(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["chunk-vendors"],{ /***/ "./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js": /*!*********************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js ***! \*********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _arrayLikeToArray; });\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js?"); /***/ }), /***/ "./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js": /*!*******************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js ***! \*******************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _arrayWithHoles; });\nfunction _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js?"); /***/ }), /***/ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js": /*!*******************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/esm/defineProperty.js ***! \*******************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _defineProperty; });\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/esm/defineProperty.js?"); /***/ }), /***/ "./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js": /*!*************************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js ***! \*************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _iterableToArrayLimit; });\n/* harmony import */ var core_js_modules_es_symbol__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.symbol */ \"./node_modules/core-js/modules/es.symbol.js\");\n/* harmony import */ var core_js_modules_es_symbol__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_es_symbol_description__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.symbol.description */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n/* harmony import */ var core_js_modules_es_symbol_description__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_description__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_es_symbol_iterator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n/* harmony import */ var core_js_modules_es_symbol_iterator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_iterator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.object.to-string */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n/* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.string.iterator */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n/* harmony import */ var core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\n/* harmony import */ var core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_5__);\n\n\n\n\n\n\nfunction _iterableToArrayLimit(arr, i) {\n if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js?"); /***/ }), /***/ "./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js": /*!********************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js ***! \********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _nonIterableRest; });\nfunction _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js?"); /***/ }), /***/ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js": /*!******************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js ***! \******************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _slicedToArray; });\n/* harmony import */ var _arrayWithHoles__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayWithHoles */ \"./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js\");\n/* harmony import */ var _iterableToArrayLimit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./iterableToArrayLimit */ \"./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js\");\n/* harmony import */ var _unsupportedIterableToArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./unsupportedIterableToArray */ \"./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js\");\n/* harmony import */ var _nonIterableRest__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./nonIterableRest */ \"./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js\");\n\n\n\n\nfunction _slicedToArray(arr, i) {\n return Object(_arrayWithHoles__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr) || Object(_iterableToArrayLimit__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(arr, i) || Object(_unsupportedIterableToArray__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(arr, i) || Object(_nonIterableRest__WEBPACK_IMPORTED_MODULE_3__[\"default\"])();\n}\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/esm/slicedToArray.js?"); /***/ }), /***/ "./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js": /*!*******************************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js ***! \*******************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _unsupportedIterableToArray; });\n/* harmony import */ var core_js_modules_es_array_from__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.from */ \"./node_modules/core-js/modules/es.array.from.js\");\n/* harmony import */ var core_js_modules_es_array_from__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_from__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.slice */ \"./node_modules/core-js/modules/es.array.slice.js\");\n/* harmony import */ var core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_slice__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_es_function_name__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.function.name */ \"./node_modules/core-js/modules/es.function.name.js\");\n/* harmony import */ var core_js_modules_es_function_name__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_function_name__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.object.to-string */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n/* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string */ \"./node_modules/core-js/modules/es.regexp.to-string.js\");\n/* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.string.iterator */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n/* harmony import */ var core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _arrayLikeToArray__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./arrayLikeToArray */ \"./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js\");\n\n\n\n\n\n\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(o, minLen);\n}\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js?"); /***/ }), /***/ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js": /*!**********************************************************************!*\ !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nmodule.exports = _interopRequireDefault;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/interopRequireDefault.js?"); /***/ }), /***/ "./node_modules/@emotion/hash/dist/hash.esm.js": /*!*****************************************************!*\ !*** ./node_modules/@emotion/hash/dist/hash.esm.js ***! \*****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* eslint-disable */\n// murmurhash2 via https://github.com/garycourt/murmurhash-js/blob/master/murmurhash2_gc.js\nfunction murmurhash2_32_gc(str) {\n var l = str.length,\n h = l ^ l,\n i = 0,\n k;\n\n while (l >= 4) {\n k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;\n k = (k & 0xffff) * 0x5bd1e995 + (((k >>> 16) * 0x5bd1e995 & 0xffff) << 16);\n k ^= k >>> 24;\n k = (k & 0xffff) * 0x5bd1e995 + (((k >>> 16) * 0x5bd1e995 & 0xffff) << 16);\n h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16) ^ k;\n l -= 4;\n ++i;\n }\n\n switch (l) {\n case 3:\n h ^= (str.charCodeAt(i + 2) & 0xff) << 16;\n\n case 2:\n h ^= (str.charCodeAt(i + 1) & 0xff) << 8;\n\n case 1:\n h ^= str.charCodeAt(i) & 0xff;\n h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16);\n }\n\n h ^= h >>> 13;\n h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16);\n h ^= h >>> 15;\n return (h >>> 0).toString(36);\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (murmurhash2_32_gc);\n\n\n//# sourceURL=webpack:///./node_modules/@emotion/hash/dist/hash.esm.js?"); /***/ }), /***/ "./node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js": /*!*******************************************************************************!*\ !*** ./node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js ***! \*******************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _emotion_memoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @emotion/memoize */ \"./node_modules/@emotion/is-prop-valid/node_modules/@emotion/memoize/dist/memoize.browser.esm.js\");\n\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = Object(_emotion_memoize__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (index);\n\n\n//# sourceURL=webpack:///./node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js?"); /***/ }), /***/ "./node_modules/@emotion/is-prop-valid/node_modules/@emotion/memoize/dist/memoize.browser.esm.js": /*!*******************************************************************************************************!*\ !*** ./node_modules/@emotion/is-prop-valid/node_modules/@emotion/memoize/dist/memoize.browser.esm.js ***! \*******************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\nfunction memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (memoize);\n\n\n//# sourceURL=webpack:///./node_modules/@emotion/is-prop-valid/node_modules/@emotion/memoize/dist/memoize.browser.esm.js?"); /***/ }), /***/ "./node_modules/@emotion/memoize/dist/memoize.esm.js": /*!***********************************************************!*\ !*** ./node_modules/@emotion/memoize/dist/memoize.esm.js ***! \***********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\nfunction memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (memoize);\n\n\n//# sourceURL=webpack:///./node_modules/@emotion/memoize/dist/memoize.esm.js?"); /***/ }), /***/ "./node_modules/@emotion/stylis/dist/stylis.esm.js": /*!*********************************************************!*\ !*** ./node_modules/@emotion/stylis/dist/stylis.esm.js ***! \*********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\nfunction stylis_min (W) {\n function M(d, c, e, h, a) {\n for (var m = 0, b = 0, v = 0, n = 0, q, g, x = 0, K = 0, k, u = k = q = 0, l = 0, r = 0, I = 0, t = 0, B = e.length, J = B - 1, y, f = '', p = '', F = '', G = '', C; l < B;) {\n g = e.charCodeAt(l);\n l === J && 0 !== b + n + v + m && (0 !== b && (g = 47 === b ? 10 : 47), n = v = m = 0, B++, J++);\n\n if (0 === b + n + v + m) {\n if (l === J && (0 < r && (f = f.replace(N, '')), 0 < f.trim().length)) {\n switch (g) {\n case 32:\n case 9:\n case 59:\n case 13:\n case 10:\n break;\n\n default:\n f += e.charAt(l);\n }\n\n g = 59;\n }\n\n switch (g) {\n case 123:\n f = f.trim();\n q = f.charCodeAt(0);\n k = 1;\n\n for (t = ++l; l < B;) {\n switch (g = e.charCodeAt(l)) {\n case 123:\n k++;\n break;\n\n case 125:\n k--;\n break;\n\n case 47:\n switch (g = e.charCodeAt(l + 1)) {\n case 42:\n case 47:\n a: {\n for (u = l + 1; u < J; ++u) {\n switch (e.charCodeAt(u)) {\n case 47:\n if (42 === g && 42 === e.charCodeAt(u - 1) && l + 2 !== u) {\n l = u + 1;\n break a;\n }\n\n break;\n\n case 10:\n if (47 === g) {\n l = u + 1;\n break a;\n }\n\n }\n }\n\n l = u;\n }\n\n }\n\n break;\n\n case 91:\n g++;\n\n case 40:\n g++;\n\n case 34:\n case 39:\n for (; l++ < J && e.charCodeAt(l) !== g;) {\n }\n\n }\n\n if (0 === k) break;\n l++;\n }\n\n k = e.substring(t, l);\n 0 === q && (q = (f = f.replace(ca, '').trim()).charCodeAt(0));\n\n switch (q) {\n case 64:\n 0 < r && (f = f.replace(N, ''));\n g = f.charCodeAt(1);\n\n switch (g) {\n case 100:\n case 109:\n case 115:\n case 45:\n r = c;\n break;\n\n default:\n r = O;\n }\n\n k = M(c, r, k, g, a + 1);\n t = k.length;\n 0 < A && (r = X(O, f, I), C = H(3, k, r, c, D, z, t, g, a, h), f = r.join(''), void 0 !== C && 0 === (t = (k = C.trim()).length) && (g = 0, k = ''));\n if (0 < t) switch (g) {\n case 115:\n f = f.replace(da, ea);\n\n case 100:\n case 109:\n case 45:\n k = f + '{' + k + '}';\n break;\n\n case 107:\n f = f.replace(fa, '$1 $2');\n k = f + '{' + k + '}';\n k = 1 === w || 2 === w && L('@' + k, 3) ? '@-webkit-' + k + '@' + k : '@' + k;\n break;\n\n default:\n k = f + k, 112 === h && (k = (p += k, ''));\n } else k = '';\n break;\n\n default:\n k = M(c, X(c, f, I), k, h, a + 1);\n }\n\n F += k;\n k = I = r = u = q = 0;\n f = '';\n g = e.charCodeAt(++l);\n break;\n\n case 125:\n case 59:\n f = (0 < r ? f.replace(N, '') : f).trim();\n if (1 < (t = f.length)) switch (0 === u && (q = f.charCodeAt(0), 45 === q || 96 < q && 123 > q) && (t = (f = f.replace(' ', ':')).length), 0 < A && void 0 !== (C = H(1, f, c, d, D, z, p.length, h, a, h)) && 0 === (t = (f = C.trim()).length) && (f = '\\x00\\x00'), q = f.charCodeAt(0), g = f.charCodeAt(1), q) {\n case 0:\n break;\n\n case 64:\n if (105 === g || 99 === g) {\n G += f + e.charAt(l);\n break;\n }\n\n default:\n 58 !== f.charCodeAt(t - 1) && (p += P(f, q, g, f.charCodeAt(2)));\n }\n I = r = u = q = 0;\n f = '';\n g = e.charCodeAt(++l);\n }\n }\n\n switch (g) {\n case 13:\n case 10:\n 47 === b ? b = 0 : 0 === 1 + q && 107 !== h && 0 < f.length && (r = 1, f += '\\x00');\n 0 < A * Y && H(0, f, c, d, D, z, p.length, h, a, h);\n z = 1;\n D++;\n break;\n\n case 59:\n case 125:\n if (0 === b + n + v + m) {\n z++;\n break;\n }\n\n default:\n z++;\n y = e.charAt(l);\n\n switch (g) {\n case 9:\n case 32:\n if (0 === n + m + b) switch (x) {\n case 44:\n case 58:\n case 9:\n case 32:\n y = '';\n break;\n\n default:\n 32 !== g && (y = ' ');\n }\n break;\n\n case 0:\n y = '\\\\0';\n break;\n\n case 12:\n y = '\\\\f';\n break;\n\n case 11:\n y = '\\\\v';\n break;\n\n case 38:\n 0 === n + b + m && (r = I = 1, y = '\\f' + y);\n break;\n\n case 108:\n if (0 === n + b + m + E && 0 < u) switch (l - u) {\n case 2:\n 112 === x && 58 === e.charCodeAt(l - 3) && (E = x);\n\n case 8:\n 111 === K && (E = K);\n }\n break;\n\n case 58:\n 0 === n + b + m && (u = l);\n break;\n\n case 44:\n 0 === b + v + n + m && (r = 1, y += '\\r');\n break;\n\n case 34:\n case 39:\n 0 === b && (n = n === g ? 0 : 0 === n ? g : n);\n break;\n\n case 91:\n 0 === n + b + v && m++;\n break;\n\n case 93:\n 0 === n + b + v && m--;\n break;\n\n case 41:\n 0 === n + b + m && v--;\n break;\n\n case 40:\n if (0 === n + b + m) {\n if (0 === q) switch (2 * x + 3 * K) {\n case 533:\n break;\n\n default:\n q = 1;\n }\n v++;\n }\n\n break;\n\n case 64:\n 0 === b + v + n + m + u + k && (k = 1);\n break;\n\n case 42:\n case 47:\n if (!(0 < n + m + v)) switch (b) {\n case 0:\n switch (2 * g + 3 * e.charCodeAt(l + 1)) {\n case 235:\n b = 47;\n break;\n\n case 220:\n t = l, b = 42;\n }\n\n break;\n\n case 42:\n 47 === g && 42 === x && t + 2 !== l && (33 === e.charCodeAt(t + 2) && (p += e.substring(t, l + 1)), y = '', b = 0);\n }\n }\n\n 0 === b && (f += y);\n }\n\n K = x;\n x = g;\n l++;\n }\n\n t = p.length;\n\n if (0 < t) {\n r = c;\n if (0 < A && (C = H(2, p, r, d, D, z, t, h, a, h), void 0 !== C && 0 === (p = C).length)) return G + p + F;\n p = r.join(',') + '{' + p + '}';\n\n if (0 !== w * E) {\n 2 !== w || L(p, 2) || (E = 0);\n\n switch (E) {\n case 111:\n p = p.replace(ha, ':-moz-$1') + p;\n break;\n\n case 112:\n p = p.replace(Q, '::-webkit-input-$1') + p.replace(Q, '::-moz-$1') + p.replace(Q, ':-ms-input-$1') + p;\n }\n\n E = 0;\n }\n }\n\n return G + p + F;\n }\n\n function X(d, c, e) {\n var h = c.trim().split(ia);\n c = h;\n var a = h.length,\n m = d.length;\n\n switch (m) {\n case 0:\n case 1:\n var b = 0;\n\n for (d = 0 === m ? '' : d[0] + ' '; b < a; ++b) {\n c[b] = Z(d, c[b], e, m).trim();\n }\n\n break;\n\n default:\n var v = b = 0;\n\n for (c = []; b < a; ++b) {\n for (var n = 0; n < m; ++n) {\n c[v++] = Z(d[n] + ' ', h[b], e, m).trim();\n }\n }\n\n }\n\n return c;\n }\n\n function Z(d, c, e) {\n var h = c.charCodeAt(0);\n 33 > h && (h = (c = c.trim()).charCodeAt(0));\n\n switch (h) {\n case 38:\n return c.replace(F, '$1' + d.trim());\n\n case 58:\n return d.trim() + c.replace(F, '$1' + d.trim());\n\n default:\n if (0 < 1 * e && 0 < c.indexOf('\\f')) return c.replace(F, (58 === d.charCodeAt(0) ? '' : '$1') + d.trim());\n }\n\n return d + c;\n }\n\n function P(d, c, e, h) {\n var a = d + ';',\n m = 2 * c + 3 * e + 4 * h;\n\n if (944 === m) {\n d = a.indexOf(':', 9) + 1;\n var b = a.substring(d, a.length - 1).trim();\n b = a.substring(0, d).trim() + b + ';';\n return 1 === w || 2 === w && L(b, 1) ? '-webkit-' + b + b : b;\n }\n\n if (0 === w || 2 === w && !L(a, 1)) return a;\n\n switch (m) {\n case 1015:\n return 97 === a.charCodeAt(10) ? '-webkit-' + a + a : a;\n\n case 951:\n return 116 === a.charCodeAt(3) ? '-webkit-' + a + a : a;\n\n case 963:\n return 110 === a.charCodeAt(5) ? '-webkit-' + a + a : a;\n\n case 1009:\n if (100 !== a.charCodeAt(4)) break;\n\n case 969:\n case 942:\n return '-webkit-' + a + a;\n\n case 978:\n return '-webkit-' + a + '-moz-' + a + a;\n\n case 1019:\n case 983:\n return '-webkit-' + a + '-moz-' + a + '-ms-' + a + a;\n\n case 883:\n if (45 === a.charCodeAt(8)) return '-webkit-' + a + a;\n if (0 < a.indexOf('image-set(', 11)) return a.replace(ja, '$1-webkit-$2') + a;\n break;\n\n case 932:\n if (45 === a.charCodeAt(4)) switch (a.charCodeAt(5)) {\n case 103:\n return '-webkit-box-' + a.replace('-grow', '') + '-webkit-' + a + '-ms-' + a.replace('grow', 'positive') + a;\n\n case 115:\n return '-webkit-' + a + '-ms-' + a.replace('shrink', 'negative') + a;\n\n case 98:\n return '-webkit-' + a + '-ms-' + a.replace('basis', 'preferred-size') + a;\n }\n return '-webkit-' + a + '-ms-' + a + a;\n\n case 964:\n return '-webkit-' + a + '-ms-flex-' + a + a;\n\n case 1023:\n if (99 !== a.charCodeAt(8)) break;\n b = a.substring(a.indexOf(':', 15)).replace('flex-', '').replace('space-between', 'justify');\n return '-webkit-box-pack' + b + '-webkit-' + a + '-ms-flex-pack' + b + a;\n\n case 1005:\n return ka.test(a) ? a.replace(aa, ':-webkit-') + a.replace(aa, ':-moz-') + a : a;\n\n case 1e3:\n b = a.substring(13).trim();\n c = b.indexOf('-') + 1;\n\n switch (b.charCodeAt(0) + b.charCodeAt(c)) {\n case 226:\n b = a.replace(G, 'tb');\n break;\n\n case 232:\n b = a.replace(G, 'tb-rl');\n break;\n\n case 220:\n b = a.replace(G, 'lr');\n break;\n\n default:\n return a;\n }\n\n return '-webkit-' + a + '-ms-' + b + a;\n\n case 1017:\n if (-1 === a.indexOf('sticky', 9)) break;\n\n case 975:\n c = (a = d).length - 10;\n b = (33 === a.charCodeAt(c) ? a.substring(0, c) : a).substring(d.indexOf(':', 7) + 1).trim();\n\n switch (m = b.charCodeAt(0) + (b.charCodeAt(7) | 0)) {\n case 203:\n if (111 > b.charCodeAt(8)) break;\n\n case 115:\n a = a.replace(b, '-webkit-' + b) + ';' + a;\n break;\n\n case 207:\n case 102:\n a = a.replace(b, '-webkit-' + (102 < m ? 'inline-' : '') + 'box') + ';' + a.replace(b, '-webkit-' + b) + ';' + a.replace(b, '-ms-' + b + 'box') + ';' + a;\n }\n\n return a + ';';\n\n case 938:\n if (45 === a.charCodeAt(5)) switch (a.charCodeAt(6)) {\n case 105:\n return b = a.replace('-items', ''), '-webkit-' + a + '-webkit-box-' + b + '-ms-flex-' + b + a;\n\n case 115:\n return '-webkit-' + a + '-ms-flex-item-' + a.replace(ba, '') + a;\n\n default:\n return '-webkit-' + a + '-ms-flex-line-pack' + a.replace('align-content', '').replace(ba, '') + a;\n }\n break;\n\n case 973:\n case 989:\n if (45 !== a.charCodeAt(3) || 122 === a.charCodeAt(4)) break;\n\n case 931:\n case 953:\n if (!0 === la.test(d)) return 115 === (b = d.substring(d.indexOf(':') + 1)).charCodeAt(0) ? P(d.replace('stretch', 'fill-available'), c, e, h).replace(':fill-available', ':stretch') : a.replace(b, '-webkit-' + b) + a.replace(b, '-moz-' + b.replace('fill-', '')) + a;\n break;\n\n case 962:\n if (a = '-webkit-' + a + (102 === a.charCodeAt(5) ? '-ms-' + a : '') + a, 211 === e + h && 105 === a.charCodeAt(13) && 0 < a.indexOf('transform', 10)) return a.substring(0, a.indexOf(';', 27) + 1).replace(ma, '$1-webkit-$2') + a;\n }\n\n return a;\n }\n\n function L(d, c) {\n var e = d.indexOf(1 === c ? ':' : '{'),\n h = d.substring(0, 3 !== c ? e : 10);\n e = d.substring(e + 1, d.length - 1);\n return R(2 !== c ? h : h.replace(na, '$1'), e, c);\n }\n\n function ea(d, c) {\n var e = P(c, c.charCodeAt(0), c.charCodeAt(1), c.charCodeAt(2));\n return e !== c + ';' ? e.replace(oa, ' or ($1)').substring(4) : '(' + c + ')';\n }\n\n function H(d, c, e, h, a, m, b, v, n, q) {\n for (var g = 0, x = c, w; g < A; ++g) {\n switch (w = S[g].call(B, d, x, e, h, a, m, b, v, n, q)) {\n case void 0:\n case !1:\n case !0:\n case null:\n break;\n\n default:\n x = w;\n }\n }\n\n if (x !== c) return x;\n }\n\n function T(d) {\n switch (d) {\n case void 0:\n case null:\n A = S.length = 0;\n break;\n\n default:\n switch (d.constructor) {\n case Array:\n for (var c = 0, e = d.length; c < e; ++c) {\n T(d[c]);\n }\n\n break;\n\n case Function:\n S[A++] = d;\n break;\n\n case Boolean:\n Y = !!d | 0;\n }\n\n }\n\n return T;\n }\n\n function U(d) {\n d = d.prefix;\n void 0 !== d && (R = null, d ? 'function' !== typeof d ? w = 1 : (w = 2, R = d) : w = 0);\n return U;\n }\n\n function B(d, c) {\n var e = d;\n 33 > e.charCodeAt(0) && (e = e.trim());\n V = e;\n e = [V];\n\n if (0 < A) {\n var h = H(-1, c, e, e, D, z, 0, 0, 0, 0);\n void 0 !== h && 'string' === typeof h && (c = h);\n }\n\n var a = M(O, e, c, 0, 0);\n 0 < A && (h = H(-2, a, e, e, D, z, a.length, 0, 0, 0), void 0 !== h && (a = h));\n V = '';\n E = 0;\n z = D = 1;\n return a;\n }\n\n var ca = /^\\0+/g,\n N = /[\\0\\r\\f]/g,\n aa = /: */g,\n ka = /zoo|gra/,\n ma = /([,: ])(transform)/g,\n ia = /,\\r+?/g,\n F = /([\\t\\r\\n ])*\\f?&/g,\n fa = /@(k\\w+)\\s*(\\S*)\\s*/,\n Q = /::(place)/g,\n ha = /:(read-only)/g,\n G = /[svh]\\w+-[tblr]{2}/,\n da = /\\(\\s*(.*)\\s*\\)/g,\n oa = /([\\s\\S]*?);/g,\n ba = /-self|flex-/g,\n na = /[^]*?(:[rp][el]a[\\w-]+)[^]*/,\n la = /stretch|:\\s*\\w+\\-(?:conte|avail)/,\n ja = /([^-])(image-set\\()/,\n z = 1,\n D = 1,\n E = 0,\n w = 1,\n O = [],\n S = [],\n A = 0,\n R = null,\n Y = 0,\n V = '';\n B.use = T;\n B.set = U;\n void 0 !== W && U(W);\n return B;\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (stylis_min);\n\n\n//# sourceURL=webpack:///./node_modules/@emotion/stylis/dist/stylis.esm.js?"); /***/ }), /***/ "./node_modules/@emotion/unitless/dist/unitless.esm.js": /*!*************************************************************!*\ !*** ./node_modules/@emotion/unitless/dist/unitless.esm.js ***! \*************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\nvar unitlessKeys = {\n animationIterationCount: 1,\n borderImageOutset: 1,\n borderImageSlice: 1,\n borderImageWidth: 1,\n boxFlex: 1,\n boxFlexGroup: 1,\n boxOrdinalGroup: 1,\n columnCount: 1,\n columns: 1,\n flex: 1,\n flexGrow: 1,\n flexPositive: 1,\n flexShrink: 1,\n flexNegative: 1,\n flexOrder: 1,\n gridRow: 1,\n gridRowEnd: 1,\n gridRowSpan: 1,\n gridRowStart: 1,\n gridColumn: 1,\n gridColumnEnd: 1,\n gridColumnSpan: 1,\n gridColumnStart: 1,\n fontWeight: 1,\n lineHeight: 1,\n opacity: 1,\n order: 1,\n orphans: 1,\n tabSize: 1,\n widows: 1,\n zIndex: 1,\n zoom: 1,\n WebkitLineClamp: 1,\n // SVG-related properties\n fillOpacity: 1,\n floodOpacity: 1,\n stopOpacity: 1,\n strokeDasharray: 1,\n strokeDashoffset: 1,\n strokeMiterlimit: 1,\n strokeOpacity: 1,\n strokeWidth: 1\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (unitlessKeys);\n\n\n//# sourceURL=webpack:///./node_modules/@emotion/unitless/dist/unitless.esm.js?"); /***/ }), /***/ "./node_modules/@icons/material/CheckIcon.js": /*!***************************************************!*\ !*** ./node_modules/@icons/material/CheckIcon.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _react = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nvar DEFAULT_SIZE = 24;\n\nexports.default = function (_ref) {\n var _ref$fill = _ref.fill,\n fill = _ref$fill === undefined ? 'currentColor' : _ref$fill,\n _ref$width = _ref.width,\n width = _ref$width === undefined ? DEFAULT_SIZE : _ref$width,\n _ref$height = _ref.height,\n height = _ref$height === undefined ? DEFAULT_SIZE : _ref$height,\n _ref$style = _ref.style,\n style = _ref$style === undefined ? {} : _ref$style,\n props = _objectWithoutProperties(_ref, ['fill', 'width', 'height', 'style']);\n\n return _react2.default.createElement(\n 'svg',\n _extends({\n viewBox: '0 0 ' + DEFAULT_SIZE + ' ' + DEFAULT_SIZE,\n style: _extends({ fill: fill, width: width, height: height }, style)\n }, props),\n _react2.default.createElement('path', { d: 'M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z' })\n );\n};\n\n//# sourceURL=webpack:///./node_modules/@icons/material/CheckIcon.js?"); /***/ }), /***/ "./node_modules/@icons/material/UnfoldMoreHorizontalIcon.js": /*!******************************************************************!*\ !*** ./node_modules/@icons/material/UnfoldMoreHorizontalIcon.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _react = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nvar DEFAULT_SIZE = 24;\n\nexports.default = function (_ref) {\n var _ref$fill = _ref.fill,\n fill = _ref$fill === undefined ? 'currentColor' : _ref$fill,\n _ref$width = _ref.width,\n width = _ref$width === undefined ? DEFAULT_SIZE : _ref$width,\n _ref$height = _ref.height,\n height = _ref$height === undefined ? DEFAULT_SIZE : _ref$height,\n _ref$style = _ref.style,\n style = _ref$style === undefined ? {} : _ref$style,\n props = _objectWithoutProperties(_ref, ['fill', 'width', 'height', 'style']);\n\n return _react2.default.createElement(\n 'svg',\n _extends({\n viewBox: '0 0 ' + DEFAULT_SIZE + ' ' + DEFAULT_SIZE,\n style: _extends({ fill: fill, width: width, height: height }, style)\n }, props),\n _react2.default.createElement('path', { d: 'M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z' })\n );\n};\n\n//# sourceURL=webpack:///./node_modules/@icons/material/UnfoldMoreHorizontalIcon.js?"); /***/ }), /***/ "./node_modules/@plotly/draft-js-export-html/lib/helpers/combineOrderedStyles.js": /*!***************************************************************************************!*\ !*** ./node_modules/@plotly/draft-js-export-html/lib/helpers/combineOrderedStyles.js ***! \***************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction combineOrderedStyles(customMap, defaults) {\n if (customMap == null) {\n return defaults;\n }\n\n var _defaults = _slicedToArray(defaults, 2),\n defaultStyleMap = _defaults[0],\n defaultStyleOrder = _defaults[1];\n\n var styleMap = _extends({}, defaultStyleMap);\n var styleOrder = [].concat(_toConsumableArray(defaultStyleOrder));\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = Object.keys(customMap)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _styleName = _step.value;\n\n if (defaultStyleMap.hasOwnProperty(_styleName)) {\n var defaultStyles = defaultStyleMap[_styleName];\n styleMap[_styleName] = _extends({}, defaultStyles, customMap[_styleName]);\n } else {\n styleMap[_styleName] = customMap[_styleName];\n styleOrder.push(_styleName);\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return [styleMap, styleOrder];\n}\n\nexports.default = combineOrderedStyles;\n\n//# sourceURL=webpack:///./node_modules/@plotly/draft-js-export-html/lib/helpers/combineOrderedStyles.js?"); /***/ }), /***/ "./node_modules/@plotly/draft-js-export-html/lib/helpers/normalizeAttributes.js": /*!**************************************************************************************!*\ !*** ./node_modules/@plotly/draft-js-export-html/lib/helpers/normalizeAttributes.js ***! \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\n\n// Lifted from: https://github.com/facebook/react/blob/master/src/renderers/dom/shared/HTMLDOMPropertyConfig.js\nvar ATTR_NAME_MAP = {\n acceptCharset: 'accept-charset',\n className: 'class',\n htmlFor: 'for',\n httpEquiv: 'http-equiv'\n};\n\nfunction normalizeAttributes(attributes) {\n if (attributes == null) {\n return attributes;\n }\n var normalized = {};\n var didNormalize = false;\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = Object.keys(attributes)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var name = _step.value;\n\n var newName = name;\n if (ATTR_NAME_MAP.hasOwnProperty(name)) {\n newName = ATTR_NAME_MAP[name];\n didNormalize = true;\n }\n normalized[newName] = attributes[name];\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return didNormalize ? normalized : attributes;\n}\n\nexports.default = normalizeAttributes;\n\n//# sourceURL=webpack:///./node_modules/@plotly/draft-js-export-html/lib/helpers/normalizeAttributes.js?"); /***/ }), /***/ "./node_modules/@plotly/draft-js-export-html/lib/helpers/styleToCSS.js": /*!*****************************************************************************!*\ !*** ./node_modules/@plotly/draft-js-export-html/lib/helpers/styleToCSS.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\n\nvar VENDOR_PREFIX = /^(moz|ms|o|webkit)-/;\n\nvar NUMERIC_STRING = /^\\d+$/;\nvar UPPERCASE_PATTERN = /([A-Z])/g;\n\n// Lifted from:\n// https://github.com/facebook/react/blob/ab4ddf64939aebbbc8d31be1022efd56e834c95c/src/renderers/dom/shared/CSSProperty.js\nvar isUnitlessNumber = {\n animationIterationCount: true,\n borderImageOutset: true,\n borderImageSlice: true,\n borderImageWidth: true,\n boxFlex: true,\n boxFlexGroup: true,\n boxOrdinalGroup: true,\n columnCount: true,\n flex: true,\n flexGrow: true,\n flexPositive: true,\n flexShrink: true,\n flexNegative: true,\n flexOrder: true,\n gridRow: true,\n gridRowEnd: true,\n gridRowSpan: true,\n gridRowStart: true,\n gridColumn: true,\n gridColumnEnd: true,\n gridColumnSpan: true,\n gridColumnStart: true,\n fontWeight: true,\n lineClamp: true,\n lineHeight: true,\n opacity: true,\n order: true,\n orphans: true,\n tabSize: true,\n widows: true,\n zIndex: true,\n zoom: true,\n // SVG-related properties\n fillOpacity: true,\n floodOpacity: true,\n stopOpacity: true,\n strokeDasharray: true,\n strokeDashoffset: true,\n strokeMiterlimit: true,\n strokeOpacity: true,\n strokeWidth: true\n};\n\n// Lifted from: https://github.com/facebook/react/blob/master/src/renderers/dom/shared/CSSPropertyOperations.js\nfunction processStyleName(name) {\n return name.replace(UPPERCASE_PATTERN, '-$1').toLowerCase().replace(VENDOR_PREFIX, '-$1-');\n}\n\n// Lifted from: https://github.com/facebook/react/blob/master/src/renderers/dom/shared/dangerousStyleValue.js\nfunction processStyleValue(name, value) {\n var isNumeric = void 0;\n if (typeof value === 'string') {\n isNumeric = NUMERIC_STRING.test(value);\n } else {\n isNumeric = true;\n value = String(value);\n }\n if (!isNumeric || value === '0' || isUnitlessNumber[name] === true) {\n return value;\n } else {\n return value + 'px';\n }\n}\n\nfunction styleToCSS(styleDescr) {\n return Object.keys(styleDescr).map(function (name) {\n var styleValue = processStyleValue(name, styleDescr[name]);\n var styleName = processStyleName(name);\n return styleName + ': ' + styleValue;\n }).join('; ');\n}\n\nexports.default = styleToCSS;\n\n//# sourceURL=webpack:///./node_modules/@plotly/draft-js-export-html/lib/helpers/styleToCSS.js?"); /***/ }), /***/ "./node_modules/@plotly/draft-js-export-html/lib/main.js": /*!***************************************************************!*\ !*** ./node_modules/@plotly/draft-js-export-html/lib/main.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _stateToHTML = __webpack_require__(/*! ./stateToHTML */ \"./node_modules/@plotly/draft-js-export-html/lib/stateToHTML.js\");\n\nObject.defineProperty(exports, 'stateToHTML', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_stateToHTML).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n//# sourceURL=webpack:///./node_modules/@plotly/draft-js-export-html/lib/main.js?"); /***/ }), /***/ "./node_modules/@plotly/draft-js-export-html/lib/stateToHTML.js": /*!**********************************************************************!*\ !*** ./node_modules/@plotly/draft-js-export-html/lib/stateToHTML.js ***! \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _DEFAULT_STYLE_MAP, _ENTITY_ATTR_MAP, _DATA_TO_ATTR;\n\nexports.default = stateToHTML;\n\nvar _combineOrderedStyles3 = __webpack_require__(/*! ./helpers/combineOrderedStyles */ \"./node_modules/@plotly/draft-js-export-html/lib/helpers/combineOrderedStyles.js\");\n\nvar _combineOrderedStyles4 = _interopRequireDefault(_combineOrderedStyles3);\n\nvar _normalizeAttributes = __webpack_require__(/*! ./helpers/normalizeAttributes */ \"./node_modules/@plotly/draft-js-export-html/lib/helpers/normalizeAttributes.js\");\n\nvar _normalizeAttributes2 = _interopRequireDefault(_normalizeAttributes);\n\nvar _styleToCSS = __webpack_require__(/*! ./helpers/styleToCSS */ \"./node_modules/@plotly/draft-js-export-html/lib/helpers/styleToCSS.js\");\n\nvar _styleToCSS2 = _interopRequireDefault(_styleToCSS);\n\nvar _draftJsUtils = __webpack_require__(/*! draft-js-utils */ \"./node_modules/draft-js-utils/esm/main.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar BOLD = _draftJsUtils.INLINE_STYLE.BOLD,\n CODE = _draftJsUtils.INLINE_STYLE.CODE,\n ITALIC = _draftJsUtils.INLINE_STYLE.ITALIC,\n STRIKETHROUGH = _draftJsUtils.INLINE_STYLE.STRIKETHROUGH,\n UNDERLINE = _draftJsUtils.INLINE_STYLE.UNDERLINE;\n\n\nvar INDENT = ' ';\nvar BREAK = '
';\nvar DATA_ATTRIBUTE = /^data-([a-z0-9-]+)$/;\n\nvar DEFAULT_STYLE_MAP = (_DEFAULT_STYLE_MAP = {}, _defineProperty(_DEFAULT_STYLE_MAP, BOLD, { element: 'strong' }), _defineProperty(_DEFAULT_STYLE_MAP, CODE, { element: 'code' }), _defineProperty(_DEFAULT_STYLE_MAP, ITALIC, { element: 'em' }), _defineProperty(_DEFAULT_STYLE_MAP, STRIKETHROUGH, { element: 'del' }), _defineProperty(_DEFAULT_STYLE_MAP, UNDERLINE, { element: 'u' }), _DEFAULT_STYLE_MAP);\n\n// Order: inner-most style to outer-most.\n// Examle: foo\nvar DEFAULT_STYLE_ORDER = [BOLD, ITALIC, UNDERLINE, STRIKETHROUGH, CODE];\n\n// Map entity data to element attributes.\nvar ENTITY_ATTR_MAP = (_ENTITY_ATTR_MAP = {}, _defineProperty(_ENTITY_ATTR_MAP, _draftJsUtils.ENTITY_TYPE.LINK, {\n url: 'href',\n href: 'href',\n rel: 'rel',\n target: 'target',\n title: 'title',\n className: 'class'\n}), _defineProperty(_ENTITY_ATTR_MAP, _draftJsUtils.ENTITY_TYPE.IMAGE, {\n src: 'src',\n height: 'height',\n width: 'width',\n alt: 'alt',\n className: 'class'\n}), _ENTITY_ATTR_MAP);\n\n// Map entity data to element attributes.\nvar DATA_TO_ATTR = (_DATA_TO_ATTR = {}, _defineProperty(_DATA_TO_ATTR, _draftJsUtils.ENTITY_TYPE.LINK, function (entityType, entity) {\n var attrMap = ENTITY_ATTR_MAP.hasOwnProperty(entityType) ? ENTITY_ATTR_MAP[entityType] : {};\n var data = entity.getData();\n var attrs = {};\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = Object.keys(data)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var dataKey = _step.value;\n\n var dataValue = data[dataKey];\n if (attrMap.hasOwnProperty(dataKey)) {\n var attrKey = attrMap[dataKey];\n attrs[attrKey] = dataValue;\n } else if (DATA_ATTRIBUTE.test(dataKey)) {\n attrs[dataKey] = dataValue;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return attrs;\n}), _defineProperty(_DATA_TO_ATTR, _draftJsUtils.ENTITY_TYPE.IMAGE, function (entityType, entity) {\n var attrMap = ENTITY_ATTR_MAP.hasOwnProperty(entityType) ? ENTITY_ATTR_MAP[entityType] : {};\n var data = entity.getData();\n var attrs = {};\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = Object.keys(data)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var dataKey = _step2.value;\n\n var dataValue = data[dataKey];\n if (attrMap.hasOwnProperty(dataKey)) {\n var attrKey = attrMap[dataKey];\n attrs[attrKey] = dataValue;\n } else if (DATA_ATTRIBUTE.test(dataKey)) {\n attrs[dataKey] = dataValue;\n }\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n\n return attrs;\n}), _DATA_TO_ATTR);\n\n// The reason this returns an array is because a single block might get wrapped\n// in two tags.\nfunction getTags(blockType, defaultBlockTag) {\n switch (blockType) {\n case _draftJsUtils.BLOCK_TYPE.HEADER_ONE:\n return ['h1'];\n case _draftJsUtils.BLOCK_TYPE.HEADER_TWO:\n return ['h2'];\n case _draftJsUtils.BLOCK_TYPE.HEADER_THREE:\n return ['h3'];\n case _draftJsUtils.BLOCK_TYPE.HEADER_FOUR:\n return ['h4'];\n case _draftJsUtils.BLOCK_TYPE.HEADER_FIVE:\n return ['h5'];\n case _draftJsUtils.BLOCK_TYPE.HEADER_SIX:\n return ['h6'];\n case _draftJsUtils.BLOCK_TYPE.UNORDERED_LIST_ITEM:\n case _draftJsUtils.BLOCK_TYPE.ORDERED_LIST_ITEM:\n return ['li'];\n case _draftJsUtils.BLOCK_TYPE.BLOCKQUOTE:\n return ['blockquote'];\n case _draftJsUtils.BLOCK_TYPE.CODE:\n return ['pre', 'code'];\n case _draftJsUtils.BLOCK_TYPE.ATOMIC:\n return ['figure'];\n default:\n if (defaultBlockTag === null) {\n return [];\n }\n return [defaultBlockTag || 'p'];\n }\n}\n\nfunction getWrapperTag(blockType) {\n switch (blockType) {\n case _draftJsUtils.BLOCK_TYPE.UNORDERED_LIST_ITEM:\n return 'ul';\n case _draftJsUtils.BLOCK_TYPE.ORDERED_LIST_ITEM:\n return 'ol';\n default:\n return null;\n }\n}\n\nvar MarkupGenerator = function () {\n // These are related to state.\n function MarkupGenerator(contentState, options) {\n _classCallCheck(this, MarkupGenerator);\n\n if (options == null) {\n options = {};\n }\n this.contentState = contentState;\n this.options = options;\n\n var _combineOrderedStyles = (0, _combineOrderedStyles4.default)(options.inlineStyles, [DEFAULT_STYLE_MAP, DEFAULT_STYLE_ORDER]),\n _combineOrderedStyles2 = _slicedToArray(_combineOrderedStyles, 2),\n inlineStyles = _combineOrderedStyles2[0],\n styleOrder = _combineOrderedStyles2[1];\n\n this.inlineStyles = inlineStyles;\n this.styleOrder = styleOrder;\n }\n // These are related to user-defined options.\n\n\n _createClass(MarkupGenerator, [{\n key: 'generate',\n value: function generate() {\n this.output = [];\n this.blocks = this.contentState.getBlocksAsArray();\n this.totalBlocks = this.blocks.length;\n this.currentBlock = 0;\n this.indentLevel = 0;\n this.wrapperTag = null;\n while (this.currentBlock < this.totalBlocks) {\n this.processBlock();\n }\n this.closeWrapperTag();\n return this.output.join('').trim();\n }\n }, {\n key: 'processBlock',\n value: function processBlock() {\n var _options = this.options,\n blockRenderers = _options.blockRenderers,\n defaultBlockTag = _options.defaultBlockTag;\n\n var block = this.blocks[this.currentBlock];\n var blockType = block.getType();\n var newWrapperTag = getWrapperTag(blockType);\n if (this.wrapperTag !== newWrapperTag) {\n if (this.wrapperTag) {\n this.closeWrapperTag();\n }\n if (newWrapperTag) {\n this.openWrapperTag(newWrapperTag);\n }\n }\n this.indent();\n // Allow blocks to be rendered using a custom renderer.\n var customRenderer = blockRenderers != null && blockRenderers.hasOwnProperty(blockType) ? blockRenderers[blockType] : null;\n var customRendererOutput = customRenderer ? customRenderer(block) : null;\n // Renderer can return null, which will cause processing to continue as normal.\n if (customRendererOutput != null) {\n this.output.push(customRendererOutput);\n this.output.push('\\n');\n this.currentBlock += 1;\n return;\n }\n this.writeStartTag(block, defaultBlockTag);\n this.output.push(this.renderBlockContent(block));\n // Look ahead and see if we will nest list.\n var nextBlock = this.getNextBlock();\n if (canHaveDepth(blockType) && nextBlock && nextBlock.getDepth() === block.getDepth() + 1) {\n this.output.push('\\n');\n // This is a litle hacky: temporarily stash our current wrapperTag and\n // render child list(s).\n var thisWrapperTag = this.wrapperTag;\n this.wrapperTag = null;\n this.indentLevel += 1;\n this.currentBlock += 1;\n this.processBlocksAtDepth(nextBlock.getDepth());\n this.wrapperTag = thisWrapperTag;\n this.indentLevel -= 1;\n this.indent();\n } else {\n this.currentBlock += 1;\n }\n this.writeEndTag(block, defaultBlockTag);\n }\n }, {\n key: 'processBlocksAtDepth',\n value: function processBlocksAtDepth(depth) {\n var block = this.blocks[this.currentBlock];\n while (block && block.getDepth() === depth) {\n this.processBlock();\n block = this.blocks[this.currentBlock];\n }\n this.closeWrapperTag();\n }\n }, {\n key: 'getNextBlock',\n value: function getNextBlock() {\n return this.blocks[this.currentBlock + 1];\n }\n }, {\n key: 'writeStartTag',\n value: function writeStartTag(block, defaultBlockTag) {\n var tags = getTags(block.getType(), defaultBlockTag);\n\n var attrString = void 0;\n if (this.options.blockStyleFn) {\n var _ref = this.options.blockStyleFn(block) || {},\n _attributes = _ref.attributes,\n _style = _ref.style;\n // Normalize `className` -> `class`, etc.\n\n\n _attributes = (0, _normalizeAttributes2.default)(_attributes);\n if (_style != null) {\n var styleAttr = (0, _styleToCSS2.default)(_style);\n _attributes = _attributes == null ? { style: styleAttr } : _extends({}, _attributes, { style: styleAttr });\n }\n attrString = stringifyAttrs(_attributes);\n } else {\n attrString = '';\n }\n\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = tags[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var tag = _step3.value;\n\n this.output.push('<' + tag + attrString + '>');\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3.return) {\n _iterator3.return();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n }\n }, {\n key: 'writeEndTag',\n value: function writeEndTag(block, defaultBlockTag) {\n var tags = getTags(block.getType(), defaultBlockTag);\n if (tags.length === 1) {\n this.output.push('\\n');\n } else {\n var output = [];\n var _iteratorNormalCompletion4 = true;\n var _didIteratorError4 = false;\n var _iteratorError4 = undefined;\n\n try {\n for (var _iterator4 = tags[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {\n var tag = _step4.value;\n\n output.unshift('');\n }\n } catch (err) {\n _didIteratorError4 = true;\n _iteratorError4 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion4 && _iterator4.return) {\n _iterator4.return();\n }\n } finally {\n if (_didIteratorError4) {\n throw _iteratorError4;\n }\n }\n }\n\n this.output.push(output.join('') + '\\n');\n }\n }\n }, {\n key: 'openWrapperTag',\n value: function openWrapperTag(wrapperTag) {\n this.wrapperTag = wrapperTag;\n this.indent();\n this.output.push('<' + wrapperTag + '>\\n');\n this.indentLevel += 1;\n }\n }, {\n key: 'closeWrapperTag',\n value: function closeWrapperTag() {\n var wrapperTag = this.wrapperTag;\n\n if (wrapperTag) {\n this.indentLevel -= 1;\n this.indent();\n this.output.push('\\n');\n this.wrapperTag = null;\n }\n }\n }, {\n key: 'indent',\n value: function indent() {\n this.output.push(INDENT.repeat(this.indentLevel));\n }\n }, {\n key: 'renderBlockContent',\n value: function renderBlockContent(block) {\n var _this = this;\n\n var blockType = block.getType();\n var text = block.getText();\n if (text === '') {\n // Prevent element collapse if completely empty.\n return BREAK;\n }\n text = this.preserveWhitespace(text);\n var charMetaList = block.getCharacterList();\n var entityPieces = (0, _draftJsUtils.getEntityRanges)(text, charMetaList);\n return entityPieces.map(function (_ref2) {\n var _ref3 = _slicedToArray(_ref2, 2),\n entityKey = _ref3[0],\n stylePieces = _ref3[1];\n\n var content = stylePieces.map(function (_ref4) {\n var _ref5 = _slicedToArray(_ref4, 2),\n text = _ref5[0],\n styleSet = _ref5[1];\n\n var content = encodeContent(text);\n var _iteratorNormalCompletion5 = true;\n var _didIteratorError5 = false;\n var _iteratorError5 = undefined;\n\n try {\n for (var _iterator5 = _this.styleOrder[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {\n var _styleName = _step5.value;\n\n // If our block type is CODE then don't wrap inline code elements.\n if (_styleName === CODE && blockType === _draftJsUtils.BLOCK_TYPE.CODE) {\n continue;\n }\n if (styleSet.has(_styleName)) {\n var _inlineStyles$_styleN = _this.inlineStyles[_styleName],\n _element = _inlineStyles$_styleN.element,\n _attributes2 = _inlineStyles$_styleN.attributes,\n _style2 = _inlineStyles$_styleN.style;\n\n if (_element == null) {\n _element = 'span';\n }\n // Normalize `className` -> `class`, etc.\n _attributes2 = (0, _normalizeAttributes2.default)(_attributes2);\n if (_style2 != null) {\n var styleAttr = (0, _styleToCSS2.default)(_style2);\n _attributes2 = _attributes2 == null ? { style: styleAttr } : _extends({}, _attributes2, { style: styleAttr });\n }\n var attrString = stringifyAttrs(_attributes2);\n content = '<' + _element + attrString + '>' + content + '';\n }\n }\n } catch (err) {\n _didIteratorError5 = true;\n _iteratorError5 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion5 && _iterator5.return) {\n _iterator5.return();\n }\n } finally {\n if (_didIteratorError5) {\n throw _iteratorError5;\n }\n }\n }\n\n return content;\n }).join('');\n var entity = entityKey ? _this.contentState.getEntity(entityKey) : null;\n // Note: The `toUpperCase` below is for compatability with some libraries that use lower-case for image blocks.\n var entityType = entity == null ? null : entity.getType().toUpperCase();\n var entityStyle = void 0;\n if (entity != null && _this.options.entityStyleFn && (entityStyle = _this.options.entityStyleFn(entity))) {\n var _entityStyle = entityStyle,\n _element2 = _entityStyle.element,\n _attributes3 = _entityStyle.attributes,\n _style3 = _entityStyle.style;\n\n if (_element2 == null) {\n _element2 = 'span';\n }\n // Normalize `className` -> `class`, etc.\n _attributes3 = (0, _normalizeAttributes2.default)(_attributes3);\n if (_style3 != null) {\n var styleAttr = (0, _styleToCSS2.default)(_style3);\n _attributes3 = _attributes3 == null ? { style: styleAttr } : _extends({}, _attributes3, { style: styleAttr });\n }\n var attrString = stringifyAttrs(_attributes3);\n return '<' + _element2 + attrString + '>' + content + '';\n } else if (entityType != null && entityType === _draftJsUtils.ENTITY_TYPE.LINK) {\n var attrs = DATA_TO_ATTR.hasOwnProperty(entityType) ? DATA_TO_ATTR[entityType](entityType, entity) : null;\n var _attrString = stringifyAttrs(attrs);\n return '' + content + '';\n } else if (entityType != null && entityType === _draftJsUtils.ENTITY_TYPE.IMAGE) {\n var _attrs = DATA_TO_ATTR.hasOwnProperty(entityType) ? DATA_TO_ATTR[entityType](entityType, entity) : null;\n var _attrString2 = stringifyAttrs(_attrs);\n return '';\n } else {\n return content;\n }\n }).join('');\n }\n }, {\n key: 'preserveWhitespace',\n value: function preserveWhitespace(text) {\n var length = text.length;\n // Prevent leading/trailing/consecutive whitespace collapse.\n var newText = new Array(length);\n for (var i = 0; i < length; i++) {\n if (text[i] === ' ' && (i === 0 || i === length - 1 || text[i - 1] === ' ')) {\n newText[i] = '\\xA0';\n } else {\n newText[i] = text[i];\n }\n }\n return newText.join('');\n }\n }]);\n\n return MarkupGenerator;\n}();\n\nfunction stringifyAttrs(attrs) {\n if (attrs == null) {\n return '';\n }\n var parts = [];\n var _iteratorNormalCompletion6 = true;\n var _didIteratorError6 = false;\n var _iteratorError6 = undefined;\n\n try {\n for (var _iterator6 = Object.keys(attrs)[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) {\n var name = _step6.value;\n\n var value = attrs[name];\n if (value != null) {\n parts.push(' ' + name + '=\"' + encodeAttr(value + '') + '\"');\n }\n }\n } catch (err) {\n _didIteratorError6 = true;\n _iteratorError6 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion6 && _iterator6.return) {\n _iterator6.return();\n }\n } finally {\n if (_didIteratorError6) {\n throw _iteratorError6;\n }\n }\n }\n\n return parts.join('');\n}\n\nfunction canHaveDepth(blockType) {\n switch (blockType) {\n case _draftJsUtils.BLOCK_TYPE.UNORDERED_LIST_ITEM:\n case _draftJsUtils.BLOCK_TYPE.ORDERED_LIST_ITEM:\n return true;\n default:\n return false;\n }\n}\n\nfunction encodeContent(text) {\n return text.split('&').join('&').split('<').join('<').split('>').join('>').split('\\xA0').join(' ').split('\\n').join(BREAK + '\\n');\n}\n\nfunction encodeAttr(text) {\n return text.split('&').join('&').split('<').join('<').split('>').join('>').split('\"').join('"');\n}\n\nfunction stateToHTML(content, options) {\n return new MarkupGenerator(content, options).generate();\n}\n\n//# sourceURL=webpack:///./node_modules/@plotly/draft-js-export-html/lib/stateToHTML.js?"); /***/ }), /***/ "./node_modules/attr-accept/dist/index.js": /*!************************************************!*\ !*** ./node_modules/attr-accept/dist/index.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("module.exports=function(e){function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}var t={};return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\"a\",t),t},r.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},r.p=\"\",r(r.s=0)}([function(e,r,t){\"use strict\";r.__esModule=!0,r.default=function(e,r){if(e&&r){var t=Array.isArray(r)?r:r.split(\",\"),n=e.name||\"\",o=e.type||\"\",u=o.replace(/\\/.*$/,\"\");return t.some(function(e){var r=e.trim();return\".\"===r.charAt(0)?n.toLowerCase().endsWith(r.toLowerCase()):r.endsWith(\"/*\")?u===r.replace(/\\/.*$/,\"\"):o===r})}return!0}}]);\n\n//# sourceURL=webpack:///./node_modules/attr-accept/dist/index.js?"); /***/ }), /***/ "./node_modules/classnames/index.js": /*!******************************************!*\ !*** ./node_modules/classnames/index.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n Copyright (c) 2017 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg) && arg.length) {\n\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\tif (inner) {\n\t\t\t\t\tclasses.push(inner);\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif ( true && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (true) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\t!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n\t\t\treturn classNames;\n\t\t}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t} else {}\n}());\n\n\n//# sourceURL=webpack:///./node_modules/classnames/index.js?"); /***/ }), /***/ "./node_modules/clsx/dist/clsx.m.js": /*!******************************************!*\ !*** ./node_modules/clsx/dist/clsx.m.js ***! \******************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\nfunction toVal(mix) {\n\tvar k, y, str='';\n\n\tif (typeof mix === 'string' || typeof mix === 'number') {\n\t\tstr += mix;\n\t} else if (typeof mix === 'object') {\n\t\tif (Array.isArray(mix)) {\n\t\t\tfor (k=0; k < mix.length; k++) {\n\t\t\t\tif (mix[k]) {\n\t\t\t\t\tif (y = toVal(mix[k])) {\n\t\t\t\t\t\tstr && (str += ' ');\n\t\t\t\t\t\tstr += y;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor (k in mix) {\n\t\t\t\tif (mix[k]) {\n\t\t\t\t\tstr && (str += ' ');\n\t\t\t\t\tstr += k;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn str;\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function () {\n\tvar i=0, tmp, x, str='';\n\twhile (i < arguments.length) {\n\t\tif (tmp = arguments[i++]) {\n\t\t\tif (x = toVal(tmp)) {\n\t\t\t\tstr && (str += ' ');\n\t\t\t\tstr += x\n\t\t\t}\n\t\t}\n\t}\n\treturn str;\n});\n\n\n//# sourceURL=webpack:///./node_modules/clsx/dist/clsx.m.js?"); /***/ }), /***/ "./node_modules/codemirror/addon/hint/show-hint.css": /*!**********************************************************!*\ !*** ./node_modules/codemirror/addon/hint/show-hint.css ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("// style-loader: Adds some css to the DOM by adding a plotly-logomark'\n }\n};\n\n},{}],709:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\n/**\n * Determine the position anchor property of x/y xanchor/yanchor components.\n *\n * - values < 1/3 align the low side at that fraction,\n * - values [1/3, 2/3] align the center at that fraction,\n * - values > 2/3 align the right at that fraction.\n */\n\n\nexports.isLeftAnchor = function isLeftAnchor(opts) {\n return (\n opts.xanchor === 'left' ||\n (opts.xanchor === 'auto' && opts.x <= 1 / 3)\n );\n};\n\nexports.isCenterAnchor = function isCenterAnchor(opts) {\n return (\n opts.xanchor === 'center' ||\n (opts.xanchor === 'auto' && opts.x > 1 / 3 && opts.x < 2 / 3)\n );\n};\n\nexports.isRightAnchor = function isRightAnchor(opts) {\n return (\n opts.xanchor === 'right' ||\n (opts.xanchor === 'auto' && opts.x >= 2 / 3)\n );\n};\n\nexports.isTopAnchor = function isTopAnchor(opts) {\n return (\n opts.yanchor === 'top' ||\n (opts.yanchor === 'auto' && opts.y >= 2 / 3)\n );\n};\n\nexports.isMiddleAnchor = function isMiddleAnchor(opts) {\n return (\n opts.yanchor === 'middle' ||\n (opts.yanchor === 'auto' && opts.y > 1 / 3 && opts.y < 2 / 3)\n );\n};\n\nexports.isBottomAnchor = function isBottomAnchor(opts) {\n return (\n opts.yanchor === 'bottom' ||\n (opts.yanchor === 'auto' && opts.y <= 1 / 3)\n );\n};\n\n},{}],710:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar modModule = _dereq_('./mod');\nvar mod = modModule.mod;\nvar modHalf = modModule.modHalf;\n\nvar PI = Math.PI;\nvar twoPI = 2 * PI;\n\nfunction deg2rad(deg) { return deg / 180 * PI; }\n\nfunction rad2deg(rad) { return rad / PI * 180; }\n\n/**\n * is sector a full circle?\n * ... this comes up a lot in SVG path-drawing routines\n *\n * N.B. we consider all sectors that span more that 2pi 'full' circles\n *\n * @param {2-item array} aBnds : angular bounds in *radians*\n * @return {boolean}\n */\nfunction isFullCircle(aBnds) {\n return Math.abs(aBnds[1] - aBnds[0]) > twoPI - 1e-14;\n}\n\n/**\n * angular delta between angle 'a' and 'b'\n * solution taken from: https://stackoverflow.com/a/2007279\n *\n * @param {number} a : first angle in *radians*\n * @param {number} b : second angle in *radians*\n * @return {number} angular delta in *radians*\n */\nfunction angleDelta(a, b) {\n return modHalf(b - a, twoPI);\n}\n\n/**\n * angular distance between angle 'a' and 'b'\n *\n * @param {number} a : first angle in *radians*\n * @param {number} b : second angle in *radians*\n * @return {number} angular distance in *radians*\n */\nfunction angleDist(a, b) {\n return Math.abs(angleDelta(a, b));\n}\n\n/**\n * is angle inside sector?\n *\n * @param {number} a : angle to test in *radians*\n * @param {2-item array} aBnds : sector's angular bounds in *radians*\n * @param {boolean}\n */\nfunction isAngleInsideSector(a, aBnds) {\n if(isFullCircle(aBnds)) return true;\n\n var s0, s1;\n\n if(aBnds[0] < aBnds[1]) {\n s0 = aBnds[0];\n s1 = aBnds[1];\n } else {\n s0 = aBnds[1];\n s1 = aBnds[0];\n }\n\n s0 = mod(s0, twoPI);\n s1 = mod(s1, twoPI);\n if(s0 > s1) s1 += twoPI;\n\n var a0 = mod(a, twoPI);\n var a1 = a0 + twoPI;\n\n return (a0 >= s0 && a0 <= s1) || (a1 >= s0 && a1 <= s1);\n}\n\n/**\n * is pt (r,a) inside sector?\n *\n * @param {number} r : pt's radial coordinate\n * @param {number} a : pt's angular coordinate in *radians*\n * @param {2-item array} rBnds : sector's radial bounds\n * @param {2-item array} aBnds : sector's angular bounds in *radians*\n * @return {boolean}\n */\nfunction isPtInsideSector(r, a, rBnds, aBnds) {\n if(!isAngleInsideSector(a, aBnds)) return false;\n\n var r0, r1;\n\n if(rBnds[0] < rBnds[1]) {\n r0 = rBnds[0];\n r1 = rBnds[1];\n } else {\n r0 = rBnds[1];\n r1 = rBnds[0];\n }\n\n return r >= r0 && r <= r1;\n}\n\n// common to pathArc, pathSector and pathAnnulus\nfunction _path(r0, r1, a0, a1, cx, cy, isClosed) {\n cx = cx || 0;\n cy = cy || 0;\n\n var isCircle = isFullCircle([a0, a1]);\n var aStart, aMid, aEnd;\n var rStart, rEnd;\n\n if(isCircle) {\n aStart = 0;\n aMid = PI;\n aEnd = twoPI;\n } else {\n if(a0 < a1) {\n aStart = a0;\n aEnd = a1;\n } else {\n aStart = a1;\n aEnd = a0;\n }\n }\n\n if(r0 < r1) {\n rStart = r0;\n rEnd = r1;\n } else {\n rStart = r1;\n rEnd = r0;\n }\n\n // N.B. svg coordinates here, where y increases downward\n function pt(r, a) {\n return [r * Math.cos(a) + cx, cy - r * Math.sin(a)];\n }\n\n var largeArc = Math.abs(aEnd - aStart) <= PI ? 0 : 1;\n function arc(r, a, cw) {\n return 'A' + [r, r] + ' ' + [0, largeArc, cw] + ' ' + pt(r, a);\n }\n\n var p;\n\n if(isCircle) {\n if(rStart === null) {\n p = 'M' + pt(rEnd, aStart) +\n arc(rEnd, aMid, 0) +\n arc(rEnd, aEnd, 0) + 'Z';\n } else {\n p = 'M' + pt(rStart, aStart) +\n arc(rStart, aMid, 0) +\n arc(rStart, aEnd, 0) + 'Z' +\n 'M' + pt(rEnd, aStart) +\n arc(rEnd, aMid, 1) +\n arc(rEnd, aEnd, 1) + 'Z';\n }\n } else {\n if(rStart === null) {\n p = 'M' + pt(rEnd, aStart) + arc(rEnd, aEnd, 0);\n if(isClosed) p += 'L0,0Z';\n } else {\n p = 'M' + pt(rStart, aStart) +\n 'L' + pt(rEnd, aStart) +\n arc(rEnd, aEnd, 0) +\n 'L' + pt(rStart, aEnd) +\n arc(rStart, aStart, 1) + 'Z';\n }\n }\n\n return p;\n}\n\n/**\n * path an arc\n *\n * @param {number} r : radius\n * @param {number} a0 : first angular coordinate in *radians*\n * @param {number} a1 : second angular coordinate in *radians*\n * @param {number (optional)} cx : x coordinate of center\n * @param {number (optional)} cy : y coordinate of center\n * @return {string} svg path\n */\nfunction pathArc(r, a0, a1, cx, cy) {\n return _path(null, r, a0, a1, cx, cy, 0);\n}\n\n/**\n * path a sector\n *\n * @param {number} r : radius\n * @param {number} a0 : first angular coordinate in *radians*\n * @param {number} a1 : second angular coordinate in *radians*\n * @param {number (optional)} cx : x coordinate of center\n * @param {number (optional)} cy : y coordinate of center\n * @return {string} svg path\n */\nfunction pathSector(r, a0, a1, cx, cy) {\n return _path(null, r, a0, a1, cx, cy, 1);\n}\n\n/**\n * path an annulus\n *\n * @param {number} r0 : first radial coordinate\n * @param {number} r1 : second radial coordinate\n * @param {number} a0 : first angular coordinate in *radians*\n * @param {number} a1 : second angular coordinate in *radians*\n * @param {number (optional)} cx : x coordinate of center\n * @param {number (optional)} cy : y coordinate of center\n * @return {string} svg path\n */\nfunction pathAnnulus(r0, r1, a0, a1, cx, cy) {\n return _path(r0, r1, a0, a1, cx, cy, 1);\n}\n\nmodule.exports = {\n deg2rad: deg2rad,\n rad2deg: rad2deg,\n angleDelta: angleDelta,\n angleDist: angleDist,\n isFullCircle: isFullCircle,\n isAngleInsideSector: isAngleInsideSector,\n isPtInsideSector: isPtInsideSector,\n pathArc: pathArc,\n pathSector: pathSector,\n pathAnnulus: pathAnnulus\n};\n\n},{\"./mod\":735}],711:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isArray = Array.isArray;\n\n// IE9 fallbacks\n\nvar ab = (typeof ArrayBuffer === 'undefined' || !ArrayBuffer.isView) ?\n {isView: function() { return false; }} :\n ArrayBuffer;\n\nvar dv = (typeof DataView === 'undefined') ?\n function() {} :\n DataView;\n\nfunction isTypedArray(a) {\n return ab.isView(a) && !(a instanceof dv);\n}\nexports.isTypedArray = isTypedArray;\n\nfunction isArrayOrTypedArray(a) {\n return isArray(a) || isTypedArray(a);\n}\nexports.isArrayOrTypedArray = isArrayOrTypedArray;\n\n/*\n * Test whether an input object is 1D.\n *\n * Assumes we already know the object is an array.\n *\n * Looks only at the first element, if the dimensionality is\n * not consistent we won't figure that out here.\n */\nfunction isArray1D(a) {\n return !isArrayOrTypedArray(a[0]);\n}\nexports.isArray1D = isArray1D;\n\n/*\n * Ensures an array has the right amount of storage space. If it doesn't\n * exist, it creates an array. If it does exist, it returns it if too\n * short or truncates it in-place.\n *\n * The goal is to just reuse memory to avoid a bit of excessive garbage\n * collection.\n */\nexports.ensureArray = function(out, n) {\n // TODO: typed array support here? This is only used in\n // traces/carpet/compute_control_points\n if(!isArray(out)) out = [];\n\n // If too long, truncate. (If too short, it will grow\n // automatically so we don't care about that case)\n out.length = n;\n\n return out;\n};\n\n/*\n * TypedArray-compatible concatenation of n arrays\n * if all arrays are the same type it will preserve that type,\n * otherwise it falls back on Array.\n * Also tries to avoid copying, in case one array has zero length\n * But never mutates an existing array\n */\nexports.concat = function() {\n var args = [];\n var allArray = true;\n var totalLen = 0;\n\n var _constructor, arg0, i, argi, posi, leni, out, j;\n\n for(i = 0; i < arguments.length; i++) {\n argi = arguments[i];\n leni = argi.length;\n if(leni) {\n if(arg0) args.push(argi);\n else {\n arg0 = argi;\n posi = leni;\n }\n\n if(isArray(argi)) {\n _constructor = false;\n } else {\n allArray = false;\n if(!totalLen) {\n _constructor = argi.constructor;\n } else if(_constructor !== argi.constructor) {\n // TODO: in principle we could upgrade here,\n // ie keep typed array but convert all to Float64Array?\n _constructor = false;\n }\n }\n\n totalLen += leni;\n }\n }\n\n if(!totalLen) return [];\n if(!args.length) return arg0;\n\n if(allArray) return arg0.concat.apply(arg0, args);\n if(_constructor) {\n // matching typed arrays\n out = new _constructor(totalLen);\n out.set(arg0);\n for(i = 0; i < args.length; i++) {\n argi = args[i];\n out.set(argi, posi);\n posi += argi.length;\n }\n return out;\n }\n\n // mismatched types or Array + typed\n out = new Array(totalLen);\n for(j = 0; j < arg0.length; j++) out[j] = arg0[j];\n for(i = 0; i < args.length; i++) {\n argi = args[i];\n for(j = 0; j < argi.length; j++) out[posi + j] = argi[j];\n posi += j;\n }\n return out;\n};\n\nexports.maxRowLength = function(z) {\n return _rowLength(z, Math.max, 0);\n};\n\nexports.minRowLength = function(z) {\n return _rowLength(z, Math.min, Infinity);\n};\n\nfunction _rowLength(z, fn, len0) {\n if(isArrayOrTypedArray(z)) {\n if(isArrayOrTypedArray(z[0])) {\n var len = len0;\n for(var i = 0; i < z.length; i++) {\n len = fn(len, z[i].length);\n }\n return len;\n } else {\n return z.length;\n }\n }\n return 0;\n}\n\n},{}],712:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar BADNUM = _dereq_('../constants/numerical').BADNUM;\n\n// precompile for speed\nvar JUNK = /^['\"%,$#\\s']+|[, ]|['\"%,$#\\s']+$/g;\n\n/**\n * cleanNumber: remove common leading and trailing cruft\n * Always returns either a number or BADNUM.\n */\nmodule.exports = function cleanNumber(v) {\n if(typeof v === 'string') {\n v = v.replace(JUNK, '');\n }\n\n if(isNumeric(v)) return Number(v);\n\n return BADNUM;\n};\n\n},{\"../constants/numerical\":704,\"fast-isnumeric\":236}],713:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/**\n * Clear gl frame (if any). This is a common pattern as\n * we usually set `preserveDrawingBuffer: true` during\n * gl context creation (e.g. via `reglUtils.prepare`).\n *\n * @param {DOM node or object} gd : graph div object\n */\nmodule.exports = function clearGlCanvases(gd) {\n var fullLayout = gd._fullLayout;\n\n if(fullLayout._glcanvas && fullLayout._glcanvas.size()) {\n fullLayout._glcanvas.each(function(d) {\n if(d.regl) d.regl.clear({color: true, depth: true});\n });\n }\n};\n\n},{}],714:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/**\n * Clear responsive handlers (if any).\n *\n * @param {DOM node or object} gd : graph div object\n */\nmodule.exports = function clearResponsive(gd) {\n if(gd._responsiveChartHandler) {\n window.removeEventListener('resize', gd._responsiveChartHandler);\n delete gd._responsiveChartHandler;\n }\n};\n\n},{}],715:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar tinycolor = _dereq_('tinycolor2');\n\nvar baseTraceAttrs = _dereq_('../plots/attributes');\nvar colorscales = _dereq_('../components/colorscale/scales');\nvar DESELECTDIM = _dereq_('../constants/interactions').DESELECTDIM;\n\nvar nestedProperty = _dereq_('./nested_property');\nvar counterRegex = _dereq_('./regex').counter;\nvar modHalf = _dereq_('./mod').modHalf;\nvar isArrayOrTypedArray = _dereq_('./array').isArrayOrTypedArray;\n\nexports.valObjectMeta = {\n data_array: {\n // You can use *dflt=[] to force said array to exist though.\n \n \n \n coerceFunction: function(v, propOut, dflt) {\n // TODO maybe `v: {type: 'float32', vals: [/* ... */]}` also\n if(isArrayOrTypedArray(v)) propOut.set(v);\n else if(dflt !== undefined) propOut.set(dflt);\n }\n },\n enumerated: {\n \n \n \n coerceFunction: function(v, propOut, dflt, opts) {\n if(opts.coerceNumber) v = +v;\n if(opts.values.indexOf(v) === -1) propOut.set(dflt);\n else propOut.set(v);\n },\n validateFunction: function(v, opts) {\n if(opts.coerceNumber) v = +v;\n\n var values = opts.values;\n for(var i = 0; i < values.length; i++) {\n var k = String(values[i]);\n\n if((k.charAt(0) === '/' && k.charAt(k.length - 1) === '/')) {\n var regex = new RegExp(k.substr(1, k.length - 2));\n if(regex.test(v)) return true;\n } else if(v === values[i]) return true;\n }\n return false;\n }\n },\n 'boolean': {\n \n \n \n coerceFunction: function(v, propOut, dflt) {\n if(v === true || v === false) propOut.set(v);\n else propOut.set(dflt);\n }\n },\n number: {\n \n \n \n coerceFunction: function(v, propOut, dflt, opts) {\n if(!isNumeric(v) ||\n (opts.min !== undefined && v < opts.min) ||\n (opts.max !== undefined && v > opts.max)) {\n propOut.set(dflt);\n } else propOut.set(+v);\n }\n },\n integer: {\n \n \n \n coerceFunction: function(v, propOut, dflt, opts) {\n if(v % 1 || !isNumeric(v) ||\n (opts.min !== undefined && v < opts.min) ||\n (opts.max !== undefined && v > opts.max)) {\n propOut.set(dflt);\n } else propOut.set(+v);\n }\n },\n string: {\n \n \n // TODO 'values shouldn't be in there (edge case: 'dash' in Scatter)\n \n coerceFunction: function(v, propOut, dflt, opts) {\n if(typeof v !== 'string') {\n var okToCoerce = (typeof v === 'number');\n\n if(opts.strict === true || !okToCoerce) propOut.set(dflt);\n else propOut.set(String(v));\n } else if(opts.noBlank && !v) propOut.set(dflt);\n else propOut.set(v);\n }\n },\n color: {\n \n \n \n coerceFunction: function(v, propOut, dflt) {\n if(tinycolor(v).isValid()) propOut.set(v);\n else propOut.set(dflt);\n }\n },\n colorlist: {\n \n \n \n coerceFunction: function(v, propOut, dflt) {\n function isColor(color) {\n return tinycolor(color).isValid();\n }\n if(!Array.isArray(v) || !v.length) propOut.set(dflt);\n else if(v.every(isColor)) propOut.set(v);\n else propOut.set(dflt);\n }\n },\n colorscale: {\n \n \n \n coerceFunction: function(v, propOut, dflt) {\n propOut.set(colorscales.get(v, dflt));\n }\n },\n angle: {\n \n \n \n coerceFunction: function(v, propOut, dflt) {\n if(v === 'auto') propOut.set('auto');\n else if(!isNumeric(v)) propOut.set(dflt);\n else propOut.set(modHalf(+v, 360));\n }\n },\n subplotid: {\n \n \n \n coerceFunction: function(v, propOut, dflt, opts) {\n var regex = opts.regex || counterRegex(dflt);\n if(typeof v === 'string' && regex.test(v)) {\n propOut.set(v);\n return;\n }\n propOut.set(dflt);\n },\n validateFunction: function(v, opts) {\n var dflt = opts.dflt;\n\n if(v === dflt) return true;\n if(typeof v !== 'string') return false;\n if(counterRegex(dflt).test(v)) return true;\n\n return false;\n }\n },\n flaglist: {\n \n \n \n coerceFunction: function(v, propOut, dflt, opts) {\n if(typeof v !== 'string') {\n propOut.set(dflt);\n return;\n }\n if((opts.extras || []).indexOf(v) !== -1) {\n propOut.set(v);\n return;\n }\n var vParts = v.split('+');\n var i = 0;\n while(i < vParts.length) {\n var vi = vParts[i];\n if(opts.flags.indexOf(vi) === -1 || vParts.indexOf(vi) < i) {\n vParts.splice(i, 1);\n } else i++;\n }\n if(!vParts.length) propOut.set(dflt);\n else propOut.set(vParts.join('+'));\n }\n },\n any: {\n \n \n \n coerceFunction: function(v, propOut, dflt) {\n if(v === undefined) propOut.set(dflt);\n else propOut.set(v);\n }\n },\n info_array: {\n \n \n // set `dimensions=2` for a 2D array or '1-2' for either\n // `items` may be a single object instead of an array, in which case\n // `freeLength` must be true.\n // if `dimensions='1-2'` and items is a 1D array, then the value can\n // either be a matching 1D array or an array of such matching 1D arrays\n \n coerceFunction: function(v, propOut, dflt, opts) {\n // simplified coerce function just for array items\n function coercePart(v, opts, dflt) {\n var out;\n var propPart = {set: function(v) { out = v; }};\n\n if(dflt === undefined) dflt = opts.dflt;\n\n exports.valObjectMeta[opts.valType].coerceFunction(v, propPart, dflt, opts);\n\n return out;\n }\n\n var twoD = opts.dimensions === 2 || (opts.dimensions === '1-2' && Array.isArray(v) && Array.isArray(v[0]));\n\n if(!Array.isArray(v)) {\n propOut.set(dflt);\n return;\n }\n\n var items = opts.items;\n var vOut = [];\n var arrayItems = Array.isArray(items);\n var arrayItems2D = arrayItems && twoD && Array.isArray(items[0]);\n var innerItemsOnly = twoD && arrayItems && !arrayItems2D;\n var len = (arrayItems && !innerItemsOnly) ? items.length : v.length;\n\n var i, j, row, item, len2, vNew;\n\n dflt = Array.isArray(dflt) ? dflt : [];\n\n if(twoD) {\n for(i = 0; i < len; i++) {\n vOut[i] = [];\n row = Array.isArray(v[i]) ? v[i] : [];\n if(innerItemsOnly) len2 = items.length;\n else if(arrayItems) len2 = items[i].length;\n else len2 = row.length;\n\n for(j = 0; j < len2; j++) {\n if(innerItemsOnly) item = items[j];\n else if(arrayItems) item = items[i][j];\n else item = items;\n\n vNew = coercePart(row[j], item, (dflt[i] || [])[j]);\n if(vNew !== undefined) vOut[i][j] = vNew;\n }\n }\n } else {\n for(i = 0; i < len; i++) {\n vNew = coercePart(v[i], arrayItems ? items[i] : items, dflt[i]);\n if(vNew !== undefined) vOut[i] = vNew;\n }\n }\n\n propOut.set(vOut);\n },\n validateFunction: function(v, opts) {\n if(!Array.isArray(v)) return false;\n\n var items = opts.items;\n var arrayItems = Array.isArray(items);\n var twoD = opts.dimensions === 2;\n\n // when free length is off, input and declared lengths must match\n if(!opts.freeLength && v.length !== items.length) return false;\n\n // valid when all input items are valid\n for(var i = 0; i < v.length; i++) {\n if(twoD) {\n if(!Array.isArray(v[i]) || (!opts.freeLength && v[i].length !== items[i].length)) {\n return false;\n }\n for(var j = 0; j < v[i].length; j++) {\n if(!validate(v[i][j], arrayItems ? items[i][j] : items)) {\n return false;\n }\n }\n } else if(!validate(v[i], arrayItems ? items[i] : items)) return false;\n }\n\n return true;\n }\n }\n};\n\n/**\n * Ensures that container[attribute] has a valid value.\n *\n * attributes[attribute] is an object with possible keys:\n * - valType: data_array, enumerated, boolean, ... as in valObjectMeta\n * - values: (enumerated only) array of allowed vals\n * - min, max: (number, integer only) inclusive bounds on allowed vals\n * either or both may be omitted\n * - dflt: if attribute is invalid or missing, use this default\n * if dflt is provided as an argument to lib.coerce it takes precedence\n * as a convenience, returns the value it finally set\n */\nexports.coerce = function(containerIn, containerOut, attributes, attribute, dflt) {\n return _coerce(containerIn, containerOut, attributes, attribute, dflt).val;\n};\n\nfunction _coerce(containerIn, containerOut, attributes, attribute, dflt, opts) {\n var shouldValidate = (opts || {}).shouldValidate;\n\n var attr = nestedProperty(attributes, attribute).get();\n if(dflt === undefined) dflt = attr.dflt;\n var src = false;\n\n var propIn = nestedProperty(containerIn, attribute);\n var propOut = nestedProperty(containerOut, attribute);\n var valIn = propIn.get();\n\n var template = containerOut._template;\n if(valIn === undefined && template) {\n valIn = nestedProperty(template, attribute).get();\n src = (valIn !== undefined);\n\n // already used the template value, so short-circuit the second check\n template = 0;\n }\n\n /**\n * arrayOk: value MAY be an array, then we do no value checking\n * at this point, because it can be more complicated than the\n * individual form (eg. some array vals can be numbers, even if the\n * single values must be color strings)\n */\n if(attr.arrayOk && isArrayOrTypedArray(valIn)) {\n propOut.set(valIn);\n return {\n inp: valIn,\n val: valIn,\n src: true\n };\n }\n\n var coerceFunction = exports.valObjectMeta[attr.valType].coerceFunction;\n coerceFunction(valIn, propOut, dflt, attr);\n\n var valOut = propOut.get();\n src = (valOut !== undefined) && shouldValidate && validate(valIn, attr);\n\n // in case v was provided but invalid, try the template again so it still\n // overrides the regular default\n if(template && valOut === dflt && !validate(valIn, attr)) {\n valIn = nestedProperty(template, attribute).get();\n coerceFunction(valIn, propOut, dflt, attr);\n valOut = propOut.get();\n\n src = (valOut !== undefined) && shouldValidate && validate(valIn, attr);\n }\n\n return {\n inp: valIn,\n val: valOut,\n src: src\n };\n}\n\n/**\n * Variation on coerce\n * useful when setting an attribute to a valid value\n * can change the default for another attribute.\n *\n * Uses coerce to get attribute value if user input is valid,\n * returns attribute default if user input it not valid or\n * returns false if there is no user input.\n */\nexports.coerce2 = function(containerIn, containerOut, attributes, attribute, dflt) {\n var out = _coerce(containerIn, containerOut, attributes, attribute, dflt, {\n shouldValidate: true\n });\n return (out.src && out.inp !== undefined) ? out.val : false;\n};\n\n/*\n * Shortcut to coerce the three font attributes\n *\n * 'coerce' is a lib.coerce wrapper with implied first three arguments\n */\nexports.coerceFont = function(coerce, attr, dfltObj) {\n var out = {};\n\n dfltObj = dfltObj || {};\n\n out.family = coerce(attr + '.family', dfltObj.family);\n out.size = coerce(attr + '.size', dfltObj.size);\n out.color = coerce(attr + '.color', dfltObj.color);\n\n return out;\n};\n\n/** Coerce shortcut for 'hoverinfo'\n * handling 1-vs-multi-trace dflt logic\n *\n * @param {object} traceIn : user trace object\n * @param {object} traceOut : full trace object (requires _module ref)\n * @param {object} layoutOut : full layout object (require _dataLength ref)\n * @return {any} : the coerced value\n */\nexports.coerceHoverinfo = function(traceIn, traceOut, layoutOut) {\n var moduleAttrs = traceOut._module.attributes;\n var attrs = moduleAttrs.hoverinfo ? moduleAttrs : baseTraceAttrs;\n\n var valObj = attrs.hoverinfo;\n var dflt;\n\n if(layoutOut._dataLength === 1) {\n var flags = valObj.dflt === 'all' ?\n valObj.flags.slice() :\n valObj.dflt.split('+');\n\n flags.splice(flags.indexOf('name'), 1);\n dflt = flags.join('+');\n }\n\n return exports.coerce(traceIn, traceOut, attrs, 'hoverinfo', dflt);\n};\n\n/** Coerce shortcut for [un]selected.marker.opacity,\n * which has special default logic, to ensure that it corresponds to the\n * default selection behavior while allowing to be overtaken by any other\n * [un]selected attribute.\n *\n * N.B. This must be called *after* coercing all the other [un]selected attrs,\n * to give the intended result.\n *\n * @param {object} traceOut : fullData item\n * @param {function} coerce : lib.coerce wrapper with implied first three arguments\n */\nexports.coerceSelectionMarkerOpacity = function(traceOut, coerce) {\n if(!traceOut.marker) return;\n\n var mo = traceOut.marker.opacity;\n // you can still have a `marker` container with no markers if there's text\n if(mo === undefined) return;\n\n var smoDflt;\n var usmoDflt;\n\n // Don't give [un]selected.marker.opacity a default value if\n // marker.opacity is an array: handle this during style step.\n //\n // Only give [un]selected.marker.opacity a default value if you don't\n // set any other [un]selected attributes.\n if(!isArrayOrTypedArray(mo) && !traceOut.selected && !traceOut.unselected) {\n smoDflt = mo;\n usmoDflt = DESELECTDIM * mo;\n }\n\n coerce('selected.marker.opacity', smoDflt);\n coerce('unselected.marker.opacity', usmoDflt);\n};\n\nfunction validate(value, opts) {\n var valObjectDef = exports.valObjectMeta[opts.valType];\n\n if(opts.arrayOk && isArrayOrTypedArray(value)) return true;\n\n if(valObjectDef.validateFunction) {\n return valObjectDef.validateFunction(value, opts);\n }\n\n var failed = {};\n var out = failed;\n var propMock = { set: function(v) { out = v; } };\n\n // 'failed' just something mutable that won't be === anything else\n\n valObjectDef.coerceFunction(value, propMock, failed, opts);\n return out !== failed;\n}\nexports.validate = validate;\n\n},{\"../components/colorscale/scales\":610,\"../constants/interactions\":703,\"../plots/attributes\":773,\"./array\":711,\"./mod\":735,\"./nested_property\":736,\"./regex\":744,\"fast-isnumeric\":236,\"tinycolor2\":528}],716:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Loggers = _dereq_('./loggers');\nvar mod = _dereq_('./mod').mod;\n\nvar constants = _dereq_('../constants/numerical');\nvar BADNUM = constants.BADNUM;\nvar ONEDAY = constants.ONEDAY;\nvar ONEHOUR = constants.ONEHOUR;\nvar ONEMIN = constants.ONEMIN;\nvar ONESEC = constants.ONESEC;\nvar EPOCHJD = constants.EPOCHJD;\n\nvar Registry = _dereq_('../registry');\n\nvar utcFormat = d3.time.format.utc;\n\nvar DATETIME_REGEXP = /^\\s*(-?\\d\\d\\d\\d|\\d\\d)(-(\\d?\\d)(-(\\d?\\d)([ Tt]([01]?\\d|2[0-3])(:([0-5]\\d)(:([0-5]\\d(\\.\\d+)?))?(Z|z|[+\\-]\\d\\d:?\\d\\d)?)?)?)?)?\\s*$/m;\n// special regex for chinese calendars to support yyyy-mmi-dd etc for intercalary months\nvar DATETIME_REGEXP_CN = /^\\s*(-?\\d\\d\\d\\d|\\d\\d)(-(\\d?\\di?)(-(\\d?\\d)([ Tt]([01]?\\d|2[0-3])(:([0-5]\\d)(:([0-5]\\d(\\.\\d+)?))?(Z|z|[+\\-]\\d\\d:?\\d\\d)?)?)?)?)?\\s*$/m;\n\n// for 2-digit years, the first year we map them onto\nvar YFIRST = new Date().getFullYear() - 70;\n\nfunction isWorldCalendar(calendar) {\n return (\n calendar &&\n Registry.componentsRegistry.calendars &&\n typeof calendar === 'string' && calendar !== 'gregorian'\n );\n}\n\n/*\n * dateTick0: get the canonical tick for this calendar\n *\n * bool sunday is for week ticks, shift it to a Sunday.\n */\nexports.dateTick0 = function(calendar, sunday) {\n if(isWorldCalendar(calendar)) {\n return sunday ?\n Registry.getComponentMethod('calendars', 'CANONICAL_SUNDAY')[calendar] :\n Registry.getComponentMethod('calendars', 'CANONICAL_TICK')[calendar];\n } else {\n return sunday ? '2000-01-02' : '2000-01-01';\n }\n};\n\n/*\n * dfltRange: for each calendar, give a valid default range\n */\nexports.dfltRange = function(calendar) {\n if(isWorldCalendar(calendar)) {\n return Registry.getComponentMethod('calendars', 'DFLTRANGE')[calendar];\n } else {\n return ['2000-01-01', '2001-01-01'];\n }\n};\n\n// is an object a javascript date?\nexports.isJSDate = function(v) {\n return typeof v === 'object' && v !== null && typeof v.getTime === 'function';\n};\n\n// The absolute limits of our date-time system\n// This is a little weird: we use MIN_MS and MAX_MS in dateTime2ms\n// but we use dateTime2ms to calculate them (after defining it!)\nvar MIN_MS, MAX_MS;\n\n/**\n * dateTime2ms - turn a date object or string s into milliseconds\n * (relative to 1970-01-01, per javascript standard)\n * optional calendar (string) to use a non-gregorian calendar\n *\n * Returns BADNUM if it doesn't find a date\n *\n * strings should have the form:\n *\n * -?YYYY-mm-ddHH:MM:SS.sss?\n *\n * : space (our normal standard) or T or t (ISO-8601)\n * : Z, z, or [+\\-]HH:?MM and we THROW IT AWAY\n * this format comes from https://tools.ietf.org/html/rfc3339#section-5.6\n * but we allow it even with a space as the separator\n *\n * May truncate after any full field, and sss can be any length\n * even >3 digits, though javascript dates truncate to milliseconds,\n * we keep as much as javascript numeric precision can hold, but we only\n * report back up to 100 microsecond precision, because most dates support\n * this precision (close to 1970 support more, very far away support less)\n *\n * Expanded to support negative years to -9999 but you must always\n * give 4 digits, except for 2-digit positive years which we assume are\n * near the present time.\n * Note that we follow ISO 8601:2004: there *is* a year 0, which\n * is 1BC/BCE, and -1===2BC etc.\n *\n * World calendars: not all of these *have* agreed extensions to this full range,\n * if you have another calendar system but want a date range outside its validity,\n * you can use a gregorian date string prefixed with 'G' or 'g'.\n *\n * Where to cut off 2-digit years between 1900s and 2000s?\n * from http://support.microsoft.com/kb/244664:\n * 1930-2029 (the most retro of all...)\n * but in my mac chrome from eg. d=new Date(Date.parse('8/19/50')):\n * 1950-2049\n * by Java, from http://stackoverflow.com/questions/2024273/:\n * now-80 - now+19\n * or FileMaker Pro, from\n * http://www.filemaker.com/12help/html/add_view_data.4.21.html:\n * now-70 - now+29\n * but python strptime etc, via\n * http://docs.python.org/py3k/library/time.html:\n * 1969-2068 (super forward-looking, but static, not sliding!)\n *\n * lets go with now-70 to now+29, and if anyone runs into this problem\n * they can learn the hard way not to use 2-digit years, as no choice we\n * make now will cover all possibilities. mostly this will all be taken\n * care of in initial parsing, should only be an issue for hand-entered data\n * currently (2016) this range is:\n * 1946-2045\n */\nexports.dateTime2ms = function(s, calendar) {\n // first check if s is a date object\n if(exports.isJSDate(s)) {\n // Convert to the UTC milliseconds that give the same\n // hours as this date has in the local timezone\n var tzOffset = s.getTimezoneOffset() * ONEMIN;\n var offsetTweak = (s.getUTCMinutes() - s.getMinutes()) * ONEMIN +\n (s.getUTCSeconds() - s.getSeconds()) * ONESEC +\n (s.getUTCMilliseconds() - s.getMilliseconds());\n\n if(offsetTweak) {\n var comb = 3 * ONEMIN;\n tzOffset = tzOffset - comb / 2 + mod(offsetTweak - tzOffset + comb / 2, comb);\n }\n s = Number(s) - tzOffset;\n if(s >= MIN_MS && s <= MAX_MS) return s;\n return BADNUM;\n }\n // otherwise only accept strings and numbers\n if(typeof s !== 'string' && typeof s !== 'number') return BADNUM;\n\n s = String(s);\n\n var isWorld = isWorldCalendar(calendar);\n\n // to handle out-of-range dates in international calendars, accept\n // 'G' as a prefix to force the built-in gregorian calendar.\n var s0 = s.charAt(0);\n if(isWorld && (s0 === 'G' || s0 === 'g')) {\n s = s.substr(1);\n calendar = '';\n }\n\n var isChinese = isWorld && calendar.substr(0, 7) === 'chinese';\n\n var match = s.match(isChinese ? DATETIME_REGEXP_CN : DATETIME_REGEXP);\n if(!match) return BADNUM;\n var y = match[1];\n var m = match[3] || '1';\n var d = Number(match[5] || 1);\n var H = Number(match[7] || 0);\n var M = Number(match[9] || 0);\n var S = Number(match[11] || 0);\n\n if(isWorld) {\n // disallow 2-digit years for world calendars\n if(y.length === 2) return BADNUM;\n y = Number(y);\n\n var cDate;\n try {\n var calInstance = Registry.getComponentMethod('calendars', 'getCal')(calendar);\n if(isChinese) {\n var isIntercalary = m.charAt(m.length - 1) === 'i';\n m = parseInt(m, 10);\n cDate = calInstance.newDate(y, calInstance.toMonthIndex(y, m, isIntercalary), d);\n } else {\n cDate = calInstance.newDate(y, Number(m), d);\n }\n } catch(e) { return BADNUM; } // Invalid ... date\n\n if(!cDate) return BADNUM;\n\n return ((cDate.toJD() - EPOCHJD) * ONEDAY) +\n (H * ONEHOUR) + (M * ONEMIN) + (S * ONESEC);\n }\n\n if(y.length === 2) {\n y = (Number(y) + 2000 - YFIRST) % 100 + YFIRST;\n } else y = Number(y);\n\n // new Date uses months from 0; subtract 1 here just so we\n // don't have to do it again during the validity test below\n m -= 1;\n\n // javascript takes new Date(0..99,m,d) to mean 1900-1999, so\n // to support years 0-99 we need to use setFullYear explicitly\n // Note that 2000 is a leap year.\n var date = new Date(Date.UTC(2000, m, d, H, M));\n date.setUTCFullYear(y);\n\n if(date.getUTCMonth() !== m) return BADNUM;\n if(date.getUTCDate() !== d) return BADNUM;\n\n return date.getTime() + S * ONESEC;\n};\n\nMIN_MS = exports.MIN_MS = exports.dateTime2ms('-9999');\nMAX_MS = exports.MAX_MS = exports.dateTime2ms('9999-12-31 23:59:59.9999');\n\n// is string s a date? (see above)\nexports.isDateTime = function(s, calendar) {\n return (exports.dateTime2ms(s, calendar) !== BADNUM);\n};\n\n// pad a number with zeroes, to given # of digits before the decimal point\nfunction lpad(val, digits) {\n return String(val + Math.pow(10, digits)).substr(1);\n}\n\n/**\n * Turn ms into string of the form YYYY-mm-dd HH:MM:SS.ssss\n * Crop any trailing zeros in time, except never stop right after hours\n * (we could choose to crop '-01' from date too but for now we always\n * show the whole date)\n * Optional range r is the data range that applies, also in ms.\n * If rng is big, the later parts of time will be omitted\n */\nvar NINETYDAYS = 90 * ONEDAY;\nvar THREEHOURS = 3 * ONEHOUR;\nvar FIVEMIN = 5 * ONEMIN;\nexports.ms2DateTime = function(ms, r, calendar) {\n if(typeof ms !== 'number' || !(ms >= MIN_MS && ms <= MAX_MS)) return BADNUM;\n\n if(!r) r = 0;\n\n var msecTenths = Math.floor(mod(ms + 0.05, 1) * 10);\n var msRounded = Math.round(ms - msecTenths / 10);\n var dateStr, h, m, s, msec10, d;\n\n if(isWorldCalendar(calendar)) {\n var dateJD = Math.floor(msRounded / ONEDAY) + EPOCHJD;\n var timeMs = Math.floor(mod(ms, ONEDAY));\n try {\n dateStr = Registry.getComponentMethod('calendars', 'getCal')(calendar)\n .fromJD(dateJD).formatDate('yyyy-mm-dd');\n } catch(e) {\n // invalid date in this calendar - fall back to Gyyyy-mm-dd\n dateStr = utcFormat('G%Y-%m-%d')(new Date(msRounded));\n }\n\n // yyyy does NOT guarantee 4-digit years. YYYY mostly does, but does\n // other things for a few calendars, so we can't trust it. Just pad\n // it manually (after the '-' if there is one)\n if(dateStr.charAt(0) === '-') {\n while(dateStr.length < 11) dateStr = '-0' + dateStr.substr(1);\n } else {\n while(dateStr.length < 10) dateStr = '0' + dateStr;\n }\n\n // TODO: if this is faster, we could use this block for extracting\n // the time components of regular gregorian too\n h = (r < NINETYDAYS) ? Math.floor(timeMs / ONEHOUR) : 0;\n m = (r < NINETYDAYS) ? Math.floor((timeMs % ONEHOUR) / ONEMIN) : 0;\n s = (r < THREEHOURS) ? Math.floor((timeMs % ONEMIN) / ONESEC) : 0;\n msec10 = (r < FIVEMIN) ? (timeMs % ONESEC) * 10 + msecTenths : 0;\n } else {\n d = new Date(msRounded);\n\n dateStr = utcFormat('%Y-%m-%d')(d);\n\n // <90 days: add hours and minutes - never *only* add hours\n h = (r < NINETYDAYS) ? d.getUTCHours() : 0;\n m = (r < NINETYDAYS) ? d.getUTCMinutes() : 0;\n // <3 hours: add seconds\n s = (r < THREEHOURS) ? d.getUTCSeconds() : 0;\n // <5 minutes: add ms (plus one extra digit, this is msec*10)\n msec10 = (r < FIVEMIN) ? d.getUTCMilliseconds() * 10 + msecTenths : 0;\n }\n\n return includeTime(dateStr, h, m, s, msec10);\n};\n\n// For converting old-style milliseconds to date strings,\n// we use the local timezone rather than UTC like we use\n// everywhere else, both for backward compatibility and\n// because that's how people mostly use javasript date objects.\n// Clip one extra day off our date range though so we can't get\n// thrown beyond the range by the timezone shift.\nexports.ms2DateTimeLocal = function(ms) {\n if(!(ms >= MIN_MS + ONEDAY && ms <= MAX_MS - ONEDAY)) return BADNUM;\n\n var msecTenths = Math.floor(mod(ms + 0.05, 1) * 10);\n var d = new Date(Math.round(ms - msecTenths / 10));\n var dateStr = d3.time.format('%Y-%m-%d')(d);\n var h = d.getHours();\n var m = d.getMinutes();\n var s = d.getSeconds();\n var msec10 = d.getUTCMilliseconds() * 10 + msecTenths;\n\n return includeTime(dateStr, h, m, s, msec10);\n};\n\nfunction includeTime(dateStr, h, m, s, msec10) {\n // include each part that has nonzero data in or after it\n if(h || m || s || msec10) {\n dateStr += ' ' + lpad(h, 2) + ':' + lpad(m, 2);\n if(s || msec10) {\n dateStr += ':' + lpad(s, 2);\n if(msec10) {\n var digits = 4;\n while(msec10 % 10 === 0) {\n digits -= 1;\n msec10 /= 10;\n }\n dateStr += '.' + lpad(msec10, digits);\n }\n }\n }\n return dateStr;\n}\n\n// normalize date format to date string, in case it starts as\n// a Date object or milliseconds\n// optional dflt is the return value if cleaning fails\nexports.cleanDate = function(v, dflt, calendar) {\n // let us use cleanDate to provide a missing default without an error\n if(v === BADNUM) return dflt;\n if(exports.isJSDate(v) || (typeof v === 'number' && isFinite(v))) {\n // do not allow milliseconds (old) or jsdate objects (inherently\n // described as gregorian dates) with world calendars\n if(isWorldCalendar(calendar)) {\n Loggers.error('JS Dates and milliseconds are incompatible with world calendars', v);\n return dflt;\n }\n\n // NOTE: if someone puts in a year as a number rather than a string,\n // this will mistakenly convert it thinking it's milliseconds from 1970\n // that is: '2012' -> Jan. 1, 2012, but 2012 -> 2012 epoch milliseconds\n v = exports.ms2DateTimeLocal(+v);\n if(!v && dflt !== undefined) return dflt;\n } else if(!exports.isDateTime(v, calendar)) {\n Loggers.error('unrecognized date', v);\n return dflt;\n }\n return v;\n};\n\n/*\n * Date formatting for ticks and hovertext\n */\n\n/*\n * modDateFormat: Support world calendars, and add one item to\n * d3's vocabulary:\n * %{n}f where n is the max number of digits of fractional seconds\n */\nvar fracMatch = /%\\d?f/g;\nfunction modDateFormat(fmt, x, formatter, calendar) {\n fmt = fmt.replace(fracMatch, function(match) {\n var digits = Math.min(+(match.charAt(1)) || 6, 6);\n var fracSecs = ((x / 1000 % 1) + 2)\n .toFixed(digits)\n .substr(2).replace(/0+$/, '') || '0';\n return fracSecs;\n });\n\n var d = new Date(Math.floor(x + 0.05));\n\n if(isWorldCalendar(calendar)) {\n try {\n fmt = Registry.getComponentMethod('calendars', 'worldCalFmt')(fmt, x, calendar);\n } catch(e) {\n return 'Invalid';\n }\n }\n return formatter(fmt)(d);\n}\n\n/*\n * formatTime: create a time string from:\n * x: milliseconds\n * tr: tickround ('M', 'S', or # digits)\n * only supports UTC times (where every day is 24 hours and 0 is at midnight)\n */\nvar MAXSECONDS = [59, 59.9, 59.99, 59.999, 59.9999];\nfunction formatTime(x, tr) {\n var timePart = mod(x + 0.05, ONEDAY);\n\n var timeStr = lpad(Math.floor(timePart / ONEHOUR), 2) + ':' +\n lpad(mod(Math.floor(timePart / ONEMIN), 60), 2);\n\n if(tr !== 'M') {\n if(!isNumeric(tr)) tr = 0; // should only be 'S'\n\n /*\n * this is a weird one - and shouldn't come up unless people\n * monkey with tick0 in weird ways, but we need to do something!\n * IN PARTICULAR we had better not display garbage (see below)\n * for numbers we always round to the nearest increment of the\n * precision we're showing, and this seems like the right way to\n * handle seconds and milliseconds, as they have a decimal point\n * and people will interpret that to mean rounding like numbers.\n * but for larger increments we floor the value: it's always\n * 2013 until the ball drops on the new year. We could argue about\n * which field it is where we start rounding (should 12:08:59\n * round to 12:09 if we're stopping at minutes?) but for now I'll\n * say we round seconds but floor everything else. BUT that means\n * we need to never round up to 60 seconds, ie 23:59:60\n */\n var sec = Math.min(mod(x / ONESEC, 60), MAXSECONDS[tr]);\n\n var secStr = (100 + sec).toFixed(tr).substr(1);\n if(tr > 0) {\n secStr = secStr.replace(/0+$/, '').replace(/[\\.]$/, '');\n }\n\n timeStr += ':' + secStr;\n }\n return timeStr;\n}\n\n/*\n * formatDate: turn a date into tick or hover label text.\n *\n * x: milliseconds, the value to convert\n * fmt: optional, an explicit format string (d3 format, even for world calendars)\n * tr: tickround ('y', 'm', 'd', 'M', 'S', or # digits)\n * used if no explicit fmt is provided\n * formatter: locale-aware d3 date formatter for standard gregorian calendars\n * should be the result of exports.getD3DateFormat(gd)\n * calendar: optional string, the world calendar system to use\n *\n * returns the date/time as a string, potentially with the leading portion\n * on a separate line (after '\\n')\n * Note that this means if you provide an explicit format which includes '\\n'\n * the axis may choose to strip things after it when they don't change from\n * one tick to the next (as it does with automatic formatting)\n */\nexports.formatDate = function(x, fmt, tr, formatter, calendar, extraFormat) {\n calendar = isWorldCalendar(calendar) && calendar;\n\n if(!fmt) {\n if(tr === 'y') fmt = extraFormat.year;\n else if(tr === 'm') fmt = extraFormat.month;\n else if(tr === 'd') {\n fmt = extraFormat.dayMonth + '\\n' + extraFormat.year;\n } else {\n return formatTime(x, tr) + '\\n' + modDateFormat(extraFormat.dayMonthYear, x, formatter, calendar);\n }\n }\n\n return modDateFormat(fmt, x, formatter, calendar);\n};\n\n/*\n * incrementMonth: make a new milliseconds value from the given one,\n * having changed the month\n *\n * special case for world calendars: multiples of 12 are treated as years,\n * even for calendar systems that don't have (always or ever) 12 months/year\n * TODO: perhaps we need a different code for year increments to support this?\n *\n * ms (number): the initial millisecond value\n * dMonth (int): the (signed) number of months to shift\n * calendar (string): the calendar system to use\n *\n * changing month does not (and CANNOT) always preserve day, since\n * months have different lengths. The worst example of this is:\n * d = new Date(1970,0,31); d.setMonth(1) -> Feb 31 turns into Mar 3\n *\n * But we want to be able to iterate over the last day of each month,\n * regardless of what its number is.\n * So shift 3 days forward, THEN set the new month, then unshift:\n * 1/31 -> 2/28 (or 29) -> 3/31 -> 4/30 -> ...\n *\n * Note that odd behavior still exists if you start from the 26th-28th:\n * 1/28 -> 2/28 -> 3/31\n * but at least you can't shift any dates into the wrong month,\n * and ticks on these days incrementing by month would be very unusual\n */\nvar THREEDAYS = 3 * ONEDAY;\nexports.incrementMonth = function(ms, dMonth, calendar) {\n calendar = isWorldCalendar(calendar) && calendar;\n\n // pull time out and operate on pure dates, then add time back at the end\n // this gives maximum precision - not that we *normally* care if we're\n // incrementing by month, but better to be safe!\n var timeMs = mod(ms, ONEDAY);\n ms = Math.round(ms - timeMs);\n\n if(calendar) {\n try {\n var dateJD = Math.round(ms / ONEDAY) + EPOCHJD;\n var calInstance = Registry.getComponentMethod('calendars', 'getCal')(calendar);\n var cDate = calInstance.fromJD(dateJD);\n\n if(dMonth % 12) calInstance.add(cDate, dMonth, 'm');\n else calInstance.add(cDate, dMonth / 12, 'y');\n\n return (cDate.toJD() - EPOCHJD) * ONEDAY + timeMs;\n } catch(e) {\n Loggers.error('invalid ms ' + ms + ' in calendar ' + calendar);\n // then keep going in gregorian even though the result will be 'Invalid'\n }\n }\n\n var y = new Date(ms + THREEDAYS);\n return y.setUTCMonth(y.getUTCMonth() + dMonth) + timeMs - THREEDAYS;\n};\n\n/*\n * findExactDates: what fraction of data is exact days, months, or years?\n *\n * data: array of millisecond values\n * calendar (string) the calendar to test against\n */\nexports.findExactDates = function(data, calendar) {\n var exactYears = 0;\n var exactMonths = 0;\n var exactDays = 0;\n var blankCount = 0;\n var d;\n var di;\n\n var calInstance = (\n isWorldCalendar(calendar) &&\n Registry.getComponentMethod('calendars', 'getCal')(calendar)\n );\n\n for(var i = 0; i < data.length; i++) {\n di = data[i];\n\n // not date data at all\n if(!isNumeric(di)) {\n blankCount ++;\n continue;\n }\n\n // not an exact date\n if(di % ONEDAY) continue;\n\n if(calInstance) {\n try {\n d = calInstance.fromJD(di / ONEDAY + EPOCHJD);\n if(d.day() === 1) {\n if(d.month() === 1) exactYears++;\n else exactMonths++;\n } else exactDays++;\n } catch(e) {\n // invalid date in this calendar - ignore it here.\n }\n } else {\n d = new Date(di);\n if(d.getUTCDate() === 1) {\n if(d.getUTCMonth() === 0) exactYears++;\n else exactMonths++;\n } else exactDays++;\n }\n }\n exactMonths += exactYears;\n exactDays += exactMonths;\n\n var dataCount = data.length - blankCount;\n\n return {\n exactYears: exactYears / dataCount,\n exactMonths: exactMonths / dataCount,\n exactDays: exactDays / dataCount\n };\n};\n\n},{\"../constants/numerical\":704,\"../registry\":859,\"./loggers\":732,\"./mod\":735,\"d3\":164,\"fast-isnumeric\":236}],717:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar loggers = _dereq_('./loggers');\n\n/**\n * Allow referencing a graph DOM element either directly\n * or by its id string\n *\n * @param {HTMLDivElement|string} gd: a graph element or its id\n *\n * @returns {HTMLDivElement} the DOM element of the graph\n */\nfunction getGraphDiv(gd) {\n var gdElement;\n\n if(typeof gd === 'string') {\n gdElement = document.getElementById(gd);\n\n if(gdElement === null) {\n throw new Error('No DOM element with id \\'' + gd + '\\' exists on the page.');\n }\n\n return gdElement;\n } else if(gd === null || gd === undefined) {\n throw new Error('DOM element provided is null or undefined');\n }\n\n // otherwise assume that gd is a DOM element\n return gd;\n}\n\nfunction isPlotDiv(el) {\n var el3 = d3.select(el);\n return el3.node() instanceof HTMLElement &&\n el3.size() &&\n el3.classed('js-plotly-plot');\n}\n\nfunction removeElement(el) {\n var elParent = el && el.parentNode;\n if(elParent) elParent.removeChild(el);\n}\n\n/**\n * for dynamically adding style rules\n * makes one stylesheet that contains all rules added\n * by all calls to this function\n */\nfunction addStyleRule(selector, styleString) {\n addRelatedStyleRule('global', selector, styleString);\n}\n\n/**\n * for dynamically adding style rules\n * to a stylesheet uniquely identified by a uid\n */\nfunction addRelatedStyleRule(uid, selector, styleString) {\n var id = 'plotly.js-style-' + uid;\n var style = document.getElementById(id);\n if(!style) {\n style = document.createElement('style');\n style.setAttribute('id', id);\n // WebKit hack :(\n style.appendChild(document.createTextNode(''));\n document.head.appendChild(style);\n }\n var styleSheet = style.sheet;\n\n if(styleSheet.insertRule) {\n styleSheet.insertRule(selector + '{' + styleString + '}', 0);\n } else if(styleSheet.addRule) {\n styleSheet.addRule(selector, styleString, 0);\n } else loggers.warn('addStyleRule failed');\n}\n\n/**\n * to remove from the page a stylesheet identified by a given uid\n */\nfunction deleteRelatedStyleRule(uid) {\n var id = 'plotly.js-style-' + uid;\n var style = document.getElementById(id);\n if(style) removeElement(style);\n}\n\nmodule.exports = {\n getGraphDiv: getGraphDiv,\n isPlotDiv: isPlotDiv,\n removeElement: removeElement,\n addStyleRule: addStyleRule,\n addRelatedStyleRule: addRelatedStyleRule,\n deleteRelatedStyleRule: deleteRelatedStyleRule\n};\n\n},{\"./loggers\":732,\"d3\":164}],718:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n/* global jQuery:false */\n\nvar EventEmitter = _dereq_('events').EventEmitter;\n\nvar Events = {\n\n init: function(plotObj) {\n /*\n * If we have already instantiated an emitter for this plot\n * return early.\n */\n if(plotObj._ev instanceof EventEmitter) return plotObj;\n\n var ev = new EventEmitter();\n var internalEv = new EventEmitter();\n\n /*\n * Assign to plot._ev while we still live in a land\n * where plot is a DOM element with stuff attached to it.\n * In the future we can make plot the event emitter itself.\n */\n plotObj._ev = ev;\n\n /*\n * Create a second event handler that will manage events *internally*.\n * This allows parts of plotly to respond to thing like relayout without\n * having to use the user-facing event handler. They cannot peacefully\n * coexist on the same handler because a user invoking\n * plotObj.removeAllListeners() would detach internal events, breaking\n * plotly.\n */\n plotObj._internalEv = internalEv;\n\n /*\n * Assign bound methods from the ev to the plot object. These methods\n * will reference the 'this' of plot._ev even though they are methods\n * of plot. This will keep the event machinery away from the plot object\n * which currently is often a DOM element but presents an API that will\n * continue to function when plot becomes an emitter. Not all EventEmitter\n * methods have been bound to `plot` as some do not currently add value to\n * the Plotly event API.\n */\n plotObj.on = ev.on.bind(ev);\n plotObj.once = ev.once.bind(ev);\n plotObj.removeListener = ev.removeListener.bind(ev);\n plotObj.removeAllListeners = ev.removeAllListeners.bind(ev);\n\n /*\n * Create functions for managing internal events. These are *only* triggered\n * by the mirroring of external events via the emit function.\n */\n plotObj._internalOn = internalEv.on.bind(internalEv);\n plotObj._internalOnce = internalEv.once.bind(internalEv);\n plotObj._removeInternalListener = internalEv.removeListener.bind(internalEv);\n plotObj._removeAllInternalListeners = internalEv.removeAllListeners.bind(internalEv);\n\n /*\n * We must wrap emit to continue to support JQuery events. The idea\n * is to check to see if the user is using JQuery events, if they are\n * we emit JQuery events to trigger user handlers as well as the EventEmitter\n * events.\n */\n plotObj.emit = function(event, data) {\n if(typeof jQuery !== 'undefined') {\n jQuery(plotObj).trigger(event, data);\n }\n\n ev.emit(event, data);\n internalEv.emit(event, data);\n };\n\n return plotObj;\n },\n\n /*\n * This function behaves like jQuery's triggerHandler. It calls\n * all handlers for a particular event and returns the return value\n * of the LAST handler. This function also triggers jQuery's\n * triggerHandler for backwards compatibility.\n */\n triggerHandler: function(plotObj, event, data) {\n var jQueryHandlerValue;\n var nodeEventHandlerValue;\n\n /*\n * If jQuery exists run all its handlers for this event and\n * collect the return value of the LAST handler function\n */\n if(typeof jQuery !== 'undefined') {\n jQueryHandlerValue = jQuery(plotObj).triggerHandler(event, data);\n }\n\n /*\n * Now run all the node style event handlers\n */\n var ev = plotObj._ev;\n if(!ev) return jQueryHandlerValue;\n\n var handlers = ev._events[event];\n if(!handlers) return jQueryHandlerValue;\n\n // making sure 'this' is the EventEmitter instance\n function apply(handler) {\n // The 'once' case, we can't just call handler() as we need\n // the return value here. So,\n // - remove handler\n // - call listener and grab return value!\n // - stash 'fired' key to not call handler twice\n if(handler.listener) {\n ev.removeListener(event, handler.listener);\n if(!handler.fired) {\n handler.fired = true;\n return handler.listener.apply(ev, [data]);\n }\n } else {\n return handler.apply(ev, [data]);\n }\n }\n\n // handlers can be function or an array of functions\n handlers = Array.isArray(handlers) ? handlers : [handlers];\n\n var i;\n for(i = 0; i < handlers.length - 1; i++) {\n apply(handlers[i]);\n }\n // now call the final handler and collect its value\n nodeEventHandlerValue = apply(handlers[i]);\n\n /*\n * Return either the jQuery handler value if it exists or the\n * nodeEventHandler value. jQuery event value supersedes nodejs\n * events for backwards compatibility reasons.\n */\n return jQueryHandlerValue !== undefined ?\n jQueryHandlerValue :\n nodeEventHandlerValue;\n },\n\n purge: function(plotObj) {\n delete plotObj._ev;\n delete plotObj.on;\n delete plotObj.once;\n delete plotObj.removeListener;\n delete plotObj.removeAllListeners;\n delete plotObj.emit;\n\n delete plotObj._ev;\n delete plotObj._internalEv;\n delete plotObj._internalOn;\n delete plotObj._internalOnce;\n delete plotObj._removeInternalListener;\n delete plotObj._removeAllInternalListeners;\n\n return plotObj;\n }\n\n};\n\nmodule.exports = Events;\n\n},{\"events\":107}],719:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isPlainObject = _dereq_('./is_plain_object.js');\nvar isArray = Array.isArray;\n\nfunction primitivesLoopSplice(source, target) {\n var i, value;\n for(i = 0; i < source.length; i++) {\n value = source[i];\n if(value !== null && typeof(value) === 'object') {\n return false;\n }\n if(value !== void(0)) {\n target[i] = value;\n }\n }\n return true;\n}\n\nexports.extendFlat = function() {\n return _extend(arguments, false, false, false);\n};\n\nexports.extendDeep = function() {\n return _extend(arguments, true, false, false);\n};\n\nexports.extendDeepAll = function() {\n return _extend(arguments, true, true, false);\n};\n\nexports.extendDeepNoArrays = function() {\n return _extend(arguments, true, false, true);\n};\n\n/*\n * Inspired by https://github.com/justmoon/node-extend/blob/master/index.js\n * All credit to the jQuery authors for perfecting this amazing utility.\n *\n * API difference with jQuery version:\n * - No optional boolean (true -> deep extend) first argument,\n * use `extendFlat` for first-level only extend and\n * use `extendDeep` for a deep extend.\n *\n * Other differences with jQuery version:\n * - Uses a modern (and faster) isPlainObject routine.\n * - Expected to work with object {} and array [] arguments only.\n * - Does not check for circular structure.\n * FYI: jQuery only does a check across one level.\n * Warning: this might result in infinite loops.\n *\n */\nfunction _extend(inputs, isDeep, keepAllKeys, noArrayCopies) {\n var target = inputs[0];\n var length = inputs.length;\n\n var input, key, src, copy, copyIsArray, clone, allPrimitives;\n\n // TODO does this do the right thing for typed arrays?\n\n if(length === 2 && isArray(target) && isArray(inputs[1]) && target.length === 0) {\n allPrimitives = primitivesLoopSplice(inputs[1], target);\n\n if(allPrimitives) {\n return target;\n } else {\n target.splice(0, target.length); // reset target and continue to next block\n }\n }\n\n for(var i = 1; i < length; i++) {\n input = inputs[i];\n\n for(key in input) {\n src = target[key];\n copy = input[key];\n\n if(noArrayCopies && isArray(copy)) {\n // Stop early and just transfer the array if array copies are disallowed:\n\n target[key] = copy;\n } else if(isDeep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n // recurse if we're merging plain objects or arrays\n\n if(copyIsArray) {\n copyIsArray = false;\n clone = src && isArray(src) ? src : [];\n } else {\n clone = src && isPlainObject(src) ? src : {};\n }\n\n // never move original objects, clone them\n target[key] = _extend([clone, copy], isDeep, keepAllKeys, noArrayCopies);\n } else if(typeof copy !== 'undefined' || keepAllKeys) {\n // don't bring in undefined values, except for extendDeepAll\n\n target[key] = copy;\n }\n }\n }\n\n return target;\n}\n\n},{\"./is_plain_object.js\":729}],720:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\n/**\n * Return news array containing only the unique items\n * found in input array.\n *\n * IMPORTANT: Note that items are considered unique\n * if `String({})` is unique. For example;\n *\n * Lib.filterUnique([ { a: 1 }, { b: 2 } ])\n *\n * returns [{ a: 1 }]\n *\n * and\n *\n * Lib.filterUnique([ '1', 1 ])\n *\n * returns ['1']\n *\n *\n * @param {array} array base array\n * @return {array} new filtered array\n */\nmodule.exports = function filterUnique(array) {\n var seen = {};\n var out = [];\n var j = 0;\n\n for(var i = 0; i < array.length; i++) {\n var item = array[i];\n\n if(seen[item] !== 1) {\n seen[item] = 1;\n out[j++] = item;\n }\n }\n\n return out;\n};\n\n},{}],721:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/** Filter out object items with visible !== true\n * insider array container.\n *\n * @param {array of objects} container\n * @return {array of objects} of length <= container\n *\n */\nmodule.exports = function filterVisible(container) {\n var filterFn = isCalcData(container) ? calcDataFilter : baseFilter;\n var out = [];\n\n for(var i = 0; i < container.length; i++) {\n var item = container[i];\n if(filterFn(item)) out.push(item);\n }\n\n return out;\n};\n\nfunction baseFilter(item) {\n return item.visible === true;\n}\n\nfunction calcDataFilter(item) {\n var trace = item[0].trace;\n return trace.visible === true && trace._length !== 0;\n}\n\nfunction isCalcData(cont) {\n return (\n Array.isArray(cont) &&\n Array.isArray(cont[0]) &&\n cont[0][0] &&\n cont[0][0].trace\n );\n}\n\n},{}],722:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar countryRegex = _dereq_('country-regex');\nvar turfArea = _dereq_('@turf/area');\nvar turfCentroid = _dereq_('@turf/centroid');\nvar turfBbox = _dereq_('@turf/bbox');\n\nvar identity = _dereq_('./identity');\nvar loggers = _dereq_('./loggers');\nvar isPlainObject = _dereq_('./is_plain_object');\nvar nestedProperty = _dereq_('./nested_property');\nvar polygon = _dereq_('./polygon');\n\n// make list of all country iso3 ids from at runtime\nvar countryIds = Object.keys(countryRegex);\n\nvar locationmodeToIdFinder = {\n 'ISO-3': identity,\n 'USA-states': identity,\n 'country names': countryNameToISO3\n};\n\nfunction countryNameToISO3(countryName) {\n for(var i = 0; i < countryIds.length; i++) {\n var iso3 = countryIds[i];\n var regex = new RegExp(countryRegex[iso3]);\n\n if(regex.test(countryName.trim().toLowerCase())) return iso3;\n }\n\n loggers.log('Unrecognized country name: ' + countryName + '.');\n\n return false;\n}\n\nfunction locationToFeature(locationmode, location, features) {\n if(!location || typeof location !== 'string') return false;\n\n var locationId = locationmodeToIdFinder[locationmode](location);\n var filteredFeatures;\n var f, i;\n\n if(locationId) {\n if(locationmode === 'USA-states') {\n // Filter out features out in USA\n //\n // This is important as the Natural Earth files\n // include state/provinces from USA, Canada, Australia and Brazil\n // which have some overlay in their two-letter ids. For example,\n // 'WA' is used for both Washington state and Western Australia.\n filteredFeatures = [];\n for(i = 0; i < features.length; i++) {\n f = features[i];\n if(f.properties && f.properties.gu && f.properties.gu === 'USA') {\n filteredFeatures.push(f);\n }\n }\n } else {\n filteredFeatures = features;\n }\n\n for(i = 0; i < filteredFeatures.length; i++) {\n f = filteredFeatures[i];\n if(f.id === locationId) return f;\n }\n\n loggers.log([\n 'Location with id', locationId,\n 'does not have a matching topojson feature at this resolution.'\n ].join(' '));\n }\n\n return false;\n}\n\nfunction feature2polygons(feature) {\n var geometry = feature.geometry;\n var coords = geometry.coordinates;\n var loc = feature.id;\n\n var polygons = [];\n var appendPolygon, j, k, m;\n\n function doesCrossAntiMerdian(pts) {\n for(var l = 0; l < pts.length - 1; l++) {\n if(pts[l][0] > 0 && pts[l + 1][0] < 0) return l;\n }\n return null;\n }\n\n if(loc === 'RUS' || loc === 'FJI') {\n // Russia and Fiji have landmasses that cross the antimeridian,\n // we need to add +360 to their longitude coordinates, so that\n // polygon 'contains' doesn't get confused when crossing the antimeridian.\n //\n // Note that other countries have polygons on either side of the antimeridian\n // (e.g. some Aleutian island for the USA), but those don't confuse\n // the 'contains' method; these are skipped here.\n appendPolygon = function(_pts) {\n var pts;\n\n if(doesCrossAntiMerdian(_pts) === null) {\n pts = _pts;\n } else {\n pts = new Array(_pts.length);\n for(m = 0; m < _pts.length; m++) {\n // do not mutate calcdata[i][j].geojson !!\n pts[m] = [\n _pts[m][0] < 0 ? _pts[m][0] + 360 : _pts[m][0],\n _pts[m][1]\n ];\n }\n }\n\n polygons.push(polygon.tester(pts));\n };\n } else if(loc === 'ATA') {\n // Antarctica has a landmass that wraps around every longitudes which\n // confuses the 'contains' methods.\n appendPolygon = function(pts) {\n var crossAntiMeridianIndex = doesCrossAntiMerdian(pts);\n\n // polygon that do not cross anti-meridian need no special handling\n if(crossAntiMeridianIndex === null) {\n return polygons.push(polygon.tester(pts));\n }\n\n // stitch polygon by adding pt over South Pole,\n // so that it covers the projected region covers all latitudes\n //\n // Note that the algorithm below only works for polygons that\n // start and end on longitude -180 (like the ones built by\n // https://github.com/etpinard/sane-topojson).\n var stitch = new Array(pts.length + 1);\n var si = 0;\n\n for(m = 0; m < pts.length; m++) {\n if(m > crossAntiMeridianIndex) {\n stitch[si++] = [pts[m][0] + 360, pts[m][1]];\n } else if(m === crossAntiMeridianIndex) {\n stitch[si++] = pts[m];\n stitch[si++] = [pts[m][0], -90];\n } else {\n stitch[si++] = pts[m];\n }\n }\n\n // polygon.tester by default appends pt[0] to the points list,\n // we must remove it here, to avoid a jump in longitude from 180 to -180,\n // that would confuse the 'contains' method\n var tester = polygon.tester(stitch);\n tester.pts.pop();\n polygons.push(tester);\n };\n } else {\n // otherwise using same array ref is fine\n appendPolygon = function(pts) {\n polygons.push(polygon.tester(pts));\n };\n }\n\n switch(geometry.type) {\n case 'MultiPolygon':\n for(j = 0; j < coords.length; j++) {\n for(k = 0; k < coords[j].length; k++) {\n appendPolygon(coords[j][k]);\n }\n }\n break;\n case 'Polygon':\n for(j = 0; j < coords.length; j++) {\n appendPolygon(coords[j]);\n }\n break;\n }\n\n return polygons;\n}\n\nfunction getTraceGeojson(trace) {\n var g = trace.geojson;\n var PlotlyGeoAssets = window.PlotlyGeoAssets || {};\n var geojsonIn = typeof g === 'string' ? PlotlyGeoAssets[g] : g;\n\n // This should not happen, but just in case something goes\n // really wrong when fetching the GeoJSON\n if(!isPlainObject(geojsonIn)) {\n loggers.error('Oops ... something went wrong when fetching ' + g);\n return false;\n }\n\n return geojsonIn;\n}\n\nfunction extractTraceFeature(calcTrace) {\n var trace = calcTrace[0].trace;\n\n var geojsonIn = getTraceGeojson(trace);\n if(!geojsonIn) return false;\n\n var lookup = {};\n var featuresOut = [];\n var i;\n\n for(i = 0; i < trace._length; i++) {\n var cdi = calcTrace[i];\n if(cdi.loc || cdi.loc === 0) {\n lookup[cdi.loc] = cdi;\n }\n }\n\n function appendFeature(fIn) {\n var id = nestedProperty(fIn, trace.featureidkey || 'id').get();\n var cdi = lookup[id];\n\n if(cdi) {\n var geometry = fIn.geometry;\n\n if(geometry.type === 'Polygon' || geometry.type === 'MultiPolygon') {\n var fOut = {\n type: 'Feature',\n id: id,\n geometry: geometry,\n properties: {}\n };\n\n // Compute centroid, add it to the properties\n fOut.properties.ct = findCentroid(fOut);\n\n // Mutate in in/out features into calcdata\n cdi.fIn = fIn;\n cdi.fOut = fOut;\n\n featuresOut.push(fOut);\n } else {\n loggers.log([\n 'Location', cdi.loc, 'does not have a valid GeoJSON geometry.',\n 'Traces with locationmode *geojson-id* only support',\n '*Polygon* and *MultiPolygon* geometries.'\n ].join(' '));\n }\n }\n\n // remove key from lookup, so that we can track (if any)\n // the locations that did not have a corresponding GeoJSON feature\n delete lookup[id];\n }\n\n switch(geojsonIn.type) {\n case 'FeatureCollection':\n var featuresIn = geojsonIn.features;\n for(i = 0; i < featuresIn.length; i++) {\n appendFeature(featuresIn[i]);\n }\n break;\n case 'Feature':\n appendFeature(geojsonIn);\n break;\n default:\n loggers.warn([\n 'Invalid GeoJSON type', (geojsonIn.type || 'none') + '.',\n 'Traces with locationmode *geojson-id* only support',\n '*FeatureCollection* and *Feature* types.'\n ].join(' '));\n return false;\n }\n\n for(var loc in lookup) {\n loggers.log([\n 'Location *' + loc + '*',\n 'does not have a matching feature with id-key',\n '*' + trace.featureidkey + '*.'\n ].join(' '));\n }\n\n return featuresOut;\n}\n\n// TODO this find the centroid of the polygon of maxArea\n// (just like we currently do for geo choropleth polygons),\n// maybe instead it would make more sense to compute the centroid\n// of each polygon and consider those on hover/select\nfunction findCentroid(feature) {\n var geometry = feature.geometry;\n var poly;\n\n if(geometry.type === 'MultiPolygon') {\n var coords = geometry.coordinates;\n var maxArea = 0;\n\n for(var i = 0; i < coords.length; i++) {\n var polyi = {type: 'Polygon', coordinates: coords[i]};\n var area = turfArea.default(polyi);\n if(area > maxArea) {\n maxArea = area;\n poly = polyi;\n }\n }\n } else {\n poly = geometry;\n }\n\n return turfCentroid.default(poly).geometry.coordinates;\n}\n\nfunction fetchTraceGeoData(calcData) {\n var PlotlyGeoAssets = window.PlotlyGeoAssets || {};\n var promises = [];\n\n function fetch(url) {\n return new Promise(function(resolve, reject) {\n d3.json(url, function(err, d) {\n if(err) {\n delete PlotlyGeoAssets[url];\n var msg = err.status === 404 ?\n ('GeoJSON at URL \"' + url + '\" does not exist.') :\n ('Unexpected error while fetching from ' + url);\n return reject(new Error(msg));\n }\n\n PlotlyGeoAssets[url] = d;\n return resolve(d);\n });\n });\n }\n\n function wait(url) {\n return new Promise(function(resolve, reject) {\n var cnt = 0;\n var interval = setInterval(function() {\n if(PlotlyGeoAssets[url] && PlotlyGeoAssets[url] !== 'pending') {\n clearInterval(interval);\n return resolve(PlotlyGeoAssets[url]);\n }\n if(cnt > 100) {\n clearInterval(interval);\n return reject('Unexpected error while fetching from ' + url);\n }\n cnt++;\n }, 50);\n });\n }\n\n for(var i = 0; i < calcData.length; i++) {\n var trace = calcData[i][0].trace;\n var url = trace.geojson;\n\n if(typeof url === 'string') {\n if(!PlotlyGeoAssets[url]) {\n PlotlyGeoAssets[url] = 'pending';\n promises.push(fetch(url));\n } else if(PlotlyGeoAssets[url] === 'pending') {\n promises.push(wait(url));\n }\n }\n }\n\n return promises;\n}\n\n// TODO `turf/bbox` gives wrong result when the input feature/geometry\n// crosses the anti-meridian. We should try to implement our own bbox logic.\nfunction computeBbox(d) {\n return turfBbox.default(d);\n}\n\nmodule.exports = {\n locationToFeature: locationToFeature,\n feature2polygons: feature2polygons,\n getTraceGeojson: getTraceGeojson,\n extractTraceFeature: extractTraceFeature,\n fetchTraceGeoData: fetchTraceGeoData,\n computeBbox: computeBbox\n};\n\n},{\"./identity\":727,\"./is_plain_object\":729,\"./loggers\":732,\"./nested_property\":736,\"./polygon\":740,\"@turf/area\":57,\"@turf/bbox\":58,\"@turf/centroid\":59,\"country-regex\":136,\"d3\":164}],723:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar BADNUM = _dereq_('../constants/numerical').BADNUM;\n\n/**\n * Convert calcTrace to GeoJSON 'MultiLineString' coordinate arrays\n *\n * @param {object} calcTrace\n * gd.calcdata item.\n * Note that calcTrace[i].lonlat is assumed to be defined\n *\n * @return {array}\n * return line coords array (or array of arrays)\n *\n */\nexports.calcTraceToLineCoords = function(calcTrace) {\n var trace = calcTrace[0].trace;\n var connectgaps = trace.connectgaps;\n\n var coords = [];\n var lineString = [];\n\n for(var i = 0; i < calcTrace.length; i++) {\n var calcPt = calcTrace[i];\n var lonlat = calcPt.lonlat;\n\n if(lonlat[0] !== BADNUM) {\n lineString.push(lonlat);\n } else if(!connectgaps && lineString.length > 0) {\n coords.push(lineString);\n lineString = [];\n }\n }\n\n if(lineString.length > 0) {\n coords.push(lineString);\n }\n\n return coords;\n};\n\n\n/**\n * Make line ('LineString' or 'MultiLineString') GeoJSON\n *\n * @param {array} coords\n * results form calcTraceToLineCoords\n * @return {object} out\n * GeoJSON object\n *\n */\nexports.makeLine = function(coords) {\n if(coords.length === 1) {\n return {\n type: 'LineString',\n coordinates: coords[0]\n };\n } else {\n return {\n type: 'MultiLineString',\n coordinates: coords\n };\n }\n};\n\n/**\n * Make polygon ('Polygon' or 'MultiPolygon') GeoJSON\n *\n * @param {array} coords\n * results form calcTraceToLineCoords\n * @return {object} out\n * GeoJSON object\n */\nexports.makePolygon = function(coords) {\n if(coords.length === 1) {\n return {\n type: 'Polygon',\n coordinates: coords\n };\n } else {\n var _coords = new Array(coords.length);\n\n for(var i = 0; i < coords.length; i++) {\n _coords[i] = [coords[i]];\n }\n\n return {\n type: 'MultiPolygon',\n coordinates: _coords\n };\n }\n};\n\n/**\n * Make blank GeoJSON\n *\n * @return {object}\n * Blank GeoJSON object\n *\n */\nexports.makeBlank = function() {\n return {\n type: 'Point',\n coordinates: []\n };\n};\n\n},{\"../constants/numerical\":704}],724:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar mod = _dereq_('./mod').mod;\n\n/*\n * look for intersection of two line segments\n * (1->2 and 3->4) - returns array [x,y] if they do, null if not\n */\nexports.segmentsIntersect = segmentsIntersect;\nfunction segmentsIntersect(x1, y1, x2, y2, x3, y3, x4, y4) {\n var a = x2 - x1;\n var b = x3 - x1;\n var c = x4 - x3;\n var d = y2 - y1;\n var e = y3 - y1;\n var f = y4 - y3;\n var det = a * f - c * d;\n // parallel lines? intersection is undefined\n // ignore the case where they are colinear\n if(det === 0) return null;\n var t = (b * f - c * e) / det;\n var u = (b * d - a * e) / det;\n // segments do not intersect?\n if(u < 0 || u > 1 || t < 0 || t > 1) return null;\n\n return {x: x1 + a * t, y: y1 + d * t};\n}\n\n/*\n * find the minimum distance between two line segments (1->2 and 3->4)\n */\nexports.segmentDistance = function segmentDistance(x1, y1, x2, y2, x3, y3, x4, y4) {\n if(segmentsIntersect(x1, y1, x2, y2, x3, y3, x4, y4)) return 0;\n\n // the two segments and their lengths squared\n var x12 = x2 - x1;\n var y12 = y2 - y1;\n var x34 = x4 - x3;\n var y34 = y4 - y3;\n var ll12 = x12 * x12 + y12 * y12;\n var ll34 = x34 * x34 + y34 * y34;\n\n // calculate distance squared, then take the sqrt at the very end\n var dist2 = Math.min(\n perpDistance2(x12, y12, ll12, x3 - x1, y3 - y1),\n perpDistance2(x12, y12, ll12, x4 - x1, y4 - y1),\n perpDistance2(x34, y34, ll34, x1 - x3, y1 - y3),\n perpDistance2(x34, y34, ll34, x2 - x3, y2 - y3)\n );\n\n return Math.sqrt(dist2);\n};\n\n/*\n * distance squared from segment ab to point c\n * [xab, yab] is the vector b-a\n * [xac, yac] is the vector c-a\n * llab is the length squared of (b-a), just to simplify calculation\n */\nfunction perpDistance2(xab, yab, llab, xac, yac) {\n var fcAB = (xac * xab + yac * yab);\n if(fcAB < 0) {\n // point c is closer to point a\n return xac * xac + yac * yac;\n } else if(fcAB > llab) {\n // point c is closer to point b\n var xbc = xac - xab;\n var ybc = yac - yab;\n return xbc * xbc + ybc * ybc;\n } else {\n // perpendicular distance is the shortest\n var crossProduct = xac * yab - yac * xab;\n return crossProduct * crossProduct / llab;\n }\n}\n\n// a very short-term cache for getTextLocation, just because\n// we're often looping over the same locations multiple times\n// invalidated as soon as we look at a different path\nvar locationCache, workingPath, workingTextWidth;\n\n// turn a path and position along it into x, y, and angle for the given text\nexports.getTextLocation = function getTextLocation(path, totalPathLen, positionOnPath, textWidth) {\n if(path !== workingPath || textWidth !== workingTextWidth) {\n locationCache = {};\n workingPath = path;\n workingTextWidth = textWidth;\n }\n if(locationCache[positionOnPath]) {\n return locationCache[positionOnPath];\n }\n\n // for the angle, use points on the path separated by the text width\n // even though due to curvature, the text will cover a bit more than that\n var p0 = path.getPointAtLength(mod(positionOnPath - textWidth / 2, totalPathLen));\n var p1 = path.getPointAtLength(mod(positionOnPath + textWidth / 2, totalPathLen));\n // note: atan handles 1/0 nicely\n var theta = Math.atan((p1.y - p0.y) / (p1.x - p0.x));\n // center the text at 2/3 of the center position plus 1/3 the p0/p1 midpoint\n // that's the average position of this segment, assuming it's roughly quadratic\n var pCenter = path.getPointAtLength(mod(positionOnPath, totalPathLen));\n var x = (pCenter.x * 4 + p0.x + p1.x) / 6;\n var y = (pCenter.y * 4 + p0.y + p1.y) / 6;\n\n var out = {x: x, y: y, theta: theta};\n locationCache[positionOnPath] = out;\n return out;\n};\n\nexports.clearLocationCache = function() {\n workingPath = null;\n};\n\n/*\n * Find the segment of `path` that's within the visible area\n * given by `bounds` {left, right, top, bottom}, to within a\n * precision of `buffer` px\n *\n * returns: undefined if nothing is visible, else object:\n * {\n * min: position where the path first enters bounds, or 0 if it\n * starts within bounds\n * max: position where the path last exits bounds, or the path length\n * if it finishes within bounds\n * len: max - min, ie the length of visible path\n * total: the total path length - just included so the caller doesn't\n * need to call path.getTotalLength() again\n * isClosed: true iff the start and end points of the path are both visible\n * and are at the same point\n * }\n *\n * Works by starting from either end and repeatedly finding the distance from\n * that point to the plot area, and if it's outside the plot, moving along the\n * path by that distance (because the plot must be at least that far away on\n * the path). Note that if a path enters, exits, and re-enters the plot, we\n * will not capture this behavior.\n */\nexports.getVisibleSegment = function getVisibleSegment(path, bounds, buffer) {\n var left = bounds.left;\n var right = bounds.right;\n var top = bounds.top;\n var bottom = bounds.bottom;\n\n var pMin = 0;\n var pTotal = path.getTotalLength();\n var pMax = pTotal;\n\n var pt0, ptTotal;\n\n function getDistToPlot(len) {\n var pt = path.getPointAtLength(len);\n\n // hold on to the start and end points for `closed`\n if(len === 0) pt0 = pt;\n else if(len === pTotal) ptTotal = pt;\n\n var dx = (pt.x < left) ? left - pt.x : (pt.x > right ? pt.x - right : 0);\n var dy = (pt.y < top) ? top - pt.y : (pt.y > bottom ? pt.y - bottom : 0);\n return Math.sqrt(dx * dx + dy * dy);\n }\n\n var distToPlot = getDistToPlot(pMin);\n while(distToPlot) {\n pMin += distToPlot + buffer;\n if(pMin > pMax) return;\n distToPlot = getDistToPlot(pMin);\n }\n\n distToPlot = getDistToPlot(pMax);\n while(distToPlot) {\n pMax -= distToPlot + buffer;\n if(pMin > pMax) return;\n distToPlot = getDistToPlot(pMax);\n }\n\n return {\n min: pMin,\n max: pMax,\n len: pMax - pMin,\n total: pTotal,\n isClosed: pMin === 0 && pMax === pTotal &&\n Math.abs(pt0.x - ptTotal.x) < 0.1 &&\n Math.abs(pt0.y - ptTotal.y) < 0.1\n };\n};\n\n/**\n * Find point on SVG path corresponding to a given constraint coordinate\n *\n * @param {SVGPathElement} path\n * @param {Number} val : constraint coordinate value\n * @param {String} coord : 'x' or 'y' the constraint coordinate\n * @param {Object} opts :\n * - {Number} pathLength : supply total path length before hand\n * - {Number} tolerance\n * - {Number} iterationLimit\n * @return {SVGPoint}\n */\nexports.findPointOnPath = function findPointOnPath(path, val, coord, opts) {\n opts = opts || {};\n\n var pathLength = opts.pathLength || path.getTotalLength();\n var tolerance = opts.tolerance || 1e-3;\n var iterationLimit = opts.iterationLimit || 30;\n\n // if path starts at a val greater than the path tail (like on vertical violins),\n // we must flip the sign of the computed diff.\n var mul = path.getPointAtLength(0)[coord] > path.getPointAtLength(pathLength)[coord] ? -1 : 1;\n\n var i = 0;\n var b0 = 0;\n var b1 = pathLength;\n var mid;\n var pt;\n var diff;\n\n while(i < iterationLimit) {\n mid = (b0 + b1) / 2;\n pt = path.getPointAtLength(mid);\n diff = pt[coord] - val;\n\n if(Math.abs(diff) < tolerance) {\n return pt;\n } else {\n if(mul * diff > 0) {\n b1 = mid;\n } else {\n b0 = mid;\n }\n i++;\n }\n }\n return pt;\n};\n\n},{\"./mod\":735}],725:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar tinycolor = _dereq_('tinycolor2');\nvar rgba = _dereq_('color-normalize');\n\nvar Colorscale = _dereq_('../components/colorscale');\nvar colorDflt = _dereq_('../components/color/attributes').defaultLine;\nvar isArrayOrTypedArray = _dereq_('./array').isArrayOrTypedArray;\n\nvar colorDfltRgba = rgba(colorDflt);\nvar opacityDflt = 1;\n\nfunction calculateColor(colorIn, opacityIn) {\n var colorOut = colorIn;\n colorOut[3] *= opacityIn;\n return colorOut;\n}\n\nfunction validateColor(colorIn) {\n if(isNumeric(colorIn)) return colorDfltRgba;\n\n var colorOut = rgba(colorIn);\n\n return colorOut.length ? colorOut : colorDfltRgba;\n}\n\nfunction validateOpacity(opacityIn) {\n return isNumeric(opacityIn) ? opacityIn : opacityDflt;\n}\n\nfunction formatColor(containerIn, opacityIn, len) {\n var colorIn = containerIn.color;\n var isArrayColorIn = isArrayOrTypedArray(colorIn);\n var isArrayOpacityIn = isArrayOrTypedArray(opacityIn);\n var cOpts = Colorscale.extractOpts(containerIn);\n var colorOut = [];\n\n var sclFunc, getColor, getOpacity, colori, opacityi;\n\n if(cOpts.colorscale !== undefined) {\n sclFunc = Colorscale.makeColorScaleFuncFromTrace(containerIn);\n } else {\n sclFunc = validateColor;\n }\n\n if(isArrayColorIn) {\n getColor = function(c, i) {\n // FIXME: there is double work, considering that sclFunc does the opposite\n return c[i] === undefined ? colorDfltRgba : rgba(sclFunc(c[i]));\n };\n } else getColor = validateColor;\n\n if(isArrayOpacityIn) {\n getOpacity = function(o, i) {\n return o[i] === undefined ? opacityDflt : validateOpacity(o[i]);\n };\n } else getOpacity = validateOpacity;\n\n if(isArrayColorIn || isArrayOpacityIn) {\n for(var i = 0; i < len; i++) {\n colori = getColor(colorIn, i);\n opacityi = getOpacity(opacityIn, i);\n colorOut[i] = calculateColor(colori, opacityi);\n }\n } else colorOut = calculateColor(rgba(colorIn), opacityIn);\n\n return colorOut;\n}\n\nfunction parseColorScale(cont, alpha) {\n if(alpha === undefined) alpha = 1;\n\n var cOpts = Colorscale.extractOpts(cont);\n\n var colorscale = cOpts.reversescale ?\n Colorscale.flipScale(cOpts.colorscale) :\n cOpts.colorscale;\n\n return colorscale.map(function(elem) {\n var index = elem[0];\n var color = tinycolor(elem[1]);\n var rgb = color.toRgb();\n return {\n index: index,\n rgb: [rgb.r, rgb.g, rgb.b, alpha]\n };\n });\n}\n\nmodule.exports = {\n formatColor: formatColor,\n parseColorScale: parseColorScale\n};\n\n},{\"../components/color/attributes\":594,\"../components/colorscale\":607,\"./array\":711,\"color-normalize\":122,\"fast-isnumeric\":236,\"tinycolor2\":528}],726:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar identity = _dereq_('./identity');\n\nfunction wrap(d) {return [d];}\n\nmodule.exports = {\n\n // The D3 data binding concept and the General Update Pattern promotes the idea of\n // traversing into the scenegraph by using the `.data(fun, keyFun)` call.\n // The `fun` is most often a `repeat`, ie. the elements beneath a `` element need\n // access to the same data, or a `descend`, which fans a scenegraph node into a bunch of\n // of elements, e.g. points, lines, rows, requiring an array as input.\n // The role of the `keyFun` is to identify what elements are being entered/exited/updated,\n // otherwise D3 reverts to using a plain index which would screw up `transition`s.\n keyFun: function(d) {return d.key;},\n repeat: wrap,\n descend: identity,\n\n // Plotly.js uses a convention of storing the actual contents of the `calcData` as the\n // element zero of a container array. These helpers are just used for clarity as a\n // newcomer to the codebase may not know what the `[0]` is, and whether there can be further\n // elements (not atm).\n wrap: wrap,\n unwrap: function(d) {return d[0];}\n};\n\n},{\"./identity\":727}],727:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n// Simple helper functions\n// none of these need any external deps\n\nmodule.exports = function identity(d) { return d; };\n\n},{}],728:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar numConstants = _dereq_('../constants/numerical');\nvar FP_SAFE = numConstants.FP_SAFE;\nvar BADNUM = numConstants.BADNUM;\n\nvar lib = module.exports = {};\n\nlib.nestedProperty = _dereq_('./nested_property');\nlib.keyedContainer = _dereq_('./keyed_container');\nlib.relativeAttr = _dereq_('./relative_attr');\nlib.isPlainObject = _dereq_('./is_plain_object');\nlib.toLogRange = _dereq_('./to_log_range');\nlib.relinkPrivateKeys = _dereq_('./relink_private');\n\nvar arrayModule = _dereq_('./array');\nlib.isTypedArray = arrayModule.isTypedArray;\nlib.isArrayOrTypedArray = arrayModule.isArrayOrTypedArray;\nlib.isArray1D = arrayModule.isArray1D;\nlib.ensureArray = arrayModule.ensureArray;\nlib.concat = arrayModule.concat;\nlib.maxRowLength = arrayModule.maxRowLength;\nlib.minRowLength = arrayModule.minRowLength;\n\nvar modModule = _dereq_('./mod');\nlib.mod = modModule.mod;\nlib.modHalf = modModule.modHalf;\n\nvar coerceModule = _dereq_('./coerce');\nlib.valObjectMeta = coerceModule.valObjectMeta;\nlib.coerce = coerceModule.coerce;\nlib.coerce2 = coerceModule.coerce2;\nlib.coerceFont = coerceModule.coerceFont;\nlib.coerceHoverinfo = coerceModule.coerceHoverinfo;\nlib.coerceSelectionMarkerOpacity = coerceModule.coerceSelectionMarkerOpacity;\nlib.validate = coerceModule.validate;\n\nvar datesModule = _dereq_('./dates');\nlib.dateTime2ms = datesModule.dateTime2ms;\nlib.isDateTime = datesModule.isDateTime;\nlib.ms2DateTime = datesModule.ms2DateTime;\nlib.ms2DateTimeLocal = datesModule.ms2DateTimeLocal;\nlib.cleanDate = datesModule.cleanDate;\nlib.isJSDate = datesModule.isJSDate;\nlib.formatDate = datesModule.formatDate;\nlib.incrementMonth = datesModule.incrementMonth;\nlib.dateTick0 = datesModule.dateTick0;\nlib.dfltRange = datesModule.dfltRange;\nlib.findExactDates = datesModule.findExactDates;\nlib.MIN_MS = datesModule.MIN_MS;\nlib.MAX_MS = datesModule.MAX_MS;\n\nvar searchModule = _dereq_('./search');\nlib.findBin = searchModule.findBin;\nlib.sorterAsc = searchModule.sorterAsc;\nlib.sorterDes = searchModule.sorterDes;\nlib.distinctVals = searchModule.distinctVals;\nlib.roundUp = searchModule.roundUp;\nlib.sort = searchModule.sort;\nlib.findIndexOfMin = searchModule.findIndexOfMin;\n\nvar statsModule = _dereq_('./stats');\nlib.aggNums = statsModule.aggNums;\nlib.len = statsModule.len;\nlib.mean = statsModule.mean;\nlib.median = statsModule.median;\nlib.midRange = statsModule.midRange;\nlib.variance = statsModule.variance;\nlib.stdev = statsModule.stdev;\nlib.interp = statsModule.interp;\n\nvar matrixModule = _dereq_('./matrix');\nlib.init2dArray = matrixModule.init2dArray;\nlib.transposeRagged = matrixModule.transposeRagged;\nlib.dot = matrixModule.dot;\nlib.translationMatrix = matrixModule.translationMatrix;\nlib.rotationMatrix = matrixModule.rotationMatrix;\nlib.rotationXYMatrix = matrixModule.rotationXYMatrix;\nlib.apply2DTransform = matrixModule.apply2DTransform;\nlib.apply2DTransform2 = matrixModule.apply2DTransform2;\n\nvar anglesModule = _dereq_('./angles');\nlib.deg2rad = anglesModule.deg2rad;\nlib.rad2deg = anglesModule.rad2deg;\nlib.angleDelta = anglesModule.angleDelta;\nlib.angleDist = anglesModule.angleDist;\nlib.isFullCircle = anglesModule.isFullCircle;\nlib.isAngleInsideSector = anglesModule.isAngleInsideSector;\nlib.isPtInsideSector = anglesModule.isPtInsideSector;\nlib.pathArc = anglesModule.pathArc;\nlib.pathSector = anglesModule.pathSector;\nlib.pathAnnulus = anglesModule.pathAnnulus;\n\nvar anchorUtils = _dereq_('./anchor_utils');\nlib.isLeftAnchor = anchorUtils.isLeftAnchor;\nlib.isCenterAnchor = anchorUtils.isCenterAnchor;\nlib.isRightAnchor = anchorUtils.isRightAnchor;\nlib.isTopAnchor = anchorUtils.isTopAnchor;\nlib.isMiddleAnchor = anchorUtils.isMiddleAnchor;\nlib.isBottomAnchor = anchorUtils.isBottomAnchor;\n\nvar geom2dModule = _dereq_('./geometry2d');\nlib.segmentsIntersect = geom2dModule.segmentsIntersect;\nlib.segmentDistance = geom2dModule.segmentDistance;\nlib.getTextLocation = geom2dModule.getTextLocation;\nlib.clearLocationCache = geom2dModule.clearLocationCache;\nlib.getVisibleSegment = geom2dModule.getVisibleSegment;\nlib.findPointOnPath = geom2dModule.findPointOnPath;\n\nvar extendModule = _dereq_('./extend');\nlib.extendFlat = extendModule.extendFlat;\nlib.extendDeep = extendModule.extendDeep;\nlib.extendDeepAll = extendModule.extendDeepAll;\nlib.extendDeepNoArrays = extendModule.extendDeepNoArrays;\n\nvar loggersModule = _dereq_('./loggers');\nlib.log = loggersModule.log;\nlib.warn = loggersModule.warn;\nlib.error = loggersModule.error;\n\nvar regexModule = _dereq_('./regex');\nlib.counterRegex = regexModule.counter;\n\nvar throttleModule = _dereq_('./throttle');\nlib.throttle = throttleModule.throttle;\nlib.throttleDone = throttleModule.done;\nlib.clearThrottle = throttleModule.clear;\n\nvar domModule = _dereq_('./dom');\nlib.getGraphDiv = domModule.getGraphDiv;\nlib.isPlotDiv = domModule.isPlotDiv;\nlib.removeElement = domModule.removeElement;\nlib.addStyleRule = domModule.addStyleRule;\nlib.addRelatedStyleRule = domModule.addRelatedStyleRule;\nlib.deleteRelatedStyleRule = domModule.deleteRelatedStyleRule;\n\nlib.clearResponsive = _dereq_('./clear_responsive');\n\nlib.makeTraceGroups = _dereq_('./make_trace_groups');\n\nlib._ = _dereq_('./localize');\n\nlib.notifier = _dereq_('./notifier');\n\nlib.filterUnique = _dereq_('./filter_unique');\nlib.filterVisible = _dereq_('./filter_visible');\nlib.pushUnique = _dereq_('./push_unique');\n\nlib.cleanNumber = _dereq_('./clean_number');\n\nlib.ensureNumber = function ensureNumber(v) {\n if(!isNumeric(v)) return BADNUM;\n v = Number(v);\n if(v < -FP_SAFE || v > FP_SAFE) return BADNUM;\n return isNumeric(v) ? Number(v) : BADNUM;\n};\n\n/**\n * Is v a valid array index? Accepts numeric strings as well as numbers.\n *\n * @param {any} v: the value to test\n * @param {Optional[integer]} len: the array length we are indexing\n *\n * @return {bool}: v is a valid array index\n */\nlib.isIndex = function(v, len) {\n if(len !== undefined && v >= len) return false;\n return isNumeric(v) && (v >= 0) && (v % 1 === 0);\n};\n\nlib.noop = _dereq_('./noop');\nlib.identity = _dereq_('./identity');\n\n/**\n * create an array of length 'cnt' filled with 'v' at all indices\n *\n * @param {any} v\n * @param {number} cnt\n * @return {array}\n */\nlib.repeat = function(v, cnt) {\n var out = new Array(cnt);\n for(var i = 0; i < cnt; i++) {\n out[i] = v;\n }\n return out;\n};\n\n/**\n * swap x and y of the same attribute in container cont\n * specify attr with a ? in place of x/y\n * you can also swap other things than x/y by providing part1 and part2\n */\nlib.swapAttrs = function(cont, attrList, part1, part2) {\n if(!part1) part1 = 'x';\n if(!part2) part2 = 'y';\n for(var i = 0; i < attrList.length; i++) {\n var attr = attrList[i];\n var xp = lib.nestedProperty(cont, attr.replace('?', part1));\n var yp = lib.nestedProperty(cont, attr.replace('?', part2));\n var temp = xp.get();\n xp.set(yp.get());\n yp.set(temp);\n }\n};\n\n/**\n * SVG painter's algo worked around with reinsertion\n */\nlib.raiseToTop = function raiseToTop(elem) {\n elem.parentNode.appendChild(elem);\n};\n\n/**\n * cancel a possibly pending transition; returned selection may be used by caller\n */\nlib.cancelTransition = function(selection) {\n return selection.transition().duration(0);\n};\n\n// constrain - restrict a number v to be between v0 and v1\nlib.constrain = function(v, v0, v1) {\n if(v0 > v1) return Math.max(v1, Math.min(v0, v));\n return Math.max(v0, Math.min(v1, v));\n};\n\n/**\n * do two bounding boxes from getBoundingClientRect,\n * ie {left,right,top,bottom,width,height}, overlap?\n * takes optional padding pixels\n */\nlib.bBoxIntersect = function(a, b, pad) {\n pad = pad || 0;\n return (a.left <= b.right + pad &&\n b.left <= a.right + pad &&\n a.top <= b.bottom + pad &&\n b.top <= a.bottom + pad);\n};\n\n/*\n * simpleMap: alternative to Array.map that only\n * passes on the element and up to 2 extra args you\n * provide (but not the array index or the whole array)\n *\n * array: the array to map it to\n * func: the function to apply\n * x1, x2: optional extra args\n */\nlib.simpleMap = function(array, func, x1, x2, opts) {\n var len = array.length;\n var out = new Array(len);\n for(var i = 0; i < len; i++) out[i] = func(array[i], x1, x2, opts);\n return out;\n};\n\n/**\n * Random string generator\n *\n * @param {object} existing\n * pass in strings to avoid as keys with truthy values\n * @param {int} bits\n * bits of information in the output string, default 24\n * @param {int} base\n * base of string representation, default 16. Should be a power of 2.\n */\nlib.randstr = function randstr(existing, bits, base, _recursion) {\n if(!base) base = 16;\n if(bits === undefined) bits = 24;\n if(bits <= 0) return '0';\n\n var digits = Math.log(Math.pow(2, bits)) / Math.log(base);\n var res = '';\n var i, b, x;\n\n for(i = 2; digits === Infinity; i *= 2) {\n digits = Math.log(Math.pow(2, bits / i)) / Math.log(base) * i;\n }\n\n var rem = digits - Math.floor(digits);\n\n for(i = 0; i < Math.floor(digits); i++) {\n x = Math.floor(Math.random() * base).toString(base);\n res = x + res;\n }\n\n if(rem) {\n b = Math.pow(base, rem);\n x = Math.floor(Math.random() * b).toString(base);\n res = x + res;\n }\n\n var parsed = parseInt(res, base);\n if((existing && existing[res]) ||\n (parsed !== Infinity && parsed >= Math.pow(2, bits))) {\n if(_recursion > 10) {\n lib.warn('randstr failed uniqueness');\n return res;\n }\n return randstr(existing, bits, base, (_recursion || 0) + 1);\n } else return res;\n};\n\nlib.OptionControl = function(opt, optname) {\n /*\n * An environment to contain all option setters and\n * getters that collectively modify opts.\n *\n * You can call up opts from any function in new object\n * as this.optname || this.opt\n *\n * See FitOpts for example of usage\n */\n if(!opt) opt = {};\n if(!optname) optname = 'opt';\n\n var self = {};\n self.optionList = [];\n\n self._newoption = function(optObj) {\n optObj[optname] = opt;\n self[optObj.name] = optObj;\n self.optionList.push(optObj);\n };\n\n self['_' + optname] = opt;\n return self;\n};\n\n/**\n * lib.smooth: smooth arrayIn by convolving with\n * a hann window with given full width at half max\n * bounce the ends in, so the output has the same length as the input\n */\nlib.smooth = function(arrayIn, FWHM) {\n FWHM = Math.round(FWHM) || 0; // only makes sense for integers\n if(FWHM < 2) return arrayIn;\n\n var alen = arrayIn.length;\n var alen2 = 2 * alen;\n var wlen = 2 * FWHM - 1;\n var w = new Array(wlen);\n var arrayOut = new Array(alen);\n var i;\n var j;\n var k;\n var v;\n\n // first make the window array\n for(i = 0; i < wlen; i++) {\n w[i] = (1 - Math.cos(Math.PI * (i + 1) / FWHM)) / (2 * FWHM);\n }\n\n // now do the convolution\n for(i = 0; i < alen; i++) {\n v = 0;\n for(j = 0; j < wlen; j++) {\n k = i + j + 1 - FWHM;\n\n // multibounce\n if(k < -alen) k -= alen2 * Math.round(k / alen2);\n else if(k >= alen2) k -= alen2 * Math.floor(k / alen2);\n\n // single bounce\n if(k < 0) k = - 1 - k;\n else if(k >= alen) k = alen2 - 1 - k;\n\n v += arrayIn[k] * w[j];\n }\n arrayOut[i] = v;\n }\n\n return arrayOut;\n};\n\n/**\n * syncOrAsync: run a sequence of functions synchronously\n * as long as its returns are not promises (ie have no .then)\n * includes one argument arg to send to all functions...\n * this is mainly just to prevent us having to make wrapper functions\n * when the only purpose of the wrapper is to reference gd\n * and a final step to be executed at the end\n * TODO: if there's an error and everything is sync,\n * this doesn't happen yet because we want to make sure\n * that it gets reported\n */\nlib.syncOrAsync = function(sequence, arg, finalStep) {\n var ret, fni;\n\n function continueAsync() {\n return lib.syncOrAsync(sequence, arg, finalStep);\n }\n\n while(sequence.length) {\n fni = sequence.splice(0, 1)[0];\n ret = fni(arg);\n\n if(ret && ret.then) {\n return ret.then(continueAsync)\n .then(undefined, lib.promiseError);\n }\n }\n\n return finalStep && finalStep(arg);\n};\n\n\n/**\n * Helper to strip trailing slash, from\n * http://stackoverflow.com/questions/6680825/return-string-without-trailing-slash\n */\nlib.stripTrailingSlash = function(str) {\n if(str.substr(-1) === '/') return str.substr(0, str.length - 1);\n return str;\n};\n\nlib.noneOrAll = function(containerIn, containerOut, attrList) {\n /**\n * some attributes come together, so if you have one of them\n * in the input, you should copy the default values of the others\n * to the input as well.\n */\n if(!containerIn) return;\n\n var hasAny = false;\n var hasAll = true;\n var i;\n var val;\n\n for(i = 0; i < attrList.length; i++) {\n val = containerIn[attrList[i]];\n if(val !== undefined && val !== null) hasAny = true;\n else hasAll = false;\n }\n\n if(hasAny && !hasAll) {\n for(i = 0; i < attrList.length; i++) {\n containerIn[attrList[i]] = containerOut[attrList[i]];\n }\n }\n};\n\n/** merges calcdata field (given by cdAttr) with traceAttr values\n *\n * N.B. Loop over minimum of cd.length and traceAttr.length\n * i.e. it does not try to fill in beyond traceAttr.length-1\n *\n * @param {array} traceAttr : trace attribute\n * @param {object} cd : calcdata trace\n * @param {string} cdAttr : calcdata key\n */\nlib.mergeArray = function(traceAttr, cd, cdAttr, fn) {\n var hasFn = typeof fn === 'function';\n if(lib.isArrayOrTypedArray(traceAttr)) {\n var imax = Math.min(traceAttr.length, cd.length);\n for(var i = 0; i < imax; i++) {\n var v = traceAttr[i];\n cd[i][cdAttr] = hasFn ? fn(v) : v;\n }\n }\n};\n\n// cast numbers to positive numbers, returns 0 if not greater than 0\nlib.mergeArrayCastPositive = function(traceAttr, cd, cdAttr) {\n return lib.mergeArray(traceAttr, cd, cdAttr, function(v) {\n var w = +v;\n return !isFinite(w) ? 0 : w > 0 ? w : 0;\n });\n};\n\n/** fills calcdata field (given by cdAttr) with traceAttr values\n * or function of traceAttr values (e.g. some fallback)\n *\n * N.B. Loops over all cd items.\n *\n * @param {array} traceAttr : trace attribute\n * @param {object} cd : calcdata trace\n * @param {string} cdAttr : calcdata key\n * @param {function} [fn] : optional function to apply to each array item\n */\nlib.fillArray = function(traceAttr, cd, cdAttr, fn) {\n fn = fn || lib.identity;\n\n if(lib.isArrayOrTypedArray(traceAttr)) {\n for(var i = 0; i < cd.length; i++) {\n cd[i][cdAttr] = fn(traceAttr[i]);\n }\n }\n};\n\n/** Handler for trace-wide vs per-point options\n *\n * @param {object} trace : (full) trace object\n * @param {number} ptNumber : index of the point in question\n * @param {string} astr : attribute string\n * @param {function} [fn] : optional function to apply to each array item\n *\n * @return {any}\n */\nlib.castOption = function(trace, ptNumber, astr, fn) {\n fn = fn || lib.identity;\n\n var val = lib.nestedProperty(trace, astr).get();\n\n if(lib.isArrayOrTypedArray(val)) {\n if(Array.isArray(ptNumber) && lib.isArrayOrTypedArray(val[ptNumber[0]])) {\n return fn(val[ptNumber[0]][ptNumber[1]]);\n } else {\n return fn(val[ptNumber]);\n }\n } else {\n return val;\n }\n};\n\n/** Extract option from calcdata item, correctly falling back to\n * trace value if not found.\n *\n * @param {object} calcPt : calcdata[i][j] item\n * @param {object} trace : (full) trace object\n * @param {string} calcKey : calcdata key\n * @param {string} traceKey : aka trace attribute string\n * @return {any}\n */\nlib.extractOption = function(calcPt, trace, calcKey, traceKey) {\n if(calcKey in calcPt) return calcPt[calcKey];\n\n // fallback to trace value,\n // must check if value isn't itself an array\n // which means the trace attribute has a corresponding\n // calcdata key, but its value is falsy\n var traceVal = lib.nestedProperty(trace, traceKey).get();\n if(!Array.isArray(traceVal)) return traceVal;\n};\n\nfunction makePtIndex2PtNumber(indexToPoints) {\n var ptIndex2ptNumber = {};\n for(var k in indexToPoints) {\n var pts = indexToPoints[k];\n for(var j = 0; j < pts.length; j++) {\n ptIndex2ptNumber[pts[j]] = +k;\n }\n }\n return ptIndex2ptNumber;\n}\n\n/** Tag selected calcdata items\n *\n * N.B. note that point 'index' corresponds to input data array index\n * whereas 'number' is its post-transform version.\n *\n * @param {array} calcTrace\n * @param {object} trace\n * - selectedpoints {array}\n * - _indexToPoints {object}\n * @param {ptNumber2cdIndex} ptNumber2cdIndex (optional)\n * optional map object for trace types that do not have 1-to-1 point number to\n * calcdata item index correspondence (e.g. histogram)\n */\nlib.tagSelected = function(calcTrace, trace, ptNumber2cdIndex) {\n var selectedpoints = trace.selectedpoints;\n var indexToPoints = trace._indexToPoints;\n var ptIndex2ptNumber;\n\n // make pt index-to-number map object, which takes care of transformed traces\n if(indexToPoints) {\n ptIndex2ptNumber = makePtIndex2PtNumber(indexToPoints);\n }\n\n function isCdIndexValid(v) {\n return v !== undefined && v < calcTrace.length;\n }\n\n for(var i = 0; i < selectedpoints.length; i++) {\n var ptIndex = selectedpoints[i];\n\n if(lib.isIndex(ptIndex) ||\n (lib.isArrayOrTypedArray(ptIndex) && lib.isIndex(ptIndex[0]) && lib.isIndex(ptIndex[1]))\n ) {\n var ptNumber = ptIndex2ptNumber ? ptIndex2ptNumber[ptIndex] : ptIndex;\n var cdIndex = ptNumber2cdIndex ? ptNumber2cdIndex[ptNumber] : ptNumber;\n\n if(isCdIndexValid(cdIndex)) {\n calcTrace[cdIndex].selected = 1;\n }\n }\n }\n};\n\nlib.selIndices2selPoints = function(trace) {\n var selectedpoints = trace.selectedpoints;\n var indexToPoints = trace._indexToPoints;\n\n if(indexToPoints) {\n var ptIndex2ptNumber = makePtIndex2PtNumber(indexToPoints);\n var out = [];\n\n for(var i = 0; i < selectedpoints.length; i++) {\n var ptIndex = selectedpoints[i];\n if(lib.isIndex(ptIndex)) {\n var ptNumber = ptIndex2ptNumber[ptIndex];\n if(lib.isIndex(ptNumber)) {\n out.push(ptNumber);\n }\n }\n }\n\n return out;\n } else {\n return selectedpoints;\n }\n};\n\n/** Returns target as set by 'target' transform attribute\n *\n * @param {object} trace : full trace object\n * @param {object} transformOpts : transform option object\n * - target (string} :\n * either an attribute string referencing an array in the trace object, or\n * a set array.\n *\n * @return {array or false} : the target array (NOT a copy!!) or false if invalid\n */\nlib.getTargetArray = function(trace, transformOpts) {\n var target = transformOpts.target;\n\n if(typeof target === 'string' && target) {\n var array = lib.nestedProperty(trace, target).get();\n return Array.isArray(array) ? array : false;\n } else if(Array.isArray(target)) {\n return target;\n }\n\n return false;\n};\n\n/**\n * modified version of jQuery's extend to strip out private objs and functions,\n * and cut arrays down to first or 1 elements\n * because extend-like algorithms are hella slow\n * obj2 is assumed to already be clean of these things (including no arrays)\n */\nlib.minExtend = function(obj1, obj2) {\n var objOut = {};\n if(typeof obj2 !== 'object') obj2 = {};\n var arrayLen = 3;\n var keys = Object.keys(obj1);\n var i, k, v;\n\n for(i = 0; i < keys.length; i++) {\n k = keys[i];\n v = obj1[k];\n if(k.charAt(0) === '_' || typeof v === 'function') continue;\n else if(k === 'module') objOut[k] = v;\n else if(Array.isArray(v)) {\n if(k === 'colorscale') {\n objOut[k] = v.slice();\n } else {\n objOut[k] = v.slice(0, arrayLen);\n }\n } else if(lib.isTypedArray(v)) {\n objOut[k] = v.subarray(0, arrayLen);\n } else if(v && (typeof v === 'object')) objOut[k] = lib.minExtend(obj1[k], obj2[k]);\n else objOut[k] = v;\n }\n\n keys = Object.keys(obj2);\n for(i = 0; i < keys.length; i++) {\n k = keys[i];\n v = obj2[k];\n if(typeof v !== 'object' || !(k in objOut) || typeof objOut[k] !== 'object') {\n objOut[k] = v;\n }\n }\n\n return objOut;\n};\n\nlib.titleCase = function(s) {\n return s.charAt(0).toUpperCase() + s.substr(1);\n};\n\nlib.containsAny = function(s, fragments) {\n for(var i = 0; i < fragments.length; i++) {\n if(s.indexOf(fragments[i]) !== -1) return true;\n }\n return false;\n};\n\nlib.isIE = function() {\n return typeof window.navigator.msSaveBlob !== 'undefined';\n};\n\nvar IS_IE9_OR_BELOW_REGEX = /MSIE [1-9]\\./;\nlib.isIE9orBelow = function() {\n return lib.isIE() && IS_IE9_OR_BELOW_REGEX.test(window.navigator.userAgent);\n};\n\nvar IS_SAFARI_REGEX = /Version\\/[\\d\\.]+.*Safari/;\nlib.isSafari = function() {\n return IS_SAFARI_REGEX.test(window.navigator.userAgent);\n};\n\n/**\n * Duck typing to recognize a d3 selection, mostly for IE9's benefit\n * because it doesn't handle instanceof like modern browsers\n */\nlib.isD3Selection = function(obj) {\n return obj && (typeof obj.classed === 'function');\n};\n\n/**\n * Append element to DOM only if not present.\n *\n * @param {d3 selection} parent : parent selection of the element in question\n * @param {string} nodeType : node type of element to append\n * @param {string} className (optional) : class name of element in question\n * @param {fn} enterFn (optional) : optional fn applied to entering elements only\n * @return {d3 selection} selection of new layer\n *\n * Previously, we were using the following pattern:\n *\n * ```\n * var sel = parent.selectAll('.' + className)\n * .data([0]);\n *\n * sel.enter().append(nodeType)\n * .classed(className, true);\n *\n * return sel;\n * ```\n *\n * in numerous places in our codebase to achieve the same behavior.\n *\n * The logic below performs much better, mostly as we are using\n * `.select` instead `.selectAll` that is `querySelector` instead of\n * `querySelectorAll`.\n *\n */\nlib.ensureSingle = function(parent, nodeType, className, enterFn) {\n var sel = parent.select(nodeType + (className ? '.' + className : ''));\n if(sel.size()) return sel;\n\n var layer = parent.append(nodeType);\n if(className) layer.classed(className, true);\n if(enterFn) layer.call(enterFn);\n\n return layer;\n};\n\n/**\n * Same as Lib.ensureSingle, but using id as selector.\n * This version is mostly used for clipPath nodes.\n *\n * @param {d3 selection} parent : parent selection of the element in question\n * @param {string} nodeType : node type of element to append\n * @param {string} id : id of element in question\n * @param {fn} enterFn (optional) : optional fn applied to entering elements only\n * @return {d3 selection} selection of new layer\n */\nlib.ensureSingleById = function(parent, nodeType, id, enterFn) {\n var sel = parent.select(nodeType + '#' + id);\n if(sel.size()) return sel;\n\n var layer = parent.append(nodeType).attr('id', id);\n if(enterFn) layer.call(enterFn);\n\n return layer;\n};\n\n/**\n * Converts a string path to an object.\n *\n * When given a string containing an array element, it will create a `null`\n * filled array of the given size.\n *\n * @example\n * lib.objectFromPath('nested.test[2].path', 'value');\n * // returns { nested: { test: [null, null, { path: 'value' }]}\n *\n * @param {string} path to nested value\n * @param {*} any value to be set\n *\n * @return {Object} the constructed object with a full nested path\n */\nlib.objectFromPath = function(path, value) {\n var keys = path.split('.');\n var tmpObj;\n var obj = tmpObj = {};\n\n for(var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var el = null;\n\n var parts = keys[i].match(/(.*)\\[([0-9]+)\\]/);\n\n if(parts) {\n key = parts[1];\n el = parts[2];\n\n tmpObj = tmpObj[key] = [];\n\n if(i === keys.length - 1) {\n tmpObj[el] = value;\n } else {\n tmpObj[el] = {};\n }\n\n tmpObj = tmpObj[el];\n } else {\n if(i === keys.length - 1) {\n tmpObj[key] = value;\n } else {\n tmpObj[key] = {};\n }\n\n tmpObj = tmpObj[key];\n }\n }\n\n return obj;\n};\n\n/**\n * Iterate through an object in-place, converting dotted properties to objects.\n *\n * Examples:\n *\n * lib.expandObjectPaths({'nested.test.path': 'value'});\n * => { nested: { test: {path: 'value'}}}\n *\n * It also handles array notation, e.g.:\n *\n * lib.expandObjectPaths({'foo[1].bar': 'value'});\n * => { foo: [null, {bar: value}] }\n *\n * It handles merges the results when two properties are specified in parallel:\n *\n * lib.expandObjectPaths({'foo[1].bar': 10, 'foo[0].bar': 20});\n * => { foo: [{bar: 10}, {bar: 20}] }\n *\n * It does NOT, however, merge mulitple mutliply-nested arrays::\n *\n * lib.expandObjectPaths({'marker[1].range[1]': 5, 'marker[1].range[0]': 4})\n * => { marker: [null, {range: 4}] }\n */\n\n// Store this to avoid recompiling regex on *every* prop since this may happen many\n// many times for animations. Could maybe be inside the function. Not sure about\n// scoping vs. recompilation tradeoff, but at least it's not just inlining it into\n// the inner loop.\nvar dottedPropertyRegex = /^([^\\[\\.]+)\\.(.+)?/;\nvar indexedPropertyRegex = /^([^\\.]+)\\[([0-9]+)\\](\\.)?(.+)?/;\n\nlib.expandObjectPaths = function(data) {\n var match, key, prop, datum, idx, dest, trailingPath;\n if(typeof data === 'object' && !Array.isArray(data)) {\n for(key in data) {\n if(data.hasOwnProperty(key)) {\n if((match = key.match(dottedPropertyRegex))) {\n datum = data[key];\n prop = match[1];\n\n delete data[key];\n\n data[prop] = lib.extendDeepNoArrays(data[prop] || {}, lib.objectFromPath(key, lib.expandObjectPaths(datum))[prop]);\n } else if((match = key.match(indexedPropertyRegex))) {\n datum = data[key];\n\n prop = match[1];\n idx = parseInt(match[2]);\n\n delete data[key];\n\n data[prop] = data[prop] || [];\n\n if(match[3] === '.') {\n // This is the case where theere are subsequent properties into which\n // we must recurse, e.g. transforms[0].value\n trailingPath = match[4];\n dest = data[prop][idx] = data[prop][idx] || {};\n\n // NB: Extend deep no arrays prevents this from working on multiple\n // nested properties in the same object, e.g.\n //\n // {\n // foo[0].bar[1].range\n // foo[0].bar[0].range\n // }\n //\n // In this case, the extendDeepNoArrays will overwrite one array with\n // the other, so that both properties *will not* be present in the\n // result. Fixing this would require a more intelligent tracking\n // of changes and merging than extendDeepNoArrays currently accomplishes.\n lib.extendDeepNoArrays(dest, lib.objectFromPath(trailingPath, lib.expandObjectPaths(datum)));\n } else {\n // This is the case where this property is the end of the line,\n // e.g. xaxis.range[0]\n data[prop][idx] = lib.expandObjectPaths(datum);\n }\n } else {\n data[key] = lib.expandObjectPaths(data[key]);\n }\n }\n }\n }\n\n return data;\n};\n\n/**\n * Converts value to string separated by the provided separators.\n *\n * @example\n * lib.numSeparate(2016, '.,');\n * // returns '2016'\n *\n * @example\n * lib.numSeparate(3000, '.,', true);\n * // returns '3,000'\n *\n * @example\n * lib.numSeparate(1234.56, '|,')\n * // returns '1,234|56'\n *\n * @param {string|number} value the value to be converted\n * @param {string} separators string of decimal, then thousands separators\n * @param {boolean} separatethousands boolean, 4-digit integers are separated if true\n *\n * @return {string} the value that has been separated\n */\nlib.numSeparate = function(value, separators, separatethousands) {\n if(!separatethousands) separatethousands = false;\n\n if(typeof separators !== 'string' || separators.length === 0) {\n throw new Error('Separator string required for formatting!');\n }\n\n if(typeof value === 'number') {\n value = String(value);\n }\n\n var thousandsRe = /(\\d+)(\\d{3})/;\n var decimalSep = separators.charAt(0);\n var thouSep = separators.charAt(1);\n\n var x = value.split('.');\n var x1 = x[0];\n var x2 = x.length > 1 ? decimalSep + x[1] : '';\n\n // Years are ignored for thousands separators\n if(thouSep && (x.length > 1 || x1.length > 4 || separatethousands)) {\n while(thousandsRe.test(x1)) {\n x1 = x1.replace(thousandsRe, '$1' + thouSep + '$2');\n }\n }\n\n return x1 + x2;\n};\n\nlib.TEMPLATE_STRING_REGEX = /%{([^\\s%{}:]*)([:|\\|][^}]*)?}/g;\nvar SIMPLE_PROPERTY_REGEX = /^\\w*$/;\n\n/**\n * Substitute values from an object into a string\n *\n * Examples:\n * Lib.templateString('name: %{trace}', {trace: 'asdf'}) --> 'name: asdf'\n * Lib.templateString('name: %{trace[0].name}', {trace: [{name: 'asdf'}]}) --> 'name: asdf'\n *\n * @param {string} input string containing %{...} template strings\n * @param {obj} data object containing substitution values\n *\n * @return {string} templated string\n */\nlib.templateString = function(string, obj) {\n // Not all that useful, but cache nestedProperty instantiation\n // just in case it speeds things up *slightly*:\n var getterCache = {};\n\n return string.replace(lib.TEMPLATE_STRING_REGEX, function(dummy, key) {\n var v;\n if(SIMPLE_PROPERTY_REGEX.test(key)) {\n v = obj[key];\n } else {\n getterCache[key] = getterCache[key] || lib.nestedProperty(obj, key).get;\n v = getterCache[key]();\n }\n return lib.isValidTextValue(v) ? v : '';\n });\n};\n\nvar hovertemplateWarnings = {\n max: 10,\n count: 0,\n name: 'hovertemplate'\n};\nlib.hovertemplateString = function() {\n return templateFormatString.apply(hovertemplateWarnings, arguments);\n};\n\nvar texttemplateWarnings = {\n max: 10,\n count: 0,\n name: 'texttemplate'\n};\nlib.texttemplateString = function() {\n return templateFormatString.apply(texttemplateWarnings, arguments);\n};\n\nvar TEMPLATE_STRING_FORMAT_SEPARATOR = /^[:|\\|]/;\n/**\n * Substitute values from an object into a string and optionally formats them using d3-format,\n * or fallback to associated labels.\n *\n * Examples:\n * Lib.hovertemplateString('name: %{trace}', {trace: 'asdf'}) --> 'name: asdf'\n * Lib.hovertemplateString('name: %{trace[0].name}', {trace: [{name: 'asdf'}]}) --> 'name: asdf'\n * Lib.hovertemplateString('price: %{y:$.2f}', {y: 1}) --> 'price: $1.00'\n *\n * @param {string} input string containing %{...:...} template strings\n * @param {obj} data object containing fallback text when no formatting is specified, ex.: {yLabel: 'formattedYValue'}\n * @param {obj} d3 locale\n * @param {obj} data objects containing substitution values\n *\n * @return {string} templated string\n */\nfunction templateFormatString(string, labels, d3locale) {\n var opts = this;\n var args = arguments;\n if(!labels) labels = {};\n // Not all that useful, but cache nestedProperty instantiation\n // just in case it speeds things up *slightly*:\n var getterCache = {};\n\n return string.replace(lib.TEMPLATE_STRING_REGEX, function(match, key, format) {\n var obj, value, i;\n for(i = 3; i < args.length; i++) {\n obj = args[i];\n if(!obj) continue;\n if(obj.hasOwnProperty(key)) {\n value = obj[key];\n break;\n }\n\n if(!SIMPLE_PROPERTY_REGEX.test(key)) {\n value = getterCache[key] || lib.nestedProperty(obj, key).get();\n if(value) getterCache[key] = value;\n }\n if(value !== undefined) break;\n }\n\n if(value === undefined && opts) {\n if(opts.count < opts.max) {\n lib.warn('Variable \\'' + key + '\\' in ' + opts.name + ' could not be found!');\n value = match;\n }\n\n if(opts.count === opts.max) {\n lib.warn('Too many ' + opts.name + ' warnings - additional warnings will be suppressed');\n }\n opts.count++;\n\n return match;\n }\n\n if(format) {\n var fmt;\n if(format[0] === ':') {\n fmt = d3locale ? d3locale.numberFormat : d3.format;\n value = fmt(format.replace(TEMPLATE_STRING_FORMAT_SEPARATOR, ''))(value);\n }\n\n if(format[0] === '|') {\n fmt = d3locale ? d3locale.timeFormat.utc : d3.time.format.utc;\n var ms = lib.dateTime2ms(value);\n value = lib.formatDate(ms, format.replace(TEMPLATE_STRING_FORMAT_SEPARATOR, ''), false, fmt);\n }\n } else {\n if(labels.hasOwnProperty(key + 'Label')) value = labels[key + 'Label'];\n }\n return value;\n });\n}\n\n/*\n * alphanumeric string sort, tailored for subplot IDs like scene2, scene10, x10y13 etc\n */\nvar char0 = 48;\nvar char9 = 57;\nlib.subplotSort = function(a, b) {\n var l = Math.min(a.length, b.length) + 1;\n var numA = 0;\n var numB = 0;\n for(var i = 0; i < l; i++) {\n var charA = a.charCodeAt(i) || 0;\n var charB = b.charCodeAt(i) || 0;\n var isNumA = charA >= char0 && charA <= char9;\n var isNumB = charB >= char0 && charB <= char9;\n\n if(isNumA) numA = 10 * numA + charA - char0;\n if(isNumB) numB = 10 * numB + charB - char0;\n\n if(!isNumA || !isNumB) {\n if(numA !== numB) return numA - numB;\n if(charA !== charB) return charA - charB;\n }\n }\n return numB - numA;\n};\n\n// repeatable pseudorandom generator\nvar randSeed = 2000000000;\n\nlib.seedPseudoRandom = function() {\n randSeed = 2000000000;\n};\n\nlib.pseudoRandom = function() {\n var lastVal = randSeed;\n randSeed = (69069 * randSeed + 1) % 4294967296;\n // don't let consecutive vals be too close together\n // gets away from really trying to be random, in favor of better local uniformity\n if(Math.abs(randSeed - lastVal) < 429496729) return lib.pseudoRandom();\n return randSeed / 4294967296;\n};\n\n\n/** Fill hover 'pointData' container with 'correct' hover text value\n *\n * - If trace hoverinfo contains a 'text' flag and hovertext is not set,\n * the text elements will be seen in the hover labels.\n *\n * - If trace hoverinfo contains a 'text' flag and hovertext is set,\n * hovertext takes precedence over text\n * i.e. the hoverinfo elements will be seen in the hover labels\n *\n * @param {object} calcPt\n * @param {object} trace\n * @param {object || array} contOut (mutated here)\n */\nlib.fillText = function(calcPt, trace, contOut) {\n var fill = Array.isArray(contOut) ?\n function(v) { contOut.push(v); } :\n function(v) { contOut.text = v; };\n\n var htx = lib.extractOption(calcPt, trace, 'htx', 'hovertext');\n if(lib.isValidTextValue(htx)) return fill(htx);\n\n var tx = lib.extractOption(calcPt, trace, 'tx', 'text');\n if(lib.isValidTextValue(tx)) return fill(tx);\n};\n\n// accept all truthy values and 0 (which gets cast to '0' in the hover labels)\nlib.isValidTextValue = function(v) {\n return v || v === 0;\n};\n\n/**\n * @param {number} ratio\n * @param {number} n (number of decimal places)\n */\nlib.formatPercent = function(ratio, n) {\n n = n || 0;\n var str = (Math.round(100 * ratio * Math.pow(10, n)) * Math.pow(0.1, n)).toFixed(n) + '%';\n for(var i = 0; i < n; i++) {\n if(str.indexOf('.') !== -1) {\n str = str.replace('0%', '%');\n str = str.replace('.%', '%');\n }\n }\n return str;\n};\n\nlib.isHidden = function(gd) {\n var display = window.getComputedStyle(gd).display;\n return !display || display === 'none';\n};\n\n/** Return transform text for bar bar-like rectangles and pie-like slices\n * @param {object} transform\n * - targetX: desired position on the x-axis\n * - targetY: desired position on the y-axis\n * - textX: text middle position on the x-axis\n * - textY: text middle position on the y-axis\n * - anchorX: (optional) text anchor position on the x-axis (computed from textX), zero for middle anchor\n * - anchorY: (optional) text anchor position on the y-axis (computed from textY), zero for middle anchor\n * - scale: (optional) scale applied after translate\n * - rotate: (optional) rotation applied after scale\n * - noCenter: when defined no extra arguments needed in rotation\n */\nlib.getTextTransform = function(transform) {\n var noCenter = transform.noCenter;\n var textX = transform.textX;\n var textY = transform.textY;\n var targetX = transform.targetX;\n var targetY = transform.targetY;\n var anchorX = transform.anchorX || 0;\n var anchorY = transform.anchorY || 0;\n var rotate = transform.rotate;\n var scale = transform.scale;\n if(!scale) scale = 0;\n else if(scale > 1) scale = 1;\n\n return (\n 'translate(' +\n (targetX - scale * (textX + anchorX)) + ',' +\n (targetY - scale * (textY + anchorY)) +\n ')' +\n (scale < 1 ?\n 'scale(' + scale + ')' : ''\n ) +\n (rotate ?\n 'rotate(' + rotate +\n (noCenter ? '' : ' ' + textX + ' ' + textY) +\n ')' : ''\n )\n );\n};\n\nlib.ensureUniformFontSize = function(gd, baseFont) {\n var out = lib.extendFlat({}, baseFont);\n out.size = Math.max(\n baseFont.size,\n gd._fullLayout.uniformtext.minsize || 0\n );\n return out;\n};\n\n},{\"../constants/numerical\":704,\"./anchor_utils\":709,\"./angles\":710,\"./array\":711,\"./clean_number\":712,\"./clear_responsive\":714,\"./coerce\":715,\"./dates\":716,\"./dom\":717,\"./extend\":719,\"./filter_unique\":720,\"./filter_visible\":721,\"./geometry2d\":724,\"./identity\":727,\"./is_plain_object\":729,\"./keyed_container\":730,\"./localize\":731,\"./loggers\":732,\"./make_trace_groups\":733,\"./matrix\":734,\"./mod\":735,\"./nested_property\":736,\"./noop\":737,\"./notifier\":738,\"./push_unique\":742,\"./regex\":744,\"./relative_attr\":745,\"./relink_private\":746,\"./search\":747,\"./stats\":750,\"./throttle\":753,\"./to_log_range\":754,\"d3\":164,\"fast-isnumeric\":236}],729:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n// more info: http://stackoverflow.com/questions/18531624/isplainobject-thing\nmodule.exports = function isPlainObject(obj) {\n // We need to be a little less strict in the `imagetest` container because\n // of how async image requests are handled.\n //\n // N.B. isPlainObject(new Constructor()) will return true in `imagetest`\n if(window && window.process && window.process.versions) {\n return Object.prototype.toString.call(obj) === '[object Object]';\n }\n\n return (\n Object.prototype.toString.call(obj) === '[object Object]' &&\n Object.getPrototypeOf(obj) === Object.prototype\n );\n};\n\n},{}],730:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar nestedProperty = _dereq_('./nested_property');\n\nvar SIMPLE_PROPERTY_REGEX = /^\\w*$/;\n\n// bitmask for deciding what's updated. Sometimes the name needs to be updated,\n// sometimes the value needs to be updated, and sometimes both do. This is just\n// a simple way to track what's updated such that it's a simple OR operation to\n// assimilate new updates.\n//\n// The only exception is the UNSET bit that tracks when we need to explicitly\n// unset and remove the property. This concrn arises because of the special\n// way in which nestedProperty handles null/undefined. When you specify `null`,\n// it prunes any unused items in the tree. I ran into some issues with it getting\n// null vs undefined confused, so UNSET is just a bit that forces the property\n// update to send `null`, removing the property explicitly rather than setting\n// it to undefined.\nvar NONE = 0;\nvar NAME = 1;\nvar VALUE = 2;\nvar BOTH = 3;\nvar UNSET = 4;\n\nmodule.exports = function keyedContainer(baseObj, path, keyName, valueName) {\n keyName = keyName || 'name';\n valueName = valueName || 'value';\n var i, arr, baseProp;\n var changeTypes = {};\n\n if(path && path.length) {\n baseProp = nestedProperty(baseObj, path);\n arr = baseProp.get();\n } else {\n arr = baseObj;\n }\n\n path = path || '';\n\n // Construct an index:\n var indexLookup = {};\n if(arr) {\n for(i = 0; i < arr.length; i++) {\n indexLookup[arr[i][keyName]] = i;\n }\n }\n\n var isSimpleValueProp = SIMPLE_PROPERTY_REGEX.test(valueName);\n\n var obj = {\n set: function(name, value) {\n var changeType = value === null ? UNSET : NONE;\n\n // create the base array if necessary\n if(!arr) {\n if(!baseProp || changeType === UNSET) return;\n\n arr = [];\n baseProp.set(arr);\n }\n\n var idx = indexLookup[name];\n if(idx === undefined) {\n if(changeType === UNSET) return;\n\n changeType = changeType | BOTH;\n idx = arr.length;\n indexLookup[name] = idx;\n } else if(value !== (isSimpleValueProp ? arr[idx][valueName] : nestedProperty(arr[idx], valueName).get())) {\n changeType = changeType | VALUE;\n }\n\n var newValue = arr[idx] = arr[idx] || {};\n newValue[keyName] = name;\n\n if(isSimpleValueProp) {\n newValue[valueName] = value;\n } else {\n nestedProperty(newValue, valueName).set(value);\n }\n\n // If it's not an unset, force that bit to be unset. This is all related to the fact\n // that undefined and null are a bit specially implemented in nestedProperties.\n if(value !== null) {\n changeType = changeType & ~UNSET;\n }\n\n changeTypes[idx] = changeTypes[idx] | changeType;\n\n return obj;\n },\n get: function(name) {\n if(!arr) return;\n\n var idx = indexLookup[name];\n\n if(idx === undefined) {\n return undefined;\n } else if(isSimpleValueProp) {\n return arr[idx][valueName];\n } else {\n return nestedProperty(arr[idx], valueName).get();\n }\n },\n rename: function(name, newName) {\n var idx = indexLookup[name];\n\n if(idx === undefined) return obj;\n changeTypes[idx] = changeTypes[idx] | NAME;\n\n indexLookup[newName] = idx;\n delete indexLookup[name];\n\n arr[idx][keyName] = newName;\n\n return obj;\n },\n remove: function(name) {\n var idx = indexLookup[name];\n\n if(idx === undefined) return obj;\n\n var object = arr[idx];\n if(Object.keys(object).length > 2) {\n // This object contains more than just the key/value, so unset\n // the value without modifying the entry otherwise:\n changeTypes[idx] = changeTypes[idx] | VALUE;\n return obj.set(name, null);\n }\n\n if(isSimpleValueProp) {\n for(i = idx; i < arr.length; i++) {\n changeTypes[i] = changeTypes[i] | BOTH;\n }\n for(i = idx; i < arr.length; i++) {\n indexLookup[arr[i][keyName]]--;\n }\n arr.splice(idx, 1);\n delete(indexLookup[name]);\n } else {\n // Perform this update *strictly* so we can check whether the result's\n // been pruned. If so, it's a removal. If not, it's a value unset only.\n nestedProperty(object, valueName).set(null);\n\n // Now check if the top level nested property has any keys left. If so,\n // the object still has values so we only want to unset the key. If not,\n // the entire object can be removed since there's no other data.\n // var topLevelKeys = Object.keys(object[valueName.split('.')[0]] || []);\n\n changeTypes[idx] = changeTypes[idx] | VALUE | UNSET;\n }\n\n return obj;\n },\n constructUpdate: function() {\n var astr, idx;\n var update = {};\n var changed = Object.keys(changeTypes);\n for(var i = 0; i < changed.length; i++) {\n idx = changed[i];\n astr = path + '[' + idx + ']';\n if(arr[idx]) {\n if(changeTypes[idx] & NAME) {\n update[astr + '.' + keyName] = arr[idx][keyName];\n }\n if(changeTypes[idx] & VALUE) {\n if(isSimpleValueProp) {\n update[astr + '.' + valueName] = (changeTypes[idx] & UNSET) ? null : arr[idx][valueName];\n } else {\n update[astr + '.' + valueName] = (changeTypes[idx] & UNSET) ? null : nestedProperty(arr[idx], valueName).get();\n }\n }\n } else {\n update[astr] = null;\n }\n }\n\n return update;\n }\n };\n\n return obj;\n};\n\n},{\"./nested_property\":736}],731:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Registry = _dereq_('../registry');\n\n/**\n * localize: translate a string for the current locale\n *\n * @param {object} gd: the graphDiv for context\n * gd._context.locale determines the language (& optional region/country)\n * the dictionary for each locale may either be supplied in\n * gd._context.locales or globally via Plotly.register\n * @param {string} s: the string to translate\n */\nmodule.exports = function localize(gd, s) {\n var locale = gd._context.locale;\n\n /*\n * Priority of lookup:\n * contextDicts[locale],\n * registeredDicts[locale],\n * contextDicts[baseLocale], (if baseLocale is distinct)\n * registeredDicts[baseLocale]\n * Return the first translation we find.\n * This way if you have a regionalization you are allowed to specify\n * only what's different from the base locale, everything else will\n * fall back on the base.\n */\n for(var i = 0; i < 2; i++) {\n var locales = gd._context.locales;\n for(var j = 0; j < 2; j++) {\n var dict = (locales[locale] || {}).dictionary;\n if(dict) {\n var out = dict[s];\n if(out) return out;\n }\n locales = Registry.localeRegistry;\n }\n\n var baseLocale = locale.split('-')[0];\n if(baseLocale === locale) break;\n locale = baseLocale;\n }\n\n return s;\n};\n\n},{\"../registry\":859}],732:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/* eslint-disable no-console */\n\nvar dfltConfig = _dereq_('../plot_api/plot_config').dfltConfig;\n\nvar notifier = _dereq_('./notifier');\n\nvar loggers = module.exports = {};\n\n/**\n * ------------------------------------------\n * debugging tools\n * ------------------------------------------\n */\n\nloggers.log = function() {\n var i;\n\n if(dfltConfig.logging > 1) {\n var messages = ['LOG:'];\n for(i = 0; i < arguments.length; i++) {\n messages.push(arguments[i]);\n }\n apply(console.trace || console.log, messages);\n }\n\n if(dfltConfig.notifyOnLogging > 1) {\n var lines = [];\n for(i = 0; i < arguments.length; i++) {\n lines.push(arguments[i]);\n }\n notifier(lines.join('
'), 'long');\n }\n};\n\nloggers.warn = function() {\n var i;\n\n if(dfltConfig.logging > 0) {\n var messages = ['WARN:'];\n for(i = 0; i < arguments.length; i++) {\n messages.push(arguments[i]);\n }\n apply(console.trace || console.log, messages);\n }\n\n if(dfltConfig.notifyOnLogging > 0) {\n var lines = [];\n for(i = 0; i < arguments.length; i++) {\n lines.push(arguments[i]);\n }\n notifier(lines.join('
'), 'stick');\n }\n};\n\nloggers.error = function() {\n var i;\n\n if(dfltConfig.logging > 0) {\n var messages = ['ERROR:'];\n for(i = 0; i < arguments.length; i++) {\n messages.push(arguments[i]);\n }\n apply(console.error, messages);\n }\n\n if(dfltConfig.notifyOnLogging > 0) {\n var lines = [];\n for(i = 0; i < arguments.length; i++) {\n lines.push(arguments[i]);\n }\n notifier(lines.join('
'), 'stick');\n }\n};\n\n/*\n * Robust apply, for IE9 where console.log doesn't support\n * apply like other functions do\n */\nfunction apply(f, args) {\n if(f && f.apply) {\n try {\n // `this` should always be console, since here we're always\n // applying a method of the console object.\n f.apply(console, args);\n return;\n } catch(e) { /* in case apply failed, fall back on the code below */ }\n }\n\n // no apply - just try calling the function on each arg independently\n for(var i = 0; i < args.length; i++) {\n try {\n f(args[i]);\n } catch(e) {\n // still fails - last resort simple console.log\n console.log(args[i]);\n }\n }\n}\n\n},{\"../plot_api/plot_config\":764,\"./notifier\":738}],733:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\n/**\n * General helper to manage trace groups based on calcdata\n *\n * @param {d3.selection} traceLayer: a selection containing a single group\n * to draw these traces into\n * @param {array} cdModule: array of calcdata items for this\n * module and subplot combination. Assumes the calcdata item for each\n * trace is an array with the fullData trace attached to the first item.\n * @param {string} cls: the class attribute to give each trace group\n * so you can give multiple classes separated by spaces\n */\nmodule.exports = function makeTraceGroups(traceLayer, cdModule, cls) {\n var traces = traceLayer.selectAll('g.' + cls.replace(/\\s/g, '.'))\n .data(cdModule, function(cd) { return cd[0].trace.uid; });\n\n traces.exit().remove();\n\n traces.enter().append('g')\n .attr('class', cls);\n\n traces.order();\n\n // stash ref node to trace group in calcdata,\n // useful for (fast) styleOnSelect\n var k = traceLayer.classed('rangeplot') ? 'nodeRangePlot3' : 'node3';\n traces.each(function(cd) { cd[0][k] = d3.select(this); });\n\n return traces;\n};\n\n},{\"d3\":164}],734:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\nexports.init2dArray = function(rowLength, colLength) {\n var array = new Array(rowLength);\n for(var i = 0; i < rowLength; i++) array[i] = new Array(colLength);\n return array;\n};\n\n/**\n * transpose a (possibly ragged) 2d array z. inspired by\n * http://stackoverflow.com/questions/17428587/\n * transposing-a-2d-array-in-javascript\n */\nexports.transposeRagged = function(z) {\n var maxlen = 0;\n var zlen = z.length;\n var i, j;\n // Maximum row length:\n for(i = 0; i < zlen; i++) maxlen = Math.max(maxlen, z[i].length);\n\n var t = new Array(maxlen);\n for(i = 0; i < maxlen; i++) {\n t[i] = new Array(zlen);\n for(j = 0; j < zlen; j++) t[i][j] = z[j][i];\n }\n\n return t;\n};\n\n// our own dot function so that we don't need to include numeric\nexports.dot = function(x, y) {\n if(!(x.length && y.length) || x.length !== y.length) return null;\n\n var len = x.length;\n var out;\n var i;\n\n if(x[0].length) {\n // mat-vec or mat-mat\n out = new Array(len);\n for(i = 0; i < len; i++) out[i] = exports.dot(x[i], y);\n } else if(y[0].length) {\n // vec-mat\n var yTranspose = exports.transposeRagged(y);\n out = new Array(yTranspose.length);\n for(i = 0; i < yTranspose.length; i++) out[i] = exports.dot(x, yTranspose[i]);\n } else {\n // vec-vec\n out = 0;\n for(i = 0; i < len; i++) out += x[i] * y[i];\n }\n\n return out;\n};\n\n// translate by (x,y)\nexports.translationMatrix = function(x, y) {\n return [[1, 0, x], [0, 1, y], [0, 0, 1]];\n};\n\n// rotate by alpha around (0,0)\nexports.rotationMatrix = function(alpha) {\n var a = alpha * Math.PI / 180;\n return [[Math.cos(a), -Math.sin(a), 0],\n [Math.sin(a), Math.cos(a), 0],\n [0, 0, 1]];\n};\n\n// rotate by alpha around (x,y)\nexports.rotationXYMatrix = function(a, x, y) {\n return exports.dot(\n exports.dot(exports.translationMatrix(x, y),\n exports.rotationMatrix(a)),\n exports.translationMatrix(-x, -y));\n};\n\n// applies a 2D transformation matrix to either x and y params or an [x,y] array\nexports.apply2DTransform = function(transform) {\n return function() {\n var args = arguments;\n if(args.length === 3) {\n args = args[0];\n }// from map\n var xy = arguments.length === 1 ? args[0] : [args[0], args[1]];\n return exports.dot(transform, [xy[0], xy[1], 1]).slice(0, 2);\n };\n};\n\n// applies a 2D transformation matrix to an [x1,y1,x2,y2] array (to transform a segment)\nexports.apply2DTransform2 = function(transform) {\n var at = exports.apply2DTransform(transform);\n return function(xys) {\n return at(xys.slice(0, 2)).concat(at(xys.slice(2, 4)));\n };\n};\n\n},{}],735:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/**\n * sanitized modulus function that always returns in the range [0, d)\n * rather than (-d, 0] if v is negative\n */\nfunction mod(v, d) {\n var out = v % d;\n return out < 0 ? out + d : out;\n}\n\n/**\n * sanitized modulus function that always returns in the range [-d/2, d/2]\n * rather than (-d, 0] if v is negative\n */\nfunction modHalf(v, d) {\n return Math.abs(v) > (d / 2) ?\n v - Math.round(v / d) * d :\n v;\n}\n\nmodule.exports = {\n mod: mod,\n modHalf: modHalf\n};\n\n},{}],736:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar isArrayOrTypedArray = _dereq_('./array').isArrayOrTypedArray;\n\n/**\n * convert a string s (such as 'xaxis.range[0]')\n * representing a property of nested object into set and get methods\n * also return the string and object so we don't have to keep track of them\n * allows [-1] for an array index, to set a property inside all elements\n * of an array\n * eg if obj = {arr: [{a: 1}, {a: 2}]}\n * you can do p = nestedProperty(obj, 'arr[-1].a')\n * but you cannot set the array itself this way, to do that\n * just set the whole array.\n * eg if obj = {arr: [1, 2, 3]}\n * you can't do nestedProperty(obj, 'arr[-1]').set(5)\n * but you can do nestedProperty(obj, 'arr').set([5, 5, 5])\n */\nmodule.exports = function nestedProperty(container, propStr) {\n if(isNumeric(propStr)) propStr = String(propStr);\n else if(typeof propStr !== 'string' ||\n propStr.substr(propStr.length - 4) === '[-1]') {\n throw 'bad property string';\n }\n\n var j = 0;\n var propParts = propStr.split('.');\n var indexed;\n var indices;\n var i;\n\n // check for parts of the nesting hierarchy that are numbers (ie array elements)\n while(j < propParts.length) {\n // look for non-bracket chars, then any number of [##] blocks\n indexed = String(propParts[j]).match(/^([^\\[\\]]*)((\\[\\-?[0-9]*\\])+)$/);\n if(indexed) {\n if(indexed[1]) propParts[j] = indexed[1];\n // allow propStr to start with bracketed array indices\n else if(j === 0) propParts.splice(0, 1);\n else throw 'bad property string';\n\n indices = indexed[2]\n .substr(1, indexed[2].length - 2)\n .split('][');\n\n for(i = 0; i < indices.length; i++) {\n j++;\n propParts.splice(j, 0, Number(indices[i]));\n }\n }\n j++;\n }\n\n if(typeof container !== 'object') {\n return badContainer(container, propStr, propParts);\n }\n\n return {\n set: npSet(container, propParts, propStr),\n get: npGet(container, propParts),\n astr: propStr,\n parts: propParts,\n obj: container\n };\n};\n\nfunction npGet(cont, parts) {\n return function() {\n var curCont = cont;\n var curPart;\n var allSame;\n var out;\n var i;\n var j;\n\n for(i = 0; i < parts.length - 1; i++) {\n curPart = parts[i];\n if(curPart === -1) {\n allSame = true;\n out = [];\n for(j = 0; j < curCont.length; j++) {\n out[j] = npGet(curCont[j], parts.slice(i + 1))();\n if(out[j] !== out[0]) allSame = false;\n }\n return allSame ? out[0] : out;\n }\n if(typeof curPart === 'number' && !isArrayOrTypedArray(curCont)) {\n return undefined;\n }\n curCont = curCont[curPart];\n if(typeof curCont !== 'object' || curCont === null) {\n return undefined;\n }\n }\n\n // only hit this if parts.length === 1\n if(typeof curCont !== 'object' || curCont === null) return undefined;\n\n out = curCont[parts[i]];\n if(out === null) return undefined;\n return out;\n };\n}\n\n/*\n * Can this value be deleted? We can delete `undefined`, and `null` except INSIDE an\n * *args* array.\n *\n * Previously we also deleted some `{}` and `[]`, in order to try and make set/unset\n * a net noop; but this causes far more complication than it's worth, and still had\n * lots of exceptions. See https://github.com/plotly/plotly.js/issues/1410\n *\n * *args* arrays get passed directly to API methods and we should respect null if\n * the user put it there, but otherwise null is deleted as we use it as code\n * in restyle/relayout/update for \"delete this value\" whereas undefined means\n * \"ignore this edit\"\n */\nvar ARGS_PATTERN = /(^|\\.)args\\[/;\nfunction isDeletable(val, propStr) {\n return (val === undefined) || (val === null && !propStr.match(ARGS_PATTERN));\n}\n\nfunction npSet(cont, parts, propStr) {\n return function(val) {\n var curCont = cont;\n var propPart = '';\n var containerLevels = [[cont, propPart]];\n var toDelete = isDeletable(val, propStr);\n var curPart;\n var i;\n\n for(i = 0; i < parts.length - 1; i++) {\n curPart = parts[i];\n\n if(typeof curPart === 'number' && !isArrayOrTypedArray(curCont)) {\n throw 'array index but container is not an array';\n }\n\n // handle special -1 array index\n if(curPart === -1) {\n toDelete = !setArrayAll(curCont, parts.slice(i + 1), val, propStr);\n if(toDelete) break;\n else return;\n }\n\n if(!checkNewContainer(curCont, curPart, parts[i + 1], toDelete)) {\n break;\n }\n\n curCont = curCont[curPart];\n\n if(typeof curCont !== 'object' || curCont === null) {\n throw 'container is not an object';\n }\n\n propPart = joinPropStr(propPart, curPart);\n\n containerLevels.push([curCont, propPart]);\n }\n\n if(toDelete) {\n if(i === parts.length - 1) {\n delete curCont[parts[i]];\n\n // The one bit of pruning we still do: drop `undefined` from the end of arrays.\n // In case someone has already unset previous items, continue until we hit a\n // non-undefined value.\n if(Array.isArray(curCont) && +parts[i] === curCont.length - 1) {\n while(curCont.length && curCont[curCont.length - 1] === undefined) {\n curCont.pop();\n }\n }\n }\n } else curCont[parts[i]] = val;\n };\n}\n\nfunction joinPropStr(propStr, newPart) {\n var toAdd = newPart;\n if(isNumeric(newPart)) toAdd = '[' + newPart + ']';\n else if(propStr) toAdd = '.' + newPart;\n\n return propStr + toAdd;\n}\n\n// handle special -1 array index\nfunction setArrayAll(containerArray, innerParts, val, propStr) {\n var arrayVal = isArrayOrTypedArray(val);\n var allSet = true;\n var thisVal = val;\n var thisPropStr = propStr.replace('-1', 0);\n var deleteThis = arrayVal ? false : isDeletable(val, thisPropStr);\n var firstPart = innerParts[0];\n var i;\n\n for(i = 0; i < containerArray.length; i++) {\n thisPropStr = propStr.replace('-1', i);\n if(arrayVal) {\n thisVal = val[i % val.length];\n deleteThis = isDeletable(thisVal, thisPropStr);\n }\n if(deleteThis) allSet = false;\n if(!checkNewContainer(containerArray, i, firstPart, deleteThis)) {\n continue;\n }\n npSet(containerArray[i], innerParts, propStr.replace('-1', i))(thisVal);\n }\n return allSet;\n}\n\n/**\n * make new sub-container as needed.\n * returns false if there's no container and none is needed\n * because we're only deleting an attribute\n */\nfunction checkNewContainer(container, part, nextPart, toDelete) {\n if(container[part] === undefined) {\n if(toDelete) return false;\n\n if(typeof nextPart === 'number') container[part] = [];\n else container[part] = {};\n }\n return true;\n}\n\nfunction badContainer(container, propStr, propParts) {\n return {\n set: function() { throw 'bad container'; },\n get: function() {},\n astr: propStr,\n parts: propParts,\n obj: container\n };\n}\n\n},{\"./array\":711,\"fast-isnumeric\":236}],737:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n// Simple helper functions\n// none of these need any external deps\n\nmodule.exports = function noop() {};\n\n},{}],738:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar NOTEDATA = [];\n\n/**\n * notifier\n * @param {String} text The person's user name\n * @param {Number} [delay=1000] The delay time in milliseconds\n * or 'long' which provides 2000 ms delay time.\n * @return {undefined} this function does not return a value\n */\nmodule.exports = function(text, displayLength) {\n if(NOTEDATA.indexOf(text) !== -1) return;\n\n NOTEDATA.push(text);\n\n var ts = 1000;\n if(isNumeric(displayLength)) ts = displayLength;\n else if(displayLength === 'long') ts = 3000;\n\n var notifierContainer = d3.select('body')\n .selectAll('.plotly-notifier')\n .data([0]);\n notifierContainer.enter()\n .append('div')\n .classed('plotly-notifier', true);\n\n var notes = notifierContainer.selectAll('.notifier-note').data(NOTEDATA);\n\n function killNote(transition) {\n transition\n .duration(700)\n .style('opacity', 0)\n .each('end', function(thisText) {\n var thisIndex = NOTEDATA.indexOf(thisText);\n if(thisIndex !== -1) NOTEDATA.splice(thisIndex, 1);\n d3.select(this).remove();\n });\n }\n\n notes.enter().append('div')\n .classed('notifier-note', true)\n .style('opacity', 0)\n .each(function(thisText) {\n var note = d3.select(this);\n\n note.append('button')\n .classed('notifier-close', true)\n .html('×')\n .on('click', function() {\n note.transition().call(killNote);\n });\n\n var p = note.append('p');\n var lines = thisText.split(//g);\n for(var i = 0; i < lines.length; i++) {\n if(i) p.append('br');\n p.append('span').text(lines[i]);\n }\n\n if(displayLength === 'stick') {\n note.transition()\n .duration(350)\n .style('opacity', 1);\n } else {\n note.transition()\n .duration(700)\n .style('opacity', 1)\n .transition()\n .delay(ts)\n .call(killNote);\n }\n });\n};\n\n},{\"d3\":164,\"fast-isnumeric\":236}],739:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar setCursor = _dereq_('./setcursor');\n\nvar STASHATTR = 'data-savedcursor';\nvar NO_CURSOR = '!!';\n\n/*\n * works with our CSS cursor classes (see css/_cursor.scss)\n * to override a previous cursor set on d3 single-element selections,\n * by moving the name of the original cursor to the data-savedcursor attr.\n * omit cursor to revert to the previously set value.\n */\nmodule.exports = function overrideCursor(el3, csr) {\n var savedCursor = el3.attr(STASHATTR);\n if(csr) {\n if(!savedCursor) {\n var classes = (el3.attr('class') || '').split(' ');\n for(var i = 0; i < classes.length; i++) {\n var cls = classes[i];\n if(cls.indexOf('cursor-') === 0) {\n el3.attr(STASHATTR, cls.substr(7))\n .classed(cls, false);\n }\n }\n if(!el3.attr(STASHATTR)) {\n el3.attr(STASHATTR, NO_CURSOR);\n }\n }\n setCursor(el3, csr);\n } else if(savedCursor) {\n el3.attr(STASHATTR, null);\n\n if(savedCursor === NO_CURSOR) setCursor(el3);\n else setCursor(el3, savedCursor);\n }\n};\n\n},{\"./setcursor\":748}],740:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar dot = _dereq_('./matrix').dot;\nvar BADNUM = _dereq_('../constants/numerical').BADNUM;\n\nvar polygon = module.exports = {};\n\n/**\n * Turn an array of [x, y] pairs into a polygon object\n * that can test if points are inside it\n *\n * @param ptsIn Array of [x, y] pairs\n *\n * @returns polygon Object {xmin, xmax, ymin, ymax, pts, contains}\n * (x|y)(min|max) are the bounding rect of the polygon\n * pts is the original array, with the first pair repeated at the end\n * contains is a function: (pt, omitFirstEdge)\n * pt is the [x, y] pair to test\n * omitFirstEdge truthy means points exactly on the first edge don't\n * count. This is for use adding one polygon to another so we\n * don't double-count the edge where they meet.\n * returns boolean: is pt inside the polygon (including on its edges)\n */\npolygon.tester = function tester(ptsIn) {\n var pts = ptsIn.slice();\n var xmin = pts[0][0];\n var xmax = xmin;\n var ymin = pts[0][1];\n var ymax = ymin;\n var i;\n\n pts.push(pts[0]);\n for(i = 1; i < pts.length; i++) {\n xmin = Math.min(xmin, pts[i][0]);\n xmax = Math.max(xmax, pts[i][0]);\n ymin = Math.min(ymin, pts[i][1]);\n ymax = Math.max(ymax, pts[i][1]);\n }\n\n // do we have a rectangle? Handle this here, so we can use the same\n // tester for the rectangular case without sacrificing speed\n\n var isRect = false;\n var rectFirstEdgeTest;\n\n if(pts.length === 5) {\n if(pts[0][0] === pts[1][0]) { // vert, horz, vert, horz\n if(pts[2][0] === pts[3][0] &&\n pts[0][1] === pts[3][1] &&\n pts[1][1] === pts[2][1]) {\n isRect = true;\n rectFirstEdgeTest = function(pt) { return pt[0] === pts[0][0]; };\n }\n } else if(pts[0][1] === pts[1][1]) { // horz, vert, horz, vert\n if(pts[2][1] === pts[3][1] &&\n pts[0][0] === pts[3][0] &&\n pts[1][0] === pts[2][0]) {\n isRect = true;\n rectFirstEdgeTest = function(pt) { return pt[1] === pts[0][1]; };\n }\n }\n }\n\n function rectContains(pt, omitFirstEdge) {\n var x = pt[0];\n var y = pt[1];\n\n if(x === BADNUM || x < xmin || x > xmax || y === BADNUM || y < ymin || y > ymax) {\n // pt is outside the bounding box of polygon\n return false;\n }\n if(omitFirstEdge && rectFirstEdgeTest(pt)) return false;\n\n return true;\n }\n\n function contains(pt, omitFirstEdge) {\n var x = pt[0];\n var y = pt[1];\n\n if(x === BADNUM || x < xmin || x > xmax || y === BADNUM || y < ymin || y > ymax) {\n // pt is outside the bounding box of polygon\n return false;\n }\n\n var imax = pts.length;\n var x1 = pts[0][0];\n var y1 = pts[0][1];\n var crossings = 0;\n var i;\n var x0;\n var y0;\n var xmini;\n var ycross;\n\n for(i = 1; i < imax; i++) {\n // find all crossings of a vertical line upward from pt with\n // polygon segments\n // crossings exactly at xmax don't count, unless the point is\n // exactly on the segment, then it counts as inside.\n x0 = x1;\n y0 = y1;\n x1 = pts[i][0];\n y1 = pts[i][1];\n xmini = Math.min(x0, x1);\n\n if(x < xmini || x > Math.max(x0, x1) || y > Math.max(y0, y1)) {\n // outside the bounding box of this segment, it's only a crossing\n // if it's below the box.\n\n continue;\n } else if(y < Math.min(y0, y1)) {\n // don't count the left-most point of the segment as a crossing\n // because we don't want to double-count adjacent crossings\n // UNLESS the polygon turns past vertical at exactly this x\n // Note that this is repeated below, but we can't factor it out\n // because\n if(x !== xmini) crossings++;\n } else {\n // inside the bounding box, check the actual line intercept\n\n // vertical segment - we know already that the point is exactly\n // on the segment, so mark the crossing as exactly at the point.\n if(x1 === x0) ycross = y;\n // any other angle\n else ycross = y0 + (x - x0) * (y1 - y0) / (x1 - x0);\n\n // exactly on the edge: counts as inside the polygon, unless it's the\n // first edge and we're omitting it.\n if(y === ycross) {\n if(i === 1 && omitFirstEdge) return false;\n return true;\n }\n\n if(y <= ycross && x !== xmini) crossings++;\n }\n }\n\n // if we've gotten this far, odd crossings means inside, even is outside\n return crossings % 2 === 1;\n }\n\n // detect if poly is degenerate\n var degenerate = true;\n var lastPt = pts[0];\n for(i = 1; i < pts.length; i++) {\n if(lastPt[0] !== pts[i][0] || lastPt[1] !== pts[i][1]) {\n degenerate = false;\n break;\n }\n }\n\n return {\n xmin: xmin,\n xmax: xmax,\n ymin: ymin,\n ymax: ymax,\n pts: pts,\n contains: isRect ? rectContains : contains,\n isRect: isRect,\n degenerate: degenerate\n };\n};\n\n/**\n * Test if a segment of a points array is bent or straight\n *\n * @param pts Array of [x, y] pairs\n * @param start the index of the proposed start of the straight section\n * @param end the index of the proposed end point\n * @param tolerance the max distance off the line connecting start and end\n * before the line counts as bent\n * @returns boolean: true means this segment is bent, false means straight\n */\npolygon.isSegmentBent = function isSegmentBent(pts, start, end, tolerance) {\n var startPt = pts[start];\n var segment = [pts[end][0] - startPt[0], pts[end][1] - startPt[1]];\n var segmentSquared = dot(segment, segment);\n var segmentLen = Math.sqrt(segmentSquared);\n var unitPerp = [-segment[1] / segmentLen, segment[0] / segmentLen];\n var i;\n var part;\n var partParallel;\n\n for(i = start + 1; i < end; i++) {\n part = [pts[i][0] - startPt[0], pts[i][1] - startPt[1]];\n partParallel = dot(part, segment);\n\n if(partParallel < 0 || partParallel > segmentSquared ||\n Math.abs(dot(part, unitPerp)) > tolerance) return true;\n }\n return false;\n};\n\n/**\n * Make a filtering polygon, to minimize the number of segments\n *\n * @param pts Array of [x, y] pairs (must start with at least 1 pair)\n * @param tolerance the maximum deviation from straight allowed for\n * removing points to simplify the polygon\n *\n * @returns Object {addPt, raw, filtered}\n * addPt is a function(pt: [x, y] pair) to add a raw point and\n * continue filtering\n * raw is all the input points\n * filtered is the resulting filtered Array of [x, y] pairs\n */\npolygon.filter = function filter(pts, tolerance) {\n var ptsFiltered = [pts[0]];\n var doneRawIndex = 0;\n var doneFilteredIndex = 0;\n\n function addPt(pt) {\n pts.push(pt);\n var prevFilterLen = ptsFiltered.length;\n var iLast = doneRawIndex;\n ptsFiltered.splice(doneFilteredIndex + 1);\n\n for(var i = iLast + 1; i < pts.length; i++) {\n if(i === pts.length - 1 || polygon.isSegmentBent(pts, iLast, i + 1, tolerance)) {\n ptsFiltered.push(pts[i]);\n if(ptsFiltered.length < prevFilterLen - 2) {\n doneRawIndex = i;\n doneFilteredIndex = ptsFiltered.length - 1;\n }\n iLast = i;\n }\n }\n }\n\n if(pts.length > 1) {\n var lastPt = pts.pop();\n addPt(lastPt);\n }\n\n return {\n addPt: addPt,\n raw: pts,\n filtered: ptsFiltered\n };\n};\n\n},{\"../constants/numerical\":704,\"./matrix\":734}],741:[function(_dereq_,module,exports){\n(function (global){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar showNoWebGlMsg = _dereq_('./show_no_webgl_msg');\n\n// Note that this module should be ONLY required into\n// files corresponding to regl trace modules\n// so that bundles with non-regl only don't include\n// regl and all its bytes.\nvar createRegl = _dereq_('regl');\n\n/**\n * Idempotent version of createRegl. Create regl instances\n * in the correct canvases with the correct attributes and\n * options\n *\n * @param {DOM node or object} gd : graph div object\n * @param {array} extensions : list of extension to pass to createRegl\n *\n * @return {boolean} true if all createRegl calls succeeded, false otherwise\n */\nmodule.exports = function prepareRegl(gd, extensions) {\n var fullLayout = gd._fullLayout;\n var success = true;\n\n fullLayout._glcanvas.each(function(d) {\n if(d.regl) return;\n // only parcoords needs pick layer\n if(d.pick && !fullLayout._has('parcoords')) return;\n\n try {\n d.regl = createRegl({\n canvas: this,\n attributes: {\n antialias: !d.pick,\n preserveDrawingBuffer: true\n },\n pixelRatio: gd._context.plotGlPixelRatio || global.devicePixelRatio,\n extensions: extensions || []\n });\n } catch(e) {\n success = false;\n }\n\n if(!d.regl) success = false;\n\n if(success) {\n this.addEventListener('webglcontextlost', function(event) {\n if(gd && gd.emit) {\n gd.emit('plotly_webglcontextlost', {\n event: event,\n layer: d.key\n });\n }\n }, false);\n }\n });\n\n if(!success) {\n showNoWebGlMsg({container: fullLayout._glcontainer.node()});\n }\n return success;\n};\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{\"./show_no_webgl_msg\":749,\"regl\":492}],742:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/**\n * Push array with unique items\n *\n * Ignores falsy items, except 0 so we can use it to construct arrays of indices.\n *\n * @param {array} array\n * array to be filled\n * @param {any} item\n * item to be or not to be inserted\n * @return {array}\n * ref to array (now possibly containing one more item)\n *\n */\nmodule.exports = function pushUnique(array, item) {\n if(item instanceof RegExp) {\n var itemStr = item.toString();\n for(var i = 0; i < array.length; i++) {\n if(array[i] instanceof RegExp && array[i].toString() === itemStr) {\n return array;\n }\n }\n array.push(item);\n } else if((item || item === 0) && array.indexOf(item) === -1) array.push(item);\n\n return array;\n};\n\n},{}],743:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../lib');\nvar dfltConfig = _dereq_('../plot_api/plot_config').dfltConfig;\n\n/**\n * Copy arg array *without* removing `undefined` values from objects.\n *\n * @param gd\n * @param args\n * @returns {Array}\n */\nfunction copyArgArray(gd, args) {\n var copy = [];\n var arg;\n\n for(var i = 0; i < args.length; i++) {\n arg = args[i];\n\n if(arg === gd) copy[i] = arg;\n else if(typeof arg === 'object') {\n copy[i] = Array.isArray(arg) ?\n Lib.extendDeep([], arg) :\n Lib.extendDeepAll({}, arg);\n } else copy[i] = arg;\n }\n\n return copy;\n}\n\n\n// -----------------------------------------------------\n// Undo/Redo queue for plots\n// -----------------------------------------------------\n\n\nvar queue = {};\n\n// TODO: disable/enable undo and redo buttons appropriately\n\n/**\n * Add an item to the undoQueue for a graphDiv\n *\n * @param gd\n * @param undoFunc Function undo this operation\n * @param undoArgs Args to supply undoFunc with\n * @param redoFunc Function to redo this operation\n * @param redoArgs Args to supply redoFunc with\n */\nqueue.add = function(gd, undoFunc, undoArgs, redoFunc, redoArgs) {\n var queueObj,\n queueIndex;\n\n // make sure we have the queue and our position in it\n gd.undoQueue = gd.undoQueue || {index: 0, queue: [], sequence: false};\n queueIndex = gd.undoQueue.index;\n\n // if we're already playing an undo or redo, or if this is an auto operation\n // (like pane resize... any others?) then we don't save this to the undo queue\n if(gd.autoplay) {\n if(!gd.undoQueue.inSequence) gd.autoplay = false;\n return;\n }\n\n // if we're not in a sequence or are just starting, we need a new queue item\n if(!gd.undoQueue.sequence || gd.undoQueue.beginSequence) {\n queueObj = {undo: {calls: [], args: []}, redo: {calls: [], args: []}};\n gd.undoQueue.queue.splice(queueIndex, gd.undoQueue.queue.length - queueIndex, queueObj);\n gd.undoQueue.index += 1;\n } else {\n queueObj = gd.undoQueue.queue[queueIndex - 1];\n }\n gd.undoQueue.beginSequence = false;\n\n // we unshift to handle calls for undo in a forward for loop later\n if(queueObj) {\n queueObj.undo.calls.unshift(undoFunc);\n queueObj.undo.args.unshift(undoArgs);\n queueObj.redo.calls.push(redoFunc);\n queueObj.redo.args.push(redoArgs);\n }\n\n if(gd.undoQueue.queue.length > dfltConfig.queueLength) {\n gd.undoQueue.queue.shift();\n gd.undoQueue.index--;\n }\n};\n\n/**\n * Begin a sequence of undoQueue changes\n *\n * @param gd\n */\nqueue.startSequence = function(gd) {\n gd.undoQueue = gd.undoQueue || {index: 0, queue: [], sequence: false};\n gd.undoQueue.sequence = true;\n gd.undoQueue.beginSequence = true;\n};\n\n/**\n * Stop a sequence of undoQueue changes\n *\n * Call this *after* you're sure your undo chain has ended\n *\n * @param gd\n */\nqueue.stopSequence = function(gd) {\n gd.undoQueue = gd.undoQueue || {index: 0, queue: [], sequence: false};\n gd.undoQueue.sequence = false;\n gd.undoQueue.beginSequence = false;\n};\n\n/**\n * Move one step back in the undo queue, and undo the object there.\n *\n * @param gd\n */\nqueue.undo = function undo(gd) {\n var queueObj, i;\n\n if(gd.framework && gd.framework.isPolar) {\n gd.framework.undo();\n return;\n }\n if(gd.undoQueue === undefined ||\n isNaN(gd.undoQueue.index) ||\n gd.undoQueue.index <= 0) {\n return;\n }\n\n // index is pointing to next *forward* queueObj, point to the one we're undoing\n gd.undoQueue.index--;\n\n // get the queueObj for instructions on how to undo\n queueObj = gd.undoQueue.queue[gd.undoQueue.index];\n\n // this sequence keeps things from adding to the queue during undo/redo\n gd.undoQueue.inSequence = true;\n for(i = 0; i < queueObj.undo.calls.length; i++) {\n queue.plotDo(gd, queueObj.undo.calls[i], queueObj.undo.args[i]);\n }\n gd.undoQueue.inSequence = false;\n gd.autoplay = false;\n};\n\n/**\n * Redo the current object in the undo, then move forward in the queue.\n *\n * @param gd\n */\nqueue.redo = function redo(gd) {\n var queueObj, i;\n\n if(gd.framework && gd.framework.isPolar) {\n gd.framework.redo();\n return;\n }\n if(gd.undoQueue === undefined ||\n isNaN(gd.undoQueue.index) ||\n gd.undoQueue.index >= gd.undoQueue.queue.length) {\n return;\n }\n\n // get the queueObj for instructions on how to undo\n queueObj = gd.undoQueue.queue[gd.undoQueue.index];\n\n // this sequence keeps things from adding to the queue during undo/redo\n gd.undoQueue.inSequence = true;\n for(i = 0; i < queueObj.redo.calls.length; i++) {\n queue.plotDo(gd, queueObj.redo.calls[i], queueObj.redo.args[i]);\n }\n gd.undoQueue.inSequence = false;\n gd.autoplay = false;\n\n // index is pointing to the thing we just redid, move it\n gd.undoQueue.index++;\n};\n\n/**\n * Called by undo/redo to make the actual changes.\n *\n * Not meant to be called publically, but included for mocking out in tests.\n *\n * @param gd\n * @param func\n * @param args\n */\nqueue.plotDo = function(gd, func, args) {\n gd.autoplay = true;\n\n // this *won't* copy gd and it preserves `undefined` properties!\n args = copyArgArray(gd, args);\n\n // call the supplied function\n func.apply(null, args);\n};\n\nmodule.exports = queue;\n\n},{\"../lib\":728,\"../plot_api/plot_config\":764}],744:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/*\n * make a regex for matching counter ids/names ie xaxis, xaxis2, xaxis10...\n *\n * @param {string} head: the head of the pattern, eg 'x' matches 'x', 'x2', 'x10' etc.\n * 'xy' is a special case for cartesian subplots: it matches 'x2y3' etc\n * @param {Optional(string)} tail: a fixed piece after the id\n * eg counterRegex('scene', '.annotations') for scene2.annotations etc.\n * @param {boolean} openEnded: if true, the string may continue past the match.\n * @param {boolean} matchBeginning: if false, the string may start before the match.\n */\nexports.counter = function(head, tail, openEnded, matchBeginning) {\n var fullTail = (tail || '') + (openEnded ? '' : '$');\n var startWithPrefix = matchBeginning === false ? '' : '^';\n if(head === 'xy') {\n return new RegExp(startWithPrefix + 'x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?' + fullTail);\n }\n return new RegExp(startWithPrefix + head + '([2-9]|[1-9][0-9]+)?' + fullTail);\n};\n\n},{}],745:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n// ASCEND: chop off the last nesting level - either [] or . - to ascend\n// the attribute tree. the remaining attrString is in match[1]\nvar ASCEND = /^(.*)(\\.[^\\.\\[\\]]+|\\[\\d\\])$/;\n\n// SIMPLEATTR: is this an un-nested attribute? (no dots or brackets)\nvar SIMPLEATTR = /^[^\\.\\[\\]]+$/;\n\n/*\n * calculate a relative attribute string, similar to a relative path\n *\n * @param {string} baseAttr:\n * an attribute string, such as 'annotations[3].x'. The \"current location\"\n * is the attribute string minus the last component ('annotations[3]')\n * @param {string} relativeAttr:\n * a route to the desired attribute string, using '^' to ascend\n *\n * @return {string} attrString:\n * for example:\n * relativeAttr('annotations[3].x', 'y') = 'annotations[3].y'\n * relativeAttr('annotations[3].x', '^[2].z') = 'annotations[2].z'\n * relativeAttr('annotations[3].x', '^^margin') = 'margin'\n * relativeAttr('annotations[3].x', '^^margin.r') = 'margin.r'\n */\nmodule.exports = function(baseAttr, relativeAttr) {\n while(relativeAttr) {\n var match = baseAttr.match(ASCEND);\n\n if(match) baseAttr = match[1];\n else if(baseAttr.match(SIMPLEATTR)) baseAttr = '';\n else throw new Error('bad relativeAttr call:' + [baseAttr, relativeAttr]);\n\n if(relativeAttr.charAt(0) === '^') relativeAttr = relativeAttr.slice(1);\n else break;\n }\n\n if(baseAttr && relativeAttr.charAt(0) !== '[') {\n return baseAttr + '.' + relativeAttr;\n }\n return baseAttr + relativeAttr;\n};\n\n},{}],746:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isArrayOrTypedArray = _dereq_('./array').isArrayOrTypedArray;\nvar isPlainObject = _dereq_('./is_plain_object');\n\n/**\n * Relink private _keys and keys with a function value from one container\n * to the new container.\n * Relink means copying if object is pass-by-value and adding a reference\n * if object is pass-by-ref.\n * This prevents deepCopying massive structures like a webgl context.\n */\nmodule.exports = function relinkPrivateKeys(toContainer, fromContainer) {\n for(var k in fromContainer) {\n var fromVal = fromContainer[k];\n var toVal = toContainer[k];\n\n if(toVal === fromVal) continue;\n\n if(k.charAt(0) === '_' || typeof fromVal === 'function') {\n // if it already exists at this point, it's something\n // that we recreate each time around, so ignore it\n if(k in toContainer) continue;\n\n toContainer[k] = fromVal;\n } else if(isArrayOrTypedArray(fromVal) && isArrayOrTypedArray(toVal) && isPlainObject(fromVal[0])) {\n // filter out data_array items that can contain user objects\n // most of the time the toVal === fromVal check will catch these early\n // but if the user makes new ones we also don't want to recurse in.\n if(k === 'customdata' || k === 'ids') continue;\n\n // recurse into arrays containers\n var minLen = Math.min(fromVal.length, toVal.length);\n for(var j = 0; j < minLen; j++) {\n if((toVal[j] !== fromVal[j]) && isPlainObject(fromVal[j]) && isPlainObject(toVal[j])) {\n relinkPrivateKeys(toVal[j], fromVal[j]);\n }\n }\n } else if(isPlainObject(fromVal) && isPlainObject(toVal)) {\n // recurse into objects, but only if they still exist\n relinkPrivateKeys(toVal, fromVal);\n\n if(!Object.keys(toVal).length) delete toContainer[k];\n }\n }\n};\n\n},{\"./array\":711,\"./is_plain_object\":729}],747:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar loggers = _dereq_('./loggers');\nvar identity = _dereq_('./identity');\nvar BADNUM = _dereq_('../constants/numerical').BADNUM;\n\n// don't trust floating point equality - fraction of bin size to call\n// \"on the line\" and ensure that they go the right way specified by\n// linelow\nvar roundingError = 1e-9;\n\n\n/**\n * findBin - find the bin for val - note that it can return outside the\n * bin range any pos. or neg. integer for linear bins, or -1 or\n * bins.length-1 for explicit.\n * bins is either an object {start,size,end} or an array length #bins+1\n * bins can be either increasing or decreasing but must be monotonic\n * for linear bins, we can just calculate. For listed bins, run a binary\n * search linelow (truthy) says the bin boundary should be attributed to\n * the lower bin rather than the default upper bin\n */\nexports.findBin = function(val, bins, linelow) {\n if(isNumeric(bins.start)) {\n return linelow ?\n Math.ceil((val - bins.start) / bins.size - roundingError) - 1 :\n Math.floor((val - bins.start) / bins.size + roundingError);\n } else {\n var n1 = 0;\n var n2 = bins.length;\n var c = 0;\n var binSize = (n2 > 1) ? (bins[n2 - 1] - bins[0]) / (n2 - 1) : 1;\n var n, test;\n if(binSize >= 0) {\n test = linelow ? lessThan : lessOrEqual;\n } else {\n test = linelow ? greaterOrEqual : greaterThan;\n }\n val += binSize * roundingError * (linelow ? -1 : 1) * (binSize >= 0 ? 1 : -1);\n // c is just to avoid infinite loops if there's an error\n while(n1 < n2 && c++ < 100) {\n n = Math.floor((n1 + n2) / 2);\n if(test(bins[n], val)) n1 = n + 1;\n else n2 = n;\n }\n if(c > 90) loggers.log('Long binary search...');\n return n1 - 1;\n }\n};\n\nfunction lessThan(a, b) { return a < b; }\nfunction lessOrEqual(a, b) { return a <= b; }\nfunction greaterThan(a, b) { return a > b; }\nfunction greaterOrEqual(a, b) { return a >= b; }\n\nexports.sorterAsc = function(a, b) { return a - b; };\nexports.sorterDes = function(a, b) { return b - a; };\n\n/**\n * find distinct values in an array, lumping together ones that appear to\n * just be off by a rounding error\n * return the distinct values and the minimum difference between any two\n */\nexports.distinctVals = function(valsIn) {\n var vals = valsIn.slice(); // otherwise we sort the original array...\n vals.sort(exports.sorterAsc); // undefined listed in the end - also works on IE11\n\n var last;\n for(last = vals.length - 1; last > -1; last--) {\n if(vals[last] !== BADNUM) break;\n }\n\n var minDiff = (vals[last] - vals[0]) || 1;\n var errDiff = minDiff / (last || 1) / 10000;\n var newVals = [];\n var preV;\n for(var i = 0; i <= last; i++) {\n var v = vals[i];\n\n // make sure values aren't just off by a rounding error\n var diff = v - preV;\n\n if(preV === undefined) {\n newVals.push(v);\n preV = v;\n } else if(diff > errDiff) {\n minDiff = Math.min(minDiff, diff);\n\n newVals.push(v);\n preV = v;\n }\n }\n\n return {vals: newVals, minDiff: minDiff};\n};\n\n/**\n * return the smallest element from (sorted) array arrayIn that's bigger than val,\n * or (reverse) the largest element smaller than val\n * used to find the best tick given the minimum (non-rounded) tick\n * particularly useful for date/time where things are not powers of 10\n * binary search is probably overkill here...\n */\nexports.roundUp = function(val, arrayIn, reverse) {\n var low = 0;\n var high = arrayIn.length - 1;\n var mid;\n var c = 0;\n var dlow = reverse ? 0 : 1;\n var dhigh = reverse ? 1 : 0;\n var rounded = reverse ? Math.ceil : Math.floor;\n // c is just to avoid infinite loops if there's an error\n while(low < high && c++ < 100) {\n mid = rounded((low + high) / 2);\n if(arrayIn[mid] <= val) low = mid + dlow;\n else high = mid - dhigh;\n }\n return arrayIn[low];\n};\n\n/**\n * Tweak to Array.sort(sortFn) that improves performance for pre-sorted arrays\n *\n * Note that newer browsers (such as Chrome v70+) are starting to pick up\n * on pre-sorted arrays which may render the following optimization unnecessary\n * in the future.\n *\n * Motivation: sometimes we need to sort arrays but the input is likely to\n * already be sorted. Browsers don't seem to pick up on pre-sorted arrays,\n * and in fact Chrome is actually *slower* sorting pre-sorted arrays than purely\n * random arrays. FF is at least faster if the array is pre-sorted, but still\n * not as fast as it could be.\n * Here's how this plays out sorting a length-1e6 array:\n *\n * Calls to Sort FN | Chrome bare | FF bare | Chrome tweak | FF tweak\n * | v68.0 Mac | v61.0 Mac| |\n * ------------------+---------------+-----------+----------------+------------\n * ordered | 30.4e6 | 10.1e6 | 1e6 | 1e6\n * reversed | 29.4e6 | 9.9e6 | 1e6 + reverse | 1e6 + reverse\n * random | ~21e6 | ~18.7e6 | ~21e6 | ~18.7e6\n *\n * So this is a substantial win for pre-sorted (ordered or exactly reversed)\n * arrays. Including this wrapper on an unsorted array adds a penalty that will\n * in general be only a few calls to the sort function. The only case this\n * penalty will be significant is if the array is mostly sorted but there are\n * a few unsorted items near the end, but the penalty is still at most N calls\n * out of (for N=1e6) ~20N total calls\n *\n * @param {Array} array: the array, to be sorted in place\n * @param {function} sortFn: As in Array.sort, function(a, b) that puts\n * item a before item b if the return is negative, a after b if positive,\n * and no change if zero.\n * @return {Array}: the original array, sorted in place.\n */\nexports.sort = function(array, sortFn) {\n var notOrdered = 0;\n var notReversed = 0;\n for(var i = 1; i < array.length; i++) {\n var pairOrder = sortFn(array[i], array[i - 1]);\n if(pairOrder < 0) notOrdered = 1;\n else if(pairOrder > 0) notReversed = 1;\n if(notOrdered && notReversed) return array.sort(sortFn);\n }\n return notReversed ? array : array.reverse();\n};\n\n/**\n * find index in array 'arr' that minimizes 'fn'\n *\n * @param {array} arr : array where to search\n * @param {fn (optional)} fn : function to minimize,\n * if not given, fn is the identity function\n * @return {integer}\n */\nexports.findIndexOfMin = function(arr, fn) {\n fn = fn || identity;\n\n var min = Infinity;\n var ind;\n\n for(var i = 0; i < arr.length; i++) {\n var v = fn(arr[i]);\n if(v < min) {\n min = v;\n ind = i;\n }\n }\n return ind;\n};\n\n},{\"../constants/numerical\":704,\"./identity\":727,\"./loggers\":732,\"fast-isnumeric\":236}],748:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n// works with our CSS cursor classes (see css/_cursor.scss)\n// to apply cursors to d3 single-element selections.\n// omit cursor to revert to the default.\nmodule.exports = function setCursor(el3, csr) {\n (el3.attr('class') || '').split(' ').forEach(function(cls) {\n if(cls.indexOf('cursor-') === 0) el3.classed(cls, false);\n });\n\n if(csr) el3.classed('cursor-' + csr, true);\n};\n\n},{}],749:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Color = _dereq_('../components/color');\n\nvar noop = function() {};\n\n\n/**\n * Prints a no webgl error message into the scene container\n * @param {scene instance} scene\n *\n * Expects 'scene' to have property 'container'\n *\n */\nmodule.exports = function showNoWebGlMsg(scene) {\n for(var prop in scene) {\n if(typeof scene[prop] === 'function') scene[prop] = noop;\n }\n\n scene.destroy = function() {\n scene.container.parentNode.removeChild(scene.container);\n };\n\n var div = document.createElement('div');\n div.className = 'no-webgl';\n div.style.cursor = 'pointer';\n div.style.fontSize = '24px';\n div.style.color = Color.defaults[0];\n div.style.position = 'absolute';\n div.style.left = div.style.top = '0px';\n div.style.width = div.style.height = '100%';\n div.style['background-color'] = Color.lightLine;\n div.style['z-index'] = 30;\n\n var p = document.createElement('p');\n p.textContent = 'WebGL is not supported by your browser - visit https://get.webgl.org for more info';\n p.style.position = 'relative';\n p.style.top = '50%';\n p.style.left = '50%';\n p.style.height = '30%';\n p.style.width = '50%';\n p.style.margin = '-15% 0 0 -25%';\n\n div.appendChild(p);\n scene.container.appendChild(div);\n scene.container.style.background = '#FFFFFF';\n scene.container.onclick = function() {\n window.open('https://get.webgl.org');\n };\n\n // return before setting up camera and onrender methods\n return false;\n};\n\n},{\"../components/color\":595}],750:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar isArrayOrTypedArray = _dereq_('./array').isArrayOrTypedArray;\n\n/**\n * aggNums() returns the result of an aggregate function applied to an array of\n * values, where non-numerical values have been tossed out.\n *\n * @param {function} f - aggregation function (e.g., Math.min)\n * @param {Number} v - initial value (continuing from previous calls)\n * if there's no continuing value, use null for selector-type\n * functions (max,min), or 0 for summations\n * @param {Array} a - array to aggregate (may be nested, we will recurse,\n * but all elements must have the same dimension)\n * @param {Number} len - maximum length of a to aggregate\n * @return {Number} - result of f applied to a starting from v\n */\nexports.aggNums = function(f, v, a, len) {\n var i,\n b;\n if(!len || len > a.length) len = a.length;\n if(!isNumeric(v)) v = false;\n if(isArrayOrTypedArray(a[0])) {\n b = new Array(len);\n for(i = 0; i < len; i++) b[i] = exports.aggNums(f, v, a[i]);\n a = b;\n }\n\n for(i = 0; i < len; i++) {\n if(!isNumeric(v)) v = a[i];\n else if(isNumeric(a[i])) v = f(+v, +a[i]);\n }\n return v;\n};\n\n/**\n * mean & std dev functions using aggNums, so it handles non-numerics nicely\n * even need to use aggNums instead of .length, to toss out non-numerics\n */\nexports.len = function(data) {\n return exports.aggNums(function(a) { return a + 1; }, 0, data);\n};\n\nexports.mean = function(data, len) {\n if(!len) len = exports.len(data);\n return exports.aggNums(function(a, b) { return a + b; }, 0, data) / len;\n};\n\nexports.midRange = function(numArr) {\n if(numArr === undefined || numArr.length === 0) return undefined;\n return (exports.aggNums(Math.max, null, numArr) + exports.aggNums(Math.min, null, numArr)) / 2;\n};\n\nexports.variance = function(data, len, mean) {\n if(!len) len = exports.len(data);\n if(!isNumeric(mean)) mean = exports.mean(data, len);\n\n return exports.aggNums(function(a, b) {\n return a + Math.pow(b - mean, 2);\n }, 0, data) / len;\n};\n\nexports.stdev = function(data, len, mean) {\n return Math.sqrt(exports.variance(data, len, mean));\n};\n\n/**\n * median of a finite set of numbers\n * reference page: https://en.wikipedia.org/wiki/Median#Finite_set_of_numbers\n**/\nexports.median = function(data) {\n var b = data.slice().sort();\n return exports.interp(b, 0.5);\n};\n\n/**\n * interp() computes a percentile (quantile) for a given distribution.\n * We interpolate the distribution (to compute quantiles, we follow method #10 here:\n * http://www.amstat.org/publications/jse/v14n3/langford.html).\n * Typically the index or rank (n * arr.length) may be non-integer.\n * For reference: ends are clipped to the extreme values in the array;\n * For box plots: index you get is half a point too high (see\n * http://en.wikipedia.org/wiki/Percentile#Nearest_rank) but note that this definition\n * indexes from 1 rather than 0, so we subtract 1/2 (instead of add).\n *\n * @param {Array} arr - This array contains the values that make up the distribution.\n * @param {Number} n - Between 0 and 1, n = p/100 is such that we compute the p^th percentile.\n * For example, the 50th percentile (or median) corresponds to n = 0.5\n * @return {Number} - percentile\n */\nexports.interp = function(arr, n) {\n if(!isNumeric(n)) throw 'n should be a finite number';\n n = n * arr.length - 0.5;\n if(n < 0) return arr[0];\n if(n > arr.length - 1) return arr[arr.length - 1];\n var frac = n % 1;\n return frac * arr[Math.ceil(n)] + (1 - frac) * arr[Math.floor(n)];\n};\n\n},{\"./array\":711,\"fast-isnumeric\":236}],751:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar rgba = _dereq_('color-normalize');\n\nfunction str2RgbaArray(color) {\n if(!color) return [0, 0, 0, 1];\n return rgba(color);\n}\n\nmodule.exports = str2RgbaArray;\n\n},{\"color-normalize\":122}],752:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n/* global MathJax:false */\n\nvar d3 = _dereq_('d3');\n\nvar Lib = _dereq_('../lib');\nvar xmlnsNamespaces = _dereq_('../constants/xmlns_namespaces');\nvar LINE_SPACING = _dereq_('../constants/alignment').LINE_SPACING;\n\n// text converter\n\nfunction getSize(_selection, _dimension) {\n return _selection.node().getBoundingClientRect()[_dimension];\n}\n\nvar FIND_TEX = /([^$]*)([$]+[^$]*[$]+)([^$]*)/;\n\nexports.convertToTspans = function(_context, gd, _callback) {\n var str = _context.text();\n\n // Until we get tex integrated more fully (so it can be used along with non-tex)\n // allow some elements to prohibit it by attaching 'data-notex' to the original\n var tex = (!_context.attr('data-notex')) &&\n (typeof MathJax !== 'undefined') &&\n str.match(FIND_TEX);\n\n var parent = d3.select(_context.node().parentNode);\n if(parent.empty()) return;\n var svgClass = (_context.attr('class')) ? _context.attr('class').split(' ')[0] : 'text';\n svgClass += '-math';\n parent.selectAll('svg.' + svgClass).remove();\n parent.selectAll('g.' + svgClass + '-group').remove();\n _context.style('display', null)\n .attr({\n // some callers use data-unformatted *from the element* in 'cancel'\n // so we need it here even if we're going to turn it into math\n // these two (plus style and text-anchor attributes) form the key we're\n // going to use for Drawing.bBox\n 'data-unformatted': str,\n 'data-math': 'N'\n });\n\n function showText() {\n if(!parent.empty()) {\n svgClass = _context.attr('class') + '-math';\n parent.select('svg.' + svgClass).remove();\n }\n _context.text('')\n .style('white-space', 'pre');\n\n var hasLink = buildSVGText(_context.node(), str);\n\n if(hasLink) {\n // at least in Chrome, pointer-events does not seem\n // to be honored in children of elements\n // so if we have an anchor, we have to make the\n // whole element respond\n _context.style('pointer-events', 'all');\n }\n\n exports.positionText(_context);\n\n if(_callback) _callback.call(_context);\n }\n\n if(tex) {\n ((gd && gd._promises) || []).push(new Promise(function(resolve) {\n _context.style('display', 'none');\n var fontSize = parseInt(_context.node().style.fontSize, 10);\n var config = {fontSize: fontSize};\n\n texToSVG(tex[2], config, function(_svgEl, _glyphDefs, _svgBBox) {\n parent.selectAll('svg.' + svgClass).remove();\n parent.selectAll('g.' + svgClass + '-group').remove();\n\n var newSvg = _svgEl && _svgEl.select('svg');\n if(!newSvg || !newSvg.node()) {\n showText();\n resolve();\n return;\n }\n\n var mathjaxGroup = parent.append('g')\n .classed(svgClass + '-group', true)\n .attr({\n 'pointer-events': 'none',\n 'data-unformatted': str,\n 'data-math': 'Y'\n });\n\n mathjaxGroup.node().appendChild(newSvg.node());\n\n // stitch the glyph defs\n if(_glyphDefs && _glyphDefs.node()) {\n newSvg.node().insertBefore(_glyphDefs.node().cloneNode(true),\n newSvg.node().firstChild);\n }\n\n newSvg.attr({\n 'class': svgClass,\n height: _svgBBox.height,\n preserveAspectRatio: 'xMinYMin meet'\n })\n .style({overflow: 'visible', 'pointer-events': 'none'});\n\n var fill = _context.node().style.fill || 'black';\n var g = newSvg.select('g');\n g.attr({fill: fill, stroke: fill});\n\n var newSvgW = getSize(g, 'width');\n var newSvgH = getSize(g, 'height');\n var newX = +_context.attr('x') - newSvgW *\n {start: 0, middle: 0.5, end: 1}[_context.attr('text-anchor') || 'start'];\n // font baseline is about 1/4 fontSize below centerline\n var textHeight = fontSize || getSize(_context, 'height');\n var dy = -textHeight / 4;\n\n if(svgClass[0] === 'y') {\n mathjaxGroup.attr({\n transform: 'rotate(' + [-90, +_context.attr('x'), +_context.attr('y')] +\n ') translate(' + [-newSvgW / 2, dy - newSvgH / 2] + ')'\n });\n newSvg.attr({x: +_context.attr('x'), y: +_context.attr('y')});\n } else if(svgClass[0] === 'l') {\n newSvg.attr({x: _context.attr('x'), y: dy - (newSvgH / 2)});\n } else if(svgClass[0] === 'a' && svgClass.indexOf('atitle') !== 0) {\n newSvg.attr({x: 0, y: dy});\n } else {\n newSvg.attr({x: newX, y: (+_context.attr('y') + dy - newSvgH / 2)});\n }\n\n if(_callback) _callback.call(_context, mathjaxGroup);\n resolve(mathjaxGroup);\n });\n }));\n } else showText();\n\n return _context;\n};\n\n\n// MathJax\n\nvar LT_MATCH = /(<|<|<)/g;\nvar GT_MATCH = /(>|>|>)/g;\n\nfunction cleanEscapesForTex(s) {\n return s.replace(LT_MATCH, '\\\\lt ')\n .replace(GT_MATCH, '\\\\gt ');\n}\n\nfunction texToSVG(_texString, _config, _callback) {\n var originalRenderer,\n originalConfig,\n originalProcessSectionDelay,\n tmpDiv;\n\n MathJax.Hub.Queue(\n function() {\n originalConfig = Lib.extendDeepAll({}, MathJax.Hub.config);\n\n originalProcessSectionDelay = MathJax.Hub.processSectionDelay;\n if(MathJax.Hub.processSectionDelay !== undefined) {\n // MathJax 2.5+\n MathJax.Hub.processSectionDelay = 0;\n }\n\n return MathJax.Hub.Config({\n messageStyle: 'none',\n tex2jax: {\n inlineMath: [['$', '$'], ['\\\\(', '\\\\)']]\n },\n displayAlign: 'left',\n });\n },\n function() {\n // Get original renderer\n originalRenderer = MathJax.Hub.config.menuSettings.renderer;\n if(originalRenderer !== 'SVG') {\n return MathJax.Hub.setRenderer('SVG');\n }\n },\n function() {\n var randomID = 'math-output-' + Lib.randstr({}, 64);\n tmpDiv = d3.select('body').append('div')\n .attr({id: randomID})\n .style({visibility: 'hidden', position: 'absolute'})\n .style({'font-size': _config.fontSize + 'px'})\n .text(cleanEscapesForTex(_texString));\n\n return MathJax.Hub.Typeset(tmpDiv.node());\n },\n function() {\n var glyphDefs = d3.select('body').select('#MathJax_SVG_glyphs');\n\n if(tmpDiv.select('.MathJax_SVG').empty() || !tmpDiv.select('svg').node()) {\n Lib.log('There was an error in the tex syntax.', _texString);\n _callback();\n } else {\n var svgBBox = tmpDiv.select('svg').node().getBoundingClientRect();\n _callback(tmpDiv.select('.MathJax_SVG'), glyphDefs, svgBBox);\n }\n\n tmpDiv.remove();\n\n if(originalRenderer !== 'SVG') {\n return MathJax.Hub.setRenderer(originalRenderer);\n }\n },\n function() {\n if(originalProcessSectionDelay !== undefined) {\n MathJax.Hub.processSectionDelay = originalProcessSectionDelay;\n }\n return MathJax.Hub.Config(originalConfig);\n });\n}\n\nvar TAG_STYLES = {\n // would like to use baseline-shift for sub/sup but FF doesn't support it\n // so we need to use dy along with the uber hacky shift-back-to\n // baseline below\n sup: 'font-size:70%',\n sub: 'font-size:70%',\n b: 'font-weight:bold',\n i: 'font-style:italic',\n a: 'cursor:pointer',\n span: '',\n em: 'font-style:italic;font-weight:bold'\n};\n\n// baseline shifts for sub and sup\nvar SHIFT_DY = {\n sub: '0.3em',\n sup: '-0.6em'\n};\n// reset baseline by adding a tspan (empty except for a zero-width space)\n// with dy of -70% * SHIFT_DY (because font-size=70%)\nvar RESET_DY = {\n sub: '-0.21em',\n sup: '0.42em'\n};\nvar ZERO_WIDTH_SPACE = '\\u200b';\n\n/*\n * Whitelist of protocols in user-supplied urls. Mostly we want to avoid javascript\n * and related attack vectors. The empty items are there for IE, that in various\n * versions treats relative paths as having different flavors of no protocol, while\n * other browsers have these explicitly inherit the protocol of the page they're in.\n */\nvar PROTOCOLS = ['http:', 'https:', 'mailto:', '', undefined, ':'];\n\nvar NEWLINES = exports.NEWLINES = /(\\r\\n?|\\n)/g;\n\nvar SPLIT_TAGS = /(<[^<>]*>)/;\n\nvar ONE_TAG = /<(\\/?)([^ >]*)(\\s+(.*))?>/i;\n\nvar BR_TAG = //i;\nexports.BR_TAG_ALL = //gi;\n\n/*\n * style and href: pull them out of either single or double quotes. Also\n * - target: (_blank|_self|_parent|_top|framename)\n * note that you can't use target to get a popup but if you use popup,\n * a `framename` will be passed along as the name of the popup window.\n * per the spec, cannot contain whitespace.\n * for backward compatibility we default to '_blank'\n * - popup: a custom one for us to enable popup (new window) links. String\n * for window.open -> strWindowFeatures, like 'menubar=yes,width=500,height=550'\n * note that at least in Chrome, you need to give at least one property\n * in this string or the page will open in a new tab anyway. We follow this\n * convention and will not make a popup if this string is empty.\n * per the spec, cannot contain whitespace.\n *\n * Because we hack in other attributes with style (sub & sup), drop any trailing\n * semicolon in user-supplied styles so we can consistently append the tag-dependent style\n *\n * These are for tag attributes; Chrome anyway will convert entities in\n * attribute values, but not in attribute names\n * you can test this by for example:\n * > p = document.createElement('p')\n * > p.innerHTML = 'Hi'\n * > p.innerHTML\n * <- 'Hi'\n */\nvar STYLEMATCH = /(^|[\\s\"'])style\\s*=\\s*(\"([^\"]*);?\"|'([^']*);?')/i;\nvar HREFMATCH = /(^|[\\s\"'])href\\s*=\\s*(\"([^\"]*)\"|'([^']*)')/i;\nvar TARGETMATCH = /(^|[\\s\"'])target\\s*=\\s*(\"([^\"\\s]*)\"|'([^'\\s]*)')/i;\nvar POPUPMATCH = /(^|[\\s\"'])popup\\s*=\\s*(\"([\\w=,]*)\"|'([\\w=,]*)')/i;\n\n// dedicated matcher for these quoted regexes, that can return their results\n// in two different places\nfunction getQuotedMatch(_str, re) {\n if(!_str) return null;\n var match = _str.match(re);\n var result = match && (match[3] || match[4]);\n return result && convertEntities(result);\n}\n\nvar COLORMATCH = /(^|;)\\s*color:/;\n\n/**\n * Strip string of tags\n *\n * @param {string} _str : input string\n * @param {object} opts :\n * - len {number} max length of output string\n * - allowedTags {array} list of pseudo-html tags to NOT strip\n * @return {string}\n */\nexports.plainText = function(_str, opts) {\n opts = opts || {};\n\n var len = (opts.len !== undefined && opts.len !== -1) ? opts.len : Infinity;\n var allowedTags = opts.allowedTags !== undefined ? opts.allowedTags : ['br'];\n\n var ellipsis = '...';\n var eLen = ellipsis.length;\n\n var oldParts = _str.split(SPLIT_TAGS);\n var newParts = [];\n var prevTag = '';\n var l = 0;\n\n for(var i = 0; i < oldParts.length; i++) {\n var p = oldParts[i];\n var match = p.match(ONE_TAG);\n var tagType = match && match[2].toLowerCase();\n\n if(tagType) {\n // N.B. tags do not count towards string length\n if(allowedTags.indexOf(tagType) !== -1) {\n newParts.push(p);\n prevTag = tagType;\n }\n } else {\n var pLen = p.length;\n\n if((l + pLen) < len) {\n newParts.push(p);\n l += pLen;\n } else if(l < len) {\n var pLen2 = len - l;\n\n if(prevTag && (prevTag !== 'br' || pLen2 <= eLen || pLen <= eLen)) {\n newParts.pop();\n }\n\n if(len > eLen) {\n newParts.push(p.substr(0, pLen2 - eLen) + ellipsis);\n } else {\n newParts.push(p.substr(0, pLen2));\n }\n break;\n }\n\n prevTag = '';\n }\n }\n\n return newParts.join('');\n};\n\n/*\n * N.B. HTML entities are listed without the leading '&' and trailing ';'\n * https://www.freeformatter.com/html-entities.html\n *\n * FWIW if we wanted to support the full set, it has 2261 entries:\n * https://www.w3.org/TR/html5/entities.json\n * though I notice that some of these are duplicates and/or are missing \";\"\n * eg: \"&\", \"&\", \"&\", and \"&\" all map to \"&\"\n * We no longer need to include numeric entities here, these are now handled\n * by String.fromCodePoint/fromCharCode\n *\n * Anyway the only ones that are really important to allow are the HTML special\n * chars <, >, and &, because these ones can trigger special processing if not\n * replaced by the corresponding entity.\n */\nvar entityToUnicode = {\n mu: 'μ',\n amp: '&',\n lt: '<',\n gt: '>',\n nbsp: ' ',\n times: '×',\n plusmn: '±',\n deg: '°'\n};\n\n// NOTE: in general entities can contain uppercase too (so [a-zA-Z]) but all the\n// ones we support use only lowercase. If we ever change that, update the regex.\nvar ENTITY_MATCH = /&(#\\d+|#x[\\da-fA-F]+|[a-z]+);/g;\nfunction convertEntities(_str) {\n return _str.replace(ENTITY_MATCH, function(fullMatch, innerMatch) {\n var outChar;\n if(innerMatch.charAt(0) === '#') {\n // cannot use String.fromCodePoint in IE\n outChar = fromCodePoint(\n innerMatch.charAt(1) === 'x' ?\n parseInt(innerMatch.substr(2), 16) :\n parseInt(innerMatch.substr(1), 10)\n );\n } else outChar = entityToUnicode[innerMatch];\n\n // as in regular HTML, if we didn't decode the entity just\n // leave the raw text in place.\n return outChar || fullMatch;\n });\n}\nexports.convertEntities = convertEntities;\n\nfunction fromCodePoint(code) {\n // Don't allow overflow. In Chrome this turns into � but I feel like it's\n // more useful to just not convert it at all.\n if(code > 0x10FFFF) return;\n var stringFromCodePoint = String.fromCodePoint;\n if(stringFromCodePoint) return stringFromCodePoint(code);\n\n // IE doesn't have String.fromCodePoint\n // see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint\n var stringFromCharCode = String.fromCharCode;\n if(code <= 0xFFFF) return stringFromCharCode(code);\n return stringFromCharCode(\n (code >> 10) + 0xD7C0,\n (code % 0x400) + 0xDC00\n );\n}\n\n/*\n * buildSVGText: convert our pseudo-html into SVG tspan elements, and attach these\n * to containerNode\n *\n * @param {svg text element} containerNode: the node to insert this text into\n * @param {string} str: the pseudo-html string to convert to svg\n *\n * @returns {bool}: does the result contain any links? We need to handle the text element\n * somewhat differently if it does, so just keep track of this when it happens.\n */\nfunction buildSVGText(containerNode, str) {\n /*\n * Normalize behavior between IE and others wrt newlines and whitespace:pre\n * this combination makes IE barf https://github.com/plotly/plotly.js/issues/746\n * Chrome and FF display \\n, \\r, or \\r\\n as a space in this mode.\n * I feel like at some point we turned these into
but currently we don't so\n * I'm just going to cement what we do now in Chrome and FF\n */\n str = str.replace(NEWLINES, ' ');\n\n var hasLink = false;\n\n // as we're building the text, keep track of what elements we're nested inside\n // nodeStack will be an array of {node, type, style, href, target, popup}\n // where only type: 'a' gets the last 3 and node is only added when it's created\n var nodeStack = [];\n var currentNode;\n var currentLine = -1;\n\n function newLine() {\n currentLine++;\n\n var lineNode = document.createElementNS(xmlnsNamespaces.svg, 'tspan');\n d3.select(lineNode).attr({\n class: 'line',\n dy: (currentLine * LINE_SPACING) + 'em'\n });\n containerNode.appendChild(lineNode);\n\n currentNode = lineNode;\n\n var oldNodeStack = nodeStack;\n nodeStack = [{node: lineNode}];\n\n if(oldNodeStack.length > 1) {\n for(var i = 1; i < oldNodeStack.length; i++) {\n enterNode(oldNodeStack[i]);\n }\n }\n }\n\n function enterNode(nodeSpec) {\n var type = nodeSpec.type;\n var nodeAttrs = {};\n var nodeType;\n\n if(type === 'a') {\n nodeType = 'a';\n var target = nodeSpec.target;\n var href = nodeSpec.href;\n var popup = nodeSpec.popup;\n if(href) {\n nodeAttrs = {\n 'xlink:xlink:show': (target === '_blank' || target.charAt(0) !== '_') ? 'new' : 'replace',\n target: target,\n 'xlink:xlink:href': href\n };\n if(popup) {\n // security: href and target are not inserted as code but\n // as attributes. popup is, but limited to /[A-Za-z0-9_=,]/\n nodeAttrs.onclick = 'window.open(this.href.baseVal,this.target.baseVal,\"' +\n popup + '\");return false;';\n }\n }\n } else nodeType = 'tspan';\n\n if(nodeSpec.style) nodeAttrs.style = nodeSpec.style;\n\n var newNode = document.createElementNS(xmlnsNamespaces.svg, nodeType);\n\n if(type === 'sup' || type === 'sub') {\n addTextNode(currentNode, ZERO_WIDTH_SPACE);\n currentNode.appendChild(newNode);\n\n var resetter = document.createElementNS(xmlnsNamespaces.svg, 'tspan');\n addTextNode(resetter, ZERO_WIDTH_SPACE);\n d3.select(resetter).attr('dy', RESET_DY[type]);\n nodeAttrs.dy = SHIFT_DY[type];\n\n currentNode.appendChild(newNode);\n currentNode.appendChild(resetter);\n } else {\n currentNode.appendChild(newNode);\n }\n\n d3.select(newNode).attr(nodeAttrs);\n\n currentNode = nodeSpec.node = newNode;\n nodeStack.push(nodeSpec);\n }\n\n function addTextNode(node, text) {\n node.appendChild(document.createTextNode(text));\n }\n\n function exitNode(type) {\n // A bare closing tag can't close the root node. If we encounter this it\n // means there's an extra closing tag that can just be ignored:\n if(nodeStack.length === 1) {\n Lib.log('Ignoring unexpected end tag .', str);\n return;\n }\n\n var innerNode = nodeStack.pop();\n\n if(type !== innerNode.type) {\n Lib.log('Start tag <' + innerNode.type + '> doesnt match end tag <' +\n type + '>. Pretending it did match.', str);\n }\n currentNode = nodeStack[nodeStack.length - 1].node;\n }\n\n var hasLines = BR_TAG.test(str);\n\n if(hasLines) newLine();\n else {\n currentNode = containerNode;\n nodeStack = [{node: containerNode}];\n }\n\n var parts = str.split(SPLIT_TAGS);\n for(var i = 0; i < parts.length; i++) {\n var parti = parts[i];\n var match = parti.match(ONE_TAG);\n var tagType = match && match[2].toLowerCase();\n var tagStyle = TAG_STYLES[tagType];\n\n if(tagType === 'br') {\n newLine();\n } else if(tagStyle === undefined) {\n addTextNode(currentNode, convertEntities(parti));\n } else {\n // tag - open or close\n if(match[1]) {\n exitNode(tagType);\n } else {\n var extra = match[4];\n\n var nodeSpec = {type: tagType};\n\n // now add style, from both the tag name and any extra css\n // Most of the svg css that users will care about is just like html,\n // but font color is different (uses fill). Let our users ignore this.\n var css = getQuotedMatch(extra, STYLEMATCH);\n if(css) {\n css = css.replace(COLORMATCH, '$1 fill:');\n if(tagStyle) css += ';' + tagStyle;\n } else if(tagStyle) css = tagStyle;\n\n if(css) nodeSpec.style = css;\n\n if(tagType === 'a') {\n hasLink = true;\n\n var href = getQuotedMatch(extra, HREFMATCH);\n\n if(href) {\n // check safe protocols\n var dummyAnchor = document.createElement('a');\n dummyAnchor.href = href;\n if(PROTOCOLS.indexOf(dummyAnchor.protocol) !== -1) {\n // Decode href to allow both already encoded and not encoded\n // URIs. Without decoding prior encoding, an already encoded\n // URI would be encoded twice producing a semantically different URI.\n nodeSpec.href = encodeURI(decodeURI(href));\n nodeSpec.target = getQuotedMatch(extra, TARGETMATCH) || '_blank';\n nodeSpec.popup = getQuotedMatch(extra, POPUPMATCH);\n }\n }\n }\n\n enterNode(nodeSpec);\n }\n }\n }\n\n return hasLink;\n}\n\n/*\n * sanitizeHTML: port of buildSVGText aimed at providing a clean subset of HTML\n * @param {string} str: the html string to clean\n * @returns {string}: a cleaned and normalized version of the input,\n * supporting only a small subset of html\n */\nexports.sanitizeHTML = function sanitizeHTML(str) {\n str = str.replace(NEWLINES, ' ');\n\n var rootNode = document.createElement('p');\n var currentNode = rootNode;\n var nodeStack = [];\n\n var parts = str.split(SPLIT_TAGS);\n for(var i = 0; i < parts.length; i++) {\n var parti = parts[i];\n var match = parti.match(ONE_TAG);\n var tagType = match && match[2].toLowerCase();\n\n if(tagType in TAG_STYLES) {\n if(match[1]) {\n if(nodeStack.length) {\n currentNode = nodeStack.pop();\n }\n } else {\n var extra = match[4];\n\n var css = getQuotedMatch(extra, STYLEMATCH);\n var nodeAttrs = css ? {style: css} : {};\n\n if(tagType === 'a') {\n var href = getQuotedMatch(extra, HREFMATCH);\n\n if(href) {\n var dummyAnchor = document.createElement('a');\n dummyAnchor.href = href;\n if(PROTOCOLS.indexOf(dummyAnchor.protocol) !== -1) {\n nodeAttrs.href = encodeURI(decodeURI(href));\n var target = getQuotedMatch(extra, TARGETMATCH);\n if(target) {\n nodeAttrs.target = target;\n }\n }\n }\n }\n\n var newNode = document.createElement(tagType);\n currentNode.appendChild(newNode);\n d3.select(newNode).attr(nodeAttrs);\n\n currentNode = newNode;\n nodeStack.push(newNode);\n }\n } else {\n currentNode.appendChild(\n document.createTextNode(convertEntities(parti))\n );\n }\n }\n var key = 'innerHTML'; // i.e. to avoid pass test-syntax\n return rootNode[key];\n};\n\nexports.lineCount = function lineCount(s) {\n return s.selectAll('tspan.line').size() || 1;\n};\n\nexports.positionText = function positionText(s, x, y) {\n return s.each(function() {\n var text = d3.select(this);\n\n function setOrGet(attr, val) {\n if(val === undefined) {\n val = text.attr(attr);\n if(val === null) {\n text.attr(attr, 0);\n val = 0;\n }\n } else text.attr(attr, val);\n return val;\n }\n\n var thisX = setOrGet('x', x);\n var thisY = setOrGet('y', y);\n\n if(this.nodeName === 'text') {\n text.selectAll('tspan.line').attr({x: thisX, y: thisY});\n }\n });\n};\n\nfunction alignHTMLWith(_base, container, options) {\n var alignH = options.horizontalAlign;\n var alignV = options.verticalAlign || 'top';\n var bRect = _base.node().getBoundingClientRect();\n var cRect = container.node().getBoundingClientRect();\n var thisRect;\n var getTop;\n var getLeft;\n\n if(alignV === 'bottom') {\n getTop = function() { return bRect.bottom - thisRect.height; };\n } else if(alignV === 'middle') {\n getTop = function() { return bRect.top + (bRect.height - thisRect.height) / 2; };\n } else { // default: top\n getTop = function() { return bRect.top; };\n }\n\n if(alignH === 'right') {\n getLeft = function() { return bRect.right - thisRect.width; };\n } else if(alignH === 'center') {\n getLeft = function() { return bRect.left + (bRect.width - thisRect.width) / 2; };\n } else { // default: left\n getLeft = function() { return bRect.left; };\n }\n\n return function() {\n thisRect = this.node().getBoundingClientRect();\n this.style({\n top: (getTop() - cRect.top) + 'px',\n left: (getLeft() - cRect.left) + 'px',\n 'z-index': 1000\n });\n return this;\n };\n}\n\n/*\n * Editable title\n * @param {d3.selection} context: the element being edited. Normally text,\n * but if it isn't, you should provide the styling options\n * @param {object} options:\n * @param {div} options.gd: graphDiv\n * @param {d3.selection} options.delegate: item to bind events to if not this\n * @param {boolean} options.immediate: start editing now (true) or on click (false, default)\n * @param {string} options.fill: font color if not as shown\n * @param {string} options.background: background color if not as shown\n * @param {string} options.text: initial text, if not as shown\n * @param {string} options.horizontalAlign: alignment of the edit box wrt. the bound element\n * @param {string} options.verticalAlign: alignment of the edit box wrt. the bound element\n */\n\nexports.makeEditable = function(context, options) {\n var gd = options.gd;\n var _delegate = options.delegate;\n var dispatch = d3.dispatch('edit', 'input', 'cancel');\n var handlerElement = _delegate || context;\n\n context.style({'pointer-events': _delegate ? 'none' : 'all'});\n\n if(context.size() !== 1) throw new Error('boo');\n\n function handleClick() {\n appendEditable();\n context.style({opacity: 0});\n // also hide any mathjax svg\n var svgClass = handlerElement.attr('class');\n var mathjaxClass;\n if(svgClass) mathjaxClass = '.' + svgClass.split(' ')[0] + '-math-group';\n else mathjaxClass = '[class*=-math-group]';\n if(mathjaxClass) {\n d3.select(context.node().parentNode).select(mathjaxClass).style({opacity: 0});\n }\n }\n\n function selectElementContents(_el) {\n var el = _el.node();\n var range = document.createRange();\n range.selectNodeContents(el);\n var sel = window.getSelection();\n sel.removeAllRanges();\n sel.addRange(range);\n el.focus();\n }\n\n function appendEditable() {\n var plotDiv = d3.select(gd);\n var container = plotDiv.select('.svg-container');\n var div = container.append('div');\n var cStyle = context.node().style;\n var fontSize = parseFloat(cStyle.fontSize || 12);\n\n var initialText = options.text;\n if(initialText === undefined) initialText = context.attr('data-unformatted');\n\n div.classed('plugin-editable editable', true)\n .style({\n position: 'absolute',\n 'font-family': cStyle.fontFamily || 'Arial',\n 'font-size': fontSize,\n color: options.fill || cStyle.fill || 'black',\n opacity: 1,\n 'background-color': options.background || 'transparent',\n outline: '#ffffff33 1px solid',\n margin: [-fontSize / 8 + 1, 0, 0, -1].join('px ') + 'px',\n padding: '0',\n 'box-sizing': 'border-box'\n })\n .attr({contenteditable: true})\n .text(initialText)\n .call(alignHTMLWith(context, container, options))\n .on('blur', function() {\n gd._editing = false;\n context.text(this.textContent)\n .style({opacity: 1});\n var svgClass = d3.select(this).attr('class');\n var mathjaxClass;\n if(svgClass) mathjaxClass = '.' + svgClass.split(' ')[0] + '-math-group';\n else mathjaxClass = '[class*=-math-group]';\n if(mathjaxClass) {\n d3.select(context.node().parentNode).select(mathjaxClass).style({opacity: 0});\n }\n var text = this.textContent;\n d3.select(this).transition().duration(0).remove();\n d3.select(document).on('mouseup', null);\n dispatch.edit.call(context, text);\n })\n .on('focus', function() {\n var editDiv = this;\n gd._editing = true;\n d3.select(document).on('mouseup', function() {\n if(d3.event.target === editDiv) return false;\n if(document.activeElement === div.node()) div.node().blur();\n });\n })\n .on('keyup', function() {\n if(d3.event.which === 27) {\n gd._editing = false;\n context.style({opacity: 1});\n d3.select(this)\n .style({opacity: 0})\n .on('blur', function() { return false; })\n .transition().remove();\n dispatch.cancel.call(context, this.textContent);\n } else {\n dispatch.input.call(context, this.textContent);\n d3.select(this).call(alignHTMLWith(context, container, options));\n }\n })\n .on('keydown', function() {\n if(d3.event.which === 13) this.blur();\n })\n .call(selectElementContents);\n }\n\n if(options.immediate) handleClick();\n else handlerElement.on('click', handleClick);\n\n return d3.rebind(context, dispatch, 'on');\n};\n\n},{\"../constants/alignment\":697,\"../constants/xmlns_namespaces\":705,\"../lib\":728,\"d3\":164}],753:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar timerCache = {};\n\n/**\n * Throttle a callback. `callback` executes synchronously only if\n * more than `minInterval` milliseconds have already elapsed since the latest\n * call (if any). Otherwise we wait until `minInterval` is over and execute the\n * last callback received while waiting.\n * So the first and last events in a train are always executed (eventually)\n * but some of the events in the middle can be dropped.\n *\n * @param {string} id: an identifier to mark events to throttle together\n * @param {number} minInterval: minimum time, in milliseconds, between\n * invocations of `callback`\n * @param {function} callback: the function to throttle. `callback` itself\n * should be a purely synchronous function.\n */\nexports.throttle = function throttle(id, minInterval, callback) {\n var cache = timerCache[id];\n var now = Date.now();\n\n if(!cache) {\n /*\n * Throw out old items before making a new one, to prevent the cache\n * getting overgrown, for example from old plots that have been replaced.\n * 1 minute age is arbitrary.\n */\n for(var idi in timerCache) {\n if(timerCache[idi].ts < now - 60000) {\n delete timerCache[idi];\n }\n }\n cache = timerCache[id] = {ts: 0, timer: null};\n }\n\n _clearTimeout(cache);\n\n function exec() {\n callback();\n cache.ts = Date.now();\n if(cache.onDone) {\n cache.onDone();\n cache.onDone = null;\n }\n }\n\n if(now > cache.ts + minInterval) {\n exec();\n return;\n }\n\n cache.timer = setTimeout(function() {\n exec();\n cache.timer = null;\n }, minInterval);\n};\n\nexports.done = function(id) {\n var cache = timerCache[id];\n if(!cache || !cache.timer) return Promise.resolve();\n\n return new Promise(function(resolve) {\n var previousOnDone = cache.onDone;\n cache.onDone = function onDone() {\n if(previousOnDone) previousOnDone();\n resolve();\n cache.onDone = null;\n };\n });\n};\n\n/**\n * Clear the throttle cache for one or all timers\n * @param {optional string} id:\n * if provided, clear just this timer\n * if omitted, clear all timers (mainly useful for testing)\n */\nexports.clear = function(id) {\n if(id) {\n _clearTimeout(timerCache[id]);\n delete timerCache[id];\n } else {\n for(var idi in timerCache) exports.clear(idi);\n }\n};\n\nfunction _clearTimeout(cache) {\n if(cache && cache.timer !== null) {\n clearTimeout(cache.timer);\n cache.timer = null;\n }\n}\n\n},{}],754:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\n/**\n * convert a linear value into a logged value, folding negative numbers into\n * the given range\n */\nmodule.exports = function toLogRange(val, range) {\n if(val > 0) return Math.log(val) / Math.LN10;\n\n // move a negative value reference to a log axis - just put the\n // result at the lowest range value on the plot (or if the range also went negative,\n // one millionth of the top of the range)\n var newVal = Math.log(Math.min(range[0], range[1])) / Math.LN10;\n if(!isNumeric(newVal)) newVal = Math.log(Math.max(range[0], range[1])) / Math.LN10 - 6;\n return newVal;\n};\n\n},{\"fast-isnumeric\":236}],755:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar topojsonUtils = module.exports = {};\n\nvar locationmodeToLayer = _dereq_('../plots/geo/constants').locationmodeToLayer;\nvar topojsonFeature = _dereq_('topojson-client').feature;\n\ntopojsonUtils.getTopojsonName = function(geoLayout) {\n return [\n geoLayout.scope.replace(/ /g, '-'), '_',\n geoLayout.resolution.toString(), 'm'\n ].join('');\n};\n\ntopojsonUtils.getTopojsonPath = function(topojsonURL, topojsonName) {\n return topojsonURL + topojsonName + '.json';\n};\n\ntopojsonUtils.getTopojsonFeatures = function(trace, topojson) {\n var layer = locationmodeToLayer[trace.locationmode];\n var obj = topojson.objects[layer];\n\n return topojsonFeature(topojson, obj).features;\n};\n\n},{\"../plots/geo/constants\":806,\"topojson-client\":531}],756:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n moduleType: 'locale',\n name: 'en-US',\n dictionary: {\n 'Click to enter Colorscale title': 'Click to enter Colorscale title'\n },\n format: {\n date: '%m/%d/%Y'\n }\n};\n\n},{}],757:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n moduleType: 'locale',\n name: 'en',\n dictionary: {\n 'Click to enter Colorscale title': 'Click to enter Colourscale title'\n },\n format: {\n days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],\n shortDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n months: [\n 'January', 'February', 'March', 'April', 'May', 'June',\n 'July', 'August', 'September', 'October', 'November', 'December'\n ],\n shortMonths: [\n 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\n 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'\n ],\n periods: ['AM', 'PM'],\n dateTime: '%a %b %e %X %Y',\n date: '%d/%m/%Y',\n time: '%H:%M:%S',\n decimal: '.',\n thousands: ',',\n grouping: [3],\n currency: ['$', ''],\n year: '%Y',\n month: '%b %Y',\n dayMonth: '%b %-d',\n dayMonthYear: '%b %-d, %Y'\n }\n};\n\n},{}],758:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Registry = _dereq_('../registry');\n\n/*\n * containerArrayMatch: does this attribute string point into a\n * layout container array?\n *\n * @param {String} astr: an attribute string, like *annotations[2].text*\n *\n * @returns {Object | false} Returns false if `astr` doesn't match a container\n * array. If it does, returns:\n * {array: {String}, index: {Number}, property: {String}}\n * ie the attribute string for the array, the index within the array (or ''\n * if the whole array) and the property within that (or '' if the whole array\n * or the whole object)\n */\nmodule.exports = function containerArrayMatch(astr) {\n var rootContainers = Registry.layoutArrayContainers;\n var regexpContainers = Registry.layoutArrayRegexes;\n var rootPart = astr.split('[')[0];\n var arrayStr;\n var match;\n\n // look for regexp matches first, because they may be nested inside root matches\n // eg updatemenus[i].buttons is nested inside updatemenus\n for(var i = 0; i < regexpContainers.length; i++) {\n match = astr.match(regexpContainers[i]);\n if(match && match.index === 0) {\n arrayStr = match[0];\n break;\n }\n }\n\n // now look for root matches\n if(!arrayStr) arrayStr = rootContainers[rootContainers.indexOf(rootPart)];\n\n if(!arrayStr) return false;\n\n var tail = astr.substr(arrayStr.length);\n if(!tail) return {array: arrayStr, index: '', property: ''};\n\n match = tail.match(/^\\[(0|[1-9][0-9]*)\\](\\.(.+))?$/);\n if(!match) return false;\n\n return {array: arrayStr, index: Number(match[1]), property: match[3] || ''};\n};\n\n},{\"../registry\":859}],759:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../lib');\nvar extendFlat = Lib.extendFlat;\nvar isPlainObject = Lib.isPlainObject;\n\nvar traceOpts = {\n valType: 'flaglist',\n extras: ['none'],\n flags: ['calc', 'clearAxisTypes', 'plot', 'style', 'markerSize', 'colorbars'],\n \n};\n\nvar layoutOpts = {\n valType: 'flaglist',\n extras: ['none'],\n flags: [\n 'calc', 'plot', 'legend', 'ticks', 'axrange',\n 'layoutstyle', 'modebar', 'camera', 'arraydraw', 'colorbars'\n ],\n \n};\n\n// flags for inside restyle/relayout include a few extras\n// that shouldn't be used in attributes, to deal with certain\n// combinations and conditionals efficiently\nvar traceEditTypeFlags = traceOpts.flags.slice()\n .concat(['fullReplot']);\n\nvar layoutEditTypeFlags = layoutOpts.flags.slice()\n .concat('layoutReplot');\n\nmodule.exports = {\n traces: traceOpts,\n layout: layoutOpts,\n /*\n * default (all false) edit flags for restyle (traces)\n * creates a new object each call, so the caller can mutate freely\n */\n traceFlags: function() { return falseObj(traceEditTypeFlags); },\n\n /*\n * default (all false) edit flags for relayout\n * creates a new object each call, so the caller can mutate freely\n */\n layoutFlags: function() { return falseObj(layoutEditTypeFlags); },\n\n /*\n * update `flags` with the `editType` values found in `attr`\n */\n update: function(flags, attr) {\n var editType = attr.editType;\n if(editType && editType !== 'none') {\n var editTypeParts = editType.split('+');\n for(var i = 0; i < editTypeParts.length; i++) {\n flags[editTypeParts[i]] = true;\n }\n }\n },\n\n overrideAll: overrideAll\n};\n\nfunction falseObj(keys) {\n var out = {};\n for(var i = 0; i < keys.length; i++) out[keys[i]] = false;\n return out;\n}\n\n/**\n * For attributes that are largely copied from elsewhere into a plot type that doesn't\n * support partial redraws - overrides the editType field of all attributes in the object\n *\n * @param {object} attrs: the attributes to override. Will not be mutated.\n * @param {string} editTypeOverride: the new editType to use\n * @param {'nested'|'from-root'} overrideContainers:\n * - 'nested' will override editType for nested containers but not the root.\n * - 'from-root' will also override editType of the root container.\n * Containers below the absolute top level (trace or layout root) DO need an\n * editType even if they are not `valObject`s themselves (eg `scatter.marker`)\n * to handle the case where you edit the whole container.\n *\n * @return {object} a new attributes object with `editType` modified as directed\n */\nfunction overrideAll(attrs, editTypeOverride, overrideContainers) {\n var out = extendFlat({}, attrs);\n for(var key in out) {\n var attr = out[key];\n if(isPlainObject(attr)) {\n out[key] = overrideOne(attr, editTypeOverride, overrideContainers, key);\n }\n }\n if(overrideContainers === 'from-root') out.editType = editTypeOverride;\n\n return out;\n}\n\nfunction overrideOne(attr, editTypeOverride, overrideContainers, key) {\n if(attr.valType) {\n var out = extendFlat({}, attr);\n out.editType = editTypeOverride;\n\n if(Array.isArray(attr.items)) {\n out.items = new Array(attr.items.length);\n for(var i = 0; i < attr.items.length; i++) {\n out.items[i] = overrideOne(attr.items[i], editTypeOverride, 'from-root');\n }\n }\n return out;\n } else {\n // don't provide an editType for the _deprecated container\n return overrideAll(attr, editTypeOverride,\n (key.charAt(0) === '_') ? 'nested' : 'from-root');\n }\n}\n\n},{\"../lib\":728}],760:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar m4FromQuat = _dereq_('gl-mat4/fromQuat');\n\nvar Registry = _dereq_('../registry');\nvar Lib = _dereq_('../lib');\nvar Plots = _dereq_('../plots/plots');\nvar AxisIds = _dereq_('../plots/cartesian/axis_ids');\nvar Color = _dereq_('../components/color');\n\nvar cleanId = AxisIds.cleanId;\nvar getFromTrace = AxisIds.getFromTrace;\nvar traceIs = Registry.traceIs;\n\n// clear the promise queue if one of them got rejected\nexports.clearPromiseQueue = function(gd) {\n if(Array.isArray(gd._promises) && gd._promises.length > 0) {\n Lib.log('Clearing previous rejected promises from queue.');\n }\n\n gd._promises = [];\n};\n\n// make a few changes to the layout right away\n// before it gets used for anything\n// backward compatibility and cleanup of nonstandard options\nexports.cleanLayout = function(layout) {\n var i, j;\n\n if(!layout) layout = {};\n\n // cannot have (x|y)axis1, numbering goes axis, axis2, axis3...\n if(layout.xaxis1) {\n if(!layout.xaxis) layout.xaxis = layout.xaxis1;\n delete layout.xaxis1;\n }\n if(layout.yaxis1) {\n if(!layout.yaxis) layout.yaxis = layout.yaxis1;\n delete layout.yaxis1;\n }\n if(layout.scene1) {\n if(!layout.scene) layout.scene = layout.scene1;\n delete layout.scene1;\n }\n\n var axisAttrRegex = (Plots.subplotsRegistry.cartesian || {}).attrRegex;\n var polarAttrRegex = (Plots.subplotsRegistry.polar || {}).attrRegex;\n var ternaryAttrRegex = (Plots.subplotsRegistry.ternary || {}).attrRegex;\n var sceneAttrRegex = (Plots.subplotsRegistry.gl3d || {}).attrRegex;\n\n var keys = Object.keys(layout);\n for(i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if(axisAttrRegex && axisAttrRegex.test(key)) {\n // modifications to cartesian axes\n\n var ax = layout[key];\n if(ax.anchor && ax.anchor !== 'free') {\n ax.anchor = cleanId(ax.anchor);\n }\n if(ax.overlaying) ax.overlaying = cleanId(ax.overlaying);\n\n // old method of axis type - isdate and islog (before category existed)\n if(!ax.type) {\n if(ax.isdate) ax.type = 'date';\n else if(ax.islog) ax.type = 'log';\n else if(ax.isdate === false && ax.islog === false) ax.type = 'linear';\n }\n if(ax.autorange === 'withzero' || ax.autorange === 'tozero') {\n ax.autorange = true;\n ax.rangemode = 'tozero';\n }\n delete ax.islog;\n delete ax.isdate;\n delete ax.categories; // replaced by _categories\n\n // prune empty domain arrays made before the new nestedProperty\n if(emptyContainer(ax, 'domain')) delete ax.domain;\n\n // autotick -> tickmode\n if(ax.autotick !== undefined) {\n if(ax.tickmode === undefined) {\n ax.tickmode = ax.autotick ? 'auto' : 'linear';\n }\n delete ax.autotick;\n }\n\n cleanTitle(ax);\n } else if(polarAttrRegex && polarAttrRegex.test(key)) {\n // modifications for polar\n\n var polar = layout[key];\n cleanTitle(polar.radialaxis);\n } else if(ternaryAttrRegex && ternaryAttrRegex.test(key)) {\n // modifications for ternary\n\n var ternary = layout[key];\n cleanTitle(ternary.aaxis);\n cleanTitle(ternary.baxis);\n cleanTitle(ternary.caxis);\n } else if(sceneAttrRegex && sceneAttrRegex.test(key)) {\n // modifications for 3D scenes\n\n var scene = layout[key];\n\n // clean old Camera coords\n var cameraposition = scene.cameraposition;\n\n if(Array.isArray(cameraposition) && cameraposition[0].length === 4) {\n var rotation = cameraposition[0];\n var center = cameraposition[1];\n var radius = cameraposition[2];\n var mat = m4FromQuat([], rotation);\n var eye = [];\n\n for(j = 0; j < 3; ++j) {\n eye[j] = center[j] + radius * mat[2 + 4 * j];\n }\n\n scene.camera = {\n eye: {x: eye[0], y: eye[1], z: eye[2]},\n center: {x: center[0], y: center[1], z: center[2]},\n up: {x: 0, y: 0, z: 1} // we just ignore calculating camera z up in this case\n };\n\n delete scene.cameraposition;\n }\n\n // clean axis titles\n cleanTitle(scene.xaxis);\n cleanTitle(scene.yaxis);\n cleanTitle(scene.zaxis);\n }\n }\n\n var annotationsLen = Array.isArray(layout.annotations) ? layout.annotations.length : 0;\n for(i = 0; i < annotationsLen; i++) {\n var ann = layout.annotations[i];\n\n if(!Lib.isPlainObject(ann)) continue;\n\n if(ann.ref) {\n if(ann.ref === 'paper') {\n ann.xref = 'paper';\n ann.yref = 'paper';\n } else if(ann.ref === 'data') {\n ann.xref = 'x';\n ann.yref = 'y';\n }\n delete ann.ref;\n }\n\n cleanAxRef(ann, 'xref');\n cleanAxRef(ann, 'yref');\n }\n\n var shapesLen = Array.isArray(layout.shapes) ? layout.shapes.length : 0;\n for(i = 0; i < shapesLen; i++) {\n var shape = layout.shapes[i];\n\n if(!Lib.isPlainObject(shape)) continue;\n\n cleanAxRef(shape, 'xref');\n cleanAxRef(shape, 'yref');\n }\n\n var legend = layout.legend;\n if(legend) {\n // check for old-style legend positioning (x or y is +/- 100)\n if(legend.x > 3) {\n legend.x = 1.02;\n legend.xanchor = 'left';\n } else if(legend.x < -2) {\n legend.x = -0.02;\n legend.xanchor = 'right';\n }\n\n if(legend.y > 3) {\n legend.y = 1.02;\n legend.yanchor = 'bottom';\n } else if(legend.y < -2) {\n legend.y = -0.02;\n legend.yanchor = 'top';\n }\n }\n\n // clean plot title\n cleanTitle(layout);\n\n /*\n * Moved from rotate -> orbit for dragmode\n */\n if(layout.dragmode === 'rotate') layout.dragmode = 'orbit';\n\n // sanitize rgb(fractions) and rgba(fractions) that old tinycolor\n // supported, but new tinycolor does not because they're not valid css\n Color.clean(layout);\n\n // clean the layout container in layout.template\n if(layout.template && layout.template.layout) {\n exports.cleanLayout(layout.template.layout);\n }\n\n return layout;\n};\n\nfunction cleanAxRef(container, attr) {\n var valIn = container[attr];\n var axLetter = attr.charAt(0);\n if(valIn && valIn !== 'paper') {\n container[attr] = cleanId(valIn, axLetter);\n }\n}\n\n/**\n * Cleans up old title attribute structure (flat) in favor of the new one (nested).\n *\n * @param {Object} titleContainer - an object potentially including deprecated title attributes\n */\nfunction cleanTitle(titleContainer) {\n if(titleContainer) {\n // title -> title.text\n // (although title used to be a string attribute,\n // numbers are accepted as well)\n if(typeof titleContainer.title === 'string' || typeof titleContainer.title === 'number') {\n titleContainer.title = {\n text: titleContainer.title\n };\n }\n\n rewireAttr('titlefont', 'font');\n rewireAttr('titleposition', 'position');\n rewireAttr('titleside', 'side');\n rewireAttr('titleoffset', 'offset');\n }\n\n function rewireAttr(oldAttrName, newAttrName) {\n var oldAttrSet = titleContainer[oldAttrName];\n var newAttrSet = titleContainer.title && titleContainer.title[newAttrName];\n\n if(oldAttrSet && !newAttrSet) {\n // Ensure title object exists\n if(!titleContainer.title) {\n titleContainer.title = {};\n }\n\n titleContainer.title[newAttrName] = titleContainer[oldAttrName];\n delete titleContainer[oldAttrName];\n }\n }\n}\n\n/*\n * cleanData: Make a few changes to the data for backward compatibility\n * before it gets used for anything. Modifies the data traces users provide.\n *\n * Important: if you're going to add something here that modifies a data array,\n * update it in place so the new array === the old one.\n */\nexports.cleanData = function(data) {\n for(var tracei = 0; tracei < data.length; tracei++) {\n var trace = data[tracei];\n var i;\n\n // use xbins to bin data in x, and ybins to bin data in y\n if(trace.type === 'histogramy' && 'xbins' in trace && !('ybins' in trace)) {\n trace.ybins = trace.xbins;\n delete trace.xbins;\n }\n\n // error_y.opacity is obsolete - merge into color\n if(trace.error_y && 'opacity' in trace.error_y) {\n var dc = Color.defaults;\n var yeColor = trace.error_y.color || (traceIs(trace, 'bar') ?\n Color.defaultLine :\n dc[tracei % dc.length]);\n trace.error_y.color = Color.addOpacity(\n Color.rgb(yeColor),\n Color.opacity(yeColor) * trace.error_y.opacity);\n delete trace.error_y.opacity;\n }\n\n // convert bardir to orientation, and put the data into\n // the axes it's eventually going to be used with\n if('bardir' in trace) {\n if(trace.bardir === 'h' && (traceIs(trace, 'bar') ||\n trace.type.substr(0, 9) === 'histogram')) {\n trace.orientation = 'h';\n exports.swapXYData(trace);\n }\n delete trace.bardir;\n }\n\n // now we have only one 1D histogram type, and whether\n // it uses x or y data depends on trace.orientation\n if(trace.type === 'histogramy') exports.swapXYData(trace);\n if(trace.type === 'histogramx' || trace.type === 'histogramy') {\n trace.type = 'histogram';\n }\n\n // scl->scale, reversescl->reversescale\n if('scl' in trace && !('colorscale' in trace)) {\n trace.colorscale = trace.scl;\n delete trace.scl;\n }\n if('reversescl' in trace && !('reversescale' in trace)) {\n trace.reversescale = trace.reversescl;\n delete trace.reversescl;\n }\n\n // axis ids x1 -> x, y1-> y\n if(trace.xaxis) trace.xaxis = cleanId(trace.xaxis, 'x');\n if(trace.yaxis) trace.yaxis = cleanId(trace.yaxis, 'y');\n\n // scene ids scene1 -> scene\n if(traceIs(trace, 'gl3d') && trace.scene) {\n trace.scene = Plots.subplotsRegistry.gl3d.cleanId(trace.scene);\n }\n\n if(!traceIs(trace, 'pie-like') && !traceIs(trace, 'bar-like')) {\n if(Array.isArray(trace.textposition)) {\n for(i = 0; i < trace.textposition.length; i++) {\n trace.textposition[i] = cleanTextPosition(trace.textposition[i]);\n }\n } else if(trace.textposition) {\n trace.textposition = cleanTextPosition(trace.textposition);\n }\n }\n\n // fix typo in colorscale definition\n var _module = Registry.getModule(trace);\n if(_module && _module.colorbar) {\n var containerName = _module.colorbar.container;\n var container = containerName ? trace[containerName] : trace;\n if(container && container.colorscale) {\n if(container.colorscale === 'YIGnBu') container.colorscale = 'YlGnBu';\n if(container.colorscale === 'YIOrRd') container.colorscale = 'YlOrRd';\n }\n }\n\n // fix typo in surface 'highlight*' definitions\n if(trace.type === 'surface' && Lib.isPlainObject(trace.contours)) {\n var dims = ['x', 'y', 'z'];\n\n for(i = 0; i < dims.length; i++) {\n var opts = trace.contours[dims[i]];\n\n if(!Lib.isPlainObject(opts)) continue;\n\n if(opts.highlightColor) {\n opts.highlightcolor = opts.highlightColor;\n delete opts.highlightColor;\n }\n\n if(opts.highlightWidth) {\n opts.highlightwidth = opts.highlightWidth;\n delete opts.highlightWidth;\n }\n }\n }\n\n // fixes from converting finance from transforms to real trace types\n if(trace.type === 'candlestick' || trace.type === 'ohlc') {\n var increasingShowlegend = (trace.increasing || {}).showlegend !== false;\n var decreasingShowlegend = (trace.decreasing || {}).showlegend !== false;\n var increasingName = cleanFinanceDir(trace.increasing);\n var decreasingName = cleanFinanceDir(trace.decreasing);\n\n // now figure out something smart to do with the separate direction\n // names we removed\n if((increasingName !== false) && (decreasingName !== false)) {\n // both sub-names existed: base name previously had no effect\n // so ignore it and try to find a shared part of the sub-names\n\n var newName = commonPrefix(\n increasingName, decreasingName,\n increasingShowlegend, decreasingShowlegend\n );\n // if no common part, leave whatever name was (or wasn't) there\n if(newName) trace.name = newName;\n } else if((increasingName || decreasingName) && !trace.name) {\n // one sub-name existed but not the base name - just use the sub-name\n trace.name = increasingName || decreasingName;\n }\n }\n\n // transforms backward compatibility fixes\n if(Array.isArray(trace.transforms)) {\n var transforms = trace.transforms;\n\n for(i = 0; i < transforms.length; i++) {\n var transform = transforms[i];\n\n if(!Lib.isPlainObject(transform)) continue;\n\n switch(transform.type) {\n case 'filter':\n if(transform.filtersrc) {\n transform.target = transform.filtersrc;\n delete transform.filtersrc;\n }\n\n if(transform.calendar) {\n if(!transform.valuecalendar) {\n transform.valuecalendar = transform.calendar;\n }\n delete transform.calendar;\n }\n break;\n\n case 'groupby':\n // Name has changed from `style` to `styles`, so use `style` but prefer `styles`:\n transform.styles = transform.styles || transform.style;\n\n if(transform.styles && !Array.isArray(transform.styles)) {\n var prevStyles = transform.styles;\n var styleKeys = Object.keys(prevStyles);\n\n transform.styles = [];\n for(var j = 0; j < styleKeys.length; j++) {\n transform.styles.push({\n target: styleKeys[j],\n value: prevStyles[styleKeys[j]]\n });\n }\n }\n break;\n }\n }\n }\n\n // prune empty containers made before the new nestedProperty\n if(emptyContainer(trace, 'line')) delete trace.line;\n if('marker' in trace) {\n if(emptyContainer(trace.marker, 'line')) delete trace.marker.line;\n if(emptyContainer(trace, 'marker')) delete trace.marker;\n }\n\n // sanitize rgb(fractions) and rgba(fractions) that old tinycolor\n // supported, but new tinycolor does not because they're not valid css\n Color.clean(trace);\n\n // remove obsolete autobin(x|y) attributes, but only if true\n // if false, this needs to happen in Histogram.calc because it\n // can be a one-time autobin so we need to know the results before\n // we can push them back into the trace.\n if(trace.autobinx) {\n delete trace.autobinx;\n delete trace.xbins;\n }\n if(trace.autobiny) {\n delete trace.autobiny;\n delete trace.ybins;\n }\n\n cleanTitle(trace);\n if(trace.colorbar) cleanTitle(trace.colorbar);\n if(trace.marker && trace.marker.colorbar) cleanTitle(trace.marker.colorbar);\n if(trace.line && trace.line.colorbar) cleanTitle(trace.line.colorbar);\n if(trace.aaxis) cleanTitle(trace.aaxis);\n if(trace.baxis) cleanTitle(trace.baxis);\n }\n};\n\nfunction cleanFinanceDir(dirContainer) {\n if(!Lib.isPlainObject(dirContainer)) return false;\n\n var dirName = dirContainer.name;\n\n delete dirContainer.name;\n delete dirContainer.showlegend;\n\n return (typeof dirName === 'string' || typeof dirName === 'number') && String(dirName);\n}\n\nfunction commonPrefix(name1, name2, show1, show2) {\n // if only one is shown in the legend, use that\n if(show1 && !show2) return name1;\n if(show2 && !show1) return name2;\n\n // if both or neither are in the legend, check if one is blank (or whitespace)\n // and use the other one\n // note that hover labels can still use the name even if the legend doesn't\n if(!name1.trim()) return name2;\n if(!name2.trim()) return name1;\n\n var minLen = Math.min(name1.length, name2.length);\n var i;\n for(i = 0; i < minLen; i++) {\n if(name1.charAt(i) !== name2.charAt(i)) break;\n }\n\n var out = name1.substr(0, i);\n return out.trim();\n}\n\n// textposition - support partial attributes (ie just 'top')\n// and incorrect use of middle / center etc.\nfunction cleanTextPosition(textposition) {\n var posY = 'middle';\n var posX = 'center';\n\n if(typeof textposition === 'string') {\n if(textposition.indexOf('top') !== -1) posY = 'top';\n else if(textposition.indexOf('bottom') !== -1) posY = 'bottom';\n\n if(textposition.indexOf('left') !== -1) posX = 'left';\n else if(textposition.indexOf('right') !== -1) posX = 'right';\n }\n\n return posY + ' ' + posX;\n}\n\nfunction emptyContainer(outer, innerStr) {\n return (innerStr in outer) &&\n (typeof outer[innerStr] === 'object') &&\n (Object.keys(outer[innerStr]).length === 0);\n}\n\n\n// swap all the data and data attributes associated with x and y\nexports.swapXYData = function(trace) {\n var i;\n Lib.swapAttrs(trace, ['?', '?0', 'd?', '?bins', 'nbins?', 'autobin?', '?src', 'error_?']);\n if(Array.isArray(trace.z) && Array.isArray(trace.z[0])) {\n if(trace.transpose) delete trace.transpose;\n else trace.transpose = true;\n }\n if(trace.error_x && trace.error_y) {\n var errorY = trace.error_y;\n var copyYstyle = ('copy_ystyle' in errorY) ?\n errorY.copy_ystyle :\n !(errorY.color || errorY.thickness || errorY.width);\n Lib.swapAttrs(trace, ['error_?.copy_ystyle']);\n if(copyYstyle) {\n Lib.swapAttrs(trace, ['error_?.color', 'error_?.thickness', 'error_?.width']);\n }\n }\n if(typeof trace.hoverinfo === 'string') {\n var hoverInfoParts = trace.hoverinfo.split('+');\n for(i = 0; i < hoverInfoParts.length; i++) {\n if(hoverInfoParts[i] === 'x') hoverInfoParts[i] = 'y';\n else if(hoverInfoParts[i] === 'y') hoverInfoParts[i] = 'x';\n }\n trace.hoverinfo = hoverInfoParts.join('+');\n }\n};\n\n// coerce traceIndices input to array of trace indices\nexports.coerceTraceIndices = function(gd, traceIndices) {\n if(isNumeric(traceIndices)) {\n return [traceIndices];\n } else if(!Array.isArray(traceIndices) || !traceIndices.length) {\n return gd.data.map(function(_, i) { return i; });\n } else if(Array.isArray(traceIndices)) {\n var traceIndicesOut = [];\n for(var i = 0; i < traceIndices.length; i++) {\n if(Lib.isIndex(traceIndices[i], gd.data.length)) {\n traceIndicesOut.push(traceIndices[i]);\n } else {\n Lib.warn('trace index (', traceIndices[i], ') is not a number or is out of bounds');\n }\n }\n return traceIndicesOut;\n }\n\n return traceIndices;\n};\n\n/**\n * Manages logic around array container item creation / deletion / update\n * that nested property alone can't handle.\n *\n * @param {Object} np\n * nested property of update attribute string about trace or layout object\n * @param {*} newVal\n * update value passed to restyle / relayout / update\n * @param {Object} undoit\n * undo hash (N.B. undoit may be mutated here).\n *\n */\nexports.manageArrayContainers = function(np, newVal, undoit) {\n var obj = np.obj;\n var parts = np.parts;\n var pLength = parts.length;\n var pLast = parts[pLength - 1];\n\n var pLastIsNumber = isNumeric(pLast);\n\n if(pLastIsNumber && newVal === null) {\n // delete item\n\n // Clear item in array container when new value is null\n var contPath = parts.slice(0, pLength - 1).join('.');\n var cont = Lib.nestedProperty(obj, contPath).get();\n cont.splice(pLast, 1);\n\n // Note that nested property clears null / undefined at end of\n // array container, but not within them.\n } else if(pLastIsNumber && np.get() === undefined) {\n // create item\n\n // When adding a new item, make sure undo command will remove it\n if(np.get() === undefined) undoit[np.astr] = null;\n\n np.set(newVal);\n } else {\n // update item\n\n // If the last part of attribute string isn't a number,\n // np.set is all we need.\n np.set(newVal);\n }\n};\n\n/*\n * Match the part to strip off to turn an attribute into its parent\n * really it should be either '.some_characters' or '[number]'\n * but we're a little more permissive here and match either\n * '.not_brackets_or_dot' or '[not_brackets_or_dot]'\n */\nvar ATTR_TAIL_RE = /(\\.[^\\[\\]\\.]+|\\[[^\\[\\]\\.]+\\])$/;\n\nfunction getParent(attr) {\n var tail = attr.search(ATTR_TAIL_RE);\n if(tail > 0) return attr.substr(0, tail);\n}\n\n/*\n * hasParent: does an attribute object contain a parent of the given attribute?\n * for example, given 'images[2].x' do we also have 'images' or 'images[2]'?\n *\n * @param {Object} aobj\n * update object, whose keys are attribute strings and values are their new settings\n * @param {string} attr\n * the attribute string to test against\n * @returns {Boolean}\n * is a parent of attr present in aobj?\n */\nexports.hasParent = function(aobj, attr) {\n var attrParent = getParent(attr);\n while(attrParent) {\n if(attrParent in aobj) return true;\n attrParent = getParent(attrParent);\n }\n return false;\n};\n\n/**\n * Empty out types for all axes containing these traces so we auto-set them again\n *\n * @param {object} gd\n * @param {[integer]} traces: trace indices to search for axes to clear the types of\n * @param {object} layoutUpdate: any update being done concurrently to the layout,\n * which may supercede clearing the axis types\n */\nvar axLetters = ['x', 'y', 'z'];\nexports.clearAxisTypes = function(gd, traces, layoutUpdate) {\n for(var i = 0; i < traces.length; i++) {\n var trace = gd._fullData[i];\n for(var j = 0; j < 3; j++) {\n var ax = getFromTrace(gd, trace, axLetters[j]);\n\n // do not clear log type - that's never an auto result so must have been intentional\n if(ax && ax.type !== 'log') {\n var axAttr = ax._name;\n var sceneName = ax._id.substr(1);\n if(sceneName.substr(0, 5) === 'scene') {\n if(layoutUpdate[sceneName] !== undefined) continue;\n axAttr = sceneName + '.' + axAttr;\n }\n var typeAttr = axAttr + '.type';\n\n if(layoutUpdate[axAttr] === undefined && layoutUpdate[typeAttr] === undefined) {\n Lib.nestedProperty(gd.layout, typeAttr).set(null);\n }\n }\n }\n }\n};\n\n},{\"../components/color\":595,\"../lib\":728,\"../plots/cartesian/axis_ids\":779,\"../plots/plots\":839,\"../registry\":859,\"fast-isnumeric\":236,\"gl-mat4/fromQuat\":270}],761:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar main = _dereq_('./plot_api');\n\nexports.plot = main.plot;\nexports.newPlot = main.newPlot;\nexports.restyle = main.restyle;\nexports.relayout = main.relayout;\nexports.redraw = main.redraw;\nexports.update = main.update;\nexports._guiRestyle = main._guiRestyle;\nexports._guiRelayout = main._guiRelayout;\nexports._guiUpdate = main._guiUpdate;\nexports._storeDirectGUIEdit = main._storeDirectGUIEdit;\nexports.react = main.react;\nexports.extendTraces = main.extendTraces;\nexports.prependTraces = main.prependTraces;\nexports.addTraces = main.addTraces;\nexports.deleteTraces = main.deleteTraces;\nexports.moveTraces = main.moveTraces;\nexports.purge = main.purge;\nexports.addFrames = main.addFrames;\nexports.deleteFrames = main.deleteFrames;\nexports.animate = main.animate;\nexports.setPlotConfig = main.setPlotConfig;\n\nexports.toImage = _dereq_('./to_image');\nexports.validate = _dereq_('./validate');\nexports.downloadImage = _dereq_('../snapshot/download');\n\nvar templateApi = _dereq_('./template_api');\nexports.makeTemplate = templateApi.makeTemplate;\nexports.validateTemplate = templateApi.validateTemplate;\n\n},{\"../snapshot/download\":861,\"./plot_api\":763,\"./template_api\":768,\"./to_image\":769,\"./validate\":770}],762:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isPlainObject = _dereq_('../lib/is_plain_object');\nvar noop = _dereq_('../lib/noop');\nvar Loggers = _dereq_('../lib/loggers');\nvar sorterAsc = _dereq_('../lib/search').sorterAsc;\nvar Registry = _dereq_('../registry');\n\n\nexports.containerArrayMatch = _dereq_('./container_array_match');\n\nvar isAddVal = exports.isAddVal = function isAddVal(val) {\n return val === 'add' || isPlainObject(val);\n};\n\nvar isRemoveVal = exports.isRemoveVal = function isRemoveVal(val) {\n return val === null || val === 'remove';\n};\n\n/*\n * applyContainerArrayChanges: for managing arrays of layout components in relayout\n * handles them all with a consistent interface.\n *\n * Here are the supported actions -> relayout calls -> edits we get here\n * (as prepared in _relayout):\n *\n * add an empty obj -> {'annotations[2]': 'add'} -> {2: {'': 'add'}}\n * add a specific obj -> {'annotations[2]': {attrs}} -> {2: {'': {attrs}}}\n * delete an obj -> {'annotations[2]': 'remove'} -> {2: {'': 'remove'}}\n * -> {'annotations[2]': null} -> {2: {'': null}}\n * delete the whole array -> {'annotations': 'remove'} -> {'': {'': 'remove'}}\n * -> {'annotations': null} -> {'': {'': null}}\n * edit an object -> {'annotations[2].text': 'boo'} -> {2: {'text': 'boo'}}\n *\n * You can combine many edits to different objects. Objects are added and edited\n * in ascending order, then removed in descending order.\n * For example, starting with [a, b, c], if you want to:\n * - replace b with d:\n * {'annotations[1]': d, 'annotations[2]': null} (b is item 2 after adding d)\n * - add a new item d between a and b, and edit b:\n * {'annotations[1]': d, 'annotations[2].x': newX} (b is item 2 after adding d)\n * - delete b and edit c:\n * {'annotations[1]': null, 'annotations[2].x': newX} (c is edited before b is removed)\n *\n * You CANNOT combine adding/deleting an item at index `i` with edits to the same index `i`\n * You CANNOT combine replacing/deleting the whole array with anything else (for the same array).\n *\n * @param {HTMLDivElement} gd\n * the DOM element of the graph container div\n * @param {Lib.nestedProperty} componentType: the array we are editing\n * @param {Object} edits\n * the changes to make; keys are indices to edit, values are themselves objects:\n * {attr: newValue} of changes to make to that index (with add/remove behavior\n * in special values of the empty attr)\n * @param {Object} flags\n * the flags for which actions we're going to perform to display these (and\n * any other) changes. If we're already `recalc`ing, we don't need to redraw\n * individual items\n * @param {function} _nestedProperty\n * a (possibly modified for gui edits) nestedProperty constructor\n * The modified version takes a 3rd argument, for a prefix to the attribute\n * string necessary for storing GUI edits\n *\n * @returns {bool} `true` if it managed to complete drawing of the changes\n * `false` would mean the parent should replot.\n */\nexports.applyContainerArrayChanges = function applyContainerArrayChanges(gd, np, edits, flags, _nestedProperty) {\n var componentType = np.astr;\n var supplyComponentDefaults = Registry.getComponentMethod(componentType, 'supplyLayoutDefaults');\n var draw = Registry.getComponentMethod(componentType, 'draw');\n var drawOne = Registry.getComponentMethod(componentType, 'drawOne');\n var replotLater = flags.replot || flags.recalc || (supplyComponentDefaults === noop) || (draw === noop);\n var layout = gd.layout;\n var fullLayout = gd._fullLayout;\n\n if(edits['']) {\n if(Object.keys(edits).length > 1) {\n Loggers.warn('Full array edits are incompatible with other edits',\n componentType);\n }\n\n var fullVal = edits[''][''];\n\n if(isRemoveVal(fullVal)) np.set(null);\n else if(Array.isArray(fullVal)) np.set(fullVal);\n else {\n Loggers.warn('Unrecognized full array edit value', componentType, fullVal);\n return true;\n }\n\n if(replotLater) return false;\n\n supplyComponentDefaults(layout, fullLayout);\n draw(gd);\n return true;\n }\n\n var componentNums = Object.keys(edits).map(Number).sort(sorterAsc);\n var componentArrayIn = np.get();\n var componentArray = componentArrayIn || [];\n // componentArrayFull is used just to keep splices in line between\n // full and input arrays, so private keys can be copied over after\n // redoing supplyDefaults\n // TODO: this assumes componentArray is in gd.layout - which will not be\n // true after we extend this to restyle\n var componentArrayFull = _nestedProperty(fullLayout, componentType).get();\n\n var deletes = [];\n var firstIndexChange = -1;\n var maxIndex = componentArray.length;\n var i;\n var j;\n var componentNum;\n var objEdits;\n var objKeys;\n var objVal;\n var adding, prefix;\n\n // first make the add and edit changes\n for(i = 0; i < componentNums.length; i++) {\n componentNum = componentNums[i];\n objEdits = edits[componentNum];\n objKeys = Object.keys(objEdits);\n objVal = objEdits[''],\n adding = isAddVal(objVal);\n\n if(componentNum < 0 || componentNum > componentArray.length - (adding ? 0 : 1)) {\n Loggers.warn('index out of range', componentType, componentNum);\n continue;\n }\n\n if(objVal !== undefined) {\n if(objKeys.length > 1) {\n Loggers.warn(\n 'Insertion & removal are incompatible with edits to the same index.',\n componentType, componentNum);\n }\n\n if(isRemoveVal(objVal)) {\n deletes.push(componentNum);\n } else if(adding) {\n if(objVal === 'add') objVal = {};\n componentArray.splice(componentNum, 0, objVal);\n if(componentArrayFull) componentArrayFull.splice(componentNum, 0, {});\n } else {\n Loggers.warn('Unrecognized full object edit value',\n componentType, componentNum, objVal);\n }\n\n if(firstIndexChange === -1) firstIndexChange = componentNum;\n } else {\n for(j = 0; j < objKeys.length; j++) {\n prefix = componentType + '[' + componentNum + '].';\n _nestedProperty(componentArray[componentNum], objKeys[j], prefix)\n .set(objEdits[objKeys[j]]);\n }\n }\n }\n\n // now do deletes\n for(i = deletes.length - 1; i >= 0; i--) {\n componentArray.splice(deletes[i], 1);\n // TODO: this drops private keys that had been stored in componentArrayFull\n // does this have any ill effects?\n if(componentArrayFull) componentArrayFull.splice(deletes[i], 1);\n }\n\n if(!componentArray.length) np.set(null);\n else if(!componentArrayIn) np.set(componentArray);\n\n if(replotLater) return false;\n\n supplyComponentDefaults(layout, fullLayout);\n\n // finally draw all the components we need to\n // if we added or removed any, redraw all after it\n if(drawOne !== noop) {\n var indicesToDraw;\n if(firstIndexChange === -1) {\n // there's no re-indexing to do, so only redraw components that changed\n indicesToDraw = componentNums;\n } else {\n // in case the component array was shortened, we still need do call\n // drawOne on the latter items so they get properly removed\n maxIndex = Math.max(componentArray.length, maxIndex);\n indicesToDraw = [];\n for(i = 0; i < componentNums.length; i++) {\n componentNum = componentNums[i];\n if(componentNum >= firstIndexChange) break;\n indicesToDraw.push(componentNum);\n }\n for(i = firstIndexChange; i < maxIndex; i++) {\n indicesToDraw.push(i);\n }\n }\n for(i = 0; i < indicesToDraw.length; i++) {\n drawOne(gd, indicesToDraw[i]);\n }\n } else draw(gd);\n\n return true;\n};\n\n},{\"../lib/is_plain_object\":729,\"../lib/loggers\":732,\"../lib/noop\":737,\"../lib/search\":747,\"../registry\":859,\"./container_array_match\":758}],763:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar isNumeric = _dereq_('fast-isnumeric');\nvar hasHover = _dereq_('has-hover');\n\nvar Lib = _dereq_('../lib');\nvar nestedProperty = Lib.nestedProperty;\n\nvar Events = _dereq_('../lib/events');\nvar Queue = _dereq_('../lib/queue');\n\nvar Registry = _dereq_('../registry');\nvar PlotSchema = _dereq_('./plot_schema');\nvar Plots = _dereq_('../plots/plots');\nvar Polar = _dereq_('../plots/polar/legacy');\n\nvar Axes = _dereq_('../plots/cartesian/axes');\nvar Drawing = _dereq_('../components/drawing');\nvar Color = _dereq_('../components/color');\nvar initInteractions = _dereq_('../plots/cartesian/graph_interact').initInteractions;\nvar xmlnsNamespaces = _dereq_('../constants/xmlns_namespaces');\nvar svgTextUtils = _dereq_('../lib/svg_text_utils');\nvar clearSelect = _dereq_('../plots/cartesian/select').clearSelect;\n\nvar dfltConfig = _dereq_('./plot_config').dfltConfig;\nvar manageArrays = _dereq_('./manage_arrays');\nvar helpers = _dereq_('./helpers');\nvar subroutines = _dereq_('./subroutines');\nvar editTypes = _dereq_('./edit_types');\n\nvar AX_NAME_PATTERN = _dereq_('../plots/cartesian/constants').AX_NAME_PATTERN;\n\nvar numericNameWarningCount = 0;\nvar numericNameWarningCountLimit = 5;\n\n/**\n * Main plot-creation function\n *\n * @param {string id or DOM element} gd\n * the id or DOM element of the graph container div\n * @param {array of objects} data\n * array of traces, containing the data and display information for each trace\n * @param {object} layout\n * object describing the overall display of the plot,\n * all the stuff that doesn't pertain to any individual trace\n * @param {object} config\n * configuration options (see ./plot_config.js for more info)\n *\n * OR\n *\n * @param {string id or DOM element} gd\n * the id or DOM element of the graph container div\n * @param {object} figure\n * object containing `data`, `layout`, `config`, and `frames` members\n *\n */\nfunction plot(gd, data, layout, config) {\n var frames;\n\n gd = Lib.getGraphDiv(gd);\n\n // Events.init is idempotent and bails early if gd has already been init'd\n Events.init(gd);\n\n if(Lib.isPlainObject(data)) {\n var obj = data;\n data = obj.data;\n layout = obj.layout;\n config = obj.config;\n frames = obj.frames;\n }\n\n var okToPlot = Events.triggerHandler(gd, 'plotly_beforeplot', [data, layout, config]);\n if(okToPlot === false) return Promise.reject();\n\n // if there's no data or layout, and this isn't yet a plotly plot\n // container, log a warning to help plotly.js users debug\n if(!data && !layout && !Lib.isPlotDiv(gd)) {\n Lib.warn('Calling Plotly.plot as if redrawing ' +\n 'but this container doesn\\'t yet have a plot.', gd);\n }\n\n function addFrames() {\n if(frames) {\n return exports.addFrames(gd, frames);\n }\n }\n\n // transfer configuration options to gd until we move over to\n // a more OO like model\n setPlotContext(gd, config);\n\n if(!layout) layout = {};\n\n // hook class for plots main container (in case of plotly.js\n // this won't be #embedded-graph or .js-tab-contents)\n d3.select(gd).classed('js-plotly-plot', true);\n\n // off-screen getBoundingClientRect testing space,\n // in #js-plotly-tester (and stored as Drawing.tester)\n // so we can share cached text across tabs\n Drawing.makeTester();\n\n // collect promises for any async actions during plotting\n // any part of the plotting code can push to gd._promises, then\n // before we move to the next step, we check that they're all\n // complete, and empty out the promise list again.\n if(!Array.isArray(gd._promises)) gd._promises = [];\n\n var graphWasEmpty = ((gd.data || []).length === 0 && Array.isArray(data));\n\n // if there is already data on the graph, append the new data\n // if you only want to redraw, pass a non-array for data\n if(Array.isArray(data)) {\n helpers.cleanData(data);\n\n if(graphWasEmpty) gd.data = data;\n else gd.data.push.apply(gd.data, data);\n\n // for routines outside graph_obj that want a clean tab\n // (rather than appending to an existing one) gd.empty\n // is used to determine whether to make a new tab\n gd.empty = false;\n }\n\n if(!gd.layout || graphWasEmpty) {\n gd.layout = helpers.cleanLayout(layout);\n }\n\n Plots.supplyDefaults(gd);\n\n var fullLayout = gd._fullLayout;\n var hasCartesian = fullLayout._has('cartesian');\n\n // Legacy polar plots\n if(!fullLayout._has('polar') && data && data[0] && data[0].r) {\n Lib.log('Legacy polar charts are deprecated!');\n return plotLegacyPolar(gd, data, layout);\n }\n\n // so we don't try to re-call Plotly.plot from inside\n // legend and colorbar, if margins changed\n fullLayout._replotting = true;\n\n // make or remake the framework if we need to\n if(graphWasEmpty || fullLayout._shouldCreateBgLayer) {\n makePlotFramework(gd);\n\n if(fullLayout._shouldCreateBgLayer) {\n delete fullLayout._shouldCreateBgLayer;\n }\n }\n\n // polar need a different framework\n if(gd.framework !== makePlotFramework) {\n gd.framework = makePlotFramework;\n makePlotFramework(gd);\n }\n\n // clear gradient defs on each .plot call, because we know we'll loop through all traces\n Drawing.initGradients(gd);\n\n // save initial show spikes once per graph\n if(graphWasEmpty) Axes.saveShowSpikeInitial(gd);\n\n // prepare the data and find the autorange\n\n // generate calcdata, if we need to\n // to force redoing calcdata, just delete it before calling Plotly.plot\n var recalc = !gd.calcdata || gd.calcdata.length !== (gd._fullData || []).length;\n if(recalc) Plots.doCalcdata(gd);\n\n // in case it has changed, attach fullData traces to calcdata\n for(var i = 0; i < gd.calcdata.length; i++) {\n gd.calcdata[i][0].trace = gd._fullData[i];\n }\n\n // make the figure responsive\n if(gd._context.responsive) {\n if(!gd._responsiveChartHandler) {\n // Keep a reference to the resize handler to purge it down the road\n gd._responsiveChartHandler = function() { if(!Lib.isHidden(gd)) Plots.resize(gd); };\n\n // Listen to window resize\n window.addEventListener('resize', gd._responsiveChartHandler);\n }\n } else {\n Lib.clearResponsive(gd);\n }\n\n /*\n * start async-friendly code - now we're actually drawing things\n */\n\n var oldMargins = Lib.extendFlat({}, fullLayout._size);\n\n // draw framework first so that margin-pushing\n // components can position themselves correctly\n var drawFrameworkCalls = 0;\n function drawFramework() {\n var basePlotModules = fullLayout._basePlotModules;\n\n for(var i = 0; i < basePlotModules.length; i++) {\n if(basePlotModules[i].drawFramework) {\n basePlotModules[i].drawFramework(gd);\n }\n }\n\n if(!fullLayout._glcanvas && fullLayout._has('gl')) {\n fullLayout._glcanvas = fullLayout._glcontainer.selectAll('.gl-canvas').data([{\n key: 'contextLayer',\n context: true,\n pick: false\n }, {\n key: 'focusLayer',\n context: false,\n pick: false\n }, {\n key: 'pickLayer',\n context: false,\n pick: true\n }], function(d) { return d.key; });\n\n fullLayout._glcanvas.enter().append('canvas')\n .attr('class', function(d) {\n return 'gl-canvas gl-canvas-' + d.key.replace('Layer', '');\n })\n .style({\n position: 'absolute',\n top: 0,\n left: 0,\n overflow: 'visible',\n 'pointer-events': 'none'\n });\n }\n\n if(fullLayout._glcanvas) {\n fullLayout._glcanvas\n .attr('width', fullLayout.width)\n .attr('height', fullLayout.height);\n\n var regl = fullLayout._glcanvas.data()[0].regl;\n if(regl) {\n // Unfortunately, this can happen when relayouting to large\n // width/height on some browsers.\n if(Math.floor(fullLayout.width) !== regl._gl.drawingBufferWidth ||\n Math.floor(fullLayout.height) !== regl._gl.drawingBufferHeight\n ) {\n var msg = 'WebGL context buffer and canvas dimensions do not match due to browser/WebGL bug.';\n if(drawFrameworkCalls) {\n Lib.error(msg);\n } else {\n Lib.log(msg + ' Clearing graph and plotting again.');\n Plots.cleanPlot([], {}, gd._fullData, fullLayout);\n Plots.supplyDefaults(gd);\n fullLayout = gd._fullLayout;\n Plots.doCalcdata(gd);\n drawFrameworkCalls++;\n return drawFramework();\n }\n }\n }\n }\n\n if(fullLayout.modebar.orientation === 'h') {\n fullLayout._modebardiv\n .style('height', null)\n .style('width', '100%');\n } else {\n fullLayout._modebardiv\n .style('width', null)\n .style('height', fullLayout.height + 'px');\n }\n\n return Plots.previousPromises(gd);\n }\n\n // draw anything that can affect margins.\n function marginPushers() {\n // First reset the list of things that are allowed to change the margins\n // So any deleted traces or components will be wiped out of the\n // automargin calculation.\n // This means *every* margin pusher must be listed here, even if it\n // doesn't actually try to push the margins until later.\n Plots.clearAutoMarginIds(gd);\n\n subroutines.drawMarginPushers(gd);\n Axes.allowAutoMargin(gd);\n\n // TODO can this be moved elsewhere?\n if(fullLayout._has('pie')) {\n var fullData = gd._fullData;\n for(var i = 0; i < fullData.length; i++) {\n var trace = fullData[i];\n if(trace.type === 'pie' && trace.automargin) {\n Plots.allowAutoMargin(gd, 'pie.' + trace.uid + '.automargin');\n }\n }\n }\n\n Plots.doAutoMargin(gd);\n return Plots.previousPromises(gd);\n }\n\n // in case the margins changed, draw margin pushers again\n function marginPushersAgain() {\n if(!Plots.didMarginChange(oldMargins, fullLayout._size)) return;\n\n return Lib.syncOrAsync([\n marginPushers,\n subroutines.layoutStyles\n ], gd);\n }\n\n function positionAndAutorange() {\n if(!recalc) {\n doAutoRangeAndConstraints();\n return;\n }\n\n // TODO: autosize extra for text markers and images\n // see https://github.com/plotly/plotly.js/issues/1111\n return Lib.syncOrAsync([\n Registry.getComponentMethod('shapes', 'calcAutorange'),\n Registry.getComponentMethod('annotations', 'calcAutorange'),\n doAutoRangeAndConstraints\n ], gd);\n }\n\n function doAutoRangeAndConstraints() {\n if(gd._transitioning) return;\n\n subroutines.doAutoRangeAndConstraints(gd);\n\n // store initial ranges *after* enforcing constraints, otherwise\n // we will never look like we're at the initial ranges\n if(graphWasEmpty) Axes.saveRangeInitial(gd);\n\n // this one is different from shapes/annotations calcAutorange\n // the others incorporate those components into ax._extremes,\n // this one actually sets the ranges in rangesliders.\n Registry.getComponentMethod('rangeslider', 'calcAutorange')(gd);\n }\n\n // draw ticks, titles, and calculate axis scaling (._b, ._m)\n function drawAxes() {\n return Axes.draw(gd, graphWasEmpty ? '' : 'redraw');\n }\n\n var seq = [\n Plots.previousPromises,\n addFrames,\n drawFramework,\n marginPushers,\n marginPushersAgain\n ];\n\n if(hasCartesian) seq.push(positionAndAutorange);\n\n seq.push(subroutines.layoutStyles);\n if(hasCartesian) seq.push(drawAxes);\n\n seq.push(\n subroutines.drawData,\n subroutines.finalDraw,\n initInteractions,\n Plots.addLinks,\n Plots.rehover,\n Plots.redrag,\n // TODO: doAutoMargin is only needed here for axis automargin, which\n // happens outside of marginPushers where all the other automargins are\n // calculated. Would be much better to separate margin calculations from\n // component drawing - see https://github.com/plotly/plotly.js/issues/2704\n Plots.doAutoMargin,\n Plots.previousPromises\n );\n\n // even if everything we did was synchronous, return a promise\n // so that the caller doesn't care which route we took\n var plotDone = Lib.syncOrAsync(seq, gd);\n if(!plotDone || !plotDone.then) plotDone = Promise.resolve();\n\n return plotDone.then(function() {\n emitAfterPlot(gd);\n return gd;\n });\n}\n\nfunction emitAfterPlot(gd) {\n var fullLayout = gd._fullLayout;\n\n if(fullLayout._redrawFromAutoMarginCount) {\n fullLayout._redrawFromAutoMarginCount--;\n } else {\n gd.emit('plotly_afterplot');\n }\n}\n\nfunction setPlotConfig(obj) {\n return Lib.extendFlat(dfltConfig, obj);\n}\n\nfunction setBackground(gd, bgColor) {\n try {\n gd._fullLayout._paper.style('background', bgColor);\n } catch(e) {\n Lib.error(e);\n }\n}\n\nfunction opaqueSetBackground(gd, bgColor) {\n var blend = Color.combine(bgColor, 'white');\n setBackground(gd, blend);\n}\n\nfunction setPlotContext(gd, config) {\n if(!gd._context) {\n gd._context = Lib.extendDeep({}, dfltConfig);\n\n // stash href, used to make robust clipPath URLs\n var base = d3.select('base');\n gd._context._baseUrl = base.size() && base.attr('href') ?\n window.location.href.split('#')[0] :\n '';\n }\n\n var context = gd._context;\n\n var i, keys, key;\n\n if(config) {\n keys = Object.keys(config);\n for(i = 0; i < keys.length; i++) {\n key = keys[i];\n if(key === 'editable' || key === 'edits') continue;\n if(key in context) {\n if(key === 'setBackground' && config[key] === 'opaque') {\n context[key] = opaqueSetBackground;\n } else {\n context[key] = config[key];\n }\n }\n }\n\n // map plot3dPixelRatio to plotGlPixelRatio for backward compatibility\n if(config.plot3dPixelRatio && !context.plotGlPixelRatio) {\n context.plotGlPixelRatio = context.plot3dPixelRatio;\n }\n\n // now deal with editable and edits - first editable overrides\n // everything, then edits refines\n var editable = config.editable;\n if(editable !== undefined) {\n // we're not going to *use* context.editable, we're only going to\n // use context.edits... but keep it for the record\n context.editable = editable;\n\n keys = Object.keys(context.edits);\n for(i = 0; i < keys.length; i++) {\n context.edits[keys[i]] = editable;\n }\n }\n if(config.edits) {\n keys = Object.keys(config.edits);\n for(i = 0; i < keys.length; i++) {\n key = keys[i];\n if(key in context.edits) {\n context.edits[key] = config.edits[key];\n }\n }\n }\n\n // not part of the user-facing config options\n context._exportedPlot = config._exportedPlot;\n }\n\n // staticPlot forces a bunch of others:\n if(context.staticPlot) {\n context.editable = false;\n context.edits = {};\n context.autosizable = false;\n context.scrollZoom = false;\n context.doubleClick = false;\n context.showTips = false;\n context.showLink = false;\n context.displayModeBar = false;\n }\n\n // make sure hover-only devices have mode bar visible\n if(context.displayModeBar === 'hover' && !hasHover) {\n context.displayModeBar = true;\n }\n\n // default and fallback for setBackground\n if(context.setBackground === 'transparent' || typeof context.setBackground !== 'function') {\n context.setBackground = setBackground;\n }\n\n // Check if gd has a specified widht/height to begin with\n context._hasZeroHeight = context._hasZeroHeight || gd.clientHeight === 0;\n context._hasZeroWidth = context._hasZeroWidth || gd.clientWidth === 0;\n\n // fill context._scrollZoom helper to help manage scrollZoom flaglist\n var szIn = context.scrollZoom;\n var szOut = context._scrollZoom = {};\n if(szIn === true) {\n szOut.cartesian = 1;\n szOut.gl3d = 1;\n szOut.geo = 1;\n szOut.mapbox = 1;\n } else if(typeof szIn === 'string') {\n var parts = szIn.split('+');\n for(i = 0; i < parts.length; i++) {\n szOut[parts[i]] = 1;\n }\n } else if(szIn !== false) {\n szOut.gl3d = 1;\n szOut.geo = 1;\n szOut.mapbox = 1;\n }\n}\n\nfunction plotLegacyPolar(gd, data, layout) {\n // build or reuse the container skeleton\n var plotContainer = d3.select(gd).selectAll('.plot-container')\n .data([0]);\n plotContainer.enter()\n .insert('div', ':first-child')\n .classed('plot-container plotly', true);\n var paperDiv = plotContainer.selectAll('.svg-container')\n .data([0]);\n paperDiv.enter().append('div')\n .classed('svg-container', true)\n .style('position', 'relative');\n\n // empty it everytime for now\n paperDiv.html('');\n\n // fulfill gd requirements\n if(data) gd.data = data;\n if(layout) gd.layout = layout;\n Polar.manager.fillLayout(gd);\n\n // resize canvas\n paperDiv.style({\n width: gd._fullLayout.width + 'px',\n height: gd._fullLayout.height + 'px'\n });\n\n // instantiate framework\n gd.framework = Polar.manager.framework(gd);\n\n // plot\n gd.framework({data: gd.data, layout: gd.layout}, paperDiv.node());\n\n // set undo point\n gd.framework.setUndoPoint();\n\n // get the resulting svg for extending it\n var polarPlotSVG = gd.framework.svg();\n\n // editable title\n var opacity = 1;\n var txt = gd._fullLayout.title ? gd._fullLayout.title.text : '';\n if(txt === '' || !txt) opacity = 0;\n\n var titleLayout = function() {\n this.call(svgTextUtils.convertToTspans, gd);\n // TODO: html/mathjax\n // TODO: center title\n };\n\n var title = polarPlotSVG.select('.title-group text')\n .call(titleLayout);\n\n if(gd._context.edits.titleText) {\n var placeholderText = Lib._(gd, 'Click to enter Plot title');\n if(!txt || txt === placeholderText) {\n opacity = 0.2;\n // placeholder is not going through convertToTspans\n // so needs explicit data-unformatted\n title.attr({'data-unformatted': placeholderText})\n .text(placeholderText)\n .style({opacity: opacity})\n .on('mouseover.opacity', function() {\n d3.select(this).transition().duration(100)\n .style('opacity', 1);\n })\n .on('mouseout.opacity', function() {\n d3.select(this).transition().duration(1000)\n .style('opacity', 0);\n });\n }\n\n var setContenteditable = function() {\n this.call(svgTextUtils.makeEditable, {gd: gd})\n .on('edit', function(text) {\n gd.framework({layout: {title: {text: text}}});\n this.text(text)\n .call(titleLayout);\n this.call(setContenteditable);\n })\n .on('cancel', function() {\n var txt = this.attr('data-unformatted');\n this.text(txt).call(titleLayout);\n });\n };\n title.call(setContenteditable);\n }\n\n gd._context.setBackground(gd, gd._fullLayout.paper_bgcolor);\n Plots.addLinks(gd);\n\n return Promise.resolve();\n}\n\n// convenience function to force a full redraw, mostly for use by plotly.js\nfunction redraw(gd) {\n gd = Lib.getGraphDiv(gd);\n\n if(!Lib.isPlotDiv(gd)) {\n throw new Error('This element is not a Plotly plot: ' + gd);\n }\n\n helpers.cleanData(gd.data);\n helpers.cleanLayout(gd.layout);\n\n gd.calcdata = undefined;\n return exports.plot(gd).then(function() {\n gd.emit('plotly_redraw');\n return gd;\n });\n}\n\n/**\n * Convenience function to make idempotent plot option obvious to users.\n *\n * @param gd\n * @param {Object[]} data\n * @param {Object} layout\n * @param {Object} config\n */\nfunction newPlot(gd, data, layout, config) {\n gd = Lib.getGraphDiv(gd);\n\n // remove gl contexts\n Plots.cleanPlot([], {}, gd._fullData || [], gd._fullLayout || {});\n\n Plots.purge(gd);\n return exports.plot(gd, data, layout, config);\n}\n\n/**\n * Wrap negative indicies to their positive counterparts.\n *\n * @param {Number[]} indices An array of indices\n * @param {Number} maxIndex The maximum index allowable (arr.length - 1)\n */\nfunction positivifyIndices(indices, maxIndex) {\n var parentLength = maxIndex + 1;\n var positiveIndices = [];\n var i;\n var index;\n\n for(i = 0; i < indices.length; i++) {\n index = indices[i];\n if(index < 0) {\n positiveIndices.push(parentLength + index);\n } else {\n positiveIndices.push(index);\n }\n }\n return positiveIndices;\n}\n\n/**\n * Ensures that an index array for manipulating gd.data is valid.\n *\n * Intended for use with addTraces, deleteTraces, and moveTraces.\n *\n * @param gd\n * @param indices\n * @param arrayName\n */\nfunction assertIndexArray(gd, indices, arrayName) {\n var i,\n index;\n\n for(i = 0; i < indices.length; i++) {\n index = indices[i];\n\n // validate that indices are indeed integers\n if(index !== parseInt(index, 10)) {\n throw new Error('all values in ' + arrayName + ' must be integers');\n }\n\n // check that all indices are in bounds for given gd.data array length\n if(index >= gd.data.length || index < -gd.data.length) {\n throw new Error(arrayName + ' must be valid indices for gd.data.');\n }\n\n // check that indices aren't repeated\n if(indices.indexOf(index, i + 1) > -1 ||\n index >= 0 && indices.indexOf(-gd.data.length + index) > -1 ||\n index < 0 && indices.indexOf(gd.data.length + index) > -1) {\n throw new Error('each index in ' + arrayName + ' must be unique.');\n }\n }\n}\n\n/**\n * Private function used by Plotly.moveTraces to check input args\n *\n * @param gd\n * @param currentIndices\n * @param newIndices\n */\nfunction checkMoveTracesArgs(gd, currentIndices, newIndices) {\n // check that gd has attribute 'data' and 'data' is array\n if(!Array.isArray(gd.data)) {\n throw new Error('gd.data must be an array.');\n }\n\n // validate currentIndices array\n if(typeof currentIndices === 'undefined') {\n throw new Error('currentIndices is a required argument.');\n } else if(!Array.isArray(currentIndices)) {\n currentIndices = [currentIndices];\n }\n assertIndexArray(gd, currentIndices, 'currentIndices');\n\n // validate newIndices array if it exists\n if(typeof newIndices !== 'undefined' && !Array.isArray(newIndices)) {\n newIndices = [newIndices];\n }\n if(typeof newIndices !== 'undefined') {\n assertIndexArray(gd, newIndices, 'newIndices');\n }\n\n // check currentIndices and newIndices are the same length if newIdices exists\n if(typeof newIndices !== 'undefined' && currentIndices.length !== newIndices.length) {\n throw new Error('current and new indices must be of equal length.');\n }\n}\n/**\n * A private function to reduce the type checking clutter in addTraces.\n *\n * @param gd\n * @param traces\n * @param newIndices\n */\nfunction checkAddTracesArgs(gd, traces, newIndices) {\n var i, value;\n\n // check that gd has attribute 'data' and 'data' is array\n if(!Array.isArray(gd.data)) {\n throw new Error('gd.data must be an array.');\n }\n\n // make sure traces exists\n if(typeof traces === 'undefined') {\n throw new Error('traces must be defined.');\n }\n\n // make sure traces is an array\n if(!Array.isArray(traces)) {\n traces = [traces];\n }\n\n // make sure each value in traces is an object\n for(i = 0; i < traces.length; i++) {\n value = traces[i];\n if(typeof value !== 'object' || (Array.isArray(value) || value === null)) {\n throw new Error('all values in traces array must be non-array objects');\n }\n }\n\n // make sure we have an index for each trace\n if(typeof newIndices !== 'undefined' && !Array.isArray(newIndices)) {\n newIndices = [newIndices];\n }\n if(typeof newIndices !== 'undefined' && newIndices.length !== traces.length) {\n throw new Error(\n 'if indices is specified, traces.length must equal indices.length'\n );\n }\n}\n\n/**\n * A private function to reduce the type checking clutter in spliceTraces.\n * Get all update Properties from gd.data. Validate inputs and outputs.\n * Used by prependTrace and extendTraces\n *\n * @param gd\n * @param update\n * @param indices\n * @param maxPoints\n */\nfunction assertExtendTracesArgs(gd, update, indices, maxPoints) {\n var maxPointsIsObject = Lib.isPlainObject(maxPoints);\n\n if(!Array.isArray(gd.data)) {\n throw new Error('gd.data must be an array');\n }\n if(!Lib.isPlainObject(update)) {\n throw new Error('update must be a key:value object');\n }\n\n if(typeof indices === 'undefined') {\n throw new Error('indices must be an integer or array of integers');\n }\n\n assertIndexArray(gd, indices, 'indices');\n\n for(var key in update) {\n /*\n * Verify that the attribute to be updated contains as many trace updates\n * as indices. Failure must result in throw and no-op\n */\n if(!Array.isArray(update[key]) || update[key].length !== indices.length) {\n throw new Error('attribute ' + key + ' must be an array of length equal to indices array length');\n }\n\n /*\n * if maxPoints is an object it must match keys and array lengths of 'update' 1:1\n */\n if(maxPointsIsObject &&\n (!(key in maxPoints) || !Array.isArray(maxPoints[key]) ||\n maxPoints[key].length !== update[key].length)) {\n throw new Error('when maxPoints is set as a key:value object it must contain a 1:1 ' +\n 'corrispondence with the keys and number of traces in the update object');\n }\n }\n}\n\n/**\n * A private function to reduce the type checking clutter in spliceTraces.\n *\n * @param {Object|HTMLDivElement} gd\n * @param {Object} update\n * @param {Number[]} indices\n * @param {Number||Object} maxPoints\n * @return {Object[]}\n */\nfunction getExtendProperties(gd, update, indices, maxPoints) {\n var maxPointsIsObject = Lib.isPlainObject(maxPoints);\n var updateProps = [];\n var trace, target, prop, insert, maxp;\n\n // allow scalar index to represent a single trace position\n if(!Array.isArray(indices)) indices = [indices];\n\n // negative indices are wrapped around to their positive value. Equivalent to python indexing.\n indices = positivifyIndices(indices, gd.data.length - 1);\n\n // loop through all update keys and traces and harvest validated data.\n for(var key in update) {\n for(var j = 0; j < indices.length; j++) {\n /*\n * Choose the trace indexed by the indices map argument and get the prop setter-getter\n * instance that references the key and value for this particular trace.\n */\n trace = gd.data[indices[j]];\n prop = nestedProperty(trace, key);\n\n /*\n * Target is the existing gd.data.trace.dataArray value like \"x\" or \"marker.size\"\n * Target must exist as an Array to allow the extend operation to be performed.\n */\n target = prop.get();\n insert = update[key][j];\n\n if(!Lib.isArrayOrTypedArray(insert)) {\n throw new Error('attribute: ' + key + ' index: ' + j + ' must be an array');\n }\n if(!Lib.isArrayOrTypedArray(target)) {\n throw new Error('cannot extend missing or non-array attribute: ' + key);\n }\n if(target.constructor !== insert.constructor) {\n throw new Error('cannot extend array with an array of a different type: ' + key);\n }\n\n /*\n * maxPoints may be an object map or a scalar. If object select the key:value, else\n * Use the scalar maxPoints for all key and trace combinations.\n */\n maxp = maxPointsIsObject ? maxPoints[key][j] : maxPoints;\n\n // could have chosen null here, -1 just tells us to not take a window\n if(!isNumeric(maxp)) maxp = -1;\n\n /*\n * Wrap the nestedProperty in an object containing required data\n * for lengthening and windowing this particular trace - key combination.\n * Flooring maxp mirrors the behaviour of floats in the Array.slice JSnative function.\n */\n updateProps.push({\n prop: prop,\n target: target,\n insert: insert,\n maxp: Math.floor(maxp)\n });\n }\n }\n\n // all target and insertion data now validated\n return updateProps;\n}\n\n/**\n * A private function to key Extend and Prepend traces DRY\n *\n * @param {Object|HTMLDivElement} gd\n * @param {Object} update\n * @param {Number[]} indices\n * @param {Number||Object} maxPoints\n * @param {Function} updateArray\n * @return {Object}\n */\nfunction spliceTraces(gd, update, indices, maxPoints, updateArray) {\n assertExtendTracesArgs(gd, update, indices, maxPoints);\n\n var updateProps = getExtendProperties(gd, update, indices, maxPoints);\n var undoUpdate = {};\n var undoPoints = {};\n\n for(var i = 0; i < updateProps.length; i++) {\n var prop = updateProps[i].prop;\n var maxp = updateProps[i].maxp;\n\n // return new array and remainder\n var out = updateArray(updateProps[i].target, updateProps[i].insert, maxp);\n prop.set(out[0]);\n\n // build the inverse update object for the undo operation\n if(!Array.isArray(undoUpdate[prop.astr])) undoUpdate[prop.astr] = [];\n undoUpdate[prop.astr].push(out[1]);\n\n // build the matching maxPoints undo object containing original trace lengths\n if(!Array.isArray(undoPoints[prop.astr])) undoPoints[prop.astr] = [];\n undoPoints[prop.astr].push(updateProps[i].target.length);\n }\n\n return {update: undoUpdate, maxPoints: undoPoints};\n}\n\nfunction concatTypedArray(arr0, arr1) {\n var arr2 = new arr0.constructor(arr0.length + arr1.length);\n arr2.set(arr0);\n arr2.set(arr1, arr0.length);\n return arr2;\n}\n\n/**\n * extend && prepend traces at indices with update arrays, window trace lengths to maxPoints\n *\n * Extend and Prepend have identical APIs. Prepend inserts an array at the head while Extend\n * inserts an array off the tail. Prepend truncates the tail of the array - counting maxPoints\n * from the head, whereas Extend truncates the head of the array, counting backward maxPoints\n * from the tail.\n *\n * If maxPoints is undefined, nonNumeric, negative or greater than extended trace length no\n * truncation / windowing will be performed. If its zero, well the whole trace is truncated.\n *\n * @param {Object|HTMLDivElement} gd The graph div\n * @param {Object} update The key:array map of target attributes to extend\n * @param {Number|Number[]} indices The locations of traces to be extended\n * @param {Number|Object} [maxPoints] Number of points for trace window after lengthening.\n *\n */\nfunction extendTraces(gd, update, indices, maxPoints) {\n gd = Lib.getGraphDiv(gd);\n\n function updateArray(target, insert, maxp) {\n var newArray, remainder;\n\n if(Lib.isTypedArray(target)) {\n if(maxp < 0) {\n var none = new target.constructor(0);\n var both = concatTypedArray(target, insert);\n\n if(maxp < 0) {\n newArray = both;\n remainder = none;\n } else {\n newArray = none;\n remainder = both;\n }\n } else {\n newArray = new target.constructor(maxp);\n remainder = new target.constructor(target.length + insert.length - maxp);\n\n if(maxp === insert.length) {\n newArray.set(insert);\n remainder.set(target);\n } else if(maxp < insert.length) {\n var numberOfItemsFromInsert = insert.length - maxp;\n\n newArray.set(insert.subarray(numberOfItemsFromInsert));\n remainder.set(target);\n remainder.set(insert.subarray(0, numberOfItemsFromInsert), target.length);\n } else {\n var numberOfItemsFromTarget = maxp - insert.length;\n var targetBegin = target.length - numberOfItemsFromTarget;\n\n newArray.set(target.subarray(targetBegin));\n newArray.set(insert, numberOfItemsFromTarget);\n remainder.set(target.subarray(0, targetBegin));\n }\n }\n } else {\n newArray = target.concat(insert);\n remainder = (maxp >= 0 && maxp < newArray.length) ?\n newArray.splice(0, newArray.length - maxp) :\n [];\n }\n\n return [newArray, remainder];\n }\n\n var undo = spliceTraces(gd, update, indices, maxPoints, updateArray);\n var promise = exports.redraw(gd);\n var undoArgs = [gd, undo.update, indices, undo.maxPoints];\n Queue.add(gd, exports.prependTraces, undoArgs, extendTraces, arguments);\n\n return promise;\n}\n\nfunction prependTraces(gd, update, indices, maxPoints) {\n gd = Lib.getGraphDiv(gd);\n\n function updateArray(target, insert, maxp) {\n var newArray, remainder;\n\n if(Lib.isTypedArray(target)) {\n if(maxp <= 0) {\n var none = new target.constructor(0);\n var both = concatTypedArray(insert, target);\n\n if(maxp < 0) {\n newArray = both;\n remainder = none;\n } else {\n newArray = none;\n remainder = both;\n }\n } else {\n newArray = new target.constructor(maxp);\n remainder = new target.constructor(target.length + insert.length - maxp);\n\n if(maxp === insert.length) {\n newArray.set(insert);\n remainder.set(target);\n } else if(maxp < insert.length) {\n var numberOfItemsFromInsert = insert.length - maxp;\n\n newArray.set(insert.subarray(0, numberOfItemsFromInsert));\n remainder.set(insert.subarray(numberOfItemsFromInsert));\n remainder.set(target, numberOfItemsFromInsert);\n } else {\n var numberOfItemsFromTarget = maxp - insert.length;\n\n newArray.set(insert);\n newArray.set(target.subarray(0, numberOfItemsFromTarget), insert.length);\n remainder.set(target.subarray(numberOfItemsFromTarget));\n }\n }\n } else {\n newArray = insert.concat(target);\n remainder = (maxp >= 0 && maxp < newArray.length) ?\n newArray.splice(maxp, newArray.length) :\n [];\n }\n\n return [newArray, remainder];\n }\n\n var undo = spliceTraces(gd, update, indices, maxPoints, updateArray);\n var promise = exports.redraw(gd);\n var undoArgs = [gd, undo.update, indices, undo.maxPoints];\n Queue.add(gd, exports.extendTraces, undoArgs, prependTraces, arguments);\n\n return promise;\n}\n\n/**\n * Add data traces to an existing graph div.\n *\n * @param {Object|HTMLDivElement} gd The graph div\n * @param {Object[]} gd.data The array of traces we're adding to\n * @param {Object[]|Object} traces The object or array of objects to add\n * @param {Number[]|Number} [newIndices=[gd.data.length]] Locations to add traces\n *\n */\nfunction addTraces(gd, traces, newIndices) {\n gd = Lib.getGraphDiv(gd);\n\n var currentIndices = [];\n var undoFunc = exports.deleteTraces;\n var redoFunc = addTraces;\n var undoArgs = [gd, currentIndices];\n var redoArgs = [gd, traces]; // no newIndices here\n var i;\n var promise;\n\n // all validation is done elsewhere to remove clutter here\n checkAddTracesArgs(gd, traces, newIndices);\n\n // make sure traces is an array\n if(!Array.isArray(traces)) {\n traces = [traces];\n }\n\n // make sure traces do not repeat existing ones\n traces = traces.map(function(trace) {\n return Lib.extendFlat({}, trace);\n });\n\n helpers.cleanData(traces);\n\n // add the traces to gd.data (no redrawing yet!)\n for(i = 0; i < traces.length; i++) {\n gd.data.push(traces[i]);\n }\n\n // to continue, we need to call moveTraces which requires currentIndices\n for(i = 0; i < traces.length; i++) {\n currentIndices.push(-traces.length + i);\n }\n\n // if the user didn't define newIndices, they just want the traces appended\n // i.e., we can simply redraw and be done\n if(typeof newIndices === 'undefined') {\n promise = exports.redraw(gd);\n Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);\n return promise;\n }\n\n // make sure indices is property defined\n if(!Array.isArray(newIndices)) {\n newIndices = [newIndices];\n }\n\n try {\n // this is redundant, but necessary to not catch later possible errors!\n checkMoveTracesArgs(gd, currentIndices, newIndices);\n } catch(error) {\n // something went wrong, reset gd to be safe and rethrow error\n gd.data.splice(gd.data.length - traces.length, traces.length);\n throw error;\n }\n\n // if we're here, the user has defined specific places to place the new traces\n // this requires some extra work that moveTraces will do\n Queue.startSequence(gd);\n Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);\n promise = exports.moveTraces(gd, currentIndices, newIndices);\n Queue.stopSequence(gd);\n return promise;\n}\n\n/**\n * Delete traces at `indices` from gd.data array.\n *\n * @param {Object|HTMLDivElement} gd The graph div\n * @param {Object[]} gd.data The array of traces we're removing from\n * @param {Number|Number[]} indices The indices\n */\nfunction deleteTraces(gd, indices) {\n gd = Lib.getGraphDiv(gd);\n\n var traces = [];\n var undoFunc = exports.addTraces;\n var redoFunc = deleteTraces;\n var undoArgs = [gd, traces, indices];\n var redoArgs = [gd, indices];\n var i;\n var deletedTrace;\n\n // make sure indices are defined\n if(typeof indices === 'undefined') {\n throw new Error('indices must be an integer or array of integers.');\n } else if(!Array.isArray(indices)) {\n indices = [indices];\n }\n assertIndexArray(gd, indices, 'indices');\n\n // convert negative indices to positive indices\n indices = positivifyIndices(indices, gd.data.length - 1);\n\n // we want descending here so that splicing later doesn't affect indexing\n indices.sort(Lib.sorterDes);\n for(i = 0; i < indices.length; i += 1) {\n deletedTrace = gd.data.splice(indices[i], 1)[0];\n traces.push(deletedTrace);\n }\n\n var promise = exports.redraw(gd);\n Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);\n\n return promise;\n}\n\n/**\n * Move traces at currentIndices array to locations in newIndices array.\n *\n * If newIndices is omitted, currentIndices will be moved to the end. E.g.,\n * these are equivalent:\n *\n * Plotly.moveTraces(gd, [1, 2, 3], [-3, -2, -1])\n * Plotly.moveTraces(gd, [1, 2, 3])\n *\n * @param {Object|HTMLDivElement} gd The graph div\n * @param {Object[]} gd.data The array of traces we're removing from\n * @param {Number|Number[]} currentIndices The locations of traces to be moved\n * @param {Number|Number[]} [newIndices] The locations to move traces to\n *\n * Example calls:\n *\n * // move trace i to location x\n * Plotly.moveTraces(gd, i, x)\n *\n * // move trace i to end of array\n * Plotly.moveTraces(gd, i)\n *\n * // move traces i, j, k to end of array (i != j != k)\n * Plotly.moveTraces(gd, [i, j, k])\n *\n * // move traces [i, j, k] to [x, y, z] (i != j != k) (x != y != z)\n * Plotly.moveTraces(gd, [i, j, k], [x, y, z])\n *\n * // reorder all traces (assume there are 5--a, b, c, d, e)\n * Plotly.moveTraces(gd, [b, d, e, a, c]) // same as 'move to end'\n */\nfunction moveTraces(gd, currentIndices, newIndices) {\n gd = Lib.getGraphDiv(gd);\n\n var newData = [];\n var movingTraceMap = [];\n var undoFunc = moveTraces;\n var redoFunc = moveTraces;\n var undoArgs = [gd, newIndices, currentIndices];\n var redoArgs = [gd, currentIndices, newIndices];\n var i;\n\n // to reduce complexity here, check args elsewhere\n // this throws errors where appropriate\n checkMoveTracesArgs(gd, currentIndices, newIndices);\n\n // make sure currentIndices is an array\n currentIndices = Array.isArray(currentIndices) ? currentIndices : [currentIndices];\n\n // if undefined, define newIndices to point to the end of gd.data array\n if(typeof newIndices === 'undefined') {\n newIndices = [];\n for(i = 0; i < currentIndices.length; i++) {\n newIndices.push(-currentIndices.length + i);\n }\n }\n\n // make sure newIndices is an array if it's user-defined\n newIndices = Array.isArray(newIndices) ? newIndices : [newIndices];\n\n // convert negative indices to positive indices (they're the same length)\n currentIndices = positivifyIndices(currentIndices, gd.data.length - 1);\n newIndices = positivifyIndices(newIndices, gd.data.length - 1);\n\n // at this point, we've coerced the index arrays into predictable forms\n\n // get the traces that aren't being moved around\n for(i = 0; i < gd.data.length; i++) {\n // if index isn't in currentIndices, include it in ignored!\n if(currentIndices.indexOf(i) === -1) {\n newData.push(gd.data[i]);\n }\n }\n\n // get a mapping of indices to moving traces\n for(i = 0; i < currentIndices.length; i++) {\n movingTraceMap.push({newIndex: newIndices[i], trace: gd.data[currentIndices[i]]});\n }\n\n // reorder this mapping by newIndex, ascending\n movingTraceMap.sort(function(a, b) {\n return a.newIndex - b.newIndex;\n });\n\n // now, add the moving traces back in, in order!\n for(i = 0; i < movingTraceMap.length; i += 1) {\n newData.splice(movingTraceMap[i].newIndex, 0, movingTraceMap[i].trace);\n }\n\n gd.data = newData;\n\n var promise = exports.redraw(gd);\n Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);\n\n return promise;\n}\n\n/**\n * restyle: update trace attributes of an existing plot\n *\n * Can be called two ways.\n *\n * Signature 1:\n * @param {String | HTMLDivElement} gd\n * the id or DOM element of the graph container div\n * @param {String} astr\n * attribute string (like `'marker.symbol'`) to update\n * @param {*} val\n * value to give this attribute\n * @param {Number[] | Number} [traces]\n * integer or array of integers for the traces to alter (all if omitted)\n *\n * Signature 2:\n * @param {String | HTMLDivElement} gd\n * (as in signature 1)\n * @param {Object} aobj\n * attribute object `{astr1: val1, astr2: val2 ...}`\n * allows setting multiple attributes simultaneously\n * @param {Number[] | Number} [traces]\n * (as in signature 1)\n *\n * `val` (or `val1`, `val2` ... in the object form) can be an array,\n * to apply different values to each trace.\n *\n * If the array is too short, it will wrap around (useful for\n * style files that want to specify cyclical default values).\n */\nfunction restyle(gd, astr, val, _traces) {\n gd = Lib.getGraphDiv(gd);\n helpers.clearPromiseQueue(gd);\n\n var aobj = {};\n if(typeof astr === 'string') aobj[astr] = val;\n else if(Lib.isPlainObject(astr)) {\n // the 3-arg form\n aobj = Lib.extendFlat({}, astr);\n if(_traces === undefined) _traces = val;\n } else {\n Lib.warn('Restyle fail.', astr, val, _traces);\n return Promise.reject();\n }\n\n if(Object.keys(aobj).length) gd.changed = true;\n\n var traces = helpers.coerceTraceIndices(gd, _traces);\n\n var specs = _restyle(gd, aobj, traces);\n var flags = specs.flags;\n\n // clear calcdata and/or axis types if required so they get regenerated\n if(flags.calc) gd.calcdata = undefined;\n if(flags.clearAxisTypes) helpers.clearAxisTypes(gd, traces, {});\n\n // fill in redraw sequence\n var seq = [];\n\n if(flags.fullReplot) {\n seq.push(exports.plot);\n } else {\n seq.push(Plots.previousPromises);\n\n // maybe only call Plots.supplyDataDefaults in the splom case,\n // to skip over long and slow axes defaults\n Plots.supplyDefaults(gd);\n\n if(flags.markerSize) {\n Plots.doCalcdata(gd);\n addAxRangeSequence(seq);\n\n // TODO\n // if all axes have autorange:false, then\n // proceed to subroutines.doTraceStyle(),\n // otherwise we must go through addAxRangeSequence,\n // which in general must redraws 'all' axes\n }\n\n if(flags.style) seq.push(subroutines.doTraceStyle);\n if(flags.colorbars) seq.push(subroutines.doColorBars);\n\n seq.push(emitAfterPlot);\n }\n\n seq.push(Plots.rehover, Plots.redrag);\n\n Queue.add(gd,\n restyle, [gd, specs.undoit, specs.traces],\n restyle, [gd, specs.redoit, specs.traces]\n );\n\n var plotDone = Lib.syncOrAsync(seq, gd);\n if(!plotDone || !plotDone.then) plotDone = Promise.resolve();\n\n return plotDone.then(function() {\n gd.emit('plotly_restyle', specs.eventData);\n return gd;\n });\n}\n\n// for undo: undefined initial vals must be turned into nulls\n// so that we unset rather than ignore them\nfunction undefinedToNull(val) {\n if(val === undefined) return null;\n return val;\n}\n\n/**\n * Factory function to wrap nestedProperty with GUI edits if necessary\n * with GUI edits we add an optional prefix to the nestedProperty constructor\n * to prepend to the attribute string in the preGUI store.\n */\nfunction makeNP(preGUI, guiEditFlag) {\n if(!guiEditFlag) return nestedProperty;\n\n return function(container, attr, prefix) {\n var np = nestedProperty(container, attr);\n var npSet = np.set;\n np.set = function(val) {\n var fullAttr = (prefix || '') + attr;\n storeCurrent(fullAttr, np.get(), val, preGUI);\n npSet(val);\n };\n return np;\n };\n}\n\nfunction storeCurrent(attr, val, newVal, preGUI) {\n if(Array.isArray(val) || Array.isArray(newVal)) {\n var arrayVal = Array.isArray(val) ? val : [];\n var arrayNew = Array.isArray(newVal) ? newVal : [];\n var maxLen = Math.max(arrayVal.length, arrayNew.length);\n for(var i = 0; i < maxLen; i++) {\n storeCurrent(attr + '[' + i + ']', arrayVal[i], arrayNew[i], preGUI);\n }\n } else if(Lib.isPlainObject(val) || Lib.isPlainObject(newVal)) {\n var objVal = Lib.isPlainObject(val) ? val : {};\n var objNew = Lib.isPlainObject(newVal) ? newVal : {};\n var objBoth = Lib.extendFlat({}, objVal, objNew);\n for(var key in objBoth) {\n storeCurrent(attr + '.' + key, objVal[key], objNew[key], preGUI);\n }\n } else if(preGUI[attr] === undefined) {\n preGUI[attr] = undefinedToNull(val);\n }\n}\n\n/**\n * storeDirectGUIEdit: for routines that skip restyle/relayout and mock it\n * by emitting a plotly_restyle or plotly_relayout event, this routine\n * keeps track of the initial state in _preGUI for use by uirevision\n * Does *not* apply these changes to data/layout - that's the responsibility\n * of the calling routine.\n *\n * @param {object} container: the input attributes container (eg `layout` or a `trace`)\n * @param {object} preGUI: where original values should be stored, either\n * `layout._preGUI` or `layout._tracePreGUI[uid]`\n * @param {object} edits: the {attr: val} object as normally passed to `relayout` etc\n */\nfunction _storeDirectGUIEdit(container, preGUI, edits) {\n for(var attr in edits) {\n var np = nestedProperty(container, attr);\n storeCurrent(attr, np.get(), edits[attr], preGUI);\n }\n}\n\nfunction _restyle(gd, aobj, traces) {\n var fullLayout = gd._fullLayout;\n var fullData = gd._fullData;\n var data = gd.data;\n var guiEditFlag = fullLayout._guiEditing;\n var layoutNP = makeNP(fullLayout._preGUI, guiEditFlag);\n var eventData = Lib.extendDeepAll({}, aobj);\n var i;\n\n cleanDeprecatedAttributeKeys(aobj);\n\n // initialize flags\n var flags = editTypes.traceFlags();\n\n // copies of the change (and previous values of anything affected)\n // for the undo / redo queue\n var redoit = {};\n var undoit = {};\n var axlist;\n\n // make a new empty vals array for undoit\n function a0() { return traces.map(function() { return undefined; }); }\n\n // for autoranging multiple axes\n function addToAxlist(axid) {\n var axName = Axes.id2name(axid);\n if(axlist.indexOf(axName) === -1) axlist.push(axName);\n }\n\n function autorangeAttr(axName) { return 'LAYOUT' + axName + '.autorange'; }\n\n function rangeAttr(axName) { return 'LAYOUT' + axName + '.range'; }\n\n function getFullTrace(traceIndex) {\n // usually fullData maps 1:1 onto data, but with groupby transforms\n // the fullData index can be greater. Take the *first* matching trace.\n for(var j = traceIndex; j < fullData.length; j++) {\n if(fullData[j]._input === data[traceIndex]) return fullData[j];\n }\n // should never get here - and if we *do* it should cause an error\n // later on undefined fullTrace is passed to nestedProperty.\n }\n\n // for attrs that interact (like scales & autoscales), save the\n // old vals before making the change\n // val=undefined will not set a value, just record what the value was.\n // val=null will delete the attribute\n // attr can be an array to set several at once (all to the same val)\n function doextra(attr, val, i) {\n if(Array.isArray(attr)) {\n attr.forEach(function(a) { doextra(a, val, i); });\n return;\n }\n // quit if explicitly setting this elsewhere\n if(attr in aobj || helpers.hasParent(aobj, attr)) return;\n\n var extraparam;\n if(attr.substr(0, 6) === 'LAYOUT') {\n extraparam = layoutNP(gd.layout, attr.replace('LAYOUT', ''));\n } else {\n var tracei = traces[i];\n var preGUI = fullLayout._tracePreGUI[getFullTrace(tracei)._fullInput.uid];\n extraparam = makeNP(preGUI, guiEditFlag)(data[tracei], attr);\n }\n\n if(!(attr in undoit)) {\n undoit[attr] = a0();\n }\n if(undoit[attr][i] === undefined) {\n undoit[attr][i] = undefinedToNull(extraparam.get());\n }\n if(val !== undefined) {\n extraparam.set(val);\n }\n }\n\n function allBins(binAttr) {\n return function(j) {\n return fullData[j][binAttr];\n };\n }\n\n function arrayBins(binAttr) {\n return function(vij, j) {\n return vij === false ? fullData[traces[j]][binAttr] : null;\n };\n }\n\n // now make the changes to gd.data (and occasionally gd.layout)\n // and figure out what kind of graphics update we need to do\n for(var ai in aobj) {\n if(helpers.hasParent(aobj, ai)) {\n throw new Error('cannot set ' + ai + ' and a parent attribute simultaneously');\n }\n\n var vi = aobj[ai];\n var cont;\n var contFull;\n var param;\n var oldVal;\n var newVal;\n var valObject;\n\n // Backward compatibility shim for turning histogram autobin on,\n // or freezing previous autobinned values.\n // Replace obsolete `autobin(x|y): true` with `(x|y)bins: null`\n // and `autobin(x|y): false` with the `(x|y)bins` in `fullData`\n if(ai === 'autobinx' || ai === 'autobiny') {\n ai = ai.charAt(ai.length - 1) + 'bins';\n if(Array.isArray(vi)) vi = vi.map(arrayBins(ai));\n else if(vi === false) vi = traces.map(allBins(ai));\n else vi = null;\n }\n\n redoit[ai] = vi;\n\n if(ai.substr(0, 6) === 'LAYOUT') {\n param = layoutNP(gd.layout, ai.replace('LAYOUT', ''));\n undoit[ai] = [undefinedToNull(param.get())];\n // since we're allowing val to be an array, allow it here too,\n // even though that's meaningless\n param.set(Array.isArray(vi) ? vi[0] : vi);\n // ironically, the layout attrs in restyle only require replot,\n // not relayout\n flags.calc = true;\n continue;\n }\n\n // set attribute in gd.data\n undoit[ai] = a0();\n for(i = 0; i < traces.length; i++) {\n cont = data[traces[i]];\n contFull = getFullTrace(traces[i]);\n var preGUI = fullLayout._tracePreGUI[contFull._fullInput.uid];\n param = makeNP(preGUI, guiEditFlag)(cont, ai);\n oldVal = param.get();\n newVal = Array.isArray(vi) ? vi[i % vi.length] : vi;\n\n if(newVal === undefined) continue;\n\n var finalPart = param.parts[param.parts.length - 1];\n var prefix = ai.substr(0, ai.length - finalPart.length - 1);\n var prefixDot = prefix ? prefix + '.' : '';\n var innerContFull = prefix ?\n nestedProperty(contFull, prefix).get() : contFull;\n\n valObject = PlotSchema.getTraceValObject(contFull, param.parts);\n\n if(valObject && valObject.impliedEdits && newVal !== null) {\n for(var impliedKey in valObject.impliedEdits) {\n doextra(Lib.relativeAttr(ai, impliedKey), valObject.impliedEdits[impliedKey], i);\n }\n } else if((finalPart === 'thicknessmode' || finalPart === 'lenmode') &&\n oldVal !== newVal &&\n (newVal === 'fraction' || newVal === 'pixels') &&\n innerContFull\n ) {\n // changing colorbar size modes,\n // make the resulting size not change\n // note that colorbar fractional sizing is based on the\n // original plot size, before anything (like a colorbar)\n // increases the margins\n\n var gs = fullLayout._size;\n var orient = innerContFull.orient;\n var topOrBottom = (orient === 'top') || (orient === 'bottom');\n if(finalPart === 'thicknessmode') {\n var thicknorm = topOrBottom ? gs.h : gs.w;\n doextra(prefixDot + 'thickness', innerContFull.thickness *\n (newVal === 'fraction' ? 1 / thicknorm : thicknorm), i);\n } else {\n var lennorm = topOrBottom ? gs.w : gs.h;\n doextra(prefixDot + 'len', innerContFull.len *\n (newVal === 'fraction' ? 1 / lennorm : lennorm), i);\n }\n } else if(ai === 'type' && (\n (newVal === 'pie') !== (oldVal === 'pie') ||\n (newVal === 'funnelarea') !== (oldVal === 'funnelarea')\n )) {\n var labelsTo = 'x';\n var valuesTo = 'y';\n if((newVal === 'bar' || oldVal === 'bar') && cont.orientation === 'h') {\n labelsTo = 'y';\n valuesTo = 'x';\n }\n Lib.swapAttrs(cont, ['?', '?src'], 'labels', labelsTo);\n Lib.swapAttrs(cont, ['d?', '?0'], 'label', labelsTo);\n Lib.swapAttrs(cont, ['?', '?src'], 'values', valuesTo);\n\n if(oldVal === 'pie' || oldVal === 'funnelarea') {\n nestedProperty(cont, 'marker.color')\n .set(nestedProperty(cont, 'marker.colors').get());\n\n // super kludgy - but if all pies are gone we won't remove them otherwise\n fullLayout._pielayer.selectAll('g.trace').remove();\n } else if(Registry.traceIs(cont, 'cartesian')) {\n nestedProperty(cont, 'marker.colors')\n .set(nestedProperty(cont, 'marker.color').get());\n }\n }\n\n undoit[ai][i] = undefinedToNull(oldVal);\n // set the new value - if val is an array, it's one el per trace\n // first check for attributes that get more complex alterations\n var swapAttrs = [\n 'swapxy', 'swapxyaxes', 'orientation', 'orientationaxes'\n ];\n if(swapAttrs.indexOf(ai) !== -1) {\n // setting an orientation: make sure it's changing\n // before we swap everything else\n if(ai === 'orientation') {\n param.set(newVal);\n // obnoxious that we need this level of coupling... but in order to\n // properly handle setting orientation to `null` we need to mimic\n // the logic inside Bars.supplyDefaults for default orientation\n var defaultOrientation = (cont.x && !cont.y) ? 'h' : 'v';\n if((param.get() || defaultOrientation) === contFull.orientation) {\n continue;\n }\n } else if(ai === 'orientationaxes') {\n // orientationaxes has no value,\n // it flips everything and the axes\n\n cont.orientation =\n {v: 'h', h: 'v'}[contFull.orientation];\n }\n helpers.swapXYData(cont);\n flags.calc = flags.clearAxisTypes = true;\n } else if(Plots.dataArrayContainers.indexOf(param.parts[0]) !== -1) {\n // TODO: use manageArrays.applyContainerArrayChanges here too\n helpers.manageArrayContainers(param, newVal, undoit);\n flags.calc = true;\n } else {\n if(valObject) {\n // must redo calcdata when restyling array values of arrayOk attributes\n // ... but no need to this for regl-based traces\n if(valObject.arrayOk &&\n !Registry.traceIs(contFull, 'regl') &&\n (Lib.isArrayOrTypedArray(newVal) || Lib.isArrayOrTypedArray(oldVal))\n ) {\n flags.calc = true;\n } else editTypes.update(flags, valObject);\n } else {\n /*\n * if we couldn't find valObject, assume a full recalc.\n * This can happen if you're changing type and making\n * some other edits too, so the modules we're\n * looking at don't have these attributes in them.\n */\n flags.calc = true;\n }\n\n // all the other ones, just modify that one attribute\n param.set(newVal);\n }\n }\n\n // swap the data attributes of the relevant x and y axes?\n if(['swapxyaxes', 'orientationaxes'].indexOf(ai) !== -1) {\n Axes.swap(gd, traces);\n }\n\n // swap hovermode if set to \"compare x/y data\"\n if(ai === 'orientationaxes') {\n var hovermode = nestedProperty(gd.layout, 'hovermode');\n if(hovermode.get() === 'x') {\n hovermode.set('y');\n } else if(hovermode.get() === 'y') {\n hovermode.set('x');\n } else if(hovermode.get() === 'x unified') {\n hovermode.set('y unified');\n } else if(hovermode.get() === 'y unified') {\n hovermode.set('x unified');\n }\n }\n\n // Major enough changes deserve autoscale and\n // non-reversed axes so people don't get confused\n //\n // Note: autobin (or its new analog bin clearing) is not included here\n // since we're not pushing bins back to gd.data, so if we have bin\n // info it was explicitly provided by the user.\n if(['orientation', 'type'].indexOf(ai) !== -1) {\n axlist = [];\n for(i = 0; i < traces.length; i++) {\n var trace = data[traces[i]];\n\n if(Registry.traceIs(trace, 'cartesian')) {\n addToAxlist(trace.xaxis || 'x');\n addToAxlist(trace.yaxis || 'y');\n }\n }\n\n doextra(axlist.map(autorangeAttr), true, 0);\n doextra(axlist.map(rangeAttr), [0, 1], 0);\n }\n }\n\n if(flags.calc || flags.plot) {\n flags.fullReplot = true;\n }\n\n return {\n flags: flags,\n undoit: undoit,\n redoit: redoit,\n traces: traces,\n eventData: Lib.extendDeepNoArrays([], [eventData, traces])\n };\n}\n\n/**\n * Converts deprecated attribute keys to\n * the current API to ensure backwards compatibility.\n *\n * This is needed for the update mechanism to determine which\n * subroutines to run based on the actual attribute\n * definitions (that don't include the deprecated ones).\n *\n * E.g. Maps {'xaxis.title': 'A chart'} to {'xaxis.title.text': 'A chart'}\n * and {titlefont: {...}} to {'title.font': {...}}.\n *\n * @param aobj\n */\nfunction cleanDeprecatedAttributeKeys(aobj) {\n var oldAxisTitleRegex = Lib.counterRegex('axis', '\\.title', false, false);\n var colorbarRegex = /colorbar\\.title$/;\n var keys = Object.keys(aobj);\n var i, key, value;\n\n for(i = 0; i < keys.length; i++) {\n key = keys[i];\n value = aobj[key];\n\n if((key === 'title' || oldAxisTitleRegex.test(key) || colorbarRegex.test(key)) &&\n (typeof value === 'string' || typeof value === 'number')) {\n replace(key, key.replace('title', 'title.text'));\n } else if(key.indexOf('titlefont') > -1) {\n replace(key, key.replace('titlefont', 'title.font'));\n } else if(key.indexOf('titleposition') > -1) {\n replace(key, key.replace('titleposition', 'title.position'));\n } else if(key.indexOf('titleside') > -1) {\n replace(key, key.replace('titleside', 'title.side'));\n } else if(key.indexOf('titleoffset') > -1) {\n replace(key, key.replace('titleoffset', 'title.offset'));\n }\n }\n\n function replace(oldAttrStr, newAttrStr) {\n aobj[newAttrStr] = aobj[oldAttrStr];\n delete aobj[oldAttrStr];\n }\n}\n\n/**\n * relayout: update layout attributes of an existing plot\n *\n * Can be called two ways:\n *\n * Signature 1:\n * @param {String | HTMLDivElement} gd\n * the id or dom element of the graph container div\n * @param {String} astr\n * attribute string (like `'xaxis.range[0]'`) to update\n * @param {*} val\n * value to give this attribute\n *\n * Signature 2:\n * @param {String | HTMLDivElement} gd\n * (as in signature 1)\n * @param {Object} aobj\n * attribute object `{astr1: val1, astr2: val2 ...}`\n * allows setting multiple attributes simultaneously\n */\nfunction relayout(gd, astr, val) {\n gd = Lib.getGraphDiv(gd);\n helpers.clearPromiseQueue(gd);\n\n if(gd.framework && gd.framework.isPolar) {\n return Promise.resolve(gd);\n }\n\n var aobj = {};\n if(typeof astr === 'string') {\n aobj[astr] = val;\n } else if(Lib.isPlainObject(astr)) {\n aobj = Lib.extendFlat({}, astr);\n } else {\n Lib.warn('Relayout fail.', astr, val);\n return Promise.reject();\n }\n\n if(Object.keys(aobj).length) gd.changed = true;\n\n var specs = _relayout(gd, aobj);\n var flags = specs.flags;\n\n // clear calcdata if required\n if(flags.calc) gd.calcdata = undefined;\n\n // fill in redraw sequence\n\n // even if we don't have anything left in aobj,\n // something may have happened within relayout that we\n // need to wait for\n var seq = [Plots.previousPromises];\n\n if(flags.layoutReplot) {\n seq.push(subroutines.layoutReplot);\n } else if(Object.keys(aobj).length) {\n axRangeSupplyDefaultsByPass(gd, flags, specs) || Plots.supplyDefaults(gd);\n\n if(flags.legend) seq.push(subroutines.doLegend);\n if(flags.layoutstyle) seq.push(subroutines.layoutStyles);\n if(flags.axrange) addAxRangeSequence(seq, specs.rangesAltered);\n if(flags.ticks) seq.push(subroutines.doTicksRelayout);\n if(flags.modebar) seq.push(subroutines.doModeBar);\n if(flags.camera) seq.push(subroutines.doCamera);\n if(flags.colorbars) seq.push(subroutines.doColorBars);\n\n seq.push(emitAfterPlot);\n }\n\n seq.push(Plots.rehover, Plots.redrag);\n\n Queue.add(gd,\n relayout, [gd, specs.undoit],\n relayout, [gd, specs.redoit]\n );\n\n var plotDone = Lib.syncOrAsync(seq, gd);\n if(!plotDone || !plotDone.then) plotDone = Promise.resolve(gd);\n\n return plotDone.then(function() {\n gd.emit('plotly_relayout', specs.eventData);\n return gd;\n });\n}\n\n// Optimization mostly for large splom traces where\n// Plots.supplyDefaults can take > 100ms\nfunction axRangeSupplyDefaultsByPass(gd, flags, specs) {\n var fullLayout = gd._fullLayout;\n\n if(!flags.axrange) return false;\n\n for(var k in flags) {\n if(k !== 'axrange' && flags[k]) return false;\n }\n\n for(var axId in specs.rangesAltered) {\n var axName = Axes.id2name(axId);\n var axIn = gd.layout[axName];\n var axOut = fullLayout[axName];\n axOut.autorange = axIn.autorange;\n axOut.range = axIn.range.slice();\n axOut.cleanRange();\n\n if(axOut._matchGroup) {\n for(var axId2 in axOut._matchGroup) {\n if(axId2 !== axId) {\n var ax2 = fullLayout[Axes.id2name(axId2)];\n ax2.autorange = axOut.autorange;\n ax2.range = axOut.range.slice();\n ax2._input.range = axOut.range.slice();\n }\n }\n }\n }\n\n return true;\n}\n\nfunction addAxRangeSequence(seq, rangesAltered) {\n // N.B. leave as sequence of subroutines (for now) instead of\n // subroutine of its own so that finalDraw always gets\n // executed after drawData\n var drawAxes = rangesAltered ?\n function(gd) {\n var axIds = [];\n var skipTitle = true;\n\n for(var id in rangesAltered) {\n var ax = Axes.getFromId(gd, id);\n axIds.push(id);\n\n if(ax._matchGroup) {\n for(var id2 in ax._matchGroup) {\n if(!rangesAltered[id2]) {\n axIds.push(id2);\n }\n }\n }\n\n if(ax.automargin) skipTitle = false;\n }\n\n return Axes.draw(gd, axIds, {skipTitle: skipTitle});\n } :\n function(gd) {\n return Axes.draw(gd, 'redraw');\n };\n\n seq.push(\n clearSelect,\n subroutines.doAutoRangeAndConstraints,\n drawAxes,\n subroutines.drawData,\n subroutines.finalDraw\n );\n}\n\nvar AX_RANGE_RE = /^[xyz]axis[0-9]*\\.range(\\[[0|1]\\])?$/;\nvar AX_AUTORANGE_RE = /^[xyz]axis[0-9]*\\.autorange$/;\nvar AX_DOMAIN_RE = /^[xyz]axis[0-9]*\\.domain(\\[[0|1]\\])?$/;\n\nfunction _relayout(gd, aobj) {\n var layout = gd.layout;\n var fullLayout = gd._fullLayout;\n var guiEditFlag = fullLayout._guiEditing;\n var layoutNP = makeNP(fullLayout._preGUI, guiEditFlag);\n var keys = Object.keys(aobj);\n var axes = Axes.list(gd);\n var eventData = Lib.extendDeepAll({}, aobj);\n var arrayEdits = {};\n\n var arrayStr, i, j;\n\n cleanDeprecatedAttributeKeys(aobj);\n keys = Object.keys(aobj);\n\n // look for 'allaxes', split out into all axes\n // in case of 3D the axis are nested within a scene which is held in _id\n for(i = 0; i < keys.length; i++) {\n if(keys[i].indexOf('allaxes') === 0) {\n for(j = 0; j < axes.length; j++) {\n var scene = axes[j]._id.substr(1);\n var axisAttr = (scene.indexOf('scene') !== -1) ? (scene + '.') : '';\n var newkey = keys[i].replace('allaxes', axisAttr + axes[j]._name);\n\n if(!aobj[newkey]) aobj[newkey] = aobj[keys[i]];\n }\n\n delete aobj[keys[i]];\n }\n }\n\n // initialize flags\n var flags = editTypes.layoutFlags();\n\n // copies of the change (and previous values of anything affected)\n // for the undo / redo queue\n var redoit = {};\n var undoit = {};\n\n // for attrs that interact (like scales & autoscales), save the\n // old vals before making the change\n // val=undefined will not set a value, just record what the value was.\n // attr can be an array to set several at once (all to the same val)\n function doextra(attr, val) {\n if(Array.isArray(attr)) {\n attr.forEach(function(a) { doextra(a, val); });\n return;\n }\n\n // if we have another value for this attribute (explicitly or\n // via a parent) do not override with this auto-generated extra\n if(attr in aobj || helpers.hasParent(aobj, attr)) return;\n\n var p = layoutNP(layout, attr);\n if(!(attr in undoit)) {\n undoit[attr] = undefinedToNull(p.get());\n }\n if(val !== undefined) p.set(val);\n }\n\n // for constraint enforcement: keep track of all axes (as {id: name})\n // we're editing the (auto)range of, so we can tell the others constrained\n // to scale with them that it's OK for them to shrink\n var rangesAltered = {};\n var axId;\n\n function recordAlteredAxis(pleafPlus) {\n var axId = Axes.name2id(pleafPlus.split('.')[0]);\n rangesAltered[axId] = 1;\n return axId;\n }\n\n // alter gd.layout\n for(var ai in aobj) {\n if(helpers.hasParent(aobj, ai)) {\n throw new Error('cannot set ' + ai + ' and a parent attribute simultaneously');\n }\n\n var p = layoutNP(layout, ai);\n var vi = aobj[ai];\n var plen = p.parts.length;\n // p.parts may end with an index integer if the property is an array\n var pend = plen - 1;\n while(pend > 0 && typeof p.parts[pend] !== 'string') pend--;\n // last property in chain (leaf node)\n var pleaf = p.parts[pend];\n // leaf plus immediate parent\n var pleafPlus = p.parts[pend - 1] + '.' + pleaf;\n // trunk nodes (everything except the leaf)\n var ptrunk = p.parts.slice(0, pend).join('.');\n var parentIn = nestedProperty(gd.layout, ptrunk).get();\n var parentFull = nestedProperty(fullLayout, ptrunk).get();\n var vOld = p.get();\n\n if(vi === undefined) continue;\n\n redoit[ai] = vi;\n\n // axis reverse is special - it is its own inverse\n // op and has no flag.\n undoit[ai] = (pleaf === 'reverse') ? vi : undefinedToNull(vOld);\n\n var valObject = PlotSchema.getLayoutValObject(fullLayout, p.parts);\n\n if(valObject && valObject.impliedEdits && vi !== null) {\n for(var impliedKey in valObject.impliedEdits) {\n doextra(Lib.relativeAttr(ai, impliedKey), valObject.impliedEdits[impliedKey]);\n }\n }\n\n // Setting width or height to null must reset the graph's width / height\n // back to its initial value as computed during the first pass in Plots.plotAutoSize.\n //\n // To do so, we must manually set them back here using the _initialAutoSize cache.\n // can't use impliedEdits for this because behavior depends on vi\n if(['width', 'height'].indexOf(ai) !== -1) {\n if(vi) {\n doextra('autosize', null);\n // currently we don't support autosize one dim only - so\n // explicitly set the other one. Note that doextra will\n // ignore this if the same relayout call also provides oppositeAttr\n var oppositeAttr = ai === 'height' ? 'width' : 'height';\n doextra(oppositeAttr, fullLayout[oppositeAttr]);\n } else {\n fullLayout[ai] = gd._initialAutoSize[ai];\n }\n } else if(ai === 'autosize') {\n // depends on vi here too, so again can't use impliedEdits\n doextra('width', vi ? null : fullLayout.width);\n doextra('height', vi ? null : fullLayout.height);\n } else if(pleafPlus.match(AX_RANGE_RE)) {\n // check autorange vs range\n\n recordAlteredAxis(pleafPlus);\n nestedProperty(fullLayout, ptrunk + '._inputRange').set(null);\n } else if(pleafPlus.match(AX_AUTORANGE_RE)) {\n recordAlteredAxis(pleafPlus);\n nestedProperty(fullLayout, ptrunk + '._inputRange').set(null);\n var axFull = nestedProperty(fullLayout, ptrunk).get();\n if(axFull._inputDomain) {\n // if we're autoranging and this axis has a constrained domain,\n // reset it so we don't get locked into a shrunken size\n axFull._input.domain = axFull._inputDomain.slice();\n }\n } else if(pleafPlus.match(AX_DOMAIN_RE)) {\n nestedProperty(fullLayout, ptrunk + '._inputDomain').set(null);\n }\n\n // toggling axis type between log and linear: we need to convert\n // positions for components that are still using linearized values,\n // not data values like newer components.\n // previously we did this for log <-> not-log, but now only do it\n // for log <-> linear\n if(pleaf === 'type') {\n var ax = parentIn;\n var toLog = parentFull.type === 'linear' && vi === 'log';\n var fromLog = parentFull.type === 'log' && vi === 'linear';\n\n if(toLog || fromLog) {\n if(!ax || !ax.range) {\n // 2D never gets here, but 3D does\n // I don't think this is needed, but left here in case there\n // are edge cases I'm not thinking of.\n doextra(ptrunk + '.autorange', true);\n } else if(!parentFull.autorange) {\n // toggling log without autorange: need to also recalculate ranges\n // because log axes use linearized values for range endpoints\n var r0 = ax.range[0];\n var r1 = ax.range[1];\n if(toLog) {\n // if both limits are negative, autorange\n if(r0 <= 0 && r1 <= 0) {\n doextra(ptrunk + '.autorange', true);\n }\n // if one is negative, set it 6 orders below the other.\n if(r0 <= 0) r0 = r1 / 1e6;\n else if(r1 <= 0) r1 = r0 / 1e6;\n // now set the range values as appropriate\n doextra(ptrunk + '.range[0]', Math.log(r0) / Math.LN10);\n doextra(ptrunk + '.range[1]', Math.log(r1) / Math.LN10);\n } else {\n doextra(ptrunk + '.range[0]', Math.pow(10, r0));\n doextra(ptrunk + '.range[1]', Math.pow(10, r1));\n }\n } else if(toLog) {\n // just make sure the range is positive and in the right\n // order, it'll get recalculated later\n ax.range = (ax.range[1] > ax.range[0]) ? [1, 2] : [2, 1];\n }\n\n // clear polar view initial stash for radial range so that\n // value get recomputed in correct units\n if(Array.isArray(fullLayout._subplots.polar) &&\n fullLayout._subplots.polar.length &&\n fullLayout[p.parts[0]] &&\n p.parts[1] === 'radialaxis'\n ) {\n delete fullLayout[p.parts[0]]._subplot.viewInitial['radialaxis.range'];\n }\n\n // Annotations and images also need to convert to/from linearized coords\n // Shapes do not need this :)\n Registry.getComponentMethod('annotations', 'convertCoords')(gd, parentFull, vi, doextra);\n Registry.getComponentMethod('images', 'convertCoords')(gd, parentFull, vi, doextra);\n } else {\n // any other type changes: the range from the previous type\n // will not make sense, so autorange it.\n doextra(ptrunk + '.autorange', true);\n doextra(ptrunk + '.range', null);\n }\n nestedProperty(fullLayout, ptrunk + '._inputRange').set(null);\n } else if(pleaf.match(AX_NAME_PATTERN)) {\n var fullProp = nestedProperty(fullLayout, ai).get();\n var newType = (vi || {}).type;\n\n // This can potentially cause strange behavior if the autotype is not\n // numeric (linear, because we don't auto-log) but the previous type\n // was log. That's a very strange edge case though\n if(!newType || newType === '-') newType = 'linear';\n Registry.getComponentMethod('annotations', 'convertCoords')(gd, fullProp, newType, doextra);\n Registry.getComponentMethod('images', 'convertCoords')(gd, fullProp, newType, doextra);\n }\n\n // alter gd.layout\n\n // collect array component edits for execution all together\n // so we can ensure consistent behavior adding/removing items\n // and order-independence for add/remove/edit all together in\n // one relayout call\n var containerArrayMatch = manageArrays.containerArrayMatch(ai);\n if(containerArrayMatch) {\n arrayStr = containerArrayMatch.array;\n i = containerArrayMatch.index;\n var propStr = containerArrayMatch.property;\n var updateValObject = valObject || {editType: 'calc'};\n\n if(i !== '' && propStr === '') {\n // special handling of undoit if we're adding or removing an element\n // ie 'annotations[2]' which can be {...} (add) or null,\n // does not work when replacing the entire array\n if(manageArrays.isAddVal(vi)) {\n undoit[ai] = null;\n } else if(manageArrays.isRemoveVal(vi)) {\n undoit[ai] = (nestedProperty(layout, arrayStr).get() || [])[i];\n } else {\n Lib.warn('unrecognized full object value', aobj);\n }\n }\n editTypes.update(flags, updateValObject);\n\n // prepare the edits object we'll send to applyContainerArrayChanges\n if(!arrayEdits[arrayStr]) arrayEdits[arrayStr] = {};\n var objEdits = arrayEdits[arrayStr][i];\n if(!objEdits) objEdits = arrayEdits[arrayStr][i] = {};\n objEdits[propStr] = vi;\n\n delete aobj[ai];\n } else if(pleaf === 'reverse') {\n // handle axis reversal explicitly, as there's no 'reverse' attribute\n\n if(parentIn.range) parentIn.range.reverse();\n else {\n doextra(ptrunk + '.autorange', true);\n parentIn.range = [1, 0];\n }\n\n if(parentFull.autorange) flags.calc = true;\n else flags.plot = true;\n } else {\n if((fullLayout._has('scatter-like') && fullLayout._has('regl')) &&\n (ai === 'dragmode' &&\n (vi === 'lasso' || vi === 'select') &&\n !(vOld === 'lasso' || vOld === 'select'))\n ) {\n flags.plot = true;\n } else if(fullLayout._has('gl2d')) {\n flags.plot = true;\n } else if(valObject) editTypes.update(flags, valObject);\n else flags.calc = true;\n\n p.set(vi);\n }\n }\n\n // now we've collected component edits - execute them all together\n for(arrayStr in arrayEdits) {\n var finished = manageArrays.applyContainerArrayChanges(gd,\n layoutNP(layout, arrayStr), arrayEdits[arrayStr], flags, layoutNP);\n if(!finished) flags.plot = true;\n }\n\n // figure out if we need to recalculate axis constraints\n var constraints = fullLayout._axisConstraintGroups || [];\n for(axId in rangesAltered) {\n for(i = 0; i < constraints.length; i++) {\n var group = constraints[i];\n if(group[axId]) {\n // Always recalc if we're changing constrained ranges.\n // Otherwise it's possible to violate the constraints by\n // specifying arbitrary ranges for all axes in the group.\n // this way some ranges may expand beyond what's specified,\n // as they do at first draw, to satisfy the constraints.\n flags.calc = true;\n for(var groupAxId in group) {\n if(!rangesAltered[groupAxId]) {\n Axes.getFromId(gd, groupAxId)._constraintShrinkable = true;\n }\n }\n }\n }\n }\n\n // If the autosize changed or height or width was explicitly specified,\n // this triggers a redraw\n // TODO: do we really need special aobj.height/width handling here?\n // couldn't editType do this?\n if(updateAutosize(gd) || aobj.height || aobj.width) flags.plot = true;\n\n if(flags.plot || flags.calc) {\n flags.layoutReplot = true;\n }\n\n // now all attribute mods are done, as are\n // redo and undo so we can save them\n\n return {\n flags: flags,\n rangesAltered: rangesAltered,\n undoit: undoit,\n redoit: redoit,\n eventData: eventData\n };\n}\n\n/*\n * updateAutosize: we made a change, does it change the autosize result?\n * puts the new size into fullLayout\n * returns true if either height or width changed\n */\nfunction updateAutosize(gd) {\n var fullLayout = gd._fullLayout;\n var oldWidth = fullLayout.width;\n var oldHeight = fullLayout.height;\n\n // calculate autosizing\n if(gd.layout.autosize) Plots.plotAutoSize(gd, gd.layout, fullLayout);\n\n return (fullLayout.width !== oldWidth) || (fullLayout.height !== oldHeight);\n}\n\n/**\n * update: update trace and layout attributes of an existing plot\n *\n * @param {String | HTMLDivElement} gd\n * the id or DOM element of the graph container div\n * @param {Object} traceUpdate\n * attribute object `{astr1: val1, astr2: val2 ...}`\n * corresponding to updates in the plot's traces\n * @param {Object} layoutUpdate\n * attribute object `{astr1: val1, astr2: val2 ...}`\n * corresponding to updates in the plot's layout\n * @param {Number[] | Number} [traces]\n * integer or array of integers for the traces to alter (all if omitted)\n *\n */\nfunction update(gd, traceUpdate, layoutUpdate, _traces) {\n gd = Lib.getGraphDiv(gd);\n helpers.clearPromiseQueue(gd);\n\n if(gd.framework && gd.framework.isPolar) {\n return Promise.resolve(gd);\n }\n\n if(!Lib.isPlainObject(traceUpdate)) traceUpdate = {};\n if(!Lib.isPlainObject(layoutUpdate)) layoutUpdate = {};\n\n if(Object.keys(traceUpdate).length) gd.changed = true;\n if(Object.keys(layoutUpdate).length) gd.changed = true;\n\n var traces = helpers.coerceTraceIndices(gd, _traces);\n\n var restyleSpecs = _restyle(gd, Lib.extendFlat({}, traceUpdate), traces);\n var restyleFlags = restyleSpecs.flags;\n\n var relayoutSpecs = _relayout(gd, Lib.extendFlat({}, layoutUpdate));\n var relayoutFlags = relayoutSpecs.flags;\n\n // clear calcdata and/or axis types if required\n if(restyleFlags.calc || relayoutFlags.calc) gd.calcdata = undefined;\n if(restyleFlags.clearAxisTypes) helpers.clearAxisTypes(gd, traces, layoutUpdate);\n\n // fill in redraw sequence\n var seq = [];\n\n if(relayoutFlags.layoutReplot) {\n // N.B. works fine when both\n // relayoutFlags.layoutReplot and restyleFlags.fullReplot are true\n seq.push(subroutines.layoutReplot);\n } else if(restyleFlags.fullReplot) {\n seq.push(exports.plot);\n } else {\n seq.push(Plots.previousPromises);\n axRangeSupplyDefaultsByPass(gd, relayoutFlags, relayoutSpecs) || Plots.supplyDefaults(gd);\n\n if(restyleFlags.style) seq.push(subroutines.doTraceStyle);\n if(restyleFlags.colorbars || relayoutFlags.colorbars) seq.push(subroutines.doColorBars);\n if(relayoutFlags.legend) seq.push(subroutines.doLegend);\n if(relayoutFlags.layoutstyle) seq.push(subroutines.layoutStyles);\n if(relayoutFlags.axrange) addAxRangeSequence(seq, relayoutSpecs.rangesAltered);\n if(relayoutFlags.ticks) seq.push(subroutines.doTicksRelayout);\n if(relayoutFlags.modebar) seq.push(subroutines.doModeBar);\n if(relayoutFlags.camera) seq.push(subroutines.doCamera);\n\n seq.push(emitAfterPlot);\n }\n\n seq.push(Plots.rehover, Plots.redrag);\n\n Queue.add(gd,\n update, [gd, restyleSpecs.undoit, relayoutSpecs.undoit, restyleSpecs.traces],\n update, [gd, restyleSpecs.redoit, relayoutSpecs.redoit, restyleSpecs.traces]\n );\n\n var plotDone = Lib.syncOrAsync(seq, gd);\n if(!plotDone || !plotDone.then) plotDone = Promise.resolve(gd);\n\n return plotDone.then(function() {\n gd.emit('plotly_update', {\n data: restyleSpecs.eventData,\n layout: relayoutSpecs.eventData\n });\n\n return gd;\n });\n}\n\n/*\n * internal-use-only restyle/relayout/update variants that record the initial\n * values in (fullLayout|fullTrace)._preGUI so changes can be persisted across\n * Plotly.react data updates, dependent on uirevision attributes\n */\nfunction guiEdit(func) {\n return function wrappedEdit(gd) {\n gd._fullLayout._guiEditing = true;\n var p = func.apply(null, arguments);\n gd._fullLayout._guiEditing = false;\n return p;\n };\n}\n\n// For connecting edited layout attributes to uirevision attrs\n// If no `attr` we use `match[1] + '.uirevision'`\n// Ordered by most common edits first, to minimize our search time\nvar layoutUIControlPatterns = [\n {pattern: /^hiddenlabels/, attr: 'legend.uirevision'},\n {pattern: /^((x|y)axis\\d*)\\.((auto)?range|title\\.text)/},\n\n // showspikes and modes include those nested inside scenes\n {pattern: /axis\\d*\\.showspikes$/, attr: 'modebar.uirevision'},\n {pattern: /(hover|drag)mode$/, attr: 'modebar.uirevision'},\n\n {pattern: /^(scene\\d*)\\.camera/},\n {pattern: /^(geo\\d*)\\.(projection|center|fitbounds)/},\n {pattern: /^(ternary\\d*\\.[abc]axis)\\.(min|title\\.text)$/},\n {pattern: /^(polar\\d*\\.radialaxis)\\.((auto)?range|angle|title\\.text)/},\n {pattern: /^(polar\\d*\\.angularaxis)\\.rotation/},\n {pattern: /^(mapbox\\d*)\\.(center|zoom|bearing|pitch)/},\n\n {pattern: /^legend\\.(x|y)$/, attr: 'editrevision'},\n {pattern: /^(shapes|annotations)/, attr: 'editrevision'},\n {pattern: /^title\\.text$/, attr: 'editrevision'}\n];\n\n// same for trace attributes: if `attr` is given it's in layout,\n// or with no `attr` we use `trace.uirevision`\nvar traceUIControlPatterns = [\n {pattern: /^selectedpoints$/, attr: 'selectionrevision'},\n // \"visible\" includes trace.transforms[i].styles[j].value.visible\n {pattern: /(^|value\\.)visible$/, attr: 'legend.uirevision'},\n {pattern: /^dimensions\\[\\d+\\]\\.constraintrange/},\n {pattern: /^node\\.(x|y|groups)/}, // for Sankey nodes\n {pattern: /^level$/}, // for Sunburst & Treemap traces\n\n // below this you must be in editable: true mode\n // TODO: I still put name and title with `trace.uirevision`\n // reasonable or should these be `editrevision`?\n // Also applies to axis titles up in the layout section\n\n // \"name\" also includes transform.styles\n {pattern: /(^|value\\.)name$/},\n // including nested colorbar attributes (ie marker.colorbar)\n {pattern: /colorbar\\.title\\.text$/},\n {pattern: /colorbar\\.(x|y)$/, attr: 'editrevision'}\n];\n\nfunction findUIPattern(key, patternSpecs) {\n for(var i = 0; i < patternSpecs.length; i++) {\n var spec = patternSpecs[i];\n var match = key.match(spec.pattern);\n if(match) {\n return {head: match[1], attr: spec.attr};\n }\n }\n}\n\n// We're finding the new uirevision before supplyDefaults, so do the\n// inheritance manually. Note that only `undefined` inherits - other\n// falsy values are returned.\nfunction getNewRev(revAttr, container) {\n var newRev = nestedProperty(container, revAttr).get();\n if(newRev !== undefined) return newRev;\n\n var parts = revAttr.split('.');\n parts.pop();\n while(parts.length > 1) {\n parts.pop();\n newRev = nestedProperty(container, parts.join('.') + '.uirevision').get();\n if(newRev !== undefined) return newRev;\n }\n\n return container.uirevision;\n}\n\nfunction getFullTraceIndexFromUid(uid, fullData) {\n for(var i = 0; i < fullData.length; i++) {\n if(fullData[i]._fullInput.uid === uid) return i;\n }\n return -1;\n}\n\nfunction getTraceIndexFromUid(uid, data, tracei) {\n for(var i = 0; i < data.length; i++) {\n if(data[i].uid === uid) return i;\n }\n // fall back on trace order, but only if user didn't provide a uid for that trace\n return (!data[tracei] || data[tracei].uid) ? -1 : tracei;\n}\n\nfunction valsMatch(v1, v2) {\n var v1IsObj = Lib.isPlainObject(v1);\n var v1IsArray = Array.isArray(v1);\n if(v1IsObj || v1IsArray) {\n return (\n (v1IsObj && Lib.isPlainObject(v2)) ||\n (v1IsArray && Array.isArray(v2))\n ) && JSON.stringify(v1) === JSON.stringify(v2);\n }\n return v1 === v2;\n}\n\nfunction applyUIRevisions(data, layout, oldFullData, oldFullLayout) {\n var layoutPreGUI = oldFullLayout._preGUI;\n var key, revAttr, oldRev, newRev, match, preGUIVal, newNP, newVal;\n var bothInheritAutorange = [];\n var newRangeAccepted = {};\n for(key in layoutPreGUI) {\n match = findUIPattern(key, layoutUIControlPatterns);\n if(match) {\n revAttr = match.attr || (match.head + '.uirevision');\n oldRev = nestedProperty(oldFullLayout, revAttr).get();\n newRev = oldRev && getNewRev(revAttr, layout);\n if(newRev && (newRev === oldRev)) {\n preGUIVal = layoutPreGUI[key];\n if(preGUIVal === null) preGUIVal = undefined;\n newNP = nestedProperty(layout, key);\n newVal = newNP.get();\n if(valsMatch(newVal, preGUIVal)) {\n if(newVal === undefined && key.substr(key.length - 9) === 'autorange') {\n bothInheritAutorange.push(key.substr(0, key.length - 10));\n }\n newNP.set(undefinedToNull(nestedProperty(oldFullLayout, key).get()));\n continue;\n }\n }\n } else {\n Lib.warn('unrecognized GUI edit: ' + key);\n }\n // if we got this far, the new value was accepted as the new starting\n // point (either because it changed or revision changed)\n // so remove it from _preGUI for next time.\n delete layoutPreGUI[key];\n\n if(key.substr(key.length - 8, 6) === 'range[') {\n newRangeAccepted[key.substr(0, key.length - 9)] = 1;\n }\n }\n\n // Special logic for `autorange`, since it interacts with `range`:\n // If the new figure's matching `range` was kept, and `autorange`\n // wasn't supplied explicitly in either the original or the new figure,\n // we shouldn't alter that - but we may just have done that, so fix it.\n for(var i = 0; i < bothInheritAutorange.length; i++) {\n var axAttr = bothInheritAutorange[i];\n if(newRangeAccepted[axAttr]) {\n var newAx = nestedProperty(layout, axAttr).get();\n if(newAx) delete newAx.autorange;\n }\n }\n\n // Now traces - try to match them up by uid (in case we added/deleted in\n // the middle), then fall back on index.\n var allTracePreGUI = oldFullLayout._tracePreGUI;\n for(var uid in allTracePreGUI) {\n var tracePreGUI = allTracePreGUI[uid];\n var newTrace = null;\n var fullInput;\n for(key in tracePreGUI) {\n // wait until we know we have preGUI values to look for traces\n // but if we don't find both, stop looking at this uid\n if(!newTrace) {\n var fulli = getFullTraceIndexFromUid(uid, oldFullData);\n if(fulli < 0) {\n // Somehow we didn't even have this trace in oldFullData...\n // I guess this could happen with `deleteTraces` or something\n delete allTracePreGUI[uid];\n break;\n }\n var fullTrace = oldFullData[fulli];\n fullInput = fullTrace._fullInput;\n\n var newTracei = getTraceIndexFromUid(uid, data, fullInput.index);\n if(newTracei < 0) {\n // No match in new data\n delete allTracePreGUI[uid];\n break;\n }\n newTrace = data[newTracei];\n }\n\n match = findUIPattern(key, traceUIControlPatterns);\n if(match) {\n if(match.attr) {\n oldRev = nestedProperty(oldFullLayout, match.attr).get();\n newRev = oldRev && getNewRev(match.attr, layout);\n } else {\n oldRev = fullInput.uirevision;\n // inheritance for trace.uirevision is simple, just layout.uirevision\n newRev = newTrace.uirevision;\n if(newRev === undefined) newRev = layout.uirevision;\n }\n\n if(newRev && newRev === oldRev) {\n preGUIVal = tracePreGUI[key];\n if(preGUIVal === null) preGUIVal = undefined;\n newNP = nestedProperty(newTrace, key);\n newVal = newNP.get();\n if(valsMatch(newVal, preGUIVal)) {\n newNP.set(undefinedToNull(nestedProperty(fullInput, key).get()));\n continue;\n }\n }\n } else {\n Lib.warn('unrecognized GUI edit: ' + key + ' in trace uid ' + uid);\n }\n delete tracePreGUI[key];\n }\n }\n}\n\n/**\n * Plotly.react:\n * A plot/update method that takes the full plot state (same API as plot/newPlot)\n * and diffs to determine the minimal update pathway\n *\n * @param {string id or DOM element} gd\n * the id or DOM element of the graph container div\n * @param {array of objects} data\n * array of traces, containing the data and display information for each trace\n * @param {object} layout\n * object describing the overall display of the plot,\n * all the stuff that doesn't pertain to any individual trace\n * @param {object} config\n * configuration options (see ./plot_config.js for more info)\n *\n * OR\n *\n * @param {string id or DOM element} gd\n * the id or DOM element of the graph container div\n * @param {object} figure\n * object containing `data`, `layout`, `config`, and `frames` members\n *\n */\nfunction react(gd, data, layout, config) {\n var frames, plotDone;\n\n function addFrames() { return exports.addFrames(gd, frames); }\n\n gd = Lib.getGraphDiv(gd);\n helpers.clearPromiseQueue(gd);\n\n var oldFullData = gd._fullData;\n var oldFullLayout = gd._fullLayout;\n\n // you can use this as the initial draw as well as to update\n if(!Lib.isPlotDiv(gd) || !oldFullData || !oldFullLayout) {\n plotDone = exports.newPlot(gd, data, layout, config);\n } else {\n if(Lib.isPlainObject(data)) {\n var obj = data;\n data = obj.data;\n layout = obj.layout;\n config = obj.config;\n frames = obj.frames;\n }\n\n var configChanged = false;\n // assume that if there's a config at all, we're reacting to it too,\n // and completely replace the previous config\n if(config) {\n var oldConfig = Lib.extendDeep({}, gd._context);\n gd._context = undefined;\n setPlotContext(gd, config);\n configChanged = diffConfig(oldConfig, gd._context);\n }\n\n gd.data = data || [];\n helpers.cleanData(gd.data);\n gd.layout = layout || {};\n helpers.cleanLayout(gd.layout);\n\n applyUIRevisions(gd.data, gd.layout, oldFullData, oldFullLayout);\n\n var allNames = Object.getOwnPropertyNames(oldFullLayout);\n for(var q = 0; q < allNames.length; q++) {\n var name = allNames[q];\n var start = name.substring(0, 5);\n if(start === 'xaxis' || start === 'yaxis') {\n var emptyCategories = oldFullLayout[name]._emptyCategories;\n if(emptyCategories) emptyCategories();\n }\n }\n\n // \"true\" skips updating calcdata and remapping arrays from calcTransforms,\n // which supplyDefaults usually does at the end, but we may need to NOT do\n // if the diff (which we haven't determined yet) says we'll recalc\n Plots.supplyDefaults(gd, {skipUpdateCalc: true});\n\n var newFullData = gd._fullData;\n var newFullLayout = gd._fullLayout;\n var immutable = newFullLayout.datarevision === undefined;\n var transition = newFullLayout.transition;\n\n var relayoutFlags = diffLayout(gd, oldFullLayout, newFullLayout, immutable, transition);\n var newDataRevision = relayoutFlags.newDataRevision;\n var restyleFlags = diffData(gd, oldFullData, newFullData, immutable, transition, newDataRevision);\n\n // TODO: how to translate this part of relayout to Plotly.react?\n // // Setting width or height to null must reset the graph's width / height\n // // back to its initial value as computed during the first pass in Plots.plotAutoSize.\n // //\n // // To do so, we must manually set them back here using the _initialAutoSize cache.\n // if(['width', 'height'].indexOf(ai) !== -1 && vi === null) {\n // fullLayout[ai] = gd._initialAutoSize[ai];\n // }\n\n if(updateAutosize(gd)) relayoutFlags.layoutReplot = true;\n\n // clear calcdata if required\n if(restyleFlags.calc || relayoutFlags.calc) gd.calcdata = undefined;\n // otherwise do the calcdata updates and calcTransform array remaps that we skipped earlier\n else Plots.supplyDefaultsUpdateCalc(gd.calcdata, newFullData);\n\n // Note: what restyle/relayout use impliedEdits and clearAxisTypes for\n // must be handled by the user when using Plotly.react.\n\n // fill in redraw sequence\n var seq = [];\n\n if(frames) {\n gd._transitionData = {};\n Plots.createTransitionData(gd);\n seq.push(addFrames);\n }\n\n // Transition pathway,\n // only used when 'transition' is set by user and\n // when at least one animatable attribute has changed,\n // N.B. config changed aren't animatable\n if(newFullLayout.transition && !configChanged && (restyleFlags.anim || relayoutFlags.anim)) {\n Plots.doCalcdata(gd);\n subroutines.doAutoRangeAndConstraints(gd);\n\n seq.push(function() {\n return Plots.transitionFromReact(gd, restyleFlags, relayoutFlags, oldFullLayout);\n });\n } else if(restyleFlags.fullReplot || relayoutFlags.layoutReplot || configChanged) {\n gd._fullLayout._skipDefaults = true;\n seq.push(exports.plot);\n } else {\n for(var componentType in relayoutFlags.arrays) {\n var indices = relayoutFlags.arrays[componentType];\n if(indices.length) {\n var drawOne = Registry.getComponentMethod(componentType, 'drawOne');\n if(drawOne !== Lib.noop) {\n for(var i = 0; i < indices.length; i++) {\n drawOne(gd, indices[i]);\n }\n } else {\n var draw = Registry.getComponentMethod(componentType, 'draw');\n if(draw === Lib.noop) {\n throw new Error('cannot draw components: ' + componentType);\n }\n draw(gd);\n }\n }\n }\n\n seq.push(Plots.previousPromises);\n if(restyleFlags.style) seq.push(subroutines.doTraceStyle);\n if(restyleFlags.colorbars || relayoutFlags.colorbars) seq.push(subroutines.doColorBars);\n if(relayoutFlags.legend) seq.push(subroutines.doLegend);\n if(relayoutFlags.layoutstyle) seq.push(subroutines.layoutStyles);\n if(relayoutFlags.axrange) addAxRangeSequence(seq);\n if(relayoutFlags.ticks) seq.push(subroutines.doTicksRelayout);\n if(relayoutFlags.modebar) seq.push(subroutines.doModeBar);\n if(relayoutFlags.camera) seq.push(subroutines.doCamera);\n seq.push(emitAfterPlot);\n }\n\n seq.push(Plots.rehover, Plots.redrag);\n\n plotDone = Lib.syncOrAsync(seq, gd);\n if(!plotDone || !plotDone.then) plotDone = Promise.resolve(gd);\n }\n\n return plotDone.then(function() {\n gd.emit('plotly_react', {\n data: data,\n layout: layout\n });\n\n return gd;\n });\n}\n\nfunction diffData(gd, oldFullData, newFullData, immutable, transition, newDataRevision) {\n var sameTraceLength = oldFullData.length === newFullData.length;\n\n if(!transition && !sameTraceLength) {\n return {\n fullReplot: true,\n calc: true\n };\n }\n\n var flags = editTypes.traceFlags();\n flags.arrays = {};\n flags.nChanges = 0;\n flags.nChangesAnim = 0;\n\n var i, trace;\n\n function getTraceValObject(parts) {\n var out = PlotSchema.getTraceValObject(trace, parts);\n if(!trace._module.animatable && out.anim) {\n out.anim = false;\n }\n return out;\n }\n\n var diffOpts = {\n getValObject: getTraceValObject,\n flags: flags,\n immutable: immutable,\n transition: transition,\n newDataRevision: newDataRevision,\n gd: gd\n };\n\n var seenUIDs = {};\n\n for(i = 0; i < oldFullData.length; i++) {\n if(newFullData[i]) {\n trace = newFullData[i]._fullInput;\n if(Plots.hasMakesDataTransform(trace)) trace = newFullData[i];\n if(seenUIDs[trace.uid]) continue;\n seenUIDs[trace.uid] = 1;\n\n getDiffFlags(oldFullData[i]._fullInput, trace, [], diffOpts);\n }\n }\n\n if(flags.calc || flags.plot) {\n flags.fullReplot = true;\n }\n\n if(transition && flags.nChanges && flags.nChangesAnim) {\n flags.anim = (flags.nChanges === flags.nChangesAnim) && sameTraceLength ? 'all' : 'some';\n }\n\n return flags;\n}\n\nfunction diffLayout(gd, oldFullLayout, newFullLayout, immutable, transition) {\n var flags = editTypes.layoutFlags();\n flags.arrays = {};\n flags.rangesAltered = {};\n flags.nChanges = 0;\n flags.nChangesAnim = 0;\n\n function getLayoutValObject(parts) {\n return PlotSchema.getLayoutValObject(newFullLayout, parts);\n }\n\n var diffOpts = {\n getValObject: getLayoutValObject,\n flags: flags,\n immutable: immutable,\n transition: transition,\n gd: gd\n };\n\n getDiffFlags(oldFullLayout, newFullLayout, [], diffOpts);\n\n if(flags.plot || flags.calc) {\n flags.layoutReplot = true;\n }\n\n if(transition && flags.nChanges && flags.nChangesAnim) {\n flags.anim = flags.nChanges === flags.nChangesAnim ? 'all' : 'some';\n }\n\n return flags;\n}\n\nfunction getDiffFlags(oldContainer, newContainer, outerparts, opts) {\n var valObject, key, astr;\n\n var getValObject = opts.getValObject;\n var flags = opts.flags;\n var immutable = opts.immutable;\n var inArray = opts.inArray;\n var arrayIndex = opts.arrayIndex;\n\n function changed() {\n var editType = valObject.editType;\n if(inArray && editType.indexOf('arraydraw') !== -1) {\n Lib.pushUnique(flags.arrays[inArray], arrayIndex);\n return;\n }\n editTypes.update(flags, valObject);\n\n if(editType !== 'none') {\n flags.nChanges++;\n }\n\n // track animatable changes\n if(opts.transition && valObject.anim) {\n flags.nChangesAnim++;\n }\n\n // track cartesian axes with altered ranges\n if(AX_RANGE_RE.test(astr) || AX_AUTORANGE_RE.test(astr)) {\n flags.rangesAltered[outerparts[0]] = 1;\n }\n\n // clear _inputDomain on cartesian axes with altered domains\n if(AX_DOMAIN_RE.test(astr)) {\n nestedProperty(newContainer, '_inputDomain').set(null);\n }\n\n // track datarevision changes\n if(key === 'datarevision') {\n flags.newDataRevision = 1;\n }\n }\n\n function valObjectCanBeDataArray(valObject) {\n return valObject.valType === 'data_array' || valObject.arrayOk;\n }\n\n for(key in oldContainer) {\n // short-circuit based on previous calls or previous keys that already maximized the pathway\n if(flags.calc && !opts.transition) return;\n\n var oldVal = oldContainer[key];\n var newVal = newContainer[key];\n var parts = outerparts.concat(key);\n astr = parts.join('.');\n\n if(key.charAt(0) === '_' || typeof oldVal === 'function' || oldVal === newVal) continue;\n\n // FIXME: ax.tick0 and dtick get filled in during plotting (except for geo subplots),\n // and unlike other auto values they don't make it back into the input,\n // so newContainer won't have them.\n if((key === 'tick0' || key === 'dtick') && outerparts[0] !== 'geo') {\n var tickMode = newContainer.tickmode;\n if(tickMode === 'auto' || tickMode === 'array' || !tickMode) continue;\n }\n // FIXME: Similarly for axis ranges for 3D\n // contourcarpet doesn't HAVE zmin/zmax, they're just auto-added. It needs them.\n if(key === 'range' && newContainer.autorange) continue;\n if((key === 'zmin' || key === 'zmax') && newContainer.type === 'contourcarpet') continue;\n\n valObject = getValObject(parts);\n\n // in case type changed, we may not even *have* a valObject.\n if(!valObject) continue;\n\n if(valObject._compareAsJSON && JSON.stringify(oldVal) === JSON.stringify(newVal)) continue;\n\n var valType = valObject.valType;\n var i;\n\n var canBeDataArray = valObjectCanBeDataArray(valObject);\n var wasArray = Array.isArray(oldVal);\n var nowArray = Array.isArray(newVal);\n\n // hack for traces that modify the data in supplyDefaults, like\n // converting 1D to 2D arrays, which will always create new objects\n if(wasArray && nowArray) {\n var inputKey = '_input_' + key;\n var oldValIn = oldContainer[inputKey];\n var newValIn = newContainer[inputKey];\n if(Array.isArray(oldValIn) && oldValIn === newValIn) continue;\n }\n\n if(newVal === undefined) {\n if(canBeDataArray && wasArray) flags.calc = true;\n else changed();\n } else if(valObject._isLinkedToArray) {\n var arrayEditIndices = [];\n var extraIndices = false;\n if(!inArray) flags.arrays[key] = arrayEditIndices;\n\n var minLen = Math.min(oldVal.length, newVal.length);\n var maxLen = Math.max(oldVal.length, newVal.length);\n if(minLen !== maxLen) {\n if(valObject.editType === 'arraydraw') {\n extraIndices = true;\n } else {\n changed();\n continue;\n }\n }\n\n for(i = 0; i < minLen; i++) {\n getDiffFlags(oldVal[i], newVal[i], parts.concat(i),\n // add array indices, but not if we're already in an array\n Lib.extendFlat({inArray: key, arrayIndex: i}, opts));\n }\n\n // put this at the end so that we know our collected array indices are sorted\n // but the check for length changes happens up front so we can short-circuit\n // diffing if appropriate\n if(extraIndices) {\n for(i = minLen; i < maxLen; i++) {\n arrayEditIndices.push(i);\n }\n }\n } else if(!valType && Lib.isPlainObject(oldVal)) {\n getDiffFlags(oldVal, newVal, parts, opts);\n } else if(canBeDataArray) {\n if(wasArray && nowArray) {\n // don't try to diff two data arrays. If immutable we know the data changed,\n // if not, assume it didn't and let `layout.datarevision` tell us if it did\n if(immutable) {\n flags.calc = true;\n }\n\n // look for animatable attributes when the data changed\n if(immutable || opts.newDataRevision) {\n changed();\n }\n } else if(wasArray !== nowArray) {\n flags.calc = true;\n } else changed();\n } else if(wasArray && nowArray) {\n // info array, colorscale, 'any' - these are short, just stringify.\n // I don't *think* that covers up any real differences post-validation, does it?\n // otherwise we need to dive in 1 (info_array) or 2 (colorscale) levels and compare\n // all elements.\n if(oldVal.length !== newVal.length || String(oldVal) !== String(newVal)) {\n changed();\n }\n } else {\n changed();\n }\n }\n\n for(key in newContainer) {\n if(!(key in oldContainer || key.charAt(0) === '_' || typeof newContainer[key] === 'function')) {\n valObject = getValObject(outerparts.concat(key));\n\n if(valObjectCanBeDataArray(valObject) && Array.isArray(newContainer[key])) {\n flags.calc = true;\n return;\n } else changed();\n }\n }\n}\n\n/*\n * simple diff for config - for now, just treat all changes as equivalent\n */\nfunction diffConfig(oldConfig, newConfig) {\n var key;\n\n for(key in oldConfig) {\n if(key.charAt(0) === '_') continue;\n var oldVal = oldConfig[key];\n var newVal = newConfig[key];\n if(oldVal !== newVal) {\n if(Lib.isPlainObject(oldVal) && Lib.isPlainObject(newVal)) {\n if(diffConfig(oldVal, newVal)) {\n return true;\n }\n } else if(Array.isArray(oldVal) && Array.isArray(newVal)) {\n if(oldVal.length !== newVal.length) {\n return true;\n }\n for(var i = 0; i < oldVal.length; i++) {\n if(oldVal[i] !== newVal[i]) {\n if(Lib.isPlainObject(oldVal[i]) && Lib.isPlainObject(newVal[i])) {\n if(diffConfig(oldVal[i], newVal[i])) {\n return true;\n }\n } else {\n return true;\n }\n }\n }\n } else {\n return true;\n }\n }\n }\n}\n\n/**\n * Animate to a frame, sequence of frame, frame group, or frame definition\n *\n * @param {string id or DOM element} gd\n * the id or DOM element of the graph container div\n *\n * @param {string or object or array of strings or array of objects} frameOrGroupNameOrFrameList\n * a single frame, array of frames, or group to which to animate. The intent is\n * inferred by the type of the input. Valid inputs are:\n *\n * - string, e.g. 'groupname': animate all frames of a given `group` in the order\n * in which they are defined via `Plotly.addFrames`.\n *\n * - array of strings, e.g. ['frame1', frame2']: a list of frames by name to which\n * to animate in sequence\n *\n * - object: {data: ...}: a frame definition to which to animate. The frame is not\n * and does not need to be added via `Plotly.addFrames`. It may contain any of\n * the properties of a frame, including `data`, `layout`, and `traces`. The\n * frame is used as provided and does not use the `baseframe` property.\n *\n * - array of objects, e.g. [{data: ...}, {data: ...}]: a list of frame objects,\n * each following the same rules as a single `object`.\n *\n * @param {object} animationOpts\n * configuration for the animation\n */\nfunction animate(gd, frameOrGroupNameOrFrameList, animationOpts) {\n gd = Lib.getGraphDiv(gd);\n\n if(!Lib.isPlotDiv(gd)) {\n throw new Error(\n 'This element is not a Plotly plot: ' + gd + '. It\\'s likely that you\\'ve failed ' +\n 'to create a plot before animating it. For more details, see ' +\n 'https://plotly.com/javascript/animations/'\n );\n }\n\n var trans = gd._transitionData;\n\n // This is the queue of frames that will be animated as soon as possible. They\n // are popped immediately upon the *start* of a transition:\n if(!trans._frameQueue) {\n trans._frameQueue = [];\n }\n\n animationOpts = Plots.supplyAnimationDefaults(animationOpts);\n var transitionOpts = animationOpts.transition;\n var frameOpts = animationOpts.frame;\n\n // Since frames are popped immediately, an empty queue only means all frames have\n // *started* to transition, not that the animation is complete. To solve that,\n // track a separate counter that increments at the same time as frames are added\n // to the queue, but decrements only when the transition is complete.\n if(trans._frameWaitingCnt === undefined) {\n trans._frameWaitingCnt = 0;\n }\n\n function getTransitionOpts(i) {\n if(Array.isArray(transitionOpts)) {\n if(i >= transitionOpts.length) {\n return transitionOpts[0];\n } else {\n return transitionOpts[i];\n }\n } else {\n return transitionOpts;\n }\n }\n\n function getFrameOpts(i) {\n if(Array.isArray(frameOpts)) {\n if(i >= frameOpts.length) {\n return frameOpts[0];\n } else {\n return frameOpts[i];\n }\n } else {\n return frameOpts;\n }\n }\n\n // Execute a callback after the wrapper function has been called n times.\n // This is used to defer the resolution until a transition has resovled *and*\n // the frame has completed. If it's not done this way, then we get a race\n // condition in which the animation might resolve before a transition is complete\n // or vice versa.\n function callbackOnNthTime(cb, n) {\n var cnt = 0;\n return function() {\n if(cb && ++cnt === n) {\n return cb();\n }\n };\n }\n\n return new Promise(function(resolve, reject) {\n function discardExistingFrames() {\n if(trans._frameQueue.length === 0) {\n return;\n }\n\n while(trans._frameQueue.length) {\n var next = trans._frameQueue.pop();\n if(next.onInterrupt) {\n next.onInterrupt();\n }\n }\n\n gd.emit('plotly_animationinterrupted', []);\n }\n\n function queueFrames(frameList) {\n if(frameList.length === 0) return;\n\n for(var i = 0; i < frameList.length; i++) {\n var computedFrame;\n\n if(frameList[i].type === 'byname') {\n // If it's a named frame, compute it:\n computedFrame = Plots.computeFrame(gd, frameList[i].name);\n } else {\n // Otherwise we must have been given a simple object, so treat\n // the input itself as the computed frame.\n computedFrame = frameList[i].data;\n }\n\n var frameOpts = getFrameOpts(i);\n var transitionOpts = getTransitionOpts(i);\n\n // It doesn't make much sense for the transition duration to be greater than\n // the frame duration, so limit it:\n transitionOpts.duration = Math.min(transitionOpts.duration, frameOpts.duration);\n\n var nextFrame = {\n frame: computedFrame,\n name: frameList[i].name,\n frameOpts: frameOpts,\n transitionOpts: transitionOpts,\n };\n if(i === frameList.length - 1) {\n // The last frame in this .animate call stores the promise resolve\n // and reject callbacks. This is how we ensure that the animation\n // loop (which may exist as a result of a *different* .animate call)\n // still resolves or rejecdts this .animate call's promise. once it's\n // complete.\n nextFrame.onComplete = callbackOnNthTime(resolve, 2);\n nextFrame.onInterrupt = reject;\n }\n\n trans._frameQueue.push(nextFrame);\n }\n\n // Set it as never having transitioned to a frame. This will cause the animation\n // loop to immediately transition to the next frame (which, for immediate mode,\n // is the first frame in the list since all others would have been discarded\n // below)\n if(animationOpts.mode === 'immediate') {\n trans._lastFrameAt = -Infinity;\n }\n\n // Only it's not already running, start a RAF loop. This could be avoided in the\n // case that there's only one frame, but it significantly complicated the logic\n // and only sped things up by about 5% or so for a lorenz attractor simulation.\n // It would be a fine thing to implement, but the benefit of that optimization\n // doesn't seem worth the extra complexity.\n if(!trans._animationRaf) {\n beginAnimationLoop();\n }\n }\n\n function stopAnimationLoop() {\n gd.emit('plotly_animated');\n\n // Be sure to unset also since it's how we know whether a loop is already running:\n window.cancelAnimationFrame(trans._animationRaf);\n trans._animationRaf = null;\n }\n\n function nextFrame() {\n if(trans._currentFrame && trans._currentFrame.onComplete) {\n // Execute the callback and unset it to ensure it doesn't\n // accidentally get called twice\n trans._currentFrame.onComplete();\n }\n\n var newFrame = trans._currentFrame = trans._frameQueue.shift();\n\n if(newFrame) {\n // Since it's sometimes necessary to do deep digging into frame data,\n // we'll consider it not 100% impossible for nulls or numbers to sneak through,\n // so check when casting the name, just to be absolutely certain:\n var stringName = newFrame.name ? newFrame.name.toString() : null;\n gd._fullLayout._currentFrame = stringName;\n\n trans._lastFrameAt = Date.now();\n trans._timeToNext = newFrame.frameOpts.duration;\n\n // This is simply called and it's left to .transition to decide how to manage\n // interrupting current transitions. That means we don't need to worry about\n // how it resolves or what happens after this:\n Plots.transition(gd,\n newFrame.frame.data,\n newFrame.frame.layout,\n helpers.coerceTraceIndices(gd, newFrame.frame.traces),\n newFrame.frameOpts,\n newFrame.transitionOpts\n ).then(function() {\n if(newFrame.onComplete) {\n newFrame.onComplete();\n }\n });\n\n gd.emit('plotly_animatingframe', {\n name: stringName,\n frame: newFrame.frame,\n animation: {\n frame: newFrame.frameOpts,\n transition: newFrame.transitionOpts,\n }\n });\n } else {\n // If there are no more frames, then stop the RAF loop:\n stopAnimationLoop();\n }\n }\n\n function beginAnimationLoop() {\n gd.emit('plotly_animating');\n\n // If no timer is running, then set last frame = long ago so that the next\n // frame is immediately transitioned:\n trans._lastFrameAt = -Infinity;\n trans._timeToNext = 0;\n trans._runningTransitions = 0;\n trans._currentFrame = null;\n\n var doFrame = function() {\n // This *must* be requested before nextFrame since nextFrame may decide\n // to cancel it if there's nothing more to animated:\n trans._animationRaf = window.requestAnimationFrame(doFrame);\n\n // Check if we're ready for a new frame:\n if(Date.now() - trans._lastFrameAt > trans._timeToNext) {\n nextFrame();\n }\n };\n\n doFrame();\n }\n\n // This is an animate-local counter that helps match up option input list\n // items with the particular frame.\n var configCounter = 0;\n function setTransitionConfig(frame) {\n if(Array.isArray(transitionOpts)) {\n if(configCounter >= transitionOpts.length) {\n frame.transitionOpts = transitionOpts[configCounter];\n } else {\n frame.transitionOpts = transitionOpts[0];\n }\n } else {\n frame.transitionOpts = transitionOpts;\n }\n configCounter++;\n return frame;\n }\n\n // Disambiguate what's sort of frames have been received\n var i, frame;\n var frameList = [];\n var allFrames = frameOrGroupNameOrFrameList === undefined || frameOrGroupNameOrFrameList === null;\n var isFrameArray = Array.isArray(frameOrGroupNameOrFrameList);\n var isSingleFrame = !allFrames && !isFrameArray && Lib.isPlainObject(frameOrGroupNameOrFrameList);\n\n if(isSingleFrame) {\n // In this case, a simple object has been passed to animate.\n frameList.push({\n type: 'object',\n data: setTransitionConfig(Lib.extendFlat({}, frameOrGroupNameOrFrameList))\n });\n } else if(allFrames || ['string', 'number'].indexOf(typeof frameOrGroupNameOrFrameList) !== -1) {\n // In this case, null or undefined has been passed so that we want to\n // animate *all* currently defined frames\n for(i = 0; i < trans._frames.length; i++) {\n frame = trans._frames[i];\n\n if(!frame) continue;\n\n if(allFrames || String(frame.group) === String(frameOrGroupNameOrFrameList)) {\n frameList.push({\n type: 'byname',\n name: String(frame.name),\n data: setTransitionConfig({name: frame.name})\n });\n }\n }\n } else if(isFrameArray) {\n for(i = 0; i < frameOrGroupNameOrFrameList.length; i++) {\n var frameOrName = frameOrGroupNameOrFrameList[i];\n if(['number', 'string'].indexOf(typeof frameOrName) !== -1) {\n frameOrName = String(frameOrName);\n // In this case, there's an array and this frame is a string name:\n frameList.push({\n type: 'byname',\n name: frameOrName,\n data: setTransitionConfig({name: frameOrName})\n });\n } else if(Lib.isPlainObject(frameOrName)) {\n frameList.push({\n type: 'object',\n data: setTransitionConfig(Lib.extendFlat({}, frameOrName))\n });\n }\n }\n }\n\n // Verify that all of these frames actually exist; return and reject if not:\n for(i = 0; i < frameList.length; i++) {\n frame = frameList[i];\n if(frame.type === 'byname' && !trans._frameHash[frame.data.name]) {\n Lib.warn('animate failure: frame not found: \"' + frame.data.name + '\"');\n reject();\n return;\n }\n }\n\n // If the mode is either next or immediate, then all currently queued frames must\n // be dumped and the corresponding .animate promises rejected.\n if(['next', 'immediate'].indexOf(animationOpts.mode) !== -1) {\n discardExistingFrames();\n }\n\n if(animationOpts.direction === 'reverse') {\n frameList.reverse();\n }\n\n var currentFrame = gd._fullLayout._currentFrame;\n if(currentFrame && animationOpts.fromcurrent) {\n var idx = -1;\n for(i = 0; i < frameList.length; i++) {\n frame = frameList[i];\n if(frame.type === 'byname' && frame.name === currentFrame) {\n idx = i;\n break;\n }\n }\n\n if(idx > 0 && idx < frameList.length - 1) {\n var filteredFrameList = [];\n for(i = 0; i < frameList.length; i++) {\n frame = frameList[i];\n if(frameList[i].type !== 'byname' || i > idx) {\n filteredFrameList.push(frame);\n }\n }\n frameList = filteredFrameList;\n }\n }\n\n if(frameList.length > 0) {\n queueFrames(frameList);\n } else {\n // This is the case where there were simply no frames. It's a little strange\n // since there's not much to do:\n gd.emit('plotly_animated');\n resolve();\n }\n });\n}\n\n/**\n * Register new frames\n *\n * @param {string id or DOM element} gd\n * the id or DOM element of the graph container div\n *\n * @param {array of objects} frameList\n * list of frame definitions, in which each object includes any of:\n * - name: {string} name of frame to add\n * - data: {array of objects} trace data\n * - layout {object} layout definition\n * - traces {array} trace indices\n * - baseframe {string} name of frame from which this frame gets defaults\n *\n * @param {array of integers} indices\n * an array of integer indices matching the respective frames in `frameList`. If not\n * provided, an index will be provided in serial order. If already used, the frame\n * will be overwritten.\n */\nfunction addFrames(gd, frameList, indices) {\n gd = Lib.getGraphDiv(gd);\n\n if(frameList === null || frameList === undefined) {\n return Promise.resolve();\n }\n\n if(!Lib.isPlotDiv(gd)) {\n throw new Error(\n 'This element is not a Plotly plot: ' + gd + '. It\\'s likely that you\\'ve failed ' +\n 'to create a plot before adding frames. For more details, see ' +\n 'https://plotly.com/javascript/animations/'\n );\n }\n\n var i, frame, j, idx;\n var _frames = gd._transitionData._frames;\n var _frameHash = gd._transitionData._frameHash;\n\n\n if(!Array.isArray(frameList)) {\n throw new Error('addFrames failure: frameList must be an Array of frame definitions' + frameList);\n }\n\n // Create a sorted list of insertions since we run into lots of problems if these\n // aren't in ascending order of index:\n //\n // Strictly for sorting. Make sure this is guaranteed to never collide with any\n // already-exisisting indices:\n var bigIndex = _frames.length + frameList.length * 2;\n\n var insertions = [];\n var _frameHashLocal = {};\n for(i = frameList.length - 1; i >= 0; i--) {\n if(!Lib.isPlainObject(frameList[i])) continue;\n\n // The entire logic for checking for this type of name collision can be removed once we migrate to ES6 and\n // use a Map instead of an Object instance, as Map keys aren't converted to strings.\n var lookupName = frameList[i].name;\n var name = (_frameHash[lookupName] || _frameHashLocal[lookupName] || {}).name;\n var newName = frameList[i].name;\n var collisionPresent = _frameHash[name] || _frameHashLocal[name];\n\n if(name && newName && typeof newName === 'number' && collisionPresent && numericNameWarningCount < numericNameWarningCountLimit) {\n numericNameWarningCount++;\n\n Lib.warn('addFrames: overwriting frame \"' + (_frameHash[name] || _frameHashLocal[name]).name +\n '\" with a frame whose name of type \"number\" also equates to \"' +\n name + '\". This is valid but may potentially lead to unexpected ' +\n 'behavior since all plotly.js frame names are stored internally ' +\n 'as strings.');\n\n if(numericNameWarningCount === numericNameWarningCountLimit) {\n Lib.warn('addFrames: This API call has yielded too many of these warnings. ' +\n 'For the rest of this call, further warnings about numeric frame ' +\n 'names will be suppressed.');\n }\n }\n\n _frameHashLocal[lookupName] = {name: lookupName};\n\n insertions.push({\n frame: Plots.supplyFrameDefaults(frameList[i]),\n index: (indices && indices[i] !== undefined && indices[i] !== null) ? indices[i] : bigIndex + i\n });\n }\n\n // Sort this, taking note that undefined insertions end up at the end:\n insertions.sort(function(a, b) {\n if(a.index > b.index) return -1;\n if(a.index < b.index) return 1;\n return 0;\n });\n\n var ops = [];\n var revops = [];\n var frameCount = _frames.length;\n\n for(i = insertions.length - 1; i >= 0; i--) {\n frame = insertions[i].frame;\n\n if(typeof frame.name === 'number') {\n Lib.warn('Warning: addFrames accepts frames with numeric names, but the numbers are' +\n 'implicitly cast to strings');\n }\n\n if(!frame.name) {\n // Repeatedly assign a default name, incrementing the counter each time until\n // we get a name that's not in the hashed lookup table:\n while(_frameHash[(frame.name = 'frame ' + gd._transitionData._counter++)]);\n }\n\n if(_frameHash[frame.name]) {\n // If frame is present, overwrite its definition:\n for(j = 0; j < _frames.length; j++) {\n if((_frames[j] || {}).name === frame.name) break;\n }\n ops.push({type: 'replace', index: j, value: frame});\n revops.unshift({type: 'replace', index: j, value: _frames[j]});\n } else {\n // Otherwise insert it at the end of the list:\n idx = Math.max(0, Math.min(insertions[i].index, frameCount));\n\n ops.push({type: 'insert', index: idx, value: frame});\n revops.unshift({type: 'delete', index: idx});\n frameCount++;\n }\n }\n\n var undoFunc = Plots.modifyFrames;\n var redoFunc = Plots.modifyFrames;\n var undoArgs = [gd, revops];\n var redoArgs = [gd, ops];\n\n if(Queue) Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);\n\n return Plots.modifyFrames(gd, ops);\n}\n\n/**\n * Delete frame\n *\n * @param {string id or DOM element} gd\n * the id or DOM element of the graph container div\n *\n * @param {array of integers} frameList\n * list of integer indices of frames to be deleted\n */\nfunction deleteFrames(gd, frameList) {\n gd = Lib.getGraphDiv(gd);\n\n if(!Lib.isPlotDiv(gd)) {\n throw new Error('This element is not a Plotly plot: ' + gd);\n }\n\n var i, idx;\n var _frames = gd._transitionData._frames;\n var ops = [];\n var revops = [];\n\n if(!frameList) {\n frameList = [];\n for(i = 0; i < _frames.length; i++) {\n frameList.push(i);\n }\n }\n\n frameList = frameList.slice();\n frameList.sort();\n\n for(i = frameList.length - 1; i >= 0; i--) {\n idx = frameList[i];\n ops.push({type: 'delete', index: idx});\n revops.unshift({type: 'insert', index: idx, value: _frames[idx]});\n }\n\n var undoFunc = Plots.modifyFrames;\n var redoFunc = Plots.modifyFrames;\n var undoArgs = [gd, revops];\n var redoArgs = [gd, ops];\n\n if(Queue) Queue.add(gd, undoFunc, undoArgs, redoFunc, redoArgs);\n\n return Plots.modifyFrames(gd, ops);\n}\n\n/**\n * Purge a graph container div back to its initial pre-Plotly.plot state\n *\n * @param {string id or DOM element} gd\n * the id or DOM element of the graph container div\n */\nfunction purge(gd) {\n gd = Lib.getGraphDiv(gd);\n\n var fullLayout = gd._fullLayout || {};\n var fullData = gd._fullData || [];\n\n // remove gl contexts\n Plots.cleanPlot([], {}, fullData, fullLayout);\n\n // purge properties\n Plots.purge(gd);\n\n // purge event emitter methods\n Events.purge(gd);\n\n // remove plot container\n if(fullLayout._container) fullLayout._container.remove();\n\n // in contrast to Plotly.Plots.purge which does NOT clear _context!\n delete gd._context;\n\n return gd;\n}\n\n// -------------------------------------------------------\n// makePlotFramework: Create the plot container and axes\n// -------------------------------------------------------\nfunction makePlotFramework(gd) {\n var gd3 = d3.select(gd);\n var fullLayout = gd._fullLayout;\n\n // Plot container\n fullLayout._container = gd3.selectAll('.plot-container').data([0]);\n fullLayout._container.enter().insert('div', ':first-child')\n .classed('plot-container', true)\n .classed('plotly', true);\n\n // Make the svg container\n fullLayout._paperdiv = fullLayout._container.selectAll('.svg-container').data([0]);\n fullLayout._paperdiv.enter().append('div')\n .classed('svg-container', true)\n .style('position', 'relative');\n\n // Make the graph containers\n // start fresh each time we get here, so we know the order comes out\n // right, rather than enter/exit which can muck up the order\n // TODO: sort out all the ordering so we don't have to\n // explicitly delete anything\n // FIXME: parcoords reuses this object, not the best pattern\n fullLayout._glcontainer = fullLayout._paperdiv.selectAll('.gl-container')\n .data([{}]);\n\n fullLayout._glcontainer.enter().append('div')\n .classed('gl-container', true);\n\n fullLayout._paperdiv.selectAll('.main-svg').remove();\n fullLayout._paperdiv.select('.modebar-container').remove();\n\n fullLayout._paper = fullLayout._paperdiv.insert('svg', ':first-child')\n .classed('main-svg', true);\n\n fullLayout._toppaper = fullLayout._paperdiv.append('svg')\n .classed('main-svg', true);\n\n fullLayout._modebardiv = fullLayout._paperdiv.append('div');\n\n fullLayout._hoverpaper = fullLayout._paperdiv.append('svg')\n .classed('main-svg', true);\n\n if(!fullLayout._uid) {\n var otherUids = {};\n d3.selectAll('defs').each(function() {\n if(this.id) otherUids[this.id.split('-')[1]] = 1;\n });\n fullLayout._uid = Lib.randstr(otherUids);\n }\n\n fullLayout._paperdiv.selectAll('.main-svg')\n .attr(xmlnsNamespaces.svgAttrs);\n\n fullLayout._defs = fullLayout._paper.append('defs')\n .attr('id', 'defs-' + fullLayout._uid);\n\n fullLayout._clips = fullLayout._defs.append('g')\n .classed('clips', true);\n\n fullLayout._topdefs = fullLayout._toppaper.append('defs')\n .attr('id', 'topdefs-' + fullLayout._uid);\n\n fullLayout._topclips = fullLayout._topdefs.append('g')\n .classed('clips', true);\n\n fullLayout._bgLayer = fullLayout._paper.append('g')\n .classed('bglayer', true);\n\n fullLayout._draggers = fullLayout._paper.append('g')\n .classed('draglayer', true);\n\n // lower shape/image layer - note that this is behind\n // all subplots data/grids but above the backgrounds\n // except inset subplots, whose backgrounds are drawn\n // inside their own group so that they appear above\n // the data for the main subplot\n // lower shapes and images which are fully referenced to\n // a subplot still get drawn within the subplot's group\n // so they will work correctly on insets\n var layerBelow = fullLayout._paper.append('g')\n .classed('layer-below', true);\n fullLayout._imageLowerLayer = layerBelow.append('g')\n .classed('imagelayer', true);\n fullLayout._shapeLowerLayer = layerBelow.append('g')\n .classed('shapelayer', true);\n\n // single cartesian layer for the whole plot\n fullLayout._cartesianlayer = fullLayout._paper.append('g').classed('cartesianlayer', true);\n\n // single polar layer for the whole plot\n fullLayout._polarlayer = fullLayout._paper.append('g').classed('polarlayer', true);\n\n // single ternary layer for the whole plot\n fullLayout._ternarylayer = fullLayout._paper.append('g').classed('ternarylayer', true);\n\n // single geo layer for the whole plot\n fullLayout._geolayer = fullLayout._paper.append('g').classed('geolayer', true);\n\n // single funnelarea layer for the whole plot\n fullLayout._funnelarealayer = fullLayout._paper.append('g').classed('funnelarealayer', true);\n\n // single pie layer for the whole plot\n fullLayout._pielayer = fullLayout._paper.append('g').classed('pielayer', true);\n\n // single treemap layer for the whole plot\n fullLayout._treemaplayer = fullLayout._paper.append('g').classed('treemaplayer', true);\n\n // single sunburst layer for the whole plot\n fullLayout._sunburstlayer = fullLayout._paper.append('g').classed('sunburstlayer', true);\n\n // single indicator layer for the whole plot\n fullLayout._indicatorlayer = fullLayout._toppaper.append('g').classed('indicatorlayer', true);\n\n // fill in image server scrape-svg\n fullLayout._glimages = fullLayout._paper.append('g').classed('glimages', true);\n\n // lastly upper shapes, info (legend, annotations) and hover layers go on top\n // these are in a different svg element normally, but get collapsed into a single\n // svg when exporting (after inserting 3D)\n // upper shapes/images are only those drawn above the whole plot, including subplots\n var layerAbove = fullLayout._toppaper.append('g')\n .classed('layer-above', true);\n fullLayout._imageUpperLayer = layerAbove.append('g')\n .classed('imagelayer', true);\n fullLayout._shapeUpperLayer = layerAbove.append('g')\n .classed('shapelayer', true);\n\n fullLayout._infolayer = fullLayout._toppaper.append('g').classed('infolayer', true);\n fullLayout._menulayer = fullLayout._toppaper.append('g').classed('menulayer', true);\n fullLayout._zoomlayer = fullLayout._toppaper.append('g').classed('zoomlayer', true);\n fullLayout._hoverlayer = fullLayout._hoverpaper.append('g').classed('hoverlayer', true);\n\n // Make the modebar container\n fullLayout._modebardiv\n .classed('modebar-container', true)\n .style('position', 'absolute')\n .style('top', '0px')\n .style('right', '0px');\n\n gd.emit('plotly_framework');\n}\n\nexports.animate = animate;\nexports.addFrames = addFrames;\nexports.deleteFrames = deleteFrames;\n\nexports.addTraces = addTraces;\nexports.deleteTraces = deleteTraces;\nexports.extendTraces = extendTraces;\nexports.moveTraces = moveTraces;\nexports.prependTraces = prependTraces;\n\nexports.newPlot = newPlot;\nexports.plot = plot;\nexports.purge = purge;\n\nexports.react = react;\nexports.redraw = redraw;\nexports.relayout = relayout;\nexports.restyle = restyle;\n\nexports.setPlotConfig = setPlotConfig;\n\nexports.update = update;\n\nexports._guiRelayout = guiEdit(relayout);\nexports._guiRestyle = guiEdit(restyle);\nexports._guiUpdate = guiEdit(update);\n\nexports._storeDirectGUIEdit = _storeDirectGUIEdit;\n\n},{\"../components/color\":595,\"../components/drawing\":617,\"../constants/xmlns_namespaces\":705,\"../lib\":728,\"../lib/events\":718,\"../lib/queue\":743,\"../lib/svg_text_utils\":752,\"../plots/cartesian/axes\":776,\"../plots/cartesian/constants\":782,\"../plots/cartesian/graph_interact\":785,\"../plots/cartesian/select\":795,\"../plots/plots\":839,\"../plots/polar/legacy\":847,\"../registry\":859,\"./edit_types\":759,\"./helpers\":760,\"./manage_arrays\":762,\"./plot_config\":764,\"./plot_schema\":765,\"./subroutines\":767,\"d3\":164,\"fast-isnumeric\":236,\"has-hover\":409}],764:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/**\n * This will be transferred over to gd and overridden by\n * config args to Plotly.plot.\n *\n * The defaults are the appropriate settings for plotly.js,\n * so we get the right experience without any config argument.\n *\n * N.B. the config options are not coerced using Lib.coerce so keys\n * like `valType` and `values` are only set for documentation purposes\n * at the moment.\n */\n\nvar configAttributes = {\n staticPlot: {\n valType: 'boolean',\n dflt: false,\n \n },\n\n plotlyServerURL: {\n valType: 'string',\n dflt: '',\n \n },\n\n editable: {\n valType: 'boolean',\n dflt: false,\n \n },\n edits: {\n annotationPosition: {\n valType: 'boolean',\n dflt: false,\n \n },\n annotationTail: {\n valType: 'boolean',\n dflt: false,\n \n },\n annotationText: {\n valType: 'boolean',\n dflt: false,\n \n },\n axisTitleText: {\n valType: 'boolean',\n dflt: false,\n \n },\n colorbarPosition: {\n valType: 'boolean',\n dflt: false,\n \n },\n colorbarTitleText: {\n valType: 'boolean',\n dflt: false,\n \n },\n legendPosition: {\n valType: 'boolean',\n dflt: false,\n \n },\n legendText: {\n valType: 'boolean',\n dflt: false,\n \n },\n shapePosition: {\n valType: 'boolean',\n dflt: false,\n \n },\n titleText: {\n valType: 'boolean',\n dflt: false,\n \n }\n },\n\n autosizable: {\n valType: 'boolean',\n dflt: false,\n \n },\n responsive: {\n valType: 'boolean',\n dflt: false,\n \n },\n fillFrame: {\n valType: 'boolean',\n dflt: false,\n \n },\n frameMargins: {\n valType: 'number',\n dflt: 0,\n min: 0,\n max: 0.5,\n \n },\n\n scrollZoom: {\n valType: 'flaglist',\n flags: ['cartesian', 'gl3d', 'geo', 'mapbox'],\n extras: [true, false],\n dflt: 'gl3d+geo+mapbox',\n \n },\n doubleClick: {\n valType: 'enumerated',\n values: [false, 'reset', 'autosize', 'reset+autosize'],\n dflt: 'reset+autosize',\n \n },\n doubleClickDelay: {\n valType: 'number',\n dflt: 300,\n min: 0,\n \n },\n\n showAxisDragHandles: {\n valType: 'boolean',\n dflt: true,\n \n },\n showAxisRangeEntryBoxes: {\n valType: 'boolean',\n dflt: true,\n \n },\n\n showTips: {\n valType: 'boolean',\n dflt: true,\n \n },\n\n showLink: {\n valType: 'boolean',\n dflt: false,\n \n },\n linkText: {\n valType: 'string',\n dflt: 'Edit chart',\n noBlank: true,\n \n },\n sendData: {\n valType: 'boolean',\n dflt: true,\n \n },\n showSources: {\n valType: 'any',\n dflt: false,\n \n },\n\n displayModeBar: {\n valType: 'enumerated',\n values: ['hover', true, false],\n dflt: 'hover',\n \n },\n showSendToCloud: {\n valType: 'boolean',\n dflt: false,\n \n },\n showEditInChartStudio: {\n valType: 'boolean',\n dflt: false,\n \n },\n modeBarButtonsToRemove: {\n valType: 'any',\n dflt: [],\n \n },\n modeBarButtonsToAdd: {\n valType: 'any',\n dflt: [],\n \n },\n modeBarButtons: {\n valType: 'any',\n dflt: false,\n \n },\n toImageButtonOptions: {\n valType: 'any',\n dflt: {},\n \n },\n displaylogo: {\n valType: 'boolean',\n dflt: true,\n \n },\n watermark: {\n valType: 'boolean',\n dflt: false,\n \n },\n\n plotGlPixelRatio: {\n valType: 'number',\n dflt: 2,\n min: 1,\n max: 4,\n \n },\n\n setBackground: {\n valType: 'any',\n dflt: 'transparent',\n \n },\n\n topojsonURL: {\n valType: 'string',\n noBlank: true,\n dflt: 'https://cdn.plot.ly/',\n \n },\n\n mapboxAccessToken: {\n valType: 'string',\n dflt: null,\n \n },\n\n logging: {\n valType: 'integer',\n min: 0,\n max: 2,\n dflt: 1,\n \n },\n\n notifyOnLogging: {\n valType: 'integer',\n min: 0,\n max: 2,\n dflt: 0,\n \n },\n\n queueLength: {\n valType: 'integer',\n min: 0,\n dflt: 0,\n \n },\n\n globalTransforms: {\n valType: 'any',\n dflt: [],\n \n },\n\n locale: {\n valType: 'string',\n dflt: 'en-US',\n \n },\n\n locales: {\n valType: 'any',\n dflt: {},\n \n }\n};\n\nvar dfltConfig = {};\n\nfunction crawl(src, target) {\n for(var k in src) {\n var obj = src[k];\n if(obj.valType) {\n target[k] = obj.dflt;\n } else {\n if(!target[k]) {\n target[k] = {};\n }\n crawl(obj, target[k]);\n }\n }\n}\n\ncrawl(configAttributes, dfltConfig);\n\nmodule.exports = {\n configAttributes: configAttributes,\n dfltConfig: dfltConfig\n};\n\n},{}],765:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../registry');\nvar Lib = _dereq_('../lib');\n\nvar baseAttributes = _dereq_('../plots/attributes');\nvar baseLayoutAttributes = _dereq_('../plots/layout_attributes');\nvar frameAttributes = _dereq_('../plots/frame_attributes');\nvar animationAttributes = _dereq_('../plots/animation_attributes');\nvar configAttributes = _dereq_('./plot_config').configAttributes;\n\n// polar attributes are not part of the Registry yet\nvar polarAreaAttrs = _dereq_('../plots/polar/legacy/area_attributes');\nvar polarAxisAttrs = _dereq_('../plots/polar/legacy/axis_attributes');\n\nvar editTypes = _dereq_('./edit_types');\n\nvar extendFlat = Lib.extendFlat;\nvar extendDeepAll = Lib.extendDeepAll;\nvar isPlainObject = Lib.isPlainObject;\nvar isArrayOrTypedArray = Lib.isArrayOrTypedArray;\nvar nestedProperty = Lib.nestedProperty;\nvar valObjectMeta = Lib.valObjectMeta;\n\nvar IS_SUBPLOT_OBJ = '_isSubplotObj';\nvar IS_LINKED_TO_ARRAY = '_isLinkedToArray';\nvar ARRAY_ATTR_REGEXPS = '_arrayAttrRegexps';\nvar DEPRECATED = '_deprecated';\nvar UNDERSCORE_ATTRS = [IS_SUBPLOT_OBJ, IS_LINKED_TO_ARRAY, ARRAY_ATTR_REGEXPS, DEPRECATED];\n\nexports.IS_SUBPLOT_OBJ = IS_SUBPLOT_OBJ;\nexports.IS_LINKED_TO_ARRAY = IS_LINKED_TO_ARRAY;\nexports.DEPRECATED = DEPRECATED;\nexports.UNDERSCORE_ATTRS = UNDERSCORE_ATTRS;\n\n/** Outputs the full plotly.js plot schema\n *\n * @return {object}\n * - defs\n * - traces\n * - layout\n * - transforms\n * - frames\n * - animations\n * - config\n */\nexports.get = function() {\n var traces = {};\n\n Registry.allTypes.concat('area').forEach(function(type) {\n traces[type] = getTraceAttributes(type);\n });\n\n var transforms = {};\n\n Object.keys(Registry.transformsRegistry).forEach(function(type) {\n transforms[type] = getTransformAttributes(type);\n });\n\n return {\n defs: {\n valObjects: valObjectMeta,\n metaKeys: UNDERSCORE_ATTRS.concat(['description', 'role', 'editType', 'impliedEdits']),\n editType: {\n traces: editTypes.traces,\n layout: editTypes.layout\n },\n impliedEdits: {\n \n }\n },\n\n traces: traces,\n layout: getLayoutAttributes(),\n\n transforms: transforms,\n\n frames: getFramesAttributes(),\n animation: formatAttributes(animationAttributes),\n\n config: formatAttributes(configAttributes)\n };\n};\n\n/**\n * Crawl the attribute tree, recursively calling a callback function\n *\n * @param {object} attrs\n * The node of the attribute tree (e.g. the root) from which recursion originates\n * @param {Function} callback\n * A callback function with the signature:\n * @callback callback\n * @param {object} attr an attribute\n * @param {String} attrName name string\n * @param {object[]} attrs all the attributes\n * @param {Number} level the recursion level, 0 at the root\n * @param {String} fullAttrString full attribute name (ie 'marker.line')\n * @param {Number} [specifiedLevel]\n * The level in the tree, in order to let the callback function detect descend or backtrack,\n * typically unsupplied (implied 0), just used by the self-recursive call.\n * The necessity arises because the tree traversal is not controlled by callback return values.\n * The decision to not use callback return values for controlling tree pruning arose from\n * the goal of keeping the crawler backwards compatible. Observe that one of the pruning conditions\n * precedes the callback call.\n * @param {string} [attrString]\n * the path to the current attribute, as an attribute string (ie 'marker.line')\n * typically unsupplied, but you may supply it if you want to disambiguate which attrs tree you\n * are starting from\n *\n * @return {object} transformOut\n * copy of transformIn that contains attribute defaults\n */\nexports.crawl = function(attrs, callback, specifiedLevel, attrString) {\n var level = specifiedLevel || 0;\n attrString = attrString || '';\n\n Object.keys(attrs).forEach(function(attrName) {\n var attr = attrs[attrName];\n\n if(UNDERSCORE_ATTRS.indexOf(attrName) !== -1) return;\n\n var fullAttrString = (attrString ? attrString + '.' : '') + attrName;\n callback(attr, attrName, attrs, level, fullAttrString);\n\n if(exports.isValObject(attr)) return;\n\n if(isPlainObject(attr) && attrName !== 'impliedEdits') {\n exports.crawl(attr, callback, level + 1, fullAttrString);\n }\n });\n};\n\n/** Is object a value object (or a container object)?\n *\n * @param {object} obj\n * @return {boolean}\n * returns true for a valid value object and\n * false for tree nodes in the attribute hierarchy\n */\nexports.isValObject = function(obj) {\n return obj && obj.valType !== undefined;\n};\n\n/**\n * Find all data array attributes in a given trace object - including\n * `arrayOk` attributes.\n *\n * @param {object} trace\n * full trace object that contains a reference to `_module.attributes`\n *\n * @return {array} arrayAttributes\n * list of array attributes for the given trace\n */\nexports.findArrayAttributes = function(trace) {\n var arrayAttributes = [];\n var stack = [];\n var isArrayStack = [];\n var baseContainer, baseAttrName;\n\n function callback(attr, attrName, attrs, level) {\n stack = stack.slice(0, level).concat([attrName]);\n isArrayStack = isArrayStack.slice(0, level).concat([attr && attr._isLinkedToArray]);\n\n var splittableAttr = (\n attr &&\n (attr.valType === 'data_array' || attr.arrayOk === true) &&\n !(stack[level - 1] === 'colorbar' && (attrName === 'ticktext' || attrName === 'tickvals'))\n );\n\n // Manually exclude 'colorbar.tickvals' and 'colorbar.ticktext' for now\n // which are declared as `valType: 'data_array'` but scale independently of\n // the coordinate arrays.\n //\n // Down the road, we might want to add a schema field (e.g `uncorrelatedArray: true`)\n // to distinguish attributes of the likes.\n\n if(!splittableAttr) return;\n\n crawlIntoTrace(baseContainer, 0, '');\n }\n\n function crawlIntoTrace(container, i, astrPartial) {\n var item = container[stack[i]];\n var newAstrPartial = astrPartial + stack[i];\n if(i === stack.length - 1) {\n if(isArrayOrTypedArray(item)) {\n arrayAttributes.push(baseAttrName + newAstrPartial);\n }\n } else {\n if(isArrayStack[i]) {\n if(Array.isArray(item)) {\n for(var j = 0; j < item.length; j++) {\n if(isPlainObject(item[j])) {\n crawlIntoTrace(item[j], i + 1, newAstrPartial + '[' + j + '].');\n }\n }\n }\n } else if(isPlainObject(item)) {\n crawlIntoTrace(item, i + 1, newAstrPartial + '.');\n }\n }\n }\n\n baseContainer = trace;\n baseAttrName = '';\n exports.crawl(baseAttributes, callback);\n if(trace._module && trace._module.attributes) {\n exports.crawl(trace._module.attributes, callback);\n }\n\n var transforms = trace.transforms;\n if(transforms) {\n for(var i = 0; i < transforms.length; i++) {\n var transform = transforms[i];\n var module = transform._module;\n\n if(module) {\n baseAttrName = 'transforms[' + i + '].';\n baseContainer = transform;\n\n exports.crawl(module.attributes, callback);\n }\n }\n }\n\n return arrayAttributes;\n};\n\n/*\n * Find the valObject for one attribute in an existing trace\n *\n * @param {object} trace\n * full trace object that contains a reference to `_module.attributes`\n * @param {object} parts\n * an array of parts, like ['transforms', 1, 'value']\n * typically from nestedProperty(...).parts\n *\n * @return {object|false}\n * the valObject for this attribute, or the last found parent\n * in some cases the innermost valObject will not exist, for example\n * `valType: 'any'` attributes where we might set a part of the attribute.\n * In that case, stop at the deepest valObject we *do* find.\n */\nexports.getTraceValObject = function(trace, parts) {\n var head = parts[0];\n var i = 1; // index to start recursing from\n var moduleAttrs, valObject;\n\n if(head === 'transforms') {\n if(parts.length === 1) {\n return baseAttributes.transforms;\n }\n var transforms = trace.transforms;\n if(!Array.isArray(transforms) || !transforms.length) return false;\n var tNum = parts[1];\n if(!isIndex(tNum) || tNum >= transforms.length) {\n return false;\n }\n moduleAttrs = (Registry.transformsRegistry[transforms[tNum].type] || {}).attributes;\n valObject = moduleAttrs && moduleAttrs[parts[2]];\n i = 3; // start recursing only inside the transform\n } else if(trace.type === 'area') {\n valObject = polarAreaAttrs[head];\n } else {\n // first look in the module for this trace\n // components have already merged their trace attributes in here\n var _module = trace._module;\n if(!_module) _module = (Registry.modules[trace.type || baseAttributes.type.dflt] || {})._module;\n if(!_module) return false;\n\n moduleAttrs = _module.attributes;\n valObject = moduleAttrs && moduleAttrs[head];\n\n // then look in the subplot attributes\n if(!valObject) {\n var subplotModule = _module.basePlotModule;\n if(subplotModule && subplotModule.attributes) {\n valObject = subplotModule.attributes[head];\n }\n }\n\n // finally look in the global attributes\n if(!valObject) valObject = baseAttributes[head];\n }\n\n return recurseIntoValObject(valObject, parts, i);\n};\n\n/*\n * Find the valObject for one layout attribute\n *\n * @param {array} parts\n * an array of parts, like ['annotations', 1, 'x']\n * typically from nestedProperty(...).parts\n *\n * @return {object|false}\n * the valObject for this attribute, or the last found parent\n * in some cases the innermost valObject will not exist, for example\n * `valType: 'any'` attributes where we might set a part of the attribute.\n * In that case, stop at the deepest valObject we *do* find.\n */\nexports.getLayoutValObject = function(fullLayout, parts) {\n var valObject = layoutHeadAttr(fullLayout, parts[0]);\n\n return recurseIntoValObject(valObject, parts, 1);\n};\n\nfunction layoutHeadAttr(fullLayout, head) {\n var i, key, _module, attributes;\n\n // look for attributes of the subplot types used on the plot\n var basePlotModules = fullLayout._basePlotModules;\n if(basePlotModules) {\n var out;\n for(i = 0; i < basePlotModules.length; i++) {\n _module = basePlotModules[i];\n if(_module.attrRegex && _module.attrRegex.test(head)) {\n // if a module defines overrides, these take precedence\n // initially this is to allow gl2d different editTypes from svg cartesian\n if(_module.layoutAttrOverrides) return _module.layoutAttrOverrides;\n\n // otherwise take the first attributes we find\n if(!out && _module.layoutAttributes) out = _module.layoutAttributes;\n }\n\n // a module can also override the behavior of base (and component) module layout attrs\n // again see gl2d for initial use case\n var baseOverrides = _module.baseLayoutAttrOverrides;\n if(baseOverrides && head in baseOverrides) return baseOverrides[head];\n }\n if(out) return out;\n }\n\n // look for layout attributes contributed by traces on the plot\n var modules = fullLayout._modules;\n if(modules) {\n for(i = 0; i < modules.length; i++) {\n attributes = modules[i].layoutAttributes;\n if(attributes && head in attributes) {\n return attributes[head];\n }\n }\n }\n\n /*\n * Next look in components.\n * Components that define a schema have already merged this into\n * base and subplot attribute defs, so ignore these.\n * Others (older style) all put all their attributes\n * inside a container matching the module `name`\n * eg `attributes` (array) or `legend` (object)\n */\n for(key in Registry.componentsRegistry) {\n _module = Registry.componentsRegistry[key];\n if(_module.name === 'colorscale' && head.indexOf('coloraxis') === 0) {\n return _module.layoutAttributes[head];\n } else if(!_module.schema && (head === _module.name)) {\n return _module.layoutAttributes;\n }\n }\n\n if(head in baseLayoutAttributes) return baseLayoutAttributes[head];\n\n // Polar doesn't populate _modules or _basePlotModules\n // just fall back on these when the others fail\n if(head === 'radialaxis' || head === 'angularaxis') {\n return polarAxisAttrs[head];\n }\n return polarAxisAttrs.layout[head] || false;\n}\n\nfunction recurseIntoValObject(valObject, parts, i) {\n if(!valObject) return false;\n\n if(valObject._isLinkedToArray) {\n // skip array index, abort if we try to dive into an array without an index\n if(isIndex(parts[i])) i++;\n else if(i < parts.length) return false;\n }\n\n // now recurse as far as we can. Occasionally we have an attribute\n // setting an internal part below what's in the schema; just return\n // the innermost schema item we find.\n for(; i < parts.length; i++) {\n var newValObject = valObject[parts[i]];\n if(isPlainObject(newValObject)) valObject = newValObject;\n else break;\n\n if(i === parts.length - 1) break;\n\n if(valObject._isLinkedToArray) {\n i++;\n if(!isIndex(parts[i])) return false;\n } else if(valObject.valType === 'info_array') {\n i++;\n var index = parts[i];\n if(!isIndex(index)) return false;\n\n var items = valObject.items;\n if(Array.isArray(items)) {\n if(index >= items.length) return false;\n if(valObject.dimensions === 2) {\n i++;\n if(parts.length === i) return valObject;\n var index2 = parts[i];\n if(!isIndex(index2)) return false;\n valObject = items[index][index2];\n } else valObject = items[index];\n } else {\n valObject = items;\n }\n }\n }\n\n return valObject;\n}\n\n// note: this is different from Lib.isIndex, this one doesn't accept numeric\n// strings, only actual numbers.\nfunction isIndex(val) {\n return val === Math.round(val) && val >= 0;\n}\n\nfunction getTraceAttributes(type) {\n var _module, basePlotModule;\n\n if(type === 'area') {\n _module = { attributes: polarAreaAttrs };\n basePlotModule = {};\n } else {\n _module = Registry.modules[type]._module,\n basePlotModule = _module.basePlotModule;\n }\n\n var attributes = {};\n\n // make 'type' the first attribute in the object\n attributes.type = null;\n\n var copyBaseAttributes = extendDeepAll({}, baseAttributes);\n var copyModuleAttributes = extendDeepAll({}, _module.attributes);\n\n // prune global-level trace attributes that are already defined in a trace\n exports.crawl(copyModuleAttributes, function(attr, attrName, attrs, level, fullAttrString) {\n nestedProperty(copyBaseAttributes, fullAttrString).set(undefined);\n // Prune undefined attributes\n if(attr === undefined) nestedProperty(copyModuleAttributes, fullAttrString).set(undefined);\n });\n\n // base attributes (same for all trace types)\n extendDeepAll(attributes, copyBaseAttributes);\n\n // prune-out base attributes based on trace module categories\n if(Registry.traceIs(type, 'noOpacity')) {\n delete attributes.opacity;\n }\n if(!Registry.traceIs(type, 'showLegend')) {\n delete attributes.showlegend;\n delete attributes.legendgroup;\n }\n if(Registry.traceIs(type, 'noHover')) {\n delete attributes.hoverinfo;\n delete attributes.hoverlabel;\n }\n if(!_module.selectPoints) {\n delete attributes.selectedpoints;\n }\n\n // module attributes\n extendDeepAll(attributes, copyModuleAttributes);\n\n // subplot attributes\n if(basePlotModule.attributes) {\n extendDeepAll(attributes, basePlotModule.attributes);\n }\n\n // 'type' gets overwritten by baseAttributes; reset it here\n attributes.type = type;\n\n var out = {\n meta: _module.meta || {},\n categories: _module.categories || {},\n animatable: Boolean(_module.animatable),\n type: type,\n attributes: formatAttributes(attributes),\n };\n\n // trace-specific layout attributes\n if(_module.layoutAttributes) {\n var layoutAttributes = {};\n\n extendDeepAll(layoutAttributes, _module.layoutAttributes);\n out.layoutAttributes = formatAttributes(layoutAttributes);\n }\n\n // drop anim:true in non-animatable modules\n if(!_module.animatable) {\n exports.crawl(out, function(attr) {\n if(exports.isValObject(attr) && 'anim' in attr) {\n delete attr.anim;\n }\n });\n }\n\n return out;\n}\n\nfunction getLayoutAttributes() {\n var layoutAttributes = {};\n var key, _module;\n\n // global layout attributes\n extendDeepAll(layoutAttributes, baseLayoutAttributes);\n\n // add base plot module layout attributes\n for(key in Registry.subplotsRegistry) {\n _module = Registry.subplotsRegistry[key];\n\n if(!_module.layoutAttributes) continue;\n\n if(Array.isArray(_module.attr)) {\n for(var i = 0; i < _module.attr.length; i++) {\n handleBasePlotModule(layoutAttributes, _module, _module.attr[i]);\n }\n } else {\n var astr = _module.attr === 'subplot' ? _module.name : _module.attr;\n handleBasePlotModule(layoutAttributes, _module, astr);\n }\n }\n\n // polar layout attributes\n layoutAttributes = assignPolarLayoutAttrs(layoutAttributes);\n\n // add registered components layout attributes\n for(key in Registry.componentsRegistry) {\n _module = Registry.componentsRegistry[key];\n var schema = _module.schema;\n\n if(schema && (schema.subplots || schema.layout)) {\n /*\n * Components with defined schema have already been merged in at register time\n * but a few components define attributes that apply only to xaxis\n * not yaxis (rangeselector, rangeslider) - delete from y schema.\n * Note that the input attributes for xaxis/yaxis are the same object\n * so it's not possible to only add them to xaxis from the start.\n * If we ever have such asymmetry the other way, or anywhere else,\n * we will need to extend both this code and mergeComponentAttrsToSubplot\n * (which will not find yaxis only for example)\n */\n var subplots = schema.subplots;\n if(subplots && subplots.xaxis && !subplots.yaxis) {\n for(var xkey in subplots.xaxis) {\n delete layoutAttributes.yaxis[xkey];\n }\n }\n } else if(_module.name === 'colorscale') {\n extendDeepAll(layoutAttributes, _module.layoutAttributes);\n } else if(_module.layoutAttributes) {\n // older style without schema need to be explicitly merged in now\n insertAttrs(layoutAttributes, _module.layoutAttributes, _module.name);\n }\n }\n\n return {\n layoutAttributes: formatAttributes(layoutAttributes)\n };\n}\n\nfunction getTransformAttributes(type) {\n var _module = Registry.transformsRegistry[type];\n var attributes = extendDeepAll({}, _module.attributes);\n\n // add registered components transform attributes\n Object.keys(Registry.componentsRegistry).forEach(function(k) {\n var _module = Registry.componentsRegistry[k];\n\n if(_module.schema && _module.schema.transforms && _module.schema.transforms[type]) {\n Object.keys(_module.schema.transforms[type]).forEach(function(v) {\n insertAttrs(attributes, _module.schema.transforms[type][v], v);\n });\n }\n });\n\n return {\n attributes: formatAttributes(attributes)\n };\n}\n\nfunction getFramesAttributes() {\n var attrs = {\n frames: extendDeepAll({}, frameAttributes)\n };\n\n formatAttributes(attrs);\n\n return attrs.frames;\n}\n\nfunction formatAttributes(attrs) {\n mergeValTypeAndRole(attrs);\n formatArrayContainers(attrs);\n stringify(attrs);\n\n return attrs;\n}\n\nfunction mergeValTypeAndRole(attrs) {\n function makeSrcAttr(attrName) {\n return {\n valType: 'string',\n \n \n editType: 'none'\n };\n }\n\n function callback(attr, attrName, attrs) {\n if(exports.isValObject(attr)) {\n if(attr.valType === 'data_array') {\n // all 'data_array' attrs have role 'data'\n attr.role = 'data';\n // all 'data_array' attrs have a corresponding 'src' attr\n attrs[attrName + 'src'] = makeSrcAttr(attrName);\n } else if(attr.arrayOk === true) {\n // all 'arrayOk' attrs have a corresponding 'src' attr\n attrs[attrName + 'src'] = makeSrcAttr(attrName);\n }\n } else if(isPlainObject(attr)) {\n // all attrs container objects get role 'object'\n attr.role = 'object';\n }\n }\n\n exports.crawl(attrs, callback);\n}\n\nfunction formatArrayContainers(attrs) {\n function callback(attr, attrName, attrs) {\n if(!attr) return;\n\n var itemName = attr[IS_LINKED_TO_ARRAY];\n\n if(!itemName) return;\n\n delete attr[IS_LINKED_TO_ARRAY];\n\n attrs[attrName] = { items: {} };\n attrs[attrName].items[itemName] = attr;\n attrs[attrName].role = 'object';\n }\n\n exports.crawl(attrs, callback);\n}\n\n// this can take around 10ms and should only be run from PlotSchema.get(),\n// to ensure JSON.stringify(PlotSchema.get()) gives the intended result.\nfunction stringify(attrs) {\n function walk(attr) {\n for(var k in attr) {\n if(isPlainObject(attr[k])) {\n walk(attr[k]);\n } else if(Array.isArray(attr[k])) {\n for(var i = 0; i < attr[k].length; i++) {\n walk(attr[k][i]);\n }\n } else {\n // as JSON.stringify(/test/) // => {}\n if(attr[k] instanceof RegExp) {\n attr[k] = attr[k].toString();\n }\n }\n }\n }\n\n walk(attrs);\n}\n\nfunction assignPolarLayoutAttrs(layoutAttributes) {\n extendFlat(layoutAttributes, {\n radialaxis: polarAxisAttrs.radialaxis,\n angularaxis: polarAxisAttrs.angularaxis\n });\n\n extendFlat(layoutAttributes, polarAxisAttrs.layout);\n\n return layoutAttributes;\n}\n\nfunction handleBasePlotModule(layoutAttributes, _module, astr) {\n var np = nestedProperty(layoutAttributes, astr);\n var attrs = extendDeepAll({}, _module.layoutAttributes);\n\n attrs[IS_SUBPLOT_OBJ] = true;\n np.set(attrs);\n}\n\nfunction insertAttrs(baseAttrs, newAttrs, astr) {\n var np = nestedProperty(baseAttrs, astr);\n\n np.set(extendDeepAll(np.get() || {}, newAttrs));\n}\n\n},{\"../lib\":728,\"../plots/animation_attributes\":771,\"../plots/attributes\":773,\"../plots/frame_attributes\":805,\"../plots/layout_attributes\":830,\"../plots/polar/legacy/area_attributes\":845,\"../plots/polar/legacy/axis_attributes\":846,\"../registry\":859,\"./edit_types\":759,\"./plot_config\":764}],766:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../lib');\nvar plotAttributes = _dereq_('../plots/attributes');\n\nvar TEMPLATEITEMNAME = 'templateitemname';\n\nvar templateAttrs = {\n name: {\n valType: 'string',\n \n editType: 'none',\n \n }\n};\ntemplateAttrs[TEMPLATEITEMNAME] = {\n valType: 'string',\n \n editType: 'calc',\n \n};\n\n/**\n * templatedArray: decorate an attributes object with templating (and array)\n * properties.\n *\n * @param {string} name: the singular form of the array name. Sets\n * `_isLinkedToArray` to this, so the schema knows to treat this as an array.\n * @param {object} attrs: the item attributes. Since all callers are expected\n * to be constructing this object on the spot, we mutate it here for\n * performance, rather than extending a new object with it.\n *\n * @returns {object}: the decorated `attrs` object\n */\nexports.templatedArray = function(name, attrs) {\n attrs._isLinkedToArray = name;\n attrs.name = templateAttrs.name;\n attrs[TEMPLATEITEMNAME] = templateAttrs[TEMPLATEITEMNAME];\n return attrs;\n};\n\n/**\n * traceTemplater: logic for matching traces to trace templates\n *\n * @param {object} dataTemplate: collection of {traceType: [{template}, ...]}\n * ie each type the template applies to contains a list of template objects,\n * to be provided cyclically to data traces of that type.\n *\n * @returns {object}: {newTrace}, a function:\n * newTrace(traceIn): that takes the input traceIn, coerces its type, then\n * uses that type to find the next template to apply. returns the output\n * traceOut with template attached, ready to continue supplyDefaults.\n */\nexports.traceTemplater = function(dataTemplate) {\n var traceCounts = {};\n var traceType, typeTemplates;\n\n for(traceType in dataTemplate) {\n typeTemplates = dataTemplate[traceType];\n if(Array.isArray(typeTemplates) && typeTemplates.length) {\n traceCounts[traceType] = 0;\n }\n }\n\n function newTrace(traceIn) {\n traceType = Lib.coerce(traceIn, {}, plotAttributes, 'type');\n var traceOut = {type: traceType, _template: null};\n if(traceType in traceCounts) {\n typeTemplates = dataTemplate[traceType];\n // cycle through traces in the template set for this type\n var typei = traceCounts[traceType] % typeTemplates.length;\n traceCounts[traceType]++;\n traceOut._template = typeTemplates[typei];\n } else {\n // TODO: anything we should do for types missing from the template?\n // try to apply some other type? Or just bail as we do here?\n // Actually I think yes, we should apply other types; would be nice\n // if all scatter* could inherit from each other, and if histogram\n // could inherit from bar, etc... but how to specify this? And do we\n // compose them, or if a type is present require it to be complete?\n // Actually this could apply to layout too - 3D annotations\n // inheriting from 2D, axes of different types inheriting from each\n // other...\n }\n return traceOut;\n }\n\n return {\n newTrace: newTrace\n // TODO: function to figure out what's left & what didn't work\n };\n};\n\n/**\n * newContainer: Create a new sub-container inside `container` and propagate any\n * applicable template to it. If there's no template, still propagates\n * `undefined` so relinkPrivate will not retain an old template!\n *\n * @param {object} container: the outer container, should already have _template\n * if there *is* a template for this plot\n * @param {string} name: the key of the new container to make\n * @param {string} baseName: if applicable, a base attribute to take the\n * template from, ie for xaxis3 the base would be xaxis\n *\n * @returns {object}: an object for inclusion _full*, empty except for the\n * appropriate template piece\n */\nexports.newContainer = function(container, name, baseName) {\n var template = container._template;\n var part = template && (template[name] || (baseName && template[baseName]));\n if(!Lib.isPlainObject(part)) part = null;\n\n var out = container[name] = {_template: part};\n return out;\n};\n\n/**\n * arrayTemplater: special logic for templating both defaults and specific items\n * in a container array (annotations etc)\n *\n * @param {object} container: the outer container, should already have _template\n * if there *is* a template for this plot\n * @param {string} name: the name of the array to template (ie 'annotations')\n * will be used to find default ('annotationdefaults' object) and specific\n * ('annotations' array) template specs.\n * @param {string} inclusionAttr: the attribute determining this item's\n * inclusion in the output, usually 'visible' or 'enabled'\n *\n * @returns {object}: {newItem, defaultItems}, both functions:\n * newItem(itemIn): create an output item, bare except for the correct\n * template and name(s), as the base for supplyDefaults\n * defaultItems(): to be called after all newItem calls, return any\n * specific template items that have not already beeen included,\n * also as bare output items ready for supplyDefaults.\n */\nexports.arrayTemplater = function(container, name, inclusionAttr) {\n var template = container._template;\n var defaultsTemplate = template && template[arrayDefaultKey(name)];\n var templateItems = template && template[name];\n if(!Array.isArray(templateItems) || !templateItems.length) {\n templateItems = [];\n }\n\n var usedNames = {};\n\n function newItem(itemIn) {\n // include name and templateitemname in the output object for ALL\n // container array items. Note: you could potentially use different\n // name and templateitemname, if you're using one template to make\n // another template. templateitemname would be the name in the original\n // template, and name is the new \"subclassed\" item name.\n var out = {name: itemIn.name, _input: itemIn};\n var templateItemName = out[TEMPLATEITEMNAME] = itemIn[TEMPLATEITEMNAME];\n\n // no itemname: use the default template\n if(!validItemName(templateItemName)) {\n out._template = defaultsTemplate;\n return out;\n }\n\n // look for an item matching this itemname\n // note these do not inherit from the default template, only the item.\n for(var i = 0; i < templateItems.length; i++) {\n var templateItem = templateItems[i];\n if(templateItem.name === templateItemName) {\n // Note: it's OK to use a template item more than once\n // but using it at least once will stop it from generating\n // a default item at the end.\n usedNames[templateItemName] = 1;\n out._template = templateItem;\n return out;\n }\n }\n\n // Didn't find a matching template item, so since this item is intended\n // to only be modifications it's most likely broken. Hide it unless\n // it's explicitly marked visible - in which case it gets NO template,\n // not even the default.\n out[inclusionAttr] = itemIn[inclusionAttr] || false;\n // special falsy value we can look for in validateTemplate\n out._template = false;\n return out;\n }\n\n function defaultItems() {\n var out = [];\n for(var i = 0; i < templateItems.length; i++) {\n var templateItem = templateItems[i];\n var name = templateItem.name;\n // only allow named items to be added as defaults,\n // and only allow each name once\n if(validItemName(name) && !usedNames[name]) {\n var outi = {\n _template: templateItem,\n name: name,\n _input: {_templateitemname: name}\n };\n outi[TEMPLATEITEMNAME] = templateItem[TEMPLATEITEMNAME];\n out.push(outi);\n usedNames[name] = 1;\n }\n }\n return out;\n }\n\n return {\n newItem: newItem,\n defaultItems: defaultItems\n };\n};\n\nfunction validItemName(name) {\n return name && typeof name === 'string';\n}\n\nfunction arrayDefaultKey(name) {\n var lastChar = name.length - 1;\n if(name.charAt(lastChar) !== 's') {\n Lib.warn('bad argument to arrayDefaultKey: ' + name);\n }\n return name.substr(0, name.length - 1) + 'defaults';\n}\nexports.arrayDefaultKey = arrayDefaultKey;\n\n/**\n * arrayEditor: helper for editing array items that may have come from\n * template defaults (in which case they will not exist in the input yet)\n *\n * @param {object} parentIn: the input container (eg gd.layout)\n * @param {string} containerStr: the attribute string for the container inside\n * `parentIn`.\n * @param {object} itemOut: the _full* item (eg gd._fullLayout.annotations[0])\n * that we'll be editing. Assumed to have been created by `arrayTemplater`.\n *\n * @returns {object}: {modifyBase, modifyItem, getUpdateObj, applyUpdate}, all functions:\n * modifyBase(attr, value): Add an update that's *not* related to the item.\n * `attr` is the full attribute string.\n * modifyItem(attr, value): Add an update to the item. `attr` is just the\n * portion of the attribute string inside the item.\n * getUpdateObj(): Get the final constructed update object, to use in\n * `restyle` or `relayout`. Also resets the update object in case this\n * update was canceled.\n * applyUpdate(attr, value): optionally add an update `attr: value`,\n * then apply it to `parent` which should be the parent of `containerIn`,\n * ie the object to which `containerStr` is the attribute string.\n */\nexports.arrayEditor = function(parentIn, containerStr, itemOut) {\n var lengthIn = (Lib.nestedProperty(parentIn, containerStr).get() || []).length;\n var index = itemOut._index;\n // Check that we are indeed off the end of this container.\n // Otherwise a devious user could put a key `_templateitemname` in their\n // own input and break lots of things.\n var templateItemName = (index >= lengthIn) && (itemOut._input || {})._templateitemname;\n if(templateItemName) index = lengthIn;\n var itemStr = containerStr + '[' + index + ']';\n\n var update;\n function resetUpdate() {\n update = {};\n if(templateItemName) {\n update[itemStr] = {};\n update[itemStr][TEMPLATEITEMNAME] = templateItemName;\n }\n }\n resetUpdate();\n\n function modifyBase(attr, value) {\n update[attr] = value;\n }\n\n function modifyItem(attr, value) {\n if(templateItemName) {\n // we're making a new object: edit that object\n Lib.nestedProperty(update[itemStr], attr).set(value);\n } else {\n // we're editing an existing object: include *just* the edit\n update[itemStr + '.' + attr] = value;\n }\n }\n\n function getUpdateObj() {\n var updateOut = update;\n resetUpdate();\n return updateOut;\n }\n\n function applyUpdate(attr, value) {\n if(attr) modifyItem(attr, value);\n var updateToApply = getUpdateObj();\n for(var key in updateToApply) {\n Lib.nestedProperty(parentIn, key).set(updateToApply[key]);\n }\n }\n\n return {\n modifyBase: modifyBase,\n modifyItem: modifyItem,\n getUpdateObj: getUpdateObj,\n applyUpdate: applyUpdate\n };\n};\n\n},{\"../lib\":728,\"../plots/attributes\":773}],767:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Registry = _dereq_('../registry');\nvar Plots = _dereq_('../plots/plots');\n\nvar Lib = _dereq_('../lib');\nvar clearGlCanvases = _dereq_('../lib/clear_gl_canvases');\n\nvar Color = _dereq_('../components/color');\nvar Drawing = _dereq_('../components/drawing');\nvar Titles = _dereq_('../components/titles');\nvar ModeBar = _dereq_('../components/modebar');\n\nvar Axes = _dereq_('../plots/cartesian/axes');\nvar alignmentConstants = _dereq_('../constants/alignment');\nvar axisConstraints = _dereq_('../plots/cartesian/constraints');\nvar enforceAxisConstraints = axisConstraints.enforce;\nvar cleanAxisConstraints = axisConstraints.clean;\nvar doAutoRange = _dereq_('../plots/cartesian/autorange').doAutoRange;\n\nvar SVG_TEXT_ANCHOR_START = 'start';\nvar SVG_TEXT_ANCHOR_MIDDLE = 'middle';\nvar SVG_TEXT_ANCHOR_END = 'end';\n\nexports.layoutStyles = function(gd) {\n return Lib.syncOrAsync([Plots.doAutoMargin, lsInner], gd);\n};\n\nfunction overlappingDomain(xDomain, yDomain, domains) {\n for(var i = 0; i < domains.length; i++) {\n var existingX = domains[i][0];\n var existingY = domains[i][1];\n\n if(existingX[0] >= xDomain[1] || existingX[1] <= xDomain[0]) {\n continue;\n }\n if(existingY[0] < yDomain[1] && existingY[1] > yDomain[0]) {\n return true;\n }\n }\n return false;\n}\n\nfunction lsInner(gd) {\n var fullLayout = gd._fullLayout;\n var gs = fullLayout._size;\n var pad = gs.p;\n var axList = Axes.list(gd, '', true);\n var i, subplot, plotinfo, ax, xa, ya;\n\n fullLayout._paperdiv.style({\n width: (gd._context.responsive && fullLayout.autosize && !gd._context._hasZeroWidth && !gd.layout.width) ? '100%' : fullLayout.width + 'px',\n height: (gd._context.responsive && fullLayout.autosize && !gd._context._hasZeroHeight && !gd.layout.height) ? '100%' : fullLayout.height + 'px'\n })\n .selectAll('.main-svg')\n .call(Drawing.setSize, fullLayout.width, fullLayout.height);\n gd._context.setBackground(gd, fullLayout.paper_bgcolor);\n\n exports.drawMainTitle(gd);\n ModeBar.manage(gd);\n\n // _has('cartesian') means SVG specifically, not GL2D - but GL2D\n // can still get here because it makes some of the SVG structure\n // for shared features like selections.\n if(!fullLayout._has('cartesian')) {\n return Plots.previousPromises(gd);\n }\n\n function getLinePosition(ax, counterAx, side) {\n var lwHalf = ax._lw / 2;\n\n if(ax._id.charAt(0) === 'x') {\n if(!counterAx) return gs.t + gs.h * (1 - (ax.position || 0)) + (lwHalf % 1);\n else if(side === 'top') return counterAx._offset - pad - lwHalf;\n return counterAx._offset + counterAx._length + pad + lwHalf;\n }\n\n if(!counterAx) return gs.l + gs.w * (ax.position || 0) + (lwHalf % 1);\n else if(side === 'right') return counterAx._offset + counterAx._length + pad + lwHalf;\n return counterAx._offset - pad - lwHalf;\n }\n\n // some preparation of axis position info\n for(i = 0; i < axList.length; i++) {\n ax = axList[i];\n\n var counterAx = ax._anchorAxis;\n\n // clear axis line positions, to be set in the subplot loop below\n ax._linepositions = {};\n\n // stash crispRounded linewidth so we don't need to pass gd all over the place\n ax._lw = Drawing.crispRound(gd, ax.linewidth, 1);\n\n // figure out the main axis line and main mirror line position.\n // it's easier to follow the logic if we handle these separately from\n // ax._linepositions, which are only used by mirror=allticks\n // for non-main-subplot ticks, and mirror=all(ticks)? for zero line\n // hiding logic\n ax._mainLinePosition = getLinePosition(ax, counterAx, ax.side);\n ax._mainMirrorPosition = (ax.mirror && counterAx) ?\n getLinePosition(ax, counterAx,\n alignmentConstants.OPPOSITE_SIDE[ax.side]) : null;\n }\n\n // figure out which backgrounds we need to draw,\n // and in which layers to put them\n var lowerBackgroundIDs = [];\n var backgroundIds = [];\n var lowerDomains = [];\n // no need to draw background when paper and plot color are the same color,\n // activate mode just for large splom (which benefit the most from this\n // optimization), but this could apply to all cartesian subplots.\n var noNeedForBg = (\n Color.opacity(fullLayout.paper_bgcolor) === 1 &&\n Color.opacity(fullLayout.plot_bgcolor) === 1 &&\n fullLayout.paper_bgcolor === fullLayout.plot_bgcolor\n );\n\n for(subplot in fullLayout._plots) {\n plotinfo = fullLayout._plots[subplot];\n\n if(plotinfo.mainplot) {\n // mainplot is a reference to the main plot this one is overlaid on\n // so if it exists, this is an overlaid plot and we don't need to\n // give it its own background\n if(plotinfo.bg) {\n plotinfo.bg.remove();\n }\n plotinfo.bg = undefined;\n } else {\n var xDomain = plotinfo.xaxis.domain;\n var yDomain = plotinfo.yaxis.domain;\n var plotgroup = plotinfo.plotgroup;\n\n if(overlappingDomain(xDomain, yDomain, lowerDomains)) {\n var pgNode = plotgroup.node();\n var plotgroupBg = plotinfo.bg = Lib.ensureSingle(plotgroup, 'rect', 'bg');\n pgNode.insertBefore(plotgroupBg.node(), pgNode.childNodes[0]);\n backgroundIds.push(subplot);\n } else {\n plotgroup.select('rect.bg').remove();\n lowerDomains.push([xDomain, yDomain]);\n if(!noNeedForBg) {\n lowerBackgroundIDs.push(subplot);\n backgroundIds.push(subplot);\n }\n }\n }\n }\n\n // now create all the lower-layer backgrounds at once now that\n // we have the list of subplots that need them\n var lowerBackgrounds = fullLayout._bgLayer.selectAll('.bg')\n .data(lowerBackgroundIDs);\n\n lowerBackgrounds.enter().append('rect')\n .classed('bg', true);\n\n lowerBackgrounds.exit().remove();\n\n lowerBackgrounds.each(function(subplot) {\n fullLayout._plots[subplot].bg = d3.select(this);\n });\n\n // style all backgrounds\n for(i = 0; i < backgroundIds.length; i++) {\n plotinfo = fullLayout._plots[backgroundIds[i]];\n xa = plotinfo.xaxis;\n ya = plotinfo.yaxis;\n\n if(plotinfo.bg) {\n plotinfo.bg\n .call(Drawing.setRect,\n xa._offset - pad, ya._offset - pad,\n xa._length + 2 * pad, ya._length + 2 * pad)\n .call(Color.fill, fullLayout.plot_bgcolor)\n .style('stroke-width', 0);\n }\n }\n\n if(!fullLayout._hasOnlyLargeSploms) {\n for(subplot in fullLayout._plots) {\n plotinfo = fullLayout._plots[subplot];\n xa = plotinfo.xaxis;\n ya = plotinfo.yaxis;\n\n // Clip so that data only shows up on the plot area.\n var clipId = plotinfo.clipId = 'clip' + fullLayout._uid + subplot + 'plot';\n\n var plotClip = Lib.ensureSingleById(fullLayout._clips, 'clipPath', clipId, function(s) {\n s.classed('plotclip', true)\n .append('rect');\n });\n\n plotinfo.clipRect = plotClip.select('rect').attr({\n width: xa._length,\n height: ya._length\n });\n\n Drawing.setTranslate(plotinfo.plot, xa._offset, ya._offset);\n\n var plotClipId;\n var layerClipId;\n\n if(plotinfo._hasClipOnAxisFalse) {\n plotClipId = null;\n layerClipId = clipId;\n } else {\n plotClipId = clipId;\n layerClipId = null;\n }\n\n Drawing.setClipUrl(plotinfo.plot, plotClipId, gd);\n\n // stash layer clipId value (null or same as clipId)\n // to DRY up Drawing.setClipUrl calls on trace-module and trace layers\n // downstream\n plotinfo.layerClipId = layerClipId;\n }\n }\n\n var xLinesXLeft, xLinesXRight, xLinesYBottom, xLinesYTop,\n leftYLineWidth, rightYLineWidth;\n var yLinesYBottom, yLinesYTop, yLinesXLeft, yLinesXRight,\n connectYBottom, connectYTop;\n var extraSubplot;\n\n function xLinePath(y) {\n return 'M' + xLinesXLeft + ',' + y + 'H' + xLinesXRight;\n }\n\n function xLinePathFree(y) {\n return 'M' + xa._offset + ',' + y + 'h' + xa._length;\n }\n\n function yLinePath(x) {\n return 'M' + x + ',' + yLinesYTop + 'V' + yLinesYBottom;\n }\n\n function yLinePathFree(x) {\n return 'M' + x + ',' + ya._offset + 'v' + ya._length;\n }\n\n function mainPath(ax, pathFn, pathFnFree) {\n if(!ax.showline || subplot !== ax._mainSubplot) return '';\n if(!ax._anchorAxis) return pathFnFree(ax._mainLinePosition);\n var out = pathFn(ax._mainLinePosition);\n if(ax.mirror) out += pathFn(ax._mainMirrorPosition);\n return out;\n }\n\n for(subplot in fullLayout._plots) {\n plotinfo = fullLayout._plots[subplot];\n xa = plotinfo.xaxis;\n ya = plotinfo.yaxis;\n\n /*\n * x lines get longer where they meet y lines, to make a crisp corner.\n * The x lines get the padding (margin.pad) plus the y line width to\n * fill up the corner nicely. Free x lines are excluded - they always\n * span exactly the data area of the plot\n *\n * | XXXXX\n * | XXXXX\n * |\n * +------\n * x1\n * -----\n * x2\n */\n var xPath = 'M0,0';\n if(shouldShowLinesOrTicks(xa, subplot)) {\n leftYLineWidth = findCounterAxisLineWidth(xa, 'left', ya, axList);\n xLinesXLeft = xa._offset - (leftYLineWidth ? (pad + leftYLineWidth) : 0);\n rightYLineWidth = findCounterAxisLineWidth(xa, 'right', ya, axList);\n xLinesXRight = xa._offset + xa._length + (rightYLineWidth ? (pad + rightYLineWidth) : 0);\n xLinesYBottom = getLinePosition(xa, ya, 'bottom');\n xLinesYTop = getLinePosition(xa, ya, 'top');\n\n // save axis line positions for extra ticks to reference\n // each subplot that gets ticks from \"allticks\" gets an entry:\n // [left or bottom, right or top]\n extraSubplot = (!xa._anchorAxis || subplot !== xa._mainSubplot);\n if(extraSubplot && (xa.mirror === 'allticks' || xa.mirror === 'all')) {\n xa._linepositions[subplot] = [xLinesYBottom, xLinesYTop];\n }\n\n xPath = mainPath(xa, xLinePath, xLinePathFree);\n if(extraSubplot && xa.showline && (xa.mirror === 'all' || xa.mirror === 'allticks')) {\n xPath += xLinePath(xLinesYBottom) + xLinePath(xLinesYTop);\n }\n\n plotinfo.xlines\n .style('stroke-width', xa._lw + 'px')\n .call(Color.stroke, xa.showline ?\n xa.linecolor : 'rgba(0,0,0,0)');\n }\n plotinfo.xlines.attr('d', xPath);\n\n /*\n * y lines that meet x axes get longer only by margin.pad, because\n * the x axes fill in the corner space. Free y axes, like free x axes,\n * always span exactly the data area of the plot\n *\n * | | XXXX\n * y2| y1| XXXX\n * | | XXXX\n * |\n * +-----\n */\n var yPath = 'M0,0';\n if(shouldShowLinesOrTicks(ya, subplot)) {\n connectYBottom = findCounterAxisLineWidth(ya, 'bottom', xa, axList);\n yLinesYBottom = ya._offset + ya._length + (connectYBottom ? pad : 0);\n connectYTop = findCounterAxisLineWidth(ya, 'top', xa, axList);\n yLinesYTop = ya._offset - (connectYTop ? pad : 0);\n yLinesXLeft = getLinePosition(ya, xa, 'left');\n yLinesXRight = getLinePosition(ya, xa, 'right');\n\n extraSubplot = (!ya._anchorAxis || subplot !== ya._mainSubplot);\n if(extraSubplot && (ya.mirror === 'allticks' || ya.mirror === 'all')) {\n ya._linepositions[subplot] = [yLinesXLeft, yLinesXRight];\n }\n\n yPath = mainPath(ya, yLinePath, yLinePathFree);\n if(extraSubplot && ya.showline && (ya.mirror === 'all' || ya.mirror === 'allticks')) {\n yPath += yLinePath(yLinesXLeft) + yLinePath(yLinesXRight);\n }\n\n plotinfo.ylines\n .style('stroke-width', ya._lw + 'px')\n .call(Color.stroke, ya.showline ?\n ya.linecolor : 'rgba(0,0,0,0)');\n }\n plotinfo.ylines.attr('d', yPath);\n }\n\n Axes.makeClipPaths(gd);\n\n return Plots.previousPromises(gd);\n}\n\nfunction shouldShowLinesOrTicks(ax, subplot) {\n return (ax.ticks || ax.showline) &&\n (subplot === ax._mainSubplot || ax.mirror === 'all' || ax.mirror === 'allticks');\n}\n\n/*\n * should we draw a line on counterAx at this side of ax?\n * It's assumed that counterAx is known to overlay the subplot we're working on\n * but it may not be its main axis.\n */\nfunction shouldShowLineThisSide(ax, side, counterAx) {\n // does counterAx get a line at all?\n if(!counterAx.showline || !counterAx._lw) return false;\n\n // are we drawing *all* lines for counterAx?\n if(counterAx.mirror === 'all' || counterAx.mirror === 'allticks') return true;\n\n var anchorAx = counterAx._anchorAxis;\n\n // is this a free axis? free axes can only have a subplot side-line with all(ticks)? mirroring\n if(!anchorAx) return false;\n\n // in order to handle cases where the user forgot to anchor this axis correctly\n // (because its default anchor has the same domain on the relevant end)\n // check whether the relevant position is the same.\n var sideIndex = alignmentConstants.FROM_BL[side];\n if(counterAx.side === side) {\n return anchorAx.domain[sideIndex] === ax.domain[sideIndex];\n }\n return counterAx.mirror && anchorAx.domain[1 - sideIndex] === ax.domain[1 - sideIndex];\n}\n\n/*\n * Is there another axis intersecting `side` end of `ax`?\n * First look at `counterAx` (the axis for this subplot),\n * then at all other potential counteraxes on or overlaying this subplot.\n * Take the line width from the first one that has a line.\n */\nfunction findCounterAxisLineWidth(ax, side, counterAx, axList) {\n if(shouldShowLineThisSide(ax, side, counterAx)) {\n return counterAx._lw;\n }\n for(var i = 0; i < axList.length; i++) {\n var axi = axList[i];\n if(axi._mainAxis === counterAx._mainAxis && shouldShowLineThisSide(ax, side, axi)) {\n return axi._lw;\n }\n }\n return 0;\n}\n\nexports.drawMainTitle = function(gd) {\n var fullLayout = gd._fullLayout;\n\n var textAnchor = getMainTitleTextAnchor(fullLayout);\n var dy = getMainTitleDy(fullLayout);\n\n Titles.draw(gd, 'gtitle', {\n propContainer: fullLayout,\n propName: 'title.text',\n placeholder: fullLayout._dfltTitle.plot,\n attributes: {\n x: getMainTitleX(fullLayout, textAnchor),\n y: getMainTitleY(fullLayout, dy),\n 'text-anchor': textAnchor,\n dy: dy\n }\n });\n};\n\nfunction getMainTitleX(fullLayout, textAnchor) {\n var title = fullLayout.title;\n var gs = fullLayout._size;\n var hPadShift = 0;\n\n if(textAnchor === SVG_TEXT_ANCHOR_START) {\n hPadShift = title.pad.l;\n } else if(textAnchor === SVG_TEXT_ANCHOR_END) {\n hPadShift = -title.pad.r;\n }\n\n switch(title.xref) {\n case 'paper':\n return gs.l + gs.w * title.x + hPadShift;\n case 'container':\n default:\n return fullLayout.width * title.x + hPadShift;\n }\n}\n\nfunction getMainTitleY(fullLayout, dy) {\n var title = fullLayout.title;\n var gs = fullLayout._size;\n var vPadShift = 0;\n\n if(dy === '0em' || !dy) {\n vPadShift = -title.pad.b;\n } else if(dy === alignmentConstants.CAP_SHIFT + 'em') {\n vPadShift = title.pad.t;\n }\n\n if(title.y === 'auto') {\n return gs.t / 2;\n } else {\n switch(title.yref) {\n case 'paper':\n return gs.t + gs.h - gs.h * title.y + vPadShift;\n case 'container':\n default:\n return fullLayout.height - fullLayout.height * title.y + vPadShift;\n }\n }\n}\n\nfunction getMainTitleTextAnchor(fullLayout) {\n var title = fullLayout.title;\n\n var textAnchor = SVG_TEXT_ANCHOR_MIDDLE;\n if(Lib.isRightAnchor(title)) {\n textAnchor = SVG_TEXT_ANCHOR_END;\n } else if(Lib.isLeftAnchor(title)) {\n textAnchor = SVG_TEXT_ANCHOR_START;\n }\n\n return textAnchor;\n}\n\nfunction getMainTitleDy(fullLayout) {\n var title = fullLayout.title;\n\n var dy = '0em';\n if(Lib.isTopAnchor(title)) {\n dy = alignmentConstants.CAP_SHIFT + 'em';\n } else if(Lib.isMiddleAnchor(title)) {\n dy = alignmentConstants.MID_SHIFT + 'em';\n }\n\n return dy;\n}\n\nexports.doTraceStyle = function(gd) {\n var calcdata = gd.calcdata;\n var editStyleCalls = [];\n var i;\n\n for(i = 0; i < calcdata.length; i++) {\n var cd = calcdata[i];\n var cd0 = cd[0] || {};\n var trace = cd0.trace || {};\n var _module = trace._module || {};\n\n // See if we need to do arraysToCalcdata\n // call it regardless of what change we made, in case\n // supplyDefaults brought in an array that was already\n // in gd.data but not in gd._fullData previously\n var arraysToCalcdata = _module.arraysToCalcdata;\n if(arraysToCalcdata) arraysToCalcdata(cd, trace);\n\n var editStyle = _module.editStyle;\n if(editStyle) editStyleCalls.push({fn: editStyle, cd0: cd0});\n }\n\n if(editStyleCalls.length) {\n for(i = 0; i < editStyleCalls.length; i++) {\n var edit = editStyleCalls[i];\n edit.fn(gd, edit.cd0);\n }\n clearGlCanvases(gd);\n exports.redrawReglTraces(gd);\n }\n\n Plots.style(gd);\n Registry.getComponentMethod('legend', 'draw')(gd);\n\n return Plots.previousPromises(gd);\n};\n\nexports.doColorBars = function(gd) {\n Registry.getComponentMethod('colorbar', 'draw')(gd);\n return Plots.previousPromises(gd);\n};\n\n// force plot() to redo the layout and replot with the modified layout\nexports.layoutReplot = function(gd) {\n var layout = gd.layout;\n gd.layout = undefined;\n return Registry.call('plot', gd, '', layout);\n};\n\nexports.doLegend = function(gd) {\n Registry.getComponentMethod('legend', 'draw')(gd);\n return Plots.previousPromises(gd);\n};\n\nexports.doTicksRelayout = function(gd) {\n Axes.draw(gd, 'redraw');\n\n if(gd._fullLayout._hasOnlyLargeSploms) {\n Registry.subplotsRegistry.splom.updateGrid(gd);\n clearGlCanvases(gd);\n exports.redrawReglTraces(gd);\n }\n\n exports.drawMainTitle(gd);\n return Plots.previousPromises(gd);\n};\n\nexports.doModeBar = function(gd) {\n var fullLayout = gd._fullLayout;\n\n ModeBar.manage(gd);\n\n for(var i = 0; i < fullLayout._basePlotModules.length; i++) {\n var updateFx = fullLayout._basePlotModules[i].updateFx;\n if(updateFx) updateFx(gd);\n }\n\n return Plots.previousPromises(gd);\n};\n\nexports.doCamera = function(gd) {\n var fullLayout = gd._fullLayout;\n var sceneIds = fullLayout._subplots.gl3d;\n\n for(var i = 0; i < sceneIds.length; i++) {\n var sceneLayout = fullLayout[sceneIds[i]];\n var scene = sceneLayout._scene;\n\n scene.setViewport(sceneLayout);\n }\n};\n\nexports.drawData = function(gd) {\n var fullLayout = gd._fullLayout;\n\n clearGlCanvases(gd);\n\n // loop over the base plot modules present on graph\n var basePlotModules = fullLayout._basePlotModules;\n for(var i = 0; i < basePlotModules.length; i++) {\n basePlotModules[i].plot(gd);\n }\n\n exports.redrawReglTraces(gd);\n\n // styling separate from drawing\n Plots.style(gd);\n\n // draw components that can be drawn on axes,\n // and that do not push the margins\n Registry.getComponentMethod('shapes', 'draw')(gd);\n Registry.getComponentMethod('annotations', 'draw')(gd);\n Registry.getComponentMethod('images', 'draw')(gd);\n\n // Mark the first render as complete\n fullLayout._replotting = false;\n\n return Plots.previousPromises(gd);\n};\n\n// Draw (or redraw) all regl-based traces in one go,\n// useful during drag and selection where buffers of targeted traces are updated,\n// but all traces need to be redrawn following clearGlCanvases.\n//\n// Note that _module.plot for regl trace does NOT draw things\n// on the canvas, they only update the buffers.\n// Drawing is perform here.\n//\n// TODO try adding per-subplot option using gl.SCISSOR_TEST for\n// non-overlaying, disjoint subplots.\n//\n// TODO try to include parcoords in here.\n// https://github.com/plotly/plotly.js/issues/3069\nexports.redrawReglTraces = function(gd) {\n var fullLayout = gd._fullLayout;\n\n if(fullLayout._has('regl')) {\n var fullData = gd._fullData;\n var cartesianIds = [];\n var polarIds = [];\n var i, sp;\n\n if(fullLayout._hasOnlyLargeSploms) {\n fullLayout._splomGrid.draw();\n }\n\n // N.B.\n // - Loop over fullData (not _splomScenes) to preserve splom trace-to-trace ordering\n // - Fill list if subplot ids (instead of fullLayout._subplots) to handle cases where all traces\n // of a given module are `visible !== true`\n for(i = 0; i < fullData.length; i++) {\n var trace = fullData[i];\n\n if(trace.visible === true && trace._length !== 0) {\n if(trace.type === 'splom') {\n fullLayout._splomScenes[trace.uid].draw();\n } else if(trace.type === 'scattergl') {\n Lib.pushUnique(cartesianIds, trace.xaxis + trace.yaxis);\n } else if(trace.type === 'scatterpolargl') {\n Lib.pushUnique(polarIds, trace.subplot);\n }\n }\n }\n\n for(i = 0; i < cartesianIds.length; i++) {\n sp = fullLayout._plots[cartesianIds[i]];\n if(sp._scene) sp._scene.draw();\n }\n\n for(i = 0; i < polarIds.length; i++) {\n sp = fullLayout[polarIds[i]]._subplot;\n if(sp._scene) sp._scene.draw();\n }\n }\n};\n\nexports.doAutoRangeAndConstraints = function(gd) {\n var fullLayout = gd._fullLayout;\n var axList = Axes.list(gd, '', true);\n var matchGroups = fullLayout._axisMatchGroups || [];\n var axLookup = {};\n var ax;\n var axRng;\n\n for(var i = 0; i < axList.length; i++) {\n ax = axList[i];\n cleanAxisConstraints(gd, ax);\n doAutoRange(gd, ax);\n axLookup[ax._id] = 1;\n }\n\n enforceAxisConstraints(gd);\n\n groupLoop:\n for(var j = 0; j < matchGroups.length; j++) {\n var group = matchGroups[j];\n var rng = null;\n var id;\n\n for(id in group) {\n ax = Axes.getFromId(gd, id);\n\n // skip over 'missing' axes which do not pass through doAutoRange\n if(!axLookup[ax._id]) continue;\n // if one axis has autorange false, we're done\n if(ax.autorange === false) continue groupLoop;\n\n axRng = Lib.simpleMap(ax.range, ax.r2l);\n if(rng) {\n if(rng[0] < rng[1]) {\n rng[0] = Math.min(rng[0], axRng[0]);\n rng[1] = Math.max(rng[1], axRng[1]);\n } else {\n rng[0] = Math.max(rng[0], axRng[0]);\n rng[1] = Math.min(rng[1], axRng[1]);\n }\n } else {\n rng = axRng;\n }\n }\n\n for(id in group) {\n ax = Axes.getFromId(gd, id);\n ax.range = Lib.simpleMap(rng, ax.l2r);\n ax._input.range = ax.range.slice();\n ax.setScale();\n }\n }\n};\n\n// An initial paint must be completed before these components can be\n// correctly sized and the whole plot re-margined. fullLayout._replotting must\n// be set to false before these will work properly.\nexports.finalDraw = function(gd) {\n // TODO: rangesliders really belong in marginPushers but they need to be\n // drawn after data - can we at least get the margin pushing part separated\n // out and done earlier?\n Registry.getComponentMethod('rangeslider', 'draw')(gd);\n // TODO: rangeselector only needs to be here (in addition to drawMarginPushers)\n // because the margins need to be fully determined before we can call\n // autorange and update axis ranges (which rangeselector needs to know which\n // button is active). Can we break out its automargin step from its draw step?\n Registry.getComponentMethod('rangeselector', 'draw')(gd);\n};\n\nexports.drawMarginPushers = function(gd) {\n Registry.getComponentMethod('legend', 'draw')(gd);\n Registry.getComponentMethod('rangeselector', 'draw')(gd);\n Registry.getComponentMethod('sliders', 'draw')(gd);\n Registry.getComponentMethod('updatemenus', 'draw')(gd);\n Registry.getComponentMethod('colorbar', 'draw')(gd);\n};\n\n},{\"../components/color\":595,\"../components/drawing\":617,\"../components/modebar\":655,\"../components/titles\":690,\"../constants/alignment\":697,\"../lib\":728,\"../lib/clear_gl_canvases\":713,\"../plots/cartesian/autorange\":775,\"../plots/cartesian/axes\":776,\"../plots/cartesian/constraints\":783,\"../plots/plots\":839,\"../registry\":859,\"d3\":164}],768:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../lib');\nvar isPlainObject = Lib.isPlainObject;\nvar PlotSchema = _dereq_('./plot_schema');\nvar Plots = _dereq_('../plots/plots');\nvar plotAttributes = _dereq_('../plots/attributes');\nvar Template = _dereq_('./plot_template');\nvar dfltConfig = _dereq_('./plot_config').dfltConfig;\n\n/**\n * Plotly.makeTemplate: create a template off an existing figure to reuse\n * style attributes on other figures.\n *\n * Note: separated from the rest of templates because otherwise we get circular\n * references due to PlotSchema.\n *\n * @param {object|DOM element|string} figure: The figure to base the template on\n * should contain a trace array `figure.data`\n * and a layout object `figure.layout`\n * @returns {object} template: the extracted template - can then be used as\n * `layout.template` in another figure.\n */\nexports.makeTemplate = function(figure) {\n figure = Lib.isPlainObject(figure) ? figure : Lib.getGraphDiv(figure);\n figure = Lib.extendDeep({_context: dfltConfig}, {data: figure.data, layout: figure.layout});\n Plots.supplyDefaults(figure);\n var data = figure.data || [];\n var layout = figure.layout || {};\n // copy over a few items to help follow the schema\n layout._basePlotModules = figure._fullLayout._basePlotModules;\n layout._modules = figure._fullLayout._modules;\n\n var template = {\n data: {},\n layout: {}\n };\n\n /*\n * Note: we do NOT validate template values, we just take what's in the\n * user inputs data and layout, not the validated values in fullData and\n * fullLayout. Even if we were to validate here, there's no guarantee that\n * these values would still be valid when applied to a new figure, which\n * may contain different trace modes, different axes, etc. So it's\n * important that when applying a template we still validate the template\n * values, rather than just using them as defaults.\n */\n\n data.forEach(function(trace) {\n // TODO: What if no style info is extracted for this trace. We may\n // not want an empty object as the null value.\n // TODO: allow transforms to contribute to templates?\n // as it stands they are ignored, which may be for the best...\n\n var traceTemplate = {};\n walkStyleKeys(trace, traceTemplate, getTraceInfo.bind(null, trace));\n\n var traceType = Lib.coerce(trace, {}, plotAttributes, 'type');\n var typeTemplates = template.data[traceType];\n if(!typeTemplates) typeTemplates = template.data[traceType] = [];\n typeTemplates.push(traceTemplate);\n });\n\n walkStyleKeys(layout, template.layout, getLayoutInfo.bind(null, layout));\n\n /*\n * Compose the new template with an existing one to the same effect\n *\n * NOTE: there's a possibility of slightly different behavior: if the plot\n * has an invalid value and the old template has a valid value for the same\n * attribute, the plot will use the old template value but this routine\n * will pull the invalid value (resulting in the original default).\n * In the general case it's not possible to solve this with a single value,\n * since valid options can be context-dependent. It could be solved with\n * a *list* of values, but that would be huge complexity for little gain.\n */\n delete template.layout.template;\n var oldTemplate = layout.template;\n if(isPlainObject(oldTemplate)) {\n var oldLayoutTemplate = oldTemplate.layout;\n\n var i, traceType, oldTypeTemplates, oldTypeLen, typeTemplates, typeLen;\n\n if(isPlainObject(oldLayoutTemplate)) {\n mergeTemplates(oldLayoutTemplate, template.layout);\n }\n var oldDataTemplate = oldTemplate.data;\n if(isPlainObject(oldDataTemplate)) {\n for(traceType in template.data) {\n oldTypeTemplates = oldDataTemplate[traceType];\n if(Array.isArray(oldTypeTemplates)) {\n typeTemplates = template.data[traceType];\n typeLen = typeTemplates.length;\n oldTypeLen = oldTypeTemplates.length;\n for(i = 0; i < typeLen; i++) {\n mergeTemplates(oldTypeTemplates[i % oldTypeLen], typeTemplates[i]);\n }\n for(i = typeLen; i < oldTypeLen; i++) {\n typeTemplates.push(Lib.extendDeep({}, oldTypeTemplates[i]));\n }\n }\n }\n for(traceType in oldDataTemplate) {\n if(!(traceType in template.data)) {\n template.data[traceType] = Lib.extendDeep([], oldDataTemplate[traceType]);\n }\n }\n }\n }\n\n return template;\n};\n\nfunction mergeTemplates(oldTemplate, newTemplate) {\n // we don't care about speed here, just make sure we have a totally\n // distinct object from the previous template\n oldTemplate = Lib.extendDeep({}, oldTemplate);\n\n // sort keys so we always get annotationdefaults before annotations etc\n // so arrayTemplater will work right\n var oldKeys = Object.keys(oldTemplate).sort();\n var i, j;\n\n function mergeOne(oldVal, newVal, key) {\n if(isPlainObject(newVal) && isPlainObject(oldVal)) {\n mergeTemplates(oldVal, newVal);\n } else if(Array.isArray(newVal) && Array.isArray(oldVal)) {\n // Note: omitted `inclusionAttr` from arrayTemplater here,\n // it's irrelevant as we only want the resulting `_template`.\n var templater = Template.arrayTemplater({_template: oldTemplate}, key);\n for(j = 0; j < newVal.length; j++) {\n var item = newVal[j];\n var oldItem = templater.newItem(item)._template;\n if(oldItem) mergeTemplates(oldItem, item);\n }\n var defaultItems = templater.defaultItems();\n for(j = 0; j < defaultItems.length; j++) newVal.push(defaultItems[j]._template);\n\n // templateitemname only applies to receiving plots\n for(j = 0; j < newVal.length; j++) delete newVal[j].templateitemname;\n }\n }\n\n for(i = 0; i < oldKeys.length; i++) {\n var key = oldKeys[i];\n var oldVal = oldTemplate[key];\n if(key in newTemplate) {\n mergeOne(oldVal, newTemplate[key], key);\n } else newTemplate[key] = oldVal;\n\n // if this is a base key from the old template (eg xaxis), look for\n // extended keys (eg xaxis2) in the new template to merge into\n if(getBaseKey(key) === key) {\n for(var key2 in newTemplate) {\n var baseKey2 = getBaseKey(key2);\n if(key2 !== baseKey2 && baseKey2 === key && !(key2 in oldTemplate)) {\n mergeOne(oldVal, newTemplate[key2], key);\n }\n }\n }\n }\n}\n\nfunction getBaseKey(key) {\n return key.replace(/[0-9]+$/, '');\n}\n\nfunction walkStyleKeys(parent, templateOut, getAttributeInfo, path, basePath) {\n var pathAttr = basePath && getAttributeInfo(basePath);\n for(var key in parent) {\n var child = parent[key];\n var nextPath = getNextPath(parent, key, path);\n var nextBasePath = getNextPath(parent, key, basePath);\n var attr = getAttributeInfo(nextBasePath);\n if(!attr) {\n var baseKey = getBaseKey(key);\n if(baseKey !== key) {\n nextBasePath = getNextPath(parent, baseKey, basePath);\n attr = getAttributeInfo(nextBasePath);\n }\n }\n\n // we'll get an attr if path starts with a valid part, then has an\n // invalid ending. Make sure we got all the way to the end.\n if(pathAttr && (pathAttr === attr)) continue;\n\n if(!attr || attr._noTemplating ||\n attr.valType === 'data_array' ||\n (attr.arrayOk && Array.isArray(child))\n ) {\n continue;\n }\n\n if(!attr.valType && isPlainObject(child)) {\n walkStyleKeys(child, templateOut, getAttributeInfo, nextPath, nextBasePath);\n } else if(attr._isLinkedToArray && Array.isArray(child)) {\n var dfltDone = false;\n var namedIndex = 0;\n var usedNames = {};\n for(var i = 0; i < child.length; i++) {\n var item = child[i];\n if(isPlainObject(item)) {\n var name = item.name;\n if(name) {\n if(!usedNames[name]) {\n // named array items: allow all attributes except data arrays\n walkStyleKeys(item, templateOut, getAttributeInfo,\n getNextPath(child, namedIndex, nextPath),\n getNextPath(child, namedIndex, nextBasePath));\n namedIndex++;\n usedNames[name] = 1;\n }\n } else if(!dfltDone) {\n var dfltKey = Template.arrayDefaultKey(key);\n var dfltPath = getNextPath(parent, dfltKey, path);\n\n // getAttributeInfo will fail if we try to use dfltKey directly.\n // Instead put this item into the next array element, then\n // pull it out and move it to dfltKey.\n var pathInArray = getNextPath(child, namedIndex, nextPath);\n walkStyleKeys(item, templateOut, getAttributeInfo, pathInArray,\n getNextPath(child, namedIndex, nextBasePath));\n var itemPropInArray = Lib.nestedProperty(templateOut, pathInArray);\n var dfltProp = Lib.nestedProperty(templateOut, dfltPath);\n dfltProp.set(itemPropInArray.get());\n itemPropInArray.set(null);\n\n dfltDone = true;\n }\n }\n }\n } else {\n var templateProp = Lib.nestedProperty(templateOut, nextPath);\n templateProp.set(child);\n }\n }\n}\n\nfunction getLayoutInfo(layout, path) {\n return PlotSchema.getLayoutValObject(\n layout, Lib.nestedProperty({}, path).parts\n );\n}\n\nfunction getTraceInfo(trace, path) {\n return PlotSchema.getTraceValObject(\n trace, Lib.nestedProperty({}, path).parts\n );\n}\n\nfunction getNextPath(parent, key, path) {\n var nextPath;\n if(!path) nextPath = key;\n else if(Array.isArray(parent)) nextPath = path + '[' + key + ']';\n else nextPath = path + '.' + key;\n\n return nextPath;\n}\n\n/**\n * validateTemplate: Test for consistency between the given figure and\n * a template, either already included in the figure or given separately.\n * Note that not every issue we identify here is necessarily a problem,\n * it depends on what you're using the template for.\n *\n * @param {object|DOM element} figure: the plot, with {data, layout} members,\n * to test the template against\n * @param {Optional(object)} template: the template, with its own {data, layout},\n * to test. If omitted, we will look for a template already attached as the\n * plot's `layout.template` attribute.\n *\n * @returns {array} array of error objects each containing:\n * - {string} code\n * error code ('missing', 'unused', 'reused', 'noLayout', 'noData')\n * - {string} msg\n * a full readable description of the issue.\n */\nexports.validateTemplate = function(figureIn, template) {\n var figure = Lib.extendDeep({}, {\n _context: dfltConfig,\n data: figureIn.data,\n layout: figureIn.layout\n });\n var layout = figure.layout || {};\n if(!isPlainObject(template)) template = layout.template || {};\n var layoutTemplate = template.layout;\n var dataTemplate = template.data;\n var errorList = [];\n\n figure.layout = layout;\n figure.layout.template = template;\n Plots.supplyDefaults(figure);\n\n var fullLayout = figure._fullLayout;\n var fullData = figure._fullData;\n\n var layoutPaths = {};\n function crawlLayoutForContainers(obj, paths) {\n for(var key in obj) {\n if(key.charAt(0) !== '_' && isPlainObject(obj[key])) {\n var baseKey = getBaseKey(key);\n var nextPaths = [];\n var i;\n for(i = 0; i < paths.length; i++) {\n nextPaths.push(getNextPath(obj, key, paths[i]));\n if(baseKey !== key) nextPaths.push(getNextPath(obj, baseKey, paths[i]));\n }\n for(i = 0; i < nextPaths.length; i++) {\n layoutPaths[nextPaths[i]] = 1;\n }\n crawlLayoutForContainers(obj[key], nextPaths);\n }\n }\n }\n\n function crawlLayoutTemplateForContainers(obj, path) {\n for(var key in obj) {\n if(key.indexOf('defaults') === -1 && isPlainObject(obj[key])) {\n var nextPath = getNextPath(obj, key, path);\n if(layoutPaths[nextPath]) {\n crawlLayoutTemplateForContainers(obj[key], nextPath);\n } else {\n errorList.push({code: 'unused', path: nextPath});\n }\n }\n }\n }\n\n if(!isPlainObject(layoutTemplate)) {\n errorList.push({code: 'layout'});\n } else {\n crawlLayoutForContainers(fullLayout, ['layout']);\n crawlLayoutTemplateForContainers(layoutTemplate, 'layout');\n }\n\n if(!isPlainObject(dataTemplate)) {\n errorList.push({code: 'data'});\n } else {\n var typeCount = {};\n var traceType;\n for(var i = 0; i < fullData.length; i++) {\n var fullTrace = fullData[i];\n traceType = fullTrace.type;\n typeCount[traceType] = (typeCount[traceType] || 0) + 1;\n if(!fullTrace._fullInput._template) {\n // this takes care of the case of traceType in the data but not\n // the template\n errorList.push({\n code: 'missing',\n index: fullTrace._fullInput.index,\n traceType: traceType\n });\n }\n }\n for(traceType in dataTemplate) {\n var templateCount = dataTemplate[traceType].length;\n var dataCount = typeCount[traceType] || 0;\n if(templateCount > dataCount) {\n errorList.push({\n code: 'unused',\n traceType: traceType,\n templateCount: templateCount,\n dataCount: dataCount\n });\n } else if(dataCount > templateCount) {\n errorList.push({\n code: 'reused',\n traceType: traceType,\n templateCount: templateCount,\n dataCount: dataCount\n });\n }\n }\n }\n\n // _template: false is when someone tried to modify an array item\n // but there was no template with matching name\n function crawlForMissingTemplates(obj, path) {\n for(var key in obj) {\n if(key.charAt(0) === '_') continue;\n var val = obj[key];\n var nextPath = getNextPath(obj, key, path);\n if(isPlainObject(val)) {\n if(Array.isArray(obj) && val._template === false && val.templateitemname) {\n errorList.push({\n code: 'missing',\n path: nextPath,\n templateitemname: val.templateitemname\n });\n }\n crawlForMissingTemplates(val, nextPath);\n } else if(Array.isArray(val) && hasPlainObject(val)) {\n crawlForMissingTemplates(val, nextPath);\n }\n }\n }\n crawlForMissingTemplates({data: fullData, layout: fullLayout}, '');\n\n if(errorList.length) return errorList.map(format);\n};\n\nfunction hasPlainObject(arr) {\n for(var i = 0; i < arr.length; i++) {\n if(isPlainObject(arr[i])) return true;\n }\n}\n\nfunction format(opts) {\n var msg;\n switch(opts.code) {\n case 'data':\n msg = 'The template has no key data.';\n break;\n case 'layout':\n msg = 'The template has no key layout.';\n break;\n case 'missing':\n if(opts.path) {\n msg = 'There are no templates for item ' + opts.path +\n ' with name ' + opts.templateitemname;\n } else {\n msg = 'There are no templates for trace ' + opts.index +\n ', of type ' + opts.traceType + '.';\n }\n break;\n case 'unused':\n if(opts.path) {\n msg = 'The template item at ' + opts.path +\n ' was not used in constructing the plot.';\n } else if(opts.dataCount) {\n msg = 'Some of the templates of type ' + opts.traceType +\n ' were not used. The template has ' + opts.templateCount +\n ' traces, the data only has ' + opts.dataCount +\n ' of this type.';\n } else {\n msg = 'The template has ' + opts.templateCount +\n ' traces of type ' + opts.traceType +\n ' but there are none in the data.';\n }\n break;\n case 'reused':\n msg = 'Some of the templates of type ' + opts.traceType +\n ' were used more than once. The template has ' +\n opts.templateCount + ' traces, the data has ' +\n opts.dataCount + ' of this type.';\n break;\n }\n opts.msg = msg;\n\n return opts;\n}\n\n},{\"../lib\":728,\"../plots/attributes\":773,\"../plots/plots\":839,\"./plot_config\":764,\"./plot_schema\":765,\"./plot_template\":766}],769:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar plotApi = _dereq_('./plot_api');\nvar plots = _dereq_('../plots/plots');\nvar Lib = _dereq_('../lib');\n\nvar helpers = _dereq_('../snapshot/helpers');\nvar toSVG = _dereq_('../snapshot/tosvg');\nvar svgToImg = _dereq_('../snapshot/svgtoimg');\nvar version = _dereq_('../version').version;\n\nvar attrs = {\n format: {\n valType: 'enumerated',\n values: ['png', 'jpeg', 'webp', 'svg', 'full-json'],\n dflt: 'png',\n \n },\n width: {\n valType: 'number',\n min: 1,\n \n },\n height: {\n valType: 'number',\n min: 1,\n \n },\n scale: {\n valType: 'number',\n min: 0,\n dflt: 1,\n \n },\n setBackground: {\n valType: 'any',\n dflt: false,\n \n },\n imageDataOnly: {\n valType: 'boolean',\n dflt: false,\n \n }\n};\n\n/** Plotly.toImage\n *\n * @param {object | string | HTML div} gd\n * can either be a data/layout/config object\n * or an existing graph
\n * or an id to an existing graph
\n * @param {object} opts (see above)\n * @return {promise}\n */\nfunction toImage(gd, opts) {\n opts = opts || {};\n\n var data;\n var layout;\n var config;\n var fullLayout;\n\n if(Lib.isPlainObject(gd)) {\n data = gd.data || [];\n layout = gd.layout || {};\n config = gd.config || {};\n fullLayout = {};\n } else {\n gd = Lib.getGraphDiv(gd);\n data = Lib.extendDeep([], gd.data);\n layout = Lib.extendDeep({}, gd.layout);\n config = gd._context;\n fullLayout = gd._fullLayout || {};\n }\n\n function isImpliedOrValid(attr) {\n return !(attr in opts) || Lib.validate(opts[attr], attrs[attr]);\n }\n\n if((!isImpliedOrValid('width') && opts.width !== null) ||\n (!isImpliedOrValid('height') && opts.height !== null)) {\n throw new Error('Height and width should be pixel values.');\n }\n\n if(!isImpliedOrValid('format')) {\n throw new Error('Image format is not jpeg, png, svg or webp.');\n }\n\n var fullOpts = {};\n\n function coerce(attr, dflt) {\n return Lib.coerce(opts, fullOpts, attrs, attr, dflt);\n }\n\n var format = coerce('format');\n var width = coerce('width');\n var height = coerce('height');\n var scale = coerce('scale');\n var setBackground = coerce('setBackground');\n var imageDataOnly = coerce('imageDataOnly');\n\n // put the cloned div somewhere off screen before attaching to DOM\n var clonedGd = document.createElement('div');\n clonedGd.style.position = 'absolute';\n clonedGd.style.left = '-5000px';\n document.body.appendChild(clonedGd);\n\n // extend layout with image options\n var layoutImage = Lib.extendFlat({}, layout);\n if(width) {\n layoutImage.width = width;\n } else if(opts.width === null && isNumeric(fullLayout.width)) {\n layoutImage.width = fullLayout.width;\n }\n if(height) {\n layoutImage.height = height;\n } else if(opts.height === null && isNumeric(fullLayout.height)) {\n layoutImage.height = fullLayout.height;\n }\n\n // extend config for static plot\n var configImage = Lib.extendFlat({}, config, {\n _exportedPlot: true,\n staticPlot: true,\n setBackground: setBackground\n });\n\n var redrawFunc = helpers.getRedrawFunc(clonedGd);\n\n function wait() {\n return new Promise(function(resolve) {\n setTimeout(resolve, helpers.getDelay(clonedGd._fullLayout));\n });\n }\n\n function convert() {\n return new Promise(function(resolve, reject) {\n var svg = toSVG(clonedGd, format, scale);\n var width = clonedGd._fullLayout.width;\n var height = clonedGd._fullLayout.height;\n\n function cleanup() {\n plotApi.purge(clonedGd);\n document.body.removeChild(clonedGd);\n }\n\n if(format === 'full-json') {\n var json = plots.graphJson(clonedGd, false, 'keepdata', 'object', true, true);\n json.version = version;\n json = JSON.stringify(json);\n cleanup();\n if(imageDataOnly) {\n return resolve(json);\n } else {\n return resolve(helpers.encodeJSON(json));\n }\n }\n\n cleanup();\n\n if(format === 'svg') {\n if(imageDataOnly) {\n return resolve(svg);\n } else {\n return resolve(helpers.encodeSVG(svg));\n }\n }\n\n var canvas = document.createElement('canvas');\n canvas.id = Lib.randstr();\n\n svgToImg({\n format: format,\n width: width,\n height: height,\n scale: scale,\n canvas: canvas,\n svg: svg,\n // ask svgToImg to return a Promise\n // rather than EventEmitter\n // leave EventEmitter for backward\n // compatibility\n promise: true\n })\n .then(resolve)\n .catch(reject);\n });\n }\n\n function urlToImageData(url) {\n if(imageDataOnly) {\n return url.replace(helpers.IMAGE_URL_PREFIX, '');\n } else {\n return url;\n }\n }\n\n return new Promise(function(resolve, reject) {\n plotApi.plot(clonedGd, data, layoutImage, configImage)\n .then(redrawFunc)\n .then(wait)\n .then(convert)\n .then(function(url) { resolve(urlToImageData(url)); })\n .catch(function(err) { reject(err); });\n });\n}\n\nmodule.exports = toImage;\n\n},{\"../lib\":728,\"../plots/plots\":839,\"../snapshot/helpers\":863,\"../snapshot/svgtoimg\":865,\"../snapshot/tosvg\":867,\"../version\":1316,\"./plot_api\":763,\"fast-isnumeric\":236}],770:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../lib');\nvar Plots = _dereq_('../plots/plots');\nvar PlotSchema = _dereq_('./plot_schema');\nvar dfltConfig = _dereq_('./plot_config').dfltConfig;\n\nvar isPlainObject = Lib.isPlainObject;\nvar isArray = Array.isArray;\nvar isArrayOrTypedArray = Lib.isArrayOrTypedArray;\n\n/**\n * Validate a data array and layout object.\n *\n * @param {array} data\n * @param {object} layout\n *\n * @return {array} array of error objects each containing:\n * - {string} code\n * error code ('object', 'array', 'schema', 'unused', 'invisible' or 'value')\n * - {string} container\n * container where the error occurs ('data' or 'layout')\n * - {number} trace\n * trace index of the 'data' container where the error occurs\n * - {array} path\n * nested path to the key that causes the error\n * - {string} astr\n * attribute string variant of 'path' compatible with Plotly.restyle and\n * Plotly.relayout.\n * - {string} msg\n * error message (shown in console in logger config argument is enable)\n */\nmodule.exports = function validate(data, layout) {\n if(data === undefined) data = [];\n if(layout === undefined) layout = {};\n\n var schema = PlotSchema.get();\n var errorList = [];\n var gd = {_context: Lib.extendFlat({}, dfltConfig)};\n\n var dataIn, layoutIn;\n\n if(isArray(data)) {\n gd.data = Lib.extendDeep([], data);\n dataIn = data;\n } else {\n gd.data = [];\n dataIn = [];\n errorList.push(format('array', 'data'));\n }\n\n if(isPlainObject(layout)) {\n gd.layout = Lib.extendDeep({}, layout);\n layoutIn = layout;\n } else {\n gd.layout = {};\n layoutIn = {};\n if(arguments.length > 1) {\n errorList.push(format('object', 'layout'));\n }\n }\n\n // N.B. dataIn and layoutIn are in general not the same as\n // gd.data and gd.layout after supplyDefaults as some attributes\n // in gd.data and gd.layout (still) get mutated during this step.\n\n Plots.supplyDefaults(gd);\n\n var dataOut = gd._fullData;\n var len = dataIn.length;\n\n for(var i = 0; i < len; i++) {\n var traceIn = dataIn[i];\n var base = ['data', i];\n\n if(!isPlainObject(traceIn)) {\n errorList.push(format('object', base));\n continue;\n }\n\n var traceOut = dataOut[i];\n var traceType = traceOut.type;\n var traceSchema = schema.traces[traceType].attributes;\n\n // PlotSchema does something fancy with trace 'type', reset it here\n // to make the trace schema compatible with Lib.validate.\n traceSchema.type = {\n valType: 'enumerated',\n values: [traceType]\n };\n\n if(traceOut.visible === false && traceIn.visible !== false) {\n errorList.push(format('invisible', base));\n }\n\n crawl(traceIn, traceOut, traceSchema, errorList, base);\n\n var transformsIn = traceIn.transforms;\n var transformsOut = traceOut.transforms;\n\n if(transformsIn) {\n if(!isArray(transformsIn)) {\n errorList.push(format('array', base, ['transforms']));\n }\n\n base.push('transforms');\n\n for(var j = 0; j < transformsIn.length; j++) {\n var path = ['transforms', j];\n var transformType = transformsIn[j].type;\n\n if(!isPlainObject(transformsIn[j])) {\n errorList.push(format('object', base, path));\n continue;\n }\n\n var transformSchema = schema.transforms[transformType] ?\n schema.transforms[transformType].attributes :\n {};\n\n // add 'type' to transform schema to validate the transform type\n transformSchema.type = {\n valType: 'enumerated',\n values: Object.keys(schema.transforms)\n };\n\n crawl(transformsIn[j], transformsOut[j], transformSchema, errorList, base, path);\n }\n }\n }\n\n var layoutOut = gd._fullLayout;\n var layoutSchema = fillLayoutSchema(schema, dataOut);\n\n crawl(layoutIn, layoutOut, layoutSchema, errorList, 'layout');\n\n // return undefined if no validation errors were found\n return (errorList.length === 0) ? void(0) : errorList;\n};\n\nfunction crawl(objIn, objOut, schema, list, base, path) {\n path = path || [];\n\n var keys = Object.keys(objIn);\n\n for(var i = 0; i < keys.length; i++) {\n var k = keys[i];\n\n // transforms are handled separately\n if(k === 'transforms') continue;\n\n var p = path.slice();\n p.push(k);\n\n var valIn = objIn[k];\n var valOut = objOut[k];\n\n var nestedSchema = getNestedSchema(schema, k);\n var nestedValType = (nestedSchema || {}).valType;\n var isInfoArray = nestedValType === 'info_array';\n var isColorscale = nestedValType === 'colorscale';\n var items = (nestedSchema || {}).items;\n\n if(!isInSchema(schema, k)) {\n list.push(format('schema', base, p));\n } else if(isPlainObject(valIn) && isPlainObject(valOut) && nestedValType !== 'any') {\n crawl(valIn, valOut, nestedSchema, list, base, p);\n } else if(isInfoArray && isArray(valIn)) {\n if(valIn.length > valOut.length) {\n list.push(format('unused', base, p.concat(valOut.length)));\n }\n var len = valOut.length;\n var arrayItems = Array.isArray(items);\n if(arrayItems) len = Math.min(len, items.length);\n var m, n, item, valInPart, valOutPart;\n if(nestedSchema.dimensions === 2) {\n for(n = 0; n < len; n++) {\n if(isArray(valIn[n])) {\n if(valIn[n].length > valOut[n].length) {\n list.push(format('unused', base, p.concat(n, valOut[n].length)));\n }\n var len2 = valOut[n].length;\n for(m = 0; m < (arrayItems ? Math.min(len2, items[n].length) : len2); m++) {\n item = arrayItems ? items[n][m] : items;\n valInPart = valIn[n][m];\n valOutPart = valOut[n][m];\n if(!Lib.validate(valInPart, item)) {\n list.push(format('value', base, p.concat(n, m), valInPart));\n } else if(valOutPart !== valInPart && valOutPart !== +valInPart) {\n list.push(format('dynamic', base, p.concat(n, m), valInPart, valOutPart));\n }\n }\n } else {\n list.push(format('array', base, p.concat(n), valIn[n]));\n }\n }\n } else {\n for(n = 0; n < len; n++) {\n item = arrayItems ? items[n] : items;\n valInPart = valIn[n];\n valOutPart = valOut[n];\n if(!Lib.validate(valInPart, item)) {\n list.push(format('value', base, p.concat(n), valInPart));\n } else if(valOutPart !== valInPart && valOutPart !== +valInPart) {\n list.push(format('dynamic', base, p.concat(n), valInPart, valOutPart));\n }\n }\n }\n } else if(nestedSchema.items && !isInfoArray && isArray(valIn)) {\n var _nestedSchema = items[Object.keys(items)[0]];\n var indexList = [];\n\n var j, _p;\n\n // loop over valOut items while keeping track of their\n // corresponding input container index (given by _index)\n for(j = 0; j < valOut.length; j++) {\n var _index = valOut[j]._index || j;\n\n _p = p.slice();\n _p.push(_index);\n\n if(isPlainObject(valIn[_index]) && isPlainObject(valOut[j])) {\n indexList.push(_index);\n var valInj = valIn[_index];\n var valOutj = valOut[j];\n if(isPlainObject(valInj) && valInj.visible !== false && valOutj.visible === false) {\n list.push(format('invisible', base, _p));\n } else crawl(valInj, valOutj, _nestedSchema, list, base, _p);\n }\n }\n\n // loop over valIn to determine where it went wrong for some items\n for(j = 0; j < valIn.length; j++) {\n _p = p.slice();\n _p.push(j);\n\n if(!isPlainObject(valIn[j])) {\n list.push(format('object', base, _p, valIn[j]));\n } else if(indexList.indexOf(j) === -1) {\n list.push(format('unused', base, _p));\n }\n }\n } else if(!isPlainObject(valIn) && isPlainObject(valOut)) {\n list.push(format('object', base, p, valIn));\n } else if(!isArrayOrTypedArray(valIn) && isArrayOrTypedArray(valOut) && !isInfoArray && !isColorscale) {\n list.push(format('array', base, p, valIn));\n } else if(!(k in objOut)) {\n list.push(format('unused', base, p, valIn));\n } else if(!Lib.validate(valIn, nestedSchema)) {\n list.push(format('value', base, p, valIn));\n } else if(nestedSchema.valType === 'enumerated' &&\n ((nestedSchema.coerceNumber && valIn !== +valOut) || valIn !== valOut)\n ) {\n list.push(format('dynamic', base, p, valIn, valOut));\n }\n }\n\n return list;\n}\n\n// the 'full' layout schema depends on the traces types presents\nfunction fillLayoutSchema(schema, dataOut) {\n var layoutSchema = schema.layout.layoutAttributes;\n\n for(var i = 0; i < dataOut.length; i++) {\n var traceOut = dataOut[i];\n var traceSchema = schema.traces[traceOut.type];\n var traceLayoutAttr = traceSchema.layoutAttributes;\n\n if(traceLayoutAttr) {\n if(traceOut.subplot) {\n Lib.extendFlat(layoutSchema[traceSchema.attributes.subplot.dflt], traceLayoutAttr);\n } else {\n Lib.extendFlat(layoutSchema, traceLayoutAttr);\n }\n }\n }\n\n return layoutSchema;\n}\n\n// validation error codes\nvar code2msgFunc = {\n object: function(base, astr) {\n var prefix;\n\n if(base === 'layout' && astr === '') prefix = 'The layout argument';\n else if(base[0] === 'data' && astr === '') {\n prefix = 'Trace ' + base[1] + ' in the data argument';\n } else prefix = inBase(base) + 'key ' + astr;\n\n return prefix + ' must be linked to an object container';\n },\n array: function(base, astr) {\n var prefix;\n\n if(base === 'data') prefix = 'The data argument';\n else prefix = inBase(base) + 'key ' + astr;\n\n return prefix + ' must be linked to an array container';\n },\n schema: function(base, astr) {\n return inBase(base) + 'key ' + astr + ' is not part of the schema';\n },\n unused: function(base, astr, valIn) {\n var target = isPlainObject(valIn) ? 'container' : 'key';\n\n return inBase(base) + target + ' ' + astr + ' did not get coerced';\n },\n dynamic: function(base, astr, valIn, valOut) {\n return [\n inBase(base) + 'key',\n astr,\n '(set to \\'' + valIn + '\\')',\n 'got reset to',\n '\\'' + valOut + '\\'',\n 'during defaults.'\n ].join(' ');\n },\n invisible: function(base, astr) {\n return (\n astr ? (inBase(base) + 'item ' + astr) : ('Trace ' + base[1])\n ) + ' got defaulted to be not visible';\n },\n value: function(base, astr, valIn) {\n return [\n inBase(base) + 'key ' + astr,\n 'is set to an invalid value (' + valIn + ')'\n ].join(' ');\n }\n};\n\nfunction inBase(base) {\n if(isArray(base)) return 'In data trace ' + base[1] + ', ';\n\n return 'In ' + base + ', ';\n}\n\nfunction format(code, base, path, valIn, valOut) {\n path = path || '';\n\n var container, trace;\n\n // container is either 'data' or 'layout\n // trace is the trace index if 'data', null otherwise\n\n if(isArray(base)) {\n container = base[0];\n trace = base[1];\n } else {\n container = base;\n trace = null;\n }\n\n var astr = convertPathToAttributeString(path);\n var msg = code2msgFunc[code](base, astr, valIn, valOut);\n\n // log to console if logger config option is enabled\n Lib.log(msg);\n\n return {\n code: code,\n container: container,\n trace: trace,\n path: path,\n astr: astr,\n msg: msg\n };\n}\n\nfunction isInSchema(schema, key) {\n var parts = splitKey(key);\n var keyMinusId = parts.keyMinusId;\n var id = parts.id;\n\n if((keyMinusId in schema) && schema[keyMinusId]._isSubplotObj && id) {\n return true;\n }\n\n return (key in schema);\n}\n\nfunction getNestedSchema(schema, key) {\n if(key in schema) return schema[key];\n\n var parts = splitKey(key);\n\n return schema[parts.keyMinusId];\n}\n\nvar idRegex = Lib.counterRegex('([a-z]+)');\n\nfunction splitKey(key) {\n var idMatch = key.match(idRegex);\n\n return {\n keyMinusId: idMatch && idMatch[1],\n id: idMatch && idMatch[2]\n };\n}\n\nfunction convertPathToAttributeString(path) {\n if(!isArray(path)) return String(path);\n\n var astr = '';\n\n for(var i = 0; i < path.length; i++) {\n var p = path[i];\n\n if(typeof p === 'number') {\n astr = astr.substr(0, astr.length - 1) + '[' + p + ']';\n } else {\n astr += p;\n }\n\n if(i < path.length - 1) astr += '.';\n }\n\n return astr;\n}\n\n},{\"../lib\":728,\"../plots/plots\":839,\"./plot_config\":764,\"./plot_schema\":765}],771:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n mode: {\n valType: 'enumerated',\n dflt: 'afterall',\n \n values: ['immediate', 'next', 'afterall'],\n \n },\n direction: {\n valType: 'enumerated',\n \n values: ['forward', 'reverse'],\n dflt: 'forward',\n \n },\n fromcurrent: {\n valType: 'boolean',\n dflt: false,\n \n \n },\n frame: {\n duration: {\n valType: 'number',\n \n min: 0,\n dflt: 500,\n \n },\n redraw: {\n valType: 'boolean',\n \n dflt: true,\n \n },\n },\n transition: {\n duration: {\n valType: 'number',\n \n min: 0,\n dflt: 500,\n editType: 'none',\n \n },\n easing: {\n valType: 'enumerated',\n dflt: 'cubic-in-out',\n values: [\n 'linear',\n 'quad',\n 'cubic',\n 'sin',\n 'exp',\n 'circle',\n 'elastic',\n 'back',\n 'bounce',\n 'linear-in',\n 'quad-in',\n 'cubic-in',\n 'sin-in',\n 'exp-in',\n 'circle-in',\n 'elastic-in',\n 'back-in',\n 'bounce-in',\n 'linear-out',\n 'quad-out',\n 'cubic-out',\n 'sin-out',\n 'exp-out',\n 'circle-out',\n 'elastic-out',\n 'back-out',\n 'bounce-out',\n 'linear-in-out',\n 'quad-in-out',\n 'cubic-in-out',\n 'sin-in-out',\n 'exp-in-out',\n 'circle-in-out',\n 'elastic-in-out',\n 'back-in-out',\n 'bounce-in-out'\n ],\n \n editType: 'none',\n \n },\n ordering: {\n valType: 'enumerated',\n values: ['layout first', 'traces first'],\n dflt: 'layout first',\n \n editType: 'none',\n \n }\n }\n};\n\n},{}],772:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../lib');\nvar Template = _dereq_('../plot_api/plot_template');\n\n/** Convenience wrapper for making array container logic DRY and consistent\n *\n * @param {object} parentObjIn\n * user input object where the container in question is linked\n * (i.e. either a user trace object or the user layout object)\n *\n * @param {object} parentObjOut\n * full object where the coerced container will be linked\n * (i.e. either a full trace object or the full layout object)\n *\n * @param {object} opts\n * options object:\n * - name {string}\n * name of the key linking the container in question\n * - inclusionAttr {string}\n * name of the item attribute for inclusion/exclusion. Default is 'visible'.\n * Since inclusion is true, use eg 'enabled' instead of 'disabled'.\n * - handleItemDefaults {function}\n * defaults method to be called on each item in the array container in question\n *\n * Its arguments are:\n * - itemIn {object} item in user layout\n * - itemOut {object} item in full layout\n * - parentObj {object} (as in closure)\n * - opts {object} (as in closure)\n * N.B.\n *\n * - opts is passed to handleItemDefaults so it can also store\n * links to supplementary data (e.g. fullData for layout components)\n *\n */\nmodule.exports = function handleArrayContainerDefaults(parentObjIn, parentObjOut, opts) {\n var name = opts.name;\n var inclusionAttr = opts.inclusionAttr || 'visible';\n\n var previousContOut = parentObjOut[name];\n\n var contIn = Lib.isArrayOrTypedArray(parentObjIn[name]) ? parentObjIn[name] : [];\n var contOut = parentObjOut[name] = [];\n var templater = Template.arrayTemplater(parentObjOut, name, inclusionAttr);\n var i, itemOut;\n\n for(i = 0; i < contIn.length; i++) {\n var itemIn = contIn[i];\n\n if(!Lib.isPlainObject(itemIn)) {\n itemOut = templater.newItem({});\n itemOut[inclusionAttr] = false;\n } else {\n itemOut = templater.newItem(itemIn);\n }\n\n itemOut._index = i;\n\n if(itemOut[inclusionAttr] !== false) {\n opts.handleItemDefaults(itemIn, itemOut, parentObjOut, opts);\n }\n\n contOut.push(itemOut);\n }\n\n var defaultItems = templater.defaultItems();\n for(i = 0; i < defaultItems.length; i++) {\n itemOut = defaultItems[i];\n itemOut._index = contOut.length;\n opts.handleItemDefaults({}, itemOut, parentObjOut, opts, {});\n contOut.push(itemOut);\n }\n\n // in case this array gets its defaults rebuilt independent of the whole layout,\n // relink the private keys just for this array.\n if(Lib.isArrayOrTypedArray(previousContOut)) {\n var len = Math.min(previousContOut.length, contOut.length);\n for(i = 0; i < len; i++) {\n Lib.relinkPrivateKeys(contOut[i], previousContOut[i]);\n }\n }\n\n return contOut;\n};\n\n},{\"../lib\":728,\"../plot_api/plot_template\":766}],773:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar fxAttrs = _dereq_('../components/fx/attributes');\n\nmodule.exports = {\n type: {\n valType: 'enumerated',\n \n values: [], // listed dynamically\n dflt: 'scatter',\n editType: 'calc+clearAxisTypes',\n _noTemplating: true // we handle this at a higher level\n },\n visible: {\n valType: 'enumerated',\n values: [true, false, 'legendonly'],\n \n dflt: true,\n editType: 'calc',\n \n },\n showlegend: {\n valType: 'boolean',\n \n dflt: true,\n editType: 'style',\n \n },\n legendgroup: {\n valType: 'string',\n \n dflt: '',\n editType: 'style',\n \n },\n opacity: {\n valType: 'number',\n \n min: 0,\n max: 1,\n dflt: 1,\n editType: 'style',\n \n },\n name: {\n valType: 'string',\n \n editType: 'style',\n \n },\n uid: {\n valType: 'string',\n \n editType: 'plot',\n anim: true,\n \n },\n ids: {\n valType: 'data_array',\n editType: 'calc',\n anim: true,\n \n },\n customdata: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n meta: {\n valType: 'any',\n arrayOk: true,\n \n editType: 'plot',\n \n },\n\n // N.B. these cannot be 'data_array' as they do not have the same length as\n // other data arrays and arrayOk attributes in general\n //\n // Maybe add another valType:\n // https://github.com/plotly/plotly.js/issues/1894\n selectedpoints: {\n valType: 'any',\n \n editType: 'calc',\n \n },\n\n hoverinfo: {\n valType: 'flaglist',\n \n flags: ['x', 'y', 'z', 'text', 'name'],\n extras: ['all', 'none', 'skip'],\n arrayOk: true,\n dflt: 'all',\n editType: 'none',\n \n },\n hoverlabel: fxAttrs.hoverlabel,\n stream: {\n token: {\n valType: 'string',\n noBlank: true,\n strict: true,\n \n editType: 'calc',\n \n },\n maxpoints: {\n valType: 'number',\n min: 0,\n max: 10000,\n dflt: 500,\n \n editType: 'calc',\n \n },\n editType: 'calc'\n },\n transforms: {\n _isLinkedToArray: 'transform',\n editType: 'calc',\n \n },\n uirevision: {\n valType: 'any',\n \n editType: 'none',\n \n }\n};\n\n},{\"../components/fx/attributes\":626}],774:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n\nmodule.exports = {\n xaxis: {\n valType: 'subplotid',\n \n dflt: 'x',\n editType: 'calc+clearAxisTypes',\n \n },\n yaxis: {\n valType: 'subplotid',\n \n dflt: 'y',\n editType: 'calc+clearAxisTypes',\n \n }\n};\n\n},{}],775:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Lib = _dereq_('../../lib');\nvar FP_SAFE = _dereq_('../../constants/numerical').FP_SAFE;\nvar Registry = _dereq_('../../registry');\n\nmodule.exports = {\n getAutoRange: getAutoRange,\n makePadFn: makePadFn,\n doAutoRange: doAutoRange,\n findExtremes: findExtremes,\n concatExtremes: concatExtremes\n};\n\n/**\n * getAutoRange\n *\n * Collects all _extremes values corresponding to a given axis\n * and computes its auto range.\n *\n * Note that getAutoRange uses return values from findExtremes.\n *\n * @param {object} gd:\n * graph div object with filled-in fullData and fullLayout, in particular\n * with filled-in '_extremes' containers:\n * {\n * val: calcdata value,\n * pad: extra pixels beyond this value,\n * extrapad: bool, does this point want 5% extra padding\n * }\n * @param {object} ax:\n * full axis object, in particular with filled-in '_traceIndices'\n * and '_annIndices' / '_shapeIndices' if applicable\n * @return {array}\n * an array of [min, max]. These are calcdata for log and category axes\n * and data for linear and date axes.\n *\n * TODO: we want to change log to data as well, but it's hard to do this\n * maintaining backward compatibility. category will always have to use calcdata\n * though, because otherwise values between categories (or outside all categories)\n * would be impossible.\n */\nfunction getAutoRange(gd, ax) {\n var i, j;\n var newRange = [];\n\n var getPad = makePadFn(ax);\n var extremes = concatExtremes(gd, ax);\n var minArray = extremes.min;\n var maxArray = extremes.max;\n\n if(minArray.length === 0 || maxArray.length === 0) {\n return Lib.simpleMap(ax.range, ax.r2l);\n }\n\n var minmin = minArray[0].val;\n var maxmax = maxArray[0].val;\n\n for(i = 1; i < minArray.length; i++) {\n if(minmin !== maxmax) break;\n minmin = Math.min(minmin, minArray[i].val);\n }\n for(i = 1; i < maxArray.length; i++) {\n if(minmin !== maxmax) break;\n maxmax = Math.max(maxmax, maxArray[i].val);\n }\n\n var axReverse = false;\n\n if(ax.range) {\n var rng = Lib.simpleMap(ax.range, ax.r2l);\n axReverse = rng[1] < rng[0];\n }\n // one-time setting to easily reverse the axis\n // when plotting from code\n if(ax.autorange === 'reversed') {\n axReverse = true;\n ax.autorange = true;\n }\n\n var rangeMode = ax.rangemode;\n var toZero = rangeMode === 'tozero';\n var nonNegative = rangeMode === 'nonnegative';\n var axLen = ax._length;\n // don't allow padding to reduce the data to < 10% of the length\n var minSpan = axLen / 10;\n\n // find axis rangebreaks in [v0,v1] and compute its length in value space\n var calcBreaksLength = function(v0, v1) {\n var lBreaks = 0;\n if(ax.rangebreaks) {\n var rangebreaksOut = ax.locateBreaks(v0, v1);\n for(var i = 0; i < rangebreaksOut.length; i++) {\n var brk = rangebreaksOut[i];\n lBreaks += brk.max - brk.min;\n }\n }\n return lBreaks;\n };\n\n var mbest = 0;\n var minpt, maxpt, minbest, maxbest, dp, dv;\n\n for(i = 0; i < minArray.length; i++) {\n minpt = minArray[i];\n for(j = 0; j < maxArray.length; j++) {\n maxpt = maxArray[j];\n dv = maxpt.val - minpt.val - calcBreaksLength(minpt.val, maxpt.val);\n if(dv > 0) {\n dp = axLen - getPad(minpt) - getPad(maxpt);\n if(dp > minSpan) {\n if(dv / dp > mbest) {\n minbest = minpt;\n maxbest = maxpt;\n mbest = dv / dp;\n }\n } else if(dv / axLen > mbest) {\n // in case of padding longer than the axis\n // at least include the unpadded data values.\n minbest = {val: minpt.val, pad: 0};\n maxbest = {val: maxpt.val, pad: 0};\n mbest = dv / axLen;\n }\n }\n }\n }\n\n function getMaxPad(prev, pt) {\n return Math.max(prev, getPad(pt));\n }\n\n if(minmin === maxmax) {\n var lower = minmin - 1;\n var upper = minmin + 1;\n if(toZero) {\n if(minmin === 0) {\n // The only value we have on this axis is 0, and we want to\n // autorange so zero is one end.\n // In principle this could be [0, 1] or [-1, 0] but usually\n // 'tozero' pins 0 to the low end, so follow that.\n newRange = [0, 1];\n } else {\n var maxPad = (minmin > 0 ? maxArray : minArray).reduce(getMaxPad, 0);\n // we're pushing a single value away from the edge due to its\n // padding, with the other end clamped at zero\n // 0.5 means don't push it farther than the center.\n var rangeEnd = minmin / (1 - Math.min(0.5, maxPad / axLen));\n newRange = minmin > 0 ? [0, rangeEnd] : [rangeEnd, 0];\n }\n } else if(nonNegative) {\n newRange = [Math.max(0, lower), Math.max(1, upper)];\n } else {\n newRange = [lower, upper];\n }\n } else {\n if(toZero) {\n if(minbest.val >= 0) {\n minbest = {val: 0, pad: 0};\n }\n if(maxbest.val <= 0) {\n maxbest = {val: 0, pad: 0};\n }\n } else if(nonNegative) {\n if(minbest.val - mbest * getPad(minbest) < 0) {\n minbest = {val: 0, pad: 0};\n }\n if(maxbest.val <= 0) {\n maxbest = {val: 1, pad: 0};\n }\n }\n\n // in case it changed again...\n mbest = (maxbest.val - minbest.val - calcBreaksLength(minpt.val, maxpt.val)) /\n (axLen - getPad(minbest) - getPad(maxbest));\n\n newRange = [\n minbest.val - mbest * getPad(minbest),\n maxbest.val + mbest * getPad(maxbest)\n ];\n }\n\n // maintain reversal\n if(axReverse) newRange.reverse();\n\n return Lib.simpleMap(newRange, ax.l2r || Number);\n}\n\n/*\n * calculate the pixel padding for ax._min and ax._max entries with\n * optional extrapad as 5% of the total axis length\n */\nfunction makePadFn(ax) {\n // 5% padding for points that specify extrapad: true\n var extrappad = ax._length / 20;\n\n // domain-constrained axes: base extrappad on the unconstrained\n // domain so it's consistent as the domain changes\n if((ax.constrain === 'domain') && ax._inputDomain) {\n extrappad *= (ax._inputDomain[1] - ax._inputDomain[0]) /\n (ax.domain[1] - ax.domain[0]);\n }\n\n return function getPad(pt) { return pt.pad + (pt.extrapad ? extrappad : 0); };\n}\n\nfunction concatExtremes(gd, ax) {\n var axId = ax._id;\n var fullData = gd._fullData;\n var fullLayout = gd._fullLayout;\n var minArray = [];\n var maxArray = [];\n var i, j, d;\n\n function _concat(cont, indices) {\n for(i = 0; i < indices.length; i++) {\n var item = cont[indices[i]];\n var extremes = (item._extremes || {})[axId];\n if(item.visible === true && extremes) {\n for(j = 0; j < extremes.min.length; j++) {\n d = extremes.min[j];\n collapseMinArray(minArray, d.val, d.pad, {extrapad: d.extrapad});\n }\n for(j = 0; j < extremes.max.length; j++) {\n d = extremes.max[j];\n collapseMaxArray(maxArray, d.val, d.pad, {extrapad: d.extrapad});\n }\n }\n }\n }\n\n _concat(fullData, ax._traceIndices);\n _concat(fullLayout.annotations || [], ax._annIndices || []);\n _concat(fullLayout.shapes || [], ax._shapeIndices || []);\n\n return {min: minArray, max: maxArray};\n}\n\nfunction doAutoRange(gd, ax) {\n ax.setScale();\n\n if(ax.autorange) {\n ax.range = getAutoRange(gd, ax);\n\n ax._r = ax.range.slice();\n ax._rl = Lib.simpleMap(ax._r, ax.r2l);\n\n // doAutoRange will get called on fullLayout,\n // but we want to report its results back to layout\n\n var axIn = ax._input;\n\n // before we edit _input, store preGUI values\n var edits = {};\n edits[ax._attr + '.range'] = ax.range;\n edits[ax._attr + '.autorange'] = ax.autorange;\n Registry.call('_storeDirectGUIEdit', gd.layout, gd._fullLayout._preGUI, edits);\n\n axIn.range = ax.range.slice();\n axIn.autorange = ax.autorange;\n }\n\n var anchorAx = ax._anchorAxis;\n\n if(anchorAx && anchorAx.rangeslider) {\n var axeRangeOpts = anchorAx.rangeslider[ax._name];\n if(axeRangeOpts) {\n if(axeRangeOpts.rangemode === 'auto') {\n axeRangeOpts.range = getAutoRange(gd, ax);\n }\n }\n anchorAx._input.rangeslider[ax._name] = Lib.extendFlat({}, axeRangeOpts);\n }\n}\n\n/**\n * findExtremes\n *\n * Find min/max extremes of an array of coordinates on a given axis.\n *\n * Note that findExtremes is called during `calc`, when we don't yet know the axis\n * length; all the inputs should be based solely on the trace data, nothing\n * about the axis layout.\n *\n * Note that `ppad` and `vpad` as well as their asymmetric variants refer to\n * the before and after padding of the passed `data` array, not to the whole axis.\n *\n * @param {object} ax: full axis object\n * relies on\n * - ax.type\n * - ax._m (just its sign)\n * - ax.d2l\n * @param {array} data:\n * array of numbers (i.e. already run though ax.d2c)\n * @param {object} opts:\n * available keys are:\n * vpad: (number or number array) pad values (data value +-vpad)\n * ppad: (number or number array) pad pixels (pixel location +-ppad)\n * ppadplus, ppadminus, vpadplus, vpadminus:\n * separate padding for each side, overrides symmetric\n * padded: (boolean) add 5% padding to both ends\n * (unless one end is overridden by tozero)\n * tozero: (boolean) make sure to include zero if axis is linear,\n * and make it a tight bound if possible\n * vpadLinearized: (boolean) whether or not vpad (or vpadplus/vpadminus)\n * is linearized (for log scale axes)\n *\n * @return {object}\n * - min {array of objects}\n * - max {array of objects}\n * each object item has fields:\n * - val {number}\n * - pad {number}\n * - extrappad {number}\n * - opts {object}: a ref to the passed \"options\" object\n */\nfunction findExtremes(ax, data, opts) {\n if(!opts) opts = {};\n if(!ax._m) ax.setScale();\n\n var minArray = [];\n var maxArray = [];\n\n var len = data.length;\n var extrapad = opts.padded || false;\n var tozero = opts.tozero && (ax.type === 'linear' || ax.type === '-');\n var isLog = ax.type === 'log';\n var hasArrayOption = false;\n var vpadLinearized = opts.vpadLinearized || false;\n var i, v, di, dmin, dmax, ppadiplus, ppadiminus, vmin, vmax;\n\n function makePadAccessor(item) {\n if(Array.isArray(item)) {\n hasArrayOption = true;\n return function(i) { return Math.max(Number(item[i]||0), 0); };\n } else {\n var v = Math.max(Number(item||0), 0);\n return function() { return v; };\n }\n }\n\n var ppadplus = makePadAccessor((ax._m > 0 ?\n opts.ppadplus : opts.ppadminus) || opts.ppad || 0);\n var ppadminus = makePadAccessor((ax._m > 0 ?\n opts.ppadminus : opts.ppadplus) || opts.ppad || 0);\n var vpadplus = makePadAccessor(opts.vpadplus || opts.vpad);\n var vpadminus = makePadAccessor(opts.vpadminus || opts.vpad);\n\n if(!hasArrayOption) {\n // with no arrays other than `data` we don't need to consider\n // every point, only the extreme data points\n vmin = Infinity;\n vmax = -Infinity;\n\n if(isLog) {\n for(i = 0; i < len; i++) {\n v = data[i];\n // data is not linearized yet so we still have to filter out negative logs\n if(v < vmin && v > 0) vmin = v;\n if(v > vmax && v < FP_SAFE) vmax = v;\n }\n } else {\n for(i = 0; i < len; i++) {\n v = data[i];\n if(v < vmin && v > -FP_SAFE) vmin = v;\n if(v > vmax && v < FP_SAFE) vmax = v;\n }\n }\n\n data = [vmin, vmax];\n len = 2;\n }\n\n var collapseOpts = {tozero: tozero, extrapad: extrapad};\n\n function addItem(i) {\n di = data[i];\n if(!isNumeric(di)) return;\n ppadiplus = ppadplus(i);\n ppadiminus = ppadminus(i);\n\n if(vpadLinearized) {\n dmin = ax.c2l(di) - vpadminus(i);\n dmax = ax.c2l(di) + vpadplus(i);\n } else {\n vmin = di - vpadminus(i);\n vmax = di + vpadplus(i);\n // special case for log axes: if vpad makes this object span\n // more than an order of mag, clip it to one order. This is so\n // we don't have non-positive errors or absurdly large lower\n // range due to rounding errors\n if(isLog && vmin < vmax / 10) vmin = vmax / 10;\n\n dmin = ax.c2l(vmin);\n dmax = ax.c2l(vmax);\n }\n\n if(tozero) {\n dmin = Math.min(0, dmin);\n dmax = Math.max(0, dmax);\n }\n if(goodNumber(dmin)) {\n collapseMinArray(minArray, dmin, ppadiminus, collapseOpts);\n }\n if(goodNumber(dmax)) {\n collapseMaxArray(maxArray, dmax, ppadiplus, collapseOpts);\n }\n }\n\n // For efficiency covering monotonic or near-monotonic data,\n // check a few points at both ends first and then sweep\n // through the middle\n var iMax = Math.min(6, len);\n for(i = 0; i < iMax; i++) addItem(i);\n for(i = len - 1; i >= iMax; i--) addItem(i);\n\n return {\n min: minArray,\n max: maxArray,\n opts: opts\n };\n}\n\nfunction collapseMinArray(array, newVal, newPad, opts) {\n collapseArray(array, newVal, newPad, opts, lessOrEqual);\n}\n\nfunction collapseMaxArray(array, newVal, newPad, opts) {\n collapseArray(array, newVal, newPad, opts, greaterOrEqual);\n}\n\n/**\n * collapseArray\n *\n * Takes items from 'array' and compares them to 'newVal', 'newPad'.\n *\n * @param {array} array:\n * current set of min or max extremes\n * @param {number} newVal:\n * new value to compare against\n * @param {number} newPad:\n * pad value associated with 'newVal'\n * @param {object} opts:\n * - tozero {boolean}\n * - extrapad {number}\n * @param {function} atLeastAsExtreme:\n * comparison function, use\n * - lessOrEqual for min 'array' and\n * - greaterOrEqual for max 'array'\n *\n * In practice, 'array' is either\n * - 'extremes[ax._id].min' or\n * - 'extremes[ax._id].max\n * found in traces and layout items that affect autorange.\n *\n * Since we don't yet know the relationship between pixels and values\n * (that's what we're trying to figure out!) AND we don't yet know how\n * many pixels `extrapad` represents (it's going to be 5% of the length,\n * but we don't want to have to redo calc just because length changed)\n * two point must satisfy three criteria simultaneously for one to supersede the other:\n * - at least as extreme a `val`\n * - at least as big a `pad`\n * - an unpadded point cannot supersede a padded point, but any other combination can\n *\n * Then:\n * - If the item supersedes the new point, set includeThis false\n * - If the new pt supersedes the item, delete it from 'array'\n */\nfunction collapseArray(array, newVal, newPad, opts, atLeastAsExtreme) {\n var tozero = opts.tozero;\n var extrapad = opts.extrapad;\n var includeThis = true;\n\n for(var j = 0; j < array.length && includeThis; j++) {\n var v = array[j];\n if(atLeastAsExtreme(v.val, newVal) && v.pad >= newPad && (v.extrapad || !extrapad)) {\n includeThis = false;\n break;\n } else if(atLeastAsExtreme(newVal, v.val) && v.pad <= newPad && (extrapad || !v.extrapad)) {\n array.splice(j, 1);\n j--;\n }\n }\n if(includeThis) {\n var clipAtZero = (tozero && newVal === 0);\n array.push({\n val: newVal,\n pad: clipAtZero ? 0 : newPad,\n extrapad: clipAtZero ? false : extrapad\n });\n }\n}\n\n// In order to stop overflow errors, don't consider points\n// too close to the limits of js floating point\nfunction goodNumber(v) {\n return isNumeric(v) && Math.abs(v) < FP_SAFE;\n}\n\nfunction lessOrEqual(v0, v1) { return v0 <= v1; }\nfunction greaterOrEqual(v0, v1) { return v0 >= v1; }\n\n},{\"../../constants/numerical\":704,\"../../lib\":728,\"../../registry\":859,\"fast-isnumeric\":236}],776:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar isNumeric = _dereq_('fast-isnumeric');\nvar Plots = _dereq_('../../plots/plots');\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\nvar svgTextUtils = _dereq_('../../lib/svg_text_utils');\nvar Titles = _dereq_('../../components/titles');\nvar Color = _dereq_('../../components/color');\nvar Drawing = _dereq_('../../components/drawing');\n\nvar axAttrs = _dereq_('./layout_attributes');\nvar cleanTicks = _dereq_('./clean_ticks');\n\nvar constants = _dereq_('../../constants/numerical');\nvar ONEAVGYEAR = constants.ONEAVGYEAR;\nvar ONEAVGMONTH = constants.ONEAVGMONTH;\nvar ONEDAY = constants.ONEDAY;\nvar ONEHOUR = constants.ONEHOUR;\nvar ONEMIN = constants.ONEMIN;\nvar ONESEC = constants.ONESEC;\nvar MINUS_SIGN = constants.MINUS_SIGN;\nvar BADNUM = constants.BADNUM;\n\nvar alignmentConstants = _dereq_('../../constants/alignment');\nvar MID_SHIFT = alignmentConstants.MID_SHIFT;\nvar CAP_SHIFT = alignmentConstants.CAP_SHIFT;\nvar LINE_SPACING = alignmentConstants.LINE_SPACING;\nvar OPPOSITE_SIDE = alignmentConstants.OPPOSITE_SIDE;\n\nvar axes = module.exports = {};\n\naxes.setConvert = _dereq_('./set_convert');\nvar autoType = _dereq_('./axis_autotype');\n\nvar axisIds = _dereq_('./axis_ids');\naxes.id2name = axisIds.id2name;\naxes.name2id = axisIds.name2id;\naxes.cleanId = axisIds.cleanId;\naxes.list = axisIds.list;\naxes.listIds = axisIds.listIds;\naxes.getFromId = axisIds.getFromId;\naxes.getFromTrace = axisIds.getFromTrace;\n\nvar autorange = _dereq_('./autorange');\naxes.getAutoRange = autorange.getAutoRange;\naxes.findExtremes = autorange.findExtremes;\n\nvar epsilon = 0.0001;\nfunction expandRange(range) {\n var delta = (range[1] - range[0]) * epsilon;\n return [\n range[0] - delta,\n range[1] + delta\n ];\n}\n\n/*\n * find the list of possible axes to reference with an xref or yref attribute\n * and coerce it to that list\n *\n * attr: the attribute we're generating a reference for. Should end in 'x' or 'y'\n * but can be prefixed, like 'ax' for annotation's arrow x\n * dflt: the default to coerce to, or blank to use the first axis (falling back on\n * extraOption if there is no axis)\n * extraOption: aside from existing axes with this letter, what non-axis value is allowed?\n * Only required if it's different from `dflt`\n */\naxes.coerceRef = function(containerIn, containerOut, gd, attr, dflt, extraOption) {\n var axLetter = attr.charAt(attr.length - 1);\n var axlist = gd._fullLayout._subplots[axLetter + 'axis'];\n var refAttr = attr + 'ref';\n var attrDef = {};\n\n if(!dflt) dflt = axlist[0] || extraOption;\n if(!extraOption) extraOption = dflt;\n\n // data-ref annotations are not supported in gl2d yet\n\n attrDef[refAttr] = {\n valType: 'enumerated',\n values: axlist.concat(extraOption ? [extraOption] : []),\n dflt: dflt\n };\n\n // xref, yref\n return Lib.coerce(containerIn, containerOut, attrDef, refAttr);\n};\n\n/*\n * coerce position attributes (range-type) that can be either on axes or absolute\n * (paper or pixel) referenced. The biggest complication here is that we don't know\n * before looking at the axis whether the value must be a number or not (it may be\n * a date string), so we can't use the regular valType='number' machinery\n *\n * axRef (string): the axis this position is referenced to, or:\n * paper: fraction of the plot area\n * pixel: pixels relative to some starting position\n * attr (string): the attribute in containerOut we are coercing\n * dflt (number): the default position, as a fraction or pixels. If the attribute\n * is to be axis-referenced, this will be converted to an axis data value\n *\n * Also cleans the values, since the attribute definition itself has to say\n * valType: 'any' to handle date axes. This allows us to accept:\n * - for category axes: category names, and convert them here into serial numbers.\n * Note that this will NOT work for axis range endpoints, because we don't know\n * the category list yet (it's set by ax.makeCalcdata during calc)\n * but it works for component (note, shape, images) positions.\n * - for date axes: JS Dates or milliseconds, and convert to date strings\n * - for other types: coerce them to numbers\n */\naxes.coercePosition = function(containerOut, gd, coerce, axRef, attr, dflt) {\n var cleanPos, pos;\n\n if(axRef === 'paper' || axRef === 'pixel') {\n cleanPos = Lib.ensureNumber;\n pos = coerce(attr, dflt);\n } else {\n var ax = axes.getFromId(gd, axRef);\n dflt = ax.fraction2r(dflt);\n pos = coerce(attr, dflt);\n cleanPos = ax.cleanPos;\n }\n\n containerOut[attr] = cleanPos(pos);\n};\n\naxes.cleanPosition = function(pos, gd, axRef) {\n var cleanPos = (axRef === 'paper' || axRef === 'pixel') ?\n Lib.ensureNumber :\n axes.getFromId(gd, axRef).cleanPos;\n\n return cleanPos(pos);\n};\n\naxes.redrawComponents = function(gd, axIds) {\n axIds = axIds ? axIds : axes.listIds(gd);\n\n var fullLayout = gd._fullLayout;\n\n function _redrawOneComp(moduleName, methodName, stashName, shortCircuit) {\n var method = Registry.getComponentMethod(moduleName, methodName);\n var stash = {};\n\n for(var i = 0; i < axIds.length; i++) {\n var ax = fullLayout[axes.id2name(axIds[i])];\n var indices = ax[stashName];\n\n for(var j = 0; j < indices.length; j++) {\n var ind = indices[j];\n\n if(!stash[ind]) {\n method(gd, ind);\n stash[ind] = 1;\n // once is enough for images (which doesn't use the `i` arg anyway)\n if(shortCircuit) return;\n }\n }\n }\n }\n\n // annotations and shapes 'draw' method is slow,\n // use the finer-grained 'drawOne' method instead\n _redrawOneComp('annotations', 'drawOne', '_annIndices');\n _redrawOneComp('shapes', 'drawOne', '_shapeIndices');\n _redrawOneComp('images', 'draw', '_imgIndices', true);\n};\n\nvar getDataConversions = axes.getDataConversions = function(gd, trace, target, targetArray) {\n var ax;\n\n // If target points to an axis, use the type we already have for that\n // axis to find the data type. Otherwise use the values to autotype.\n var d2cTarget = (target === 'x' || target === 'y' || target === 'z') ?\n target :\n targetArray;\n\n // In the case of an array target, make a mock data array\n // and call supplyDefaults to the data type and\n // setup the data-to-calc method.\n if(Array.isArray(d2cTarget)) {\n ax = {\n type: autoType(targetArray),\n _categories: []\n };\n axes.setConvert(ax);\n\n // build up ax._categories (usually done during ax.makeCalcdata()\n if(ax.type === 'category') {\n for(var i = 0; i < targetArray.length; i++) {\n ax.d2c(targetArray[i]);\n }\n }\n // TODO what to do for transforms?\n } else {\n ax = axes.getFromTrace(gd, trace, d2cTarget);\n }\n\n // if 'target' has corresponding axis\n // -> use setConvert method\n if(ax) return {d2c: ax.d2c, c2d: ax.c2d};\n\n // special case for 'ids'\n // -> cast to String\n if(d2cTarget === 'ids') return {d2c: toString, c2d: toString};\n\n // otherwise (e.g. numeric-array of 'marker.color' or 'marker.size')\n // -> cast to Number\n\n return {d2c: toNum, c2d: toNum};\n};\n\nfunction toNum(v) { return +v; }\nfunction toString(v) { return String(v); }\n\naxes.getDataToCoordFunc = function(gd, trace, target, targetArray) {\n return getDataConversions(gd, trace, target, targetArray).d2c;\n};\n\n// get counteraxis letter for this axis (name or id)\n// this can also be used as the id for default counter axis\naxes.counterLetter = function(id) {\n var axLetter = id.charAt(0);\n if(axLetter === 'x') return 'y';\n if(axLetter === 'y') return 'x';\n};\n\n// incorporate a new minimum difference and first tick into\n// forced\n// note that _forceTick0 is linearized, so needs to be turned into\n// a range value for setting tick0\naxes.minDtick = function(ax, newDiff, newFirst, allow) {\n // doesn't make sense to do forced min dTick on log or category axes,\n // and the plot itself may decide to cancel (ie non-grouped bars)\n if(['log', 'category', 'multicategory'].indexOf(ax.type) !== -1 || !allow) {\n ax._minDtick = 0;\n } else if(ax._minDtick === undefined) {\n // undefined means there's nothing there yet\n\n ax._minDtick = newDiff;\n ax._forceTick0 = newFirst;\n } else if(ax._minDtick) {\n if((ax._minDtick / newDiff + 1e-6) % 1 < 2e-6 &&\n // existing minDtick is an integer multiple of newDiff\n // (within rounding err)\n // and forceTick0 can be shifted to newFirst\n\n (((newFirst - ax._forceTick0) / newDiff % 1) +\n 1.000001) % 1 < 2e-6) {\n ax._minDtick = newDiff;\n ax._forceTick0 = newFirst;\n } else if((newDiff / ax._minDtick + 1e-6) % 1 > 2e-6 ||\n // if the converse is true (newDiff is a multiple of minDtick and\n // newFirst can be shifted to forceTick0) then do nothing - same\n // forcing stands. Otherwise, cancel forced minimum\n\n (((newFirst - ax._forceTick0) / ax._minDtick % 1) +\n 1.000001) % 1 > 2e-6) {\n ax._minDtick = 0;\n }\n }\n};\n\n// save a copy of the initial axis ranges in fullLayout\n// use them in mode bar and dblclick events\naxes.saveRangeInitial = function(gd, overwrite) {\n var axList = axes.list(gd, '', true);\n var hasOneAxisChanged = false;\n\n for(var i = 0; i < axList.length; i++) {\n var ax = axList[i];\n var isNew = (ax._rangeInitial === undefined);\n var hasChanged = isNew || !(\n ax.range[0] === ax._rangeInitial[0] &&\n ax.range[1] === ax._rangeInitial[1]\n );\n\n if((isNew && ax.autorange === false) || (overwrite && hasChanged)) {\n ax._rangeInitial = ax.range.slice();\n hasOneAxisChanged = true;\n }\n }\n\n return hasOneAxisChanged;\n};\n\n// save a copy of the initial spike visibility\naxes.saveShowSpikeInitial = function(gd, overwrite) {\n var axList = axes.list(gd, '', true);\n var hasOneAxisChanged = false;\n var allSpikesEnabled = 'on';\n\n for(var i = 0; i < axList.length; i++) {\n var ax = axList[i];\n var isNew = (ax._showSpikeInitial === undefined);\n var hasChanged = isNew || !(ax.showspikes === ax._showspikes);\n\n if(isNew || (overwrite && hasChanged)) {\n ax._showSpikeInitial = ax.showspikes;\n hasOneAxisChanged = true;\n }\n\n if(allSpikesEnabled === 'on' && !ax.showspikes) {\n allSpikesEnabled = 'off';\n }\n }\n gd._fullLayout._cartesianSpikesEnabled = allSpikesEnabled;\n return hasOneAxisChanged;\n};\n\naxes.autoBin = function(data, ax, nbins, is2d, calendar, size) {\n var dataMin = Lib.aggNums(Math.min, null, data);\n var dataMax = Lib.aggNums(Math.max, null, data);\n\n if(ax.type === 'category' || ax.type === 'multicategory') {\n return {\n start: dataMin - 0.5,\n end: dataMax + 0.5,\n size: Math.max(1, Math.round(size) || 1),\n _dataSpan: dataMax - dataMin,\n };\n }\n\n if(!calendar) calendar = ax.calendar;\n\n // piggyback off tick code to make \"nice\" bin sizes and edges\n var dummyAx;\n if(ax.type === 'log') {\n dummyAx = {\n type: 'linear',\n range: [dataMin, dataMax]\n };\n } else {\n dummyAx = {\n type: ax.type,\n range: Lib.simpleMap([dataMin, dataMax], ax.c2r, 0, calendar),\n calendar: calendar\n };\n }\n axes.setConvert(dummyAx);\n\n size = size && cleanTicks.dtick(size, dummyAx.type);\n\n if(size) {\n dummyAx.dtick = size;\n dummyAx.tick0 = cleanTicks.tick0(undefined, dummyAx.type, calendar);\n } else {\n var size0;\n if(nbins) size0 = ((dataMax - dataMin) / nbins);\n else {\n // totally auto: scale off std deviation so the highest bin is\n // somewhat taller than the total number of bins, but don't let\n // the size get smaller than the 'nice' rounded down minimum\n // difference between values\n var distinctData = Lib.distinctVals(data);\n var msexp = Math.pow(10, Math.floor(\n Math.log(distinctData.minDiff) / Math.LN10));\n var minSize = msexp * Lib.roundUp(\n distinctData.minDiff / msexp, [0.9, 1.9, 4.9, 9.9], true);\n size0 = Math.max(minSize, 2 * Lib.stdev(data) /\n Math.pow(data.length, is2d ? 0.25 : 0.4));\n\n // fallback if ax.d2c output BADNUMs\n // e.g. when user try to plot categorical bins\n // on a layout.xaxis.type: 'linear'\n if(!isNumeric(size0)) size0 = 1;\n }\n\n axes.autoTicks(dummyAx, size0);\n }\n\n var finalSize = dummyAx.dtick;\n var binStart = axes.tickIncrement(\n axes.tickFirst(dummyAx), finalSize, 'reverse', calendar);\n var binEnd, bincount;\n\n // check for too many data points right at the edges of bins\n // (>50% within 1% of bin edges) or all data points integral\n // and offset the bins accordingly\n if(typeof finalSize === 'number') {\n binStart = autoShiftNumericBins(binStart, data, dummyAx, dataMin, dataMax);\n\n bincount = 1 + Math.floor((dataMax - binStart) / finalSize);\n binEnd = binStart + bincount * finalSize;\n } else {\n // month ticks - should be the only nonlinear kind we have at this point.\n // dtick (as supplied by axes.autoTick) only has nonlinear values on\n // date and log axes, but even if you display a histogram on a log axis\n // we bin it on a linear axis (which one could argue against, but that's\n // a separate issue)\n if(dummyAx.dtick.charAt(0) === 'M') {\n binStart = autoShiftMonthBins(binStart, data, finalSize, dataMin, calendar);\n }\n\n // calculate the endpoint for nonlinear ticks - you have to\n // just increment until you're done\n binEnd = binStart;\n bincount = 0;\n while(binEnd <= dataMax) {\n binEnd = axes.tickIncrement(binEnd, finalSize, false, calendar);\n bincount++;\n }\n }\n\n return {\n start: ax.c2r(binStart, 0, calendar),\n end: ax.c2r(binEnd, 0, calendar),\n size: finalSize,\n _dataSpan: dataMax - dataMin\n };\n};\n\n\nfunction autoShiftNumericBins(binStart, data, ax, dataMin, dataMax) {\n var edgecount = 0;\n var midcount = 0;\n var intcount = 0;\n var blankCount = 0;\n\n function nearEdge(v) {\n // is a value within 1% of a bin edge?\n return (1 + (v - binStart) * 100 / ax.dtick) % 100 < 2;\n }\n\n for(var i = 0; i < data.length; i++) {\n if(data[i] % 1 === 0) intcount++;\n else if(!isNumeric(data[i])) blankCount++;\n\n if(nearEdge(data[i])) edgecount++;\n if(nearEdge(data[i] + ax.dtick / 2)) midcount++;\n }\n var dataCount = data.length - blankCount;\n\n if(intcount === dataCount && ax.type !== 'date') {\n if(ax.dtick < 1) {\n // all integers: if bin size is <1, it's because\n // that was specifically requested (large nbins)\n // so respect that... but center the bins containing\n // integers on those integers\n\n binStart = dataMin - 0.5 * ax.dtick;\n } else {\n // otherwise start half an integer down regardless of\n // the bin size, just enough to clear up endpoint\n // ambiguity about which integers are in which bins.\n\n binStart -= 0.5;\n if(binStart + ax.dtick < dataMin) binStart += ax.dtick;\n }\n } else if(midcount < dataCount * 0.1) {\n if(edgecount > dataCount * 0.3 ||\n nearEdge(dataMin) || nearEdge(dataMax)) {\n // lots of points at the edge, not many in the middle\n // shift half a bin\n var binshift = ax.dtick / 2;\n binStart += (binStart + binshift < dataMin) ? binshift : -binshift;\n }\n }\n return binStart;\n}\n\n\nfunction autoShiftMonthBins(binStart, data, dtick, dataMin, calendar) {\n var stats = Lib.findExactDates(data, calendar);\n // number of data points that needs to be an exact value\n // to shift that increment to (near) the bin center\n var threshold = 0.8;\n\n if(stats.exactDays > threshold) {\n var numMonths = Number(dtick.substr(1));\n\n if((stats.exactYears > threshold) && (numMonths % 12 === 0)) {\n // The exact middle of a non-leap-year is 1.5 days into July\n // so if we start the bins here, all but leap years will\n // get hover-labeled as exact years.\n binStart = axes.tickIncrement(binStart, 'M6', 'reverse') + ONEDAY * 1.5;\n } else if(stats.exactMonths > threshold) {\n // Months are not as clean, but if we shift half the *longest*\n // month (31/2 days) then 31-day months will get labeled exactly\n // and shorter months will get labeled with the correct month\n // but shifted 12-36 hours into it.\n binStart = axes.tickIncrement(binStart, 'M1', 'reverse') + ONEDAY * 15.5;\n } else {\n // Shifting half a day is exact, but since these are month bins it\n // will always give a somewhat odd-looking label, until we do something\n // smarter like showing the bin boundaries (or the bounds of the actual\n // data in each bin)\n binStart -= ONEDAY / 2;\n }\n var nextBinStart = axes.tickIncrement(binStart, dtick);\n\n if(nextBinStart <= dataMin) return nextBinStart;\n }\n return binStart;\n}\n\n// ----------------------------------------------------\n// Ticks and grids\n// ----------------------------------------------------\n\n// ensure we have tick0, dtick, and tick rounding calculated\naxes.prepTicks = function(ax, opts) {\n var rng = Lib.simpleMap(ax.range, ax.r2l, undefined, undefined, opts);\n\n // calculate max number of (auto) ticks to display based on plot size\n if(ax.tickmode === 'auto' || !ax.dtick) {\n var nt = ax.nticks;\n var minPx;\n\n if(!nt) {\n if(ax.type === 'category' || ax.type === 'multicategory') {\n minPx = ax.tickfont ? (ax.tickfont.size || 12) * 1.2 : 15;\n nt = ax._length / minPx;\n } else {\n minPx = ax._id.charAt(0) === 'y' ? 40 : 80;\n nt = Lib.constrain(ax._length / minPx, 4, 9) + 1;\n }\n\n // radial axes span half their domain,\n // multiply nticks value by two to get correct number of auto ticks.\n if(ax._name === 'radialaxis') nt *= 2;\n }\n\n // add a couple of extra digits for filling in ticks when we\n // have explicit tickvals without tick text\n if(ax.tickmode === 'array') nt *= 100;\n\n\n ax._roughDTick = (Math.abs(rng[1] - rng[0]) - (ax._lBreaks || 0)) / nt;\n axes.autoTicks(ax, ax._roughDTick);\n\n // check for a forced minimum dtick\n if(ax._minDtick > 0 && ax.dtick < ax._minDtick * 2) {\n ax.dtick = ax._minDtick;\n ax.tick0 = ax.l2r(ax._forceTick0);\n }\n }\n\n // check for missing tick0\n if(!ax.tick0) {\n ax.tick0 = (ax.type === 'date') ? '2000-01-01' : 0;\n }\n\n // ensure we don't try to make ticks below our minimum precision\n // see https://github.com/plotly/plotly.js/issues/2892\n if(ax.type === 'date' && ax.dtick < 0.1) ax.dtick = 0.1;\n\n // now figure out rounding of tick values\n autoTickRound(ax);\n};\n\n// calculate the ticks: text, values, positioning\n// if ticks are set to automatic, determine the right values (tick0,dtick)\n// in any case, set tickround to # of digits to round tick labels to,\n// or codes to this effect for log and date scales\naxes.calcTicks = function calcTicks(ax, opts) {\n axes.prepTicks(ax, opts);\n var rng = Lib.simpleMap(ax.range, ax.r2l, undefined, undefined, opts);\n\n // now that we've figured out the auto values for formatting\n // in case we're missing some ticktext, we can break out for array ticks\n if(ax.tickmode === 'array') return arrayTicks(ax);\n\n // find the first tick\n ax._tmin = axes.tickFirst(ax, opts);\n\n // add a tiny bit so we get ticks which may have rounded out\n var exRng = expandRange(rng);\n var startTick = exRng[0];\n var endTick = exRng[1];\n // check for reversed axis\n var axrev = (rng[1] < rng[0]);\n\n // No visible ticks? Quit.\n // I've only seen this on category axes with all categories off the edge.\n if((ax._tmin < startTick) !== axrev) return [];\n\n // return the full set of tick vals\n if(ax.type === 'category' || ax.type === 'multicategory') {\n endTick = (axrev) ? Math.max(-0.5, endTick) :\n Math.min(ax._categories.length - 0.5, endTick);\n }\n\n var isDLog = (ax.type === 'log') && !(isNumeric(ax.dtick) || ax.dtick.charAt(0) === 'L');\n\n var tickVals;\n function generateTicks() {\n var xPrevious = null;\n var maxTicks = Math.max(1000, ax._length || 0);\n tickVals = [];\n for(var x = ax._tmin;\n (axrev) ? (x >= endTick) : (x <= endTick);\n x = axes.tickIncrement(x, ax.dtick, axrev, ax.calendar)) {\n // prevent infinite loops - no more than one tick per pixel,\n // and make sure each value is different from the previous\n if(tickVals.length > maxTicks || x === xPrevious) break;\n xPrevious = x;\n\n var minor = false;\n if(isDLog && (x !== (x | 0))) {\n minor = true;\n }\n\n tickVals.push({\n minor: minor,\n value: x\n });\n }\n }\n\n generateTicks();\n\n if(ax.rangebreaks) {\n // replace ticks inside breaks that would get a tick\n // and reduce ticks\n var len = tickVals.length;\n if(len) {\n var tf = 0;\n if(ax.tickmode === 'auto') {\n tf =\n (ax._id.charAt(0) === 'y' ? 2 : 6) *\n (ax.tickfont ? ax.tickfont.size : 12);\n }\n\n var newTickVals = [];\n var prevPos;\n\n var dir = axrev ? 1 : -1;\n var first = axrev ? 0 : len - 1;\n var last = axrev ? len - 1 : 0;\n for(var q = first; dir * q <= dir * last; q += dir) {\n var tickVal = tickVals[q];\n if(ax.maskBreaks(tickVal.value) === BADNUM) {\n tickVal.value = moveOutsideBreak(tickVal.value, ax);\n\n if(ax._rl && (\n ax._rl[0] === tickVal.value ||\n ax._rl[1] === tickVal.value\n )) continue;\n }\n\n var pos = ax.c2p(tickVal.value);\n\n if(pos === prevPos) {\n if(newTickVals[newTickVals.length - 1].value < tickVal.value) {\n newTickVals[newTickVals.length - 1] = tickVal;\n }\n } else if(prevPos === undefined || Math.abs(pos - prevPos) > tf) {\n prevPos = pos;\n newTickVals.push(tickVal);\n }\n }\n tickVals = newTickVals.reverse();\n }\n }\n\n // If same angle over a full circle, the last tick vals is a duplicate.\n // TODO must do something similar for angular date axes.\n if(isAngular(ax) && Math.abs(rng[1] - rng[0]) === 360) {\n tickVals.pop();\n }\n\n // save the last tick as well as first, so we can\n // show the exponent only on the last one\n ax._tmax = (tickVals[tickVals.length - 1] || {}).value;\n\n // for showing the rest of a date when the main tick label is only the\n // latter part: ax._prevDateHead holds what we showed most recently.\n // Start with it cleared and mark that we're in calcTicks (ie calculating a\n // whole string of these so we should care what the previous date head was!)\n ax._prevDateHead = '';\n ax._inCalcTicks = true;\n\n var ticksOut = new Array(tickVals.length);\n for(var i = 0; i < tickVals.length; i++) {\n var _minor = tickVals[i].minor;\n var _value = tickVals[i].value;\n\n ticksOut[i] = axes.tickText(\n ax,\n _value,\n false, // hover\n _minor // noSuffixPrefix\n );\n }\n\n ax._inCalcTicks = false;\n\n return ticksOut;\n};\n\nfunction arrayTicks(ax) {\n var vals = ax.tickvals;\n var text = ax.ticktext;\n var ticksOut = new Array(vals.length);\n var rng = Lib.simpleMap(ax.range, ax.r2l);\n var exRng = expandRange(rng);\n var tickMin = Math.min(exRng[0], exRng[1]);\n var tickMax = Math.max(exRng[0], exRng[1]);\n var j = 0;\n\n // without a text array, just format the given values as any other ticks\n // except with more precision to the numbers\n if(!Array.isArray(text)) text = [];\n\n // make sure showing ticks doesn't accidentally add new categories\n // TODO multicategory, if we allow ticktext / tickvals\n var tickVal2l = ax.type === 'category' ? ax.d2l_noadd : ax.d2l;\n\n // array ticks on log axes always show the full number\n // (if no explicit ticktext overrides it)\n if(ax.type === 'log' && String(ax.dtick).charAt(0) !== 'L') {\n ax.dtick = 'L' + Math.pow(10, Math.floor(Math.min(ax.range[0], ax.range[1])) - 1);\n }\n\n for(var i = 0; i < vals.length; i++) {\n var vali = tickVal2l(vals[i]);\n if(vali > tickMin && vali < tickMax) {\n if(text[i] === undefined) ticksOut[j] = axes.tickText(ax, vali);\n else ticksOut[j] = tickTextObj(ax, vali, String(text[i]));\n j++;\n }\n }\n\n if(j < vals.length) ticksOut.splice(j, vals.length - j);\n\n if(ax.rangebreaks) {\n // remove ticks falling inside rangebreaks\n ticksOut = ticksOut.filter(function(d) {\n return ax.maskBreaks(d.x) !== BADNUM;\n });\n }\n\n return ticksOut;\n}\n\nvar roundBase10 = [2, 5, 10];\nvar roundBase24 = [1, 2, 3, 6, 12];\nvar roundBase60 = [1, 2, 5, 10, 15, 30];\n// 2&3 day ticks are weird, but need something btwn 1&7\nvar roundDays = [1, 2, 3, 7, 14];\n// approx. tick positions for log axes, showing all (1) and just 1, 2, 5 (2)\n// these don't have to be exact, just close enough to round to the right value\nvar roundLog1 = [-0.046, 0, 0.301, 0.477, 0.602, 0.699, 0.778, 0.845, 0.903, 0.954, 1];\nvar roundLog2 = [-0.301, 0, 0.301, 0.699, 1];\n// N.B. `thetaunit; 'radians' angular axes must be converted to degrees\nvar roundAngles = [15, 30, 45, 90, 180];\n\nfunction roundDTick(roughDTick, base, roundingSet) {\n return base * Lib.roundUp(roughDTick / base, roundingSet);\n}\n\n// autoTicks: calculate best guess at pleasant ticks for this axis\n// inputs:\n// ax - an axis object\n// roughDTick - rough tick spacing (to be turned into a nice round number)\n// outputs (into ax):\n// tick0: starting point for ticks (not necessarily on the graph)\n// usually 0 for numeric (=10^0=1 for log) or jan 1, 2000 for dates\n// dtick: the actual, nice round tick spacing, usually a little larger than roughDTick\n// if the ticks are spaced linearly (linear scale, categories,\n// log with only full powers, date ticks < month),\n// this will just be a number\n// months: M#\n// years: M# where # is 12*number of years\n// log with linear ticks: L# where # is the linear tick spacing\n// log showing powers plus some intermediates:\n// D1 shows all digits, D2 shows 2 and 5\naxes.autoTicks = function(ax, roughDTick) {\n var base;\n\n function getBase(v) {\n return Math.pow(v, Math.floor(Math.log(roughDTick) / Math.LN10));\n }\n\n if(ax.type === 'date') {\n ax.tick0 = Lib.dateTick0(ax.calendar);\n // the criteria below are all based on the rough spacing we calculate\n // being > half of the final unit - so precalculate twice the rough val\n var roughX2 = 2 * roughDTick;\n\n if(roughX2 > ONEAVGYEAR) {\n roughDTick /= ONEAVGYEAR;\n base = getBase(10);\n ax.dtick = 'M' + (12 * roundDTick(roughDTick, base, roundBase10));\n } else if(roughX2 > ONEAVGMONTH) {\n roughDTick /= ONEAVGMONTH;\n ax.dtick = 'M' + roundDTick(roughDTick, 1, roundBase24);\n } else if(roughX2 > ONEDAY) {\n ax.dtick = roundDTick(roughDTick, ONEDAY, ax._hasDayOfWeekBreaks ? [1, 2, 7, 14] : roundDays);\n // get week ticks on sunday\n // this will also move the base tick off 2000-01-01 if dtick is\n // 2 or 3 days... but that's a weird enough case that we'll ignore it.\n ax.tick0 = Lib.dateTick0(ax.calendar, true);\n } else if(roughX2 > ONEHOUR) {\n ax.dtick = roundDTick(roughDTick, ONEHOUR, roundBase24);\n } else if(roughX2 > ONEMIN) {\n ax.dtick = roundDTick(roughDTick, ONEMIN, roundBase60);\n } else if(roughX2 > ONESEC) {\n ax.dtick = roundDTick(roughDTick, ONESEC, roundBase60);\n } else {\n // milliseconds\n base = getBase(10);\n ax.dtick = roundDTick(roughDTick, base, roundBase10);\n }\n } else if(ax.type === 'log') {\n ax.tick0 = 0;\n var rng = Lib.simpleMap(ax.range, ax.r2l);\n\n if(roughDTick > 0.7) {\n // only show powers of 10\n ax.dtick = Math.ceil(roughDTick);\n } else if(Math.abs(rng[1] - rng[0]) < 1) {\n // span is less than one power of 10\n var nt = 1.5 * Math.abs((rng[1] - rng[0]) / roughDTick);\n\n // ticks on a linear scale, labeled fully\n roughDTick = Math.abs(Math.pow(10, rng[1]) -\n Math.pow(10, rng[0])) / nt;\n base = getBase(10);\n ax.dtick = 'L' + roundDTick(roughDTick, base, roundBase10);\n } else {\n // include intermediates between powers of 10,\n // labeled with small digits\n // ax.dtick = \"D2\" (show 2 and 5) or \"D1\" (show all digits)\n ax.dtick = (roughDTick > 0.3) ? 'D2' : 'D1';\n }\n } else if(ax.type === 'category' || ax.type === 'multicategory') {\n ax.tick0 = 0;\n ax.dtick = Math.ceil(Math.max(roughDTick, 1));\n } else if(isAngular(ax)) {\n ax.tick0 = 0;\n base = 1;\n ax.dtick = roundDTick(roughDTick, base, roundAngles);\n } else {\n // auto ticks always start at 0\n ax.tick0 = 0;\n base = getBase(10);\n ax.dtick = roundDTick(roughDTick, base, roundBase10);\n }\n\n // prevent infinite loops\n if(ax.dtick === 0) ax.dtick = 1;\n\n // TODO: this is from log axis histograms with autorange off\n if(!isNumeric(ax.dtick) && typeof ax.dtick !== 'string') {\n var olddtick = ax.dtick;\n ax.dtick = 1;\n throw 'ax.dtick error: ' + String(olddtick);\n }\n};\n\n// after dtick is already known, find tickround = precision\n// to display in tick labels\n// for numeric ticks, integer # digits after . to round to\n// for date ticks, the last date part to show (y,m,d,H,M,S)\n// or an integer # digits past seconds\nfunction autoTickRound(ax) {\n var dtick = ax.dtick;\n\n ax._tickexponent = 0;\n if(!isNumeric(dtick) && typeof dtick !== 'string') {\n dtick = 1;\n }\n\n if(ax.type === 'category' || ax.type === 'multicategory') {\n ax._tickround = null;\n }\n if(ax.type === 'date') {\n // If tick0 is unusual, give tickround a bit more information\n // not necessarily *all* the information in tick0 though, if it's really odd\n // minimal string length for tick0: 'd' is 10, 'M' is 16, 'S' is 19\n // take off a leading minus (year < 0) and i (intercalary month) so length is consistent\n var tick0ms = ax.r2l(ax.tick0);\n var tick0str = ax.l2r(tick0ms).replace(/(^-|i)/g, '');\n var tick0len = tick0str.length;\n\n if(String(dtick).charAt(0) === 'M') {\n // any tick0 more specific than a year: alway show the full date\n if(tick0len > 10 || tick0str.substr(5) !== '01-01') ax._tickround = 'd';\n // show the month unless ticks are full multiples of a year\n else ax._tickround = (+(dtick.substr(1)) % 12 === 0) ? 'y' : 'm';\n } else if((dtick >= ONEDAY && tick0len <= 10) || (dtick >= ONEDAY * 15)) ax._tickround = 'd';\n else if((dtick >= ONEMIN && tick0len <= 16) || (dtick >= ONEHOUR)) ax._tickround = 'M';\n else if((dtick >= ONESEC && tick0len <= 19) || (dtick >= ONEMIN)) ax._tickround = 'S';\n else {\n // tickround is a number of digits of fractional seconds\n // of any two adjacent ticks, at least one will have the maximum fractional digits\n // of all possible ticks - so take the max. length of tick0 and the next one\n var tick1len = ax.l2r(tick0ms + dtick).replace(/^-/, '').length;\n ax._tickround = Math.max(tick0len, tick1len) - 20;\n\n // We shouldn't get here... but in case there's a situation I'm\n // not thinking of where tick0str and tick1str are identical or\n // something, fall back on maximum precision\n if(ax._tickround < 0) ax._tickround = 4;\n }\n } else if(isNumeric(dtick) || dtick.charAt(0) === 'L') {\n // linear or log (except D1, D2)\n var rng = ax.range.map(ax.r2d || Number);\n if(!isNumeric(dtick)) dtick = Number(dtick.substr(1));\n // 2 digits past largest digit of dtick\n ax._tickround = 2 - Math.floor(Math.log(dtick) / Math.LN10 + 0.01);\n\n var maxend = Math.max(Math.abs(rng[0]), Math.abs(rng[1]));\n var rangeexp = Math.floor(Math.log(maxend) / Math.LN10 + 0.01);\n if(Math.abs(rangeexp) > 3) {\n if(isSIFormat(ax.exponentformat) && !beyondSI(rangeexp)) {\n ax._tickexponent = 3 * Math.round((rangeexp - 1) / 3);\n } else ax._tickexponent = rangeexp;\n }\n } else {\n // D1 or D2 (log)\n ax._tickround = null;\n }\n}\n\n// months and years don't have constant millisecond values\n// (but a year is always 12 months so we only need months)\n// log-scale ticks are also not consistently spaced, except\n// for pure powers of 10\n// numeric ticks always have constant differences, other datetime ticks\n// can all be calculated as constant number of milliseconds\naxes.tickIncrement = function(x, dtick, axrev, calendar) {\n var axSign = axrev ? -1 : 1;\n\n // includes linear, all dates smaller than month, and pure 10^n in log\n if(isNumeric(dtick)) return x + axSign * dtick;\n\n // everything else is a string, one character plus a number\n var tType = dtick.charAt(0);\n var dtSigned = axSign * Number(dtick.substr(1));\n\n // Dates: months (or years - see Lib.incrementMonth)\n if(tType === 'M') return Lib.incrementMonth(x, dtSigned, calendar);\n\n // Log scales: Linear, Digits\n if(tType === 'L') return Math.log(Math.pow(10, x) + dtSigned) / Math.LN10;\n\n // log10 of 2,5,10, or all digits (logs just have to be\n // close enough to round)\n if(tType === 'D') {\n var tickset = (dtick === 'D2') ? roundLog2 : roundLog1;\n var x2 = x + axSign * 0.01;\n var frac = Lib.roundUp(Lib.mod(x2, 1), tickset, axrev);\n\n return Math.floor(x2) +\n Math.log(d3.round(Math.pow(10, frac), 1)) / Math.LN10;\n }\n\n throw 'unrecognized dtick ' + String(dtick);\n};\n\n// calculate the first tick on an axis\naxes.tickFirst = function(ax, opts) {\n var r2l = ax.r2l || Number;\n var rng = Lib.simpleMap(ax.range, r2l, undefined, undefined, opts);\n var axrev = rng[1] < rng[0];\n var sRound = axrev ? Math.floor : Math.ceil;\n // add a tiny extra bit to make sure we get ticks\n // that may have been rounded out\n var r0 = expandRange(rng)[0];\n var dtick = ax.dtick;\n var tick0 = r2l(ax.tick0);\n\n if(isNumeric(dtick)) {\n var tmin = sRound((r0 - tick0) / dtick) * dtick + tick0;\n\n // make sure no ticks outside the category list\n if(ax.type === 'category' || ax.type === 'multicategory') {\n tmin = Lib.constrain(tmin, 0, ax._categories.length - 1);\n }\n return tmin;\n }\n\n var tType = dtick.charAt(0);\n var dtNum = Number(dtick.substr(1));\n\n // Dates: months (or years)\n if(tType === 'M') {\n var cnt = 0;\n var t0 = tick0;\n var t1, mult, newDTick;\n\n // This algorithm should work for *any* nonlinear (but close to linear!)\n // tick spacing. Limit to 10 iterations, for gregorian months it's normally <=3.\n while(cnt < 10) {\n t1 = axes.tickIncrement(t0, dtick, axrev, ax.calendar);\n if((t1 - r0) * (t0 - r0) <= 0) {\n // t1 and t0 are on opposite sides of r0! we've succeeded!\n if(axrev) return Math.min(t0, t1);\n return Math.max(t0, t1);\n }\n mult = (r0 - ((t0 + t1) / 2)) / (t1 - t0);\n newDTick = tType + ((Math.abs(Math.round(mult)) || 1) * dtNum);\n t0 = axes.tickIncrement(t0, newDTick, mult < 0 ? !axrev : axrev, ax.calendar);\n cnt++;\n }\n Lib.error('tickFirst did not converge', ax);\n return t0;\n } else if(tType === 'L') {\n // Log scales: Linear, Digits\n\n return Math.log(sRound(\n (Math.pow(10, r0) - tick0) / dtNum) * dtNum + tick0) / Math.LN10;\n } else if(tType === 'D') {\n var tickset = (dtick === 'D2') ? roundLog2 : roundLog1;\n var frac = Lib.roundUp(Lib.mod(r0, 1), tickset, axrev);\n\n return Math.floor(r0) +\n Math.log(d3.round(Math.pow(10, frac), 1)) / Math.LN10;\n } else throw 'unrecognized dtick ' + String(dtick);\n};\n\n// draw the text for one tick.\n// px,py are the location on gd.paper\n// prefix is there so the x axis ticks can be dropped a line\n// ax is the axis layout, x is the tick value\n// hover is a (truthy) flag for whether to show numbers with a bit\n// more precision for hovertext\naxes.tickText = function(ax, x, hover, noSuffixPrefix) {\n var out = tickTextObj(ax, x);\n var arrayMode = ax.tickmode === 'array';\n var extraPrecision = hover || arrayMode;\n var axType = ax.type;\n // TODO multicategory, if we allow ticktext / tickvals\n var tickVal2l = axType === 'category' ? ax.d2l_noadd : ax.d2l;\n var i;\n\n if(arrayMode && Array.isArray(ax.ticktext)) {\n var rng = Lib.simpleMap(ax.range, ax.r2l);\n var minDiff = (Math.abs(rng[1] - rng[0]) - (ax._lBreaks || 0)) / 10000;\n\n for(i = 0; i < ax.ticktext.length; i++) {\n if(Math.abs(x - tickVal2l(ax.tickvals[i])) < minDiff) break;\n }\n if(i < ax.ticktext.length) {\n out.text = String(ax.ticktext[i]);\n return out;\n }\n }\n\n function isHidden(showAttr) {\n if(showAttr === undefined) return true;\n if(hover) return showAttr === 'none';\n\n var firstOrLast = {\n first: ax._tmin,\n last: ax._tmax\n }[showAttr];\n\n return showAttr !== 'all' && x !== firstOrLast;\n }\n\n var hideexp = hover ?\n 'never' :\n ax.exponentformat !== 'none' && isHidden(ax.showexponent) ? 'hide' : '';\n\n if(axType === 'date') formatDate(ax, out, hover, extraPrecision);\n else if(axType === 'log') formatLog(ax, out, hover, extraPrecision, hideexp);\n else if(axType === 'category') formatCategory(ax, out);\n else if(axType === 'multicategory') formatMultiCategory(ax, out, hover);\n else if(isAngular(ax)) formatAngle(ax, out, hover, extraPrecision, hideexp);\n else formatLinear(ax, out, hover, extraPrecision, hideexp);\n\n // add prefix and suffix\n if(!noSuffixPrefix) {\n if(ax.tickprefix && !isHidden(ax.showtickprefix)) out.text = ax.tickprefix + out.text;\n if(ax.ticksuffix && !isHidden(ax.showticksuffix)) out.text += ax.ticksuffix;\n }\n\n // Setup ticks and grid lines boundaries\n // at 1/2 a 'category' to the left/bottom\n if(ax.tickson === 'boundaries' || ax.showdividers) {\n var inbounds = function(v) {\n var p = ax.l2p(v);\n return p >= 0 && p <= ax._length ? v : null;\n };\n\n out.xbnd = [\n inbounds(out.x - 0.5),\n inbounds(out.x + ax.dtick - 0.5)\n ];\n }\n\n return out;\n};\n\n/**\n * create text for a hover label on this axis, with special handling of\n * log axes (where negative values can't be displayed but can appear in hover text)\n *\n * @param {object} ax: the axis to format text for\n * @param {number} val: calcdata value to format\n * @param {Optional(number)} val2: a second value to display\n *\n * @returns {string} `val` formatted as a string appropriate to this axis, or\n * `val` and `val2` as a range (ie ' - ') if `val2` is provided and\n * it's different from `val`.\n */\naxes.hoverLabelText = function(ax, val, val2) {\n if(val2 !== BADNUM && val2 !== val) {\n return axes.hoverLabelText(ax, val) + ' - ' + axes.hoverLabelText(ax, val2);\n }\n\n var logOffScale = (ax.type === 'log' && val <= 0);\n var tx = axes.tickText(ax, ax.c2l(logOffScale ? -val : val), 'hover').text;\n\n if(logOffScale) {\n return val === 0 ? '0' : MINUS_SIGN + tx;\n }\n\n // TODO: should we do something special if the axis calendar and\n // the data calendar are different? Somehow display both dates with\n // their system names? Right now it will just display in the axis calendar\n // but users could add the other one as text.\n return tx;\n};\n\nfunction tickTextObj(ax, x, text) {\n var tf = ax.tickfont || {};\n\n return {\n x: x,\n dx: 0,\n dy: 0,\n text: text || '',\n fontSize: tf.size,\n font: tf.family,\n fontColor: tf.color\n };\n}\n\nfunction formatDate(ax, out, hover, extraPrecision) {\n var tr = ax._tickround;\n var fmt = (hover && ax.hoverformat) || axes.getTickFormat(ax);\n\n if(extraPrecision) {\n // second or sub-second precision: extra always shows max digits.\n // for other fields, extra precision just adds one field.\n if(isNumeric(tr)) tr = 4;\n else tr = {y: 'm', m: 'd', d: 'M', M: 'S', S: 4}[tr];\n }\n\n var dateStr = Lib.formatDate(out.x, fmt, tr, ax._dateFormat, ax.calendar, ax._extraFormat);\n var headStr;\n\n var splitIndex = dateStr.indexOf('\\n');\n if(splitIndex !== -1) {\n headStr = dateStr.substr(splitIndex + 1);\n dateStr = dateStr.substr(0, splitIndex);\n }\n\n if(extraPrecision) {\n // if extraPrecision led to trailing zeros, strip them off\n // actually, this can lead to removing even more zeros than\n // in the original rounding, but that's fine because in these\n // contexts uniformity is not so important (if there's even\n // anything to be uniform with!)\n\n // can we remove the whole time part?\n if(dateStr === '00:00:00' || dateStr === '00:00') {\n dateStr = headStr;\n headStr = '';\n } else if(dateStr.length === 8) {\n // strip off seconds if they're zero (zero fractional seconds\n // are already omitted)\n // but we never remove minutes and leave just hours\n dateStr = dateStr.replace(/:00$/, '');\n }\n }\n\n if(headStr) {\n if(hover) {\n // hover puts it all on one line, so headPart works best up front\n // except for year headPart: turn this into \"Jan 1, 2000\" etc.\n if(tr === 'd') dateStr += ', ' + headStr;\n else dateStr = headStr + (dateStr ? ', ' + dateStr : '');\n } else if(!ax._inCalcTicks || (headStr !== ax._prevDateHead)) {\n dateStr += '
' + headStr;\n ax._prevDateHead = headStr;\n }\n }\n\n out.text = dateStr;\n}\n\nfunction formatLog(ax, out, hover, extraPrecision, hideexp) {\n var dtick = ax.dtick;\n var x = out.x;\n var tickformat = ax.tickformat;\n var dtChar0 = typeof dtick === 'string' && dtick.charAt(0);\n\n if(hideexp === 'never') {\n // If this is a hover label, then we must *never* hide the exponent\n // for the sake of display, which could give the wrong value by\n // potentially many orders of magnitude. If hideexp was 'never', then\n // it's now succeeded by preventing the other condition from automating\n // this choice. Thus we can unset it so that the axis formatting takes\n // precedence.\n hideexp = '';\n }\n\n if(extraPrecision && (dtChar0 !== 'L')) {\n dtick = 'L3';\n dtChar0 = 'L';\n }\n\n if(tickformat || (dtChar0 === 'L')) {\n out.text = numFormat(Math.pow(10, x), ax, hideexp, extraPrecision);\n } else if(isNumeric(dtick) || ((dtChar0 === 'D') && (Lib.mod(x + 0.01, 1) < 0.1))) {\n var p = Math.round(x);\n var absP = Math.abs(p);\n var exponentFormat = ax.exponentformat;\n if(exponentFormat === 'power' || (isSIFormat(exponentFormat) && beyondSI(p))) {\n if(p === 0) out.text = 1;\n else if(p === 1) out.text = '10';\n else out.text = '10' + (p > 1 ? '' : MINUS_SIGN) + absP + '';\n\n out.fontSize *= 1.25;\n } else if((exponentFormat === 'e' || exponentFormat === 'E') && absP > 2) {\n out.text = '1' + exponentFormat + (p > 0 ? '+' : MINUS_SIGN) + absP;\n } else {\n out.text = numFormat(Math.pow(10, x), ax, '', 'fakehover');\n if(dtick === 'D1' && ax._id.charAt(0) === 'y') {\n out.dy -= out.fontSize / 6;\n }\n }\n } else if(dtChar0 === 'D') {\n out.text = String(Math.round(Math.pow(10, Lib.mod(x, 1))));\n out.fontSize *= 0.75;\n } else throw 'unrecognized dtick ' + String(dtick);\n\n // if 9's are printed on log scale, move the 10's away a bit\n if(ax.dtick === 'D1') {\n var firstChar = String(out.text).charAt(0);\n if(firstChar === '0' || firstChar === '1') {\n if(ax._id.charAt(0) === 'y') {\n out.dx -= out.fontSize / 4;\n } else {\n out.dy += out.fontSize / 2;\n out.dx += (ax.range[1] > ax.range[0] ? 1 : -1) *\n out.fontSize * (x < 0 ? 0.5 : 0.25);\n }\n }\n }\n}\n\nfunction formatCategory(ax, out) {\n var tt = ax._categories[Math.round(out.x)];\n if(tt === undefined) tt = '';\n out.text = String(tt);\n}\n\nfunction formatMultiCategory(ax, out, hover) {\n var v = Math.round(out.x);\n var cats = ax._categories[v] || [];\n var tt = cats[1] === undefined ? '' : String(cats[1]);\n var tt2 = cats[0] === undefined ? '' : String(cats[0]);\n\n if(hover) {\n // TODO is this what we want?\n out.text = tt2 + ' - ' + tt;\n } else {\n // setup for secondary labels\n out.text = tt;\n out.text2 = tt2;\n }\n}\n\nfunction formatLinear(ax, out, hover, extraPrecision, hideexp) {\n if(hideexp === 'never') {\n // If this is a hover label, then we must *never* hide the exponent\n // for the sake of display, which could give the wrong value by\n // potentially many orders of magnitude. If hideexp was 'never', then\n // it's now succeeded by preventing the other condition from automating\n // this choice. Thus we can unset it so that the axis formatting takes\n // precedence.\n hideexp = '';\n } else if(ax.showexponent === 'all' && Math.abs(out.x / ax.dtick) < 1e-6) {\n // don't add an exponent to zero if we're showing all exponents\n // so the only reason you'd show an exponent on zero is if it's the\n // ONLY tick to get an exponent (first or last)\n hideexp = 'hide';\n }\n out.text = numFormat(out.x, ax, hideexp, extraPrecision);\n}\n\nfunction formatAngle(ax, out, hover, extraPrecision, hideexp) {\n if(ax.thetaunit === 'radians' && !hover) {\n var num = out.x / 180;\n\n if(num === 0) {\n out.text = '0';\n } else {\n var frac = num2frac(num);\n\n if(frac[1] >= 100) {\n out.text = numFormat(Lib.deg2rad(out.x), ax, hideexp, extraPrecision);\n } else {\n var isNeg = out.x < 0;\n\n if(frac[1] === 1) {\n if(frac[0] === 1) out.text = 'π';\n else out.text = frac[0] + 'π';\n } else {\n out.text = [\n '', frac[0], '',\n '⁄',\n '', frac[1], '',\n 'π'\n ].join('');\n }\n\n if(isNeg) out.text = MINUS_SIGN + out.text;\n }\n }\n } else {\n out.text = numFormat(out.x, ax, hideexp, extraPrecision);\n }\n}\n\n// inspired by\n// https://github.com/yisibl/num2fraction/blob/master/index.js\nfunction num2frac(num) {\n function almostEq(a, b) {\n return Math.abs(a - b) <= 1e-6;\n }\n\n function findGCD(a, b) {\n return almostEq(b, 0) ? a : findGCD(b, a % b);\n }\n\n function findPrecision(n) {\n var e = 1;\n while(!almostEq(Math.round(n * e) / e, n)) {\n e *= 10;\n }\n return e;\n }\n\n var precision = findPrecision(num);\n var number = num * precision;\n var gcd = Math.abs(findGCD(number, precision));\n\n return [\n // numerator\n Math.round(number / gcd),\n // denominator\n Math.round(precision / gcd)\n ];\n}\n\n// format a number (tick value) according to the axis settings\n// new, more reliable procedure than d3.round or similar:\n// add half the rounding increment, then stringify and truncate\n// also automatically switch to sci. notation\nvar SIPREFIXES = ['f', 'p', 'n', 'μ', 'm', '', 'k', 'M', 'G', 'T'];\n\nfunction isSIFormat(exponentFormat) {\n return exponentFormat === 'SI' || exponentFormat === 'B';\n}\n\n// are we beyond the range of common SI prefixes?\n// 10^-16 -> 1x10^-16\n// 10^-15 -> 1f\n// ...\n// 10^14 -> 100T\n// 10^15 -> 1x10^15\n// 10^16 -> 1x10^16\nfunction beyondSI(exponent) {\n return exponent > 14 || exponent < -15;\n}\n\nfunction numFormat(v, ax, fmtoverride, hover) {\n var isNeg = v < 0;\n // max number of digits past decimal point to show\n var tickRound = ax._tickround;\n var exponentFormat = fmtoverride || ax.exponentformat || 'B';\n var exponent = ax._tickexponent;\n var tickformat = axes.getTickFormat(ax);\n var separatethousands = ax.separatethousands;\n\n // special case for hover: set exponent just for this value, and\n // add a couple more digits of precision over tick labels\n if(hover) {\n // make a dummy axis obj to get the auto rounding and exponent\n var ah = {\n exponentformat: exponentFormat,\n dtick: ax.showexponent === 'none' ? ax.dtick :\n (isNumeric(v) ? Math.abs(v) || 1 : 1),\n // if not showing any exponents, don't change the exponent\n // from what we calculate\n range: ax.showexponent === 'none' ? ax.range.map(ax.r2d) : [0, v || 1]\n };\n autoTickRound(ah);\n tickRound = (Number(ah._tickround) || 0) + 4;\n exponent = ah._tickexponent;\n if(ax.hoverformat) tickformat = ax.hoverformat;\n }\n\n if(tickformat) return ax._numFormat(tickformat)(v).replace(/-/g, MINUS_SIGN);\n\n // 'epsilon' - rounding increment\n var e = Math.pow(10, -tickRound) / 2;\n\n // exponentFormat codes:\n // 'e' (1.2e+6, default)\n // 'E' (1.2E+6)\n // 'SI' (1.2M)\n // 'B' (same as SI except 10^9=B not G)\n // 'none' (1200000)\n // 'power' (1.2x10^6)\n // 'hide' (1.2, use 3rd argument=='hide' to eg\n // only show exponent on last tick)\n if(exponentFormat === 'none') exponent = 0;\n\n // take the sign out, put it back manually at the end\n // - makes cases easier\n v = Math.abs(v);\n if(v < e) {\n // 0 is just 0, but may get exponent if it's the last tick\n v = '0';\n isNeg = false;\n } else {\n v += e;\n // take out a common exponent, if any\n if(exponent) {\n v *= Math.pow(10, -exponent);\n tickRound += exponent;\n }\n // round the mantissa\n if(tickRound === 0) v = String(Math.floor(v));\n else if(tickRound < 0) {\n v = String(Math.round(v));\n v = v.substr(0, v.length + tickRound);\n for(var i = tickRound; i < 0; i++) v += '0';\n } else {\n v = String(v);\n var dp = v.indexOf('.') + 1;\n if(dp) v = v.substr(0, dp + tickRound).replace(/\\.?0+$/, '');\n }\n // insert appropriate decimal point and thousands separator\n v = Lib.numSeparate(v, ax._separators, separatethousands);\n }\n\n // add exponent\n if(exponent && exponentFormat !== 'hide') {\n if(isSIFormat(exponentFormat) && beyondSI(exponent)) exponentFormat = 'power';\n\n var signedExponent;\n if(exponent < 0) signedExponent = MINUS_SIGN + -exponent;\n else if(exponentFormat !== 'power') signedExponent = '+' + exponent;\n else signedExponent = String(exponent);\n\n if(exponentFormat === 'e' || exponentFormat === 'E') {\n v += exponentFormat + signedExponent;\n } else if(exponentFormat === 'power') {\n v += '×10' + signedExponent + '';\n } else if(exponentFormat === 'B' && exponent === 9) {\n v += 'B';\n } else if(isSIFormat(exponentFormat)) {\n v += SIPREFIXES[exponent / 3 + 5];\n }\n }\n\n // put sign back in and return\n // replace standard minus character (which is technically a hyphen)\n // with a true minus sign\n if(isNeg) return MINUS_SIGN + v;\n return v;\n}\n\naxes.getTickFormat = function(ax) {\n var i;\n\n function convertToMs(dtick) {\n return typeof dtick !== 'string' ? dtick : Number(dtick.replace('M', '')) * ONEAVGMONTH;\n }\n\n function compareLogTicks(left, right) {\n var priority = ['L', 'D'];\n if(typeof left === typeof right) {\n if(typeof left === 'number') {\n return left - right;\n } else {\n var leftPriority = priority.indexOf(left.charAt(0));\n var rightPriority = priority.indexOf(right.charAt(0));\n if(leftPriority === rightPriority) {\n return Number(left.replace(/(L|D)/g, '')) - Number(right.replace(/(L|D)/g, ''));\n } else {\n return leftPriority - rightPriority;\n }\n }\n } else {\n return typeof left === 'number' ? 1 : -1;\n }\n }\n\n function isProperStop(dtick, range, convert) {\n var convertFn = convert || function(x) { return x;};\n var leftDtick = range[0];\n var rightDtick = range[1];\n return ((!leftDtick && typeof leftDtick !== 'number') || convertFn(leftDtick) <= convertFn(dtick)) &&\n ((!rightDtick && typeof rightDtick !== 'number') || convertFn(rightDtick) >= convertFn(dtick));\n }\n\n function isProperLogStop(dtick, range) {\n var isLeftDtickNull = range[0] === null;\n var isRightDtickNull = range[1] === null;\n var isDtickInRangeLeft = compareLogTicks(dtick, range[0]) >= 0;\n var isDtickInRangeRight = compareLogTicks(dtick, range[1]) <= 0;\n return (isLeftDtickNull || isDtickInRangeLeft) && (isRightDtickNull || isDtickInRangeRight);\n }\n\n var tickstop, stopi;\n if(ax.tickformatstops && ax.tickformatstops.length > 0) {\n switch(ax.type) {\n case 'date':\n case 'linear': {\n for(i = 0; i < ax.tickformatstops.length; i++) {\n stopi = ax.tickformatstops[i];\n if(stopi.enabled && isProperStop(ax.dtick, stopi.dtickrange, convertToMs)) {\n tickstop = stopi;\n break;\n }\n }\n break;\n }\n case 'log': {\n for(i = 0; i < ax.tickformatstops.length; i++) {\n stopi = ax.tickformatstops[i];\n if(stopi.enabled && isProperLogStop(ax.dtick, stopi.dtickrange)) {\n tickstop = stopi;\n break;\n }\n }\n break;\n }\n default:\n }\n }\n return tickstop ? tickstop.value : ax.tickformat;\n};\n\n// getSubplots - extract all subplot IDs we need\n// as an array of items like 'xy', 'x2y', 'x2y2'...\n// sorted by x (x,x2,x3...) then y\n// optionally restrict to only subplots containing axis object ax\n//\n// NOTE: this is currently only used OUTSIDE plotly.js (toolpanel, webapp)\n// ideally we get rid of it there (or just copy this there) and remove it here\naxes.getSubplots = function(gd, ax) {\n var subplotObj = gd._fullLayout._subplots;\n var allSubplots = subplotObj.cartesian.concat(subplotObj.gl2d || []);\n\n var out = ax ? axes.findSubplotsWithAxis(allSubplots, ax) : allSubplots;\n\n out.sort(function(a, b) {\n var aParts = a.substr(1).split('y');\n var bParts = b.substr(1).split('y');\n\n if(aParts[0] === bParts[0]) return +aParts[1] - +bParts[1];\n return +aParts[0] - +bParts[0];\n });\n\n return out;\n};\n\n// find all subplots with axis 'ax'\n// NOTE: this is only used in axes.getSubplots (only used outside plotly.js) and\n// gl2d/convert (where it restricts axis subplots to only those with gl2d)\naxes.findSubplotsWithAxis = function(subplots, ax) {\n var axMatch = new RegExp(\n (ax._id.charAt(0) === 'x') ? ('^' + ax._id + 'y') : (ax._id + '$')\n );\n var subplotsWithAx = [];\n\n for(var i = 0; i < subplots.length; i++) {\n var sp = subplots[i];\n if(axMatch.test(sp)) subplotsWithAx.push(sp);\n }\n\n return subplotsWithAx;\n};\n\n// makeClipPaths: prepare clipPaths for all single axes and all possible xy pairings\naxes.makeClipPaths = function(gd) {\n var fullLayout = gd._fullLayout;\n\n // for more info: https://github.com/plotly/plotly.js/issues/2595\n if(fullLayout._hasOnlyLargeSploms) return;\n\n var fullWidth = {_offset: 0, _length: fullLayout.width, _id: ''};\n var fullHeight = {_offset: 0, _length: fullLayout.height, _id: ''};\n var xaList = axes.list(gd, 'x', true);\n var yaList = axes.list(gd, 'y', true);\n var clipList = [];\n var i, j;\n\n for(i = 0; i < xaList.length; i++) {\n clipList.push({x: xaList[i], y: fullHeight});\n for(j = 0; j < yaList.length; j++) {\n if(i === 0) clipList.push({x: fullWidth, y: yaList[j]});\n clipList.push({x: xaList[i], y: yaList[j]});\n }\n }\n\n // selectors don't work right with camelCase tags,\n // have to use class instead\n // https://groups.google.com/forum/#!topic/d3-js/6EpAzQ2gU9I\n var axClips = fullLayout._clips.selectAll('.axesclip')\n .data(clipList, function(d) { return d.x._id + d.y._id; });\n\n axClips.enter().append('clipPath')\n .classed('axesclip', true)\n .attr('id', function(d) { return 'clip' + fullLayout._uid + d.x._id + d.y._id; })\n .append('rect');\n\n axClips.exit().remove();\n\n axClips.each(function(d) {\n d3.select(this).select('rect').attr({\n x: d.x._offset || 0,\n y: d.y._offset || 0,\n width: d.x._length || 1,\n height: d.y._length || 1\n });\n });\n};\n\n/**\n * Main multi-axis drawing routine!\n *\n * @param {DOM element} gd : graph div\n * @param {string or array of strings} arg : polymorphic argument\n * @param {object} opts:\n * - @param {boolean} skipTitle : optional flag to skip axis title draw/update\n *\n * Signature 1: Axes.draw(gd, 'redraw')\n * use this to clear and redraw all axes on graph\n *\n * Signature 2: Axes.draw(gd, '')\n * use this to draw all axes on graph w/o the selectAll().remove()\n * of the 'redraw' signature\n *\n * Signature 3: Axes.draw(gd, [axId, axId2, ...])\n * where the items are axis id string,\n * use this to update multiple axes in one call\n *\n * N.B draw updates:\n * - ax._r (stored range for use by zoom/pan)\n * - ax._rl (stored linearized range for use by zoom/pan)\n */\naxes.draw = function(gd, arg, opts) {\n var fullLayout = gd._fullLayout;\n\n if(arg === 'redraw') {\n fullLayout._paper.selectAll('g.subplot').each(function(d) {\n var id = d[0];\n var plotinfo = fullLayout._plots[id];\n var xa = plotinfo.xaxis;\n var ya = plotinfo.yaxis;\n\n plotinfo.xaxislayer.selectAll('.' + xa._id + 'tick').remove();\n plotinfo.yaxislayer.selectAll('.' + ya._id + 'tick').remove();\n plotinfo.xaxislayer.selectAll('.' + xa._id + 'tick2').remove();\n plotinfo.yaxislayer.selectAll('.' + ya._id + 'tick2').remove();\n plotinfo.xaxislayer.selectAll('.' + xa._id + 'divider').remove();\n plotinfo.yaxislayer.selectAll('.' + ya._id + 'divider').remove();\n\n if(plotinfo.gridlayer) plotinfo.gridlayer.selectAll('path').remove();\n if(plotinfo.zerolinelayer) plotinfo.zerolinelayer.selectAll('path').remove();\n\n fullLayout._infolayer.select('.g-' + xa._id + 'title').remove();\n fullLayout._infolayer.select('.g-' + ya._id + 'title').remove();\n });\n }\n\n var axList = (!arg || arg === 'redraw') ? axes.listIds(gd) : arg;\n\n return Lib.syncOrAsync(axList.map(function(axId) {\n return function() {\n if(!axId) return;\n\n var ax = axes.getFromId(gd, axId);\n var axDone = axes.drawOne(gd, ax, opts);\n\n ax._r = ax.range.slice();\n ax._rl = Lib.simpleMap(ax._r, ax.r2l);\n\n return axDone;\n };\n }));\n};\n\n/**\n * Draw one cartesian axis\n *\n * @param {DOM element} gd\n * @param {object} ax (full) axis object\n * @param {object} opts\n * - @param {boolean} skipTitle (set to true to skip axis title draw call)\n *\n * Depends on:\n * - ax._mainSubplot (from linkSubplots)\n * - ax._mainAxis\n * - ax._anchorAxis\n * - ax._subplotsWith\n * - ax._counterDomainMin, ax._counterDomainMax (optionally, from linkSubplots)\n * - ax._tickAngles (on redraw only, old value relinked during supplyDefaults)\n * - ax._mainLinePosition (from lsInner)\n * - ax._mainMirrorPosition\n * - ax._linepositions\n *\n * Fills in:\n * - ax._vals:\n * - ax._gridVals:\n * - ax._selections:\n * - ax._tickAngles:\n * - ax._depth (when required only):\n * - and calls ax.setScale\n */\naxes.drawOne = function(gd, ax, opts) {\n opts = opts || {};\n\n var i, sp, plotinfo;\n\n ax.setScale();\n\n var fullLayout = gd._fullLayout;\n var axId = ax._id;\n var axLetter = axId.charAt(0);\n var counterLetter = axes.counterLetter(axId);\n var mainPlotinfo = fullLayout._plots[ax._mainSubplot];\n\n // this happens when updating matched group with 'missing' axes\n if(!mainPlotinfo) return;\n\n var mainAxLayer = mainPlotinfo[axLetter + 'axislayer'];\n var mainLinePosition = ax._mainLinePosition;\n var mainMirrorPosition = ax._mainMirrorPosition;\n\n var vals = ax._vals = axes.calcTicks(ax);\n\n // Add a couple of axis properties that should cause us to recreate\n // elements. Used in d3 data function.\n var axInfo = [ax.mirror, mainLinePosition, mainMirrorPosition].join('_');\n for(i = 0; i < vals.length; i++) {\n vals[i].axInfo = axInfo;\n }\n\n // stash selections to avoid DOM queries e.g.\n // - stash tickLabels selection, so that drawTitle can use it to scoot title\n ax._selections = {};\n // stash tick angle (including the computed 'auto' values) per tick-label class\n // linkup 'previous' tick angles on redraws\n if(ax._tickAngles) ax._prevTickAngles = ax._tickAngles;\n ax._tickAngles = {};\n // measure [in px] between axis position and outward-most part of bounding box\n // (touching either the tick label or ticks)\n // depth can be expansive to compute, so we only do so when required\n ax._depth = null;\n\n // calcLabelLevelBbox can be expensive,\n // so make sure to not call it twice during the same Axes.drawOne call\n // by stashing label-level bounding boxes per tick-label class\n var llbboxes = {};\n function getLabelLevelBbox(suffix) {\n var cls = axId + (suffix || 'tick');\n if(!llbboxes[cls]) llbboxes[cls] = calcLabelLevelBbox(ax, cls);\n return llbboxes[cls];\n }\n\n if(!ax.visible) return;\n\n var transFn = axes.makeTransFn(ax);\n var tickVals;\n // We remove zero lines, grid lines, and inside ticks if they're within 1px of the end\n // The key case here is removing zero lines when the axis bound is zero\n var valsClipped;\n\n if(ax.tickson === 'boundaries') {\n var boundaryVals = getBoundaryVals(ax, vals);\n valsClipped = axes.clipEnds(ax, boundaryVals);\n tickVals = ax.ticks === 'inside' ? valsClipped : boundaryVals;\n } else {\n valsClipped = axes.clipEnds(ax, vals);\n tickVals = ax.ticks === 'inside' ? valsClipped : vals;\n }\n\n var gridVals = ax._gridVals = valsClipped;\n var dividerVals = getDividerVals(ax, vals);\n\n if(!fullLayout._hasOnlyLargeSploms) {\n var subplotsWithAx = ax._subplotsWith;\n\n // keep track of which subplots (by main counter axis) we've already\n // drawn grids for, so we don't overdraw overlaying subplots\n var finishedGrids = {};\n\n for(i = 0; i < subplotsWithAx.length; i++) {\n sp = subplotsWithAx[i];\n plotinfo = fullLayout._plots[sp];\n\n var counterAxis = plotinfo[counterLetter + 'axis'];\n var mainCounterID = counterAxis._mainAxis._id;\n if(finishedGrids[mainCounterID]) continue;\n finishedGrids[mainCounterID] = 1;\n\n var gridPath = axLetter === 'x' ?\n 'M0,' + counterAxis._offset + 'v' + counterAxis._length :\n 'M' + counterAxis._offset + ',0h' + counterAxis._length;\n\n axes.drawGrid(gd, ax, {\n vals: gridVals,\n counterAxis: counterAxis,\n layer: plotinfo.gridlayer.select('.' + axId),\n path: gridPath,\n transFn: transFn\n });\n axes.drawZeroLine(gd, ax, {\n counterAxis: counterAxis,\n layer: plotinfo.zerolinelayer,\n path: gridPath,\n transFn: transFn\n });\n }\n }\n\n var tickSigns = axes.getTickSigns(ax);\n var tickSubplots = [];\n\n if(ax.ticks) {\n var mainTickPath = axes.makeTickPath(ax, mainLinePosition, tickSigns[2]);\n var mirrorTickPath;\n var fullTickPath;\n if(ax._anchorAxis && ax.mirror && ax.mirror !== true) {\n mirrorTickPath = axes.makeTickPath(ax, mainMirrorPosition, tickSigns[3]);\n fullTickPath = mainTickPath + mirrorTickPath;\n } else {\n mirrorTickPath = '';\n fullTickPath = mainTickPath;\n }\n\n var tickPath;\n if(ax.showdividers && ax.ticks === 'outside' && ax.tickson === 'boundaries') {\n var dividerLookup = {};\n for(i = 0; i < dividerVals.length; i++) {\n dividerLookup[dividerVals[i].x] = 1;\n }\n tickPath = function(d) {\n return dividerLookup[d.x] ? mirrorTickPath : fullTickPath;\n };\n } else {\n tickPath = fullTickPath;\n }\n\n axes.drawTicks(gd, ax, {\n vals: tickVals,\n layer: mainAxLayer,\n path: tickPath,\n transFn: transFn\n });\n\n if(ax.mirror === 'allticks') {\n tickSubplots = Object.keys(ax._linepositions || {});\n }\n }\n\n for(i = 0; i < tickSubplots.length; i++) {\n sp = tickSubplots[i];\n plotinfo = fullLayout._plots[sp];\n // [bottom or left, top or right], free and main are handled above\n var linepositions = ax._linepositions[sp] || [];\n var spTickPath = axes.makeTickPath(ax, linepositions[0], tickSigns[0]) +\n axes.makeTickPath(ax, linepositions[1], tickSigns[1]);\n\n axes.drawTicks(gd, ax, {\n vals: tickVals,\n layer: plotinfo[axLetter + 'axislayer'],\n path: spTickPath,\n transFn: transFn\n });\n }\n\n var seq = [];\n\n // tick labels - for now just the main labels.\n // TODO: mirror labels, esp for subplots\n\n seq.push(function() {\n return axes.drawLabels(gd, ax, {\n vals: vals,\n layer: mainAxLayer,\n transFn: transFn,\n labelFns: axes.makeLabelFns(ax, mainLinePosition)\n });\n });\n\n if(ax.type === 'multicategory') {\n var pad = {x: 2, y: 10}[axLetter];\n\n seq.push(function() {\n var bboxKey = {x: 'height', y: 'width'}[axLetter];\n var standoff = getLabelLevelBbox()[bboxKey] + pad +\n (ax._tickAngles[axId + 'tick'] ? ax.tickfont.size * LINE_SPACING : 0);\n\n return axes.drawLabels(gd, ax, {\n vals: getSecondaryLabelVals(ax, vals),\n layer: mainAxLayer,\n cls: axId + 'tick2',\n repositionOnUpdate: true,\n secondary: true,\n transFn: transFn,\n labelFns: axes.makeLabelFns(ax, mainLinePosition + standoff * tickSigns[4])\n });\n });\n\n seq.push(function() {\n ax._depth = tickSigns[4] * (getLabelLevelBbox('tick2')[ax.side] - mainLinePosition);\n\n return drawDividers(gd, ax, {\n vals: dividerVals,\n layer: mainAxLayer,\n path: axes.makeTickPath(ax, mainLinePosition, tickSigns[4], ax._depth),\n transFn: transFn\n });\n });\n } else if(ax.title.hasOwnProperty('standoff')) {\n seq.push(function() {\n ax._depth = tickSigns[4] * (getLabelLevelBbox()[ax.side] - mainLinePosition);\n });\n }\n\n var hasRangeSlider = Registry.getComponentMethod('rangeslider', 'isVisible')(ax);\n\n seq.push(function() {\n var s = ax.side.charAt(0);\n var sMirror = OPPOSITE_SIDE[ax.side].charAt(0);\n var pos = axes.getPxPosition(gd, ax);\n var outsideTickLen = ax.ticks === 'outside' ? ax.ticklen : 0;\n var llbbox;\n\n var push;\n var mirrorPush;\n var rangeSliderPush;\n\n if(ax.automargin || hasRangeSlider) {\n if(ax.type === 'multicategory') {\n llbbox = getLabelLevelBbox('tick2');\n } else {\n llbbox = getLabelLevelBbox();\n if(axLetter === 'x' && s === 'b') {\n ax._depth = Math.max(llbbox.width > 0 ? llbbox.bottom - pos : 0, outsideTickLen);\n }\n }\n }\n\n if(ax.automargin) {\n push = {x: 0, y: 0, r: 0, l: 0, t: 0, b: 0};\n var domainIndices = [0, 1];\n\n if(axLetter === 'x') {\n if(s === 'b') {\n push[s] = ax._depth;\n } else {\n push[s] = ax._depth = Math.max(llbbox.width > 0 ? pos - llbbox.top : 0, outsideTickLen);\n domainIndices.reverse();\n }\n\n if(llbbox.width > 0) {\n var rExtra = llbbox.right - (ax._offset + ax._length);\n if(rExtra > 0) {\n push.xr = 1;\n push.r = rExtra;\n }\n var lExtra = ax._offset - llbbox.left;\n if(lExtra > 0) {\n push.xl = 0;\n push.l = lExtra;\n }\n }\n } else {\n if(s === 'l') {\n push[s] = ax._depth = Math.max(llbbox.height > 0 ? pos - llbbox.left : 0, outsideTickLen);\n } else {\n push[s] = ax._depth = Math.max(llbbox.height > 0 ? llbbox.right - pos : 0, outsideTickLen);\n domainIndices.reverse();\n }\n\n if(llbbox.height > 0) {\n var bExtra = llbbox.bottom - (ax._offset + ax._length);\n if(bExtra > 0) {\n push.yb = 0;\n push.b = bExtra;\n }\n var tExtra = ax._offset - llbbox.top;\n if(tExtra > 0) {\n push.yt = 1;\n push.t = tExtra;\n }\n }\n }\n\n push[counterLetter] = ax.anchor === 'free' ?\n ax.position :\n ax._anchorAxis.domain[domainIndices[0]];\n\n if(ax.title.text !== fullLayout._dfltTitle[axLetter]) {\n push[s] += approxTitleDepth(ax) + (ax.title.standoff || 0);\n }\n\n if(ax.mirror && ax.anchor !== 'free') {\n mirrorPush = {x: 0, y: 0, r: 0, l: 0, t: 0, b: 0};\n\n mirrorPush[sMirror] = ax.linewidth;\n if(ax.mirror && ax.mirror !== true) mirrorPush[sMirror] += outsideTickLen;\n\n if(ax.mirror === true || ax.mirror === 'ticks') {\n mirrorPush[counterLetter] = ax._anchorAxis.domain[domainIndices[1]];\n } else if(ax.mirror === 'all' || ax.mirror === 'allticks') {\n mirrorPush[counterLetter] = [ax._counterDomainMin, ax._counterDomainMax][domainIndices[1]];\n }\n }\n }\n\n if(hasRangeSlider) {\n rangeSliderPush = Registry.getComponentMethod('rangeslider', 'autoMarginOpts')(gd, ax);\n }\n\n Plots.autoMargin(gd, axAutoMarginID(ax), push);\n Plots.autoMargin(gd, axMirrorAutoMarginID(ax), mirrorPush);\n Plots.autoMargin(gd, rangeSliderAutoMarginID(ax), rangeSliderPush);\n });\n\n if(!opts.skipTitle &&\n !(hasRangeSlider && ax.side === 'bottom')\n ) {\n seq.push(function() { return drawTitle(gd, ax); });\n }\n\n return Lib.syncOrAsync(seq);\n};\n\nfunction getBoundaryVals(ax, vals) {\n var out = [];\n var i;\n\n // boundaryVals are never used for labels;\n // no need to worry about the other tickTextObj keys\n var _push = function(d, bndIndex) {\n var xb = d.xbnd[bndIndex];\n if(xb !== null) {\n out.push(Lib.extendFlat({}, d, {x: xb}));\n }\n };\n\n if(vals.length) {\n for(i = 0; i < vals.length; i++) {\n _push(vals[i], 0);\n }\n _push(vals[i - 1], 1);\n }\n\n return out;\n}\n\nfunction getSecondaryLabelVals(ax, vals) {\n var out = [];\n var lookup = {};\n\n for(var i = 0; i < vals.length; i++) {\n var d = vals[i];\n if(lookup[d.text2]) {\n lookup[d.text2].push(d.x);\n } else {\n lookup[d.text2] = [d.x];\n }\n }\n\n for(var k in lookup) {\n out.push(tickTextObj(ax, Lib.interp(lookup[k], 0.5), k));\n }\n\n return out;\n}\n\nfunction getDividerVals(ax, vals) {\n var out = [];\n var i, current;\n\n var reversed = (vals.length && vals[vals.length - 1].x < vals[0].x);\n\n // never used for labels;\n // no need to worry about the other tickTextObj keys\n var _push = function(d, bndIndex) {\n var xb = d.xbnd[bndIndex];\n if(xb !== null) {\n out.push(Lib.extendFlat({}, d, {x: xb}));\n }\n };\n\n if(ax.showdividers && vals.length) {\n for(i = 0; i < vals.length; i++) {\n var d = vals[i];\n if(d.text2 !== current) {\n _push(d, reversed ? 1 : 0);\n }\n current = d.text2;\n }\n _push(vals[i - 1], reversed ? 0 : 1);\n }\n\n return out;\n}\n\nfunction calcLabelLevelBbox(ax, cls) {\n var top, bottom;\n var left, right;\n\n if(ax._selections[cls].size()) {\n top = Infinity;\n bottom = -Infinity;\n left = Infinity;\n right = -Infinity;\n ax._selections[cls].each(function() {\n var thisLabel = selectTickLabel(this);\n // Use parent node , to make Drawing.bBox\n // retrieve a bbox computed with transform info\n //\n // To improve perf, it would be nice to use `thisLabel.node()`\n // (like in fixLabelOverlaps) instead and use Axes.getPxPosition\n // together with the makeLabelFns outputs and `tickangle`\n // to compute one bbox per (tick value x tick style)\n var bb = Drawing.bBox(thisLabel.node().parentNode);\n top = Math.min(top, bb.top);\n bottom = Math.max(bottom, bb.bottom);\n left = Math.min(left, bb.left);\n right = Math.max(right, bb.right);\n });\n } else {\n top = 0;\n bottom = 0;\n left = 0;\n right = 0;\n }\n\n return {\n top: top,\n bottom: bottom,\n left: left,\n right: right,\n height: bottom - top,\n width: right - left\n };\n}\n\n/**\n * Which direction do the 'ax.side' values, and free ticks go?\n *\n * @param {object} ax (full) axis object\n * - {string} _id (starting with 'x' or 'y')\n * - {string} side\n * - {string} ticks\n * @return {array} all entries are either -1 or 1\n * - [0]: sign for top/right ticks (i.e. negative SVG direction)\n * - [1]: sign for bottom/left ticks (i.e. positive SVG direction)\n * - [2]: sign for ticks corresponding to 'ax.side'\n * - [3]: sign for ticks mirroring 'ax.side'\n * - [4]: sign of arrow starting at axis pointing towards margin\n */\naxes.getTickSigns = function(ax) {\n var axLetter = ax._id.charAt(0);\n var sideOpposite = {x: 'top', y: 'right'}[axLetter];\n var main = ax.side === sideOpposite ? 1 : -1;\n var out = [-1, 1, main, -main];\n // then we flip if outside XOR y axis\n if((ax.ticks !== 'inside') === (axLetter === 'x')) {\n out = out.map(function(v) { return -v; });\n }\n // independent of `ticks`; do not flip this one\n if(ax.side) {\n out.push({l: -1, t: -1, r: 1, b: 1}[ax.side.charAt(0)]);\n }\n return out;\n};\n\n/**\n * Make axis translate transform function\n *\n * @param {object} ax (full) axis object\n * - {string} _id\n * - {number} _offset\n * - {fn} l2p\n * @return {fn} function of calcTicks items\n */\naxes.makeTransFn = function(ax) {\n var axLetter = ax._id.charAt(0);\n var offset = ax._offset;\n return axLetter === 'x' ?\n function(d) { return 'translate(' + (offset + ax.l2p(d.x)) + ',0)'; } :\n function(d) { return 'translate(0,' + (offset + ax.l2p(d.x)) + ')'; };\n};\n\n/**\n * Make axis tick path string\n *\n * @param {object} ax (full) axis object\n * - {string} _id\n * - {number} ticklen\n * - {number} linewidth\n * @param {number} shift along direction of ticklen\n * @param {1 or -1} sgn tick sign\n * @param {number (optional)} len tick length\n * @return {string}\n */\naxes.makeTickPath = function(ax, shift, sgn, len) {\n len = len !== undefined ? len : ax.ticklen;\n\n var axLetter = ax._id.charAt(0);\n var pad = (ax.linewidth || 1) / 2;\n\n return axLetter === 'x' ?\n 'M0,' + (shift + pad * sgn) + 'v' + (len * sgn) :\n 'M' + (shift + pad * sgn) + ',0h' + (len * sgn);\n};\n\n/**\n * Make axis tick label x, y and anchor functions\n *\n * @param {object} ax (full) axis object\n * - {string} _id\n * - {string} ticks\n * - {number} ticklen\n * - {string} side\n * - {number} linewidth\n * - {number} tickfont.size\n * - {boolean} showline\n * @param {number} shift\n * @param {number} angle [in degrees] ...\n * @return {object}\n * - {fn} xFn\n * - {fn} yFn\n * - {fn} anchorFn\n * - {fn} heightFn\n * - {number} labelStandoff (gap parallel to ticks)\n * - {number} labelShift (gap perpendicular to ticks)\n */\naxes.makeLabelFns = function(ax, shift, angle) {\n var axLetter = ax._id.charAt(0);\n var ticksOnOutsideLabels = ax.tickson !== 'boundaries' && ax.ticks === 'outside';\n\n var labelStandoff = 0;\n var labelShift = 0;\n\n if(ticksOnOutsideLabels) {\n labelStandoff += ax.ticklen;\n }\n if(angle && ax.ticks === 'outside') {\n var rad = Lib.deg2rad(angle);\n labelStandoff = ax.ticklen * Math.cos(rad) + 1;\n labelShift = ax.ticklen * Math.sin(rad);\n }\n if(ax.showticklabels && (ticksOnOutsideLabels || ax.showline)) {\n labelStandoff += 0.2 * ax.tickfont.size;\n }\n labelStandoff += (ax.linewidth || 1) / 2;\n\n var out = {\n labelStandoff: labelStandoff,\n labelShift: labelShift\n };\n\n var x0, y0, ff, flipIt;\n\n if(axLetter === 'x') {\n flipIt = ax.side === 'bottom' ? 1 : -1;\n x0 = labelShift * flipIt;\n y0 = shift + labelStandoff * flipIt;\n ff = ax.side === 'bottom' ? 1 : -0.2;\n\n out.xFn = function(d) { return d.dx + x0; };\n out.yFn = function(d) { return d.dy + y0 + d.fontSize * ff; };\n out.anchorFn = function(d, a) {\n if(!isNumeric(a) || a === 0 || a === 180) {\n return 'middle';\n }\n return (a * flipIt < 0) ? 'end' : 'start';\n };\n out.heightFn = function(d, a, h) {\n return (a < -60 || a > 60) ? -0.5 * h :\n ax.side === 'top' ? -h :\n 0;\n };\n } else if(axLetter === 'y') {\n flipIt = ax.side === 'right' ? 1 : -1;\n x0 = labelStandoff;\n y0 = -labelShift * flipIt;\n ff = Math.abs(ax.tickangle) === 90 ? 0.5 : 0;\n\n out.xFn = function(d) { return d.dx + shift + (x0 + d.fontSize * ff) * flipIt; };\n out.yFn = function(d) { return d.dy + y0 + d.fontSize * MID_SHIFT; };\n out.anchorFn = function(d, a) {\n if(isNumeric(a) && Math.abs(a) === 90) {\n return 'middle';\n }\n return ax.side === 'right' ? 'start' : 'end';\n };\n out.heightFn = function(d, a, h) {\n a *= ax.side === 'left' ? 1 : -1;\n return a < -30 ? -h :\n a < 30 ? -0.5 * h :\n 0;\n };\n }\n\n return out;\n};\n\nfunction tickDataFn(d) {\n return [d.text, d.x, d.axInfo, d.font, d.fontSize, d.fontColor].join('_');\n}\n\n/**\n * Draw axis ticks\n *\n * @param {DOM element} gd\n * @param {object} ax (full) axis object\n * - {string} _id\n * - {string} ticks\n * - {number} linewidth\n * - {string} tickcolor\n * @param {object} opts\n * - {array of object} vals (calcTicks output-like)\n * - {d3 selection} layer\n * - {string or fn} path\n * - {fn} transFn\n * - {boolean} crisp (set to false to unset crisp-edge SVG rendering)\n */\naxes.drawTicks = function(gd, ax, opts) {\n opts = opts || {};\n\n var cls = ax._id + 'tick';\n\n var ticks = opts.layer.selectAll('path.' + cls)\n .data(ax.ticks ? opts.vals : [], tickDataFn);\n\n ticks.exit().remove();\n\n ticks.enter().append('path')\n .classed(cls, 1)\n .classed('ticks', 1)\n .classed('crisp', opts.crisp !== false)\n .call(Color.stroke, ax.tickcolor)\n .style('stroke-width', Drawing.crispRound(gd, ax.tickwidth, 1) + 'px')\n .attr('d', opts.path);\n\n ticks.attr('transform', opts.transFn);\n};\n\n/**\n * Draw axis grid\n *\n * @param {DOM element} gd\n * @param {object} ax (full) axis object\n * - {string} _id\n * - {boolean} showgrid\n * - {string} gridcolor\n * - {string} gridwidth\n * - {boolean} zeroline\n * - {string} type\n * - {string} dtick\n * @param {object} opts\n * - {array of object} vals (calcTicks output-like)\n * - {d3 selection} layer\n * - {object} counterAxis (full axis object corresponding to counter axis)\n * optional - only required if this axis supports zero lines\n * - {string or fn} path\n * - {fn} transFn\n * - {boolean} crisp (set to false to unset crisp-edge SVG rendering)\n */\naxes.drawGrid = function(gd, ax, opts) {\n opts = opts || {};\n\n var cls = ax._id + 'grid';\n var vals = opts.vals;\n var counterAx = opts.counterAxis;\n if(ax.showgrid === false) {\n vals = [];\n } else if(counterAx && axes.shouldShowZeroLine(gd, ax, counterAx)) {\n var isArrayMode = ax.tickmode === 'array';\n for(var i = 0; i < vals.length; i++) {\n var xi = vals[i].x;\n if(isArrayMode ? !xi : (Math.abs(xi) < ax.dtick / 100)) {\n vals = vals.slice(0, i).concat(vals.slice(i + 1));\n // In array mode you can in principle have multiple\n // ticks at 0, so test them all. Otherwise once we found\n // one we can stop.\n if(isArrayMode) i--;\n else break;\n }\n }\n }\n\n var grid = opts.layer.selectAll('path.' + cls)\n .data(vals, tickDataFn);\n\n grid.exit().remove();\n\n grid.enter().append('path')\n .classed(cls, 1)\n .classed('crisp', opts.crisp !== false);\n\n ax._gw = Drawing.crispRound(gd, ax.gridwidth, 1);\n\n grid.attr('transform', opts.transFn)\n .attr('d', opts.path)\n .call(Color.stroke, ax.gridcolor || '#ddd')\n .style('stroke-width', ax._gw + 'px');\n\n if(typeof opts.path === 'function') grid.attr('d', opts.path);\n};\n\n/**\n * Draw axis zero-line\n *\n * @param {DOM element} gd\n * @param {object} ax (full) axis object\n * - {string} _id\n * - {boolean} zeroline\n * - {number} zerolinewidth\n * - {string} zerolinecolor\n * - {number (optional)} _gridWidthCrispRound\n * @param {object} opts\n * - {d3 selection} layer\n * - {object} counterAxis (full axis object corresponding to counter axis)\n * - {string or fn} path\n * - {fn} transFn\n * - {boolean} crisp (set to false to unset crisp-edge SVG rendering)\n */\naxes.drawZeroLine = function(gd, ax, opts) {\n opts = opts || opts;\n\n var cls = ax._id + 'zl';\n var show = axes.shouldShowZeroLine(gd, ax, opts.counterAxis);\n\n var zl = opts.layer.selectAll('path.' + cls)\n .data(show ? [{x: 0, id: ax._id}] : []);\n\n zl.exit().remove();\n\n zl.enter().append('path')\n .classed(cls, 1)\n .classed('zl', 1)\n .classed('crisp', opts.crisp !== false)\n .each(function() {\n // use the fact that only one element can enter to trigger a sort.\n // If several zerolines enter at the same time we will sort once per,\n // but generally this should be a minimal overhead.\n opts.layer.selectAll('path').sort(function(da, db) {\n return axisIds.idSort(da.id, db.id);\n });\n });\n\n zl.attr('transform', opts.transFn)\n .attr('d', opts.path)\n .call(Color.stroke, ax.zerolinecolor || Color.defaultLine)\n .style('stroke-width', Drawing.crispRound(gd, ax.zerolinewidth, ax._gw || 1) + 'px');\n};\n\n/**\n * Draw axis tick labels\n *\n * @param {DOM element} gd\n * @param {object} ax (full) axis object\n * - {string} _id\n * - {boolean} showticklabels\n * - {number} tickangle\n * - {object (optional)} _selections\n * - {object} (optional)} _tickAngles\n * - {object} (optional)} _prevTickAngles\n * @param {object} opts\n * - {array of object} vals (calcTicks output-like)\n * - {d3 selection} layer\n * - {string (optional)} cls (node className)\n * - {boolean} repositionOnUpdate (set to true to reposition update selection)\n * - {boolean} secondary\n * - {fn} transFn\n * - {object} labelFns\n * + {fn} xFn\n * + {fn} yFn\n * + {fn} anchorFn\n * + {fn} heightFn\n */\naxes.drawLabels = function(gd, ax, opts) {\n opts = opts || {};\n\n var fullLayout = gd._fullLayout;\n var axId = ax._id;\n var axLetter = axId.charAt(0);\n var cls = opts.cls || axId + 'tick';\n var vals = opts.vals;\n var labelFns = opts.labelFns;\n var tickAngle = opts.secondary ? 0 : ax.tickangle;\n var prevAngle = (ax._prevTickAngles || {})[cls];\n\n var tickLabels = opts.layer.selectAll('g.' + cls)\n .data(ax.showticklabels ? vals : [], tickDataFn);\n\n var labelsReady = [];\n\n tickLabels.enter().append('g')\n .classed(cls, 1)\n .append('text')\n // only so tex has predictable alignment that we can\n // alter later\n .attr('text-anchor', 'middle')\n .each(function(d) {\n var thisLabel = d3.select(this);\n var newPromise = gd._promises.length;\n\n thisLabel\n .call(svgTextUtils.positionText, labelFns.xFn(d), labelFns.yFn(d))\n .call(Drawing.font, d.font, d.fontSize, d.fontColor)\n .text(d.text)\n .call(svgTextUtils.convertToTspans, gd);\n\n if(gd._promises[newPromise]) {\n // if we have an async label, we'll deal with that\n // all here so take it out of gd._promises and\n // instead position the label and promise this in\n // labelsReady\n labelsReady.push(gd._promises.pop().then(function() {\n positionLabels(thisLabel, tickAngle);\n }));\n } else {\n // sync label: just position it now.\n positionLabels(thisLabel, tickAngle);\n }\n });\n\n tickLabels.exit().remove();\n\n if(opts.repositionOnUpdate) {\n tickLabels.each(function(d) {\n d3.select(this).select('text')\n .call(svgTextUtils.positionText, labelFns.xFn(d), labelFns.yFn(d));\n });\n }\n\n function positionLabels(s, angle) {\n s.each(function(d) {\n var thisLabel = d3.select(this);\n var mathjaxGroup = thisLabel.select('.text-math-group');\n var anchor = labelFns.anchorFn(d, angle);\n\n var transform = opts.transFn.call(thisLabel.node(), d) +\n ((isNumeric(angle) && +angle !== 0) ?\n (' rotate(' + angle + ',' + labelFns.xFn(d) + ',' +\n (labelFns.yFn(d) - d.fontSize / 2) + ')') :\n '');\n\n // how much to shift a multi-line label to center it vertically.\n var nLines = svgTextUtils.lineCount(thisLabel);\n var lineHeight = LINE_SPACING * d.fontSize;\n var anchorHeight = labelFns.heightFn(d, isNumeric(angle) ? +angle : 0, (nLines - 1) * lineHeight);\n\n if(anchorHeight) {\n transform += ' translate(0, ' + anchorHeight + ')';\n }\n\n if(mathjaxGroup.empty()) {\n thisLabel.select('text').attr({\n transform: transform,\n 'text-anchor': anchor\n });\n } else {\n var mjWidth = Drawing.bBox(mathjaxGroup.node()).width;\n var mjShift = mjWidth * {end: -0.5, start: 0.5}[anchor];\n mathjaxGroup.attr('transform', transform + (mjShift ? 'translate(' + mjShift + ',0)' : ''));\n }\n });\n }\n\n // make sure all labels are correctly positioned at their base angle\n // the positionLabels call above is only for newly drawn labels.\n // do this without waiting, using the last calculated angle to\n // minimize flicker, then do it again when we know all labels are\n // there, putting back the prescribed angle to check for overlaps.\n positionLabels(tickLabels, (prevAngle + 1) ? prevAngle : tickAngle);\n\n function allLabelsReady() {\n return labelsReady.length && Promise.all(labelsReady);\n }\n\n var autoangle = null;\n\n function fixLabelOverlaps() {\n positionLabels(tickLabels, tickAngle);\n\n // check for auto-angling if x labels overlap\n // don't auto-angle at all for log axes with\n // base and digit format\n if(vals.length && axLetter === 'x' && !isNumeric(tickAngle) &&\n (ax.type !== 'log' || String(ax.dtick).charAt(0) !== 'D')\n ) {\n autoangle = 0;\n\n var maxFontSize = 0;\n var lbbArray = [];\n var i;\n\n tickLabels.each(function(d) {\n maxFontSize = Math.max(maxFontSize, d.fontSize);\n\n var x = ax.l2p(d.x);\n var thisLabel = selectTickLabel(this);\n var bb = Drawing.bBox(thisLabel.node());\n\n lbbArray.push({\n // ignore about y, just deal with x overlaps\n top: 0,\n bottom: 10,\n height: 10,\n left: x - bb.width / 2,\n // impose a 2px gap\n right: x + bb.width / 2 + 2,\n width: bb.width + 2\n });\n });\n\n if((ax.tickson === 'boundaries' || ax.showdividers) && !opts.secondary) {\n var gap = 2;\n if(ax.ticks) gap += ax.tickwidth / 2;\n\n // TODO should secondary labels also fall into this fix-overlap regime?\n\n for(i = 0; i < lbbArray.length; i++) {\n var xbnd = vals[i].xbnd;\n var lbb = lbbArray[i];\n if(\n (xbnd[0] !== null && (lbb.left - ax.l2p(xbnd[0])) < gap) ||\n (xbnd[1] !== null && (ax.l2p(xbnd[1]) - lbb.right) < gap)\n ) {\n autoangle = 90;\n break;\n }\n }\n } else {\n var vLen = vals.length;\n var tickSpacing = Math.abs((vals[vLen - 1].x - vals[0].x) * ax._m) / (vLen - 1);\n var rotate90 = (tickSpacing < maxFontSize * 2.5) || ax.type === 'multicategory';\n\n // any overlap at all - set 30 degrees or 90 degrees\n for(i = 0; i < lbbArray.length - 1; i++) {\n if(Lib.bBoxIntersect(lbbArray[i], lbbArray[i + 1])) {\n autoangle = rotate90 ? 90 : 30;\n break;\n }\n }\n }\n\n if(autoangle) {\n positionLabels(tickLabels, autoangle);\n }\n }\n }\n\n if(ax._selections) {\n ax._selections[cls] = tickLabels;\n }\n\n var seq = [allLabelsReady];\n\n // N.B. during auto-margin redraws, if the axis fixed its label overlaps\n // by rotating 90 degrees, do not attempt to re-fix its label overlaps\n // as this can lead to infinite redraw loops!\n if(ax.automargin && fullLayout._redrawFromAutoMarginCount && prevAngle === 90) {\n autoangle = 90;\n seq.push(function() {\n positionLabels(tickLabels, prevAngle);\n });\n } else {\n seq.push(fixLabelOverlaps);\n }\n\n // save current tick angle for future redraws\n if(ax._tickAngles) {\n seq.push(function() {\n ax._tickAngles[cls] = autoangle === null ?\n (isNumeric(tickAngle) ? tickAngle : 0) :\n autoangle;\n });\n }\n\n var done = Lib.syncOrAsync(seq);\n if(done && done.then) gd._promises.push(done);\n return done;\n};\n\n/**\n * Draw axis dividers\n *\n * @param {DOM element} gd\n * @param {object} ax (full) axis object\n * - {string} _id\n * - {string} showdividers\n * - {number} dividerwidth\n * - {string} dividercolor\n * @param {object} opts\n * - {array of object} vals (calcTicks output-like)\n * - {d3 selection} layer\n * - {fn} path\n * - {fn} transFn\n */\nfunction drawDividers(gd, ax, opts) {\n var cls = ax._id + 'divider';\n var vals = opts.vals;\n\n var dividers = opts.layer.selectAll('path.' + cls)\n .data(vals, tickDataFn);\n\n dividers.exit().remove();\n\n dividers.enter().insert('path', ':first-child')\n .classed(cls, 1)\n .classed('crisp', 1)\n .call(Color.stroke, ax.dividercolor)\n .style('stroke-width', Drawing.crispRound(gd, ax.dividerwidth, 1) + 'px');\n\n dividers\n .attr('transform', opts.transFn)\n .attr('d', opts.path);\n}\n\n/**\n * Get axis position in px, that is the distance for the graph's\n * top (left) edge for x (y) axes.\n *\n * @param {DOM element} gd\n * @param {object} ax (full) axis object\n * - {string} _id\n * - {string} side\n * if anchored:\n * - {object} _anchorAxis\n * Otherwise:\n * - {number} position\n * @return {number}\n */\naxes.getPxPosition = function(gd, ax) {\n var gs = gd._fullLayout._size;\n var axLetter = ax._id.charAt(0);\n var side = ax.side;\n var anchorAxis;\n\n if(ax.anchor !== 'free') {\n anchorAxis = ax._anchorAxis;\n } else if(axLetter === 'x') {\n anchorAxis = {\n _offset: gs.t + (1 - (ax.position || 0)) * gs.h,\n _length: 0\n };\n } else if(axLetter === 'y') {\n anchorAxis = {\n _offset: gs.l + (ax.position || 0) * gs.w,\n _length: 0\n };\n }\n\n if(side === 'top' || side === 'left') {\n return anchorAxis._offset;\n } else if(side === 'bottom' || side === 'right') {\n return anchorAxis._offset + anchorAxis._length;\n }\n};\n\n/**\n * Approximate axis title depth (w/o computing its bounding box)\n *\n * @param {object} ax (full) axis object\n * - {string} title.text\n * - {number} title.font.size\n * - {number} title.standoff\n * @return {number} (in px)\n */\nfunction approxTitleDepth(ax) {\n var fontSize = ax.title.font.size;\n var extraLines = (ax.title.text.match(svgTextUtils.BR_TAG_ALL) || []).length;\n if(ax.title.hasOwnProperty('standoff')) {\n return extraLines ?\n fontSize * (CAP_SHIFT + (extraLines * LINE_SPACING)) :\n fontSize * CAP_SHIFT;\n } else {\n return extraLines ?\n fontSize * (extraLines + 1) * LINE_SPACING :\n fontSize;\n }\n}\n\n/**\n * Draw axis title, compute default standoff if necessary\n *\n * @param {DOM element} gd\n * @param {object} ax (full) axis object\n * - {string} _id\n * - {string} _name\n * - {string} side\n * - {number} title.font.size\n * - {object} _selections\n *\n * - {number} _depth\n * - {number} title.standoff\n * OR\n * - {number} linewidth\n * - {boolean} showticklabels\n */\nfunction drawTitle(gd, ax) {\n var fullLayout = gd._fullLayout;\n var axId = ax._id;\n var axLetter = axId.charAt(0);\n var fontSize = ax.title.font.size;\n\n var titleStandoff;\n\n if(ax.title.hasOwnProperty('standoff')) {\n titleStandoff = ax._depth + ax.title.standoff + approxTitleDepth(ax);\n } else {\n if(ax.type === 'multicategory') {\n titleStandoff = ax._depth;\n } else {\n var offsetBase = 1.5;\n titleStandoff = 10 + fontSize * offsetBase + (ax.linewidth ? ax.linewidth - 1 : 0);\n }\n\n if(axLetter === 'x') {\n titleStandoff += ax.side === 'top' ?\n fontSize * (ax.showticklabels ? 1 : 0) :\n fontSize * (ax.showticklabels ? 1.5 : 0.5);\n } else {\n titleStandoff += ax.side === 'right' ?\n fontSize * (ax.showticklabels ? 1 : 0.5) :\n fontSize * (ax.showticklabels ? 0.5 : 0);\n }\n }\n\n var pos = axes.getPxPosition(gd, ax);\n var transform, x, y;\n\n if(axLetter === 'x') {\n x = ax._offset + ax._length / 2;\n y = (ax.side === 'top') ? pos - titleStandoff : pos + titleStandoff;\n } else {\n y = ax._offset + ax._length / 2;\n x = (ax.side === 'right') ? pos + titleStandoff : pos - titleStandoff;\n transform = {rotate: '-90', offset: 0};\n }\n\n var avoid;\n\n if(ax.type !== 'multicategory') {\n var tickLabels = ax._selections[ax._id + 'tick'];\n\n avoid = {\n selection: tickLabels,\n side: ax.side\n };\n\n if(tickLabels && tickLabels.node() && tickLabels.node().parentNode) {\n var translation = Drawing.getTranslate(tickLabels.node().parentNode);\n avoid.offsetLeft = translation.x;\n avoid.offsetTop = translation.y;\n }\n\n if(ax.title.hasOwnProperty('standoff')) {\n avoid.pad = 0;\n }\n }\n\n return Titles.draw(gd, axId + 'title', {\n propContainer: ax,\n propName: ax._name + '.title.text',\n placeholder: fullLayout._dfltTitle[axLetter],\n avoid: avoid,\n transform: transform,\n attributes: {x: x, y: y, 'text-anchor': 'middle'}\n });\n}\n\naxes.shouldShowZeroLine = function(gd, ax, counterAxis) {\n var rng = Lib.simpleMap(ax.range, ax.r2l);\n return (\n (rng[0] * rng[1] <= 0) &&\n ax.zeroline &&\n (ax.type === 'linear' || ax.type === '-') &&\n !(ax.rangebreaks && ax.maskBreaks(0) === BADNUM) &&\n (\n clipEnds(ax, 0) ||\n !anyCounterAxLineAtZero(gd, ax, counterAxis, rng) ||\n hasBarsOrFill(gd, ax)\n )\n );\n};\n\naxes.clipEnds = function(ax, vals) {\n return vals.filter(function(d) { return clipEnds(ax, d.x); });\n};\n\nfunction clipEnds(ax, l) {\n var p = ax.l2p(l);\n return (p > 1 && p < ax._length - 1);\n}\n\nfunction anyCounterAxLineAtZero(gd, ax, counterAxis, rng) {\n var mainCounterAxis = counterAxis._mainAxis;\n if(!mainCounterAxis) return;\n\n var fullLayout = gd._fullLayout;\n var axLetter = ax._id.charAt(0);\n var counterLetter = axes.counterLetter(ax._id);\n\n var zeroPosition = ax._offset + (\n ((Math.abs(rng[0]) < Math.abs(rng[1])) === (axLetter === 'x')) ?\n 0 : ax._length\n );\n\n function lineNearZero(ax2) {\n if(!ax2.showline || !ax2.linewidth) return false;\n var tolerance = Math.max((ax2.linewidth + ax.zerolinewidth) / 2, 1);\n\n function closeEnough(pos2) {\n return typeof pos2 === 'number' && Math.abs(pos2 - zeroPosition) < tolerance;\n }\n\n if(closeEnough(ax2._mainLinePosition) || closeEnough(ax2._mainMirrorPosition)) {\n return true;\n }\n var linePositions = ax2._linepositions || {};\n for(var k in linePositions) {\n if(closeEnough(linePositions[k][0]) || closeEnough(linePositions[k][1])) {\n return true;\n }\n }\n }\n\n var plotinfo = fullLayout._plots[counterAxis._mainSubplot];\n if(!(plotinfo.mainplotinfo || plotinfo).overlays.length) {\n return lineNearZero(counterAxis, zeroPosition);\n }\n\n var counterLetterAxes = axes.list(gd, counterLetter);\n for(var i = 0; i < counterLetterAxes.length; i++) {\n var counterAxis2 = counterLetterAxes[i];\n if(\n counterAxis2._mainAxis === mainCounterAxis &&\n lineNearZero(counterAxis2, zeroPosition)\n ) {\n return true;\n }\n }\n}\n\nfunction hasBarsOrFill(gd, ax) {\n var fullData = gd._fullData;\n var subplot = ax._mainSubplot;\n var axLetter = ax._id.charAt(0);\n\n for(var i = 0; i < fullData.length; i++) {\n var trace = fullData[i];\n\n if(trace.visible === true && (trace.xaxis + trace.yaxis) === subplot) {\n if(\n Registry.traceIs(trace, 'bar-like') &&\n trace.orientation === {x: 'h', y: 'v'}[axLetter]\n ) return true;\n\n if(\n trace.fill &&\n trace.fill.charAt(trace.fill.length - 1) === axLetter\n ) return true;\n }\n }\n return false;\n}\n\nfunction selectTickLabel(gTick) {\n var s = d3.select(gTick);\n var mj = s.select('.text-math-group');\n return mj.empty() ? s.select('text') : mj;\n}\n\n/**\n * Find all margin pushers for 2D axes and reserve them for later use\n * Both label and rangeslider automargin calculations happen later so\n * we need to explicitly allow their ids in order to not delete them.\n *\n * TODO: can we pull the actual automargin calls forward to avoid this hack?\n * We're probably also doing multiple redraws in this case, would be faster\n * if we can just do the whole calculation ahead of time and draw once.\n */\naxes.allowAutoMargin = function(gd) {\n var axList = axes.list(gd, '', true);\n for(var i = 0; i < axList.length; i++) {\n var ax = axList[i];\n if(ax.automargin) {\n Plots.allowAutoMargin(gd, axAutoMarginID(ax));\n if(ax.mirror) {\n Plots.allowAutoMargin(gd, axMirrorAutoMarginID(ax));\n }\n }\n if(Registry.getComponentMethod('rangeslider', 'isVisible')(ax)) {\n Plots.allowAutoMargin(gd, rangeSliderAutoMarginID(ax));\n }\n }\n};\n\nfunction axAutoMarginID(ax) { return ax._id + '.automargin'; }\nfunction axMirrorAutoMarginID(ax) { return axAutoMarginID(ax) + '.mirror'; }\nfunction rangeSliderAutoMarginID(ax) { return ax._id + '.rangeslider'; }\n\n// swap all the presentation attributes of the axes showing these traces\naxes.swap = function(gd, traces) {\n var axGroups = makeAxisGroups(gd, traces);\n\n for(var i = 0; i < axGroups.length; i++) {\n swapAxisGroup(gd, axGroups[i].x, axGroups[i].y);\n }\n};\n\nfunction makeAxisGroups(gd, traces) {\n var groups = [];\n var i, j;\n\n for(i = 0; i < traces.length; i++) {\n var groupsi = [];\n var xi = gd._fullData[traces[i]].xaxis;\n var yi = gd._fullData[traces[i]].yaxis;\n if(!xi || !yi) continue; // not a 2D cartesian trace?\n\n for(j = 0; j < groups.length; j++) {\n if(groups[j].x.indexOf(xi) !== -1 || groups[j].y.indexOf(yi) !== -1) {\n groupsi.push(j);\n }\n }\n\n if(!groupsi.length) {\n groups.push({x: [xi], y: [yi]});\n continue;\n }\n\n var group0 = groups[groupsi[0]];\n var groupj;\n\n if(groupsi.length > 1) {\n for(j = 1; j < groupsi.length; j++) {\n groupj = groups[groupsi[j]];\n mergeAxisGroups(group0.x, groupj.x);\n mergeAxisGroups(group0.y, groupj.y);\n }\n }\n mergeAxisGroups(group0.x, [xi]);\n mergeAxisGroups(group0.y, [yi]);\n }\n\n return groups;\n}\n\nfunction mergeAxisGroups(intoSet, fromSet) {\n for(var i = 0; i < fromSet.length; i++) {\n if(intoSet.indexOf(fromSet[i]) === -1) intoSet.push(fromSet[i]);\n }\n}\n\nfunction swapAxisGroup(gd, xIds, yIds) {\n var xFullAxes = [];\n var yFullAxes = [];\n var layout = gd.layout;\n var i, j;\n\n for(i = 0; i < xIds.length; i++) xFullAxes.push(axes.getFromId(gd, xIds[i]));\n for(i = 0; i < yIds.length; i++) yFullAxes.push(axes.getFromId(gd, yIds[i]));\n\n var allAxKeys = Object.keys(axAttrs);\n\n var noSwapAttrs = [\n 'anchor', 'domain', 'overlaying', 'position', 'side', 'tickangle', 'editType'\n ];\n var numericTypes = ['linear', 'log'];\n\n for(i = 0; i < allAxKeys.length; i++) {\n var keyi = allAxKeys[i];\n var xVal = xFullAxes[0][keyi];\n var yVal = yFullAxes[0][keyi];\n var allEqual = true;\n var coerceLinearX = false;\n var coerceLinearY = false;\n if(keyi.charAt(0) === '_' || typeof xVal === 'function' ||\n noSwapAttrs.indexOf(keyi) !== -1) {\n continue;\n }\n for(j = 1; j < xFullAxes.length && allEqual; j++) {\n var xVali = xFullAxes[j][keyi];\n if(keyi === 'type' && numericTypes.indexOf(xVal) !== -1 &&\n numericTypes.indexOf(xVali) !== -1 && xVal !== xVali) {\n // type is special - if we find a mixture of linear and log,\n // coerce them all to linear on flipping\n coerceLinearX = true;\n } else if(xVali !== xVal) allEqual = false;\n }\n for(j = 1; j < yFullAxes.length && allEqual; j++) {\n var yVali = yFullAxes[j][keyi];\n if(keyi === 'type' && numericTypes.indexOf(yVal) !== -1 &&\n numericTypes.indexOf(yVali) !== -1 && yVal !== yVali) {\n // type is special - if we find a mixture of linear and log,\n // coerce them all to linear on flipping\n coerceLinearY = true;\n } else if(yFullAxes[j][keyi] !== yVal) allEqual = false;\n }\n if(allEqual) {\n if(coerceLinearX) layout[xFullAxes[0]._name].type = 'linear';\n if(coerceLinearY) layout[yFullAxes[0]._name].type = 'linear';\n swapAxisAttrs(layout, keyi, xFullAxes, yFullAxes, gd._fullLayout._dfltTitle);\n }\n }\n\n // now swap x&y for any annotations anchored to these x & y\n for(i = 0; i < gd._fullLayout.annotations.length; i++) {\n var ann = gd._fullLayout.annotations[i];\n if(xIds.indexOf(ann.xref) !== -1 &&\n yIds.indexOf(ann.yref) !== -1) {\n Lib.swapAttrs(layout.annotations[i], ['?']);\n }\n }\n}\n\nfunction swapAxisAttrs(layout, key, xFullAxes, yFullAxes, dfltTitle) {\n // in case the value is the default for either axis,\n // look at the first axis in each list and see if\n // this key's value is undefined\n var np = Lib.nestedProperty;\n var xVal = np(layout[xFullAxes[0]._name], key).get();\n var yVal = np(layout[yFullAxes[0]._name], key).get();\n var i;\n\n if(key === 'title') {\n // special handling of placeholder titles\n if(xVal && xVal.text === dfltTitle.x) {\n xVal.text = dfltTitle.y;\n }\n if(yVal && yVal.text === dfltTitle.y) {\n yVal.text = dfltTitle.x;\n }\n }\n\n for(i = 0; i < xFullAxes.length; i++) {\n np(layout, xFullAxes[i]._name + '.' + key).set(yVal);\n }\n for(i = 0; i < yFullAxes.length; i++) {\n np(layout, yFullAxes[i]._name + '.' + key).set(xVal);\n }\n}\n\nfunction isAngular(ax) {\n return ax._id === 'angularaxis';\n}\n\nfunction moveOutsideBreak(v, ax) {\n var len = ax._rangebreaks.length;\n for(var k = 0; k < len; k++) {\n var brk = ax._rangebreaks[k];\n if(v >= brk.min && v < brk.max) {\n return brk.max;\n }\n }\n return v;\n}\n\n},{\"../../components/color\":595,\"../../components/drawing\":617,\"../../components/titles\":690,\"../../constants/alignment\":697,\"../../constants/numerical\":704,\"../../lib\":728,\"../../lib/svg_text_utils\":752,\"../../plots/plots\":839,\"../../registry\":859,\"./autorange\":775,\"./axis_autotype\":777,\"./axis_ids\":779,\"./clean_ticks\":781,\"./layout_attributes\":790,\"./set_convert\":796,\"d3\":164,\"fast-isnumeric\":236}],777:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Lib = _dereq_('../../lib');\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\n\nmodule.exports = function autoType(array, calendar, opts) {\n opts = opts || {};\n\n if(!opts.noMultiCategory && multiCategory(array)) return 'multicategory';\n if(moreDates(array, calendar)) return 'date';\n if(category(array)) return 'category';\n if(linearOK(array)) return 'linear';\n else return '-';\n};\n\n// is there at least one number in array? If not, we should leave\n// ax.type empty so it can be autoset later\nfunction linearOK(array) {\n if(!array) return false;\n\n for(var i = 0; i < array.length; i++) {\n if(isNumeric(array[i])) return true;\n }\n\n return false;\n}\n\n// does the array a have mostly dates rather than numbers?\n// note: some values can be neither (such as blanks, text)\n// 2- or 4-digit integers can be both, so require twice as many\n// dates as non-dates, to exclude cases with mostly 2 & 4 digit\n// numbers and a few dates\n// as with categories, consider DISTINCT values only.\nfunction moreDates(a, calendar) {\n // test at most 1000 points, evenly spaced\n var inc = Math.max(1, (a.length - 1) / 1000);\n var dcnt = 0;\n var ncnt = 0;\n var seen = {};\n\n for(var i = 0; i < a.length; i += inc) {\n var ai = a[Math.round(i)];\n var stri = String(ai);\n if(seen[stri]) continue;\n seen[stri] = 1;\n\n if(Lib.isDateTime(ai, calendar)) dcnt += 1;\n if(isNumeric(ai)) ncnt += 1;\n }\n\n return (dcnt > ncnt * 2);\n}\n\n// are the (x,y)-values in gd.data mostly text?\n// require twice as many DISTINCT categories as distinct numbers\nfunction category(a) {\n // test at most 1000 points\n var inc = Math.max(1, (a.length - 1) / 1000);\n var curvenums = 0;\n var curvecats = 0;\n var seen = {};\n\n for(var i = 0; i < a.length; i += inc) {\n var ai = a[Math.round(i)];\n var stri = String(ai);\n if(seen[stri]) continue;\n seen[stri] = 1;\n\n if(typeof ai === 'boolean') curvecats++;\n else if(Lib.cleanNumber(ai) !== BADNUM) curvenums++;\n else if(typeof ai === 'string') curvecats++;\n }\n\n return curvecats > curvenums * 2;\n}\n\n// very-loose requirements for multicategory,\n// trace modules that should never auto-type to multicategory\n// should be declared with 'noMultiCategory'\nfunction multiCategory(a) {\n return Lib.isArrayOrTypedArray(a[0]) && Lib.isArrayOrTypedArray(a[1]);\n}\n\n},{\"../../constants/numerical\":704,\"../../lib\":728,\"fast-isnumeric\":236}],778:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\n\nvar handleArrayContainerDefaults = _dereq_('../array_container_defaults');\n\nvar layoutAttributes = _dereq_('./layout_attributes');\nvar handleTickValueDefaults = _dereq_('./tick_value_defaults');\nvar handleTickMarkDefaults = _dereq_('./tick_mark_defaults');\nvar handleTickLabelDefaults = _dereq_('./tick_label_defaults');\nvar handleCategoryOrderDefaults = _dereq_('./category_order_defaults');\nvar handleLineGridDefaults = _dereq_('./line_grid_defaults');\nvar setConvert = _dereq_('./set_convert');\n\nvar DAY_OF_WEEK = _dereq_('./constants').WEEKDAY_PATTERN;\nvar HOUR = _dereq_('./constants').HOUR_PATTERN;\n\n/**\n * options: object containing:\n *\n * letter: 'x' or 'y'\n * title: name of the axis (ie 'Colorbar') to go in default title\n * font: the default font to inherit\n * outerTicks: boolean, should ticks default to outside?\n * showGrid: boolean, should gridlines be shown by default?\n * noHover: boolean, this axis doesn't support hover effects?\n * noTickson: boolean, this axis doesn't support 'tickson'\n * data: the plot data, used to manage categories\n * bgColor: the plot background color, to calculate default gridline colors\n * calendar:\n * splomStash:\n * visibleDflt: boolean\n * reverseDflt: boolean\n * automargin: boolean\n */\nmodule.exports = function handleAxisDefaults(containerIn, containerOut, coerce, options, layoutOut) {\n var letter = options.letter;\n var font = options.font || {};\n var splomStash = options.splomStash || {};\n\n var visible = coerce('visible', !options.visibleDflt);\n\n var axTemplate = containerOut._template || {};\n var axType = containerOut.type || axTemplate.type || '-';\n\n if(axType === 'date') {\n var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleDefaults');\n handleCalendarDefaults(containerIn, containerOut, 'calendar', options.calendar);\n }\n\n setConvert(containerOut, layoutOut);\n\n var autorangeDflt = !containerOut.isValidRange(containerIn.range);\n if(autorangeDflt && options.reverseDflt) autorangeDflt = 'reversed';\n var autoRange = coerce('autorange', autorangeDflt);\n if(autoRange && (axType === 'linear' || axType === '-')) coerce('rangemode');\n\n coerce('range');\n containerOut.cleanRange();\n\n handleCategoryOrderDefaults(containerIn, containerOut, coerce, options);\n\n if(axType !== 'category' && !options.noHover) coerce('hoverformat');\n\n var dfltColor = coerce('color');\n // if axis.color was provided, use it for fonts too; otherwise,\n // inherit from global font color in case that was provided.\n // Compare to dflt rather than to containerIn, so we can provide color via\n // template too.\n var dfltFontColor = (dfltColor !== layoutAttributes.color.dflt) ? dfltColor : font.color;\n // try to get default title from splom trace, fallback to graph-wide value\n var dfltTitle = splomStash.label || layoutOut._dfltTitle[letter];\n\n handleTickLabelDefaults(containerIn, containerOut, coerce, axType, options, {pass: 1});\n if(!visible) return containerOut;\n\n coerce('title.text', dfltTitle);\n Lib.coerceFont(coerce, 'title.font', {\n family: font.family,\n size: Math.round(font.size * 1.2),\n color: dfltFontColor\n });\n\n handleTickValueDefaults(containerIn, containerOut, coerce, axType);\n handleTickLabelDefaults(containerIn, containerOut, coerce, axType, options, {pass: 2});\n handleTickMarkDefaults(containerIn, containerOut, coerce, options);\n handleLineGridDefaults(containerIn, containerOut, coerce, {\n dfltColor: dfltColor,\n bgColor: options.bgColor,\n showGrid: options.showGrid,\n attributes: layoutAttributes\n });\n\n if(containerOut.showline || containerOut.ticks) coerce('mirror');\n\n if(options.automargin) coerce('automargin');\n\n var isMultiCategory = axType === 'multicategory';\n\n if(!options.noTickson &&\n (axType === 'category' || isMultiCategory) &&\n (containerOut.ticks || containerOut.showgrid)\n ) {\n var ticksonDflt;\n if(isMultiCategory) ticksonDflt = 'boundaries';\n coerce('tickson', ticksonDflt);\n }\n\n if(isMultiCategory) {\n var showDividers = coerce('showdividers');\n if(showDividers) {\n coerce('dividercolor');\n coerce('dividerwidth');\n }\n }\n\n if(axType === 'date') {\n handleArrayContainerDefaults(containerIn, containerOut, {\n name: 'rangebreaks',\n inclusionAttr: 'enabled',\n handleItemDefaults: rangebreaksDefaults\n });\n\n if(!containerOut.rangebreaks.length) {\n delete containerOut.rangebreaks;\n } else {\n for(var k = 0; k < containerOut.rangebreaks.length; k++) {\n if(containerOut.rangebreaks[k].pattern === DAY_OF_WEEK) {\n containerOut._hasDayOfWeekBreaks = true;\n break;\n }\n }\n\n setConvert(containerOut, layoutOut);\n\n if(layoutOut._has('scattergl') || layoutOut._has('splom')) {\n for(var i = 0; i < options.data.length; i++) {\n var trace = options.data[i];\n if(trace.type === 'scattergl' || trace.type === 'splom') {\n trace.visible = false;\n Lib.warn(trace.type +\n ' traces do not work on axes with rangebreaks.' +\n ' Setting trace ' + trace.index + ' to `visible: false`.');\n }\n }\n }\n }\n }\n\n return containerOut;\n};\n\nfunction rangebreaksDefaults(itemIn, itemOut, containerOut) {\n function coerce(attr, dflt) {\n return Lib.coerce(itemIn, itemOut, layoutAttributes.rangebreaks, attr, dflt);\n }\n\n var enabled = coerce('enabled');\n\n if(enabled) {\n var bnds = coerce('bounds');\n if(bnds && bnds.length >= 2) {\n var dfltPattern = '';\n var i, q;\n if(bnds.length === 2) {\n for(i = 0; i < 2; i++) {\n q = indexOfDay(bnds[i]);\n if(q) {\n dfltPattern = DAY_OF_WEEK;\n break;\n }\n }\n }\n var pattern = coerce('pattern', dfltPattern);\n if(pattern === DAY_OF_WEEK) {\n for(i = 0; i < 2; i++) {\n q = indexOfDay(bnds[i]);\n if(q) {\n // convert to integers i.e 'Sunday' --> 0\n itemOut.bounds[i] = bnds[i] = q - 1;\n }\n }\n }\n if(pattern) {\n // ensure types and ranges\n for(i = 0; i < 2; i++) {\n q = bnds[i];\n switch(pattern) {\n case DAY_OF_WEEK :\n if(!isNumeric(q)) {\n itemOut.enabled = false;\n return;\n }\n q = +q;\n\n if(\n q !== Math.floor(q) || // don't accept fractional days for mow\n q < 0 || q >= 7\n ) {\n itemOut.enabled = false;\n return;\n }\n // use number\n itemOut.bounds[i] = bnds[i] = q;\n break;\n\n case HOUR :\n if(!isNumeric(q)) {\n itemOut.enabled = false;\n return;\n }\n q = +q;\n\n if(q < 0 || q > 24) { // accept 24\n itemOut.enabled = false;\n return;\n }\n // use number\n itemOut.bounds[i] = bnds[i] = q;\n break;\n }\n }\n }\n\n if(containerOut.autorange === false) {\n var rng = containerOut.range;\n\n // if bounds are bigger than the (set) range, disable break\n if(rng[0] < rng[1]) {\n if(bnds[0] < rng[0] && bnds[1] > rng[1]) {\n itemOut.enabled = false;\n return;\n }\n } else if(bnds[0] > rng[0] && bnds[1] < rng[1]) {\n itemOut.enabled = false;\n return;\n }\n }\n } else {\n var values = coerce('values');\n\n if(values && values.length) {\n coerce('dvalue');\n } else {\n itemOut.enabled = false;\n return;\n }\n }\n }\n}\n\n// these numbers are one more than what bounds would be mapped to\nvar dayStrToNum = {\n sun: 1,\n mon: 2,\n tue: 3,\n wed: 4,\n thu: 5,\n fri: 6,\n sat: 7\n};\n\nfunction indexOfDay(v) {\n if(typeof v !== 'string') return;\n return dayStrToNum[\n v.substr(0, 3).toLowerCase()\n ];\n}\n\n},{\"../../lib\":728,\"../../registry\":859,\"../array_container_defaults\":772,\"./category_order_defaults\":780,\"./constants\":782,\"./layout_attributes\":790,\"./line_grid_defaults\":792,\"./set_convert\":796,\"./tick_label_defaults\":797,\"./tick_mark_defaults\":798,\"./tick_value_defaults\":799,\"fast-isnumeric\":236}],779:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../../registry');\n\nvar constants = _dereq_('./constants');\n\n\n// convert between axis names (xaxis, xaxis2, etc, elements of gd.layout)\n// and axis id's (x, x2, etc). Would probably have ditched 'xaxis'\n// completely in favor of just 'x' if it weren't ingrained in the API etc.\nexports.id2name = function id2name(id) {\n if(typeof id !== 'string' || !id.match(constants.AX_ID_PATTERN)) return;\n var axNum = id.substr(1);\n if(axNum === '1') axNum = '';\n return id.charAt(0) + 'axis' + axNum;\n};\n\nexports.name2id = function name2id(name) {\n if(!name.match(constants.AX_NAME_PATTERN)) return;\n var axNum = name.substr(5);\n if(axNum === '1') axNum = '';\n return name.charAt(0) + axNum;\n};\n\nexports.cleanId = function cleanId(id, axLetter) {\n if(typeof id !== 'string' || !id.match(constants.AX_ID_PATTERN)) return;\n if(axLetter && id.charAt(0) !== axLetter) return;\n\n var axNum = id.substr(1).replace(/^0+/, '');\n if(axNum === '1') axNum = '';\n return id.charAt(0) + axNum;\n};\n\n// get all axis objects, as restricted in listNames\nexports.list = function(gd, axLetter, only2d) {\n var fullLayout = gd._fullLayout;\n if(!fullLayout) return [];\n\n var idList = exports.listIds(gd, axLetter);\n var out = new Array(idList.length);\n var i;\n\n for(i = 0; i < idList.length; i++) {\n var idi = idList[i];\n out[i] = fullLayout[idi.charAt(0) + 'axis' + idi.substr(1)];\n }\n\n if(!only2d) {\n var sceneIds3D = fullLayout._subplots.gl3d || [];\n\n for(i = 0; i < sceneIds3D.length; i++) {\n var scene = fullLayout[sceneIds3D[i]];\n\n if(axLetter) out.push(scene[axLetter + 'axis']);\n else out.push(scene.xaxis, scene.yaxis, scene.zaxis);\n }\n }\n\n return out;\n};\n\n// get all axis ids, optionally restricted by letter\n// this only makes sense for 2d axes\nexports.listIds = function(gd, axLetter) {\n var fullLayout = gd._fullLayout;\n if(!fullLayout) return [];\n\n var subplotLists = fullLayout._subplots;\n if(axLetter) return subplotLists[axLetter + 'axis'];\n return subplotLists.xaxis.concat(subplotLists.yaxis);\n};\n\n// get an axis object from its id 'x','x2' etc\n// optionally, id can be a subplot (ie 'x2y3') and type gets x or y from it\nexports.getFromId = function(gd, id, type) {\n var fullLayout = gd._fullLayout;\n\n if(type === 'x') id = id.replace(/y[0-9]*/, '');\n else if(type === 'y') id = id.replace(/x[0-9]*/, '');\n\n return fullLayout[exports.id2name(id)];\n};\n\n// get an axis object of specified type from the containing trace\nexports.getFromTrace = function(gd, fullTrace, type) {\n var fullLayout = gd._fullLayout;\n var ax = null;\n\n if(Registry.traceIs(fullTrace, 'gl3d')) {\n var scene = fullTrace.scene;\n if(scene.substr(0, 5) === 'scene') {\n ax = fullLayout[scene][type + 'axis'];\n }\n } else {\n ax = exports.getFromId(gd, fullTrace[type + 'axis'] || type);\n }\n\n return ax;\n};\n\n// sort x, x2, x10, y, y2, y10...\nexports.idSort = function(id1, id2) {\n var letter1 = id1.charAt(0);\n var letter2 = id2.charAt(0);\n if(letter1 !== letter2) return letter1 > letter2 ? 1 : -1;\n return +(id1.substr(1) || 1) - +(id2.substr(1) || 1);\n};\n\nexports.getAxisGroup = function getAxisGroup(fullLayout, axId) {\n var matchGroups = fullLayout._axisMatchGroups;\n\n for(var i = 0; i < matchGroups.length; i++) {\n var group = matchGroups[i];\n if(group[axId]) return 'g' + i;\n }\n return axId;\n};\n\n},{\"../../registry\":859,\"./constants\":782}],780:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nfunction findCategories(ax, opts) {\n var dataAttr = opts.dataAttr || ax._id.charAt(0);\n var lookup = {};\n var axData;\n var i, j;\n\n if(opts.axData) {\n // non-x/y case\n axData = opts.axData;\n } else {\n // x/y case\n axData = [];\n for(i = 0; i < opts.data.length; i++) {\n var trace = opts.data[i];\n if(trace[dataAttr + 'axis'] === ax._id) {\n axData.push(trace);\n }\n }\n }\n\n for(i = 0; i < axData.length; i++) {\n var vals = axData[i][dataAttr];\n for(j = 0; j < vals.length; j++) {\n var v = vals[j];\n if(v !== null && v !== undefined) {\n lookup[v] = 1;\n }\n }\n }\n\n return Object.keys(lookup);\n}\n\n/**\n * Fills in category* default and initial categories.\n *\n * @param {object} containerIn : input axis object\n * @param {object} containerOut : full axis object\n * @param {function} coerce : Lib.coerce fn wrapper\n * @param {object} opts :\n * - data {array} : (full) data trace\n * OR\n * - axData {array} : (full) data associated with axis being coerced here\n * - dataAttr {string} : attribute name corresponding to coordinate array\n */\nmodule.exports = function handleCategoryOrderDefaults(containerIn, containerOut, coerce, opts) {\n if(containerOut.type !== 'category') return;\n\n var arrayIn = containerIn.categoryarray;\n var isValidArray = (Array.isArray(arrayIn) && arrayIn.length > 0);\n\n // override default 'categoryorder' value when non-empty array is supplied\n var orderDefault;\n if(isValidArray) orderDefault = 'array';\n\n var order = coerce('categoryorder', orderDefault);\n var array;\n\n // coerce 'categoryarray' only in array order case\n if(order === 'array') {\n array = coerce('categoryarray');\n }\n\n // cannot set 'categoryorder' to 'array' with an invalid 'categoryarray'\n if(!isValidArray && order === 'array') {\n order = containerOut.categoryorder = 'trace';\n }\n\n // set up things for makeCalcdata\n if(order === 'trace') {\n containerOut._initialCategories = [];\n } else if(order === 'array') {\n containerOut._initialCategories = array.slice();\n } else {\n array = findCategories(containerOut, opts).sort();\n if(order === 'category ascending') {\n containerOut._initialCategories = array;\n } else if(order === 'category descending') {\n containerOut._initialCategories = array.reverse();\n }\n }\n};\n\n},{}],781:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar Lib = _dereq_('../../lib');\nvar ONEDAY = _dereq_('../../constants/numerical').ONEDAY;\n\n/**\n * Return a validated dtick value for this axis\n *\n * @param {any} dtick: the candidate dtick. valid values are numbers and strings,\n * and further constrained depending on the axis type.\n * @param {string} axType: the axis type\n */\nexports.dtick = function(dtick, axType) {\n var isLog = axType === 'log';\n var isDate = axType === 'date';\n var isCat = axType === 'category';\n var dtickDflt = isDate ? ONEDAY : 1;\n\n if(!dtick) return dtickDflt;\n\n if(isNumeric(dtick)) {\n dtick = Number(dtick);\n if(dtick <= 0) return dtickDflt;\n if(isCat) {\n // category dtick must be positive integers\n return Math.max(1, Math.round(dtick));\n }\n if(isDate) {\n // date dtick must be at least 0.1ms (our current precision)\n return Math.max(0.1, dtick);\n }\n return dtick;\n }\n\n if(typeof dtick !== 'string' || !(isDate || isLog)) {\n return dtickDflt;\n }\n\n var prefix = dtick.charAt(0);\n var dtickNum = dtick.substr(1);\n dtickNum = isNumeric(dtickNum) ? Number(dtickNum) : 0;\n\n if((dtickNum <= 0) || !(\n // \"M\" gives ticks every (integer) n months\n (isDate && prefix === 'M' && dtickNum === Math.round(dtickNum)) ||\n // \"L\" gives ticks linearly spaced in data (not in position) every (float) f\n (isLog && prefix === 'L') ||\n // \"D1\" gives powers of 10 with all small digits between, \"D2\" gives only 2 and 5\n (isLog && prefix === 'D' && (dtickNum === 1 || dtickNum === 2))\n )) {\n return dtickDflt;\n }\n\n return dtick;\n};\n\n/**\n * Return a validated tick0 for this axis\n *\n * @param {any} tick0: the candidate tick0. Valid values are numbers and strings,\n * further constrained depending on the axis type\n * @param {string} axType: the axis type\n * @param {string} calendar: for date axes, the calendar to validate/convert with\n * @param {any} dtick: an already valid dtick. Only used for D1 and D2 log dticks,\n * which do not support tick0 at all.\n */\nexports.tick0 = function(tick0, axType, calendar, dtick) {\n if(axType === 'date') {\n return Lib.cleanDate(tick0, Lib.dateTick0(calendar));\n }\n if(dtick === 'D1' || dtick === 'D2') {\n // D1 and D2 modes ignore tick0 entirely\n return undefined;\n }\n // Aside from date axes, tick0 must be numeric\n return isNumeric(tick0) ? Number(tick0) : 0;\n};\n\n},{\"../../constants/numerical\":704,\"../../lib\":728,\"fast-isnumeric\":236}],782:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar counterRegex = _dereq_('../../lib/regex').counter;\n\nmodule.exports = {\n idRegex: {\n x: counterRegex('x'),\n y: counterRegex('y')\n },\n\n attrRegex: counterRegex('[xy]axis'),\n\n // axis match regular expression\n xAxisMatch: counterRegex('xaxis'),\n yAxisMatch: counterRegex('yaxis'),\n\n // pattern matching axis ids and names\n // note that this is more permissive than counterRegex, as\n // id2name, name2id, and cleanId accept \"x1\" etc\n AX_ID_PATTERN: /^[xyz][0-9]*$/,\n AX_NAME_PATTERN: /^[xyz]axis[0-9]*$/,\n\n // and for 2D subplots\n SUBPLOT_PATTERN: /^x([0-9]*)y([0-9]*)$/,\n\n HOUR_PATTERN: 'hour',\n WEEKDAY_PATTERN: 'day of week',\n\n // pixels to move mouse before you stop clamping to starting point\n MINDRAG: 8,\n\n // smallest dimension allowed for a select box\n MINSELECT: 12,\n\n // smallest dimension allowed for a zoombox\n MINZOOM: 20,\n\n // width of axis drag regions\n DRAGGERSIZE: 20,\n\n // max pixels off straight before a lasso select line counts as bent\n BENDPX: 1.5,\n\n // delay before a redraw (relayout) after smooth panning and zooming\n REDRAWDELAY: 50,\n\n // throttling limit (ms) for selectPoints calls\n SELECTDELAY: 100,\n\n // cache ID suffix for throttle\n SELECTID: '-select',\n\n // last resort axis ranges for x and y axes if we have no data\n DFLTRANGEX: [-1, 6],\n DFLTRANGEY: [-1, 4],\n\n // Layers to keep trace types in the right order\n // N.B. each 'unique' plot method must have its own layer\n traceLayerClasses: [\n 'imagelayer',\n 'heatmaplayer',\n 'contourcarpetlayer', 'contourlayer',\n 'funnellayer', 'waterfalllayer', 'barlayer',\n 'carpetlayer',\n 'violinlayer',\n 'boxlayer',\n 'ohlclayer',\n 'scattercarpetlayer', 'scatterlayer'\n ],\n\n clipOnAxisFalseQuery: [\n '.scatterlayer',\n '.barlayer',\n '.funnellayer',\n '.waterfalllayer'\n ],\n\n layerValue2layerClass: {\n 'above traces': 'above',\n 'below traces': 'below'\n }\n};\n\n},{\"../../lib/regex\":744}],783:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar id2name = _dereq_('./axis_ids').id2name;\nvar scaleZoom = _dereq_('./scale_zoom');\nvar makePadFn = _dereq_('./autorange').makePadFn;\nvar concatExtremes = _dereq_('./autorange').concatExtremes;\n\nvar ALMOST_EQUAL = _dereq_('../../constants/numerical').ALMOST_EQUAL;\nvar FROM_BL = _dereq_('../../constants/alignment').FROM_BL;\n\nexports.handleConstraintDefaults = function(containerIn, containerOut, coerce, opts) {\n var allAxisIds = opts.allAxisIds;\n var layoutOut = opts.layoutOut;\n var scaleanchorDflt = opts.scaleanchorDflt;\n var constrainDflt = opts.constrainDflt;\n var constraintGroups = layoutOut._axisConstraintGroups;\n var matchGroups = layoutOut._axisMatchGroups;\n var axId = containerOut._id;\n var axLetter = axId.charAt(0);\n var splomStash = ((layoutOut._splomAxes || {})[axLetter] || {})[axId] || {};\n var thisID = containerOut._id;\n var letter = thisID.charAt(0);\n\n // coerce the constraint mechanics even if this axis has no scaleanchor\n // because it may be the anchor of another axis.\n var constrain = coerce('constrain', constrainDflt);\n Lib.coerce(containerIn, containerOut, {\n constraintoward: {\n valType: 'enumerated',\n values: letter === 'x' ? ['left', 'center', 'right'] : ['bottom', 'middle', 'top'],\n dflt: letter === 'x' ? 'center' : 'middle'\n }\n }, 'constraintoward');\n\n var matches, matchOpts;\n\n if((containerIn.matches || splomStash.matches) && !containerOut.fixedrange) {\n matchOpts = getConstraintOpts(matchGroups, thisID, allAxisIds, layoutOut);\n matches = Lib.coerce(containerIn, containerOut, {\n matches: {\n valType: 'enumerated',\n values: matchOpts.linkableAxes || [],\n dflt: splomStash.matches\n }\n }, 'matches');\n }\n\n // 'matches' wins over 'scaleanchor' (for now)\n var scaleanchor, scaleOpts;\n\n if(!matches &&\n !(containerOut.fixedrange && constrain !== 'domain') &&\n (containerIn.scaleanchor || scaleanchorDflt)\n ) {\n scaleOpts = getConstraintOpts(constraintGroups, thisID, allAxisIds, layoutOut, constrain);\n scaleanchor = Lib.coerce(containerIn, containerOut, {\n scaleanchor: {\n valType: 'enumerated',\n values: scaleOpts.linkableAxes || []\n }\n }, 'scaleanchor', scaleanchorDflt);\n }\n\n if(matches) {\n delete containerOut.constrain;\n updateConstraintGroups(matchGroups, matchOpts.thisGroup, thisID, matches, 1);\n } else if(allAxisIds.indexOf(containerIn.matches) !== -1) {\n Lib.warn('ignored ' + containerOut._name + '.matches: \"' +\n containerIn.matches + '\" to avoid either an infinite loop ' +\n 'or because the target axis has fixed range.');\n }\n\n if(scaleanchor) {\n var scaleratio = coerce('scaleratio');\n\n // TODO: I suppose I could do attribute.min: Number.MIN_VALUE to avoid zero,\n // but that seems hacky. Better way to say \"must be a positive number\"?\n // Of course if you use several super-tiny values you could eventually\n // force a product of these to zero and all hell would break loose...\n // Likewise with super-huge values.\n if(!scaleratio) scaleratio = containerOut.scaleratio = 1;\n\n updateConstraintGroups(constraintGroups, scaleOpts.thisGroup, thisID, scaleanchor, scaleratio);\n } else if(allAxisIds.indexOf(containerIn.scaleanchor) !== -1) {\n Lib.warn('ignored ' + containerOut._name + '.scaleanchor: \"' +\n containerIn.scaleanchor + '\" to avoid either an infinite loop ' +\n 'and possibly inconsistent scaleratios, or because the target ' +\n 'axis has fixed range or this axis declares a *matches* constraint.');\n }\n};\n\n// If this axis is already part of a constraint group, we can't\n// scaleanchor any other axis in that group, or we'd make a loop.\n// Filter allAxisIds to enforce this, also matching axis types.\nfunction getConstraintOpts(groups, thisID, allAxisIds, layoutOut, constrain) {\n var doesNotConstrainRange = constrain !== 'range';\n var thisType = layoutOut[id2name(thisID)].type;\n var i, j, idj, axj;\n\n var linkableAxes = [];\n for(j = 0; j < allAxisIds.length; j++) {\n idj = allAxisIds[j];\n if(idj === thisID) continue;\n\n axj = layoutOut[id2name(idj)];\n if(axj.type === thisType) {\n if(!axj.fixedrange) {\n linkableAxes.push(idj);\n } else if(doesNotConstrainRange && axj.anchor) {\n // allow domain constraints on subplots where\n // BOTH axes have fixedrange:true and constrain:domain\n var counterAxj = layoutOut[id2name(axj.anchor)];\n if(counterAxj.fixedrange) {\n linkableAxes.push(idj);\n }\n }\n }\n }\n\n for(i = 0; i < groups.length; i++) {\n if(groups[i][thisID]) {\n var thisGroup = groups[i];\n\n var linkableAxesNoLoops = [];\n for(j = 0; j < linkableAxes.length; j++) {\n idj = linkableAxes[j];\n if(!thisGroup[idj]) linkableAxesNoLoops.push(idj);\n }\n return {linkableAxes: linkableAxesNoLoops, thisGroup: thisGroup};\n }\n }\n\n return {linkableAxes: linkableAxes, thisGroup: null};\n}\n\n/*\n * Add this axis to the axis constraint groups, which is the collection\n * of axes that are all constrained together on scale.\n *\n * constraintGroups: a list of objects. each object is\n * {axis_id: scale_within_group}, where scale_within_group is\n * only important relative to the rest of the group, and defines\n * the relative scales between all axes in the group\n *\n * thisGroup: the group the current axis is already in\n * thisID: the id if the current axis\n * scaleanchor: the id of the axis to scale it with\n * scaleratio: the ratio of this axis to the scaleanchor axis\n */\nfunction updateConstraintGroups(constraintGroups, thisGroup, thisID, scaleanchor, scaleratio) {\n var i, j, groupi, keyj, thisGroupIndex;\n\n if(thisGroup === null) {\n thisGroup = {};\n thisGroup[thisID] = 1;\n thisGroupIndex = constraintGroups.length;\n constraintGroups.push(thisGroup);\n } else {\n thisGroupIndex = constraintGroups.indexOf(thisGroup);\n }\n\n var thisGroupKeys = Object.keys(thisGroup);\n\n // we know that this axis isn't in any other groups, but we don't know\n // about the scaleanchor axis. If it is, we need to merge the groups.\n for(i = 0; i < constraintGroups.length; i++) {\n groupi = constraintGroups[i];\n if(i !== thisGroupIndex && groupi[scaleanchor]) {\n var baseScale = groupi[scaleanchor];\n for(j = 0; j < thisGroupKeys.length; j++) {\n keyj = thisGroupKeys[j];\n groupi[keyj] = baseScale * scaleratio * thisGroup[keyj];\n }\n constraintGroups.splice(thisGroupIndex, 1);\n return;\n }\n }\n\n // otherwise, we insert the new scaleanchor axis as the base scale (1)\n // in its group, and scale the rest of the group to it\n if(scaleratio !== 1) {\n for(j = 0; j < thisGroupKeys.length; j++) {\n thisGroup[thisGroupKeys[j]] *= scaleratio;\n }\n }\n thisGroup[scaleanchor] = 1;\n}\n\nexports.enforce = function enforce(gd) {\n var fullLayout = gd._fullLayout;\n var constraintGroups = fullLayout._axisConstraintGroups || [];\n\n var i, j, axisID, ax, normScale, mode, factor;\n\n for(i = 0; i < constraintGroups.length; i++) {\n var group = constraintGroups[i];\n var axisIDs = Object.keys(group);\n\n var minScale = Infinity;\n var maxScale = 0;\n // mostly matchScale will be the same as minScale\n // ie we expand axis ranges to encompass *everything*\n // that's currently in any of their ranges, but during\n // autorange of a subset of axes we will ignore other\n // axes for this purpose.\n var matchScale = Infinity;\n var normScales = {};\n var axes = {};\n var hasAnyDomainConstraint = false;\n\n // find the (normalized) scale of each axis in the group\n for(j = 0; j < axisIDs.length; j++) {\n axisID = axisIDs[j];\n axes[axisID] = ax = fullLayout[id2name(axisID)];\n\n if(ax._inputDomain) ax.domain = ax._inputDomain.slice();\n else ax._inputDomain = ax.domain.slice();\n\n if(!ax._inputRange) ax._inputRange = ax.range.slice();\n\n // set axis scale here so we can use _m rather than\n // having to calculate it from length and range\n ax.setScale();\n\n // abs: inverted scales still satisfy the constraint\n normScales[axisID] = normScale = Math.abs(ax._m) / group[axisID];\n minScale = Math.min(minScale, normScale);\n if(ax.constrain === 'domain' || !ax._constraintShrinkable) {\n matchScale = Math.min(matchScale, normScale);\n }\n\n // this has served its purpose, so remove it\n delete ax._constraintShrinkable;\n maxScale = Math.max(maxScale, normScale);\n\n if(ax.constrain === 'domain') hasAnyDomainConstraint = true;\n }\n\n // Do we have a constraint mismatch? Give a small buffer for rounding errors\n if(minScale > ALMOST_EQUAL * maxScale && !hasAnyDomainConstraint) continue;\n\n // now increase any ranges we need to until all normalized scales are equal\n for(j = 0; j < axisIDs.length; j++) {\n axisID = axisIDs[j];\n normScale = normScales[axisID];\n ax = axes[axisID];\n mode = ax.constrain;\n\n // even if the scale didn't change, if we're shrinking domain\n // we need to recalculate in case `constraintoward` changed\n if(normScale !== matchScale || mode === 'domain') {\n factor = normScale / matchScale;\n\n if(mode === 'range') {\n scaleZoom(ax, factor);\n } else {\n // mode === 'domain'\n\n var inputDomain = ax._inputDomain;\n var domainShrunk = (ax.domain[1] - ax.domain[0]) /\n (inputDomain[1] - inputDomain[0]);\n var rangeShrunk = (ax.r2l(ax.range[1]) - ax.r2l(ax.range[0])) /\n (ax.r2l(ax._inputRange[1]) - ax.r2l(ax._inputRange[0]));\n\n factor /= domainShrunk;\n\n if(factor * rangeShrunk < 1) {\n // we've asked to magnify the axis more than we can just by\n // enlarging the domain - so we need to constrict range\n ax.domain = ax._input.domain = inputDomain.slice();\n scaleZoom(ax, factor);\n continue;\n }\n\n if(rangeShrunk < 1) {\n // the range has previously been constricted by ^^, but we've\n // switched to the domain-constricted regime, so reset range\n ax.range = ax._input.range = ax._inputRange.slice();\n factor *= rangeShrunk;\n }\n\n if(ax.autorange) {\n /*\n * range & factor may need to change because range was\n * calculated for the larger scaling, so some pixel\n * paddings may get cut off when we reduce the domain.\n *\n * This is easier than the regular autorange calculation\n * because we already know the scaling `m`, but we still\n * need to cut out impossible constraints (like\n * annotations with super-long arrows). That's what\n * outerMin/Max are for - if the expansion was going to\n * go beyond the original domain, it must be impossible\n */\n var rl0 = ax.r2l(ax.range[0]);\n var rl1 = ax.r2l(ax.range[1]);\n var rangeCenter = (rl0 + rl1) / 2;\n var rangeMin = rangeCenter;\n var rangeMax = rangeCenter;\n var halfRange = Math.abs(rl1 - rangeCenter);\n // extra tiny bit for rounding errors, in case we actually\n // *are* expanding to the full domain\n var outerMin = rangeCenter - halfRange * factor * 1.0001;\n var outerMax = rangeCenter + halfRange * factor * 1.0001;\n var getPad = makePadFn(ax);\n\n updateDomain(ax, factor);\n var m = Math.abs(ax._m);\n var extremes = concatExtremes(gd, ax);\n var minArray = extremes.min;\n var maxArray = extremes.max;\n var newVal;\n var k;\n\n for(k = 0; k < minArray.length; k++) {\n newVal = minArray[k].val - getPad(minArray[k]) / m;\n if(newVal > outerMin && newVal < rangeMin) {\n rangeMin = newVal;\n }\n }\n\n for(k = 0; k < maxArray.length; k++) {\n newVal = maxArray[k].val + getPad(maxArray[k]) / m;\n if(newVal < outerMax && newVal > rangeMax) {\n rangeMax = newVal;\n }\n }\n\n var domainExpand = (rangeMax - rangeMin) / (2 * halfRange);\n factor /= domainExpand;\n\n rangeMin = ax.l2r(rangeMin);\n rangeMax = ax.l2r(rangeMax);\n ax.range = ax._input.range = (rl0 < rl1) ?\n [rangeMin, rangeMax] : [rangeMax, rangeMin];\n }\n\n updateDomain(ax, factor);\n }\n }\n }\n }\n};\n\n// For use before autoranging, check if this axis was previously constrained\n// by domain but no longer is\nexports.clean = function clean(gd, ax) {\n if(ax._inputDomain) {\n var isConstrained = false;\n var axId = ax._id;\n var constraintGroups = gd._fullLayout._axisConstraintGroups;\n for(var j = 0; j < constraintGroups.length; j++) {\n if(constraintGroups[j][axId]) {\n isConstrained = true;\n break;\n }\n }\n if(!isConstrained || ax.constrain !== 'domain') {\n ax._input.domain = ax.domain = ax._inputDomain;\n delete ax._inputDomain;\n }\n }\n};\n\nfunction updateDomain(ax, factor) {\n var inputDomain = ax._inputDomain;\n var centerFraction = FROM_BL[ax.constraintoward];\n var center = inputDomain[0] + (inputDomain[1] - inputDomain[0]) * centerFraction;\n\n ax.domain = ax._input.domain = [\n center + (inputDomain[0] - center) / factor,\n center + (inputDomain[1] - center) / factor\n ];\n ax.setScale();\n}\n\n},{\"../../constants/alignment\":697,\"../../constants/numerical\":704,\"../../lib\":728,\"./autorange\":775,\"./axis_ids\":779,\"./scale_zoom\":794}],784:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar tinycolor = _dereq_('tinycolor2');\nvar supportsPassive = _dereq_('has-passive-events');\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\nvar svgTextUtils = _dereq_('../../lib/svg_text_utils');\nvar Color = _dereq_('../../components/color');\nvar Drawing = _dereq_('../../components/drawing');\nvar Fx = _dereq_('../../components/fx');\nvar Axes = _dereq_('./axes');\nvar setCursor = _dereq_('../../lib/setcursor');\nvar dragElement = _dereq_('../../components/dragelement');\nvar helpers = _dereq_('../../components/dragelement/helpers');\nvar selectingOrDrawing = helpers.selectingOrDrawing;\nvar freeMode = helpers.freeMode;\n\nvar FROM_TL = _dereq_('../../constants/alignment').FROM_TL;\nvar clearGlCanvases = _dereq_('../../lib/clear_gl_canvases');\nvar redrawReglTraces = _dereq_('../../plot_api/subroutines').redrawReglTraces;\n\nvar Plots = _dereq_('../plots');\n\nvar getFromId = _dereq_('./axis_ids').getFromId;\nvar prepSelect = _dereq_('./select').prepSelect;\nvar clearSelect = _dereq_('./select').clearSelect;\nvar selectOnClick = _dereq_('./select').selectOnClick;\nvar scaleZoom = _dereq_('./scale_zoom');\n\nvar constants = _dereq_('./constants');\nvar MINDRAG = constants.MINDRAG;\nvar MINZOOM = constants.MINZOOM;\n\n// flag for showing \"doubleclick to zoom out\" only at the beginning\nvar SHOWZOOMOUTTIP = true;\n\n// dragBox: create an element to drag one or more axis ends\n// inputs:\n// plotinfo - which subplot are we making dragboxes on?\n// x,y,w,h - left, top, width, height of the box\n// ns - how does this drag the vertical axis?\n// 'n' - top only\n// 's' - bottom only\n// 'ns' - top and bottom together, difference unchanged\n// ew - same for horizontal axis\nfunction makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {\n // mouseDown stores ms of first mousedown event in the last\n // `gd._context.doubleClickDelay` ms on the drag bars\n // numClicks stores how many mousedowns have been seen\n // within `gd._context.doubleClickDelay` so we can check for click or doubleclick events\n // dragged stores whether a drag has occurred, so we don't have to\n // redraw unnecessarily, ie if no move bigger than MINDRAG or MINZOOM px\n var zoomlayer = gd._fullLayout._zoomlayer;\n var isMainDrag = (ns + ew === 'nsew');\n var singleEnd = (ns + ew).length === 1;\n\n // main subplot x and y (i.e. found in plotinfo - the main ones)\n var xa0, ya0;\n // {ax._id: ax} hash objects\n var xaHash, yaHash;\n // xaHash/yaHash values (arrays)\n var xaxes, yaxes;\n // main axis offsets\n var xs, ys;\n // main axis lengths\n var pw, ph;\n // contains keys 'xaHash', 'yaHash', 'xaxes', and 'yaxes'\n // which are the x/y {ax._id: ax} hash objects and their values\n // for linked axis relative to this subplot\n var links;\n // similar to `links` but for matching axes\n var matches;\n // set to ew/ns val when active, set to '' when inactive\n var xActive, yActive;\n // are all axes in this subplot are fixed?\n var allFixedRanges;\n // do we need to edit x/y ranges?\n var editX, editY;\n // graph-wide optimization flags\n var hasScatterGl, hasSplom, hasSVG;\n // collected changes to be made to the plot by relayout at the end\n var updates;\n\n function recomputeAxisLists() {\n xa0 = plotinfo.xaxis;\n ya0 = plotinfo.yaxis;\n pw = xa0._length;\n ph = ya0._length;\n xs = xa0._offset;\n ys = ya0._offset;\n\n xaHash = {};\n xaHash[xa0._id] = xa0;\n yaHash = {};\n yaHash[ya0._id] = ya0;\n\n // if we're dragging two axes at once, also drag overlays\n if(ns && ew) {\n var overlays = plotinfo.overlays;\n for(var i = 0; i < overlays.length; i++) {\n var xa = overlays[i].xaxis;\n xaHash[xa._id] = xa;\n var ya = overlays[i].yaxis;\n yaHash[ya._id] = ya;\n }\n }\n\n xaxes = hashValues(xaHash);\n yaxes = hashValues(yaHash);\n xActive = isDirectionActive(xaxes, ew);\n yActive = isDirectionActive(yaxes, ns);\n allFixedRanges = !yActive && !xActive;\n\n links = calcLinks(gd, gd._fullLayout._axisConstraintGroups, xaHash, yaHash);\n matches = calcLinks(gd, gd._fullLayout._axisMatchGroups, xaHash, yaHash);\n editX = ew || links.isSubplotConstrained || matches.isSubplotConstrained;\n editY = ns || links.isSubplotConstrained || matches.isSubplotConstrained;\n\n var fullLayout = gd._fullLayout;\n hasScatterGl = fullLayout._has('scattergl');\n hasSplom = fullLayout._has('splom');\n hasSVG = fullLayout._has('svg');\n }\n\n recomputeAxisLists();\n\n var cursor = getDragCursor(yActive + xActive, gd._fullLayout.dragmode, isMainDrag);\n var dragger = makeRectDragger(plotinfo, ns + ew + 'drag', cursor, x, y, w, h);\n\n // still need to make the element if the axes are disabled\n // but nuke its events (except for maindrag which needs them for hover)\n // and stop there\n if(allFixedRanges && !isMainDrag) {\n dragger.onmousedown = null;\n dragger.style.pointerEvents = 'none';\n return dragger;\n }\n\n var dragOptions = {\n element: dragger,\n gd: gd,\n plotinfo: plotinfo\n };\n\n dragOptions.prepFn = function(e, startX, startY) {\n var dragModePrev = dragOptions.dragmode;\n var dragModeNow = gd._fullLayout.dragmode;\n if(dragModeNow !== dragModePrev) {\n dragOptions.dragmode = dragModeNow;\n }\n\n recomputeAxisLists();\n\n if(!allFixedRanges) {\n if(isMainDrag) {\n // main dragger handles all drag modes, and changes\n // to pan (or to zoom if it already is pan) on shift\n if(e.shiftKey) {\n if(dragModeNow === 'pan') dragModeNow = 'zoom';\n else if(!selectingOrDrawing(dragModeNow)) dragModeNow = 'pan';\n } else if(e.ctrlKey) {\n dragModeNow = 'pan';\n }\n } else {\n // all other draggers just pan\n dragModeNow = 'pan';\n }\n }\n\n if(freeMode(dragModeNow)) dragOptions.minDrag = 1;\n else dragOptions.minDrag = undefined;\n\n if(selectingOrDrawing(dragModeNow)) {\n dragOptions.xaxes = xaxes;\n dragOptions.yaxes = yaxes;\n // this attaches moveFn, clickFn, doneFn on dragOptions\n prepSelect(e, startX, startY, dragOptions, dragModeNow);\n } else {\n dragOptions.clickFn = clickFn;\n if(selectingOrDrawing(dragModePrev)) {\n // TODO Fix potential bug\n // Note: clearing / resetting selection state only happens, when user\n // triggers at least one interaction in pan/zoom mode. Otherwise, the\n // select/lasso outlines are deleted (in plots.js.cleanPlot) but the selection\n // cache isn't cleared. So when the user switches back to select/lasso and\n // 'adds to a selection' with Shift, the \"old\", seemingly removed outlines\n // are redrawn again because the selection cache still holds their coordinates.\n // However, this isn't easily solved, since plots.js would need\n // to have a reference to the dragOptions object (which holds the\n // selection cache).\n clearAndResetSelect();\n }\n\n if(!allFixedRanges) {\n if(dragModeNow === 'zoom') {\n dragOptions.moveFn = zoomMove;\n dragOptions.doneFn = zoomDone;\n\n // zoomMove takes care of the threshold, but we need to\n // minimize this so that constrained zoom boxes will flip\n // orientation at the right place\n dragOptions.minDrag = 1;\n\n zoomPrep(e, startX, startY);\n } else if(dragModeNow === 'pan') {\n dragOptions.moveFn = plotDrag;\n dragOptions.doneFn = dragTail;\n }\n }\n }\n\n gd._fullLayout._redrag = function() {\n var dragDataNow = gd._dragdata;\n\n if(dragDataNow && dragDataNow.element === dragger) {\n var dragModeNow = gd._fullLayout.dragmode;\n\n if(!selectingOrDrawing(dragModeNow)) {\n recomputeAxisLists();\n updateSubplots([0, 0, pw, ph]);\n dragOptions.moveFn(dragDataNow.dx, dragDataNow.dy);\n }\n\n // TODO should we try to \"re-select\" under select/lasso modes?\n // probably best to wait for https://github.com/plotly/plotly.js/issues/1851\n }\n };\n };\n\n function clearAndResetSelect() {\n // clear selection polygon cache (if any)\n dragOptions.plotinfo.selection = false;\n // clear selection outlines\n clearSelect(gd);\n }\n\n function clickFn(numClicks, evt) {\n var gd = dragOptions.gd;\n if(gd._fullLayout._activeShapeIndex >= 0) {\n gd._fullLayout._deactivateShape(gd);\n return;\n }\n\n var clickmode = gd._fullLayout.clickmode;\n\n removeZoombox(gd);\n\n if(numClicks === 2 && !singleEnd) doubleClick();\n\n if(isMainDrag) {\n if(clickmode.indexOf('select') > -1) {\n selectOnClick(evt, gd, xaxes, yaxes, plotinfo.id, dragOptions);\n }\n\n if(clickmode.indexOf('event') > -1) {\n Fx.click(gd, evt, plotinfo.id);\n }\n } else if(numClicks === 1 && singleEnd) {\n var ax = ns ? ya0 : xa0;\n var end = (ns === 's' || ew === 'w') ? 0 : 1;\n var attrStr = ax._name + '.range[' + end + ']';\n var initialText = getEndText(ax, end);\n var hAlign = 'left';\n var vAlign = 'middle';\n\n if(ax.fixedrange) return;\n\n if(ns) {\n vAlign = (ns === 'n') ? 'top' : 'bottom';\n if(ax.side === 'right') hAlign = 'right';\n } else if(ew === 'e') hAlign = 'right';\n\n if(gd._context.showAxisRangeEntryBoxes) {\n d3.select(dragger)\n .call(svgTextUtils.makeEditable, {\n gd: gd,\n immediate: true,\n background: gd._fullLayout.paper_bgcolor,\n text: String(initialText),\n fill: ax.tickfont ? ax.tickfont.color : '#444',\n horizontalAlign: hAlign,\n verticalAlign: vAlign\n })\n .on('edit', function(text) {\n var v = ax.d2r(text);\n if(v !== undefined) {\n Registry.call('_guiRelayout', gd, attrStr, v);\n }\n });\n }\n }\n }\n\n dragElement.init(dragOptions);\n\n // x/y px position at start of drag\n var x0, y0;\n // bbox object of the zoombox\n var box;\n // luminance of bg behind zoombox\n var lum;\n // zoombox path outline\n var path0;\n // is zoombox dimmed (during drag)\n var dimmed;\n // 'x'-only, 'y' or 'xy' zooming\n var zoomMode;\n // zoombox d3 selection\n var zb;\n // zoombox corner d3 selection\n var corners;\n // zoom takes over minDrag, so it also has to take over gd._dragged\n var zoomDragged;\n\n function zoomPrep(e, startX, startY) {\n var dragBBox = dragger.getBoundingClientRect();\n x0 = startX - dragBBox.left;\n y0 = startY - dragBBox.top;\n box = {l: x0, r: x0, w: 0, t: y0, b: y0, h: 0};\n lum = gd._hmpixcount ?\n (gd._hmlumcount / gd._hmpixcount) :\n tinycolor(gd._fullLayout.plot_bgcolor).getLuminance();\n path0 = 'M0,0H' + pw + 'V' + ph + 'H0V0';\n dimmed = false;\n zoomMode = 'xy';\n zoomDragged = false;\n zb = makeZoombox(zoomlayer, lum, xs, ys, path0);\n corners = makeCorners(zoomlayer, xs, ys);\n }\n\n function zoomMove(dx0, dy0) {\n if(gd._transitioningWithDuration) {\n return false;\n }\n\n var x1 = Math.max(0, Math.min(pw, dx0 + x0));\n var y1 = Math.max(0, Math.min(ph, dy0 + y0));\n var dx = Math.abs(x1 - x0);\n var dy = Math.abs(y1 - y0);\n\n box.l = Math.min(x0, x1);\n box.r = Math.max(x0, x1);\n box.t = Math.min(y0, y1);\n box.b = Math.max(y0, y1);\n\n function noZoom() {\n zoomMode = '';\n box.r = box.l;\n box.t = box.b;\n corners.attr('d', 'M0,0Z');\n }\n\n if(links.isSubplotConstrained) {\n if(dx > MINZOOM || dy > MINZOOM) {\n zoomMode = 'xy';\n if(dx / pw > dy / ph) {\n dy = dx * ph / pw;\n if(y0 > y1) box.t = y0 - dy;\n else box.b = y0 + dy;\n } else {\n dx = dy * pw / ph;\n if(x0 > x1) box.l = x0 - dx;\n else box.r = x0 + dx;\n }\n corners.attr('d', xyCorners(box));\n } else {\n noZoom();\n }\n } else if(matches.isSubplotConstrained) {\n if(dx > MINZOOM || dy > MINZOOM) {\n zoomMode = 'xy';\n\n var r0 = Math.min(box.l / pw, (ph - box.b) / ph);\n var r1 = Math.max(box.r / pw, (ph - box.t) / ph);\n\n box.l = r0 * pw;\n box.r = r1 * pw;\n box.b = (1 - r0) * ph;\n box.t = (1 - r1) * ph;\n corners.attr('d', xyCorners(box));\n } else {\n noZoom();\n }\n } else if(!yActive || dy < Math.min(Math.max(dx * 0.6, MINDRAG), MINZOOM)) {\n // look for small drags in one direction or the other,\n // and only drag the other axis\n\n if(dx < MINDRAG || !xActive) {\n noZoom();\n } else {\n box.t = 0;\n box.b = ph;\n zoomMode = 'x';\n corners.attr('d', xCorners(box, y0));\n }\n } else if(!xActive || dx < Math.min(dy * 0.6, MINZOOM)) {\n box.l = 0;\n box.r = pw;\n zoomMode = 'y';\n corners.attr('d', yCorners(box, x0));\n } else {\n zoomMode = 'xy';\n corners.attr('d', xyCorners(box));\n }\n box.w = box.r - box.l;\n box.h = box.b - box.t;\n\n if(zoomMode) zoomDragged = true;\n gd._dragged = zoomDragged;\n\n updateZoombox(zb, corners, box, path0, dimmed, lum);\n computeZoomUpdates();\n gd.emit('plotly_relayouting', updates);\n dimmed = true;\n }\n\n function computeZoomUpdates() {\n updates = {};\n\n // TODO: edit linked axes in zoomAxRanges and in dragTail\n if(zoomMode === 'xy' || zoomMode === 'x') {\n zoomAxRanges(xaxes, box.l / pw, box.r / pw, updates, links.xaxes);\n updateMatchedAxRange('x', updates);\n }\n if(zoomMode === 'xy' || zoomMode === 'y') {\n zoomAxRanges(yaxes, (ph - box.b) / ph, (ph - box.t) / ph, updates, links.yaxes);\n updateMatchedAxRange('y', updates);\n }\n }\n\n function zoomDone() {\n computeZoomUpdates();\n removeZoombox(gd);\n dragTail();\n showDoubleClickNotifier(gd);\n }\n\n // scroll zoom, on all draggers except corners\n var scrollViewBox = [0, 0, pw, ph];\n // wait a little after scrolling before redrawing\n var redrawTimer = null;\n var REDRAWDELAY = constants.REDRAWDELAY;\n var mainplot = plotinfo.mainplot ? gd._fullLayout._plots[plotinfo.mainplot] : plotinfo;\n\n function zoomWheel(e) {\n // deactivate mousewheel scrolling on embedded graphs\n // devs can override this with layout._enablescrollzoom,\n // but _ ensures this setting won't leave their page\n if(!gd._context._scrollZoom.cartesian && !gd._fullLayout._enablescrollzoom) {\n return;\n }\n\n clearAndResetSelect();\n\n // If a transition is in progress, then disable any behavior:\n if(gd._transitioningWithDuration) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n\n recomputeAxisLists();\n\n clearTimeout(redrawTimer);\n\n var wheelDelta = -e.deltaY;\n if(!isFinite(wheelDelta)) wheelDelta = e.wheelDelta / 10;\n if(!isFinite(wheelDelta)) {\n Lib.log('Did not find wheel motion attributes: ', e);\n return;\n }\n\n var zoom = Math.exp(-Math.min(Math.max(wheelDelta, -20), 20) / 200);\n var gbb = mainplot.draglayer.select('.nsewdrag').node().getBoundingClientRect();\n var xfrac = (e.clientX - gbb.left) / gbb.width;\n var yfrac = (gbb.bottom - e.clientY) / gbb.height;\n var i;\n\n function zoomWheelOneAxis(ax, centerFraction, zoom) {\n if(ax.fixedrange) return;\n\n var axRange = Lib.simpleMap(ax.range, ax.r2l);\n var v0 = axRange[0] + (axRange[1] - axRange[0]) * centerFraction;\n function doZoom(v) { return ax.l2r(v0 + (v - v0) * zoom); }\n ax.range = axRange.map(doZoom);\n }\n\n if(editX) {\n // if we're only zooming this axis because of constraints,\n // zoom it about the center\n if(!ew) xfrac = 0.5;\n\n for(i = 0; i < xaxes.length; i++) {\n zoomWheelOneAxis(xaxes[i], xfrac, zoom);\n }\n updateMatchedAxRange('x');\n\n scrollViewBox[2] *= zoom;\n scrollViewBox[0] += scrollViewBox[2] * xfrac * (1 / zoom - 1);\n }\n if(editY) {\n if(!ns) yfrac = 0.5;\n\n for(i = 0; i < yaxes.length; i++) {\n zoomWheelOneAxis(yaxes[i], yfrac, zoom);\n }\n updateMatchedAxRange('y');\n\n scrollViewBox[3] *= zoom;\n scrollViewBox[1] += scrollViewBox[3] * (1 - yfrac) * (1 / zoom - 1);\n }\n\n // viewbox redraw at first\n updateSubplots(scrollViewBox);\n ticksAndAnnotations();\n\n gd.emit('plotly_relayouting', updates);\n\n // then replot after a delay to make sure\n // no more scrolling is coming\n redrawTimer = setTimeout(function() {\n scrollViewBox = [0, 0, pw, ph];\n dragTail();\n }, REDRAWDELAY);\n\n e.preventDefault();\n return;\n }\n\n // everything but the corners gets wheel zoom\n if(ns.length * ew.length !== 1) {\n attachWheelEventHandler(dragger, zoomWheel);\n }\n\n // plotDrag: move the plot in response to a drag\n function plotDrag(dx, dy) {\n // If a transition is in progress, then disable any behavior:\n if(gd._transitioningWithDuration) {\n return;\n }\n\n // prevent axis drawing from monkeying with margins until we're done\n gd._fullLayout._replotting = true;\n\n if(xActive === 'ew' || yActive === 'ns') {\n if(xActive) {\n dragAxList(xaxes, dx);\n updateMatchedAxRange('x');\n }\n if(yActive) {\n dragAxList(yaxes, dy);\n updateMatchedAxRange('y');\n }\n updateSubplots([xActive ? -dx : 0, yActive ? -dy : 0, pw, ph]);\n ticksAndAnnotations();\n gd.emit('plotly_relayouting', updates);\n return;\n }\n\n // dz: set a new value for one end (0 or 1) of an axis array axArray,\n // and return a pixel shift for that end for the viewbox\n // based on pixel drag distance d\n // TODO: this makes (generally non-fatal) errors when you get\n // near floating point limits\n function dz(axArray, end, d) {\n var otherEnd = 1 - end;\n var movedAx;\n var newLinearizedEnd;\n for(var i = 0; i < axArray.length; i++) {\n var axi = axArray[i];\n if(axi.fixedrange) continue;\n movedAx = axi;\n newLinearizedEnd = axi._rl[otherEnd] +\n (axi._rl[end] - axi._rl[otherEnd]) / dZoom(d / axi._length);\n var newEnd = axi.l2r(newLinearizedEnd);\n\n // if l2r comes back false or undefined, it means we've dragged off\n // the end of valid ranges - so stop.\n if(newEnd !== false && newEnd !== undefined) axi.range[end] = newEnd;\n }\n return movedAx._length * (movedAx._rl[end] - newLinearizedEnd) /\n (movedAx._rl[end] - movedAx._rl[otherEnd]);\n }\n\n if(links.isSubplotConstrained && xActive && yActive) {\n // dragging a corner of a constrained subplot:\n // respect the fixed corner, but harmonize dx and dy\n var dxySign = ((xActive === 'w') === (yActive === 'n')) ? 1 : -1;\n var dxyFraction = (dx / pw + dxySign * dy / ph) / 2;\n dx = dxyFraction * pw;\n dy = dxySign * dxyFraction * ph;\n }\n\n if(xActive === 'w') dx = dz(xaxes, 0, dx);\n else if(xActive === 'e') dx = dz(xaxes, 1, -dx);\n else if(!xActive) dx = 0;\n\n if(yActive === 'n') dy = dz(yaxes, 1, dy);\n else if(yActive === 's') dy = dz(yaxes, 0, -dy);\n else if(!yActive) dy = 0;\n\n var xStart = (xActive === 'w') ? dx : 0;\n var yStart = (yActive === 'n') ? dy : 0;\n\n if(links.isSubplotConstrained) {\n var i;\n if(!xActive && yActive.length === 1) {\n // dragging one end of the y axis of a constrained subplot\n // scale the other axis the same about its middle\n for(i = 0; i < xaxes.length; i++) {\n xaxes[i].range = xaxes[i]._r.slice();\n scaleZoom(xaxes[i], 1 - dy / ph);\n }\n dx = dy * pw / ph;\n xStart = dx / 2;\n }\n if(!yActive && xActive.length === 1) {\n for(i = 0; i < yaxes.length; i++) {\n yaxes[i].range = yaxes[i]._r.slice();\n scaleZoom(yaxes[i], 1 - dx / pw);\n }\n dy = dx * ph / pw;\n yStart = dy / 2;\n }\n }\n\n updateMatchedAxRange('x');\n updateMatchedAxRange('y');\n updateSubplots([xStart, yStart, pw - dx, ph - dy]);\n ticksAndAnnotations();\n gd.emit('plotly_relayouting', updates);\n }\n\n function updateMatchedAxRange(axLetter, out) {\n var matchedAxes = matches.isSubplotConstrained ?\n {x: yaxes, y: xaxes}[axLetter] :\n matches[axLetter + 'axes'];\n\n var constrainedAxes = matches.isSubplotConstrained ?\n {x: xaxes, y: yaxes}[axLetter] :\n [];\n\n for(var i = 0; i < matchedAxes.length; i++) {\n var ax = matchedAxes[i];\n var axId = ax._id;\n var axId2 = matches.xLinks[axId] || matches.yLinks[axId];\n var ax2 = constrainedAxes[0] || xaHash[axId2] || yaHash[axId2];\n\n if(ax2) {\n if(out) {\n // zoombox case - don't mutate 'range', just add keys in 'updates'\n out[ax._name + '.range[0]'] = out[ax2._name + '.range[0]'];\n out[ax._name + '.range[1]'] = out[ax2._name + '.range[1]'];\n } else {\n ax.range = ax2.range.slice();\n }\n }\n }\n }\n\n // Draw ticks and annotations (and other components) when ranges change.\n // Also records the ranges that have changed for use by update at the end.\n function ticksAndAnnotations() {\n var activeAxIds = [];\n var i;\n\n function pushActiveAxIds(axList) {\n for(i = 0; i < axList.length; i++) {\n if(!axList[i].fixedrange) activeAxIds.push(axList[i]._id);\n }\n }\n\n if(editX) {\n pushActiveAxIds(xaxes);\n pushActiveAxIds(links.xaxes);\n pushActiveAxIds(matches.xaxes);\n }\n if(editY) {\n pushActiveAxIds(yaxes);\n pushActiveAxIds(links.yaxes);\n pushActiveAxIds(matches.yaxes);\n }\n\n updates = {};\n for(i = 0; i < activeAxIds.length; i++) {\n var axId = activeAxIds[i];\n var ax = getFromId(gd, axId);\n Axes.drawOne(gd, ax, {skipTitle: true});\n updates[ax._name + '.range[0]'] = ax.range[0];\n updates[ax._name + '.range[1]'] = ax.range[1];\n }\n\n Axes.redrawComponents(gd, activeAxIds);\n }\n\n function doubleClick() {\n if(gd._transitioningWithDuration) return;\n\n var doubleClickConfig = gd._context.doubleClick;\n\n var axList = [];\n if(xActive) axList = axList.concat(xaxes);\n if(yActive) axList = axList.concat(yaxes);\n if(matches.xaxes) axList = axList.concat(matches.xaxes);\n if(matches.yaxes) axList = axList.concat(matches.yaxes);\n\n var attrs = {};\n var ax, i, rangeInitial;\n\n // For reset+autosize mode:\n // If *any* of the main axes is not at its initial range\n // (or autoranged, if we have no initial range, to match the logic in\n // doubleClickConfig === 'reset' below), we reset.\n // If they are *all* at their initial ranges, then we autosize.\n if(doubleClickConfig === 'reset+autosize') {\n doubleClickConfig = 'autosize';\n\n for(i = 0; i < axList.length; i++) {\n ax = axList[i];\n if((ax._rangeInitial && (\n ax.range[0] !== ax._rangeInitial[0] ||\n ax.range[1] !== ax._rangeInitial[1]\n )) ||\n (!ax._rangeInitial && !ax.autorange)\n ) {\n doubleClickConfig = 'reset';\n break;\n }\n }\n }\n\n if(doubleClickConfig === 'autosize') {\n // don't set the linked axes here, so relayout marks them as shrinkable\n // and we autosize just to the requested axis/axes\n for(i = 0; i < axList.length; i++) {\n ax = axList[i];\n if(!ax.fixedrange) attrs[ax._name + '.autorange'] = true;\n }\n } else if(doubleClickConfig === 'reset') {\n // when we're resetting, reset all linked axes too, so we get back\n // to the fully-auto-with-constraints situation\n if(xActive || links.isSubplotConstrained) axList = axList.concat(links.xaxes);\n if(yActive && !links.isSubplotConstrained) axList = axList.concat(links.yaxes);\n\n if(links.isSubplotConstrained) {\n if(!xActive) axList = axList.concat(xaxes);\n else if(!yActive) axList = axList.concat(yaxes);\n }\n\n for(i = 0; i < axList.length; i++) {\n ax = axList[i];\n\n if(!ax.fixedrange) {\n if(!ax._rangeInitial) {\n attrs[ax._name + '.autorange'] = true;\n } else {\n rangeInitial = ax._rangeInitial;\n attrs[ax._name + '.range[0]'] = rangeInitial[0];\n attrs[ax._name + '.range[1]'] = rangeInitial[1];\n }\n }\n }\n }\n\n gd.emit('plotly_doubleclick', null);\n Registry.call('_guiRelayout', gd, attrs);\n }\n\n // dragTail - finish a drag event with a redraw\n function dragTail() {\n // put the subplot viewboxes back to default (Because we're going to)\n // be repositioning the data in the relayout. But DON'T call\n // ticksAndAnnotations again - it's unnecessary and would overwrite `updates`\n updateSubplots([0, 0, pw, ph]);\n\n // since we may have been redrawing some things during the drag, we may have\n // accumulated MathJax promises - wait for them before we relayout.\n Lib.syncOrAsync([\n Plots.previousPromises,\n function() {\n gd._fullLayout._replotting = false;\n Registry.call('_guiRelayout', gd, updates);\n }\n ], gd);\n }\n\n // updateSubplots - find all plot viewboxes that should be\n // affected by this drag, and update them. look for all plots\n // sharing an affected axis (including the one being dragged),\n // includes also scattergl and splom logic.\n function updateSubplots(viewBox) {\n var fullLayout = gd._fullLayout;\n var plotinfos = fullLayout._plots;\n var subplots = fullLayout._subplots.cartesian;\n var i, sp, xa, ya;\n\n if(hasSplom) {\n Registry.subplotsRegistry.splom.drag(gd);\n }\n\n if(hasScatterGl) {\n for(i = 0; i < subplots.length; i++) {\n sp = plotinfos[subplots[i]];\n xa = sp.xaxis;\n ya = sp.yaxis;\n\n if(sp._scene) {\n var xrng = Lib.simpleMap(xa.range, xa.r2l);\n var yrng = Lib.simpleMap(ya.range, ya.r2l);\n sp._scene.update({range: [xrng[0], yrng[0], xrng[1], yrng[1]]});\n }\n }\n }\n\n if(hasSplom || hasScatterGl) {\n clearGlCanvases(gd);\n redrawReglTraces(gd);\n }\n\n if(hasSVG) {\n var xScaleFactor = viewBox[2] / xa0._length;\n var yScaleFactor = viewBox[3] / ya0._length;\n\n for(i = 0; i < subplots.length; i++) {\n sp = plotinfos[subplots[i]];\n xa = sp.xaxis;\n ya = sp.yaxis;\n\n var editX2 = editX && !xa.fixedrange && xaHash[xa._id];\n var editY2 = editY && !ya.fixedrange && yaHash[ya._id];\n\n var xScaleFactor2, yScaleFactor2;\n var clipDx, clipDy;\n\n if(editX2) {\n xScaleFactor2 = xScaleFactor;\n clipDx = ew ? viewBox[0] : getShift(xa, xScaleFactor2);\n } else if(matches.xaHash[xa._id]) {\n xScaleFactor2 = xScaleFactor;\n clipDx = viewBox[0] * xa._length / xa0._length;\n } else if(matches.yaHash[xa._id]) {\n xScaleFactor2 = yScaleFactor;\n clipDx = yActive === 'ns' ?\n -viewBox[1] * xa._length / ya0._length :\n getShift(xa, xScaleFactor2, {n: 'top', s: 'bottom'}[yActive]);\n } else {\n xScaleFactor2 = getLinkedScaleFactor(xa, xScaleFactor, yScaleFactor);\n clipDx = scaleAndGetShift(xa, xScaleFactor2);\n }\n\n if(editY2) {\n yScaleFactor2 = yScaleFactor;\n clipDy = ns ? viewBox[1] : getShift(ya, yScaleFactor2);\n } else if(matches.yaHash[ya._id]) {\n yScaleFactor2 = yScaleFactor;\n clipDy = viewBox[1] * ya._length / ya0._length;\n } else if(matches.xaHash[ya._id]) {\n yScaleFactor2 = xScaleFactor;\n clipDy = xActive === 'ew' ?\n -viewBox[0] * ya._length / xa0._length :\n getShift(ya, yScaleFactor2, {e: 'right', w: 'left'}[xActive]);\n } else {\n yScaleFactor2 = getLinkedScaleFactor(ya, xScaleFactor, yScaleFactor);\n clipDy = scaleAndGetShift(ya, yScaleFactor2);\n }\n\n // don't scale at all if neither axis is scalable here\n if(!xScaleFactor2 && !yScaleFactor2) {\n continue;\n }\n\n // but if only one is, reset the other axis scaling\n if(!xScaleFactor2) xScaleFactor2 = 1;\n if(!yScaleFactor2) yScaleFactor2 = 1;\n\n var plotDx = xa._offset - clipDx / xScaleFactor2;\n var plotDy = ya._offset - clipDy / yScaleFactor2;\n\n // TODO could be more efficient here:\n // setTranslate and setScale do a lot of extra work\n // when working independently, should perhaps combine\n // them into a single routine.\n sp.clipRect\n .call(Drawing.setTranslate, clipDx, clipDy)\n .call(Drawing.setScale, xScaleFactor2, yScaleFactor2);\n\n sp.plot\n .call(Drawing.setTranslate, plotDx, plotDy)\n .call(Drawing.setScale, 1 / xScaleFactor2, 1 / yScaleFactor2);\n\n // apply an inverse scale to individual points to counteract\n // the scale of the trace group.\n // apply only when scale changes, as adjusting the scale of\n // all the points can be expansive.\n if(xScaleFactor2 !== sp.xScaleFactor || yScaleFactor2 !== sp.yScaleFactor) {\n Drawing.setPointGroupScale(sp.zoomScalePts, xScaleFactor2, yScaleFactor2);\n Drawing.setTextPointsScale(sp.zoomScaleTxt, xScaleFactor2, yScaleFactor2);\n }\n\n Drawing.hideOutsideRangePoints(sp.clipOnAxisFalseTraces, sp);\n\n // update x/y scaleFactor stash\n sp.xScaleFactor = xScaleFactor2;\n sp.yScaleFactor = yScaleFactor2;\n }\n }\n }\n\n // Find the appropriate scaling for this axis, if it's linked to the\n // dragged axes by constraints. 0 is special, it means this axis shouldn't\n // ever be scaled (will be converted to 1 if the other axis is scaled)\n function getLinkedScaleFactor(ax, xScaleFactor, yScaleFactor) {\n if(ax.fixedrange) return 0;\n\n if(editX && links.xaHash[ax._id]) {\n return xScaleFactor;\n }\n if(editY && (links.isSubplotConstrained ? links.xaHash : links.yaHash)[ax._id]) {\n return yScaleFactor;\n }\n return 0;\n }\n\n function scaleAndGetShift(ax, scaleFactor) {\n if(scaleFactor) {\n ax.range = ax._r.slice();\n scaleZoom(ax, scaleFactor);\n return getShift(ax, scaleFactor);\n }\n return 0;\n }\n\n function getShift(ax, scaleFactor, from) {\n return ax._length * (1 - scaleFactor) * FROM_TL[from || ax.constraintoward || 'middle'];\n }\n\n return dragger;\n}\n\nfunction makeDragger(plotinfo, nodeName, dragClass, cursor) {\n var dragger3 = Lib.ensureSingle(plotinfo.draglayer, nodeName, dragClass, function(s) {\n s.classed('drag', true)\n .style({fill: 'transparent', 'stroke-width': 0})\n .attr('data-subplot', plotinfo.id);\n });\n\n dragger3.call(setCursor, cursor);\n\n return dragger3.node();\n}\n\nfunction makeRectDragger(plotinfo, dragClass, cursor, x, y, w, h) {\n var dragger = makeDragger(plotinfo, 'rect', dragClass, cursor);\n d3.select(dragger).call(Drawing.setRect, x, y, w, h);\n return dragger;\n}\n\nfunction isDirectionActive(axList, activeVal) {\n for(var i = 0; i < axList.length; i++) {\n if(!axList[i].fixedrange) return activeVal;\n }\n return '';\n}\n\nfunction getEndText(ax, end) {\n var initialVal = ax.range[end];\n var diff = Math.abs(initialVal - ax.range[1 - end]);\n var dig;\n\n // TODO: this should basically be ax.r2d but we're doing extra\n // rounding here... can we clean up at all?\n if(ax.type === 'date') {\n return initialVal;\n } else if(ax.type === 'log') {\n dig = Math.ceil(Math.max(0, -Math.log(diff) / Math.LN10)) + 3;\n return d3.format('.' + dig + 'g')(Math.pow(10, initialVal));\n } else { // linear numeric (or category... but just show numbers here)\n dig = Math.floor(Math.log(Math.abs(initialVal)) / Math.LN10) -\n Math.floor(Math.log(diff) / Math.LN10) + 4;\n return d3.format('.' + String(dig) + 'g')(initialVal);\n }\n}\n\nfunction zoomAxRanges(axList, r0Fraction, r1Fraction, updates, linkedAxes) {\n for(var i = 0; i < axList.length; i++) {\n var axi = axList[i];\n if(axi.fixedrange) continue;\n\n if(axi.rangebreaks) {\n var isY = axi._id.charAt(0) === 'y';\n var r0F = isY ? (1 - r0Fraction) : r0Fraction;\n var r1F = isY ? (1 - r1Fraction) : r1Fraction;\n\n updates[axi._name + '.range[0]'] = axi.l2r(axi.p2l(r0F * axi._length));\n updates[axi._name + '.range[1]'] = axi.l2r(axi.p2l(r1F * axi._length));\n } else {\n var axRangeLinear0 = axi._rl[0];\n var axRangeLinearSpan = axi._rl[1] - axRangeLinear0;\n updates[axi._name + '.range[0]'] = axi.l2r(axRangeLinear0 + axRangeLinearSpan * r0Fraction);\n updates[axi._name + '.range[1]'] = axi.l2r(axRangeLinear0 + axRangeLinearSpan * r1Fraction);\n }\n }\n\n // zoom linked axes about their centers\n if(linkedAxes && linkedAxes.length) {\n var linkedR0Fraction = (r0Fraction + (1 - r1Fraction)) / 2;\n zoomAxRanges(linkedAxes, linkedR0Fraction, 1 - linkedR0Fraction, updates, []);\n }\n}\n\nfunction dragAxList(axList, pix) {\n for(var i = 0; i < axList.length; i++) {\n var axi = axList[i];\n if(!axi.fixedrange) {\n if(axi.rangebreaks) {\n var p0 = 0;\n var p1 = axi._length;\n var d0 = axi.p2l(p0 + pix) - axi.p2l(p0);\n var d1 = axi.p2l(p1 + pix) - axi.p2l(p1);\n var delta = (d0 + d1) / 2;\n\n axi.range = [\n axi.l2r(axi._rl[0] - delta),\n axi.l2r(axi._rl[1] - delta)\n ];\n } else {\n axi.range = [\n axi.l2r(axi._rl[0] - pix / axi._m),\n axi.l2r(axi._rl[1] - pix / axi._m)\n ];\n }\n }\n }\n}\n\n// common transform for dragging one end of an axis\n// d>0 is compressing scale (cursor is over the plot,\n// the axis end should move with the cursor)\n// d<0 is expanding (cursor is off the plot, axis end moves\n// nonlinearly so you can expand far)\nfunction dZoom(d) {\n return 1 - ((d >= 0) ? Math.min(d, 0.9) :\n 1 / (1 / Math.max(d, -0.3) + 3.222));\n}\n\nfunction getDragCursor(nsew, dragmode, isMainDrag) {\n if(!nsew) return 'pointer';\n if(nsew === 'nsew') {\n // in this case here, clear cursor and\n // use the cursor style set on \n if(isMainDrag) return '';\n if(dragmode === 'pan') return 'move';\n return 'crosshair';\n }\n return nsew.toLowerCase() + '-resize';\n}\n\nfunction makeZoombox(zoomlayer, lum, xs, ys, path0) {\n return zoomlayer.append('path')\n .attr('class', 'zoombox')\n .style({\n 'fill': lum > 0.2 ? 'rgba(0,0,0,0)' : 'rgba(255,255,255,0)',\n 'stroke-width': 0\n })\n .attr('transform', 'translate(' + xs + ', ' + ys + ')')\n .attr('d', path0 + 'Z');\n}\n\nfunction makeCorners(zoomlayer, xs, ys) {\n return zoomlayer.append('path')\n .attr('class', 'zoombox-corners')\n .style({\n fill: Color.background,\n stroke: Color.defaultLine,\n 'stroke-width': 1,\n opacity: 0\n })\n .attr('transform', 'translate(' + xs + ', ' + ys + ')')\n .attr('d', 'M0,0Z');\n}\n\nfunction updateZoombox(zb, corners, box, path0, dimmed, lum) {\n zb.attr('d',\n path0 + 'M' + (box.l) + ',' + (box.t) + 'v' + (box.h) +\n 'h' + (box.w) + 'v-' + (box.h) + 'h-' + (box.w) + 'Z');\n transitionZoombox(zb, corners, dimmed, lum);\n}\n\nfunction transitionZoombox(zb, corners, dimmed, lum) {\n if(!dimmed) {\n zb.transition()\n .style('fill', lum > 0.2 ? 'rgba(0,0,0,0.4)' :\n 'rgba(255,255,255,0.3)')\n .duration(200);\n corners.transition()\n .style('opacity', 1)\n .duration(200);\n }\n}\n\nfunction removeZoombox(gd) {\n d3.select(gd)\n .selectAll('.zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners')\n .remove();\n}\n\nfunction showDoubleClickNotifier(gd) {\n if(SHOWZOOMOUTTIP && gd.data && gd._context.showTips) {\n Lib.notifier(Lib._(gd, 'Double-click to zoom back out'), 'long');\n SHOWZOOMOUTTIP = false;\n }\n}\n\nfunction xCorners(box, y0) {\n return 'M' +\n (box.l - 0.5) + ',' + (y0 - MINZOOM - 0.5) +\n 'h-3v' + (2 * MINZOOM + 1) + 'h3ZM' +\n (box.r + 0.5) + ',' + (y0 - MINZOOM - 0.5) +\n 'h3v' + (2 * MINZOOM + 1) + 'h-3Z';\n}\n\nfunction yCorners(box, x0) {\n return 'M' +\n (x0 - MINZOOM - 0.5) + ',' + (box.t - 0.5) +\n 'v-3h' + (2 * MINZOOM + 1) + 'v3ZM' +\n (x0 - MINZOOM - 0.5) + ',' + (box.b + 0.5) +\n 'v3h' + (2 * MINZOOM + 1) + 'v-3Z';\n}\n\nfunction xyCorners(box) {\n var clen = Math.floor(Math.min(box.b - box.t, box.r - box.l, MINZOOM) / 2);\n return 'M' +\n (box.l - 3.5) + ',' + (box.t - 0.5 + clen) + 'h3v' + (-clen) +\n 'h' + clen + 'v-3h-' + (clen + 3) + 'ZM' +\n (box.r + 3.5) + ',' + (box.t - 0.5 + clen) + 'h-3v' + (-clen) +\n 'h' + (-clen) + 'v-3h' + (clen + 3) + 'ZM' +\n (box.r + 3.5) + ',' + (box.b + 0.5 - clen) + 'h-3v' + clen +\n 'h' + (-clen) + 'v3h' + (clen + 3) + 'ZM' +\n (box.l - 3.5) + ',' + (box.b + 0.5 - clen) + 'h3v' + clen +\n 'h' + clen + 'v3h-' + (clen + 3) + 'Z';\n}\n\nfunction calcLinks(gd, groups, xaHash, yaHash) {\n var isSubplotConstrained = false;\n var xLinks = {};\n var yLinks = {};\n var xID, yID, xLinkID, yLinkID;\n\n for(var i = 0; i < groups.length; i++) {\n var group = groups[i];\n // check if any of the x axes we're dragging is in this constraint group\n for(xID in xaHash) {\n if(group[xID]) {\n // put the rest of these axes into xLinks, if we're not already\n // dragging them, so we know to scale these axes automatically too\n // to match the changes in the dragged x axes\n for(xLinkID in group) {\n if(!(xLinkID.charAt(0) === 'x' ? xaHash : yaHash)[xLinkID]) {\n xLinks[xLinkID] = xID;\n }\n }\n\n // check if the x and y axes of THIS drag are linked\n for(yID in yaHash) {\n if(group[yID]) isSubplotConstrained = true;\n }\n }\n }\n\n // now check if any of the y axes we're dragging is in this constraint group\n // only look for outside links, as we've already checked for links within the dragger\n for(yID in yaHash) {\n if(group[yID]) {\n for(yLinkID in group) {\n if(!(yLinkID.charAt(0) === 'x' ? xaHash : yaHash)[yLinkID]) {\n yLinks[yLinkID] = yID;\n }\n }\n }\n }\n }\n\n if(isSubplotConstrained) {\n // merge xLinks and yLinks if the subplot is constrained,\n // since we'll always apply both anyway and the two will contain\n // duplicates\n Lib.extendFlat(xLinks, yLinks);\n yLinks = {};\n }\n\n var xaHashLinked = {};\n var xaxesLinked = [];\n for(xLinkID in xLinks) {\n var xa = getFromId(gd, xLinkID);\n xaxesLinked.push(xa);\n xaHashLinked[xa._id] = xa;\n }\n\n var yaHashLinked = {};\n var yaxesLinked = [];\n for(yLinkID in yLinks) {\n var ya = getFromId(gd, yLinkID);\n yaxesLinked.push(ya);\n yaHashLinked[ya._id] = ya;\n }\n\n return {\n xaHash: xaHashLinked,\n yaHash: yaHashLinked,\n xaxes: xaxesLinked,\n yaxes: yaxesLinked,\n xLinks: xLinks,\n yLinks: yLinks,\n isSubplotConstrained: isSubplotConstrained\n };\n}\n\n// still seems to be some confusion about onwheel vs onmousewheel...\nfunction attachWheelEventHandler(element, handler) {\n if(!supportsPassive) {\n if(element.onwheel !== undefined) element.onwheel = handler;\n else if(element.onmousewheel !== undefined) element.onmousewheel = handler;\n else if(!element.isAddedWheelEvent) {\n element.isAddedWheelEvent = true;\n element.addEventListener('wheel', handler, {passive: false});\n }\n } else {\n var wheelEventName = element.onwheel !== undefined ? 'wheel' : 'mousewheel';\n\n if(element._onwheel) {\n element.removeEventListener(wheelEventName, element._onwheel);\n }\n element._onwheel = handler;\n\n element.addEventListener(wheelEventName, handler, {passive: false});\n }\n}\n\nfunction hashValues(hash) {\n var out = [];\n for(var k in hash) out.push(hash[k]);\n return out;\n}\n\nmodule.exports = {\n makeDragBox: makeDragBox,\n\n makeDragger: makeDragger,\n makeRectDragger: makeRectDragger,\n makeZoombox: makeZoombox,\n makeCorners: makeCorners,\n\n updateZoombox: updateZoombox,\n xyCorners: xyCorners,\n transitionZoombox: transitionZoombox,\n removeZoombox: removeZoombox,\n showDoubleClickNotifier: showDoubleClickNotifier,\n\n attachWheelEventHandler: attachWheelEventHandler\n};\n\n},{\"../../components/color\":595,\"../../components/dragelement\":614,\"../../components/dragelement/helpers\":613,\"../../components/drawing\":617,\"../../components/fx\":635,\"../../constants/alignment\":697,\"../../lib\":728,\"../../lib/clear_gl_canvases\":713,\"../../lib/setcursor\":748,\"../../lib/svg_text_utils\":752,\"../../plot_api/subroutines\":767,\"../../registry\":859,\"../plots\":839,\"./axes\":776,\"./axis_ids\":779,\"./constants\":782,\"./scale_zoom\":794,\"./select\":795,\"d3\":164,\"has-passive-events\":410,\"tinycolor2\":528}],785:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Fx = _dereq_('../../components/fx');\nvar dragElement = _dereq_('../../components/dragelement');\nvar setCursor = _dereq_('../../lib/setcursor');\n\nvar makeDragBox = _dereq_('./dragbox').makeDragBox;\nvar DRAGGERSIZE = _dereq_('./constants').DRAGGERSIZE;\n\nexports.initInteractions = function initInteractions(gd) {\n var fullLayout = gd._fullLayout;\n\n if(gd._context.staticPlot) {\n // this sweeps up more than just cartesian drag elements...\n d3.select(gd).selectAll('.drag').remove();\n return;\n }\n\n if(!fullLayout._has('cartesian') && !fullLayout._has('splom')) return;\n\n var subplots = Object.keys(fullLayout._plots || {}).sort(function(a, b) {\n // sort overlays last, then by x axis number, then y axis number\n if((fullLayout._plots[a].mainplot && true) ===\n (fullLayout._plots[b].mainplot && true)) {\n var aParts = a.split('y');\n var bParts = b.split('y');\n return (aParts[0] === bParts[0]) ?\n (Number(aParts[1] || 1) - Number(bParts[1] || 1)) :\n (Number(aParts[0] || 1) - Number(bParts[0] || 1));\n }\n return fullLayout._plots[a].mainplot ? 1 : -1;\n });\n\n subplots.forEach(function(subplot) {\n var plotinfo = fullLayout._plots[subplot];\n var xa = plotinfo.xaxis;\n var ya = plotinfo.yaxis;\n\n // main and corner draggers need not be repeated for\n // overlaid subplots - these draggers drag them all\n if(!plotinfo.mainplot) {\n // main dragger goes over the grids and data, so we use its\n // mousemove events for all data hover effects\n var maindrag = makeDragBox(gd, plotinfo, xa._offset, ya._offset,\n xa._length, ya._length, 'ns', 'ew');\n\n maindrag.onmousemove = function(evt) {\n // This is on `gd._fullLayout`, *not* fullLayout because the reference\n // changes by the time this is called again.\n gd._fullLayout._rehover = function() {\n if((gd._fullLayout._hoversubplot === subplot) && gd._fullLayout._plots[subplot]) {\n Fx.hover(gd, evt, subplot);\n }\n };\n\n Fx.hover(gd, evt, subplot);\n\n // Note that we have *not* used the cached fullLayout variable here\n // since that may be outdated when this is called as a callback later on\n gd._fullLayout._lasthover = maindrag;\n gd._fullLayout._hoversubplot = subplot;\n };\n\n /*\n * IMPORTANT:\n * We must check for the presence of the drag cover here.\n * If we don't, a 'mouseout' event is triggered on the\n * maindrag before each 'click' event, which has the effect\n * of clearing the hoverdata; thus, cancelling the click event.\n */\n maindrag.onmouseout = function(evt) {\n if(gd._dragging) return;\n\n // When the mouse leaves this maindrag, unset the hovered subplot.\n // This may cause problems if it leaves the subplot directly *onto*\n // another subplot, but that's a tiny corner case at the moment.\n gd._fullLayout._hoversubplot = null;\n\n dragElement.unhover(gd, evt);\n };\n\n // corner draggers\n if(gd._context.showAxisDragHandles) {\n makeDragBox(gd, plotinfo, xa._offset - DRAGGERSIZE, ya._offset - DRAGGERSIZE,\n DRAGGERSIZE, DRAGGERSIZE, 'n', 'w');\n makeDragBox(gd, plotinfo, xa._offset + xa._length, ya._offset - DRAGGERSIZE,\n DRAGGERSIZE, DRAGGERSIZE, 'n', 'e');\n makeDragBox(gd, plotinfo, xa._offset - DRAGGERSIZE, ya._offset + ya._length,\n DRAGGERSIZE, DRAGGERSIZE, 's', 'w');\n makeDragBox(gd, plotinfo, xa._offset + xa._length, ya._offset + ya._length,\n DRAGGERSIZE, DRAGGERSIZE, 's', 'e');\n }\n }\n if(gd._context.showAxisDragHandles) {\n // x axis draggers - if you have overlaid plots,\n // these drag each axis separately\n if(subplot === xa._mainSubplot) {\n // the y position of the main x axis line\n var y0 = xa._mainLinePosition;\n if(xa.side === 'top') y0 -= DRAGGERSIZE;\n makeDragBox(gd, plotinfo, xa._offset + xa._length * 0.1, y0,\n xa._length * 0.8, DRAGGERSIZE, '', 'ew');\n makeDragBox(gd, plotinfo, xa._offset, y0,\n xa._length * 0.1, DRAGGERSIZE, '', 'w');\n makeDragBox(gd, plotinfo, xa._offset + xa._length * 0.9, y0,\n xa._length * 0.1, DRAGGERSIZE, '', 'e');\n }\n // y axis draggers\n if(subplot === ya._mainSubplot) {\n // the x position of the main y axis line\n var x0 = ya._mainLinePosition;\n if(ya.side !== 'right') x0 -= DRAGGERSIZE;\n makeDragBox(gd, plotinfo, x0, ya._offset + ya._length * 0.1,\n DRAGGERSIZE, ya._length * 0.8, 'ns', '');\n makeDragBox(gd, plotinfo, x0, ya._offset + ya._length * 0.9,\n DRAGGERSIZE, ya._length * 0.1, 's', '');\n makeDragBox(gd, plotinfo, x0, ya._offset,\n DRAGGERSIZE, ya._length * 0.1, 'n', '');\n }\n }\n });\n\n // In case you mousemove over some hovertext, send it to Fx.hover too\n // we do this so that we can put the hover text in front of everything,\n // but still be able to interact with everything as if it isn't there\n var hoverLayer = fullLayout._hoverlayer.node();\n\n hoverLayer.onmousemove = function(evt) {\n evt.target = gd._fullLayout._lasthover;\n Fx.hover(gd, evt, fullLayout._hoversubplot);\n };\n\n hoverLayer.onclick = function(evt) {\n evt.target = gd._fullLayout._lasthover;\n Fx.click(gd, evt);\n };\n\n // also delegate mousedowns... TODO: does this actually work?\n hoverLayer.onmousedown = function(evt) {\n gd._fullLayout._lasthover.onmousedown(evt);\n };\n\n exports.updateFx(gd);\n};\n\n// Minimal set of update needed on 'modebar' edits.\n// We only need to update the cursor style.\n//\n// Note that changing the axis configuration and/or the fixedrange attribute\n// should trigger a full initInteractions.\nexports.updateFx = function(gd) {\n var fullLayout = gd._fullLayout;\n var cursor = fullLayout.dragmode === 'pan' ? 'move' : 'crosshair';\n setCursor(fullLayout._draggers, cursor);\n};\n\n},{\"../../components/dragelement\":614,\"../../components/fx\":635,\"../../lib/setcursor\":748,\"./constants\":782,\"./dragbox\":784,\"d3\":164}],786:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nfunction clearOutlineControllers(gd) {\n var zoomLayer = gd._fullLayout._zoomlayer;\n if(zoomLayer) {\n zoomLayer.selectAll('.outline-controllers').remove();\n }\n}\n\nfunction clearSelect(gd) {\n var zoomLayer = gd._fullLayout._zoomlayer;\n if(zoomLayer) {\n // until we get around to persistent selections, remove the outline\n // here. The selection itself will be removed when the plot redraws\n // at the end.\n zoomLayer.selectAll('.select-outline').remove();\n }\n\n gd._fullLayout._drawing = false;\n}\n\nmodule.exports = {\n clearOutlineControllers: clearOutlineControllers,\n clearSelect: clearSelect\n};\n\n},{}],787:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n// in v2 (once log ranges are fixed),\n// we'll be able to p2r here for all axis types\nfunction p2r(ax, v) {\n switch(ax.type) {\n case 'log':\n return ax.p2d(v);\n case 'date':\n return ax.p2r(v, 0, ax.calendar);\n default:\n return ax.p2r(v);\n }\n}\n\nfunction r2p(ax, v) {\n switch(ax.type) {\n case 'log':\n return ax.d2p(v);\n case 'date':\n return ax.r2p(v, 0, ax.calendar);\n default:\n return ax.r2p(v);\n }\n}\n\nfunction axValue(ax) {\n var index = (ax._id.charAt(0) === 'y') ? 1 : 0;\n return function(v) { return p2r(ax, v[index]); };\n}\n\nfunction getTransform(plotinfo) {\n return 'translate(' +\n plotinfo.xaxis._offset + ',' +\n plotinfo.yaxis._offset + ')';\n}\n\nmodule.exports = {\n p2r: p2r,\n r2p: r2p,\n axValue: axValue,\n getTransform: getTransform\n};\n\n},{}],788:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\n\n/**\n * Factory function for checking component arrays for subplot references.\n *\n * @param {string} containerArrayName: the top-level array in gd.layout to check\n * If an item in this container is found that references a cartesian x and/or y axis,\n * ensure cartesian is marked as a base plot module and record the axes (and subplot\n * if both refs are axes) in gd._fullLayout\n *\n * @return {function}: with args layoutIn (gd.layout) and layoutOut (gd._fullLayout)\n * as expected of a component includeBasePlot method\n */\nmodule.exports = function makeIncludeComponents(containerArrayName) {\n return function includeComponents(layoutIn, layoutOut) {\n var array = layoutIn[containerArrayName];\n if(!Array.isArray(array)) return;\n\n var Cartesian = Registry.subplotsRegistry.cartesian;\n var idRegex = Cartesian.idRegex;\n var subplots = layoutOut._subplots;\n var xaList = subplots.xaxis;\n var yaList = subplots.yaxis;\n var cartesianList = subplots.cartesian;\n var hasCartesianOrGL2D = layoutOut._has('cartesian') || layoutOut._has('gl2d');\n\n for(var i = 0; i < array.length; i++) {\n var itemi = array[i];\n if(!Lib.isPlainObject(itemi)) continue;\n\n var xref = itemi.xref;\n var yref = itemi.yref;\n\n var hasXref = idRegex.x.test(xref);\n var hasYref = idRegex.y.test(yref);\n if(hasXref || hasYref) {\n if(!hasCartesianOrGL2D) Lib.pushUnique(layoutOut._basePlotModules, Cartesian);\n\n var newAxis = false;\n if(hasXref && xaList.indexOf(xref) === -1) {\n xaList.push(xref);\n newAxis = true;\n }\n if(hasYref && yaList.indexOf(yref) === -1) {\n yaList.push(yref);\n newAxis = true;\n }\n\n /*\n * Notice the logic here: only add a subplot for a component if\n * it's referencing both x and y axes AND it's creating a new axis\n * so for example if your plot already has xy and x2y2, an annotation\n * on x2y or xy2 will not create a new subplot.\n */\n if(newAxis && hasXref && hasYref) {\n cartesianList.push(xref + yref);\n }\n }\n }\n };\n};\n\n},{\"../../lib\":728,\"../../registry\":859}],789:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\nvar Plots = _dereq_('../plots');\nvar Drawing = _dereq_('../../components/drawing');\n\nvar getModuleCalcData = _dereq_('../get_data').getModuleCalcData;\nvar axisIds = _dereq_('./axis_ids');\nvar constants = _dereq_('./constants');\nvar xmlnsNamespaces = _dereq_('../../constants/xmlns_namespaces');\n\nvar ensureSingle = Lib.ensureSingle;\n\nfunction ensureSingleAndAddDatum(parent, nodeType, className) {\n return Lib.ensureSingle(parent, nodeType, className, function(s) {\n s.datum(className);\n });\n}\n\nexports.name = 'cartesian';\n\nexports.attr = ['xaxis', 'yaxis'];\n\nexports.idRoot = ['x', 'y'];\n\nexports.idRegex = constants.idRegex;\n\nexports.attrRegex = constants.attrRegex;\n\nexports.attributes = _dereq_('./attributes');\n\nexports.layoutAttributes = _dereq_('./layout_attributes');\n\nexports.supplyLayoutDefaults = _dereq_('./layout_defaults');\n\nexports.transitionAxes = _dereq_('./transition_axes');\n\nexports.finalizeSubplots = function(layoutIn, layoutOut) {\n var subplots = layoutOut._subplots;\n var xList = subplots.xaxis;\n var yList = subplots.yaxis;\n var spSVG = subplots.cartesian;\n var spAll = spSVG.concat(subplots.gl2d || []);\n var allX = {};\n var allY = {};\n var i, xi, yi;\n\n for(i = 0; i < spAll.length; i++) {\n var parts = spAll[i].split('y');\n allX[parts[0]] = 1;\n allY['y' + parts[1]] = 1;\n }\n\n // check for x axes with no subplot, and make one from the anchor of that x axis\n for(i = 0; i < xList.length; i++) {\n xi = xList[i];\n if(!allX[xi]) {\n yi = (layoutIn[axisIds.id2name(xi)] || {}).anchor;\n if(!constants.idRegex.y.test(yi)) yi = 'y';\n spSVG.push(xi + yi);\n spAll.push(xi + yi);\n\n if(!allY[yi]) {\n allY[yi] = 1;\n Lib.pushUnique(yList, yi);\n }\n }\n }\n\n // same for y axes with no subplot\n for(i = 0; i < yList.length; i++) {\n yi = yList[i];\n if(!allY[yi]) {\n xi = (layoutIn[axisIds.id2name(yi)] || {}).anchor;\n if(!constants.idRegex.x.test(xi)) xi = 'x';\n spSVG.push(xi + yi);\n spAll.push(xi + yi);\n\n if(!allX[xi]) {\n allX[xi] = 1;\n Lib.pushUnique(xList, xi);\n }\n }\n }\n\n // finally, if we've gotten here we're supposed to show cartesian...\n // so if there are NO subplots at all, make one from the first\n // x & y axes in the input layout\n if(!spAll.length) {\n xi = '';\n yi = '';\n for(var ki in layoutIn) {\n if(constants.attrRegex.test(ki)) {\n var axLetter = ki.charAt(0);\n if(axLetter === 'x') {\n if(!xi || (+ki.substr(5) < +xi.substr(5))) {\n xi = ki;\n }\n } else if(!yi || (+ki.substr(5) < +yi.substr(5))) {\n yi = ki;\n }\n }\n }\n xi = xi ? axisIds.name2id(xi) : 'x';\n yi = yi ? axisIds.name2id(yi) : 'y';\n xList.push(xi);\n yList.push(yi);\n spSVG.push(xi + yi);\n }\n};\n\n/**\n * Cartesian.plot\n *\n * @param {DOM div | object} gd\n * @param {array (optional)} traces\n * array of traces indices to plot\n * if undefined, plots all cartesian traces,\n * @param {object} (optional) transitionOpts\n * transition option object\n * @param {function} (optional) makeOnCompleteCallback\n * transition make callback function from Plots.transition\n */\nexports.plot = function(gd, traces, transitionOpts, makeOnCompleteCallback) {\n var fullLayout = gd._fullLayout;\n var subplots = fullLayout._subplots.cartesian;\n var calcdata = gd.calcdata;\n var i;\n\n if(!Array.isArray(traces)) {\n // If traces is not provided, then it's a complete replot and missing\n // traces are removed\n traces = [];\n for(i = 0; i < calcdata.length; i++) traces.push(i);\n }\n\n for(i = 0; i < subplots.length; i++) {\n var subplot = subplots[i];\n var subplotInfo = fullLayout._plots[subplot];\n\n // Get all calcdata for this subplot:\n var cdSubplot = [];\n var pcd;\n\n for(var j = 0; j < calcdata.length; j++) {\n var cd = calcdata[j];\n var trace = cd[0].trace;\n\n // Skip trace if whitelist provided and it's not whitelisted:\n // if (Array.isArray(traces) && traces.indexOf(i) === -1) continue;\n if(trace.xaxis + trace.yaxis === subplot) {\n // XXX: Should trace carpet dependencies. Only replot all carpet plots if the carpet\n // axis has actually changed:\n //\n // If this trace is specifically requested, add it to the list:\n if(traces.indexOf(trace.index) !== -1 || trace.carpet) {\n // Okay, so example: traces 0, 1, and 2 have fill = tonext. You animate\n // traces 0 and 2. Trace 1 also needs to be updated, otherwise its fill\n // is outdated. So this retroactively adds the previous trace if the\n // traces are interdependent.\n if(\n pcd &&\n pcd[0].trace.xaxis + pcd[0].trace.yaxis === subplot &&\n ['tonextx', 'tonexty', 'tonext'].indexOf(trace.fill) !== -1 &&\n cdSubplot.indexOf(pcd) === -1\n ) {\n cdSubplot.push(pcd);\n }\n\n cdSubplot.push(cd);\n }\n\n // Track the previous trace on this subplot for the retroactive-add step\n // above:\n pcd = cd;\n }\n }\n\n plotOne(gd, subplotInfo, cdSubplot, transitionOpts, makeOnCompleteCallback);\n }\n};\n\nfunction plotOne(gd, plotinfo, cdSubplot, transitionOpts, makeOnCompleteCallback) {\n var traceLayerClasses = constants.traceLayerClasses;\n var fullLayout = gd._fullLayout;\n var modules = fullLayout._modules;\n var _module, cdModuleAndOthers, cdModule;\n\n var layerData = [];\n var zoomScaleQueryParts = [];\n\n for(var i = 0; i < modules.length; i++) {\n _module = modules[i];\n var name = _module.name;\n var categories = Registry.modules[name].categories;\n\n if(categories.svg) {\n var className = (_module.layerName || name + 'layer');\n var plotMethod = _module.plot;\n\n // plot all visible traces of this type on this subplot at once\n cdModuleAndOthers = getModuleCalcData(cdSubplot, plotMethod);\n cdModule = cdModuleAndOthers[0];\n // don't need to search the found traces again - in fact we need to NOT\n // so that if two modules share the same plotter we don't double-plot\n cdSubplot = cdModuleAndOthers[1];\n\n if(cdModule.length) {\n layerData.push({\n i: traceLayerClasses.indexOf(className),\n className: className,\n plotMethod: plotMethod,\n cdModule: cdModule\n });\n }\n\n if(categories.zoomScale) {\n zoomScaleQueryParts.push('.' + className);\n }\n }\n }\n\n layerData.sort(function(a, b) { return a.i - b.i; });\n\n var layers = plotinfo.plot.selectAll('g.mlayer')\n .data(layerData, function(d) { return d.className; });\n\n layers.enter().append('g')\n .attr('class', function(d) { return d.className; })\n .classed('mlayer', true)\n .classed('rangeplot', plotinfo.isRangePlot);\n\n layers.exit().remove();\n\n layers.order();\n\n layers.each(function(d) {\n var sel = d3.select(this);\n var className = d.className;\n\n d.plotMethod(\n gd, plotinfo, d.cdModule, sel,\n transitionOpts, makeOnCompleteCallback\n );\n\n // layers that allow `cliponaxis: false`\n if(constants.clipOnAxisFalseQuery.indexOf('.' + className) === -1) {\n Drawing.setClipUrl(sel, plotinfo.layerClipId, gd);\n }\n });\n\n // call Scattergl.plot separately\n if(fullLayout._has('scattergl')) {\n _module = Registry.getModule('scattergl');\n cdModule = getModuleCalcData(cdSubplot, _module)[0];\n _module.plot(gd, plotinfo, cdModule);\n }\n\n // stash \"hot\" selections for faster interaction on drag and scroll\n if(!gd._context.staticPlot) {\n if(plotinfo._hasClipOnAxisFalse) {\n plotinfo.clipOnAxisFalseTraces = plotinfo.plot\n .selectAll(constants.clipOnAxisFalseQuery.join(','))\n .selectAll('.trace');\n }\n\n if(zoomScaleQueryParts.length) {\n var traces = plotinfo.plot\n .selectAll(zoomScaleQueryParts.join(','))\n .selectAll('.trace');\n\n plotinfo.zoomScalePts = traces.selectAll('path.point');\n plotinfo.zoomScaleTxt = traces.selectAll('.textpoint');\n }\n }\n}\n\nexports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) {\n var oldPlots = oldFullLayout._plots || {};\n var newPlots = newFullLayout._plots || {};\n var oldSubplotList = oldFullLayout._subplots || {};\n var plotinfo;\n var i, k;\n\n // when going from a large splom graph to something else,\n // we need to clear so that the new cartesian subplot\n // can have the correct layer ordering\n if(oldFullLayout._hasOnlyLargeSploms && !newFullLayout._hasOnlyLargeSploms) {\n for(k in oldPlots) {\n plotinfo = oldPlots[k];\n if(plotinfo.plotgroup) plotinfo.plotgroup.remove();\n }\n }\n\n var hadGl = (oldFullLayout._has && oldFullLayout._has('gl'));\n var hasGl = (newFullLayout._has && newFullLayout._has('gl'));\n\n if(hadGl && !hasGl) {\n for(k in oldPlots) {\n plotinfo = oldPlots[k];\n if(plotinfo._scene) plotinfo._scene.destroy();\n }\n }\n\n // delete any titles we don't need anymore\n // check if axis list has changed, and if so clear old titles\n if(oldSubplotList.xaxis && oldSubplotList.yaxis) {\n var oldAxIDs = axisIds.listIds({_fullLayout: oldFullLayout});\n for(i = 0; i < oldAxIDs.length; i++) {\n var oldAxId = oldAxIDs[i];\n if(!newFullLayout[axisIds.id2name(oldAxId)]) {\n oldFullLayout._infolayer.selectAll('.g-' + oldAxId + 'title').remove();\n }\n }\n }\n\n var hadCartesian = (oldFullLayout._has && oldFullLayout._has('cartesian'));\n var hasCartesian = (newFullLayout._has && newFullLayout._has('cartesian'));\n\n if(hadCartesian && !hasCartesian) {\n // if we've gotten rid of all cartesian traces, remove all the subplot svg items\n\n purgeSubplotLayers(oldFullLayout._cartesianlayer.selectAll('.subplot'), oldFullLayout);\n oldFullLayout._defs.selectAll('.axesclip').remove();\n delete oldFullLayout._axisConstraintGroups;\n } else if(oldSubplotList.cartesian) {\n // otherwise look for subplots we need to remove\n\n for(i = 0; i < oldSubplotList.cartesian.length; i++) {\n var oldSubplotId = oldSubplotList.cartesian[i];\n if(!newPlots[oldSubplotId]) {\n var selector = '.' + oldSubplotId + ',.' + oldSubplotId + '-x,.' + oldSubplotId + '-y';\n oldFullLayout._cartesianlayer.selectAll(selector).remove();\n removeSubplotExtras(oldSubplotId, oldFullLayout);\n }\n }\n }\n};\n\nexports.drawFramework = function(gd) {\n var fullLayout = gd._fullLayout;\n var subplotData = makeSubplotData(gd);\n\n var subplotLayers = fullLayout._cartesianlayer.selectAll('.subplot')\n .data(subplotData, String);\n\n subplotLayers.enter().append('g')\n .attr('class', function(d) { return 'subplot ' + d[0]; });\n\n subplotLayers.order();\n\n subplotLayers.exit()\n .call(purgeSubplotLayers, fullLayout);\n\n subplotLayers.each(function(d) {\n var id = d[0];\n var plotinfo = fullLayout._plots[id];\n\n plotinfo.plotgroup = d3.select(this);\n makeSubplotLayer(gd, plotinfo);\n\n // make separate drag layers for each subplot,\n // but append them to paper rather than the plot groups,\n // so they end up on top of the rest\n plotinfo.draglayer = ensureSingle(fullLayout._draggers, 'g', id);\n });\n};\n\nexports.rangePlot = function(gd, plotinfo, cdSubplot) {\n makeSubplotLayer(gd, plotinfo);\n plotOne(gd, plotinfo, cdSubplot);\n Plots.style(gd);\n};\n\nfunction makeSubplotData(gd) {\n var fullLayout = gd._fullLayout;\n var ids = fullLayout._subplots.cartesian;\n var len = ids.length;\n var i, j, id, plotinfo, xa, ya;\n\n // split 'regular' and 'overlaying' subplots\n var regulars = [];\n var overlays = [];\n\n for(i = 0; i < len; i++) {\n id = ids[i];\n plotinfo = fullLayout._plots[id];\n xa = plotinfo.xaxis;\n ya = plotinfo.yaxis;\n\n var xa2 = xa._mainAxis;\n var ya2 = ya._mainAxis;\n var mainplot = xa2._id + ya2._id;\n var mainplotinfo = fullLayout._plots[mainplot];\n plotinfo.overlays = [];\n\n if(mainplot !== id && mainplotinfo) {\n plotinfo.mainplot = mainplot;\n plotinfo.mainplotinfo = mainplotinfo;\n overlays.push(id);\n } else {\n plotinfo.mainplot = undefined;\n plotinfo.mainPlotinfo = undefined;\n regulars.push(id);\n }\n }\n\n // fill in list of overlaying subplots in 'main plot'\n for(i = 0; i < overlays.length; i++) {\n id = overlays[i];\n plotinfo = fullLayout._plots[id];\n plotinfo.mainplotinfo.overlays.push(plotinfo);\n }\n\n // put 'regular' subplot data before 'overlaying'\n var subplotIds = regulars.concat(overlays);\n var subplotData = new Array(len);\n\n for(i = 0; i < len; i++) {\n id = subplotIds[i];\n plotinfo = fullLayout._plots[id];\n xa = plotinfo.xaxis;\n ya = plotinfo.yaxis;\n\n // use info about axis layer and overlaying pattern\n // to clean what need to be cleaned up in exit selection\n var d = [id, xa.layer, ya.layer, xa.overlaying || '', ya.overlaying || ''];\n for(j = 0; j < plotinfo.overlays.length; j++) {\n d.push(plotinfo.overlays[j].id);\n }\n subplotData[i] = d;\n }\n\n return subplotData;\n}\n\nfunction makeSubplotLayer(gd, plotinfo) {\n var plotgroup = plotinfo.plotgroup;\n var id = plotinfo.id;\n var xLayer = constants.layerValue2layerClass[plotinfo.xaxis.layer];\n var yLayer = constants.layerValue2layerClass[plotinfo.yaxis.layer];\n var hasOnlyLargeSploms = gd._fullLayout._hasOnlyLargeSploms;\n\n if(!plotinfo.mainplot) {\n if(hasOnlyLargeSploms) {\n // TODO could do even better\n // - we don't need plot (but we would have to mock it in lsInner\n // and other places\n // - we don't (x|y)lines and (x|y)axislayer for most subplots\n // usually just the bottom x and left y axes.\n plotinfo.xlines = ensureSingle(plotgroup, 'path', 'xlines-above');\n plotinfo.ylines = ensureSingle(plotgroup, 'path', 'ylines-above');\n plotinfo.xaxislayer = ensureSingle(plotgroup, 'g', 'xaxislayer-above');\n plotinfo.yaxislayer = ensureSingle(plotgroup, 'g', 'yaxislayer-above');\n } else {\n var backLayer = ensureSingle(plotgroup, 'g', 'layer-subplot');\n plotinfo.shapelayer = ensureSingle(backLayer, 'g', 'shapelayer');\n plotinfo.imagelayer = ensureSingle(backLayer, 'g', 'imagelayer');\n\n plotinfo.gridlayer = ensureSingle(plotgroup, 'g', 'gridlayer');\n plotinfo.zerolinelayer = ensureSingle(plotgroup, 'g', 'zerolinelayer');\n\n ensureSingle(plotgroup, 'path', 'xlines-below');\n ensureSingle(plotgroup, 'path', 'ylines-below');\n plotinfo.overlinesBelow = ensureSingle(plotgroup, 'g', 'overlines-below');\n\n ensureSingle(plotgroup, 'g', 'xaxislayer-below');\n ensureSingle(plotgroup, 'g', 'yaxislayer-below');\n plotinfo.overaxesBelow = ensureSingle(plotgroup, 'g', 'overaxes-below');\n\n plotinfo.plot = ensureSingle(plotgroup, 'g', 'plot');\n plotinfo.overplot = ensureSingle(plotgroup, 'g', 'overplot');\n\n plotinfo.xlines = ensureSingle(plotgroup, 'path', 'xlines-above');\n plotinfo.ylines = ensureSingle(plotgroup, 'path', 'ylines-above');\n plotinfo.overlinesAbove = ensureSingle(plotgroup, 'g', 'overlines-above');\n\n ensureSingle(plotgroup, 'g', 'xaxislayer-above');\n ensureSingle(plotgroup, 'g', 'yaxislayer-above');\n plotinfo.overaxesAbove = ensureSingle(plotgroup, 'g', 'overaxes-above');\n\n // set refs to correct layers as determined by 'axis.layer'\n plotinfo.xlines = plotgroup.select('.xlines-' + xLayer);\n plotinfo.ylines = plotgroup.select('.ylines-' + yLayer);\n plotinfo.xaxislayer = plotgroup.select('.xaxislayer-' + xLayer);\n plotinfo.yaxislayer = plotgroup.select('.yaxislayer-' + yLayer);\n }\n } else {\n var mainplotinfo = plotinfo.mainplotinfo;\n var mainplotgroup = mainplotinfo.plotgroup;\n var xId = id + '-x';\n var yId = id + '-y';\n\n // now make the components of overlaid subplots\n // overlays don't have backgrounds, and append all\n // their other components to the corresponding\n // extra groups of their main plots.\n\n plotinfo.gridlayer = mainplotinfo.gridlayer;\n plotinfo.zerolinelayer = mainplotinfo.zerolinelayer;\n\n ensureSingle(mainplotinfo.overlinesBelow, 'path', xId);\n ensureSingle(mainplotinfo.overlinesBelow, 'path', yId);\n ensureSingle(mainplotinfo.overaxesBelow, 'g', xId);\n ensureSingle(mainplotinfo.overaxesBelow, 'g', yId);\n\n plotinfo.plot = ensureSingle(mainplotinfo.overplot, 'g', id);\n\n ensureSingle(mainplotinfo.overlinesAbove, 'path', xId);\n ensureSingle(mainplotinfo.overlinesAbove, 'path', yId);\n ensureSingle(mainplotinfo.overaxesAbove, 'g', xId);\n ensureSingle(mainplotinfo.overaxesAbove, 'g', yId);\n\n // set refs to correct layers as determined by 'abovetraces'\n plotinfo.xlines = mainplotgroup.select('.overlines-' + xLayer).select('.' + xId);\n plotinfo.ylines = mainplotgroup.select('.overlines-' + yLayer).select('.' + yId);\n plotinfo.xaxislayer = mainplotgroup.select('.overaxes-' + xLayer).select('.' + xId);\n plotinfo.yaxislayer = mainplotgroup.select('.overaxes-' + yLayer).select('.' + yId);\n }\n\n // common attributes for all subplots, overlays or not\n\n if(!hasOnlyLargeSploms) {\n ensureSingleAndAddDatum(plotinfo.gridlayer, 'g', plotinfo.xaxis._id);\n ensureSingleAndAddDatum(plotinfo.gridlayer, 'g', plotinfo.yaxis._id);\n plotinfo.gridlayer.selectAll('g')\n .map(function(d) { return d[0]; })\n .sort(axisIds.idSort);\n }\n\n plotinfo.xlines\n .style('fill', 'none')\n .classed('crisp', true);\n\n plotinfo.ylines\n .style('fill', 'none')\n .classed('crisp', true);\n}\n\nfunction purgeSubplotLayers(layers, fullLayout) {\n if(!layers) return;\n\n var overlayIdsToRemove = {};\n\n layers.each(function(d) {\n var id = d[0];\n var plotgroup = d3.select(this);\n\n plotgroup.remove();\n removeSubplotExtras(id, fullLayout);\n overlayIdsToRemove[id] = true;\n\n // do not remove individual axis s here\n // as other subplots may need them\n });\n\n // must remove overlaid subplot trace layers 'manually'\n\n for(var k in fullLayout._plots) {\n var subplotInfo = fullLayout._plots[k];\n var overlays = subplotInfo.overlays || [];\n\n for(var j = 0; j < overlays.length; j++) {\n var overlayInfo = overlays[j];\n\n if(overlayIdsToRemove[overlayInfo.id]) {\n overlayInfo.plot.selectAll('.trace').remove();\n }\n }\n }\n}\n\nfunction removeSubplotExtras(subplotId, fullLayout) {\n fullLayout._draggers.selectAll('g.' + subplotId).remove();\n fullLayout._defs.select('#clip' + fullLayout._uid + subplotId + 'plot').remove();\n}\n\nexports.toSVG = function(gd) {\n var imageRoot = gd._fullLayout._glimages;\n var root = d3.select(gd).selectAll('.svg-container');\n var canvases = root.filter(function(d, i) {return i === root.size() - 1;})\n .selectAll('.gl-canvas-context, .gl-canvas-focus');\n\n function canvasToImage() {\n var canvas = this;\n var imageData = canvas.toDataURL('image/png');\n var image = imageRoot.append('svg:image');\n\n image.attr({\n xmlns: xmlnsNamespaces.svg,\n 'xlink:href': imageData,\n preserveAspectRatio: 'none',\n x: 0,\n y: 0,\n width: canvas.width,\n height: canvas.height\n });\n }\n\n canvases.each(canvasToImage);\n};\n\nexports.updateFx = _dereq_('./graph_interact').updateFx;\n\n},{\"../../components/drawing\":617,\"../../constants/xmlns_namespaces\":705,\"../../lib\":728,\"../../registry\":859,\"../get_data\":813,\"../plots\":839,\"./attributes\":774,\"./axis_ids\":779,\"./constants\":782,\"./graph_interact\":785,\"./layout_attributes\":790,\"./layout_defaults\":791,\"./transition_axes\":800,\"d3\":164}],790:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar fontAttrs = _dereq_('../font_attributes');\nvar colorAttrs = _dereq_('../../components/color/attributes');\nvar dash = _dereq_('../../components/drawing/attributes').dash;\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\nvar templatedArray = _dereq_('../../plot_api/plot_template').templatedArray;\n\nvar FORMAT_LINK = _dereq_('../../constants/docs').FORMAT_LINK;\nvar DATE_FORMAT_LINK = _dereq_('../../constants/docs').DATE_FORMAT_LINK;\nvar ONEDAY = _dereq_('../../constants/numerical').ONEDAY;\nvar constants = _dereq_('./constants');\nvar HOUR = constants.HOUR_PATTERN;\nvar DAY_OF_WEEK = constants.WEEKDAY_PATTERN;\n\nmodule.exports = {\n visible: {\n valType: 'boolean',\n \n editType: 'plot',\n \n },\n color: {\n valType: 'color',\n dflt: colorAttrs.defaultLine,\n \n editType: 'ticks',\n \n },\n title: {\n text: {\n valType: 'string',\n \n editType: 'ticks',\n \n },\n font: fontAttrs({\n editType: 'ticks',\n \n }),\n standoff: {\n valType: 'number',\n \n min: 0,\n editType: 'ticks',\n \n },\n editType: 'ticks'\n },\n type: {\n valType: 'enumerated',\n // '-' means we haven't yet run autotype or couldn't find any data\n // it gets turned into linear in gd._fullLayout but not copied back\n // to gd.data like the others are.\n values: ['-', 'linear', 'log', 'date', 'category', 'multicategory'],\n dflt: '-',\n \n editType: 'calc',\n // we forget when an axis has been autotyped, just writing the auto\n // value back to the input - so it doesn't make sense to template this.\n // Note: we do NOT prohibit this in `coerce`, so if someone enters a\n // type in the template explicitly it will be honored as the default.\n _noTemplating: true,\n \n },\n autorange: {\n valType: 'enumerated',\n values: [true, false, 'reversed'],\n dflt: true,\n \n editType: 'axrange',\n impliedEdits: {'range[0]': undefined, 'range[1]': undefined},\n \n },\n rangemode: {\n valType: 'enumerated',\n values: ['normal', 'tozero', 'nonnegative'],\n dflt: 'normal',\n \n editType: 'plot',\n \n },\n range: {\n valType: 'info_array',\n \n items: [\n {valType: 'any', editType: 'axrange', impliedEdits: {'^autorange': false}, anim: true},\n {valType: 'any', editType: 'axrange', impliedEdits: {'^autorange': false}, anim: true}\n ],\n editType: 'axrange',\n impliedEdits: {'autorange': false},\n anim: true,\n \n },\n fixedrange: {\n valType: 'boolean',\n dflt: false,\n \n editType: 'calc',\n \n },\n // scaleanchor: not used directly, just put here for reference\n // values are any opposite-letter axis id\n scaleanchor: {\n valType: 'enumerated',\n values: [\n constants.idRegex.x.toString(),\n constants.idRegex.y.toString()\n ],\n \n editType: 'plot',\n \n },\n scaleratio: {\n valType: 'number',\n min: 0,\n dflt: 1,\n \n editType: 'plot',\n \n },\n constrain: {\n valType: 'enumerated',\n values: ['range', 'domain'],\n dflt: 'range',\n \n editType: 'plot',\n \n },\n // constraintoward: not used directly, just put here for reference\n constraintoward: {\n valType: 'enumerated',\n values: ['left', 'center', 'right', 'top', 'middle', 'bottom'],\n \n editType: 'plot',\n \n },\n matches: {\n valType: 'enumerated',\n values: [\n constants.idRegex.x.toString(),\n constants.idRegex.y.toString()\n ],\n \n editType: 'calc',\n \n },\n\n rangebreaks: templatedArray('rangebreak', {\n enabled: {\n valType: 'boolean',\n \n dflt: true,\n editType: 'calc',\n \n },\n\n bounds: {\n valType: 'info_array',\n \n items: [\n {valType: 'any', editType: 'calc'},\n {valType: 'any', editType: 'calc'}\n ],\n editType: 'calc',\n \n },\n\n pattern: {\n valType: 'enumerated',\n values: [DAY_OF_WEEK, HOUR, ''],\n \n editType: 'calc',\n \n },\n\n values: {\n valType: 'info_array',\n freeLength: true,\n \n editType: 'calc',\n items: {\n valType: 'any',\n editType: 'calc'\n },\n \n },\n dvalue: {\n // TODO could become 'any' to add support for 'months', 'years'\n valType: 'number',\n \n editType: 'calc',\n min: 0,\n dflt: ONEDAY,\n \n },\n\n /*\n gap: {\n valType: 'number',\n min: 0,\n dflt: 0, // for *date* axes, maybe something else for *linear*\n editType: 'calc',\n \n \n },\n gapmode: {\n valType: 'enumerated',\n values: ['pixels', 'fraction'],\n dflt: 'pixels',\n editType: 'calc',\n \n \n },\n */\n\n // To complete https://github.com/plotly/plotly.js/issues/4210\n // we additionally need `gap` and make this work on *linear*, and\n // possibly all other cartesian axis types. We possibly would also need\n // some style attributes controlling the zig-zag on the corresponding\n // axis.\n\n editType: 'calc'\n }),\n\n // ticks\n tickmode: {\n valType: 'enumerated',\n values: ['auto', 'linear', 'array'],\n \n editType: 'ticks',\n impliedEdits: {tick0: undefined, dtick: undefined},\n \n },\n nticks: {\n valType: 'integer',\n min: 0,\n dflt: 0,\n \n editType: 'ticks',\n \n },\n tick0: {\n valType: 'any',\n \n editType: 'ticks',\n impliedEdits: {tickmode: 'linear'},\n \n },\n dtick: {\n valType: 'any',\n \n editType: 'ticks',\n impliedEdits: {tickmode: 'linear'},\n \n },\n tickvals: {\n valType: 'data_array',\n editType: 'ticks',\n \n },\n ticktext: {\n valType: 'data_array',\n editType: 'ticks',\n \n },\n ticks: {\n valType: 'enumerated',\n values: ['outside', 'inside', ''],\n \n editType: 'ticks',\n \n },\n tickson: {\n valType: 'enumerated',\n values: ['labels', 'boundaries'],\n \n dflt: 'labels',\n editType: 'ticks',\n \n },\n mirror: {\n valType: 'enumerated',\n values: [true, 'ticks', false, 'all', 'allticks'],\n dflt: false,\n \n editType: 'ticks+layoutstyle',\n \n },\n ticklen: {\n valType: 'number',\n min: 0,\n dflt: 5,\n \n editType: 'ticks',\n \n },\n tickwidth: {\n valType: 'number',\n min: 0,\n dflt: 1,\n \n editType: 'ticks',\n \n },\n tickcolor: {\n valType: 'color',\n dflt: colorAttrs.defaultLine,\n \n editType: 'ticks',\n \n },\n showticklabels: {\n valType: 'boolean',\n dflt: true,\n \n editType: 'ticks',\n \n },\n automargin: {\n valType: 'boolean',\n dflt: false,\n \n editType: 'ticks',\n \n },\n showspikes: {\n valType: 'boolean',\n dflt: false,\n \n editType: 'modebar',\n \n },\n spikecolor: {\n valType: 'color',\n dflt: null,\n \n editType: 'none',\n \n },\n spikethickness: {\n valType: 'number',\n dflt: 3,\n \n editType: 'none',\n \n },\n spikedash: extendFlat({}, dash, {dflt: 'dash', editType: 'none'}),\n spikemode: {\n valType: 'flaglist',\n flags: ['toaxis', 'across', 'marker'],\n \n dflt: 'toaxis',\n editType: 'none',\n \n },\n spikesnap: {\n valType: 'enumerated',\n values: ['data', 'cursor', 'hovered data'],\n dflt: 'data',\n \n editType: 'none',\n \n },\n tickfont: fontAttrs({\n editType: 'ticks',\n \n }),\n tickangle: {\n valType: 'angle',\n dflt: 'auto',\n \n editType: 'ticks',\n \n },\n tickprefix: {\n valType: 'string',\n dflt: '',\n \n editType: 'ticks',\n \n },\n showtickprefix: {\n valType: 'enumerated',\n values: ['all', 'first', 'last', 'none'],\n dflt: 'all',\n \n editType: 'ticks',\n \n },\n ticksuffix: {\n valType: 'string',\n dflt: '',\n \n editType: 'ticks',\n \n },\n showticksuffix: {\n valType: 'enumerated',\n values: ['all', 'first', 'last', 'none'],\n dflt: 'all',\n \n editType: 'ticks',\n \n },\n showexponent: {\n valType: 'enumerated',\n values: ['all', 'first', 'last', 'none'],\n dflt: 'all',\n \n editType: 'ticks',\n \n },\n exponentformat: {\n valType: 'enumerated',\n values: ['none', 'e', 'E', 'power', 'SI', 'B'],\n dflt: 'B',\n \n editType: 'ticks',\n \n },\n separatethousands: {\n valType: 'boolean',\n dflt: false,\n \n editType: 'ticks',\n \n },\n tickformat: {\n valType: 'string',\n dflt: '',\n \n editType: 'ticks',\n \n },\n tickformatstops: templatedArray('tickformatstop', {\n enabled: {\n valType: 'boolean',\n \n dflt: true,\n editType: 'ticks',\n \n },\n dtickrange: {\n valType: 'info_array',\n \n items: [\n {valType: 'any', editType: 'ticks'},\n {valType: 'any', editType: 'ticks'}\n ],\n editType: 'ticks',\n \n },\n value: {\n valType: 'string',\n dflt: '',\n \n editType: 'ticks',\n \n },\n editType: 'ticks'\n }),\n hoverformat: {\n valType: 'string',\n dflt: '',\n \n editType: 'none',\n \n },\n // lines and grids\n showline: {\n valType: 'boolean',\n dflt: false,\n \n editType: 'ticks+layoutstyle',\n \n },\n linecolor: {\n valType: 'color',\n dflt: colorAttrs.defaultLine,\n \n editType: 'layoutstyle',\n \n },\n linewidth: {\n valType: 'number',\n min: 0,\n dflt: 1,\n \n editType: 'ticks+layoutstyle',\n \n },\n showgrid: {\n valType: 'boolean',\n \n editType: 'ticks',\n \n },\n gridcolor: {\n valType: 'color',\n dflt: colorAttrs.lightLine,\n \n editType: 'ticks',\n \n },\n gridwidth: {\n valType: 'number',\n min: 0,\n dflt: 1,\n \n editType: 'ticks',\n \n },\n zeroline: {\n valType: 'boolean',\n \n editType: 'ticks',\n \n },\n zerolinecolor: {\n valType: 'color',\n dflt: colorAttrs.defaultLine,\n \n editType: 'ticks',\n \n },\n zerolinewidth: {\n valType: 'number',\n dflt: 1,\n \n editType: 'ticks',\n \n },\n\n showdividers: {\n valType: 'boolean',\n dflt: true,\n \n editType: 'ticks',\n \n },\n dividercolor: {\n valType: 'color',\n dflt: colorAttrs.defaultLine,\n \n editType: 'ticks',\n \n },\n dividerwidth: {\n valType: 'number',\n dflt: 1,\n \n editType: 'ticks',\n \n },\n // TODO dividerlen: that would override \"to label base\" length?\n\n // positioning attributes\n // anchor: not used directly, just put here for reference\n // values are any opposite-letter axis id\n anchor: {\n valType: 'enumerated',\n values: [\n 'free',\n constants.idRegex.x.toString(),\n constants.idRegex.y.toString()\n ],\n \n editType: 'plot',\n \n },\n // side: not used directly, as values depend on direction\n // values are top, bottom for x axes, and left, right for y\n side: {\n valType: 'enumerated',\n values: ['top', 'bottom', 'left', 'right'],\n \n editType: 'plot',\n \n },\n // overlaying: not used directly, just put here for reference\n // values are false and any other same-letter axis id that's not\n // itself overlaying anything\n overlaying: {\n valType: 'enumerated',\n values: [\n 'free',\n constants.idRegex.x.toString(),\n constants.idRegex.y.toString()\n ],\n \n editType: 'plot',\n \n },\n layer: {\n valType: 'enumerated',\n values: ['above traces', 'below traces'],\n dflt: 'above traces',\n \n editType: 'plot',\n \n },\n domain: {\n valType: 'info_array',\n \n items: [\n {valType: 'number', min: 0, max: 1, editType: 'plot'},\n {valType: 'number', min: 0, max: 1, editType: 'plot'}\n ],\n dflt: [0, 1],\n editType: 'plot',\n \n },\n position: {\n valType: 'number',\n min: 0,\n max: 1,\n dflt: 0,\n \n editType: 'plot',\n \n },\n categoryorder: {\n valType: 'enumerated',\n values: [\n 'trace', 'category ascending', 'category descending', 'array',\n 'total ascending', 'total descending',\n 'min ascending', 'min descending',\n 'max ascending', 'max descending',\n 'sum ascending', 'sum descending',\n 'mean ascending', 'mean descending',\n 'median ascending', 'median descending'\n ],\n dflt: 'trace',\n \n editType: 'calc',\n \n },\n categoryarray: {\n valType: 'data_array',\n \n editType: 'calc',\n \n },\n uirevision: {\n valType: 'any',\n \n editType: 'none',\n \n },\n editType: 'calc',\n\n _deprecated: {\n autotick: {\n valType: 'boolean',\n \n editType: 'ticks',\n \n },\n title: {\n valType: 'string',\n \n editType: 'ticks',\n \n },\n titlefont: fontAttrs({\n editType: 'ticks',\n \n })\n }\n};\n\n},{\"../../components/color/attributes\":594,\"../../components/drawing/attributes\":616,\"../../constants/docs\":699,\"../../constants/numerical\":704,\"../../lib/extend\":719,\"../../plot_api/plot_template\":766,\"../font_attributes\":804,\"./constants\":782}],791:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Color = _dereq_('../../components/color');\nvar isUnifiedHover = _dereq_('../../components/fx/helpers').isUnifiedHover;\nvar handleHoverModeDefaults = _dereq_('../../components/fx/hovermode_defaults');\nvar Template = _dereq_('../../plot_api/plot_template');\nvar basePlotLayoutAttributes = _dereq_('../layout_attributes');\n\nvar layoutAttributes = _dereq_('./layout_attributes');\nvar handleTypeDefaults = _dereq_('./type_defaults');\nvar handleAxisDefaults = _dereq_('./axis_defaults');\nvar handleConstraintDefaults = _dereq_('./constraints').handleConstraintDefaults;\nvar handlePositionDefaults = _dereq_('./position_defaults');\n\nvar axisIds = _dereq_('./axis_ids');\nvar id2name = axisIds.id2name;\nvar name2id = axisIds.name2id;\n\nvar AX_ID_PATTERN = _dereq_('./constants').AX_ID_PATTERN;\n\nvar Registry = _dereq_('../../registry');\nvar traceIs = Registry.traceIs;\nvar getComponentMethod = Registry.getComponentMethod;\n\nfunction appendList(cont, k, item) {\n if(Array.isArray(cont[k])) cont[k].push(item);\n else cont[k] = [item];\n}\n\nmodule.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {\n var ax2traces = {};\n var xaMayHide = {};\n var yaMayHide = {};\n var xaMustDisplay = {};\n var yaMustDisplay = {};\n var yaMustNotReverse = {};\n var yaMayReverse = {};\n var axHasImage = {};\n var outerTicks = {};\n var noGrids = {};\n var i, j;\n\n // look for axes in the data\n for(i = 0; i < fullData.length; i++) {\n var trace = fullData[i];\n if(!traceIs(trace, 'cartesian') && !traceIs(trace, 'gl2d')) continue;\n\n var xaName;\n if(trace.xaxis) {\n xaName = id2name(trace.xaxis);\n appendList(ax2traces, xaName, trace);\n } else if(trace.xaxes) {\n for(j = 0; j < trace.xaxes.length; j++) {\n appendList(ax2traces, id2name(trace.xaxes[j]), trace);\n }\n }\n\n var yaName;\n if(trace.yaxis) {\n yaName = id2name(trace.yaxis);\n appendList(ax2traces, yaName, trace);\n } else if(trace.yaxes) {\n for(j = 0; j < trace.yaxes.length; j++) {\n appendList(ax2traces, id2name(trace.yaxes[j]), trace);\n }\n }\n\n // logic for funnels\n if(trace.type === 'funnel') {\n if(trace.orientation === 'h') {\n if(xaName) xaMayHide[xaName] = true;\n if(yaName) yaMayReverse[yaName] = true;\n } else {\n if(yaName) yaMayHide[yaName] = true;\n }\n } else if(trace.type === 'image') {\n if(yaName) axHasImage[yaName] = true;\n if(xaName) axHasImage[xaName] = true;\n } else {\n if(yaName) {\n yaMustDisplay[yaName] = true;\n yaMustNotReverse[yaName] = true;\n }\n\n if(!traceIs(trace, 'carpet') || (trace.type === 'carpet' && !trace._cheater)) {\n if(xaName) xaMustDisplay[xaName] = true;\n }\n }\n\n // Two things trigger axis visibility:\n // 1. is not carpet\n // 2. carpet that's not cheater\n\n // The above check for definitely-not-cheater is not adequate. This\n // second list tracks which axes *could* be a cheater so that the\n // full condition triggering hiding is:\n // *could* be a cheater and *is not definitely visible*\n if(trace.type === 'carpet' && trace._cheater) {\n if(xaName) xaMayHide[xaName] = true;\n }\n\n // check for default formatting tweaks\n if(traceIs(trace, '2dMap')) {\n outerTicks[xaName] = true;\n outerTicks[yaName] = true;\n }\n\n if(traceIs(trace, 'oriented')) {\n var positionAxis = trace.orientation === 'h' ? yaName : xaName;\n noGrids[positionAxis] = true;\n }\n }\n\n var subplots = layoutOut._subplots;\n var xIds = subplots.xaxis;\n var yIds = subplots.yaxis;\n var xNames = Lib.simpleMap(xIds, id2name);\n var yNames = Lib.simpleMap(yIds, id2name);\n var axNames = xNames.concat(yNames);\n\n // plot_bgcolor only makes sense if there's a (2D) plot!\n // TODO: bgcolor for each subplot, to inherit from the main one\n var plotBgColor = Color.background;\n if(xIds.length && yIds.length) {\n plotBgColor = Lib.coerce(layoutIn, layoutOut, basePlotLayoutAttributes, 'plot_bgcolor');\n }\n\n var bgColor = Color.combine(plotBgColor, layoutOut.paper_bgcolor);\n\n // name of single axis (e.g. 'xaxis', 'yaxis2')\n var axName;\n // id of single axis (e.g. 'y', 'x5')\n var axId;\n // 'x' or 'y'\n var axLetter;\n // input layout axis container\n var axLayoutIn;\n // full layout axis container\n var axLayoutOut;\n\n function newAxLayoutOut() {\n var traces = ax2traces[axName] || [];\n axLayoutOut._traceIndices = traces.map(function(t) { return t._expandedIndex; });\n axLayoutOut._annIndices = [];\n axLayoutOut._shapeIndices = [];\n axLayoutOut._imgIndices = [];\n axLayoutOut._subplotsWith = [];\n axLayoutOut._counterAxes = [];\n axLayoutOut._name = axLayoutOut._attr = axName;\n axLayoutOut._id = axId;\n }\n\n function coerce(attr, dflt) {\n return Lib.coerce(axLayoutIn, axLayoutOut, layoutAttributes, attr, dflt);\n }\n\n function coerce2(attr, dflt) {\n return Lib.coerce2(axLayoutIn, axLayoutOut, layoutAttributes, attr, dflt);\n }\n\n function getCounterAxes(axLetter) {\n return (axLetter === 'x') ? yIds : xIds;\n }\n\n function getOverlayableAxes(axLetter, axName) {\n var list = (axLetter === 'x') ? xNames : yNames;\n var out = [];\n\n for(var j = 0; j < list.length; j++) {\n var axName2 = list[j];\n\n if(axName2 !== axName && !(layoutIn[axName2] || {}).overlaying) {\n out.push(name2id(axName2));\n }\n }\n\n return out;\n }\n\n // list of available counter axis names\n var counterAxes = {x: getCounterAxes('x'), y: getCounterAxes('y')};\n // list of all x AND y axis ids\n var allAxisIds = counterAxes.x.concat(counterAxes.y);\n // lookup and list of axis ids that axes in axNames have a reference to,\n // even though they are missing from allAxisIds\n var missingMatchedAxisIdsLookup = {};\n var missingMatchedAxisIds = [];\n\n // fill in 'missing' axis lookup when an axis is set to match an axis\n // not part of the allAxisIds list, save axis type so that we can propagate\n // it to the missing axes\n function addMissingMatchedAxis() {\n var matchesIn = axLayoutIn.matches;\n if(AX_ID_PATTERN.test(matchesIn) && allAxisIds.indexOf(matchesIn) === -1) {\n missingMatchedAxisIdsLookup[matchesIn] = axLayoutIn.type;\n missingMatchedAxisIds = Object.keys(missingMatchedAxisIdsLookup);\n }\n }\n\n var hovermode = handleHoverModeDefaults(layoutIn, layoutOut, fullData);\n var unifiedHover = isUnifiedHover(hovermode);\n\n // first pass creates the containers, determines types, and handles most of the settings\n for(i = 0; i < axNames.length; i++) {\n axName = axNames[i];\n axId = name2id(axName);\n axLetter = axName.charAt(0);\n\n if(!Lib.isPlainObject(layoutIn[axName])) {\n layoutIn[axName] = {};\n }\n\n axLayoutIn = layoutIn[axName];\n axLayoutOut = Template.newContainer(layoutOut, axName, axLetter + 'axis');\n newAxLayoutOut();\n\n var visibleDflt =\n (axLetter === 'x' && !xaMustDisplay[axName] && xaMayHide[axName]) ||\n (axLetter === 'y' && !yaMustDisplay[axName] && yaMayHide[axName]);\n\n var reverseDflt =\n (axLetter === 'y' &&\n (\n (!yaMustNotReverse[axName] && yaMayReverse[axName]) ||\n axHasImage[axName]\n ));\n\n var defaultOptions = {\n letter: axLetter,\n font: layoutOut.font,\n outerTicks: outerTicks[axName],\n showGrid: !noGrids[axName],\n data: ax2traces[axName] || [],\n bgColor: bgColor,\n calendar: layoutOut.calendar,\n automargin: true,\n visibleDflt: visibleDflt,\n reverseDflt: reverseDflt,\n splomStash: ((layoutOut._splomAxes || {})[axLetter] || {})[axId]\n };\n\n coerce('uirevision', layoutOut.uirevision);\n\n handleTypeDefaults(axLayoutIn, axLayoutOut, coerce, defaultOptions);\n handleAxisDefaults(axLayoutIn, axLayoutOut, coerce, defaultOptions, layoutOut);\n\n var unifiedSpike = unifiedHover && axLetter === hovermode.charAt(0);\n var spikecolor = coerce2('spikecolor', unifiedHover ? axLayoutOut.color : undefined);\n var spikethickness = coerce2('spikethickness', unifiedHover ? 1.5 : undefined);\n var spikedash = coerce2('spikedash', unifiedHover ? 'dot' : undefined);\n var spikemode = coerce2('spikemode', unifiedHover ? 'across' : undefined);\n var spikesnap = coerce2('spikesnap', unifiedHover ? 'hovered data' : undefined);\n var showSpikes = coerce('showspikes', !!unifiedSpike || !!spikecolor || !!spikethickness || !!spikedash || !!spikemode || !!spikesnap);\n\n if(!showSpikes) {\n delete axLayoutOut.spikecolor;\n delete axLayoutOut.spikethickness;\n delete axLayoutOut.spikedash;\n delete axLayoutOut.spikemode;\n delete axLayoutOut.spikesnap;\n }\n\n handlePositionDefaults(axLayoutIn, axLayoutOut, coerce, {\n letter: axLetter,\n counterAxes: counterAxes[axLetter],\n overlayableAxes: getOverlayableAxes(axLetter, axName),\n grid: layoutOut.grid\n });\n\n coerce('title.standoff');\n\n addMissingMatchedAxis();\n\n axLayoutOut._input = axLayoutIn;\n }\n\n // coerce the 'missing' axes\n i = 0;\n while(i < missingMatchedAxisIds.length) {\n axId = missingMatchedAxisIds[i++];\n axName = id2name(axId);\n axLetter = axName.charAt(0);\n\n if(!Lib.isPlainObject(layoutIn[axName])) {\n layoutIn[axName] = {};\n }\n\n axLayoutIn = layoutIn[axName];\n axLayoutOut = Template.newContainer(layoutOut, axName, axLetter + 'axis');\n newAxLayoutOut();\n\n var defaultOptions2 = {\n letter: axLetter,\n font: layoutOut.font,\n outerTicks: outerTicks[axName],\n showGrid: !noGrids[axName],\n data: [],\n bgColor: bgColor,\n calendar: layoutOut.calendar,\n automargin: true,\n visibleDflt: false,\n reverseDflt: false,\n splomStash: ((layoutOut._splomAxes || {})[axLetter] || {})[axId]\n };\n\n coerce('uirevision', layoutOut.uirevision);\n\n axLayoutOut.type = missingMatchedAxisIdsLookup[axId] || 'linear';\n\n handleAxisDefaults(axLayoutIn, axLayoutOut, coerce, defaultOptions2, layoutOut);\n\n handlePositionDefaults(axLayoutIn, axLayoutOut, coerce, {\n letter: axLetter,\n counterAxes: counterAxes[axLetter],\n overlayableAxes: getOverlayableAxes(axLetter, axName),\n grid: layoutOut.grid\n });\n\n coerce('fixedrange');\n\n addMissingMatchedAxis();\n\n axLayoutOut._input = axLayoutIn;\n }\n\n // quick second pass for range slider and selector defaults\n var rangeSliderDefaults = getComponentMethod('rangeslider', 'handleDefaults');\n var rangeSelectorDefaults = getComponentMethod('rangeselector', 'handleDefaults');\n\n for(i = 0; i < xNames.length; i++) {\n axName = xNames[i];\n axLayoutIn = layoutIn[axName];\n axLayoutOut = layoutOut[axName];\n\n rangeSliderDefaults(layoutIn, layoutOut, axName);\n\n if(axLayoutOut.type === 'date') {\n rangeSelectorDefaults(\n axLayoutIn,\n axLayoutOut,\n layoutOut,\n yNames,\n axLayoutOut.calendar\n );\n }\n\n coerce('fixedrange');\n }\n\n for(i = 0; i < yNames.length; i++) {\n axName = yNames[i];\n axLayoutIn = layoutIn[axName];\n axLayoutOut = layoutOut[axName];\n\n var anchoredAxis = layoutOut[id2name(axLayoutOut.anchor)];\n\n var fixedRangeDflt = getComponentMethod('rangeslider', 'isVisible')(anchoredAxis);\n\n coerce('fixedrange', fixedRangeDflt);\n }\n\n // Finally, handle scale constraints and matching axes.\n //\n // We need to do this after all axes have coerced both `type`\n // (so we link only axes of the same type) and\n // `fixedrange` (so we can avoid linking from OR TO a fixed axis).\n\n // sets of axes linked by `scaleanchor` along with the scaleratios compounded\n // together, populated in handleConstraintDefaults\n var constraintGroups = layoutOut._axisConstraintGroups = [];\n // similar to _axisConstraintGroups, but for matching axes\n var matchGroups = layoutOut._axisMatchGroups = [];\n // make sure to include 'missing' axes here\n var allAxisIdsIncludingMissing = allAxisIds.concat(missingMatchedAxisIds);\n var axNamesIncludingMissing = axNames.concat(Lib.simpleMap(missingMatchedAxisIds, id2name));\n\n for(i = 0; i < axNamesIncludingMissing.length; i++) {\n axName = axNamesIncludingMissing[i];\n axLetter = axName.charAt(0);\n axLayoutIn = layoutIn[axName];\n axLayoutOut = layoutOut[axName];\n\n var scaleanchorDflt;\n if(axLetter === 'y' && !axLayoutIn.hasOwnProperty('scaleanchor') && axHasImage[axName]) {\n scaleanchorDflt = axLayoutOut.anchor;\n } else {\n scaleanchorDflt = undefined;\n }\n\n var constrainDflt;\n if(!axLayoutIn.hasOwnProperty('constrain') && axHasImage[axName]) {\n constrainDflt = 'domain';\n } else {\n constrainDflt = undefined;\n }\n\n handleConstraintDefaults(axLayoutIn, axLayoutOut, coerce, {\n allAxisIds: allAxisIdsIncludingMissing,\n layoutOut: layoutOut,\n scaleanchorDflt: scaleanchorDflt,\n constrainDflt: constrainDflt\n });\n }\n\n for(i = 0; i < matchGroups.length; i++) {\n var group = matchGroups[i];\n var rng = null;\n var autorange = null;\n\n // find 'matching' range attrs\n for(axId in group) {\n axLayoutOut = layoutOut[id2name(axId)];\n if(!axLayoutOut.matches) {\n rng = axLayoutOut.range;\n autorange = axLayoutOut.autorange;\n }\n }\n // if `ax.matches` values are reciprocal,\n // pick values of first axis in group\n if(rng === null || autorange === null) {\n for(axId in group) {\n axLayoutOut = layoutOut[id2name(axId)];\n rng = axLayoutOut.range;\n autorange = axLayoutOut.autorange;\n break;\n }\n }\n // apply matching range attrs\n for(axId in group) {\n axLayoutOut = layoutOut[id2name(axId)];\n if(axLayoutOut.matches) {\n axLayoutOut.range = rng.slice();\n axLayoutOut.autorange = autorange;\n }\n axLayoutOut._matchGroup = group;\n }\n\n // remove matching axis from scaleanchor constraint groups (for now)\n if(constraintGroups.length) {\n for(axId in group) {\n for(j = 0; j < constraintGroups.length; j++) {\n var group2 = constraintGroups[j];\n for(var axId2 in group2) {\n if(axId === axId2) {\n Lib.warn('Axis ' + axId2 + ' is set with both ' +\n 'a *scaleanchor* and *matches* constraint; ' +\n 'ignoring the scale constraint.');\n\n delete group2[axId2];\n if(Object.keys(group2).length < 2) {\n constraintGroups.splice(j, 1);\n }\n }\n }\n }\n }\n }\n }\n};\n\n},{\"../../components/color\":595,\"../../components/fx/helpers\":631,\"../../components/fx/hovermode_defaults\":634,\"../../lib\":728,\"../../plot_api/plot_template\":766,\"../../registry\":859,\"../layout_attributes\":830,\"./axis_defaults\":778,\"./axis_ids\":779,\"./constants\":782,\"./constraints\":783,\"./layout_attributes\":790,\"./position_defaults\":793,\"./type_defaults\":801}],792:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar colorMix = _dereq_('tinycolor2').mix;\nvar lightFraction = _dereq_('../../components/color/attributes').lightFraction;\nvar Lib = _dereq_('../../lib');\n\n/**\n * @param {object} opts :\n * - dfltColor {string} : default axis color\n * - bgColor {string} : combined subplot bg color\n * - blend {number, optional} : blend percentage (to compute dflt grid color)\n * - showLine {boolean} : show line by default\n * - showGrid {boolean} : show grid by default\n * - noZeroLine {boolean} : don't coerce zeroline* attributes\n * - attributes {object} : attribute object associated with input containers\n */\nmodule.exports = function handleLineGridDefaults(containerIn, containerOut, coerce, opts) {\n opts = opts || {};\n\n var dfltColor = opts.dfltColor;\n\n function coerce2(attr, dflt) {\n return Lib.coerce2(containerIn, containerOut, opts.attributes, attr, dflt);\n }\n\n var lineColor = coerce2('linecolor', dfltColor);\n var lineWidth = coerce2('linewidth');\n var showLine = coerce('showline', opts.showLine || !!lineColor || !!lineWidth);\n\n if(!showLine) {\n delete containerOut.linecolor;\n delete containerOut.linewidth;\n }\n\n var gridColorDflt = colorMix(dfltColor, opts.bgColor, opts.blend || lightFraction).toRgbString();\n var gridColor = coerce2('gridcolor', gridColorDflt);\n var gridWidth = coerce2('gridwidth');\n var showGridLines = coerce('showgrid', opts.showGrid || !!gridColor || !!gridWidth);\n\n if(!showGridLines) {\n delete containerOut.gridcolor;\n delete containerOut.gridwidth;\n }\n\n if(!opts.noZeroLine) {\n var zeroLineColor = coerce2('zerolinecolor', dfltColor);\n var zeroLineWidth = coerce2('zerolinewidth');\n var showZeroLine = coerce('zeroline', opts.showGrid || !!zeroLineColor || !!zeroLineWidth);\n\n if(!showZeroLine) {\n delete containerOut.zerolinecolor;\n delete containerOut.zerolinewidth;\n }\n }\n};\n\n},{\"../../components/color/attributes\":594,\"../../lib\":728,\"tinycolor2\":528}],793:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Lib = _dereq_('../../lib');\n\n\nmodule.exports = function handlePositionDefaults(containerIn, containerOut, coerce, options) {\n var counterAxes = options.counterAxes || [];\n var overlayableAxes = options.overlayableAxes || [];\n var letter = options.letter;\n var grid = options.grid;\n\n var dfltAnchor, dfltDomain, dfltSide, dfltPosition;\n\n if(grid) {\n dfltDomain = grid._domains[letter][grid._axisMap[containerOut._id]];\n dfltAnchor = grid._anchors[containerOut._id];\n if(dfltDomain) {\n dfltSide = grid[letter + 'side'].split(' ')[0];\n dfltPosition = grid.domain[letter][dfltSide === 'right' || dfltSide === 'top' ? 1 : 0];\n }\n }\n\n // Even if there's a grid, this axis may not be in it - fall back on non-grid defaults\n dfltDomain = dfltDomain || [0, 1];\n dfltAnchor = dfltAnchor || (isNumeric(containerIn.position) ? 'free' : (counterAxes[0] || 'free'));\n dfltSide = dfltSide || (letter === 'x' ? 'bottom' : 'left');\n dfltPosition = dfltPosition || 0;\n\n var anchor = Lib.coerce(containerIn, containerOut, {\n anchor: {\n valType: 'enumerated',\n values: ['free'].concat(counterAxes),\n dflt: dfltAnchor\n }\n }, 'anchor');\n\n if(anchor === 'free') coerce('position', dfltPosition);\n\n Lib.coerce(containerIn, containerOut, {\n side: {\n valType: 'enumerated',\n values: letter === 'x' ? ['bottom', 'top'] : ['left', 'right'],\n dflt: dfltSide\n }\n }, 'side');\n\n var overlaying = false;\n if(overlayableAxes.length) {\n overlaying = Lib.coerce(containerIn, containerOut, {\n overlaying: {\n valType: 'enumerated',\n values: [false].concat(overlayableAxes),\n dflt: false\n }\n }, 'overlaying');\n }\n\n if(!overlaying) {\n // TODO: right now I'm copying this domain over to overlaying axes\n // in ax.setscale()... but this means we still need (imperfect) logic\n // in the axes popover to hide domain for the overlaying axis.\n // perhaps I should make a private version _domain that all axes get???\n var domain = coerce('domain', dfltDomain);\n\n // according to https://www.npmjs.com/package/canvas-size\n // the minimum value of max canvas width across browsers and devices is 4096\n // which applied in the calculation below:\n if(domain[0] > domain[1] - 1 / 4096) containerOut.domain = dfltDomain;\n Lib.noneOrAll(containerIn.domain, containerOut.domain, dfltDomain);\n }\n\n coerce('layer');\n\n return containerOut;\n};\n\n},{\"../../lib\":728,\"fast-isnumeric\":236}],794:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar FROM_BL = _dereq_('../../constants/alignment').FROM_BL;\n\nmodule.exports = function scaleZoom(ax, factor, centerFraction) {\n if(centerFraction === undefined) {\n centerFraction = FROM_BL[ax.constraintoward || 'center'];\n }\n\n var rangeLinear = [ax.r2l(ax.range[0]), ax.r2l(ax.range[1])];\n var center = rangeLinear[0] + (rangeLinear[1] - rangeLinear[0]) * centerFraction;\n\n ax.range = ax._input.range = [\n ax.l2r(center + (rangeLinear[0] - center) * factor),\n ax.l2r(center + (rangeLinear[1] - center) * factor)\n ];\n};\n\n},{\"../../constants/alignment\":697}],795:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar polybool = _dereq_('polybooljs');\n\nvar Registry = _dereq_('../../registry');\nvar dashStyle = _dereq_('../../components/drawing').dashStyle;\nvar Color = _dereq_('../../components/color');\nvar Fx = _dereq_('../../components/fx');\nvar makeEventData = _dereq_('../../components/fx/helpers').makeEventData;\nvar dragHelpers = _dereq_('../../components/dragelement/helpers');\nvar freeMode = dragHelpers.freeMode;\nvar rectMode = dragHelpers.rectMode;\nvar drawMode = dragHelpers.drawMode;\nvar openMode = dragHelpers.openMode;\nvar selectMode = dragHelpers.selectMode;\n\nvar displayOutlines = _dereq_('../../components/shapes/draw_newshape/display_outlines');\nvar handleEllipse = _dereq_('../../components/shapes/draw_newshape/helpers').handleEllipse;\nvar newShapes = _dereq_('../../components/shapes/draw_newshape/newshapes');\n\nvar Lib = _dereq_('../../lib');\nvar polygon = _dereq_('../../lib/polygon');\nvar throttle = _dereq_('../../lib/throttle');\nvar getFromId = _dereq_('./axis_ids').getFromId;\nvar clearGlCanvases = _dereq_('../../lib/clear_gl_canvases');\n\nvar redrawReglTraces = _dereq_('../../plot_api/subroutines').redrawReglTraces;\n\nvar constants = _dereq_('./constants');\nvar MINSELECT = constants.MINSELECT;\n\nvar filteredPolygon = polygon.filter;\nvar polygonTester = polygon.tester;\n\nvar clearSelect = _dereq_('./handle_outline').clearSelect;\n\nvar helpers = _dereq_('./helpers');\nvar p2r = helpers.p2r;\nvar axValue = helpers.axValue;\nvar getTransform = helpers.getTransform;\n\nfunction prepSelect(e, startX, startY, dragOptions, mode) {\n var isFreeMode = freeMode(mode);\n var isRectMode = rectMode(mode);\n var isOpenMode = openMode(mode);\n var isDrawMode = drawMode(mode);\n var isSelectMode = selectMode(mode);\n\n var isLine = mode === 'drawline';\n var isEllipse = mode === 'drawcircle';\n var isLineOrEllipse = isLine || isEllipse; // cases with two start & end positions\n\n var gd = dragOptions.gd;\n var fullLayout = gd._fullLayout;\n var zoomLayer = fullLayout._zoomlayer;\n var dragBBox = dragOptions.element.getBoundingClientRect();\n var plotinfo = dragOptions.plotinfo;\n var transform = getTransform(plotinfo);\n var x0 = startX - dragBBox.left;\n var y0 = startY - dragBBox.top;\n var x1 = x0;\n var y1 = y0;\n var path0 = 'M' + x0 + ',' + y0;\n var pw = dragOptions.xaxes[0]._length;\n var ph = dragOptions.yaxes[0]._length;\n var allAxes = dragOptions.xaxes.concat(dragOptions.yaxes);\n var subtract = e.altKey &&\n !(drawMode(mode) && isOpenMode);\n\n var filterPoly, selectionTester, mergedPolygons, currentPolygon;\n var i, searchInfo, eventData;\n\n coerceSelectionsCache(e, gd, dragOptions);\n\n if(isFreeMode) {\n filterPoly = filteredPolygon([[x0, y0]], constants.BENDPX);\n }\n\n var outlines = zoomLayer.selectAll('path.select-outline-' + plotinfo.id).data(isDrawMode ? [0] : [1, 2]);\n var drwStyle = fullLayout.newshape;\n\n outlines.enter()\n .append('path')\n .attr('class', function(d) { return 'select-outline select-outline-' + d + ' select-outline-' + plotinfo.id; })\n .style(isDrawMode ? {\n opacity: drwStyle.opacity / 2,\n fill: isOpenMode ? undefined : drwStyle.fillcolor,\n stroke: drwStyle.line.color,\n 'stroke-dasharray': dashStyle(drwStyle.line.dash, drwStyle.line.width),\n 'stroke-width': drwStyle.line.width + 'px'\n } : {})\n .attr('fill-rule', drwStyle.fillrule)\n .classed('cursor-move', isDrawMode ? true : false)\n .attr('transform', transform)\n .attr('d', path0 + 'Z');\n\n var corners = zoomLayer.append('path')\n .attr('class', 'zoombox-corners')\n .style({\n fill: Color.background,\n stroke: Color.defaultLine,\n 'stroke-width': 1\n })\n .attr('transform', transform)\n .attr('d', 'M0,0Z');\n\n\n var throttleID = fullLayout._uid + constants.SELECTID;\n var selection = [];\n\n // find the traces to search for selection points\n var searchTraces = determineSearchTraces(gd, dragOptions.xaxes,\n dragOptions.yaxes, dragOptions.subplot);\n\n function ascending(a, b) { return a - b; }\n\n // allow subplots to override fillRangeItems routine\n var fillRangeItems;\n\n if(plotinfo.fillRangeItems) {\n fillRangeItems = plotinfo.fillRangeItems;\n } else {\n if(isRectMode) {\n fillRangeItems = function(eventData, poly) {\n var ranges = eventData.range = {};\n\n for(i = 0; i < allAxes.length; i++) {\n var ax = allAxes[i];\n var axLetter = ax._id.charAt(0);\n\n ranges[ax._id] = [\n p2r(ax, poly[axLetter + 'min']),\n p2r(ax, poly[axLetter + 'max'])\n ].sort(ascending);\n }\n };\n } else { // case of isFreeMode\n fillRangeItems = function(eventData, poly, filterPoly) {\n var dataPts = eventData.lassoPoints = {};\n\n for(i = 0; i < allAxes.length; i++) {\n var ax = allAxes[i];\n dataPts[ax._id] = filterPoly.filtered.map(axValue(ax));\n }\n };\n }\n }\n\n dragOptions.moveFn = function(dx0, dy0) {\n x1 = Math.max(0, Math.min(pw, dx0 + x0));\n y1 = Math.max(0, Math.min(ph, dy0 + y0));\n\n var dx = Math.abs(x1 - x0);\n var dy = Math.abs(y1 - y0);\n\n if(isRectMode) {\n var direction;\n var start, end;\n\n if(isSelectMode) {\n var q = fullLayout.selectdirection;\n\n if(q === 'any') {\n if(dy < Math.min(dx * 0.6, MINSELECT)) {\n direction = 'h';\n } else if(dx < Math.min(dy * 0.6, MINSELECT)) {\n direction = 'v';\n } else {\n direction = 'd';\n }\n } else {\n direction = q;\n }\n\n switch(direction) {\n case 'h':\n start = isEllipse ? ph / 2 : 0;\n end = ph;\n break;\n case 'v':\n start = isEllipse ? pw / 2 : 0;\n end = pw;\n break;\n }\n }\n\n if(isDrawMode) {\n switch(fullLayout.newshape.drawdirection) {\n case 'vertical':\n direction = 'h';\n start = isEllipse ? ph / 2 : 0;\n end = ph;\n break;\n case 'horizontal':\n direction = 'v';\n start = isEllipse ? pw / 2 : 0;\n end = pw;\n break;\n case 'ortho':\n if(dx < dy) {\n direction = 'h';\n start = y0;\n end = y1;\n } else {\n direction = 'v';\n start = x0;\n end = x1;\n }\n break;\n default: // i.e. case of 'diagonal'\n direction = 'd';\n }\n }\n\n if(direction === 'h') {\n // horizontal motion\n currentPolygon = isLineOrEllipse ?\n handleEllipse(isEllipse, [x1, start], [x1, end]) : // using x1 instead of x0 allows adjusting the line while drawing\n [[x0, start], [x0, end], [x1, end], [x1, start]]; // make a vertical box\n\n currentPolygon.xmin = isLineOrEllipse ? x1 : Math.min(x0, x1);\n currentPolygon.xmax = isLineOrEllipse ? x1 : Math.max(x0, x1);\n currentPolygon.ymin = Math.min(start, end);\n currentPolygon.ymax = Math.max(start, end);\n // extras to guide users in keeping a straight selection\n corners.attr('d', 'M' + currentPolygon.xmin + ',' + (y0 - MINSELECT) +\n 'h-4v' + (2 * MINSELECT) + 'h4Z' +\n 'M' + (currentPolygon.xmax - 1) + ',' + (y0 - MINSELECT) +\n 'h4v' + (2 * MINSELECT) + 'h-4Z');\n } else if(direction === 'v') {\n // vertical motion\n currentPolygon = isLineOrEllipse ?\n handleEllipse(isEllipse, [start, y1], [end, y1]) : // using y1 instead of y0 allows adjusting the line while drawing\n [[start, y0], [start, y1], [end, y1], [end, y0]]; // make a horizontal box\n\n currentPolygon.xmin = Math.min(start, end);\n currentPolygon.xmax = Math.max(start, end);\n currentPolygon.ymin = isLineOrEllipse ? y1 : Math.min(y0, y1);\n currentPolygon.ymax = isLineOrEllipse ? y1 : Math.max(y0, y1);\n corners.attr('d', 'M' + (x0 - MINSELECT) + ',' + currentPolygon.ymin +\n 'v-4h' + (2 * MINSELECT) + 'v4Z' +\n 'M' + (x0 - MINSELECT) + ',' + (currentPolygon.ymax - 1) +\n 'v4h' + (2 * MINSELECT) + 'v-4Z');\n } else if(direction === 'd') {\n // diagonal motion\n currentPolygon = isLineOrEllipse ?\n handleEllipse(isEllipse, [x0, y0], [x1, y1]) :\n [[x0, y0], [x0, y1], [x1, y1], [x1, y0]];\n\n currentPolygon.xmin = Math.min(x0, x1);\n currentPolygon.xmax = Math.max(x0, x1);\n currentPolygon.ymin = Math.min(y0, y1);\n currentPolygon.ymax = Math.max(y0, y1);\n corners.attr('d', 'M0,0Z');\n }\n } else if(isFreeMode) {\n filterPoly.addPt([x1, y1]);\n currentPolygon = filterPoly.filtered;\n }\n\n // create outline & tester\n if(dragOptions.selectionDefs && dragOptions.selectionDefs.length) {\n mergedPolygons = mergePolygons(dragOptions.mergedPolygons, currentPolygon, subtract);\n currentPolygon.subtract = subtract;\n selectionTester = multiTester(dragOptions.selectionDefs.concat([currentPolygon]));\n } else {\n mergedPolygons = [currentPolygon];\n selectionTester = polygonTester(currentPolygon);\n }\n\n // display polygons on the screen\n displayOutlines(convertPoly(mergedPolygons, isOpenMode), outlines, dragOptions);\n\n if(isSelectMode) {\n throttle.throttle(\n throttleID,\n constants.SELECTDELAY,\n function() {\n selection = [];\n\n var thisSelection;\n var traceSelections = [];\n var traceSelection;\n for(i = 0; i < searchTraces.length; i++) {\n searchInfo = searchTraces[i];\n\n traceSelection = searchInfo._module.selectPoints(searchInfo, selectionTester);\n traceSelections.push(traceSelection);\n\n thisSelection = fillSelectionItem(traceSelection, searchInfo);\n\n if(selection.length) {\n for(var j = 0; j < thisSelection.length; j++) {\n selection.push(thisSelection[j]);\n }\n } else selection = thisSelection;\n }\n\n eventData = {points: selection};\n updateSelectedState(gd, searchTraces, eventData);\n fillRangeItems(eventData, currentPolygon, filterPoly);\n dragOptions.gd.emit('plotly_selecting', eventData);\n }\n );\n }\n };\n\n dragOptions.clickFn = function(numClicks, evt) {\n corners.remove();\n\n if(gd._fullLayout._activeShapeIndex >= 0) {\n gd._fullLayout._deactivateShape(gd);\n return;\n }\n if(isDrawMode) return;\n\n var clickmode = fullLayout.clickmode;\n\n throttle.done(throttleID).then(function() {\n throttle.clear(throttleID);\n if(numClicks === 2) {\n // clear selection on doubleclick\n outlines.remove();\n for(i = 0; i < searchTraces.length; i++) {\n searchInfo = searchTraces[i];\n searchInfo._module.selectPoints(searchInfo, false);\n }\n\n updateSelectedState(gd, searchTraces);\n\n clearSelectionsCache(dragOptions);\n\n gd.emit('plotly_deselect', null);\n } else {\n if(clickmode.indexOf('select') > -1) {\n selectOnClick(evt, gd, dragOptions.xaxes, dragOptions.yaxes,\n dragOptions.subplot, dragOptions, outlines);\n }\n\n if(clickmode === 'event') {\n // TODO: remove in v2 - this was probably never intended to work as it does,\n // but in case anyone depends on it we don't want to break it now.\n // Note that click-to-select introduced pre v2 also emitts proper\n // event data when clickmode is having 'select' in its flag list.\n gd.emit('plotly_selected', undefined);\n }\n }\n\n Fx.click(gd, evt);\n }).catch(Lib.error);\n };\n\n dragOptions.doneFn = function() {\n corners.remove();\n\n throttle.done(throttleID).then(function() {\n throttle.clear(throttleID);\n dragOptions.gd.emit('plotly_selected', eventData);\n\n if(currentPolygon && dragOptions.selectionDefs) {\n // save last polygons\n currentPolygon.subtract = subtract;\n dragOptions.selectionDefs.push(currentPolygon);\n\n // we have to keep reference to arrays container\n dragOptions.mergedPolygons.length = 0;\n [].push.apply(dragOptions.mergedPolygons, mergedPolygons);\n }\n\n if(dragOptions.doneFnCompleted) {\n dragOptions.doneFnCompleted(selection);\n }\n }).catch(Lib.error);\n\n if(isDrawMode) {\n clearSelectionsCache(dragOptions);\n }\n };\n}\n\nfunction selectOnClick(evt, gd, xAxes, yAxes, subplot, dragOptions, polygonOutlines) {\n var hoverData = gd._hoverdata;\n var fullLayout = gd._fullLayout;\n var clickmode = fullLayout.clickmode;\n var sendEvents = clickmode.indexOf('event') > -1;\n var selection = [];\n var searchTraces, searchInfo, currentSelectionDef, selectionTester, traceSelection;\n var thisTracesSelection, pointOrBinSelected, subtract, eventData, i;\n\n if(isHoverDataSet(hoverData)) {\n coerceSelectionsCache(evt, gd, dragOptions);\n searchTraces = determineSearchTraces(gd, xAxes, yAxes, subplot);\n var clickedPtInfo = extractClickedPtInfo(hoverData, searchTraces);\n var isBinnedTrace = clickedPtInfo.pointNumbers.length > 0;\n\n\n // Note: potentially costly operation isPointOrBinSelected is\n // called as late as possible through the use of an assignment\n // in an if condition.\n if(isBinnedTrace ?\n isOnlyThisBinSelected(searchTraces, clickedPtInfo) :\n isOnlyOnePointSelected(searchTraces) &&\n (pointOrBinSelected = isPointOrBinSelected(clickedPtInfo))) {\n if(polygonOutlines) polygonOutlines.remove();\n for(i = 0; i < searchTraces.length; i++) {\n searchInfo = searchTraces[i];\n searchInfo._module.selectPoints(searchInfo, false);\n }\n\n updateSelectedState(gd, searchTraces);\n\n clearSelectionsCache(dragOptions);\n\n if(sendEvents) {\n gd.emit('plotly_deselect', null);\n }\n } else {\n subtract = evt.shiftKey &&\n (pointOrBinSelected !== undefined ?\n pointOrBinSelected :\n isPointOrBinSelected(clickedPtInfo));\n currentSelectionDef = newPointSelectionDef(clickedPtInfo.pointNumber, clickedPtInfo.searchInfo, subtract);\n\n var allSelectionDefs = dragOptions.selectionDefs.concat([currentSelectionDef]);\n selectionTester = multiTester(allSelectionDefs);\n\n for(i = 0; i < searchTraces.length; i++) {\n traceSelection = searchTraces[i]._module.selectPoints(searchTraces[i], selectionTester);\n thisTracesSelection = fillSelectionItem(traceSelection, searchTraces[i]);\n\n if(selection.length) {\n for(var j = 0; j < thisTracesSelection.length; j++) {\n selection.push(thisTracesSelection[j]);\n }\n } else selection = thisTracesSelection;\n }\n\n eventData = {points: selection};\n updateSelectedState(gd, searchTraces, eventData);\n\n if(currentSelectionDef && dragOptions) {\n dragOptions.selectionDefs.push(currentSelectionDef);\n }\n\n if(polygonOutlines) {\n var polygons = dragOptions.mergedPolygons;\n var isOpenMode = openMode(dragOptions.dragmode);\n\n // display polygons on the screen\n displayOutlines(convertPoly(polygons, isOpenMode), polygonOutlines, dragOptions);\n }\n\n if(sendEvents) {\n gd.emit('plotly_selected', eventData);\n }\n }\n }\n}\n\n/**\n * Constructs a new point selection definition object.\n */\nfunction newPointSelectionDef(pointNumber, searchInfo, subtract) {\n return {\n pointNumber: pointNumber,\n searchInfo: searchInfo,\n subtract: subtract\n };\n}\n\nfunction isPointSelectionDef(o) {\n return 'pointNumber' in o && 'searchInfo' in o;\n}\n\n/*\n * Constructs a new point number tester.\n */\nfunction newPointNumTester(pointSelectionDef) {\n return {\n xmin: 0,\n xmax: 0,\n ymin: 0,\n ymax: 0,\n pts: [],\n contains: function(pt, omitFirstEdge, pointNumber, searchInfo) {\n var idxWantedTrace = pointSelectionDef.searchInfo.cd[0].trace._expandedIndex;\n var idxActualTrace = searchInfo.cd[0].trace._expandedIndex;\n return idxActualTrace === idxWantedTrace &&\n pointNumber === pointSelectionDef.pointNumber;\n },\n isRect: false,\n degenerate: false,\n subtract: pointSelectionDef.subtract\n };\n}\n\n/**\n * Wraps multiple selection testers.\n *\n * @param {Array} list - An array of selection testers.\n *\n * @return a selection tester object with a contains function\n * that can be called to evaluate a point against all wrapped\n * selection testers that were passed in list.\n */\nfunction multiTester(list) {\n var testers = [];\n var xmin = isPointSelectionDef(list[0]) ? 0 : list[0][0][0];\n var xmax = xmin;\n var ymin = isPointSelectionDef(list[0]) ? 0 : list[0][0][1];\n var ymax = ymin;\n\n for(var i = 0; i < list.length; i++) {\n if(isPointSelectionDef(list[i])) {\n testers.push(newPointNumTester(list[i]));\n } else {\n var tester = polygon.tester(list[i]);\n tester.subtract = list[i].subtract;\n testers.push(tester);\n xmin = Math.min(xmin, tester.xmin);\n xmax = Math.max(xmax, tester.xmax);\n ymin = Math.min(ymin, tester.ymin);\n ymax = Math.max(ymax, tester.ymax);\n }\n }\n\n /**\n * Tests if the given point is within this tester.\n *\n * @param {Array} pt - [0] is the x coordinate, [1] is the y coordinate of the point.\n * @param {*} arg - An optional parameter to pass down to wrapped testers.\n * @param {number} pointNumber - The point number of the point within the underlying data array.\n * @param {number} searchInfo - An object identifying the trace the point is contained in.\n *\n * @return {boolean} true if point is considered to be selected, false otherwise.\n */\n function contains(pt, arg, pointNumber, searchInfo) {\n var contained = false;\n for(var i = 0; i < testers.length; i++) {\n if(testers[i].contains(pt, arg, pointNumber, searchInfo)) {\n // if contained by subtract tester - exclude the point\n contained = testers[i].subtract === false;\n }\n }\n\n return contained;\n }\n\n return {\n xmin: xmin,\n xmax: xmax,\n ymin: ymin,\n ymax: ymax,\n pts: [],\n contains: contains,\n isRect: false,\n degenerate: false\n };\n}\n\nfunction coerceSelectionsCache(evt, gd, dragOptions) {\n gd._fullLayout._drawing = false;\n\n var fullLayout = gd._fullLayout;\n var plotinfo = dragOptions.plotinfo;\n var dragmode = dragOptions.dragmode;\n\n var selectingOnSameSubplot = (\n fullLayout._lastSelectedSubplot &&\n fullLayout._lastSelectedSubplot === plotinfo.id\n );\n\n var hasModifierKey = (evt.shiftKey || evt.altKey) &&\n !(drawMode(dragmode) && openMode(dragmode));\n\n if(selectingOnSameSubplot && hasModifierKey &&\n (plotinfo.selection && plotinfo.selection.selectionDefs) && !dragOptions.selectionDefs) {\n // take over selection definitions from prev mode, if any\n dragOptions.selectionDefs = plotinfo.selection.selectionDefs;\n dragOptions.mergedPolygons = plotinfo.selection.mergedPolygons;\n } else if(!hasModifierKey || !plotinfo.selection) {\n clearSelectionsCache(dragOptions);\n }\n\n // clear selection outline when selecting a different subplot\n if(!selectingOnSameSubplot) {\n clearSelect(gd);\n fullLayout._lastSelectedSubplot = plotinfo.id;\n }\n}\n\nfunction clearSelectionsCache(dragOptions) {\n var dragmode = dragOptions.dragmode;\n var plotinfo = dragOptions.plotinfo;\n\n var gd = dragOptions.gd;\n if(gd._fullLayout._activeShapeIndex >= 0) {\n gd._fullLayout._deactivateShape(gd);\n }\n\n if(drawMode(dragmode)) {\n var fullLayout = gd._fullLayout;\n var zoomLayer = fullLayout._zoomlayer;\n\n var outlines = zoomLayer.selectAll('.select-outline-' + plotinfo.id);\n if(outlines && gd._fullLayout._drawing) {\n // add shape\n var shapes = newShapes(outlines, dragOptions);\n if(shapes) {\n Registry.call('_guiRelayout', gd, {\n shapes: shapes\n });\n }\n\n gd._fullLayout._drawing = false;\n }\n }\n\n plotinfo.selection = {};\n plotinfo.selection.selectionDefs = dragOptions.selectionDefs = [];\n plotinfo.selection.mergedPolygons = dragOptions.mergedPolygons = [];\n}\n\nfunction determineSearchTraces(gd, xAxes, yAxes, subplot) {\n var searchTraces = [];\n var xAxisIds = xAxes.map(function(ax) { return ax._id; });\n var yAxisIds = yAxes.map(function(ax) { return ax._id; });\n var cd, trace, i;\n\n for(i = 0; i < gd.calcdata.length; i++) {\n cd = gd.calcdata[i];\n trace = cd[0].trace;\n\n if(trace.visible !== true || !trace._module || !trace._module.selectPoints) continue;\n\n if(subplot && (trace.subplot === subplot || trace.geo === subplot)) {\n searchTraces.push(createSearchInfo(trace._module, cd, xAxes[0], yAxes[0]));\n } else if(\n trace.type === 'splom' &&\n // FIXME: make sure we don't have more than single axis for splom\n trace._xaxes[xAxisIds[0]] && trace._yaxes[yAxisIds[0]]\n ) {\n var info = createSearchInfo(trace._module, cd, xAxes[0], yAxes[0]);\n info.scene = gd._fullLayout._splomScenes[trace.uid];\n searchTraces.push(info);\n } else if(\n trace.type === 'sankey'\n ) {\n var sankeyInfo = createSearchInfo(trace._module, cd, xAxes[0], yAxes[0]);\n searchTraces.push(sankeyInfo);\n } else {\n if(xAxisIds.indexOf(trace.xaxis) === -1) continue;\n if(yAxisIds.indexOf(trace.yaxis) === -1) continue;\n\n searchTraces.push(createSearchInfo(trace._module, cd,\n getFromId(gd, trace.xaxis), getFromId(gd, trace.yaxis)));\n }\n }\n\n return searchTraces;\n\n function createSearchInfo(module, calcData, xaxis, yaxis) {\n return {\n _module: module,\n cd: calcData,\n xaxis: xaxis,\n yaxis: yaxis\n };\n }\n}\n\nfunction isHoverDataSet(hoverData) {\n return hoverData &&\n Array.isArray(hoverData) &&\n hoverData[0].hoverOnBox !== true;\n}\n\nfunction extractClickedPtInfo(hoverData, searchTraces) {\n var hoverDatum = hoverData[0];\n var pointNumber = -1;\n var pointNumbers = [];\n var searchInfo, i;\n\n for(i = 0; i < searchTraces.length; i++) {\n searchInfo = searchTraces[i];\n if(hoverDatum.fullData._expandedIndex === searchInfo.cd[0].trace._expandedIndex) {\n // Special case for box (and violin)\n if(hoverDatum.hoverOnBox === true) {\n break;\n }\n\n // Hint: in some traces like histogram, one graphical element\n // doesn't correspond to one particular data point, but to\n // bins of data points. Thus, hoverDatum can have a binNumber\n // property instead of pointNumber.\n if(hoverDatum.pointNumber !== undefined) {\n pointNumber = hoverDatum.pointNumber;\n } else if(hoverDatum.binNumber !== undefined) {\n pointNumber = hoverDatum.binNumber;\n pointNumbers = hoverDatum.pointNumbers;\n }\n\n break;\n }\n }\n\n return {\n pointNumber: pointNumber,\n pointNumbers: pointNumbers,\n searchInfo: searchInfo\n };\n}\n\nfunction isPointOrBinSelected(clickedPtInfo) {\n var trace = clickedPtInfo.searchInfo.cd[0].trace;\n var ptNum = clickedPtInfo.pointNumber;\n var ptNums = clickedPtInfo.pointNumbers;\n var ptNumsSet = ptNums.length > 0;\n\n // When pointsNumbers is set (e.g. histogram's binning),\n // it is assumed that when the first point of\n // a bin is selected, all others are as well\n var ptNumToTest = ptNumsSet ? ptNums[0] : ptNum;\n\n // TODO potential performance improvement\n // Primarily we need this function to determine if a click adds\n // or subtracts from a selection.\n // In cases `trace.selectedpoints` is a huge array, indexOf\n // might be slow. One remedy would be to introduce a hash somewhere.\n return trace.selectedpoints ? trace.selectedpoints.indexOf(ptNumToTest) > -1 : false;\n}\n\nfunction isOnlyThisBinSelected(searchTraces, clickedPtInfo) {\n var tracesWithSelectedPts = [];\n var searchInfo, trace, isSameTrace, i;\n\n for(i = 0; i < searchTraces.length; i++) {\n searchInfo = searchTraces[i];\n if(searchInfo.cd[0].trace.selectedpoints && searchInfo.cd[0].trace.selectedpoints.length > 0) {\n tracesWithSelectedPts.push(searchInfo);\n }\n }\n\n if(tracesWithSelectedPts.length === 1) {\n isSameTrace = tracesWithSelectedPts[0] === clickedPtInfo.searchInfo;\n if(isSameTrace) {\n trace = clickedPtInfo.searchInfo.cd[0].trace;\n if(trace.selectedpoints.length === clickedPtInfo.pointNumbers.length) {\n for(i = 0; i < clickedPtInfo.pointNumbers.length; i++) {\n if(trace.selectedpoints.indexOf(clickedPtInfo.pointNumbers[i]) < 0) {\n return false;\n }\n }\n return true;\n }\n }\n }\n\n return false;\n}\n\nfunction isOnlyOnePointSelected(searchTraces) {\n var len = 0;\n var searchInfo, trace, i;\n\n for(i = 0; i < searchTraces.length; i++) {\n searchInfo = searchTraces[i];\n trace = searchInfo.cd[0].trace;\n if(trace.selectedpoints) {\n if(trace.selectedpoints.length > 1) return false;\n\n len += trace.selectedpoints.length;\n if(len > 1) return false;\n }\n }\n\n return len === 1;\n}\n\nfunction updateSelectedState(gd, searchTraces, eventData) {\n var i, searchInfo, cd, trace;\n\n // before anything else, update preGUI if necessary\n for(i = 0; i < searchTraces.length; i++) {\n var fullInputTrace = searchTraces[i].cd[0].trace._fullInput;\n var tracePreGUI = gd._fullLayout._tracePreGUI[fullInputTrace.uid] || {};\n if(tracePreGUI.selectedpoints === undefined) {\n tracePreGUI.selectedpoints = fullInputTrace._input.selectedpoints || null;\n }\n }\n\n if(eventData) {\n var pts = eventData.points || [];\n\n for(i = 0; i < searchTraces.length; i++) {\n trace = searchTraces[i].cd[0].trace;\n trace._input.selectedpoints = trace._fullInput.selectedpoints = [];\n if(trace._fullInput !== trace) trace.selectedpoints = [];\n }\n\n for(i = 0; i < pts.length; i++) {\n var pt = pts[i];\n var data = pt.data;\n var fullData = pt.fullData;\n\n if(pt.pointIndices) {\n [].push.apply(data.selectedpoints, pt.pointIndices);\n if(trace._fullInput !== trace) {\n [].push.apply(fullData.selectedpoints, pt.pointIndices);\n }\n } else {\n data.selectedpoints.push(pt.pointIndex);\n if(trace._fullInput !== trace) {\n fullData.selectedpoints.push(pt.pointIndex);\n }\n }\n }\n } else {\n for(i = 0; i < searchTraces.length; i++) {\n trace = searchTraces[i].cd[0].trace;\n delete trace.selectedpoints;\n delete trace._input.selectedpoints;\n if(trace._fullInput !== trace) {\n delete trace._fullInput.selectedpoints;\n }\n }\n }\n\n var hasRegl = false;\n\n for(i = 0; i < searchTraces.length; i++) {\n searchInfo = searchTraces[i];\n cd = searchInfo.cd;\n trace = cd[0].trace;\n\n if(Registry.traceIs(trace, 'regl')) {\n hasRegl = true;\n }\n\n var _module = searchInfo._module;\n var fn = _module.styleOnSelect || _module.style;\n if(fn) {\n fn(gd, cd, cd[0].node3);\n if(cd[0].nodeRangePlot3) fn(gd, cd, cd[0].nodeRangePlot3);\n }\n }\n\n if(hasRegl) {\n clearGlCanvases(gd);\n redrawReglTraces(gd);\n }\n}\n\nfunction mergePolygons(list, poly, subtract) {\n var res;\n\n if(subtract) {\n res = polybool.difference({\n regions: list,\n inverted: false\n }, {\n regions: [poly],\n inverted: false\n });\n\n return res.regions;\n }\n\n res = polybool.union({\n regions: list,\n inverted: false\n }, {\n regions: [poly],\n inverted: false\n });\n\n return res.regions;\n}\n\nfunction fillSelectionItem(selection, searchInfo) {\n if(Array.isArray(selection)) {\n var cd = searchInfo.cd;\n var trace = searchInfo.cd[0].trace;\n\n for(var i = 0; i < selection.length; i++) {\n selection[i] = makeEventData(selection[i], trace, cd);\n }\n }\n\n return selection;\n}\n\nfunction convertPoly(polygonsIn, isOpenMode) { // add M and L command to draft positions\n var polygonsOut = [];\n for(var i = 0; i < polygonsIn.length; i++) {\n polygonsOut[i] = [];\n for(var j = 0; j < polygonsIn[i].length; j++) {\n polygonsOut[i][j] = [];\n polygonsOut[i][j][0] = j ? 'L' : 'M';\n for(var k = 0; k < polygonsIn[i][j].length; k++) {\n polygonsOut[i][j].push(\n polygonsIn[i][j][k]\n );\n }\n }\n\n if(!isOpenMode) {\n polygonsOut[i].push([\n 'Z',\n polygonsOut[i][0][1], // initial x\n polygonsOut[i][0][2] // initial y\n ]);\n }\n }\n\n return polygonsOut;\n}\n\nmodule.exports = {\n prepSelect: prepSelect,\n clearSelect: clearSelect,\n clearSelectionsCache: clearSelectionsCache,\n selectOnClick: selectOnClick\n};\n\n},{\"../../components/color\":595,\"../../components/dragelement/helpers\":613,\"../../components/drawing\":617,\"../../components/fx\":635,\"../../components/fx/helpers\":631,\"../../components/shapes/draw_newshape/display_outlines\":680,\"../../components/shapes/draw_newshape/helpers\":681,\"../../components/shapes/draw_newshape/newshapes\":682,\"../../lib\":728,\"../../lib/clear_gl_canvases\":713,\"../../lib/polygon\":740,\"../../lib/throttle\":753,\"../../plot_api/subroutines\":767,\"../../registry\":859,\"./axis_ids\":779,\"./constants\":782,\"./handle_outline\":786,\"./helpers\":787,\"polybooljs\":471}],796:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Lib = _dereq_('../../lib');\nvar cleanNumber = Lib.cleanNumber;\nvar ms2DateTime = Lib.ms2DateTime;\nvar dateTime2ms = Lib.dateTime2ms;\nvar ensureNumber = Lib.ensureNumber;\nvar isArrayOrTypedArray = Lib.isArrayOrTypedArray;\n\nvar numConstants = _dereq_('../../constants/numerical');\nvar FP_SAFE = numConstants.FP_SAFE;\nvar BADNUM = numConstants.BADNUM;\nvar LOG_CLIP = numConstants.LOG_CLIP;\nvar ONEDAY = numConstants.ONEDAY;\nvar ONEHOUR = numConstants.ONEHOUR;\nvar ONEMIN = numConstants.ONEMIN;\nvar ONESEC = numConstants.ONESEC;\n\nvar axisIds = _dereq_('./axis_ids');\n\nvar constants = _dereq_('./constants');\nvar HOUR_PATTERN = constants.HOUR_PATTERN;\nvar WEEKDAY_PATTERN = constants.WEEKDAY_PATTERN;\n\nfunction fromLog(v) {\n return Math.pow(10, v);\n}\n\nfunction isValidCategory(v) {\n return v !== null && v !== undefined;\n}\n\n/**\n * Define the conversion functions for an axis data is used in 5 ways:\n *\n * d: data, in whatever form it's provided\n * c: calcdata: turned into numbers, but not linearized\n * l: linearized - same as c except for log axes (and other nonlinear\n * mappings later?) this is used when we need to know if it's\n * *possible* to show some data on this axis, without caring about\n * the current range\n * p: pixel value - mapped to the screen with current size and zoom\n * r: ranges, tick0, and annotation positions match one of the above\n * but are handled differently for different types:\n * - linear and date: data format (d)\n * - category: calcdata format (c), and will stay that way because\n * the data format has no continuous mapping\n * - log: linearized (l) format\n * TODO: in v2.0 we plan to change it to data format. At that point\n * shapes will work the same way as ranges, tick0, and annotations\n * so they can use this conversion too.\n *\n * Creates/updates these conversion functions, and a few more utilities\n * like cleanRange, and makeCalcdata\n *\n * also clears the autotick constraints ._minDtick, ._forceTick0\n */\nmodule.exports = function setConvert(ax, fullLayout) {\n fullLayout = fullLayout || {};\n\n var axId = (ax._id || 'x');\n var axLetter = axId.charAt(0);\n\n function toLog(v, clip) {\n if(v > 0) return Math.log(v) / Math.LN10;\n\n else if(v <= 0 && clip && ax.range && ax.range.length === 2) {\n // clip NaN (ie past negative infinity) to LOG_CLIP axis\n // length past the negative edge\n var r0 = ax.range[0];\n var r1 = ax.range[1];\n return 0.5 * (r0 + r1 - 2 * LOG_CLIP * Math.abs(r0 - r1));\n } else return BADNUM;\n }\n\n /*\n * wrapped dateTime2ms that:\n * - accepts ms numbers for backward compatibility\n * - inserts a dummy arg so calendar is the 3rd arg (see notes below).\n * - defaults to ax.calendar\n */\n function dt2ms(v, _, calendar, opts) {\n // NOTE: Changed this behavior: previously we took any numeric value\n // to be a ms, even if it was a string that could be a bare year.\n // Now we convert it as a date if at all possible, and only try\n // as (local) ms if that fails.\n var ms = dateTime2ms(v, calendar || ax.calendar);\n if(ms === BADNUM) {\n if(isNumeric(v)) {\n v = +v;\n if((opts || {}).msUTC) {\n // For now it is only used\n // to fix bar length in milliseconds.\n // It could be applied in other places in v2\n return v;\n }\n\n // keep track of tenths of ms, that `new Date` will drop\n // same logic as in Lib.ms2DateTime\n var msecTenths = Math.floor(Lib.mod(v + 0.05, 1) * 10);\n var msRounded = Math.round(v - msecTenths / 10);\n ms = dateTime2ms(new Date(msRounded)) + msecTenths / 10;\n } else return BADNUM;\n }\n return ms;\n }\n\n // wrapped ms2DateTime to insert default ax.calendar\n function ms2dt(v, r, calendar) {\n return ms2DateTime(v, r, calendar || ax.calendar);\n }\n\n function getCategoryName(v) {\n return ax._categories[Math.round(v)];\n }\n\n /*\n * setCategoryIndex: return the index of category v,\n * inserting it in the list if it's not already there\n *\n * this will enter the categories in the order it\n * encounters them, ie all the categories from the\n * first data set, then all the ones from the second\n * that aren't in the first etc.\n *\n * it is assumed that this function is being invoked in the\n * already sorted category order; otherwise there would be\n * a disconnect between the array and the index returned\n */\n function setCategoryIndex(v) {\n if(isValidCategory(v)) {\n if(ax._categoriesMap === undefined) {\n ax._categoriesMap = {};\n }\n\n if(ax._categoriesMap[v] !== undefined) {\n return ax._categoriesMap[v];\n } else {\n ax._categories.push(typeof v === 'number' ? String(v) : v);\n\n var curLength = ax._categories.length - 1;\n ax._categoriesMap[v] = curLength;\n\n return curLength;\n }\n }\n return BADNUM;\n }\n\n function setMultiCategoryIndex(arrayIn, len) {\n var arrayOut = new Array(len);\n\n for(var i = 0; i < len; i++) {\n var v0 = (arrayIn[0] || [])[i];\n var v1 = (arrayIn[1] || [])[i];\n arrayOut[i] = getCategoryIndex([v0, v1]);\n }\n\n return arrayOut;\n }\n\n function getCategoryIndex(v) {\n if(ax._categoriesMap) {\n return ax._categoriesMap[v];\n }\n }\n\n function getCategoryPosition(v) {\n // d2l/d2c variant that that won't add categories but will also\n // allow numbers to be mapped to the linearized axis positions\n var index = getCategoryIndex(v);\n if(index !== undefined) return index;\n if(isNumeric(v)) return +v;\n }\n\n // include 2 fractional digits on pixel, for PDF zooming etc\n function _l2p(v, m, b) { return d3.round(b + m * v, 2); }\n\n function _p2l(px, m, b) { return (px - b) / m; }\n\n var l2p = function l2p(v) {\n if(!isNumeric(v)) return BADNUM;\n return _l2p(v, ax._m, ax._b);\n };\n\n var p2l = function(px) {\n return _p2l(px, ax._m, ax._b);\n };\n\n if(ax.rangebreaks) {\n var isY = axLetter === 'y';\n\n l2p = function(v) {\n if(!isNumeric(v)) return BADNUM;\n var len = ax._rangebreaks.length;\n if(!len) return _l2p(v, ax._m, ax._b);\n\n var flip = isY;\n if(ax.range[0] > ax.range[1]) flip = !flip;\n var signAx = flip ? -1 : 1;\n var pos = signAx * v;\n\n var q = 0;\n for(var i = 0; i < len; i++) {\n var min = signAx * ax._rangebreaks[i].min;\n var max = signAx * ax._rangebreaks[i].max;\n\n if(pos < min) break;\n if(pos > max) q = i + 1;\n else {\n // when falls into break, pick 'closest' offset\n q = pos < (min + max) / 2 ? i : i + 1;\n break;\n }\n }\n var b2 = ax._B[q] || 0;\n if(!isFinite(b2)) return 0; // avoid NaN translate e.g. in positionLabels if one keep zooming exactly into a break\n return _l2p(v, ax._m2, b2);\n };\n\n p2l = function(px) {\n var len = ax._rangebreaks.length;\n if(!len) return _p2l(px, ax._m, ax._b);\n\n var q = 0;\n for(var i = 0; i < len; i++) {\n if(px < ax._rangebreaks[i].pmin) break;\n if(px > ax._rangebreaks[i].pmax) q = i + 1;\n }\n return _p2l(px, ax._m2, ax._B[q]);\n };\n }\n\n // conversions among c/l/p are fairly simple - do them together for all axis types\n ax.c2l = (ax.type === 'log') ? toLog : ensureNumber;\n ax.l2c = (ax.type === 'log') ? fromLog : ensureNumber;\n\n ax.l2p = l2p;\n ax.p2l = p2l;\n\n ax.c2p = (ax.type === 'log') ? function(v, clip) { return l2p(toLog(v, clip)); } : l2p;\n ax.p2c = (ax.type === 'log') ? function(px) { return fromLog(p2l(px)); } : p2l;\n\n /*\n * now type-specific conversions for **ALL** other combinations\n * they're all written out, instead of being combinations of each other, for\n * both clarity and speed.\n */\n if(['linear', '-'].indexOf(ax.type) !== -1) {\n // all are data vals, but d and r need cleaning\n ax.d2r = ax.r2d = ax.d2c = ax.r2c = ax.d2l = ax.r2l = cleanNumber;\n ax.c2d = ax.c2r = ax.l2d = ax.l2r = ensureNumber;\n\n ax.d2p = ax.r2p = function(v) { return ax.l2p(cleanNumber(v)); };\n ax.p2d = ax.p2r = p2l;\n\n ax.cleanPos = ensureNumber;\n } else if(ax.type === 'log') {\n // d and c are data vals, r and l are logged (but d and r need cleaning)\n ax.d2r = ax.d2l = function(v, clip) { return toLog(cleanNumber(v), clip); };\n ax.r2d = ax.r2c = function(v) { return fromLog(cleanNumber(v)); };\n\n ax.d2c = ax.r2l = cleanNumber;\n ax.c2d = ax.l2r = ensureNumber;\n\n ax.c2r = toLog;\n ax.l2d = fromLog;\n\n ax.d2p = function(v, clip) { return ax.l2p(ax.d2r(v, clip)); };\n ax.p2d = function(px) { return fromLog(p2l(px)); };\n\n ax.r2p = function(v) { return ax.l2p(cleanNumber(v)); };\n ax.p2r = p2l;\n\n ax.cleanPos = ensureNumber;\n } else if(ax.type === 'date') {\n // r and d are date strings, l and c are ms\n\n /*\n * Any of these functions with r and d on either side, calendar is the\n * **3rd** argument. log has reserved the second argument.\n *\n * Unless you need the special behavior of the second arg (ms2DateTime\n * uses this to limit precision, toLog uses true to clip negatives\n * to offscreen low rather than undefined), it's safe to pass 0.\n */\n ax.d2r = ax.r2d = Lib.identity;\n\n ax.d2c = ax.r2c = ax.d2l = ax.r2l = dt2ms;\n ax.c2d = ax.c2r = ax.l2d = ax.l2r = ms2dt;\n\n ax.d2p = ax.r2p = function(v, _, calendar) { return ax.l2p(dt2ms(v, 0, calendar)); };\n ax.p2d = ax.p2r = function(px, r, calendar) { return ms2dt(p2l(px), r, calendar); };\n\n ax.cleanPos = function(v) { return Lib.cleanDate(v, BADNUM, ax.calendar); };\n } else if(ax.type === 'category') {\n // d is categories (string)\n // c and l are indices (numbers)\n // r is categories or numbers\n\n ax.d2c = ax.d2l = setCategoryIndex;\n ax.r2d = ax.c2d = ax.l2d = getCategoryName;\n\n ax.d2r = ax.d2l_noadd = getCategoryPosition;\n\n ax.r2c = function(v) {\n var index = getCategoryPosition(v);\n return index !== undefined ? index : ax.fraction2r(0.5);\n };\n\n ax.l2r = ax.c2r = ensureNumber;\n ax.r2l = getCategoryPosition;\n\n ax.d2p = function(v) { return ax.l2p(ax.r2c(v)); };\n ax.p2d = function(px) { return getCategoryName(p2l(px)); };\n ax.r2p = ax.d2p;\n ax.p2r = p2l;\n\n ax.cleanPos = function(v) {\n if(typeof v === 'string' && v !== '') return v;\n return ensureNumber(v);\n };\n } else if(ax.type === 'multicategory') {\n // N.B. multicategory axes don't define d2c and d2l,\n // as 'data-to-calcdata' conversion needs to take into\n // account all data array items as in ax.makeCalcdata.\n\n ax.r2d = ax.c2d = ax.l2d = getCategoryName;\n ax.d2r = ax.d2l_noadd = getCategoryPosition;\n\n ax.r2c = function(v) {\n var index = getCategoryPosition(v);\n return index !== undefined ? index : ax.fraction2r(0.5);\n };\n\n ax.r2c_just_indices = getCategoryIndex;\n\n ax.l2r = ax.c2r = ensureNumber;\n ax.r2l = getCategoryPosition;\n\n ax.d2p = function(v) { return ax.l2p(ax.r2c(v)); };\n ax.p2d = function(px) { return getCategoryName(p2l(px)); };\n ax.r2p = ax.d2p;\n ax.p2r = p2l;\n\n ax.cleanPos = function(v) {\n if(Array.isArray(v) || (typeof v === 'string' && v !== '')) return v;\n return ensureNumber(v);\n };\n\n ax.setupMultiCategory = function(fullData) {\n var traceIndices = ax._traceIndices;\n var i, j;\n\n var matchGroups = fullLayout._axisMatchGroups;\n if(matchGroups && matchGroups.length && ax._categories.length === 0) {\n for(i = 0; i < matchGroups.length; i++) {\n var group = matchGroups[i];\n if(group[axId]) {\n for(var axId2 in group) {\n if(axId2 !== axId) {\n var ax2 = fullLayout[axisIds.id2name(axId2)];\n traceIndices = traceIndices.concat(ax2._traceIndices);\n }\n }\n }\n }\n }\n\n // [ [cnt, {$cat: index}], for 1,2 ]\n var seen = [[0, {}], [0, {}]];\n // [ [arrayIn[0][i], arrayIn[1][i]], for i .. N ]\n var list = [];\n\n for(i = 0; i < traceIndices.length; i++) {\n var trace = fullData[traceIndices[i]];\n\n if(axLetter in trace) {\n var arrayIn = trace[axLetter];\n var len = trace._length || Lib.minRowLength(arrayIn);\n\n if(isArrayOrTypedArray(arrayIn[0]) && isArrayOrTypedArray(arrayIn[1])) {\n for(j = 0; j < len; j++) {\n var v0 = arrayIn[0][j];\n var v1 = arrayIn[1][j];\n\n if(isValidCategory(v0) && isValidCategory(v1)) {\n list.push([v0, v1]);\n\n if(!(v0 in seen[0][1])) {\n seen[0][1][v0] = seen[0][0]++;\n }\n if(!(v1 in seen[1][1])) {\n seen[1][1][v1] = seen[1][0]++;\n }\n }\n }\n }\n }\n }\n\n list.sort(function(a, b) {\n var ind0 = seen[0][1];\n var d = ind0[a[0]] - ind0[b[0]];\n if(d) return d;\n\n var ind1 = seen[1][1];\n return ind1[a[1]] - ind1[b[1]];\n });\n\n for(i = 0; i < list.length; i++) {\n setCategoryIndex(list[i]);\n }\n };\n }\n\n // find the range value at the specified (linear) fraction of the axis\n ax.fraction2r = function(v) {\n var rl0 = ax.r2l(ax.range[0]);\n var rl1 = ax.r2l(ax.range[1]);\n return ax.l2r(rl0 + v * (rl1 - rl0));\n };\n\n // find the fraction of the range at the specified range value\n ax.r2fraction = function(v) {\n var rl0 = ax.r2l(ax.range[0]);\n var rl1 = ax.r2l(ax.range[1]);\n return (ax.r2l(v) - rl0) / (rl1 - rl0);\n };\n\n /*\n * cleanRange: make sure range is a couplet of valid & distinct values\n * keep numbers away from the limits of floating point numbers,\n * and dates away from the ends of our date system (+/- 9999 years)\n *\n * optional param rangeAttr: operate on a different attribute, like\n * ax._r, rather than ax.range\n */\n ax.cleanRange = function(rangeAttr, opts) {\n if(!opts) opts = {};\n if(!rangeAttr) rangeAttr = 'range';\n\n var range = Lib.nestedProperty(ax, rangeAttr).get();\n var i, dflt;\n\n if(ax.type === 'date') dflt = Lib.dfltRange(ax.calendar);\n else if(axLetter === 'y') dflt = constants.DFLTRANGEY;\n else dflt = opts.dfltRange || constants.DFLTRANGEX;\n\n // make sure we don't later mutate the defaults\n dflt = dflt.slice();\n\n if(ax.rangemode === 'tozero' || ax.rangemode === 'nonnegative') {\n dflt[0] = 0;\n }\n\n if(!range || range.length !== 2) {\n Lib.nestedProperty(ax, rangeAttr).set(dflt);\n return;\n }\n\n if(ax.type === 'date' && !ax.autorange) {\n // check if milliseconds or js date objects are provided for range\n // and convert to date strings\n range[0] = Lib.cleanDate(range[0], BADNUM, ax.calendar);\n range[1] = Lib.cleanDate(range[1], BADNUM, ax.calendar);\n }\n\n for(i = 0; i < 2; i++) {\n if(ax.type === 'date') {\n if(!Lib.isDateTime(range[i], ax.calendar)) {\n ax[rangeAttr] = dflt;\n break;\n }\n\n if(ax.r2l(range[0]) === ax.r2l(range[1])) {\n // split by +/- 1 second\n var linCenter = Lib.constrain(ax.r2l(range[0]),\n Lib.MIN_MS + 1000, Lib.MAX_MS - 1000);\n range[0] = ax.l2r(linCenter - 1000);\n range[1] = ax.l2r(linCenter + 1000);\n break;\n }\n } else {\n if(!isNumeric(range[i])) {\n if(isNumeric(range[1 - i])) {\n range[i] = range[1 - i] * (i ? 10 : 0.1);\n } else {\n ax[rangeAttr] = dflt;\n break;\n }\n }\n\n if(range[i] < -FP_SAFE) range[i] = -FP_SAFE;\n else if(range[i] > FP_SAFE) range[i] = FP_SAFE;\n\n if(range[0] === range[1]) {\n // somewhat arbitrary: split by 1 or 1ppm, whichever is bigger\n var inc = Math.max(1, Math.abs(range[0] * 1e-6));\n range[0] -= inc;\n range[1] += inc;\n }\n }\n }\n };\n\n // set scaling to pixels\n ax.setScale = function(usePrivateRange) {\n var gs = fullLayout._size;\n\n // make sure we have a domain (pull it in from the axis\n // this one is overlaying if necessary)\n if(ax.overlaying) {\n var ax2 = axisIds.getFromId({ _fullLayout: fullLayout }, ax.overlaying);\n ax.domain = ax2.domain;\n }\n\n // While transitions are occurring, we get a double-transform\n // issue if we transform the drawn layer *and* use the new axis range to\n // draw the data. This allows us to construct setConvert using the pre-\n // interaction values of the range:\n var rangeAttr = (usePrivateRange && ax._r) ? '_r' : 'range';\n var calendar = ax.calendar;\n ax.cleanRange(rangeAttr);\n\n var rl0 = ax.r2l(ax[rangeAttr][0], calendar);\n var rl1 = ax.r2l(ax[rangeAttr][1], calendar);\n\n var isY = axLetter === 'y';\n if(isY) {\n ax._offset = gs.t + (1 - ax.domain[1]) * gs.h;\n ax._length = gs.h * (ax.domain[1] - ax.domain[0]);\n ax._m = ax._length / (rl0 - rl1);\n ax._b = -ax._m * rl1;\n } else {\n ax._offset = gs.l + ax.domain[0] * gs.w;\n ax._length = gs.w * (ax.domain[1] - ax.domain[0]);\n ax._m = ax._length / (rl1 - rl0);\n ax._b = -ax._m * rl0;\n }\n\n // set of \"N\" disjoint rangebreaks inside the range\n ax._rangebreaks = [];\n // length of these rangebreaks in value space - negative on reversed axes\n ax._lBreaks = 0;\n // l2p slope (same for all intervals)\n ax._m2 = 0;\n // set of l2p offsets (one for each of the (N+1) piecewise intervals)\n ax._B = [];\n\n if(ax.rangebreaks) {\n var i, brk;\n\n ax._rangebreaks = ax.locateBreaks(\n Math.min(rl0, rl1),\n Math.max(rl0, rl1)\n );\n\n if(ax._rangebreaks.length) {\n for(i = 0; i < ax._rangebreaks.length; i++) {\n brk = ax._rangebreaks[i];\n ax._lBreaks += Math.abs(brk.max - brk.min);\n }\n\n var flip = isY;\n if(rl0 > rl1) flip = !flip;\n if(flip) ax._rangebreaks.reverse();\n var sign = flip ? -1 : 1;\n\n ax._m2 = sign * ax._length / (Math.abs(rl1 - rl0) - ax._lBreaks);\n ax._B.push(-ax._m2 * (isY ? rl1 : rl0));\n for(i = 0; i < ax._rangebreaks.length; i++) {\n brk = ax._rangebreaks[i];\n ax._B.push(\n ax._B[ax._B.length - 1] -\n sign * ax._m2 * (brk.max - brk.min)\n );\n }\n\n // fill pixel (i.e. 'p') min/max here,\n // to not have to loop through the _rangebreaks twice during `p2l`\n for(i = 0; i < ax._rangebreaks.length; i++) {\n brk = ax._rangebreaks[i];\n brk.pmin = l2p(brk.min);\n brk.pmax = l2p(brk.max);\n }\n }\n }\n\n if(!isFinite(ax._m) || !isFinite(ax._b) || ax._length < 0) {\n fullLayout._replotting = false;\n throw new Error('Something went wrong with axis scaling');\n }\n };\n\n ax.maskBreaks = function(v) {\n var rangebreaksIn = ax.rangebreaks || [];\n var bnds, b0, b1, vb, vDate;\n\n for(var i = 0; i < rangebreaksIn.length; i++) {\n var brk = rangebreaksIn[i];\n\n if(brk.enabled) {\n if(brk.bounds) {\n var pattern = brk.pattern;\n bnds = Lib.simpleMap(brk.bounds, pattern ?\n cleanNumber :\n ax.d2c // case of pattern: ''\n );\n b0 = bnds[0];\n b1 = bnds[1];\n\n switch(pattern) {\n case WEEKDAY_PATTERN:\n vDate = new Date(v);\n vb = vDate.getUTCDay();\n\n if(b0 > b1) {\n b1 += 7;\n if(vb < b0) vb += 7;\n }\n\n break;\n case HOUR_PATTERN:\n vDate = new Date(v);\n var hours = vDate.getUTCHours();\n var minutes = vDate.getUTCMinutes();\n var seconds = vDate.getUTCSeconds();\n var milliseconds = vDate.getUTCMilliseconds();\n\n vb = hours + (\n minutes / 60 +\n seconds / 3600 +\n milliseconds / 3600000\n );\n\n if(b0 > b1) {\n b1 += 24;\n if(vb < b0) vb += 24;\n }\n\n break;\n case '':\n // N.B. should work on date axes as well!\n // e.g. { bounds: ['2020-01-04', '2020-01-05 23:59'] }\n // TODO should work with reversed-range axes\n vb = v;\n break;\n }\n\n if(vb >= b0 && vb < b1) return BADNUM;\n } else {\n var vals = Lib.simpleMap(brk.values, ax.d2c).sort(Lib.sorterAsc);\n for(var j = 0; j < vals.length; j++) {\n b0 = vals[j];\n b1 = b0 + brk.dvalue;\n if(v >= b0 && v < b1) return BADNUM;\n }\n }\n }\n }\n return v;\n };\n\n ax.locateBreaks = function(r0, r1) {\n var i, bnds, b0, b1;\n\n var rangebreaksOut = [];\n if(!ax.rangebreaks) return rangebreaksOut;\n\n var rangebreaksIn = ax.rangebreaks.slice().sort(function(a, b) {\n if(a.pattern === WEEKDAY_PATTERN && b.pattern === HOUR_PATTERN) return -1;\n if(b.pattern === WEEKDAY_PATTERN && a.pattern === HOUR_PATTERN) return 1;\n return 0;\n });\n\n var addBreak = function(min, max) {\n min = Lib.constrain(min, r0, r1);\n max = Lib.constrain(max, r0, r1);\n if(min === max) return;\n\n var isNewBreak = true;\n for(var j = 0; j < rangebreaksOut.length; j++) {\n var brkj = rangebreaksOut[j];\n if(min < brkj.max && max >= brkj.min) {\n if(min < brkj.min) {\n brkj.min = min;\n }\n if(max > brkj.max) {\n brkj.max = max;\n }\n isNewBreak = false;\n }\n }\n if(isNewBreak) {\n rangebreaksOut.push({min: min, max: max});\n }\n };\n\n for(i = 0; i < rangebreaksIn.length; i++) {\n var brk = rangebreaksIn[i];\n\n if(brk.enabled) {\n if(brk.bounds) {\n var t0 = r0;\n var t1 = r1;\n if(brk.pattern) {\n // to remove decimal (most often found in auto ranges)\n t0 = Math.floor(t0);\n }\n\n bnds = Lib.simpleMap(brk.bounds, brk.pattern ? cleanNumber : ax.r2l);\n b0 = bnds[0];\n b1 = bnds[1];\n\n // r0 value as date\n var t0Date = new Date(t0);\n // r0 value for break pattern\n var bndDelta;\n // step in ms between rangebreaks\n var step;\n\n switch(brk.pattern) {\n case WEEKDAY_PATTERN:\n step = 7 * ONEDAY;\n\n bndDelta = (\n (b1 < b0 ? 7 : 0) +\n (b1 - b0)\n ) * ONEDAY;\n\n t0 += b0 * ONEDAY - (\n t0Date.getUTCDay() * ONEDAY +\n t0Date.getUTCHours() * ONEHOUR +\n t0Date.getUTCMinutes() * ONEMIN +\n t0Date.getUTCSeconds() * ONESEC +\n t0Date.getUTCMilliseconds()\n );\n break;\n case HOUR_PATTERN:\n step = ONEDAY;\n\n bndDelta = (\n (b1 < b0 ? 24 : 0) +\n (b1 - b0)\n ) * ONEHOUR;\n\n t0 += b0 * ONEHOUR - (\n t0Date.getUTCHours() * ONEHOUR +\n t0Date.getUTCMinutes() * ONEMIN +\n t0Date.getUTCSeconds() * ONESEC +\n t0Date.getUTCMilliseconds()\n );\n break;\n default:\n t0 = Math.min(bnds[0], bnds[1]);\n t1 = Math.max(bnds[0], bnds[1]);\n step = t1 - t0;\n bndDelta = step;\n }\n\n for(var t = t0; t < t1; t += step) {\n addBreak(t, t + bndDelta);\n }\n } else {\n var vals = Lib.simpleMap(brk.values, ax.d2c);\n for(var j = 0; j < vals.length; j++) {\n b0 = vals[j];\n b1 = b0 + brk.dvalue;\n addBreak(b0, b1);\n }\n }\n }\n }\n\n rangebreaksOut.sort(function(a, b) { return a.min - b.min; });\n\n return rangebreaksOut;\n };\n\n // makeCalcdata: takes an x or y array and converts it\n // to a position on the axis object \"ax\"\n // inputs:\n // trace - a data object from gd.data\n // axLetter - a string, either 'x' or 'y', for which item\n // to convert (TODO: is this now always the same as\n // the first letter of ax._id?)\n // in case the expected data isn't there, make a list of\n // integers based on the opposite data\n ax.makeCalcdata = function(trace, axLetter, opts) {\n var arrayIn, arrayOut, i, len;\n\n var axType = ax.type;\n var cal = axType === 'date' && trace[axLetter + 'calendar'];\n\n if(axLetter in trace) {\n arrayIn = trace[axLetter];\n len = trace._length || Lib.minRowLength(arrayIn);\n\n if(Lib.isTypedArray(arrayIn) && (axType === 'linear' || axType === 'log')) {\n if(len === arrayIn.length) {\n return arrayIn;\n } else if(arrayIn.subarray) {\n return arrayIn.subarray(0, len);\n }\n }\n\n if(axType === 'multicategory') {\n return setMultiCategoryIndex(arrayIn, len);\n }\n\n arrayOut = new Array(len);\n for(i = 0; i < len; i++) {\n arrayOut[i] = ax.d2c(arrayIn[i], 0, cal, opts);\n }\n } else {\n var v0 = ((axLetter + '0') in trace) ? ax.d2c(trace[axLetter + '0'], 0, cal) : 0;\n var dv = (trace['d' + axLetter]) ? Number(trace['d' + axLetter]) : 1;\n\n // the opposing data, for size if we have x and dx etc\n arrayIn = trace[{x: 'y', y: 'x'}[axLetter]];\n len = trace._length || arrayIn.length;\n arrayOut = new Array(len);\n\n for(i = 0; i < len; i++) {\n arrayOut[i] = v0 + i * dv;\n }\n }\n\n // mask (i.e. set to BADNUM) coords that fall inside rangebreaks\n if(ax.rangebreaks) {\n for(i = 0; i < len; i++) {\n arrayOut[i] = ax.maskBreaks(arrayOut[i]);\n }\n }\n\n return arrayOut;\n };\n\n ax.isValidRange = function(range) {\n return (\n Array.isArray(range) &&\n range.length === 2 &&\n isNumeric(ax.r2l(range[0])) &&\n isNumeric(ax.r2l(range[1]))\n );\n };\n\n ax.isPtWithinRange = function(d, calendar) {\n var coord = ax.c2l(d[axLetter], null, calendar);\n var r0 = ax.r2l(ax.range[0]);\n var r1 = ax.r2l(ax.range[1]);\n\n if(r0 < r1) {\n return r0 <= coord && coord <= r1;\n } else {\n // Reversed axis case.\n return r1 <= coord && coord <= r0;\n }\n };\n\n ax._emptyCategories = function() {\n ax._categories = [];\n ax._categoriesMap = {};\n };\n\n // should skip if not category nor multicategory\n ax.clearCalc = function() {\n var matchGroups = fullLayout._axisMatchGroups;\n\n if(matchGroups && matchGroups.length) {\n var found = false;\n\n for(var i = 0; i < matchGroups.length; i++) {\n var group = matchGroups[i];\n\n if(group[axId]) {\n found = true;\n var categories = null;\n var categoriesMap = null;\n\n for(var axId2 in group) {\n var ax2 = fullLayout[axisIds.id2name(axId2)];\n if(ax2._categories) {\n categories = ax2._categories;\n categoriesMap = ax2._categoriesMap;\n break;\n }\n }\n\n if(categories && categoriesMap) {\n ax._categories = categories;\n ax._categoriesMap = categoriesMap;\n } else {\n ax._emptyCategories();\n }\n break;\n }\n }\n if(!found) ax._emptyCategories();\n } else {\n ax._emptyCategories();\n }\n\n if(ax._initialCategories) {\n for(var j = 0; j < ax._initialCategories.length; j++) {\n setCategoryIndex(ax._initialCategories[j]);\n }\n }\n };\n\n // sort the axis (and all the matching ones) by _initialCategories\n // returns the indices of the traces affected by the reordering\n ax.sortByInitialCategories = function() {\n var affectedTraces = [];\n\n ax._emptyCategories();\n\n if(ax._initialCategories) {\n for(var j = 0; j < ax._initialCategories.length; j++) {\n setCategoryIndex(ax._initialCategories[j]);\n }\n }\n\n affectedTraces = affectedTraces.concat(ax._traceIndices);\n\n // Propagate to matching axes\n var group = ax._matchGroup;\n for(var axId2 in group) {\n if(axId === axId2) continue;\n var ax2 = fullLayout[axisIds.id2name(axId2)];\n ax2._categories = ax._categories;\n ax2._categoriesMap = ax._categoriesMap;\n affectedTraces = affectedTraces.concat(ax2._traceIndices);\n }\n return affectedTraces;\n };\n\n // Propagate localization into the axis so that\n // methods in Axes can use it w/o having to pass fullLayout\n // Default (non-d3) number formatting uses separators directly\n // dates and d3-formatted numbers use the d3 locale\n // Fall back on default format for dummy axes that don't care about formatting\n var locale = fullLayout._d3locale;\n if(ax.type === 'date') {\n ax._dateFormat = locale ? locale.timeFormat.utc : d3.time.format.utc;\n ax._extraFormat = fullLayout._extraFormat;\n }\n // occasionally we need _numFormat to pass through\n // even though it won't be needed by this axis\n ax._separators = fullLayout.separators;\n ax._numFormat = locale ? locale.numberFormat : d3.format;\n\n // and for bar charts and box plots: reset forced minimum tick spacing\n delete ax._minDtick;\n delete ax._forceTick0;\n};\n\n},{\"../../constants/numerical\":704,\"../../lib\":728,\"./axis_ids\":779,\"./constants\":782,\"d3\":164,\"fast-isnumeric\":236}],797:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar layoutAttributes = _dereq_('./layout_attributes');\nvar handleArrayContainerDefaults = _dereq_('../array_container_defaults');\n\nmodule.exports = function handleTickLabelDefaults(containerIn, containerOut, coerce, axType, options, config) {\n if(!config || config.pass === 1) {\n handlePrefixSuffix(containerIn, containerOut, coerce, axType, options);\n }\n\n if(!config || config.pass === 2) {\n handleOtherDefaults(containerIn, containerOut, coerce, axType, options);\n }\n};\n\nfunction handlePrefixSuffix(containerIn, containerOut, coerce, axType, options) {\n var showAttrDflt = getShowAttrDflt(containerIn);\n\n var tickPrefix = coerce('tickprefix');\n if(tickPrefix) coerce('showtickprefix', showAttrDflt);\n\n var tickSuffix = coerce('ticksuffix', options.tickSuffixDflt);\n if(tickSuffix) coerce('showticksuffix', showAttrDflt);\n}\n\nfunction handleOtherDefaults(containerIn, containerOut, coerce, axType, options) {\n var showAttrDflt = getShowAttrDflt(containerIn);\n\n var tickPrefix = coerce('tickprefix');\n if(tickPrefix) coerce('showtickprefix', showAttrDflt);\n\n var tickSuffix = coerce('ticksuffix', options.tickSuffixDflt);\n if(tickSuffix) coerce('showticksuffix', showAttrDflt);\n\n var showTickLabels = coerce('showticklabels');\n if(showTickLabels) {\n var font = options.font || {};\n var contColor = containerOut.color;\n // as with titlefont.color, inherit axis.color only if one was\n // explicitly provided\n var dfltFontColor = (contColor && contColor !== layoutAttributes.color.dflt) ?\n contColor : font.color;\n Lib.coerceFont(coerce, 'tickfont', {\n family: font.family,\n size: font.size,\n color: dfltFontColor\n });\n coerce('tickangle');\n\n if(axType !== 'category') {\n var tickFormat = coerce('tickformat');\n\n handleArrayContainerDefaults(containerIn, containerOut, {\n name: 'tickformatstops',\n inclusionAttr: 'enabled',\n handleItemDefaults: tickformatstopDefaults\n });\n if(!containerOut.tickformatstops.length) {\n delete containerOut.tickformatstops;\n }\n\n if(!tickFormat && axType !== 'date') {\n coerce('showexponent', showAttrDflt);\n coerce('exponentformat');\n coerce('separatethousands');\n }\n }\n }\n}\n\n/*\n * Attributes 'showexponent', 'showtickprefix' and 'showticksuffix'\n * share values.\n *\n * If only 1 attribute is set,\n * the remaining attributes inherit that value.\n *\n * If 2 attributes are set to the same value,\n * the remaining attribute inherits that value.\n *\n * If 2 attributes are set to different values,\n * the remaining is set to its dflt value.\n *\n */\nfunction getShowAttrDflt(containerIn) {\n var showAttrsAll = ['showexponent', 'showtickprefix', 'showticksuffix'];\n var showAttrs = showAttrsAll.filter(function(a) {\n return containerIn[a] !== undefined;\n });\n var sameVal = function(a) {\n return containerIn[a] === containerIn[showAttrs[0]];\n };\n\n if(showAttrs.every(sameVal) || showAttrs.length === 1) {\n return containerIn[showAttrs[0]];\n }\n}\n\nfunction tickformatstopDefaults(valueIn, valueOut) {\n function coerce(attr, dflt) {\n return Lib.coerce(valueIn, valueOut, layoutAttributes.tickformatstops, attr, dflt);\n }\n\n var enabled = coerce('enabled');\n if(enabled) {\n coerce('dtickrange');\n coerce('value');\n }\n}\n\n},{\"../../lib\":728,\"../array_container_defaults\":772,\"./layout_attributes\":790}],798:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nvar layoutAttributes = _dereq_('./layout_attributes');\n\n\n/**\n * options: inherits outerTicks from axes.handleAxisDefaults\n */\nmodule.exports = function handleTickDefaults(containerIn, containerOut, coerce, options) {\n var tickLen = Lib.coerce2(containerIn, containerOut, layoutAttributes, 'ticklen');\n var tickWidth = Lib.coerce2(containerIn, containerOut, layoutAttributes, 'tickwidth');\n var tickColor = Lib.coerce2(containerIn, containerOut, layoutAttributes, 'tickcolor', containerOut.color);\n var showTicks = coerce('ticks', (options.outerTicks || tickLen || tickWidth || tickColor) ? 'outside' : '');\n\n if(!showTicks) {\n delete containerOut.ticklen;\n delete containerOut.tickwidth;\n delete containerOut.tickcolor;\n }\n};\n\n},{\"../../lib\":728,\"./layout_attributes\":790}],799:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar cleanTicks = _dereq_('./clean_ticks');\nvar isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray;\n\nmodule.exports = function handleTickValueDefaults(containerIn, containerOut, coerce, axType) {\n function readInput(attr) {\n var v = containerIn[attr];\n return (\n v !== undefined\n ) ? v : (containerOut._template || {})[attr];\n }\n\n var _tick0 = readInput('tick0');\n var _dtick = readInput('dtick');\n var _tickvals = readInput('tickvals');\n\n var tickmodeDefault = isArrayOrTypedArray(_tickvals) ? 'array' :\n _dtick ? 'linear' :\n 'auto';\n var tickmode = coerce('tickmode', tickmodeDefault);\n\n if(tickmode === 'auto') coerce('nticks');\n else if(tickmode === 'linear') {\n // dtick is usually a positive number, but there are some\n // special strings available for log or date axes\n // tick0 also has special logic\n var dtick = containerOut.dtick = cleanTicks.dtick(\n _dtick, axType);\n containerOut.tick0 = cleanTicks.tick0(\n _tick0, axType, containerOut.calendar, dtick);\n } else if(axType !== 'multicategory') {\n var tickvals = coerce('tickvals');\n if(tickvals === undefined) containerOut.tickmode = 'auto';\n else coerce('ticktext');\n }\n};\n\n},{\"../../lib\":728,\"./clean_ticks\":781}],800:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\nvar Drawing = _dereq_('../../components/drawing');\nvar Axes = _dereq_('./axes');\n\n/**\n * transitionAxes\n *\n * transition axes from one set of ranges to another, using a svg\n * transformations, similar to during panning.\n *\n * @param {DOM element | object} gd\n * @param {array} edits : array of 'edits', each item with\n * - plotinfo {object} subplot object\n * - xr0 {array} initial x-range\n * - xr1 {array} end x-range\n * - yr0 {array} initial y-range\n * - yr1 {array} end y-range\n * @param {object} transitionOpts\n * @param {function} makeOnCompleteCallback\n */\nmodule.exports = function transitionAxes(gd, edits, transitionOpts, makeOnCompleteCallback) {\n var fullLayout = gd._fullLayout;\n\n // special case for redraw:false Plotly.animate that relies on this\n // to update axis-referenced layout components\n if(edits.length === 0) {\n Axes.redrawComponents(gd);\n return;\n }\n\n function unsetSubplotTransform(subplot) {\n var xa = subplot.xaxis;\n var ya = subplot.yaxis;\n\n fullLayout._defs.select('#' + subplot.clipId + '> rect')\n .call(Drawing.setTranslate, 0, 0)\n .call(Drawing.setScale, 1, 1);\n\n subplot.plot\n .call(Drawing.setTranslate, xa._offset, ya._offset)\n .call(Drawing.setScale, 1, 1);\n\n var traceGroups = subplot.plot.selectAll('.scatterlayer .trace');\n\n // This is specifically directed at scatter traces, applying an inverse\n // scale to individual points to counteract the scale of the trace\n // as a whole:\n traceGroups.selectAll('.point')\n .call(Drawing.setPointGroupScale, 1, 1);\n traceGroups.selectAll('.textpoint')\n .call(Drawing.setTextPointsScale, 1, 1);\n traceGroups\n .call(Drawing.hideOutsideRangePoints, subplot);\n }\n\n function updateSubplot(edit, progress) {\n var plotinfo = edit.plotinfo;\n var xa = plotinfo.xaxis;\n var ya = plotinfo.yaxis;\n var xlen = xa._length;\n var ylen = ya._length;\n var editX = !!edit.xr1;\n var editY = !!edit.yr1;\n var viewBox = [];\n\n if(editX) {\n var xr0 = Lib.simpleMap(edit.xr0, xa.r2l);\n var xr1 = Lib.simpleMap(edit.xr1, xa.r2l);\n var dx0 = xr0[1] - xr0[0];\n var dx1 = xr1[1] - xr1[0];\n viewBox[0] = (xr0[0] * (1 - progress) + progress * xr1[0] - xr0[0]) / (xr0[1] - xr0[0]) * xlen;\n viewBox[2] = xlen * ((1 - progress) + progress * dx1 / dx0);\n xa.range[0] = xa.l2r(xr0[0] * (1 - progress) + progress * xr1[0]);\n xa.range[1] = xa.l2r(xr0[1] * (1 - progress) + progress * xr1[1]);\n } else {\n viewBox[0] = 0;\n viewBox[2] = xlen;\n }\n\n if(editY) {\n var yr0 = Lib.simpleMap(edit.yr0, ya.r2l);\n var yr1 = Lib.simpleMap(edit.yr1, ya.r2l);\n var dy0 = yr0[1] - yr0[0];\n var dy1 = yr1[1] - yr1[0];\n viewBox[1] = (yr0[1] * (1 - progress) + progress * yr1[1] - yr0[1]) / (yr0[0] - yr0[1]) * ylen;\n viewBox[3] = ylen * ((1 - progress) + progress * dy1 / dy0);\n ya.range[0] = xa.l2r(yr0[0] * (1 - progress) + progress * yr1[0]);\n ya.range[1] = ya.l2r(yr0[1] * (1 - progress) + progress * yr1[1]);\n } else {\n viewBox[1] = 0;\n viewBox[3] = ylen;\n }\n\n Axes.drawOne(gd, xa, {skipTitle: true});\n Axes.drawOne(gd, ya, {skipTitle: true});\n Axes.redrawComponents(gd, [xa._id, ya._id]);\n\n var xScaleFactor = editX ? xlen / viewBox[2] : 1;\n var yScaleFactor = editY ? ylen / viewBox[3] : 1;\n var clipDx = editX ? viewBox[0] : 0;\n var clipDy = editY ? viewBox[1] : 0;\n var fracDx = editX ? (viewBox[0] / viewBox[2] * xlen) : 0;\n var fracDy = editY ? (viewBox[1] / viewBox[3] * ylen) : 0;\n var plotDx = xa._offset - fracDx;\n var plotDy = ya._offset - fracDy;\n\n plotinfo.clipRect\n .call(Drawing.setTranslate, clipDx, clipDy)\n .call(Drawing.setScale, 1 / xScaleFactor, 1 / yScaleFactor);\n\n plotinfo.plot\n .call(Drawing.setTranslate, plotDx, plotDy)\n .call(Drawing.setScale, xScaleFactor, yScaleFactor);\n\n // apply an inverse scale to individual points to counteract\n // the scale of the trace group.\n Drawing.setPointGroupScale(plotinfo.zoomScalePts, 1 / xScaleFactor, 1 / yScaleFactor);\n Drawing.setTextPointsScale(plotinfo.zoomScaleTxt, 1 / xScaleFactor, 1 / yScaleFactor);\n }\n\n var onComplete;\n if(makeOnCompleteCallback) {\n // This module makes the choice whether or not it notifies Plotly.transition\n // about completion:\n onComplete = makeOnCompleteCallback();\n }\n\n function transitionComplete() {\n var aobj = {};\n\n for(var i = 0; i < edits.length; i++) {\n var edit = edits[i];\n var xa = edit.plotinfo.xaxis;\n var ya = edit.plotinfo.yaxis;\n if(edit.xr1) aobj[xa._name + '.range'] = edit.xr1.slice();\n if(edit.yr1) aobj[ya._name + '.range'] = edit.yr1.slice();\n }\n\n // Signal that this transition has completed:\n onComplete && onComplete();\n\n return Registry.call('relayout', gd, aobj).then(function() {\n for(var i = 0; i < edits.length; i++) {\n unsetSubplotTransform(edits[i].plotinfo);\n }\n });\n }\n\n function transitionInterrupt() {\n var aobj = {};\n\n for(var i = 0; i < edits.length; i++) {\n var edit = edits[i];\n var xa = edit.plotinfo.xaxis;\n var ya = edit.plotinfo.yaxis;\n if(edit.xr0) aobj[xa._name + '.range'] = edit.xr0.slice();\n if(edit.yr0) aobj[ya._name + '.range'] = edit.yr0.slice();\n }\n\n return Registry.call('relayout', gd, aobj).then(function() {\n for(var i = 0; i < edits.length; i++) {\n unsetSubplotTransform(edits[i].plotinfo);\n }\n });\n }\n\n var t1, t2, raf;\n var easeFn = d3.ease(transitionOpts.easing);\n\n gd._transitionData._interruptCallbacks.push(function() {\n window.cancelAnimationFrame(raf);\n raf = null;\n return transitionInterrupt();\n });\n\n function doFrame() {\n t2 = Date.now();\n\n var tInterp = Math.min(1, (t2 - t1) / transitionOpts.duration);\n var progress = easeFn(tInterp);\n\n for(var i = 0; i < edits.length; i++) {\n updateSubplot(edits[i], progress);\n }\n\n if(t2 - t1 > transitionOpts.duration) {\n transitionComplete();\n raf = window.cancelAnimationFrame(doFrame);\n } else {\n raf = window.requestAnimationFrame(doFrame);\n }\n }\n\n t1 = Date.now();\n raf = window.requestAnimationFrame(doFrame);\n\n return Promise.resolve();\n};\n\n},{\"../../components/drawing\":617,\"../../lib\":728,\"../../registry\":859,\"./axes\":776,\"d3\":164}],801:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar traceIs = _dereq_('../../registry').traceIs;\nvar autoType = _dereq_('./axis_autotype');\n\n/*\n * data: the plot data to use in choosing auto type\n * name: axis object name (ie 'xaxis') if one should be stored\n */\nmodule.exports = function handleTypeDefaults(containerIn, containerOut, coerce, options) {\n var axType = coerce('type', (options.splomStash || {}).type);\n\n if(axType === '-') {\n setAutoType(containerOut, options.data);\n\n if(containerOut.type === '-') {\n containerOut.type = 'linear';\n } else {\n // copy autoType back to input axis\n // note that if this object didn't exist\n // in the input layout, we have to put it in\n // this happens in the main supplyDefaults function\n containerIn.type = containerOut.type;\n }\n }\n};\n\nfunction setAutoType(ax, data) {\n // new logic: let people specify any type they want,\n // only autotype if type is '-'\n if(ax.type !== '-') return;\n\n var id = ax._id;\n var axLetter = id.charAt(0);\n var i;\n\n // support 3d\n if(id.indexOf('scene') !== -1) id = axLetter;\n\n var d0 = getFirstNonEmptyTrace(data, id, axLetter);\n if(!d0) return;\n\n // first check for histograms, as the count direction\n // should always default to a linear axis\n if(d0.type === 'histogram' &&\n axLetter === {v: 'y', h: 'x'}[d0.orientation || 'v']\n ) {\n ax.type = 'linear';\n return;\n }\n\n var calAttr = axLetter + 'calendar';\n var calendar = d0[calAttr];\n var opts = {noMultiCategory: !traceIs(d0, 'cartesian') || traceIs(d0, 'noMultiCategory')};\n\n // To not confuse 2D x/y used for per-box sample points for multicategory coordinates\n if(d0.type === 'box' && d0._hasPreCompStats &&\n axLetter === {h: 'x', v: 'y'}[d0.orientation || 'v']\n ) {\n opts.noMultiCategory = true;\n }\n\n // check all boxes on this x axis to see\n // if they're dates, numbers, or categories\n if(isBoxWithoutPositionCoords(d0, axLetter)) {\n var posLetter = getBoxPosLetter(d0);\n var boxPositions = [];\n\n for(i = 0; i < data.length; i++) {\n var trace = data[i];\n if(!traceIs(trace, 'box-violin') || (trace[axLetter + 'axis'] || axLetter) !== id) continue;\n\n if(trace[posLetter] !== undefined) boxPositions.push(trace[posLetter][0]);\n else if(trace.name !== undefined) boxPositions.push(trace.name);\n else boxPositions.push('text');\n\n if(trace[calAttr] !== calendar) calendar = undefined;\n }\n\n ax.type = autoType(boxPositions, calendar, opts);\n } else if(d0.type === 'splom') {\n var dimensions = d0.dimensions;\n var dim = dimensions[d0._axesDim[id]];\n if(dim.visible) ax.type = autoType(dim.values, calendar, opts);\n } else {\n ax.type = autoType(d0[axLetter] || [d0[axLetter + '0']], calendar, opts);\n }\n}\n\nfunction getFirstNonEmptyTrace(data, id, axLetter) {\n for(var i = 0; i < data.length; i++) {\n var trace = data[i];\n\n if(trace.type === 'splom' &&\n trace._length > 0 &&\n (trace['_' + axLetter + 'axes'] || {})[id]\n ) {\n return trace;\n }\n\n if((trace[axLetter + 'axis'] || axLetter) === id) {\n if(isBoxWithoutPositionCoords(trace, axLetter)) {\n return trace;\n } else if((trace[axLetter] || []).length || trace[axLetter + '0']) {\n return trace;\n }\n }\n }\n}\n\nfunction getBoxPosLetter(trace) {\n return {v: 'x', h: 'y'}[trace.orientation || 'v'];\n}\n\nfunction isBoxWithoutPositionCoords(trace, axLetter) {\n var posLetter = getBoxPosLetter(trace);\n var isBox = traceIs(trace, 'box-violin');\n var isCandlestick = traceIs(trace._fullInput || {}, 'candlestick');\n\n return (\n isBox &&\n !isCandlestick &&\n axLetter === posLetter &&\n trace[posLetter] === undefined &&\n trace[posLetter + '0'] === undefined\n );\n}\n\n},{\"../../registry\":859,\"./axis_autotype\":777}],802:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../registry');\nvar Lib = _dereq_('../lib');\n\n/*\n * Create or update an observer. This function is designed to be\n * idempotent so that it can be called over and over as the component\n * updates, and will attach and detach listeners as needed.\n *\n * @param {optional object} container\n * An object on which the observer is stored. This is the mechanism\n * by which it is idempotent. If it already exists, another won't be\n * added. Each time it's called, the value lookup table is updated.\n * @param {array} commandList\n * An array of commands, following either `buttons` of `updatemenus`\n * or `steps` of `sliders`.\n * @param {function} onchange\n * A listener called when the value is changed. Receives data object\n * with information about the new state.\n */\nexports.manageCommandObserver = function(gd, container, commandList, onchange) {\n var ret = {};\n var enabled = true;\n\n if(container && container._commandObserver) {\n ret = container._commandObserver;\n }\n\n if(!ret.cache) {\n ret.cache = {};\n }\n\n // Either create or just recompute this:\n ret.lookupTable = {};\n\n var binding = exports.hasSimpleAPICommandBindings(gd, commandList, ret.lookupTable);\n\n if(container && container._commandObserver) {\n if(!binding) {\n // If container exists and there are no longer any bindings,\n // remove existing:\n if(container._commandObserver.remove) {\n container._commandObserver.remove();\n container._commandObserver = null;\n return ret;\n }\n } else {\n // If container exists and there *are* bindings, then the lookup\n // table should have been updated and check is already attached,\n // so there's nothing to be done:\n return ret;\n }\n }\n\n // Determine whether there's anything to do for this binding:\n\n if(binding) {\n // Build the cache:\n bindingValueHasChanged(gd, binding, ret.cache);\n\n ret.check = function check() {\n if(!enabled) return;\n\n var update = bindingValueHasChanged(gd, binding, ret.cache);\n\n if(update.changed && onchange) {\n // Disable checks for the duration of this command in order to avoid\n // infinite loops:\n if(ret.lookupTable[update.value] !== undefined) {\n ret.disable();\n Promise.resolve(onchange({\n value: update.value,\n type: binding.type,\n prop: binding.prop,\n traces: binding.traces,\n index: ret.lookupTable[update.value]\n })).then(ret.enable, ret.enable);\n }\n }\n\n return update.changed;\n };\n\n var checkEvents = [\n 'plotly_relayout',\n 'plotly_redraw',\n 'plotly_restyle',\n 'plotly_update',\n 'plotly_animatingframe',\n 'plotly_afterplot'\n ];\n\n for(var i = 0; i < checkEvents.length; i++) {\n gd._internalOn(checkEvents[i], ret.check);\n }\n\n ret.remove = function() {\n for(var i = 0; i < checkEvents.length; i++) {\n gd._removeInternalListener(checkEvents[i], ret.check);\n }\n };\n } else {\n // TODO: It'd be really neat to actually give a *reason* for this, but at least a warning\n // is a start\n Lib.log('Unable to automatically bind plot updates to API command');\n\n ret.lookupTable = {};\n ret.remove = function() {};\n }\n\n ret.disable = function disable() {\n enabled = false;\n };\n\n ret.enable = function enable() {\n enabled = true;\n };\n\n if(container) {\n container._commandObserver = ret;\n }\n\n return ret;\n};\n\n/*\n * This function checks to see if an array of objects containing\n * method and args properties is compatible with automatic two-way\n * binding. The criteria right now are that\n *\n * 1. multiple traces may be affected\n * 2. only one property may be affected\n * 3. the same property must be affected by all commands\n */\nexports.hasSimpleAPICommandBindings = function(gd, commandList, bindingsByValue) {\n var i;\n var n = commandList.length;\n\n var refBinding;\n\n for(i = 0; i < n; i++) {\n var binding;\n var command = commandList[i];\n var method = command.method;\n var args = command.args;\n\n if(!Array.isArray(args)) args = [];\n\n // If any command has no method, refuse to bind:\n if(!method) {\n return false;\n }\n var bindings = exports.computeAPICommandBindings(gd, method, args);\n\n // Right now, handle one and *only* one property being set:\n if(bindings.length !== 1) {\n return false;\n }\n\n if(!refBinding) {\n refBinding = bindings[0];\n if(Array.isArray(refBinding.traces)) {\n refBinding.traces.sort();\n }\n } else {\n binding = bindings[0];\n if(binding.type !== refBinding.type) {\n return false;\n }\n if(binding.prop !== refBinding.prop) {\n return false;\n }\n if(Array.isArray(refBinding.traces)) {\n if(Array.isArray(binding.traces)) {\n binding.traces.sort();\n for(var j = 0; j < refBinding.traces.length; j++) {\n if(refBinding.traces[j] !== binding.traces[j]) {\n return false;\n }\n }\n } else {\n return false;\n }\n } else {\n if(binding.prop !== refBinding.prop) {\n return false;\n }\n }\n }\n\n binding = bindings[0];\n var value = binding.value;\n if(Array.isArray(value)) {\n if(value.length === 1) {\n value = value[0];\n } else {\n return false;\n }\n }\n if(bindingsByValue) {\n bindingsByValue[value] = i;\n }\n }\n\n return refBinding;\n};\n\nfunction bindingValueHasChanged(gd, binding, cache) {\n var container, value, obj;\n var changed = false;\n\n if(binding.type === 'data') {\n // If it's data, we need to get a trace. Based on the limited scope\n // of what we cover, we can just take the first trace from the list,\n // or otherwise just the first trace:\n container = gd._fullData[binding.traces !== null ? binding.traces[0] : 0];\n } else if(binding.type === 'layout') {\n container = gd._fullLayout;\n } else {\n return false;\n }\n\n value = Lib.nestedProperty(container, binding.prop).get();\n\n obj = cache[binding.type] = cache[binding.type] || {};\n\n if(obj.hasOwnProperty(binding.prop)) {\n if(obj[binding.prop] !== value) {\n changed = true;\n }\n }\n\n obj[binding.prop] = value;\n\n return {\n changed: changed,\n value: value\n };\n}\n\n/*\n * Execute an API command. There's really not much to this; it just provides\n * a common hook so that implementations don't need to be synchronized across\n * multiple components with the ability to invoke API commands.\n *\n * @param {string} method\n * The name of the plotly command to execute. Must be one of 'animate',\n * 'restyle', 'relayout', 'update'.\n * @param {array} args\n * A list of arguments passed to the API command\n */\nexports.executeAPICommand = function(gd, method, args) {\n if(method === 'skip') return Promise.resolve();\n\n var _method = Registry.apiMethodRegistry[method];\n var allArgs = [gd];\n if(!Array.isArray(args)) args = [];\n\n for(var i = 0; i < args.length; i++) {\n allArgs.push(args[i]);\n }\n\n return _method.apply(null, allArgs).catch(function(err) {\n Lib.warn('API call to Plotly.' + method + ' rejected.', err);\n return Promise.reject(err);\n });\n};\n\nexports.computeAPICommandBindings = function(gd, method, args) {\n var bindings;\n\n if(!Array.isArray(args)) args = [];\n\n switch(method) {\n case 'restyle':\n bindings = computeDataBindings(gd, args);\n break;\n case 'relayout':\n bindings = computeLayoutBindings(gd, args);\n break;\n case 'update':\n bindings = computeDataBindings(gd, [args[0], args[2]])\n .concat(computeLayoutBindings(gd, [args[1]]));\n break;\n case 'animate':\n bindings = computeAnimateBindings(gd, args);\n break;\n default:\n // This is the case where intelligent logic about what affects\n // this command is not implemented. It causes no ill effects.\n // For example, addFrames simply won't bind to a control component.\n bindings = [];\n }\n return bindings;\n};\n\nfunction computeAnimateBindings(gd, args) {\n // We'll assume that the only relevant modification an animation\n // makes that's meaningfully tracked is the frame:\n if(Array.isArray(args[0]) && args[0].length === 1 && ['string', 'number'].indexOf(typeof args[0][0]) !== -1) {\n return [{type: 'layout', prop: '_currentFrame', value: args[0][0].toString()}];\n } else {\n return [];\n }\n}\n\nfunction computeLayoutBindings(gd, args) {\n var bindings = [];\n\n var astr = args[0];\n var aobj = {};\n if(typeof astr === 'string') {\n aobj[astr] = args[1];\n } else if(Lib.isPlainObject(astr)) {\n aobj = astr;\n } else {\n return bindings;\n }\n\n crawl(aobj, function(path, attrName, attr) {\n bindings.push({type: 'layout', prop: path, value: attr});\n }, '', 0);\n\n return bindings;\n}\n\nfunction computeDataBindings(gd, args) {\n var traces, astr, val, aobj;\n var bindings = [];\n\n // Logic copied from Plotly.restyle:\n astr = args[0];\n val = args[1];\n traces = args[2];\n aobj = {};\n if(typeof astr === 'string') {\n aobj[astr] = val;\n } else if(Lib.isPlainObject(astr)) {\n // the 3-arg form\n aobj = astr;\n\n if(traces === undefined) {\n traces = val;\n }\n } else {\n return bindings;\n }\n\n if(traces === undefined) {\n // Explicitly assign this to null instead of undefined:\n traces = null;\n }\n\n crawl(aobj, function(path, attrName, _attr) {\n var thisTraces;\n var attr;\n\n if(Array.isArray(_attr)) {\n attr = _attr.slice();\n\n var nAttr = Math.min(attr.length, gd.data.length);\n if(traces) {\n nAttr = Math.min(nAttr, traces.length);\n }\n thisTraces = [];\n for(var j = 0; j < nAttr; j++) {\n thisTraces[j] = traces ? traces[j] : j;\n }\n } else {\n attr = _attr;\n thisTraces = traces ? traces.slice() : null;\n }\n\n // Convert [7] to just 7 when traces is null:\n if(thisTraces === null) {\n if(Array.isArray(attr)) {\n attr = attr[0];\n }\n } else if(Array.isArray(thisTraces)) {\n if(!Array.isArray(attr)) {\n var tmp = attr;\n attr = [];\n for(var i = 0; i < thisTraces.length; i++) {\n attr[i] = tmp;\n }\n }\n attr.length = Math.min(thisTraces.length, attr.length);\n }\n\n bindings.push({\n type: 'data',\n prop: path,\n traces: thisTraces,\n value: attr\n });\n }, '', 0);\n\n return bindings;\n}\n\nfunction crawl(attrs, callback, path, depth) {\n Object.keys(attrs).forEach(function(attrName) {\n var attr = attrs[attrName];\n\n if(attrName[0] === '_') return;\n\n var thisPath = path + (depth > 0 ? '.' : '') + attrName;\n\n if(Lib.isPlainObject(attr)) {\n crawl(attr, callback, thisPath, depth + 1);\n } else {\n // Only execute the callback on leaf nodes:\n callback(thisPath, attrName, attr);\n }\n });\n}\n\n},{\"../lib\":728,\"../registry\":859}],803:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar extendFlat = _dereq_('../lib/extend').extendFlat;\n\n/**\n * Make a xy domain attribute group\n *\n * @param {object} opts\n * @param {string}\n * opts.name: name to be inserted in the default description\n * @param {boolean}\n * opts.trace: set to true for trace containers\n * @param {string}\n * opts.editType: editType for all pieces\n * @param {boolean}\n * opts.noGridCell: set to true to omit `row` and `column`\n *\n * @param {object} extra\n * @param {string}\n * extra.description: extra description. N.B we use\n * a separate extra container to make it compatible with\n * the compress_attributes transform.\n *\n * @return {object} attributes object containing {x,y} as specified\n */\nexports.attributes = function(opts, extra) {\n opts = opts || {};\n extra = extra || {};\n\n var base = {\n valType: 'info_array',\n \n editType: opts.editType,\n items: [\n {valType: 'number', min: 0, max: 1, editType: opts.editType},\n {valType: 'number', min: 0, max: 1, editType: opts.editType}\n ],\n dflt: [0, 1]\n };\n\n var namePart = opts.name ? opts.name + ' ' : '';\n var contPart = opts.trace ? 'trace ' : 'subplot ';\n var descPart = extra.description ? ' ' + extra.description : '';\n\n var out = {\n x: extendFlat({}, base, {\n \n }),\n y: extendFlat({}, base, {\n \n }),\n editType: opts.editType\n };\n\n if(!opts.noGridCell) {\n out.row = {\n valType: 'integer',\n min: 0,\n dflt: 0,\n \n editType: opts.editType,\n \n };\n out.column = {\n valType: 'integer',\n min: 0,\n dflt: 0,\n \n editType: opts.editType,\n \n };\n }\n\n return out;\n};\n\nexports.defaults = function(containerOut, layout, coerce, dfltDomains) {\n var dfltX = (dfltDomains && dfltDomains.x) || [0, 1];\n var dfltY = (dfltDomains && dfltDomains.y) || [0, 1];\n\n var grid = layout.grid;\n if(grid) {\n var column = coerce('domain.column');\n if(column !== undefined) {\n if(column < grid.columns) dfltX = grid._domains.x[column];\n else delete containerOut.domain.column;\n }\n\n var row = coerce('domain.row');\n if(row !== undefined) {\n if(row < grid.rows) dfltY = grid._domains.y[row];\n else delete containerOut.domain.row;\n }\n }\n\n var x = coerce('domain.x', dfltX);\n var y = coerce('domain.y', dfltY);\n\n // don't accept bad input data\n if(!(x[0] < x[1])) containerOut.domain.x = dfltX.slice();\n if(!(y[0] < y[1])) containerOut.domain.y = dfltY.slice();\n};\n\n},{\"../lib/extend\":719}],804:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/*\n * make a font attribute group\n *\n * @param {object} opts\n * @param {string}\n * opts.description: where & how this font is used\n * @param {optional bool} arrayOk:\n * should each part (family, size, color) be arrayOk? default false.\n * @param {string} editType:\n * the editType for all pieces of this font\n * @param {optional string} colorEditType:\n * a separate editType just for color\n *\n * @return {object} attributes object containing {family, size, color} as specified\n */\nmodule.exports = function(opts) {\n var editType = opts.editType;\n var colorEditType = opts.colorEditType;\n if(colorEditType === undefined) colorEditType = editType;\n var attrs = {\n family: {\n valType: 'string',\n \n noBlank: true,\n strict: true,\n editType: editType,\n \n },\n size: {\n valType: 'number',\n \n min: 1,\n editType: editType\n },\n color: {\n valType: 'color',\n \n editType: colorEditType\n },\n editType: editType,\n // blank strings so compress_attributes can remove\n // TODO - that's uber hacky... better solution?\n \n };\n\n if(opts.arrayOk) {\n attrs.family.arrayOk = true;\n attrs.size.arrayOk = true;\n attrs.color.arrayOk = true;\n }\n\n return attrs;\n};\n\n},{}],805:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n _isLinkedToArray: 'frames_entry',\n\n group: {\n valType: 'string',\n \n \n },\n name: {\n valType: 'string',\n \n \n },\n traces: {\n valType: 'any',\n \n \n },\n baseframe: {\n valType: 'string',\n \n \n },\n data: {\n valType: 'any',\n \n \n },\n layout: {\n valType: 'any',\n \n \n }\n};\n\n},{}],806:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n// projection names to d3 function name\nexports.projNames = {\n // d3.geo.projection\n 'equirectangular': 'equirectangular',\n 'mercator': 'mercator',\n 'orthographic': 'orthographic',\n 'natural earth': 'naturalEarth',\n 'kavrayskiy7': 'kavrayskiy7',\n 'miller': 'miller',\n 'robinson': 'robinson',\n 'eckert4': 'eckert4',\n 'azimuthal equal area': 'azimuthalEqualArea',\n 'azimuthal equidistant': 'azimuthalEquidistant',\n 'conic equal area': 'conicEqualArea',\n 'conic conformal': 'conicConformal',\n 'conic equidistant': 'conicEquidistant',\n 'gnomonic': 'gnomonic',\n 'stereographic': 'stereographic',\n 'mollweide': 'mollweide',\n 'hammer': 'hammer',\n 'transverse mercator': 'transverseMercator',\n 'albers usa': 'albersUsa',\n 'winkel tripel': 'winkel3',\n 'aitoff': 'aitoff',\n 'sinusoidal': 'sinusoidal'\n};\n\n// name of the axes\nexports.axesNames = ['lonaxis', 'lataxis'];\n\n// max longitudinal angular span (EXPERIMENTAL)\nexports.lonaxisSpan = {\n 'orthographic': 180,\n 'azimuthal equal area': 360,\n 'azimuthal equidistant': 360,\n 'conic conformal': 180,\n 'gnomonic': 160,\n 'stereographic': 180,\n 'transverse mercator': 180,\n '*': 360\n};\n\n// max latitudinal angular span (EXPERIMENTAL)\nexports.lataxisSpan = {\n 'conic conformal': 150,\n 'stereographic': 179.5,\n '*': 180\n};\n\n// defaults for each scope\nexports.scopeDefaults = {\n world: {\n lonaxisRange: [-180, 180],\n lataxisRange: [-90, 90],\n projType: 'equirectangular',\n projRotate: [0, 0, 0]\n },\n usa: {\n lonaxisRange: [-180, -50],\n lataxisRange: [15, 80],\n projType: 'albers usa'\n },\n europe: {\n lonaxisRange: [-30, 60],\n lataxisRange: [30, 85],\n projType: 'conic conformal',\n projRotate: [15, 0, 0],\n projParallels: [0, 60]\n },\n asia: {\n lonaxisRange: [22, 160],\n lataxisRange: [-15, 55],\n projType: 'mercator',\n projRotate: [0, 0, 0]\n },\n africa: {\n lonaxisRange: [-30, 60],\n lataxisRange: [-40, 40],\n projType: 'mercator',\n projRotate: [0, 0, 0]\n },\n 'north america': {\n lonaxisRange: [-180, -45],\n lataxisRange: [5, 85],\n projType: 'conic conformal',\n projRotate: [-100, 0, 0],\n projParallels: [29.5, 45.5]\n },\n 'south america': {\n lonaxisRange: [-100, -30],\n lataxisRange: [-60, 15],\n projType: 'mercator',\n projRotate: [0, 0, 0]\n }\n};\n\n// angular pad to avoid rounding error around clip angles\nexports.clipPad = 1e-3;\n\n// map projection precision\nexports.precision = 0.1;\n\n// default land and water fill colors\nexports.landColor = '#F0DC82';\nexports.waterColor = '#3399FF';\n\n// locationmode to layer name\nexports.locationmodeToLayer = {\n 'ISO-3': 'countries',\n 'USA-states': 'subunits',\n 'country names': 'countries'\n};\n\n// SVG element for a sphere (use to frame maps)\nexports.sphereSVG = {type: 'Sphere'};\n\n// N.B. base layer names must be the same as in the topojson files\n\n// base layer with a fill color\nexports.fillLayers = {\n ocean: 1,\n land: 1,\n lakes: 1\n};\n\n// base layer with a only a line color\nexports.lineLayers = {\n subunits: 1,\n countries: 1,\n coastlines: 1,\n rivers: 1,\n frame: 1\n};\n\nexports.layers = [\n 'bg',\n 'ocean', 'land', 'lakes',\n 'subunits', 'countries', 'coastlines', 'rivers',\n 'lataxis', 'lonaxis', 'frame',\n 'backplot',\n 'frontplot'\n];\n\nexports.layersForChoropleth = [\n 'bg',\n 'ocean', 'land',\n 'subunits', 'countries', 'coastlines',\n 'lataxis', 'lonaxis', 'frame',\n 'backplot',\n 'rivers', 'lakes',\n 'frontplot'\n];\n\nexports.layerNameToAdjective = {\n ocean: 'ocean',\n land: 'land',\n lakes: 'lake',\n subunits: 'subunit',\n countries: 'country',\n coastlines: 'coastline',\n rivers: 'river',\n frame: 'frame'\n};\n\n},{}],807:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/* global PlotlyGeoAssets:false */\n\nvar d3 = _dereq_('d3');\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\nvar Color = _dereq_('../../components/color');\nvar Drawing = _dereq_('../../components/drawing');\nvar Fx = _dereq_('../../components/fx');\nvar Plots = _dereq_('../plots');\nvar Axes = _dereq_('../cartesian/axes');\nvar getAutoRange = _dereq_('../cartesian/autorange').getAutoRange;\nvar dragElement = _dereq_('../../components/dragelement');\nvar prepSelect = _dereq_('../cartesian/select').prepSelect;\nvar clearSelect = _dereq_('../cartesian/select').clearSelect;\nvar selectOnClick = _dereq_('../cartesian/select').selectOnClick;\n\nvar createGeoZoom = _dereq_('./zoom');\nvar constants = _dereq_('./constants');\n\nvar geoUtils = _dereq_('../../lib/geo_location_utils');\nvar topojsonUtils = _dereq_('../../lib/topojson_utils');\nvar topojsonFeature = _dereq_('topojson-client').feature;\n\n_dereq_('./projections')(d3);\n\nfunction Geo(opts) {\n this.id = opts.id;\n this.graphDiv = opts.graphDiv;\n this.container = opts.container;\n this.topojsonURL = opts.topojsonURL;\n this.isStatic = opts.staticPlot;\n\n this.topojsonName = null;\n this.topojson = null;\n\n this.projection = null;\n this.scope = null;\n this.viewInitial = null;\n this.fitScale = null;\n this.bounds = null;\n this.midPt = null;\n\n this.hasChoropleth = false;\n this.traceHash = {};\n\n this.layers = {};\n this.basePaths = {};\n this.dataPaths = {};\n this.dataPoints = {};\n\n this.clipDef = null;\n this.clipRect = null;\n this.bgRect = null;\n\n this.makeFramework();\n}\n\nvar proto = Geo.prototype;\n\nmodule.exports = function createGeo(opts) {\n return new Geo(opts);\n};\n\nproto.plot = function(geoCalcData, fullLayout, promises) {\n var _this = this;\n var geoLayout = fullLayout[this.id];\n var geoPromises = [];\n\n var needsTopojson = false;\n for(var k in constants.layerNameToAdjective) {\n if(k !== 'frame' && geoLayout['show' + k]) {\n needsTopojson = true;\n break;\n }\n }\n for(var i = 0; i < geoCalcData.length; i++) {\n if(geoCalcData[0][0].trace.locationmode) {\n needsTopojson = true;\n break;\n }\n }\n\n if(needsTopojson) {\n var topojsonNameNew = topojsonUtils.getTopojsonName(geoLayout);\n if(_this.topojson === null || topojsonNameNew !== _this.topojsonName) {\n _this.topojsonName = topojsonNameNew;\n\n if(PlotlyGeoAssets.topojson[_this.topojsonName] === undefined) {\n geoPromises.push(_this.fetchTopojson());\n }\n }\n }\n\n geoPromises = geoPromises.concat(geoUtils.fetchTraceGeoData(geoCalcData));\n\n promises.push(new Promise(function(resolve, reject) {\n Promise.all(geoPromises).then(function() {\n _this.topojson = PlotlyGeoAssets.topojson[_this.topojsonName];\n _this.update(geoCalcData, fullLayout);\n resolve();\n })\n .catch(reject);\n }));\n};\n\nproto.fetchTopojson = function() {\n var _this = this;\n var topojsonPath = topojsonUtils.getTopojsonPath(_this.topojsonURL, _this.topojsonName);\n\n return new Promise(function(resolve, reject) {\n d3.json(topojsonPath, function(err, topojson) {\n if(err) {\n if(err.status === 404) {\n return reject(new Error([\n 'plotly.js could not find topojson file at',\n topojsonPath, '.',\n 'Make sure the *topojsonURL* plot config option',\n 'is set properly.'\n ].join(' ')));\n } else {\n return reject(new Error([\n 'unexpected error while fetching topojson file at',\n topojsonPath\n ].join(' ')));\n }\n }\n\n PlotlyGeoAssets.topojson[_this.topojsonName] = topojson;\n resolve();\n });\n });\n};\n\nproto.update = function(geoCalcData, fullLayout) {\n var geoLayout = fullLayout[this.id];\n\n // important: maps with choropleth traces have a different layer order\n this.hasChoropleth = false;\n\n for(var i = 0; i < geoCalcData.length; i++) {\n var calcTrace = geoCalcData[i];\n var trace = calcTrace[0].trace;\n\n if(trace.type === 'choropleth') {\n this.hasChoropleth = true;\n }\n if(trace.visible === true && trace._length > 0) {\n trace._module.calcGeoJSON(calcTrace, fullLayout);\n }\n }\n\n var hasInvalidBounds = this.updateProjection(geoCalcData, fullLayout);\n if(hasInvalidBounds) return;\n\n if(!this.viewInitial || this.scope !== geoLayout.scope) {\n this.saveViewInitial(geoLayout);\n }\n this.scope = geoLayout.scope;\n\n this.updateBaseLayers(fullLayout, geoLayout);\n this.updateDims(fullLayout, geoLayout);\n this.updateFx(fullLayout, geoLayout);\n\n Plots.generalUpdatePerTraceModule(this.graphDiv, this, geoCalcData, geoLayout);\n\n var scatterLayer = this.layers.frontplot.select('.scatterlayer');\n this.dataPoints.point = scatterLayer.selectAll('.point');\n this.dataPoints.text = scatterLayer.selectAll('text');\n this.dataPaths.line = scatterLayer.selectAll('.js-line');\n\n var choroplethLayer = this.layers.backplot.select('.choroplethlayer');\n this.dataPaths.choropleth = choroplethLayer.selectAll('path');\n\n this.render();\n};\n\nproto.updateProjection = function(geoCalcData, fullLayout) {\n var gd = this.graphDiv;\n var geoLayout = fullLayout[this.id];\n var gs = fullLayout._size;\n var domain = geoLayout.domain;\n var projLayout = geoLayout.projection;\n\n var lonaxis = geoLayout.lonaxis;\n var lataxis = geoLayout.lataxis;\n var axLon = lonaxis._ax;\n var axLat = lataxis._ax;\n\n var projection = this.projection = getProjection(geoLayout);\n\n // setup subplot extent [[x0,y0], [x1,y1]]\n var extent = [[\n gs.l + gs.w * domain.x[0],\n gs.t + gs.h * (1 - domain.y[1])\n ], [\n gs.l + gs.w * domain.x[1],\n gs.t + gs.h * (1 - domain.y[0])\n ]];\n\n var center = geoLayout.center || {};\n var rotation = projLayout.rotation || {};\n var lonaxisRange = lonaxis.range || [];\n var lataxisRange = lataxis.range || [];\n\n if(geoLayout.fitbounds) {\n axLon._length = extent[1][0] - extent[0][0];\n axLat._length = extent[1][1] - extent[0][1];\n axLon.range = getAutoRange(gd, axLon);\n axLat.range = getAutoRange(gd, axLat);\n\n var midLon = (axLon.range[0] + axLon.range[1]) / 2;\n var midLat = (axLat.range[0] + axLat.range[1]) / 2;\n\n if(geoLayout._isScoped) {\n center = {lon: midLon, lat: midLat};\n } else if(geoLayout._isClipped) {\n center = {lon: midLon, lat: midLat};\n rotation = {lon: midLon, lat: midLat, roll: rotation.roll};\n\n var projType = projLayout.type;\n var lonHalfSpan = (constants.lonaxisSpan[projType] / 2) || 180;\n var latHalfSpan = (constants.lataxisSpan[projType] / 2) || 180;\n\n lonaxisRange = [midLon - lonHalfSpan, midLon + lonHalfSpan];\n lataxisRange = [midLat - latHalfSpan, midLat + latHalfSpan];\n } else {\n center = {lon: midLon, lat: midLat};\n rotation = {lon: midLon, lat: rotation.lat, roll: rotation.roll};\n }\n }\n\n // set 'pre-fit' projection\n projection\n .center([center.lon - rotation.lon, center.lat - rotation.lat])\n .rotate([-rotation.lon, -rotation.lat, rotation.roll])\n .parallels(projLayout.parallels);\n\n // fit projection 'scale' and 'translate' to set lon/lat ranges\n var rangeBox = makeRangeBox(lonaxisRange, lataxisRange);\n projection.fitExtent(extent, rangeBox);\n\n var b = this.bounds = projection.getBounds(rangeBox);\n var s = this.fitScale = projection.scale();\n var t = projection.translate();\n\n if(\n !isFinite(b[0][0]) || !isFinite(b[0][1]) ||\n !isFinite(b[1][0]) || !isFinite(b[1][1]) ||\n isNaN(t[0]) || isNaN(t[0])\n ) {\n var attrToUnset = ['fitbounds', 'projection.rotation', 'center', 'lonaxis.range', 'lataxis.range'];\n var msg = 'Invalid geo settings, relayout\\'ing to default view.';\n var updateObj = {};\n\n // clear all attributes that could cause invalid bounds,\n // clear viewInitial to update reset-view behavior\n\n for(var i = 0; i < attrToUnset.length; i++) {\n updateObj[this.id + '.' + attrToUnset[i]] = null;\n }\n\n this.viewInitial = null;\n\n Lib.warn(msg);\n gd._promises.push(Registry.call('relayout', gd, updateObj));\n return msg;\n }\n\n if(geoLayout.fitbounds) {\n var b2 = projection.getBounds(makeRangeBox(axLon.range, axLat.range));\n var k2 = Math.min(\n (b[1][0] - b[0][0]) / (b2[1][0] - b2[0][0]),\n (b[1][1] - b[0][1]) / (b2[1][1] - b2[0][1])\n );\n\n if(isFinite(k2)) {\n projection.scale(k2 * s);\n } else {\n Lib.warn('Something went wrong during' + this.id + 'fitbounds computations.');\n }\n } else {\n // adjust projection to user setting\n projection.scale(projLayout.scale * s);\n }\n\n // px coordinates of view mid-point,\n // useful to update `geo.center` after interactions\n var midPt = this.midPt = [\n (b[0][0] + b[1][0]) / 2,\n (b[0][1] + b[1][1]) / 2\n ];\n\n projection\n .translate([t[0] + (midPt[0] - t[0]), t[1] + (midPt[1] - t[1])])\n .clipExtent(b);\n\n // the 'albers usa' projection does not expose a 'center' method\n // so here's this hack to make it respond to 'geoLayout.center'\n if(geoLayout._isAlbersUsa) {\n var centerPx = projection([center.lon, center.lat]);\n var tt = projection.translate();\n\n projection.translate([\n tt[0] - (centerPx[0] - tt[0]),\n tt[1] - (centerPx[1] - tt[1])\n ]);\n }\n};\n\nproto.updateBaseLayers = function(fullLayout, geoLayout) {\n var _this = this;\n var topojson = _this.topojson;\n var layers = _this.layers;\n var basePaths = _this.basePaths;\n\n function isAxisLayer(d) {\n return (d === 'lonaxis' || d === 'lataxis');\n }\n\n function isLineLayer(d) {\n return Boolean(constants.lineLayers[d]);\n }\n\n function isFillLayer(d) {\n return Boolean(constants.fillLayers[d]);\n }\n\n var allLayers = this.hasChoropleth ?\n constants.layersForChoropleth :\n constants.layers;\n\n var layerData = allLayers.filter(function(d) {\n return (isLineLayer(d) || isFillLayer(d)) ? geoLayout['show' + d] :\n isAxisLayer(d) ? geoLayout[d].showgrid :\n true;\n });\n\n var join = _this.framework.selectAll('.layer')\n .data(layerData, String);\n\n join.exit().each(function(d) {\n delete layers[d];\n delete basePaths[d];\n d3.select(this).remove();\n });\n\n join.enter().append('g')\n .attr('class', function(d) { return 'layer ' + d; })\n .each(function(d) {\n var layer = layers[d] = d3.select(this);\n\n if(d === 'bg') {\n _this.bgRect = layer.append('rect')\n .style('pointer-events', 'all');\n } else if(isAxisLayer(d)) {\n basePaths[d] = layer.append('path')\n .style('fill', 'none');\n } else if(d === 'backplot') {\n layer.append('g')\n .classed('choroplethlayer', true);\n } else if(d === 'frontplot') {\n layer.append('g')\n .classed('scatterlayer', true);\n } else if(isLineLayer(d)) {\n basePaths[d] = layer.append('path')\n .style('fill', 'none')\n .style('stroke-miterlimit', 2);\n } else if(isFillLayer(d)) {\n basePaths[d] = layer.append('path')\n .style('stroke', 'none');\n }\n });\n\n join.order();\n\n join.each(function(d) {\n var path = basePaths[d];\n var adj = constants.layerNameToAdjective[d];\n\n if(d === 'frame') {\n path.datum(constants.sphereSVG);\n } else if(isLineLayer(d) || isFillLayer(d)) {\n path.datum(topojsonFeature(topojson, topojson.objects[d]));\n } else if(isAxisLayer(d)) {\n path.datum(makeGraticule(d, geoLayout, fullLayout))\n .call(Color.stroke, geoLayout[d].gridcolor)\n .call(Drawing.dashLine, '', geoLayout[d].gridwidth);\n }\n\n if(isLineLayer(d)) {\n path.call(Color.stroke, geoLayout[adj + 'color'])\n .call(Drawing.dashLine, '', geoLayout[adj + 'width']);\n } else if(isFillLayer(d)) {\n path.call(Color.fill, geoLayout[adj + 'color']);\n }\n });\n};\n\nproto.updateDims = function(fullLayout, geoLayout) {\n var b = this.bounds;\n var hFrameWidth = (geoLayout.framewidth || 0) / 2;\n\n var l = b[0][0] - hFrameWidth;\n var t = b[0][1] - hFrameWidth;\n var w = b[1][0] - l + hFrameWidth;\n var h = b[1][1] - t + hFrameWidth;\n\n Drawing.setRect(this.clipRect, l, t, w, h);\n\n this.bgRect\n .call(Drawing.setRect, l, t, w, h)\n .call(Color.fill, geoLayout.bgcolor);\n\n this.xaxis._offset = l;\n this.xaxis._length = w;\n\n this.yaxis._offset = t;\n this.yaxis._length = h;\n};\n\nproto.updateFx = function(fullLayout, geoLayout) {\n var _this = this;\n var gd = _this.graphDiv;\n var bgRect = _this.bgRect;\n var dragMode = fullLayout.dragmode;\n var clickMode = fullLayout.clickmode;\n\n if(_this.isStatic) return;\n\n function zoomReset() {\n var viewInitial = _this.viewInitial;\n var updateObj = {};\n\n for(var k in viewInitial) {\n updateObj[_this.id + '.' + k] = viewInitial[k];\n }\n\n Registry.call('_guiRelayout', gd, updateObj);\n gd.emit('plotly_doubleclick', null);\n }\n\n function invert(lonlat) {\n return _this.projection.invert([\n lonlat[0] + _this.xaxis._offset,\n lonlat[1] + _this.yaxis._offset\n ]);\n }\n\n var fillRangeItems;\n\n if(dragMode === 'select') {\n fillRangeItems = function(eventData, poly) {\n var ranges = eventData.range = {};\n ranges[_this.id] = [\n invert([poly.xmin, poly.ymin]),\n invert([poly.xmax, poly.ymax])\n ];\n };\n } else if(dragMode === 'lasso') {\n fillRangeItems = function(eventData, poly, pts) {\n var dataPts = eventData.lassoPoints = {};\n dataPts[_this.id] = pts.filtered.map(invert);\n };\n }\n\n // Note: dragOptions is needed to be declared for all dragmodes because\n // it's the object that holds persistent selection state.\n var dragOptions = {\n element: _this.bgRect.node(),\n gd: gd,\n plotinfo: {\n id: _this.id,\n xaxis: _this.xaxis,\n yaxis: _this.yaxis,\n fillRangeItems: fillRangeItems\n },\n xaxes: [_this.xaxis],\n yaxes: [_this.yaxis],\n subplot: _this.id,\n clickFn: function(numClicks) {\n if(numClicks === 2) {\n clearSelect(gd);\n }\n }\n };\n\n if(dragMode === 'pan') {\n bgRect.node().onmousedown = null;\n bgRect.call(createGeoZoom(_this, geoLayout));\n bgRect.on('dblclick.zoom', zoomReset);\n if(!gd._context._scrollZoom.geo) {\n bgRect.on('wheel.zoom', null);\n }\n } else if(dragMode === 'select' || dragMode === 'lasso') {\n bgRect.on('.zoom', null);\n\n dragOptions.prepFn = function(e, startX, startY) {\n prepSelect(e, startX, startY, dragOptions, dragMode);\n };\n\n dragElement.init(dragOptions);\n }\n\n bgRect.on('mousemove', function() {\n var lonlat = _this.projection.invert(d3.mouse(this));\n\n if(!lonlat || isNaN(lonlat[0]) || isNaN(lonlat[1])) {\n return dragElement.unhover(gd, d3.event);\n }\n\n _this.xaxis.p2c = function() { return lonlat[0]; };\n _this.yaxis.p2c = function() { return lonlat[1]; };\n\n Fx.hover(gd, d3.event, _this.id);\n });\n\n bgRect.on('mouseout', function() {\n if(gd._dragging) return;\n dragElement.unhover(gd, d3.event);\n });\n\n bgRect.on('click', function() {\n // For select and lasso the dragElement is handling clicks\n if(dragMode !== 'select' && dragMode !== 'lasso') {\n if(clickMode.indexOf('select') > -1) {\n selectOnClick(d3.event, gd, [_this.xaxis], [_this.yaxis],\n _this.id, dragOptions);\n }\n\n if(clickMode.indexOf('event') > -1) {\n // TODO: like pie and mapbox, this doesn't support right-click\n // actually this one is worse, as right-click starts a pan, or leaves\n // select in a weird state.\n // Also, only tangentially related, we should cancel hover during pan\n Fx.click(gd, d3.event);\n }\n }\n });\n};\n\nproto.makeFramework = function() {\n var _this = this;\n var gd = _this.graphDiv;\n var fullLayout = gd._fullLayout;\n var clipId = 'clip' + fullLayout._uid + _this.id;\n\n _this.clipDef = fullLayout._clips.append('clipPath')\n .attr('id', clipId);\n\n _this.clipRect = _this.clipDef.append('rect');\n\n _this.framework = d3.select(_this.container).append('g')\n .attr('class', 'geo ' + _this.id)\n .call(Drawing.setClipUrl, clipId, gd);\n\n // sane lonlat to px\n _this.project = function(v) {\n var px = _this.projection(v);\n return px ?\n [px[0] - _this.xaxis._offset, px[1] - _this.yaxis._offset] :\n [null, null];\n };\n\n _this.xaxis = {\n _id: 'x',\n c2p: function(v) { return _this.project(v)[0]; }\n };\n\n _this.yaxis = {\n _id: 'y',\n c2p: function(v) { return _this.project(v)[1]; }\n };\n\n // mock axis for hover formatting\n _this.mockAxis = {\n type: 'linear',\n showexponent: 'all',\n exponentformat: 'B'\n };\n Axes.setConvert(_this.mockAxis, fullLayout);\n};\n\nproto.saveViewInitial = function(geoLayout) {\n var center = geoLayout.center || {};\n var projLayout = geoLayout.projection;\n var rotation = projLayout.rotation || {};\n\n this.viewInitial = {\n 'fitbounds': geoLayout.fitbounds,\n 'projection.scale': projLayout.scale\n };\n\n var extra;\n if(geoLayout._isScoped) {\n extra = {\n 'center.lon': center.lon,\n 'center.lat': center.lat,\n };\n } else if(geoLayout._isClipped) {\n extra = {\n 'projection.rotation.lon': rotation.lon,\n 'projection.rotation.lat': rotation.lat\n };\n } else {\n extra = {\n 'center.lon': center.lon,\n 'center.lat': center.lat,\n 'projection.rotation.lon': rotation.lon\n };\n }\n\n Lib.extendFlat(this.viewInitial, extra);\n};\n\n// [hot code path] (re)draw all paths which depend on the projection\nproto.render = function() {\n var projection = this.projection;\n var pathFn = projection.getPath();\n var k;\n\n function translatePoints(d) {\n var lonlatPx = projection(d.lonlat);\n return lonlatPx ?\n 'translate(' + lonlatPx[0] + ',' + lonlatPx[1] + ')' :\n null;\n }\n\n function hideShowPoints(d) {\n return projection.isLonLatOverEdges(d.lonlat) ? 'none' : null;\n }\n\n for(k in this.basePaths) {\n this.basePaths[k].attr('d', pathFn);\n }\n\n for(k in this.dataPaths) {\n this.dataPaths[k].attr('d', function(d) { return pathFn(d.geojson); });\n }\n\n for(k in this.dataPoints) {\n this.dataPoints[k]\n .attr('display', hideShowPoints)\n .attr('transform', translatePoints);\n }\n};\n\n// Helper that wraps d3.geo[/* projection name /*]() which:\n//\n// - adds 'fitExtent' (available in d3 v4)\n// - adds 'getPath', 'getBounds' convenience methods\n// - scopes logic related to 'clipAngle'\n// - adds 'isLonLatOverEdges' method\n// - sets projection precision\n// - sets methods that aren't always defined depending\n// on the projection type to a dummy 'd3-esque' function,\n//\n// This wrapper alleviates subsequent code of (many) annoying if-statements.\nfunction getProjection(geoLayout) {\n var projLayout = geoLayout.projection;\n var projType = projLayout.type;\n\n var projection = d3.geo[constants.projNames[projType]]();\n\n var clipAngle = geoLayout._isClipped ?\n constants.lonaxisSpan[projType] / 2 :\n null;\n\n var methods = ['center', 'rotate', 'parallels', 'clipExtent'];\n var dummyFn = function(_) { return _ ? projection : []; };\n\n for(var i = 0; i < methods.length; i++) {\n var m = methods[i];\n if(typeof projection[m] !== 'function') {\n projection[m] = dummyFn;\n }\n }\n\n projection.isLonLatOverEdges = function(lonlat) {\n if(projection(lonlat) === null) {\n return true;\n }\n\n if(clipAngle) {\n var r = projection.rotate();\n var angle = d3.geo.distance(lonlat, [-r[0], -r[1]]);\n var maxAngle = clipAngle * Math.PI / 180;\n return angle > maxAngle;\n } else {\n return false;\n }\n };\n\n projection.getPath = function() {\n return d3.geo.path().projection(projection);\n };\n\n projection.getBounds = function(object) {\n return projection.getPath().bounds(object);\n };\n\n // adapted from d3 v4:\n // https://github.com/d3/d3-geo/blob/master/src/projection/fit.js\n projection.fitExtent = function(extent, object) {\n var w = extent[1][0] - extent[0][0];\n var h = extent[1][1] - extent[0][1];\n var clip = projection.clipExtent && projection.clipExtent();\n\n projection\n .scale(150)\n .translate([0, 0]);\n\n if(clip) projection.clipExtent(null);\n\n var b = projection.getBounds(object);\n var k = Math.min(w / (b[1][0] - b[0][0]), h / (b[1][1] - b[0][1]));\n var x = +extent[0][0] + (w - k * (b[1][0] + b[0][0])) / 2;\n var y = +extent[0][1] + (h - k * (b[1][1] + b[0][1])) / 2;\n\n if(clip) projection.clipExtent(clip);\n\n return projection\n .scale(k * 150)\n .translate([x, y]);\n };\n\n projection.precision(constants.precision);\n\n if(clipAngle) {\n projection.clipAngle(clipAngle - constants.clipPad);\n }\n\n return projection;\n}\n\nfunction makeGraticule(axisName, geoLayout, fullLayout) {\n // equivalent to the d3 \"ε\"\n var epsilon = 1e-6;\n // same as the geoGraticule default\n var precision = 2.5;\n\n var axLayout = geoLayout[axisName];\n var scopeDefaults = constants.scopeDefaults[geoLayout.scope];\n var rng;\n var oppRng;\n var coordFn;\n\n if(axisName === 'lonaxis') {\n rng = scopeDefaults.lonaxisRange;\n oppRng = scopeDefaults.lataxisRange;\n coordFn = function(v, l) { return [v, l]; };\n } else if(axisName === 'lataxis') {\n rng = scopeDefaults.lataxisRange;\n oppRng = scopeDefaults.lonaxisRange;\n coordFn = function(v, l) { return [l, v]; };\n }\n\n var dummyAx = {\n type: 'linear',\n range: [rng[0], rng[1] - epsilon],\n tick0: axLayout.tick0,\n dtick: axLayout.dtick\n };\n\n Axes.setConvert(dummyAx, fullLayout);\n var vals = Axes.calcTicks(dummyAx);\n\n // remove duplicate on antimeridian\n if(!geoLayout.isScoped && axisName === 'lonaxis') {\n vals.pop();\n }\n\n var len = vals.length;\n var coords = new Array(len);\n\n for(var i = 0; i < len; i++) {\n var v = vals[i].x;\n var line = coords[i] = [];\n for(var l = oppRng[0]; l < oppRng[1] + precision; l += precision) {\n line.push(coordFn(v, l));\n }\n }\n\n return {\n type: 'MultiLineString',\n coordinates: coords\n };\n}\n\n// Returns polygon GeoJSON corresponding to lon/lat range box\n// with well-defined direction\n//\n// Note that clipPad padding is added around range to avoid aliasing.\nfunction makeRangeBox(lon, lat) {\n var clipPad = constants.clipPad;\n var lon0 = lon[0] + clipPad;\n var lon1 = lon[1] - clipPad;\n var lat0 = lat[0] + clipPad;\n var lat1 = lat[1] - clipPad;\n\n // to cross antimeridian w/o ambiguity\n if(lon0 > 0 && lon1 < 0) lon1 += 360;\n\n var dlon4 = (lon1 - lon0) / 4;\n\n return {\n type: 'Polygon',\n coordinates: [[\n [lon0, lat0],\n [lon0, lat1],\n [lon0 + dlon4, lat1],\n [lon0 + 2 * dlon4, lat1],\n [lon0 + 3 * dlon4, lat1],\n [lon1, lat1],\n [lon1, lat0],\n [lon1 - dlon4, lat0],\n [lon1 - 2 * dlon4, lat0],\n [lon1 - 3 * dlon4, lat0],\n [lon0, lat0]\n ]]\n };\n}\n\n},{\"../../components/color\":595,\"../../components/dragelement\":614,\"../../components/drawing\":617,\"../../components/fx\":635,\"../../lib\":728,\"../../lib/geo_location_utils\":722,\"../../lib/topojson_utils\":755,\"../../registry\":859,\"../cartesian/autorange\":775,\"../cartesian/axes\":776,\"../cartesian/select\":795,\"../plots\":839,\"./constants\":806,\"./projections\":811,\"./zoom\":812,\"d3\":164,\"topojson-client\":531}],808:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar getSubplotCalcData = _dereq_('../../plots/get_data').getSubplotCalcData;\nvar counterRegex = _dereq_('../../lib').counterRegex;\n\nvar createGeo = _dereq_('./geo');\n\nvar GEO = 'geo';\nvar counter = counterRegex(GEO);\n\nvar attributes = {};\nattributes[GEO] = {\n valType: 'subplotid',\n \n dflt: GEO,\n editType: 'calc',\n \n};\n\nfunction plotGeo(gd) {\n var fullLayout = gd._fullLayout;\n var calcData = gd.calcdata;\n var geoIds = fullLayout._subplots[GEO];\n\n for(var i = 0; i < geoIds.length; i++) {\n var geoId = geoIds[i];\n var geoCalcData = getSubplotCalcData(calcData, GEO, geoId);\n var geoLayout = fullLayout[geoId];\n var geo = geoLayout._subplot;\n\n if(!geo) {\n geo = createGeo({\n id: geoId,\n graphDiv: gd,\n container: fullLayout._geolayer.node(),\n topojsonURL: gd._context.topojsonURL,\n staticPlot: gd._context.staticPlot\n });\n\n fullLayout[geoId]._subplot = geo;\n }\n\n geo.plot(geoCalcData, fullLayout, gd._promises);\n }\n}\n\nfunction clean(newFullData, newFullLayout, oldFullData, oldFullLayout) {\n var oldGeoKeys = oldFullLayout._subplots[GEO] || [];\n\n for(var i = 0; i < oldGeoKeys.length; i++) {\n var oldGeoKey = oldGeoKeys[i];\n var oldGeo = oldFullLayout[oldGeoKey]._subplot;\n\n if(!newFullLayout[oldGeoKey] && !!oldGeo) {\n oldGeo.framework.remove();\n oldGeo.clipDef.remove();\n }\n }\n}\n\nfunction updateFx(gd) {\n var fullLayout = gd._fullLayout;\n var subplotIds = fullLayout._subplots[GEO];\n\n for(var i = 0; i < subplotIds.length; i++) {\n var subplotLayout = fullLayout[subplotIds[i]];\n var subplotObj = subplotLayout._subplot;\n subplotObj.updateFx(fullLayout, subplotLayout);\n }\n}\n\nmodule.exports = {\n attr: GEO,\n name: GEO,\n idRoot: GEO,\n idRegex: counter,\n attrRegex: counter,\n attributes: attributes,\n layoutAttributes: _dereq_('./layout_attributes'),\n supplyLayoutDefaults: _dereq_('./layout_defaults'),\n plot: plotGeo,\n updateFx: updateFx,\n clean: clean\n};\n\n},{\"../../lib\":728,\"../../plots/get_data\":813,\"./geo\":807,\"./layout_attributes\":809,\"./layout_defaults\":810}],809:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar colorAttrs = _dereq_('../../components/color/attributes');\nvar domainAttrs = _dereq_('../domain').attributes;\nvar constants = _dereq_('./constants');\nvar overrideAll = _dereq_('../../plot_api/edit_types').overrideAll;\n\nvar geoAxesAttrs = {\n range: {\n valType: 'info_array',\n \n items: [\n {valType: 'number'},\n {valType: 'number'}\n ],\n \n },\n showgrid: {\n valType: 'boolean',\n \n dflt: false,\n \n },\n tick0: {\n valType: 'number',\n \n dflt: 0,\n \n },\n dtick: {\n valType: 'number',\n \n \n },\n gridcolor: {\n valType: 'color',\n \n dflt: colorAttrs.lightLine,\n \n },\n gridwidth: {\n valType: 'number',\n \n min: 0,\n dflt: 1,\n \n }\n};\n\nvar attrs = module.exports = overrideAll({\n domain: domainAttrs({name: 'geo'}, {\n \n }),\n\n fitbounds: {\n valType: 'enumerated',\n values: [false, 'locations', 'geojson'],\n dflt: false,\n \n editType: 'plot',\n \n },\n\n resolution: {\n valType: 'enumerated',\n values: [110, 50],\n \n dflt: 110,\n coerceNumber: true,\n \n },\n scope: {\n valType: 'enumerated',\n \n values: Object.keys(constants.scopeDefaults),\n dflt: 'world',\n \n },\n projection: {\n type: {\n valType: 'enumerated',\n \n values: Object.keys(constants.projNames),\n \n },\n rotation: {\n lon: {\n valType: 'number',\n \n \n },\n lat: {\n valType: 'number',\n \n \n },\n roll: {\n valType: 'number',\n \n \n }\n },\n parallels: {\n valType: 'info_array',\n \n items: [\n {valType: 'number'},\n {valType: 'number'}\n ],\n \n },\n scale: {\n valType: 'number',\n \n min: 0,\n dflt: 1,\n \n },\n },\n center: {\n lon: {\n valType: 'number',\n \n \n },\n lat: {\n valType: 'number',\n \n \n }\n },\n visible: {\n valType: 'boolean',\n \n dflt: true,\n \n },\n showcoastlines: {\n valType: 'boolean',\n \n \n },\n coastlinecolor: {\n valType: 'color',\n \n dflt: colorAttrs.defaultLine,\n \n },\n coastlinewidth: {\n valType: 'number',\n \n min: 0,\n dflt: 1,\n \n },\n showland: {\n valType: 'boolean',\n \n dflt: false,\n \n },\n landcolor: {\n valType: 'color',\n \n dflt: constants.landColor,\n \n },\n showocean: {\n valType: 'boolean',\n \n dflt: false,\n \n },\n oceancolor: {\n valType: 'color',\n \n dflt: constants.waterColor,\n \n },\n showlakes: {\n valType: 'boolean',\n \n dflt: false,\n \n },\n lakecolor: {\n valType: 'color',\n \n dflt: constants.waterColor,\n \n },\n showrivers: {\n valType: 'boolean',\n \n dflt: false,\n \n },\n rivercolor: {\n valType: 'color',\n \n dflt: constants.waterColor,\n \n },\n riverwidth: {\n valType: 'number',\n \n min: 0,\n dflt: 1,\n \n },\n showcountries: {\n valType: 'boolean',\n \n \n },\n countrycolor: {\n valType: 'color',\n \n dflt: colorAttrs.defaultLine,\n \n },\n countrywidth: {\n valType: 'number',\n \n min: 0,\n dflt: 1,\n \n },\n showsubunits: {\n valType: 'boolean',\n \n \n },\n subunitcolor: {\n valType: 'color',\n \n dflt: colorAttrs.defaultLine,\n \n },\n subunitwidth: {\n valType: 'number',\n \n min: 0,\n dflt: 1,\n \n },\n showframe: {\n valType: 'boolean',\n \n \n },\n framecolor: {\n valType: 'color',\n \n dflt: colorAttrs.defaultLine,\n \n },\n framewidth: {\n valType: 'number',\n \n min: 0,\n dflt: 1,\n \n },\n bgcolor: {\n valType: 'color',\n \n dflt: colorAttrs.background,\n \n },\n lonaxis: geoAxesAttrs,\n lataxis: geoAxesAttrs\n}, 'plot', 'from-root');\n\n// set uirevision outside of overrideAll so it can be `editType: 'none'`\nattrs.uirevision = {\n valType: 'any',\n \n editType: 'none',\n \n};\n\n},{\"../../components/color/attributes\":594,\"../../plot_api/edit_types\":759,\"../domain\":803,\"./constants\":806}],810:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar handleSubplotDefaults = _dereq_('../subplot_defaults');\nvar getSubplotData = _dereq_('../get_data').getSubplotData;\n\nvar constants = _dereq_('./constants');\nvar layoutAttributes = _dereq_('./layout_attributes');\n\nvar axesNames = constants.axesNames;\n\nmodule.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {\n handleSubplotDefaults(layoutIn, layoutOut, fullData, {\n type: 'geo',\n attributes: layoutAttributes,\n handleDefaults: handleGeoDefaults,\n fullData: fullData,\n partition: 'y'\n });\n};\n\nfunction handleGeoDefaults(geoLayoutIn, geoLayoutOut, coerce, opts) {\n var subplotData = getSubplotData(opts.fullData, 'geo', opts.id);\n var traceIndices = subplotData.map(function(t) { return t._expandedIndex; });\n\n var resolution = coerce('resolution');\n var scope = coerce('scope');\n var scopeParams = constants.scopeDefaults[scope];\n\n var projType = coerce('projection.type', scopeParams.projType);\n var isAlbersUsa = geoLayoutOut._isAlbersUsa = projType === 'albers usa';\n\n // no other scopes are allowed for 'albers usa' projection\n if(isAlbersUsa) scope = geoLayoutOut.scope = 'usa';\n\n var isScoped = geoLayoutOut._isScoped = (scope !== 'world');\n var isConic = geoLayoutOut._isConic = projType.indexOf('conic') !== -1;\n var isClipped = geoLayoutOut._isClipped = !!constants.lonaxisSpan[projType];\n\n if(geoLayoutIn.visible === false) {\n // should override template.layout.geo.show* - see issue 4482\n\n // make a copy\n var newTemplate = Lib.extendDeep({}, geoLayoutOut._template);\n\n // override show*\n newTemplate.showcoastlines = false;\n newTemplate.showcountries = false;\n newTemplate.showframe = false;\n newTemplate.showlakes = false;\n newTemplate.showland = false;\n newTemplate.showocean = false;\n newTemplate.showrivers = false;\n newTemplate.showsubunits = false;\n if(newTemplate.lonaxis) newTemplate.lonaxis.showgrid = false;\n if(newTemplate.lataxis) newTemplate.lataxis.showgrid = false;\n\n // set ref to copy\n geoLayoutOut._template = newTemplate;\n }\n var visible = coerce('visible');\n\n var show;\n for(var i = 0; i < axesNames.length; i++) {\n var axisName = axesNames[i];\n var dtickDflt = [30, 10][i];\n var rangeDflt;\n\n if(isScoped) {\n rangeDflt = scopeParams[axisName + 'Range'];\n } else {\n var dfltSpans = constants[axisName + 'Span'];\n var hSpan = (dfltSpans[projType] || dfltSpans['*']) / 2;\n var rot = coerce(\n 'projection.rotation.' + axisName.substr(0, 3),\n scopeParams.projRotate[i]\n );\n rangeDflt = [rot - hSpan, rot + hSpan];\n }\n\n var range = coerce(axisName + '.range', rangeDflt);\n coerce(axisName + '.tick0');\n coerce(axisName + '.dtick', dtickDflt);\n\n show = coerce(axisName + '.showgrid', !visible ? false : undefined);\n if(show) {\n coerce(axisName + '.gridcolor');\n coerce(axisName + '.gridwidth');\n }\n\n // mock axis for autorange computations\n geoLayoutOut[axisName]._ax = {\n type: 'linear',\n _id: axisName.slice(0, 3),\n _traceIndices: traceIndices,\n setScale: Lib.identity,\n c2l: Lib.identity,\n r2l: Lib.identity,\n autorange: true,\n range: range.slice(),\n _m: 1,\n _input: {}\n };\n }\n\n var lonRange = geoLayoutOut.lonaxis.range;\n var latRange = geoLayoutOut.lataxis.range;\n\n // to cross antimeridian w/o ambiguity\n var lon0 = lonRange[0];\n var lon1 = lonRange[1];\n if(lon0 > 0 && lon1 < 0) lon1 += 360;\n\n var centerLon = (lon0 + lon1) / 2;\n var projLon;\n\n if(!isAlbersUsa) {\n var dfltProjRotate = isScoped ? scopeParams.projRotate : [centerLon, 0, 0];\n\n projLon = coerce('projection.rotation.lon', dfltProjRotate[0]);\n coerce('projection.rotation.lat', dfltProjRotate[1]);\n coerce('projection.rotation.roll', dfltProjRotate[2]);\n\n show = coerce('showcoastlines', !isScoped && visible);\n if(show) {\n coerce('coastlinecolor');\n coerce('coastlinewidth');\n }\n\n show = coerce('showocean', !visible ? false : undefined);\n if(show) coerce('oceancolor');\n }\n\n var centerLonDflt;\n var centerLatDflt;\n\n if(isAlbersUsa) {\n // 'albers usa' does not have a 'center',\n // these values were found using via:\n // projection.invert([geoLayout.center.lon, geoLayoutIn.center.lat])\n centerLonDflt = -96.6;\n centerLatDflt = 38.7;\n } else {\n centerLonDflt = isScoped ? centerLon : projLon;\n centerLatDflt = (latRange[0] + latRange[1]) / 2;\n }\n\n coerce('center.lon', centerLonDflt);\n coerce('center.lat', centerLatDflt);\n\n if(isConic) {\n var dfltProjParallels = scopeParams.projParallels || [0, 60];\n coerce('projection.parallels', dfltProjParallels);\n }\n\n coerce('projection.scale');\n\n show = coerce('showland', !visible ? false : undefined);\n if(show) coerce('landcolor');\n\n show = coerce('showlakes', !visible ? false : undefined);\n if(show) coerce('lakecolor');\n\n show = coerce('showrivers', !visible ? false : undefined);\n if(show) {\n coerce('rivercolor');\n coerce('riverwidth');\n }\n\n show = coerce('showcountries', isScoped && scope !== 'usa' && visible);\n if(show) {\n coerce('countrycolor');\n coerce('countrywidth');\n }\n\n if(scope === 'usa' || (scope === 'north america' && resolution === 50)) {\n // Only works for:\n // USA states at 110m\n // USA states + Canada provinces at 50m\n coerce('showsubunits', visible);\n coerce('subunitcolor');\n coerce('subunitwidth');\n }\n\n if(!isScoped) {\n // Does not work in non-world scopes\n show = coerce('showframe', visible);\n if(show) {\n coerce('framecolor');\n coerce('framewidth');\n }\n }\n\n coerce('bgcolor');\n\n var fitBounds = coerce('fitbounds');\n\n // clear attributes that will get auto-filled later\n if(fitBounds) {\n delete geoLayoutOut.projection.scale;\n\n if(isScoped) {\n delete geoLayoutOut.center.lon;\n delete geoLayoutOut.center.lat;\n } else if(isClipped) {\n delete geoLayoutOut.center.lon;\n delete geoLayoutOut.center.lat;\n delete geoLayoutOut.projection.rotation.lon;\n delete geoLayoutOut.projection.rotation.lat;\n delete geoLayoutOut.lonaxis.range;\n delete geoLayoutOut.lataxis.range;\n } else {\n delete geoLayoutOut.center.lon;\n delete geoLayoutOut.center.lat;\n delete geoLayoutOut.projection.rotation.lon;\n }\n }\n}\n\n},{\"../../lib\":728,\"../get_data\":813,\"../subplot_defaults\":853,\"./constants\":806,\"./layout_attributes\":809}],811:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n/*\n * Generated by https://github.com/etpinard/d3-geo-projection-picker\n *\n * which is hand-picks projection from https://github.com/d3/d3-geo-projection\n *\n * into a CommonJS require-able module.\n */\n\n'use strict';\n\n/* eslint-disable */\n\nfunction addProjectionsToD3(d3) {\n d3.geo.project = function(object, projection) {\n var stream = projection.stream;\n if (!stream) throw new Error(\"not yet supported\");\n return (object && d3_geo_projectObjectType.hasOwnProperty(object.type) ? d3_geo_projectObjectType[object.type] : d3_geo_projectGeometry)(object, stream);\n };\n function d3_geo_projectFeature(object, stream) {\n return {\n type: \"Feature\",\n id: object.id,\n properties: object.properties,\n geometry: d3_geo_projectGeometry(object.geometry, stream)\n };\n }\n function d3_geo_projectGeometry(geometry, stream) {\n if (!geometry) return null;\n if (geometry.type === \"GeometryCollection\") return {\n type: \"GeometryCollection\",\n geometries: object.geometries.map(function(geometry) {\n return d3_geo_projectGeometry(geometry, stream);\n })\n };\n if (!d3_geo_projectGeometryType.hasOwnProperty(geometry.type)) return null;\n var sink = d3_geo_projectGeometryType[geometry.type];\n d3.geo.stream(geometry, stream(sink));\n return sink.result();\n }\n var d3_geo_projectObjectType = {\n Feature: d3_geo_projectFeature,\n FeatureCollection: function(object, stream) {\n return {\n type: \"FeatureCollection\",\n features: object.features.map(function(feature) {\n return d3_geo_projectFeature(feature, stream);\n })\n };\n }\n };\n var d3_geo_projectPoints = [], d3_geo_projectLines = [];\n var d3_geo_projectPoint = {\n point: function(x, y) {\n d3_geo_projectPoints.push([ x, y ]);\n },\n result: function() {\n var result = !d3_geo_projectPoints.length ? null : d3_geo_projectPoints.length < 2 ? {\n type: \"Point\",\n coordinates: d3_geo_projectPoints[0]\n } : {\n type: \"MultiPoint\",\n coordinates: d3_geo_projectPoints\n };\n d3_geo_projectPoints = [];\n return result;\n }\n };\n var d3_geo_projectLine = {\n lineStart: d3_geo_projectNoop,\n point: function(x, y) {\n d3_geo_projectPoints.push([ x, y ]);\n },\n lineEnd: function() {\n if (d3_geo_projectPoints.length) d3_geo_projectLines.push(d3_geo_projectPoints),\n d3_geo_projectPoints = [];\n },\n result: function() {\n var result = !d3_geo_projectLines.length ? null : d3_geo_projectLines.length < 2 ? {\n type: \"LineString\",\n coordinates: d3_geo_projectLines[0]\n } : {\n type: \"MultiLineString\",\n coordinates: d3_geo_projectLines\n };\n d3_geo_projectLines = [];\n return result;\n }\n };\n var d3_geo_projectPolygon = {\n polygonStart: d3_geo_projectNoop,\n lineStart: d3_geo_projectNoop,\n point: function(x, y) {\n d3_geo_projectPoints.push([ x, y ]);\n },\n lineEnd: function() {\n var n = d3_geo_projectPoints.length;\n if (n) {\n do d3_geo_projectPoints.push(d3_geo_projectPoints[0].slice()); while (++n < 4);\n d3_geo_projectLines.push(d3_geo_projectPoints), d3_geo_projectPoints = [];\n }\n },\n polygonEnd: d3_geo_projectNoop,\n result: function() {\n if (!d3_geo_projectLines.length) return null;\n var polygons = [], holes = [];\n d3_geo_projectLines.forEach(function(ring) {\n if (d3_geo_projectClockwise(ring)) polygons.push([ ring ]); else holes.push(ring);\n });\n holes.forEach(function(hole) {\n var point = hole[0];\n polygons.some(function(polygon) {\n if (d3_geo_projectContains(polygon[0], point)) {\n polygon.push(hole);\n return true;\n }\n }) || polygons.push([ hole ]);\n });\n d3_geo_projectLines = [];\n return !polygons.length ? null : polygons.length > 1 ? {\n type: \"MultiPolygon\",\n coordinates: polygons\n } : {\n type: \"Polygon\",\n coordinates: polygons[0]\n };\n }\n };\n var d3_geo_projectGeometryType = {\n Point: d3_geo_projectPoint,\n MultiPoint: d3_geo_projectPoint,\n LineString: d3_geo_projectLine,\n MultiLineString: d3_geo_projectLine,\n Polygon: d3_geo_projectPolygon,\n MultiPolygon: d3_geo_projectPolygon,\n Sphere: d3_geo_projectPolygon\n };\n function d3_geo_projectNoop() {}\n function d3_geo_projectClockwise(ring) {\n if ((n = ring.length) < 4) return false;\n var i = 0, n, area = ring[n - 1][1] * ring[0][0] - ring[n - 1][0] * ring[0][1];\n while (++i < n) area += ring[i - 1][1] * ring[i][0] - ring[i - 1][0] * ring[i][1];\n return area <= 0;\n }\n function d3_geo_projectContains(ring, point) {\n var x = point[0], y = point[1], contains = false;\n for (var i = 0, n = ring.length, j = n - 1; i < n; j = i++) {\n var pi = ring[i], xi = pi[0], yi = pi[1], pj = ring[j], xj = pj[0], yj = pj[1];\n if (yi > y ^ yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi) contains = !contains;\n }\n return contains;\n }\n var ε = 1e-6, ε2 = ε * ε, π = Math.PI, halfπ = π / 2, sqrtπ = Math.sqrt(π), radians = π / 180, degrees = 180 / π;\n function sinci(x) {\n return x ? x / Math.sin(x) : 1;\n }\n function sgn(x) {\n return x > 0 ? 1 : x < 0 ? -1 : 0;\n }\n function asin(x) {\n return x > 1 ? halfπ : x < -1 ? -halfπ : Math.asin(x);\n }\n function acos(x) {\n return x > 1 ? 0 : x < -1 ? π : Math.acos(x);\n }\n function asqrt(x) {\n return x > 0 ? Math.sqrt(x) : 0;\n }\n var projection = d3.geo.projection, projectionMutator = d3.geo.projectionMutator;\n d3.geo.interrupt = function(project) {\n var lobes = [ [ [ [ -π, 0 ], [ 0, halfπ ], [ π, 0 ] ] ], [ [ [ -π, 0 ], [ 0, -halfπ ], [ π, 0 ] ] ] ];\n var bounds;\n function forward(λ, φ) {\n var sign = φ < 0 ? -1 : +1, hemilobes = lobes[+(φ < 0)];\n for (var i = 0, n = hemilobes.length - 1; i < n && λ > hemilobes[i][2][0]; ++i) ;\n var coordinates = project(λ - hemilobes[i][1][0], φ);\n coordinates[0] += project(hemilobes[i][1][0], sign * φ > sign * hemilobes[i][0][1] ? hemilobes[i][0][1] : φ)[0];\n return coordinates;\n }\n function reset() {\n bounds = lobes.map(function(hemilobes) {\n return hemilobes.map(function(lobe) {\n var x0 = project(lobe[0][0], lobe[0][1])[0], x1 = project(lobe[2][0], lobe[2][1])[0], y0 = project(lobe[1][0], lobe[0][1])[1], y1 = project(lobe[1][0], lobe[1][1])[1], t;\n if (y0 > y1) t = y0, y0 = y1, y1 = t;\n return [ [ x0, y0 ], [ x1, y1 ] ];\n });\n });\n }\n if (project.invert) forward.invert = function(x, y) {\n var hemibounds = bounds[+(y < 0)], hemilobes = lobes[+(y < 0)];\n for (var i = 0, n = hemibounds.length; i < n; ++i) {\n var b = hemibounds[i];\n if (b[0][0] <= x && x < b[1][0] && b[0][1] <= y && y < b[1][1]) {\n var coordinates = project.invert(x - project(hemilobes[i][1][0], 0)[0], y);\n coordinates[0] += hemilobes[i][1][0];\n return pointEqual(forward(coordinates[0], coordinates[1]), [ x, y ]) ? coordinates : null;\n }\n }\n };\n var projection = d3.geo.projection(forward), stream_ = projection.stream;\n projection.stream = function(stream) {\n var rotate = projection.rotate(), rotateStream = stream_(stream), sphereStream = (projection.rotate([ 0, 0 ]),\n stream_(stream));\n projection.rotate(rotate);\n rotateStream.sphere = function() {\n d3.geo.stream(sphere(), sphereStream);\n };\n return rotateStream;\n };\n projection.lobes = function(_) {\n if (!arguments.length) return lobes.map(function(lobes) {\n return lobes.map(function(lobe) {\n return [ [ lobe[0][0] * 180 / π, lobe[0][1] * 180 / π ], [ lobe[1][0] * 180 / π, lobe[1][1] * 180 / π ], [ lobe[2][0] * 180 / π, lobe[2][1] * 180 / π ] ];\n });\n });\n lobes = _.map(function(lobes) {\n return lobes.map(function(lobe) {\n return [ [ lobe[0][0] * π / 180, lobe[0][1] * π / 180 ], [ lobe[1][0] * π / 180, lobe[1][1] * π / 180 ], [ lobe[2][0] * π / 180, lobe[2][1] * π / 180 ] ];\n });\n });\n reset();\n return projection;\n };\n function sphere() {\n var ε = 1e-6, coordinates = [];\n for (var i = 0, n = lobes[0].length; i < n; ++i) {\n var lobe = lobes[0][i], λ0 = lobe[0][0] * 180 / π, φ0 = lobe[0][1] * 180 / π, φ1 = lobe[1][1] * 180 / π, λ2 = lobe[2][0] * 180 / π, φ2 = lobe[2][1] * 180 / π;\n coordinates.push(resample([ [ λ0 + ε, φ0 + ε ], [ λ0 + ε, φ1 - ε ], [ λ2 - ε, φ1 - ε ], [ λ2 - ε, φ2 + ε ] ], 30));\n }\n for (var i = lobes[1].length - 1; i >= 0; --i) {\n var lobe = lobes[1][i], λ0 = lobe[0][0] * 180 / π, φ0 = lobe[0][1] * 180 / π, φ1 = lobe[1][1] * 180 / π, λ2 = lobe[2][0] * 180 / π, φ2 = lobe[2][1] * 180 / π;\n coordinates.push(resample([ [ λ2 - ε, φ2 - ε ], [ λ2 - ε, φ1 + ε ], [ λ0 + ε, φ1 + ε ], [ λ0 + ε, φ0 - ε ] ], 30));\n }\n return {\n type: \"Polygon\",\n coordinates: [ d3.merge(coordinates) ]\n };\n }\n function resample(coordinates, m) {\n var i = -1, n = coordinates.length, p0 = coordinates[0], p1, dx, dy, resampled = [];\n while (++i < n) {\n p1 = coordinates[i];\n dx = (p1[0] - p0[0]) / m;\n dy = (p1[1] - p0[1]) / m;\n for (var j = 0; j < m; ++j) resampled.push([ p0[0] + j * dx, p0[1] + j * dy ]);\n p0 = p1;\n }\n resampled.push(p1);\n return resampled;\n }\n function pointEqual(a, b) {\n return Math.abs(a[0] - b[0]) < ε && Math.abs(a[1] - b[1]) < ε;\n }\n return projection;\n };\n function eckert4(λ, φ) {\n var k = (2 + halfπ) * Math.sin(φ);\n φ /= 2;\n for (var i = 0, δ = Infinity; i < 10 && Math.abs(δ) > ε; i++) {\n var cosφ = Math.cos(φ);\n φ -= δ = (φ + Math.sin(φ) * (cosφ + 2) - k) / (2 * cosφ * (1 + cosφ));\n }\n return [ 2 / Math.sqrt(π * (4 + π)) * λ * (1 + Math.cos(φ)), 2 * Math.sqrt(π / (4 + π)) * Math.sin(φ) ];\n }\n eckert4.invert = function(x, y) {\n var A = .5 * y * Math.sqrt((4 + π) / π), k = asin(A), c = Math.cos(k);\n return [ x / (2 / Math.sqrt(π * (4 + π)) * (1 + c)), asin((k + A * (c + 2)) / (2 + halfπ)) ];\n };\n (d3.geo.eckert4 = function() {\n return projection(eckert4);\n }).raw = eckert4;\n var hammerAzimuthalEqualArea = d3.geo.azimuthalEqualArea.raw;\n function hammer(A, B) {\n if (arguments.length < 2) B = A;\n if (B === 1) return hammerAzimuthalEqualArea;\n if (B === Infinity) return hammerQuarticAuthalic;\n function forward(λ, φ) {\n var coordinates = hammerAzimuthalEqualArea(λ / B, φ);\n coordinates[0] *= A;\n return coordinates;\n }\n forward.invert = function(x, y) {\n var coordinates = hammerAzimuthalEqualArea.invert(x / A, y);\n coordinates[0] *= B;\n return coordinates;\n };\n return forward;\n }\n function hammerProjection() {\n var B = 2, m = projectionMutator(hammer), p = m(B);\n p.coefficient = function(_) {\n if (!arguments.length) return B;\n return m(B = +_);\n };\n return p;\n }\n function hammerQuarticAuthalic(λ, φ) {\n return [ λ * Math.cos(φ) / Math.cos(φ /= 2), 2 * Math.sin(φ) ];\n }\n hammerQuarticAuthalic.invert = function(x, y) {\n var φ = 2 * asin(y / 2);\n return [ x * Math.cos(φ / 2) / Math.cos(φ), φ ];\n };\n (d3.geo.hammer = hammerProjection).raw = hammer;\n function kavrayskiy7(λ, φ) {\n return [ 3 * λ / (2 * π) * Math.sqrt(π * π / 3 - φ * φ), φ ];\n }\n kavrayskiy7.invert = function(x, y) {\n return [ 2 / 3 * π * x / Math.sqrt(π * π / 3 - y * y), y ];\n };\n (d3.geo.kavrayskiy7 = function() {\n return projection(kavrayskiy7);\n }).raw = kavrayskiy7;\n function miller(λ, φ) {\n return [ λ, 1.25 * Math.log(Math.tan(π / 4 + .4 * φ)) ];\n }\n miller.invert = function(x, y) {\n return [ x, 2.5 * Math.atan(Math.exp(.8 * y)) - .625 * π ];\n };\n (d3.geo.miller = function() {\n return projection(miller);\n }).raw = miller;\n function mollweideBromleyθ(Cp) {\n return function(θ) {\n var Cpsinθ = Cp * Math.sin(θ), i = 30, δ;\n do θ -= δ = (θ + Math.sin(θ) - Cpsinθ) / (1 + Math.cos(θ)); while (Math.abs(δ) > ε && --i > 0);\n return θ / 2;\n };\n }\n function mollweideBromley(Cx, Cy, Cp) {\n var θ = mollweideBromleyθ(Cp);\n function forward(λ, φ) {\n return [ Cx * λ * Math.cos(φ = θ(φ)), Cy * Math.sin(φ) ];\n }\n forward.invert = function(x, y) {\n var θ = asin(y / Cy);\n return [ x / (Cx * Math.cos(θ)), asin((2 * θ + Math.sin(2 * θ)) / Cp) ];\n };\n return forward;\n }\n var mollweideθ = mollweideBromleyθ(π), mollweide = mollweideBromley(Math.SQRT2 / halfπ, Math.SQRT2, π);\n (d3.geo.mollweide = function() {\n return projection(mollweide);\n }).raw = mollweide;\n function naturalEarth(λ, φ) {\n var φ2 = φ * φ, φ4 = φ2 * φ2;\n return [ λ * (.8707 - .131979 * φ2 + φ4 * (-.013791 + φ4 * (.003971 * φ2 - .001529 * φ4))), φ * (1.007226 + φ2 * (.015085 + φ4 * (-.044475 + .028874 * φ2 - .005916 * φ4))) ];\n }\n naturalEarth.invert = function(x, y) {\n var φ = y, i = 25, δ;\n do {\n var φ2 = φ * φ, φ4 = φ2 * φ2;\n φ -= δ = (φ * (1.007226 + φ2 * (.015085 + φ4 * (-.044475 + .028874 * φ2 - .005916 * φ4))) - y) / (1.007226 + φ2 * (.015085 * 3 + φ4 * (-.044475 * 7 + .028874 * 9 * φ2 - .005916 * 11 * φ4)));\n } while (Math.abs(δ) > ε && --i > 0);\n return [ x / (.8707 + (φ2 = φ * φ) * (-.131979 + φ2 * (-.013791 + φ2 * φ2 * φ2 * (.003971 - .001529 * φ2)))), φ ];\n };\n (d3.geo.naturalEarth = function() {\n return projection(naturalEarth);\n }).raw = naturalEarth;\n var robinsonConstants = [ [ .9986, -.062 ], [ 1, 0 ], [ .9986, .062 ], [ .9954, .124 ], [ .99, .186 ], [ .9822, .248 ], [ .973, .31 ], [ .96, .372 ], [ .9427, .434 ], [ .9216, .4958 ], [ .8962, .5571 ], [ .8679, .6176 ], [ .835, .6769 ], [ .7986, .7346 ], [ .7597, .7903 ], [ .7186, .8435 ], [ .6732, .8936 ], [ .6213, .9394 ], [ .5722, .9761 ], [ .5322, 1 ] ];\n robinsonConstants.forEach(function(d) {\n d[1] *= 1.0144;\n });\n function robinson(λ, φ) {\n var i = Math.min(18, Math.abs(φ) * 36 / π), i0 = Math.floor(i), di = i - i0, ax = (k = robinsonConstants[i0])[0], ay = k[1], bx = (k = robinsonConstants[++i0])[0], by = k[1], cx = (k = robinsonConstants[Math.min(19, ++i0)])[0], cy = k[1], k;\n return [ λ * (bx + di * (cx - ax) / 2 + di * di * (cx - 2 * bx + ax) / 2), (φ > 0 ? halfπ : -halfπ) * (by + di * (cy - ay) / 2 + di * di * (cy - 2 * by + ay) / 2) ];\n }\n robinson.invert = function(x, y) {\n var yy = y / halfπ, φ = yy * 90, i = Math.min(18, Math.abs(φ / 5)), i0 = Math.max(0, Math.floor(i));\n do {\n var ay = robinsonConstants[i0][1], by = robinsonConstants[i0 + 1][1], cy = robinsonConstants[Math.min(19, i0 + 2)][1], u = cy - ay, v = cy - 2 * by + ay, t = 2 * (Math.abs(yy) - by) / u, c = v / u, di = t * (1 - c * t * (1 - 2 * c * t));\n if (di >= 0 || i0 === 1) {\n φ = (y >= 0 ? 5 : -5) * (di + i);\n var j = 50, δ;\n do {\n i = Math.min(18, Math.abs(φ) / 5);\n i0 = Math.floor(i);\n di = i - i0;\n ay = robinsonConstants[i0][1];\n by = robinsonConstants[i0 + 1][1];\n cy = robinsonConstants[Math.min(19, i0 + 2)][1];\n φ -= (δ = (y >= 0 ? halfπ : -halfπ) * (by + di * (cy - ay) / 2 + di * di * (cy - 2 * by + ay) / 2) - y) * degrees;\n } while (Math.abs(δ) > ε2 && --j > 0);\n break;\n }\n } while (--i0 >= 0);\n var ax = robinsonConstants[i0][0], bx = robinsonConstants[i0 + 1][0], cx = robinsonConstants[Math.min(19, i0 + 2)][0];\n return [ x / (bx + di * (cx - ax) / 2 + di * di * (cx - 2 * bx + ax) / 2), φ * radians ];\n };\n (d3.geo.robinson = function() {\n return projection(robinson);\n }).raw = robinson;\n function sinusoidal(λ, φ) {\n return [ λ * Math.cos(φ), φ ];\n }\n sinusoidal.invert = function(x, y) {\n return [ x / Math.cos(y), y ];\n };\n (d3.geo.sinusoidal = function() {\n return projection(sinusoidal);\n }).raw = sinusoidal;\n function aitoff(λ, φ) {\n var cosφ = Math.cos(φ), sinciα = sinci(acos(cosφ * Math.cos(λ /= 2)));\n return [ 2 * cosφ * Math.sin(λ) * sinciα, Math.sin(φ) * sinciα ];\n }\n aitoff.invert = function(x, y) {\n if (x * x + 4 * y * y > π * π + ε) return;\n var λ = x, φ = y, i = 25;\n do {\n var sinλ = Math.sin(λ), sinλ_2 = Math.sin(λ / 2), cosλ_2 = Math.cos(λ / 2), sinφ = Math.sin(φ), cosφ = Math.cos(φ), sin_2φ = Math.sin(2 * φ), sin2φ = sinφ * sinφ, cos2φ = cosφ * cosφ, sin2λ_2 = sinλ_2 * sinλ_2, C = 1 - cos2φ * cosλ_2 * cosλ_2, E = C ? acos(cosφ * cosλ_2) * Math.sqrt(F = 1 / C) : F = 0, F, fx = 2 * E * cosφ * sinλ_2 - x, fy = E * sinφ - y, δxδλ = F * (cos2φ * sin2λ_2 + E * cosφ * cosλ_2 * sin2φ), δxδφ = F * (.5 * sinλ * sin_2φ - E * 2 * sinφ * sinλ_2), δyδλ = F * .25 * (sin_2φ * sinλ_2 - E * sinφ * cos2φ * sinλ), δyδφ = F * (sin2φ * cosλ_2 + E * sin2λ_2 * cosφ), denominator = δxδφ * δyδλ - δyδφ * δxδλ;\n if (!denominator) break;\n var δλ = (fy * δxδφ - fx * δyδφ) / denominator, δφ = (fx * δyδλ - fy * δxδλ) / denominator;\n λ -= δλ, φ -= δφ;\n } while ((Math.abs(δλ) > ε || Math.abs(δφ) > ε) && --i > 0);\n return [ λ, φ ];\n };\n (d3.geo.aitoff = function() {\n return projection(aitoff);\n }).raw = aitoff;\n function winkel3(λ, φ) {\n var coordinates = aitoff(λ, φ);\n return [ (coordinates[0] + λ / halfπ) / 2, (coordinates[1] + φ) / 2 ];\n }\n winkel3.invert = function(x, y) {\n var λ = x, φ = y, i = 25;\n do {\n var cosφ = Math.cos(φ), sinφ = Math.sin(φ), sin_2φ = Math.sin(2 * φ), sin2φ = sinφ * sinφ, cos2φ = cosφ * cosφ, sinλ = Math.sin(λ), cosλ_2 = Math.cos(λ / 2), sinλ_2 = Math.sin(λ / 2), sin2λ_2 = sinλ_2 * sinλ_2, C = 1 - cos2φ * cosλ_2 * cosλ_2, E = C ? acos(cosφ * cosλ_2) * Math.sqrt(F = 1 / C) : F = 0, F, fx = .5 * (2 * E * cosφ * sinλ_2 + λ / halfπ) - x, fy = .5 * (E * sinφ + φ) - y, δxδλ = .5 * F * (cos2φ * sin2λ_2 + E * cosφ * cosλ_2 * sin2φ) + .5 / halfπ, δxδφ = F * (sinλ * sin_2φ / 4 - E * sinφ * sinλ_2), δyδλ = .125 * F * (sin_2φ * sinλ_2 - E * sinφ * cos2φ * sinλ), δyδφ = .5 * F * (sin2φ * cosλ_2 + E * sin2λ_2 * cosφ) + .5, denominator = δxδφ * δyδλ - δyδφ * δxδλ, δλ = (fy * δxδφ - fx * δyδφ) / denominator, δφ = (fx * δyδλ - fy * δxδλ) / denominator;\n λ -= δλ, φ -= δφ;\n } while ((Math.abs(δλ) > ε || Math.abs(δφ) > ε) && --i > 0);\n return [ λ, φ ];\n };\n (d3.geo.winkel3 = function() {\n return projection(winkel3);\n }).raw = winkel3;\n}\n\nmodule.exports = addProjectionsToD3;\n\n},{}],812:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Lib = _dereq_('../../lib');\nvar Registry = _dereq_('../../registry');\n\nvar radians = Math.PI / 180;\nvar degrees = 180 / Math.PI;\nvar zoomstartStyle = {cursor: 'pointer'};\nvar zoomendStyle = {cursor: 'auto'};\n\nfunction createGeoZoom(geo, geoLayout) {\n var projection = geo.projection;\n var zoomConstructor;\n\n if(geoLayout._isScoped) {\n zoomConstructor = zoomScoped;\n } else if(geoLayout._isClipped) {\n zoomConstructor = zoomClipped;\n } else {\n zoomConstructor = zoomNonClipped;\n }\n\n // TODO add a conic-specific zoom\n\n return zoomConstructor(geo, projection);\n}\n\nmodule.exports = createGeoZoom;\n\n// common to all zoom types\nfunction initZoom(geo, projection) {\n return d3.behavior.zoom()\n .translate(projection.translate())\n .scale(projection.scale());\n}\n\n// sync zoom updates with user & full layout\nfunction sync(geo, projection, cb) {\n var id = geo.id;\n var gd = geo.graphDiv;\n var layout = gd.layout;\n var userOpts = layout[id];\n var fullLayout = gd._fullLayout;\n var fullOpts = fullLayout[id];\n\n var preGUI = {};\n var eventData = {};\n\n function set(propStr, val) {\n preGUI[id + '.' + propStr] = Lib.nestedProperty(userOpts, propStr).get();\n Registry.call('_storeDirectGUIEdit', layout, fullLayout._preGUI, preGUI);\n\n var fullNp = Lib.nestedProperty(fullOpts, propStr);\n if(fullNp.get() !== val) {\n fullNp.set(val);\n Lib.nestedProperty(userOpts, propStr).set(val);\n eventData[id + '.' + propStr] = val;\n }\n }\n\n cb(set);\n set('projection.scale', projection.scale() / geo.fitScale);\n set('fitbounds', false);\n gd.emit('plotly_relayout', eventData);\n}\n\n// zoom for scoped projections\nfunction zoomScoped(geo, projection) {\n var zoom = initZoom(geo, projection);\n\n function handleZoomstart() {\n d3.select(this).style(zoomstartStyle);\n }\n\n function handleZoom() {\n projection\n .scale(d3.event.scale)\n .translate(d3.event.translate);\n geo.render();\n\n var center = projection.invert(geo.midPt);\n geo.graphDiv.emit('plotly_relayouting', {\n 'geo.projection.scale': projection.scale() / geo.fitScale,\n 'geo.center.lon': center[0],\n 'geo.center.lat': center[1]\n });\n }\n\n function syncCb(set) {\n var center = projection.invert(geo.midPt);\n\n set('center.lon', center[0]);\n set('center.lat', center[1]);\n }\n\n function handleZoomend() {\n d3.select(this).style(zoomendStyle);\n sync(geo, projection, syncCb);\n }\n\n zoom\n .on('zoomstart', handleZoomstart)\n .on('zoom', handleZoom)\n .on('zoomend', handleZoomend);\n\n return zoom;\n}\n\n// zoom for non-clipped projections\nfunction zoomNonClipped(geo, projection) {\n var zoom = initZoom(geo, projection);\n\n var INSIDETOLORANCEPXS = 2;\n\n var mouse0, rotate0, translate0, lastRotate, zoomPoint,\n mouse1, rotate1, point1, didZoom;\n\n function position(x) { return projection.invert(x); }\n\n function outside(x) {\n var pos = position(x);\n if(!pos) return true;\n\n var pt = projection(pos);\n return (\n Math.abs(pt[0] - x[0]) > INSIDETOLORANCEPXS ||\n Math.abs(pt[1] - x[1]) > INSIDETOLORANCEPXS\n );\n }\n\n function handleZoomstart() {\n d3.select(this).style(zoomstartStyle);\n\n mouse0 = d3.mouse(this);\n rotate0 = projection.rotate();\n translate0 = projection.translate();\n lastRotate = rotate0;\n zoomPoint = position(mouse0);\n }\n\n function handleZoom() {\n mouse1 = d3.mouse(this);\n\n if(outside(mouse0)) {\n zoom.scale(projection.scale());\n zoom.translate(projection.translate());\n return;\n }\n\n projection.scale(d3.event.scale);\n projection.translate([translate0[0], d3.event.translate[1]]);\n\n if(!zoomPoint) {\n mouse0 = mouse1;\n zoomPoint = position(mouse0);\n } else if(position(mouse1)) {\n point1 = position(mouse1);\n rotate1 = [lastRotate[0] + (point1[0] - zoomPoint[0]), rotate0[1], rotate0[2]];\n projection.rotate(rotate1);\n lastRotate = rotate1;\n }\n\n didZoom = true;\n geo.render();\n\n var rotate = projection.rotate();\n var center = projection.invert(geo.midPt);\n geo.graphDiv.emit('plotly_relayouting', {\n 'geo.projection.scale': projection.scale() / geo.fitScale,\n 'geo.center.lon': center[0],\n 'geo.center.lat': center[1],\n 'geo.projection.rotation.lon': -rotate[0]\n });\n }\n\n function handleZoomend() {\n d3.select(this).style(zoomendStyle);\n if(didZoom) sync(geo, projection, syncCb);\n }\n\n function syncCb(set) {\n var rotate = projection.rotate();\n var center = projection.invert(geo.midPt);\n\n set('projection.rotation.lon', -rotate[0]);\n set('center.lon', center[0]);\n set('center.lat', center[1]);\n }\n\n zoom\n .on('zoomstart', handleZoomstart)\n .on('zoom', handleZoom)\n .on('zoomend', handleZoomend);\n\n return zoom;\n}\n\n// zoom for clipped projections\n// inspired by https://www.jasondavies.com/maps/d3.geo.zoom.js\nfunction zoomClipped(geo, projection) {\n var view = {r: projection.rotate(), k: projection.scale()};\n var zoom = initZoom(geo, projection);\n var event = d3eventDispatch(zoom, 'zoomstart', 'zoom', 'zoomend');\n var zooming = 0;\n var zoomOn = zoom.on;\n\n var zoomPoint;\n\n zoom.on('zoomstart', function() {\n d3.select(this).style(zoomstartStyle);\n\n var mouse0 = d3.mouse(this);\n var rotate0 = projection.rotate();\n var lastRotate = rotate0;\n var translate0 = projection.translate();\n var q = quaternionFromEuler(rotate0);\n\n zoomPoint = position(projection, mouse0);\n\n zoomOn.call(zoom, 'zoom', function() {\n var mouse1 = d3.mouse(this);\n\n projection.scale(view.k = d3.event.scale);\n\n if(!zoomPoint) {\n // if no zoomPoint, the mouse wasn't over the actual geography yet\n // maybe this point is the start... we'll find out next time!\n mouse0 = mouse1;\n zoomPoint = position(projection, mouse0);\n } else if(position(projection, mouse1)) {\n // check if the point is on the map\n // if not, don't do anything new but scale\n // if it is, then we can assume between will exist below\n // so we don't need the 'bank' function, whatever that is.\n\n // go back to original projection temporarily\n // except for scale... that's kind of independent?\n projection\n .rotate(rotate0)\n .translate(translate0);\n\n // calculate the new params\n var point1 = position(projection, mouse1);\n var between = rotateBetween(zoomPoint, point1);\n var newEuler = eulerFromQuaternion(multiply(q, between));\n var rotateAngles = view.r = unRoll(newEuler, zoomPoint, lastRotate);\n\n if(!isFinite(rotateAngles[0]) || !isFinite(rotateAngles[1]) ||\n !isFinite(rotateAngles[2])) {\n rotateAngles = lastRotate;\n }\n\n // update the projection\n projection.rotate(rotateAngles);\n lastRotate = rotateAngles;\n }\n\n zoomed(event.of(this, arguments));\n });\n\n zoomstarted(event.of(this, arguments));\n })\n .on('zoomend', function() {\n d3.select(this).style(zoomendStyle);\n zoomOn.call(zoom, 'zoom', null);\n zoomended(event.of(this, arguments));\n sync(geo, projection, syncCb);\n })\n .on('zoom.redraw', function() {\n geo.render();\n\n var _rotate = projection.rotate();\n geo.graphDiv.emit('plotly_relayouting', {\n 'geo.projection.scale': projection.scale() / geo.fitScale,\n 'geo.projection.rotation.lon': -_rotate[0],\n 'geo.projection.rotation.lat': -_rotate[1]\n });\n });\n\n function zoomstarted(dispatch) {\n if(!zooming++) dispatch({type: 'zoomstart'});\n }\n\n function zoomed(dispatch) {\n dispatch({type: 'zoom'});\n }\n\n function zoomended(dispatch) {\n if(!--zooming) dispatch({type: 'zoomend'});\n }\n\n function syncCb(set) {\n var _rotate = projection.rotate();\n set('projection.rotation.lon', -_rotate[0]);\n set('projection.rotation.lat', -_rotate[1]);\n }\n\n return d3.rebind(zoom, event, 'on');\n}\n\n// -- helper functions for zoomClipped\n\nfunction position(projection, point) {\n var spherical = projection.invert(point);\n return spherical && isFinite(spherical[0]) && isFinite(spherical[1]) && cartesian(spherical);\n}\n\nfunction quaternionFromEuler(euler) {\n var lambda = 0.5 * euler[0] * radians;\n var phi = 0.5 * euler[1] * radians;\n var gamma = 0.5 * euler[2] * radians;\n var sinLambda = Math.sin(lambda);\n var cosLambda = Math.cos(lambda);\n var sinPhi = Math.sin(phi);\n var cosPhi = Math.cos(phi);\n var sinGamma = Math.sin(gamma);\n var cosGamma = Math.cos(gamma);\n return [\n cosLambda * cosPhi * cosGamma + sinLambda * sinPhi * sinGamma,\n sinLambda * cosPhi * cosGamma - cosLambda * sinPhi * sinGamma,\n cosLambda * sinPhi * cosGamma + sinLambda * cosPhi * sinGamma,\n cosLambda * cosPhi * sinGamma - sinLambda * sinPhi * cosGamma\n ];\n}\n\nfunction multiply(a, b) {\n var a0 = a[0];\n var a1 = a[1];\n var a2 = a[2];\n var a3 = a[3];\n var b0 = b[0];\n var b1 = b[1];\n var b2 = b[2];\n var b3 = b[3];\n return [\n a0 * b0 - a1 * b1 - a2 * b2 - a3 * b3,\n a0 * b1 + a1 * b0 + a2 * b3 - a3 * b2,\n a0 * b2 - a1 * b3 + a2 * b0 + a3 * b1,\n a0 * b3 + a1 * b2 - a2 * b1 + a3 * b0\n ];\n}\n\nfunction rotateBetween(a, b) {\n if(!a || !b) return;\n var axis = cross(a, b);\n var norm = Math.sqrt(dot(axis, axis));\n var halfgamma = 0.5 * Math.acos(Math.max(-1, Math.min(1, dot(a, b))));\n var k = Math.sin(halfgamma) / norm;\n return norm && [Math.cos(halfgamma), axis[2] * k, -axis[1] * k, axis[0] * k];\n}\n\n// input:\n// rotateAngles: a calculated set of Euler angles\n// pt: a point (cartesian in 3-space) to keep fixed\n// roll0: an initial roll, to be preserved\n// output:\n// a set of Euler angles that preserve the projection of pt\n// but set roll (output[2]) equal to roll0\n// note that this doesn't depend on the particular projection,\n// just on the rotation angles\nfunction unRoll(rotateAngles, pt, lastRotate) {\n // calculate the fixed point transformed by these Euler angles\n // but with the desired roll undone\n var ptRotated = rotateCartesian(pt, 2, rotateAngles[0]);\n ptRotated = rotateCartesian(ptRotated, 1, rotateAngles[1]);\n ptRotated = rotateCartesian(ptRotated, 0, rotateAngles[2] - lastRotate[2]);\n\n var x = pt[0];\n var y = pt[1];\n var z = pt[2];\n var f = ptRotated[0];\n var g = ptRotated[1];\n var h = ptRotated[2];\n\n // the following essentially solves:\n // ptRotated = rotateCartesian(rotateCartesian(pt, 2, newYaw), 1, newPitch)\n // for newYaw and newPitch, as best it can\n var theta = Math.atan2(y, x) * degrees;\n var a = Math.sqrt(x * x + y * y);\n var b;\n var newYaw1;\n\n if(Math.abs(g) > a) {\n newYaw1 = (g > 0 ? 90 : -90) - theta;\n b = 0;\n } else {\n newYaw1 = Math.asin(g / a) * degrees - theta;\n b = Math.sqrt(a * a - g * g);\n }\n\n var newYaw2 = 180 - newYaw1 - 2 * theta;\n var newPitch1 = (Math.atan2(h, f) - Math.atan2(z, b)) * degrees;\n var newPitch2 = (Math.atan2(h, f) - Math.atan2(z, -b)) * degrees;\n\n // which is closest to lastRotate[0,1]: newYaw/Pitch or newYaw2/Pitch2?\n var dist1 = angleDistance(lastRotate[0], lastRotate[1], newYaw1, newPitch1);\n var dist2 = angleDistance(lastRotate[0], lastRotate[1], newYaw2, newPitch2);\n\n if(dist1 <= dist2) return [newYaw1, newPitch1, lastRotate[2]];\n else return [newYaw2, newPitch2, lastRotate[2]];\n}\n\nfunction angleDistance(yaw0, pitch0, yaw1, pitch1) {\n var dYaw = angleMod(yaw1 - yaw0);\n var dPitch = angleMod(pitch1 - pitch0);\n return Math.sqrt(dYaw * dYaw + dPitch * dPitch);\n}\n\n// reduce an angle in degrees to [-180,180]\nfunction angleMod(angle) {\n return (angle % 360 + 540) % 360 - 180;\n}\n\n// rotate a cartesian vector\n// axis is 0 (x), 1 (y), or 2 (z)\n// angle is in degrees\nfunction rotateCartesian(vector, axis, angle) {\n var angleRads = angle * radians;\n var vectorOut = vector.slice();\n var ax1 = (axis === 0) ? 1 : 0;\n var ax2 = (axis === 2) ? 1 : 2;\n var cosa = Math.cos(angleRads);\n var sina = Math.sin(angleRads);\n\n vectorOut[ax1] = vector[ax1] * cosa - vector[ax2] * sina;\n vectorOut[ax2] = vector[ax2] * cosa + vector[ax1] * sina;\n\n return vectorOut;\n}\nfunction eulerFromQuaternion(q) {\n return [\n Math.atan2(2 * (q[0] * q[1] + q[2] * q[3]), 1 - 2 * (q[1] * q[1] + q[2] * q[2])) * degrees,\n Math.asin(Math.max(-1, Math.min(1, 2 * (q[0] * q[2] - q[3] * q[1])))) * degrees,\n Math.atan2(2 * (q[0] * q[3] + q[1] * q[2]), 1 - 2 * (q[2] * q[2] + q[3] * q[3])) * degrees\n ];\n}\n\nfunction cartesian(spherical) {\n var lambda = spherical[0] * radians;\n var phi = spherical[1] * radians;\n var cosPhi = Math.cos(phi);\n return [\n cosPhi * Math.cos(lambda),\n cosPhi * Math.sin(lambda),\n Math.sin(phi)\n ];\n}\n\nfunction dot(a, b) {\n var s = 0;\n for(var i = 0, n = a.length; i < n; ++i) s += a[i] * b[i];\n return s;\n}\n\nfunction cross(a, b) {\n return [\n a[1] * b[2] - a[2] * b[1],\n a[2] * b[0] - a[0] * b[2],\n a[0] * b[1] - a[1] * b[0]\n ];\n}\n\n// Like d3.dispatch, but for custom events abstracting native UI events. These\n// events have a target component (such as a brush), a target element (such as\n// the svg:g element containing the brush) and the standard arguments `d` (the\n// target element's data) and `i` (the selection index of the target element).\nfunction d3eventDispatch(target) {\n var i = 0;\n var n = arguments.length;\n var argumentz = [];\n\n while(++i < n) argumentz.push(arguments[i]);\n\n var dispatch = d3.dispatch.apply(null, argumentz);\n\n // Creates a dispatch context for the specified `thiz` (typically, the target\n // DOM element that received the source event) and `argumentz` (typically, the\n // data `d` and index `i` of the target element). The returned function can be\n // used to dispatch an event to any registered listeners; the function takes a\n // single argument as input, being the event to dispatch. The event must have\n // a \"type\" attribute which corresponds to a type registered in the\n // constructor. This context will automatically populate the \"sourceEvent\" and\n // \"target\" attributes of the event, as well as setting the `d3.event` global\n // for the duration of the notification.\n dispatch.of = function(thiz, argumentz) {\n return function(e1) {\n var e0;\n try {\n e0 = e1.sourceEvent = d3.event;\n e1.target = target;\n d3.event = e1;\n dispatch[e1.type].apply(thiz, argumentz);\n } finally {\n d3.event = e0;\n }\n };\n };\n\n return dispatch;\n}\n\n},{\"../../lib\":728,\"../../registry\":859,\"d3\":164}],813:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../registry');\nvar SUBPLOT_PATTERN = _dereq_('./cartesian/constants').SUBPLOT_PATTERN;\n\n/**\n * Get calcdata trace(s) associated with a given subplot\n *\n * @param {array} calcData: as in gd.calcdata\n * @param {string} type: subplot type\n * @param {string} subplotId: subplot id to look for\n *\n * @return {array} array of calcdata traces\n */\nexports.getSubplotCalcData = function(calcData, type, subplotId) {\n var basePlotModule = Registry.subplotsRegistry[type];\n if(!basePlotModule) return [];\n\n var attr = basePlotModule.attr;\n var subplotCalcData = [];\n\n for(var i = 0; i < calcData.length; i++) {\n var calcTrace = calcData[i];\n var trace = calcTrace[0].trace;\n\n if(trace[attr] === subplotId) subplotCalcData.push(calcTrace);\n }\n\n return subplotCalcData;\n};\n/**\n * Get calcdata trace(s) that can be plotted with a given module\n * NOTE: this isn't necessarily just exactly matching trace type,\n * if multiple trace types use the same plotting routine, they will be\n * collected here.\n * In order to not plot the same thing multiple times, we return two arrays,\n * the calcdata we *will* plot with this module, and the ones we *won't*\n *\n * @param {array} calcdata: as in gd.calcdata\n * @param {object|string|fn} arg1:\n * the plotting module, or its name, or its plot method\n *\n * @return {array[array]} [foundCalcdata, remainingCalcdata]\n */\nexports.getModuleCalcData = function(calcdata, arg1) {\n var moduleCalcData = [];\n var remainingCalcData = [];\n\n var plotMethod;\n if(typeof arg1 === 'string') {\n plotMethod = Registry.getModule(arg1).plot;\n } else if(typeof arg1 === 'function') {\n plotMethod = arg1;\n } else {\n plotMethod = arg1.plot;\n }\n if(!plotMethod) {\n return [moduleCalcData, calcdata];\n }\n\n for(var i = 0; i < calcdata.length; i++) {\n var cd = calcdata[i];\n var trace = cd[0].trace;\n // N.B.\n // - 'legendonly' traces do not make it past here\n // - skip over 'visible' traces that got trimmed completely during calc transforms\n if(trace.visible !== true || trace._length === 0) continue;\n\n // group calcdata trace not by 'module' (as the name of this function\n // would suggest), but by 'module plot method' so that if some traces\n // share the same module plot method (e.g. bar and histogram), we\n // only call it one!\n if(trace._module.plot === plotMethod) {\n moduleCalcData.push(cd);\n } else {\n remainingCalcData.push(cd);\n }\n }\n\n return [moduleCalcData, remainingCalcData];\n};\n\n/**\n * Get the data trace(s) associated with a given subplot.\n *\n * @param {array} data plotly full data array.\n * @param {string} type subplot type to look for.\n * @param {string} subplotId subplot id to look for.\n *\n * @return {array} list of trace objects.\n *\n */\nexports.getSubplotData = function getSubplotData(data, type, subplotId) {\n if(!Registry.subplotsRegistry[type]) return [];\n\n var attr = Registry.subplotsRegistry[type].attr;\n var subplotData = [];\n var trace, subplotX, subplotY;\n\n if(type === 'gl2d') {\n var spmatch = subplotId.match(SUBPLOT_PATTERN);\n subplotX = 'x' + spmatch[1];\n subplotY = 'y' + spmatch[2];\n }\n\n for(var i = 0; i < data.length; i++) {\n trace = data[i];\n\n if(type === 'gl2d' && Registry.traceIs(trace, 'gl2d')) {\n if(trace[attr[0]] === subplotX && trace[attr[1]] === subplotY) {\n subplotData.push(trace);\n }\n } else {\n if(trace[attr] === subplotId) subplotData.push(trace);\n }\n }\n\n return subplotData;\n};\n\n},{\"../registry\":859,\"./cartesian/constants\":782}],814:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar mouseChange = _dereq_('mouse-change');\nvar mouseWheel = _dereq_('mouse-wheel');\nvar mouseOffset = _dereq_('mouse-event-offset');\nvar cartesianConstants = _dereq_('../cartesian/constants');\nvar hasPassive = _dereq_('has-passive-events');\n\nmodule.exports = createCamera;\n\nfunction Camera2D(element, plot) {\n this.element = element;\n this.plot = plot;\n this.mouseListener = null;\n this.wheelListener = null;\n this.lastInputTime = Date.now();\n this.lastPos = [0, 0];\n this.boxEnabled = false;\n this.boxInited = false;\n this.boxStart = [0, 0];\n this.boxEnd = [0, 0];\n this.dragStart = [0, 0];\n}\n\n\nfunction createCamera(scene) {\n var element = scene.mouseContainer;\n var plot = scene.glplot;\n var result = new Camera2D(element, plot);\n\n function unSetAutoRange() {\n scene.xaxis.autorange = false;\n scene.yaxis.autorange = false;\n }\n\n function getSubplotConstraint() {\n // note: this assumes we only have one x and one y axis on this subplot\n // when this constraint is lifted this block won't make sense\n var constraints = scene.graphDiv._fullLayout._axisConstraintGroups;\n var xaId = scene.xaxis._id;\n var yaId = scene.yaxis._id;\n for(var i = 0; i < constraints.length; i++) {\n if(constraints[i][xaId] !== -1) {\n if(constraints[i][yaId] !== -1) return true;\n break;\n }\n }\n return false;\n }\n\n result.mouseListener = mouseChange(element, handleInteraction);\n\n // enable simple touch interactions\n element.addEventListener('touchstart', function(ev) {\n var xy = mouseOffset(ev.changedTouches[0], element);\n handleInteraction(0, xy[0], xy[1]);\n handleInteraction(1, xy[0], xy[1]);\n\n ev.preventDefault();\n }, hasPassive ? {passive: false} : false);\n element.addEventListener('touchmove', function(ev) {\n ev.preventDefault();\n var xy = mouseOffset(ev.changedTouches[0], element);\n handleInteraction(1, xy[0], xy[1]);\n\n ev.preventDefault();\n }, hasPassive ? {passive: false} : false);\n element.addEventListener('touchend', function(ev) {\n handleInteraction(0, result.lastPos[0], result.lastPos[1]);\n\n ev.preventDefault();\n }, hasPassive ? {passive: false} : false);\n\n function handleInteraction(buttons, x, y) {\n var dataBox = scene.calcDataBox();\n var viewBox = plot.viewBox;\n\n var lastX = result.lastPos[0];\n var lastY = result.lastPos[1];\n\n var MINDRAG = cartesianConstants.MINDRAG * plot.pixelRatio;\n var MINZOOM = cartesianConstants.MINZOOM * plot.pixelRatio;\n\n var dx, dy;\n\n x *= plot.pixelRatio;\n y *= plot.pixelRatio;\n\n // mouseChange gives y about top; convert to about bottom\n y = (viewBox[3] - viewBox[1]) - y;\n\n function updateRange(i0, start, end) {\n var range0 = Math.min(start, end);\n var range1 = Math.max(start, end);\n\n if(range0 !== range1) {\n dataBox[i0] = range0;\n dataBox[i0 + 2] = range1;\n result.dataBox = dataBox;\n scene.setRanges(dataBox);\n } else {\n scene.selectBox.selectBox = [0, 0, 1, 1];\n scene.glplot.setDirty();\n }\n }\n\n switch(scene.fullLayout.dragmode) {\n case 'zoom':\n if(buttons) {\n var dataX = x /\n (viewBox[2] - viewBox[0]) * (dataBox[2] - dataBox[0]) +\n dataBox[0];\n var dataY = y /\n (viewBox[3] - viewBox[1]) * (dataBox[3] - dataBox[1]) +\n dataBox[1];\n\n if(!result.boxInited) {\n result.boxStart[0] = dataX;\n result.boxStart[1] = dataY;\n result.dragStart[0] = x;\n result.dragStart[1] = y;\n }\n\n result.boxEnd[0] = dataX;\n result.boxEnd[1] = dataY;\n\n // we need to mark the box as initialized right away\n // so that we can tell the start and end points apart\n result.boxInited = true;\n\n // but don't actually enable the box until the cursor moves\n if(!result.boxEnabled && (\n result.boxStart[0] !== result.boxEnd[0] ||\n result.boxStart[1] !== result.boxEnd[1])\n ) {\n result.boxEnabled = true;\n }\n\n // constrain aspect ratio if the axes require it\n var smallDx = Math.abs(result.dragStart[0] - x) < MINZOOM;\n var smallDy = Math.abs(result.dragStart[1] - y) < MINZOOM;\n if(getSubplotConstraint() && !(smallDx && smallDy)) {\n dx = result.boxEnd[0] - result.boxStart[0];\n dy = result.boxEnd[1] - result.boxStart[1];\n var dydx = (dataBox[3] - dataBox[1]) / (dataBox[2] - dataBox[0]);\n\n if(Math.abs(dx * dydx) > Math.abs(dy)) {\n result.boxEnd[1] = result.boxStart[1] +\n Math.abs(dx) * dydx * (dy >= 0 ? 1 : -1);\n\n // gl-select-box clips to the plot area bounds,\n // which breaks the axis constraint, so don't allow\n // this box to go out of bounds\n if(result.boxEnd[1] < dataBox[1]) {\n result.boxEnd[1] = dataBox[1];\n result.boxEnd[0] = result.boxStart[0] +\n (dataBox[1] - result.boxStart[1]) / Math.abs(dydx);\n } else if(result.boxEnd[1] > dataBox[3]) {\n result.boxEnd[1] = dataBox[3];\n result.boxEnd[0] = result.boxStart[0] +\n (dataBox[3] - result.boxStart[1]) / Math.abs(dydx);\n }\n } else {\n result.boxEnd[0] = result.boxStart[0] +\n Math.abs(dy) / dydx * (dx >= 0 ? 1 : -1);\n\n if(result.boxEnd[0] < dataBox[0]) {\n result.boxEnd[0] = dataBox[0];\n result.boxEnd[1] = result.boxStart[1] +\n (dataBox[0] - result.boxStart[0]) * Math.abs(dydx);\n } else if(result.boxEnd[0] > dataBox[2]) {\n result.boxEnd[0] = dataBox[2];\n result.boxEnd[1] = result.boxStart[1] +\n (dataBox[2] - result.boxStart[0]) * Math.abs(dydx);\n }\n }\n } else {\n // otherwise clamp small changes to the origin so we get 1D zoom\n\n if(smallDx) result.boxEnd[0] = result.boxStart[0];\n if(smallDy) result.boxEnd[1] = result.boxStart[1];\n }\n } else if(result.boxEnabled) {\n dx = result.boxStart[0] !== result.boxEnd[0];\n dy = result.boxStart[1] !== result.boxEnd[1];\n if(dx || dy) {\n if(dx) {\n updateRange(0, result.boxStart[0], result.boxEnd[0]);\n scene.xaxis.autorange = false;\n }\n if(dy) {\n updateRange(1, result.boxStart[1], result.boxEnd[1]);\n scene.yaxis.autorange = false;\n }\n scene.relayoutCallback();\n } else {\n scene.glplot.setDirty();\n }\n result.boxEnabled = false;\n result.boxInited = false;\n } else if(result.boxInited) {\n // if box was inited but button released then - reset the box\n\n result.boxInited = false;\n }\n break;\n\n case 'pan':\n result.boxEnabled = false;\n result.boxInited = false;\n\n if(buttons) {\n if(!result.panning) {\n result.dragStart[0] = x;\n result.dragStart[1] = y;\n }\n\n if(Math.abs(result.dragStart[0] - x) < MINDRAG) x = result.dragStart[0];\n if(Math.abs(result.dragStart[1] - y) < MINDRAG) y = result.dragStart[1];\n\n dx = (lastX - x) * (dataBox[2] - dataBox[0]) /\n (plot.viewBox[2] - plot.viewBox[0]);\n dy = (lastY - y) * (dataBox[3] - dataBox[1]) /\n (plot.viewBox[3] - plot.viewBox[1]);\n\n dataBox[0] += dx;\n dataBox[2] += dx;\n dataBox[1] += dy;\n dataBox[3] += dy;\n\n scene.setRanges(dataBox);\n\n result.panning = true;\n result.lastInputTime = Date.now();\n unSetAutoRange();\n scene.cameraChanged();\n scene.handleAnnotations();\n } else if(result.panning) {\n result.panning = false;\n scene.relayoutCallback();\n }\n break;\n }\n\n result.lastPos[0] = x;\n result.lastPos[1] = y;\n }\n\n result.wheelListener = mouseWheel(element, function(dx, dy) {\n if(!scene.scrollZoom) return false;\n\n var dataBox = scene.calcDataBox();\n var viewBox = plot.viewBox;\n\n var lastX = result.lastPos[0];\n var lastY = result.lastPos[1];\n\n var scale = Math.exp(5.0 * dy / (viewBox[3] - viewBox[1]));\n\n var cx = lastX /\n (viewBox[2] - viewBox[0]) * (dataBox[2] - dataBox[0]) +\n dataBox[0];\n var cy = lastY /\n (viewBox[3] - viewBox[1]) * (dataBox[3] - dataBox[1]) +\n dataBox[1];\n\n dataBox[0] = (dataBox[0] - cx) * scale + cx;\n dataBox[2] = (dataBox[2] - cx) * scale + cx;\n dataBox[1] = (dataBox[1] - cy) * scale + cy;\n dataBox[3] = (dataBox[3] - cy) * scale + cy;\n\n scene.setRanges(dataBox);\n\n result.lastInputTime = Date.now();\n unSetAutoRange();\n scene.cameraChanged();\n scene.handleAnnotations();\n scene.relayoutCallback();\n\n return true;\n }, true);\n\n return result;\n}\n\n},{\"../cartesian/constants\":782,\"has-passive-events\":410,\"mouse-change\":436,\"mouse-event-offset\":437,\"mouse-wheel\":439}],815:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Axes = _dereq_('../cartesian/axes');\n\nvar str2RGBArray = _dereq_('../../lib/str2rgbarray');\n\nfunction Axes2DOptions(scene) {\n this.scene = scene;\n this.gl = scene.gl;\n this.pixelRatio = scene.pixelRatio;\n\n this.screenBox = [0, 0, 1, 1];\n this.viewBox = [0, 0, 1, 1];\n this.dataBox = [-1, -1, 1, 1];\n\n this.borderLineEnable = [false, false, false, false];\n this.borderLineWidth = [1, 1, 1, 1];\n this.borderLineColor = [\n [0, 0, 0, 1],\n [0, 0, 0, 1],\n [0, 0, 0, 1],\n [0, 0, 0, 1]\n ];\n\n this.ticks = [[], []];\n this.tickEnable = [true, true, false, false];\n this.tickPad = [15, 15, 15, 15];\n this.tickAngle = [0, 0, 0, 0];\n this.tickColor = [\n [0, 0, 0, 1],\n [0, 0, 0, 1],\n [0, 0, 0, 1],\n [0, 0, 0, 1]\n ];\n this.tickMarkLength = [0, 0, 0, 0];\n this.tickMarkWidth = [0, 0, 0, 0];\n this.tickMarkColor = [\n [0, 0, 0, 1],\n [0, 0, 0, 1],\n [0, 0, 0, 1],\n [0, 0, 0, 1]\n ];\n\n this.labels = ['x', 'y'];\n this.labelEnable = [true, true, false, false];\n this.labelAngle = [0, Math.PI / 2, 0, 3.0 * Math.PI / 2];\n this.labelPad = [15, 15, 15, 15];\n this.labelSize = [12, 12];\n this.labelFont = ['sans-serif', 'sans-serif'];\n this.labelColor = [\n [0, 0, 0, 1],\n [0, 0, 0, 1],\n [0, 0, 0, 1],\n [0, 0, 0, 1]\n ];\n\n this.title = '';\n this.titleEnable = true;\n this.titleCenter = [0, 0, 0, 0];\n this.titleAngle = 0;\n this.titleColor = [0, 0, 0, 1];\n this.titleFont = 'sans-serif';\n this.titleSize = 18;\n\n this.gridLineEnable = [true, true];\n this.gridLineColor = [\n [0, 0, 0, 0.5],\n [0, 0, 0, 0.5]\n ];\n this.gridLineWidth = [1, 1];\n\n this.zeroLineEnable = [true, true];\n this.zeroLineWidth = [1, 1];\n this.zeroLineColor = [\n [0, 0, 0, 1],\n [0, 0, 0, 1]\n ];\n\n this.borderColor = [0, 0, 0, 0];\n this.backgroundColor = [0, 0, 0, 0];\n\n this.static = this.scene.staticPlot;\n}\n\nvar proto = Axes2DOptions.prototype;\n\nvar AXES = ['xaxis', 'yaxis'];\n\nproto.merge = function(options) {\n // titles are rendered in SVG\n this.titleEnable = false;\n this.backgroundColor = str2RGBArray(options.plot_bgcolor);\n\n var axisName, ax, axTitle, axMirror;\n var hasAxisInDfltPos, hasAxisInAltrPos, hasSharedAxis, mirrorLines, mirrorTicks;\n var i, j;\n\n for(i = 0; i < 2; ++i) {\n axisName = AXES[i];\n var axisLetter = axisName.charAt(0);\n\n // get options relevant to this subplot,\n // '_name' is e.g. xaxis, xaxis2, yaxis, yaxis4 ...\n ax = options[this.scene[axisName]._name];\n\n axTitle = ax.title.text === this.scene.fullLayout._dfltTitle[axisLetter] ? '' : ax.title.text;\n\n for(j = 0; j <= 2; j += 2) {\n this.labelEnable[i + j] = false;\n this.labels[i + j] = axTitle;\n this.labelColor[i + j] = str2RGBArray(ax.title.font.color);\n this.labelFont[i + j] = ax.title.font.family;\n this.labelSize[i + j] = ax.title.font.size;\n this.labelPad[i + j] = this.getLabelPad(axisName, ax);\n\n this.tickEnable[i + j] = false;\n this.tickColor[i + j] = str2RGBArray((ax.tickfont || {}).color);\n this.tickAngle[i + j] = (ax.tickangle === 'auto') ?\n 0 :\n Math.PI * -ax.tickangle / 180;\n this.tickPad[i + j] = this.getTickPad(ax);\n\n this.tickMarkLength[i + j] = 0;\n this.tickMarkWidth[i + j] = ax.tickwidth || 0;\n this.tickMarkColor[i + j] = str2RGBArray(ax.tickcolor);\n\n this.borderLineEnable[i + j] = false;\n this.borderLineColor[i + j] = str2RGBArray(ax.linecolor);\n this.borderLineWidth[i + j] = ax.linewidth || 0;\n }\n\n hasSharedAxis = this.hasSharedAxis(ax);\n hasAxisInDfltPos = this.hasAxisInDfltPos(axisName, ax) && !hasSharedAxis;\n hasAxisInAltrPos = this.hasAxisInAltrPos(axisName, ax) && !hasSharedAxis;\n\n axMirror = ax.mirror || false;\n mirrorLines = hasSharedAxis ?\n (String(axMirror).indexOf('all') !== -1) : // 'all' or 'allticks'\n !!axMirror; // all but false\n mirrorTicks = hasSharedAxis ?\n (axMirror === 'allticks') :\n (String(axMirror).indexOf('ticks') !== -1); // 'ticks' or 'allticks'\n\n // Axis titles and tick labels can only appear of one side of the scene\n // and are never show on subplots that share existing axes.\n\n if(hasAxisInDfltPos) this.labelEnable[i] = true;\n else if(hasAxisInAltrPos) this.labelEnable[i + 2] = true;\n\n if(hasAxisInDfltPos) this.tickEnable[i] = ax.showticklabels;\n else if(hasAxisInAltrPos) this.tickEnable[i + 2] = ax.showticklabels;\n\n // Grid lines and ticks can appear on both sides of the scene\n // and can appear on subplot that share existing axes via `ax.mirror`.\n\n if(hasAxisInDfltPos || mirrorLines) this.borderLineEnable[i] = ax.showline;\n if(hasAxisInAltrPos || mirrorLines) this.borderLineEnable[i + 2] = ax.showline;\n\n if(hasAxisInDfltPos || mirrorTicks) this.tickMarkLength[i] = this.getTickMarkLength(ax);\n if(hasAxisInAltrPos || mirrorTicks) this.tickMarkLength[i + 2] = this.getTickMarkLength(ax);\n\n this.gridLineEnable[i] = ax.showgrid;\n this.gridLineColor[i] = str2RGBArray(ax.gridcolor);\n this.gridLineWidth[i] = ax.gridwidth;\n\n this.zeroLineEnable[i] = ax.zeroline;\n this.zeroLineColor[i] = str2RGBArray(ax.zerolinecolor);\n this.zeroLineWidth[i] = ax.zerolinewidth;\n }\n};\n\n// is an axis shared with an already-drawn subplot ?\nproto.hasSharedAxis = function(ax) {\n var scene = this.scene;\n var subplotIds = scene.fullLayout._subplots.gl2d;\n var list = Axes.findSubplotsWithAxis(subplotIds, ax);\n\n // if index === 0, then the subplot is already drawn as subplots\n // are drawn in order.\n return (list.indexOf(scene.id) !== 0);\n};\n\n// has an axis in default position (i.e. bottom/left) ?\nproto.hasAxisInDfltPos = function(axisName, ax) {\n var axSide = ax.side;\n\n if(axisName === 'xaxis') return (axSide === 'bottom');\n else if(axisName === 'yaxis') return (axSide === 'left');\n};\n\n// has an axis in alternate position (i.e. top/right) ?\nproto.hasAxisInAltrPos = function(axisName, ax) {\n var axSide = ax.side;\n\n if(axisName === 'xaxis') return (axSide === 'top');\n else if(axisName === 'yaxis') return (axSide === 'right');\n};\n\nproto.getLabelPad = function(axisName, ax) {\n var offsetBase = 1.5;\n var fontSize = ax.title.font.size;\n var showticklabels = ax.showticklabels;\n\n if(axisName === 'xaxis') {\n return (ax.side === 'top') ?\n -10 + fontSize * (offsetBase + (showticklabels ? 1 : 0)) :\n -10 + fontSize * (offsetBase + (showticklabels ? 0.5 : 0));\n } else if(axisName === 'yaxis') {\n return (ax.side === 'right') ?\n 10 + fontSize * (offsetBase + (showticklabels ? 1 : 0.5)) :\n 10 + fontSize * (offsetBase + (showticklabels ? 0.5 : 0));\n }\n};\n\nproto.getTickPad = function(ax) {\n return (ax.ticks === 'outside') ? 10 + ax.ticklen : 15;\n};\n\nproto.getTickMarkLength = function(ax) {\n if(!ax.ticks) return 0;\n\n var ticklen = ax.ticklen;\n\n return (ax.ticks === 'inside') ? -ticklen : ticklen;\n};\n\n\nfunction createAxes2D(scene) {\n return new Axes2DOptions(scene);\n}\n\nmodule.exports = createAxes2D;\n\n},{\"../../lib/str2rgbarray\":751,\"../cartesian/axes\":776}],816:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar overrideAll = _dereq_('../../plot_api/edit_types').overrideAll;\n\nvar Scene2D = _dereq_('./scene2d');\nvar layoutGlobalAttrs = _dereq_('../layout_attributes');\nvar xmlnsNamespaces = _dereq_('../../constants/xmlns_namespaces');\nvar constants = _dereq_('../cartesian/constants');\nvar Cartesian = _dereq_('../cartesian');\nvar fxAttrs = _dereq_('../../components/fx/layout_attributes');\nvar getSubplotData = _dereq_('../get_data').getSubplotData;\n\nexports.name = 'gl2d';\n\nexports.attr = ['xaxis', 'yaxis'];\n\nexports.idRoot = ['x', 'y'];\n\nexports.idRegex = constants.idRegex;\n\nexports.attrRegex = constants.attrRegex;\n\nexports.attributes = _dereq_('../cartesian/attributes');\n\nexports.supplyLayoutDefaults = function(layoutIn, layoutOut, fullData) {\n if(!layoutOut._has('cartesian')) {\n Cartesian.supplyLayoutDefaults(layoutIn, layoutOut, fullData);\n }\n};\n\n// gl2d uses svg axis attributes verbatim, but overrides editType\n// this could potentially be just `layoutAttributes` but it would\n// still need special handling somewhere to give it precedence over\n// the svg version when both are in use on one plot\nexports.layoutAttrOverrides = overrideAll(Cartesian.layoutAttributes, 'plot', 'from-root');\n\n// similar overrides for base plot attributes (and those added by components)\nexports.baseLayoutAttrOverrides = overrideAll({\n plot_bgcolor: layoutGlobalAttrs.plot_bgcolor,\n hoverlabel: fxAttrs.hoverlabel\n // dragmode needs calc but only when transitioning TO lasso or select\n // so for now it's left inside _relayout\n // dragmode: fxAttrs.dragmode\n}, 'plot', 'nested');\n\nexports.plot = function plot(gd) {\n var fullLayout = gd._fullLayout;\n var fullData = gd._fullData;\n var subplotIds = fullLayout._subplots.gl2d;\n\n for(var i = 0; i < subplotIds.length; i++) {\n var subplotId = subplotIds[i];\n var subplotObj = fullLayout._plots[subplotId];\n var fullSubplotData = getSubplotData(fullData, 'gl2d', subplotId);\n\n // ref. to corresp. Scene instance\n var scene = subplotObj._scene2d;\n\n // If Scene is not instantiated, create one!\n if(scene === undefined) {\n scene = new Scene2D({\n id: subplotId,\n graphDiv: gd,\n container: gd.querySelector('.gl-container'),\n staticPlot: gd._context.staticPlot,\n plotGlPixelRatio: gd._context.plotGlPixelRatio\n },\n fullLayout\n );\n\n // set ref to Scene instance\n subplotObj._scene2d = scene;\n }\n\n scene.plot(fullSubplotData, gd.calcdata, fullLayout, gd.layout);\n }\n};\n\nexports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) {\n var oldSceneKeys = oldFullLayout._subplots.gl2d || [];\n\n for(var i = 0; i < oldSceneKeys.length; i++) {\n var id = oldSceneKeys[i];\n var oldSubplot = oldFullLayout._plots[id];\n\n // old subplot wasn't gl2d; nothing to do\n if(!oldSubplot._scene2d) continue;\n\n // if no traces are present, delete gl2d subplot\n var subplotData = getSubplotData(newFullData, 'gl2d', id);\n if(subplotData.length === 0) {\n oldSubplot._scene2d.destroy();\n delete oldFullLayout._plots[id];\n }\n }\n\n // since we use cartesian interactions, do cartesian clean\n Cartesian.clean.apply(this, arguments);\n};\n\nexports.drawFramework = function(gd) {\n if(!gd._context.staticPlot) {\n Cartesian.drawFramework(gd);\n }\n};\n\nexports.toSVG = function(gd) {\n var fullLayout = gd._fullLayout;\n var subplotIds = fullLayout._subplots.gl2d;\n\n for(var i = 0; i < subplotIds.length; i++) {\n var subplot = fullLayout._plots[subplotIds[i]];\n var scene = subplot._scene2d;\n\n var imageData = scene.toImage('png');\n var image = fullLayout._glimages.append('svg:image');\n\n image.attr({\n xmlns: xmlnsNamespaces.svg,\n 'xlink:href': imageData,\n x: 0,\n y: 0,\n width: '100%',\n height: '100%',\n preserveAspectRatio: 'none'\n });\n\n scene.destroy();\n }\n};\n\nexports.updateFx = function(gd) {\n var fullLayout = gd._fullLayout;\n var subplotIds = fullLayout._subplots.gl2d;\n\n for(var i = 0; i < subplotIds.length; i++) {\n var subplotObj = fullLayout._plots[subplotIds[i]]._scene2d;\n subplotObj.updateFx(fullLayout.dragmode);\n }\n};\n\n},{\"../../components/fx/layout_attributes\":636,\"../../constants/xmlns_namespaces\":705,\"../../plot_api/edit_types\":759,\"../cartesian\":789,\"../cartesian/attributes\":774,\"../cartesian/constants\":782,\"../get_data\":813,\"../layout_attributes\":830,\"./scene2d\":817}],817:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Registry = _dereq_('../../registry');\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar Fx = _dereq_('../../components/fx');\n\nvar createPlot2D = _dereq_('gl-plot2d');\nvar createSpikes = _dereq_('gl-spikes2d');\nvar createSelectBox = _dereq_('gl-select-box');\nvar getContext = _dereq_('webgl-context');\n\nvar createOptions = _dereq_('./convert');\nvar createCamera = _dereq_('./camera');\nvar showNoWebGlMsg = _dereq_('../../lib/show_no_webgl_msg');\nvar axisConstraints = _dereq_('../cartesian/constraints');\nvar enforceAxisConstraints = axisConstraints.enforce;\nvar cleanAxisConstraints = axisConstraints.clean;\nvar doAutoRange = _dereq_('../cartesian/autorange').doAutoRange;\n\nvar dragHelpers = _dereq_('../../components/dragelement/helpers');\nvar drawMode = dragHelpers.drawMode;\nvar selectMode = dragHelpers.selectMode;\n\nvar AXES = ['xaxis', 'yaxis'];\nvar STATIC_CANVAS, STATIC_CONTEXT;\n\nvar SUBPLOT_PATTERN = _dereq_('../cartesian/constants').SUBPLOT_PATTERN;\n\n\nfunction Scene2D(options, fullLayout) {\n this.container = options.container;\n this.graphDiv = options.graphDiv;\n this.pixelRatio = options.plotGlPixelRatio || window.devicePixelRatio;\n this.id = options.id;\n this.staticPlot = !!options.staticPlot;\n this.scrollZoom = this.graphDiv._context._scrollZoom.cartesian;\n\n this.fullData = null;\n this.updateRefs(fullLayout);\n\n this.makeFramework();\n if(this.stopped) return;\n\n // update options\n this.glplotOptions = createOptions(this);\n this.glplotOptions.merge(fullLayout);\n\n // create the plot\n this.glplot = createPlot2D(this.glplotOptions);\n\n // create camera\n this.camera = createCamera(this);\n\n // trace set\n this.traces = {};\n\n // create axes spikes\n this.spikes = createSpikes(this.glplot);\n\n this.selectBox = createSelectBox(this.glplot, {\n innerFill: false,\n outerFill: true\n });\n\n // last button state\n this.lastButtonState = 0;\n\n // last pick result\n this.pickResult = null;\n\n // is the mouse over the plot?\n // it's OK if this says true when it's not, so long as\n // when we get a mouseout we set it to false before handling\n this.isMouseOver = true;\n\n // flag to stop render loop\n this.stopped = false;\n\n // redraw the plot\n this.redraw = this.draw.bind(this);\n this.redraw();\n}\n\nmodule.exports = Scene2D;\n\nvar proto = Scene2D.prototype;\n\nproto.makeFramework = function() {\n // create canvas and gl context\n if(this.staticPlot) {\n if(!STATIC_CONTEXT) {\n STATIC_CANVAS = document.createElement('canvas');\n\n STATIC_CONTEXT = getContext({\n canvas: STATIC_CANVAS,\n preserveDrawingBuffer: false,\n premultipliedAlpha: true,\n antialias: true\n });\n\n if(!STATIC_CONTEXT) {\n throw new Error('Error creating static canvas/context for image server');\n }\n }\n\n this.canvas = STATIC_CANVAS;\n this.gl = STATIC_CONTEXT;\n } else {\n var liveCanvas = this.container.querySelector('.gl-canvas-focus');\n\n var gl = getContext({\n canvas: liveCanvas,\n preserveDrawingBuffer: true,\n premultipliedAlpha: true\n });\n\n if(!gl) {\n showNoWebGlMsg(this);\n this.stopped = true;\n return;\n }\n\n this.canvas = liveCanvas;\n this.gl = gl;\n }\n\n // position the canvas\n var canvas = this.canvas;\n\n canvas.style.width = '100%';\n canvas.style.height = '100%';\n canvas.style.position = 'absolute';\n canvas.style.top = '0px';\n canvas.style.left = '0px';\n canvas.style['pointer-events'] = 'none';\n\n this.updateSize(canvas);\n\n // disabling user select on the canvas\n // sanitizes double-clicks interactions\n // ref: https://github.com/plotly/plotly.js/issues/744\n canvas.className += ' user-select-none';\n\n // create SVG container for hover text\n var svgContainer = this.svgContainer = document.createElementNS(\n 'http://www.w3.org/2000/svg',\n 'svg');\n svgContainer.style.position = 'absolute';\n svgContainer.style.top = svgContainer.style.left = '0px';\n svgContainer.style.width = svgContainer.style.height = '100%';\n svgContainer.style['z-index'] = 20;\n svgContainer.style['pointer-events'] = 'none';\n\n // create div to catch the mouse event\n var mouseContainer = this.mouseContainer = document.createElement('div');\n mouseContainer.style.position = 'absolute';\n mouseContainer.style['pointer-events'] = 'auto';\n\n this.pickCanvas = this.container.querySelector('.gl-canvas-pick');\n\n\n // append canvas, hover svg and mouse div to container\n var container = this.container;\n container.appendChild(svgContainer);\n container.appendChild(mouseContainer);\n\n var self = this;\n mouseContainer.addEventListener('mouseout', function() {\n self.isMouseOver = false;\n self.unhover();\n });\n mouseContainer.addEventListener('mouseover', function() {\n self.isMouseOver = true;\n });\n};\n\nproto.toImage = function(format) {\n if(!format) format = 'png';\n\n this.stopped = true;\n\n if(this.staticPlot) this.container.appendChild(STATIC_CANVAS);\n\n // update canvas size\n this.updateSize(this.canvas);\n\n\n // grab context and yank out pixels\n var gl = this.glplot.gl;\n var w = gl.drawingBufferWidth;\n var h = gl.drawingBufferHeight;\n\n // force redraw\n gl.clearColor(1, 1, 1, 0);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n this.glplot.setDirty();\n this.glplot.draw();\n\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n\n var pixels = new Uint8Array(w * h * 4);\n gl.readPixels(0, 0, w, h, gl.RGBA, gl.UNSIGNED_BYTE, pixels);\n\n // flip pixels\n for(var j = 0, k = h - 1; j < k; ++j, --k) {\n for(var i = 0; i < w; ++i) {\n for(var l = 0; l < 4; ++l) {\n var tmp = pixels[4 * (w * j + i) + l];\n pixels[4 * (w * j + i) + l] = pixels[4 * (w * k + i) + l];\n pixels[4 * (w * k + i) + l] = tmp;\n }\n }\n }\n\n var canvas = document.createElement('canvas');\n canvas.width = w;\n canvas.height = h;\n\n var context = canvas.getContext('2d');\n var imageData = context.createImageData(w, h);\n imageData.data.set(pixels);\n context.putImageData(imageData, 0, 0);\n\n var dataURL;\n\n switch(format) {\n case 'jpeg':\n dataURL = canvas.toDataURL('image/jpeg');\n break;\n case 'webp':\n dataURL = canvas.toDataURL('image/webp');\n break;\n default:\n dataURL = canvas.toDataURL('image/png');\n }\n\n if(this.staticPlot) this.container.removeChild(STATIC_CANVAS);\n\n return dataURL;\n};\n\nproto.updateSize = function(canvas) {\n if(!canvas) canvas = this.canvas;\n\n var pixelRatio = this.pixelRatio;\n var fullLayout = this.fullLayout;\n\n var width = fullLayout.width;\n var height = fullLayout.height;\n var pixelWidth = Math.ceil(pixelRatio * width) |0;\n var pixelHeight = Math.ceil(pixelRatio * height) |0;\n\n // check for resize\n if(canvas.width !== pixelWidth || canvas.height !== pixelHeight) {\n canvas.width = pixelWidth;\n canvas.height = pixelHeight;\n }\n\n return canvas;\n};\n\nproto.computeTickMarks = function() {\n this.xaxis.setScale();\n this.yaxis.setScale();\n\n var nextTicks = [\n Axes.calcTicks(this.xaxis),\n Axes.calcTicks(this.yaxis)\n ];\n\n for(var j = 0; j < 2; ++j) {\n for(var i = 0; i < nextTicks[j].length; ++i) {\n // coercing tick value (may not be a string) to a string\n nextTicks[j][i].text = nextTicks[j][i].text + '';\n }\n }\n\n return nextTicks;\n};\n\nfunction compareTicks(a, b) {\n for(var i = 0; i < 2; ++i) {\n var aticks = a[i];\n var bticks = b[i];\n\n if(aticks.length !== bticks.length) return true;\n\n for(var j = 0; j < aticks.length; ++j) {\n if(aticks[j].x !== bticks[j].x) return true;\n }\n }\n\n return false;\n}\n\nproto.updateRefs = function(newFullLayout) {\n this.fullLayout = newFullLayout;\n\n var spmatch = this.id.match(SUBPLOT_PATTERN);\n var xaxisName = 'xaxis' + spmatch[1];\n var yaxisName = 'yaxis' + spmatch[2];\n\n this.xaxis = this.fullLayout[xaxisName];\n this.yaxis = this.fullLayout[yaxisName];\n};\n\nproto.relayoutCallback = function() {\n var graphDiv = this.graphDiv;\n var xaxis = this.xaxis;\n var yaxis = this.yaxis;\n var layout = graphDiv.layout;\n\n // make a meaningful value to be passed on to possible 'plotly_relayout' subscriber(s)\n var update = {};\n var xrange = update[xaxis._name + '.range'] = xaxis.range.slice();\n var yrange = update[yaxis._name + '.range'] = yaxis.range.slice();\n update[xaxis._name + '.autorange'] = xaxis.autorange;\n update[yaxis._name + '.autorange'] = yaxis.autorange;\n\n Registry.call('_storeDirectGUIEdit', graphDiv.layout, graphDiv._fullLayout._preGUI, update);\n\n // update the input layout\n var xaIn = layout[xaxis._name];\n xaIn.range = xrange;\n xaIn.autorange = xaxis.autorange;\n\n var yaIn = layout[yaxis._name];\n yaIn.range = yrange;\n yaIn.autorange = yaxis.autorange;\n\n // lastInputTime helps determine which one is the latest input (if async)\n update.lastInputTime = this.camera.lastInputTime;\n graphDiv.emit('plotly_relayout', update);\n};\n\nproto.cameraChanged = function() {\n var camera = this.camera;\n\n this.glplot.setDataBox(this.calcDataBox());\n\n var nextTicks = this.computeTickMarks();\n var curTicks = this.glplotOptions.ticks;\n\n if(compareTicks(nextTicks, curTicks)) {\n this.glplotOptions.ticks = nextTicks;\n this.glplotOptions.dataBox = camera.dataBox;\n this.glplot.update(this.glplotOptions);\n this.handleAnnotations();\n }\n};\n\nproto.handleAnnotations = function() {\n var gd = this.graphDiv;\n var annotations = this.fullLayout.annotations;\n\n for(var i = 0; i < annotations.length; i++) {\n var ann = annotations[i];\n\n if(ann.xref === this.xaxis._id && ann.yref === this.yaxis._id) {\n Registry.getComponentMethod('annotations', 'drawOne')(gd, i);\n }\n }\n};\n\nproto.destroy = function() {\n if(!this.glplot) return;\n\n var traces = this.traces;\n\n if(traces) {\n Object.keys(traces).map(function(key) {\n traces[key].dispose();\n delete traces[key];\n });\n }\n\n this.glplot.dispose();\n\n this.container.removeChild(this.svgContainer);\n this.container.removeChild(this.mouseContainer);\n\n this.fullData = null;\n this.glplot = null;\n this.stopped = true;\n this.camera.mouseListener.enabled = false;\n this.mouseContainer.removeEventListener('wheel', this.camera.wheelListener);\n this.camera = null;\n};\n\nproto.plot = function(fullData, calcData, fullLayout) {\n var glplot = this.glplot;\n\n this.updateRefs(fullLayout);\n this.xaxis.clearCalc();\n this.yaxis.clearCalc();\n this.updateTraces(fullData, calcData);\n this.updateFx(fullLayout.dragmode);\n\n var width = fullLayout.width;\n var height = fullLayout.height;\n\n this.updateSize(this.canvas);\n\n var options = this.glplotOptions;\n options.merge(fullLayout);\n options.screenBox = [0, 0, width, height];\n\n var mockGraphDiv = {_fullLayout: {\n _axisConstraintGroups: this.graphDiv._fullLayout._axisConstraintGroups,\n xaxis: this.xaxis,\n yaxis: this.yaxis\n }};\n\n cleanAxisConstraints(mockGraphDiv, this.xaxis);\n cleanAxisConstraints(mockGraphDiv, this.yaxis);\n\n var size = fullLayout._size;\n var domainX = this.xaxis.domain;\n var domainY = this.yaxis.domain;\n\n options.viewBox = [\n size.l + domainX[0] * size.w,\n size.b + domainY[0] * size.h,\n (width - size.r) - (1 - domainX[1]) * size.w,\n (height - size.t) - (1 - domainY[1]) * size.h\n ];\n\n this.mouseContainer.style.width = size.w * (domainX[1] - domainX[0]) + 'px';\n this.mouseContainer.style.height = size.h * (domainY[1] - domainY[0]) + 'px';\n this.mouseContainer.height = size.h * (domainY[1] - domainY[0]);\n this.mouseContainer.style.left = size.l + domainX[0] * size.w + 'px';\n this.mouseContainer.style.top = size.t + (1 - domainY[1]) * size.h + 'px';\n\n var ax, i;\n\n for(i = 0; i < 2; ++i) {\n ax = this[AXES[i]];\n ax._length = options.viewBox[i + 2] - options.viewBox[i];\n\n doAutoRange(this.graphDiv, ax);\n ax.setScale();\n }\n\n enforceAxisConstraints(mockGraphDiv);\n\n options.ticks = this.computeTickMarks();\n\n options.dataBox = this.calcDataBox();\n\n options.merge(fullLayout);\n glplot.update(options);\n\n // force redraw so that promise is returned when rendering is completed\n this.glplot.draw();\n};\n\nproto.calcDataBox = function() {\n var xaxis = this.xaxis;\n var yaxis = this.yaxis;\n var xrange = xaxis.range;\n var yrange = yaxis.range;\n var xr2l = xaxis.r2l;\n var yr2l = yaxis.r2l;\n\n return [xr2l(xrange[0]), yr2l(yrange[0]), xr2l(xrange[1]), yr2l(yrange[1])];\n};\n\nproto.setRanges = function(dataBox) {\n var xaxis = this.xaxis;\n var yaxis = this.yaxis;\n var xl2r = xaxis.l2r;\n var yl2r = yaxis.l2r;\n\n xaxis.range = [xl2r(dataBox[0]), xl2r(dataBox[2])];\n yaxis.range = [yl2r(dataBox[1]), yl2r(dataBox[3])];\n};\n\nproto.updateTraces = function(fullData, calcData) {\n var traceIds = Object.keys(this.traces);\n var i, j, fullTrace;\n\n this.fullData = fullData;\n\n // remove empty traces\n traceIdLoop:\n for(i = 0; i < traceIds.length; i++) {\n var oldUid = traceIds[i];\n var oldTrace = this.traces[oldUid];\n\n for(j = 0; j < fullData.length; j++) {\n fullTrace = fullData[j];\n\n if(fullTrace.uid === oldUid && fullTrace.type === oldTrace.type) {\n continue traceIdLoop;\n }\n }\n\n oldTrace.dispose();\n delete this.traces[oldUid];\n }\n\n // update / create trace objects\n for(i = 0; i < fullData.length; i++) {\n fullTrace = fullData[i];\n var calcTrace = calcData[i];\n var traceObj = this.traces[fullTrace.uid];\n\n if(traceObj) traceObj.update(fullTrace, calcTrace);\n else {\n traceObj = fullTrace._module.plot(this, fullTrace, calcTrace);\n this.traces[fullTrace.uid] = traceObj;\n }\n }\n\n // order object per traces\n this.glplot.objects.sort(function(a, b) {\n return a._trace.index - b._trace.index;\n });\n};\n\nproto.updateFx = function(dragmode) {\n // switch to svg interactions in lasso/select mode & shape drawing\n if(selectMode(dragmode) || drawMode(dragmode)) {\n this.pickCanvas.style['pointer-events'] = 'none';\n this.mouseContainer.style['pointer-events'] = 'none';\n } else {\n this.pickCanvas.style['pointer-events'] = 'auto';\n this.mouseContainer.style['pointer-events'] = 'auto';\n }\n\n // set proper cursor\n if(dragmode === 'pan') {\n this.mouseContainer.style.cursor = 'move';\n } else if(dragmode === 'zoom') {\n this.mouseContainer.style.cursor = 'crosshair';\n } else {\n this.mouseContainer.style.cursor = null;\n }\n};\n\nproto.emitPointAction = function(nextSelection, eventType) {\n var uid = nextSelection.trace.uid;\n var ptNumber = nextSelection.pointIndex;\n var trace;\n\n for(var i = 0; i < this.fullData.length; i++) {\n if(this.fullData[i].uid === uid) {\n trace = this.fullData[i];\n }\n }\n\n var pointData = {\n x: nextSelection.traceCoord[0],\n y: nextSelection.traceCoord[1],\n curveNumber: trace.index,\n pointNumber: ptNumber,\n data: trace._input,\n fullData: this.fullData,\n xaxis: this.xaxis,\n yaxis: this.yaxis\n };\n\n Fx.appendArrayPointValue(pointData, trace, ptNumber);\n\n this.graphDiv.emit(eventType, {points: [pointData]});\n};\n\nproto.draw = function() {\n if(this.stopped) return;\n\n requestAnimationFrame(this.redraw);\n\n var glplot = this.glplot;\n var camera = this.camera;\n var mouseListener = camera.mouseListener;\n var mouseUp = this.lastButtonState === 1 && mouseListener.buttons === 0;\n var fullLayout = this.fullLayout;\n\n this.lastButtonState = mouseListener.buttons;\n\n this.cameraChanged();\n\n var x = mouseListener.x * glplot.pixelRatio;\n var y = this.canvas.height - glplot.pixelRatio * mouseListener.y;\n\n var result;\n\n if(camera.boxEnabled && fullLayout.dragmode === 'zoom') {\n this.selectBox.enabled = true;\n\n var selectBox = this.selectBox.selectBox = [\n Math.min(camera.boxStart[0], camera.boxEnd[0]),\n Math.min(camera.boxStart[1], camera.boxEnd[1]),\n Math.max(camera.boxStart[0], camera.boxEnd[0]),\n Math.max(camera.boxStart[1], camera.boxEnd[1])\n ];\n\n // 1D zoom\n for(var i = 0; i < 2; i++) {\n if(camera.boxStart[i] === camera.boxEnd[i]) {\n selectBox[i] = glplot.dataBox[i];\n selectBox[i + 2] = glplot.dataBox[i + 2];\n }\n }\n\n glplot.setDirty();\n } else if(!camera.panning && this.isMouseOver) {\n this.selectBox.enabled = false;\n\n var size = fullLayout._size;\n var domainX = this.xaxis.domain;\n var domainY = this.yaxis.domain;\n\n result = glplot.pick(\n (x / glplot.pixelRatio) + size.l + domainX[0] * size.w,\n (y / glplot.pixelRatio) - (size.t + (1 - domainY[1]) * size.h)\n );\n\n var nextSelection = result && result.object._trace.handlePick(result);\n\n if(nextSelection && mouseUp) {\n this.emitPointAction(nextSelection, 'plotly_click');\n }\n\n if(result && result.object._trace.hoverinfo !== 'skip' && fullLayout.hovermode) {\n if(nextSelection && (\n !this.lastPickResult ||\n this.lastPickResult.traceUid !== nextSelection.trace.uid ||\n this.lastPickResult.dataCoord[0] !== nextSelection.dataCoord[0] ||\n this.lastPickResult.dataCoord[1] !== nextSelection.dataCoord[1])\n ) {\n var selection = nextSelection;\n\n this.lastPickResult = {\n traceUid: nextSelection.trace ? nextSelection.trace.uid : null,\n dataCoord: nextSelection.dataCoord.slice()\n };\n this.spikes.update({ center: result.dataCoord });\n\n selection.screenCoord = [\n ((glplot.viewBox[2] - glplot.viewBox[0]) *\n (result.dataCoord[0] - glplot.dataBox[0]) /\n (glplot.dataBox[2] - glplot.dataBox[0]) + glplot.viewBox[0]) /\n glplot.pixelRatio,\n (this.canvas.height - (glplot.viewBox[3] - glplot.viewBox[1]) *\n (result.dataCoord[1] - glplot.dataBox[1]) /\n (glplot.dataBox[3] - glplot.dataBox[1]) - glplot.viewBox[1]) /\n glplot.pixelRatio\n ];\n\n // this needs to happen before the next block that deletes traceCoord data\n // also it's important to copy, otherwise data is lost by the time event data is read\n this.emitPointAction(nextSelection, 'plotly_hover');\n\n var trace = this.fullData[selection.trace.index] || {};\n var ptNumber = selection.pointIndex;\n var hoverinfo = Fx.castHoverinfo(trace, fullLayout, ptNumber);\n\n if(hoverinfo && hoverinfo !== 'all') {\n var parts = hoverinfo.split('+');\n if(parts.indexOf('x') === -1) selection.traceCoord[0] = undefined;\n if(parts.indexOf('y') === -1) selection.traceCoord[1] = undefined;\n if(parts.indexOf('z') === -1) selection.traceCoord[2] = undefined;\n if(parts.indexOf('text') === -1) selection.textLabel = undefined;\n if(parts.indexOf('name') === -1) selection.name = undefined;\n }\n\n Fx.loneHover({\n x: selection.screenCoord[0],\n y: selection.screenCoord[1],\n xLabel: this.hoverFormatter('xaxis', selection.traceCoord[0]),\n yLabel: this.hoverFormatter('yaxis', selection.traceCoord[1]),\n zLabel: selection.traceCoord[2],\n text: selection.textLabel,\n name: selection.name,\n color: Fx.castHoverOption(trace, ptNumber, 'bgcolor') || selection.color,\n borderColor: Fx.castHoverOption(trace, ptNumber, 'bordercolor'),\n fontFamily: Fx.castHoverOption(trace, ptNumber, 'font.family'),\n fontSize: Fx.castHoverOption(trace, ptNumber, 'font.size'),\n fontColor: Fx.castHoverOption(trace, ptNumber, 'font.color'),\n nameLength: Fx.castHoverOption(trace, ptNumber, 'namelength'),\n textAlign: Fx.castHoverOption(trace, ptNumber, 'align')\n }, {\n container: this.svgContainer,\n gd: this.graphDiv\n });\n }\n }\n }\n\n // Remove hover effects if we're not over a point OR\n // if we're zooming or panning (in which case result is not set)\n if(!result) {\n this.unhover();\n }\n\n glplot.draw();\n};\n\nproto.unhover = function() {\n if(this.lastPickResult) {\n this.spikes.update({});\n this.lastPickResult = null;\n this.graphDiv.emit('plotly_unhover');\n Fx.loneUnhover(this.svgContainer);\n }\n};\n\nproto.hoverFormatter = function(axisName, val) {\n if(val === undefined) return undefined;\n\n var axis = this[axisName];\n return Axes.tickText(axis, axis.c2l(val), 'hover').text;\n};\n\n},{\"../../components/dragelement/helpers\":613,\"../../components/fx\":635,\"../../lib/show_no_webgl_msg\":749,\"../../plots/cartesian/axes\":776,\"../../registry\":859,\"../cartesian/autorange\":775,\"../cartesian/constants\":782,\"../cartesian/constraints\":783,\"./camera\":814,\"./convert\":815,\"gl-plot2d\":293,\"gl-select-box\":305,\"gl-spikes2d\":314,\"webgl-context\":558}],818:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar overrideAll = _dereq_('../../plot_api/edit_types').overrideAll;\nvar fxAttrs = _dereq_('../../components/fx/layout_attributes');\n\nvar Scene = _dereq_('./scene');\nvar getSubplotData = _dereq_('../get_data').getSubplotData;\nvar Lib = _dereq_('../../lib');\nvar xmlnsNamespaces = _dereq_('../../constants/xmlns_namespaces');\n\nvar GL3D = 'gl3d';\nvar SCENE = 'scene';\n\n\nexports.name = GL3D;\n\nexports.attr = SCENE;\n\nexports.idRoot = SCENE;\n\nexports.idRegex = exports.attrRegex = Lib.counterRegex('scene');\n\nexports.attributes = _dereq_('./layout/attributes');\n\nexports.layoutAttributes = _dereq_('./layout/layout_attributes');\n\nexports.baseLayoutAttrOverrides = overrideAll({\n hoverlabel: fxAttrs.hoverlabel\n}, 'plot', 'nested');\n\nexports.supplyLayoutDefaults = _dereq_('./layout/defaults');\n\nexports.plot = function plot(gd) {\n var fullLayout = gd._fullLayout;\n var fullData = gd._fullData;\n var sceneIds = fullLayout._subplots[GL3D];\n\n for(var i = 0; i < sceneIds.length; i++) {\n var sceneId = sceneIds[i];\n var fullSceneData = getSubplotData(fullData, GL3D, sceneId);\n var sceneLayout = fullLayout[sceneId];\n var camera = sceneLayout.camera;\n var scene = sceneLayout._scene;\n\n if(!scene) {\n scene = new Scene({\n id: sceneId,\n graphDiv: gd,\n container: gd.querySelector('.gl-container'),\n staticPlot: gd._context.staticPlot,\n plotGlPixelRatio: gd._context.plotGlPixelRatio,\n camera: camera\n },\n fullLayout\n );\n\n // set ref to Scene instance\n sceneLayout._scene = scene;\n }\n\n // save 'initial' camera view settings for modebar button\n if(!scene.viewInitial) {\n scene.viewInitial = {\n up: {\n x: camera.up.x,\n y: camera.up.y,\n z: camera.up.z\n },\n eye: {\n x: camera.eye.x,\n y: camera.eye.y,\n z: camera.eye.z\n },\n center: {\n x: camera.center.x,\n y: camera.center.y,\n z: camera.center.z\n }\n };\n }\n\n scene.plot(fullSceneData, fullLayout, gd.layout);\n }\n};\n\nexports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) {\n var oldSceneKeys = oldFullLayout._subplots[GL3D] || [];\n\n for(var i = 0; i < oldSceneKeys.length; i++) {\n var oldSceneKey = oldSceneKeys[i];\n\n if(!newFullLayout[oldSceneKey] && !!oldFullLayout[oldSceneKey]._scene) {\n oldFullLayout[oldSceneKey]._scene.destroy();\n\n if(oldFullLayout._infolayer) {\n oldFullLayout._infolayer\n .selectAll('.annotation-' + oldSceneKey)\n .remove();\n }\n }\n }\n};\n\nexports.toSVG = function(gd) {\n var fullLayout = gd._fullLayout;\n var sceneIds = fullLayout._subplots[GL3D];\n var size = fullLayout._size;\n\n for(var i = 0; i < sceneIds.length; i++) {\n var sceneLayout = fullLayout[sceneIds[i]];\n var domain = sceneLayout.domain;\n var scene = sceneLayout._scene;\n\n var imageData = scene.toImage('png');\n var image = fullLayout._glimages.append('svg:image');\n\n image.attr({\n xmlns: xmlnsNamespaces.svg,\n 'xlink:href': imageData,\n x: size.l + size.w * domain.x[0],\n y: size.t + size.h * (1 - domain.y[1]),\n width: size.w * (domain.x[1] - domain.x[0]),\n height: size.h * (domain.y[1] - domain.y[0]),\n preserveAspectRatio: 'none'\n });\n\n scene.destroy();\n }\n};\n\n// clean scene ids, 'scene1' -> 'scene'\nexports.cleanId = function cleanId(id) {\n if(!id.match(/^scene[0-9]*$/)) return;\n\n var sceneNum = id.substr(5);\n if(sceneNum === '1') sceneNum = '';\n\n return SCENE + sceneNum;\n};\n\nexports.updateFx = function(gd) {\n var fullLayout = gd._fullLayout;\n var subplotIds = fullLayout._subplots[GL3D];\n\n for(var i = 0; i < subplotIds.length; i++) {\n var subplotObj = fullLayout[subplotIds[i]]._scene;\n subplotObj.updateFx(fullLayout.dragmode, fullLayout.hovermode);\n }\n};\n\n},{\"../../components/fx/layout_attributes\":636,\"../../constants/xmlns_namespaces\":705,\"../../lib\":728,\"../../plot_api/edit_types\":759,\"../get_data\":813,\"./layout/attributes\":819,\"./layout/defaults\":823,\"./layout/layout_attributes\":824,\"./scene\":828}],819:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n\nmodule.exports = {\n scene: {\n valType: 'subplotid',\n \n dflt: 'scene',\n editType: 'calc+clearAxisTypes',\n \n }\n};\n\n},{}],820:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Color = _dereq_('../../../components/color');\nvar axesAttrs = _dereq_('../../cartesian/layout_attributes');\nvar extendFlat = _dereq_('../../../lib/extend').extendFlat;\nvar overrideAll = _dereq_('../../../plot_api/edit_types').overrideAll;\n\nmodule.exports = overrideAll({\n visible: axesAttrs.visible,\n showspikes: {\n valType: 'boolean',\n \n dflt: true,\n \n },\n spikesides: {\n valType: 'boolean',\n \n dflt: true,\n \n },\n spikethickness: {\n valType: 'number',\n \n min: 0,\n dflt: 2,\n \n },\n spikecolor: {\n valType: 'color',\n \n dflt: Color.defaultLine,\n \n },\n showbackground: {\n valType: 'boolean',\n \n dflt: false,\n \n },\n backgroundcolor: {\n valType: 'color',\n \n dflt: 'rgba(204, 204, 204, 0.5)',\n \n },\n showaxeslabels: {\n valType: 'boolean',\n \n dflt: true,\n \n },\n color: axesAttrs.color,\n categoryorder: axesAttrs.categoryorder,\n categoryarray: axesAttrs.categoryarray,\n title: {\n text: axesAttrs.title.text,\n font: axesAttrs.title.font\n },\n type: extendFlat({}, axesAttrs.type, {\n values: ['-', 'linear', 'log', 'date', 'category']\n }),\n autorange: axesAttrs.autorange,\n rangemode: axesAttrs.rangemode,\n range: extendFlat({}, axesAttrs.range, {\n items: [\n {valType: 'any', editType: 'plot', impliedEdits: {'^autorange': false}},\n {valType: 'any', editType: 'plot', impliedEdits: {'^autorange': false}}\n ],\n anim: false\n }),\n // ticks\n tickmode: axesAttrs.tickmode,\n nticks: axesAttrs.nticks,\n tick0: axesAttrs.tick0,\n dtick: axesAttrs.dtick,\n tickvals: axesAttrs.tickvals,\n ticktext: axesAttrs.ticktext,\n ticks: axesAttrs.ticks,\n mirror: axesAttrs.mirror,\n ticklen: axesAttrs.ticklen,\n tickwidth: axesAttrs.tickwidth,\n tickcolor: axesAttrs.tickcolor,\n showticklabels: axesAttrs.showticklabels,\n tickfont: axesAttrs.tickfont,\n tickangle: axesAttrs.tickangle,\n tickprefix: axesAttrs.tickprefix,\n showtickprefix: axesAttrs.showtickprefix,\n ticksuffix: axesAttrs.ticksuffix,\n showticksuffix: axesAttrs.showticksuffix,\n showexponent: axesAttrs.showexponent,\n exponentformat: axesAttrs.exponentformat,\n separatethousands: axesAttrs.separatethousands,\n tickformat: axesAttrs.tickformat,\n tickformatstops: axesAttrs.tickformatstops,\n hoverformat: axesAttrs.hoverformat,\n // lines and grids\n showline: axesAttrs.showline,\n linecolor: axesAttrs.linecolor,\n linewidth: axesAttrs.linewidth,\n showgrid: axesAttrs.showgrid,\n gridcolor: extendFlat({}, axesAttrs.gridcolor, // shouldn't this be on-par with 2D?\n {dflt: 'rgb(204, 204, 204)'}),\n gridwidth: axesAttrs.gridwidth,\n zeroline: axesAttrs.zeroline,\n zerolinecolor: axesAttrs.zerolinecolor,\n zerolinewidth: axesAttrs.zerolinewidth,\n _deprecated: {\n title: axesAttrs._deprecated.title,\n titlefont: axesAttrs._deprecated.titlefont\n }\n}, 'plot', 'from-root');\n\n},{\"../../../components/color\":595,\"../../../lib/extend\":719,\"../../../plot_api/edit_types\":759,\"../../cartesian/layout_attributes\":790}],821:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar colorMix = _dereq_('tinycolor2').mix;\n\nvar Lib = _dereq_('../../../lib');\nvar Template = _dereq_('../../../plot_api/plot_template');\n\nvar layoutAttributes = _dereq_('./axis_attributes');\nvar handleTypeDefaults = _dereq_('../../cartesian/type_defaults');\nvar handleAxisDefaults = _dereq_('../../cartesian/axis_defaults');\n\nvar axesNames = ['xaxis', 'yaxis', 'zaxis'];\n\n// TODO: hard-coded lightness fraction based on gridline default colors\n// that differ from other subplot types.\nvar gridLightness = 100 * (204 - 0x44) / (255 - 0x44);\n\nmodule.exports = function supplyLayoutDefaults(layoutIn, layoutOut, options) {\n var containerIn, containerOut;\n\n function coerce(attr, dflt) {\n return Lib.coerce(containerIn, containerOut, layoutAttributes, attr, dflt);\n }\n\n for(var j = 0; j < axesNames.length; j++) {\n var axName = axesNames[j];\n containerIn = layoutIn[axName] || {};\n\n containerOut = Template.newContainer(layoutOut, axName);\n containerOut._id = axName[0] + options.scene;\n containerOut._name = axName;\n\n handleTypeDefaults(containerIn, containerOut, coerce, options);\n\n handleAxisDefaults(\n containerIn,\n containerOut,\n coerce,\n {\n font: options.font,\n letter: axName[0],\n data: options.data,\n showGrid: true,\n noTickson: true,\n bgColor: options.bgColor,\n calendar: options.calendar\n },\n options.fullLayout);\n\n coerce('gridcolor', colorMix(containerOut.color, options.bgColor, gridLightness).toRgbString());\n coerce('title.text', axName[0]); // shouldn't this be on-par with 2D?\n\n containerOut.setScale = Lib.noop;\n\n if(coerce('showspikes')) {\n coerce('spikesides');\n coerce('spikethickness');\n coerce('spikecolor', containerOut.color);\n }\n\n coerce('showaxeslabels');\n if(coerce('showbackground')) coerce('backgroundcolor');\n }\n};\n\n},{\"../../../lib\":728,\"../../../plot_api/plot_template\":766,\"../../cartesian/axis_defaults\":778,\"../../cartesian/type_defaults\":801,\"./axis_attributes\":820,\"tinycolor2\":528}],822:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar str2RgbaArray = _dereq_('../../../lib/str2rgbarray');\nvar Lib = _dereq_('../../../lib');\n\nvar AXES_NAMES = ['xaxis', 'yaxis', 'zaxis'];\n\nfunction AxesOptions() {\n this.bounds = [\n [-10, -10, -10],\n [10, 10, 10]\n ];\n\n this.ticks = [ [], [], [] ];\n this.tickEnable = [ true, true, true ];\n this.tickFont = [ 'sans-serif', 'sans-serif', 'sans-serif' ];\n this.tickSize = [ 12, 12, 12 ];\n this.tickAngle = [ 0, 0, 0 ];\n this.tickColor = [ [0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1] ];\n this.tickPad = [ 18, 18, 18 ];\n\n this.labels = [ 'x', 'y', 'z' ];\n this.labelEnable = [ true, true, true ];\n this.labelFont = ['Open Sans', 'Open Sans', 'Open Sans'];\n this.labelSize = [ 20, 20, 20 ];\n this.labelColor = [ [0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1] ];\n this.labelPad = [ 30, 30, 30 ];\n\n this.lineEnable = [ true, true, true ];\n this.lineMirror = [ false, false, false ];\n this.lineWidth = [ 1, 1, 1 ];\n this.lineColor = [ [0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1] ];\n\n this.lineTickEnable = [ true, true, true ];\n this.lineTickMirror = [ false, false, false ];\n this.lineTickLength = [ 10, 10, 10 ];\n this.lineTickWidth = [ 1, 1, 1 ];\n this.lineTickColor = [ [0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1] ];\n\n this.gridEnable = [ true, true, true ];\n this.gridWidth = [ 1, 1, 1 ];\n this.gridColor = [ [0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1] ];\n\n this.zeroEnable = [ true, true, true ];\n this.zeroLineColor = [ [0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1] ];\n this.zeroLineWidth = [ 2, 2, 2 ];\n\n this.backgroundEnable = [ true, true, true ];\n this.backgroundColor = [ [0.8, 0.8, 0.8, 0.5],\n [0.8, 0.8, 0.8, 0.5],\n [0.8, 0.8, 0.8, 0.5] ];\n\n // some default values are stored for applying model transforms\n this._defaultTickPad = this.tickPad.slice();\n this._defaultLabelPad = this.labelPad.slice();\n this._defaultLineTickLength = this.lineTickLength.slice();\n}\n\nvar proto = AxesOptions.prototype;\n\nproto.merge = function(fullLayout, sceneLayout) {\n var opts = this;\n for(var i = 0; i < 3; ++i) {\n var axes = sceneLayout[AXES_NAMES[i]];\n\n if(!axes.visible) {\n opts.tickEnable[i] = false;\n opts.labelEnable[i] = false;\n opts.lineEnable[i] = false;\n opts.lineTickEnable[i] = false;\n opts.gridEnable[i] = false;\n opts.zeroEnable[i] = false;\n opts.backgroundEnable[i] = false;\n continue;\n }\n\n // Axes labels\n opts.labels[i] = fullLayout._meta ?\n Lib.templateString(axes.title.text, fullLayout._meta) :\n axes.title.text;\n\n if('font' in axes.title) {\n if(axes.title.font.color) opts.labelColor[i] = str2RgbaArray(axes.title.font.color);\n if(axes.title.font.family) opts.labelFont[i] = axes.title.font.family;\n if(axes.title.font.size) opts.labelSize[i] = axes.title.font.size;\n }\n\n // Lines\n if('showline' in axes) opts.lineEnable[i] = axes.showline;\n if('linecolor' in axes) opts.lineColor[i] = str2RgbaArray(axes.linecolor);\n if('linewidth' in axes) opts.lineWidth[i] = axes.linewidth;\n\n if('showgrid' in axes) opts.gridEnable[i] = axes.showgrid;\n if('gridcolor' in axes) opts.gridColor[i] = str2RgbaArray(axes.gridcolor);\n if('gridwidth' in axes) opts.gridWidth[i] = axes.gridwidth;\n\n // Remove zeroline if axis type is log\n // otherwise the zeroline is incorrectly drawn at 1 on log axes\n if(axes.type === 'log') opts.zeroEnable[i] = false;\n else if('zeroline' in axes) opts.zeroEnable[i] = axes.zeroline;\n if('zerolinecolor' in axes) opts.zeroLineColor[i] = str2RgbaArray(axes.zerolinecolor);\n if('zerolinewidth' in axes) opts.zeroLineWidth[i] = axes.zerolinewidth;\n\n // tick lines\n if('ticks' in axes && !!axes.ticks) opts.lineTickEnable[i] = true;\n else opts.lineTickEnable[i] = false;\n\n if('ticklen' in axes) {\n opts.lineTickLength[i] = opts._defaultLineTickLength[i] = axes.ticklen;\n }\n if('tickcolor' in axes) opts.lineTickColor[i] = str2RgbaArray(axes.tickcolor);\n if('tickwidth' in axes) opts.lineTickWidth[i] = axes.tickwidth;\n if('tickangle' in axes) {\n opts.tickAngle[i] = (axes.tickangle === 'auto') ?\n -3600 : // i.e. special number to set auto option\n Math.PI * -axes.tickangle / 180;\n }\n\n // tick labels\n if('showticklabels' in axes) opts.tickEnable[i] = axes.showticklabels;\n if('tickfont' in axes) {\n if(axes.tickfont.color) opts.tickColor[i] = str2RgbaArray(axes.tickfont.color);\n if(axes.tickfont.family) opts.tickFont[i] = axes.tickfont.family;\n if(axes.tickfont.size) opts.tickSize[i] = axes.tickfont.size;\n }\n\n if('mirror' in axes) {\n if(['ticks', 'all', 'allticks'].indexOf(axes.mirror) !== -1) {\n opts.lineTickMirror[i] = true;\n opts.lineMirror[i] = true;\n } else if(axes.mirror === true) {\n opts.lineTickMirror[i] = false;\n opts.lineMirror[i] = true;\n } else {\n opts.lineTickMirror[i] = false;\n opts.lineMirror[i] = false;\n }\n } else opts.lineMirror[i] = false;\n\n // grid background\n if('showbackground' in axes && axes.showbackground !== false) {\n opts.backgroundEnable[i] = true;\n opts.backgroundColor[i] = str2RgbaArray(axes.backgroundcolor);\n } else opts.backgroundEnable[i] = false;\n }\n};\n\n\nfunction createAxesOptions(fullLayout, sceneLayout) {\n var result = new AxesOptions();\n result.merge(fullLayout, sceneLayout);\n return result;\n}\n\nmodule.exports = createAxesOptions;\n\n},{\"../../../lib\":728,\"../../../lib/str2rgbarray\":751}],823:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../../lib');\nvar Color = _dereq_('../../../components/color');\nvar Registry = _dereq_('../../../registry');\n\nvar handleSubplotDefaults = _dereq_('../../subplot_defaults');\nvar supplyGl3dAxisLayoutDefaults = _dereq_('./axis_defaults');\nvar layoutAttributes = _dereq_('./layout_attributes');\nvar getSubplotData = _dereq_('../../get_data').getSubplotData;\n\nvar GL3D = 'gl3d';\n\nmodule.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {\n var hasNon3D = layoutOut._basePlotModules.length > 1;\n\n // some layout-wide attribute are used in all scenes\n // if 3D is the only visible plot type\n function getDfltFromLayout(attr) {\n if(hasNon3D) return;\n\n var isValid = Lib.validate(layoutIn[attr], layoutAttributes[attr]);\n if(isValid) return layoutIn[attr];\n }\n\n handleSubplotDefaults(layoutIn, layoutOut, fullData, {\n type: GL3D,\n attributes: layoutAttributes,\n handleDefaults: handleGl3dDefaults,\n fullLayout: layoutOut,\n font: layoutOut.font,\n fullData: fullData,\n getDfltFromLayout: getDfltFromLayout,\n paper_bgcolor: layoutOut.paper_bgcolor,\n calendar: layoutOut.calendar\n });\n};\n\nfunction handleGl3dDefaults(sceneLayoutIn, sceneLayoutOut, coerce, opts) {\n /*\n * Scene numbering proceeds as follows\n * scene\n * scene2\n * scene3\n *\n * and d.scene will be undefined or some number or number string\n *\n * Also write back a blank scene object to user layout so that some\n * attributes like aspectratio can be written back dynamically.\n */\n\n var bgcolor = coerce('bgcolor');\n var bgColorCombined = Color.combine(bgcolor, opts.paper_bgcolor);\n\n var cameraKeys = ['up', 'center', 'eye'];\n\n for(var j = 0; j < cameraKeys.length; j++) {\n coerce('camera.' + cameraKeys[j] + '.x');\n coerce('camera.' + cameraKeys[j] + '.y');\n coerce('camera.' + cameraKeys[j] + '.z');\n }\n\n coerce('camera.projection.type');\n\n /*\n * coerce to positive number (min 0) but also do not accept 0 (>0 not >=0)\n * note that 0's go false with the !! call\n */\n var hasAspect = !!coerce('aspectratio.x') &&\n !!coerce('aspectratio.y') &&\n !!coerce('aspectratio.z');\n\n var defaultAspectMode = hasAspect ? 'manual' : 'auto';\n var aspectMode = coerce('aspectmode', defaultAspectMode);\n\n /*\n * We need aspectratio object in all the Layouts as it is dynamically set\n * in the calculation steps, ie, we cant set the correct data now, it happens later.\n * We must also account for the case the user sends bad ratio data with 'manual' set\n * for the mode. In this case we must force change it here as the default coerce\n * misses it above.\n */\n if(!hasAspect) {\n sceneLayoutIn.aspectratio = sceneLayoutOut.aspectratio = {x: 1, y: 1, z: 1};\n\n if(aspectMode === 'manual') sceneLayoutOut.aspectmode = 'auto';\n\n /*\n * kind of like autorange - we need the calculated aspectmode back in\n * the input layout or relayout can cause problems later\n */\n sceneLayoutIn.aspectmode = sceneLayoutOut.aspectmode;\n }\n\n var fullGl3dData = getSubplotData(opts.fullData, GL3D, opts.id);\n\n supplyGl3dAxisLayoutDefaults(sceneLayoutIn, sceneLayoutOut, {\n font: opts.font,\n scene: opts.id,\n data: fullGl3dData,\n bgColor: bgColorCombined,\n calendar: opts.calendar,\n fullLayout: opts.fullLayout\n });\n\n Registry.getComponentMethod('annotations3d', 'handleDefaults')(\n sceneLayoutIn, sceneLayoutOut, opts\n );\n\n var dragmode = opts.getDfltFromLayout('dragmode');\n\n if(dragmode !== false) {\n if(!dragmode) {\n dragmode = 'orbit';\n\n if(sceneLayoutIn.camera &&\n sceneLayoutIn.camera.up) {\n var x = sceneLayoutIn.camera.up.x;\n var y = sceneLayoutIn.camera.up.y;\n var z = sceneLayoutIn.camera.up.z;\n\n if(z !== 0) {\n if(!x || !y || !z) {\n dragmode = 'turntable';\n } else if(z / Math.sqrt(x * x + y * y + z * z) > 0.999) {\n dragmode = 'turntable';\n }\n }\n } else {\n dragmode = 'turntable';\n }\n }\n }\n\n coerce('dragmode', dragmode);\n coerce('hovermode', opts.getDfltFromLayout('hovermode'));\n}\n\n},{\"../../../components/color\":595,\"../../../lib\":728,\"../../../registry\":859,\"../../get_data\":813,\"../../subplot_defaults\":853,\"./axis_defaults\":821,\"./layout_attributes\":824}],824:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar gl3dAxisAttrs = _dereq_('./axis_attributes');\nvar domainAttrs = _dereq_('../../domain').attributes;\nvar extendFlat = _dereq_('../../../lib/extend').extendFlat;\nvar counterRegex = _dereq_('../../../lib').counterRegex;\n\nfunction makeCameraVector(x, y, z) {\n return {\n x: {\n valType: 'number',\n \n dflt: x,\n editType: 'camera'\n },\n y: {\n valType: 'number',\n \n dflt: y,\n editType: 'camera'\n },\n z: {\n valType: 'number',\n \n dflt: z,\n editType: 'camera'\n },\n editType: 'camera'\n };\n}\n\nmodule.exports = {\n _arrayAttrRegexps: [counterRegex('scene', '.annotations', true)],\n\n bgcolor: {\n valType: 'color',\n \n dflt: 'rgba(0,0,0,0)',\n editType: 'plot'\n },\n camera: {\n up: extendFlat(makeCameraVector(0, 0, 1), {\n \n }),\n center: extendFlat(makeCameraVector(0, 0, 0), {\n \n }),\n eye: extendFlat(makeCameraVector(1.25, 1.25, 1.25), {\n \n }),\n projection: {\n type: {\n valType: 'enumerated',\n \n values: ['perspective', 'orthographic'],\n dflt: 'perspective',\n editType: 'calc',\n \n },\n editType: 'calc'\n },\n editType: 'camera'\n },\n domain: domainAttrs({name: 'scene', editType: 'plot'}),\n aspectmode: {\n valType: 'enumerated',\n \n values: ['auto', 'cube', 'data', 'manual'],\n dflt: 'auto',\n editType: 'plot',\n impliedEdits: {\n 'aspectratio.x': undefined,\n 'aspectratio.y': undefined,\n 'aspectratio.z': undefined\n },\n \n },\n aspectratio: { // must be positive (0's are coerced to 1)\n x: {\n valType: 'number',\n \n min: 0,\n editType: 'plot',\n impliedEdits: {'^aspectmode': 'manual'}\n },\n y: {\n valType: 'number',\n \n min: 0,\n editType: 'plot',\n impliedEdits: {'^aspectmode': 'manual'}\n },\n z: {\n valType: 'number',\n \n min: 0,\n editType: 'plot',\n impliedEdits: {'^aspectmode': 'manual'}\n },\n editType: 'plot',\n impliedEdits: {aspectmode: 'manual'},\n \n },\n\n xaxis: gl3dAxisAttrs,\n yaxis: gl3dAxisAttrs,\n zaxis: gl3dAxisAttrs,\n\n dragmode: {\n valType: 'enumerated',\n \n values: ['orbit', 'turntable', 'zoom', 'pan', false],\n editType: 'plot',\n \n },\n hovermode: {\n valType: 'enumerated',\n \n values: ['closest', false],\n dflt: 'closest',\n editType: 'modebar',\n \n },\n uirevision: {\n valType: 'any',\n \n editType: 'none',\n \n },\n editType: 'plot',\n\n _deprecated: {\n cameraposition: {\n valType: 'info_array',\n \n editType: 'camera',\n \n }\n }\n};\n\n},{\"../../../lib\":728,\"../../../lib/extend\":719,\"../../domain\":803,\"./axis_attributes\":820}],825:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar str2RGBArray = _dereq_('../../../lib/str2rgbarray');\n\nvar AXES_NAMES = ['xaxis', 'yaxis', 'zaxis'];\n\nfunction SpikeOptions() {\n this.enabled = [true, true, true];\n this.colors = [[0, 0, 0, 1],\n [0, 0, 0, 1],\n [0, 0, 0, 1]];\n this.drawSides = [true, true, true];\n this.lineWidth = [1, 1, 1];\n}\n\nvar proto = SpikeOptions.prototype;\n\nproto.merge = function(sceneLayout) {\n for(var i = 0; i < 3; ++i) {\n var axes = sceneLayout[AXES_NAMES[i]];\n\n if(!axes.visible) {\n this.enabled[i] = false;\n this.drawSides[i] = false;\n continue;\n }\n\n this.enabled[i] = axes.showspikes;\n this.colors[i] = str2RGBArray(axes.spikecolor);\n this.drawSides[i] = axes.spikesides;\n this.lineWidth[i] = axes.spikethickness;\n }\n};\n\nfunction createSpikeOptions(layout) {\n var result = new SpikeOptions();\n result.merge(layout);\n return result;\n}\n\nmodule.exports = createSpikeOptions;\n\n},{\"../../../lib/str2rgbarray\":751}],826:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n/* eslint block-scoped-var: 0*/\n/* eslint no-redeclare: 0*/\n\n'use strict';\n\nmodule.exports = computeTickMarks;\n\nvar Axes = _dereq_('../../cartesian/axes');\nvar Lib = _dereq_('../../../lib');\n\nvar AXES_NAMES = ['xaxis', 'yaxis', 'zaxis'];\n\nvar centerPoint = [0, 0, 0];\n\nfunction contourLevelsFromTicks(ticks) {\n var result = new Array(3);\n for(var i = 0; i < 3; ++i) {\n var tlevel = ticks[i];\n var clevel = new Array(tlevel.length);\n for(var j = 0; j < tlevel.length; ++j) {\n clevel[j] = tlevel[j].x;\n }\n result[i] = clevel;\n }\n return result;\n}\n\nfunction computeTickMarks(scene) {\n var axesOptions = scene.axesOptions;\n var glRange = scene.glplot.axesPixels;\n var sceneLayout = scene.fullSceneLayout;\n\n var ticks = [[], [], []];\n\n for(var i = 0; i < 3; ++i) {\n var axes = sceneLayout[AXES_NAMES[i]];\n\n axes._length = (glRange[i].hi - glRange[i].lo) *\n glRange[i].pixelsPerDataUnit / scene.dataScale[i];\n\n if(Math.abs(axes._length) === Infinity ||\n isNaN(axes._length)) {\n ticks[i] = [];\n } else {\n axes._input_range = axes.range.slice();\n axes.range[0] = (glRange[i].lo) / scene.dataScale[i];\n axes.range[1] = (glRange[i].hi) / scene.dataScale[i];\n axes._m = 1.0 / (scene.dataScale[i] * glRange[i].pixelsPerDataUnit);\n\n if(axes.range[0] === axes.range[1]) {\n axes.range[0] -= 1;\n axes.range[1] += 1;\n }\n // this is necessary to short-circuit the 'y' handling\n // in autotick part of calcTicks... Treating all axes as 'y' in this case\n // running the autoticks here, then setting\n // autoticks to false to get around the 2D handling in calcTicks.\n var tickModeCached = axes.tickmode;\n if(axes.tickmode === 'auto') {\n axes.tickmode = 'linear';\n var nticks = axes.nticks || Lib.constrain((axes._length / 40), 4, 9);\n Axes.autoTicks(axes, Math.abs(axes.range[1] - axes.range[0]) / nticks);\n }\n var dataTicks = Axes.calcTicks(axes, { msUTC: true });\n for(var j = 0; j < dataTicks.length; ++j) {\n dataTicks[j].x = dataTicks[j].x * scene.dataScale[i];\n\n if(axes.type === 'date') {\n dataTicks[j].text =\n dataTicks[j].text.replace(/\\/g, ' ');\n }\n }\n ticks[i] = dataTicks;\n\n\n axes.tickmode = tickModeCached;\n }\n }\n\n axesOptions.ticks = ticks;\n\n // Calculate tick lengths dynamically\n for(var i = 0; i < 3; ++i) {\n centerPoint[i] = 0.5 * (scene.glplot.bounds[0][i] + scene.glplot.bounds[1][i]);\n for(var j = 0; j < 2; ++j) {\n axesOptions.bounds[j][i] = scene.glplot.bounds[j][i];\n }\n }\n\n scene.contourLevels = contourLevelsFromTicks(ticks);\n}\n\n},{\"../../../lib\":728,\"../../cartesian/axes\":776}],827:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nfunction xformMatrix(m, v) {\n var out = [0, 0, 0, 0];\n var i, j;\n\n for(i = 0; i < 4; ++i) {\n for(j = 0; j < 4; ++j) {\n out[j] += m[4 * i + j] * v[i];\n }\n }\n\n return out;\n}\n\nfunction project(camera, v) {\n var p = xformMatrix(camera.projection,\n xformMatrix(camera.view,\n xformMatrix(camera.model, [v[0], v[1], v[2], 1])));\n return p;\n}\n\nmodule.exports = project;\n\n},{}],828:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar glPlot3d = _dereq_('gl-plot3d');\nvar createCamera = glPlot3d.createCamera;\nvar createPlot = glPlot3d.createScene;\n\nvar getContext = _dereq_('webgl-context');\nvar passiveSupported = _dereq_('has-passive-events');\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\n\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar Fx = _dereq_('../../components/fx');\n\nvar str2RGBAarray = _dereq_('../../lib/str2rgbarray');\nvar showNoWebGlMsg = _dereq_('../../lib/show_no_webgl_msg');\n\nvar project = _dereq_('./project');\nvar createAxesOptions = _dereq_('./layout/convert');\nvar createSpikeOptions = _dereq_('./layout/spikes');\nvar computeTickMarks = _dereq_('./layout/tick_marks');\n\nvar isMobile = _dereq_('is-mobile')({ tablet: true, featureDetect: true });\n\n\nvar STATIC_CANVAS, STATIC_CONTEXT;\n\nfunction Scene(options, fullLayout) {\n // create sub container for plot\n var sceneContainer = document.createElement('div');\n var plotContainer = options.container;\n\n // keep a ref to the graph div to fire hover+click events\n this.graphDiv = options.graphDiv;\n\n // create SVG container for hover text\n var svgContainer = document.createElementNS(\n 'http://www.w3.org/2000/svg',\n 'svg');\n svgContainer.style.position = 'absolute';\n svgContainer.style.top = svgContainer.style.left = '0px';\n svgContainer.style.width = svgContainer.style.height = '100%';\n svgContainer.style['z-index'] = 20;\n svgContainer.style['pointer-events'] = 'none';\n sceneContainer.appendChild(svgContainer);\n this.svgContainer = svgContainer;\n\n // Tag the container with the sceneID\n sceneContainer.id = options.id;\n sceneContainer.style.position = 'absolute';\n sceneContainer.style.top = sceneContainer.style.left = '0px';\n sceneContainer.style.width = sceneContainer.style.height = '100%';\n plotContainer.appendChild(sceneContainer);\n\n this.fullLayout = fullLayout;\n this.id = options.id || 'scene';\n this.fullSceneLayout = fullLayout[this.id];\n\n // Saved from last call to plot()\n this.plotArgs = [ [], {}, {} ];\n\n /*\n * Move this to calc step? Why does it work here?\n */\n this.axesOptions = createAxesOptions(fullLayout, fullLayout[this.id]);\n this.spikeOptions = createSpikeOptions(fullLayout[this.id]);\n this.container = sceneContainer;\n this.staticMode = !!options.staticPlot;\n this.pixelRatio = this.pixelRatio || options.plotGlPixelRatio || 2;\n\n // Coordinate rescaling\n this.dataScale = [1, 1, 1];\n\n this.contourLevels = [ [], [], [] ];\n\n this.convertAnnotations = Registry.getComponentMethod('annotations3d', 'convert');\n this.drawAnnotations = Registry.getComponentMethod('annotations3d', 'draw');\n\n this.initializeGLPlot();\n}\n\nvar proto = Scene.prototype;\n\nproto.prepareOptions = function() {\n var scene = this;\n\n var opts = {\n canvas: scene.canvas,\n gl: scene.gl,\n glOptions: {\n preserveDrawingBuffer: isMobile,\n premultipliedAlpha: true,\n antialias: true\n },\n container: scene.container,\n axes: scene.axesOptions,\n spikes: scene.spikeOptions,\n pickRadius: 10,\n snapToData: true,\n autoScale: true,\n autoBounds: false,\n cameraObject: scene.camera,\n pixelRatio: scene.pixelRatio\n };\n\n // for static plots, we reuse the WebGL context\n // as WebKit doesn't collect them reliably\n if(scene.staticMode) {\n if(!STATIC_CONTEXT) {\n STATIC_CANVAS = document.createElement('canvas');\n STATIC_CONTEXT = getContext({\n canvas: STATIC_CANVAS,\n preserveDrawingBuffer: true,\n premultipliedAlpha: true,\n antialias: true\n });\n if(!STATIC_CONTEXT) {\n throw new Error('error creating static canvas/context for image server');\n }\n }\n\n opts.gl = STATIC_CONTEXT;\n opts.canvas = STATIC_CANVAS;\n }\n\n return opts;\n};\n\nproto.tryCreatePlot = function() {\n var scene = this;\n\n var opts = scene.prepareOptions();\n\n var success = true;\n\n try {\n scene.glplot = createPlot(opts);\n } catch(e) {\n if(scene.staticMode) {\n success = false;\n } else { // try second time\n try {\n // invert preserveDrawingBuffer setup which could be resulted from is-mobile not detecting the right device\n Lib.warn([\n 'webgl setup failed possibly due to',\n isMobile ? 'disabling' : 'enabling',\n 'preserveDrawingBuffer config.',\n 'The device may not be supported by is-mobile module!',\n 'Inverting preserveDrawingBuffer option in second attempt to create webgl scene.'\n ].join(' '));\n isMobile = opts.glOptions.preserveDrawingBuffer = !opts.glOptions.preserveDrawingBuffer;\n\n scene.glplot = createPlot(opts);\n } catch(e) {\n success = false;\n }\n }\n }\n\n return success;\n};\n\nproto.initializeGLCamera = function() {\n var scene = this;\n var cameraData = scene.fullSceneLayout.camera;\n var isOrtho = (cameraData.projection.type === 'orthographic');\n\n scene.camera = createCamera(scene.container, {\n center: [cameraData.center.x, cameraData.center.y, cameraData.center.z],\n eye: [cameraData.eye.x, cameraData.eye.y, cameraData.eye.z],\n up: [cameraData.up.x, cameraData.up.y, cameraData.up.z],\n _ortho: isOrtho,\n zoomMin: 0.01,\n zoomMax: 100,\n mode: 'orbit'\n });\n};\n\nproto.initializeGLPlot = function() {\n var scene = this;\n\n scene.initializeGLCamera();\n\n var success = scene.tryCreatePlot();\n /*\n * createPlot will throw when webgl is not enabled in the client.\n * Lets return an instance of the module with all functions noop'd.\n * The destroy method - which will remove the container from the DOM\n * is overridden with a function that removes the container only.\n */\n if(!success) return showNoWebGlMsg(scene);\n\n // List of scene objects\n scene.traces = {};\n\n scene.make4thDimension();\n\n var gd = scene.graphDiv;\n var layout = gd.layout;\n\n var makeUpdate = function() {\n var update = {};\n\n if(scene.isCameraChanged(layout)) {\n // camera updates\n update[scene.id + '.camera'] = scene.getCamera();\n }\n\n if(scene.isAspectChanged(layout)) {\n // scene updates\n update[scene.id + '.aspectratio'] = scene.glplot.getAspectratio();\n\n if(layout[scene.id].aspectmode !== 'manual') {\n scene.fullSceneLayout.aspectmode =\n layout[scene.id].aspectmode =\n update[scene.id + '.aspectmode'] = 'manual';\n }\n }\n\n return update;\n };\n\n var relayoutCallback = function(scene) {\n if(scene.fullSceneLayout.dragmode === false) return;\n\n var update = makeUpdate();\n scene.saveLayout(layout);\n scene.graphDiv.emit('plotly_relayout', update);\n };\n\n scene.glplot.canvas.addEventListener('mouseup', function() {\n relayoutCallback(scene);\n });\n\n scene.glplot.canvas.addEventListener('wheel', function(e) {\n if(gd._context._scrollZoom.gl3d) {\n if(scene.camera._ortho) {\n var s = (e.deltaX > e.deltaY) ? 1.1 : 1.0 / 1.1;\n var o = scene.glplot.getAspectratio();\n scene.glplot.setAspectratio({\n x: s * o.x,\n y: s * o.y,\n z: s * o.z\n });\n }\n\n relayoutCallback(scene);\n }\n }, passiveSupported ? {passive: false} : false);\n\n scene.glplot.canvas.addEventListener('mousemove', function() {\n if(scene.fullSceneLayout.dragmode === false) return;\n if(scene.camera.mouseListener.buttons === 0) return;\n\n var update = makeUpdate();\n scene.graphDiv.emit('plotly_relayouting', update);\n });\n\n if(!scene.staticMode) {\n scene.glplot.canvas.addEventListener('webglcontextlost', function(event) {\n if(gd && gd.emit) {\n gd.emit('plotly_webglcontextlost', {\n event: event,\n layer: scene.id\n });\n }\n }, false);\n }\n\n scene.glplot.oncontextloss = function() {\n scene.recoverContext();\n };\n\n scene.glplot.onrender = function() {\n scene.render();\n };\n\n return true;\n};\n\nproto.render = function() {\n var scene = this;\n var gd = scene.graphDiv;\n var trace;\n\n // update size of svg container\n var svgContainer = scene.svgContainer;\n var clientRect = scene.container.getBoundingClientRect();\n var width = clientRect.width;\n var height = clientRect.height;\n svgContainer.setAttributeNS(null, 'viewBox', '0 0 ' + width + ' ' + height);\n svgContainer.setAttributeNS(null, 'width', width);\n svgContainer.setAttributeNS(null, 'height', height);\n\n computeTickMarks(scene);\n scene.glplot.axes.update(scene.axesOptions);\n\n // check if pick has changed\n var keys = Object.keys(scene.traces);\n var lastPicked = null;\n var selection = scene.glplot.selection;\n for(var i = 0; i < keys.length; ++i) {\n trace = scene.traces[keys[i]];\n if(trace.data.hoverinfo !== 'skip' && trace.handlePick(selection)) {\n lastPicked = trace;\n }\n\n if(trace.setContourLevels) trace.setContourLevels();\n }\n\n function formatter(axisName, val) {\n var axis = scene.fullSceneLayout[axisName];\n\n return Axes.tickText(axis, axis.d2l(val), 'hover').text;\n }\n\n var oldEventData;\n\n if(lastPicked !== null) {\n var pdata = project(scene.glplot.cameraParams, selection.dataCoordinate);\n trace = lastPicked.data;\n var traceNow = gd._fullData[trace.index];\n var ptNumber = selection.index;\n\n var labels = {\n xLabel: formatter('xaxis', selection.traceCoordinate[0]),\n yLabel: formatter('yaxis', selection.traceCoordinate[1]),\n zLabel: formatter('zaxis', selection.traceCoordinate[2])\n };\n\n var hoverinfo = Fx.castHoverinfo(traceNow, scene.fullLayout, ptNumber);\n var hoverinfoParts = (hoverinfo || '').split('+');\n var isHoverinfoAll = hoverinfo && hoverinfo === 'all';\n\n if(!traceNow.hovertemplate && !isHoverinfoAll) {\n if(hoverinfoParts.indexOf('x') === -1) labels.xLabel = undefined;\n if(hoverinfoParts.indexOf('y') === -1) labels.yLabel = undefined;\n if(hoverinfoParts.indexOf('z') === -1) labels.zLabel = undefined;\n if(hoverinfoParts.indexOf('text') === -1) selection.textLabel = undefined;\n if(hoverinfoParts.indexOf('name') === -1) lastPicked.name = undefined;\n }\n\n var tx;\n var vectorTx = [];\n\n if(trace.type === 'cone' || trace.type === 'streamtube') {\n labels.uLabel = formatter('xaxis', selection.traceCoordinate[3]);\n if(isHoverinfoAll || hoverinfoParts.indexOf('u') !== -1) {\n vectorTx.push('u: ' + labels.uLabel);\n }\n\n labels.vLabel = formatter('yaxis', selection.traceCoordinate[4]);\n if(isHoverinfoAll || hoverinfoParts.indexOf('v') !== -1) {\n vectorTx.push('v: ' + labels.vLabel);\n }\n\n labels.wLabel = formatter('zaxis', selection.traceCoordinate[5]);\n if(isHoverinfoAll || hoverinfoParts.indexOf('w') !== -1) {\n vectorTx.push('w: ' + labels.wLabel);\n }\n\n labels.normLabel = selection.traceCoordinate[6].toPrecision(3);\n if(isHoverinfoAll || hoverinfoParts.indexOf('norm') !== -1) {\n vectorTx.push('norm: ' + labels.normLabel);\n }\n if(trace.type === 'streamtube') {\n labels.divergenceLabel = selection.traceCoordinate[7].toPrecision(3);\n if(isHoverinfoAll || hoverinfoParts.indexOf('divergence') !== -1) {\n vectorTx.push('divergence: ' + labels.divergenceLabel);\n }\n }\n if(selection.textLabel) {\n vectorTx.push(selection.textLabel);\n }\n tx = vectorTx.join('
');\n } else if(trace.type === 'isosurface' || trace.type === 'volume') {\n labels.valueLabel = Axes.tickText(scene._mockAxis, scene._mockAxis.d2l(selection.traceCoordinate[3]), 'hover').text;\n vectorTx.push('value: ' + labels.valueLabel);\n if(selection.textLabel) {\n vectorTx.push(selection.textLabel);\n }\n tx = vectorTx.join('
');\n } else {\n tx = selection.textLabel;\n }\n\n var pointData = {\n x: selection.traceCoordinate[0],\n y: selection.traceCoordinate[1],\n z: selection.traceCoordinate[2],\n data: traceNow._input,\n fullData: traceNow,\n curveNumber: traceNow.index,\n pointNumber: ptNumber\n };\n\n Fx.appendArrayPointValue(pointData, traceNow, ptNumber);\n\n if(trace._module.eventData) {\n pointData = traceNow._module.eventData(pointData, selection, traceNow, {}, ptNumber);\n }\n\n var eventData = {points: [pointData]};\n\n if(scene.fullSceneLayout.hovermode) {\n Fx.loneHover({\n trace: traceNow,\n x: (0.5 + 0.5 * pdata[0] / pdata[3]) * width,\n y: (0.5 - 0.5 * pdata[1] / pdata[3]) * height,\n xLabel: labels.xLabel,\n yLabel: labels.yLabel,\n zLabel: labels.zLabel,\n text: tx,\n name: lastPicked.name,\n color: Fx.castHoverOption(traceNow, ptNumber, 'bgcolor') || lastPicked.color,\n borderColor: Fx.castHoverOption(traceNow, ptNumber, 'bordercolor'),\n fontFamily: Fx.castHoverOption(traceNow, ptNumber, 'font.family'),\n fontSize: Fx.castHoverOption(traceNow, ptNumber, 'font.size'),\n fontColor: Fx.castHoverOption(traceNow, ptNumber, 'font.color'),\n nameLength: Fx.castHoverOption(traceNow, ptNumber, 'namelength'),\n textAlign: Fx.castHoverOption(traceNow, ptNumber, 'align'),\n hovertemplate: Lib.castOption(traceNow, ptNumber, 'hovertemplate'),\n hovertemplateLabels: Lib.extendFlat({}, pointData, labels),\n eventData: [pointData]\n }, {\n container: svgContainer,\n gd: gd\n });\n }\n\n if(selection.buttons && selection.distance < 5) {\n gd.emit('plotly_click', eventData);\n } else {\n gd.emit('plotly_hover', eventData);\n }\n\n oldEventData = eventData;\n } else {\n Fx.loneUnhover(svgContainer);\n gd.emit('plotly_unhover', oldEventData);\n }\n\n scene.drawAnnotations(scene);\n};\n\nproto.recoverContext = function() {\n var scene = this;\n\n scene.glplot.dispose();\n\n var tryRecover = function() {\n if(scene.glplot.gl.isContextLost()) {\n requestAnimationFrame(tryRecover);\n return;\n }\n if(!scene.initializeGLPlot()) {\n Lib.error('Catastrophic and unrecoverable WebGL error. Context lost.');\n return;\n }\n scene.plot.apply(scene, scene.plotArgs);\n };\n\n requestAnimationFrame(tryRecover);\n};\n\nvar axisProperties = [ 'xaxis', 'yaxis', 'zaxis' ];\n\nfunction computeTraceBounds(scene, trace, bounds) {\n var fullSceneLayout = scene.fullSceneLayout;\n\n for(var d = 0; d < 3; d++) {\n var axisName = axisProperties[d];\n var axLetter = axisName.charAt(0);\n var ax = fullSceneLayout[axisName];\n var coords = trace[axLetter];\n var calendar = trace[axLetter + 'calendar'];\n var len = trace['_' + axLetter + 'length'];\n\n if(!Lib.isArrayOrTypedArray(coords)) {\n bounds[0][d] = Math.min(bounds[0][d], 0);\n bounds[1][d] = Math.max(bounds[1][d], len - 1);\n } else {\n var v;\n\n for(var i = 0; i < (len || coords.length); i++) {\n if(Lib.isArrayOrTypedArray(coords[i])) {\n for(var j = 0; j < coords[i].length; ++j) {\n v = ax.d2l(coords[i][j], 0, calendar);\n if(!isNaN(v) && isFinite(v)) {\n bounds[0][d] = Math.min(bounds[0][d], v);\n bounds[1][d] = Math.max(bounds[1][d], v);\n }\n }\n } else {\n v = ax.d2l(coords[i], 0, calendar);\n if(!isNaN(v) && isFinite(v)) {\n bounds[0][d] = Math.min(bounds[0][d], v);\n bounds[1][d] = Math.max(bounds[1][d], v);\n }\n }\n }\n }\n }\n}\n\nfunction computeAnnotationBounds(scene, bounds) {\n var fullSceneLayout = scene.fullSceneLayout;\n var annotations = fullSceneLayout.annotations || [];\n\n for(var d = 0; d < 3; d++) {\n var axisName = axisProperties[d];\n var axLetter = axisName.charAt(0);\n var ax = fullSceneLayout[axisName];\n\n for(var j = 0; j < annotations.length; j++) {\n var ann = annotations[j];\n\n if(ann.visible) {\n var pos = ax.r2l(ann[axLetter]);\n if(!isNaN(pos) && isFinite(pos)) {\n bounds[0][d] = Math.min(bounds[0][d], pos);\n bounds[1][d] = Math.max(bounds[1][d], pos);\n }\n }\n }\n }\n}\n\nproto.plot = function(sceneData, fullLayout, layout) {\n var scene = this;\n\n // Save parameters\n scene.plotArgs = [sceneData, fullLayout, layout];\n\n if(scene.glplot.contextLost) return;\n\n var data, trace;\n var i, j, axis, axisType;\n var fullSceneLayout = fullLayout[scene.id];\n var sceneLayout = layout[scene.id];\n\n // Update layout\n scene.fullLayout = fullLayout;\n scene.fullSceneLayout = fullSceneLayout;\n\n scene.axesOptions.merge(fullLayout, fullSceneLayout);\n scene.spikeOptions.merge(fullSceneLayout);\n\n // Update camera and camera mode\n scene.setViewport(fullSceneLayout);\n scene.updateFx(fullSceneLayout.dragmode, fullSceneLayout.hovermode);\n scene.camera.enableWheel = scene.graphDiv._context._scrollZoom.gl3d;\n\n // Update scene background\n scene.glplot.setClearColor(str2RGBAarray(fullSceneLayout.bgcolor));\n\n // Update axes functions BEFORE updating traces\n scene.setConvert(axis);\n\n // Convert scene data\n if(!sceneData) sceneData = [];\n else if(!Array.isArray(sceneData)) sceneData = [sceneData];\n\n // Compute trace bounding box\n var dataBounds = [\n [Infinity, Infinity, Infinity],\n [-Infinity, -Infinity, -Infinity]\n ];\n\n for(i = 0; i < sceneData.length; ++i) {\n data = sceneData[i];\n if(data.visible !== true || data._length === 0) continue;\n\n computeTraceBounds(this, data, dataBounds);\n }\n computeAnnotationBounds(this, dataBounds);\n\n var dataScale = [1, 1, 1];\n for(j = 0; j < 3; ++j) {\n if(dataBounds[1][j] === dataBounds[0][j]) {\n dataScale[j] = 1.0;\n } else {\n dataScale[j] = 1.0 / (dataBounds[1][j] - dataBounds[0][j]);\n }\n }\n\n // Save scale\n scene.dataScale = dataScale;\n\n // after computeTraceBounds where ax._categories are filled in\n scene.convertAnnotations(this);\n\n // Update traces\n for(i = 0; i < sceneData.length; ++i) {\n data = sceneData[i];\n if(data.visible !== true || data._length === 0) {\n continue;\n }\n trace = scene.traces[data.uid];\n if(trace) {\n if(trace.data.type === data.type) {\n trace.update(data);\n } else {\n trace.dispose();\n trace = data._module.plot(this, data);\n scene.traces[data.uid] = trace;\n }\n } else {\n trace = data._module.plot(this, data);\n scene.traces[data.uid] = trace;\n }\n trace.name = data.name;\n }\n\n // Remove empty traces\n var traceIds = Object.keys(scene.traces);\n\n traceIdLoop:\n for(i = 0; i < traceIds.length; ++i) {\n for(j = 0; j < sceneData.length; ++j) {\n if(sceneData[j].uid === traceIds[i] &&\n (sceneData[j].visible === true && sceneData[j]._length !== 0)) {\n continue traceIdLoop;\n }\n }\n trace = scene.traces[traceIds[i]];\n trace.dispose();\n delete scene.traces[traceIds[i]];\n }\n\n // order object per trace index\n scene.glplot.objects.sort(function(a, b) {\n return a._trace.data.index - b._trace.data.index;\n });\n\n // Update ranges (needs to be called *after* objects are added due to updates)\n var sceneBounds = [[0, 0, 0], [0, 0, 0]];\n var axisDataRange = [];\n var axisTypeRatios = {};\n\n for(i = 0; i < 3; ++i) {\n axis = fullSceneLayout[axisProperties[i]];\n axisType = axis.type;\n\n if(axisType in axisTypeRatios) {\n axisTypeRatios[axisType].acc *= dataScale[i];\n axisTypeRatios[axisType].count += 1;\n } else {\n axisTypeRatios[axisType] = {\n acc: dataScale[i],\n count: 1\n };\n }\n\n if(axis.autorange) {\n sceneBounds[0][i] = Infinity;\n sceneBounds[1][i] = -Infinity;\n\n var objects = scene.glplot.objects;\n var annotations = scene.fullSceneLayout.annotations || [];\n var axLetter = axis._name.charAt(0);\n\n for(j = 0; j < objects.length; j++) {\n var obj = objects[j];\n var objBounds = obj.bounds;\n var pad = obj._trace.data._pad || 0;\n\n if(obj.constructor.name === 'ErrorBars' && axis._lowerLogErrorBound) {\n sceneBounds[0][i] = Math.min(sceneBounds[0][i], axis._lowerLogErrorBound);\n } else {\n sceneBounds[0][i] = Math.min(sceneBounds[0][i], objBounds[0][i] / dataScale[i] - pad);\n }\n sceneBounds[1][i] = Math.max(sceneBounds[1][i], objBounds[1][i] / dataScale[i] + pad);\n }\n\n for(j = 0; j < annotations.length; j++) {\n var ann = annotations[j];\n\n // N.B. not taking into consideration the arrowhead\n if(ann.visible) {\n var pos = axis.r2l(ann[axLetter]);\n sceneBounds[0][i] = Math.min(sceneBounds[0][i], pos);\n sceneBounds[1][i] = Math.max(sceneBounds[1][i], pos);\n }\n }\n\n if('rangemode' in axis && axis.rangemode === 'tozero') {\n sceneBounds[0][i] = Math.min(sceneBounds[0][i], 0);\n sceneBounds[1][i] = Math.max(sceneBounds[1][i], 0);\n }\n if(sceneBounds[0][i] > sceneBounds[1][i]) {\n sceneBounds[0][i] = -1;\n sceneBounds[1][i] = 1;\n } else {\n var d = sceneBounds[1][i] - sceneBounds[0][i];\n sceneBounds[0][i] -= d / 32.0;\n sceneBounds[1][i] += d / 32.0;\n }\n\n if(axis.autorange === 'reversed') {\n // swap bounds:\n var tmp = sceneBounds[0][i];\n sceneBounds[0][i] = sceneBounds[1][i];\n sceneBounds[1][i] = tmp;\n }\n } else {\n var range = axis.range;\n sceneBounds[0][i] = axis.r2l(range[0]);\n sceneBounds[1][i] = axis.r2l(range[1]);\n }\n if(sceneBounds[0][i] === sceneBounds[1][i]) {\n sceneBounds[0][i] -= 1;\n sceneBounds[1][i] += 1;\n }\n axisDataRange[i] = sceneBounds[1][i] - sceneBounds[0][i];\n\n // Update plot bounds\n scene.glplot.setBounds(i, {\n min: sceneBounds[0][i] * dataScale[i],\n max: sceneBounds[1][i] * dataScale[i]\n });\n }\n\n /*\n * Dynamically set the aspect ratio depending on the users aspect settings\n */\n var aspectRatio;\n var aspectmode = fullSceneLayout.aspectmode;\n if(aspectmode === 'cube') {\n aspectRatio = [1, 1, 1];\n } else if(aspectmode === 'manual') {\n var userRatio = fullSceneLayout.aspectratio;\n aspectRatio = [userRatio.x, userRatio.y, userRatio.z];\n } else if(aspectmode === 'auto' || aspectmode === 'data') {\n var axesScaleRatio = [1, 1, 1];\n // Compute axis scale per category\n for(i = 0; i < 3; ++i) {\n axis = fullSceneLayout[axisProperties[i]];\n axisType = axis.type;\n var axisRatio = axisTypeRatios[axisType];\n axesScaleRatio[i] = Math.pow(axisRatio.acc, 1.0 / axisRatio.count) / dataScale[i];\n }\n\n if(aspectmode === 'data') {\n aspectRatio = axesScaleRatio;\n } else { // i.e. 'auto' option\n if(\n Math.max.apply(null, axesScaleRatio) /\n Math.min.apply(null, axesScaleRatio) <= 4\n ) {\n // USE DATA MODE WHEN AXIS RANGE DIMENSIONS ARE RELATIVELY EQUAL\n aspectRatio = axesScaleRatio;\n } else {\n // USE EQUAL MODE WHEN AXIS RANGE DIMENSIONS ARE HIGHLY UNEQUAL\n aspectRatio = [1, 1, 1];\n }\n }\n } else {\n throw new Error('scene.js aspectRatio was not one of the enumerated types');\n }\n\n /*\n * Write aspect Ratio back to user data and fullLayout so that it is modifies as user\n * manipulates the aspectmode settings and the fullLayout is up-to-date.\n */\n fullSceneLayout.aspectratio.x = sceneLayout.aspectratio.x = aspectRatio[0];\n fullSceneLayout.aspectratio.y = sceneLayout.aspectratio.y = aspectRatio[1];\n fullSceneLayout.aspectratio.z = sceneLayout.aspectratio.z = aspectRatio[2];\n\n /*\n * Finally assign the computed aspecratio to the glplot module. This will have an effect\n * on the next render cycle.\n */\n scene.glplot.setAspectratio(fullSceneLayout.aspectratio);\n\n // save 'initial' aspectratio & aspectmode view settings for modebar buttons\n if(!scene.viewInitial.aspectratio) {\n scene.viewInitial.aspectratio = {\n x: fullSceneLayout.aspectratio.x,\n y: fullSceneLayout.aspectratio.y,\n z: fullSceneLayout.aspectratio.z\n };\n }\n if(!scene.viewInitial.aspectmode) {\n scene.viewInitial.aspectmode = fullSceneLayout.aspectmode;\n }\n\n // Update frame position for multi plots\n var domain = fullSceneLayout.domain || null;\n var size = fullLayout._size || null;\n\n if(domain && size) {\n var containerStyle = scene.container.style;\n containerStyle.position = 'absolute';\n containerStyle.left = (size.l + domain.x[0] * size.w) + 'px';\n containerStyle.top = (size.t + (1 - domain.y[1]) * size.h) + 'px';\n containerStyle.width = (size.w * (domain.x[1] - domain.x[0])) + 'px';\n containerStyle.height = (size.h * (domain.y[1] - domain.y[0])) + 'px';\n }\n\n // force redraw so that promise is returned when rendering is completed\n scene.glplot.redraw();\n};\n\nproto.destroy = function() {\n var scene = this;\n\n if(!scene.glplot) return;\n scene.camera.mouseListener.enabled = false;\n scene.container.removeEventListener('wheel', scene.camera.wheelListener);\n scene.camera = null;\n scene.glplot.dispose();\n scene.container.parentNode.removeChild(scene.container);\n scene.glplot = null;\n};\n\n// getCameraArrays :: plotly_coords -> gl-plot3d_coords\n// inverse of getLayoutCamera\nfunction getCameraArrays(camera) {\n return [\n [camera.eye.x, camera.eye.y, camera.eye.z],\n [camera.center.x, camera.center.y, camera.center.z],\n [camera.up.x, camera.up.y, camera.up.z]\n ];\n}\n\n// getLayoutCamera :: gl-plot3d_coords -> plotly_coords\n// inverse of getCameraArrays\nfunction getLayoutCamera(camera) {\n return {\n up: {x: camera.up[0], y: camera.up[1], z: camera.up[2]},\n center: {x: camera.center[0], y: camera.center[1], z: camera.center[2]},\n eye: {x: camera.eye[0], y: camera.eye[1], z: camera.eye[2]},\n projection: {type: (camera._ortho === true) ? 'orthographic' : 'perspective'}\n };\n}\n\n// get camera position in plotly coords from 'gl-plot3d' coords\nproto.getCamera = function() {\n var scene = this;\n scene.camera.view.recalcMatrix(scene.camera.view.lastT());\n return getLayoutCamera(scene.camera);\n};\n\n// set gl-plot3d camera position and scene aspects with a set of plotly coords\nproto.setViewport = function(sceneLayout) {\n var scene = this;\n var cameraData = sceneLayout.camera;\n\n scene.camera.lookAt.apply(this, getCameraArrays(cameraData));\n scene.glplot.setAspectratio(sceneLayout.aspectratio);\n\n var newOrtho = (cameraData.projection.type === 'orthographic');\n var oldOrtho = scene.camera._ortho;\n\n if(newOrtho !== oldOrtho) {\n scene.glplot.redraw(); // TODO: figure out why we need to redraw here?\n scene.glplot.clearRGBA();\n scene.glplot.dispose();\n scene.initializeGLPlot();\n }\n};\n\nproto.isCameraChanged = function(layout) {\n var scene = this;\n var cameraData = scene.getCamera();\n var cameraNestedProp = Lib.nestedProperty(layout, scene.id + '.camera');\n var cameraDataLastSave = cameraNestedProp.get();\n\n function same(x, y, i, j) {\n var vectors = ['up', 'center', 'eye'];\n var components = ['x', 'y', 'z'];\n return y[vectors[i]] && (x[vectors[i]][components[j]] === y[vectors[i]][components[j]]);\n }\n\n var changed = false;\n if(cameraDataLastSave === undefined) {\n changed = true;\n } else {\n for(var i = 0; i < 3; i++) {\n for(var j = 0; j < 3; j++) {\n if(!same(cameraData, cameraDataLastSave, i, j)) {\n changed = true;\n break;\n }\n }\n }\n\n if(!cameraDataLastSave.projection || (\n cameraData.projection &&\n cameraData.projection.type !== cameraDataLastSave.projection.type)) {\n changed = true;\n }\n }\n\n return changed;\n};\n\nproto.isAspectChanged = function(layout) {\n var scene = this;\n var aspectData = scene.glplot.getAspectratio();\n var aspectNestedProp = Lib.nestedProperty(layout, scene.id + '.aspectratio');\n var aspectDataLastSave = aspectNestedProp.get();\n\n return (\n aspectDataLastSave === undefined || (\n aspectDataLastSave.x !== aspectData.x ||\n aspectDataLastSave.y !== aspectData.y ||\n aspectDataLastSave.z !== aspectData.z\n ));\n};\n\n// save camera to user layout (i.e. gd.layout)\nproto.saveLayout = function(layout) {\n var scene = this;\n var fullLayout = scene.fullLayout;\n\n var cameraData;\n var cameraNestedProp;\n var cameraDataLastSave;\n\n var aspectData;\n var aspectNestedProp;\n var aspectDataLastSave;\n\n var cameraChanged = scene.isCameraChanged(layout);\n var aspectChanged = scene.isAspectChanged(layout);\n\n var hasChanged = cameraChanged || aspectChanged;\n if(hasChanged) {\n var preGUI = {};\n if(cameraChanged) {\n cameraData = scene.getCamera();\n cameraNestedProp = Lib.nestedProperty(layout, scene.id + '.camera');\n cameraDataLastSave = cameraNestedProp.get();\n\n preGUI[scene.id + '.camera'] = cameraDataLastSave;\n }\n if(aspectChanged) {\n aspectData = scene.glplot.getAspectratio();\n aspectNestedProp = Lib.nestedProperty(layout, scene.id + '.aspectratio');\n aspectDataLastSave = aspectNestedProp.get();\n\n preGUI[scene.id + '.aspectratio'] = aspectDataLastSave;\n }\n Registry.call('_storeDirectGUIEdit', layout, fullLayout._preGUI, preGUI);\n\n if(cameraChanged) {\n cameraNestedProp.set(cameraData);\n\n var cameraFullNP = Lib.nestedProperty(fullLayout, scene.id + '.camera');\n cameraFullNP.set(cameraData);\n }\n\n if(aspectChanged) {\n aspectNestedProp.set(aspectData);\n\n var aspectFullNP = Lib.nestedProperty(fullLayout, scene.id + '.aspectratio');\n aspectFullNP.set(aspectData);\n\n scene.glplot.redraw();\n }\n }\n\n return hasChanged;\n};\n\nproto.updateFx = function(dragmode, hovermode) {\n var scene = this;\n var camera = scene.camera;\n if(camera) {\n // rotate and orbital are synonymous\n if(dragmode === 'orbit') {\n camera.mode = 'orbit';\n camera.keyBindingMode = 'rotate';\n } else if(dragmode === 'turntable') {\n camera.up = [0, 0, 1];\n camera.mode = 'turntable';\n camera.keyBindingMode = 'rotate';\n\n // The setter for camera.mode animates the transition to z-up,\n // but only if we *don't* explicitly set z-up earlier via the\n // relayout. So push `up` back to layout & fullLayout manually now.\n var gd = scene.graphDiv;\n var fullLayout = gd._fullLayout;\n var fullCamera = scene.fullSceneLayout.camera;\n var x = fullCamera.up.x;\n var y = fullCamera.up.y;\n var z = fullCamera.up.z;\n // only push `up` back to (full)layout if it's going to change\n if(z / Math.sqrt(x * x + y * y + z * z) < 0.999) {\n var attr = scene.id + '.camera.up';\n var zUp = {x: 0, y: 0, z: 1};\n var edits = {};\n edits[attr] = zUp;\n var layout = gd.layout;\n Registry.call('_storeDirectGUIEdit', layout, fullLayout._preGUI, edits);\n fullCamera.up = zUp;\n Lib.nestedProperty(layout, attr).set(zUp);\n }\n } else {\n // none rotation modes [pan or zoom]\n camera.keyBindingMode = dragmode;\n }\n }\n\n // to put dragmode and hovermode on the same grounds from relayout\n scene.fullSceneLayout.hovermode = hovermode;\n};\n\nfunction flipPixels(pixels, w, h) {\n for(var i = 0, q = h - 1; i < q; ++i, --q) {\n for(var j = 0; j < w; ++j) {\n for(var k = 0; k < 4; ++k) {\n var a = 4 * (w * i + j) + k;\n var b = 4 * (w * q + j) + k;\n var tmp = pixels[a];\n pixels[a] = pixels[b];\n pixels[b] = tmp;\n }\n }\n }\n}\n\nfunction correctRGB(pixels, w, h) {\n for(var i = 0; i < h; ++i) {\n for(var j = 0; j < w; ++j) {\n var k = 4 * (w * i + j);\n\n var a = pixels[k + 3]; // alpha\n if(a > 0) {\n var q = 255 / a;\n\n for(var l = 0; l < 3; ++l) { // RGB\n pixels[k + l] = Math.min(q * pixels[k + l], 255);\n }\n }\n }\n }\n}\n\nproto.toImage = function(format) {\n var scene = this;\n\n if(!format) format = 'png';\n if(scene.staticMode) scene.container.appendChild(STATIC_CANVAS);\n\n // Force redraw\n scene.glplot.redraw();\n\n // Grab context and yank out pixels\n var gl = scene.glplot.gl;\n var w = gl.drawingBufferWidth;\n var h = gl.drawingBufferHeight;\n\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n\n var pixels = new Uint8Array(w * h * 4);\n gl.readPixels(0, 0, w, h, gl.RGBA, gl.UNSIGNED_BYTE, pixels);\n flipPixels(pixels, w, h);\n correctRGB(pixels, w, h);\n\n var canvas = document.createElement('canvas');\n canvas.width = w;\n canvas.height = h;\n var context = canvas.getContext('2d');\n var imageData = context.createImageData(w, h);\n imageData.data.set(pixels);\n context.putImageData(imageData, 0, 0);\n\n var dataURL;\n\n switch(format) {\n case 'jpeg':\n dataURL = canvas.toDataURL('image/jpeg');\n break;\n case 'webp':\n dataURL = canvas.toDataURL('image/webp');\n break;\n default:\n dataURL = canvas.toDataURL('image/png');\n }\n\n if(scene.staticMode) scene.container.removeChild(STATIC_CANVAS);\n\n return dataURL;\n};\n\nproto.setConvert = function() {\n var scene = this;\n for(var i = 0; i < 3; i++) {\n var ax = scene.fullSceneLayout[axisProperties[i]];\n Axes.setConvert(ax, scene.fullLayout);\n ax.setScale = Lib.noop;\n }\n};\n\nproto.make4thDimension = function() {\n var scene = this;\n var gd = scene.graphDiv;\n var fullLayout = gd._fullLayout;\n\n // mock axis for hover formatting\n scene._mockAxis = {\n type: 'linear',\n showexponent: 'all',\n exponentformat: 'B'\n };\n Axes.setConvert(scene._mockAxis, fullLayout);\n};\n\nmodule.exports = Scene;\n\n},{\"../../components/fx\":635,\"../../lib\":728,\"../../lib/show_no_webgl_msg\":749,\"../../lib/str2rgbarray\":751,\"../../plots/cartesian/axes\":776,\"../../registry\":859,\"./layout/convert\":822,\"./layout/spikes\":825,\"./layout/tick_marks\":826,\"./project\":827,\"gl-plot3d\":296,\"has-passive-events\":410,\"is-mobile\":420,\"webgl-context\":558}],829:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = function zip3(x, y, z, len) {\n len = len || x.length;\n\n var result = new Array(len);\n for(var i = 0; i < len; i++) {\n result[i] = [x[i], y[i], z[i]];\n }\n return result;\n};\n\n},{}],830:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar fontAttrs = _dereq_('./font_attributes');\nvar animationAttrs = _dereq_('./animation_attributes');\nvar colorAttrs = _dereq_('../components/color/attributes');\nvar drawNewShapeAttrs = _dereq_('../components/shapes/draw_newshape/attributes');\nvar padAttrs = _dereq_('./pad_attributes');\nvar extendFlat = _dereq_('../lib/extend').extendFlat;\n\nvar globalFont = fontAttrs({\n editType: 'calc',\n \n});\nglobalFont.family.dflt = '\"Open Sans\", verdana, arial, sans-serif';\nglobalFont.size.dflt = 12;\nglobalFont.color.dflt = colorAttrs.defaultLine;\n\nmodule.exports = {\n font: globalFont,\n title: {\n text: {\n valType: 'string',\n \n editType: 'layoutstyle',\n \n },\n font: fontAttrs({\n editType: 'layoutstyle',\n \n }),\n xref: {\n valType: 'enumerated',\n dflt: 'container',\n values: ['container', 'paper'],\n \n editType: 'layoutstyle',\n \n },\n yref: {\n valType: 'enumerated',\n dflt: 'container',\n values: ['container', 'paper'],\n \n editType: 'layoutstyle',\n \n },\n x: {\n valType: 'number',\n min: 0,\n max: 1,\n dflt: 0.5,\n \n editType: 'layoutstyle',\n \n },\n y: {\n valType: 'number',\n min: 0,\n max: 1,\n dflt: 'auto',\n \n editType: 'layoutstyle',\n \n },\n xanchor: {\n valType: 'enumerated',\n dflt: 'auto',\n values: ['auto', 'left', 'center', 'right'],\n \n editType: 'layoutstyle',\n \n },\n yanchor: {\n valType: 'enumerated',\n dflt: 'auto',\n values: ['auto', 'top', 'middle', 'bottom'],\n \n editType: 'layoutstyle',\n \n },\n pad: extendFlat(padAttrs({editType: 'layoutstyle'}), {\n \n }),\n editType: 'layoutstyle'\n },\n uniformtext: {\n mode: {\n valType: 'enumerated',\n values: [false, 'hide', 'show'],\n dflt: false,\n \n editType: 'plot',\n \n },\n minsize: {\n valType: 'number',\n min: 0,\n dflt: 0,\n \n editType: 'plot',\n \n },\n editType: 'plot'\n },\n autosize: {\n valType: 'boolean',\n \n dflt: false,\n // autosize, width, and height get special editType treatment in _relayout\n // so we can handle noop resizes more efficiently\n editType: 'none',\n \n },\n width: {\n valType: 'number',\n \n min: 10,\n dflt: 700,\n editType: 'plot',\n \n },\n height: {\n valType: 'number',\n \n min: 10,\n dflt: 450,\n editType: 'plot',\n \n },\n margin: {\n l: {\n valType: 'number',\n \n min: 0,\n dflt: 80,\n editType: 'plot',\n \n },\n r: {\n valType: 'number',\n \n min: 0,\n dflt: 80,\n editType: 'plot',\n \n },\n t: {\n valType: 'number',\n \n min: 0,\n dflt: 100,\n editType: 'plot',\n \n },\n b: {\n valType: 'number',\n \n min: 0,\n dflt: 80,\n editType: 'plot',\n \n },\n pad: {\n valType: 'number',\n \n min: 0,\n dflt: 0,\n editType: 'plot',\n \n },\n autoexpand: {\n valType: 'boolean',\n \n dflt: true,\n editType: 'plot',\n \n },\n editType: 'plot'\n },\n paper_bgcolor: {\n valType: 'color',\n \n dflt: colorAttrs.background,\n editType: 'plot',\n \n },\n plot_bgcolor: {\n // defined here, but set in cartesian.supplyLayoutDefaults\n // because it needs to know if there are (2D) axes or not\n valType: 'color',\n \n dflt: colorAttrs.background,\n editType: 'layoutstyle',\n \n },\n separators: {\n valType: 'string',\n \n editType: 'plot',\n \n },\n hidesources: {\n valType: 'boolean',\n \n dflt: false,\n editType: 'plot',\n \n },\n showlegend: {\n // handled in legend.supplyLayoutDefaults\n // but included here because it's not in the legend object\n valType: 'boolean',\n \n editType: 'legend',\n \n },\n colorway: {\n valType: 'colorlist',\n dflt: colorAttrs.defaults,\n \n editType: 'calc',\n \n },\n datarevision: {\n valType: 'any',\n \n editType: 'calc',\n \n },\n uirevision: {\n valType: 'any',\n \n editType: 'none',\n \n },\n editrevision: {\n valType: 'any',\n \n editType: 'none',\n \n },\n selectionrevision: {\n valType: 'any',\n \n editType: 'none',\n \n },\n template: {\n valType: 'any',\n \n editType: 'calc',\n \n },\n modebar: {\n orientation: {\n valType: 'enumerated',\n values: ['v', 'h'],\n dflt: 'h',\n \n editType: 'modebar',\n \n },\n bgcolor: {\n valType: 'color',\n \n editType: 'modebar',\n \n },\n color: {\n valType: 'color',\n \n editType: 'modebar',\n \n },\n activecolor: {\n valType: 'color',\n \n editType: 'modebar',\n \n },\n uirevision: {\n valType: 'any',\n \n editType: 'none',\n \n },\n editType: 'modebar'\n },\n\n newshape: drawNewShapeAttrs.newshape,\n activeshape: drawNewShapeAttrs.activeshape,\n\n meta: {\n valType: 'any',\n arrayOk: true,\n \n editType: 'plot',\n \n },\n\n transition: extendFlat({}, animationAttrs.transition, {\n \n editType: 'none'\n }),\n _deprecated: {\n title: {\n valType: 'string',\n \n editType: 'layoutstyle',\n \n },\n titlefont: fontAttrs({\n editType: 'layoutstyle',\n \n })\n }\n};\n\n},{\"../components/color/attributes\":594,\"../components/shapes/draw_newshape/attributes\":677,\"../lib/extend\":719,\"./animation_attributes\":771,\"./font_attributes\":804,\"./pad_attributes\":838}],831:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar requiredVersion = '1.10.1';\n\nvar stylesNonMapbox = {\n 'open-street-map': {\n id: 'osm',\n version: 8,\n sources: {\n 'plotly-osm-tiles': {\n type: 'raster',\n attribution: '© OpenStreetMap',\n tiles: [\n 'https://a.tile.openstreetmap.org/{z}/{x}/{y}.png',\n 'https://b.tile.openstreetmap.org/{z}/{x}/{y}.png'\n ],\n tileSize: 256\n }\n },\n layers: [{\n id: 'plotly-osm-tiles',\n type: 'raster',\n source: 'plotly-osm-tiles',\n minzoom: 0,\n maxzoom: 22\n }]\n },\n 'white-bg': {\n id: 'white-bg',\n version: 8,\n sources: {},\n layers: [{\n id: 'white-bg',\n type: 'background',\n paint: {'background-color': '#FFFFFF'},\n minzoom: 0,\n maxzoom: 22\n }]\n },\n 'carto-positron': {\n id: 'carto-positron',\n version: 8,\n sources: {\n 'plotly-carto-positron': {\n type: 'raster',\n attribution: '© CARTO',\n tiles: ['https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png'],\n tileSize: 256\n }\n },\n layers: [{\n id: 'plotly-carto-positron',\n type: 'raster',\n source: 'plotly-carto-positron',\n minzoom: 0,\n maxzoom: 22\n }]\n },\n 'carto-darkmatter': {\n id: 'carto-darkmatter',\n version: 8,\n sources: {\n 'plotly-carto-darkmatter': {\n type: 'raster',\n attribution: '© CARTO',\n tiles: ['https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png'],\n tileSize: 256\n }\n },\n layers: [{\n id: 'plotly-carto-darkmatter',\n type: 'raster',\n source: 'plotly-carto-darkmatter',\n minzoom: 0,\n maxzoom: 22\n }]\n },\n 'stamen-terrain': {\n id: 'stamen-terrain',\n version: 8,\n sources: {\n 'plotly-stamen-terrain': {\n type: 'raster',\n attribution: 'Map tiles by Stamen Design, under CC BY 3.0 | Data by OpenStreetMap, under ODbL.',\n tiles: ['https://stamen-tiles.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png'],\n tileSize: 256\n }\n },\n layers: [{\n id: 'plotly-stamen-terrain',\n type: 'raster',\n source: 'plotly-stamen-terrain',\n minzoom: 0,\n maxzoom: 22\n }]\n },\n 'stamen-toner': {\n id: 'stamen-toner',\n version: 8,\n sources: {\n 'plotly-stamen-toner': {\n type: 'raster',\n attribution: 'Map tiles by Stamen Design, under CC BY 3.0 | Data by OpenStreetMap, under ODbL.',\n tiles: ['https://stamen-tiles.a.ssl.fastly.net/toner/{z}/{x}/{y}.png'],\n tileSize: 256\n }\n },\n layers: [{\n id: 'plotly-stamen-toner',\n type: 'raster',\n source: 'plotly-stamen-toner',\n minzoom: 0,\n maxzoom: 22\n }]\n },\n 'stamen-watercolor': {\n id: 'stamen-watercolor',\n version: 8,\n sources: {\n 'plotly-stamen-watercolor': {\n type: 'raster',\n attribution: 'Map tiles by Stamen Design, under CC BY 3.0 | Data by OpenStreetMap, under CC BY SA.',\n tiles: ['https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png'],\n tileSize: 256\n }\n },\n layers: [{\n id: 'plotly-stamen-watercolor',\n type: 'raster',\n source: 'plotly-stamen-watercolor',\n minzoom: 0,\n maxzoom: 22\n }]\n }\n};\n\nvar styleValuesNonMapbox = Object.keys(stylesNonMapbox);\n\nmodule.exports = {\n requiredVersion: requiredVersion,\n\n styleUrlPrefix: 'mapbox://styles/mapbox/',\n styleUrlSuffix: 'v9',\n\n styleValuesMapbox: ['basic', 'streets', 'outdoors', 'light', 'dark', 'satellite', 'satellite-streets'],\n styleValueDflt: 'basic',\n stylesNonMapbox: stylesNonMapbox,\n styleValuesNonMapbox: styleValuesNonMapbox,\n\n traceLayerPrefix: 'plotly-trace-layer-',\n layoutLayerPrefix: 'plotly-layout-layer-',\n\n wrongVersionErrorMsg: [\n 'Your custom plotly.js bundle is not using the correct mapbox-gl version',\n 'Please install mapbox-gl@' + requiredVersion + '.'\n ].join('\\n'),\n\n noAccessTokenErrorMsg: [\n 'Missing Mapbox access token.',\n 'Mapbox trace type require a Mapbox access token to be registered.',\n 'For example:',\n ' Plotly.plot(gd, data, layout, { mapboxAccessToken: \\'my-access-token\\' });',\n 'More info here: https://www.mapbox.com/help/define-access-token/'\n ].join('\\n'),\n\n missingStyleErrorMsg: [\n 'No valid mapbox style found, please set `mapbox.style` to one of:',\n styleValuesNonMapbox.join(', '),\n 'or register a Mapbox access token to use a Mapbox-served style.'\n ].join('\\n'),\n\n multipleTokensErrorMsg: [\n 'Set multiple mapbox access token across different mapbox subplot,',\n 'using first token found as mapbox-gl does not allow multiple' +\n 'access tokens on the same page.'\n ].join('\\n'),\n\n mapOnErrorMsg: 'Mapbox error.',\n\n // Mapbox logo for static export\n mapboxLogo: {\n path0: 'm 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z',\n path1: 'M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z',\n path2: 'M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z',\n polygon: '11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34'\n },\n\n // a subset of node_modules/mapbox-gl/dist/mapbox-gl.css\n styleRules: {\n map: 'overflow:hidden;position:relative;',\n 'missing-css': 'display:none;',\n 'canary': 'background-color:salmon;',\n\n // Reusing CSS directives from: https://api.tiles.mapbox.com/mapbox-gl-js/v1.1.1/mapbox-gl.css\n 'ctrl-bottom-left': 'position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;',\n 'ctrl-bottom-right': 'position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;',\n 'ctrl': 'clear: both; pointer-events: auto; transform: translate(0, 0);',\n\n // Compact ctrl\n 'ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner': 'display: none;',\n 'ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner': 'display: block; margin-top:2px',\n 'ctrl-attrib.mapboxgl-compact:hover': 'padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;',\n 'ctrl-attrib.mapboxgl-compact::after': 'content: \"\"; cursor: pointer; position: absolute; background-image: url(\\'data:image/svg+xml;charset=utf-8,%3Csvg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"%3E %3Cpath fill=\"%23333333\" fill-rule=\"evenodd\" d=\"M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0\"/%3E %3C/svg%3E\\'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;',\n 'ctrl-attrib.mapboxgl-compact': 'min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;',\n 'ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after': 'bottom: 0; right: 0',\n 'ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after': 'bottom: 0; left: 0',\n\n 'ctrl-bottom-left .mapboxgl-ctrl': 'margin: 0 0 10px 10px; float: left;',\n 'ctrl-bottom-right .mapboxgl-ctrl': 'margin: 0 10px 10px 0; float: right;',\n\n 'ctrl-attrib': 'color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px',\n 'ctrl-attrib a': 'color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px',\n 'ctrl-attrib a:hover': 'color: inherit; text-decoration: underline;',\n\n 'ctrl-attrib .mapbox-improve-map': 'font-weight: bold; margin-left: 2px;',\n 'attrib-empty': 'display: none;',\n\n // Compact Mapbox logo without text\n 'ctrl-logo': 'display:block; width: 21px; height: 21px; background-image: url(\\'data:image/svg+xml;charset=utf-8,%3C?xml version=\"1.0\" encoding=\"utf-8\"?%3E %3Csvg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" viewBox=\"0 0 21 21\" style=\"enable-background:new 0 0 21 21;\" xml:space=\"preserve\"%3E%3Cg transform=\"translate(0,0.01)\"%3E%3Cpath d=\"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z\" style=\"opacity:0.9;fill:%23ffffff;enable-background:new\" class=\"st0\"/%3E%3Cpath d=\"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z\" style=\"opacity:0.35;enable-background:new\" class=\"st1\"/%3E%3Cpath d=\"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z\" style=\"opacity:0.35;enable-background:new\" class=\"st1\"/%3E%3Cpolygon points=\"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 \" style=\"opacity:0.9;fill:%23ffffff;enable-background:new\" class=\"st0\"/%3E%3C/g%3E%3C/svg%3E\\')'\n\n // Mapbox logo WITH text below (commented out for now)\n // 'ctrl-logo': 'width: 85px; height: 21px; margin: 0 0 -3px -3px; display: block; background-repeat: no-repeat; cursor: pointer; background-image: url(\\'data:image/svg+xml;charset=utf-8,%3C?xml version=\"1.0\" encoding=\"utf-8\"?%3E%3Csvg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" viewBox=\"0 0 84.49 21\" style=\"enable-background:new 0 0 84.49 21;\" xml:space=\"preserve\"%3E%3Cg%3E %3Cpath class=\"st0\" style=\"opacity:0.9; fill: %23FFFFFF; enable-background: new;\" d=\"M83.25,14.26c0,0.12-0.09,0.21-0.21,0.21h-1.61c-0.13,0-0.24-0.06-0.3-0.17l-1.44-2.39l-1.44,2.39 c-0.06,0.11-0.18,0.17-0.3,0.17h-1.61c-0.04,0-0.08-0.01-0.12-0.03c-0.09-0.06-0.13-0.19-0.06-0.28l0,0l2.43-3.68L76.2,6.84 c-0.02-0.03-0.03-0.07-0.03-0.12c0-0.12,0.09-0.21,0.21-0.21h1.61c0.13,0,0.24,0.06,0.3,0.17l1.41,2.36l1.4-2.35 c0.06-0.11,0.18-0.17,0.3-0.17H83c0.04,0,0.08,0.01,0.12,0.03c0.09,0.06,0.13,0.19,0.06,0.28l0,0l-2.37,3.63l2.43,3.67 C83.24,14.18,83.25,14.22,83.25,14.26z\"/%3E %3Cpath class=\"st0\" style=\"opacity:0.9; fill: %23FFFFFF; enable-background: new;\" d=\"M66.24,9.59c-0.39-1.88-1.96-3.28-3.84-3.28c-1.03,0-2.03,0.42-2.73,1.18V3.51c0-0.13-0.1-0.23-0.23-0.23h-1.4 c-0.13,0-0.23,0.11-0.23,0.23v10.72c0,0.13,0.1,0.23,0.23,0.23h1.4c0.13,0,0.23-0.11,0.23-0.23V13.5c0.71,0.75,1.7,1.18,2.73,1.18 c1.88,0,3.45-1.41,3.84-3.29C66.37,10.79,66.37,10.18,66.24,9.59L66.24,9.59z M62.08,13c-1.32,0-2.39-1.11-2.41-2.48v-0.06 c0.02-1.38,1.09-2.48,2.41-2.48s2.42,1.12,2.42,2.51S63.41,13,62.08,13z\"/%3E %3Cpath class=\"st0\" style=\"opacity:0.9; fill: %23FFFFFF; enable-background: new;\" d=\"M71.67,6.32c-1.98-0.01-3.72,1.35-4.16,3.29c-0.13,0.59-0.13,1.19,0,1.77c0.44,1.94,2.17,3.32,4.17,3.3 c2.35,0,4.26-1.87,4.26-4.19S74.04,6.32,71.67,6.32z M71.65,13.01c-1.33,0-2.42-1.12-2.42-2.51s1.08-2.52,2.42-2.52 c1.33,0,2.42,1.12,2.42,2.51S72.99,13,71.65,13.01L71.65,13.01z\"/%3E %3Cpath class=\"st1\" style=\"opacity:0.35; enable-background:new;\" d=\"M62.08,7.98c-1.32,0-2.39,1.11-2.41,2.48v0.06C59.68,11.9,60.75,13,62.08,13s2.42-1.12,2.42-2.51 S63.41,7.98,62.08,7.98z M62.08,11.76c-0.63,0-1.14-0.56-1.17-1.25v-0.04c0.01-0.69,0.54-1.25,1.17-1.25 c0.63,0,1.17,0.57,1.17,1.27C63.24,11.2,62.73,11.76,62.08,11.76z\"/%3E %3Cpath class=\"st1\" style=\"opacity:0.35; enable-background:new;\" d=\"M71.65,7.98c-1.33,0-2.42,1.12-2.42,2.51S70.32,13,71.65,13s2.42-1.12,2.42-2.51S72.99,7.98,71.65,7.98z M71.65,11.76c-0.64,0-1.17-0.57-1.17-1.27c0-0.7,0.53-1.26,1.17-1.26s1.17,0.57,1.17,1.27C72.82,11.21,72.29,11.76,71.65,11.76z\"/%3E %3Cpath class=\"st0\" style=\"opacity:0.9; fill: %23FFFFFF; enable-background: new;\" d=\"M45.74,6.53h-1.4c-0.13,0-0.23,0.11-0.23,0.23v0.73c-0.71-0.75-1.7-1.18-2.73-1.18 c-2.17,0-3.94,1.87-3.94,4.19s1.77,4.19,3.94,4.19c1.04,0,2.03-0.43,2.73-1.19v0.73c0,0.13,0.1,0.23,0.23,0.23h1.4 c0.13,0,0.23-0.11,0.23-0.23V6.74c0-0.12-0.09-0.22-0.22-0.22C45.75,6.53,45.75,6.53,45.74,6.53z M44.12,10.53 C44.11,11.9,43.03,13,41.71,13s-2.42-1.12-2.42-2.51s1.08-2.52,2.4-2.52c1.33,0,2.39,1.11,2.41,2.48L44.12,10.53z\"/%3E %3Cpath class=\"st1\" style=\"opacity:0.35; enable-background:new;\" d=\"M41.71,7.98c-1.33,0-2.42,1.12-2.42,2.51S40.37,13,41.71,13s2.39-1.11,2.41-2.48v-0.06 C44.1,9.09,43.03,7.98,41.71,7.98z M40.55,10.49c0-0.7,0.52-1.27,1.17-1.27c0.64,0,1.14,0.56,1.17,1.25v0.04 c-0.01,0.68-0.53,1.24-1.17,1.24C41.08,11.75,40.55,11.19,40.55,10.49z\"/%3E %3Cpath class=\"st0\" style=\"opacity:0.9; fill: %23FFFFFF; enable-background: new;\" d=\"M52.41,6.32c-1.03,0-2.03,0.42-2.73,1.18V6.75c0-0.13-0.1-0.23-0.23-0.23h-1.4c-0.13,0-0.23,0.11-0.23,0.23 v10.72c0,0.13,0.1,0.23,0.23,0.23h1.4c0.13,0,0.23-0.1,0.23-0.23V13.5c0.71,0.75,1.7,1.18,2.74,1.18c2.17,0,3.94-1.87,3.94-4.19 S54.58,6.32,52.41,6.32z M52.08,13.01c-1.32,0-2.39-1.11-2.42-2.48v-0.07c0.02-1.38,1.09-2.49,2.4-2.49c1.32,0,2.41,1.12,2.41,2.51 S53.4,13,52.08,13.01L52.08,13.01z\"/%3E %3Cpath class=\"st1\" style=\"opacity:0.35; enable-background:new;\" d=\"M52.08,7.98c-1.32,0-2.39,1.11-2.42,2.48v0.06c0.03,1.38,1.1,2.48,2.42,2.48s2.41-1.12,2.41-2.51 S53.4,7.98,52.08,7.98z M52.08,11.76c-0.63,0-1.14-0.56-1.17-1.25v-0.04c0.01-0.69,0.54-1.25,1.17-1.25c0.63,0,1.17,0.58,1.17,1.27 S52.72,11.76,52.08,11.76z\"/%3E %3Cpath class=\"st0\" style=\"opacity:0.9; fill: %23FFFFFF; enable-background: new;\" d=\"M36.08,14.24c0,0.13-0.1,0.23-0.23,0.23h-1.41c-0.13,0-0.23-0.11-0.23-0.23V9.68c0-0.98-0.74-1.71-1.62-1.71 c-0.8,0-1.46,0.7-1.59,1.62l0.01,4.66c0,0.13-0.11,0.23-0.23,0.23h-1.41c-0.13,0-0.23-0.11-0.23-0.23V9.68 c0-0.98-0.74-1.71-1.62-1.71c-0.85,0-1.54,0.79-1.6,1.8v4.48c0,0.13-0.1,0.23-0.23,0.23h-1.4c-0.13,0-0.23-0.11-0.23-0.23V6.74 c0.01-0.13,0.1-0.22,0.23-0.22h1.4c0.13,0,0.22,0.11,0.23,0.22V7.4c0.5-0.68,1.3-1.09,2.16-1.1h0.03c1.09,0,2.09,0.6,2.6,1.55 c0.45-0.95,1.4-1.55,2.44-1.56c1.62,0,2.93,1.25,2.9,2.78L36.08,14.24z\"/%3E %3Cpath class=\"st1\" style=\"opacity:0.35; enable-background:new;\" d=\"M84.34,13.59l-0.07-0.13l-1.96-2.99l1.94-2.95c0.44-0.67,0.26-1.56-0.41-2.02c-0.02,0-0.03,0-0.04-0.01 c-0.23-0.15-0.5-0.22-0.78-0.22h-1.61c-0.56,0-1.08,0.29-1.37,0.78L79.72,6.6l-0.34-0.56C79.09,5.56,78.57,5.27,78,5.27h-1.6 c-0.6,0-1.13,0.37-1.35,0.92c-2.19-1.66-5.28-1.47-7.26,0.45c-0.35,0.34-0.65,0.72-0.89,1.14c-0.9-1.62-2.58-2.72-4.5-2.72 c-0.5,0-1.01,0.07-1.48,0.23V3.51c0-0.82-0.66-1.48-1.47-1.48h-1.4c-0.81,0-1.47,0.66-1.47,1.47v3.75 c-0.95-1.36-2.5-2.18-4.17-2.19c-0.74,0-1.46,0.16-2.12,0.47c-0.24-0.17-0.54-0.26-0.84-0.26h-1.4c-0.45,0-0.87,0.21-1.15,0.56 c-0.02-0.03-0.04-0.05-0.07-0.08c-0.28-0.3-0.68-0.47-1.09-0.47h-1.39c-0.3,0-0.6,0.09-0.84,0.26c-0.67-0.3-1.39-0.46-2.12-0.46 c-1.83,0-3.43,1-4.37,2.5c-0.2-0.46-0.48-0.89-0.83-1.25c-0.8-0.81-1.89-1.25-3.02-1.25h-0.01c-0.89,0.01-1.75,0.33-2.46,0.88 c-0.74-0.57-1.64-0.88-2.57-0.88H28.1c-0.29,0-0.58,0.03-0.86,0.11c-0.28,0.06-0.56,0.16-0.82,0.28c-0.21-0.12-0.45-0.18-0.7-0.18 h-1.4c-0.82,0-1.47,0.66-1.47,1.47v7.5c0,0.82,0.66,1.47,1.47,1.47h1.4c0.82,0,1.48-0.66,1.48-1.48l0,0V9.79 c0.03-0.36,0.23-0.59,0.36-0.59c0.18,0,0.38,0.18,0.38,0.47v4.57c0,0.82,0.66,1.47,1.47,1.47h1.41c0.82,0,1.47-0.66,1.47-1.47 l-0.01-4.57c0.06-0.32,0.25-0.47,0.35-0.47c0.18,0,0.38,0.18,0.38,0.47v4.57c0,0.82,0.66,1.47,1.47,1.47h1.41 c0.82,0,1.47-0.66,1.47-1.47v-0.38c0.96,1.29,2.46,2.06,4.06,2.06c0.74,0,1.46-0.16,2.12-0.47c0.24,0.17,0.54,0.26,0.84,0.26h1.39 c0.3,0,0.6-0.09,0.84-0.26v2.01c0,0.82,0.66,1.47,1.47,1.47h1.4c0.82,0,1.47-0.66,1.47-1.47v-1.77c0.48,0.15,0.99,0.23,1.49,0.22 c1.7,0,3.22-0.87,4.17-2.2v0.52c0,0.82,0.66,1.47,1.47,1.47h1.4c0.3,0,0.6-0.09,0.84-0.26c0.66,0.31,1.39,0.47,2.12,0.47 c1.92,0,3.6-1.1,4.49-2.73c1.54,2.65,4.95,3.53,7.58,1.98c0.18-0.11,0.36-0.22,0.53-0.36c0.22,0.55,0.76,0.91,1.35,0.9H78 c0.56,0,1.08-0.29,1.37-0.78l0.37-0.61l0.37,0.61c0.29,0.48,0.81,0.78,1.38,0.78h1.6c0.81,0,1.46-0.66,1.45-1.46 C84.49,14.02,84.44,13.8,84.34,13.59L84.34,13.59z M35.86,14.47h-1.41c-0.13,0-0.23-0.11-0.23-0.23V9.68 c0-0.98-0.74-1.71-1.62-1.71c-0.8,0-1.46,0.7-1.59,1.62l0.01,4.66c0,0.13-0.1,0.23-0.23,0.23h-1.41c-0.13,0-0.23-0.11-0.23-0.23 V9.68c0-0.98-0.74-1.71-1.62-1.71c-0.85,0-1.54,0.79-1.6,1.8v4.48c0,0.13-0.1,0.23-0.23,0.23h-1.4c-0.13,0-0.23-0.11-0.23-0.23 V6.74c0.01-0.13,0.11-0.22,0.23-0.22h1.4c0.13,0,0.22,0.11,0.23,0.22V7.4c0.5-0.68,1.3-1.09,2.16-1.1h0.03 c1.09,0,2.09,0.6,2.6,1.55c0.45-0.95,1.4-1.55,2.44-1.56c1.62,0,2.93,1.25,2.9,2.78l0.01,5.16C36.09,14.36,35.98,14.46,35.86,14.47 L35.86,14.47z M45.97,14.24c0,0.13-0.1,0.23-0.23,0.23h-1.4c-0.13,0-0.23-0.11-0.23-0.23V13.5c-0.7,0.76-1.69,1.18-2.72,1.18 c-2.17,0-3.94-1.87-3.94-4.19s1.77-4.19,3.94-4.19c1.03,0,2.02,0.43,2.73,1.18V6.74c0-0.13,0.1-0.23,0.23-0.23h1.4 c0.12-0.01,0.22,0.08,0.23,0.21c0,0.01,0,0.01,0,0.02v7.51h-0.01V14.24z M52.41,14.67c-1.03,0-2.02-0.43-2.73-1.18v3.97 c0,0.13-0.1,0.23-0.23,0.23h-1.4c-0.13,0-0.23-0.1-0.23-0.23V6.75c0-0.13,0.1-0.22,0.23-0.22h1.4c0.13,0,0.23,0.11,0.23,0.23v0.73 c0.71-0.76,1.7-1.18,2.73-1.18c2.17,0,3.94,1.86,3.94,4.18S54.58,14.67,52.41,14.67z M66.24,11.39c-0.39,1.87-1.96,3.29-3.84,3.29 c-1.03,0-2.02-0.43-2.73-1.18v0.73c0,0.13-0.1,0.23-0.23,0.23h-1.4c-0.13,0-0.23-0.11-0.23-0.23V3.51c0-0.13,0.1-0.23,0.23-0.23 h1.4c0.13,0,0.23,0.11,0.23,0.23v3.97c0.71-0.75,1.7-1.18,2.73-1.17c1.88,0,3.45,1.4,3.84,3.28C66.37,10.19,66.37,10.8,66.24,11.39 L66.24,11.39L66.24,11.39z M71.67,14.68c-2,0.01-3.73-1.35-4.17-3.3c-0.13-0.59-0.13-1.19,0-1.77c0.44-1.94,2.17-3.31,4.17-3.3 c2.36,0,4.26,1.87,4.26,4.19S74.03,14.68,71.67,14.68L71.67,14.68z M83.04,14.47h-1.61c-0.13,0-0.24-0.06-0.3-0.17l-1.44-2.39 l-1.44,2.39c-0.06,0.11-0.18,0.17-0.3,0.17h-1.61c-0.04,0-0.08-0.01-0.12-0.03c-0.09-0.06-0.13-0.19-0.06-0.28l0,0l2.43-3.68 L76.2,6.84c-0.02-0.03-0.03-0.07-0.03-0.12c0-0.12,0.09-0.21,0.21-0.21h1.61c0.13,0,0.24,0.06,0.3,0.17l1.41,2.36l1.41-2.36 c0.06-0.11,0.18-0.17,0.3-0.17h1.61c0.04,0,0.08,0.01,0.12,0.03c0.09,0.06,0.13,0.19,0.06,0.28l0,0l-2.38,3.64l2.43,3.67 c0.02,0.03,0.03,0.07,0.03,0.12C83.25,14.38,83.16,14.47,83.04,14.47L83.04,14.47L83.04,14.47z\"/%3E %3Cpath class=\"st0\" style=\"opacity:0.9; fill: %23FFFFFF; enable-background: new;\" d=\"M10.5,1.24c-5.11,0-9.25,4.15-9.25,9.25s4.15,9.25,9.25,9.25s9.25-4.15,9.25-9.25 C19.75,5.38,15.61,1.24,10.5,1.24z M14.89,12.77c-1.93,1.93-4.78,2.31-6.7,2.31c-0.7,0-1.41-0.05-2.1-0.16c0,0-1.02-5.64,2.14-8.81 c0.83-0.83,1.95-1.28,3.13-1.28c1.27,0,2.49,0.51,3.39,1.42C16.59,8.09,16.64,11,14.89,12.77z\"/%3E %3Cpath class=\"st1\" style=\"opacity:0.35; enable-background:new;\" d=\"M10.5-0.01C4.7-0.01,0,4.7,0,10.49s4.7,10.5,10.5,10.5S21,16.29,21,10.49C20.99,4.7,16.3-0.01,10.5-0.01z M10.5,19.74c-5.11,0-9.25-4.15-9.25-9.25s4.14-9.26,9.25-9.26s9.25,4.15,9.25,9.25C19.75,15.61,15.61,19.74,10.5,19.74z\"/%3E %3Cpath class=\"st1\" style=\"opacity:0.35; enable-background:new;\" d=\"M14.74,6.25C12.9,4.41,9.98,4.35,8.23,6.1c-3.16,3.17-2.14,8.81-2.14,8.81s5.64,1.02,8.81-2.14 C16.64,11,16.59,8.09,14.74,6.25z M12.47,10.34l-0.91,1.87l-0.9-1.87L8.8,9.43l1.86-0.9l0.9-1.87l0.91,1.87l1.86,0.9L12.47,10.34z\"/%3E %3Cpolygon class=\"st0\" style=\"opacity:0.9; fill: %23FFFFFF; enable-background: new;\" points=\"14.33,9.43 12.47,10.34 11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 \"/%3E%3C/g%3E%3C/svg%3E\\');'\n }\n};\n\n},{}],832:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\n/**\n * Convert plotly.js 'textposition' to mapbox-gl 'anchor' and 'offset'\n * (with the help of the icon size).\n *\n * @param {string} textpostion : plotly.js textposition value\n * @param {number} iconSize : plotly.js icon size (e.g. marker.size for traces)\n *\n * @return {object}\n * - anchor\n * - offset\n */\nmodule.exports = function convertTextOpts(textposition, iconSize) {\n var parts = textposition.split(' ');\n var vPos = parts[0];\n var hPos = parts[1];\n\n // ballpack values\n var factor = Lib.isArrayOrTypedArray(iconSize) ? Lib.mean(iconSize) : iconSize;\n var xInc = 0.5 + (factor / 100);\n var yInc = 1.5 + (factor / 100);\n\n var anchorVals = ['', ''];\n var offset = [0, 0];\n\n switch(vPos) {\n case 'top':\n anchorVals[0] = 'top';\n offset[1] = -yInc;\n break;\n case 'bottom':\n anchorVals[0] = 'bottom';\n offset[1] = yInc;\n break;\n }\n\n switch(hPos) {\n case 'left':\n anchorVals[1] = 'right';\n offset[0] = -xInc;\n break;\n case 'right':\n anchorVals[1] = 'left';\n offset[0] = xInc;\n break;\n }\n\n // Mapbox text-anchor must be one of:\n // center, left, right, top, bottom,\n // top-left, top-right, bottom-left, bottom-right\n\n var anchor;\n if(anchorVals[0] && anchorVals[1]) anchor = anchorVals.join('-');\n else if(anchorVals[0]) anchor = anchorVals[0];\n else if(anchorVals[1]) anchor = anchorVals[1];\n else anchor = 'center';\n\n return { anchor: anchor, offset: offset };\n};\n\n},{\"../../lib\":728}],833:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar mapboxgl = _dereq_('mapbox-gl');\n\nvar Lib = _dereq_('../../lib');\nvar getSubplotCalcData = _dereq_('../../plots/get_data').getSubplotCalcData;\nvar xmlnsNamespaces = _dereq_('../../constants/xmlns_namespaces');\nvar d3 = _dereq_('d3');\nvar Drawing = _dereq_('../../components/drawing');\nvar svgTextUtils = _dereq_('../../lib/svg_text_utils');\n\nvar Mapbox = _dereq_('./mapbox');\n\nvar MAPBOX = 'mapbox';\n\nvar constants = exports.constants = _dereq_('./constants');\n\nexports.name = MAPBOX;\n\nexports.attr = 'subplot';\n\nexports.idRoot = MAPBOX;\n\nexports.idRegex = exports.attrRegex = Lib.counterRegex(MAPBOX);\n\nexports.attributes = {\n subplot: {\n valType: 'subplotid',\n \n dflt: 'mapbox',\n editType: 'calc',\n \n }\n};\n\nexports.layoutAttributes = _dereq_('./layout_attributes');\n\nexports.supplyLayoutDefaults = _dereq_('./layout_defaults');\n\nexports.plot = function plot(gd) {\n var fullLayout = gd._fullLayout;\n var calcData = gd.calcdata;\n var mapboxIds = fullLayout._subplots[MAPBOX];\n\n if(mapboxgl.version !== constants.requiredVersion) {\n throw new Error(constants.wrongVersionErrorMsg);\n }\n\n var accessToken = findAccessToken(gd, mapboxIds);\n mapboxgl.accessToken = accessToken;\n\n for(var i = 0; i < mapboxIds.length; i++) {\n var id = mapboxIds[i];\n var subplotCalcData = getSubplotCalcData(calcData, MAPBOX, id);\n var opts = fullLayout[id];\n var mapbox = opts._subplot;\n\n if(!mapbox) {\n mapbox = new Mapbox(gd, id);\n fullLayout[id]._subplot = mapbox;\n }\n\n if(!mapbox.viewInitial) {\n mapbox.viewInitial = {\n center: Lib.extendFlat({}, opts.center),\n zoom: opts.zoom,\n bearing: opts.bearing,\n pitch: opts.pitch\n };\n }\n\n mapbox.plot(subplotCalcData, fullLayout, gd._promises);\n }\n};\n\nexports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) {\n var oldMapboxKeys = oldFullLayout._subplots[MAPBOX] || [];\n\n for(var i = 0; i < oldMapboxKeys.length; i++) {\n var oldMapboxKey = oldMapboxKeys[i];\n\n if(!newFullLayout[oldMapboxKey] && !!oldFullLayout[oldMapboxKey]._subplot) {\n oldFullLayout[oldMapboxKey]._subplot.destroy();\n }\n }\n};\n\nexports.toSVG = function(gd) {\n var fullLayout = gd._fullLayout;\n var subplotIds = fullLayout._subplots[MAPBOX];\n var size = fullLayout._size;\n\n for(var i = 0; i < subplotIds.length; i++) {\n var opts = fullLayout[subplotIds[i]];\n var domain = opts.domain;\n var mapbox = opts._subplot;\n\n var imageData = mapbox.toImage('png');\n var image = fullLayout._glimages.append('svg:image');\n\n image.attr({\n xmlns: xmlnsNamespaces.svg,\n 'xlink:href': imageData,\n x: size.l + size.w * domain.x[0],\n y: size.t + size.h * (1 - domain.y[1]),\n width: size.w * (domain.x[1] - domain.x[0]),\n height: size.h * (domain.y[1] - domain.y[0]),\n preserveAspectRatio: 'none'\n });\n\n var subplotDiv = d3.select(opts._subplot.div);\n\n // Append logo if visible\n var hidden = subplotDiv.select('.mapboxgl-ctrl-logo').node().offsetParent === null;\n if(!hidden) {\n var logo = fullLayout._glimages.append('g');\n logo.attr('transform', 'translate(' + (size.l + size.w * domain.x[0] + 10) + ', ' + (size.t + size.h * (1 - domain.y[0]) - 31) + ')');\n logo.append('path')\n .attr('d', constants.mapboxLogo.path0)\n .style({\n opacity: 0.9,\n fill: '#ffffff',\n 'enable-background': 'new'\n });\n\n logo.append('path')\n .attr('d', constants.mapboxLogo.path1)\n .style('opacity', 0.35)\n .style('enable-background', 'new');\n\n logo.append('path')\n .attr('d', constants.mapboxLogo.path2)\n .style('opacity', 0.35)\n .style('enable-background', 'new');\n\n logo.append('polygon')\n .attr('points', constants.mapboxLogo.polygon)\n .style({\n opacity: 0.9,\n fill: '#ffffff',\n 'enable-background': 'new'\n });\n }\n\n // Add attributions\n var attributions = subplotDiv\n .select('.mapboxgl-ctrl-attrib').text()\n .replace('Improve this map', '');\n\n var attributionGroup = fullLayout._glimages.append('g');\n\n var attributionText = attributionGroup.append('text');\n attributionText\n .text(attributions)\n .classed('static-attribution', true)\n .attr({\n 'font-size': 12,\n 'font-family': 'Arial',\n 'color': 'rgba(0, 0, 0, 0.75)',\n 'text-anchor': 'end',\n 'data-unformatted': attributions\n });\n\n var bBox = Drawing.bBox(attributionText.node());\n\n // Break into multiple lines twice larger than domain\n var maxWidth = size.w * (domain.x[1] - domain.x[0]);\n if((bBox.width > maxWidth / 2)) {\n var multilineAttributions = attributions.split('|').join('
');\n attributionText\n .text(multilineAttributions)\n .attr('data-unformatted', multilineAttributions)\n .call(svgTextUtils.convertToTspans, gd);\n\n bBox = Drawing.bBox(attributionText.node());\n }\n attributionText.attr('transform', 'translate(-3, ' + (-bBox.height + 8) + ')');\n\n // Draw white rectangle behind text\n attributionGroup\n .insert('rect', '.static-attribution')\n .attr({\n x: -bBox.width - 6,\n y: -bBox.height - 3,\n width: bBox.width + 6,\n height: bBox.height + 3,\n fill: 'rgba(255, 255, 255, 0.75)'\n });\n\n // Scale down if larger than domain\n var scaleRatio = 1;\n if((bBox.width + 6) > maxWidth) scaleRatio = maxWidth / (bBox.width + 6);\n\n var offset = [(size.l + size.w * domain.x[1]), (size.t + size.h * (1 - domain.y[0]))];\n attributionGroup.attr('transform', 'translate(' + offset[0] + ',' + offset[1] + ') scale(' + scaleRatio + ')');\n }\n};\n\n// N.B. mapbox-gl only allows one accessToken to be set per page:\n// https://github.com/mapbox/mapbox-gl-js/issues/6331\nfunction findAccessToken(gd, mapboxIds) {\n var fullLayout = gd._fullLayout;\n var context = gd._context;\n\n // special case for Mapbox Atlas users\n if(context.mapboxAccessToken === '') return '';\n\n var tokensUseful = [];\n var tokensListed = [];\n var hasOneSetMapboxStyle = false;\n var wontWork = false;\n\n // Take the first token we find in a mapbox subplot.\n // These default to the context value but may be overridden.\n for(var i = 0; i < mapboxIds.length; i++) {\n var opts = fullLayout[mapboxIds[i]];\n var token = opts.accesstoken;\n\n if(isMapboxStyle(opts.style)) {\n if(token) {\n Lib.pushUnique(tokensUseful, token);\n } else {\n if(isMapboxStyle(opts._input.style)) {\n Lib.error('Uses Mapbox map style, but did not set an access token.');\n hasOneSetMapboxStyle = true;\n }\n wontWork = true;\n }\n }\n\n if(token) {\n Lib.pushUnique(tokensListed, token);\n }\n }\n\n if(wontWork) {\n var msg = hasOneSetMapboxStyle ?\n constants.noAccessTokenErrorMsg :\n constants.missingStyleErrorMsg;\n Lib.error(msg);\n throw new Error(msg);\n }\n\n if(tokensUseful.length) {\n if(tokensUseful.length > 1) {\n Lib.warn(constants.multipleTokensErrorMsg);\n }\n return tokensUseful[0];\n } else {\n if(tokensListed.length) {\n Lib.log([\n 'Listed mapbox access token(s)', tokensListed.join(','),\n 'but did not use a Mapbox map style, ignoring token(s).'\n ].join(' '));\n }\n return '';\n }\n}\n\nfunction isMapboxStyle(s) {\n return typeof s === 'string' && (\n constants.styleValuesMapbox.indexOf(s) !== -1 ||\n s.indexOf('mapbox://') === 0\n );\n}\n\nexports.updateFx = function(gd) {\n var fullLayout = gd._fullLayout;\n var subplotIds = fullLayout._subplots[MAPBOX];\n\n for(var i = 0; i < subplotIds.length; i++) {\n var subplotObj = fullLayout[subplotIds[i]]._subplot;\n subplotObj.updateFx(fullLayout);\n }\n};\n\n},{\"../../components/drawing\":617,\"../../constants/xmlns_namespaces\":705,\"../../lib\":728,\"../../lib/svg_text_utils\":752,\"../../plots/get_data\":813,\"./constants\":831,\"./layout_attributes\":835,\"./layout_defaults\":836,\"./mapbox\":837,\"d3\":164,\"mapbox-gl\":426}],834:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar sanitizeHTML = _dereq_('../../lib/svg_text_utils').sanitizeHTML;\nvar convertTextOpts = _dereq_('./convert_text_opts');\nvar constants = _dereq_('./constants');\n\nfunction MapboxLayer(subplot, index) {\n this.subplot = subplot;\n\n this.uid = subplot.uid + '-' + index;\n this.index = index;\n\n this.idSource = 'source-' + this.uid;\n this.idLayer = constants.layoutLayerPrefix + this.uid;\n\n // some state variable to check if a remove/add step is needed\n this.sourceType = null;\n this.source = null;\n this.layerType = null;\n this.below = null;\n\n // is layer currently visible\n this.visible = false;\n}\n\nvar proto = MapboxLayer.prototype;\n\nproto.update = function update(opts) {\n if(!this.visible) {\n // IMPORTANT: must create source before layer to not cause errors\n this.updateSource(opts);\n this.updateLayer(opts);\n } else if(this.needsNewImage(opts)) {\n this.updateImage(opts);\n } else if(this.needsNewSource(opts)) {\n // IMPORTANT: must delete layer before source to not cause errors\n this.removeLayer();\n this.updateSource(opts);\n this.updateLayer(opts);\n } else if(this.needsNewLayer(opts)) {\n this.updateLayer(opts);\n } else {\n this.updateStyle(opts);\n }\n\n this.visible = isVisible(opts);\n};\n\nproto.needsNewImage = function(opts) {\n var map = this.subplot.map;\n return (\n map.getSource(this.idSource) &&\n this.sourceType === 'image' &&\n opts.sourcetype === 'image' &&\n (this.source !== opts.source ||\n JSON.stringify(this.coordinates) !==\n JSON.stringify(opts.coordinates))\n );\n};\n\nproto.needsNewSource = function(opts) {\n // for some reason changing layer to 'fill' or 'symbol'\n // w/o changing the source throws an exception in mapbox-gl 0.18 ;\n // stay safe and make new source on type changes\n return (\n this.sourceType !== opts.sourcetype ||\n this.source !== opts.source ||\n this.layerType !== opts.type\n );\n};\n\nproto.needsNewLayer = function(opts) {\n return (\n this.layerType !== opts.type ||\n this.below !== this.subplot.belowLookup['layout-' + this.index]\n );\n};\n\nproto.updateImage = function(opts) {\n var map = this.subplot.map;\n map.getSource(this.idSource).updateImage({\n url: opts.source, coordinates: opts.coordinates\n });\n};\n\nproto.updateSource = function(opts) {\n var map = this.subplot.map;\n\n if(map.getSource(this.idSource)) map.removeSource(this.idSource);\n\n this.sourceType = opts.sourcetype;\n this.source = opts.source;\n\n if(!isVisible(opts)) return;\n\n var sourceOpts = convertSourceOpts(opts);\n\n map.addSource(this.idSource, sourceOpts);\n};\n\nproto.updateLayer = function(opts) {\n var subplot = this.subplot;\n var convertedOpts = convertOpts(opts);\n\n var below = this.subplot.belowLookup['layout-' + this.index];\n var _below;\n\n if(below === 'traces') {\n var mapLayers = subplot.getMapLayers();\n\n // find id of first plotly trace layer\n for(var i = 0; i < mapLayers.length; i++) {\n var layerId = mapLayers[i].id;\n if(typeof layerId === 'string' &&\n layerId.indexOf(constants.traceLayerPrefix) === 0\n ) {\n _below = layerId;\n break;\n }\n }\n } else {\n _below = below;\n }\n\n this.removeLayer();\n\n if(isVisible(opts)) {\n subplot.addLayer({\n id: this.idLayer,\n source: this.idSource,\n 'source-layer': opts.sourcelayer || '',\n type: opts.type,\n minzoom: opts.minzoom,\n maxzoom: opts.maxzoom,\n layout: convertedOpts.layout,\n paint: convertedOpts.paint\n }, _below);\n }\n\n this.layerType = opts.type;\n this.below = below;\n};\n\nproto.updateStyle = function(opts) {\n if(isVisible(opts)) {\n var convertedOpts = convertOpts(opts);\n this.subplot.setOptions(this.idLayer, 'setLayoutProperty', convertedOpts.layout);\n this.subplot.setOptions(this.idLayer, 'setPaintProperty', convertedOpts.paint);\n }\n};\n\nproto.removeLayer = function() {\n var map = this.subplot.map;\n if(map.getLayer(this.idLayer)) {\n map.removeLayer(this.idLayer);\n }\n};\n\nproto.dispose = function() {\n var map = this.subplot.map;\n if(map.getLayer(this.idLayer)) map.removeLayer(this.idLayer);\n if(map.getSource(this.idSource)) map.removeSource(this.idSource);\n};\n\nfunction isVisible(opts) {\n if(!opts.visible) return false;\n\n var source = opts.source;\n\n if(Array.isArray(source) && source.length > 0) {\n for(var i = 0; i < source.length; i++) {\n if(typeof source[i] !== 'string' || source[i].length === 0) {\n return false;\n }\n }\n return true;\n }\n\n return Lib.isPlainObject(source) ||\n (typeof source === 'string' && source.length > 0);\n}\n\nfunction convertOpts(opts) {\n var layout = {};\n var paint = {};\n\n switch(opts.type) {\n case 'circle':\n Lib.extendFlat(paint, {\n 'circle-radius': opts.circle.radius,\n 'circle-color': opts.color,\n 'circle-opacity': opts.opacity\n });\n break;\n\n case 'line':\n Lib.extendFlat(paint, {\n 'line-width': opts.line.width,\n 'line-color': opts.color,\n 'line-opacity': opts.opacity,\n 'line-dasharray': opts.line.dash\n });\n break;\n\n case 'fill':\n Lib.extendFlat(paint, {\n 'fill-color': opts.color,\n 'fill-outline-color': opts.fill.outlinecolor,\n 'fill-opacity': opts.opacity\n\n // no way to pass specify outline width at the moment\n });\n break;\n\n case 'symbol':\n var symbol = opts.symbol;\n var textOpts = convertTextOpts(symbol.textposition, symbol.iconsize);\n\n Lib.extendFlat(layout, {\n 'icon-image': symbol.icon + '-15',\n 'icon-size': symbol.iconsize / 10,\n\n 'text-field': symbol.text,\n 'text-size': symbol.textfont.size,\n 'text-anchor': textOpts.anchor,\n 'text-offset': textOpts.offset,\n 'symbol-placement': symbol.placement,\n\n // TODO font family\n // 'text-font': symbol.textfont.family.split(', '),\n });\n\n Lib.extendFlat(paint, {\n 'icon-color': opts.color,\n 'text-color': symbol.textfont.color,\n 'text-opacity': opts.opacity\n });\n break;\n case 'raster':\n Lib.extendFlat(paint, {\n 'raster-fade-duration': 0,\n 'raster-opacity': opts.opacity\n });\n break;\n }\n\n return {\n layout: layout,\n paint: paint\n };\n}\n\nfunction convertSourceOpts(opts) {\n var sourceType = opts.sourcetype;\n var source = opts.source;\n var sourceOpts = {type: sourceType};\n var field;\n\n if(sourceType === 'geojson') {\n field = 'data';\n } else if(sourceType === 'vector') {\n field = typeof source === 'string' ? 'url' : 'tiles';\n } else if(sourceType === 'raster') {\n field = 'tiles';\n sourceOpts.tileSize = 256;\n } else if(sourceType === 'image') {\n field = 'url';\n sourceOpts.coordinates = opts.coordinates;\n }\n\n sourceOpts[field] = source;\n\n if(opts.sourceattribution) {\n sourceOpts.attribution = sanitizeHTML(opts.sourceattribution);\n }\n\n return sourceOpts;\n}\n\nmodule.exports = function createMapboxLayer(subplot, index, opts) {\n var mapboxLayer = new MapboxLayer(subplot, index);\n\n mapboxLayer.update(opts);\n\n return mapboxLayer;\n};\n\n},{\"../../lib\":728,\"../../lib/svg_text_utils\":752,\"./constants\":831,\"./convert_text_opts\":832}],835:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar defaultLine = _dereq_('../../components/color').defaultLine;\nvar domainAttrs = _dereq_('../domain').attributes;\nvar fontAttrs = _dereq_('../font_attributes');\nvar textposition = _dereq_('../../traces/scatter/attributes').textposition;\nvar overrideAll = _dereq_('../../plot_api/edit_types').overrideAll;\nvar templatedArray = _dereq_('../../plot_api/plot_template').templatedArray;\n\nvar constants = _dereq_('./constants');\n\nvar fontAttr = fontAttrs({\n \n});\nfontAttr.family.dflt = 'Open Sans Regular, Arial Unicode MS Regular';\n\nvar attrs = module.exports = overrideAll({\n _arrayAttrRegexps: [Lib.counterRegex('mapbox', '.layers', true)],\n\n domain: domainAttrs({name: 'mapbox'}),\n\n accesstoken: {\n valType: 'string',\n noBlank: true,\n strict: true,\n \n \n },\n style: {\n valType: 'any',\n values: constants.styleValuesMapbox.concat(constants.styleValuesNonMapbox),\n dflt: constants.styleValueDflt,\n \n \n },\n\n center: {\n lon: {\n valType: 'number',\n dflt: 0,\n \n \n },\n lat: {\n valType: 'number',\n dflt: 0,\n \n \n }\n },\n zoom: {\n valType: 'number',\n dflt: 1,\n \n \n },\n bearing: {\n valType: 'number',\n dflt: 0,\n \n \n },\n pitch: {\n valType: 'number',\n dflt: 0,\n \n \n },\n\n layers: templatedArray('layer', {\n visible: {\n valType: 'boolean',\n \n dflt: true,\n \n },\n sourcetype: {\n valType: 'enumerated',\n values: ['geojson', 'vector', 'raster', 'image'],\n dflt: 'geojson',\n \n \n },\n\n source: {\n valType: 'any',\n \n \n },\n\n sourcelayer: {\n valType: 'string',\n dflt: '',\n \n \n },\n\n sourceattribution: {\n valType: 'string',\n \n \n },\n\n type: {\n valType: 'enumerated',\n values: ['circle', 'line', 'fill', 'symbol', 'raster'],\n dflt: 'circle',\n \n \n },\n\n coordinates: {\n valType: 'any',\n \n \n },\n\n // attributes shared between all types\n below: {\n valType: 'string',\n \n \n },\n color: {\n valType: 'color',\n dflt: defaultLine,\n \n \n },\n opacity: {\n valType: 'number',\n min: 0,\n max: 1,\n dflt: 1,\n \n \n },\n minzoom: {\n valType: 'number',\n min: 0,\n max: 24,\n dflt: 0,\n \n \n },\n maxzoom: {\n valType: 'number',\n min: 0,\n max: 24,\n dflt: 24,\n \n \n },\n\n // type-specific style attributes\n circle: {\n radius: {\n valType: 'number',\n dflt: 15,\n \n \n }\n },\n\n line: {\n width: {\n valType: 'number',\n dflt: 2,\n \n \n },\n dash: {\n valType: 'data_array',\n \n \n }\n },\n\n fill: {\n outlinecolor: {\n valType: 'color',\n dflt: defaultLine,\n \n \n }\n },\n\n symbol: {\n icon: {\n valType: 'string',\n dflt: 'marker',\n \n \n },\n iconsize: {\n valType: 'number',\n dflt: 10,\n \n \n },\n text: {\n valType: 'string',\n dflt: '',\n \n \n },\n placement: {\n valType: 'enumerated',\n values: ['point', 'line', 'line-center'],\n dflt: 'point',\n \n \n },\n textfont: fontAttr,\n textposition: Lib.extendFlat({}, textposition, { arrayOk: false })\n }\n })\n}, 'plot', 'from-root');\n\n// set uirevision outside of overrideAll so it can be `editType: 'none'`\nattrs.uirevision = {\n valType: 'any',\n \n editType: 'none',\n \n};\n\n},{\"../../components/color\":595,\"../../lib\":728,\"../../plot_api/edit_types\":759,\"../../plot_api/plot_template\":766,\"../../traces/scatter/attributes\":1134,\"../domain\":803,\"../font_attributes\":804,\"./constants\":831}],836:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nvar handleSubplotDefaults = _dereq_('../subplot_defaults');\nvar handleArrayContainerDefaults = _dereq_('../array_container_defaults');\nvar layoutAttributes = _dereq_('./layout_attributes');\n\n\nmodule.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {\n handleSubplotDefaults(layoutIn, layoutOut, fullData, {\n type: 'mapbox',\n attributes: layoutAttributes,\n handleDefaults: handleDefaults,\n partition: 'y',\n accessToken: layoutOut._mapboxAccessToken\n });\n};\n\nfunction handleDefaults(containerIn, containerOut, coerce, opts) {\n coerce('accesstoken', opts.accessToken);\n coerce('style');\n coerce('center.lon');\n coerce('center.lat');\n coerce('zoom');\n coerce('bearing');\n coerce('pitch');\n\n handleArrayContainerDefaults(containerIn, containerOut, {\n name: 'layers',\n handleItemDefaults: handleLayerDefaults\n });\n\n // copy ref to input container to update 'center' and 'zoom' on map move\n containerOut._input = containerIn;\n}\n\nfunction handleLayerDefaults(layerIn, layerOut) {\n function coerce(attr, dflt) {\n return Lib.coerce(layerIn, layerOut, layoutAttributes.layers, attr, dflt);\n }\n\n var visible = coerce('visible');\n if(visible) {\n var sourceType = coerce('sourcetype');\n var mustBeRasterLayer = sourceType === 'raster' || sourceType === 'image';\n\n coerce('source');\n coerce('sourceattribution');\n\n if(sourceType === 'vector') {\n coerce('sourcelayer');\n }\n\n if(sourceType === 'image') {\n coerce('coordinates');\n }\n\n var typeDflt;\n if(mustBeRasterLayer) typeDflt = 'raster';\n\n var type = coerce('type', typeDflt);\n\n if(mustBeRasterLayer && type !== 'raster') {\n type = layerOut.type = 'raster';\n Lib.log('Source types *raster* and *image* must drawn *raster* layer type.');\n }\n\n coerce('below');\n coerce('color');\n coerce('opacity');\n coerce('minzoom');\n coerce('maxzoom');\n\n if(type === 'circle') {\n coerce('circle.radius');\n }\n\n if(type === 'line') {\n coerce('line.width');\n coerce('line.dash');\n }\n\n if(type === 'fill') {\n coerce('fill.outlinecolor');\n }\n\n if(type === 'symbol') {\n coerce('symbol.icon');\n coerce('symbol.iconsize');\n\n coerce('symbol.text');\n Lib.coerceFont(coerce, 'symbol.textfont');\n coerce('symbol.textposition');\n coerce('symbol.placement');\n }\n }\n}\n\n},{\"../../lib\":728,\"../array_container_defaults\":772,\"../subplot_defaults\":853,\"./layout_attributes\":835}],837:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar mapboxgl = _dereq_('mapbox-gl');\n\nvar Lib = _dereq_('../../lib');\nvar geoUtils = _dereq_('../../lib/geo_location_utils');\nvar Registry = _dereq_('../../registry');\nvar Axes = _dereq_('../cartesian/axes');\nvar dragElement = _dereq_('../../components/dragelement');\n\nvar Fx = _dereq_('../../components/fx');\nvar dragHelpers = _dereq_('../../components/dragelement/helpers');\nvar rectMode = dragHelpers.rectMode;\nvar drawMode = dragHelpers.drawMode;\nvar selectMode = dragHelpers.selectMode;\n\nvar prepSelect = _dereq_('../cartesian/select').prepSelect;\nvar clearSelect = _dereq_('../cartesian/select').clearSelect;\nvar clearSelectionsCache = _dereq_('../cartesian/select').clearSelectionsCache;\nvar selectOnClick = _dereq_('../cartesian/select').selectOnClick;\n\nvar constants = _dereq_('./constants');\nvar createMapboxLayer = _dereq_('./layers');\n\nfunction Mapbox(gd, id) {\n this.id = id;\n this.gd = gd;\n\n var fullLayout = gd._fullLayout;\n var context = gd._context;\n\n this.container = fullLayout._glcontainer.node();\n this.isStatic = context.staticPlot;\n\n // unique id for this Mapbox instance\n this.uid = fullLayout._uid + '-' + this.id;\n\n // create framework on instantiation for a smoother first plot call\n this.div = null;\n this.xaxis = null;\n this.yaxis = null;\n this.createFramework(fullLayout);\n\n // state variables used to infer how and what to update\n this.map = null;\n this.accessToken = null;\n this.styleObj = null;\n this.traceHash = {};\n this.layerList = [];\n this.belowLookup = {};\n this.dragging = false;\n this.wheeling = false;\n}\n\nvar proto = Mapbox.prototype;\n\nproto.plot = function(calcData, fullLayout, promises) {\n var self = this;\n var opts = fullLayout[self.id];\n\n // remove map and create a new map if access token has change\n if(self.map && (opts.accesstoken !== self.accessToken)) {\n self.map.remove();\n self.map = null;\n self.styleObj = null;\n self.traceHash = {};\n self.layerList = [];\n }\n\n var promise;\n\n if(!self.map) {\n promise = new Promise(function(resolve, reject) {\n self.createMap(calcData, fullLayout, resolve, reject);\n });\n } else {\n promise = new Promise(function(resolve, reject) {\n self.updateMap(calcData, fullLayout, resolve, reject);\n });\n }\n\n promises.push(promise);\n};\n\nproto.createMap = function(calcData, fullLayout, resolve, reject) {\n var self = this;\n var opts = fullLayout[self.id];\n\n // store style id and URL or object\n var styleObj = self.styleObj = getStyleObj(opts.style);\n\n // store access token associated with this map\n self.accessToken = opts.accesstoken;\n\n // create the map!\n var map = self.map = new mapboxgl.Map({\n container: self.div,\n\n style: styleObj.style,\n center: convertCenter(opts.center),\n zoom: opts.zoom,\n bearing: opts.bearing,\n pitch: opts.pitch,\n\n interactive: !self.isStatic,\n preserveDrawingBuffer: self.isStatic,\n\n doubleClickZoom: false,\n boxZoom: false,\n\n attributionControl: false\n })\n .addControl(new mapboxgl.AttributionControl({\n compact: true\n }));\n\n\n // make sure canvas does not inherit left and top css\n map._canvas.style.left = '0px';\n map._canvas.style.top = '0px';\n\n self.rejectOnError(reject);\n\n if(!self.isStatic) {\n self.initFx(calcData, fullLayout);\n }\n\n var promises = [];\n\n promises.push(new Promise(function(resolve) {\n map.once('load', resolve);\n }));\n\n promises = promises.concat(geoUtils.fetchTraceGeoData(calcData));\n\n Promise.all(promises).then(function() {\n self.fillBelowLookup(calcData, fullLayout);\n self.updateData(calcData);\n self.updateLayout(fullLayout);\n self.resolveOnRender(resolve);\n }).catch(reject);\n};\n\nproto.updateMap = function(calcData, fullLayout, resolve, reject) {\n var self = this;\n var map = self.map;\n var opts = fullLayout[this.id];\n\n self.rejectOnError(reject);\n\n var promises = [];\n var styleObj = getStyleObj(opts.style);\n\n if(JSON.stringify(self.styleObj) !== JSON.stringify(styleObj)) {\n self.styleObj = styleObj;\n map.setStyle(styleObj.style);\n\n // need to rebuild trace layers on reload\n // to avoid 'lost event' errors\n self.traceHash = {};\n\n promises.push(new Promise(function(resolve) {\n map.once('styledata', resolve);\n }));\n }\n\n promises = promises.concat(geoUtils.fetchTraceGeoData(calcData));\n\n Promise.all(promises).then(function() {\n self.fillBelowLookup(calcData, fullLayout);\n self.updateData(calcData);\n self.updateLayout(fullLayout);\n self.resolveOnRender(resolve);\n }).catch(reject);\n};\n\nproto.fillBelowLookup = function(calcData, fullLayout) {\n var opts = fullLayout[this.id];\n var layers = opts.layers;\n var i, val;\n\n var belowLookup = this.belowLookup = {};\n var hasTraceAtTop = false;\n\n for(i = 0; i < calcData.length; i++) {\n var trace = calcData[i][0].trace;\n var _module = trace._module;\n\n if(typeof trace.below === 'string') {\n val = trace.below;\n } else if(_module.getBelow) {\n // 'smart' default that depend the map's base layers\n val = _module.getBelow(trace, this);\n }\n\n if(val === '') {\n hasTraceAtTop = true;\n }\n\n belowLookup['trace-' + trace.uid] = val || '';\n }\n\n for(i = 0; i < layers.length; i++) {\n var item = layers[i];\n\n if(typeof item.below === 'string') {\n val = item.below;\n } else if(hasTraceAtTop) {\n // if one or more trace(s) set `below:''` and\n // layers[i].below is unset,\n // place layer below traces\n val = 'traces';\n } else {\n val = '';\n }\n\n belowLookup['layout-' + i] = val;\n }\n\n // N.B. If multiple layers have the 'below' value,\n // we must clear the stashed 'below' field in order\n // to make `traceHash[k].update()` and `layerList[i].update()`\n // remove/add the all those layers to have preserve\n // the correct layer ordering\n var val2list = {};\n var k, id;\n\n for(k in belowLookup) {\n val = belowLookup[k];\n if(val2list[val]) {\n val2list[val].push(k);\n } else {\n val2list[val] = [k];\n }\n }\n\n for(val in val2list) {\n var list = val2list[val];\n if(list.length > 1) {\n for(i = 0; i < list.length; i++) {\n k = list[i];\n if(k.indexOf('trace-') === 0) {\n id = k.split('trace-')[1];\n if(this.traceHash[id]) {\n this.traceHash[id].below = null;\n }\n } else if(k.indexOf('layout-') === 0) {\n id = k.split('layout-')[1];\n if(this.layerList[id]) {\n this.layerList[id].below = null;\n }\n }\n }\n }\n }\n};\n\nvar traceType2orderIndex = {\n choroplethmapbox: 0,\n densitymapbox: 1,\n scattermapbox: 2\n};\n\nproto.updateData = function(calcData) {\n var traceHash = this.traceHash;\n var traceObj, trace, i, j;\n\n // Need to sort here by trace type here,\n // in case traces with different `type` have the same\n // below value, but sorting we ensure that\n // e.g. choroplethmapbox traces will be below scattermapbox traces\n var calcDataSorted = calcData.slice().sort(function(a, b) {\n return (\n traceType2orderIndex[a[0].trace.type] -\n traceType2orderIndex[b[0].trace.type]\n );\n });\n\n // update or create trace objects\n for(i = 0; i < calcDataSorted.length; i++) {\n var calcTrace = calcDataSorted[i];\n\n trace = calcTrace[0].trace;\n traceObj = traceHash[trace.uid];\n\n var didUpdate = false;\n if(traceObj) {\n if(traceObj.type === trace.type) {\n traceObj.update(calcTrace);\n didUpdate = true;\n } else {\n traceObj.dispose();\n }\n }\n if(!didUpdate && trace._module) {\n traceHash[trace.uid] = trace._module.plot(this, calcTrace);\n }\n }\n\n // remove empty trace objects\n var ids = Object.keys(traceHash);\n idLoop:\n for(i = 0; i < ids.length; i++) {\n var id = ids[i];\n\n for(j = 0; j < calcData.length; j++) {\n trace = calcData[j][0].trace;\n if(id === trace.uid) continue idLoop;\n }\n\n traceObj = traceHash[id];\n traceObj.dispose();\n delete traceHash[id];\n }\n};\n\nproto.updateLayout = function(fullLayout) {\n var map = this.map;\n var opts = fullLayout[this.id];\n\n if(!this.dragging && !this.wheeling) {\n map.setCenter(convertCenter(opts.center));\n map.setZoom(opts.zoom);\n map.setBearing(opts.bearing);\n map.setPitch(opts.pitch);\n }\n\n this.updateLayers(fullLayout);\n this.updateFramework(fullLayout);\n this.updateFx(fullLayout);\n this.map.resize();\n\n if(this.gd._context._scrollZoom.mapbox) {\n map.scrollZoom.enable();\n } else {\n map.scrollZoom.disable();\n }\n};\n\nproto.resolveOnRender = function(resolve) {\n var map = this.map;\n\n map.on('render', function onRender() {\n if(map.loaded()) {\n map.off('render', onRender);\n // resolve at end of render loop\n //\n // Need a 10ms delay (0ms should suffice to skip a thread in the\n // render loop) to workaround mapbox-gl bug introduced in v1.3.0\n setTimeout(resolve, 10);\n }\n });\n};\n\nproto.rejectOnError = function(reject) {\n var map = this.map;\n\n function handler() {\n reject(new Error(constants.mapOnErrorMsg));\n }\n\n map.once('error', handler);\n map.once('style.error', handler);\n map.once('source.error', handler);\n map.once('tile.error', handler);\n map.once('layer.error', handler);\n};\n\nproto.createFramework = function(fullLayout) {\n var self = this;\n\n var div = self.div = document.createElement('div');\n div.id = self.uid;\n div.style.position = 'absolute';\n self.container.appendChild(div);\n\n // create mock x/y axes for hover routine\n self.xaxis = {\n _id: 'x',\n c2p: function(v) { return self.project(v).x; }\n };\n self.yaxis = {\n _id: 'y',\n c2p: function(v) { return self.project(v).y; }\n };\n\n self.updateFramework(fullLayout);\n\n // mock axis for hover formatting\n self.mockAxis = {\n type: 'linear',\n showexponent: 'all',\n exponentformat: 'B'\n };\n Axes.setConvert(self.mockAxis, fullLayout);\n};\n\nproto.initFx = function(calcData, fullLayout) {\n var self = this;\n var gd = self.gd;\n var map = self.map;\n\n // keep track of pan / zoom in user layout and emit relayout event\n map.on('moveend', function(evt) {\n if(!self.map) return;\n\n var fullLayoutNow = gd._fullLayout;\n\n // 'moveend' gets triggered by map.setCenter, map.setZoom,\n // map.setBearing and map.setPitch.\n //\n // Here, we make sure that state updates amd 'plotly_relayout'\n // are triggered only when the 'moveend' originates from a\n // mouse target (filtering out API calls) to not\n // duplicate 'plotly_relayout' events.\n\n if(evt.originalEvent || self.wheeling) {\n var optsNow = fullLayoutNow[self.id];\n Registry.call('_storeDirectGUIEdit', gd.layout, fullLayoutNow._preGUI, self.getViewEdits(optsNow));\n\n var viewNow = self.getView();\n optsNow._input.center = optsNow.center = viewNow.center;\n optsNow._input.zoom = optsNow.zoom = viewNow.zoom;\n optsNow._input.bearing = optsNow.bearing = viewNow.bearing;\n optsNow._input.pitch = optsNow.pitch = viewNow.pitch;\n gd.emit('plotly_relayout', self.getViewEditsWithDerived(viewNow));\n }\n if(evt.originalEvent && evt.originalEvent.type === 'mouseup') {\n self.dragging = false;\n } else if(self.wheeling) {\n self.wheeling = false;\n }\n\n if(fullLayoutNow._rehover) {\n fullLayoutNow._rehover();\n }\n });\n\n map.on('wheel', function() {\n self.wheeling = true;\n });\n\n map.on('mousemove', function(evt) {\n var bb = self.div.getBoundingClientRect();\n\n // some hackery to get Fx.hover to work\n evt.clientX = evt.point.x + bb.left;\n evt.clientY = evt.point.y + bb.top;\n\n evt.target.getBoundingClientRect = function() { return bb; };\n\n self.xaxis.p2c = function() { return evt.lngLat.lng; };\n self.yaxis.p2c = function() { return evt.lngLat.lat; };\n\n gd._fullLayout._rehover = function() {\n if(gd._fullLayout._hoversubplot === self.id && gd._fullLayout[self.id]) {\n Fx.hover(gd, evt, self.id);\n }\n };\n\n Fx.hover(gd, evt, self.id);\n gd._fullLayout._hoversubplot = self.id;\n });\n\n function unhover() {\n Fx.loneUnhover(fullLayout._hoverlayer);\n }\n\n map.on('dragstart', function() {\n self.dragging = true;\n unhover();\n });\n map.on('zoomstart', unhover);\n\n map.on('mouseout', function() {\n gd._fullLayout._hoversubplot = null;\n });\n\n function emitUpdate() {\n var viewNow = self.getView();\n gd.emit('plotly_relayouting', self.getViewEditsWithDerived(viewNow));\n }\n\n map.on('drag', emitUpdate);\n map.on('zoom', emitUpdate);\n\n map.on('dblclick', function() {\n var optsNow = gd._fullLayout[self.id];\n Registry.call('_storeDirectGUIEdit', gd.layout, gd._fullLayout._preGUI, self.getViewEdits(optsNow));\n\n var viewInitial = self.viewInitial;\n map.setCenter(convertCenter(viewInitial.center));\n map.setZoom(viewInitial.zoom);\n map.setBearing(viewInitial.bearing);\n map.setPitch(viewInitial.pitch);\n\n var viewNow = self.getView();\n optsNow._input.center = optsNow.center = viewNow.center;\n optsNow._input.zoom = optsNow.zoom = viewNow.zoom;\n optsNow._input.bearing = optsNow.bearing = viewNow.bearing;\n optsNow._input.pitch = optsNow.pitch = viewNow.pitch;\n\n gd.emit('plotly_doubleclick', null);\n gd.emit('plotly_relayout', self.getViewEditsWithDerived(viewNow));\n });\n\n // define event handlers on map creation, to keep one ref per map,\n // so that map.on / map.off in updateFx works as expected\n self.clearSelect = function() {\n clearSelectionsCache(self.dragOptions);\n clearSelect(self.dragOptions.gd);\n };\n\n /**\n * Returns a click handler function that is supposed\n * to handle clicks in pan mode.\n */\n self.onClickInPanFn = function(dragOptions) {\n return function(evt) {\n var clickMode = gd._fullLayout.clickmode;\n\n if(clickMode.indexOf('select') > -1) {\n selectOnClick(evt.originalEvent, gd, [self.xaxis], [self.yaxis], self.id, dragOptions);\n }\n\n if(clickMode.indexOf('event') > -1) {\n // TODO: this does not support right-click. If we want to support it, we\n // would likely need to change mapbox to use dragElement instead of straight\n // mapbox event binding. Or perhaps better, make a simple wrapper with the\n // right mousedown, mousemove, and mouseup handlers just for a left/right click\n // pie would use this too.\n Fx.click(gd, evt.originalEvent);\n }\n };\n };\n};\n\nproto.updateFx = function(fullLayout) {\n var self = this;\n var map = self.map;\n var gd = self.gd;\n\n if(self.isStatic) return;\n\n function invert(pxpy) {\n var obj = self.map.unproject(pxpy);\n return [obj.lng, obj.lat];\n }\n\n var dragMode = fullLayout.dragmode;\n var fillRangeItems;\n\n if(rectMode(dragMode)) {\n fillRangeItems = function(eventData, poly) {\n var ranges = eventData.range = {};\n ranges[self.id] = [\n invert([poly.xmin, poly.ymin]),\n invert([poly.xmax, poly.ymax])\n ];\n };\n } else {\n fillRangeItems = function(eventData, poly, pts) {\n var dataPts = eventData.lassoPoints = {};\n dataPts[self.id] = pts.filtered.map(invert);\n };\n }\n\n // Note: dragOptions is needed to be declared for all dragmodes because\n // it's the object that holds persistent selection state.\n // Merge old dragOptions with new to keep possibly initialized\n // persistent selection state.\n var oldDragOptions = self.dragOptions;\n self.dragOptions = Lib.extendDeep(oldDragOptions || {}, {\n dragmode: fullLayout.dragmode,\n element: self.div,\n gd: gd,\n plotinfo: {\n id: self.id,\n domain: fullLayout[self.id].domain,\n xaxis: self.xaxis,\n yaxis: self.yaxis,\n fillRangeItems: fillRangeItems\n },\n xaxes: [self.xaxis],\n yaxes: [self.yaxis],\n subplot: self.id\n });\n\n // Unregister the old handler before potentially registering\n // a new one. Otherwise multiple click handlers might\n // be registered resulting in unwanted behavior.\n map.off('click', self.onClickInPanHandler);\n if(selectMode(dragMode) || drawMode(dragMode)) {\n map.dragPan.disable();\n map.on('zoomstart', self.clearSelect);\n\n self.dragOptions.prepFn = function(e, startX, startY) {\n prepSelect(e, startX, startY, self.dragOptions, dragMode);\n };\n\n dragElement.init(self.dragOptions);\n } else {\n map.dragPan.enable();\n map.off('zoomstart', self.clearSelect);\n self.div.onmousedown = null;\n\n // TODO: this does not support right-click. If we want to support it, we\n // would likely need to change mapbox to use dragElement instead of straight\n // mapbox event binding. Or perhaps better, make a simple wrapper with the\n // right mousedown, mousemove, and mouseup handlers just for a left/right click\n // pie would use this too.\n self.onClickInPanHandler = self.onClickInPanFn(self.dragOptions);\n map.on('click', self.onClickInPanHandler);\n }\n};\n\nproto.updateFramework = function(fullLayout) {\n var domain = fullLayout[this.id].domain;\n var size = fullLayout._size;\n\n var style = this.div.style;\n style.width = size.w * (domain.x[1] - domain.x[0]) + 'px';\n style.height = size.h * (domain.y[1] - domain.y[0]) + 'px';\n style.left = size.l + domain.x[0] * size.w + 'px';\n style.top = size.t + (1 - domain.y[1]) * size.h + 'px';\n\n this.xaxis._offset = size.l + domain.x[0] * size.w;\n this.xaxis._length = size.w * (domain.x[1] - domain.x[0]);\n\n this.yaxis._offset = size.t + (1 - domain.y[1]) * size.h;\n this.yaxis._length = size.h * (domain.y[1] - domain.y[0]);\n};\n\nproto.updateLayers = function(fullLayout) {\n var opts = fullLayout[this.id];\n var layers = opts.layers;\n var layerList = this.layerList;\n var i;\n\n // if the layer arrays don't match,\n // don't try to be smart,\n // delete them all, and start all over.\n\n if(layers.length !== layerList.length) {\n for(i = 0; i < layerList.length; i++) {\n layerList[i].dispose();\n }\n\n layerList = this.layerList = [];\n\n for(i = 0; i < layers.length; i++) {\n layerList.push(createMapboxLayer(this, i, layers[i]));\n }\n } else {\n for(i = 0; i < layers.length; i++) {\n layerList[i].update(layers[i]);\n }\n }\n};\n\nproto.destroy = function() {\n if(this.map) {\n this.map.remove();\n this.map = null;\n this.container.removeChild(this.div);\n }\n};\n\nproto.toImage = function() {\n this.map.stop();\n return this.map.getCanvas().toDataURL();\n};\n\n// convenience wrapper to create set multiple layer\n// 'layout' or 'paint options at once.\nproto.setOptions = function(id, methodName, opts) {\n for(var k in opts) {\n this.map[methodName](id, k, opts[k]);\n }\n};\n\nproto.getMapLayers = function() {\n return this.map.getStyle().layers;\n};\n\n// convenience wrapper that first check in 'below' references\n// a layer that exist and then add the layer to the map,\nproto.addLayer = function(opts, below) {\n var map = this.map;\n\n if(typeof below === 'string') {\n if(below === '') {\n map.addLayer(opts, below);\n return;\n }\n\n var mapLayers = this.getMapLayers();\n for(var i = 0; i < mapLayers.length; i++) {\n if(below === mapLayers[i].id) {\n map.addLayer(opts, below);\n return;\n }\n }\n\n Lib.warn([\n 'Trying to add layer with *below* value',\n below,\n 'referencing a layer that does not exist',\n 'or that does not yet exist.'\n ].join(' '));\n }\n\n map.addLayer(opts);\n};\n\n// convenience method to project a [lon, lat] array to pixel coords\nproto.project = function(v) {\n return this.map.project(new mapboxgl.LngLat(v[0], v[1]));\n};\n\n// get map's current view values in plotly.js notation\nproto.getView = function() {\n var map = this.map;\n var mapCenter = map.getCenter();\n var center = { lon: mapCenter.lng, lat: mapCenter.lat };\n\n var canvas = map.getCanvas();\n var w = canvas.width;\n var h = canvas.height;\n return {\n center: center,\n zoom: map.getZoom(),\n bearing: map.getBearing(),\n pitch: map.getPitch(),\n _derived: {\n coordinates: [\n map.unproject([0, 0]).toArray(),\n map.unproject([w, 0]).toArray(),\n map.unproject([w, h]).toArray(),\n map.unproject([0, h]).toArray()\n ]\n }\n };\n};\n\nproto.getViewEdits = function(cont) {\n var id = this.id;\n var keys = ['center', 'zoom', 'bearing', 'pitch'];\n var obj = {};\n\n for(var i = 0; i < keys.length; i++) {\n var k = keys[i];\n obj[id + '.' + k] = cont[k];\n }\n\n return obj;\n};\n\nproto.getViewEditsWithDerived = function(cont) {\n var id = this.id;\n var obj = this.getViewEdits(cont);\n obj[id + '._derived'] = cont._derived;\n return obj;\n};\n\nfunction getStyleObj(val) {\n var styleObj = {};\n\n if(Lib.isPlainObject(val)) {\n styleObj.id = val.id;\n styleObj.style = val;\n } else if(typeof val === 'string') {\n styleObj.id = val;\n\n if(constants.styleValuesMapbox.indexOf(val) !== -1) {\n styleObj.style = convertStyleVal(val);\n } else if(constants.stylesNonMapbox[val]) {\n styleObj.style = constants.stylesNonMapbox[val];\n } else {\n styleObj.style = val;\n }\n } else {\n styleObj.id = constants.styleValueDflt;\n styleObj.style = convertStyleVal(constants.styleValueDflt);\n }\n\n styleObj.transition = {duration: 0, delay: 0};\n\n return styleObj;\n}\n\n// if style is part of the 'official' mapbox values, add URL prefix and suffix\nfunction convertStyleVal(val) {\n return constants.styleUrlPrefix + val + '-' + constants.styleUrlSuffix;\n}\n\nfunction convertCenter(center) {\n return [center.lon, center.lat];\n}\n\nmodule.exports = Mapbox;\n\n},{\"../../components/dragelement\":614,\"../../components/dragelement/helpers\":613,\"../../components/fx\":635,\"../../lib\":728,\"../../lib/geo_location_utils\":722,\"../../registry\":859,\"../cartesian/axes\":776,\"../cartesian/select\":795,\"./constants\":831,\"./layers\":834,\"mapbox-gl\":426}],838:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/**\n * Creates a set of padding attributes.\n *\n * @param {object} opts\n * @param {string} editType:\n * the editType for all pieces of this padding definition\n *\n * @return {object} attributes object containing {t, r, b, l} as specified\n */\nmodule.exports = function(opts) {\n var editType = opts.editType;\n return {\n t: {\n valType: 'number',\n dflt: 0,\n \n editType: editType,\n \n },\n r: {\n valType: 'number',\n dflt: 0,\n \n editType: editType,\n \n },\n b: {\n valType: 'number',\n dflt: 0,\n \n editType: editType,\n \n },\n l: {\n valType: 'number',\n dflt: 0,\n \n editType: editType,\n \n },\n editType: editType\n };\n};\n\n},{}],839:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Registry = _dereq_('../registry');\nvar PlotSchema = _dereq_('../plot_api/plot_schema');\nvar Template = _dereq_('../plot_api/plot_template');\nvar Lib = _dereq_('../lib');\nvar Color = _dereq_('../components/color');\nvar BADNUM = _dereq_('../constants/numerical').BADNUM;\n\nvar axisIDs = _dereq_('./cartesian/axis_ids');\nvar clearSelect = _dereq_('./cartesian/handle_outline').clearSelect;\n\nvar animationAttrs = _dereq_('./animation_attributes');\nvar frameAttrs = _dereq_('./frame_attributes');\n\nvar getModuleCalcData = _dereq_('../plots/get_data').getModuleCalcData;\n\nvar relinkPrivateKeys = Lib.relinkPrivateKeys;\nvar _ = Lib._;\n\nvar plots = module.exports = {};\n\n// Expose registry methods on Plots for backward-compatibility\nLib.extendFlat(plots, Registry);\n\nplots.attributes = _dereq_('./attributes');\nplots.attributes.type.values = plots.allTypes;\nplots.fontAttrs = _dereq_('./font_attributes');\nplots.layoutAttributes = _dereq_('./layout_attributes');\n\n// TODO make this a plot attribute?\nplots.fontWeight = 'normal';\n\nvar transformsRegistry = plots.transformsRegistry;\n\nvar commandModule = _dereq_('./command');\nplots.executeAPICommand = commandModule.executeAPICommand;\nplots.computeAPICommandBindings = commandModule.computeAPICommandBindings;\nplots.manageCommandObserver = commandModule.manageCommandObserver;\nplots.hasSimpleAPICommandBindings = commandModule.hasSimpleAPICommandBindings;\n\n// in some cases the browser doesn't seem to know how big\n// the text is at first, so it needs to draw it,\n// then wait a little, then draw it again\nplots.redrawText = function(gd) {\n gd = Lib.getGraphDiv(gd);\n\n var fullLayout = gd._fullLayout || {};\n var hasPolar = fullLayout._has && fullLayout._has('polar');\n var hasLegacyPolar = !hasPolar && gd.data && gd.data[0] && gd.data[0].r;\n\n // do not work if polar is present\n if(hasLegacyPolar) return;\n\n return new Promise(function(resolve) {\n setTimeout(function() {\n Registry.getComponentMethod('annotations', 'draw')(gd);\n Registry.getComponentMethod('legend', 'draw')(gd);\n Registry.getComponentMethod('colorbar', 'draw')(gd);\n resolve(plots.previousPromises(gd));\n }, 300);\n });\n};\n\n// resize plot about the container size\nplots.resize = function(gd) {\n gd = Lib.getGraphDiv(gd);\n\n var resolveLastResize;\n var p = new Promise(function(resolve, reject) {\n if(!gd || Lib.isHidden(gd)) {\n reject(new Error('Resize must be passed a displayed plot div element.'));\n }\n\n if(gd._redrawTimer) clearTimeout(gd._redrawTimer);\n if(gd._resolveResize) resolveLastResize = gd._resolveResize;\n gd._resolveResize = resolve;\n\n gd._redrawTimer = setTimeout(function() {\n // return if there is nothing to resize or is hidden\n if(!gd.layout || (gd.layout.width && gd.layout.height) || Lib.isHidden(gd)) {\n resolve(gd);\n return;\n }\n\n delete gd.layout.width;\n delete gd.layout.height;\n\n // autosizing doesn't count as a change that needs saving\n var oldchanged = gd.changed;\n\n // nor should it be included in the undo queue\n gd.autoplay = true;\n\n Registry.call('relayout', gd, {autosize: true}).then(function() {\n gd.changed = oldchanged;\n // Only resolve if a new call hasn't been made!\n if(gd._resolveResize === resolve) {\n delete gd._resolveResize;\n resolve(gd);\n }\n });\n }, 100);\n });\n\n if(resolveLastResize) resolveLastResize(p);\n return p;\n};\n\n\n// for use in Lib.syncOrAsync, check if there are any\n// pending promises in this plot and wait for them\nplots.previousPromises = function(gd) {\n if((gd._promises || []).length) {\n return Promise.all(gd._promises)\n .then(function() { gd._promises = []; });\n }\n};\n\n/**\n * Adds the 'Edit chart' link.\n * Note that now Plotly.plot() calls this so it can regenerate whenever it replots\n *\n * Add source links to your graph inside the 'showSources' config argument.\n */\nplots.addLinks = function(gd) {\n // Do not do anything if showLink and showSources are not set to true in config\n if(!gd._context.showLink && !gd._context.showSources) return;\n\n var fullLayout = gd._fullLayout;\n\n var linkContainer = Lib.ensureSingle(fullLayout._paper, 'text', 'js-plot-link-container', function(s) {\n s.style({\n 'font-family': '\"Open Sans\", Arial, sans-serif',\n 'font-size': '12px',\n 'fill': Color.defaultLine,\n 'pointer-events': 'all'\n })\n .each(function() {\n var links = d3.select(this);\n links.append('tspan').classed('js-link-to-tool', true);\n links.append('tspan').classed('js-link-spacer', true);\n links.append('tspan').classed('js-sourcelinks', true);\n });\n });\n\n // The text node inside svg\n var text = linkContainer.node();\n var attrs = {y: fullLayout._paper.attr('height') - 9};\n\n // If text's width is bigger than the layout\n // Check that text is a child node or document.body\n // because otherwise IE/Edge might throw an exception\n // when calling getComputedTextLength().\n // Apparently offsetParent is null for invisibles.\n if(document.body.contains(text) && text.getComputedTextLength() >= (fullLayout.width - 20)) {\n // Align the text at the left\n attrs['text-anchor'] = 'start';\n attrs.x = 5;\n } else {\n // Align the text at the right\n attrs['text-anchor'] = 'end';\n attrs.x = fullLayout._paper.attr('width') - 7;\n }\n\n linkContainer.attr(attrs);\n\n var toolspan = linkContainer.select('.js-link-to-tool');\n var spacespan = linkContainer.select('.js-link-spacer');\n var sourcespan = linkContainer.select('.js-sourcelinks');\n\n if(gd._context.showSources) gd._context.showSources(gd);\n\n // 'view in plotly' link for embedded plots\n if(gd._context.showLink) positionPlayWithData(gd, toolspan);\n\n // separator if we have both sources and tool link\n spacespan.text((toolspan.text() && sourcespan.text()) ? ' - ' : '');\n};\n\n// note that now this function is only adding the brand in\n// iframes and 3rd-party apps\nfunction positionPlayWithData(gd, container) {\n container.text('');\n var link = container.append('a')\n .attr({\n 'xlink:xlink:href': '#',\n 'class': 'link--impt link--embedview',\n 'font-weight': 'bold'\n })\n .text(gd._context.linkText + ' ' + String.fromCharCode(187));\n\n if(gd._context.sendData) {\n link.on('click', function() {\n plots.sendDataToCloud(gd);\n });\n } else {\n var path = window.location.pathname.split('/');\n var query = window.location.search;\n link.attr({\n 'xlink:xlink:show': 'new',\n 'xlink:xlink:href': '/' + path[2].split('.')[0] + '/' + path[1] + query\n });\n }\n}\n\nplots.sendDataToCloud = function(gd) {\n var baseUrl = (window.PLOTLYENV || {}).BASE_URL || gd._context.plotlyServerURL;\n if(!baseUrl) return;\n\n gd.emit('plotly_beforeexport');\n\n var hiddenformDiv = d3.select(gd)\n .append('div')\n .attr('id', 'hiddenform')\n .style('display', 'none');\n\n var hiddenform = hiddenformDiv\n .append('form')\n .attr({\n action: baseUrl + '/external',\n method: 'post',\n target: '_blank'\n });\n\n var hiddenformInput = hiddenform\n .append('input')\n .attr({\n type: 'text',\n name: 'data'\n });\n\n hiddenformInput.node().value = plots.graphJson(gd, false, 'keepdata');\n hiddenform.node().submit();\n hiddenformDiv.remove();\n\n gd.emit('plotly_afterexport');\n return false;\n};\n\nvar d3FormatKeys = [\n 'days', 'shortDays', 'months', 'shortMonths', 'periods',\n 'dateTime', 'date', 'time',\n 'decimal', 'thousands', 'grouping', 'currency'\n];\n\nvar extraFormatKeys = [\n 'year', 'month', 'dayMonth', 'dayMonthYear'\n];\n\n/*\n * Fill in default values\n * @param {DOM element} gd\n * @param {object} opts\n * @param {boolean} opts.skipUpdateCalc: normally if the existing gd.calcdata looks\n * compatible with the new gd._fullData we finish by linking the new _fullData traces\n * to the old gd.calcdata, so it's correctly set if we're not going to recalc. But also,\n * if there are calcTransforms on the trace, we first remap data arrays from the old full\n * trace into the new one. Use skipUpdateCalc to defer this (needed by Plotly.react)\n *\n * gd.data, gd.layout:\n * are precisely what the user specified (except as modified by cleanData/cleanLayout),\n * these fields shouldn't be modified (except for filling in some auto values)\n * nor used directly after the supply defaults step.\n *\n * gd._fullData, gd._fullLayout:\n * are complete descriptions of how to draw the plot,\n * use these fields in all required computations.\n *\n * gd._fullLayout._modules\n * is a list of all the trace modules required to draw the plot.\n *\n * gd._fullLayout._visibleModules\n * subset of _modules, a list of modules corresponding to visible:true traces.\n *\n * gd._fullLayout._basePlotModules\n * is a list of all the plot modules required to draw the plot.\n *\n * gd._fullLayout._transformModules\n * is a list of all the transform modules invoked.\n *\n */\nplots.supplyDefaults = function(gd, opts) {\n var skipUpdateCalc = opts && opts.skipUpdateCalc;\n var oldFullLayout = gd._fullLayout || {};\n\n if(oldFullLayout._skipDefaults) {\n delete oldFullLayout._skipDefaults;\n return;\n }\n\n var newFullLayout = gd._fullLayout = {};\n var newLayout = gd.layout || {};\n\n var oldFullData = gd._fullData || [];\n var newFullData = gd._fullData = [];\n var newData = gd.data || [];\n\n var oldCalcdata = gd.calcdata || [];\n\n var context = gd._context || {};\n\n var i;\n\n // Create all the storage space for frames, but only if doesn't already exist\n if(!gd._transitionData) plots.createTransitionData(gd);\n\n // So we only need to do this once (and since we have gd here)\n // get the translated placeholder titles.\n // These ones get used as default values so need to be known at supplyDefaults\n // others keep their blank defaults but render the placeholder as desired later\n // TODO: make these work the same way, only inserting the placeholder text at draw time?\n // The challenge is that this has slightly different behavior right now in editable mode:\n // using the placeholder as default makes this text permanently (but lightly) visible,\n // but explicit '' for these titles gives you a placeholder that's hidden until you mouse\n // over it - so you're not distracted by it if you really don't want a title, but if you do\n // and you're new to plotly you may not be able to find it.\n // When editable=false the two behave the same, no title is drawn.\n newFullLayout._dfltTitle = {\n plot: _(gd, 'Click to enter Plot title'),\n x: _(gd, 'Click to enter X axis title'),\n y: _(gd, 'Click to enter Y axis title'),\n colorbar: _(gd, 'Click to enter Colorscale title'),\n annotation: _(gd, 'new text')\n };\n newFullLayout._traceWord = _(gd, 'trace');\n\n var formatObj = getFormatObj(gd, d3FormatKeys);\n\n // stash the token from context so mapbox subplots can use it as default\n newFullLayout._mapboxAccessToken = context.mapboxAccessToken;\n\n // first fill in what we can of layout without looking at data\n // because fullData needs a few things from layout\n if(oldFullLayout._initialAutoSizeIsDone) {\n // coerce the updated layout while preserving width and height\n var oldWidth = oldFullLayout.width;\n var oldHeight = oldFullLayout.height;\n\n plots.supplyLayoutGlobalDefaults(newLayout, newFullLayout, formatObj);\n\n if(!newLayout.width) newFullLayout.width = oldWidth;\n if(!newLayout.height) newFullLayout.height = oldHeight;\n plots.sanitizeMargins(newFullLayout);\n } else {\n // coerce the updated layout and autosize if needed\n plots.supplyLayoutGlobalDefaults(newLayout, newFullLayout, formatObj);\n\n var missingWidthOrHeight = (!newLayout.width || !newLayout.height);\n var autosize = newFullLayout.autosize;\n var autosizable = context.autosizable;\n var initialAutoSize = missingWidthOrHeight && (autosize || autosizable);\n\n if(initialAutoSize) plots.plotAutoSize(gd, newLayout, newFullLayout);\n else if(missingWidthOrHeight) plots.sanitizeMargins(newFullLayout);\n\n // for backwards-compatibility with Plotly v1.x.x\n if(!autosize && missingWidthOrHeight) {\n newLayout.width = newFullLayout.width;\n newLayout.height = newFullLayout.height;\n }\n }\n\n newFullLayout._d3locale = getFormatter(formatObj, newFullLayout.separators);\n newFullLayout._extraFormat = getFormatObj(gd, extraFormatKeys);\n\n newFullLayout._initialAutoSizeIsDone = true;\n\n // keep track of how many traces are inputted\n newFullLayout._dataLength = newData.length;\n\n // clear the lists of trace and baseplot modules, and subplots\n newFullLayout._modules = [];\n newFullLayout._visibleModules = [];\n newFullLayout._basePlotModules = [];\n var subplots = newFullLayout._subplots = emptySubplotLists();\n\n // initialize axis and subplot hash objects for splom-generated grids\n var splomAxes = newFullLayout._splomAxes = {x: {}, y: {}};\n var splomSubplots = newFullLayout._splomSubplots = {};\n // initialize splom grid defaults\n newFullLayout._splomGridDflt = {};\n\n // for stacked area traces to share config across traces\n newFullLayout._scatterStackOpts = {};\n // for the first scatter trace on each subplot (so it knows tonext->tozero)\n newFullLayout._firstScatter = {};\n // for grouped bar/box/violin trace to share config across traces\n newFullLayout._alignmentOpts = {};\n // track color axes referenced in the data\n newFullLayout._colorAxes = {};\n\n // for traces to request a default rangeslider on their x axes\n // eg set `_requestRangeslider.x2 = true` for xaxis2\n newFullLayout._requestRangeslider = {};\n\n // pull uids from old data to use as new defaults\n newFullLayout._traceUids = getTraceUids(oldFullData, newData);\n\n // then do the data\n newFullLayout._globalTransforms = (gd._context || {}).globalTransforms;\n plots.supplyDataDefaults(newData, newFullData, newLayout, newFullLayout);\n\n // redo grid size defaults with info about splom x/y axes,\n // and fill in generated cartesian axes and subplots\n var splomXa = Object.keys(splomAxes.x);\n var splomYa = Object.keys(splomAxes.y);\n if(splomXa.length > 1 && splomYa.length > 1) {\n Registry.getComponentMethod('grid', 'sizeDefaults')(newLayout, newFullLayout);\n\n for(i = 0; i < splomXa.length; i++) {\n Lib.pushUnique(subplots.xaxis, splomXa[i]);\n }\n for(i = 0; i < splomYa.length; i++) {\n Lib.pushUnique(subplots.yaxis, splomYa[i]);\n }\n for(var k in splomSubplots) {\n Lib.pushUnique(subplots.cartesian, k);\n }\n }\n\n // attach helper method to check whether a plot type is present on graph\n newFullLayout._has = plots._hasPlotType.bind(newFullLayout);\n\n if(oldFullData.length === newFullData.length) {\n for(i = 0; i < newFullData.length; i++) {\n relinkPrivateKeys(newFullData[i], oldFullData[i]);\n }\n }\n\n // finally, fill in the pieces of layout that may need to look at data\n plots.supplyLayoutModuleDefaults(newLayout, newFullLayout, newFullData, gd._transitionData);\n\n // Special cases that introduce interactions between traces.\n // This is after relinkPrivateKeys so we can use those in crossTraceDefaults\n // and after layout module defaults, so we can use eg barmode\n var _modules = newFullLayout._visibleModules;\n var crossTraceDefaultsFuncs = [];\n for(i = 0; i < _modules.length; i++) {\n var funci = _modules[i].crossTraceDefaults;\n // some trace types share crossTraceDefaults (ie histogram2d, histogram2dcontour)\n if(funci) Lib.pushUnique(crossTraceDefaultsFuncs, funci);\n }\n for(i = 0; i < crossTraceDefaultsFuncs.length; i++) {\n crossTraceDefaultsFuncs[i](newFullData, newFullLayout);\n }\n\n // turn on flag to optimize large splom-only graphs\n // mostly by omitting SVG layers during Cartesian.drawFramework\n newFullLayout._hasOnlyLargeSploms = (\n newFullLayout._basePlotModules.length === 1 &&\n newFullLayout._basePlotModules[0].name === 'splom' &&\n splomXa.length > 15 &&\n splomYa.length > 15 &&\n newFullLayout.shapes.length === 0 &&\n newFullLayout.images.length === 0\n );\n\n // TODO remove in v2.0.0\n // add has-plot-type refs to fullLayout for backward compatibility\n newFullLayout._hasCartesian = newFullLayout._has('cartesian');\n newFullLayout._hasGeo = newFullLayout._has('geo');\n newFullLayout._hasGL3D = newFullLayout._has('gl3d');\n newFullLayout._hasGL2D = newFullLayout._has('gl2d');\n newFullLayout._hasTernary = newFullLayout._has('ternary');\n newFullLayout._hasPie = newFullLayout._has('pie');\n\n // relink / initialize subplot axis objects\n plots.linkSubplots(newFullData, newFullLayout, oldFullData, oldFullLayout);\n\n // clean subplots and other artifacts from previous plot calls\n plots.cleanPlot(newFullData, newFullLayout, oldFullData, oldFullLayout);\n\n var hadGL2D = !!(oldFullLayout._has && oldFullLayout._has('gl2d'));\n var hasGL2D = !!(newFullLayout._has && newFullLayout._has('gl2d'));\n var hadCartesian = !!(oldFullLayout._has && oldFullLayout._has('cartesian'));\n var hasCartesian = !!(newFullLayout._has && newFullLayout._has('cartesian'));\n var hadBgLayer = hadCartesian || hadGL2D;\n var hasBgLayer = hasCartesian || hasGL2D;\n if(hadBgLayer && !hasBgLayer) {\n // remove bgLayer\n oldFullLayout._bgLayer.remove();\n } else if(hasBgLayer && !hadBgLayer) {\n // create bgLayer\n newFullLayout._shouldCreateBgLayer = true;\n }\n\n // clear selection outline until we implement persistent selection,\n // don't clear them though when drag handlers (e.g. listening to\n // `plotly_selecting`) update the graph.\n // we should try to come up with a better solution when implementing\n // https://github.com/plotly/plotly.js/issues/1851\n if(oldFullLayout._zoomlayer && !gd._dragging) {\n clearSelect({ // mock old gd\n _fullLayout: oldFullLayout\n });\n }\n\n\n // fill in meta helpers\n fillMetaTextHelpers(newFullData, newFullLayout);\n\n // relink functions and _ attributes to promote consistency between plots\n relinkPrivateKeys(newFullLayout, oldFullLayout);\n\n // colorscale crossTraceDefaults needs newFullLayout with relinked keys\n Registry.getComponentMethod('colorscale', 'crossTraceDefaults')(newFullData, newFullLayout);\n\n // For persisting GUI-driven changes in layout\n // _preGUI and _tracePreGUI were already copied over in relinkPrivateKeys\n if(!newFullLayout._preGUI) newFullLayout._preGUI = {};\n // track trace GUI changes by uid rather than by trace index\n if(!newFullLayout._tracePreGUI) newFullLayout._tracePreGUI = {};\n var tracePreGUI = newFullLayout._tracePreGUI;\n var uids = {};\n var uid;\n for(uid in tracePreGUI) uids[uid] = 'old';\n for(i = 0; i < newFullData.length; i++) {\n uid = newFullData[i]._fullInput.uid;\n if(!uids[uid]) tracePreGUI[uid] = {};\n uids[uid] = 'new';\n }\n for(uid in uids) {\n if(uids[uid] === 'old') delete tracePreGUI[uid];\n }\n\n // set up containers for margin calculations\n initMargins(newFullLayout);\n\n // collect and do some initial calculations for rangesliders\n Registry.getComponentMethod('rangeslider', 'makeData')(newFullLayout);\n\n // update object references in calcdata\n if(!skipUpdateCalc && oldCalcdata.length === newFullData.length) {\n plots.supplyDefaultsUpdateCalc(oldCalcdata, newFullData);\n }\n};\n\nplots.supplyDefaultsUpdateCalc = function(oldCalcdata, newFullData) {\n for(var i = 0; i < newFullData.length; i++) {\n var newTrace = newFullData[i];\n var cd0 = (oldCalcdata[i] || [])[0];\n if(cd0 && cd0.trace) {\n var oldTrace = cd0.trace;\n if(oldTrace._hasCalcTransform) {\n var arrayAttrs = oldTrace._arrayAttrs;\n var j, astr, oldArrayVal;\n\n for(j = 0; j < arrayAttrs.length; j++) {\n astr = arrayAttrs[j];\n oldArrayVal = Lib.nestedProperty(oldTrace, astr).get().slice();\n Lib.nestedProperty(newTrace, astr).set(oldArrayVal);\n }\n }\n cd0.trace = newTrace;\n }\n }\n};\n\n/**\n * Create a list of uid strings satisfying (in this order of importance):\n * 1. all unique, all strings\n * 2. matches input uids if provided\n * 3. matches previous data uids\n */\nfunction getTraceUids(oldFullData, newData) {\n var len = newData.length;\n var oldFullInput = [];\n var i, prevFullInput;\n for(i = 0; i < oldFullData.length; i++) {\n var thisFullInput = oldFullData[i]._fullInput;\n if(thisFullInput !== prevFullInput) oldFullInput.push(thisFullInput);\n prevFullInput = thisFullInput;\n }\n var oldLen = oldFullInput.length;\n var out = new Array(len);\n var seenUids = {};\n\n function setUid(uid, i) {\n out[i] = uid;\n seenUids[uid] = 1;\n }\n\n function tryUid(uid, i) {\n if(uid && typeof uid === 'string' && !seenUids[uid]) {\n setUid(uid, i);\n return true;\n }\n }\n\n for(i = 0; i < len; i++) {\n var newUid = newData[i].uid;\n if(typeof newUid === 'number') newUid = String(newUid);\n\n if(tryUid(newUid, i)) continue;\n if(i < oldLen && tryUid(oldFullInput[i].uid, i)) continue;\n setUid(Lib.randstr(seenUids), i);\n }\n\n return out;\n}\n\n/**\n * Make a container for collecting subplots we need to display.\n *\n * Finds all subplot types we need to enumerate once and caches it,\n * but makes a new output object each time.\n * Single-trace subplots (which have no `id`) such as pie, table, etc\n * do not need to be collected because we just draw all visible traces.\n */\nfunction emptySubplotLists() {\n var collectableSubplotTypes = Registry.collectableSubplotTypes;\n var out = {};\n var i, j;\n\n if(!collectableSubplotTypes) {\n collectableSubplotTypes = [];\n\n var subplotsRegistry = Registry.subplotsRegistry;\n\n for(var subplotType in subplotsRegistry) {\n var subplotModule = subplotsRegistry[subplotType];\n var subplotAttr = subplotModule.attr;\n\n if(subplotAttr) {\n collectableSubplotTypes.push(subplotType);\n\n // special case, currently just for cartesian:\n // we need to enumerate axes, not just subplots\n if(Array.isArray(subplotAttr)) {\n for(j = 0; j < subplotAttr.length; j++) {\n Lib.pushUnique(collectableSubplotTypes, subplotAttr[j]);\n }\n }\n }\n }\n }\n\n for(i = 0; i < collectableSubplotTypes.length; i++) {\n out[collectableSubplotTypes[i]] = [];\n }\n return out;\n}\n\n/**\n * getFormatObj: use _context to get the format object from locale.\n * Used to get d3.locale argument object and extraFormat argument object\n *\n * Regarding d3.locale argument :\n * decimal and thousands can be overridden later by layout.separators\n * grouping and currency are not presently used by our automatic number\n * formatting system but can be used by custom formats.\n *\n * @returns {object} d3.locale format object\n */\nfunction getFormatObj(gd, formatKeys) {\n var locale = gd._context.locale;\n if(!locale) locale === 'en-US';\n\n var formatDone = false;\n var formatObj = {};\n\n function includeFormat(newFormat) {\n var formatFinished = true;\n for(var i = 0; i < formatKeys.length; i++) {\n var formatKey = formatKeys[i];\n if(!formatObj[formatKey]) {\n if(newFormat[formatKey]) {\n formatObj[formatKey] = newFormat[formatKey];\n } else formatFinished = false;\n }\n }\n if(formatFinished) formatDone = true;\n }\n\n // same as localize, look for format parts in each format spec in the chain\n for(var i = 0; i < 2; i++) {\n var locales = gd._context.locales;\n for(var j = 0; j < 2; j++) {\n var formatj = (locales[locale] || {}).format;\n if(formatj) {\n includeFormat(formatj);\n if(formatDone) break;\n }\n locales = Registry.localeRegistry;\n }\n\n var baseLocale = locale.split('-')[0];\n if(formatDone || baseLocale === locale) break;\n locale = baseLocale;\n }\n\n // lastly pick out defaults from english (non-US, as DMY is so much more common)\n if(!formatDone) includeFormat(Registry.localeRegistry.en.format);\n\n return formatObj;\n}\n\n/**\n * getFormatter: combine the final separators with the locale formatting object\n * we pulled earlier to generate number and time formatters\n * TODO: remove separators in v2, only use locale, so we don't need this step?\n *\n * @param {object} formatObj: d3.locale format object\n * @param {string} separators: length-2 string to override decimal and thousands\n * separators in number formatting\n *\n * @returns {object} {numberFormat, timeFormat} d3 formatter factory functions\n * for numbers and time\n */\nfunction getFormatter(formatObj, separators) {\n formatObj.decimal = separators.charAt(0);\n formatObj.thousands = separators.charAt(1);\n\n return d3.locale(formatObj);\n}\n\nfunction fillMetaTextHelpers(newFullData, newFullLayout) {\n var _meta;\n var meta4data = [];\n\n if(newFullLayout.meta) {\n _meta = newFullLayout._meta = {\n meta: newFullLayout.meta,\n layout: {meta: newFullLayout.meta}\n };\n }\n\n for(var i = 0; i < newFullData.length; i++) {\n var trace = newFullData[i];\n\n if(trace.meta) {\n meta4data[trace.index] = trace._meta = {meta: trace.meta};\n } else if(newFullLayout.meta) {\n trace._meta = {meta: newFullLayout.meta};\n }\n if(newFullLayout.meta) {\n trace._meta.layout = {meta: newFullLayout.meta};\n }\n }\n\n if(meta4data.length) {\n if(!_meta) {\n _meta = newFullLayout._meta = {};\n }\n _meta.data = meta4data;\n }\n}\n\n// Create storage for all of the data related to frames and transitions:\nplots.createTransitionData = function(gd) {\n // Set up the default keyframe if it doesn't exist:\n if(!gd._transitionData) {\n gd._transitionData = {};\n }\n\n if(!gd._transitionData._frames) {\n gd._transitionData._frames = [];\n }\n\n if(!gd._transitionData._frameHash) {\n gd._transitionData._frameHash = {};\n }\n\n if(!gd._transitionData._counter) {\n gd._transitionData._counter = 0;\n }\n\n if(!gd._transitionData._interruptCallbacks) {\n gd._transitionData._interruptCallbacks = [];\n }\n};\n\n// helper function to be bound to fullLayout to check\n// whether a certain plot type is present on plot\n// or trace has a category\nplots._hasPlotType = function(category) {\n var i;\n\n // check base plot modules\n var basePlotModules = this._basePlotModules || [];\n for(i = 0; i < basePlotModules.length; i++) {\n if(basePlotModules[i].name === category) return true;\n }\n\n // check trace modules (including non-visible:true)\n var modules = this._modules || [];\n for(i = 0; i < modules.length; i++) {\n var name = modules[i].name;\n if(name === category) return true;\n // N.B. this is modules[i] along with 'categories' as a hash object\n var _module = Registry.modules[name];\n if(_module && _module.categories[category]) return true;\n }\n\n return false;\n};\n\nplots.cleanPlot = function(newFullData, newFullLayout, oldFullData, oldFullLayout) {\n var i, j;\n\n var basePlotModules = oldFullLayout._basePlotModules || [];\n for(i = 0; i < basePlotModules.length; i++) {\n var _module = basePlotModules[i];\n\n if(_module.clean) {\n _module.clean(newFullData, newFullLayout, oldFullData, oldFullLayout);\n }\n }\n\n var hadGl = oldFullLayout._has && oldFullLayout._has('gl');\n var hasGl = newFullLayout._has && newFullLayout._has('gl');\n\n if(hadGl && !hasGl) {\n if(oldFullLayout._glcontainer !== undefined) {\n oldFullLayout._glcontainer.selectAll('.gl-canvas').remove();\n oldFullLayout._glcontainer.selectAll('.no-webgl').remove();\n oldFullLayout._glcanvas = null;\n }\n }\n\n var hasInfoLayer = !!oldFullLayout._infolayer;\n\n oldLoop:\n for(i = 0; i < oldFullData.length; i++) {\n var oldTrace = oldFullData[i];\n var oldUid = oldTrace.uid;\n\n for(j = 0; j < newFullData.length; j++) {\n var newTrace = newFullData[j];\n\n if(oldUid === newTrace.uid) continue oldLoop;\n }\n\n // clean old colorbars\n if(hasInfoLayer) {\n oldFullLayout._infolayer.select('.cb' + oldUid).remove();\n }\n }\n};\n\nplots.linkSubplots = function(newFullData, newFullLayout, oldFullData, oldFullLayout) {\n var i, j;\n\n var oldSubplots = oldFullLayout._plots || {};\n var newSubplots = newFullLayout._plots = {};\n var newSubplotList = newFullLayout._subplots;\n\n var mockGd = {\n _fullData: newFullData,\n _fullLayout: newFullLayout\n };\n\n var ids = newSubplotList.cartesian.concat(newSubplotList.gl2d || []);\n\n for(i = 0; i < ids.length; i++) {\n var id = ids[i];\n var oldSubplot = oldSubplots[id];\n var xaxis = axisIDs.getFromId(mockGd, id, 'x');\n var yaxis = axisIDs.getFromId(mockGd, id, 'y');\n var plotinfo;\n\n // link or create subplot object\n if(oldSubplot) {\n plotinfo = newSubplots[id] = oldSubplot;\n } else {\n plotinfo = newSubplots[id] = {};\n plotinfo.id = id;\n }\n\n // add these axis ids to each others' subplot lists\n xaxis._counterAxes.push(yaxis._id);\n yaxis._counterAxes.push(xaxis._id);\n xaxis._subplotsWith.push(id);\n yaxis._subplotsWith.push(id);\n\n // update x and y axis layout object refs\n plotinfo.xaxis = xaxis;\n plotinfo.yaxis = yaxis;\n\n // By default, we clip at the subplot level,\n // but if one trace on a given subplot has *cliponaxis* set to false,\n // we need to clip at the trace module layer level;\n // find this out here, once of for all.\n plotinfo._hasClipOnAxisFalse = false;\n\n for(j = 0; j < newFullData.length; j++) {\n var trace = newFullData[j];\n\n if(\n trace.xaxis === plotinfo.xaxis._id &&\n trace.yaxis === plotinfo.yaxis._id &&\n trace.cliponaxis === false\n ) {\n plotinfo._hasClipOnAxisFalse = true;\n break;\n }\n }\n }\n\n // while we're at it, link overlaying axes to their main axes and\n // anchored axes to the axes they're anchored to\n var axList = axisIDs.list(mockGd, null, true);\n var ax;\n for(i = 0; i < axList.length; i++) {\n ax = axList[i];\n var mainAx = null;\n\n if(ax.overlaying) {\n mainAx = axisIDs.getFromId(mockGd, ax.overlaying);\n\n // you cannot overlay an axis that's already overlaying another\n if(mainAx && mainAx.overlaying) {\n ax.overlaying = false;\n mainAx = null;\n }\n }\n ax._mainAxis = mainAx || ax;\n\n /*\n * For now force overlays to overlay completely... so they\n * can drag together correctly and share backgrounds.\n * Later perhaps we make separate axis domain and\n * tick/line domain or something, so they can still share\n * the (possibly larger) dragger and background but don't\n * have to both be drawn over that whole domain\n */\n if(mainAx) ax.domain = mainAx.domain.slice();\n\n ax._anchorAxis = ax.anchor === 'free' ?\n null :\n axisIDs.getFromId(mockGd, ax.anchor);\n }\n\n // finally, we can find the main subplot for each axis\n // (on which the ticks & labels are drawn)\n for(i = 0; i < axList.length; i++) {\n ax = axList[i];\n ax._counterAxes.sort(axisIDs.idSort);\n ax._subplotsWith.sort(Lib.subplotSort);\n ax._mainSubplot = findMainSubplot(ax, newFullLayout);\n\n // find \"full\" domain span of counter axes,\n // this loop can be costly, so only compute it when required\n if(ax._counterAxes.length && (\n (ax.spikemode && ax.spikemode.indexOf('across') !== -1) ||\n (ax.automargin && ax.mirror && ax.anchor !== 'free') ||\n Registry.getComponentMethod('rangeslider', 'isVisible')(ax)\n )) {\n var min = 1;\n var max = 0;\n for(j = 0; j < ax._counterAxes.length; j++) {\n var ax2 = axisIDs.getFromId(mockGd, ax._counterAxes[j]);\n min = Math.min(min, ax2.domain[0]);\n max = Math.max(max, ax2.domain[1]);\n }\n if(min < max) {\n ax._counterDomainMin = min;\n ax._counterDomainMax = max;\n }\n }\n }\n};\n\nfunction findMainSubplot(ax, fullLayout) {\n var mockGd = {_fullLayout: fullLayout};\n\n var isX = ax._id.charAt(0) === 'x';\n var anchorAx = ax._mainAxis._anchorAxis;\n var mainSubplotID = '';\n var nextBestMainSubplotID = '';\n var anchorID = '';\n\n // First try the main ID with the anchor\n if(anchorAx) {\n anchorID = anchorAx._mainAxis._id;\n mainSubplotID = isX ? (ax._id + anchorID) : (anchorID + ax._id);\n }\n\n // Then look for a subplot with the counteraxis overlaying the anchor\n // If that fails just use the first subplot including this axis\n if(!mainSubplotID || !fullLayout._plots[mainSubplotID]) {\n mainSubplotID = '';\n\n var counterIDs = ax._counterAxes;\n for(var j = 0; j < counterIDs.length; j++) {\n var counterPart = counterIDs[j];\n var id = isX ? (ax._id + counterPart) : (counterPart + ax._id);\n if(!nextBestMainSubplotID) nextBestMainSubplotID = id;\n var counterAx = axisIDs.getFromId(mockGd, counterPart);\n if(anchorID && counterAx.overlaying === anchorID) {\n mainSubplotID = id;\n break;\n }\n }\n }\n\n return mainSubplotID || nextBestMainSubplotID;\n}\n\n// This function clears any trace attributes with valType: color and\n// no set dflt filed in the plot schema. This is needed because groupby (which\n// is the only transform for which this currently applies) supplies parent\n// trace defaults, then expanded trace defaults. The result is that `null`\n// colors are default-supplied and inherited as a color instead of a null.\n// The result is that expanded trace default colors have no effect, with\n// the final result that groups are indistinguishable. This function clears\n// those colors so that individual groupby groups get unique colors.\nplots.clearExpandedTraceDefaultColors = function(trace) {\n var colorAttrs, path, i;\n\n // This uses weird closure state in order to satisfy the linter rule\n // that we can't create functions in a loop.\n function locateColorAttrs(attr, attrName, attrs, level) {\n path[level] = attrName;\n path.length = level + 1;\n if(attr.valType === 'color' && attr.dflt === undefined) {\n colorAttrs.push(path.join('.'));\n }\n }\n\n path = [];\n\n // Get the cached colorAttrs:\n colorAttrs = trace._module._colorAttrs;\n\n // Or else compute and cache the colorAttrs on the module:\n if(!colorAttrs) {\n trace._module._colorAttrs = colorAttrs = [];\n PlotSchema.crawl(\n trace._module.attributes,\n locateColorAttrs\n );\n }\n\n for(i = 0; i < colorAttrs.length; i++) {\n var origprop = Lib.nestedProperty(trace, '_input.' + colorAttrs[i]);\n\n if(!origprop.get()) {\n Lib.nestedProperty(trace, colorAttrs[i]).set(null);\n }\n }\n};\n\n\nplots.supplyDataDefaults = function(dataIn, dataOut, layout, fullLayout) {\n var modules = fullLayout._modules;\n var visibleModules = fullLayout._visibleModules;\n var basePlotModules = fullLayout._basePlotModules;\n var cnt = 0;\n var colorCnt = 0;\n\n var i, fullTrace, trace;\n\n fullLayout._transformModules = [];\n\n function pushModule(fullTrace) {\n dataOut.push(fullTrace);\n\n var _module = fullTrace._module;\n if(!_module) return;\n\n Lib.pushUnique(modules, _module);\n if(fullTrace.visible === true) Lib.pushUnique(visibleModules, _module);\n Lib.pushUnique(basePlotModules, fullTrace._module.basePlotModule);\n cnt++;\n\n // TODO: do we really want color not to increment for explicitly invisible traces?\n // This logic is weird, but matches previous behavior: traces that you explicitly\n // set to visible:false do not increment the color, but traces WE determine to be\n // empty or invalid (and thus set to visible:false) DO increment color.\n // I kind of think we should just let all traces increment color, visible or not.\n // see mock: axes-autotype-empty vs. a test of restyling visible: false that\n // I can't find right now...\n if(fullTrace._input.visible !== false) colorCnt++;\n }\n\n var carpetIndex = {};\n var carpetDependents = [];\n var dataTemplate = (layout.template || {}).data || {};\n var templater = Template.traceTemplater(dataTemplate);\n\n for(i = 0; i < dataIn.length; i++) {\n trace = dataIn[i];\n\n // reuse uid we may have pulled out of oldFullData\n // Note: templater supplies trace type\n fullTrace = templater.newTrace(trace);\n fullTrace.uid = fullLayout._traceUids[i];\n plots.supplyTraceDefaults(trace, fullTrace, colorCnt, fullLayout, i);\n\n fullTrace.index = i;\n fullTrace._input = trace;\n fullTrace._expandedIndex = cnt;\n\n if(fullTrace.transforms && fullTrace.transforms.length) {\n var sdInvisible = trace.visible !== false && fullTrace.visible === false;\n\n var expandedTraces = applyTransforms(fullTrace, dataOut, layout, fullLayout);\n\n for(var j = 0; j < expandedTraces.length; j++) {\n var expandedTrace = expandedTraces[j];\n\n // No further templating during transforms.\n var fullExpandedTrace = {\n _template: fullTrace._template,\n type: fullTrace.type,\n // set uid using parent uid and expanded index\n // to promote consistency between update calls\n uid: fullTrace.uid + j\n };\n\n // If the first supplyDefaults created `visible: false`,\n // clear it before running supplyDefaults a second time,\n // because sometimes there are items we still want to coerce\n // inside trace modules before determining that the trace is\n // again `visible: false`, for example partial visibilities\n // in `splom` traces.\n if(sdInvisible && expandedTrace.visible === false) {\n delete expandedTrace.visible;\n }\n\n plots.supplyTraceDefaults(expandedTrace, fullExpandedTrace, cnt, fullLayout, i);\n\n // relink private (i.e. underscore) keys expanded trace to full expanded trace so\n // that transform supply-default methods can set _ keys for future use.\n relinkPrivateKeys(fullExpandedTrace, expandedTrace);\n\n // add info about parent data trace\n fullExpandedTrace.index = i;\n fullExpandedTrace._input = trace;\n fullExpandedTrace._fullInput = fullTrace;\n\n // add info about the expanded data\n fullExpandedTrace._expandedIndex = cnt;\n fullExpandedTrace._expandedInput = expandedTrace;\n\n pushModule(fullExpandedTrace);\n }\n } else {\n // add identify refs for consistency with transformed traces\n fullTrace._fullInput = fullTrace;\n fullTrace._expandedInput = fullTrace;\n\n pushModule(fullTrace);\n }\n\n if(Registry.traceIs(fullTrace, 'carpetAxis')) {\n carpetIndex[fullTrace.carpet] = fullTrace;\n }\n\n if(Registry.traceIs(fullTrace, 'carpetDependent')) {\n carpetDependents.push(i);\n }\n }\n\n for(i = 0; i < carpetDependents.length; i++) {\n fullTrace = dataOut[carpetDependents[i]];\n\n if(!fullTrace.visible) continue;\n\n var carpetAxis = carpetIndex[fullTrace.carpet];\n fullTrace._carpet = carpetAxis;\n\n if(!carpetAxis || !carpetAxis.visible) {\n fullTrace.visible = false;\n continue;\n }\n\n fullTrace.xaxis = carpetAxis.xaxis;\n fullTrace.yaxis = carpetAxis.yaxis;\n }\n};\n\nplots.supplyAnimationDefaults = function(opts) {\n opts = opts || {};\n var i;\n var optsOut = {};\n\n function coerce(attr, dflt) {\n return Lib.coerce(opts || {}, optsOut, animationAttrs, attr, dflt);\n }\n\n coerce('mode');\n coerce('direction');\n coerce('fromcurrent');\n\n if(Array.isArray(opts.frame)) {\n optsOut.frame = [];\n for(i = 0; i < opts.frame.length; i++) {\n optsOut.frame[i] = plots.supplyAnimationFrameDefaults(opts.frame[i] || {});\n }\n } else {\n optsOut.frame = plots.supplyAnimationFrameDefaults(opts.frame || {});\n }\n\n if(Array.isArray(opts.transition)) {\n optsOut.transition = [];\n for(i = 0; i < opts.transition.length; i++) {\n optsOut.transition[i] = plots.supplyAnimationTransitionDefaults(opts.transition[i] || {});\n }\n } else {\n optsOut.transition = plots.supplyAnimationTransitionDefaults(opts.transition || {});\n }\n\n return optsOut;\n};\n\nplots.supplyAnimationFrameDefaults = function(opts) {\n var optsOut = {};\n\n function coerce(attr, dflt) {\n return Lib.coerce(opts || {}, optsOut, animationAttrs.frame, attr, dflt);\n }\n\n coerce('duration');\n coerce('redraw');\n\n return optsOut;\n};\n\nplots.supplyAnimationTransitionDefaults = function(opts) {\n var optsOut = {};\n\n function coerce(attr, dflt) {\n return Lib.coerce(opts || {}, optsOut, animationAttrs.transition, attr, dflt);\n }\n\n coerce('duration');\n coerce('easing');\n\n return optsOut;\n};\n\nplots.supplyFrameDefaults = function(frameIn) {\n var frameOut = {};\n\n function coerce(attr, dflt) {\n return Lib.coerce(frameIn, frameOut, frameAttrs, attr, dflt);\n }\n\n coerce('group');\n coerce('name');\n coerce('traces');\n coerce('baseframe');\n coerce('data');\n coerce('layout');\n\n return frameOut;\n};\n\nplots.supplyTraceDefaults = function(traceIn, traceOut, colorIndex, layout, traceInIndex) {\n var colorway = layout.colorway || Color.defaults;\n var defaultColor = colorway[colorIndex % colorway.length];\n\n var i;\n\n function coerce(attr, dflt) {\n return Lib.coerce(traceIn, traceOut, plots.attributes, attr, dflt);\n }\n\n var visible = coerce('visible');\n\n coerce('type');\n coerce('name', layout._traceWord + ' ' + traceInIndex);\n\n coerce('uirevision', layout.uirevision);\n\n // we want even invisible traces to make their would-be subplots visible\n // so coerce the subplot id(s) now no matter what\n var _module = plots.getModule(traceOut);\n\n traceOut._module = _module;\n if(_module) {\n var basePlotModule = _module.basePlotModule;\n var subplotAttr = basePlotModule.attr;\n var subplotAttrs = basePlotModule.attributes;\n if(subplotAttr && subplotAttrs) {\n var subplots = layout._subplots;\n var subplotId = '';\n\n if(\n visible ||\n basePlotModule.name !== 'gl2d' // for now just drop empty gl2d subplots\n // TODO - currently if we draw an empty gl2d subplot, it draws\n // nothing then gets stuck and you can't get it back without newPlot\n // sort this out in the regl refactor?\n ) {\n if(Array.isArray(subplotAttr)) {\n for(i = 0; i < subplotAttr.length; i++) {\n var attri = subplotAttr[i];\n var vali = Lib.coerce(traceIn, traceOut, subplotAttrs, attri);\n\n if(subplots[attri]) Lib.pushUnique(subplots[attri], vali);\n subplotId += vali;\n }\n } else {\n subplotId = Lib.coerce(traceIn, traceOut, subplotAttrs, subplotAttr);\n }\n\n if(subplots[basePlotModule.name]) {\n Lib.pushUnique(subplots[basePlotModule.name], subplotId);\n }\n }\n }\n }\n\n if(visible) {\n coerce('customdata');\n coerce('ids');\n coerce('meta');\n\n if(Registry.traceIs(traceOut, 'showLegend')) {\n Lib.coerce(traceIn, traceOut,\n _module.attributes.showlegend ? _module.attributes : plots.attributes,\n 'showlegend'\n );\n\n coerce('legendgroup');\n\n traceOut._dfltShowLegend = true;\n } else {\n traceOut._dfltShowLegend = false;\n }\n\n if(_module) {\n _module.supplyDefaults(traceIn, traceOut, defaultColor, layout);\n }\n\n if(!Registry.traceIs(traceOut, 'noOpacity')) {\n coerce('opacity');\n }\n\n if(Registry.traceIs(traceOut, 'notLegendIsolatable')) {\n // This clears out the legendonly state for traces like carpet that\n // cannot be isolated in the legend\n traceOut.visible = !!traceOut.visible;\n }\n\n if(!Registry.traceIs(traceOut, 'noHover')) {\n if(!traceOut.hovertemplate) Lib.coerceHoverinfo(traceIn, traceOut, layout);\n\n // parcats support hover, but not hoverlabel stylings (yet)\n if(traceOut.type !== 'parcats') {\n Registry.getComponentMethod('fx', 'supplyDefaults')(traceIn, traceOut, defaultColor, layout);\n }\n }\n\n if(_module && _module.selectPoints) {\n coerce('selectedpoints');\n }\n\n plots.supplyTransformDefaults(traceIn, traceOut, layout);\n }\n\n return traceOut;\n};\n\n/**\n * hasMakesDataTransform: does this trace have a transform that makes its own\n * data, either by grabbing it from somewhere else or by creating it from input\n * parameters? If so, we should still keep going with supplyDefaults\n * even if the trace is invisible, which may just be because it has no data yet.\n */\nfunction hasMakesDataTransform(trace) {\n var transforms = trace.transforms;\n if(Array.isArray(transforms) && transforms.length) {\n for(var i = 0; i < transforms.length; i++) {\n var ti = transforms[i];\n var _module = ti._module || transformsRegistry[ti.type];\n if(_module && _module.makesData) return true;\n }\n }\n return false;\n}\n\nplots.hasMakesDataTransform = hasMakesDataTransform;\n\nplots.supplyTransformDefaults = function(traceIn, traceOut, layout) {\n // For now we only allow transforms on 1D traces, ie those that specify a _length.\n // If we were to implement 2D transforms, we'd need to have each transform\n // describe its own applicability and disable itself when it doesn't apply.\n // Also allow transforms that make their own data, but not in globalTransforms\n if(!(traceOut._length || hasMakesDataTransform(traceIn))) return;\n\n var globalTransforms = layout._globalTransforms || [];\n var transformModules = layout._transformModules || [];\n\n if(!Array.isArray(traceIn.transforms) && globalTransforms.length === 0) return;\n\n var containerIn = traceIn.transforms || [];\n var transformList = globalTransforms.concat(containerIn);\n var containerOut = traceOut.transforms = [];\n\n for(var i = 0; i < transformList.length; i++) {\n var transformIn = transformList[i];\n var type = transformIn.type;\n var _module = transformsRegistry[type];\n var transformOut;\n\n /*\n * Supply defaults may run twice. First pass runs all supply defaults steps\n * and adds the _module to any output transforms.\n * If transforms exist another pass is run so that any generated traces also\n * go through supply defaults. This has the effect of rerunning\n * supplyTransformDefaults. If the transform does not have a `transform`\n * function it could not have generated any new traces and the second stage\n * is unnecessary. We detect this case with the following variables.\n */\n var isFirstStage = !(transformIn._module && transformIn._module === _module);\n var doLaterStages = _module && typeof _module.transform === 'function';\n\n if(!_module) Lib.warn('Unrecognized transform type ' + type + '.');\n\n if(_module && _module.supplyDefaults && (isFirstStage || doLaterStages)) {\n transformOut = _module.supplyDefaults(transformIn, traceOut, layout, traceIn);\n transformOut.type = type;\n transformOut._module = _module;\n\n Lib.pushUnique(transformModules, _module);\n } else {\n transformOut = Lib.extendFlat({}, transformIn);\n }\n\n containerOut.push(transformOut);\n }\n};\n\nfunction applyTransforms(fullTrace, fullData, layout, fullLayout) {\n var container = fullTrace.transforms;\n var dataOut = [fullTrace];\n\n for(var i = 0; i < container.length; i++) {\n var transform = container[i];\n var _module = transformsRegistry[transform.type];\n\n if(_module && _module.transform) {\n dataOut = _module.transform(dataOut, {\n transform: transform,\n fullTrace: fullTrace,\n fullData: fullData,\n layout: layout,\n fullLayout: fullLayout,\n transformIndex: i\n });\n }\n }\n\n return dataOut;\n}\n\nplots.supplyLayoutGlobalDefaults = function(layoutIn, layoutOut, formatObj) {\n function coerce(attr, dflt) {\n return Lib.coerce(layoutIn, layoutOut, plots.layoutAttributes, attr, dflt);\n }\n\n var template = layoutIn.template;\n if(Lib.isPlainObject(template)) {\n layoutOut.template = template;\n layoutOut._template = template.layout;\n layoutOut._dataTemplate = template.data;\n }\n\n var globalFont = Lib.coerceFont(coerce, 'font');\n\n coerce('title.text', layoutOut._dfltTitle.plot);\n\n Lib.coerceFont(coerce, 'title.font', {\n family: globalFont.family,\n size: Math.round(globalFont.size * 1.4),\n color: globalFont.color\n });\n\n coerce('title.xref');\n coerce('title.yref');\n coerce('title.x');\n coerce('title.y');\n coerce('title.xanchor');\n coerce('title.yanchor');\n coerce('title.pad.t');\n coerce('title.pad.r');\n coerce('title.pad.b');\n coerce('title.pad.l');\n\n var uniformtextMode = coerce('uniformtext.mode');\n if(uniformtextMode) {\n coerce('uniformtext.minsize');\n }\n\n // Make sure that autosize is defaulted to *true*\n // on layouts with no set width and height for backward compatibly,\n // in particular https://plotly.com/javascript/responsive-fluid-layout/\n //\n // Before https://github.com/plotly/plotly.js/pull/635 ,\n // layouts with no set width and height were set temporary set to 'initial'\n // to pass through the autosize routine\n //\n // This behavior is subject to change in v2.\n coerce('autosize', !(layoutIn.width && layoutIn.height));\n\n coerce('width');\n coerce('height');\n coerce('margin.l');\n coerce('margin.r');\n coerce('margin.t');\n coerce('margin.b');\n coerce('margin.pad');\n coerce('margin.autoexpand');\n\n if(layoutIn.width && layoutIn.height) plots.sanitizeMargins(layoutOut);\n\n Registry.getComponentMethod('grid', 'sizeDefaults')(layoutIn, layoutOut);\n\n coerce('paper_bgcolor');\n\n coerce('separators', formatObj.decimal + formatObj.thousands);\n coerce('hidesources');\n\n coerce('colorway');\n\n coerce('datarevision');\n var uirevision = coerce('uirevision');\n coerce('editrevision', uirevision);\n coerce('selectionrevision', uirevision);\n\n coerce('modebar.orientation');\n coerce('modebar.bgcolor', Color.addOpacity(layoutOut.paper_bgcolor, 0.5));\n var modebarDefaultColor = Color.contrast(Color.rgb(layoutOut.modebar.bgcolor));\n coerce('modebar.color', Color.addOpacity(modebarDefaultColor, 0.3));\n coerce('modebar.activecolor', Color.addOpacity(modebarDefaultColor, 0.7));\n coerce('modebar.uirevision', uirevision);\n\n Registry.getComponentMethod(\n 'shapes',\n 'supplyDrawNewShapeDefaults'\n )(layoutIn, layoutOut, coerce);\n\n coerce('meta');\n\n // do not include defaults in fullLayout when users do not set transition\n if(Lib.isPlainObject(layoutIn.transition)) {\n coerce('transition.duration');\n coerce('transition.easing');\n coerce('transition.ordering');\n }\n\n Registry.getComponentMethod(\n 'calendars',\n 'handleDefaults'\n )(layoutIn, layoutOut, 'calendar');\n\n Registry.getComponentMethod(\n 'fx',\n 'supplyLayoutGlobalDefaults'\n )(layoutIn, layoutOut, coerce);\n};\n\nfunction getComputedSize(attr) {\n return (\n (typeof attr === 'string') &&\n (attr.substr(attr.length - 2) === 'px') &&\n parseFloat(attr)\n );\n}\n\n\nplots.plotAutoSize = function plotAutoSize(gd, layout, fullLayout) {\n var context = gd._context || {};\n var frameMargins = context.frameMargins;\n var newWidth;\n var newHeight;\n\n var isPlotDiv = Lib.isPlotDiv(gd);\n\n if(isPlotDiv) gd.emit('plotly_autosize');\n\n // embedded in an iframe - just take the full iframe size\n // if we get to this point, with no aspect ratio restrictions\n if(context.fillFrame) {\n newWidth = window.innerWidth;\n newHeight = window.innerHeight;\n\n // somehow we get a few extra px height sometimes...\n // just hide it\n document.body.style.overflow = 'hidden';\n } else {\n // plotly.js - let the developers do what they want, either\n // provide height and width for the container div,\n // specify size in layout, or take the defaults,\n // but don't enforce any ratio restrictions\n var computedStyle = isPlotDiv ? window.getComputedStyle(gd) : {};\n\n newWidth = getComputedSize(computedStyle.width) || getComputedSize(computedStyle.maxWidth) || fullLayout.width;\n newHeight = getComputedSize(computedStyle.height) || getComputedSize(computedStyle.maxHeight) || fullLayout.height;\n\n if(isNumeric(frameMargins) && frameMargins > 0) {\n var factor = 1 - 2 * frameMargins;\n newWidth = Math.round(factor * newWidth);\n newHeight = Math.round(factor * newHeight);\n }\n }\n\n var minWidth = plots.layoutAttributes.width.min;\n var minHeight = plots.layoutAttributes.height.min;\n if(newWidth < minWidth) newWidth = minWidth;\n if(newHeight < minHeight) newHeight = minHeight;\n\n var widthHasChanged = !layout.width &&\n (Math.abs(fullLayout.width - newWidth) > 1);\n var heightHasChanged = !layout.height &&\n (Math.abs(fullLayout.height - newHeight) > 1);\n\n if(heightHasChanged || widthHasChanged) {\n if(widthHasChanged) fullLayout.width = newWidth;\n if(heightHasChanged) fullLayout.height = newHeight;\n }\n\n // cache initial autosize value, used in relayout when\n // width or height values are set to null\n if(!gd._initialAutoSize) {\n gd._initialAutoSize = { width: newWidth, height: newHeight };\n }\n\n plots.sanitizeMargins(fullLayout);\n};\n\nplots.supplyLayoutModuleDefaults = function(layoutIn, layoutOut, fullData, transitionData) {\n var componentsRegistry = Registry.componentsRegistry;\n var basePlotModules = layoutOut._basePlotModules;\n var component, i, _module;\n\n var Cartesian = Registry.subplotsRegistry.cartesian;\n\n // check if any components need to add more base plot modules\n // that weren't captured by traces\n for(component in componentsRegistry) {\n _module = componentsRegistry[component];\n\n if(_module.includeBasePlot) {\n _module.includeBasePlot(layoutIn, layoutOut);\n }\n }\n\n // make sure we *at least* have some cartesian axes\n if(!basePlotModules.length) {\n basePlotModules.push(Cartesian);\n }\n\n // ensure all cartesian axes have at least one subplot\n if(layoutOut._has('cartesian')) {\n Registry.getComponentMethod('grid', 'contentDefaults')(layoutIn, layoutOut);\n Cartesian.finalizeSubplots(layoutIn, layoutOut);\n }\n\n // sort subplot lists\n for(var subplotType in layoutOut._subplots) {\n layoutOut._subplots[subplotType].sort(Lib.subplotSort);\n }\n\n // base plot module layout defaults\n for(i = 0; i < basePlotModules.length; i++) {\n _module = basePlotModules[i];\n\n // e.g. pie does not have a layout-defaults step\n if(_module.supplyLayoutDefaults) {\n _module.supplyLayoutDefaults(layoutIn, layoutOut, fullData);\n }\n }\n\n // trace module layout defaults\n // use _modules rather than _visibleModules so that even\n // legendonly traces can include settings - eg barmode, which affects\n // legend.traceorder default value.\n var modules = layoutOut._modules;\n for(i = 0; i < modules.length; i++) {\n _module = modules[i];\n\n if(_module.supplyLayoutDefaults) {\n _module.supplyLayoutDefaults(layoutIn, layoutOut, fullData);\n }\n }\n\n // transform module layout defaults\n var transformModules = layoutOut._transformModules;\n for(i = 0; i < transformModules.length; i++) {\n _module = transformModules[i];\n\n if(_module.supplyLayoutDefaults) {\n _module.supplyLayoutDefaults(layoutIn, layoutOut, fullData, transitionData);\n }\n }\n\n for(component in componentsRegistry) {\n _module = componentsRegistry[component];\n\n if(_module.supplyLayoutDefaults) {\n _module.supplyLayoutDefaults(layoutIn, layoutOut, fullData);\n }\n }\n};\n\n// Remove all plotly attributes from a div so it can be replotted fresh\n// TODO: these really need to be encapsulated into a much smaller set...\nplots.purge = function(gd) {\n // note: we DO NOT remove _context because it doesn't change when we insert\n // a new plot, and may have been set outside of our scope.\n\n var fullLayout = gd._fullLayout || {};\n if(fullLayout._glcontainer !== undefined) {\n fullLayout._glcontainer.selectAll('.gl-canvas').remove();\n fullLayout._glcontainer.remove();\n fullLayout._glcanvas = null;\n }\n\n // remove modebar\n if(fullLayout._modeBar) fullLayout._modeBar.destroy();\n\n if(gd._transitionData) {\n // Ensure any dangling callbacks are simply dropped if the plot is purged.\n // This is more or less only actually important for testing.\n if(gd._transitionData._interruptCallbacks) {\n gd._transitionData._interruptCallbacks.length = 0;\n }\n\n if(gd._transitionData._animationRaf) {\n window.cancelAnimationFrame(gd._transitionData._animationRaf);\n }\n }\n\n // remove any planned throttles\n Lib.clearThrottle();\n\n // remove responsive handler\n Lib.clearResponsive(gd);\n\n // data and layout\n delete gd.data;\n delete gd.layout;\n delete gd._fullData;\n delete gd._fullLayout;\n delete gd.calcdata;\n delete gd.framework;\n delete gd.empty;\n\n delete gd.fid;\n\n delete gd.undoqueue; // action queue\n delete gd.undonum;\n delete gd.autoplay; // are we doing an action that doesn't go in undo queue?\n delete gd.changed;\n\n // these get recreated on Plotly.plot anyway, but just to be safe\n // (and to have a record of them...)\n delete gd._promises;\n delete gd._redrawTimer;\n delete gd._hmlumcount;\n delete gd._hmpixcount;\n delete gd._transitionData;\n delete gd._transitioning;\n delete gd._initialAutoSize;\n delete gd._transitioningWithDuration;\n\n // created during certain events, that *should* clean them up\n // themselves, but may not if there was an error\n delete gd._dragging;\n delete gd._dragged;\n delete gd._dragdata;\n delete gd._hoverdata;\n delete gd._snapshotInProgress;\n delete gd._editing;\n delete gd._mouseDownTime;\n delete gd._legendMouseDownTime;\n\n // remove all event listeners\n if(gd.removeAllListeners) gd.removeAllListeners();\n};\n\nplots.style = function(gd) {\n var _modules = gd._fullLayout._visibleModules;\n var styleModules = [];\n var i;\n\n // some trace modules reuse the same style method,\n // make sure to not unnecessary call them multiple times.\n\n for(i = 0; i < _modules.length; i++) {\n var _module = _modules[i];\n if(_module.style) {\n Lib.pushUnique(styleModules, _module.style);\n }\n }\n\n for(i = 0; i < styleModules.length; i++) {\n styleModules[i](gd);\n }\n};\n\nplots.sanitizeMargins = function(fullLayout) {\n // polar doesn't do margins...\n if(!fullLayout || !fullLayout.margin) return;\n\n var width = fullLayout.width;\n var height = fullLayout.height;\n var margin = fullLayout.margin;\n var plotWidth = width - (margin.l + margin.r);\n var plotHeight = height - (margin.t + margin.b);\n var correction;\n\n // if margin.l + margin.r = 0 then plotWidth > 0\n // as width >= 10 by supplyDefaults\n // similarly for margin.t + margin.b\n\n if(plotWidth < 0) {\n correction = (width - 1) / (margin.l + margin.r);\n margin.l = Math.floor(correction * margin.l);\n margin.r = Math.floor(correction * margin.r);\n }\n\n if(plotHeight < 0) {\n correction = (height - 1) / (margin.t + margin.b);\n margin.t = Math.floor(correction * margin.t);\n margin.b = Math.floor(correction * margin.b);\n }\n};\n\nplots.clearAutoMarginIds = function(gd) {\n gd._fullLayout._pushmarginIds = {};\n};\n\nplots.allowAutoMargin = function(gd, id) {\n gd._fullLayout._pushmarginIds[id] = 1;\n};\n\nfunction initMargins(fullLayout) {\n var margin = fullLayout.margin;\n\n if(!fullLayout._size) {\n var gs = fullLayout._size = {\n l: Math.round(margin.l),\n r: Math.round(margin.r),\n t: Math.round(margin.t),\n b: Math.round(margin.b),\n p: Math.round(margin.pad)\n };\n gs.w = Math.round(fullLayout.width) - gs.l - gs.r;\n gs.h = Math.round(fullLayout.height) - gs.t - gs.b;\n }\n if(!fullLayout._pushmargin) fullLayout._pushmargin = {};\n if(!fullLayout._pushmarginIds) fullLayout._pushmarginIds = {};\n}\n\n/**\n * autoMargin: called by components that may need to expand the margins to\n * be rendered on-plot.\n *\n * @param {DOM element} gd\n * @param {string} id - an identifier unique (within this plot) to this object,\n * so we can remove a previous margin expansion from the same object.\n * @param {object} o - the margin requirements of this object, or omit to delete\n * this entry (like if it's hidden). Keys are:\n * x, y: plot fraction of the anchor point.\n * xl, xr, yt, yb: if the object has an extent defined in plot fraction,\n * you can specify both edges as plot fractions in each dimension\n * l, r, t, b: the pixels to pad past the plot fraction x[l|r] and y[t|b]\n * pad: extra pixels to add in all directions, default 12 (why?)\n */\nplots.autoMargin = function(gd, id, o) {\n var fullLayout = gd._fullLayout;\n\n var pushMargin = fullLayout._pushmargin;\n var pushMarginIds = fullLayout._pushmarginIds;\n\n if(fullLayout.margin.autoexpand !== false) {\n if(!o) {\n delete pushMargin[id];\n delete pushMarginIds[id];\n } else {\n var pad = o.pad;\n if(pad === undefined) {\n var margin = fullLayout.margin;\n // if no explicit pad is given, use 12px unless there's a\n // specified margin that's smaller than that\n pad = Math.min(12, margin.l, margin.r, margin.t, margin.b);\n }\n\n // if the item is too big, just give it enough automargin to\n // make sure you can still grab it and bring it back\n if(o.l + o.r > fullLayout.width * 0.5) {\n Lib.log('Margin push', id, 'is too big in x, dropping');\n o.l = o.r = 0;\n }\n if(o.b + o.t > fullLayout.height * 0.5) {\n Lib.log('Margin push', id, 'is too big in y, dropping');\n o.b = o.t = 0;\n }\n\n var xl = o.xl !== undefined ? o.xl : o.x;\n var xr = o.xr !== undefined ? o.xr : o.x;\n var yt = o.yt !== undefined ? o.yt : o.y;\n var yb = o.yb !== undefined ? o.yb : o.y;\n\n pushMargin[id] = {\n l: {val: xl, size: o.l + pad},\n r: {val: xr, size: o.r + pad},\n b: {val: yb, size: o.b + pad},\n t: {val: yt, size: o.t + pad}\n };\n pushMarginIds[id] = 1;\n }\n\n if(!fullLayout._replotting) {\n return plots.doAutoMargin(gd);\n }\n }\n};\n\nplots.doAutoMargin = function(gd) {\n var fullLayout = gd._fullLayout;\n if(!fullLayout._size) fullLayout._size = {};\n initMargins(fullLayout);\n\n var gs = fullLayout._size;\n var margin = fullLayout.margin;\n var oldMargins = Lib.extendFlat({}, gs);\n\n // adjust margins for outside components\n // fullLayout.margin is the requested margin,\n // fullLayout._size has margins and plotsize after adjustment\n var ml = margin.l;\n var mr = margin.r;\n var mt = margin.t;\n var mb = margin.b;\n var width = fullLayout.width;\n var height = fullLayout.height;\n var pushMargin = fullLayout._pushmargin;\n var pushMarginIds = fullLayout._pushmarginIds;\n\n if(fullLayout.margin.autoexpand !== false) {\n for(var k in pushMargin) {\n if(!pushMarginIds[k]) delete pushMargin[k];\n }\n\n // fill in the requested margins\n pushMargin.base = {\n l: {val: 0, size: ml},\n r: {val: 1, size: mr},\n t: {val: 1, size: mt},\n b: {val: 0, size: mb}\n };\n\n // now cycle through all the combinations of l and r\n // (and t and b) to find the required margins\n\n for(var k1 in pushMargin) {\n var pushleft = pushMargin[k1].l || {};\n var pushbottom = pushMargin[k1].b || {};\n var fl = pushleft.val;\n var pl = pushleft.size;\n var fb = pushbottom.val;\n var pb = pushbottom.size;\n\n for(var k2 in pushMargin) {\n if(isNumeric(pl) && pushMargin[k2].r) {\n var fr = pushMargin[k2].r.val;\n var pr = pushMargin[k2].r.size;\n\n if(fr > fl) {\n var newL = (pl * fr + (pr - width) * fl) / (fr - fl);\n var newR = (pr * (1 - fl) + (pl - width) * (1 - fr)) / (fr - fl);\n if(newL >= 0 && newR >= 0 && width - (newL + newR) > 0 && newL + newR > ml + mr) {\n ml = newL;\n mr = newR;\n }\n }\n }\n\n if(isNumeric(pb) && pushMargin[k2].t) {\n var ft = pushMargin[k2].t.val;\n var pt = pushMargin[k2].t.size;\n\n if(ft > fb) {\n var newB = (pb * ft + (pt - height) * fb) / (ft - fb);\n var newT = (pt * (1 - fb) + (pb - height) * (1 - ft)) / (ft - fb);\n if(newB >= 0 && newT >= 0 && height - (newT + newB) > 0 && newB + newT > mb + mt) {\n mb = newB;\n mt = newT;\n }\n }\n }\n }\n }\n }\n\n gs.l = Math.round(ml);\n gs.r = Math.round(mr);\n gs.t = Math.round(mt);\n gs.b = Math.round(mb);\n gs.p = Math.round(margin.pad);\n gs.w = Math.round(width) - gs.l - gs.r;\n gs.h = Math.round(height) - gs.t - gs.b;\n\n // if things changed and we're not already redrawing, trigger a redraw\n if(!fullLayout._replotting && plots.didMarginChange(oldMargins, gs)) {\n if('_redrawFromAutoMarginCount' in fullLayout) {\n fullLayout._redrawFromAutoMarginCount++;\n } else {\n fullLayout._redrawFromAutoMarginCount = 1;\n }\n\n // Always allow at least one redraw and give each margin-push\n // call 3 loops to converge. Of course, for most cases this way too many,\n // but let's keep things on the safe side until we fix our\n // auto-margin pipeline problems:\n // https://github.com/plotly/plotly.js/issues/2704\n var maxNumberOfRedraws = 3 * (1 + Object.keys(pushMarginIds).length);\n\n if(fullLayout._redrawFromAutoMarginCount < maxNumberOfRedraws) {\n return Registry.call('plot', gd);\n } else {\n Lib.warn('Too many auto-margin redraws.');\n }\n }\n};\n\nvar marginKeys = ['l', 'r', 't', 'b', 'p', 'w', 'h'];\n\nplots.didMarginChange = function(margin0, margin1) {\n for(var i = 0; i < marginKeys.length; i++) {\n var k = marginKeys[i];\n var m0 = margin0[k];\n var m1 = margin1[k];\n // use 1px tolerance in case we old/new differ only\n // by rounding errors, which can lead to infinite loops\n if(!isNumeric(m0) || Math.abs(m1 - m0) > 1) {\n return true;\n }\n }\n return false;\n};\n\n/**\n * JSONify the graph data and layout\n *\n * This function needs to recurse because some src can be inside\n * sub-objects.\n *\n * It also strips out functions and private (starts with _) elements.\n * Therefore, we can add temporary things to data and layout that don't\n * get saved.\n *\n * @param gd The graphDiv\n * @param {Boolean} dataonly If true, don't return layout.\n * @param {'keepref'|'keepdata'|'keepall'} [mode='keepref'] Filter what's kept\n * keepref: remove data for which there's a src present\n * eg if there's xsrc present (and xsrc is well-formed,\n * ie has : and some chars before it), strip out x\n * keepdata: remove all src tags, don't remove the data itself\n * keepall: keep data and src\n * @param {String} output If you specify 'object', the result will not be stringified\n * @param {Boolean} useDefaults If truthy, use _fullLayout and _fullData\n * @param {Boolean} includeConfig If truthy, include _context\n * @returns {Object|String}\n */\nplots.graphJson = function(gd, dataonly, mode, output, useDefaults, includeConfig) {\n // if the defaults aren't supplied yet, we need to do that...\n if((useDefaults && dataonly && !gd._fullData) ||\n (useDefaults && !dataonly && !gd._fullLayout)) {\n plots.supplyDefaults(gd);\n }\n\n var data = (useDefaults) ? gd._fullData : gd.data;\n var layout = (useDefaults) ? gd._fullLayout : gd.layout;\n var frames = (gd._transitionData || {})._frames;\n\n function stripObj(d, keepFunction) {\n if(typeof d === 'function') {\n return keepFunction ? '_function_' : null;\n }\n if(Lib.isPlainObject(d)) {\n var o = {};\n var src;\n Object.keys(d).sort().forEach(function(v) {\n // remove private elements and functions\n // _ is for private, [ is a mistake ie [object Object]\n if(['_', '['].indexOf(v.charAt(0)) !== -1) return;\n\n // if a function, add if necessary then move on\n if(typeof d[v] === 'function') {\n if(keepFunction) o[v] = '_function';\n return;\n }\n\n // look for src/data matches and remove the appropriate one\n if(mode === 'keepdata') {\n // keepdata: remove all ...src tags\n if(v.substr(v.length - 3) === 'src') {\n return;\n }\n } else if(mode === 'keepstream') {\n // keep sourced data if it's being streamed.\n // similar to keepref, but if the 'stream' object exists\n // in a trace, we will keep the data array.\n src = d[v + 'src'];\n if(typeof src === 'string' && src.indexOf(':') > 0) {\n if(!Lib.isPlainObject(d.stream)) {\n return;\n }\n }\n } else if(mode !== 'keepall') {\n // keepref: remove sourced data but only\n // if the source tag is well-formed\n src = d[v + 'src'];\n if(typeof src === 'string' && src.indexOf(':') > 0) {\n return;\n }\n }\n\n // OK, we're including this... recurse into it\n o[v] = stripObj(d[v], keepFunction);\n });\n return o;\n }\n\n if(Array.isArray(d)) {\n return d.map(function(x) {return stripObj(x, keepFunction);});\n }\n\n if(Lib.isTypedArray(d)) {\n return Lib.simpleMap(d, Lib.identity);\n }\n\n // convert native dates to date strings...\n // mostly for external users exporting to plotly\n if(Lib.isJSDate(d)) return Lib.ms2DateTimeLocal(+d);\n\n return d;\n }\n\n var obj = {\n data: (data || []).map(function(v) {\n var d = stripObj(v);\n // fit has some little arrays in it that don't contain data,\n // just fit params and meta\n if(dataonly) { delete d.fit; }\n return d;\n })\n };\n if(!dataonly) { obj.layout = stripObj(layout); }\n\n if(gd.framework && gd.framework.isPolar) obj = gd.framework.getConfig();\n\n if(frames) obj.frames = stripObj(frames);\n\n if(includeConfig) obj.config = stripObj(gd._context, true);\n\n return (output === 'object') ? obj : JSON.stringify(obj);\n};\n\n/**\n * Modify a keyframe using a list of operations:\n *\n * @param {array of objects} operations\n * Sequence of operations to be performed on the keyframes\n */\nplots.modifyFrames = function(gd, operations) {\n var i, op, frame;\n var _frames = gd._transitionData._frames;\n var _frameHash = gd._transitionData._frameHash;\n\n for(i = 0; i < operations.length; i++) {\n op = operations[i];\n\n switch(op.type) {\n // No reason this couldn't exist, but is currently unused/untested:\n /* case 'rename':\n frame = _frames[op.index];\n delete _frameHash[frame.name];\n _frameHash[op.name] = frame;\n frame.name = op.name;\n break;*/\n case 'replace':\n frame = op.value;\n var oldName = (_frames[op.index] || {}).name;\n var newName = frame.name;\n _frames[op.index] = _frameHash[newName] = frame;\n\n if(newName !== oldName) {\n // If name has changed in addition to replacement, then update\n // the lookup table:\n delete _frameHash[oldName];\n _frameHash[newName] = frame;\n }\n\n break;\n case 'insert':\n frame = op.value;\n _frameHash[frame.name] = frame;\n _frames.splice(op.index, 0, frame);\n break;\n case 'delete':\n frame = _frames[op.index];\n delete _frameHash[frame.name];\n _frames.splice(op.index, 1);\n break;\n }\n }\n\n return Promise.resolve();\n};\n\n/*\n * Compute a keyframe. Merge a keyframe into its base frame(s) and\n * expand properties.\n *\n * @param {object} frameLookup\n * An object containing frames keyed by name (i.e. gd._transitionData._frameHash)\n * @param {string} frame\n * The name of the keyframe to be computed\n *\n * Returns: a new object with the merged content\n */\nplots.computeFrame = function(gd, frameName) {\n var frameLookup = gd._transitionData._frameHash;\n var i, traceIndices, traceIndex, destIndex;\n\n // Null or undefined will fail on .toString(). We'll allow numbers since we\n // make it clear frames must be given string names, but we'll allow numbers\n // here since they're otherwise fine for looking up frames as long as they're\n // properly cast to strings. We really just want to ensure here that this\n // 1) doesn't fail, and\n // 2) doens't give an incorrect answer (which String(frameName) would)\n if(!frameName) {\n throw new Error('computeFrame must be given a string frame name');\n }\n\n var framePtr = frameLookup[frameName.toString()];\n\n // Return false if the name is invalid:\n if(!framePtr) {\n return false;\n }\n\n var frameStack = [framePtr];\n var frameNameStack = [framePtr.name];\n\n // Follow frame pointers:\n while(framePtr.baseframe && (framePtr = frameLookup[framePtr.baseframe.toString()])) {\n // Avoid infinite loops:\n if(frameNameStack.indexOf(framePtr.name) !== -1) break;\n\n frameStack.push(framePtr);\n frameNameStack.push(framePtr.name);\n }\n\n // A new object for the merged result:\n var result = {};\n\n // Merge, starting with the last and ending with the desired frame:\n while((framePtr = frameStack.pop())) {\n if(framePtr.layout) {\n result.layout = plots.extendLayout(result.layout, framePtr.layout);\n }\n\n if(framePtr.data) {\n if(!result.data) {\n result.data = [];\n }\n traceIndices = framePtr.traces;\n\n if(!traceIndices) {\n // If not defined, assume serial order starting at zero\n traceIndices = [];\n for(i = 0; i < framePtr.data.length; i++) {\n traceIndices[i] = i;\n }\n }\n\n if(!result.traces) {\n result.traces = [];\n }\n\n for(i = 0; i < framePtr.data.length; i++) {\n // Loop through this frames data, find out where it should go,\n // and merge it!\n traceIndex = traceIndices[i];\n if(traceIndex === undefined || traceIndex === null) {\n continue;\n }\n\n destIndex = result.traces.indexOf(traceIndex);\n if(destIndex === -1) {\n destIndex = result.data.length;\n result.traces[destIndex] = traceIndex;\n }\n\n result.data[destIndex] = plots.extendTrace(result.data[destIndex], framePtr.data[i]);\n }\n }\n }\n\n return result;\n};\n\n/*\n * Recompute the lookup table that maps frame name -> frame object. addFrames/\n * deleteFrames already manages this data one at a time, so the only time this\n * is necessary is if you poke around manually in `gd._transitionData._frames`\n * and create and haven't updated the lookup table.\n */\nplots.recomputeFrameHash = function(gd) {\n var hash = gd._transitionData._frameHash = {};\n var frames = gd._transitionData._frames;\n for(var i = 0; i < frames.length; i++) {\n var frame = frames[i];\n if(frame && frame.name) {\n hash[frame.name] = frame;\n }\n }\n};\n\n/**\n * Extend an object, treating container arrays very differently by extracting\n * their contents and merging them separately.\n *\n * This exists so that we can extendDeepNoArrays and avoid stepping into data\n * arrays without knowledge of the plot schema, but so that we may also manually\n * recurse into known container arrays, such as transforms.\n *\n * See extendTrace and extendLayout below for usage.\n */\nplots.extendObjectWithContainers = function(dest, src, containerPaths) {\n var containerProp, containerVal, i, j, srcProp, destProp, srcContainer, destContainer;\n var copy = Lib.extendDeepNoArrays({}, src || {});\n var expandedObj = Lib.expandObjectPaths(copy);\n var containerObj = {};\n\n // Step through and extract any container properties. Otherwise extendDeepNoArrays\n // will clobber any existing properties with an empty array and then supplyDefaults\n // will reset everything to defaults.\n if(containerPaths && containerPaths.length) {\n for(i = 0; i < containerPaths.length; i++) {\n containerProp = Lib.nestedProperty(expandedObj, containerPaths[i]);\n containerVal = containerProp.get();\n\n if(containerVal === undefined) {\n Lib.nestedProperty(containerObj, containerPaths[i]).set(null);\n } else {\n containerProp.set(null);\n Lib.nestedProperty(containerObj, containerPaths[i]).set(containerVal);\n }\n }\n }\n\n dest = Lib.extendDeepNoArrays(dest || {}, expandedObj);\n\n if(containerPaths && containerPaths.length) {\n for(i = 0; i < containerPaths.length; i++) {\n srcProp = Lib.nestedProperty(containerObj, containerPaths[i]);\n srcContainer = srcProp.get();\n\n if(!srcContainer) continue;\n\n destProp = Lib.nestedProperty(dest, containerPaths[i]);\n destContainer = destProp.get();\n\n if(!Array.isArray(destContainer)) {\n destContainer = [];\n destProp.set(destContainer);\n }\n\n for(j = 0; j < srcContainer.length; j++) {\n var srcObj = srcContainer[j];\n\n if(srcObj === null) destContainer[j] = null;\n else {\n destContainer[j] = plots.extendObjectWithContainers(destContainer[j], srcObj);\n }\n }\n\n destProp.set(destContainer);\n }\n }\n\n return dest;\n};\n\nplots.dataArrayContainers = ['transforms', 'dimensions'];\nplots.layoutArrayContainers = Registry.layoutArrayContainers;\n\n/*\n * Extend a trace definition. This method:\n *\n * 1. directly transfers any array references\n * 2. manually recurses into container arrays like transforms\n *\n * The result is the original object reference with the new contents merged in.\n */\nplots.extendTrace = function(destTrace, srcTrace) {\n return plots.extendObjectWithContainers(destTrace, srcTrace, plots.dataArrayContainers);\n};\n\n/*\n * Extend a layout definition. This method:\n *\n * 1. directly transfers any array references (not critically important for\n * layout since there aren't really data arrays)\n * 2. manually recurses into container arrays like annotations\n *\n * The result is the original object reference with the new contents merged in.\n */\nplots.extendLayout = function(destLayout, srcLayout) {\n return plots.extendObjectWithContainers(destLayout, srcLayout, plots.layoutArrayContainers);\n};\n\n/**\n * Transition to a set of new data and layout properties from Plotly.animate\n *\n * @param {DOM element} gd\n * @param {Object[]} data\n * an array of data objects following the normal Plotly data definition format\n * @param {Object} layout\n * a layout object, following normal Plotly layout format\n * @param {Number[]} traces\n * indices of the corresponding traces specified in `data`\n * @param {Object} frameOpts\n * options for the frame (i.e. whether to redraw post-transition)\n * @param {Object} transitionOpts\n * options for the transition\n */\nplots.transition = function(gd, data, layout, traces, frameOpts, transitionOpts) {\n var opts = {redraw: frameOpts.redraw};\n var transitionedTraces = {};\n var axEdits = [];\n\n opts.prepareFn = function() {\n var dataLength = Array.isArray(data) ? data.length : 0;\n var traceIndices = traces.slice(0, dataLength);\n\n for(var i = 0; i < traceIndices.length; i++) {\n var traceIdx = traceIndices[i];\n var trace = gd._fullData[traceIdx];\n var _module = trace._module;\n\n // There's nothing to do if this module is not defined:\n if(!_module) continue;\n\n // Don't register the trace as transitioned if it doesn't know what to do.\n // If it *is* registered, it will receive a callback that it's responsible\n // for calling in order to register the transition as having completed.\n if(_module.animatable) {\n var n = _module.basePlotModule.name;\n if(!transitionedTraces[n]) transitionedTraces[n] = [];\n transitionedTraces[n].push(traceIdx);\n }\n\n gd.data[traceIndices[i]] = plots.extendTrace(gd.data[traceIndices[i]], data[i]);\n }\n\n // Follow the same procedure. Clone it so we don't mangle the input, then\n // expand any object paths so we can merge deep into gd.layout:\n var layoutUpdate = Lib.expandObjectPaths(Lib.extendDeepNoArrays({}, layout));\n\n // Before merging though, we need to modify the incoming layout. We only\n // know how to *transition* layout ranges, so it's imperative that a new\n // range not be sent to the layout before the transition has started. So\n // we must remove the things we can transition:\n var axisAttrRe = /^[xy]axis[0-9]*$/;\n for(var attr in layoutUpdate) {\n if(!axisAttrRe.test(attr)) continue;\n delete layoutUpdate[attr].range;\n }\n\n plots.extendLayout(gd.layout, layoutUpdate);\n\n // Supply defaults after applying the incoming properties. Note that any attempt\n // to simplify this step and reduce the amount of work resulted in the reconstruction\n // of essentially the whole supplyDefaults step, so that it seems sensible to just use\n // supplyDefaults even though it's heavier than would otherwise be desired for\n // transitions:\n\n // first delete calcdata so supplyDefaults knows a calc step is coming\n delete gd.calcdata;\n\n plots.supplyDefaults(gd);\n plots.doCalcdata(gd);\n\n var newLayout = Lib.expandObjectPaths(layout);\n\n if(newLayout) {\n var subplots = gd._fullLayout._plots;\n\n for(var k in subplots) {\n var plotinfo = subplots[k];\n var xa = plotinfo.xaxis;\n var ya = plotinfo.yaxis;\n var xr0 = xa.range.slice();\n var yr0 = ya.range.slice();\n\n var xr1 = null;\n var yr1 = null;\n var editX = null;\n var editY = null;\n\n if(Array.isArray(newLayout[xa._name + '.range'])) {\n xr1 = newLayout[xa._name + '.range'].slice();\n } else if(Array.isArray((newLayout[xa._name] || {}).range)) {\n xr1 = newLayout[xa._name].range.slice();\n }\n if(Array.isArray(newLayout[ya._name + '.range'])) {\n yr1 = newLayout[ya._name + '.range'].slice();\n } else if(Array.isArray((newLayout[ya._name] || {}).range)) {\n yr1 = newLayout[ya._name].range.slice();\n }\n\n if(xr0 && xr1 &&\n (xa.r2l(xr0[0]) !== xa.r2l(xr1[0]) || xa.r2l(xr0[1]) !== xa.r2l(xr1[1]))\n ) {\n editX = {xr0: xr0, xr1: xr1};\n }\n if(yr0 && yr1 &&\n (ya.r2l(yr0[0]) !== ya.r2l(yr1[0]) || ya.r2l(yr0[1]) !== ya.r2l(yr1[1]))\n ) {\n editY = {yr0: yr0, yr1: yr1};\n }\n\n if(editX || editY) {\n axEdits.push(Lib.extendFlat({plotinfo: plotinfo}, editX, editY));\n }\n }\n }\n\n return Promise.resolve();\n };\n\n opts.runFn = function(makeCallback) {\n var traceTransitionOpts;\n var basePlotModules = gd._fullLayout._basePlotModules;\n var hasAxisTransition = axEdits.length;\n var i;\n\n if(layout) {\n for(i = 0; i < basePlotModules.length; i++) {\n if(basePlotModules[i].transitionAxes) {\n basePlotModules[i].transitionAxes(gd, axEdits, transitionOpts, makeCallback);\n }\n }\n }\n\n // Here handle the exception that we refuse to animate scales and axes at the same\n // time. In other words, if there's an axis transition, then set the data transition\n // to instantaneous.\n if(hasAxisTransition) {\n traceTransitionOpts = Lib.extendFlat({}, transitionOpts);\n traceTransitionOpts.duration = 0;\n // This means do not transition cartesian traces,\n // this happens on layout-only (e.g. axis range) animations\n delete transitionedTraces.cartesian;\n } else {\n traceTransitionOpts = transitionOpts;\n }\n\n // Note that we pass a callback to *create* the callback that must be invoked on completion.\n // This is since not all traces know about transitions, so it greatly simplifies matters if\n // the trace is responsible for creating a callback, if needed, and then executing it when\n // the time is right.\n for(var n in transitionedTraces) {\n var traceIndices = transitionedTraces[n];\n var _module = gd._fullData[traceIndices[0]]._module;\n _module.basePlotModule.plot(gd, traceIndices, traceTransitionOpts, makeCallback);\n }\n };\n\n return _transition(gd, transitionOpts, opts);\n};\n\n/**\n * Transition to a set of new data and layout properties from Plotly.react\n *\n * @param {DOM element} gd\n * @param {object} restyleFlags\n * - anim {'all'|'some'}\n * @param {object} relayoutFlags\n * - anim {'all'|'some'}\n * @param {object} oldFullLayout : old (pre Plotly.react) fullLayout\n */\nplots.transitionFromReact = function(gd, restyleFlags, relayoutFlags, oldFullLayout) {\n var fullLayout = gd._fullLayout;\n var transitionOpts = fullLayout.transition;\n var opts = {};\n var axEdits = [];\n\n opts.prepareFn = function() {\n var subplots = fullLayout._plots;\n\n // no need to redraw at end of transition,\n // if all changes are animatable\n opts.redraw = false;\n if(restyleFlags.anim === 'some') opts.redraw = true;\n if(relayoutFlags.anim === 'some') opts.redraw = true;\n\n for(var k in subplots) {\n var plotinfo = subplots[k];\n var xa = plotinfo.xaxis;\n var ya = plotinfo.yaxis;\n var xr0 = oldFullLayout[xa._name].range.slice();\n var yr0 = oldFullLayout[ya._name].range.slice();\n var xr1 = xa.range.slice();\n var yr1 = ya.range.slice();\n\n xa.setScale();\n ya.setScale();\n\n var editX = null;\n var editY = null;\n\n if(xa.r2l(xr0[0]) !== xa.r2l(xr1[0]) || xa.r2l(xr0[1]) !== xa.r2l(xr1[1])) {\n editX = {xr0: xr0, xr1: xr1};\n }\n if(ya.r2l(yr0[0]) !== ya.r2l(yr1[0]) || ya.r2l(yr0[1]) !== ya.r2l(yr1[1])) {\n editY = {yr0: yr0, yr1: yr1};\n }\n\n if(editX || editY) {\n axEdits.push(Lib.extendFlat({plotinfo: plotinfo}, editX, editY));\n }\n }\n\n return Promise.resolve();\n };\n\n opts.runFn = function(makeCallback) {\n var fullData = gd._fullData;\n var fullLayout = gd._fullLayout;\n var basePlotModules = fullLayout._basePlotModules;\n\n var axisTransitionOpts;\n var traceTransitionOpts;\n var transitionedTraces;\n\n var allTraceIndices = [];\n for(var i = 0; i < fullData.length; i++) {\n allTraceIndices.push(i);\n }\n\n function transitionAxes() {\n for(var j = 0; j < basePlotModules.length; j++) {\n if(basePlotModules[j].transitionAxes) {\n basePlotModules[j].transitionAxes(gd, axEdits, axisTransitionOpts, makeCallback);\n }\n }\n }\n\n function transitionTraces() {\n for(var j = 0; j < basePlotModules.length; j++) {\n basePlotModules[j].plot(gd, transitionedTraces, traceTransitionOpts, makeCallback);\n }\n }\n\n if(axEdits.length && restyleFlags.anim) {\n if(transitionOpts.ordering === 'traces first') {\n axisTransitionOpts = Lib.extendFlat({}, transitionOpts, {duration: 0});\n transitionedTraces = allTraceIndices;\n traceTransitionOpts = transitionOpts;\n setTimeout(transitionAxes, transitionOpts.duration);\n transitionTraces();\n } else {\n axisTransitionOpts = transitionOpts;\n transitionedTraces = null;\n traceTransitionOpts = Lib.extendFlat({}, transitionOpts, {duration: 0});\n setTimeout(transitionTraces, axisTransitionOpts.duration);\n transitionAxes();\n }\n } else if(axEdits.length) {\n axisTransitionOpts = transitionOpts;\n transitionAxes();\n } else if(restyleFlags.anim) {\n transitionedTraces = allTraceIndices;\n traceTransitionOpts = transitionOpts;\n transitionTraces();\n }\n };\n\n return _transition(gd, transitionOpts, opts);\n};\n\n/**\n * trace/layout transition wrapper that works\n * for transitions initiated by Plotly.animate and Plotly.react.\n *\n * @param {DOM element} gd\n * @param {object} transitionOpts\n * @param {object} opts\n * - redraw {boolean}\n * - prepareFn {function} *should return a Promise*\n * - runFn {function} ran inside executeTransitions\n */\nfunction _transition(gd, transitionOpts, opts) {\n var aborted = false;\n\n function executeCallbacks(list) {\n var p = Promise.resolve();\n if(!list) return p;\n while(list.length) {\n p = p.then((list.shift()));\n }\n return p;\n }\n\n function flushCallbacks(list) {\n if(!list) return;\n while(list.length) {\n list.shift();\n }\n }\n\n function executeTransitions() {\n gd.emit('plotly_transitioning', []);\n\n return new Promise(function(resolve) {\n // This flag is used to disabled things like autorange:\n gd._transitioning = true;\n\n // When instantaneous updates are coming through quickly, it's too much to simply disable\n // all interaction, so store this flag so we can disambiguate whether mouse interactions\n // should be fully disabled or not:\n if(transitionOpts.duration > 0) {\n gd._transitioningWithDuration = true;\n }\n\n // If another transition is triggered, this callback will be executed simply because it's\n // in the interruptCallbacks queue. If this transition completes, it will instead flush\n // that queue and forget about this callback.\n gd._transitionData._interruptCallbacks.push(function() {\n aborted = true;\n });\n\n if(opts.redraw) {\n gd._transitionData._interruptCallbacks.push(function() {\n return Registry.call('redraw', gd);\n });\n }\n\n // Emit this and make sure it happens last:\n gd._transitionData._interruptCallbacks.push(function() {\n gd.emit('plotly_transitioninterrupted', []);\n });\n\n // Construct callbacks that are executed on transition end. This ensures the d3 transitions\n // are *complete* before anything else is done.\n var numCallbacks = 0;\n var numCompleted = 0;\n function makeCallback() {\n numCallbacks++;\n return function() {\n numCompleted++;\n // When all are complete, perform a redraw:\n if(!aborted && numCompleted === numCallbacks) {\n completeTransition(resolve);\n }\n };\n }\n\n opts.runFn(makeCallback);\n\n // If nothing else creates a callback, then this will trigger the completion in the next tick:\n setTimeout(makeCallback());\n });\n }\n\n function completeTransition(callback) {\n // This a simple workaround for tests which purge the graph before animations\n // have completed. That's not a very common case, so this is the simplest\n // fix.\n if(!gd._transitionData) return;\n\n flushCallbacks(gd._transitionData._interruptCallbacks);\n\n return Promise.resolve().then(function() {\n if(opts.redraw) {\n return Registry.call('redraw', gd);\n }\n }).then(function() {\n // Set transitioning false again once the redraw has occurred. This is used, for example,\n // to prevent the trailing redraw from autoranging:\n gd._transitioning = false;\n gd._transitioningWithDuration = false;\n\n gd.emit('plotly_transitioned', []);\n }).then(callback);\n }\n\n function interruptPreviousTransitions() {\n // Fail-safe against purged plot:\n if(!gd._transitionData) return;\n\n // If a transition is interrupted, set this to false. At the moment, the only thing that would\n // interrupt a transition is another transition, so that it will momentarily be set to true\n // again, but this determines whether autorange or dragbox work, so it's for the sake of\n // cleanliness:\n gd._transitioning = false;\n\n return executeCallbacks(gd._transitionData._interruptCallbacks);\n }\n\n var seq = [\n plots.previousPromises,\n interruptPreviousTransitions,\n opts.prepareFn,\n plots.rehover,\n executeTransitions\n ];\n\n var transitionStarting = Lib.syncOrAsync(seq, gd);\n\n if(!transitionStarting || !transitionStarting.then) {\n transitionStarting = Promise.resolve();\n }\n\n return transitionStarting.then(function() { return gd; });\n}\n\nplots.doCalcdata = function(gd, traces) {\n var axList = axisIDs.list(gd);\n var fullData = gd._fullData;\n var fullLayout = gd._fullLayout;\n\n var trace, _module, i, j;\n\n // XXX: Is this correct? Needs a closer look so that *some* traces can be recomputed without\n // *all* needing doCalcdata:\n var calcdata = new Array(fullData.length);\n var oldCalcdata = (gd.calcdata || []).slice();\n gd.calcdata = calcdata;\n\n // extra helper variables\n\n // how many box/violins plots do we have (in case they're grouped)\n fullLayout._numBoxes = 0;\n fullLayout._numViolins = 0;\n\n // initialize violin per-scale-group stats container\n fullLayout._violinScaleGroupStats = {};\n\n // for calculating avg luminosity of heatmaps\n gd._hmpixcount = 0;\n gd._hmlumcount = 0;\n\n // for sharing colors across pies / sunbursts / treemap / funnelarea (and for legend)\n fullLayout._piecolormap = {};\n fullLayout._sunburstcolormap = {};\n fullLayout._treemapcolormap = {};\n fullLayout._funnelareacolormap = {};\n\n // If traces were specified and this trace was not included,\n // then transfer it over from the old calcdata:\n for(i = 0; i < fullData.length; i++) {\n if(Array.isArray(traces) && traces.indexOf(i) === -1) {\n calcdata[i] = oldCalcdata[i];\n continue;\n }\n }\n\n for(i = 0; i < fullData.length; i++) {\n trace = fullData[i];\n\n trace._arrayAttrs = PlotSchema.findArrayAttributes(trace);\n\n // keep track of trace extremes (for autorange) in here\n trace._extremes = {};\n }\n\n // add polar axes to axis list\n var polarIds = fullLayout._subplots.polar || [];\n for(i = 0; i < polarIds.length; i++) {\n axList.push(\n fullLayout[polarIds[i]].radialaxis,\n fullLayout[polarIds[i]].angularaxis\n );\n }\n\n // clear relinked cmin/cmax values in shared axes to start aggregation from scratch\n for(var k in fullLayout._colorAxes) {\n var cOpts = fullLayout[k];\n if(cOpts.cauto !== false) {\n delete cOpts.cmin;\n delete cOpts.cmax;\n }\n }\n\n var hasCalcTransform = false;\n\n function transformCalci(i) {\n trace = fullData[i];\n _module = trace._module;\n\n if(trace.visible === true && trace.transforms) {\n // we need one round of trace module calc before\n // the calc transform to 'fill in' the categories list\n // used for example in the data-to-coordinate method\n if(_module && _module.calc) {\n var cdi = _module.calc(gd, trace);\n\n // must clear scene 'batches', so that 2nd\n // _module.calc call starts from scratch\n if(cdi[0] && cdi[0].t && cdi[0].t._scene) {\n delete cdi[0].t._scene.dirty;\n }\n }\n\n for(j = 0; j < trace.transforms.length; j++) {\n var transform = trace.transforms[j];\n\n _module = transformsRegistry[transform.type];\n if(_module && _module.calcTransform) {\n trace._hasCalcTransform = true;\n hasCalcTransform = true;\n _module.calcTransform(gd, trace, transform);\n }\n }\n }\n }\n\n function calci(i, isContainer) {\n trace = fullData[i];\n _module = trace._module;\n\n if(!!_module.isContainer !== isContainer) return;\n\n var cd = [];\n\n if(trace.visible === true && trace._length !== 0) {\n // clear existing ref in case it got relinked\n delete trace._indexToPoints;\n // keep ref of index-to-points map object of the *last* enabled transform,\n // this index-to-points map object is required to determine the calcdata indices\n // that correspond to input indices (e.g. from 'selectedpoints')\n var transforms = trace.transforms || [];\n for(j = transforms.length - 1; j >= 0; j--) {\n if(transforms[j].enabled) {\n trace._indexToPoints = transforms[j]._indexToPoints;\n break;\n }\n }\n\n if(_module && _module.calc) {\n cd = _module.calc(gd, trace);\n }\n }\n\n // Make sure there is a first point.\n //\n // This ensures there is a calcdata item for every trace,\n // even if cartesian logic doesn't handle it (for things like legends).\n if(!Array.isArray(cd) || !cd[0]) {\n cd = [{x: BADNUM, y: BADNUM}];\n }\n\n // add the trace-wide properties to the first point,\n // per point properties to every point\n // t is the holder for trace-wide properties\n if(!cd[0].t) cd[0].t = {};\n cd[0].trace = trace;\n\n calcdata[i] = cd;\n }\n\n setupAxisCategories(axList, fullData, fullLayout);\n\n // 'transform' loop - must calc container traces first\n // so that if their dependent traces can get transform properly\n for(i = 0; i < fullData.length; i++) calci(i, true);\n for(i = 0; i < fullData.length; i++) transformCalci(i);\n\n // clear stuff that should recomputed in 'regular' loop\n if(hasCalcTransform) setupAxisCategories(axList, fullData, fullLayout);\n\n // 'regular' loop - make sure container traces (eg carpet) calc before\n // contained traces (eg contourcarpet)\n for(i = 0; i < fullData.length; i++) calci(i, true);\n for(i = 0; i < fullData.length; i++) calci(i, false);\n\n doCrossTraceCalc(gd);\n\n // Sort axis categories per value if specified\n var sorted = sortAxisCategoriesByValue(axList, gd);\n if(sorted.length) {\n // how many box/violins plots do we have (in case they're grouped)\n fullLayout._numBoxes = 0;\n fullLayout._numViolins = 0;\n // If a sort operation was performed, run calc() again\n for(i = 0; i < sorted.length; i++) calci(sorted[i], true);\n for(i = 0; i < sorted.length; i++) calci(sorted[i], false);\n doCrossTraceCalc(gd);\n }\n\n Registry.getComponentMethod('fx', 'calc')(gd);\n Registry.getComponentMethod('errorbars', 'calc')(gd);\n};\n\nvar sortAxisCategoriesByValueRegex = /(total|sum|min|max|mean|median) (ascending|descending)/;\n\nfunction sortAxisCategoriesByValue(axList, gd) {\n var affectedTraces = [];\n var i, j, k, l, o;\n\n function zMapCategory(type, ax, value) {\n var axLetter = ax._id.charAt(0);\n if(type === 'histogram2dcontour') {\n var counterAxLetter = ax._counterAxes[0];\n var counterAx = axisIDs.getFromId(gd, counterAxLetter);\n\n var xCategorical = axLetter === 'x' || (counterAxLetter === 'x' && counterAx.type === 'category');\n var yCategorical = axLetter === 'y' || (counterAxLetter === 'y' && counterAx.type === 'category');\n\n return function(o, l) {\n if(o === 0 || l === 0) return -1; // Skip first row and column\n if(xCategorical && o === value[l].length - 1) return -1;\n if(yCategorical && l === value.length - 1) return -1;\n\n return (axLetter === 'y' ? l : o) - 1;\n };\n } else {\n return function(o, l) {\n return axLetter === 'y' ? l : o;\n };\n }\n }\n\n var aggFn = {\n 'min': function(values) {return Lib.aggNums(Math.min, null, values);},\n 'max': function(values) {return Lib.aggNums(Math.max, null, values);},\n 'sum': function(values) {return Lib.aggNums(function(a, b) { return a + b;}, null, values);},\n 'total': function(values) {return Lib.aggNums(function(a, b) { return a + b;}, null, values);},\n 'mean': function(values) {return Lib.mean(values);},\n 'median': function(values) {return Lib.median(values);}\n };\n\n for(i = 0; i < axList.length; i++) {\n var ax = axList[i];\n if(ax.type !== 'category') continue;\n\n // Order by value\n var match = ax.categoryorder.match(sortAxisCategoriesByValueRegex);\n if(match) {\n var aggregator = match[1];\n var order = match[2];\n\n // Store values associated with each category\n var categoriesValue = [];\n for(j = 0; j < ax._categories.length; j++) {\n categoriesValue.push([ax._categories[j], []]);\n }\n\n // Collect values across traces\n for(j = 0; j < ax._traceIndices.length; j++) {\n var traceIndex = ax._traceIndices[j];\n var fullTrace = gd._fullData[traceIndex];\n var axLetter = ax._id.charAt(0);\n\n // Skip over invisible traces\n if(fullTrace.visible !== true) continue;\n\n var type = fullTrace.type;\n if(Registry.traceIs(fullTrace, 'histogram')) {\n delete fullTrace._xautoBinFinished;\n delete fullTrace._yautoBinFinished;\n }\n\n var cd = gd.calcdata[traceIndex];\n for(k = 0; k < cd.length; k++) {\n var cdi = cd[k];\n var cat, catIndex, value;\n\n if(type === 'splom') {\n // If `splom`, collect values across dimensions\n // Find which dimension the current axis is representing\n var currentDimensionIndex = fullTrace._axesDim[ax._id];\n\n // Apply logic to associated x axis if it's defined\n if(axLetter === 'y') {\n var associatedXAxisID = fullTrace._diag[currentDimensionIndex][0];\n if(associatedXAxisID) ax = gd._fullLayout[axisIDs.id2name(associatedXAxisID)];\n }\n\n var categories = cdi.trace.dimensions[currentDimensionIndex].values;\n for(l = 0; l < categories.length; l++) {\n cat = categories[l];\n catIndex = ax._categoriesMap[cat];\n\n // Collect associated values at index `l` over all other dimensions\n for(o = 0; o < cdi.trace.dimensions.length; o++) {\n if(o === currentDimensionIndex) continue;\n var dimension = cdi.trace.dimensions[o];\n categoriesValue[catIndex][1].push(dimension.values[l]);\n }\n }\n } else if(type === 'scattergl') {\n // If `scattergl`, collect all values stashed under cdi.t\n for(l = 0; l < cdi.t.x.length; l++) {\n if(axLetter === 'x') {\n cat = cdi.t.x[l];\n catIndex = cat;\n value = cdi.t.y[l];\n }\n\n if(axLetter === 'y') {\n cat = cdi.t.y[l];\n catIndex = cat;\n value = cdi.t.x[l];\n }\n categoriesValue[catIndex][1].push(value);\n }\n // must clear scene 'batches', so that 2nd\n // _module.calc call starts from scratch\n if(cdi.t && cdi.t._scene) {\n delete cdi.t._scene.dirty;\n }\n } else if(cdi.hasOwnProperty('z')) {\n // If 2dMap, collect values in `z`\n value = cdi.z;\n var mapping = zMapCategory(fullTrace.type, ax, value);\n\n for(l = 0; l < value.length; l++) {\n for(o = 0; o < value[l].length; o++) {\n catIndex = mapping(o, l);\n if(catIndex + 1) categoriesValue[catIndex][1].push(value[l][o]);\n }\n }\n } else {\n // For all other 2d cartesian traces\n if(axLetter === 'x') {\n cat = cdi.p + 1 ? cdi.p : cdi.x;\n value = cdi.s || cdi.v || cdi.y;\n } else if(axLetter === 'y') {\n cat = cdi.p + 1 ? cdi.p : cdi.y;\n value = cdi.s || cdi.v || cdi.x;\n }\n if(!Array.isArray(value)) value = [value];\n for(l = 0; l < value.length; l++) {\n categoriesValue[cat][1].push(value[l]);\n }\n }\n }\n }\n\n ax._categoriesValue = categoriesValue;\n\n var categoriesAggregatedValue = [];\n for(j = 0; j < categoriesValue.length; j++) {\n categoriesAggregatedValue.push([\n categoriesValue[j][0],\n aggFn[aggregator](categoriesValue[j][1])\n ]);\n }\n\n // Sort by aggregated value\n categoriesAggregatedValue.sort(function(a, b) {\n return a[1] - b[1];\n });\n\n ax._categoriesAggregatedValue = categoriesAggregatedValue;\n\n // Set new category order\n ax._initialCategories = categoriesAggregatedValue.map(function(c) {\n return c[0];\n });\n\n // Reverse if descending\n if(order === 'descending') {\n ax._initialCategories.reverse();\n }\n\n // Sort all matching axes\n affectedTraces = affectedTraces.concat(ax.sortByInitialCategories());\n }\n }\n return affectedTraces;\n}\n\nfunction setupAxisCategories(axList, fullData, fullLayout) {\n var axLookup = {};\n var i, ax, axId;\n\n for(i = 0; i < axList.length; i++) {\n ax = axList[i];\n axId = ax._id;\n\n ax.clearCalc();\n if(ax.type === 'multicategory') {\n ax.setupMultiCategory(fullData);\n }\n\n axLookup[ax._id] = 1;\n }\n\n // look into match groups for 'missing' axes\n var matchGroups = fullLayout._axisMatchGroups || [];\n for(i = 0; i < matchGroups.length; i++) {\n for(axId in matchGroups[i]) {\n if(!axLookup[axId]) {\n ax = fullLayout[axisIDs.id2name(axId)];\n ax.clearCalc();\n }\n }\n }\n}\n\nfunction doCrossTraceCalc(gd) {\n var fullLayout = gd._fullLayout;\n var modules = fullLayout._visibleModules;\n var hash = {};\n var i, j, k;\n\n // position and range calculations for traces that\n // depend on each other ie bars (stacked or grouped)\n // and boxes (grouped) push each other out of the way\n\n for(j = 0; j < modules.length; j++) {\n var _module = modules[j];\n var fn = _module.crossTraceCalc;\n if(fn) {\n var spType = _module.basePlotModule.name;\n if(hash[spType]) {\n Lib.pushUnique(hash[spType], fn);\n } else {\n hash[spType] = [fn];\n }\n }\n }\n\n for(k in hash) {\n var methods = hash[k];\n var subplots = fullLayout._subplots[k];\n\n if(Array.isArray(subplots)) {\n for(i = 0; i < subplots.length; i++) {\n var sp = subplots[i];\n var spInfo = k === 'cartesian' ?\n fullLayout._plots[sp] :\n fullLayout[sp];\n\n for(j = 0; j < methods.length; j++) {\n methods[j](gd, spInfo, sp);\n }\n }\n } else {\n for(j = 0; j < methods.length; j++) {\n methods[j](gd);\n }\n }\n }\n}\n\nplots.rehover = function(gd) {\n if(gd._fullLayout._rehover) {\n gd._fullLayout._rehover();\n }\n};\n\nplots.redrag = function(gd) {\n if(gd._fullLayout._redrag) {\n gd._fullLayout._redrag();\n }\n};\n\nplots.generalUpdatePerTraceModule = function(gd, subplot, subplotCalcData, subplotLayout) {\n var traceHashOld = subplot.traceHash;\n var traceHash = {};\n var i;\n\n // build up moduleName -> calcData hash\n for(i = 0; i < subplotCalcData.length; i++) {\n var calcTraces = subplotCalcData[i];\n var trace = calcTraces[0].trace;\n\n // skip over visible === false traces\n // as they don't have `_module` ref\n if(trace.visible) {\n traceHash[trace.type] = traceHash[trace.type] || [];\n traceHash[trace.type].push(calcTraces);\n }\n }\n\n // when a trace gets deleted, make sure that its module's\n // plot method is called so that it is properly\n // removed from the DOM.\n for(var moduleNameOld in traceHashOld) {\n if(!traceHash[moduleNameOld]) {\n var fakeCalcTrace = traceHashOld[moduleNameOld][0];\n var fakeTrace = fakeCalcTrace[0].trace;\n\n fakeTrace.visible = false;\n traceHash[moduleNameOld] = [fakeCalcTrace];\n }\n }\n\n // call module plot method\n for(var moduleName in traceHash) {\n var moduleCalcData = traceHash[moduleName];\n var _module = moduleCalcData[0][0].trace._module;\n\n _module.plot(gd, subplot, Lib.filterVisible(moduleCalcData), subplotLayout);\n }\n\n // update moduleName -> calcData hash\n subplot.traceHash = traceHash;\n};\n\nplots.plotBasePlot = function(desiredType, gd, traces, transitionOpts, makeOnCompleteCallback) {\n var _module = Registry.getModule(desiredType);\n var cdmodule = getModuleCalcData(gd.calcdata, _module)[0];\n _module.plot(gd, cdmodule, transitionOpts, makeOnCompleteCallback);\n};\n\nplots.cleanBasePlot = function(desiredType, newFullData, newFullLayout, oldFullData, oldFullLayout) {\n var had = (oldFullLayout._has && oldFullLayout._has(desiredType));\n var has = (newFullLayout._has && newFullLayout._has(desiredType));\n\n if(had && !has) {\n oldFullLayout['_' + desiredType + 'layer'].selectAll('g.trace').remove();\n }\n};\n\n},{\"../components/color\":595,\"../constants/numerical\":704,\"../lib\":728,\"../plot_api/plot_schema\":765,\"../plot_api/plot_template\":766,\"../plots/get_data\":813,\"../registry\":859,\"./animation_attributes\":771,\"./attributes\":773,\"./cartesian/axis_ids\":779,\"./cartesian/handle_outline\":786,\"./command\":802,\"./font_attributes\":804,\"./frame_attributes\":805,\"./layout_attributes\":830,\"d3\":164,\"fast-isnumeric\":236}],840:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n attr: 'subplot',\n name: 'polar',\n\n axisNames: ['angularaxis', 'radialaxis'],\n axisName2dataArray: {angularaxis: 'theta', radialaxis: 'r'},\n\n layerNames: [\n 'draglayer',\n 'plotbg',\n 'backplot',\n 'angular-grid',\n 'radial-grid',\n 'frontplot',\n 'angular-line',\n 'radial-line',\n 'angular-axis',\n 'radial-axis'\n ],\n\n radialDragBoxSize: 50,\n angularDragBoxSize: 30,\n cornerLen: 25,\n cornerHalfWidth: 2,\n\n // pixels to move mouse before you stop clamping to starting point\n MINDRAG: 8,\n // smallest radial distance [px] allowed for a zoombox\n MINZOOM: 20,\n // distance [px] off (r=0) or (r=radius) where we transition\n // from single-sided to two-sided radial zoom\n OFFEDGE: 20\n};\n\n},{}],841:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar polygonTester = _dereq_('../../lib/polygon').tester;\n\nvar findIndexOfMin = Lib.findIndexOfMin;\nvar isAngleInsideSector = Lib.isAngleInsideSector;\nvar angleDelta = Lib.angleDelta;\nvar angleDist = Lib.angleDist;\n\n/**\n * is pt (r,a) inside polygon made up vertices at angles 'vangles'\n * inside a given polar sector\n *\n * @param {number} r : pt's radial coordinate\n * @param {number} a : pt's angular coordinate in *radians*\n * @param {2-item array} rBnds : sector's radial bounds\n * @param {2-item array} aBnds : sector's angular bounds *radians*\n * @param {array} vangles : angles of polygon vertices in *radians*\n * @return {boolean}\n */\nfunction isPtInsidePolygon(r, a, rBnds, aBnds, vangles) {\n if(!isAngleInsideSector(a, aBnds)) return false;\n\n var r0, r1;\n\n if(rBnds[0] < rBnds[1]) {\n r0 = rBnds[0];\n r1 = rBnds[1];\n } else {\n r0 = rBnds[1];\n r1 = rBnds[0];\n }\n\n var polygonIn = polygonTester(makePolygon(r0, aBnds[0], aBnds[1], vangles));\n var polygonOut = polygonTester(makePolygon(r1, aBnds[0], aBnds[1], vangles));\n var xy = [r * Math.cos(a), r * Math.sin(a)];\n return polygonOut.contains(xy) && !polygonIn.contains(xy);\n}\n\n// find intersection of 'v0' <-> 'v1' edge with a ray at angle 'a'\n// (i.e. a line that starts from the origin at angle 'a')\n// given an (xp,yp) pair on the 'v0' <-> 'v1' line\n// (N.B. 'v0' and 'v1' are angles in radians)\nfunction findIntersectionXY(v0, v1, a, xpyp) {\n var xstar, ystar;\n\n var xp = xpyp[0];\n var yp = xpyp[1];\n var dsin = clampTiny(Math.sin(v1) - Math.sin(v0));\n var dcos = clampTiny(Math.cos(v1) - Math.cos(v0));\n var tanA = Math.tan(a);\n var cotanA = clampTiny(1 / tanA);\n var m = dsin / dcos;\n var b = yp - m * xp;\n\n if(cotanA) {\n if(dsin && dcos) {\n // given\n // g(x) := v0 -> v1 line = m*x + b\n // h(x) := ray at angle 'a' = m*x = tanA*x\n // solve g(xstar) = h(xstar)\n xstar = b / (tanA - m);\n ystar = tanA * xstar;\n } else if(dcos) {\n // horizontal v0 -> v1\n xstar = yp * cotanA;\n ystar = yp;\n } else {\n // vertical v0 -> v1\n xstar = xp;\n ystar = xp * tanA;\n }\n } else {\n // vertical ray\n if(dsin && dcos) {\n xstar = 0;\n ystar = b;\n } else if(dcos) {\n xstar = 0;\n ystar = yp;\n } else {\n // does this case exists?\n xstar = ystar = NaN;\n }\n }\n\n return [xstar, ystar];\n}\n\n// solves l^2 = (f(x)^2 - yp)^2 + (x - xp)^2\n// rearranged into 0 = a*x^2 + b * x + c\n//\n// where f(x) = m*x + t + yp\n// and (x0, x1) = (-b +/- del) / (2*a)\nfunction findXYatLength(l, m, xp, yp) {\n var t = -m * xp;\n var a = m * m + 1;\n var b = 2 * (m * t - xp);\n var c = t * t + xp * xp - l * l;\n var del = Math.sqrt(b * b - 4 * a * c);\n var x0 = (-b + del) / (2 * a);\n var x1 = (-b - del) / (2 * a);\n return [\n [x0, m * x0 + t + yp],\n [x1, m * x1 + t + yp]\n ];\n}\n\nfunction makeRegularPolygon(r, vangles) {\n var len = vangles.length;\n var vertices = new Array(len + 1);\n var i;\n for(i = 0; i < len; i++) {\n var va = vangles[i];\n vertices[i] = [r * Math.cos(va), r * Math.sin(va)];\n }\n vertices[i] = vertices[0].slice();\n return vertices;\n}\n\nfunction makeClippedPolygon(r, a0, a1, vangles) {\n var len = vangles.length;\n var vertices = [];\n var i, j;\n\n function a2xy(a) {\n return [r * Math.cos(a), r * Math.sin(a)];\n }\n\n function findXY(va0, va1, s) {\n return findIntersectionXY(va0, va1, s, a2xy(va0));\n }\n\n function cycleIndex(ind) {\n return Lib.mod(ind, len);\n }\n\n function isInside(v) {\n return isAngleInsideSector(v, [a0, a1]);\n }\n\n // find index in sector closest to a0\n // use it to find intersection of v[i0] <-> v[i0-1] edge with sector radius\n var i0 = findIndexOfMin(vangles, function(v) {\n return isInside(v) ? angleDist(v, a0) : Infinity;\n });\n var xy0 = findXY(vangles[i0], vangles[cycleIndex(i0 - 1)], a0);\n vertices.push(xy0);\n\n // fill in in-sector vertices\n for(i = i0, j = 0; j < len; i++, j++) {\n var va = vangles[cycleIndex(i)];\n if(!isInside(va)) break;\n vertices.push(a2xy(va));\n }\n\n // find index in sector closest to a1,\n // use it to find intersection of v[iN] <-> v[iN+1] edge with sector radius\n var iN = findIndexOfMin(vangles, function(v) {\n return isInside(v) ? angleDist(v, a1) : Infinity;\n });\n var xyN = findXY(vangles[iN], vangles[cycleIndex(iN + 1)], a1);\n vertices.push(xyN);\n\n vertices.push([0, 0]);\n vertices.push(vertices[0].slice());\n\n return vertices;\n}\n\nfunction makePolygon(r, a0, a1, vangles) {\n return Lib.isFullCircle([a0, a1]) ?\n makeRegularPolygon(r, vangles) :\n makeClippedPolygon(r, a0, a1, vangles);\n}\n\nfunction findPolygonOffset(r, a0, a1, vangles) {\n var minX = Infinity;\n var minY = Infinity;\n var vertices = makePolygon(r, a0, a1, vangles);\n\n for(var i = 0; i < vertices.length; i++) {\n var v = vertices[i];\n minX = Math.min(minX, v[0]);\n minY = Math.min(minY, -v[1]);\n }\n return [minX, minY];\n}\n\n/**\n * find vertex angles (in 'vangles') the enclose angle 'a'\n *\n * @param {number} a : angle in *radians*\n * @param {array} vangles : angles of polygon vertices in *radians*\n * @return {2-item array}\n */\nfunction findEnclosingVertexAngles(a, vangles) {\n var minFn = function(v) {\n var adelta = angleDelta(v, a);\n return adelta > 0 ? adelta : Infinity;\n };\n var i0 = findIndexOfMin(vangles, minFn);\n var i1 = Lib.mod(i0 + 1, vangles.length);\n return [vangles[i0], vangles[i1]];\n}\n\n// to more easily catch 'almost zero' numbers in if-else blocks\nfunction clampTiny(v) {\n return Math.abs(v) > 1e-10 ? v : 0;\n}\n\nfunction transformForSVG(pts0, cx, cy) {\n cx = cx || 0;\n cy = cy || 0;\n\n var len = pts0.length;\n var pts1 = new Array(len);\n\n for(var i = 0; i < len; i++) {\n var pt = pts0[i];\n pts1[i] = [cx + pt[0], cy - pt[1]];\n }\n return pts1;\n}\n\n/**\n * path polygon\n *\n * @param {number} r : polygon 'radius'\n * @param {number} a0 : first angular coordinate in *radians*\n * @param {number} a1 : second angular coordinate in *radians*\n * @param {array} vangles : angles of polygon vertices in *radians*\n * @param {number (optional)} cx : x coordinate of center\n * @param {number (optional)} cy : y coordinate of center\n * @return {string} svg path\n *\n */\nfunction pathPolygon(r, a0, a1, vangles, cx, cy) {\n var poly = makePolygon(r, a0, a1, vangles);\n return 'M' + transformForSVG(poly, cx, cy).join('L');\n}\n\n/**\n * path a polygon 'annulus'\n * i.e. a polygon with a concentric hole\n *\n * N.B. this routine uses the evenodd SVG rule\n *\n * @param {number} r0 : first radial coordinate\n * @param {number} r1 : second radial coordinate\n * @param {number} a0 : first angular coordinate in *radians*\n * @param {number} a1 : second angular coordinate in *radians*\n * @param {array} vangles : angles of polygon vertices in *radians*\n * @param {number (optional)} cx : x coordinate of center\n * @param {number (optional)} cy : y coordinate of center\n * @return {string} svg path\n *\n */\nfunction pathPolygonAnnulus(r0, r1, a0, a1, vangles, cx, cy) {\n var rStart, rEnd;\n\n if(r0 < r1) {\n rStart = r0;\n rEnd = r1;\n } else {\n rStart = r1;\n rEnd = r0;\n }\n\n var inner = transformForSVG(makePolygon(rStart, a0, a1, vangles), cx, cy);\n var outer = transformForSVG(makePolygon(rEnd, a0, a1, vangles), cx, cy);\n return 'M' + outer.reverse().join('L') + 'M' + inner.join('L');\n}\n\nmodule.exports = {\n isPtInsidePolygon: isPtInsidePolygon,\n findPolygonOffset: findPolygonOffset,\n findEnclosingVertexAngles: findEnclosingVertexAngles,\n findIntersectionXY: findIntersectionXY,\n findXYatLength: findXYatLength,\n clampTiny: clampTiny,\n pathPolygon: pathPolygon,\n pathPolygonAnnulus: pathPolygonAnnulus\n};\n\n},{\"../../lib\":728,\"../../lib/polygon\":740}],842:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar getSubplotCalcData = _dereq_('../get_data').getSubplotCalcData;\nvar counterRegex = _dereq_('../../lib').counterRegex;\n\nvar createPolar = _dereq_('./polar');\nvar constants = _dereq_('./constants');\n\nvar attr = constants.attr;\nvar name = constants.name;\nvar counter = counterRegex(name);\n\nvar attributes = {};\nattributes[attr] = {\n valType: 'subplotid',\n \n dflt: name,\n editType: 'calc',\n \n};\n\nfunction plot(gd) {\n var fullLayout = gd._fullLayout;\n var calcData = gd.calcdata;\n var subplotIds = fullLayout._subplots[name];\n\n for(var i = 0; i < subplotIds.length; i++) {\n var id = subplotIds[i];\n var subplotCalcData = getSubplotCalcData(calcData, name, id);\n var subplot = fullLayout[id]._subplot;\n\n if(!subplot) {\n subplot = createPolar(gd, id);\n fullLayout[id]._subplot = subplot;\n }\n\n subplot.plot(subplotCalcData, fullLayout, gd._promises);\n }\n}\n\nfunction clean(newFullData, newFullLayout, oldFullData, oldFullLayout) {\n var oldIds = oldFullLayout._subplots[name] || [];\n var hadGl = (oldFullLayout._has && oldFullLayout._has('gl'));\n var hasGl = (newFullLayout._has && newFullLayout._has('gl'));\n var mustCleanScene = hadGl && !hasGl;\n\n for(var i = 0; i < oldIds.length; i++) {\n var id = oldIds[i];\n var oldSubplot = oldFullLayout[id]._subplot;\n\n if(!newFullLayout[id] && !!oldSubplot) {\n oldSubplot.framework.remove();\n oldSubplot.layers['radial-axis-title'].remove();\n\n for(var k in oldSubplot.clipPaths) {\n oldSubplot.clipPaths[k].remove();\n }\n }\n\n if(mustCleanScene && oldSubplot._scene) {\n oldSubplot._scene.destroy();\n oldSubplot._scene = null;\n }\n }\n}\n\nmodule.exports = {\n attr: attr,\n name: name,\n idRoot: name,\n idRegex: counter,\n attrRegex: counter,\n attributes: attributes,\n layoutAttributes: _dereq_('./layout_attributes'),\n supplyLayoutDefaults: _dereq_('./layout_defaults'),\n plot: plot,\n clean: clean,\n toSVG: _dereq_('../cartesian').toSVG\n};\n\n},{\"../../lib\":728,\"../cartesian\":789,\"../get_data\":813,\"./constants\":840,\"./layout_attributes\":843,\"./layout_defaults\":844,\"./polar\":851}],843:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar colorAttrs = _dereq_('../../components/color/attributes');\nvar axesAttrs = _dereq_('../cartesian/layout_attributes');\nvar domainAttrs = _dereq_('../domain').attributes;\nvar extendFlat = _dereq_('../../lib').extendFlat;\nvar overrideAll = _dereq_('../../plot_api/edit_types').overrideAll;\n\nvar axisLineGridAttr = overrideAll({\n color: axesAttrs.color,\n showline: extendFlat({}, axesAttrs.showline, {dflt: true}),\n linecolor: axesAttrs.linecolor,\n linewidth: axesAttrs.linewidth,\n showgrid: extendFlat({}, axesAttrs.showgrid, {dflt: true}),\n gridcolor: axesAttrs.gridcolor,\n gridwidth: axesAttrs.gridwidth\n\n // TODO add spike* attributes down the road\n\n // should we add zeroline* attributes?\n\n}, 'plot', 'from-root');\n\nvar axisTickAttrs = overrideAll({\n tickmode: axesAttrs.tickmode,\n nticks: axesAttrs.nticks,\n tick0: axesAttrs.tick0,\n dtick: axesAttrs.dtick,\n tickvals: axesAttrs.tickvals,\n ticktext: axesAttrs.ticktext,\n ticks: axesAttrs.ticks,\n ticklen: axesAttrs.ticklen,\n tickwidth: axesAttrs.tickwidth,\n tickcolor: axesAttrs.tickcolor,\n showticklabels: axesAttrs.showticklabels,\n showtickprefix: axesAttrs.showtickprefix,\n tickprefix: axesAttrs.tickprefix,\n showticksuffix: axesAttrs.showticksuffix,\n ticksuffix: axesAttrs.ticksuffix,\n showexponent: axesAttrs.showexponent,\n exponentformat: axesAttrs.exponentformat,\n separatethousands: axesAttrs.separatethousands,\n tickfont: axesAttrs.tickfont,\n tickangle: axesAttrs.tickangle,\n tickformat: axesAttrs.tickformat,\n tickformatstops: axesAttrs.tickformatstops,\n layer: axesAttrs.layer\n}, 'plot', 'from-root');\n\nvar radialAxisAttrs = {\n visible: extendFlat({}, axesAttrs.visible, {dflt: true}),\n type: extendFlat({}, axesAttrs.type, {\n values: ['-', 'linear', 'log', 'date', 'category']\n }),\n\n autorange: extendFlat({}, axesAttrs.autorange, {editType: 'plot'}),\n rangemode: {\n valType: 'enumerated',\n values: ['tozero', 'nonnegative', 'normal'],\n dflt: 'tozero',\n \n editType: 'calc',\n \n },\n range: extendFlat({}, axesAttrs.range, {\n items: [\n {valType: 'any', editType: 'plot', impliedEdits: {'^autorange': false}},\n {valType: 'any', editType: 'plot', impliedEdits: {'^autorange': false}}\n ],\n editType: 'plot'\n }),\n\n categoryorder: axesAttrs.categoryorder,\n categoryarray: axesAttrs.categoryarray,\n\n angle: {\n valType: 'angle',\n editType: 'plot',\n \n \n },\n\n side: {\n valType: 'enumerated',\n // TODO add 'center' for `showline: false` radial axes\n values: ['clockwise', 'counterclockwise'],\n dflt: 'clockwise',\n editType: 'plot',\n \n \n },\n\n\n title: {\n // radial title is not gui-editable at the moment,\n // so it needs dflt: '', similar to carpet axes.\n text: extendFlat({}, axesAttrs.title.text, {editType: 'plot', dflt: ''}),\n font: extendFlat({}, axesAttrs.title.font, {editType: 'plot'}),\n\n // TODO\n // - might need a 'titleside' and even 'titledirection' down the road\n // - what about standoff ??\n\n editType: 'plot'\n },\n\n hoverformat: axesAttrs.hoverformat,\n\n uirevision: {\n valType: 'any',\n \n editType: 'none',\n \n },\n\n editType: 'calc',\n\n _deprecated: {\n title: axesAttrs._deprecated.title,\n titlefont: axesAttrs._deprecated.titlefont\n }\n};\n\nextendFlat(\n radialAxisAttrs,\n\n // N.B. radialaxis grid lines are circular,\n // but radialaxis lines are straight from circle center to outer bound\n axisLineGridAttr,\n axisTickAttrs\n);\n\nvar angularAxisAttrs = {\n visible: extendFlat({}, axesAttrs.visible, {dflt: true}),\n type: {\n valType: 'enumerated',\n // 'linear' should maybe be called 'angle' or 'angular' here\n // to make clear that axis here is periodic and more tightly match\n // `thetaunit`?\n //\n // skip 'date' for first push\n // no 'log' for now\n values: ['-', 'linear', 'category'],\n dflt: '-',\n \n editType: 'calc',\n _noTemplating: true,\n \n },\n\n categoryorder: axesAttrs.categoryorder,\n categoryarray: axesAttrs.categoryarray,\n\n thetaunit: {\n valType: 'enumerated',\n values: ['radians', 'degrees'],\n dflt: 'degrees',\n \n editType: 'calc',\n \n },\n\n period: {\n valType: 'number',\n editType: 'calc',\n min: 0,\n \n \n // Examples for date axes:\n //\n // - period that equals the timeseries length\n // http://flowingdata.com/2017/01/24/one-dataset-visualized-25-ways/18-polar-coordinates/\n // - and 1-year periods (focusing on seasonal change0\n // http://otexts.org/fpp2/seasonal-plots.html\n // https://blogs.scientificamerican.com/sa-visual/why-are-so-many-babies-born-around-8-00-a-m/\n // http://www.seasonaladjustment.com/2012/09/05/clock-plot-visualising-seasonality-using-r-and-ggplot2-part-3/\n // https://i.pinimg.com/736x/49/b9/72/49b972ccb3206a1a6d6f870dac543280.jpg\n // https://www.climate-lab-book.ac.uk/spirals/\n },\n\n direction: {\n valType: 'enumerated',\n values: ['counterclockwise', 'clockwise'],\n dflt: 'counterclockwise',\n \n editType: 'calc',\n \n },\n\n rotation: {\n valType: 'angle',\n editType: 'calc',\n \n \n },\n\n hoverformat: axesAttrs.hoverformat,\n\n uirevision: {\n valType: 'any',\n \n editType: 'none',\n \n },\n\n editType: 'calc'\n};\n\nextendFlat(\n angularAxisAttrs,\n\n // N.B. angular grid lines are straight lines from circle center to outer bound\n // the angular line is circular bounding the polar plot area.\n axisLineGridAttr,\n\n // N.B. ticksuffix defaults to '°' for angular axes with `thetaunit: 'degrees'`\n axisTickAttrs\n);\n\nmodule.exports = {\n // TODO for x/y/zoom system for paper-based zooming:\n // x: {},\n // y: {},\n // zoom: {},\n\n domain: domainAttrs({name: 'polar', editType: 'plot'}),\n\n sector: {\n valType: 'info_array',\n items: [\n {valType: 'number', editType: 'plot'},\n {valType: 'number', editType: 'plot'}\n ],\n dflt: [0, 360],\n \n editType: 'plot',\n \n },\n hole: {\n valType: 'number',\n min: 0,\n max: 1,\n dflt: 0,\n editType: 'plot',\n \n \n },\n\n bgcolor: {\n valType: 'color',\n \n editType: 'plot',\n dflt: colorAttrs.background,\n \n },\n\n radialaxis: radialAxisAttrs,\n angularaxis: angularAxisAttrs,\n\n gridshape: {\n valType: 'enumerated',\n values: ['circular', 'linear'],\n dflt: 'circular',\n \n editType: 'plot',\n \n },\n\n // TODO maybe?\n // annotations:\n\n uirevision: {\n valType: 'any',\n \n editType: 'none',\n \n },\n\n editType: 'calc'\n};\n\n},{\"../../components/color/attributes\":594,\"../../lib\":728,\"../../plot_api/edit_types\":759,\"../cartesian/layout_attributes\":790,\"../domain\":803}],844:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Color = _dereq_('../../components/color');\nvar Template = _dereq_('../../plot_api/plot_template');\n\nvar handleSubplotDefaults = _dereq_('../subplot_defaults');\nvar getSubplotData = _dereq_('../get_data').getSubplotData;\n\nvar handleTickValueDefaults = _dereq_('../cartesian/tick_value_defaults');\nvar handleTickMarkDefaults = _dereq_('../cartesian/tick_mark_defaults');\nvar handleTickLabelDefaults = _dereq_('../cartesian/tick_label_defaults');\nvar handleCategoryOrderDefaults = _dereq_('../cartesian/category_order_defaults');\nvar handleLineGridDefaults = _dereq_('../cartesian/line_grid_defaults');\nvar autoType = _dereq_('../cartesian/axis_autotype');\n\nvar layoutAttributes = _dereq_('./layout_attributes');\nvar setConvert = _dereq_('./set_convert');\nvar constants = _dereq_('./constants');\nvar axisNames = constants.axisNames;\n\nfunction handleDefaults(contIn, contOut, coerce, opts) {\n var bgColor = coerce('bgcolor');\n opts.bgColor = Color.combine(bgColor, opts.paper_bgcolor);\n\n var sector = coerce('sector');\n coerce('hole');\n\n // could optimize, subplotData is not always needed!\n var subplotData = getSubplotData(opts.fullData, constants.name, opts.id);\n var layoutOut = opts.layoutOut;\n var axName;\n\n function coerceAxis(attr, dflt) {\n return coerce(axName + '.' + attr, dflt);\n }\n\n for(var i = 0; i < axisNames.length; i++) {\n axName = axisNames[i];\n\n if(!Lib.isPlainObject(contIn[axName])) {\n contIn[axName] = {};\n }\n\n var axIn = contIn[axName];\n var axOut = Template.newContainer(contOut, axName);\n axOut._id = axOut._name = axName;\n axOut._attr = opts.id + '.' + axName;\n axOut._traceIndices = subplotData.map(function(t) { return t._expandedIndex; });\n\n var dataAttr = constants.axisName2dataArray[axName];\n var axType = handleAxisTypeDefaults(axIn, axOut, coerceAxis, subplotData, dataAttr);\n\n handleCategoryOrderDefaults(axIn, axOut, coerceAxis, {\n axData: subplotData,\n dataAttr: dataAttr\n });\n\n var visible = coerceAxis('visible');\n setConvert(axOut, contOut, layoutOut);\n\n coerceAxis('uirevision', contOut.uirevision);\n\n var dfltColor;\n var dfltFontColor;\n\n if(visible) {\n dfltColor = coerceAxis('color');\n dfltFontColor = (dfltColor === axIn.color) ? dfltColor : opts.font.color;\n }\n\n // We don't want to make downstream code call ax.setScale,\n // as both radial and angular axes don't have a set domain.\n // Furthermore, angular axes don't have a set range.\n //\n // Mocked domains and ranges are set by the polar subplot instances,\n // but Axes.findExtremes uses the sign of _m to determine which padding value\n // to use.\n //\n // By setting, _m to 1 here, we make Axes.findExtremes think that\n // range[1] > range[0], and vice-versa for `autorange: 'reversed'` below.\n axOut._m = 1;\n\n switch(axName) {\n case 'radialaxis':\n var autoRange = coerceAxis('autorange', !axOut.isValidRange(axIn.range));\n axIn.autorange = autoRange;\n if(autoRange && (axType === 'linear' || axType === '-')) coerceAxis('rangemode');\n if(autoRange === 'reversed') axOut._m = -1;\n\n coerceAxis('range');\n axOut.cleanRange('range', {dfltRange: [0, 1]});\n\n if(visible) {\n coerceAxis('side');\n coerceAxis('angle', sector[0]);\n\n coerceAxis('title.text');\n Lib.coerceFont(coerceAxis, 'title.font', {\n family: opts.font.family,\n size: Math.round(opts.font.size * 1.2),\n color: dfltFontColor\n });\n }\n break;\n\n case 'angularaxis':\n // We do not support 'true' date angular axes yet,\n // users can still plot dates on angular axes by setting\n // `angularaxis.type: 'category'`.\n //\n // Here, if a date angular axes is detected, we make\n // all its corresponding traces invisible, so that\n // when we do add support for data angular axes, the new\n // behavior won't conflict with existing behavior\n if(axType === 'date') {\n Lib.log('Polar plots do not support date angular axes yet.');\n\n for(var j = 0; j < subplotData.length; j++) {\n subplotData[j].visible = false;\n }\n\n // turn this into a 'dummy' linear axis so that\n // the subplot still renders ok\n axType = axIn.type = axOut.type = 'linear';\n }\n\n if(axType === 'linear') {\n coerceAxis('thetaunit');\n } else {\n coerceAxis('period');\n }\n\n var direction = coerceAxis('direction');\n coerceAxis('rotation', {counterclockwise: 0, clockwise: 90}[direction]);\n break;\n }\n\n if(visible) {\n handleTickValueDefaults(axIn, axOut, coerceAxis, axOut.type);\n handleTickLabelDefaults(axIn, axOut, coerceAxis, axOut.type, {\n tickSuffixDflt: axOut.thetaunit === 'degrees' ? '°' : undefined\n });\n handleTickMarkDefaults(axIn, axOut, coerceAxis, {outerTicks: true});\n\n var showTickLabels = coerceAxis('showticklabels');\n if(showTickLabels) {\n Lib.coerceFont(coerceAxis, 'tickfont', {\n family: opts.font.family,\n size: opts.font.size,\n color: dfltFontColor\n });\n coerceAxis('tickangle');\n coerceAxis('tickformat');\n }\n\n handleLineGridDefaults(axIn, axOut, coerceAxis, {\n dfltColor: dfltColor,\n bgColor: opts.bgColor,\n // default grid color is darker here (60%, vs cartesian default ~91%)\n // because the grid is not square so the eye needs heavier cues to follow\n blend: 60,\n showLine: true,\n showGrid: true,\n noZeroLine: true,\n attributes: layoutAttributes[axName]\n });\n\n coerceAxis('layer');\n }\n\n if(axType !== 'category') coerceAxis('hoverformat');\n\n axOut._input = axIn;\n }\n\n if(contOut.angularaxis.type === 'category') {\n coerce('gridshape');\n }\n}\n\nfunction handleAxisTypeDefaults(axIn, axOut, coerce, subplotData, dataAttr) {\n var axType = coerce('type');\n\n if(axType === '-') {\n var trace;\n\n for(var i = 0; i < subplotData.length; i++) {\n if(subplotData[i].visible) {\n trace = subplotData[i];\n break;\n }\n }\n\n if(trace && trace[dataAttr]) {\n axOut.type = autoType(trace[dataAttr], 'gregorian');\n }\n\n if(axOut.type === '-') {\n axOut.type = 'linear';\n } else {\n // copy autoType back to input axis\n // note that if this object didn't exist\n // in the input layout, we have to put it in\n // this happens in the main supplyDefaults function\n axIn.type = axOut.type;\n }\n }\n\n return axOut.type;\n}\n\nmodule.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {\n handleSubplotDefaults(layoutIn, layoutOut, fullData, {\n type: constants.name,\n attributes: layoutAttributes,\n handleDefaults: handleDefaults,\n font: layoutOut.font,\n paper_bgcolor: layoutOut.paper_bgcolor,\n fullData: fullData,\n layoutOut: layoutOut\n });\n};\n\n},{\"../../components/color\":595,\"../../lib\":728,\"../../plot_api/plot_template\":766,\"../cartesian/axis_autotype\":777,\"../cartesian/category_order_defaults\":780,\"../cartesian/line_grid_defaults\":792,\"../cartesian/tick_label_defaults\":797,\"../cartesian/tick_mark_defaults\":798,\"../cartesian/tick_value_defaults\":799,\"../get_data\":813,\"../subplot_defaults\":853,\"./constants\":840,\"./layout_attributes\":843,\"./set_convert\":852}],845:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar scatterAttrs = _dereq_('../../../traces/scatter/attributes');\nvar scatterMarkerAttrs = scatterAttrs.marker;\nvar extendFlat = _dereq_('../../../lib/extend').extendFlat;\n\nvar deprecationWarning = [\n 'Area traces are deprecated!',\n 'Please switch to the *barpolar* trace type.'\n].join(' ');\n\nmodule.exports = {\n r: extendFlat({}, scatterAttrs.r, {\n \n }),\n t: extendFlat({}, scatterAttrs.t, {\n \n }),\n marker: {\n color: extendFlat({}, scatterMarkerAttrs.color, {\n \n }),\n size: extendFlat({}, scatterMarkerAttrs.size, {\n \n }),\n symbol: extendFlat({}, scatterMarkerAttrs.symbol, {\n \n }),\n opacity: extendFlat({}, scatterMarkerAttrs.opacity, {\n \n }),\n editType: 'calc'\n }\n};\n\n},{\"../../../lib/extend\":719,\"../../../traces/scatter/attributes\":1134}],846:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar axesAttrs = _dereq_('../../cartesian/layout_attributes');\nvar extendFlat = _dereq_('../../../lib/extend').extendFlat;\nvar overrideAll = _dereq_('../../../plot_api/edit_types').overrideAll;\n\nvar deprecationWarning = [\n 'Legacy polar charts are deprecated!',\n 'Please switch to *polar* subplots.'\n].join(' ');\n\nvar domainAttr = extendFlat({}, axesAttrs.domain, {\n \n});\n\nfunction mergeAttrs(axisName, nonCommonAttrs) {\n var commonAttrs = {\n showline: {\n valType: 'boolean',\n \n \n },\n showticklabels: {\n valType: 'boolean',\n \n \n },\n tickorientation: {\n valType: 'enumerated',\n values: ['horizontal', 'vertical'],\n \n \n },\n ticklen: {\n valType: 'number',\n min: 0,\n \n \n },\n tickcolor: {\n valType: 'color',\n \n \n },\n ticksuffix: {\n valType: 'string',\n \n \n },\n endpadding: {\n valType: 'number',\n \n description: deprecationWarning,\n },\n visible: {\n valType: 'boolean',\n \n \n }\n };\n\n return extendFlat({}, nonCommonAttrs, commonAttrs);\n}\n\nmodule.exports = overrideAll({\n radialaxis: mergeAttrs('radial', {\n range: {\n valType: 'info_array',\n \n items: [\n { valType: 'number' },\n { valType: 'number' }\n ],\n \n },\n domain: domainAttr,\n orientation: {\n valType: 'number',\n \n \n }\n }),\n\n angularaxis: mergeAttrs('angular', {\n range: {\n valType: 'info_array',\n \n items: [\n { valType: 'number', dflt: 0 },\n { valType: 'number', dflt: 360 }\n ],\n \n },\n domain: domainAttr\n }),\n\n // attributes that appear at layout root\n layout: {\n direction: {\n valType: 'enumerated',\n values: ['clockwise', 'counterclockwise'],\n \n \n },\n orientation: {\n valType: 'angle',\n \n \n }\n }\n}, 'plot', 'nested');\n\n},{\"../../../lib/extend\":719,\"../../../plot_api/edit_types\":759,\"../../cartesian/layout_attributes\":790}],847:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Polar = module.exports = _dereq_('./micropolar');\n\nPolar.manager = _dereq_('./micropolar_manager');\n\n},{\"./micropolar\":848,\"./micropolar_manager\":849}],848:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\nvar d3 = _dereq_('d3');\nvar Lib = _dereq_('../../../lib');\nvar extendDeepAll = Lib.extendDeepAll;\nvar MID_SHIFT = _dereq_('../../../constants/alignment').MID_SHIFT;\n\nvar µ = module.exports = { version: '0.2.2' };\n\nµ.Axis = function module() {\n var config = {\n data: [],\n layout: {}\n }, inputConfig = {}, liveConfig = {};\n var svg, container, dispatch = d3.dispatch('hover'), radialScale, angularScale;\n var exports = {};\n function render(_container) {\n container = _container || container;\n var data = config.data;\n var axisConfig = config.layout;\n if (typeof container == 'string' || container.nodeName) container = d3.select(container);\n container.datum(data).each(function(_data, _index) {\n var dataOriginal = _data.slice();\n liveConfig = {\n data: µ.util.cloneJson(dataOriginal),\n layout: µ.util.cloneJson(axisConfig)\n };\n var colorIndex = 0;\n dataOriginal.forEach(function(d, i) {\n if (!d.color) {\n d.color = axisConfig.defaultColorRange[colorIndex];\n colorIndex = (colorIndex + 1) % axisConfig.defaultColorRange.length;\n }\n if (!d.strokeColor) {\n d.strokeColor = d.geometry === 'LinePlot' ? d.color : d3.rgb(d.color).darker().toString();\n }\n liveConfig.data[i].color = d.color;\n liveConfig.data[i].strokeColor = d.strokeColor;\n liveConfig.data[i].strokeDash = d.strokeDash;\n liveConfig.data[i].strokeSize = d.strokeSize;\n });\n var data = dataOriginal.filter(function(d, i) {\n var visible = d.visible;\n return typeof visible === 'undefined' || visible === true;\n });\n var isStacked = false;\n var dataWithGroupId = data.map(function(d, i) {\n isStacked = isStacked || typeof d.groupId !== 'undefined';\n return d;\n });\n if (isStacked) {\n var grouped = d3.nest().key(function(d, i) {\n return typeof d.groupId != 'undefined' ? d.groupId : 'unstacked';\n }).entries(dataWithGroupId);\n var dataYStack = [];\n var stacked = grouped.map(function(d, i) {\n if (d.key === 'unstacked') return d.values; else {\n var prevArray = d.values[0].r.map(function(d, i) {\n return 0;\n });\n d.values.forEach(function(d, i, a) {\n d.yStack = [ prevArray ];\n dataYStack.push(prevArray);\n prevArray = µ.util.sumArrays(d.r, prevArray);\n });\n return d.values;\n }\n });\n data = d3.merge(stacked);\n }\n data.forEach(function(d, i) {\n d.t = Array.isArray(d.t[0]) ? d.t : [ d.t ];\n d.r = Array.isArray(d.r[0]) ? d.r : [ d.r ];\n });\n var radius = Math.min(axisConfig.width - axisConfig.margin.left - axisConfig.margin.right, axisConfig.height - axisConfig.margin.top - axisConfig.margin.bottom) / 2;\n radius = Math.max(10, radius);\n var chartCenter = [ axisConfig.margin.left + radius, axisConfig.margin.top + radius ];\n var extent;\n if (isStacked) {\n var highestStackedValue = d3.max(µ.util.sumArrays(µ.util.arrayLast(data).r[0], µ.util.arrayLast(dataYStack)));\n extent = [ 0, highestStackedValue ];\n } else extent = d3.extent(µ.util.flattenArray(data.map(function(d, i) {\n return d.r;\n })));\n if (axisConfig.radialAxis.domain != µ.DATAEXTENT) extent[0] = 0;\n radialScale = d3.scale.linear().domain(axisConfig.radialAxis.domain != µ.DATAEXTENT && axisConfig.radialAxis.domain ? axisConfig.radialAxis.domain : extent).range([ 0, radius ]);\n liveConfig.layout.radialAxis.domain = radialScale.domain();\n var angularDataMerged = µ.util.flattenArray(data.map(function(d, i) {\n return d.t;\n }));\n var isOrdinal = typeof angularDataMerged[0] === 'string';\n var ticks;\n if (isOrdinal) {\n angularDataMerged = µ.util.deduplicate(angularDataMerged);\n ticks = angularDataMerged.slice();\n angularDataMerged = d3.range(angularDataMerged.length);\n data = data.map(function(d, i) {\n var result = d;\n d.t = [ angularDataMerged ];\n if (isStacked) result.yStack = d.yStack;\n return result;\n });\n }\n var hasOnlyLineOrDotPlot = data.filter(function(d, i) {\n return d.geometry === 'LinePlot' || d.geometry === 'DotPlot';\n }).length === data.length;\n var needsEndSpacing = axisConfig.needsEndSpacing === null ? isOrdinal || !hasOnlyLineOrDotPlot : axisConfig.needsEndSpacing;\n var useProvidedDomain = axisConfig.angularAxis.domain && axisConfig.angularAxis.domain != µ.DATAEXTENT && !isOrdinal && axisConfig.angularAxis.domain[0] >= 0;\n var angularDomain = useProvidedDomain ? axisConfig.angularAxis.domain : d3.extent(angularDataMerged);\n var angularDomainStep = Math.abs(angularDataMerged[1] - angularDataMerged[0]);\n if (hasOnlyLineOrDotPlot && !isOrdinal) angularDomainStep = 0;\n var angularDomainWithPadding = angularDomain.slice();\n if (needsEndSpacing && isOrdinal) angularDomainWithPadding[1] += angularDomainStep;\n var tickCount = axisConfig.angularAxis.ticksCount || 4;\n if (tickCount > 8) tickCount = tickCount / (tickCount / 8) + tickCount % 8;\n if (axisConfig.angularAxis.ticksStep) {\n tickCount = (angularDomainWithPadding[1] - angularDomainWithPadding[0]) / tickCount;\n }\n var angularTicksStep = axisConfig.angularAxis.ticksStep || (angularDomainWithPadding[1] - angularDomainWithPadding[0]) / (tickCount * (axisConfig.minorTicks + 1));\n if (ticks) angularTicksStep = Math.max(Math.round(angularTicksStep), 1);\n if (!angularDomainWithPadding[2]) angularDomainWithPadding[2] = angularTicksStep;\n var angularAxisRange = d3.range.apply(this, angularDomainWithPadding);\n angularAxisRange = angularAxisRange.map(function(d, i) {\n return parseFloat(d.toPrecision(12));\n });\n angularScale = d3.scale.linear().domain(angularDomainWithPadding.slice(0, 2)).range(axisConfig.direction === 'clockwise' ? [ 0, 360 ] : [ 360, 0 ]);\n liveConfig.layout.angularAxis.domain = angularScale.domain();\n liveConfig.layout.angularAxis.endPadding = needsEndSpacing ? angularDomainStep : 0;\n svg = d3.select(this).select('svg.chart-root');\n if (typeof svg === 'undefined' || svg.empty()) {\n var skeleton = \"' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '\";\n var doc = new DOMParser().parseFromString(skeleton, 'application/xml');\n var newSvg = this.appendChild(this.ownerDocument.importNode(doc.documentElement, true));\n svg = d3.select(newSvg);\n }\n svg.select('.guides-group').style({\n 'pointer-events': 'none'\n });\n svg.select('.angular.axis-group').style({\n 'pointer-events': 'none'\n });\n svg.select('.radial.axis-group').style({\n 'pointer-events': 'none'\n });\n var chartGroup = svg.select('.chart-group');\n var lineStyle = {\n fill: 'none',\n stroke: axisConfig.tickColor\n };\n var fontStyle = {\n 'font-size': axisConfig.font.size,\n 'font-family': axisConfig.font.family,\n fill: axisConfig.font.color,\n 'text-shadow': [ '-1px 0px', '1px -1px', '-1px 1px', '1px 1px' ].map(function(d, i) {\n return ' ' + d + ' 0 ' + axisConfig.font.outlineColor;\n }).join(',')\n };\n var legendContainer;\n if (axisConfig.showLegend) {\n legendContainer = svg.select('.legend-group').attr({\n transform: 'translate(' + [ radius, axisConfig.margin.top ] + ')'\n }).style({\n display: 'block'\n });\n var elements = data.map(function(d, i) {\n var datumClone = µ.util.cloneJson(d);\n datumClone.symbol = d.geometry === 'DotPlot' ? d.dotType || 'circle' : d.geometry != 'LinePlot' ? 'square' : 'line';\n datumClone.visibleInLegend = typeof d.visibleInLegend === 'undefined' || d.visibleInLegend;\n datumClone.color = d.geometry === 'LinePlot' ? d.strokeColor : d.color;\n return datumClone;\n });\n\n µ.Legend().config({\n data: data.map(function(d, i) {\n return d.name || 'Element' + i;\n }),\n legendConfig: extendDeepAll({},\n µ.Legend.defaultConfig().legendConfig,\n {\n container: legendContainer,\n elements: elements,\n reverseOrder: axisConfig.legend.reverseOrder\n }\n )\n })();\n\n var legendBBox = legendContainer.node().getBBox();\n radius = Math.min(axisConfig.width - legendBBox.width - axisConfig.margin.left - axisConfig.margin.right, axisConfig.height - axisConfig.margin.top - axisConfig.margin.bottom) / 2;\n radius = Math.max(10, radius);\n chartCenter = [ axisConfig.margin.left + radius, axisConfig.margin.top + radius ];\n radialScale.range([ 0, radius ]);\n liveConfig.layout.radialAxis.domain = radialScale.domain();\n legendContainer.attr('transform', 'translate(' + [ chartCenter[0] + radius, chartCenter[1] - radius ] + ')');\n } else {\n legendContainer = svg.select('.legend-group').style({\n display: 'none'\n });\n }\n svg.attr({\n width: axisConfig.width,\n height: axisConfig.height\n }).style({\n opacity: axisConfig.opacity\n });\n chartGroup.attr('transform', 'translate(' + chartCenter + ')').style({\n cursor: 'crosshair'\n });\n var centeringOffset = [ (axisConfig.width - (axisConfig.margin.left + axisConfig.margin.right + radius * 2 + (legendBBox ? legendBBox.width : 0))) / 2, (axisConfig.height - (axisConfig.margin.top + axisConfig.margin.bottom + radius * 2)) / 2 ];\n centeringOffset[0] = Math.max(0, centeringOffset[0]);\n centeringOffset[1] = Math.max(0, centeringOffset[1]);\n svg.select('.outer-group').attr('transform', 'translate(' + centeringOffset + ')');\n if (axisConfig.title && axisConfig.title.text) {\n var title = svg.select('g.title-group text').style(fontStyle).text(axisConfig.title.text);\n var titleBBox = title.node().getBBox();\n title.attr({\n x: chartCenter[0] - titleBBox.width / 2,\n y: chartCenter[1] - radius - 20\n });\n }\n var radialAxis = svg.select('.radial.axis-group');\n if (axisConfig.radialAxis.gridLinesVisible) {\n var gridCircles = radialAxis.selectAll('circle.grid-circle').data(radialScale.ticks(5));\n gridCircles.enter().append('circle').attr({\n 'class': 'grid-circle'\n }).style(lineStyle);\n gridCircles.attr('r', radialScale);\n gridCircles.exit().remove();\n }\n radialAxis.select('circle.outside-circle').attr({\n r: radius\n }).style(lineStyle);\n var backgroundCircle = svg.select('circle.background-circle').attr({\n r: radius\n }).style({\n fill: axisConfig.backgroundColor,\n stroke: axisConfig.stroke\n });\n function currentAngle(d, i) {\n return angularScale(d) % 360 + axisConfig.orientation;\n }\n if (axisConfig.radialAxis.visible) {\n var axis = d3.svg.axis().scale(radialScale).ticks(5).tickSize(5);\n radialAxis.call(axis).attr({\n transform: 'rotate(' + axisConfig.radialAxis.orientation + ')'\n });\n radialAxis.selectAll('.domain').style(lineStyle);\n radialAxis.selectAll('g>text').text(function(d, i) {\n return this.textContent + axisConfig.radialAxis.ticksSuffix;\n }).style(fontStyle).style({\n 'text-anchor': 'start'\n }).attr({\n x: 0,\n y: 0,\n dx: 0,\n dy: 0,\n transform: function(d, i) {\n if (axisConfig.radialAxis.tickOrientation === 'horizontal') {\n return 'rotate(' + -axisConfig.radialAxis.orientation + ') translate(' + [ 0, fontStyle['font-size'] ] + ')';\n } else return 'translate(' + [ 0, fontStyle['font-size'] ] + ')';\n }\n });\n radialAxis.selectAll('g>line').style({\n stroke: 'black'\n });\n }\n var angularAxis = svg.select('.angular.axis-group').selectAll('g.angular-tick').data(angularAxisRange);\n var angularAxisEnter = angularAxis.enter().append('g').classed('angular-tick', true);\n angularAxis.attr({\n transform: function(d, i) {\n return 'rotate(' + currentAngle(d, i) + ')';\n }\n }).style({\n display: axisConfig.angularAxis.visible ? 'block' : 'none'\n });\n angularAxis.exit().remove();\n angularAxisEnter.append('line').classed('grid-line', true).classed('major', function(d, i) {\n return i % (axisConfig.minorTicks + 1) == 0;\n }).classed('minor', function(d, i) {\n return !(i % (axisConfig.minorTicks + 1) == 0);\n }).style(lineStyle);\n angularAxisEnter.selectAll('.minor').style({\n stroke: axisConfig.minorTickColor\n });\n angularAxis.select('line.grid-line').attr({\n x1: axisConfig.tickLength ? radius - axisConfig.tickLength : 0,\n x2: radius\n }).style({\n display: axisConfig.angularAxis.gridLinesVisible ? 'block' : 'none'\n });\n angularAxisEnter.append('text').classed('axis-text', true).style(fontStyle);\n var ticksText = angularAxis.select('text.axis-text').attr({\n x: radius + axisConfig.labelOffset,\n dy: MID_SHIFT + 'em',\n transform: function(d, i) {\n var angle = currentAngle(d, i);\n var rad = radius + axisConfig.labelOffset;\n var orient = axisConfig.angularAxis.tickOrientation;\n if (orient == 'horizontal') return 'rotate(' + -angle + ' ' + rad + ' 0)'; else if (orient == 'radial') return angle < 270 && angle > 90 ? 'rotate(180 ' + rad + ' 0)' : null; else return 'rotate(' + (angle <= 180 && angle > 0 ? -90 : 90) + ' ' + rad + ' 0)';\n }\n }).style({\n 'text-anchor': 'middle',\n display: axisConfig.angularAxis.labelsVisible ? 'block' : 'none'\n }).text(function(d, i) {\n if (i % (axisConfig.minorTicks + 1) != 0) return '';\n if (ticks) {\n return ticks[d] + axisConfig.angularAxis.ticksSuffix;\n } else return d + axisConfig.angularAxis.ticksSuffix;\n }).style(fontStyle);\n if (axisConfig.angularAxis.rewriteTicks) ticksText.text(function(d, i) {\n if (i % (axisConfig.minorTicks + 1) != 0) return '';\n return axisConfig.angularAxis.rewriteTicks(this.textContent, i);\n });\n var rightmostTickEndX = d3.max(chartGroup.selectAll('.angular-tick text')[0].map(function(d, i) {\n return d.getCTM().e + d.getBBox().width;\n }));\n legendContainer.attr({\n transform: 'translate(' + [ radius + rightmostTickEndX, axisConfig.margin.top ] + ')'\n });\n var hasGeometry = svg.select('g.geometry-group').selectAll('g').size() > 0;\n var geometryContainer = svg.select('g.geometry-group').selectAll('g.geometry').data(data);\n geometryContainer.enter().append('g').attr({\n 'class': function(d, i) {\n return 'geometry geometry' + i;\n }\n });\n geometryContainer.exit().remove();\n if (data[0] || hasGeometry) {\n var geometryConfigs = [];\n data.forEach(function(d, i) {\n var geometryConfig = {};\n geometryConfig.radialScale = radialScale;\n geometryConfig.angularScale = angularScale;\n geometryConfig.container = geometryContainer.filter(function(dB, iB) {\n return iB == i;\n });\n geometryConfig.geometry = d.geometry;\n geometryConfig.orientation = axisConfig.orientation;\n geometryConfig.direction = axisConfig.direction;\n geometryConfig.index = i;\n geometryConfigs.push({\n data: d,\n geometryConfig: geometryConfig\n });\n });\n var geometryConfigsGrouped = d3.nest().key(function(d, i) {\n return typeof d.data.groupId != 'undefined' || 'unstacked';\n }).entries(geometryConfigs);\n var geometryConfigsGrouped2 = [];\n geometryConfigsGrouped.forEach(function(d, i) {\n if (d.key === 'unstacked') geometryConfigsGrouped2 = geometryConfigsGrouped2.concat(d.values.map(function(d, i) {\n return [ d ];\n })); else geometryConfigsGrouped2.push(d.values);\n });\n geometryConfigsGrouped2.forEach(function(d, i) {\n var geometry;\n if (Array.isArray(d)) geometry = d[0].geometryConfig.geometry; else geometry = d.geometryConfig.geometry;\n var finalGeometryConfig = d.map(function(dB, iB) {\n return extendDeepAll(µ[geometry].defaultConfig(), dB);\n });\n µ[geometry]().config(finalGeometryConfig)();\n });\n }\n var guides = svg.select('.guides-group');\n var tooltipContainer = svg.select('.tooltips-group');\n var angularTooltip = µ.tooltipPanel().config({\n container: tooltipContainer,\n fontSize: 8\n })();\n var radialTooltip = µ.tooltipPanel().config({\n container: tooltipContainer,\n fontSize: 8\n })();\n var geometryTooltip = µ.tooltipPanel().config({\n container: tooltipContainer,\n hasTick: true\n })();\n var angularValue, radialValue;\n if (!isOrdinal) {\n var angularGuideLine = guides.select('line').attr({\n x1: 0,\n y1: 0,\n y2: 0\n }).style({\n stroke: 'grey',\n 'pointer-events': 'none'\n });\n chartGroup.on('mousemove.angular-guide', function(d, i) {\n var mouseAngle = µ.util.getMousePos(backgroundCircle).angle;\n angularGuideLine.attr({\n x2: -radius,\n transform: 'rotate(' + mouseAngle + ')'\n }).style({\n opacity: .5\n });\n var angleWithOriginOffset = (mouseAngle + 180 + 360 - axisConfig.orientation) % 360;\n angularValue = angularScale.invert(angleWithOriginOffset);\n var pos = µ.util.convertToCartesian(radius + 12, mouseAngle + 180);\n angularTooltip.text(µ.util.round(angularValue)).move([ pos[0] + chartCenter[0], pos[1] + chartCenter[1] ]);\n }).on('mouseout.angular-guide', function(d, i) {\n guides.select('line').style({\n opacity: 0\n });\n });\n }\n var angularGuideCircle = guides.select('circle').style({\n stroke: 'grey',\n fill: 'none'\n });\n chartGroup.on('mousemove.radial-guide', function(d, i) {\n var r = µ.util.getMousePos(backgroundCircle).radius;\n angularGuideCircle.attr({\n r: r\n }).style({\n opacity: .5\n });\n radialValue = radialScale.invert(µ.util.getMousePos(backgroundCircle).radius);\n var pos = µ.util.convertToCartesian(r, axisConfig.radialAxis.orientation);\n radialTooltip.text(µ.util.round(radialValue)).move([ pos[0] + chartCenter[0], pos[1] + chartCenter[1] ]);\n }).on('mouseout.radial-guide', function(d, i) {\n angularGuideCircle.style({\n opacity: 0\n });\n geometryTooltip.hide();\n angularTooltip.hide();\n radialTooltip.hide();\n });\n svg.selectAll('.geometry-group .mark').on('mouseover.tooltip', function(d, i) {\n var el = d3.select(this);\n var color = this.style.fill;\n var newColor = 'black';\n var opacity = this.style.opacity || 1;\n el.attr({\n 'data-opacity': opacity\n });\n if (color && color !== 'none') {\n el.attr({\n 'data-fill': color\n });\n newColor = d3.hsl(color).darker().toString();\n el.style({\n fill: newColor,\n opacity: 1\n });\n var textData = {\n t: µ.util.round(d[0]),\n r: µ.util.round(d[1])\n };\n if (isOrdinal) textData.t = ticks[d[0]];\n var text = 't: ' + textData.t + ', r: ' + textData.r;\n var bbox = this.getBoundingClientRect();\n var svgBBox = svg.node().getBoundingClientRect();\n var pos = [ bbox.left + bbox.width / 2 - centeringOffset[0] - svgBBox.left, bbox.top + bbox.height / 2 - centeringOffset[1] - svgBBox.top ];\n geometryTooltip.config({\n color: newColor\n }).text(text);\n geometryTooltip.move(pos);\n } else {\n color = this.style.stroke || 'black';\n el.attr({\n 'data-stroke': color\n });\n newColor = d3.hsl(color).darker().toString();\n el.style({\n stroke: newColor,\n opacity: 1\n });\n }\n }).on('mousemove.tooltip', function(d, i) {\n if (d3.event.which != 0) return false;\n if (d3.select(this).attr('data-fill')) geometryTooltip.show();\n }).on('mouseout.tooltip', function(d, i) {\n geometryTooltip.hide();\n var el = d3.select(this);\n var fillColor = el.attr('data-fill');\n if (fillColor) el.style({\n fill: fillColor,\n opacity: el.attr('data-opacity')\n }); else el.style({\n stroke: el.attr('data-stroke'),\n opacity: el.attr('data-opacity')\n });\n });\n });\n return exports;\n }\n exports.render = function(_container) {\n render(_container);\n return this;\n };\n exports.config = function(_x) {\n if (!arguments.length) return config;\n var xClone = µ.util.cloneJson(_x);\n xClone.data.forEach(function(d, i) {\n if (!config.data[i]) config.data[i] = {};\n extendDeepAll(config.data[i], µ.Axis.defaultConfig().data[0]);\n extendDeepAll(config.data[i], d);\n });\n extendDeepAll(config.layout, µ.Axis.defaultConfig().layout);\n extendDeepAll(config.layout, xClone.layout);\n return this;\n };\n exports.getLiveConfig = function() {\n return liveConfig;\n };\n exports.getinputConfig = function() {\n return inputConfig;\n };\n exports.radialScale = function(_x) {\n return radialScale;\n };\n exports.angularScale = function(_x) {\n return angularScale;\n };\n exports.svg = function() {\n return svg;\n };\n d3.rebind(exports, dispatch, 'on');\n return exports;\n};\n\nµ.Axis.defaultConfig = function(d, i) {\n var config = {\n data: [ {\n t: [ 1, 2, 3, 4 ],\n r: [ 10, 11, 12, 13 ],\n name: 'Line1',\n geometry: 'LinePlot',\n color: null,\n strokeDash: 'solid',\n strokeColor: null,\n strokeSize: '1',\n visibleInLegend: true,\n opacity: 1\n } ],\n layout: {\n defaultColorRange: d3.scale.category10().range(),\n title: null,\n height: 450,\n width: 500,\n margin: {\n top: 40,\n right: 40,\n bottom: 40,\n left: 40\n },\n font: {\n size: 12,\n color: 'gray',\n outlineColor: 'white',\n family: 'Tahoma, sans-serif'\n },\n direction: 'clockwise',\n orientation: 0,\n labelOffset: 10,\n radialAxis: {\n domain: null,\n orientation: -45,\n ticksSuffix: '',\n visible: true,\n gridLinesVisible: true,\n tickOrientation: 'horizontal',\n rewriteTicks: null\n },\n angularAxis: {\n domain: [ 0, 360 ],\n ticksSuffix: '',\n visible: true,\n gridLinesVisible: true,\n labelsVisible: true,\n tickOrientation: 'horizontal',\n rewriteTicks: null,\n ticksCount: null,\n ticksStep: null\n },\n minorTicks: 0,\n tickLength: null,\n tickColor: 'silver',\n minorTickColor: '#eee',\n backgroundColor: 'none',\n needsEndSpacing: null,\n showLegend: true,\n legend: {\n reverseOrder: false\n },\n opacity: 1\n }\n };\n return config;\n};\n\nµ.util = {};\n\nµ.DATAEXTENT = 'dataExtent';\n\nµ.AREA = 'AreaChart';\n\nµ.LINE = 'LinePlot';\n\nµ.DOT = 'DotPlot';\n\nµ.BAR = 'BarChart';\n\nµ.util._override = function(_objA, _objB) {\n for (var x in _objA) if (x in _objB) _objB[x] = _objA[x];\n};\n\nµ.util._extend = function(_objA, _objB) {\n for (var x in _objA) _objB[x] = _objA[x];\n};\n\nµ.util._rndSnd = function() {\n return Math.random() * 2 - 1 + (Math.random() * 2 - 1) + (Math.random() * 2 - 1);\n};\n\nµ.util.dataFromEquation2 = function(_equation, _step) {\n var step = _step || 6;\n var data = d3.range(0, 360 + step, step).map(function(deg, index) {\n var theta = deg * Math.PI / 180;\n var radius = _equation(theta);\n return [ deg, radius ];\n });\n return data;\n};\n\nµ.util.dataFromEquation = function(_equation, _step, _name) {\n var step = _step || 6;\n var t = [], r = [];\n d3.range(0, 360 + step, step).forEach(function(deg, index) {\n var theta = deg * Math.PI / 180;\n var radius = _equation(theta);\n t.push(deg);\n r.push(radius);\n });\n var result = {\n t: t,\n r: r\n };\n if (_name) result.name = _name;\n return result;\n};\n\nµ.util.ensureArray = function(_val, _count) {\n if (typeof _val === 'undefined') return null;\n var arr = [].concat(_val);\n return d3.range(_count).map(function(d, i) {\n return arr[i] || arr[0];\n });\n};\n\nµ.util.fillArrays = function(_obj, _valueNames, _count) {\n _valueNames.forEach(function(d, i) {\n _obj[d] = µ.util.ensureArray(_obj[d], _count);\n });\n return _obj;\n};\n\nµ.util.cloneJson = function(json) {\n return JSON.parse(JSON.stringify(json));\n};\n\nµ.util.validateKeys = function(obj, keys) {\n if (typeof keys === 'string') keys = keys.split('.');\n var next = keys.shift();\n return obj[next] && (!keys.length || objHasKeys(obj[next], keys));\n};\n\nµ.util.sumArrays = function(a, b) {\n return d3.zip(a, b).map(function(d, i) {\n return d3.sum(d);\n });\n};\n\nµ.util.arrayLast = function(a) {\n return a[a.length - 1];\n};\n\nµ.util.arrayEqual = function(a, b) {\n var i = Math.max(a.length, b.length, 1);\n while (i-- >= 0 && a[i] === b[i]) ;\n return i === -2;\n};\n\nµ.util.flattenArray = function(arr) {\n var r = [];\n while (!µ.util.arrayEqual(r, arr)) {\n r = arr;\n arr = [].concat.apply([], arr);\n }\n return arr;\n};\n\nµ.util.deduplicate = function(arr) {\n return arr.filter(function(v, i, a) {\n return a.indexOf(v) == i;\n });\n};\n\nµ.util.convertToCartesian = function(radius, theta) {\n var thetaRadians = theta * Math.PI / 180;\n var x = radius * Math.cos(thetaRadians);\n var y = radius * Math.sin(thetaRadians);\n return [ x, y ];\n};\n\nµ.util.round = function(_value, _digits) {\n var digits = _digits || 2;\n var mult = Math.pow(10, digits);\n return Math.round(_value * mult) / mult;\n};\n\nµ.util.getMousePos = function(_referenceElement) {\n var mousePos = d3.mouse(_referenceElement.node());\n var mouseX = mousePos[0];\n var mouseY = mousePos[1];\n var mouse = {};\n mouse.x = mouseX;\n mouse.y = mouseY;\n mouse.pos = mousePos;\n mouse.angle = (Math.atan2(mouseY, mouseX) + Math.PI) * 180 / Math.PI;\n mouse.radius = Math.sqrt(mouseX * mouseX + mouseY * mouseY);\n return mouse;\n};\n\nµ.util.duplicatesCount = function(arr) {\n var uniques = {}, val;\n var dups = {};\n for (var i = 0, len = arr.length; i < len; i++) {\n val = arr[i];\n if (val in uniques) {\n uniques[val]++;\n dups[val] = uniques[val];\n } else {\n uniques[val] = 1;\n }\n }\n return dups;\n};\n\nµ.util.duplicates = function(arr) {\n return Object.keys(µ.util.duplicatesCount(arr));\n};\n\nµ.util.translator = function(obj, sourceBranch, targetBranch, reverse) {\n if (reverse) {\n var targetBranchCopy = targetBranch.slice();\n targetBranch = sourceBranch;\n sourceBranch = targetBranchCopy;\n }\n var value = sourceBranch.reduce(function(previousValue, currentValue) {\n if (typeof previousValue != 'undefined') return previousValue[currentValue];\n }, obj);\n if (typeof value === 'undefined') return;\n sourceBranch.reduce(function(previousValue, currentValue, index) {\n if (typeof previousValue == 'undefined') return;\n if (index === sourceBranch.length - 1) delete previousValue[currentValue];\n return previousValue[currentValue];\n }, obj);\n targetBranch.reduce(function(previousValue, currentValue, index) {\n if (typeof previousValue[currentValue] === 'undefined') previousValue[currentValue] = {};\n if (index === targetBranch.length - 1) previousValue[currentValue] = value;\n return previousValue[currentValue];\n }, obj);\n};\n\nµ.PolyChart = function module() {\n var config = [ µ.PolyChart.defaultConfig() ];\n var dispatch = d3.dispatch('hover');\n var dashArray = {\n solid: 'none',\n dash: [ 5, 2 ],\n dot: [ 2, 5 ]\n };\n var colorScale;\n function exports() {\n var geometryConfig = config[0].geometryConfig;\n var container = geometryConfig.container;\n if (typeof container == 'string') container = d3.select(container);\n container.datum(config).each(function(_config, _index) {\n var isStack = !!_config[0].data.yStack;\n var data = _config.map(function(d, i) {\n if (isStack) return d3.zip(d.data.t[0], d.data.r[0], d.data.yStack[0]); else return d3.zip(d.data.t[0], d.data.r[0]);\n });\n var angularScale = geometryConfig.angularScale;\n var domainMin = geometryConfig.radialScale.domain()[0];\n var generator = {};\n generator.bar = function(d, i, pI) {\n var dataConfig = _config[pI].data;\n var h = geometryConfig.radialScale(d[1]) - geometryConfig.radialScale(0);\n var stackTop = geometryConfig.radialScale(d[2] || 0);\n var w = dataConfig.barWidth;\n d3.select(this).attr({\n 'class': 'mark bar',\n d: 'M' + [ [ h + stackTop, -w / 2 ], [ h + stackTop, w / 2 ], [ stackTop, w / 2 ], [ stackTop, -w / 2 ] ].join('L') + 'Z',\n transform: function(d, i) {\n return 'rotate(' + (geometryConfig.orientation + angularScale(d[0])) + ')';\n }\n });\n };\n generator.dot = function(d, i, pI) {\n var stackedData = d[2] ? [ d[0], d[1] + d[2] ] : d;\n var symbol = d3.svg.symbol().size(_config[pI].data.dotSize).type(_config[pI].data.dotType)(d, i);\n d3.select(this).attr({\n 'class': 'mark dot',\n d: symbol,\n transform: function(d, i) {\n var coord = convertToCartesian(getPolarCoordinates(stackedData));\n return 'translate(' + [ coord.x, coord.y ] + ')';\n }\n });\n };\n var line = d3.svg.line.radial().interpolate(_config[0].data.lineInterpolation).radius(function(d) {\n return geometryConfig.radialScale(d[1]);\n }).angle(function(d) {\n return geometryConfig.angularScale(d[0]) * Math.PI / 180;\n });\n generator.line = function(d, i, pI) {\n var lineData = d[2] ? data[pI].map(function(d, i) {\n return [ d[0], d[1] + d[2] ];\n }) : data[pI];\n d3.select(this).each(generator['dot']).style({\n opacity: function(dB, iB) {\n return +_config[pI].data.dotVisible;\n },\n fill: markStyle.stroke(d, i, pI)\n }).attr({\n 'class': 'mark dot'\n });\n if (i > 0) return;\n var lineSelection = d3.select(this.parentNode).selectAll('path.line').data([ 0 ]);\n lineSelection.enter().insert('path');\n lineSelection.attr({\n 'class': 'line',\n d: line(lineData),\n transform: function(dB, iB) {\n return 'rotate(' + (geometryConfig.orientation + 90) + ')';\n },\n 'pointer-events': 'none'\n }).style({\n fill: function(dB, iB) {\n return markStyle.fill(d, i, pI);\n },\n 'fill-opacity': 0,\n stroke: function(dB, iB) {\n return markStyle.stroke(d, i, pI);\n },\n 'stroke-width': function(dB, iB) {\n return markStyle['stroke-width'](d, i, pI);\n },\n 'stroke-dasharray': function(dB, iB) {\n return markStyle['stroke-dasharray'](d, i, pI);\n },\n opacity: function(dB, iB) {\n return markStyle.opacity(d, i, pI);\n },\n display: function(dB, iB) {\n return markStyle.display(d, i, pI);\n }\n });\n };\n var angularRange = geometryConfig.angularScale.range();\n var triangleAngle = Math.abs(angularRange[1] - angularRange[0]) / data[0].length * Math.PI / 180;\n var arc = d3.svg.arc().startAngle(function(d) {\n return -triangleAngle / 2;\n }).endAngle(function(d) {\n return triangleAngle / 2;\n }).innerRadius(function(d) {\n return geometryConfig.radialScale(domainMin + (d[2] || 0));\n }).outerRadius(function(d) {\n return geometryConfig.radialScale(domainMin + (d[2] || 0)) + geometryConfig.radialScale(d[1]);\n });\n generator.arc = function(d, i, pI) {\n d3.select(this).attr({\n 'class': 'mark arc',\n d: arc,\n transform: function(d, i) {\n return 'rotate(' + (geometryConfig.orientation + angularScale(d[0]) + 90) + ')';\n }\n });\n };\n var markStyle = {\n fill: function(d, i, pI) {\n return _config[pI].data.color;\n },\n stroke: function(d, i, pI) {\n return _config[pI].data.strokeColor;\n },\n 'stroke-width': function(d, i, pI) {\n return _config[pI].data.strokeSize + 'px';\n },\n 'stroke-dasharray': function(d, i, pI) {\n return dashArray[_config[pI].data.strokeDash];\n },\n opacity: function(d, i, pI) {\n return _config[pI].data.opacity;\n },\n display: function(d, i, pI) {\n return typeof _config[pI].data.visible === 'undefined' || _config[pI].data.visible ? 'block' : 'none';\n }\n };\n var geometryLayer = d3.select(this).selectAll('g.layer').data(data);\n geometryLayer.enter().append('g').attr({\n 'class': 'layer'\n });\n var geometry = geometryLayer.selectAll('path.mark').data(function(d, i) {\n return d;\n });\n geometry.enter().append('path').attr({\n 'class': 'mark'\n });\n geometry.style(markStyle).each(generator[geometryConfig.geometryType]);\n geometry.exit().remove();\n geometryLayer.exit().remove();\n function getPolarCoordinates(d, i) {\n var r = geometryConfig.radialScale(d[1]);\n var t = (geometryConfig.angularScale(d[0]) + geometryConfig.orientation) * Math.PI / 180;\n return {\n r: r,\n t: t\n };\n }\n function convertToCartesian(polarCoordinates) {\n var x = polarCoordinates.r * Math.cos(polarCoordinates.t);\n var y = polarCoordinates.r * Math.sin(polarCoordinates.t);\n return {\n x: x,\n y: y\n };\n }\n });\n }\n exports.config = function(_x) {\n if (!arguments.length) return config;\n _x.forEach(function(d, i) {\n if (!config[i]) config[i] = {};\n extendDeepAll(config[i], µ.PolyChart.defaultConfig());\n extendDeepAll(config[i], d);\n });\n return this;\n };\n exports.getColorScale = function() {\n return colorScale;\n };\n d3.rebind(exports, dispatch, 'on');\n return exports;\n};\n\nµ.PolyChart.defaultConfig = function() {\n var config = {\n data: {\n name: 'geom1',\n t: [ [ 1, 2, 3, 4 ] ],\n r: [ [ 1, 2, 3, 4 ] ],\n dotType: 'circle',\n dotSize: 64,\n dotVisible: false,\n barWidth: 20,\n color: '#ffa500',\n strokeSize: 1,\n strokeColor: 'silver',\n strokeDash: 'solid',\n opacity: 1,\n index: 0,\n visible: true,\n visibleInLegend: true\n },\n geometryConfig: {\n geometry: 'LinePlot',\n geometryType: 'arc',\n direction: 'clockwise',\n orientation: 0,\n container: 'body',\n radialScale: null,\n angularScale: null,\n colorScale: d3.scale.category20()\n }\n };\n return config;\n};\n\nµ.BarChart = function module() {\n return µ.PolyChart();\n};\n\nµ.BarChart.defaultConfig = function() {\n var config = {\n geometryConfig: {\n geometryType: 'bar'\n }\n };\n return config;\n};\n\nµ.AreaChart = function module() {\n return µ.PolyChart();\n};\n\nµ.AreaChart.defaultConfig = function() {\n var config = {\n geometryConfig: {\n geometryType: 'arc'\n }\n };\n return config;\n};\n\nµ.DotPlot = function module() {\n return µ.PolyChart();\n};\n\nµ.DotPlot.defaultConfig = function() {\n var config = {\n geometryConfig: {\n geometryType: 'dot',\n dotType: 'circle'\n }\n };\n return config;\n};\n\nµ.LinePlot = function module() {\n return µ.PolyChart();\n};\n\nµ.LinePlot.defaultConfig = function() {\n var config = {\n geometryConfig: {\n geometryType: 'line'\n }\n };\n return config;\n};\n\nµ.Legend = function module() {\n var config = µ.Legend.defaultConfig();\n var dispatch = d3.dispatch('hover');\n function exports() {\n var legendConfig = config.legendConfig;\n var flattenData = config.data.map(function(d, i) {\n return [].concat(d).map(function(dB, iB) {\n var element = extendDeepAll({}, legendConfig.elements[i]);\n element.name = dB;\n element.color = [].concat(legendConfig.elements[i].color)[iB];\n return element;\n });\n });\n var data = d3.merge(flattenData);\n data = data.filter(function(d, i) {\n return legendConfig.elements[i] && (legendConfig.elements[i].visibleInLegend || typeof legendConfig.elements[i].visibleInLegend === 'undefined');\n });\n if (legendConfig.reverseOrder) data = data.reverse();\n var container = legendConfig.container;\n if (typeof container == 'string' || container.nodeName) container = d3.select(container);\n var colors = data.map(function(d, i) {\n return d.color;\n });\n var lineHeight = legendConfig.fontSize;\n var isContinuous = legendConfig.isContinuous == null ? typeof data[0] === 'number' : legendConfig.isContinuous;\n var height = isContinuous ? legendConfig.height : lineHeight * data.length;\n var legendContainerGroup = container.classed('legend-group', true);\n var svg = legendContainerGroup.selectAll('svg').data([ 0 ]);\n var svgEnter = svg.enter().append('svg').attr({\n width: 300,\n height: height + lineHeight,\n xmlns: 'http://www.w3.org/2000/svg',\n 'xmlns:xlink': 'http://www.w3.org/1999/xlink',\n version: '1.1'\n });\n svgEnter.append('g').classed('legend-axis', true);\n svgEnter.append('g').classed('legend-marks', true);\n var dataNumbered = d3.range(data.length);\n var colorScale = d3.scale[isContinuous ? 'linear' : 'ordinal']().domain(dataNumbered).range(colors);\n var dataScale = d3.scale[isContinuous ? 'linear' : 'ordinal']().domain(dataNumbered)[isContinuous ? 'range' : 'rangePoints']([ 0, height ]);\n var shapeGenerator = function(_type, _size) {\n var squareSize = _size * 3;\n if (_type === 'line') {\n return 'M' + [ [ -_size / 2, -_size / 12 ], [ _size / 2, -_size / 12 ], [ _size / 2, _size / 12 ], [ -_size / 2, _size / 12 ] ] + 'Z';\n } else if (d3.svg.symbolTypes.indexOf(_type) != -1) return d3.svg.symbol().type(_type).size(squareSize)(); else return d3.svg.symbol().type('square').size(squareSize)();\n };\n if (isContinuous) {\n var gradient = svg.select('.legend-marks').append('defs').append('linearGradient').attr({\n id: 'grad1',\n x1: '0%',\n y1: '0%',\n x2: '0%',\n y2: '100%'\n }).selectAll('stop').data(colors);\n gradient.enter().append('stop');\n gradient.attr({\n offset: function(d, i) {\n return i / (colors.length - 1) * 100 + '%';\n }\n }).style({\n 'stop-color': function(d, i) {\n return d;\n }\n });\n svg.append('rect').classed('legend-mark', true).attr({\n height: legendConfig.height,\n width: legendConfig.colorBandWidth,\n fill: 'url(#grad1)'\n });\n } else {\n var legendElement = svg.select('.legend-marks').selectAll('path.legend-mark').data(data);\n legendElement.enter().append('path').classed('legend-mark', true);\n legendElement.attr({\n transform: function(d, i) {\n return 'translate(' + [ lineHeight / 2, dataScale(i) + lineHeight / 2 ] + ')';\n },\n d: function(d, i) {\n var symbolType = d.symbol;\n return shapeGenerator(symbolType, lineHeight);\n },\n fill: function(d, i) {\n return colorScale(i);\n }\n });\n legendElement.exit().remove();\n }\n var legendAxis = d3.svg.axis().scale(dataScale).orient('right');\n var axis = svg.select('g.legend-axis').attr({\n transform: 'translate(' + [ isContinuous ? legendConfig.colorBandWidth : lineHeight, lineHeight / 2 ] + ')'\n }).call(legendAxis);\n axis.selectAll('.domain').style({\n fill: 'none',\n stroke: 'none'\n });\n axis.selectAll('line').style({\n fill: 'none',\n stroke: isContinuous ? legendConfig.textColor : 'none'\n });\n axis.selectAll('text').style({\n fill: legendConfig.textColor,\n 'font-size': legendConfig.fontSize\n }).text(function(d, i) {\n return data[i].name;\n });\n return exports;\n }\n exports.config = function(_x) {\n if (!arguments.length) return config;\n extendDeepAll(config, _x);\n return this;\n };\n d3.rebind(exports, dispatch, 'on');\n return exports;\n};\n\nµ.Legend.defaultConfig = function(d, i) {\n var config = {\n data: [ 'a', 'b', 'c' ],\n legendConfig: {\n elements: [ {\n symbol: 'line',\n color: 'red'\n }, {\n symbol: 'square',\n color: 'yellow'\n }, {\n symbol: 'diamond',\n color: 'limegreen'\n } ],\n height: 150,\n colorBandWidth: 30,\n fontSize: 12,\n container: 'body',\n isContinuous: null,\n textColor: 'grey',\n reverseOrder: false\n }\n };\n return config;\n};\n\nµ.tooltipPanel = function() {\n var tooltipEl, tooltipTextEl, backgroundEl;\n var config = {\n container: null,\n hasTick: false,\n fontSize: 12,\n color: 'white',\n padding: 5\n };\n var id = 'tooltip-' + µ.tooltipPanel.uid++;\n var tickSize = 10;\n var exports = function() {\n tooltipEl = config.container.selectAll('g.' + id).data([ 0 ]);\n var tooltipEnter = tooltipEl.enter().append('g').classed(id, true).style({\n 'pointer-events': 'none',\n display: 'none'\n });\n backgroundEl = tooltipEnter.append('path').style({\n fill: 'white',\n 'fill-opacity': .9\n }).attr({\n d: 'M0 0'\n });\n tooltipTextEl = tooltipEnter.append('text').attr({\n dx: config.padding + tickSize,\n dy: +config.fontSize * .3\n });\n return exports;\n };\n exports.text = function(_text) {\n var l = d3.hsl(config.color).l;\n var strokeColor = l >= .5 ? '#aaa' : 'white';\n var fillColor = l >= .5 ? 'black' : 'white';\n var text = _text || '';\n tooltipTextEl.style({\n fill: fillColor,\n 'font-size': config.fontSize + 'px'\n }).text(text);\n var padding = config.padding;\n var bbox = tooltipTextEl.node().getBBox();\n var boxStyle = {\n fill: config.color,\n stroke: strokeColor,\n 'stroke-width': '2px'\n };\n var backGroundW = bbox.width + padding * 2 + tickSize;\n var backGroundH = bbox.height + padding * 2;\n backgroundEl.attr({\n d: 'M' + [ [ tickSize, -backGroundH / 2 ], [ tickSize, -backGroundH / 4 ], [ config.hasTick ? 0 : tickSize, 0 ], [ tickSize, backGroundH / 4 ], [ tickSize, backGroundH / 2 ], [ backGroundW, backGroundH / 2 ], [ backGroundW, -backGroundH / 2 ] ].join('L') + 'Z'\n }).style(boxStyle);\n tooltipEl.attr({\n transform: 'translate(' + [ tickSize, -backGroundH / 2 + padding * 2 ] + ')'\n });\n tooltipEl.style({\n display: 'block'\n });\n return exports;\n };\n exports.move = function(_pos) {\n if (!tooltipEl) return;\n tooltipEl.attr({\n transform: 'translate(' + [ _pos[0], _pos[1] ] + ')'\n }).style({\n display: 'block'\n });\n return exports;\n };\n exports.hide = function() {\n if (!tooltipEl) return;\n tooltipEl.style({\n display: 'none'\n });\n return exports;\n };\n exports.show = function() {\n if (!tooltipEl) return;\n tooltipEl.style({\n display: 'block'\n });\n return exports;\n };\n exports.config = function(_x) {\n extendDeepAll(config, _x);\n return exports;\n };\n return exports;\n};\n\nµ.tooltipPanel.uid = 1;\n\nµ.adapter = {};\n\nµ.adapter.plotly = function module() {\n var exports = {};\n exports.convert = function(_inputConfig, reverse) {\n var outputConfig = {};\n if (_inputConfig.data) {\n outputConfig.data = _inputConfig.data.map(function(d, i) {\n var r = extendDeepAll({}, d);\n var toTranslate = [\n [ r, [ 'marker', 'color' ], [ 'color' ] ],\n [ r, [ 'marker', 'opacity' ], [ 'opacity' ] ],\n [ r, [ 'marker', 'line', 'color' ], [ 'strokeColor' ] ],\n [ r, [ 'marker', 'line', 'dash' ], [ 'strokeDash' ] ],\n [ r, [ 'marker', 'line', 'width' ], [ 'strokeSize' ] ],\n [ r, [ 'marker', 'symbol' ], [ 'dotType' ] ],\n [ r, [ 'marker', 'size' ], [ 'dotSize' ] ],\n [ r, [ 'marker', 'barWidth' ], [ 'barWidth' ] ],\n [ r, [ 'line', 'interpolation' ], [ 'lineInterpolation' ] ],\n [ r, [ 'showlegend' ], [ 'visibleInLegend' ] ]\n ];\n toTranslate.forEach(function(d, i) {\n µ.util.translator.apply(null, d.concat(reverse));\n });\n\n if (!reverse) delete r.marker;\n if (reverse) delete r.groupId;\n if (!reverse) {\n if (r.type === 'scatter') {\n if (r.mode === 'lines') r.geometry = 'LinePlot'; else if (r.mode === 'markers') r.geometry = 'DotPlot'; else if (r.mode === 'lines+markers') {\n r.geometry = 'LinePlot';\n r.dotVisible = true;\n }\n } else if (r.type === 'area') r.geometry = 'AreaChart'; else if (r.type === 'bar') r.geometry = 'BarChart';\n delete r.mode;\n delete r.type;\n } else {\n if (r.geometry === 'LinePlot') {\n r.type = 'scatter';\n if (r.dotVisible === true) {\n delete r.dotVisible;\n r.mode = 'lines+markers';\n } else r.mode = 'lines';\n } else if (r.geometry === 'DotPlot') {\n r.type = 'scatter';\n r.mode = 'markers';\n } else if (r.geometry === 'AreaChart') r.type = 'area'; else if (r.geometry === 'BarChart') r.type = 'bar';\n delete r.geometry;\n }\n return r;\n });\n if (!reverse && _inputConfig.layout && _inputConfig.layout.barmode === 'stack') {\n var duplicates = µ.util.duplicates(outputConfig.data.map(function(d, i) {\n return d.geometry;\n }));\n outputConfig.data.forEach(function(d, i) {\n var idx = duplicates.indexOf(d.geometry);\n if (idx != -1) outputConfig.data[i].groupId = idx;\n });\n }\n }\n if (_inputConfig.layout) {\n var r = extendDeepAll({}, _inputConfig.layout);\n var toTranslate = [\n [ r, [ 'plot_bgcolor' ], [ 'backgroundColor' ] ],\n [ r, [ 'showlegend' ], [ 'showLegend' ] ],\n [ r, [ 'radialaxis' ], [ 'radialAxis' ] ],\n [ r, [ 'angularaxis' ], [ 'angularAxis' ] ],\n [ r.angularaxis, [ 'showline' ], [ 'gridLinesVisible' ] ],\n [ r.angularaxis, [ 'showticklabels' ], [ 'labelsVisible' ] ],\n [ r.angularaxis, [ 'nticks' ], [ 'ticksCount' ] ],\n [ r.angularaxis, [ 'tickorientation' ], [ 'tickOrientation' ] ],\n [ r.angularaxis, [ 'ticksuffix' ], [ 'ticksSuffix' ] ],\n [ r.angularaxis, [ 'range' ], [ 'domain' ] ],\n [ r.angularaxis, [ 'endpadding' ], [ 'endPadding' ] ],\n [ r.radialaxis, [ 'showline' ], [ 'gridLinesVisible' ] ],\n [ r.radialaxis, [ 'tickorientation' ], [ 'tickOrientation' ] ],\n [ r.radialaxis, [ 'ticksuffix' ], [ 'ticksSuffix' ] ],\n [ r.radialaxis, [ 'range' ], [ 'domain' ] ],\n [ r.angularAxis, [ 'showline' ], [ 'gridLinesVisible' ] ],\n [ r.angularAxis, [ 'showticklabels' ], [ 'labelsVisible' ] ],\n [ r.angularAxis, [ 'nticks' ], [ 'ticksCount' ] ],\n [ r.angularAxis, [ 'tickorientation' ], [ 'tickOrientation' ] ],\n [ r.angularAxis, [ 'ticksuffix' ], [ 'ticksSuffix' ] ],\n [ r.angularAxis, [ 'range' ], [ 'domain' ] ],\n [ r.angularAxis, [ 'endpadding' ], [ 'endPadding' ] ],\n [ r.radialAxis, [ 'showline' ], [ 'gridLinesVisible' ] ],\n [ r.radialAxis, [ 'tickorientation' ], [ 'tickOrientation' ] ],\n [ r.radialAxis, [ 'ticksuffix' ], [ 'ticksSuffix' ] ],\n [ r.radialAxis, [ 'range' ], [ 'domain' ] ],\n [ r.font, [ 'outlinecolor' ], [ 'outlineColor' ] ],\n [ r.legend, [ 'traceorder' ], [ 'reverseOrder' ] ],\n [ r, [ 'labeloffset' ], [ 'labelOffset' ] ],\n [ r, [ 'defaultcolorrange' ], [ 'defaultColorRange' ] ]\n ];\n toTranslate.forEach(function(d, i) {\n µ.util.translator.apply(null, d.concat(reverse));\n });\n\n if (!reverse) {\n if (r.angularAxis && typeof r.angularAxis.ticklen !== 'undefined') r.tickLength = r.angularAxis.ticklen;\n if (r.angularAxis && typeof r.angularAxis.tickcolor !== 'undefined') r.tickColor = r.angularAxis.tickcolor;\n } else {\n if (typeof r.tickLength !== 'undefined') {\n r.angularaxis.ticklen = r.tickLength;\n delete r.tickLength;\n }\n if (r.tickColor) {\n r.angularaxis.tickcolor = r.tickColor;\n delete r.tickColor;\n }\n }\n if (r.legend && typeof r.legend.reverseOrder != 'boolean') {\n r.legend.reverseOrder = r.legend.reverseOrder != 'normal';\n }\n if (r.legend && typeof r.legend.traceorder == 'boolean') {\n r.legend.traceorder = r.legend.traceorder ? 'reversed' : 'normal';\n delete r.legend.reverseOrder;\n }\n if (r.margin && typeof r.margin.t != 'undefined') {\n var source = [ 't', 'r', 'b', 'l', 'pad' ];\n var target = [ 'top', 'right', 'bottom', 'left', 'pad' ];\n var margin = {};\n d3.entries(r.margin).forEach(function(dB, iB) {\n margin[target[source.indexOf(dB.key)]] = dB.value;\n });\n r.margin = margin;\n }\n if (reverse) {\n delete r.needsEndSpacing;\n delete r.minorTickColor;\n delete r.minorTicks;\n delete r.angularaxis.ticksCount;\n delete r.angularaxis.ticksCount;\n delete r.angularaxis.ticksStep;\n delete r.angularaxis.rewriteTicks;\n delete r.angularaxis.nticks;\n delete r.radialaxis.ticksCount;\n delete r.radialaxis.ticksCount;\n delete r.radialaxis.ticksStep;\n delete r.radialaxis.rewriteTicks;\n delete r.radialaxis.nticks;\n }\n outputConfig.layout = r;\n }\n return outputConfig;\n };\n return exports;\n};\n\n},{\"../../../constants/alignment\":697,\"../../../lib\":728,\"d3\":164}],849:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n/* eslint-disable new-cap */\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Lib = _dereq_('../../../lib');\nvar Color = _dereq_('../../../components/color');\n\nvar micropolar = _dereq_('./micropolar');\nvar UndoManager = _dereq_('./undo_manager');\nvar extendDeepAll = Lib.extendDeepAll;\n\nvar manager = module.exports = {};\n\nmanager.framework = function(_gd) {\n var config, previousConfigClone, plot, convertedInput, container;\n var undoManager = new UndoManager();\n\n function exports(_inputConfig, _container) {\n if(_container) container = _container;\n d3.select(d3.select(container).node().parentNode).selectAll('.svg-container>*:not(.chart-root)').remove();\n\n config = (!config) ?\n _inputConfig :\n extendDeepAll(config, _inputConfig);\n\n if(!plot) plot = micropolar.Axis();\n convertedInput = micropolar.adapter.plotly().convert(config);\n plot.config(convertedInput).render(container);\n _gd.data = config.data;\n _gd.layout = config.layout;\n manager.fillLayout(_gd);\n return config;\n }\n exports.isPolar = true;\n exports.svg = function() { return plot.svg(); };\n exports.getConfig = function() { return config; };\n exports.getLiveConfig = function() {\n return micropolar.adapter.plotly().convert(plot.getLiveConfig(), true);\n };\n exports.getLiveScales = function() { return {t: plot.angularScale(), r: plot.radialScale()}; };\n exports.setUndoPoint = function() {\n var that = this;\n var configClone = micropolar.util.cloneJson(config);\n (function(_configClone, _previousConfigClone) {\n undoManager.add({\n undo: function() {\n if(_previousConfigClone) that(_previousConfigClone);\n },\n redo: function() {\n that(_configClone);\n }\n });\n })(configClone, previousConfigClone);\n previousConfigClone = micropolar.util.cloneJson(configClone);\n };\n exports.undo = function() { undoManager.undo(); };\n exports.redo = function() { undoManager.redo(); };\n return exports;\n};\n\nmanager.fillLayout = function(_gd) {\n var container = d3.select(_gd).selectAll('.plot-container');\n var paperDiv = container.selectAll('.svg-container');\n var paper = _gd.framework && _gd.framework.svg && _gd.framework.svg();\n var dflts = {\n width: 800,\n height: 600,\n paper_bgcolor: Color.background,\n _container: container,\n _paperdiv: paperDiv,\n _paper: paper\n };\n\n _gd._fullLayout = extendDeepAll(dflts, _gd.layout);\n};\n\n},{\"../../../components/color\":595,\"../../../lib\":728,\"./micropolar\":848,\"./undo_manager\":850,\"d3\":164}],850:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n// Modified from https://github.com/ArthurClemens/Javascript-Undo-Manager\n// Copyright (c) 2010-2013 Arthur Clemens, arthur@visiblearea.com\nmodule.exports = function UndoManager() {\n var undoCommands = [];\n var index = -1;\n var isExecuting = false;\n var callback;\n\n function execute(command, action) {\n if(!command) return this;\n\n isExecuting = true;\n command[action]();\n isExecuting = false;\n\n return this;\n }\n\n return {\n add: function(command) {\n if(isExecuting) return this;\n undoCommands.splice(index + 1, undoCommands.length - index);\n undoCommands.push(command);\n index = undoCommands.length - 1;\n return this;\n },\n setCallback: function(callbackFunc) { callback = callbackFunc; },\n undo: function() {\n var command = undoCommands[index];\n if(!command) return this;\n execute(command, 'undo');\n index -= 1;\n if(callback) callback(command.undo);\n return this;\n },\n redo: function() {\n var command = undoCommands[index + 1];\n if(!command) return this;\n execute(command, 'redo');\n index += 1;\n if(callback) callback(command.redo);\n return this;\n },\n clear: function() {\n undoCommands = [];\n index = -1;\n },\n hasUndo: function() { return index !== -1; },\n hasRedo: function() { return index < (undoCommands.length - 1); },\n getCommands: function() { return undoCommands; },\n getPreviousCommand: function() { return undoCommands[index - 1]; },\n getIndex: function() { return index; }\n };\n};\n\n},{}],851:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar tinycolor = _dereq_('tinycolor2');\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\nvar Color = _dereq_('../../components/color');\nvar Drawing = _dereq_('../../components/drawing');\nvar Plots = _dereq_('../plots');\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar setConvertCartesian = _dereq_('../cartesian/set_convert');\nvar setConvertPolar = _dereq_('./set_convert');\nvar doAutoRange = _dereq_('../cartesian/autorange').doAutoRange;\nvar dragBox = _dereq_('../cartesian/dragbox');\nvar dragElement = _dereq_('../../components/dragelement');\nvar Fx = _dereq_('../../components/fx');\nvar Titles = _dereq_('../../components/titles');\nvar prepSelect = _dereq_('../cartesian/select').prepSelect;\nvar selectOnClick = _dereq_('../cartesian/select').selectOnClick;\nvar clearSelect = _dereq_('../cartesian/select').clearSelect;\nvar setCursor = _dereq_('../../lib/setcursor');\nvar clearGlCanvases = _dereq_('../../lib/clear_gl_canvases');\nvar redrawReglTraces = _dereq_('../../plot_api/subroutines').redrawReglTraces;\n\nvar MID_SHIFT = _dereq_('../../constants/alignment').MID_SHIFT;\nvar constants = _dereq_('./constants');\nvar helpers = _dereq_('./helpers');\n\nvar _ = Lib._;\nvar mod = Lib.mod;\nvar deg2rad = Lib.deg2rad;\nvar rad2deg = Lib.rad2deg;\n\nfunction Polar(gd, id) {\n this.id = id;\n this.gd = gd;\n\n this._hasClipOnAxisFalse = null;\n this.vangles = null;\n this.radialAxisAngle = null;\n this.traceHash = {};\n this.layers = {};\n this.clipPaths = {};\n this.clipIds = {};\n this.viewInitial = {};\n\n var fullLayout = gd._fullLayout;\n var clipIdBase = 'clip' + fullLayout._uid + id;\n\n this.clipIds.forTraces = clipIdBase + '-for-traces';\n this.clipPaths.forTraces = fullLayout._clips.append('clipPath')\n .attr('id', this.clipIds.forTraces);\n this.clipPaths.forTraces.append('path');\n\n this.framework = fullLayout._polarlayer.append('g')\n .attr('class', id);\n\n // unfortunately, we have to keep track of some axis tick settings\n // as polar subplots do not implement the 'ticks' editType\n this.radialTickLayout = null;\n this.angularTickLayout = null;\n}\n\nvar proto = Polar.prototype;\n\nmodule.exports = function createPolar(gd, id) {\n return new Polar(gd, id);\n};\n\nproto.plot = function(polarCalcData, fullLayout) {\n var _this = this;\n var polarLayout = fullLayout[_this.id];\n\n _this._hasClipOnAxisFalse = false;\n for(var i = 0; i < polarCalcData.length; i++) {\n var trace = polarCalcData[i][0].trace;\n if(trace.cliponaxis === false) {\n _this._hasClipOnAxisFalse = true;\n break;\n }\n }\n\n _this.updateLayers(fullLayout, polarLayout);\n _this.updateLayout(fullLayout, polarLayout);\n Plots.generalUpdatePerTraceModule(_this.gd, _this, polarCalcData, polarLayout);\n _this.updateFx(fullLayout, polarLayout);\n};\n\nproto.updateLayers = function(fullLayout, polarLayout) {\n var _this = this;\n var layers = _this.layers;\n var radialLayout = polarLayout.radialaxis;\n var angularLayout = polarLayout.angularaxis;\n var layerNames = constants.layerNames;\n\n var frontPlotIndex = layerNames.indexOf('frontplot');\n var layerData = layerNames.slice(0, frontPlotIndex);\n var isAngularAxisBelowTraces = angularLayout.layer === 'below traces';\n var isRadialAxisBelowTraces = radialLayout.layer === 'below traces';\n\n if(isAngularAxisBelowTraces) layerData.push('angular-line');\n if(isRadialAxisBelowTraces) layerData.push('radial-line');\n if(isAngularAxisBelowTraces) layerData.push('angular-axis');\n if(isRadialAxisBelowTraces) layerData.push('radial-axis');\n\n layerData.push('frontplot');\n\n if(!isAngularAxisBelowTraces) layerData.push('angular-line');\n if(!isRadialAxisBelowTraces) layerData.push('radial-line');\n if(!isAngularAxisBelowTraces) layerData.push('angular-axis');\n if(!isRadialAxisBelowTraces) layerData.push('radial-axis');\n\n var join = _this.framework.selectAll('.polarsublayer')\n .data(layerData, String);\n\n join.enter().append('g')\n .attr('class', function(d) { return 'polarsublayer ' + d;})\n .each(function(d) {\n var sel = layers[d] = d3.select(this);\n\n switch(d) {\n case 'frontplot':\n // TODO add option to place in 'backplot' layer??\n sel.append('g').classed('barlayer', true);\n sel.append('g').classed('scatterlayer', true);\n break;\n case 'backplot':\n sel.append('g').classed('maplayer', true);\n break;\n case 'plotbg':\n layers.bg = sel.append('path');\n break;\n case 'radial-grid':\n sel.style('fill', 'none');\n break;\n case 'angular-grid':\n sel.style('fill', 'none');\n break;\n case 'radial-line':\n sel.append('line').style('fill', 'none');\n break;\n case 'angular-line':\n sel.append('path').style('fill', 'none');\n break;\n }\n });\n\n join.order();\n};\n\n/* Polar subplots juggle with 6 'axis objects' (!), these are:\n *\n * - polarLayout.radialaxis (aka radialLayout in this file):\n * - polarLayout.angularaxis (aka angularLayout in this file):\n * used for data -> calcdata conversions (aka d2c) during the calc step\n *\n * - this.radialAxis\n * extends polarLayout.radialaxis, adds mocked 'domain' and\n * few other keys in order to reuse Cartesian doAutoRange and the Axes\n * drawing routines.\n * used for calcdata -> geometric conversions (aka c2g) during the plot step\n * + setGeometry setups ax.c2g for given ax.range\n * + setScale setups ax._m,ax._b for given ax.range\n *\n * - this.angularAxis\n * extends polarLayout.angularaxis, adds mocked 'range' and 'domain' and\n * a few other keys in order to reuse the Axes drawing routines.\n * used for calcdata -> geometric conversions (aka c2g) during the plot step\n * + setGeometry setups ax.c2g given ax.rotation, ax.direction & ax._categories,\n * and mocks ax.range\n * + setScale setups ax._m,ax._b with that mocked ax.range\n *\n * - this.xaxis\n * - this.yaxis\n * setup so that polar traces can reuse plot methods of Cartesian traces\n * which mostly rely on 2pixel methods (e.g ax.c2p)\n */\nproto.updateLayout = function(fullLayout, polarLayout) {\n var _this = this;\n var layers = _this.layers;\n var gs = fullLayout._size;\n\n // axis attributes\n var radialLayout = polarLayout.radialaxis;\n var angularLayout = polarLayout.angularaxis;\n // layout domains\n var xDomain = polarLayout.domain.x;\n var yDomain = polarLayout.domain.y;\n // offsets from paper edge to layout domain box\n _this.xOffset = gs.l + gs.w * xDomain[0];\n _this.yOffset = gs.t + gs.h * (1 - yDomain[1]);\n // lengths of the layout domain box\n var xLength = _this.xLength = gs.w * (xDomain[1] - xDomain[0]);\n var yLength = _this.yLength = gs.h * (yDomain[1] - yDomain[0]);\n // sector to plot\n var sector = polarLayout.sector;\n _this.sectorInRad = sector.map(deg2rad);\n var sectorBBox = _this.sectorBBox = computeSectorBBox(sector);\n var dxSectorBBox = sectorBBox[2] - sectorBBox[0];\n var dySectorBBox = sectorBBox[3] - sectorBBox[1];\n // aspect ratios\n var arDomain = yLength / xLength;\n var arSector = Math.abs(dySectorBBox / dxSectorBBox);\n // actual lengths and domains of subplot box\n var xLength2, yLength2;\n var xDomain2, yDomain2;\n var gap;\n if(arDomain > arSector) {\n xLength2 = xLength;\n yLength2 = xLength * arSector;\n gap = (yLength - yLength2) / gs.h / 2;\n xDomain2 = [xDomain[0], xDomain[1]];\n yDomain2 = [yDomain[0] + gap, yDomain[1] - gap];\n } else {\n xLength2 = yLength / arSector;\n yLength2 = yLength;\n gap = (xLength - xLength2) / gs.w / 2;\n xDomain2 = [xDomain[0] + gap, xDomain[1] - gap];\n yDomain2 = [yDomain[0], yDomain[1]];\n }\n _this.xLength2 = xLength2;\n _this.yLength2 = yLength2;\n _this.xDomain2 = xDomain2;\n _this.yDomain2 = yDomain2;\n // actual offsets from paper edge to the subplot box top-left corner\n var xOffset2 = _this.xOffset2 = gs.l + gs.w * xDomain2[0];\n var yOffset2 = _this.yOffset2 = gs.t + gs.h * (1 - yDomain2[1]);\n // circle radius in px\n var radius = _this.radius = xLength2 / dxSectorBBox;\n // 'inner' radius in px (when polar.hole is set)\n var innerRadius = _this.innerRadius = polarLayout.hole * radius;\n // circle center position in px\n var cx = _this.cx = xOffset2 - radius * sectorBBox[0];\n var cy = _this.cy = yOffset2 + radius * sectorBBox[3];\n // circle center in the coordinate system of plot area\n var cxx = _this.cxx = cx - xOffset2;\n var cyy = _this.cyy = cy - yOffset2;\n\n _this.radialAxis = _this.mockAxis(fullLayout, polarLayout, radialLayout, {\n // make this an 'x' axis to make positioning (especially rotation) easier\n _id: 'x',\n // convert to 'x' axis equivalent\n side: {\n counterclockwise: 'top',\n clockwise: 'bottom'\n }[radialLayout.side],\n // spans length 1 radius\n domain: [innerRadius / gs.w, radius / gs.w]\n });\n\n _this.angularAxis = _this.mockAxis(fullLayout, polarLayout, angularLayout, {\n side: 'right',\n // to get auto nticks right\n domain: [0, Math.PI],\n // don't pass through autorange logic\n autorange: false\n });\n\n _this.doAutoRange(fullLayout, polarLayout);\n // N.B. this sets _this.vangles\n _this.updateAngularAxis(fullLayout, polarLayout);\n // N.B. this sets _this.radialAxisAngle\n _this.updateRadialAxis(fullLayout, polarLayout);\n _this.updateRadialAxisTitle(fullLayout, polarLayout);\n\n _this.xaxis = _this.mockCartesianAxis(fullLayout, polarLayout, {\n _id: 'x',\n domain: xDomain2\n });\n\n _this.yaxis = _this.mockCartesianAxis(fullLayout, polarLayout, {\n _id: 'y',\n domain: yDomain2\n });\n\n var dPath = _this.pathSubplot();\n\n _this.clipPaths.forTraces.select('path')\n .attr('d', dPath)\n .attr('transform', strTranslate(cxx, cyy));\n\n layers.frontplot\n .attr('transform', strTranslate(xOffset2, yOffset2))\n .call(Drawing.setClipUrl, _this._hasClipOnAxisFalse ? null : _this.clipIds.forTraces, _this.gd);\n\n layers.bg\n .attr('d', dPath)\n .attr('transform', strTranslate(cx, cy))\n .call(Color.fill, polarLayout.bgcolor);\n};\n\nproto.mockAxis = function(fullLayout, polarLayout, axLayout, opts) {\n var ax = Lib.extendFlat({}, axLayout, opts);\n setConvertPolar(ax, polarLayout, fullLayout);\n return ax;\n};\n\nproto.mockCartesianAxis = function(fullLayout, polarLayout, opts) {\n var _this = this;\n var axId = opts._id;\n\n var ax = Lib.extendFlat({type: 'linear'}, opts);\n setConvertCartesian(ax, fullLayout);\n\n var bboxIndices = {\n x: [0, 2],\n y: [1, 3]\n };\n\n ax.setRange = function() {\n var sectorBBox = _this.sectorBBox;\n var ind = bboxIndices[axId];\n var rl = _this.radialAxis._rl;\n var drl = (rl[1] - rl[0]) / (1 - polarLayout.hole);\n ax.range = [sectorBBox[ind[0]] * drl, sectorBBox[ind[1]] * drl];\n };\n\n ax.isPtWithinRange = axId === 'x' ?\n function(d) { return _this.isPtInside(d); } :\n function() { return true; };\n\n ax.setRange();\n ax.setScale();\n return ax;\n};\n\nproto.doAutoRange = function(fullLayout, polarLayout) {\n var gd = this.gd;\n var radialAxis = this.radialAxis;\n var radialLayout = polarLayout.radialaxis;\n\n radialAxis.setScale();\n doAutoRange(gd, radialAxis);\n\n var rng = radialAxis.range;\n radialLayout.range = rng.slice();\n radialLayout._input.range = rng.slice();\n\n radialAxis._rl = [\n radialAxis.r2l(rng[0], null, 'gregorian'),\n radialAxis.r2l(rng[1], null, 'gregorian')\n ];\n};\n\nproto.updateRadialAxis = function(fullLayout, polarLayout) {\n var _this = this;\n var gd = _this.gd;\n var layers = _this.layers;\n var radius = _this.radius;\n var innerRadius = _this.innerRadius;\n var cx = _this.cx;\n var cy = _this.cy;\n var radialLayout = polarLayout.radialaxis;\n var a0 = mod(polarLayout.sector[0], 360);\n var ax = _this.radialAxis;\n var hasRoomForIt = innerRadius < radius;\n\n _this.fillViewInitialKey('radialaxis.angle', radialLayout.angle);\n _this.fillViewInitialKey('radialaxis.range', ax.range.slice());\n\n ax.setGeometry();\n\n // rotate auto tick labels by 180 if in quadrant II and III to make them\n // readable from left-to-right\n //\n // TODO try moving deeper in Axes.drawLabels for better results?\n if(ax.tickangle === 'auto' && (a0 > 90 && a0 <= 270)) {\n ax.tickangle = 180;\n }\n\n // easier to set rotate angle with custom translate function\n var transFn = function(d) {\n return 'translate(' + (ax.l2p(d.x) + innerRadius) + ',0)';\n };\n\n // set special grid path function\n var gridPathFn = function(d) {\n return _this.pathArc(ax.r2p(d.x) + innerRadius);\n };\n\n var newTickLayout = strTickLayout(radialLayout);\n if(_this.radialTickLayout !== newTickLayout) {\n layers['radial-axis'].selectAll('.xtick').remove();\n _this.radialTickLayout = newTickLayout;\n }\n\n if(hasRoomForIt) {\n ax.setScale();\n\n var vals = Axes.calcTicks(ax);\n var valsClipped = Axes.clipEnds(ax, vals);\n var tickSign = Axes.getTickSigns(ax)[2];\n\n Axes.drawTicks(gd, ax, {\n vals: vals,\n layer: layers['radial-axis'],\n path: Axes.makeTickPath(ax, 0, tickSign),\n transFn: transFn,\n crisp: false\n });\n\n Axes.drawGrid(gd, ax, {\n vals: valsClipped,\n layer: layers['radial-grid'],\n path: gridPathFn,\n transFn: Lib.noop,\n crisp: false\n });\n\n Axes.drawLabels(gd, ax, {\n vals: vals,\n layer: layers['radial-axis'],\n transFn: transFn,\n labelFns: Axes.makeLabelFns(ax, 0)\n });\n }\n\n // stash 'actual' radial axis angle for drag handlers (in degrees)\n var angle = _this.radialAxisAngle = _this.vangles ?\n rad2deg(snapToVertexAngle(deg2rad(radialLayout.angle), _this.vangles)) :\n radialLayout.angle;\n\n var tLayer = strTranslate(cx, cy);\n var tLayer2 = tLayer + strRotate(-angle);\n\n updateElement(\n layers['radial-axis'],\n hasRoomForIt && (radialLayout.showticklabels || radialLayout.ticks),\n {transform: tLayer2}\n );\n\n updateElement(\n layers['radial-grid'],\n hasRoomForIt && radialLayout.showgrid,\n {transform: tLayer}\n );\n\n updateElement(\n layers['radial-line'].select('line'),\n hasRoomForIt && radialLayout.showline,\n {\n x1: innerRadius,\n y1: 0,\n x2: radius,\n y2: 0,\n transform: tLayer2\n }\n )\n .attr('stroke-width', radialLayout.linewidth)\n .call(Color.stroke, radialLayout.linecolor);\n};\n\nproto.updateRadialAxisTitle = function(fullLayout, polarLayout, _angle) {\n var _this = this;\n var gd = _this.gd;\n var radius = _this.radius;\n var cx = _this.cx;\n var cy = _this.cy;\n var radialLayout = polarLayout.radialaxis;\n var titleClass = _this.id + 'title';\n\n var angle = _angle !== undefined ? _angle : _this.radialAxisAngle;\n var angleRad = deg2rad(angle);\n var cosa = Math.cos(angleRad);\n var sina = Math.sin(angleRad);\n\n var pad = 0;\n\n // Hint: no need to check if there is in fact a title.text set\n // because if plot is editable, pad needs to be calculated anyways\n // to properly show placeholder text when title is empty.\n if(radialLayout.title) {\n var h = Drawing.bBox(_this.layers['radial-axis'].node()).height;\n var ts = radialLayout.title.font.size;\n pad = radialLayout.side === 'counterclockwise' ?\n -h - ts * 0.4 :\n h + ts * 0.8;\n }\n\n _this.layers['radial-axis-title'] = Titles.draw(gd, titleClass, {\n propContainer: radialLayout,\n propName: _this.id + '.radialaxis.title',\n placeholder: _(gd, 'Click to enter radial axis title'),\n attributes: {\n x: cx + (radius / 2) * cosa + pad * sina,\n y: cy - (radius / 2) * sina + pad * cosa,\n 'text-anchor': 'middle'\n },\n transform: {rotate: -angle}\n });\n};\n\nproto.updateAngularAxis = function(fullLayout, polarLayout) {\n var _this = this;\n var gd = _this.gd;\n var layers = _this.layers;\n var radius = _this.radius;\n var innerRadius = _this.innerRadius;\n var cx = _this.cx;\n var cy = _this.cy;\n var angularLayout = polarLayout.angularaxis;\n var ax = _this.angularAxis;\n\n _this.fillViewInitialKey('angularaxis.rotation', angularLayout.rotation);\n\n ax.setGeometry();\n ax.setScale();\n\n // 't'ick to 'g'eometric radians is used all over the place here\n var t2g = function(d) { return ax.t2g(d.x); };\n\n // run rad2deg on tick0 and ditck for thetaunit: 'radians' axes\n if(ax.type === 'linear' && ax.thetaunit === 'radians') {\n ax.tick0 = rad2deg(ax.tick0);\n ax.dtick = rad2deg(ax.dtick);\n }\n\n var _transFn = function(rad) {\n return strTranslate(cx + radius * Math.cos(rad), cy - radius * Math.sin(rad));\n };\n\n var transFn = function(d) {\n return _transFn(t2g(d));\n };\n\n var transFn2 = function(d) {\n var rad = t2g(d);\n return _transFn(rad) + strRotate(-rad2deg(rad));\n };\n\n var gridPathFn = function(d) {\n var rad = t2g(d);\n var cosRad = Math.cos(rad);\n var sinRad = Math.sin(rad);\n return 'M' + [cx + innerRadius * cosRad, cy - innerRadius * sinRad] +\n 'L' + [cx + radius * cosRad, cy - radius * sinRad];\n };\n\n var out = Axes.makeLabelFns(ax, 0);\n var labelStandoff = out.labelStandoff;\n var labelFns = {};\n\n labelFns.xFn = function(d) {\n var rad = t2g(d);\n return Math.cos(rad) * labelStandoff;\n };\n\n labelFns.yFn = function(d) {\n var rad = t2g(d);\n var ff = Math.sin(rad) > 0 ? 0.2 : 1;\n return -Math.sin(rad) * (labelStandoff + d.fontSize * ff) +\n Math.abs(Math.cos(rad)) * (d.fontSize * MID_SHIFT);\n };\n\n labelFns.anchorFn = function(d) {\n var rad = t2g(d);\n var cos = Math.cos(rad);\n return Math.abs(cos) < 0.1 ?\n 'middle' :\n (cos > 0 ? 'start' : 'end');\n };\n\n labelFns.heightFn = function(d, a, h) {\n var rad = t2g(d);\n return -0.5 * (1 + Math.sin(rad)) * h;\n };\n\n var newTickLayout = strTickLayout(angularLayout);\n if(_this.angularTickLayout !== newTickLayout) {\n layers['angular-axis'].selectAll('.' + ax._id + 'tick').remove();\n _this.angularTickLayout = newTickLayout;\n }\n\n var vals = Axes.calcTicks(ax);\n\n // angle of polygon vertices in geometric radians (null means circles)\n // TODO what to do when ax.period > ax._categories ??\n var vangles;\n if(polarLayout.gridshape === 'linear') {\n vangles = vals.map(t2g);\n\n // ax._vals should be always ordered, make them\n // always turn counterclockwise for convenience here\n if(Lib.angleDelta(vangles[0], vangles[1]) < 0) {\n vangles = vangles.slice().reverse();\n }\n } else {\n vangles = null;\n }\n _this.vangles = vangles;\n\n // Use tickval filter for category axes instead of tweaking\n // the range w.r.t sector, so that sectors that cross 360 can\n // show all their ticks.\n if(ax.type === 'category') {\n vals = vals.filter(function(d) {\n return Lib.isAngleInsideSector(t2g(d), _this.sectorInRad);\n });\n }\n\n if(ax.visible) {\n var tickSign = ax.ticks === 'inside' ? -1 : 1;\n var pad = (ax.linewidth || 1) / 2;\n\n Axes.drawTicks(gd, ax, {\n vals: vals,\n layer: layers['angular-axis'],\n path: 'M' + (tickSign * pad) + ',0h' + (tickSign * ax.ticklen),\n transFn: transFn2,\n crisp: false\n });\n\n Axes.drawGrid(gd, ax, {\n vals: vals,\n layer: layers['angular-grid'],\n path: gridPathFn,\n transFn: Lib.noop,\n crisp: false\n });\n\n Axes.drawLabels(gd, ax, {\n vals: vals,\n layer: layers['angular-axis'],\n repositionOnUpdate: true,\n transFn: transFn,\n labelFns: labelFns\n });\n }\n\n // TODO maybe two arcs is better here?\n // maybe split style attributes between inner and outer angular axes?\n\n updateElement(layers['angular-line'].select('path'), angularLayout.showline, {\n d: _this.pathSubplot(),\n transform: strTranslate(cx, cy)\n })\n .attr('stroke-width', angularLayout.linewidth)\n .call(Color.stroke, angularLayout.linecolor);\n};\n\nproto.updateFx = function(fullLayout, polarLayout) {\n if(!this.gd._context.staticPlot) {\n this.updateAngularDrag(fullLayout);\n this.updateRadialDrag(fullLayout, polarLayout, 0);\n this.updateRadialDrag(fullLayout, polarLayout, 1);\n this.updateMainDrag(fullLayout);\n }\n};\n\nproto.updateMainDrag = function(fullLayout) {\n var _this = this;\n var gd = _this.gd;\n var layers = _this.layers;\n var zoomlayer = fullLayout._zoomlayer;\n var MINZOOM = constants.MINZOOM;\n var OFFEDGE = constants.OFFEDGE;\n var radius = _this.radius;\n var innerRadius = _this.innerRadius;\n var cx = _this.cx;\n var cy = _this.cy;\n var cxx = _this.cxx;\n var cyy = _this.cyy;\n var sectorInRad = _this.sectorInRad;\n var vangles = _this.vangles;\n var radialAxis = _this.radialAxis;\n var clampTiny = helpers.clampTiny;\n var findXYatLength = helpers.findXYatLength;\n var findEnclosingVertexAngles = helpers.findEnclosingVertexAngles;\n var chw = constants.cornerHalfWidth;\n var chl = constants.cornerLen / 2;\n\n var mainDrag = dragBox.makeDragger(layers, 'path', 'maindrag', 'crosshair');\n\n d3.select(mainDrag)\n .attr('d', _this.pathSubplot())\n .attr('transform', strTranslate(cx, cy));\n\n var dragOpts = {\n element: mainDrag,\n gd: gd,\n subplot: _this.id,\n plotinfo: {\n id: _this.id,\n xaxis: _this.xaxis,\n yaxis: _this.yaxis\n },\n xaxes: [_this.xaxis],\n yaxes: [_this.yaxis]\n };\n\n // mouse px position at drag start (0), move (1)\n var x0, y0;\n // radial distance from circle center at drag start (0), move (1)\n var r0, r1;\n // zoombox persistent quantities\n var path0, dimmed, lum;\n // zoombox, corners elements\n var zb, corners;\n\n function norm(x, y) {\n return Math.sqrt(x * x + y * y);\n }\n\n function xy2r(x, y) {\n return norm(x - cxx, y - cyy);\n }\n\n function xy2a(x, y) {\n return Math.atan2(cyy - y, x - cxx);\n }\n\n function ra2xy(r, a) {\n return [r * Math.cos(a), r * Math.sin(-a)];\n }\n\n function pathCorner(r, a) {\n if(r === 0) return _this.pathSector(2 * chw);\n\n var da = chl / r;\n var am = a - da;\n var ap = a + da;\n var rb = Math.max(0, Math.min(r, radius));\n var rm = rb - chw;\n var rp = rb + chw;\n\n return 'M' + ra2xy(rm, am) +\n 'A' + [rm, rm] + ' 0,0,0 ' + ra2xy(rm, ap) +\n 'L' + ra2xy(rp, ap) +\n 'A' + [rp, rp] + ' 0,0,1 ' + ra2xy(rp, am) +\n 'Z';\n }\n\n // (x,y) is the pt at middle of the va0 <-> va1 edge\n //\n // ... we could eventually add another mode for cursor\n // angles 'close to' enough to a particular vertex.\n function pathCornerForPolygons(r, va0, va1) {\n if(r === 0) return _this.pathSector(2 * chw);\n\n var xy0 = ra2xy(r, va0);\n var xy1 = ra2xy(r, va1);\n var x = clampTiny((xy0[0] + xy1[0]) / 2);\n var y = clampTiny((xy0[1] + xy1[1]) / 2);\n var innerPts, outerPts;\n\n if(x && y) {\n var m = y / x;\n var mperp = -1 / m;\n var midPts = findXYatLength(chw, m, x, y);\n innerPts = findXYatLength(chl, mperp, midPts[0][0], midPts[0][1]);\n outerPts = findXYatLength(chl, mperp, midPts[1][0], midPts[1][1]);\n } else {\n var dx, dy;\n if(y) {\n // horizontal handles\n dx = chl;\n dy = chw;\n } else {\n // vertical handles\n dx = chw;\n dy = chl;\n }\n innerPts = [[x - dx, y - dy], [x + dx, y - dy]];\n outerPts = [[x - dx, y + dy], [x + dx, y + dy]];\n }\n\n return 'M' + innerPts.join('L') +\n 'L' + outerPts.reverse().join('L') + 'Z';\n }\n\n function zoomPrep() {\n r0 = null;\n r1 = null;\n path0 = _this.pathSubplot();\n dimmed = false;\n\n var polarLayoutNow = gd._fullLayout[_this.id];\n lum = tinycolor(polarLayoutNow.bgcolor).getLuminance();\n\n zb = dragBox.makeZoombox(zoomlayer, lum, cx, cy, path0);\n zb.attr('fill-rule', 'evenodd');\n corners = dragBox.makeCorners(zoomlayer, cx, cy);\n clearSelect(gd);\n }\n\n // N.B. this sets scoped 'r0' and 'r1'\n // return true if 'valid' zoom distance, false otherwise\n function clampAndSetR0R1(rr0, rr1) {\n rr1 = Math.max(Math.min(rr1, radius), innerRadius);\n\n // starting or ending drag near center (outer edge),\n // clamps radial distance at origin (at r=radius)\n if(rr0 < OFFEDGE) rr0 = 0;\n else if((radius - rr0) < OFFEDGE) rr0 = radius;\n else if(rr1 < OFFEDGE) rr1 = 0;\n else if((radius - rr1) < OFFEDGE) rr1 = radius;\n\n // make sure r0 < r1,\n // to get correct fill pattern in path1 below\n if(Math.abs(rr1 - rr0) > MINZOOM) {\n if(rr0 < rr1) {\n r0 = rr0;\n r1 = rr1;\n } else {\n r0 = rr1;\n r1 = rr0;\n }\n return true;\n } else {\n r0 = null;\n r1 = null;\n return false;\n }\n }\n\n function applyZoomMove(path1, cpath) {\n path1 = path1 || path0;\n cpath = cpath || 'M0,0Z';\n\n zb.attr('d', path1);\n corners.attr('d', cpath);\n dragBox.transitionZoombox(zb, corners, dimmed, lum);\n dimmed = true;\n\n var updateObj = {};\n computeZoomUpdates(updateObj);\n gd.emit('plotly_relayouting', updateObj);\n }\n\n function zoomMove(dx, dy) {\n var x1 = x0 + dx;\n var y1 = y0 + dy;\n var rr0 = xy2r(x0, y0);\n var rr1 = Math.min(xy2r(x1, y1), radius);\n var a0 = xy2a(x0, y0);\n var path1;\n var cpath;\n\n if(clampAndSetR0R1(rr0, rr1)) {\n path1 = path0 + _this.pathSector(r1);\n if(r0) path1 += _this.pathSector(r0);\n // keep 'starting' angle\n cpath = pathCorner(r0, a0) + pathCorner(r1, a0);\n }\n applyZoomMove(path1, cpath);\n }\n\n function findPolygonRadius(x, y, va0, va1) {\n var xy = helpers.findIntersectionXY(va0, va1, va0, [x - cxx, cyy - y]);\n return norm(xy[0], xy[1]);\n }\n\n function zoomMoveForPolygons(dx, dy) {\n var x1 = x0 + dx;\n var y1 = y0 + dy;\n var a0 = xy2a(x0, y0);\n var a1 = xy2a(x1, y1);\n var vangles0 = findEnclosingVertexAngles(a0, vangles);\n var vangles1 = findEnclosingVertexAngles(a1, vangles);\n var rr0 = findPolygonRadius(x0, y0, vangles0[0], vangles0[1]);\n var rr1 = Math.min(findPolygonRadius(x1, y1, vangles1[0], vangles1[1]), radius);\n var path1;\n var cpath;\n\n if(clampAndSetR0R1(rr0, rr1)) {\n path1 = path0 + _this.pathSector(r1);\n if(r0) path1 += _this.pathSector(r0);\n // keep 'starting' angle here too\n cpath = [\n pathCornerForPolygons(r0, vangles0[0], vangles0[1]),\n pathCornerForPolygons(r1, vangles0[0], vangles0[1])\n ].join(' ');\n }\n applyZoomMove(path1, cpath);\n }\n\n function zoomDone() {\n dragBox.removeZoombox(gd);\n\n if(r0 === null || r1 === null) return;\n var updateObj = {};\n computeZoomUpdates(updateObj);\n\n dragBox.showDoubleClickNotifier(gd);\n\n Registry.call('_guiRelayout', gd, updateObj);\n }\n\n function computeZoomUpdates(update) {\n var rl = radialAxis._rl;\n var m = (rl[1] - rl[0]) / (1 - innerRadius / radius) / radius;\n var newRng = [\n rl[0] + (r0 - innerRadius) * m,\n rl[0] + (r1 - innerRadius) * m\n ];\n update[_this.id + '.radialaxis.range'] = newRng;\n }\n\n function zoomClick(numClicks, evt) {\n var clickMode = gd._fullLayout.clickmode;\n\n dragBox.removeZoombox(gd);\n\n // TODO double once vs twice logic (autorange vs fixed range)\n if(numClicks === 2) {\n var updateObj = {};\n for(var k in _this.viewInitial) {\n updateObj[_this.id + '.' + k] = _this.viewInitial[k];\n }\n\n gd.emit('plotly_doubleclick', null);\n Registry.call('_guiRelayout', gd, updateObj);\n }\n\n if(clickMode.indexOf('select') > -1 && numClicks === 1) {\n selectOnClick(evt, gd, [_this.xaxis], [_this.yaxis], _this.id, dragOpts);\n }\n\n if(clickMode.indexOf('event') > -1) {\n Fx.click(gd, evt, _this.id);\n }\n }\n\n dragOpts.prepFn = function(evt, startX, startY) {\n var dragModeNow = gd._fullLayout.dragmode;\n\n var bbox = mainDrag.getBoundingClientRect();\n x0 = startX - bbox.left;\n y0 = startY - bbox.top;\n\n // need to offset x/y as bbox center does not\n // match origin for asymmetric polygons\n if(vangles) {\n var offset = helpers.findPolygonOffset(radius, sectorInRad[0], sectorInRad[1], vangles);\n x0 += cxx + offset[0];\n y0 += cyy + offset[1];\n }\n\n switch(dragModeNow) {\n case 'zoom':\n if(vangles) {\n dragOpts.moveFn = zoomMoveForPolygons;\n } else {\n dragOpts.moveFn = zoomMove;\n }\n dragOpts.clickFn = zoomClick;\n dragOpts.doneFn = zoomDone;\n zoomPrep(evt, startX, startY);\n break;\n case 'select':\n case 'lasso':\n prepSelect(evt, startX, startY, dragOpts, dragModeNow);\n break;\n }\n };\n\n mainDrag.onmousemove = function(evt) {\n Fx.hover(gd, evt, _this.id);\n gd._fullLayout._lasthover = mainDrag;\n gd._fullLayout._hoversubplot = _this.id;\n };\n\n mainDrag.onmouseout = function(evt) {\n if(gd._dragging) return;\n dragElement.unhover(gd, evt);\n };\n\n dragElement.init(dragOpts);\n};\n\nproto.updateRadialDrag = function(fullLayout, polarLayout, rngIndex) {\n var _this = this;\n var gd = _this.gd;\n var layers = _this.layers;\n var radius = _this.radius;\n var innerRadius = _this.innerRadius;\n var cx = _this.cx;\n var cy = _this.cy;\n var radialAxis = _this.radialAxis;\n var bl = constants.radialDragBoxSize;\n var bl2 = bl / 2;\n\n if(!radialAxis.visible) return;\n\n var angle0 = deg2rad(_this.radialAxisAngle);\n var rl = radialAxis._rl;\n var rl0 = rl[0];\n var rl1 = rl[1];\n var rbase = rl[rngIndex];\n var m = 0.75 * (rl[1] - rl[0]) / (1 - polarLayout.hole) / radius;\n\n var tx, ty, className;\n if(rngIndex) {\n tx = cx + (radius + bl2) * Math.cos(angle0);\n ty = cy - (radius + bl2) * Math.sin(angle0);\n className = 'radialdrag';\n } else {\n // the 'inner' box can get called:\n // - when polar.hole>0\n // - when polar.sector isn't a full circle\n // otherwise it is hidden behind the main drag.\n tx = cx + (innerRadius - bl2) * Math.cos(angle0);\n ty = cy - (innerRadius - bl2) * Math.sin(angle0);\n className = 'radialdrag-inner';\n }\n\n var radialDrag = dragBox.makeRectDragger(layers, className, 'crosshair', -bl2, -bl2, bl, bl);\n var dragOpts = {element: radialDrag, gd: gd};\n\n updateElement(d3.select(radialDrag), radialAxis.visible && innerRadius < radius, {\n transform: strTranslate(tx, ty)\n });\n\n // move function (either rotate or re-range flavor)\n var moveFn2;\n // rotate angle on done\n var angle1;\n // re-range range[1] (or range[0]) on done\n var rprime;\n\n function moveFn(dx, dy) {\n if(moveFn2) {\n moveFn2(dx, dy);\n } else {\n var dvec = [dx, -dy];\n var rvec = [Math.cos(angle0), Math.sin(angle0)];\n var comp = Math.abs(Lib.dot(dvec, rvec) / Math.sqrt(Lib.dot(dvec, dvec)));\n\n // mostly perpendicular motions rotate,\n // mostly parallel motions re-range\n if(!isNaN(comp)) {\n moveFn2 = comp < 0.5 ? rotateMove : rerangeMove;\n }\n }\n\n var update = {};\n computeRadialAxisUpdates(update);\n gd.emit('plotly_relayouting', update);\n }\n\n function computeRadialAxisUpdates(update) {\n if(angle1 !== null) {\n update[_this.id + '.radialaxis.angle'] = angle1;\n } else if(rprime !== null) {\n update[_this.id + '.radialaxis.range[' + rngIndex + ']'] = rprime;\n }\n }\n\n function doneFn() {\n if(angle1 !== null) {\n Registry.call('_guiRelayout', gd, _this.id + '.radialaxis.angle', angle1);\n } else if(rprime !== null) {\n Registry.call('_guiRelayout', gd, _this.id + '.radialaxis.range[' + rngIndex + ']', rprime);\n }\n }\n\n function rotateMove(dx, dy) {\n // disable for inner drag boxes\n if(rngIndex === 0) return;\n\n var x1 = tx + dx;\n var y1 = ty + dy;\n\n angle1 = Math.atan2(cy - y1, x1 - cx);\n if(_this.vangles) angle1 = snapToVertexAngle(angle1, _this.vangles);\n angle1 = rad2deg(angle1);\n\n var transform = strTranslate(cx, cy) + strRotate(-angle1);\n layers['radial-axis'].attr('transform', transform);\n layers['radial-line'].select('line').attr('transform', transform);\n\n var fullLayoutNow = _this.gd._fullLayout;\n var polarLayoutNow = fullLayoutNow[_this.id];\n _this.updateRadialAxisTitle(fullLayoutNow, polarLayoutNow, angle1);\n }\n\n function rerangeMove(dx, dy) {\n // project (dx, dy) unto unit radial axis vector\n var dr = Lib.dot([dx, -dy], [Math.cos(angle0), Math.sin(angle0)]);\n rprime = rbase - m * dr;\n\n // make sure rprime does not change the range[0] -> range[1] sign\n if((m > 0) !== (rngIndex ? rprime > rl0 : rprime < rl1)) {\n rprime = null;\n return;\n }\n\n var fullLayoutNow = gd._fullLayout;\n var polarLayoutNow = fullLayoutNow[_this.id];\n\n // update radial range -> update c2g -> update _m,_b\n radialAxis.range[rngIndex] = rprime;\n radialAxis._rl[rngIndex] = rprime;\n _this.updateRadialAxis(fullLayoutNow, polarLayoutNow);\n\n _this.xaxis.setRange();\n _this.xaxis.setScale();\n _this.yaxis.setRange();\n _this.yaxis.setScale();\n\n var hasRegl = false;\n\n for(var traceType in _this.traceHash) {\n var moduleCalcData = _this.traceHash[traceType];\n var moduleCalcDataVisible = Lib.filterVisible(moduleCalcData);\n var _module = moduleCalcData[0][0].trace._module;\n _module.plot(gd, _this, moduleCalcDataVisible, polarLayoutNow);\n if(Registry.traceIs(traceType, 'gl') && moduleCalcDataVisible.length) hasRegl = true;\n }\n\n if(hasRegl) {\n clearGlCanvases(gd);\n redrawReglTraces(gd);\n }\n }\n\n dragOpts.prepFn = function() {\n moveFn2 = null;\n angle1 = null;\n rprime = null;\n\n dragOpts.moveFn = moveFn;\n dragOpts.doneFn = doneFn;\n\n clearSelect(gd);\n };\n\n dragOpts.clampFn = function(dx, dy) {\n if(Math.sqrt(dx * dx + dy * dy) < constants.MINDRAG) {\n dx = 0;\n dy = 0;\n }\n return [dx, dy];\n };\n\n dragElement.init(dragOpts);\n};\n\nproto.updateAngularDrag = function(fullLayout) {\n var _this = this;\n var gd = _this.gd;\n var layers = _this.layers;\n var radius = _this.radius;\n var angularAxis = _this.angularAxis;\n var cx = _this.cx;\n var cy = _this.cy;\n var cxx = _this.cxx;\n var cyy = _this.cyy;\n var dbs = constants.angularDragBoxSize;\n\n var angularDrag = dragBox.makeDragger(layers, 'path', 'angulardrag', 'move');\n var dragOpts = {element: angularDrag, gd: gd};\n\n d3.select(angularDrag)\n .attr('d', _this.pathAnnulus(radius, radius + dbs))\n .attr('transform', strTranslate(cx, cy))\n .call(setCursor, 'move');\n\n function xy2a(x, y) {\n return Math.atan2(cyy + dbs - y, x - cxx - dbs);\n }\n\n // scatter trace, points and textpoints selections\n var scatterTraces = layers.frontplot.select('.scatterlayer').selectAll('.trace');\n var scatterPoints = scatterTraces.selectAll('.point');\n var scatterTextPoints = scatterTraces.selectAll('.textpoint');\n\n // mouse px position at drag start (0), move (1)\n var x0, y0;\n // angular axis angle rotation at drag start (0), move (1)\n var rot0, rot1;\n // induced radial axis rotation (only used on polygon grids)\n var rrot1;\n // angle about circle center at drag start\n var a0;\n\n function moveFn(dx, dy) {\n var fullLayoutNow = _this.gd._fullLayout;\n var polarLayoutNow = fullLayoutNow[_this.id];\n\n var x1 = x0 + dx;\n var y1 = y0 + dy;\n var a1 = xy2a(x1, y1);\n var da = rad2deg(a1 - a0);\n rot1 = rot0 + da;\n\n layers.frontplot.attr('transform',\n strTranslate(_this.xOffset2, _this.yOffset2) + strRotate([-da, cxx, cyy])\n );\n\n if(_this.vangles) {\n rrot1 = _this.radialAxisAngle + da;\n\n var trans = strTranslate(cx, cy) + strRotate(-da);\n var trans2 = strTranslate(cx, cy) + strRotate(-rrot1);\n\n layers.bg.attr('transform', trans);\n layers['radial-grid'].attr('transform', trans);\n layers['radial-axis'].attr('transform', trans2);\n layers['radial-line'].select('line').attr('transform', trans2);\n _this.updateRadialAxisTitle(fullLayoutNow, polarLayoutNow, rrot1);\n } else {\n _this.clipPaths.forTraces.select('path').attr('transform',\n strTranslate(cxx, cyy) + strRotate(da)\n );\n }\n\n // 'un-rotate' marker and text points\n scatterPoints.each(function() {\n var sel = d3.select(this);\n var xy = Drawing.getTranslate(sel);\n sel.attr('transform', strTranslate(xy.x, xy.y) + strRotate([da]));\n });\n scatterTextPoints.each(function() {\n var sel = d3.select(this);\n var tx = sel.select('text');\n var xy = Drawing.getTranslate(sel);\n // N.B rotate -> translate ordering matters\n sel.attr('transform', strRotate([da, tx.attr('x'), tx.attr('y')]) + strTranslate(xy.x, xy.y));\n });\n\n // update rotation -> range -> _m,_b\n angularAxis.rotation = Lib.modHalf(rot1, 360);\n _this.updateAngularAxis(fullLayoutNow, polarLayoutNow);\n\n if(_this._hasClipOnAxisFalse && !Lib.isFullCircle(_this.sectorInRad)) {\n scatterTraces.call(Drawing.hideOutsideRangePoints, _this);\n }\n\n var hasRegl = false;\n\n for(var traceType in _this.traceHash) {\n if(Registry.traceIs(traceType, 'gl')) {\n var moduleCalcData = _this.traceHash[traceType];\n var moduleCalcDataVisible = Lib.filterVisible(moduleCalcData);\n var _module = moduleCalcData[0][0].trace._module;\n _module.plot(gd, _this, moduleCalcDataVisible, polarLayoutNow);\n if(moduleCalcDataVisible.length) hasRegl = true;\n }\n }\n\n if(hasRegl) {\n clearGlCanvases(gd);\n redrawReglTraces(gd);\n }\n\n var update = {};\n computeRotationUpdates(update);\n gd.emit('plotly_relayouting', update);\n }\n\n function computeRotationUpdates(updateObj) {\n updateObj[_this.id + '.angularaxis.rotation'] = rot1;\n\n if(_this.vangles) {\n updateObj[_this.id + '.radialaxis.angle'] = rrot1;\n }\n }\n\n function doneFn() {\n scatterTextPoints.select('text').attr('transform', null);\n\n var updateObj = {};\n computeRotationUpdates(updateObj);\n Registry.call('_guiRelayout', gd, updateObj);\n }\n\n dragOpts.prepFn = function(evt, startX, startY) {\n var polarLayoutNow = fullLayout[_this.id];\n rot0 = polarLayoutNow.angularaxis.rotation;\n\n var bbox = angularDrag.getBoundingClientRect();\n x0 = startX - bbox.left;\n y0 = startY - bbox.top;\n a0 = xy2a(x0, y0);\n\n dragOpts.moveFn = moveFn;\n dragOpts.doneFn = doneFn;\n\n clearSelect(gd);\n };\n\n // I don't what we should do in this case, skip we now\n if(_this.vangles && !Lib.isFullCircle(_this.sectorInRad)) {\n dragOpts.prepFn = Lib.noop;\n setCursor(d3.select(angularDrag), null);\n }\n\n dragElement.init(dragOpts);\n};\n\nproto.isPtInside = function(d) {\n var sectorInRad = this.sectorInRad;\n var vangles = this.vangles;\n var thetag = this.angularAxis.c2g(d.theta);\n var radialAxis = this.radialAxis;\n var r = radialAxis.c2l(d.r);\n var rl = radialAxis._rl;\n\n var fn = vangles ? helpers.isPtInsidePolygon : Lib.isPtInsideSector;\n return fn(r, thetag, rl, sectorInRad, vangles);\n};\n\nproto.pathArc = function(r) {\n var sectorInRad = this.sectorInRad;\n var vangles = this.vangles;\n var fn = vangles ? helpers.pathPolygon : Lib.pathArc;\n return fn(r, sectorInRad[0], sectorInRad[1], vangles);\n};\n\nproto.pathSector = function(r) {\n var sectorInRad = this.sectorInRad;\n var vangles = this.vangles;\n var fn = vangles ? helpers.pathPolygon : Lib.pathSector;\n return fn(r, sectorInRad[0], sectorInRad[1], vangles);\n};\n\nproto.pathAnnulus = function(r0, r1) {\n var sectorInRad = this.sectorInRad;\n var vangles = this.vangles;\n var fn = vangles ? helpers.pathPolygonAnnulus : Lib.pathAnnulus;\n return fn(r0, r1, sectorInRad[0], sectorInRad[1], vangles);\n};\n\nproto.pathSubplot = function() {\n var r0 = this.innerRadius;\n var r1 = this.radius;\n return r0 ? this.pathAnnulus(r0, r1) : this.pathSector(r1);\n};\n\nproto.fillViewInitialKey = function(key, val) {\n if(!(key in this.viewInitial)) {\n this.viewInitial[key] = val;\n }\n};\n\nfunction strTickLayout(axLayout) {\n var out = axLayout.ticks + String(axLayout.ticklen) + String(axLayout.showticklabels);\n if('side' in axLayout) out += axLayout.side;\n return out;\n}\n\n// Finds the bounding box of a given circle sector,\n// inspired by https://math.stackexchange.com/q/1852703\n//\n// assumes:\n// - sector[0] < sector[1]\n// - counterclockwise rotation\nfunction computeSectorBBox(sector) {\n var s0 = sector[0];\n var s1 = sector[1];\n var arc = s1 - s0;\n var a0 = mod(s0, 360);\n var a1 = a0 + arc;\n\n var ax0 = Math.cos(deg2rad(a0));\n var ay0 = Math.sin(deg2rad(a0));\n var ax1 = Math.cos(deg2rad(a1));\n var ay1 = Math.sin(deg2rad(a1));\n\n var x0, y0, x1, y1;\n\n if((a0 <= 90 && a1 >= 90) || (a0 > 90 && a1 >= 450)) {\n y1 = 1;\n } else if(ay0 <= 0 && ay1 <= 0) {\n y1 = 0;\n } else {\n y1 = Math.max(ay0, ay1);\n }\n\n if((a0 <= 180 && a1 >= 180) || (a0 > 180 && a1 >= 540)) {\n x0 = -1;\n } else if(ax0 >= 0 && ax1 >= 0) {\n x0 = 0;\n } else {\n x0 = Math.min(ax0, ax1);\n }\n\n if((a0 <= 270 && a1 >= 270) || (a0 > 270 && a1 >= 630)) {\n y0 = -1;\n } else if(ay0 >= 0 && ay1 >= 0) {\n y0 = 0;\n } else {\n y0 = Math.min(ay0, ay1);\n }\n\n if(a1 >= 360) {\n x1 = 1;\n } else if(ax0 <= 0 && ax1 <= 0) {\n x1 = 0;\n } else {\n x1 = Math.max(ax0, ax1);\n }\n\n return [x0, y0, x1, y1];\n}\n\nfunction snapToVertexAngle(a, vangles) {\n var fn = function(v) { return Lib.angleDist(a, v); };\n var ind = Lib.findIndexOfMin(vangles, fn);\n return vangles[ind];\n}\n\nfunction updateElement(sel, showAttr, attrs) {\n if(showAttr) {\n sel.attr('display', null);\n sel.attr(attrs);\n } else if(sel) {\n sel.attr('display', 'none');\n }\n return sel;\n}\n\nfunction strTranslate(x, y) {\n return 'translate(' + x + ',' + y + ')';\n}\n\nfunction strRotate(angle) {\n return 'rotate(' + angle + ')';\n}\n\n},{\"../../components/color\":595,\"../../components/dragelement\":614,\"../../components/drawing\":617,\"../../components/fx\":635,\"../../components/titles\":690,\"../../constants/alignment\":697,\"../../lib\":728,\"../../lib/clear_gl_canvases\":713,\"../../lib/setcursor\":748,\"../../plot_api/subroutines\":767,\"../../plots/cartesian/axes\":776,\"../../registry\":859,\"../cartesian/autorange\":775,\"../cartesian/dragbox\":784,\"../cartesian/select\":795,\"../cartesian/set_convert\":796,\"../plots\":839,\"./constants\":840,\"./helpers\":841,\"./set_convert\":852,\"d3\":164,\"tinycolor2\":528}],852:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar setConvertCartesian = _dereq_('../cartesian/set_convert');\n\nvar deg2rad = Lib.deg2rad;\nvar rad2deg = Lib.rad2deg;\n\n/**\n * setConvert for polar axes!\n *\n * @param {object} ax\n * axis in question (works for both radial and angular axes)\n * @param {object} polarLayout\n * full polar layout of the subplot associated with 'ax'\n * @param {object} fullLayout\n * full layout\n *\n * Here, reuse some of the Cartesian setConvert logic,\n * but we must extend some of it, as both radial and angular axes\n * don't have domains and angular axes don't have _true_ ranges.\n *\n * Moreover, we introduce two new coordinate systems:\n * - 'g' for geometric coordinates and\n * - 't' for angular ticks\n *\n * Radial axis coordinate systems:\n * - d, c and l: same as for cartesian axes\n * - g: like calcdata but translated about `radialaxis.range[0]` & `polar.hole`\n *\n * Angular axis coordinate systems:\n * - d: data, in whatever form it's provided\n * - c: calcdata, turned into radians (for linear axes)\n * or category indices (category axes)\n * - t: tick calcdata, just like 'c' but in degrees for linear axes\n * - g: geometric calcdata, radians coordinates that take into account\n * axis rotation and direction\n *\n * Then, 'g'eometric data is ready to be converted to (x,y).\n */\nmodule.exports = function setConvert(ax, polarLayout, fullLayout) {\n setConvertCartesian(ax, fullLayout);\n\n switch(ax._id) {\n case 'x':\n case 'radialaxis':\n setConvertRadial(ax, polarLayout);\n break;\n case 'angularaxis':\n setConvertAngular(ax, polarLayout);\n break;\n }\n};\n\nfunction setConvertRadial(ax, polarLayout) {\n var subplot = polarLayout._subplot;\n\n ax.setGeometry = function() {\n var rl0 = ax._rl[0];\n var rl1 = ax._rl[1];\n\n var b = subplot.innerRadius;\n var m = (subplot.radius - b) / (rl1 - rl0);\n var b2 = b / m;\n\n var rFilter = rl0 > rl1 ?\n function(v) { return v <= 0; } :\n function(v) { return v >= 0; };\n\n ax.c2g = function(v) {\n var r = ax.c2l(v) - rl0;\n return (rFilter(r) ? r : 0) + b2;\n };\n\n ax.g2c = function(v) {\n return ax.l2c(v + rl0 - b2);\n };\n\n ax.g2p = function(v) { return v * m; };\n ax.c2p = function(v) { return ax.g2p(ax.c2g(v)); };\n };\n}\n\nfunction toRadians(v, unit) {\n return unit === 'degrees' ? deg2rad(v) : v;\n}\n\nfunction fromRadians(v, unit) {\n return unit === 'degrees' ? rad2deg(v) : v;\n}\n\nfunction setConvertAngular(ax, polarLayout) {\n var axType = ax.type;\n\n if(axType === 'linear') {\n var _d2c = ax.d2c;\n var _c2d = ax.c2d;\n\n ax.d2c = function(v, unit) { return toRadians(_d2c(v), unit); };\n ax.c2d = function(v, unit) { return _c2d(fromRadians(v, unit)); };\n }\n\n // override makeCalcdata to handle thetaunit and special theta0/dtheta logic\n ax.makeCalcdata = function(trace, coord) {\n var arrayIn = trace[coord];\n var len = trace._length;\n var arrayOut, i;\n\n var _d2c = function(v) { return ax.d2c(v, trace.thetaunit); };\n\n if(arrayIn) {\n if(Lib.isTypedArray(arrayIn) && axType === 'linear') {\n if(len === arrayIn.length) {\n return arrayIn;\n } else if(arrayIn.subarray) {\n return arrayIn.subarray(0, len);\n }\n }\n\n arrayOut = new Array(len);\n for(i = 0; i < len; i++) {\n arrayOut[i] = _d2c(arrayIn[i]);\n }\n } else {\n var coord0 = coord + '0';\n var dcoord = 'd' + coord;\n var v0 = (coord0 in trace) ? _d2c(trace[coord0]) : 0;\n var dv = (trace[dcoord]) ? _d2c(trace[dcoord]) : (ax.period || 2 * Math.PI) / len;\n\n arrayOut = new Array(len);\n for(i = 0; i < len; i++) {\n arrayOut[i] = v0 + i * dv;\n }\n }\n\n return arrayOut;\n };\n\n // N.B. we mock the axis 'range' here\n ax.setGeometry = function() {\n var sector = polarLayout.sector;\n var sectorInRad = sector.map(deg2rad);\n var dir = {clockwise: -1, counterclockwise: 1}[ax.direction];\n var rot = deg2rad(ax.rotation);\n\n var rad2g = function(v) { return dir * v + rot; };\n var g2rad = function(v) { return (v - rot) / dir; };\n\n var rad2c, c2rad;\n var rad2t, t2rad;\n\n switch(axType) {\n case 'linear':\n c2rad = rad2c = Lib.identity;\n t2rad = deg2rad;\n rad2t = rad2deg;\n\n // Set the angular range in degrees to make auto-tick computation cleaner,\n // changing rotation/direction should not affect the angular tick value.\n ax.range = Lib.isFullCircle(sectorInRad) ?\n [sector[0], sector[0] + 360] :\n sectorInRad.map(g2rad).map(rad2deg);\n break;\n\n case 'category':\n var catLen = ax._categories.length;\n var _period = ax.period ? Math.max(ax.period, catLen) : catLen;\n\n // fallback in case all categories have been filtered out\n if(_period === 0) _period = 1;\n\n c2rad = t2rad = function(v) { return v * 2 * Math.PI / _period; };\n rad2c = rad2t = function(v) { return v * _period / Math.PI / 2; };\n\n ax.range = [0, _period];\n break;\n }\n\n ax.c2g = function(v) { return rad2g(c2rad(v)); };\n ax.g2c = function(v) { return rad2c(g2rad(v)); };\n\n ax.t2g = function(v) { return rad2g(t2rad(v)); };\n ax.g2t = function(v) { return rad2t(g2rad(v)); };\n };\n}\n\n},{\"../../lib\":728,\"../cartesian/set_convert\":796}],853:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../lib');\nvar Template = _dereq_('../plot_api/plot_template');\nvar handleDomainDefaults = _dereq_('./domain').defaults;\n\n\n/**\n * Find and supply defaults to all subplots of a given type\n * This handles subplots that are contained within one container - so\n * gl3d, geo, ternary... but not 2d axes which have separate x and y axes\n * finds subplots, coerces their `domain` attributes, then calls the\n * given handleDefaults function to fill in everything else.\n *\n * layoutIn: the complete user-supplied input layout\n * layoutOut: the complete finished layout\n * fullData: the finished data array, used only to find subplots\n * opts: {\n * type: subplot type string\n * attributes: subplot attributes object\n * partition: 'x' or 'y', which direction to divide domain space by default\n * (default 'x', ie side-by-side subplots)\n * TODO: this option is only here because 3D and geo made opposite\n * choices in this regard previously and I didn't want to change it.\n * Instead we should do:\n * - something consistent\n * - something more square (4 cuts 2x2, 5/6 cuts 2x3, etc.)\n * - something that includes all subplot types in one arrangement,\n * now that we can have them together!\n * handleDefaults: function of (subplotLayoutIn, subplotLayoutOut, coerce, opts)\n * this opts object is passed through to handleDefaults, so attach any\n * additional items needed by this function here as well\n * }\n */\nmodule.exports = function handleSubplotDefaults(layoutIn, layoutOut, fullData, opts) {\n var subplotType = opts.type;\n var subplotAttributes = opts.attributes;\n var handleDefaults = opts.handleDefaults;\n var partition = opts.partition || 'x';\n\n var ids = layoutOut._subplots[subplotType];\n var idsLength = ids.length;\n\n var baseId = idsLength && ids[0].replace(/\\d+$/, '');\n\n var subplotLayoutIn, subplotLayoutOut;\n\n function coerce(attr, dflt) {\n return Lib.coerce(subplotLayoutIn, subplotLayoutOut, subplotAttributes, attr, dflt);\n }\n\n for(var i = 0; i < idsLength; i++) {\n var id = ids[i];\n\n // ternary traces get a layout ternary for free!\n if(layoutIn[id]) subplotLayoutIn = layoutIn[id];\n else subplotLayoutIn = layoutIn[id] = {};\n\n subplotLayoutOut = Template.newContainer(layoutOut, id, baseId);\n\n // All subplot containers get a `uirevision` inheriting from the base.\n // Currently all subplots containers have some user interaction\n // attributes, but if we ever add one that doesn't, we would need an\n // option to skip this step.\n coerce('uirevision', layoutOut.uirevision);\n\n var dfltDomains = {};\n dfltDomains[partition] = [i / idsLength, (i + 1) / idsLength];\n handleDomainDefaults(subplotLayoutOut, layoutOut, coerce, dfltDomains);\n\n opts.id = id;\n handleDefaults(subplotLayoutIn, subplotLayoutOut, coerce, opts);\n }\n};\n\n},{\"../lib\":728,\"../plot_api/plot_template\":766,\"./domain\":803}],854:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar FORMAT_LINK = _dereq_('../constants/docs').FORMAT_LINK;\nvar DATE_FORMAT_LINK = _dereq_('../constants/docs').DATE_FORMAT_LINK;\n\nvar templateFormatStringDescription = [\n 'Variables are inserted using %{variable}, for example \"y: %{y}\".',\n 'Numbers are formatted using d3-format\\'s syntax %{variable:d3-format}, for example \"Price: %{y:$.2f}\".',\n FORMAT_LINK,\n 'for details on the formatting syntax.',\n 'Dates are formatted using d3-time-format\\'s syntax %{variable|d3-time-format}, for example \"Day: %{2019-01-01|%A}\".',\n DATE_FORMAT_LINK,\n 'for details on the date formatting syntax.'\n].join(' ');\n\nfunction describeVariables(extra) {\n var descPart = extra.description ? ' ' + extra.description : '';\n var keys = extra.keys || [];\n if(keys.length > 0) {\n var quotedKeys = [];\n for(var i = 0; i < keys.length; i++) {\n quotedKeys[i] = '`' + keys[i] + '`';\n }\n descPart = descPart + 'Finally, the template string has access to ';\n if(keys.length === 1) {\n descPart = 'variable ' + quotedKeys[0];\n } else {\n descPart = 'variables ' + quotedKeys.slice(0, -1).join(', ') + ' and ' + quotedKeys.slice(-1) + '.';\n }\n }\n return descPart;\n}\n\nexports.hovertemplateAttrs = function(opts, extra) {\n opts = opts || {};\n extra = extra || {};\n\n var descPart = describeVariables(extra);\n\n var hovertemplate = {\n valType: 'string',\n \n dflt: '',\n editType: opts.editType || 'none',\n \n };\n\n if(opts.arrayOk !== false) {\n hovertemplate.arrayOk = true;\n }\n\n return hovertemplate;\n};\n\nexports.texttemplateAttrs = function(opts, extra) {\n opts = opts || {};\n extra = extra || {};\n\n var descPart = describeVariables(extra);\n\n var texttemplate = {\n valType: 'string',\n \n dflt: '',\n editType: opts.editType || 'calc',\n \n };\n\n if(opts.arrayOk !== false) {\n texttemplate.arrayOk = true;\n }\n return texttemplate;\n};\n\n},{\"../constants/docs\":699}],855:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Ternary = _dereq_('./ternary');\n\nvar getSubplotCalcData = _dereq_('../../plots/get_data').getSubplotCalcData;\nvar counterRegex = _dereq_('../../lib').counterRegex;\nvar TERNARY = 'ternary';\n\nexports.name = TERNARY;\n\nvar attr = exports.attr = 'subplot';\n\nexports.idRoot = TERNARY;\n\nexports.idRegex = exports.attrRegex = counterRegex(TERNARY);\n\nvar attributes = exports.attributes = {};\nattributes[attr] = {\n valType: 'subplotid',\n \n dflt: 'ternary',\n editType: 'calc',\n \n};\n\nexports.layoutAttributes = _dereq_('./layout_attributes');\n\nexports.supplyLayoutDefaults = _dereq_('./layout_defaults');\n\nexports.plot = function plot(gd) {\n var fullLayout = gd._fullLayout;\n var calcData = gd.calcdata;\n var ternaryIds = fullLayout._subplots[TERNARY];\n\n for(var i = 0; i < ternaryIds.length; i++) {\n var ternaryId = ternaryIds[i];\n var ternaryCalcData = getSubplotCalcData(calcData, TERNARY, ternaryId);\n var ternary = fullLayout[ternaryId]._subplot;\n\n // If ternary is not instantiated, create one!\n if(!ternary) {\n ternary = new Ternary({\n id: ternaryId,\n graphDiv: gd,\n container: fullLayout._ternarylayer.node()\n },\n fullLayout\n );\n\n fullLayout[ternaryId]._subplot = ternary;\n }\n\n ternary.plot(ternaryCalcData, fullLayout, gd._promises);\n }\n};\n\nexports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) {\n var oldTernaryKeys = oldFullLayout._subplots[TERNARY] || [];\n\n for(var i = 0; i < oldTernaryKeys.length; i++) {\n var oldTernaryKey = oldTernaryKeys[i];\n var oldTernary = oldFullLayout[oldTernaryKey]._subplot;\n\n if(!newFullLayout[oldTernaryKey] && !!oldTernary) {\n oldTernary.plotContainer.remove();\n oldTernary.clipDef.remove();\n oldTernary.clipDefRelative.remove();\n oldTernary.layers['a-title'].remove();\n oldTernary.layers['b-title'].remove();\n oldTernary.layers['c-title'].remove();\n }\n }\n};\n\n},{\"../../lib\":728,\"../../plots/get_data\":813,\"./layout_attributes\":856,\"./layout_defaults\":857,\"./ternary\":858}],856:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar colorAttrs = _dereq_('../../components/color/attributes');\nvar domainAttrs = _dereq_('../domain').attributes;\nvar axesAttrs = _dereq_('../cartesian/layout_attributes');\n\nvar overrideAll = _dereq_('../../plot_api/edit_types').overrideAll;\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nvar ternaryAxesAttrs = {\n title: {\n text: axesAttrs.title.text,\n font: axesAttrs.title.font\n // TODO does standoff here make sense?\n },\n color: axesAttrs.color,\n // ticks\n tickmode: axesAttrs.tickmode,\n nticks: extendFlat({}, axesAttrs.nticks, {dflt: 6, min: 1}),\n tick0: axesAttrs.tick0,\n dtick: axesAttrs.dtick,\n tickvals: axesAttrs.tickvals,\n ticktext: axesAttrs.ticktext,\n ticks: axesAttrs.ticks,\n ticklen: axesAttrs.ticklen,\n tickwidth: axesAttrs.tickwidth,\n tickcolor: axesAttrs.tickcolor,\n showticklabels: axesAttrs.showticklabels,\n showtickprefix: axesAttrs.showtickprefix,\n tickprefix: axesAttrs.tickprefix,\n showticksuffix: axesAttrs.showticksuffix,\n ticksuffix: axesAttrs.ticksuffix,\n showexponent: axesAttrs.showexponent,\n exponentformat: axesAttrs.exponentformat,\n separatethousands: axesAttrs.separatethousands,\n tickfont: axesAttrs.tickfont,\n tickangle: axesAttrs.tickangle,\n tickformat: axesAttrs.tickformat,\n tickformatstops: axesAttrs.tickformatstops,\n hoverformat: axesAttrs.hoverformat,\n // lines and grids\n showline: extendFlat({}, axesAttrs.showline, {dflt: true}),\n linecolor: axesAttrs.linecolor,\n linewidth: axesAttrs.linewidth,\n showgrid: extendFlat({}, axesAttrs.showgrid, {dflt: true}),\n gridcolor: axesAttrs.gridcolor,\n gridwidth: axesAttrs.gridwidth,\n layer: axesAttrs.layer,\n // range\n min: {\n valType: 'number',\n dflt: 0,\n \n min: 0,\n \n },\n _deprecated: {\n title: axesAttrs._deprecated.title,\n titlefont: axesAttrs._deprecated.titlefont\n }\n};\n\nvar attrs = module.exports = overrideAll({\n domain: domainAttrs({name: 'ternary'}),\n\n bgcolor: {\n valType: 'color',\n \n dflt: colorAttrs.background,\n \n },\n sum: {\n valType: 'number',\n \n dflt: 1,\n min: 0,\n \n },\n aaxis: ternaryAxesAttrs,\n baxis: ternaryAxesAttrs,\n caxis: ternaryAxesAttrs\n}, 'plot', 'from-root');\n\n// set uirevisions outside of `overrideAll` so we can get `editType: none`\nattrs.uirevision = {\n valType: 'any',\n \n editType: 'none',\n \n};\n\nattrs.aaxis.uirevision = attrs.baxis.uirevision = attrs.caxis.uirevision = {\n valType: 'any',\n \n editType: 'none',\n \n};\n\n},{\"../../components/color/attributes\":594,\"../../lib/extend\":719,\"../../plot_api/edit_types\":759,\"../cartesian/layout_attributes\":790,\"../domain\":803}],857:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Color = _dereq_('../../components/color');\nvar Template = _dereq_('../../plot_api/plot_template');\nvar Lib = _dereq_('../../lib');\n\nvar handleSubplotDefaults = _dereq_('../subplot_defaults');\nvar handleTickLabelDefaults = _dereq_('../cartesian/tick_label_defaults');\nvar handleTickMarkDefaults = _dereq_('../cartesian/tick_mark_defaults');\nvar handleTickValueDefaults = _dereq_('../cartesian/tick_value_defaults');\nvar handleLineGridDefaults = _dereq_('../cartesian/line_grid_defaults');\nvar layoutAttributes = _dereq_('./layout_attributes');\n\nvar axesNames = ['aaxis', 'baxis', 'caxis'];\n\nmodule.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {\n handleSubplotDefaults(layoutIn, layoutOut, fullData, {\n type: 'ternary',\n attributes: layoutAttributes,\n handleDefaults: handleTernaryDefaults,\n font: layoutOut.font,\n paper_bgcolor: layoutOut.paper_bgcolor\n });\n};\n\nfunction handleTernaryDefaults(ternaryLayoutIn, ternaryLayoutOut, coerce, options) {\n var bgColor = coerce('bgcolor');\n var sum = coerce('sum');\n options.bgColor = Color.combine(bgColor, options.paper_bgcolor);\n var axName, containerIn, containerOut;\n\n // TODO: allow most (if not all) axis attributes to be set\n // in the outer container and used as defaults in the individual axes?\n\n for(var j = 0; j < axesNames.length; j++) {\n axName = axesNames[j];\n containerIn = ternaryLayoutIn[axName] || {};\n containerOut = Template.newContainer(ternaryLayoutOut, axName);\n containerOut._name = axName;\n\n handleAxisDefaults(containerIn, containerOut, options, ternaryLayoutOut);\n }\n\n // if the min values contradict each other, set them all to default (0)\n // and delete *all* the inputs so the user doesn't get confused later by\n // changing one and having them all change.\n var aaxis = ternaryLayoutOut.aaxis;\n var baxis = ternaryLayoutOut.baxis;\n var caxis = ternaryLayoutOut.caxis;\n if(aaxis.min + baxis.min + caxis.min >= sum) {\n aaxis.min = 0;\n baxis.min = 0;\n caxis.min = 0;\n if(ternaryLayoutIn.aaxis) delete ternaryLayoutIn.aaxis.min;\n if(ternaryLayoutIn.baxis) delete ternaryLayoutIn.baxis.min;\n if(ternaryLayoutIn.caxis) delete ternaryLayoutIn.caxis.min;\n }\n}\n\nfunction handleAxisDefaults(containerIn, containerOut, options, ternaryLayoutOut) {\n var axAttrs = layoutAttributes[containerOut._name];\n\n function coerce(attr, dflt) {\n return Lib.coerce(containerIn, containerOut, axAttrs, attr, dflt);\n }\n\n coerce('uirevision', ternaryLayoutOut.uirevision);\n\n containerOut.type = 'linear'; // no other types allowed for ternary\n\n var dfltColor = coerce('color');\n // if axis.color was provided, use it for fonts too; otherwise,\n // inherit from global font color in case that was provided.\n var dfltFontColor = (dfltColor !== axAttrs.color.dflt) ? dfltColor : options.font.color;\n\n var axName = containerOut._name;\n var letterUpper = axName.charAt(0).toUpperCase();\n var dfltTitle = 'Component ' + letterUpper;\n\n var title = coerce('title.text', dfltTitle);\n containerOut._hovertitle = title === dfltTitle ? title : letterUpper;\n\n Lib.coerceFont(coerce, 'title.font', {\n family: options.font.family,\n size: Math.round(options.font.size * 1.2),\n color: dfltFontColor\n });\n\n // range is just set by 'min' - max is determined by the other axes mins\n coerce('min');\n\n handleTickValueDefaults(containerIn, containerOut, coerce, 'linear');\n handleTickLabelDefaults(containerIn, containerOut, coerce, 'linear', {});\n handleTickMarkDefaults(containerIn, containerOut, coerce,\n { outerTicks: true });\n\n var showTickLabels = coerce('showticklabels');\n if(showTickLabels) {\n Lib.coerceFont(coerce, 'tickfont', {\n family: options.font.family,\n size: options.font.size,\n color: dfltFontColor\n });\n coerce('tickangle');\n coerce('tickformat');\n }\n\n handleLineGridDefaults(containerIn, containerOut, coerce, {\n dfltColor: dfltColor,\n bgColor: options.bgColor,\n // default grid color is darker here (60%, vs cartesian default ~91%)\n // because the grid is not square so the eye needs heavier cues to follow\n blend: 60,\n showLine: true,\n showGrid: true,\n noZeroLine: true,\n attributes: axAttrs\n });\n\n coerce('hoverformat');\n coerce('layer');\n}\n\n},{\"../../components/color\":595,\"../../lib\":728,\"../../plot_api/plot_template\":766,\"../cartesian/line_grid_defaults\":792,\"../cartesian/tick_label_defaults\":797,\"../cartesian/tick_mark_defaults\":798,\"../cartesian/tick_value_defaults\":799,\"../subplot_defaults\":853,\"./layout_attributes\":856}],858:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar tinycolor = _dereq_('tinycolor2');\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\nvar _ = Lib._;\nvar Color = _dereq_('../../components/color');\nvar Drawing = _dereq_('../../components/drawing');\nvar setConvert = _dereq_('../cartesian/set_convert');\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\nvar Plots = _dereq_('../plots');\nvar Axes = _dereq_('../cartesian/axes');\nvar dragElement = _dereq_('../../components/dragelement');\nvar Fx = _dereq_('../../components/fx');\nvar dragHelpers = _dereq_('../../components/dragelement/helpers');\nvar freeMode = dragHelpers.freeMode;\nvar rectMode = dragHelpers.rectMode;\nvar Titles = _dereq_('../../components/titles');\nvar prepSelect = _dereq_('../cartesian/select').prepSelect;\nvar selectOnClick = _dereq_('../cartesian/select').selectOnClick;\nvar clearSelect = _dereq_('../cartesian/select').clearSelect;\nvar clearSelectionsCache = _dereq_('../cartesian/select').clearSelectionsCache;\nvar constants = _dereq_('../cartesian/constants');\n\nfunction Ternary(options, fullLayout) {\n this.id = options.id;\n this.graphDiv = options.graphDiv;\n this.init(fullLayout);\n this.makeFramework(fullLayout);\n\n // unfortunately, we have to keep track of some axis tick settings\n // as ternary subplots do not implement the 'ticks' editType\n this.aTickLayout = null;\n this.bTickLayout = null;\n this.cTickLayout = null;\n}\n\nmodule.exports = Ternary;\n\nvar proto = Ternary.prototype;\n\nproto.init = function(fullLayout) {\n this.container = fullLayout._ternarylayer;\n this.defs = fullLayout._defs;\n this.layoutId = fullLayout._uid;\n this.traceHash = {};\n this.layers = {};\n};\n\nproto.plot = function(ternaryCalcData, fullLayout) {\n var _this = this;\n var ternaryLayout = fullLayout[_this.id];\n var graphSize = fullLayout._size;\n\n _this._hasClipOnAxisFalse = false;\n for(var i = 0; i < ternaryCalcData.length; i++) {\n var trace = ternaryCalcData[i][0].trace;\n\n if(trace.cliponaxis === false) {\n _this._hasClipOnAxisFalse = true;\n break;\n }\n }\n\n _this.updateLayers(ternaryLayout);\n _this.adjustLayout(ternaryLayout, graphSize);\n Plots.generalUpdatePerTraceModule(_this.graphDiv, _this, ternaryCalcData, ternaryLayout);\n _this.layers.plotbg.select('path').call(Color.fill, ternaryLayout.bgcolor);\n};\n\nproto.makeFramework = function(fullLayout) {\n var _this = this;\n var gd = _this.graphDiv;\n var ternaryLayout = fullLayout[_this.id];\n\n var clipId = _this.clipId = 'clip' + _this.layoutId + _this.id;\n var clipIdRelative = _this.clipIdRelative = 'clip-relative' + _this.layoutId + _this.id;\n\n // clippath for this ternary subplot\n _this.clipDef = Lib.ensureSingleById(fullLayout._clips, 'clipPath', clipId, function(s) {\n s.append('path').attr('d', 'M0,0Z');\n });\n\n // 'relative' clippath (i.e. no translation) for this ternary subplot\n _this.clipDefRelative = Lib.ensureSingleById(fullLayout._clips, 'clipPath', clipIdRelative, function(s) {\n s.append('path').attr('d', 'M0,0Z');\n });\n\n // container for everything in this ternary subplot\n _this.plotContainer = Lib.ensureSingle(_this.container, 'g', _this.id);\n _this.updateLayers(ternaryLayout);\n\n Drawing.setClipUrl(_this.layers.backplot, clipId, gd);\n Drawing.setClipUrl(_this.layers.grids, clipId, gd);\n};\n\nproto.updateLayers = function(ternaryLayout) {\n var _this = this;\n var layers = _this.layers;\n\n // inside that container, we have one container for the data, and\n // one each for the three axes around it.\n\n var plotLayers = ['draglayer', 'plotbg', 'backplot', 'grids'];\n\n if(ternaryLayout.aaxis.layer === 'below traces') {\n plotLayers.push('aaxis', 'aline');\n }\n if(ternaryLayout.baxis.layer === 'below traces') {\n plotLayers.push('baxis', 'bline');\n }\n if(ternaryLayout.caxis.layer === 'below traces') {\n plotLayers.push('caxis', 'cline');\n }\n\n plotLayers.push('frontplot');\n\n if(ternaryLayout.aaxis.layer === 'above traces') {\n plotLayers.push('aaxis', 'aline');\n }\n if(ternaryLayout.baxis.layer === 'above traces') {\n plotLayers.push('baxis', 'bline');\n }\n if(ternaryLayout.caxis.layer === 'above traces') {\n plotLayers.push('caxis', 'cline');\n }\n\n var toplevel = _this.plotContainer.selectAll('g.toplevel')\n .data(plotLayers, String);\n\n var grids = ['agrid', 'bgrid', 'cgrid'];\n\n toplevel.enter().append('g')\n .attr('class', function(d) { return 'toplevel ' + d; })\n .each(function(d) {\n var s = d3.select(this);\n layers[d] = s;\n\n // containers for different trace types.\n // NOTE - this is different from cartesian, where all traces\n // are in front of grids. Here I'm putting maps behind the grids\n // so the grids will always be visible if they're requested.\n // Perhaps we want that for cartesian too?\n if(d === 'frontplot') {\n s.append('g').classed('scatterlayer', true);\n } else if(d === 'backplot') {\n s.append('g').classed('maplayer', true);\n } else if(d === 'plotbg') {\n s.append('path').attr('d', 'M0,0Z');\n } else if(d === 'aline' || d === 'bline' || d === 'cline') {\n s.append('path');\n } else if(d === 'grids') {\n grids.forEach(function(d) {\n layers[d] = s.append('g').classed('grid ' + d, true);\n });\n }\n });\n\n toplevel.order();\n};\n\nvar whRatio = Math.sqrt(4 / 3);\n\nproto.adjustLayout = function(ternaryLayout, graphSize) {\n var _this = this;\n var domain = ternaryLayout.domain;\n var xDomainCenter = (domain.x[0] + domain.x[1]) / 2;\n var yDomainCenter = (domain.y[0] + domain.y[1]) / 2;\n var xDomain = domain.x[1] - domain.x[0];\n var yDomain = domain.y[1] - domain.y[0];\n var wmax = xDomain * graphSize.w;\n var hmax = yDomain * graphSize.h;\n var sum = ternaryLayout.sum;\n var amin = ternaryLayout.aaxis.min;\n var bmin = ternaryLayout.baxis.min;\n var cmin = ternaryLayout.caxis.min;\n\n var x0, y0, w, h, xDomainFinal, yDomainFinal;\n\n if(wmax > whRatio * hmax) {\n h = hmax;\n w = h * whRatio;\n } else {\n w = wmax;\n h = w / whRatio;\n }\n\n xDomainFinal = xDomain * w / wmax;\n yDomainFinal = yDomain * h / hmax;\n\n x0 = graphSize.l + graphSize.w * xDomainCenter - w / 2;\n y0 = graphSize.t + graphSize.h * (1 - yDomainCenter) - h / 2;\n\n _this.x0 = x0;\n _this.y0 = y0;\n _this.w = w;\n _this.h = h;\n _this.sum = sum;\n\n // set up the x and y axis objects we'll use to lay out the points\n _this.xaxis = {\n type: 'linear',\n range: [amin + 2 * cmin - sum, sum - amin - 2 * bmin],\n domain: [\n xDomainCenter - xDomainFinal / 2,\n xDomainCenter + xDomainFinal / 2\n ],\n _id: 'x'\n };\n setConvert(_this.xaxis, _this.graphDiv._fullLayout);\n _this.xaxis.setScale();\n _this.xaxis.isPtWithinRange = function(d) {\n return (\n d.a >= _this.aaxis.range[0] &&\n d.a <= _this.aaxis.range[1] &&\n d.b >= _this.baxis.range[1] &&\n d.b <= _this.baxis.range[0] &&\n d.c >= _this.caxis.range[1] &&\n d.c <= _this.caxis.range[0]\n );\n };\n\n _this.yaxis = {\n type: 'linear',\n range: [amin, sum - bmin - cmin],\n domain: [\n yDomainCenter - yDomainFinal / 2,\n yDomainCenter + yDomainFinal / 2\n ],\n _id: 'y'\n };\n setConvert(_this.yaxis, _this.graphDiv._fullLayout);\n _this.yaxis.setScale();\n _this.yaxis.isPtWithinRange = function() { return true; };\n\n // set up the modified axes for tick drawing\n var yDomain0 = _this.yaxis.domain[0];\n\n // aaxis goes up the left side. Set it up as a y axis, but with\n // fictitious angles and domain, but then rotate and translate\n // it into place at the end\n var aaxis = _this.aaxis = extendFlat({}, ternaryLayout.aaxis, {\n range: [amin, sum - bmin - cmin],\n side: 'left',\n // tickangle = 'auto' means 0 anyway for a y axis, need to coerce to 0 here\n // so we can shift by 30.\n tickangle: (+ternaryLayout.aaxis.tickangle || 0) - 30,\n domain: [yDomain0, yDomain0 + yDomainFinal * whRatio],\n anchor: 'free',\n position: 0,\n _id: 'y',\n _length: w\n });\n setConvert(aaxis, _this.graphDiv._fullLayout);\n aaxis.setScale();\n\n // baxis goes across the bottom (backward). We can set it up as an x axis\n // without any enclosing transformation.\n var baxis = _this.baxis = extendFlat({}, ternaryLayout.baxis, {\n range: [sum - amin - cmin, bmin],\n side: 'bottom',\n domain: _this.xaxis.domain,\n anchor: 'free',\n position: 0,\n _id: 'x',\n _length: w\n });\n setConvert(baxis, _this.graphDiv._fullLayout);\n baxis.setScale();\n\n // caxis goes down the right side. Set it up as a y axis, with\n // post-transformation similar to aaxis\n var caxis = _this.caxis = extendFlat({}, ternaryLayout.caxis, {\n range: [sum - amin - bmin, cmin],\n side: 'right',\n tickangle: (+ternaryLayout.caxis.tickangle || 0) + 30,\n domain: [yDomain0, yDomain0 + yDomainFinal * whRatio],\n anchor: 'free',\n position: 0,\n _id: 'y',\n _length: w\n });\n setConvert(caxis, _this.graphDiv._fullLayout);\n caxis.setScale();\n\n var triangleClip = 'M' + x0 + ',' + (y0 + h) + 'h' + w + 'l-' + (w / 2) + ',-' + h + 'Z';\n _this.clipDef.select('path').attr('d', triangleClip);\n _this.layers.plotbg.select('path').attr('d', triangleClip);\n\n var triangleClipRelative = 'M0,' + h + 'h' + w + 'l-' + (w / 2) + ',-' + h + 'Z';\n _this.clipDefRelative.select('path').attr('d', triangleClipRelative);\n\n var plotTransform = 'translate(' + x0 + ',' + y0 + ')';\n _this.plotContainer.selectAll('.scatterlayer,.maplayer')\n .attr('transform', plotTransform);\n\n _this.clipDefRelative.select('path').attr('transform', null);\n\n // TODO: shift axes to accommodate linewidth*sin(30) tick mark angle\n\n // TODO: there's probably an easier way to handle these translations/offsets now...\n var bTransform = 'translate(' + (x0 - baxis._offset) + ',' + (y0 + h) + ')';\n\n _this.layers.baxis.attr('transform', bTransform);\n _this.layers.bgrid.attr('transform', bTransform);\n\n var aTransform = 'translate(' + (x0 + w / 2) + ',' + y0 +\n ')rotate(30)translate(0,' + -aaxis._offset + ')';\n _this.layers.aaxis.attr('transform', aTransform);\n _this.layers.agrid.attr('transform', aTransform);\n\n var cTransform = 'translate(' + (x0 + w / 2) + ',' + y0 +\n ')rotate(-30)translate(0,' + -caxis._offset + ')';\n _this.layers.caxis.attr('transform', cTransform);\n _this.layers.cgrid.attr('transform', cTransform);\n\n _this.drawAxes(true);\n\n _this.layers.aline.select('path')\n .attr('d', aaxis.showline ?\n 'M' + x0 + ',' + (y0 + h) + 'l' + (w / 2) + ',-' + h : 'M0,0')\n .call(Color.stroke, aaxis.linecolor || '#000')\n .style('stroke-width', (aaxis.linewidth || 0) + 'px');\n _this.layers.bline.select('path')\n .attr('d', baxis.showline ?\n 'M' + x0 + ',' + (y0 + h) + 'h' + w : 'M0,0')\n .call(Color.stroke, baxis.linecolor || '#000')\n .style('stroke-width', (baxis.linewidth || 0) + 'px');\n _this.layers.cline.select('path')\n .attr('d', caxis.showline ?\n 'M' + (x0 + w / 2) + ',' + y0 + 'l' + (w / 2) + ',' + h : 'M0,0')\n .call(Color.stroke, caxis.linecolor || '#000')\n .style('stroke-width', (caxis.linewidth || 0) + 'px');\n\n if(!_this.graphDiv._context.staticPlot) {\n _this.initInteractions();\n }\n\n Drawing.setClipUrl(\n _this.layers.frontplot,\n _this._hasClipOnAxisFalse ? null : _this.clipId,\n _this.graphDiv\n );\n};\n\nproto.drawAxes = function(doTitles) {\n var _this = this;\n var gd = _this.graphDiv;\n var titlesuffix = _this.id.substr(7) + 'title';\n var layers = _this.layers;\n var aaxis = _this.aaxis;\n var baxis = _this.baxis;\n var caxis = _this.caxis;\n\n _this.drawAx(aaxis);\n _this.drawAx(baxis);\n _this.drawAx(caxis);\n\n if(doTitles) {\n var apad = Math.max(aaxis.showticklabels ? aaxis.tickfont.size / 2 : 0,\n (caxis.showticklabels ? caxis.tickfont.size * 0.75 : 0) +\n (caxis.ticks === 'outside' ? caxis.ticklen * 0.87 : 0));\n var bpad = (baxis.showticklabels ? baxis.tickfont.size : 0) +\n (baxis.ticks === 'outside' ? baxis.ticklen : 0) + 3;\n\n layers['a-title'] = Titles.draw(gd, 'a' + titlesuffix, {\n propContainer: aaxis,\n propName: _this.id + '.aaxis.title',\n placeholder: _(gd, 'Click to enter Component A title'),\n attributes: {\n x: _this.x0 + _this.w / 2,\n y: _this.y0 - aaxis.title.font.size / 3 - apad,\n 'text-anchor': 'middle'\n }\n });\n layers['b-title'] = Titles.draw(gd, 'b' + titlesuffix, {\n propContainer: baxis,\n propName: _this.id + '.baxis.title',\n placeholder: _(gd, 'Click to enter Component B title'),\n attributes: {\n x: _this.x0 - bpad,\n y: _this.y0 + _this.h + baxis.title.font.size * 0.83 + bpad,\n 'text-anchor': 'middle'\n }\n });\n layers['c-title'] = Titles.draw(gd, 'c' + titlesuffix, {\n propContainer: caxis,\n propName: _this.id + '.caxis.title',\n placeholder: _(gd, 'Click to enter Component C title'),\n attributes: {\n x: _this.x0 + _this.w + bpad,\n y: _this.y0 + _this.h + caxis.title.font.size * 0.83 + bpad,\n 'text-anchor': 'middle'\n }\n });\n }\n};\n\nproto.drawAx = function(ax) {\n var _this = this;\n var gd = _this.graphDiv;\n var axName = ax._name;\n var axLetter = axName.charAt(0);\n var axId = ax._id;\n var axLayer = _this.layers[axName];\n var counterAngle = 30;\n\n var stashKey = axLetter + 'tickLayout';\n var newTickLayout = strTickLayout(ax);\n if(_this[stashKey] !== newTickLayout) {\n axLayer.selectAll('.' + axId + 'tick').remove();\n _this[stashKey] = newTickLayout;\n }\n\n ax.setScale();\n\n var vals = Axes.calcTicks(ax);\n var valsClipped = Axes.clipEnds(ax, vals);\n var transFn = Axes.makeTransFn(ax);\n var tickSign = Axes.getTickSigns(ax)[2];\n\n var caRad = Lib.deg2rad(counterAngle);\n var pad = tickSign * (ax.linewidth || 1) / 2;\n var len = tickSign * ax.ticklen;\n var w = _this.w;\n var h = _this.h;\n\n var tickPath = axLetter === 'b' ?\n 'M0,' + pad + 'l' + (Math.sin(caRad) * len) + ',' + (Math.cos(caRad) * len) :\n 'M' + pad + ',0l' + (Math.cos(caRad) * len) + ',' + (-Math.sin(caRad) * len);\n\n var gridPath = {\n a: 'M0,0l' + h + ',-' + (w / 2),\n b: 'M0,0l-' + (w / 2) + ',-' + h,\n c: 'M0,0l-' + h + ',' + (w / 2)\n }[axLetter];\n\n Axes.drawTicks(gd, ax, {\n vals: ax.ticks === 'inside' ? valsClipped : vals,\n layer: axLayer,\n path: tickPath,\n transFn: transFn,\n crisp: false\n });\n\n Axes.drawGrid(gd, ax, {\n vals: valsClipped,\n layer: _this.layers[axLetter + 'grid'],\n path: gridPath,\n transFn: transFn,\n crisp: false\n });\n\n Axes.drawLabels(gd, ax, {\n vals: vals,\n layer: axLayer,\n transFn: transFn,\n labelFns: Axes.makeLabelFns(ax, 0, counterAngle)\n });\n};\n\nfunction strTickLayout(axLayout) {\n return axLayout.ticks + String(axLayout.ticklen) + String(axLayout.showticklabels);\n}\n\n// hard coded paths for zoom corners\n// uses the same sizing as cartesian, length is MINZOOM/2, width is 3px\nvar CLEN = constants.MINZOOM / 2 + 0.87;\nvar BLPATH = 'm-0.87,.5h' + CLEN + 'v3h-' + (CLEN + 5.2) +\n 'l' + (CLEN / 2 + 2.6) + ',-' + (CLEN * 0.87 + 4.5) +\n 'l2.6,1.5l-' + (CLEN / 2) + ',' + (CLEN * 0.87) + 'Z';\nvar BRPATH = 'm0.87,.5h-' + CLEN + 'v3h' + (CLEN + 5.2) +\n 'l-' + (CLEN / 2 + 2.6) + ',-' + (CLEN * 0.87 + 4.5) +\n 'l-2.6,1.5l' + (CLEN / 2) + ',' + (CLEN * 0.87) + 'Z';\nvar TOPPATH = 'm0,1l' + (CLEN / 2) + ',' + (CLEN * 0.87) +\n 'l2.6,-1.5l-' + (CLEN / 2 + 2.6) + ',-' + (CLEN * 0.87 + 4.5) +\n 'l-' + (CLEN / 2 + 2.6) + ',' + (CLEN * 0.87 + 4.5) +\n 'l2.6,1.5l' + (CLEN / 2) + ',-' + (CLEN * 0.87) + 'Z';\nvar STARTMARKER = 'm0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z';\n\n// I guess this could be shared with cartesian... but for now it's separate.\nvar SHOWZOOMOUTTIP = true;\n\nproto.clearSelect = function() {\n clearSelectionsCache(this.dragOptions);\n clearSelect(this.dragOptions.gd);\n};\n\nproto.initInteractions = function() {\n var _this = this;\n var dragger = _this.layers.plotbg.select('path').node();\n var gd = _this.graphDiv;\n var zoomLayer = gd._fullLayout._zoomlayer;\n\n // use plotbg for the main interactions\n this.dragOptions = {\n element: dragger,\n gd: gd,\n plotinfo: {\n id: _this.id,\n domain: gd._fullLayout[_this.id].domain,\n xaxis: _this.xaxis,\n yaxis: _this.yaxis\n },\n subplot: _this.id,\n prepFn: function(e, startX, startY) {\n // these aren't available yet when initInteractions\n // is called\n _this.dragOptions.xaxes = [_this.xaxis];\n _this.dragOptions.yaxes = [_this.yaxis];\n\n var dragModeNow = _this.dragOptions.dragmode = gd._fullLayout.dragmode;\n\n if(freeMode(dragModeNow)) _this.dragOptions.minDrag = 1;\n else _this.dragOptions.minDrag = undefined;\n\n if(dragModeNow === 'zoom') {\n _this.dragOptions.moveFn = zoomMove;\n _this.dragOptions.clickFn = clickZoomPan;\n _this.dragOptions.doneFn = zoomDone;\n zoomPrep(e, startX, startY);\n } else if(dragModeNow === 'pan') {\n _this.dragOptions.moveFn = plotDrag;\n _this.dragOptions.clickFn = clickZoomPan;\n _this.dragOptions.doneFn = dragDone;\n panPrep();\n _this.clearSelect(gd);\n } else if(rectMode(dragModeNow) || freeMode(dragModeNow)) {\n prepSelect(e, startX, startY, _this.dragOptions, dragModeNow);\n }\n }\n };\n\n var x0, y0, mins0, span0, mins, lum, path0, dimmed, zb, corners;\n\n function makeUpdate(_mins) {\n var attrs = {};\n attrs[_this.id + '.aaxis.min'] = _mins.a;\n attrs[_this.id + '.baxis.min'] = _mins.b;\n attrs[_this.id + '.caxis.min'] = _mins.c;\n return attrs;\n }\n\n function clickZoomPan(numClicks, evt) {\n var clickMode = gd._fullLayout.clickmode;\n\n removeZoombox(gd);\n\n if(numClicks === 2) {\n gd.emit('plotly_doubleclick', null);\n Registry.call('_guiRelayout', gd, makeUpdate({a: 0, b: 0, c: 0}));\n }\n\n if(clickMode.indexOf('select') > -1 && numClicks === 1) {\n selectOnClick(evt, gd, [_this.xaxis], [_this.yaxis], _this.id, _this.dragOptions);\n }\n\n if(clickMode.indexOf('event') > -1) {\n Fx.click(gd, evt, _this.id);\n }\n }\n\n function zoomPrep(e, startX, startY) {\n var dragBBox = dragger.getBoundingClientRect();\n x0 = startX - dragBBox.left;\n y0 = startY - dragBBox.top;\n mins0 = {\n a: _this.aaxis.range[0],\n b: _this.baxis.range[1],\n c: _this.caxis.range[1]\n };\n mins = mins0;\n span0 = _this.aaxis.range[1] - mins0.a;\n lum = tinycolor(_this.graphDiv._fullLayout[_this.id].bgcolor).getLuminance();\n path0 = 'M0,' + _this.h + 'L' + (_this.w / 2) + ', 0L' + _this.w + ',' + _this.h + 'Z';\n dimmed = false;\n\n zb = zoomLayer.append('path')\n .attr('class', 'zoombox')\n .attr('transform', 'translate(' + _this.x0 + ', ' + _this.y0 + ')')\n .style({\n 'fill': lum > 0.2 ? 'rgba(0,0,0,0)' : 'rgba(255,255,255,0)',\n 'stroke-width': 0\n })\n .attr('d', path0);\n\n corners = zoomLayer.append('path')\n .attr('class', 'zoombox-corners')\n .attr('transform', 'translate(' + _this.x0 + ', ' + _this.y0 + ')')\n .style({\n fill: Color.background,\n stroke: Color.defaultLine,\n 'stroke-width': 1,\n opacity: 0\n })\n .attr('d', 'M0,0Z');\n\n _this.clearSelect(gd);\n }\n\n function getAFrac(x, y) { return 1 - (y / _this.h); }\n function getBFrac(x, y) { return 1 - ((x + (_this.h - y) / Math.sqrt(3)) / _this.w); }\n function getCFrac(x, y) { return ((x - (_this.h - y) / Math.sqrt(3)) / _this.w); }\n\n function zoomMove(dx0, dy0) {\n var x1 = x0 + dx0;\n var y1 = y0 + dy0;\n var afrac = Math.max(0, Math.min(1, getAFrac(x0, y0), getAFrac(x1, y1)));\n var bfrac = Math.max(0, Math.min(1, getBFrac(x0, y0), getBFrac(x1, y1)));\n var cfrac = Math.max(0, Math.min(1, getCFrac(x0, y0), getCFrac(x1, y1)));\n var xLeft = ((afrac / 2) + cfrac) * _this.w;\n var xRight = (1 - (afrac / 2) - bfrac) * _this.w;\n var xCenter = (xLeft + xRight) / 2;\n var xSpan = xRight - xLeft;\n var yBottom = (1 - afrac) * _this.h;\n var yTop = yBottom - xSpan / whRatio;\n\n if(xSpan < constants.MINZOOM) {\n mins = mins0;\n zb.attr('d', path0);\n corners.attr('d', 'M0,0Z');\n } else {\n mins = {\n a: mins0.a + afrac * span0,\n b: mins0.b + bfrac * span0,\n c: mins0.c + cfrac * span0\n };\n zb.attr('d', path0 + 'M' + xLeft + ',' + yBottom +\n 'H' + xRight + 'L' + xCenter + ',' + yTop +\n 'L' + xLeft + ',' + yBottom + 'Z');\n corners.attr('d', 'M' + x0 + ',' + y0 + STARTMARKER +\n 'M' + xLeft + ',' + yBottom + BLPATH +\n 'M' + xRight + ',' + yBottom + BRPATH +\n 'M' + xCenter + ',' + yTop + TOPPATH);\n }\n\n if(!dimmed) {\n zb.transition()\n .style('fill', lum > 0.2 ? 'rgba(0,0,0,0.4)' :\n 'rgba(255,255,255,0.3)')\n .duration(200);\n corners.transition()\n .style('opacity', 1)\n .duration(200);\n dimmed = true;\n }\n\n gd.emit('plotly_relayouting', makeUpdate(mins));\n }\n\n function zoomDone() {\n removeZoombox(gd);\n\n if(mins === mins0) return;\n\n Registry.call('_guiRelayout', gd, makeUpdate(mins));\n\n if(SHOWZOOMOUTTIP && gd.data && gd._context.showTips) {\n Lib.notifier(_(gd, 'Double-click to zoom back out'), 'long');\n SHOWZOOMOUTTIP = false;\n }\n }\n\n function panPrep() {\n mins0 = {\n a: _this.aaxis.range[0],\n b: _this.baxis.range[1],\n c: _this.caxis.range[1]\n };\n mins = mins0;\n }\n\n function plotDrag(dx, dy) {\n var dxScaled = dx / _this.xaxis._m;\n var dyScaled = dy / _this.yaxis._m;\n mins = {\n a: mins0.a - dyScaled,\n b: mins0.b + (dxScaled + dyScaled) / 2,\n c: mins0.c - (dxScaled - dyScaled) / 2\n };\n var minsorted = [mins.a, mins.b, mins.c].sort(Lib.sorterAsc);\n var minindices = {\n a: minsorted.indexOf(mins.a),\n b: minsorted.indexOf(mins.b),\n c: minsorted.indexOf(mins.c)\n };\n if(minsorted[0] < 0) {\n if(minsorted[1] + minsorted[0] / 2 < 0) {\n minsorted[2] += minsorted[0] + minsorted[1];\n minsorted[0] = minsorted[1] = 0;\n } else {\n minsorted[2] += minsorted[0] / 2;\n minsorted[1] += minsorted[0] / 2;\n minsorted[0] = 0;\n }\n mins = {\n a: minsorted[minindices.a],\n b: minsorted[minindices.b],\n c: minsorted[minindices.c]\n };\n dy = (mins0.a - mins.a) * _this.yaxis._m;\n dx = (mins0.c - mins.c - mins0.b + mins.b) * _this.xaxis._m;\n }\n\n // move the data (translate, don't redraw)\n var plotTransform = 'translate(' + (_this.x0 + dx) + ',' + (_this.y0 + dy) + ')';\n _this.plotContainer.selectAll('.scatterlayer,.maplayer')\n .attr('transform', plotTransform);\n\n var plotTransform2 = 'translate(' + -dx + ',' + -dy + ')';\n _this.clipDefRelative.select('path').attr('transform', plotTransform2);\n\n // move the ticks\n _this.aaxis.range = [mins.a, _this.sum - mins.b - mins.c];\n _this.baxis.range = [_this.sum - mins.a - mins.c, mins.b];\n _this.caxis.range = [_this.sum - mins.a - mins.b, mins.c];\n\n _this.drawAxes(false);\n\n if(_this._hasClipOnAxisFalse) {\n _this.plotContainer\n .select('.scatterlayer').selectAll('.trace')\n .call(Drawing.hideOutsideRangePoints, _this);\n }\n\n gd.emit('plotly_relayouting', makeUpdate(mins));\n }\n\n function dragDone() {\n Registry.call('_guiRelayout', gd, makeUpdate(mins));\n }\n\n // finally, set up hover and click\n // these event handlers must already be set before dragElement.init\n // so it can stash them and override them.\n dragger.onmousemove = function(evt) {\n Fx.hover(gd, evt, _this.id);\n gd._fullLayout._lasthover = dragger;\n gd._fullLayout._hoversubplot = _this.id;\n };\n\n dragger.onmouseout = function(evt) {\n if(gd._dragging) return;\n\n dragElement.unhover(gd, evt);\n };\n\n dragElement.init(this.dragOptions);\n};\n\nfunction removeZoombox(gd) {\n d3.select(gd)\n .selectAll('.zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners')\n .remove();\n}\n\n},{\"../../components/color\":595,\"../../components/dragelement\":614,\"../../components/dragelement/helpers\":613,\"../../components/drawing\":617,\"../../components/fx\":635,\"../../components/titles\":690,\"../../lib\":728,\"../../lib/extend\":719,\"../../registry\":859,\"../cartesian/axes\":776,\"../cartesian/constants\":782,\"../cartesian/select\":795,\"../cartesian/set_convert\":796,\"../plots\":839,\"d3\":164,\"tinycolor2\":528}],859:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Loggers = _dereq_('./lib/loggers');\nvar noop = _dereq_('./lib/noop');\nvar pushUnique = _dereq_('./lib/push_unique');\nvar isPlainObject = _dereq_('./lib/is_plain_object');\nvar addStyleRule = _dereq_('./lib/dom').addStyleRule;\nvar ExtendModule = _dereq_('./lib/extend');\n\nvar basePlotAttributes = _dereq_('./plots/attributes');\nvar baseLayoutAttributes = _dereq_('./plots/layout_attributes');\n\nvar extendFlat = ExtendModule.extendFlat;\nvar extendDeepAll = ExtendModule.extendDeepAll;\n\nexports.modules = {};\nexports.allCategories = {};\nexports.allTypes = [];\nexports.subplotsRegistry = {};\nexports.transformsRegistry = {};\nexports.componentsRegistry = {};\nexports.layoutArrayContainers = [];\nexports.layoutArrayRegexes = [];\nexports.traceLayoutAttributes = {};\nexports.localeRegistry = {};\nexports.apiMethodRegistry = {};\nexports.collectableSubplotTypes = null;\n\n/**\n * Top-level register routine, exported as Plotly.register\n *\n * @param {object array or array of objects} _modules :\n * module object or list of module object to register.\n *\n * A valid `moduleType: 'trace'` module has fields:\n * - name {string} : the trace type\n * - categories {array} : categories associated with this trace type,\n * tested with Register.traceIs()\n * - meta {object} : meta info (mostly for plot-schema)\n *\n * A valid `moduleType: 'locale'` module has fields:\n * - name {string} : the locale name. Should be a 2-digit language string ('en', 'de')\n * optionally with a country/region code ('en-GB', 'de-CH'). If a country\n * code is used but the base language locale has not yet been supplied,\n * we will use this locale for the base as well.\n * - dictionary {object} : the dictionary mapping input strings to localized strings\n * generally the keys should be the literal input strings, but\n * if default translations are provided you can use any string as a key.\n * - format {object} : a `d3.locale` format specifier for this locale\n * any omitted keys we'll fall back on en-US.\n *\n * A valid `moduleType: 'transform'` module has fields:\n * - name {string} : transform name\n * - transform {function} : default-level transform function\n * - calcTransform {function} : calc-level transform function\n * - attributes {object} : transform attributes declarations\n * - supplyDefaults {function} : attributes default-supply function\n *\n * A valid `moduleType: 'component'` module has fields:\n * - name {string} : the component name, used it with Register.getComponentMethod()\n * to employ component method.\n *\n * A valid `moduleType: 'apiMethod'` module has fields:\n * - name {string} : the api method name.\n * - fn {function} : the api method called with Register.call();\n *\n */\nexports.register = function register(_modules) {\n exports.collectableSubplotTypes = null;\n\n if(!_modules) {\n throw new Error('No argument passed to Plotly.register.');\n } else if(_modules && !Array.isArray(_modules)) {\n _modules = [_modules];\n }\n\n for(var i = 0; i < _modules.length; i++) {\n var newModule = _modules[i];\n\n if(!newModule) {\n throw new Error('Invalid module was attempted to be registered!');\n }\n\n switch(newModule.moduleType) {\n case 'trace':\n registerTraceModule(newModule);\n break;\n case 'transform':\n registerTransformModule(newModule);\n break;\n case 'component':\n registerComponentModule(newModule);\n break;\n case 'locale':\n registerLocale(newModule);\n break;\n case 'apiMethod':\n var name = newModule.name;\n exports.apiMethodRegistry[name] = newModule.fn;\n break;\n default:\n throw new Error('Invalid module was attempted to be registered!');\n }\n }\n};\n\n/**\n * Get registered module using trace object or trace type\n *\n * @param {object||string} trace\n * trace object with prop 'type' or trace type as a string\n * @return {object}\n * module object corresponding to trace type\n */\nexports.getModule = function(trace) {\n var _module = exports.modules[getTraceType(trace)];\n if(!_module) return false;\n return _module._module;\n};\n\n/**\n * Determine if this trace type is in a given category\n *\n * @param {object||string} traceType\n * a trace (object) or trace type (string)\n * @param {string} category\n * category in question\n * @return {boolean}\n */\nexports.traceIs = function(traceType, category) {\n traceType = getTraceType(traceType);\n\n // old Chart Studio Cloud workspace hack, nothing to see here\n if(traceType === 'various') return false;\n\n var _module = exports.modules[traceType];\n\n if(!_module) {\n if(traceType && traceType !== 'area') {\n Loggers.log('Unrecognized trace type ' + traceType + '.');\n }\n\n _module = exports.modules[basePlotAttributes.type.dflt];\n }\n\n return !!_module.categories[category];\n};\n\n/**\n * Determine if this trace has a transform of the given type and return\n * array of matching indices.\n *\n * @param {object} data\n * a trace object (member of data or fullData)\n * @param {string} type\n * type of trace to test\n * @return {array}\n * array of matching indices. If none found, returns []\n */\nexports.getTransformIndices = function(data, type) {\n var indices = [];\n var transforms = data.transforms || [];\n for(var i = 0; i < transforms.length; i++) {\n if(transforms[i].type === type) {\n indices.push(i);\n }\n }\n return indices;\n};\n\n/**\n * Determine if this trace has a transform of the given type\n *\n * @param {object} data\n * a trace object (member of data or fullData)\n * @param {string} type\n * type of trace to test\n * @return {boolean}\n */\nexports.hasTransform = function(data, type) {\n var transforms = data.transforms || [];\n for(var i = 0; i < transforms.length; i++) {\n if(transforms[i].type === type) {\n return true;\n }\n }\n return false;\n};\n\n/**\n * Retrieve component module method. Falls back on noop if either the\n * module or the method is missing, so the result can always be safely called\n *\n * @param {string} name\n * name of component (as declared in component module)\n * @param {string} method\n * name of component module method\n * @return {function}\n */\nexports.getComponentMethod = function(name, method) {\n var _module = exports.componentsRegistry[name];\n\n if(!_module) return noop;\n return _module[method] || noop;\n};\n\n/**\n * Call registered api method.\n *\n * @param {string} name : api method name\n * @param {...array} args : arguments passed to api method\n * @return {any} : returns api method output\n */\nexports.call = function() {\n var name = arguments[0];\n var args = [].slice.call(arguments, 1);\n return exports.apiMethodRegistry[name].apply(null, args);\n};\n\nfunction registerTraceModule(_module) {\n var thisType = _module.name;\n var categoriesIn = _module.categories;\n var meta = _module.meta;\n\n if(exports.modules[thisType]) {\n Loggers.log('Type ' + thisType + ' already registered');\n return;\n }\n\n if(!exports.subplotsRegistry[_module.basePlotModule.name]) {\n registerSubplot(_module.basePlotModule);\n }\n\n var categoryObj = {};\n for(var i = 0; i < categoriesIn.length; i++) {\n categoryObj[categoriesIn[i]] = true;\n exports.allCategories[categoriesIn[i]] = true;\n }\n\n exports.modules[thisType] = {\n _module: _module,\n categories: categoryObj\n };\n\n if(meta && Object.keys(meta).length) {\n exports.modules[thisType].meta = meta;\n }\n\n exports.allTypes.push(thisType);\n\n for(var componentName in exports.componentsRegistry) {\n mergeComponentAttrsToTrace(componentName, thisType);\n }\n\n /*\n * Collect all trace layout attributes in one place for easier lookup later\n * but don't merge them into the base schema as it would confuse the docs\n * (at least after https://github.com/plotly/documentation/issues/202 gets done!)\n */\n if(_module.layoutAttributes) {\n extendFlat(exports.traceLayoutAttributes, _module.layoutAttributes);\n }\n\n var basePlotModule = _module.basePlotModule;\n var bpmName = basePlotModule.name;\n\n // add mapbox-gl CSS here to avoid console warning on instantiation\n if(bpmName === 'mapbox') {\n var styleRules = basePlotModule.constants.styleRules;\n for(var k in styleRules) {\n addStyleRule('.js-plotly-plot .plotly .mapboxgl-' + k, styleRules[k]);\n }\n }\n\n // if `plotly-geo-assets.js` is not included,\n // add `PlotlyGeoAssets` global to stash references to all fetched\n // topojson / geojson data\n if((bpmName === 'geo' || bpmName === 'mapbox') &&\n (typeof window !== undefined && window.PlotlyGeoAssets === undefined)\n ) {\n window.PlotlyGeoAssets = {topojson: {}};\n }\n}\n\nfunction registerSubplot(_module) {\n var plotType = _module.name;\n\n if(exports.subplotsRegistry[plotType]) {\n Loggers.log('Plot type ' + plotType + ' already registered.');\n return;\n }\n\n // relayout array handling will look for component module methods with this\n // name and won't find them because this is a subplot module... but that\n // should be fine, it will just fall back on redrawing the plot.\n findArrayRegexps(_module);\n\n // not sure what's best for the 'cartesian' type at this point\n exports.subplotsRegistry[plotType] = _module;\n\n for(var componentName in exports.componentsRegistry) {\n mergeComponentAttrsToSubplot(componentName, _module.name);\n }\n}\n\nfunction registerComponentModule(_module) {\n if(typeof _module.name !== 'string') {\n throw new Error('Component module *name* must be a string.');\n }\n\n var name = _module.name;\n exports.componentsRegistry[name] = _module;\n\n if(_module.layoutAttributes) {\n if(_module.layoutAttributes._isLinkedToArray) {\n pushUnique(exports.layoutArrayContainers, name);\n }\n findArrayRegexps(_module);\n }\n\n for(var traceType in exports.modules) {\n mergeComponentAttrsToTrace(name, traceType);\n }\n\n for(var subplotName in exports.subplotsRegistry) {\n mergeComponentAttrsToSubplot(name, subplotName);\n }\n\n for(var transformType in exports.transformsRegistry) {\n mergeComponentAttrsToTransform(name, transformType);\n }\n\n if(_module.schema && _module.schema.layout) {\n extendDeepAll(baseLayoutAttributes, _module.schema.layout);\n }\n}\n\nfunction registerTransformModule(_module) {\n if(typeof _module.name !== 'string') {\n throw new Error('Transform module *name* must be a string.');\n }\n\n var prefix = 'Transform module ' + _module.name;\n var hasTransform = typeof _module.transform === 'function';\n var hasCalcTransform = typeof _module.calcTransform === 'function';\n\n if(!hasTransform && !hasCalcTransform) {\n throw new Error(prefix + ' is missing a *transform* or *calcTransform* method.');\n }\n if(hasTransform && hasCalcTransform) {\n Loggers.log([\n prefix + ' has both a *transform* and *calcTransform* methods.',\n 'Please note that all *transform* methods are executed',\n 'before all *calcTransform* methods.'\n ].join(' '));\n }\n if(!isPlainObject(_module.attributes)) {\n Loggers.log(prefix + ' registered without an *attributes* object.');\n }\n if(typeof _module.supplyDefaults !== 'function') {\n Loggers.log(prefix + ' registered without a *supplyDefaults* method.');\n }\n\n exports.transformsRegistry[_module.name] = _module;\n\n for(var componentName in exports.componentsRegistry) {\n mergeComponentAttrsToTransform(componentName, _module.name);\n }\n}\n\nfunction registerLocale(_module) {\n var locale = _module.name;\n var baseLocale = locale.split('-')[0];\n\n var newDict = _module.dictionary;\n var newFormat = _module.format;\n var hasDict = newDict && Object.keys(newDict).length;\n var hasFormat = newFormat && Object.keys(newFormat).length;\n\n var locales = exports.localeRegistry;\n\n var localeObj = locales[locale];\n if(!localeObj) locales[locale] = localeObj = {};\n\n // Should we use this dict for the base locale?\n // In case we're overwriting a previous dict for this locale, check\n // whether the base matches the full locale dict now. If we're not\n // overwriting, locales[locale] is undefined so this just checks if\n // baseLocale already had a dict or not.\n // Same logic for dateFormats\n if(baseLocale !== locale) {\n var baseLocaleObj = locales[baseLocale];\n if(!baseLocaleObj) locales[baseLocale] = baseLocaleObj = {};\n\n if(hasDict && baseLocaleObj.dictionary === localeObj.dictionary) {\n baseLocaleObj.dictionary = newDict;\n }\n if(hasFormat && baseLocaleObj.format === localeObj.format) {\n baseLocaleObj.format = newFormat;\n }\n }\n\n if(hasDict) localeObj.dictionary = newDict;\n if(hasFormat) localeObj.format = newFormat;\n}\n\nfunction findArrayRegexps(_module) {\n if(_module.layoutAttributes) {\n var arrayAttrRegexps = _module.layoutAttributes._arrayAttrRegexps;\n if(arrayAttrRegexps) {\n for(var i = 0; i < arrayAttrRegexps.length; i++) {\n pushUnique(exports.layoutArrayRegexes, arrayAttrRegexps[i]);\n }\n }\n }\n}\n\nfunction mergeComponentAttrsToTrace(componentName, traceType) {\n var componentSchema = exports.componentsRegistry[componentName].schema;\n if(!componentSchema || !componentSchema.traces) return;\n\n var traceAttrs = componentSchema.traces[traceType];\n if(traceAttrs) {\n extendDeepAll(exports.modules[traceType]._module.attributes, traceAttrs);\n }\n}\n\nfunction mergeComponentAttrsToTransform(componentName, transformType) {\n var componentSchema = exports.componentsRegistry[componentName].schema;\n if(!componentSchema || !componentSchema.transforms) return;\n\n var transformAttrs = componentSchema.transforms[transformType];\n if(transformAttrs) {\n extendDeepAll(exports.transformsRegistry[transformType].attributes, transformAttrs);\n }\n}\n\nfunction mergeComponentAttrsToSubplot(componentName, subplotName) {\n var componentSchema = exports.componentsRegistry[componentName].schema;\n if(!componentSchema || !componentSchema.subplots) return;\n\n var subplotModule = exports.subplotsRegistry[subplotName];\n var subplotAttrs = subplotModule.layoutAttributes;\n var subplotAttr = subplotModule.attr === 'subplot' ? subplotModule.name : subplotModule.attr;\n if(Array.isArray(subplotAttr)) subplotAttr = subplotAttr[0];\n\n var componentLayoutAttrs = componentSchema.subplots[subplotAttr];\n if(subplotAttrs && componentLayoutAttrs) {\n extendDeepAll(subplotAttrs, componentLayoutAttrs);\n }\n}\n\nfunction getTraceType(traceType) {\n if(typeof traceType === 'object') traceType = traceType.type;\n return traceType;\n}\n\n},{\"./lib/dom\":717,\"./lib/extend\":719,\"./lib/is_plain_object\":729,\"./lib/loggers\":732,\"./lib/noop\":737,\"./lib/push_unique\":742,\"./plots/attributes\":773,\"./plots/layout_attributes\":830}],860:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../registry');\nvar Lib = _dereq_('../lib');\n\nvar extendFlat = Lib.extendFlat;\nvar extendDeep = Lib.extendDeep;\n\n// Put default plotTile layouts here\nfunction cloneLayoutOverride(tileClass) {\n var override;\n\n switch(tileClass) {\n case 'themes__thumb':\n override = {\n autosize: true,\n width: 150,\n height: 150,\n title: {text: ''},\n showlegend: false,\n margin: {l: 5, r: 5, t: 5, b: 5, pad: 0},\n annotations: []\n };\n break;\n\n case 'thumbnail':\n override = {\n title: {text: ''},\n hidesources: true,\n showlegend: false,\n borderwidth: 0,\n bordercolor: '',\n margin: {l: 1, r: 1, t: 1, b: 1, pad: 0},\n annotations: []\n };\n break;\n\n default:\n override = {};\n }\n\n\n return override;\n}\n\nfunction keyIsAxis(keyName) {\n var types = ['xaxis', 'yaxis', 'zaxis'];\n return (types.indexOf(keyName.slice(0, 5)) > -1);\n}\n\n\nmodule.exports = function clonePlot(graphObj, options) {\n // Polar plot compatibility\n if(graphObj.framework && graphObj.framework.isPolar) {\n graphObj = graphObj.framework.getConfig();\n }\n\n var i;\n var oldData = graphObj.data;\n var oldLayout = graphObj.layout;\n var newData = extendDeep([], oldData);\n var newLayout = extendDeep({}, oldLayout, cloneLayoutOverride(options.tileClass));\n var context = graphObj._context || {};\n\n if(options.width) newLayout.width = options.width;\n if(options.height) newLayout.height = options.height;\n\n if(options.tileClass === 'thumbnail' || options.tileClass === 'themes__thumb') {\n // kill annotations\n newLayout.annotations = [];\n var keys = Object.keys(newLayout);\n\n for(i = 0; i < keys.length; i++) {\n if(keyIsAxis(keys[i])) {\n newLayout[keys[i]].title = {text: ''};\n }\n }\n\n // kill colorbar and pie labels\n for(i = 0; i < newData.length; i++) {\n var trace = newData[i];\n trace.showscale = false;\n if(trace.marker) trace.marker.showscale = false;\n if(Registry.traceIs(trace, 'pie-like')) trace.textposition = 'none';\n }\n }\n\n if(Array.isArray(options.annotations)) {\n for(i = 0; i < options.annotations.length; i++) {\n newLayout.annotations.push(options.annotations[i]);\n }\n }\n\n // TODO: does this scene modification really belong here?\n // If we still need it, can it move into the gl3d module?\n var sceneIds = Object.keys(newLayout).filter(function(key) {\n return key.match(/^scene\\d*$/);\n });\n if(sceneIds.length) {\n var axesImageOverride = {};\n if(options.tileClass === 'thumbnail') {\n axesImageOverride = {\n title: {text: ''},\n showaxeslabels: false,\n showticklabels: false,\n linetickenable: false\n };\n }\n for(i = 0; i < sceneIds.length; i++) {\n var scene = newLayout[sceneIds[i]];\n\n if(!scene.xaxis) {\n scene.xaxis = {};\n }\n\n if(!scene.yaxis) {\n scene.yaxis = {};\n }\n\n if(!scene.zaxis) {\n scene.zaxis = {};\n }\n\n extendFlat(scene.xaxis, axesImageOverride);\n extendFlat(scene.yaxis, axesImageOverride);\n extendFlat(scene.zaxis, axesImageOverride);\n\n // TODO what does this do?\n scene._scene = null;\n }\n }\n\n var gd = document.createElement('div');\n if(options.tileClass) gd.className = options.tileClass;\n\n var plotTile = {\n gd: gd,\n td: gd, // for external (image server) compatibility\n layout: newLayout,\n data: newData,\n config: {\n staticPlot: (options.staticPlot === undefined) ?\n true :\n options.staticPlot,\n plotGlPixelRatio: (options.plotGlPixelRatio === undefined) ?\n 2 :\n options.plotGlPixelRatio,\n displaylogo: options.displaylogo || false,\n showLink: options.showLink || false,\n showTips: options.showTips || false,\n mapboxAccessToken: context.mapboxAccessToken\n }\n };\n\n if(options.setBackground !== 'transparent') {\n plotTile.config.setBackground = options.setBackground || 'opaque';\n }\n\n // attaching the default Layout the gd, so you can grab it later\n plotTile.gd.defaultLayout = cloneLayoutOverride(options.tileClass);\n\n return plotTile;\n};\n\n},{\"../lib\":728,\"../registry\":859}],861:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../lib');\n\nvar toImage = _dereq_('../plot_api/to_image');\n\nvar fileSaver = _dereq_('./filesaver');\nvar helpers = _dereq_('./helpers');\n\n/**\n * Plotly.downloadImage\n *\n * @param {object | string | HTML div} gd\n * can either be a data/layout/config object\n * or an existing graph
\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.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\n},{\"../lib\":728,\"../plot_api/to_image\":769,\"./filesaver\":862,\"./helpers\":863}],862:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../lib');\nvar helpers = _dereq_('./helpers');\n\n/*\n* substantial portions of this code from FileSaver.js\n* https://github.com/eligrey/FileSaver.js\n* License: https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md\n* FileSaver.js\n* A saveAs() FileSaver implementation.\n* 1.1.20160328\n*\n* By Eli Grey, http://eligrey.com\n* License: MIT\n* See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md\n*/\nfunction fileSaver(url, name, format) {\n var saveLink = document.createElement('a');\n var canUseSaveLink = 'download' in saveLink;\n\n var promise = new Promise(function(resolve, reject) {\n var blob;\n var objectUrl;\n\n if(Lib.isIE9orBelow()) {\n reject(new Error('IE < 10 unsupported'));\n }\n\n // Safari doesn't allow downloading of blob urls\n if(Lib.isSafari()) {\n var prefix = format === 'svg' ? ',' : ';base64,';\n helpers.octetStream(prefix + encodeURIComponent(url));\n return resolve(name);\n }\n\n // IE 10+ (native saveAs)\n if(Lib.isIE()) {\n // At this point we are only dealing with a decoded SVG as\n // a data URL (since IE only supports SVG)\n blob = helpers.createBlob(url, 'svg');\n window.navigator.msSaveBlob(blob, name);\n blob = null;\n return resolve(name);\n }\n\n if(canUseSaveLink) {\n blob = helpers.createBlob(url, format);\n objectUrl = helpers.createObjectURL(blob);\n\n saveLink.href = objectUrl;\n saveLink.download = name;\n document.body.appendChild(saveLink);\n saveLink.click();\n\n document.body.removeChild(saveLink);\n helpers.revokeObjectURL(objectUrl);\n blob = null;\n\n return resolve(name);\n }\n\n reject(new Error('download error'));\n });\n\n return promise;\n}\n\n\nmodule.exports = fileSaver;\n\n},{\"../lib\":728,\"./helpers\":863}],863:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../registry');\n\nexports.getDelay = function(fullLayout) {\n if(!fullLayout._has) return 0;\n\n return (\n fullLayout._has('gl3d') ||\n fullLayout._has('gl2d') ||\n fullLayout._has('mapbox')\n ) ? 500 : 0;\n};\n\nexports.getRedrawFunc = function(gd) {\n return function() {\n var fullLayout = gd._fullLayout || {};\n var hasPolar = fullLayout._has && fullLayout._has('polar');\n var hasLegacyPolar = !hasPolar && gd.data && gd.data[0] && gd.data[0].r;\n\n if(!hasLegacyPolar) {\n Registry.getComponentMethod('colorbar', 'draw')(gd);\n }\n };\n};\n\nexports.encodeSVG = function(svg) {\n return 'data:image/svg+xml,' + encodeURIComponent(svg);\n};\n\nexports.encodeJSON = function(json) {\n return 'data:application/json,' + encodeURIComponent(json);\n};\n\nvar DOM_URL = window.URL || window.webkitURL;\n\nexports.createObjectURL = function(blob) {\n return DOM_URL.createObjectURL(blob);\n};\n\nexports.revokeObjectURL = function(url) {\n return DOM_URL.revokeObjectURL(url);\n};\n\nexports.createBlob = function(url, format) {\n if(format === 'svg') {\n return new window.Blob([url], {type: 'image/svg+xml;charset=utf-8'});\n } else if(format === 'full-json') {\n return new window.Blob([url], {type: 'application/json;charset=utf-8'});\n } else {\n var binary = fixBinary(window.atob(url));\n return new window.Blob([binary], {type: 'image/' + format});\n }\n};\n\nexports.octetStream = function(s) {\n document.location.href = 'data:application/octet-stream' + s;\n};\n\n// Taken from https://bl.ocks.org/nolanlawson/0eac306e4dac2114c752\nfunction fixBinary(b) {\n var len = b.length;\n var buf = new ArrayBuffer(len);\n var arr = new Uint8Array(buf);\n for(var i = 0; i < len; i++) {\n arr[i] = b.charCodeAt(i);\n }\n return buf;\n}\n\nexports.IMAGE_URL_PREFIX = /^data:image\\/\\w+;base64,/;\n\nexports.MSG_IE_BAD_FORMAT = 'Sorry IE does not support downloading from canvas. Try {format:\\'svg\\'} instead.';\n\n},{\"../registry\":859}],864:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar helpers = _dereq_('./helpers');\n\nvar Snapshot = {\n getDelay: helpers.getDelay,\n getRedrawFunc: helpers.getRedrawFunc,\n clone: _dereq_('./cloneplot'),\n toSVG: _dereq_('./tosvg'),\n svgToImg: _dereq_('./svgtoimg'),\n toImage: _dereq_('./toimage'),\n downloadImage: _dereq_('./download')\n};\n\nmodule.exports = Snapshot;\n\n},{\"./cloneplot\":860,\"./download\":861,\"./helpers\":863,\"./svgtoimg\":865,\"./toimage\":866,\"./tosvg\":867}],865:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../lib');\nvar EventEmitter = _dereq_('events').EventEmitter;\n\nvar helpers = _dereq_('./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');\n var img = new Image();\n var svgBlob, url;\n\n if(format === 'svg' || Lib.isIE9orBelow() || 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\n},{\"../lib\":728,\"./helpers\":863,\"events\":107}],866:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar EventEmitter = _dereq_('events').EventEmitter;\n\nvar Registry = _dereq_('../registry');\nvar Lib = _dereq_('../lib');\n\nvar helpers = _dereq_('./helpers');\nvar clonePlot = _dereq_('./cloneplot');\nvar toSVG = _dereq_('./tosvg');\nvar svgToImg = _dereq_('./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('plot', 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\n},{\"../lib\":728,\"../registry\":859,\"./cloneplot\":860,\"./helpers\":863,\"./svgtoimg\":865,\"./tosvg\":867,\"events\":107}],867:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Lib = _dereq_('../lib');\nvar Drawing = _dereq_('../components/drawing');\nvar Color = _dereq_('../components/color');\n\nvar xmlnsNamespaces = _dereq_('../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\n if(fullLayout._gradientUrlQueryParts) {\n var queryParts = [];\n for(var k in fullLayout._gradientUrlQueryParts) queryParts.push(k);\n\n if(queryParts.length) {\n svg.selectAll(queryParts.join(',')).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 }\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 // 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\n},{\"../components/color\":595,\"../components/drawing\":617,\"../constants/xmlns_namespaces\":705,\"../lib\":728,\"d3\":164}],868:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\n// arrayOk attributes, merge them into calcdata array\nmodule.exports = function arraysToCalcdata(cd, trace) {\n for(var i = 0; i < cd.length; i++) cd[i].i = i;\n\n Lib.mergeArray(trace.text, cd, 'tx');\n Lib.mergeArray(trace.hovertext, cd, 'htx');\n\n var marker = trace.marker;\n if(marker) {\n Lib.mergeArray(marker.opacity, cd, 'mo', true);\n Lib.mergeArray(marker.color, cd, 'mc');\n\n var markerLine = marker.line;\n if(markerLine) {\n Lib.mergeArray(markerLine.color, cd, 'mlc');\n Lib.mergeArrayCastPositive(markerLine.width, cd, 'mlw');\n }\n }\n};\n\n},{\"../../lib\":728}],869:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar scatterAttrs = _dereq_('../scatter/attributes');\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar texttemplateAttrs = _dereq_('../../plots/template_attributes').texttemplateAttrs;\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\nvar fontAttrs = _dereq_('../../plots/font_attributes');\nvar constants = _dereq_('./constants');\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nvar textFontAttrs = fontAttrs({\n editType: 'calc',\n arrayOk: true,\n colorEditType: 'style',\n \n});\n\nvar scatterMarkerAttrs = scatterAttrs.marker;\nvar scatterMarkerLineAttrs = scatterMarkerAttrs.line;\n\nvar markerLineWidth = extendFlat({},\n scatterMarkerLineAttrs.width, { dflt: 0 });\n\nvar markerLine = extendFlat({\n width: markerLineWidth,\n editType: 'calc'\n}, colorScaleAttrs('marker.line'));\n\nvar marker = extendFlat({\n line: markerLine,\n editType: 'calc'\n}, colorScaleAttrs('marker'), {\n opacity: {\n valType: 'number',\n arrayOk: true,\n dflt: 1,\n min: 0,\n max: 1,\n \n editType: 'style',\n \n }\n});\n\nmodule.exports = {\n x: scatterAttrs.x,\n x0: scatterAttrs.x0,\n dx: scatterAttrs.dx,\n y: scatterAttrs.y,\n y0: scatterAttrs.y0,\n dy: scatterAttrs.dy,\n\n text: scatterAttrs.text,\n texttemplate: texttemplateAttrs({editType: 'plot'}, {\n keys: constants.eventDataKeys\n }),\n hovertext: scatterAttrs.hovertext,\n hovertemplate: hovertemplateAttrs({}, {\n keys: constants.eventDataKeys\n }),\n\n textposition: {\n valType: 'enumerated',\n \n values: ['inside', 'outside', 'auto', 'none'],\n dflt: 'none',\n arrayOk: true,\n editType: 'calc',\n \n },\n\n insidetextanchor: {\n valType: 'enumerated',\n values: ['end', 'middle', 'start'],\n dflt: 'end',\n \n editType: 'plot',\n \n },\n\n textangle: {\n valType: 'angle',\n dflt: 'auto',\n \n editType: 'plot',\n \n },\n\n textfont: extendFlat({}, textFontAttrs, {\n \n }),\n\n insidetextfont: extendFlat({}, textFontAttrs, {\n \n }),\n\n outsidetextfont: extendFlat({}, textFontAttrs, {\n \n }),\n\n constraintext: {\n valType: 'enumerated',\n values: ['inside', 'outside', 'both', 'none'],\n \n dflt: 'both',\n editType: 'calc',\n \n },\n\n cliponaxis: extendFlat({}, scatterAttrs.cliponaxis, {\n \n }),\n\n orientation: {\n valType: 'enumerated',\n \n values: ['v', 'h'],\n editType: 'calc+clearAxisTypes',\n \n },\n\n base: {\n valType: 'any',\n dflt: null,\n arrayOk: true,\n \n editType: 'calc',\n \n },\n\n offset: {\n valType: 'number',\n dflt: null,\n arrayOk: true,\n \n editType: 'calc',\n \n },\n\n width: {\n valType: 'number',\n dflt: null,\n min: 0,\n arrayOk: true,\n \n editType: 'calc',\n \n },\n\n marker: marker,\n\n offsetgroup: {\n valType: 'string',\n \n dflt: '',\n editType: 'calc',\n \n },\n alignmentgroup: {\n valType: 'string',\n \n dflt: '',\n editType: 'calc',\n \n },\n\n selected: {\n marker: {\n opacity: scatterAttrs.selected.marker.opacity,\n color: scatterAttrs.selected.marker.color,\n editType: 'style'\n },\n textfont: scatterAttrs.selected.textfont,\n editType: 'style'\n },\n unselected: {\n marker: {\n opacity: scatterAttrs.unselected.marker.opacity,\n color: scatterAttrs.unselected.marker.color,\n editType: 'style'\n },\n textfont: scatterAttrs.unselected.textfont,\n editType: 'style'\n },\n\n r: scatterAttrs.r,\n t: scatterAttrs.t,\n\n _deprecated: {\n bardir: {\n valType: 'enumerated',\n \n editType: 'calc',\n values: ['v', 'h'],\n \n }\n }\n};\n\n},{\"../../components/colorscale/attributes\":602,\"../../lib/extend\":719,\"../../plots/font_attributes\":804,\"../../plots/template_attributes\":854,\"../scatter/attributes\":1134,\"./constants\":871}],870:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar hasColorscale = _dereq_('../../components/colorscale/helpers').hasColorscale;\nvar colorscaleCalc = _dereq_('../../components/colorscale/calc');\nvar arraysToCalcdata = _dereq_('./arrays_to_calcdata');\nvar calcSelection = _dereq_('../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;\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 pos = ya.makeCalcdata(trace, 'y');\n } else {\n size = ya.makeCalcdata(trace, 'y', sizeOpts);\n pos = xa.makeCalcdata(trace, 'x');\n }\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(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\n},{\"../../components/colorscale/calc\":603,\"../../components/colorscale/helpers\":606,\"../../plots/cartesian/axes\":776,\"../scatter/calc_selection\":1136,\"./arrays_to_calcdata\":868}],871:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nmodule.exports = {\n // padding in pixels around text\n TEXTPAD: 3,\n // 'value' and 'label' are not really necessary for bar traces,\n // but they were made available to `texttemplate` (maybe by accident)\n // via tokens `%{value}` and `%{label}` starting in 1.50.0,\n // so let's include them in the event data also.\n eventDataKeys: ['value', 'label']\n};\n\n},{}],872:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray;\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\n\nvar Registry = _dereq_('../../registry');\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar getAxisGroup = _dereq_('../../plots/cartesian/axis_ids').getAxisGroup;\nvar Sieve = _dereq_('./sieve.js');\n\n/*\n * Bar chart stacking/grouping positioning and autoscaling calculations\n * for each direction separately calculate the ranges and positions\n * note that this handles histograms too\n * now doing this one subplot at a time\n */\n\nfunction crossTraceCalc(gd, plotinfo) {\n var xa = plotinfo.xaxis;\n var ya = plotinfo.yaxis;\n\n var fullLayout = gd._fullLayout;\n var fullTraces = gd._fullData;\n var calcTraces = gd.calcdata;\n var calcTracesHorz = [];\n var calcTracesVert = [];\n\n for(var i = 0; i < fullTraces.length; i++) {\n var fullTrace = fullTraces[i];\n if(\n fullTrace.visible === true &&\n Registry.traceIs(fullTrace, 'bar') &&\n fullTrace.xaxis === xa._id &&\n fullTrace.yaxis === ya._id\n ) {\n if(fullTrace.orientation === 'h') {\n calcTracesHorz.push(calcTraces[i]);\n } else {\n calcTracesVert.push(calcTraces[i]);\n }\n\n if(fullTrace._computePh) {\n var cd = gd.calcdata[i];\n for(var j = 0; j < cd.length; j++) {\n if(typeof cd[j].ph0 === 'function') cd[j].ph0 = cd[j].ph0();\n if(typeof cd[j].ph1 === 'function') cd[j].ph1 = cd[j].ph1();\n }\n }\n }\n }\n\n var opts = {\n mode: fullLayout.barmode,\n norm: fullLayout.barnorm,\n gap: fullLayout.bargap,\n groupgap: fullLayout.bargroupgap\n };\n\n setGroupPositions(gd, xa, ya, calcTracesVert, opts);\n setGroupPositions(gd, ya, xa, calcTracesHorz, opts);\n}\n\nfunction setGroupPositions(gd, pa, sa, calcTraces, opts) {\n if(!calcTraces.length) return;\n\n var excluded;\n var included;\n var i, calcTrace, fullTrace;\n\n initBase(sa, calcTraces);\n\n switch(opts.mode) {\n case 'overlay':\n setGroupPositionsInOverlayMode(pa, sa, calcTraces, opts);\n break;\n\n case 'group':\n // exclude from the group those traces for which the user set an offset\n excluded = [];\n included = [];\n for(i = 0; i < calcTraces.length; i++) {\n calcTrace = calcTraces[i];\n fullTrace = calcTrace[0].trace;\n\n if(fullTrace.offset === undefined) included.push(calcTrace);\n else excluded.push(calcTrace);\n }\n\n if(included.length) {\n setGroupPositionsInGroupMode(gd, pa, sa, included, opts);\n }\n if(excluded.length) {\n setGroupPositionsInOverlayMode(pa, sa, excluded, opts);\n }\n break;\n\n case 'stack':\n case 'relative':\n // exclude from the stack those traces for which the user set a base\n excluded = [];\n included = [];\n for(i = 0; i < calcTraces.length; i++) {\n calcTrace = calcTraces[i];\n fullTrace = calcTrace[0].trace;\n\n if(fullTrace.base === undefined) included.push(calcTrace);\n else excluded.push(calcTrace);\n }\n\n if(included.length) {\n setGroupPositionsInStackOrRelativeMode(gd, pa, sa, included, opts);\n }\n if(excluded.length) {\n setGroupPositionsInOverlayMode(pa, sa, excluded, opts);\n }\n break;\n }\n\n collectExtents(calcTraces, pa);\n}\n\nfunction initBase(sa, calcTraces) {\n var i, j;\n\n for(i = 0; i < calcTraces.length; i++) {\n var cd = calcTraces[i];\n var trace = cd[0].trace;\n var base = (trace.type === 'funnel') ? trace._base : trace.base;\n var b;\n\n // not sure if it really makes sense to have dates for bar size data...\n // ideally if we want to make gantt charts or something we'd treat\n // the actual size (trace.x or y) as time delta but base as absolute\n // time. But included here for completeness.\n var scalendar = trace.orientation === 'h' ? trace.xcalendar : trace.ycalendar;\n\n // 'base' on categorical axes makes no sense\n var d2c = sa.type === 'category' || sa.type === 'multicategory' ?\n function() { return null; } :\n sa.d2c;\n\n if(isArrayOrTypedArray(base)) {\n for(j = 0; j < Math.min(base.length, cd.length); j++) {\n b = d2c(base[j], 0, scalendar);\n if(isNumeric(b)) {\n cd[j].b = +b;\n cd[j].hasB = 1;\n } else cd[j].b = 0;\n }\n for(; j < cd.length; j++) {\n cd[j].b = 0;\n }\n } else {\n b = d2c(base, 0, scalendar);\n var hasBase = isNumeric(b);\n b = hasBase ? b : 0;\n for(j = 0; j < cd.length; j++) {\n cd[j].b = b;\n if(hasBase) cd[j].hasB = 1;\n }\n }\n }\n}\n\nfunction setGroupPositionsInOverlayMode(pa, sa, calcTraces, opts) {\n // update position axis and set bar offsets and widths\n for(var i = 0; i < calcTraces.length; i++) {\n var calcTrace = calcTraces[i];\n\n var sieve = new Sieve([calcTrace], {\n sepNegVal: false,\n overlapNoMerge: !opts.norm\n });\n\n // set bar offsets and widths, and update position axis\n setOffsetAndWidth(pa, sieve, opts);\n\n // set bar bases and sizes, and update size axis\n //\n // (note that `setGroupPositionsInOverlayMode` handles the case barnorm\n // is defined, because this function is also invoked for traces that\n // can't be grouped or stacked)\n if(opts.norm) {\n sieveBars(sieve);\n normalizeBars(sa, sieve, opts);\n } else {\n setBaseAndTop(sa, sieve);\n }\n }\n}\n\nfunction setGroupPositionsInGroupMode(gd, pa, sa, calcTraces, opts) {\n var sieve = new Sieve(calcTraces, {\n sepNegVal: false,\n overlapNoMerge: !opts.norm\n });\n\n // set bar offsets and widths, and update position axis\n setOffsetAndWidthInGroupMode(gd, pa, sieve, opts);\n\n // relative-stack bars within the same trace that would otherwise\n // be hidden\n unhideBarsWithinTrace(sieve);\n\n // set bar bases and sizes, and update size axis\n if(opts.norm) {\n sieveBars(sieve);\n normalizeBars(sa, sieve, opts);\n } else {\n setBaseAndTop(sa, sieve);\n }\n}\n\nfunction setGroupPositionsInStackOrRelativeMode(gd, pa, sa, calcTraces, opts) {\n var sieve = new Sieve(calcTraces, {\n sepNegVal: opts.mode === 'relative',\n overlapNoMerge: !(opts.norm || opts.mode === 'stack' || opts.mode === 'relative')\n });\n\n // set bar offsets and widths, and update position axis\n setOffsetAndWidth(pa, sieve, opts);\n\n // set bar bases and sizes, and update size axis\n stackBars(sa, sieve, opts);\n\n // flag the outmost bar (for text display purposes)\n for(var i = 0; i < calcTraces.length; i++) {\n var calcTrace = calcTraces[i];\n\n for(var j = 0; j < calcTrace.length; j++) {\n var bar = calcTrace[j];\n\n if(bar.s !== BADNUM) {\n var isOutmostBar = ((bar.b + bar.s) === sieve.get(bar.p, bar.s));\n if(isOutmostBar) bar._outmost = true;\n }\n }\n }\n\n // Note that marking the outmost bars has to be done\n // before `normalizeBars` changes `bar.b` and `bar.s`.\n if(opts.norm) normalizeBars(sa, sieve, opts);\n}\n\nfunction setOffsetAndWidth(pa, sieve, opts) {\n var minDiff = sieve.minDiff;\n var calcTraces = sieve.traces;\n\n // set bar offsets and widths\n var barGroupWidth = minDiff * (1 - opts.gap);\n var barWidthPlusGap = barGroupWidth;\n var barWidth = barWidthPlusGap * (1 - (opts.groupgap || 0));\n\n // computer bar group center and bar offset\n var offsetFromCenter = -barWidth / 2;\n\n for(var i = 0; i < calcTraces.length; i++) {\n var calcTrace = calcTraces[i];\n var t = calcTrace[0].t;\n\n // store bar width and offset for this trace\n t.barwidth = barWidth;\n t.poffset = offsetFromCenter;\n t.bargroupwidth = barGroupWidth;\n t.bardelta = minDiff;\n }\n\n // stack bars that only differ by rounding\n sieve.binWidth = calcTraces[0][0].t.barwidth / 100;\n\n // if defined, apply trace offset and width\n applyAttributes(sieve);\n\n // store the bar center in each calcdata item\n setBarCenterAndWidth(pa, sieve);\n\n // update position axes\n updatePositionAxis(pa, sieve);\n}\n\nfunction setOffsetAndWidthInGroupMode(gd, pa, sieve, opts) {\n var fullLayout = gd._fullLayout;\n var positions = sieve.positions;\n var distinctPositions = sieve.distinctPositions;\n var minDiff = sieve.minDiff;\n var calcTraces = sieve.traces;\n var nTraces = calcTraces.length;\n\n // if there aren't any overlapping positions,\n // let them have full width even if mode is group\n var overlap = (positions.length !== distinctPositions.length);\n var barGroupWidth = minDiff * (1 - opts.gap);\n\n var groupId = getAxisGroup(fullLayout, pa._id) + calcTraces[0][0].trace.orientation;\n var alignmentGroups = fullLayout._alignmentOpts[groupId] || {};\n\n for(var i = 0; i < nTraces; i++) {\n var calcTrace = calcTraces[i];\n var trace = calcTrace[0].trace;\n\n var alignmentGroupOpts = alignmentGroups[trace.alignmentgroup] || {};\n var nOffsetGroups = Object.keys(alignmentGroupOpts.offsetGroups || {}).length;\n\n var barWidthPlusGap;\n if(nOffsetGroups) {\n barWidthPlusGap = barGroupWidth / nOffsetGroups;\n } else {\n barWidthPlusGap = overlap ? barGroupWidth / nTraces : barGroupWidth;\n }\n\n var barWidth = barWidthPlusGap * (1 - (opts.groupgap || 0));\n\n var offsetFromCenter;\n if(nOffsetGroups) {\n offsetFromCenter = ((2 * trace._offsetIndex + 1 - nOffsetGroups) * barWidthPlusGap - barWidth) / 2;\n } else {\n offsetFromCenter = overlap ?\n ((2 * i + 1 - nTraces) * barWidthPlusGap - barWidth) / 2 :\n -barWidth / 2;\n }\n\n var t = calcTrace[0].t;\n t.barwidth = barWidth;\n t.poffset = offsetFromCenter;\n t.bargroupwidth = barGroupWidth;\n t.bardelta = minDiff;\n }\n\n // stack bars that only differ by rounding\n sieve.binWidth = calcTraces[0][0].t.barwidth / 100;\n\n // if defined, apply trace width\n applyAttributes(sieve);\n\n // store the bar center in each calcdata item\n setBarCenterAndWidth(pa, sieve);\n\n // update position axes\n updatePositionAxis(pa, sieve, overlap);\n}\n\nfunction applyAttributes(sieve) {\n var calcTraces = sieve.traces;\n var i, j;\n\n for(i = 0; i < calcTraces.length; i++) {\n var calcTrace = calcTraces[i];\n var calcTrace0 = calcTrace[0];\n var fullTrace = calcTrace0.trace;\n var t = calcTrace0.t;\n var offset = fullTrace._offset || fullTrace.offset;\n var initialPoffset = t.poffset;\n var newPoffset;\n\n if(isArrayOrTypedArray(offset)) {\n // if offset is an array, then clone it into t.poffset.\n newPoffset = Array.prototype.slice.call(offset, 0, calcTrace.length);\n\n // guard against non-numeric items\n for(j = 0; j < newPoffset.length; j++) {\n if(!isNumeric(newPoffset[j])) {\n newPoffset[j] = initialPoffset;\n }\n }\n\n // if the length of the array is too short,\n // then extend it with the initial value of t.poffset\n for(j = newPoffset.length; j < calcTrace.length; j++) {\n newPoffset.push(initialPoffset);\n }\n\n t.poffset = newPoffset;\n } else if(offset !== undefined) {\n t.poffset = offset;\n }\n\n var width = fullTrace._width || fullTrace.width;\n var initialBarwidth = t.barwidth;\n\n if(isArrayOrTypedArray(width)) {\n // if width is an array, then clone it into t.barwidth.\n var newBarwidth = Array.prototype.slice.call(width, 0, calcTrace.length);\n\n // guard against non-numeric items\n for(j = 0; j < newBarwidth.length; j++) {\n if(!isNumeric(newBarwidth[j])) newBarwidth[j] = initialBarwidth;\n }\n\n // if the length of the array is too short,\n // then extend it with the initial value of t.barwidth\n for(j = newBarwidth.length; j < calcTrace.length; j++) {\n newBarwidth.push(initialBarwidth);\n }\n\n t.barwidth = newBarwidth;\n\n // if user didn't set offset,\n // then correct t.poffset to ensure bars remain centered\n if(offset === undefined) {\n newPoffset = [];\n for(j = 0; j < calcTrace.length; j++) {\n newPoffset.push(\n initialPoffset + (initialBarwidth - newBarwidth[j]) / 2\n );\n }\n t.poffset = newPoffset;\n }\n } else if(width !== undefined) {\n t.barwidth = width;\n\n // if user didn't set offset,\n // then correct t.poffset to ensure bars remain centered\n if(offset === undefined) {\n t.poffset = initialPoffset + (initialBarwidth - width) / 2;\n }\n }\n }\n}\n\nfunction setBarCenterAndWidth(pa, sieve) {\n var calcTraces = sieve.traces;\n var pLetter = getAxisLetter(pa);\n\n for(var i = 0; i < calcTraces.length; i++) {\n var calcTrace = calcTraces[i];\n var t = calcTrace[0].t;\n var poffset = t.poffset;\n var poffsetIsArray = Array.isArray(poffset);\n var barwidth = t.barwidth;\n var barwidthIsArray = Array.isArray(barwidth);\n\n for(var j = 0; j < calcTrace.length; j++) {\n var calcBar = calcTrace[j];\n\n // store the actual bar width and position, for use by hover\n var width = calcBar.w = barwidthIsArray ? barwidth[j] : barwidth;\n calcBar[pLetter] = calcBar.p + (poffsetIsArray ? poffset[j] : poffset) + width / 2;\n }\n }\n}\n\nfunction updatePositionAxis(pa, sieve, allowMinDtick) {\n var calcTraces = sieve.traces;\n var minDiff = sieve.minDiff;\n var vpad = minDiff / 2;\n\n Axes.minDtick(pa, sieve.minDiff, sieve.distinctPositions[0], allowMinDtick);\n\n for(var i = 0; i < calcTraces.length; i++) {\n var calcTrace = calcTraces[i];\n var calcTrace0 = calcTrace[0];\n var fullTrace = calcTrace0.trace;\n var pts = [];\n var bar, l, r, j;\n\n for(j = 0; j < calcTrace.length; j++) {\n bar = calcTrace[j];\n l = bar.p - vpad;\n r = bar.p + vpad;\n pts.push(l, r);\n }\n\n if(fullTrace.width || fullTrace.offset) {\n var t = calcTrace0.t;\n var poffset = t.poffset;\n var barwidth = t.barwidth;\n var poffsetIsArray = Array.isArray(poffset);\n var barwidthIsArray = Array.isArray(barwidth);\n\n for(j = 0; j < calcTrace.length; j++) {\n bar = calcTrace[j];\n var calcBarOffset = poffsetIsArray ? poffset[j] : poffset;\n var calcBarWidth = barwidthIsArray ? barwidth[j] : barwidth;\n l = bar.p + calcBarOffset;\n r = l + calcBarWidth;\n pts.push(l, r);\n }\n }\n\n fullTrace._extremes[pa._id] = Axes.findExtremes(pa, pts, {padded: false});\n }\n}\n\n// store these bar bases and tops in calcdata\n// and make sure the size axis includes zero,\n// along with the bases and tops of each bar.\nfunction setBaseAndTop(sa, sieve) {\n var calcTraces = sieve.traces;\n var sLetter = getAxisLetter(sa);\n\n for(var i = 0; i < calcTraces.length; i++) {\n var calcTrace = calcTraces[i];\n var fullTrace = calcTrace[0].trace;\n var pts = [];\n var tozero = false;\n\n for(var j = 0; j < calcTrace.length; j++) {\n var bar = calcTrace[j];\n var base = bar.b;\n var top = base + bar.s;\n\n bar[sLetter] = top;\n pts.push(top);\n if(bar.hasB) pts.push(base);\n\n if(!bar.hasB || !bar.b) {\n tozero = true;\n }\n }\n\n fullTrace._extremes[sa._id] = Axes.findExtremes(sa, pts, {\n tozero: tozero,\n padded: true\n });\n }\n}\n\nfunction stackBars(sa, sieve, opts) {\n var sLetter = getAxisLetter(sa);\n var calcTraces = sieve.traces;\n var calcTrace;\n var fullTrace;\n var isFunnel;\n var i, j;\n var bar;\n\n for(i = 0; i < calcTraces.length; i++) {\n calcTrace = calcTraces[i];\n fullTrace = calcTrace[0].trace;\n\n if(fullTrace.type === 'funnel') {\n for(j = 0; j < calcTrace.length; j++) {\n bar = calcTrace[j];\n\n if(bar.s !== BADNUM) {\n // create base of funnels\n sieve.put(bar.p, -0.5 * bar.s);\n }\n }\n }\n }\n\n for(i = 0; i < calcTraces.length; i++) {\n calcTrace = calcTraces[i];\n fullTrace = calcTrace[0].trace;\n\n isFunnel = (fullTrace.type === 'funnel');\n\n var pts = [];\n\n for(j = 0; j < calcTrace.length; j++) {\n bar = calcTrace[j];\n\n if(bar.s !== BADNUM) {\n // stack current bar and get previous sum\n var value;\n if(isFunnel) {\n value = bar.s;\n } else {\n value = bar.s + bar.b;\n }\n\n var base = sieve.put(bar.p, value);\n\n var top = base + value;\n\n // store the bar base and top in each calcdata item\n bar.b = base;\n bar[sLetter] = top;\n\n if(!opts.norm) {\n pts.push(top);\n if(bar.hasB) {\n pts.push(base);\n }\n }\n }\n }\n\n // if barnorm is set, let normalizeBars update the axis range\n if(!opts.norm) {\n fullTrace._extremes[sa._id] = Axes.findExtremes(sa, pts, {\n // N.B. we don't stack base with 'base',\n // so set tozero:true always!\n tozero: true,\n padded: true\n });\n }\n }\n}\n\nfunction sieveBars(sieve) {\n var calcTraces = sieve.traces;\n\n for(var i = 0; i < calcTraces.length; i++) {\n var calcTrace = calcTraces[i];\n\n for(var j = 0; j < calcTrace.length; j++) {\n var bar = calcTrace[j];\n\n if(bar.s !== BADNUM) {\n sieve.put(bar.p, bar.b + bar.s);\n }\n }\n }\n}\n\nfunction unhideBarsWithinTrace(sieve) {\n var calcTraces = sieve.traces;\n\n for(var i = 0; i < calcTraces.length; i++) {\n var calcTrace = calcTraces[i];\n var fullTrace = calcTrace[0].trace;\n\n if(fullTrace.base === undefined) {\n var inTraceSieve = new Sieve([calcTrace], {\n sepNegVal: true,\n overlapNoMerge: true\n });\n\n for(var j = 0; j < calcTrace.length; j++) {\n var bar = calcTrace[j];\n\n if(bar.p !== BADNUM) {\n // stack current bar and get previous sum\n var base = inTraceSieve.put(bar.p, bar.b + bar.s);\n\n // if previous sum if non-zero, this means:\n // multiple bars have same starting point are potentially hidden,\n // shift them vertically so that all bars are visible by default\n if(base) bar.b = base;\n }\n }\n }\n }\n}\n\n// Note:\n//\n// normalizeBars requires that either sieveBars or stackBars has been\n// previously invoked.\nfunction normalizeBars(sa, sieve, opts) {\n var calcTraces = sieve.traces;\n var sLetter = getAxisLetter(sa);\n var sTop = opts.norm === 'fraction' ? 1 : 100;\n var sTiny = sTop / 1e9; // in case of rounding error in sum\n var sMin = sa.l2c(sa.c2l(0));\n var sMax = opts.mode === 'stack' ? sTop : sMin;\n\n function needsPadding(v) {\n return (\n isNumeric(sa.c2l(v)) &&\n ((v < sMin - sTiny) || (v > sMax + sTiny) || !isNumeric(sMin))\n );\n }\n\n for(var i = 0; i < calcTraces.length; i++) {\n var calcTrace = calcTraces[i];\n var fullTrace = calcTrace[0].trace;\n var pts = [];\n var tozero = false;\n var padded = false;\n\n for(var j = 0; j < calcTrace.length; j++) {\n var bar = calcTrace[j];\n\n if(bar.s !== BADNUM) {\n var scale = Math.abs(sTop / sieve.get(bar.p, bar.s));\n bar.b *= scale;\n bar.s *= scale;\n\n var base = bar.b;\n var top = base + bar.s;\n\n bar[sLetter] = top;\n pts.push(top);\n padded = padded || needsPadding(top);\n\n if(bar.hasB) {\n pts.push(base);\n padded = padded || needsPadding(base);\n }\n\n if(!bar.hasB || !bar.b) {\n tozero = true;\n }\n }\n }\n\n fullTrace._extremes[sa._id] = Axes.findExtremes(sa, pts, {\n tozero: tozero,\n padded: padded\n });\n }\n}\n\n// find the full position span of bars at each position\n// for use by hover, to ensure labels move in if bars are\n// narrower than the space they're in.\n// run once per trace group (subplot & direction) and\n// the same mapping is attached to all calcdata traces\nfunction collectExtents(calcTraces, pa) {\n var pLetter = getAxisLetter(pa);\n var extents = {};\n var i, j, cd;\n\n var pMin = Infinity;\n var pMax = -Infinity;\n\n for(i = 0; i < calcTraces.length; i++) {\n cd = calcTraces[i];\n for(j = 0; j < cd.length; j++) {\n var p = cd[j].p;\n if(isNumeric(p)) {\n pMin = Math.min(pMin, p);\n pMax = Math.max(pMax, p);\n }\n }\n }\n\n // this is just for positioning of hover labels, and nobody will care if\n // the label is 1px too far out; so round positions to 1/10K in case\n // position values don't exactly match from trace to trace\n var roundFactor = 10000 / (pMax - pMin);\n var round = extents.round = function(p) {\n return String(Math.round(roundFactor * (p - pMin)));\n };\n\n for(i = 0; i < calcTraces.length; i++) {\n cd = calcTraces[i];\n cd[0].t.extents = extents;\n\n var poffset = cd[0].t.poffset;\n var poffsetIsArray = Array.isArray(poffset);\n\n for(j = 0; j < cd.length; j++) {\n var di = cd[j];\n var p0 = di[pLetter] - di.w / 2;\n\n if(isNumeric(p0)) {\n var p1 = di[pLetter] + di.w / 2;\n var pVal = round(di.p);\n if(extents[pVal]) {\n extents[pVal] = [Math.min(p0, extents[pVal][0]), Math.max(p1, extents[pVal][1])];\n } else {\n extents[pVal] = [p0, p1];\n }\n }\n\n di.p0 = di.p + (poffsetIsArray ? poffset[j] : poffset);\n di.p1 = di.p0 + di.w;\n di.s0 = di.b;\n di.s1 = di.s0 + di.s;\n }\n }\n}\n\nfunction getAxisLetter(ax) {\n return ax._id.charAt(0);\n}\n\nmodule.exports = {\n crossTraceCalc: crossTraceCalc,\n setGroupPositions: setGroupPositions\n};\n\n},{\"../../constants/numerical\":704,\"../../lib\":728,\"../../plots/cartesian/axes\":776,\"../../plots/cartesian/axis_ids\":779,\"../../registry\":859,\"./sieve.js\":882,\"fast-isnumeric\":236}],873:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Color = _dereq_('../../components/color');\nvar Registry = _dereq_('../../registry');\n\nvar handleXYDefaults = _dereq_('../scatter/xy_defaults');\nvar handleStyleDefaults = _dereq_('./style_defaults');\nvar getAxisGroup = _dereq_('../../plots/cartesian/axis_ids').getAxisGroup;\nvar attributes = _dereq_('./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 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\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 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\nfunction crossTraceDefaults(fullData, fullLayout) {\n var traceIn, traceOut;\n\n function coerce(attr) {\n return Lib.coerce(traceOut._input, traceOut, attributes, attr);\n }\n\n if(fullLayout.barmode === 'group') {\n for(var i = 0; i < fullData.length; i++) {\n traceOut = fullData[i];\n\n if(traceOut.type === 'bar') {\n traceIn = traceOut._input;\n handleGroupingDefaults(traceIn, traceOut, fullLayout, coerce);\n }\n }\n }\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 handleGroupingDefaults: handleGroupingDefaults,\n handleText: handleText\n};\n\n},{\"../../components/color\":595,\"../../lib\":728,\"../../plots/cartesian/axis_ids\":779,\"../../registry\":859,\"../scatter/xy_defaults\":1160,\"./attributes\":869,\"./style_defaults\":884}],874:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\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\n},{}],875:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar tinycolor = _dereq_('tinycolor2');\nvar isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray;\n\nexports.coerceString = function(attributeDefinition, value, defaultValue) {\n if(typeof value === 'string') {\n if(value || !attributeDefinition.noBlank) return value;\n } else if(typeof value === 'number' || value === true) {\n if(!attributeDefinition.strict) return String(value);\n }\n\n return (defaultValue !== undefined) ?\n defaultValue :\n attributeDefinition.dflt;\n};\n\nexports.coerceNumber = function(attributeDefinition, value, defaultValue) {\n if(isNumeric(value)) {\n value = +value;\n\n var min = attributeDefinition.min;\n var max = attributeDefinition.max;\n var isOutOfBounds = (min !== undefined && value < min) ||\n (max !== undefined && value > max);\n\n if(!isOutOfBounds) return value;\n }\n\n return (defaultValue !== undefined) ?\n defaultValue :\n attributeDefinition.dflt;\n};\n\nexports.coerceColor = function(attributeDefinition, value, defaultValue) {\n if(tinycolor(value).isValid()) return value;\n\n return (defaultValue !== undefined) ?\n defaultValue :\n attributeDefinition.dflt;\n};\n\nexports.coerceEnumerated = function(attributeDefinition, value, defaultValue) {\n if(attributeDefinition.coerceNumber) value = +value;\n\n if(attributeDefinition.values.indexOf(value) !== -1) return value;\n\n return (defaultValue !== undefined) ?\n defaultValue :\n attributeDefinition.dflt;\n};\n\nexports.getValue = function(arrayOrScalar, index) {\n var value;\n if(!Array.isArray(arrayOrScalar)) value = arrayOrScalar;\n else if(index < arrayOrScalar.length) value = arrayOrScalar[index];\n return value;\n};\n\nexports.getLineWidth = function(trace, di) {\n var w =\n (0 < di.mlw) ? di.mlw :\n !isArrayOrTypedArray(trace.marker.line.width) ? trace.marker.line.width :\n 0;\n\n return w;\n};\n\n},{\"../../lib\":728,\"fast-isnumeric\":236,\"tinycolor2\":528}],876:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Fx = _dereq_('../../components/fx');\nvar Registry = _dereq_('../../registry');\nvar Color = _dereq_('../../components/color');\n\nvar fillText = _dereq_('../../lib').fillText;\nvar getLineWidth = _dereq_('./helpers').getLineWidth;\nvar hoverLabelText = _dereq_('../../plots/cartesian/axes').hoverLabelText;\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\n\nfunction hoverPoints(pointData, xval, yval, hovermode) {\n var barPointData = hoverOnBars(pointData, xval, yval, hovermode);\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) {\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\n var posVal, sizeVal, posLetter, sizeLetter, dx, dy, pRangeCalc;\n\n function thisBarMinPos(di) { return di[posLetter] - di.w / 2; }\n function thisBarMaxPos(di) { return di[posLetter] + di.w / 2; }\n\n var minPos = isClosest ?\n thisBarMinPos :\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 :\n function(di) {\n return Math.max(thisBarMaxPos(di), di.p + t.bardelta / 2);\n };\n\n function _positionFn(_minPos, _maxPos) {\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 maxHoverDistance + Math.min(1, Math.abs(_maxPos - _minPos) / pRangeCalc) - 1);\n }\n\n function positionFn(di) {\n return _positionFn(minPos(di), maxPos(di));\n }\n\n function thisBarPositionFn(di) {\n return _positionFn(thisBarMinPos(di), thisBarMaxPos(di));\n }\n\n function sizeFn(di) {\n var v = sizeVal;\n var b = di.b;\n var s = di[sizeLetter];\n\n if(isWaterfall) {\n var rawS = Math.abs(di.rawS) || 0;\n if(v > 0) {\n s += rawS;\n } else if(v < 0) {\n s -= rawS;\n }\n }\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 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 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(!isClosest) {\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 pointData[posLetter + 'LabelVal'] = di.p;\n\n pointData.labelLabel = hoverLabelText(pa, pointData[posLetter + 'LabelVal']);\n pointData.valueLabel = hoverLabelText(sa, pointData[sizeLetter + 'LabelVal']);\n\n // spikelines always want \"closest\" distance regardless of hovermode\n pointData.spikeDistance = (sizeFn(di) + thisBarPositionFn(di)) / 2 - maxHoverDistance;\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\n},{\"../../components/color\":595,\"../../components/fx\":635,\"../../constants/numerical\":704,\"../../lib\":728,\"../../plots/cartesian/axes\":776,\"../../registry\":859,\"./helpers\":875}],877:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n attributes: _dereq_('./attributes'),\n layoutAttributes: _dereq_('./layout_attributes'),\n supplyDefaults: _dereq_('./defaults').supplyDefaults,\n crossTraceDefaults: _dereq_('./defaults').crossTraceDefaults,\n supplyLayoutDefaults: _dereq_('./layout_defaults'),\n calc: _dereq_('./calc'),\n crossTraceCalc: _dereq_('./cross_trace_calc').crossTraceCalc,\n colorbar: _dereq_('../scatter/marker_colorbar'),\n arraysToCalcdata: _dereq_('./arrays_to_calcdata'),\n plot: _dereq_('./plot').plot,\n style: _dereq_('./style').style,\n styleOnSelect: _dereq_('./style').styleOnSelect,\n hoverPoints: _dereq_('./hover').hoverPoints,\n eventData: _dereq_('./event_data'),\n selectPoints: _dereq_('./select'),\n\n moduleType: 'trace',\n name: 'bar',\n basePlotModule: _dereq_('../../plots/cartesian'),\n categories: ['bar-like', 'cartesian', 'svg', 'bar', 'oriented', 'errorBarsOK', 'showLegend', 'zoomScale'],\n animatable: true,\n meta: {\n \n }\n};\n\n},{\"../../plots/cartesian\":789,\"../scatter/marker_colorbar\":1152,\"./arrays_to_calcdata\":868,\"./attributes\":869,\"./calc\":870,\"./cross_trace_calc\":872,\"./defaults\":873,\"./event_data\":874,\"./hover\":876,\"./layout_attributes\":878,\"./layout_defaults\":879,\"./plot\":880,\"./select\":881,\"./style\":883}],878:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n\nmodule.exports = {\n barmode: {\n valType: 'enumerated',\n values: ['stack', 'group', 'overlay', 'relative'],\n dflt: 'group',\n \n editType: 'calc',\n \n },\n barnorm: {\n valType: 'enumerated',\n values: ['', 'fraction', 'percent'],\n dflt: '',\n \n editType: 'calc',\n \n },\n bargap: {\n valType: 'number',\n min: 0,\n max: 1,\n \n editType: 'calc',\n \n },\n bargroupgap: {\n valType: 'number',\n min: 0,\n max: 1,\n dflt: 0,\n \n editType: 'calc',\n \n }\n};\n\n},{}],879:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../../registry');\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar Lib = _dereq_('../../lib');\n\nvar layoutAttributes = _dereq_('./layout_attributes');\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};\n\n},{\"../../lib\":728,\"../../plots/cartesian/axes\":776,\"../../registry\":859,\"./layout_attributes\":878}],880:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Lib = _dereq_('../../lib');\nvar svgTextUtils = _dereq_('../../lib/svg_text_utils');\n\nvar Color = _dereq_('../../components/color');\nvar Drawing = _dereq_('../../components/drawing');\nvar Registry = _dereq_('../../registry');\nvar tickText = _dereq_('../../plots/cartesian/axes').tickText;\n\nvar uniformText = _dereq_('./uniform_text');\nvar recordMinTextSize = uniformText.recordMinTextSize;\nvar clearMinTextSize = uniformText.clearMinTextSize;\n\nvar style = _dereq_('./style');\nvar helpers = _dereq_('./helpers');\nvar constants = _dereq_('./constants');\nvar attributes = _dereq_('./attributes');\n\nvar attributeText = attributes.text;\nvar attributeTextPosition = attributes.textposition;\n\nvar appendArrayPointValue = _dereq_('../../components/fx/helpers').appendArrayPointValue;\n\nvar TEXTPAD = constants.TEXTPAD;\n\nfunction keyFunc(d) {return d.id;}\nfunction getKeyFunc(trace) {\n if(trace.ids) {\n return keyFunc;\n }\n}\n\nfunction dirSign(a, b) {\n return (a < b) ? 1 : -1;\n}\n\nfunction getXY(di, xa, ya, isHorizontal) {\n var s = [];\n var p = [];\n\n var sAxis = isHorizontal ? xa : ya;\n var pAxis = isHorizontal ? ya : xa;\n\n s[0] = sAxis.c2p(di.s0, true);\n p[0] = pAxis.c2p(di.p0, true);\n\n s[1] = sAxis.c2p(di.s1, true);\n p[1] = pAxis.c2p(di.p1, true);\n\n return isHorizontal ? [s, p] : [p, s];\n}\n\nfunction transition(selection, fullLayout, opts, makeOnCompleteCallback) {\n if(!fullLayout.uniformtext.mode && hasTransition(opts)) {\n var onComplete;\n if(makeOnCompleteCallback) {\n onComplete = makeOnCompleteCallback();\n }\n return selection\n .transition()\n .duration(opts.duration)\n .ease(opts.easing)\n .each('end', function() { onComplete && onComplete(); })\n .each('interrupt', function() { onComplete && onComplete(); });\n } else {\n return selection;\n }\n}\n\nfunction hasTransition(transitionOpts) {\n return transitionOpts && transitionOpts.duration > 0;\n}\n\nfunction plot(gd, plotinfo, cdModule, traceLayer, opts, makeOnCompleteCallback) {\n var xa = plotinfo.xaxis;\n var ya = plotinfo.yaxis;\n var fullLayout = gd._fullLayout;\n\n if(!opts) {\n opts = {\n mode: fullLayout.barmode,\n norm: fullLayout.barmode,\n gap: fullLayout.bargap,\n groupgap: fullLayout.bargroupgap\n };\n\n // don't clear bar when this is called from waterfall or funnel\n clearMinTextSize('bar', fullLayout);\n }\n\n var bartraces = Lib.makeTraceGroups(traceLayer, cdModule, 'trace bars').each(function(cd) {\n var plotGroup = d3.select(this);\n var trace = cd[0].trace;\n var isWaterfall = (trace.type === 'waterfall');\n var isFunnel = (trace.type === 'funnel');\n var isBar = (trace.type === 'bar');\n var shouldDisplayZeros = (isBar || isFunnel);\n\n var adjustPixel = 0;\n if(isWaterfall && trace.connector.visible && trace.connector.mode === 'between') {\n adjustPixel = trace.connector.line.width / 2;\n }\n\n var isHorizontal = (trace.orientation === 'h');\n var withTransition = hasTransition(opts);\n\n var pointGroup = Lib.ensureSingle(plotGroup, 'g', 'points');\n\n var keyFunc = getKeyFunc(trace);\n var bars = pointGroup.selectAll('g.point').data(Lib.identity, keyFunc);\n\n bars.enter().append('g')\n .classed('point', true);\n\n bars.exit().remove();\n\n bars.each(function(di, i) {\n var bar = d3.select(this);\n\n // now display the bar\n // clipped xf/yf (2nd arg true): non-positive\n // log values go off-screen by plotwidth\n // so you see them continue if you drag the plot\n var xy = getXY(di, xa, ya, isHorizontal);\n\n var x0 = xy[0][0];\n var x1 = xy[0][1];\n var y0 = xy[1][0];\n var y1 = xy[1][1];\n\n // empty bars\n var isBlank = (isHorizontal ? x1 - x0 : y1 - y0) === 0;\n\n // display zeros if line.width > 0\n if(isBlank && shouldDisplayZeros && helpers.getLineWidth(trace, di)) {\n isBlank = false;\n }\n\n // skip nulls\n if(!isBlank) {\n isBlank = (\n !isNumeric(x0) ||\n !isNumeric(x1) ||\n !isNumeric(y0) ||\n !isNumeric(y1)\n );\n }\n\n // record isBlank\n di.isBlank = isBlank;\n\n // for blank bars, ensure start and end positions are equal - important for smooth transitions\n if(isBlank) {\n if(isHorizontal) {\n x1 = x0;\n } else {\n y1 = y0;\n }\n }\n\n // in waterfall mode `between` we need to adjust bar end points to match the connector width\n if(adjustPixel && !isBlank) {\n if(isHorizontal) {\n x0 -= dirSign(x0, x1) * adjustPixel;\n x1 += dirSign(x0, x1) * adjustPixel;\n } else {\n y0 -= dirSign(y0, y1) * adjustPixel;\n y1 += dirSign(y0, y1) * adjustPixel;\n }\n }\n\n var lw;\n var mc;\n\n if(trace.type === 'waterfall') {\n if(!isBlank) {\n var cont = trace[di.dir].marker;\n lw = cont.line.width;\n mc = cont.color;\n }\n } else {\n lw = helpers.getLineWidth(trace, di);\n mc = di.mc || trace.marker.color;\n }\n\n function roundWithLine(v) {\n var offset = d3.round((lw / 2) % 1, 2);\n\n // if there are explicit gaps, don't round,\n // it can make the gaps look crappy\n return (opts.gap === 0 && opts.groupgap === 0) ?\n d3.round(Math.round(v) - offset, 2) : v;\n }\n\n function expandToVisible(v, vc, hideZeroSpan) {\n if(hideZeroSpan && v === vc) {\n // should not expand zero span bars\n // when start and end positions are identical\n // i.e. for vertical when y0 === y1\n // and for horizontal when x0 === x1\n return v;\n }\n\n // if it's not in danger of disappearing entirely,\n // round more precisely\n return Math.abs(v - vc) >= 2 ? roundWithLine(v) :\n // but if it's very thin, expand it so it's\n // necessarily visible, even if it might overlap\n // its neighbor\n (v > vc ? Math.ceil(v) : Math.floor(v));\n }\n\n if(!gd._context.staticPlot) {\n // if bars are not fully opaque or they have a line\n // around them, round to integer pixels, mainly for\n // safari so we prevent overlaps from its expansive\n // pixelation. if the bars ARE fully opaque and have\n // no line, expand to a full pixel to make sure we\n // can see them\n\n var op = Color.opacity(mc);\n var fixpx = (op < 1 || lw > 0.01) ? roundWithLine : expandToVisible;\n\n x0 = fixpx(x0, x1, isHorizontal);\n x1 = fixpx(x1, x0, isHorizontal);\n y0 = fixpx(y0, y1, !isHorizontal);\n y1 = fixpx(y1, y0, !isHorizontal);\n }\n\n var sel = transition(Lib.ensureSingle(bar, 'path'), fullLayout, opts, makeOnCompleteCallback);\n sel\n .style('vector-effect', 'non-scaling-stroke')\n .attr('d', isNaN((x1 - x0) * (y1 - y0)) ? 'M0,0Z' : 'M' + x0 + ',' + y0 + 'V' + y1 + 'H' + x1 + 'V' + y0 + 'Z')\n .call(Drawing.setClipUrl, plotinfo.layerClipId, gd);\n\n if(!fullLayout.uniformtext.mode && withTransition) {\n var styleFns = Drawing.makePointStyleFns(trace);\n Drawing.singlePointStyle(di, sel, trace, styleFns, gd);\n }\n\n appendBarText(gd, plotinfo, bar, cd, i, x0, x1, y0, y1, opts, makeOnCompleteCallback);\n\n if(plotinfo.layerClipId) {\n Drawing.hideOutsideRangePoint(di, bar.select('text'), xa, ya, trace.xcalendar, trace.ycalendar);\n }\n });\n\n // lastly, clip points groups of `cliponaxis !== false` traces\n // on `plotinfo._hasClipOnAxisFalse === true` subplots\n var hasClipOnAxisFalse = trace.cliponaxis === false;\n Drawing.setClipUrl(plotGroup, hasClipOnAxisFalse ? null : plotinfo.layerClipId, gd);\n });\n\n // error bars are on the top\n Registry.getComponentMethod('errorbars', 'plot')(gd, bartraces, plotinfo, opts);\n}\n\nfunction appendBarText(gd, plotinfo, bar, cd, i, x0, x1, y0, y1, opts, makeOnCompleteCallback) {\n var xa = plotinfo.xaxis;\n var ya = plotinfo.yaxis;\n\n var fullLayout = gd._fullLayout;\n var textPosition;\n\n function appendTextNode(bar, text, font) {\n var textSelection = Lib.ensureSingle(bar, 'text')\n .text(text)\n .attr({\n 'class': 'bartext bartext-' + textPosition,\n 'text-anchor': 'middle',\n // prohibit tex interpretation until we can handle\n // tex and regular text together\n 'data-notex': 1\n })\n .call(Drawing.font, font)\n .call(svgTextUtils.convertToTspans, gd);\n\n return textSelection;\n }\n\n // get trace attributes\n var trace = cd[0].trace;\n var isHorizontal = (trace.orientation === 'h');\n\n var text = getText(fullLayout, cd, i, xa, ya);\n textPosition = getTextPosition(trace, i);\n\n // compute text position\n var inStackOrRelativeMode =\n opts.mode === 'stack' ||\n opts.mode === 'relative';\n\n var calcBar = cd[i];\n var isOutmostBar = !inStackOrRelativeMode || calcBar._outmost;\n\n if(!text ||\n textPosition === 'none' ||\n ((calcBar.isBlank || x0 === x1 || y0 === y1) && (\n textPosition === 'auto' ||\n textPosition === 'inside'))) {\n bar.select('text').remove();\n return;\n }\n\n var layoutFont = fullLayout.font;\n var barColor = style.getBarColor(cd[i], trace);\n var insideTextFont = style.getInsideTextFont(trace, i, layoutFont, barColor);\n var outsideTextFont = style.getOutsideTextFont(trace, i, layoutFont);\n\n // Special case: don't use the c2p(v, true) value on log size axes,\n // so that we can get correctly inside text scaling\n var di = bar.datum();\n if(isHorizontal) {\n if(xa.type === 'log' && di.s0 <= 0) {\n if(xa.range[0] < xa.range[1]) {\n x0 = 0;\n } else {\n x0 = xa._length;\n }\n }\n } else {\n if(ya.type === 'log' && di.s0 <= 0) {\n if(ya.range[0] < ya.range[1]) {\n y0 = ya._length;\n } else {\n y0 = 0;\n }\n }\n }\n\n // padding excluded\n var barWidth = Math.abs(x1 - x0) - 2 * TEXTPAD;\n var barHeight = Math.abs(y1 - y0) - 2 * TEXTPAD;\n\n var textSelection;\n var textBB;\n var textWidth;\n var textHeight;\n var font;\n\n if(textPosition === 'outside') {\n if(!isOutmostBar && !calcBar.hasB) textPosition = 'inside';\n }\n\n if(textPosition === 'auto') {\n if(isOutmostBar) {\n // draw text using insideTextFont and check if it fits inside bar\n textPosition = 'inside';\n\n font = Lib.ensureUniformFontSize(gd, insideTextFont);\n\n textSelection = appendTextNode(bar, text, font);\n\n textBB = Drawing.bBox(textSelection.node()),\n textWidth = textBB.width,\n textHeight = textBB.height;\n\n var textHasSize = (textWidth > 0 && textHeight > 0);\n var fitsInside = (textWidth <= barWidth && textHeight <= barHeight);\n var fitsInsideIfRotated = (textWidth <= barHeight && textHeight <= barWidth);\n var fitsInsideIfShrunk = (isHorizontal) ?\n (barWidth >= textWidth * (barHeight / textHeight)) :\n (barHeight >= textHeight * (barWidth / textWidth));\n\n if(textHasSize && (\n fitsInside ||\n fitsInsideIfRotated ||\n fitsInsideIfShrunk)\n ) {\n textPosition = 'inside';\n } else {\n textPosition = 'outside';\n textSelection.remove();\n textSelection = null;\n }\n } else {\n textPosition = 'inside';\n }\n }\n\n if(!textSelection) {\n font = Lib.ensureUniformFontSize(gd, (textPosition === 'outside') ? outsideTextFont : insideTextFont);\n\n textSelection = appendTextNode(bar, text, font);\n\n var currentTransform = textSelection.attr('transform');\n textSelection.attr('transform', '');\n textBB = Drawing.bBox(textSelection.node()),\n textWidth = textBB.width,\n textHeight = textBB.height;\n textSelection.attr('transform', currentTransform);\n\n if(textWidth <= 0 || textHeight <= 0) {\n textSelection.remove();\n return;\n }\n }\n\n var angle = trace.textangle;\n\n // compute text transform\n var transform, constrained;\n if(textPosition === 'outside') {\n constrained =\n trace.constraintext === 'both' ||\n trace.constraintext === 'outside';\n\n transform = toMoveOutsideBar(x0, x1, y0, y1, textBB, {\n isHorizontal: isHorizontal,\n constrained: constrained,\n angle: angle\n });\n } else {\n constrained =\n trace.constraintext === 'both' ||\n trace.constraintext === 'inside';\n\n transform = toMoveInsideBar(x0, x1, y0, y1, textBB, {\n isHorizontal: isHorizontal,\n constrained: constrained,\n angle: angle,\n anchor: trace.insidetextanchor\n });\n }\n\n transform.fontSize = font.size;\n recordMinTextSize(trace.type, transform, fullLayout);\n calcBar.transform = transform;\n\n transition(textSelection, fullLayout, opts, makeOnCompleteCallback)\n .attr('transform', Lib.getTextTransform(transform));\n}\n\nfunction getRotateFromAngle(angle) {\n return (angle === 'auto') ? 0 : angle;\n}\n\nfunction getRotatedTextSize(textBB, rotate) {\n var a = Math.PI / 180 * rotate;\n var absSin = Math.abs(Math.sin(a));\n var absCos = Math.abs(Math.cos(a));\n\n return {\n x: textBB.width * absCos + textBB.height * absSin,\n y: textBB.width * absSin + textBB.height * absCos\n };\n}\n\nfunction toMoveInsideBar(x0, x1, y0, y1, textBB, opts) {\n var isHorizontal = !!opts.isHorizontal;\n var constrained = !!opts.constrained;\n var angle = opts.angle || 0;\n var anchor = opts.anchor || 'end';\n var isEnd = anchor === 'end';\n var isStart = anchor === 'start';\n var leftToRight = opts.leftToRight || 0; // left: -1, center: 0, right: 1\n var toRight = (leftToRight + 1) / 2;\n var toLeft = 1 - toRight;\n\n var textWidth = textBB.width;\n var textHeight = textBB.height;\n var lx = Math.abs(x1 - x0);\n var ly = Math.abs(y1 - y0);\n\n // compute remaining space\n var textpad = (\n lx > (2 * TEXTPAD) &&\n ly > (2 * TEXTPAD)\n ) ? TEXTPAD : 0;\n\n lx -= 2 * textpad;\n ly -= 2 * textpad;\n\n var rotate = getRotateFromAngle(angle);\n if((angle === 'auto') &&\n !(textWidth <= lx && textHeight <= ly) &&\n (textWidth > lx || textHeight > ly) && (\n !(textWidth > ly || textHeight > lx) ||\n ((textWidth < textHeight) !== (lx < ly))\n )) {\n rotate += 90;\n }\n\n var t = getRotatedTextSize(textBB, rotate);\n\n var scale = 1;\n if(constrained) {\n scale = Math.min(\n 1,\n lx / t.x,\n ly / t.y\n );\n }\n\n // compute text and target positions\n var textX = (\n textBB.left * toLeft +\n textBB.right * toRight\n );\n var textY = (textBB.top + textBB.bottom) / 2;\n var targetX = (\n (x0 + TEXTPAD) * toLeft +\n (x1 - TEXTPAD) * toRight\n );\n var targetY = (y0 + y1) / 2;\n var anchorX = 0;\n var anchorY = 0;\n if(isStart || isEnd) {\n var extrapad = (isHorizontal ? t.x : t.y) / 2;\n var dir = isHorizontal ? dirSign(x0, x1) : dirSign(y0, y1);\n\n if(isHorizontal) {\n if(isStart) {\n targetX = x0 + dir * textpad;\n anchorX = -dir * extrapad;\n } else {\n targetX = x1 - dir * textpad;\n anchorX = dir * extrapad;\n }\n } else {\n if(isStart) {\n targetY = y0 + dir * textpad;\n anchorY = -dir * extrapad;\n } else {\n targetY = y1 - dir * textpad;\n anchorY = dir * extrapad;\n }\n }\n }\n\n return {\n textX: textX,\n textY: textY,\n targetX: targetX,\n targetY: targetY,\n anchorX: anchorX,\n anchorY: anchorY,\n scale: scale,\n rotate: rotate\n };\n}\n\nfunction toMoveOutsideBar(x0, x1, y0, y1, textBB, opts) {\n var isHorizontal = !!opts.isHorizontal;\n var constrained = !!opts.constrained;\n var angle = opts.angle || 0;\n\n var textWidth = textBB.width;\n var textHeight = textBB.height;\n var lx = Math.abs(x1 - x0);\n var ly = Math.abs(y1 - y0);\n\n var textpad;\n // Keep the padding so the text doesn't sit right against\n // the bars, but don't factor it into barWidth\n if(isHorizontal) {\n textpad = (ly > 2 * TEXTPAD) ? TEXTPAD : 0;\n } else {\n textpad = (lx > 2 * TEXTPAD) ? TEXTPAD : 0;\n }\n\n // compute rotate and scale\n var scale = 1;\n if(constrained) {\n scale = (isHorizontal) ?\n Math.min(1, ly / textHeight) :\n Math.min(1, lx / textWidth);\n }\n\n var rotate = getRotateFromAngle(angle);\n var t = getRotatedTextSize(textBB, rotate);\n\n // compute text and target positions\n var extrapad = (isHorizontal ? t.x : t.y) / 2;\n var textX = (textBB.left + textBB.right) / 2;\n var textY = (textBB.top + textBB.bottom) / 2;\n var targetX = (x0 + x1) / 2;\n var targetY = (y0 + y1) / 2;\n var anchorX = 0;\n var anchorY = 0;\n\n var dir = isHorizontal ? dirSign(x1, x0) : dirSign(y0, y1);\n if(isHorizontal) {\n targetX = x1 - dir * textpad;\n anchorX = dir * extrapad;\n } else {\n targetY = y1 + dir * textpad;\n anchorY = -dir * extrapad;\n }\n\n return {\n textX: textX,\n textY: textY,\n targetX: targetX,\n targetY: targetY,\n anchorX: anchorX,\n anchorY: anchorY,\n scale: scale,\n rotate: rotate\n };\n}\n\nfunction getText(fullLayout, cd, index, xa, ya) {\n var trace = cd[0].trace;\n var texttemplate = trace.texttemplate;\n\n var value;\n if(texttemplate) {\n value = calcTexttemplate(fullLayout, cd, index, xa, ya);\n } else if(trace.textinfo) {\n value = calcTextinfo(cd, index, xa, ya);\n } else {\n value = helpers.getValue(trace.text, index);\n }\n\n return helpers.coerceString(attributeText, value);\n}\n\nfunction getTextPosition(trace, index) {\n var value = helpers.getValue(trace.textposition, index);\n return helpers.coerceEnumerated(attributeTextPosition, value);\n}\n\nfunction calcTexttemplate(fullLayout, cd, index, xa, ya) {\n var trace = cd[0].trace;\n var texttemplate = Lib.castOption(trace, index, 'texttemplate');\n if(!texttemplate) return '';\n var isWaterfall = (trace.type === 'waterfall');\n var isFunnel = (trace.type === 'funnel');\n\n var pLetter, pAxis;\n var vLetter, vAxis;\n if(trace.orientation === 'h') {\n pLetter = 'y';\n pAxis = ya;\n vLetter = 'x';\n vAxis = xa;\n } else {\n pLetter = 'x';\n pAxis = xa;\n vLetter = 'y';\n vAxis = ya;\n }\n\n function formatLabel(u) {\n return tickText(pAxis, u, true).text;\n }\n\n function formatNumber(v) {\n return tickText(vAxis, +v, true).text;\n }\n\n var cdi = cd[index];\n var obj = {};\n\n obj.label = cdi.p;\n obj.labelLabel = obj[pLetter + 'Label'] = formatLabel(cdi.p);\n\n var tx = Lib.castOption(trace, cdi.i, 'text');\n if(tx === 0 || tx) obj.text = tx;\n\n obj.value = cdi.s;\n obj.valueLabel = obj[vLetter + 'Label'] = formatNumber(cdi.s);\n\n var pt = {};\n appendArrayPointValue(pt, trace, cdi.i);\n\n if(isWaterfall) {\n obj.delta = +cdi.rawS || cdi.s;\n obj.deltaLabel = formatNumber(obj.delta);\n obj.final = cdi.v;\n obj.finalLabel = formatNumber(obj.final);\n obj.initial = obj.final - obj.delta;\n obj.initialLabel = formatNumber(obj.initial);\n }\n\n if(isFunnel) {\n obj.value = cdi.s;\n obj.valueLabel = formatNumber(obj.value);\n\n obj.percentInitial = cdi.begR;\n obj.percentInitialLabel = Lib.formatPercent(cdi.begR);\n obj.percentPrevious = cdi.difR;\n obj.percentPreviousLabel = Lib.formatPercent(cdi.difR);\n obj.percentTotal = cdi.sumR;\n obj.percenTotalLabel = Lib.formatPercent(cdi.sumR);\n }\n\n var customdata = Lib.castOption(trace, cdi.i, 'customdata');\n if(customdata) obj.customdata = customdata;\n return Lib.texttemplateString(texttemplate, obj, fullLayout._d3locale, pt, obj, trace._meta || {});\n}\n\nfunction calcTextinfo(cd, index, xa, ya) {\n var trace = cd[0].trace;\n var isHorizontal = (trace.orientation === 'h');\n var isWaterfall = (trace.type === 'waterfall');\n var isFunnel = (trace.type === 'funnel');\n\n function formatLabel(u) {\n var pAxis = isHorizontal ? ya : xa;\n return tickText(pAxis, u, true).text;\n }\n\n function formatNumber(v) {\n var sAxis = isHorizontal ? xa : ya;\n return tickText(sAxis, +v, true).text;\n }\n\n var textinfo = trace.textinfo;\n var cdi = cd[index];\n\n var parts = textinfo.split('+');\n var text = [];\n var tx;\n\n var hasFlag = function(flag) { return parts.indexOf(flag) !== -1; };\n\n if(hasFlag('label')) {\n text.push(formatLabel(cd[index].p));\n }\n\n if(hasFlag('text')) {\n tx = Lib.castOption(trace, cdi.i, 'text');\n if(tx === 0 || tx) text.push(tx);\n }\n\n if(isWaterfall) {\n var delta = +cdi.rawS || cdi.s;\n var final = cdi.v;\n var initial = final - delta;\n\n if(hasFlag('initial')) text.push(formatNumber(initial));\n if(hasFlag('delta')) text.push(formatNumber(delta));\n if(hasFlag('final')) text.push(formatNumber(final));\n }\n\n if(isFunnel) {\n if(hasFlag('value')) text.push(formatNumber(cdi.s));\n\n var nPercent = 0;\n if(hasFlag('percent initial')) nPercent++;\n if(hasFlag('percent previous')) nPercent++;\n if(hasFlag('percent total')) nPercent++;\n\n var hasMultiplePercents = nPercent > 1;\n\n if(hasFlag('percent initial')) {\n tx = Lib.formatPercent(cdi.begR);\n if(hasMultiplePercents) tx += ' of initial';\n text.push(tx);\n }\n if(hasFlag('percent previous')) {\n tx = Lib.formatPercent(cdi.difR);\n if(hasMultiplePercents) tx += ' of previous';\n text.push(tx);\n }\n if(hasFlag('percent total')) {\n tx = Lib.formatPercent(cdi.sumR);\n if(hasMultiplePercents) tx += ' of total';\n text.push(tx);\n }\n }\n\n return text.join('
');\n}\n\nmodule.exports = {\n plot: plot,\n toMoveInsideBar: toMoveInsideBar\n};\n\n},{\"../../components/color\":595,\"../../components/drawing\":617,\"../../components/fx/helpers\":631,\"../../lib\":728,\"../../lib/svg_text_utils\":752,\"../../plots/cartesian/axes\":776,\"../../registry\":859,\"./attributes\":869,\"./constants\":871,\"./helpers\":875,\"./style\":883,\"./uniform_text\":885,\"d3\":164,\"fast-isnumeric\":236}],881:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = function selectPoints(searchInfo, selectionTester) {\n var cd = searchInfo.cd;\n var xa = searchInfo.xaxis;\n var ya = searchInfo.yaxis;\n var trace = cd[0].trace;\n var isFunnel = (trace.type === 'funnel');\n var isHorizontal = (trace.orientation === 'h');\n var selection = [];\n var i;\n\n if(selectionTester === false) {\n // 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 var di = cd[i];\n var ct = 'ct' in di ? di.ct : getCentroid(di, xa, ya, isHorizontal, isFunnel);\n\n if(selectionTester.contains(ct, false, i, searchInfo)) {\n selection.push({\n pointNumber: 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\nfunction getCentroid(d, xa, ya, isHorizontal, isFunnel) {\n var x0 = xa.c2p(isHorizontal ? d.s0 : d.p0, true);\n var x1 = xa.c2p(isHorizontal ? d.s1 : d.p1, true);\n var y0 = ya.c2p(isHorizontal ? d.p0 : d.s0, true);\n var y1 = ya.c2p(isHorizontal ? d.p1 : d.s1, true);\n\n if(isFunnel) {\n return [(x0 + x1) / 2, (y0 + y1) / 2];\n } else {\n if(isHorizontal) {\n return [x1, (y0 + y1) / 2];\n } else {\n return [(x0 + x1) / 2, y1];\n }\n }\n}\n\n},{}],882:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = Sieve;\n\nvar distinctVals = _dereq_('../../lib').distinctVals;\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\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 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 if(bar.p !== BADNUM) positions.push(bar.p);\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 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 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\n},{\"../../constants/numerical\":704,\"../../lib\":728}],883:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Color = _dereq_('../../components/color');\nvar Drawing = _dereq_('../../components/drawing');\nvar Lib = _dereq_('../../lib');\nvar Registry = _dereq_('../../registry');\n\nvar resizeText = _dereq_('./uniform_text').resizeText;\nvar attributes = _dereq_('./attributes');\nvar attributeTextFont = attributes.textfont;\nvar attributeInsideTextFont = attributes.insidetextfont;\nvar attributeOutsideTextFont = attributes.outsidetextfont;\nvar helpers = _dereq_('./helpers');\n\nfunction style(gd) {\n var s = d3.select(gd).selectAll('g.barlayer').selectAll('g.trace');\n resizeText(gd, s, 'bar');\n\n var barcount = s.size();\n var fullLayout = gd._fullLayout;\n\n // trace styling\n s.style('opacity', function(d) { return d[0].trace.opacity; })\n\n // for gapless (either stacked or neighboring grouped) bars use\n // crispEdges to turn off antialiasing so an artificial gap\n // isn't introduced.\n .each(function(d) {\n if((fullLayout.barmode === 'stack' && barcount > 1) ||\n (fullLayout.bargap === 0 &&\n fullLayout.bargroupgap === 0 &&\n !d[0].trace.marker.line.width)) {\n d3.select(this).attr('shape-rendering', 'crispEdges');\n }\n });\n\n s.selectAll('g.points').each(function(d) {\n var sel = d3.select(this);\n var trace = d[0].trace;\n stylePoints(sel, trace, gd);\n });\n\n Registry.getComponentMethod('errorbars', 'style')(s);\n}\n\nfunction stylePoints(sel, trace, gd) {\n Drawing.pointStyle(sel.selectAll('path'), trace, gd);\n styleTextPoints(sel, trace, gd);\n}\n\nfunction styleTextPoints(sel, trace, gd) {\n sel.selectAll('text').each(function(d) {\n var tx = d3.select(this);\n var font = Lib.ensureUniformFontSize(gd, determineFont(tx, d, trace, gd));\n\n Drawing.font(tx, font);\n });\n}\n\nfunction styleOnSelect(gd, cd, sel) {\n var trace = cd[0].trace;\n\n if(trace.selectedpoints) {\n stylePointsInSelectionMode(sel, trace, gd);\n } else {\n stylePoints(sel, trace, gd);\n Registry.getComponentMethod('errorbars', 'style')(sel);\n }\n}\n\nfunction stylePointsInSelectionMode(s, trace, gd) {\n Drawing.selectedPointStyle(s.selectAll('path'), trace);\n styleTextInSelectionMode(s.selectAll('text'), trace, gd);\n}\n\nfunction styleTextInSelectionMode(txs, trace, gd) {\n txs.each(function(d) {\n var tx = d3.select(this);\n var font;\n\n if(d.selected) {\n font = Lib.ensureUniformFontSize(gd, determineFont(tx, d, trace, gd));\n\n var selectedFontColor = trace.selected.textfont && trace.selected.textfont.color;\n if(selectedFontColor) {\n font.color = selectedFontColor;\n }\n\n Drawing.font(tx, font);\n } else {\n Drawing.selectedTextStyle(tx, trace);\n }\n });\n}\n\nfunction determineFont(tx, d, trace, gd) {\n var layoutFont = gd._fullLayout.font;\n var textFont = trace.textfont;\n\n if(tx.classed('bartext-inside')) {\n var barColor = getBarColor(d, trace);\n textFont = getInsideTextFont(trace, d.i, layoutFont, barColor);\n } else if(tx.classed('bartext-outside')) {\n textFont = getOutsideTextFont(trace, d.i, layoutFont);\n }\n\n return textFont;\n}\n\nfunction getTextFont(trace, index, defaultValue) {\n return getFontValue(\n attributeTextFont, trace.textfont, index, defaultValue);\n}\n\nfunction getInsideTextFont(trace, index, layoutFont, barColor) {\n var defaultFont = getTextFont(trace, index, layoutFont);\n\n var wouldFallBackToLayoutFont =\n (trace._input.textfont === undefined || trace._input.textfont.color === undefined) ||\n (Array.isArray(trace.textfont.color) && trace.textfont.color[index] === undefined);\n if(wouldFallBackToLayoutFont) {\n defaultFont = {\n color: Color.contrast(barColor),\n family: defaultFont.family,\n size: defaultFont.size\n };\n }\n\n return getFontValue(\n attributeInsideTextFont, trace.insidetextfont, index, defaultFont);\n}\n\nfunction getOutsideTextFont(trace, index, layoutFont) {\n var defaultFont = getTextFont(trace, index, layoutFont);\n return getFontValue(\n attributeOutsideTextFont, trace.outsidetextfont, index, defaultFont);\n}\n\nfunction getFontValue(attributeDefinition, attributeValue, index, defaultValue) {\n attributeValue = attributeValue || {};\n\n var familyValue = helpers.getValue(attributeValue.family, index);\n var sizeValue = helpers.getValue(attributeValue.size, index);\n var colorValue = helpers.getValue(attributeValue.color, index);\n\n return {\n family: helpers.coerceString(\n attributeDefinition.family, familyValue, defaultValue.family),\n size: helpers.coerceNumber(\n attributeDefinition.size, sizeValue, defaultValue.size),\n color: helpers.coerceColor(\n attributeDefinition.color, colorValue, defaultValue.color)\n };\n}\n\nfunction getBarColor(cd, trace) {\n if(trace.type === 'waterfall') {\n return trace[cd.dir].marker.color;\n }\n return cd.mc || trace.marker.color;\n}\n\nmodule.exports = {\n style: style,\n styleTextPoints: styleTextPoints,\n styleOnSelect: styleOnSelect,\n getInsideTextFont: getInsideTextFont,\n getOutsideTextFont: getOutsideTextFont,\n getBarColor: getBarColor,\n resizeText: resizeText\n};\n\n},{\"../../components/color\":595,\"../../components/drawing\":617,\"../../lib\":728,\"../../registry\":859,\"./attributes\":869,\"./helpers\":875,\"./uniform_text\":885,\"d3\":164}],884:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Color = _dereq_('../../components/color');\nvar hasColorscale = _dereq_('../../components/colorscale/helpers').hasColorscale;\nvar colorscaleDefaults = _dereq_('../../components/colorscale/defaults');\n\nmodule.exports = function handleStyleDefaults(traceIn, traceOut, coerce, defaultColor, layout) {\n coerce('marker.color', defaultColor);\n\n if(hasColorscale(traceIn, 'marker')) {\n colorscaleDefaults(\n traceIn, traceOut, layout, coerce, {prefix: 'marker.', cLetter: 'c'}\n );\n }\n\n coerce('marker.line.color', Color.defaultLine);\n\n if(hasColorscale(traceIn, 'marker.line')) {\n colorscaleDefaults(\n traceIn, traceOut, layout, coerce, {prefix: 'marker.line.', cLetter: 'c'}\n );\n }\n\n coerce('marker.line.width');\n coerce('marker.opacity');\n coerce('selected.marker.color');\n coerce('unselected.marker.color');\n};\n\n},{\"../../components/color\":595,\"../../components/colorscale/defaults\":605,\"../../components/colorscale/helpers\":606}],885:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Lib = _dereq_('../../lib');\n\nfunction resizeText(gd, gTrace, traceType) {\n var fullLayout = gd._fullLayout;\n var minSize = fullLayout['_' + traceType + 'Text_minsize'];\n if(minSize) {\n var shouldHide = fullLayout.uniformtext.mode === 'hide';\n\n var selector;\n switch(traceType) {\n case 'funnelarea' :\n case 'pie' :\n case 'sunburst' :\n selector = 'g.slice';\n break;\n case 'treemap' :\n selector = 'g.slice, g.pathbar';\n break;\n default :\n selector = 'g.points > g.point';\n }\n\n gTrace.selectAll(selector).each(function(d) {\n var transform = d.transform;\n if(transform) {\n transform.scale = (shouldHide && transform.hide) ? 0 : minSize / transform.fontSize;\n\n var el = d3.select(this).select('text');\n el.attr('transform', Lib.getTextTransform(transform));\n }\n });\n }\n}\n\nfunction recordMinTextSize(\n traceType, // in\n transform, // inout\n fullLayout // inout\n) {\n if(fullLayout.uniformtext.mode) {\n var minKey = getMinKey(traceType);\n var minSize = fullLayout.uniformtext.minsize;\n var size = transform.scale * transform.fontSize;\n\n transform.hide = size < minSize;\n\n fullLayout[minKey] = fullLayout[minKey] || Infinity;\n if(!transform.hide) {\n fullLayout[minKey] = Math.min(\n fullLayout[minKey],\n Math.max(size, minSize)\n );\n }\n }\n}\n\nfunction clearMinTextSize(\n traceType, // in\n fullLayout // inout\n) {\n var minKey = getMinKey(traceType);\n fullLayout[minKey] = undefined;\n}\n\nfunction getMinKey(traceType) {\n return '_' + traceType + 'Text_minsize';\n}\n\nmodule.exports = {\n recordMinTextSize: recordMinTextSize,\n clearMinTextSize: clearMinTextSize,\n resizeText: resizeText\n};\n\n},{\"../../lib\":728,\"d3\":164}],886:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\nvar scatterPolarAttrs = _dereq_('../scatterpolar/attributes');\nvar barAttrs = _dereq_('../bar/attributes');\n\nmodule.exports = {\n r: scatterPolarAttrs.r,\n theta: scatterPolarAttrs.theta,\n r0: scatterPolarAttrs.r0,\n dr: scatterPolarAttrs.dr,\n theta0: scatterPolarAttrs.theta0,\n dtheta: scatterPolarAttrs.dtheta,\n thetaunit: scatterPolarAttrs.thetaunit,\n\n // orientation: {\n // valType: 'enumerated',\n // \n // values: ['radial', 'angular'],\n // editType: 'calc+clearAxisTypes',\n // \n // },\n\n base: extendFlat({}, barAttrs.base, {\n \n }),\n offset: extendFlat({}, barAttrs.offset, {\n \n }),\n width: extendFlat({}, barAttrs.width, {\n \n }),\n\n text: extendFlat({}, barAttrs.text, {\n \n }),\n hovertext: extendFlat({}, barAttrs.hovertext, {\n \n }),\n\n // textposition: {},\n // textfont: {},\n // insidetextfont: {},\n // outsidetextfont: {},\n // constraintext: {},\n // cliponaxis: extendFlat({}, barAttrs.cliponaxis, {dflt: false}),\n\n marker: barAttrs.marker,\n\n hoverinfo: scatterPolarAttrs.hoverinfo,\n hovertemplate: hovertemplateAttrs(),\n\n selected: barAttrs.selected,\n unselected: barAttrs.unselected\n\n // error_x (error_r, error_theta)\n // error_y\n};\n\n},{\"../../lib/extend\":719,\"../../plots/template_attributes\":854,\"../bar/attributes\":869,\"../scatterpolar/attributes\":1207}],887:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar hasColorscale = _dereq_('../../components/colorscale/helpers').hasColorscale;\nvar colorscaleCalc = _dereq_('../../components/colorscale/calc');\nvar arraysToCalcdata = _dereq_('../bar/arrays_to_calcdata');\nvar setGroupPositions = _dereq_('../bar/cross_trace_calc').setGroupPositions;\nvar calcSelection = _dereq_('../scatter/calc_selection');\nvar traceIs = _dereq_('../../registry').traceIs;\nvar extendFlat = _dereq_('../../lib').extendFlat;\n\nfunction calc(gd, trace) {\n var fullLayout = gd._fullLayout;\n var subplotId = trace.subplot;\n var radialAxis = fullLayout[subplotId].radialaxis;\n var angularAxis = fullLayout[subplotId].angularaxis;\n var rArray = radialAxis.makeCalcdata(trace, 'r');\n var thetaArray = angularAxis.makeCalcdata(trace, 'theta');\n var len = trace._length;\n var cd = new Array(len);\n\n // 'size' axis variables\n var sArray = rArray;\n // 'pos' axis variables\n var pArray = thetaArray;\n\n for(var i = 0; i < len; i++) {\n cd[i] = {p: pArray[i], s: sArray[i]};\n }\n\n // convert width and offset in 'c' coordinate,\n // set 'c' value(s) in trace._width and trace._offset,\n // to make Bar.crossTraceCalc \"just work\"\n function d2c(attr) {\n var val = trace[attr];\n if(val !== undefined) {\n trace['_' + attr] = Array.isArray(val) ?\n angularAxis.makeCalcdata(trace, attr) :\n angularAxis.d2c(val, trace.thetaunit);\n }\n }\n\n if(angularAxis.type === 'linear') {\n d2c('width');\n d2c('offset');\n }\n\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\nfunction crossTraceCalc(gd, polarLayout, subplotId) {\n var calcdata = gd.calcdata;\n var barPolarCd = [];\n\n for(var i = 0; i < calcdata.length; i++) {\n var cdi = calcdata[i];\n var trace = cdi[0].trace;\n\n if(trace.visible === true && traceIs(trace, 'bar') &&\n trace.subplot === subplotId\n ) {\n barPolarCd.push(cdi);\n }\n }\n\n // to make _extremes is filled in correctly so that\n // polar._subplot.radialAxis can get auotrange'd\n // TODO clean up!\n // I think we want to call getAutorange on polar.radialaxis\n // NOT on polar._subplot.radialAxis\n var rAxis = extendFlat({}, polarLayout.radialaxis, {_id: 'x'});\n var aAxis = polarLayout.angularaxis;\n\n setGroupPositions(gd, aAxis, rAxis, barPolarCd, {\n mode: polarLayout.barmode,\n norm: polarLayout.barnorm,\n gap: polarLayout.bargap,\n groupgap: polarLayout.bargroupgap\n });\n}\n\nmodule.exports = {\n calc: calc,\n crossTraceCalc: crossTraceCalc\n};\n\n},{\"../../components/colorscale/calc\":603,\"../../components/colorscale/helpers\":606,\"../../lib\":728,\"../../registry\":859,\"../bar/arrays_to_calcdata\":868,\"../bar/cross_trace_calc\":872,\"../scatter/calc_selection\":1136}],888:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nvar handleRThetaDefaults = _dereq_('../scatterpolar/defaults').handleRThetaDefaults;\nvar handleStyleDefaults = _dereq_('../bar/style_defaults');\nvar attributes = _dereq_('./attributes');\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 len = handleRThetaDefaults(traceIn, traceOut, layout, coerce);\n if(!len) {\n traceOut.visible = false;\n return;\n }\n\n // coerce('orientation', (traceOut.theta && !traceOut.r) ? 'angular' : 'radial');\n\n coerce('thetaunit');\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 // 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 textFont = coerceFont(coerce, 'textfont', layout.font);\n // if(hasInside) coerceFont(coerce, 'insidetextfont', textFont);\n // if(hasOutside) coerceFont(coerce, 'outsidetextfont', textFont);\n // coerce('constraintext');\n // coerce('selected.textfont.color');\n // coerce('unselected.textfont.color');\n // coerce('cliponaxis');\n // }\n\n handleStyleDefaults(traceIn, traceOut, coerce, defaultColor, layout);\n\n Lib.coerceSelectionMarkerOpacity(traceOut, coerce);\n};\n\n},{\"../../lib\":728,\"../bar/style_defaults\":884,\"../scatterpolar/defaults\":1209,\"./attributes\":886}],889:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Fx = _dereq_('../../components/fx');\nvar Lib = _dereq_('../../lib');\nvar getTraceColor = _dereq_('../bar/hover').getTraceColor;\nvar fillText = Lib.fillText;\nvar makeHoverPointText = _dereq_('../scatterpolar/hover').makeHoverPointText;\nvar isPtInsidePolygon = _dereq_('../../plots/polar/helpers').isPtInsidePolygon;\n\nmodule.exports = function hoverPoints(pointData, xval, yval) {\n var cd = pointData.cd;\n var trace = cd[0].trace;\n\n var subplot = pointData.subplot;\n var radialAxis = subplot.radialAxis;\n var angularAxis = subplot.angularAxis;\n var vangles = subplot.vangles;\n var inboxFn = vangles ? isPtInsidePolygon : Lib.isPtInsideSector;\n var maxHoverDistance = pointData.maxHoverDistance;\n var period = angularAxis._period || 2 * Math.PI;\n\n var rVal = Math.abs(radialAxis.g2p(Math.sqrt(xval * xval + yval * yval)));\n var thetaVal = Math.atan2(yval, xval);\n\n // polar.(x|y)axis.p2c doesn't get the reversed radial axis range case right\n if(radialAxis.range[0] > radialAxis.range[1]) {\n thetaVal += Math.PI;\n }\n\n var distFn = function(di) {\n if(inboxFn(rVal, thetaVal, [di.rp0, di.rp1], [di.thetag0, di.thetag1], vangles)) {\n return maxHoverDistance +\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 Math.min(1, Math.abs(di.thetag1 - di.thetag0) / period) - 1 +\n // add a gradient so hovering near the end of a\n // bar makes it a little closer match\n (di.rp1 - rVal) / (di.rp1 - di.rp0) - 1;\n } else {\n return Infinity;\n }\n };\n\n Fx.getClosest(cd, distFn, pointData);\n if(pointData.index === false) return;\n\n var index = pointData.index;\n var cdi = cd[index];\n\n pointData.x0 = pointData.x1 = cdi.ct[0];\n pointData.y0 = pointData.y1 = cdi.ct[1];\n\n var _cdi = Lib.extendFlat({}, cdi, {r: cdi.s, theta: cdi.p});\n fillText(cdi, trace, pointData);\n makeHoverPointText(_cdi, trace, subplot, pointData);\n pointData.hovertemplate = trace.hovertemplate;\n pointData.color = getTraceColor(trace, cdi);\n pointData.xLabelVal = pointData.yLabelVal = undefined;\n\n if(cdi.s < 0) {\n pointData.idealAlign = 'left';\n }\n\n return [pointData];\n};\n\n},{\"../../components/fx\":635,\"../../lib\":728,\"../../plots/polar/helpers\":841,\"../bar/hover\":876,\"../scatterpolar/hover\":1211}],890:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n moduleType: 'trace',\n name: 'barpolar',\n basePlotModule: _dereq_('../../plots/polar'),\n categories: ['polar', 'bar', 'showLegend'],\n\n attributes: _dereq_('./attributes'),\n layoutAttributes: _dereq_('./layout_attributes'),\n supplyDefaults: _dereq_('./defaults'),\n supplyLayoutDefaults: _dereq_('./layout_defaults'),\n\n calc: _dereq_('./calc').calc,\n crossTraceCalc: _dereq_('./calc').crossTraceCalc,\n\n plot: _dereq_('./plot'),\n colorbar: _dereq_('../scatter/marker_colorbar'),\n formatLabels: _dereq_('../scatterpolar/format_labels'),\n\n style: _dereq_('../bar/style').style,\n styleOnSelect: _dereq_('../bar/style').styleOnSelect,\n\n hoverPoints: _dereq_('./hover'),\n selectPoints: _dereq_('../bar/select'),\n\n meta: {\n \n \n }\n};\n\n},{\"../../plots/polar\":842,\"../bar/select\":881,\"../bar/style\":883,\"../scatter/marker_colorbar\":1152,\"../scatterpolar/format_labels\":1210,\"./attributes\":886,\"./calc\":887,\"./defaults\":888,\"./hover\":889,\"./layout_attributes\":891,\"./layout_defaults\":892,\"./plot\":893}],891:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n barmode: {\n valType: 'enumerated',\n values: ['stack', 'overlay'],\n dflt: 'stack',\n \n editType: 'calc',\n \n },\n bargap: {\n valType: 'number',\n dflt: 0.1,\n min: 0,\n max: 1,\n \n editType: 'calc',\n \n }\n};\n\n},{}],892:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar attrs = _dereq_('./layout_attributes');\n\nmodule.exports = function(layoutIn, layoutOut, fullData) {\n var subplotsDone = {};\n var sp;\n\n function coerce(attr, dflt) {\n return Lib.coerce(layoutIn[sp] || {}, layoutOut[sp], attrs, attr, dflt);\n }\n\n for(var i = 0; i < fullData.length; i++) {\n var trace = fullData[i];\n if(trace.type === 'barpolar' && trace.visible === true) {\n sp = trace.subplot;\n if(!subplotsDone[sp]) {\n coerce('barmode');\n coerce('bargap');\n subplotsDone[sp] = 1;\n }\n }\n }\n};\n\n},{\"../../lib\":728,\"./layout_attributes\":891}],893:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Lib = _dereq_('../../lib');\nvar Drawing = _dereq_('../../components/drawing');\nvar helpers = _dereq_('../../plots/polar/helpers');\n\nmodule.exports = function plot(gd, subplot, cdbar) {\n var xa = subplot.xaxis;\n var ya = subplot.yaxis;\n var radialAxis = subplot.radialAxis;\n var angularAxis = subplot.angularAxis;\n var pathFn = makePathFn(subplot);\n var barLayer = subplot.layers.frontplot.select('g.barlayer');\n\n Lib.makeTraceGroups(barLayer, cdbar, 'trace bars').each(function() {\n var plotGroup = d3.select(this);\n var pointGroup = Lib.ensureSingle(plotGroup, 'g', 'points');\n var bars = pointGroup.selectAll('g.point').data(Lib.identity);\n\n bars.enter().append('g')\n .style('vector-effect', 'non-scaling-stroke')\n .style('stroke-miterlimit', 2)\n .classed('point', true);\n\n bars.exit().remove();\n\n bars.each(function(di) {\n var bar = d3.select(this);\n\n var rp0 = di.rp0 = radialAxis.c2p(di.s0);\n var rp1 = di.rp1 = radialAxis.c2p(di.s1);\n var thetag0 = di.thetag0 = angularAxis.c2g(di.p0);\n var thetag1 = di.thetag1 = angularAxis.c2g(di.p1);\n\n var dPath;\n\n if(!isNumeric(rp0) || !isNumeric(rp1) ||\n !isNumeric(thetag0) || !isNumeric(thetag1) ||\n rp0 === rp1 || thetag0 === thetag1\n ) {\n // do not remove blank bars, to keep data-to-node\n // mapping intact during radial drag, that we\n // can skip calling _module.style during interactions\n dPath = 'M0,0Z';\n } else {\n // this 'center' pt is used for selections and hover labels\n var rg1 = radialAxis.c2g(di.s1);\n var thetagMid = (thetag0 + thetag1) / 2;\n di.ct = [\n xa.c2p(rg1 * Math.cos(thetagMid)),\n ya.c2p(rg1 * Math.sin(thetagMid))\n ];\n\n dPath = pathFn(rp0, rp1, thetag0, thetag1);\n }\n\n Lib.ensureSingle(bar, 'path').attr('d', dPath);\n });\n\n // clip plotGroup, when trace layer isn't clipped\n Drawing.setClipUrl(\n plotGroup,\n subplot._hasClipOnAxisFalse ? subplot.clipIds.forTraces : null,\n gd\n );\n });\n};\n\nfunction makePathFn(subplot) {\n var cxx = subplot.cxx;\n var cyy = subplot.cyy;\n\n if(subplot.vangles) {\n return function(r0, r1, _a0, _a1) {\n var a0, a1;\n\n if(Lib.angleDelta(_a0, _a1) > 0) {\n a0 = _a0;\n a1 = _a1;\n } else {\n a0 = _a1;\n a1 = _a0;\n }\n\n var va0 = helpers.findEnclosingVertexAngles(a0, subplot.vangles)[0];\n var va1 = helpers.findEnclosingVertexAngles(a1, subplot.vangles)[1];\n var vaBar = [va0, (a0 + a1) / 2, va1];\n return helpers.pathPolygonAnnulus(r0, r1, a0, a1, vaBar, cxx, cyy);\n };\n }\n\n return function(r0, r1, a0, a1) {\n return Lib.pathAnnulus(r0, r1, a0, a1, cxx, cyy);\n };\n}\n\n},{\"../../components/drawing\":617,\"../../lib\":728,\"../../plots/polar/helpers\":841,\"d3\":164,\"fast-isnumeric\":236}],894:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar scatterAttrs = _dereq_('../scatter/attributes');\nvar barAttrs = _dereq_('../bar/attributes');\nvar colorAttrs = _dereq_('../../components/color/attributes');\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nvar scatterMarkerAttrs = scatterAttrs.marker;\nvar scatterMarkerLineAttrs = scatterMarkerAttrs.line;\n\nmodule.exports = {\n y: {\n valType: 'data_array',\n editType: 'calc+clearAxisTypes',\n \n },\n x: {\n valType: 'data_array',\n editType: 'calc+clearAxisTypes',\n \n },\n x0: {\n valType: 'any',\n \n editType: 'calc+clearAxisTypes',\n \n },\n y0: {\n valType: 'any',\n \n editType: 'calc+clearAxisTypes',\n \n },\n\n dx: {\n valType: 'number',\n \n editType: 'calc',\n \n },\n dy: {\n valType: 'number',\n \n editType: 'calc',\n \n },\n\n name: {\n valType: 'string',\n \n editType: 'calc+clearAxisTypes',\n \n },\n\n q1: {\n valType: 'data_array',\n \n editType: 'calc+clearAxisTypes',\n \n },\n median: {\n valType: 'data_array',\n \n editType: 'calc+clearAxisTypes',\n \n },\n q3: {\n valType: 'data_array',\n \n editType: 'calc+clearAxisTypes',\n \n },\n lowerfence: {\n valType: 'data_array',\n \n editType: 'calc',\n \n },\n upperfence: {\n valType: 'data_array',\n \n editType: 'calc',\n \n },\n\n notched: {\n valType: 'boolean',\n \n editType: 'calc',\n \n },\n notchwidth: {\n valType: 'number',\n min: 0,\n max: 0.5,\n dflt: 0.25,\n \n editType: 'calc',\n \n },\n notchspan: {\n valType: 'data_array',\n \n editType: 'calc',\n \n },\n\n // TODO\n // maybe add\n // - loweroutlierbound / upperoutlierbound\n // - lowersuspectedoutlierbound / uppersuspectedoutlierbound\n\n boxpoints: {\n valType: 'enumerated',\n values: ['all', 'outliers', 'suspectedoutliers', false],\n \n editType: 'calc',\n \n },\n jitter: {\n valType: 'number',\n min: 0,\n max: 1,\n \n editType: 'calc',\n \n },\n pointpos: {\n valType: 'number',\n min: -2,\n max: 2,\n \n editType: 'calc',\n \n },\n\n boxmean: {\n valType: 'enumerated',\n values: [true, 'sd', false],\n \n editType: 'calc',\n \n },\n mean: {\n valType: 'data_array',\n \n editType: 'calc',\n \n },\n sd: {\n valType: 'data_array',\n \n editType: 'calc',\n \n },\n\n orientation: {\n valType: 'enumerated',\n values: ['v', 'h'],\n \n editType: 'calc+clearAxisTypes',\n \n },\n\n quartilemethod: {\n valType: 'enumerated',\n values: ['linear', 'exclusive', 'inclusive'],\n dflt: 'linear',\n \n editType: 'calc',\n \n },\n\n width: {\n valType: 'number',\n min: 0,\n \n dflt: 0,\n editType: 'calc',\n \n },\n\n marker: {\n outliercolor: {\n valType: 'color',\n dflt: 'rgba(0, 0, 0, 0)',\n \n editType: 'style',\n \n },\n symbol: extendFlat({}, scatterMarkerAttrs.symbol,\n {arrayOk: false, editType: 'plot'}),\n opacity: extendFlat({}, scatterMarkerAttrs.opacity,\n {arrayOk: false, dflt: 1, editType: 'style'}),\n size: extendFlat({}, scatterMarkerAttrs.size,\n {arrayOk: false, editType: 'calc'}),\n color: extendFlat({}, scatterMarkerAttrs.color,\n {arrayOk: false, editType: 'style'}),\n line: {\n color: extendFlat({}, scatterMarkerLineAttrs.color,\n {arrayOk: false, dflt: colorAttrs.defaultLine, editType: 'style'}\n ),\n width: extendFlat({}, scatterMarkerLineAttrs.width,\n {arrayOk: false, dflt: 0, editType: 'style'}\n ),\n outliercolor: {\n valType: 'color',\n \n editType: 'style',\n \n },\n outlierwidth: {\n valType: 'number',\n min: 0,\n dflt: 1,\n \n editType: 'style',\n \n },\n editType: 'style'\n },\n editType: 'plot'\n },\n\n line: {\n color: {\n valType: 'color',\n \n editType: 'style',\n \n },\n width: {\n valType: 'number',\n \n min: 0,\n dflt: 2,\n editType: 'style',\n \n },\n editType: 'plot'\n },\n\n fillcolor: scatterAttrs.fillcolor,\n\n whiskerwidth: {\n valType: 'number',\n min: 0,\n max: 1,\n dflt: 0.5,\n \n editType: 'calc',\n \n },\n\n offsetgroup: barAttrs.offsetgroup,\n alignmentgroup: barAttrs.alignmentgroup,\n\n selected: {\n marker: scatterAttrs.selected.marker,\n editType: 'style'\n },\n unselected: {\n marker: scatterAttrs.unselected.marker,\n editType: 'style'\n },\n\n text: extendFlat({}, scatterAttrs.text, {\n \n }),\n hovertext: extendFlat({}, scatterAttrs.hovertext, {\n \n }),\n hovertemplate: hovertemplateAttrs({\n \n }),\n\n hoveron: {\n valType: 'flaglist',\n flags: ['boxes', 'points'],\n dflt: 'boxes+points',\n \n editType: 'style',\n \n }\n};\n\n},{\"../../components/color/attributes\":594,\"../../lib/extend\":719,\"../../plots/template_attributes\":854,\"../bar/attributes\":869,\"../scatter/attributes\":1134}],895:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar Lib = _dereq_('../../lib');\n\nvar BADNUM = _dereq_('../../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 if(trace.orientation === 'h') {\n valAxis = xa;\n valLetter = 'x';\n posAxis = ya;\n posLetter = 'y';\n } else {\n valAxis = ya;\n valLetter = 'y';\n posAxis = xa;\n posLetter = 'x';\n }\n\n var posArray = getPos(trace, posLetter, posAxis, fullLayout[numKey]);\n var dv = Lib.distinctVals(posArray);\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\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);\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 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' ? _(gd, 'mean ± σ:') : _(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 getPos(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 return posAxis.makeCalcdata(trace, posLetter);\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\n},{\"../../constants/numerical\":704,\"../../lib\":728,\"../../plots/cartesian/axes\":776,\"fast-isnumeric\":236}],896:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar Lib = _dereq_('../../lib');\nvar getAxisGroup = _dereq_('../../plots/cartesian/axis_ids').getAxisGroup;\n\nvar orientations = ['v', 'h'];\n\nfunction crossTraceCalc(gd, plotinfo) {\n var calcdata = gd.calcdata;\n var xa = plotinfo.xaxis;\n var ya = plotinfo.yaxis;\n\n for(var i = 0; i < orientations.length; i++) {\n var orientation = orientations[i];\n var posAxis = orientation === 'h' ? ya : xa;\n var boxList = [];\n\n // make list of boxes / candlesticks\n // For backward compatibility, candlesticks are treated as if they *are* box traces here\n for(var j = 0; j < calcdata.length; j++) {\n var cd = calcdata[j];\n var t = cd[0].t;\n var trace = cd[0].trace;\n\n if(trace.visible === true &&\n (trace.type === 'box' || trace.type === 'candlestick') &&\n !t.empty &&\n (trace.orientation || 'v') === orientation &&\n trace.xaxis === xa._id &&\n trace.yaxis === ya._id\n ) {\n boxList.push(j);\n }\n }\n\n setPositionOffset('box', gd, boxList, posAxis);\n }\n}\n\nfunction setPositionOffset(traceType, gd, boxList, posAxis) {\n var calcdata = gd.calcdata;\n var fullLayout = gd._fullLayout;\n var axId = posAxis._id;\n var axLetter = axId.charAt(0);\n\n var i, j, calcTrace;\n var pointList = [];\n var shownPts = 0;\n\n // make list of box points\n for(i = 0; i < boxList.length; i++) {\n calcTrace = calcdata[boxList[i]];\n for(j = 0; j < calcTrace.length; j++) {\n pointList.push(posAxis.c2l(calcTrace[j].pos, true));\n shownPts += (calcTrace[j].pts2 || []).length;\n }\n }\n\n if(!pointList.length) return;\n\n // box plots - update dPos based on multiple traces\n var boxdv = Lib.distinctVals(pointList);\n var dPos0 = boxdv.minDiff / 2;\n\n // check for forced minimum dtick\n Axes.minDtick(posAxis, boxdv.minDiff, boxdv.vals[0], true);\n\n var numKey = traceType === 'violin' ? '_numViolins' : '_numBoxes';\n var numTotal = fullLayout[numKey];\n var group = fullLayout[traceType + 'mode'] === 'group' && numTotal > 1;\n var groupFraction = 1 - fullLayout[traceType + 'gap'];\n var groupGapFraction = 1 - fullLayout[traceType + 'groupgap'];\n\n for(i = 0; i < boxList.length; i++) {\n calcTrace = calcdata[boxList[i]];\n\n var trace = calcTrace[0].trace;\n var t = calcTrace[0].t;\n var width = trace.width;\n var side = trace.side;\n\n // position coordinate delta\n var dPos;\n // box half width;\n var bdPos;\n // box center offset\n var bPos;\n // half-width within which to accept hover for this box/violin\n // always split the distance to the closest box/violin\n var wHover;\n\n if(width) {\n dPos = bdPos = wHover = width / 2;\n bPos = 0;\n } else {\n dPos = dPos0;\n\n if(group) {\n var groupId = getAxisGroup(fullLayout, posAxis._id) + trace.orientation;\n var alignmentGroups = fullLayout._alignmentOpts[groupId] || {};\n var alignmentGroupOpts = alignmentGroups[trace.alignmentgroup] || {};\n var nOffsetGroups = Object.keys(alignmentGroupOpts.offsetGroups || {}).length;\n var num = nOffsetGroups || numTotal;\n var shift = nOffsetGroups ? trace._offsetIndex : t.num;\n\n bdPos = dPos * groupFraction * groupGapFraction / num;\n bPos = 2 * dPos * (-0.5 + (shift + 0.5) / num) * groupFraction;\n wHover = dPos * groupFraction / num;\n } else {\n bdPos = dPos * groupFraction * groupGapFraction;\n bPos = 0;\n wHover = dPos;\n }\n }\n t.dPos = dPos;\n t.bPos = bPos;\n t.bdPos = bdPos;\n t.wHover = wHover;\n\n // box/violin-only value-space push value\n var pushplus;\n var pushminus;\n // edge of box/violin\n var edge = bPos + bdPos;\n var edgeplus;\n var edgeminus;\n // value-space padding\n var vpadplus;\n var vpadminus;\n // pixel-space padding\n var ppadplus;\n var ppadminus;\n // do we add 5% of both sides (more logic for points beyond box/violin below)\n var padded = Boolean(width);\n // does this trace show points?\n var hasPts = (trace.boxpoints || trace.points) && (shownPts > 0);\n\n if(side === 'positive') {\n pushplus = dPos * (width ? 1 : 0.5);\n edgeplus = edge;\n pushminus = edgeplus = bPos;\n } else if(side === 'negative') {\n pushplus = edgeplus = bPos;\n pushminus = dPos * (width ? 1 : 0.5);\n edgeminus = edge;\n } else {\n pushplus = pushminus = dPos;\n edgeplus = edgeminus = edge;\n }\n\n if(hasPts) {\n var pointpos = trace.pointpos;\n var jitter = trace.jitter;\n var ms = trace.marker.size / 2;\n\n var pp = 0;\n if((pointpos + jitter) >= 0) {\n pp = edge * (pointpos + jitter);\n if(pp > pushplus) {\n // (++) beyond plus-value, use pp\n padded = true;\n ppadplus = ms;\n vpadplus = pp;\n } else if(pp > edgeplus) {\n // (+), use push-value (it's bigger), but add px-pad\n ppadplus = ms;\n vpadplus = pushplus;\n }\n }\n if(pp <= pushplus) {\n // (->) fallback to push value\n vpadplus = pushplus;\n }\n\n var pm = 0;\n if((pointpos - jitter) <= 0) {\n pm = -edge * (pointpos - jitter);\n if(pm > pushminus) {\n // (--) beyond plus-value, use pp\n padded = true;\n ppadminus = ms;\n vpadminus = pm;\n } else if(pm > edgeminus) {\n // (-), use push-value (it's bigger), but add px-pad\n ppadminus = ms;\n vpadminus = pushminus;\n }\n }\n if(pm <= pushminus) {\n // (<-) fallback to push value\n vpadminus = pushminus;\n }\n } else {\n vpadplus = pushplus;\n vpadminus = pushminus;\n }\n\n var pos = new Array(calcTrace.length);\n for(j = 0; j < calcTrace.length; j++) {\n pos[j] = calcTrace[j].pos;\n }\n\n trace._extremes[axId] = Axes.findExtremes(posAxis, pos, {\n padded: padded,\n vpadminus: vpadminus,\n vpadplus: vpadplus,\n vpadLinearized: true,\n // N.B. SVG px-space positive/negative\n ppadminus: {x: ppadminus, y: ppadplus}[axLetter],\n ppadplus: {x: ppadplus, y: ppadminus}[axLetter],\n });\n }\n}\n\nmodule.exports = {\n crossTraceCalc: crossTraceCalc,\n setPositionOffset: setPositionOffset\n};\n\n},{\"../../lib\":728,\"../../plots/cartesian/axes\":776,\"../../plots/cartesian/axis_ids\":779}],897:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Registry = _dereq_('../../registry');\nvar Color = _dereq_('../../components/color');\nvar handleGroupingDefaults = _dereq_('../bar/defaults').handleGroupingDefaults;\nvar autoType = _dereq_('../../plots/cartesian/axis_autotype');\nvar attributes = _dereq_('./attributes');\n\nfunction supplyDefaults(traceIn, traceOut, defaultColor, layout) {\n function coerce(attr, dflt) {\n return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);\n }\n\n handleSampleDefaults(traceIn, traceOut, coerce, layout);\n if(traceOut.visible === false) return;\n\n var hasPreCompStats = traceOut._hasPreCompStats;\n\n if(hasPreCompStats) {\n coerce('lowerfence');\n coerce('upperfence');\n }\n\n coerce('line.color', (traceIn.marker || {}).color || defaultColor);\n coerce('line.width');\n coerce('fillcolor', Color.addOpacity(traceOut.line.color, 0.5));\n\n var boxmeanDflt = false;\n if(hasPreCompStats) {\n var mean = coerce('mean');\n var sd = coerce('sd');\n if(mean && mean.length) {\n boxmeanDflt = true;\n if(sd && sd.length) boxmeanDflt = 'sd';\n }\n }\n coerce('boxmean', boxmeanDflt);\n\n coerce('whiskerwidth');\n coerce('width');\n coerce('quartilemethod');\n\n var notchedDflt = false;\n if(hasPreCompStats) {\n var notchspan = coerce('notchspan');\n if(notchspan && notchspan.length) {\n notchedDflt = true;\n }\n } else if(Lib.validate(traceIn.notchwidth, attributes.notchwidth)) {\n notchedDflt = true;\n }\n var notched = coerce('notched', notchedDflt);\n if(notched) coerce('notchwidth');\n\n handlePointsDefaults(traceIn, traceOut, coerce, {prefix: 'box'});\n}\n\nfunction handleSampleDefaults(traceIn, traceOut, coerce, layout) {\n function getDims(arr) {\n var dims = 0;\n if(arr && arr.length) {\n dims += 1;\n if(Lib.isArrayOrTypedArray(arr[0]) && arr[0].length) {\n dims += 1;\n }\n }\n return dims;\n }\n\n function valid(astr) {\n return Lib.validate(traceIn[astr], attributes[astr]);\n }\n\n var y = coerce('y');\n var x = coerce('x');\n\n var sLen;\n if(traceOut.type === 'box') {\n var q1 = coerce('q1');\n var median = coerce('median');\n var q3 = coerce('q3');\n\n traceOut._hasPreCompStats = (\n q1 && q1.length &&\n median && median.length &&\n q3 && q3.length\n );\n sLen = Math.min(\n Lib.minRowLength(q1),\n Lib.minRowLength(median),\n Lib.minRowLength(q3)\n );\n }\n\n var yDims = getDims(y);\n var xDims = getDims(x);\n var yLen = yDims && Lib.minRowLength(y);\n var xLen = xDims && Lib.minRowLength(x);\n\n var defaultOrientation, len;\n if(traceOut._hasPreCompStats) {\n switch(String(xDims) + String(yDims)) {\n // no x / no y\n case '00':\n var setInX = valid('x0') || valid('dx');\n var setInY = valid('y0') || valid('dy');\n\n if(setInY && !setInX) {\n defaultOrientation = 'h';\n } else {\n defaultOrientation = 'v';\n }\n\n len = sLen;\n break;\n // just x\n case '10':\n defaultOrientation = 'v';\n len = Math.min(sLen, xLen);\n break;\n case '20':\n defaultOrientation = 'h';\n len = Math.min(sLen, x.length);\n break;\n // just y\n case '01':\n defaultOrientation = 'h';\n len = Math.min(sLen, yLen);\n break;\n case '02':\n defaultOrientation = 'v';\n len = Math.min(sLen, y.length);\n break;\n // both\n case '12':\n defaultOrientation = 'v';\n len = Math.min(sLen, xLen, y.length);\n break;\n case '21':\n defaultOrientation = 'h';\n len = Math.min(sLen, x.length, yLen);\n break;\n case '11':\n // this one is ill-defined\n len = 0;\n break;\n case '22':\n var hasCategories = false;\n var i;\n for(i = 0; i < x.length; i++) {\n if(autoType(x[i]) === 'category') {\n hasCategories = true;\n break;\n }\n }\n\n if(hasCategories) {\n defaultOrientation = 'v';\n len = Math.min(sLen, xLen, y.length);\n } else {\n for(i = 0; i < y.length; i++) {\n if(autoType(y[i]) === 'category') {\n hasCategories = true;\n break;\n }\n }\n\n if(hasCategories) {\n defaultOrientation = 'h';\n len = Math.min(sLen, x.length, yLen);\n } else {\n defaultOrientation = 'v';\n len = Math.min(sLen, xLen, y.length);\n }\n }\n break;\n }\n } else if(yDims > 0) {\n defaultOrientation = 'v';\n if(xDims > 0) {\n len = Math.min(xLen, yLen);\n } else {\n len = Math.min(yLen);\n }\n } else if(xDims > 0) {\n defaultOrientation = 'h';\n len = Math.min(xLen);\n } else {\n len = 0;\n }\n\n if(!len) {\n traceOut.visible = false;\n return;\n }\n traceOut._length = len;\n\n var orientation = coerce('orientation', defaultOrientation);\n\n // these are just used for positioning, they never define the sample\n if(traceOut._hasPreCompStats) {\n if(orientation === 'v' && xDims === 0) {\n coerce('x0', 0);\n coerce('dx', 1);\n } else if(orientation === 'h' && yDims === 0) {\n coerce('y0', 0);\n coerce('dy', 1);\n }\n } else {\n if(orientation === 'v' && xDims === 0) {\n coerce('x0');\n } else if(orientation === 'h' && yDims === 0) {\n coerce('y0');\n }\n }\n\n var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');\n handleCalendarDefaults(traceIn, traceOut, ['x', 'y'], layout);\n}\n\nfunction handlePointsDefaults(traceIn, traceOut, coerce, opts) {\n var prefix = opts.prefix;\n\n var outlierColorDflt = Lib.coerce2(traceIn, traceOut, attributes, 'marker.outliercolor');\n var lineoutliercolor = coerce('marker.line.outliercolor');\n\n var modeDflt = 'outliers';\n if(traceOut._hasPreCompStats) {\n modeDflt = 'all';\n } else if(outlierColorDflt || lineoutliercolor) {\n modeDflt = 'suspectedoutliers';\n }\n\n var mode = coerce(prefix + 'points', modeDflt);\n\n if(mode) {\n coerce('jitter', mode === 'all' ? 0.3 : 0);\n coerce('pointpos', mode === 'all' ? -1.5 : 0);\n\n coerce('marker.symbol');\n coerce('marker.opacity');\n coerce('marker.size');\n coerce('marker.color', traceOut.line.color);\n coerce('marker.line.color');\n coerce('marker.line.width');\n\n if(mode === 'suspectedoutliers') {\n coerce('marker.line.outliercolor', traceOut.marker.color);\n coerce('marker.line.outlierwidth');\n }\n\n coerce('selected.marker.color');\n coerce('unselected.marker.color');\n coerce('selected.marker.size');\n coerce('unselected.marker.size');\n\n coerce('text');\n coerce('hovertext');\n } else {\n delete traceOut.marker;\n }\n\n var hoveron = coerce('hoveron');\n if(hoveron === 'all' || hoveron.indexOf('points') !== -1) {\n coerce('hovertemplate');\n }\n\n Lib.coerceSelectionMarkerOpacity(traceOut, coerce);\n}\n\nfunction crossTraceDefaults(fullData, fullLayout) {\n var traceIn, traceOut;\n\n function coerce(attr) {\n return Lib.coerce(traceOut._input, traceOut, attributes, attr);\n }\n\n for(var i = 0; i < fullData.length; i++) {\n traceOut = fullData[i];\n var traceType = traceOut.type;\n\n if(traceType === 'box' || traceType === 'violin') {\n traceIn = traceOut._input;\n if(fullLayout[traceType + 'mode'] === 'group') {\n handleGroupingDefaults(traceIn, traceOut, fullLayout, coerce);\n }\n }\n }\n}\n\nmodule.exports = {\n supplyDefaults: supplyDefaults,\n crossTraceDefaults: crossTraceDefaults,\n\n handleSampleDefaults: handleSampleDefaults,\n handlePointsDefaults: handlePointsDefaults\n};\n\n},{\"../../components/color\":595,\"../../lib\":728,\"../../plots/cartesian/axis_autotype\":777,\"../../registry\":859,\"../bar/defaults\":873,\"./attributes\":894}],898:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = function eventData(out, pt) {\n // Note: hoverOnBox property is needed for click-to-select\n // to ignore when a box was clicked. This is the reason box\n // implements this custom eventData function.\n if(pt.hoverOnBox) out.hoverOnBox = pt.hoverOnBox;\n\n if('xVal' in pt) out.x = pt.xVal;\n if('yVal' in pt) out.y = pt.yVal;\n if(pt.xa) out.xaxis = pt.xa;\n if(pt.ya) out.yaxis = pt.ya;\n\n return out;\n};\n\n},{}],899:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar Lib = _dereq_('../../lib');\nvar Fx = _dereq_('../../components/fx');\nvar Color = _dereq_('../../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 var closeBoxData = [];\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.pos;\n\n var spikePosAttr = pLetter + 'Spike';\n pointData.spikeDistance = dxy(di) * spikePseudoDistance / hoverPseudoDistance;\n pointData[spikePosAttr] = pAxis.c2p(di.pos, true);\n\n // box plots: each \"point\" gets many labels\n var usedVals = {};\n var attrs = ['med', 'q1', 'q3', 'min', 'max'];\n\n if(trace.boxmean || (trace.meanline || {}).visible) {\n attrs.push('mean');\n }\n if(trace.boxpoints || trace.points) {\n attrs.push('lf', 'uf');\n }\n\n for(var i = 0; i < attrs.length; i++) {\n var attr = attrs[i];\n\n if(!(attr in di) || (di[attr] in usedVals)) continue;\n usedVals[di[attr]] = true;\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);\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') {\n pointData2[vLetter + 'err'] = di.sd;\n }\n\n // only keep name and spikes on the first item (median)\n pointData.name = '';\n pointData.spikeDistance = undefined;\n pointData[spikePosAttr] = undefined;\n\n // no hovertemplate support yet\n pointData2.hovertemplate = false;\n\n closeBoxData.push(pointData2);\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 pa;\n if(trace.orientation === 'h') {\n pa = ya;\n closePtData.xLabelVal = pt.x;\n closePtData.yLabelVal = di.pos;\n } else {\n pa = xa;\n closePtData.xLabelVal = di.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\n},{\"../../components/color\":595,\"../../components/fx\":635,\"../../lib\":728,\"../../plots/cartesian/axes\":776}],900:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n attributes: _dereq_('./attributes'),\n layoutAttributes: _dereq_('./layout_attributes'),\n supplyDefaults: _dereq_('./defaults').supplyDefaults,\n crossTraceDefaults: _dereq_('./defaults').crossTraceDefaults,\n supplyLayoutDefaults: _dereq_('./layout_defaults').supplyLayoutDefaults,\n calc: _dereq_('./calc'),\n crossTraceCalc: _dereq_('./cross_trace_calc').crossTraceCalc,\n plot: _dereq_('./plot').plot,\n style: _dereq_('./style').style,\n styleOnSelect: _dereq_('./style').styleOnSelect,\n hoverPoints: _dereq_('./hover').hoverPoints,\n eventData: _dereq_('./event_data'),\n selectPoints: _dereq_('./select'),\n\n moduleType: 'trace',\n name: 'box',\n basePlotModule: _dereq_('../../plots/cartesian'),\n categories: ['cartesian', 'svg', 'symbols', 'oriented', 'box-violin', 'showLegend', 'boxLayout', 'zoomScale'],\n meta: {\n \n }\n};\n\n},{\"../../plots/cartesian\":789,\"./attributes\":894,\"./calc\":895,\"./cross_trace_calc\":896,\"./defaults\":897,\"./event_data\":898,\"./hover\":899,\"./layout_attributes\":901,\"./layout_defaults\":902,\"./plot\":903,\"./select\":904,\"./style\":905}],901:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n\nmodule.exports = {\n boxmode: {\n valType: 'enumerated',\n values: ['group', 'overlay'],\n dflt: 'overlay',\n \n editType: 'calc',\n \n },\n boxgap: {\n valType: 'number',\n min: 0,\n max: 1,\n dflt: 0.3,\n \n editType: 'calc',\n \n },\n boxgroupgap: {\n valType: 'number',\n min: 0,\n max: 1,\n dflt: 0.3,\n \n editType: 'calc',\n \n }\n};\n\n},{}],902:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\nvar layoutAttributes = _dereq_('./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\n},{\"../../lib\":728,\"../../registry\":859,\"./layout_attributes\":901}],903:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Lib = _dereq_('../../lib');\nvar Drawing = _dereq_('../../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 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);\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) {\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 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', 'non-scaling-stroke')\n .attr('class', 'box');\n\n paths.exit().remove();\n\n paths.each(function(d) {\n if(d.empty) return '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 q1 = valAxis.c2p(d.q1, true);\n var q3 = 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 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);\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 '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 } 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 '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\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\n},{\"../../components/drawing\":617,\"../../lib\":728,\"d3\":164}],904:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\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 i, j;\n\n if(selectionTester === false) {\n for(i = 0; i < cd.length; i++) {\n for(j = 0; j < (cd[i].pts || []).length; j++) {\n // clear selection\n cd[i].pts[j].selected = 0;\n }\n }\n } else {\n for(i = 0; i < cd.length; i++) {\n for(j = 0; j < (cd[i].pts || []).length; j++) {\n var pt = cd[i].pts[j];\n var x = xa.c2p(pt.x);\n var y = ya.c2p(pt.y);\n\n if(selectionTester.contains([x, y], null, pt.i, searchInfo)) {\n selection.push({\n pointNumber: pt.i,\n x: xa.c2d(pt.x),\n y: ya.c2d(pt.y)\n });\n pt.selected = 1;\n } else {\n pt.selected = 0;\n }\n }\n }\n }\n\n return selection;\n};\n\n},{}],905:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Color = _dereq_('../../components/color');\nvar Drawing = _dereq_('../../components/drawing');\n\nfunction style(gd, cd, sel) {\n var s = sel ? sel : d3.select(gd).selectAll('g.trace.boxes');\n\n s.style('opacity', function(d) { return d[0].trace.opacity; });\n\n s.each(function(d) {\n var el = d3.select(this);\n var trace = d[0].trace;\n var lineWidth = trace.line.width;\n\n function styleBox(boxSel, lineWidth, lineColor, fillColor) {\n boxSel.style('stroke-width', lineWidth + 'px')\n .call(Color.stroke, lineColor)\n .call(Color.fill, fillColor);\n }\n\n var allBoxes = el.selectAll('path.box');\n\n if(trace.type === 'candlestick') {\n allBoxes.each(function(boxData) {\n if(boxData.empty) return;\n\n var thisBox = d3.select(this);\n var container = trace[boxData.dir]; // dir = 'increasing' or 'decreasing'\n styleBox(thisBox, container.line.width, container.line.color, container.fillcolor);\n // TODO: custom selection style for candlesticks\n thisBox.style('opacity', trace.selectedpoints && !boxData.selected ? 0.3 : 1);\n });\n } else {\n styleBox(allBoxes, lineWidth, trace.line.color, trace.fillcolor);\n el.selectAll('path.mean')\n .style({\n 'stroke-width': lineWidth,\n 'stroke-dasharray': (2 * lineWidth) + 'px,' + lineWidth + 'px'\n })\n .call(Color.stroke, trace.line.color);\n\n var pts = el.selectAll('path.point');\n Drawing.pointStyle(pts, trace, gd);\n }\n });\n}\n\nfunction styleOnSelect(gd, cd, sel) {\n var trace = cd[0].trace;\n var pts = sel.selectAll('path.point');\n\n if(trace.selectedpoints) {\n Drawing.selectedPointStyle(pts, trace);\n } else {\n Drawing.pointStyle(pts, trace, gd);\n }\n}\n\nmodule.exports = {\n style: style,\n styleOnSelect: styleOnSelect\n};\n\n},{\"../../components/color\":595,\"../../components/drawing\":617,\"d3\":164}],906:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar extendFlat = _dereq_('../../lib').extendFlat;\nvar OHLCattrs = _dereq_('../ohlc/attributes');\nvar boxAttrs = _dereq_('../box/attributes');\n\nfunction directionAttrs(lineColorDefault) {\n return {\n line: {\n color: extendFlat({}, boxAttrs.line.color, {dflt: lineColorDefault}),\n width: boxAttrs.line.width,\n editType: 'style'\n },\n\n fillcolor: boxAttrs.fillcolor,\n editType: 'style'\n };\n}\n\nmodule.exports = {\n x: OHLCattrs.x,\n open: OHLCattrs.open,\n high: OHLCattrs.high,\n low: OHLCattrs.low,\n close: OHLCattrs.close,\n\n line: {\n width: extendFlat({}, boxAttrs.line.width, {\n \n }),\n editType: 'style'\n },\n\n increasing: directionAttrs(OHLCattrs.increasing.line.color.dflt),\n\n decreasing: directionAttrs(OHLCattrs.decreasing.line.color.dflt),\n\n text: OHLCattrs.text,\n hovertext: OHLCattrs.hovertext,\n whiskerwidth: extendFlat({}, boxAttrs.whiskerwidth, { dflt: 0 }),\n\n hoverlabel: OHLCattrs.hoverlabel,\n};\n\n},{\"../../lib\":728,\"../box/attributes\":894,\"../ohlc/attributes\":1080}],907:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Axes = _dereq_('../../plots/cartesian/axes');\n\nvar calcCommon = _dereq_('../ohlc/calc').calcCommon;\n\nmodule.exports = function(gd, trace) {\n var fullLayout = gd._fullLayout;\n var xa = Axes.getFromId(gd, trace.xaxis);\n var ya = Axes.getFromId(gd, trace.yaxis);\n\n var x = xa.makeCalcdata(trace, 'x');\n\n var cd = calcCommon(gd, trace, x, ya, ptFunc);\n\n if(cd.length) {\n Lib.extendFlat(cd[0].t, {\n num: fullLayout._numBoxes,\n dPos: Lib.distinctVals(x).minDiff / 2,\n posLetter: 'x',\n valLetter: 'y',\n });\n\n fullLayout._numBoxes++;\n return cd;\n } else {\n return [{t: {empty: true}}];\n }\n};\n\nfunction ptFunc(o, h, l, c) {\n return {\n min: l,\n q1: Math.min(o, c),\n med: c,\n q3: Math.max(o, c),\n max: h,\n };\n}\n\n},{\"../../lib\":728,\"../../plots/cartesian/axes\":776,\"../ohlc/calc\":1081}],908:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Color = _dereq_('../../components/color');\nvar handleOHLC = _dereq_('../ohlc/ohlc_defaults');\nvar attributes = _dereq_('./attributes');\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 len = handleOHLC(traceIn, traceOut, coerce, layout);\n if(!len) {\n traceOut.visible = false;\n return;\n }\n\n coerce('line.width');\n\n handleDirection(traceIn, traceOut, coerce, 'increasing');\n handleDirection(traceIn, traceOut, coerce, 'decreasing');\n\n coerce('text');\n coerce('hovertext');\n coerce('whiskerwidth');\n\n layout._requestRangeslider[traceOut.xaxis] = true;\n};\n\nfunction handleDirection(traceIn, traceOut, coerce, direction) {\n var lineColor = coerce(direction + '.line.color');\n coerce(direction + '.line.width', traceOut.line.width);\n coerce(direction + '.fillcolor', Color.addOpacity(lineColor, 0.5));\n}\n\n},{\"../../components/color\":595,\"../../lib\":728,\"../ohlc/ohlc_defaults\":1085,\"./attributes\":906}],909:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n moduleType: 'trace',\n name: 'candlestick',\n basePlotModule: _dereq_('../../plots/cartesian'),\n categories: ['cartesian', 'svg', 'showLegend', 'candlestick', 'boxLayout'],\n meta: {\n \n },\n\n attributes: _dereq_('./attributes'),\n layoutAttributes: _dereq_('../box/layout_attributes'),\n supplyLayoutDefaults: _dereq_('../box/layout_defaults').supplyLayoutDefaults,\n crossTraceCalc: _dereq_('../box/cross_trace_calc').crossTraceCalc,\n supplyDefaults: _dereq_('./defaults'),\n calc: _dereq_('./calc'),\n plot: _dereq_('../box/plot').plot,\n layerName: 'boxlayer',\n style: _dereq_('../box/style').style,\n hoverPoints: _dereq_('../ohlc/hover').hoverPoints,\n selectPoints: _dereq_('../ohlc/select')\n};\n\n},{\"../../plots/cartesian\":789,\"../box/cross_trace_calc\":896,\"../box/layout_attributes\":901,\"../box/layout_defaults\":902,\"../box/plot\":903,\"../box/style\":905,\"../ohlc/hover\":1083,\"../ohlc/select\":1087,\"./attributes\":906,\"./calc\":907,\"./defaults\":908}],910:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar handleAxisDefaults = _dereq_('./axis_defaults');\nvar Template = _dereq_('../../plot_api/plot_template');\n\nmodule.exports = function handleABDefaults(traceIn, traceOut, fullLayout, coerce, dfltColor) {\n var a = coerce('a');\n\n if(!a) {\n coerce('da');\n coerce('a0');\n }\n\n var b = coerce('b');\n\n if(!b) {\n coerce('db');\n coerce('b0');\n }\n\n mimickAxisDefaults(traceIn, traceOut, fullLayout, dfltColor);\n};\n\nfunction mimickAxisDefaults(traceIn, traceOut, fullLayout, dfltColor) {\n var axesList = ['aaxis', 'baxis'];\n\n axesList.forEach(function(axName) {\n var axLetter = axName.charAt(0);\n var axIn = traceIn[axName] || {};\n var axOut = Template.newContainer(traceOut, axName);\n\n var defaultOptions = {\n tickfont: 'x',\n id: axLetter + 'axis',\n letter: axLetter,\n font: traceOut.font,\n name: axName,\n data: traceIn[axLetter],\n calendar: traceOut.calendar,\n dfltColor: dfltColor,\n bgColor: fullLayout.paper_bgcolor,\n fullLayout: fullLayout\n };\n\n handleAxisDefaults(axIn, axOut, defaultOptions);\n axOut._categories = axOut._categories || [];\n\n // so we don't have to repeat autotype unnecessarily,\n // copy an autotype back to traceIn\n if(!traceIn[axName] && axIn.type !== '-') {\n traceIn[axName] = {type: axIn.type};\n }\n });\n}\n\n},{\"../../plot_api/plot_template\":766,\"./axis_defaults\":915}],911:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray;\n\nmodule.exports = function(a) {\n return minMax(a, 0);\n};\n\nfunction minMax(a, depth) {\n // Limit to ten dimensional datasets. This seems *exceedingly* unlikely to\n // ever cause problems or even be a concern. It's include strictly so that\n // circular arrays could never cause this to loop.\n if(!isArrayOrTypedArray(a) || depth >= 10) {\n return null;\n }\n\n var min = Infinity;\n var max = -Infinity;\n var n = a.length;\n for(var i = 0; i < n; i++) {\n var datum = a[i];\n\n if(isArrayOrTypedArray(datum)) {\n var result = minMax(datum, depth + 1);\n\n if(result) {\n min = Math.min(result[0], min);\n max = Math.max(result[1], max);\n }\n } else {\n min = Math.min(datum, min);\n max = Math.max(datum, max);\n }\n }\n\n return [min, max];\n}\n\n},{\"../../lib\":728}],912:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar fontAttrs = _dereq_('../../plots/font_attributes');\nvar axisAttrs = _dereq_('./axis_attributes');\nvar colorAttrs = _dereq_('../../components/color/attributes');\n\nvar carpetFont = fontAttrs({\n editType: 'calc',\n \n});\n// TODO: inherit from global font\ncarpetFont.family.dflt = '\"Open Sans\", verdana, arial, sans-serif';\ncarpetFont.size.dflt = 12;\ncarpetFont.color.dflt = colorAttrs.defaultLine;\n\nmodule.exports = {\n carpet: {\n valType: 'string',\n \n editType: 'calc',\n \n },\n x: {\n valType: 'data_array',\n editType: 'calc+clearAxisTypes',\n \n },\n y: {\n valType: 'data_array',\n editType: 'calc+clearAxisTypes',\n \n },\n a: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n a0: {\n valType: 'number',\n dflt: 0,\n \n editType: 'calc',\n \n },\n da: {\n valType: 'number',\n dflt: 1,\n \n editType: 'calc',\n \n },\n b: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n b0: {\n valType: 'number',\n dflt: 0,\n \n editType: 'calc',\n \n },\n db: {\n valType: 'number',\n dflt: 1,\n \n editType: 'calc',\n \n },\n cheaterslope: {\n valType: 'number',\n \n dflt: 1,\n editType: 'calc',\n \n },\n aaxis: axisAttrs,\n baxis: axisAttrs,\n font: carpetFont,\n color: {\n valType: 'color',\n dflt: colorAttrs.defaultLine,\n \n editType: 'plot',\n \n },\n transforms: undefined\n};\n\n},{\"../../components/color/attributes\":594,\"../../plots/font_attributes\":804,\"./axis_attributes\":914}],913:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray;\n\n/* This function retrns a set of control points that define a curve aligned along\n * either the a or b axis. Exactly one of a or b must be an array defining the range\n * spanned.\n *\n * Honestly this is the most complicated function I've implemente here so far because\n * of the way it handles knot insertion and direction/axis-agnostic slices.\n */\nmodule.exports = function(carpet, carpetcd, a, b) {\n var idx, tangent, tanIsoIdx, tanIsoPar, segment, refidx;\n var p0, p1, v0, v1, start, end, range;\n\n var axis = isArrayOrTypedArray(a) ? 'a' : 'b';\n var ax = axis === 'a' ? carpet.aaxis : carpet.baxis;\n var smoothing = ax.smoothing;\n var toIdx = axis === 'a' ? carpet.a2i : carpet.b2j;\n var pt = axis === 'a' ? a : b;\n var iso = axis === 'a' ? b : a;\n var n = axis === 'a' ? carpetcd.a.length : carpetcd.b.length;\n var m = axis === 'a' ? carpetcd.b.length : carpetcd.a.length;\n var isoIdx = Math.floor(axis === 'a' ? carpet.b2j(iso) : carpet.a2i(iso));\n\n var xy = axis === 'a' ? function(value) {\n return carpet.evalxy([], value, isoIdx);\n } : function(value) {\n return carpet.evalxy([], isoIdx, value);\n };\n\n if(smoothing) {\n tanIsoIdx = Math.max(0, Math.min(m - 2, isoIdx));\n tanIsoPar = isoIdx - tanIsoIdx;\n tangent = axis === 'a' ? function(i, ti) {\n return carpet.dxydi([], i, tanIsoIdx, ti, tanIsoPar);\n } : function(j, tj) {\n return carpet.dxydj([], tanIsoIdx, j, tanIsoPar, tj);\n };\n }\n\n var vstart = toIdx(pt[0]);\n var vend = toIdx(pt[1]);\n\n // So that we can make this work in two directions, flip all of the\n // math functions if the direction is from higher to lower indices:\n //\n // Note that the tolerance is directional!\n var dir = vstart < vend ? 1 : -1;\n var tol = (vend - vstart) * 1e-8;\n var dirfloor = dir > 0 ? Math.floor : Math.ceil;\n var dirceil = dir > 0 ? Math.ceil : Math.floor;\n var dirmin = dir > 0 ? Math.min : Math.max;\n var dirmax = dir > 0 ? Math.max : Math.min;\n\n var idx0 = dirfloor(vstart + tol);\n var idx1 = dirceil(vend - tol);\n\n p0 = xy(vstart);\n var segments = [[p0]];\n\n for(idx = idx0; idx * dir < idx1 * dir; idx += dir) {\n segment = [];\n start = dirmax(vstart, idx);\n end = dirmin(vend, idx + dir);\n range = end - start;\n\n // In order to figure out which cell we're in for the derivative (remember,\n // the derivatives are *not* constant across grid lines), let's just average\n // the start and end points. This cuts out just a tiny bit of logic and\n // there's really no computational difference:\n refidx = Math.max(0, Math.min(n - 2, Math.floor(0.5 * (start + end))));\n\n p1 = xy(end);\n if(smoothing) {\n v0 = tangent(refidx, start - refidx);\n v1 = tangent(refidx, end - refidx);\n\n segment.push([\n p0[0] + v0[0] / 3 * range,\n p0[1] + v0[1] / 3 * range\n ]);\n\n segment.push([\n p1[0] - v1[0] / 3 * range,\n p1[1] - v1[1] / 3 * range\n ]);\n }\n\n segment.push(p1);\n\n segments.push(segment);\n p0 = p1;\n }\n\n return segments;\n};\n\n},{\"../../lib\":728}],914:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar fontAttrs = _dereq_('../../plots/font_attributes');\nvar colorAttrs = _dereq_('../../components/color/attributes');\nvar axesAttrs = _dereq_('../../plots/cartesian/layout_attributes');\nvar overrideAll = _dereq_('../../plot_api/edit_types').overrideAll;\n\nvar FORMAT_LINK = _dereq_('../../constants/docs').FORMAT_LINK;\nvar DATE_FORMAT_LINK = _dereq_('../../constants/docs').TIME_FORMAT_LINK;\n\nmodule.exports = {\n color: {\n valType: 'color',\n \n editType: 'calc',\n \n },\n smoothing: {\n valType: 'number',\n dflt: 1,\n min: 0,\n max: 1.3,\n \n editType: 'calc'\n },\n title: {\n text: {\n valType: 'string',\n dflt: '',\n \n editType: 'calc',\n \n },\n font: fontAttrs({\n editType: 'calc',\n \n }),\n // TODO how is this different than `title.standoff`\n offset: {\n valType: 'number',\n \n dflt: 10,\n editType: 'calc',\n \n },\n editType: 'calc',\n },\n type: {\n valType: 'enumerated',\n // '-' means we haven't yet run autotype or couldn't find any data\n // it gets turned into linear in gd._fullLayout but not copied back\n // to gd.data like the others are.\n values: ['-', 'linear', 'date', 'category'],\n dflt: '-',\n \n editType: 'calc',\n \n },\n autorange: {\n valType: 'enumerated',\n values: [true, false, 'reversed'],\n dflt: true,\n \n editType: 'calc',\n \n },\n rangemode: {\n valType: 'enumerated',\n values: ['normal', 'tozero', 'nonnegative'],\n dflt: 'normal',\n \n editType: 'calc',\n \n },\n range: {\n valType: 'info_array',\n \n editType: 'calc',\n items: [\n {valType: 'any', editType: 'calc'},\n {valType: 'any', editType: 'calc'}\n ],\n \n },\n\n fixedrange: {\n valType: 'boolean',\n dflt: false,\n \n editType: 'calc',\n \n },\n cheatertype: {\n valType: 'enumerated',\n values: ['index', 'value'],\n dflt: 'value',\n \n editType: 'calc'\n },\n tickmode: {\n valType: 'enumerated',\n values: ['linear', 'array'],\n dflt: 'array',\n \n editType: 'calc'\n },\n nticks: {\n valType: 'integer',\n min: 0,\n dflt: 0,\n \n editType: 'calc',\n \n },\n tickvals: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n ticktext: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n showticklabels: {\n valType: 'enumerated',\n values: ['start', 'end', 'both', 'none'],\n dflt: 'start',\n \n editType: 'calc',\n \n },\n tickfont: fontAttrs({\n editType: 'calc',\n \n }),\n tickangle: {\n valType: 'angle',\n dflt: 'auto',\n \n editType: 'calc',\n \n },\n tickprefix: {\n valType: 'string',\n dflt: '',\n \n editType: 'calc',\n \n },\n showtickprefix: {\n valType: 'enumerated',\n values: ['all', 'first', 'last', 'none'],\n dflt: 'all',\n \n editType: 'calc',\n \n },\n ticksuffix: {\n valType: 'string',\n dflt: '',\n \n editType: 'calc',\n \n },\n showticksuffix: {\n valType: 'enumerated',\n values: ['all', 'first', 'last', 'none'],\n dflt: 'all',\n \n editType: 'calc',\n \n },\n showexponent: {\n valType: 'enumerated',\n values: ['all', 'first', 'last', 'none'],\n dflt: 'all',\n \n editType: 'calc',\n \n },\n exponentformat: {\n valType: 'enumerated',\n values: ['none', 'e', 'E', 'power', 'SI', 'B'],\n dflt: 'B',\n \n editType: 'calc',\n \n },\n separatethousands: {\n valType: 'boolean',\n dflt: false,\n \n editType: 'calc',\n \n },\n tickformat: {\n valType: 'string',\n dflt: '',\n \n editType: 'calc',\n \n },\n tickformatstops: overrideAll(axesAttrs.tickformatstops, 'calc', 'from-root'),\n categoryorder: {\n valType: 'enumerated',\n values: [\n 'trace', 'category ascending', 'category descending', 'array'\n /* , 'value ascending', 'value descending'*/ // value ascending / descending to be implemented later\n ],\n dflt: 'trace',\n \n editType: 'calc',\n \n },\n categoryarray: {\n valType: 'data_array',\n \n editType: 'calc',\n \n },\n labelpadding: {\n valType: 'integer',\n \n dflt: 10,\n editType: 'calc',\n \n },\n labelprefix: {\n valType: 'string',\n \n editType: 'calc',\n \n },\n labelsuffix: {\n valType: 'string',\n dflt: '',\n \n editType: 'calc',\n \n },\n // lines and grids\n showline: {\n valType: 'boolean',\n dflt: false,\n \n editType: 'calc',\n \n },\n linecolor: {\n valType: 'color',\n dflt: colorAttrs.defaultLine,\n \n editType: 'calc',\n \n },\n linewidth: {\n valType: 'number',\n min: 0,\n dflt: 1,\n \n editType: 'calc',\n \n },\n gridcolor: {\n valType: 'color',\n \n editType: 'calc',\n \n },\n gridwidth: {\n valType: 'number',\n min: 0,\n dflt: 1,\n \n editType: 'calc',\n \n },\n showgrid: {\n valType: 'boolean',\n \n dflt: true,\n editType: 'calc',\n \n },\n minorgridcount: {\n valType: 'integer',\n min: 0,\n dflt: 0,\n \n editType: 'calc',\n \n },\n minorgridwidth: {\n valType: 'number',\n min: 0,\n dflt: 1,\n \n editType: 'calc',\n \n },\n minorgridcolor: {\n valType: 'color',\n dflt: colorAttrs.lightLine,\n \n editType: 'calc',\n \n },\n startline: {\n valType: 'boolean',\n \n editType: 'calc',\n \n },\n startlinecolor: {\n valType: 'color',\n \n editType: 'calc',\n \n },\n startlinewidth: {\n valType: 'number',\n dflt: 1,\n \n editType: 'calc',\n \n },\n endline: {\n valType: 'boolean',\n \n editType: 'calc',\n \n },\n endlinewidth: {\n valType: 'number',\n dflt: 1,\n \n editType: 'calc',\n \n },\n endlinecolor: {\n valType: 'color',\n \n editType: 'calc',\n \n },\n tick0: {\n valType: 'number',\n min: 0,\n dflt: 0,\n \n editType: 'calc',\n \n },\n dtick: {\n valType: 'number',\n min: 0,\n dflt: 1,\n \n editType: 'calc',\n \n },\n arraytick0: {\n valType: 'integer',\n min: 0,\n dflt: 0,\n \n editType: 'calc',\n \n },\n arraydtick: {\n valType: 'integer',\n min: 1,\n dflt: 1,\n \n editType: 'calc',\n \n },\n\n _deprecated: {\n title: {\n valType: 'string',\n \n editType: 'calc',\n \n },\n titlefont: fontAttrs({\n editType: 'calc',\n \n }),\n titleoffset: {\n valType: 'number',\n \n dflt: 10,\n editType: 'calc',\n \n }\n },\n\n editType: 'calc'\n};\n\n},{\"../../components/color/attributes\":594,\"../../constants/docs\":699,\"../../plot_api/edit_types\":759,\"../../plots/cartesian/layout_attributes\":790,\"../../plots/font_attributes\":804}],915:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar carpetAttrs = _dereq_('./attributes');\n\nvar addOpacity = _dereq_('../../components/color').addOpacity;\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\nvar handleTickValueDefaults = _dereq_('../../plots/cartesian/tick_value_defaults');\nvar handleTickLabelDefaults = _dereq_('../../plots/cartesian/tick_label_defaults');\nvar handleCategoryOrderDefaults = _dereq_('../../plots/cartesian/category_order_defaults');\nvar setConvert = _dereq_('../../plots/cartesian/set_convert');\nvar autoType = _dereq_('../../plots/cartesian/axis_autotype');\n\n/**\n * options: object containing:\n *\n * letter: 'a' or 'b'\n * title: name of the axis (ie 'Colorbar') to go in default title\n * name: axis object name (ie 'xaxis') if one should be stored\n * font: the default font to inherit\n * outerTicks: boolean, should ticks default to outside?\n * showGrid: boolean, should gridlines be shown by default?\n * data: the plot data to use in choosing auto type\n * bgColor: the plot background color, to calculate default gridline colors\n */\nmodule.exports = function handleAxisDefaults(containerIn, containerOut, options) {\n var letter = options.letter;\n var font = options.font || {};\n var attributes = carpetAttrs[letter + 'axis'];\n\n function coerce(attr, dflt) {\n return Lib.coerce(containerIn, containerOut, attributes, attr, dflt);\n }\n\n function coerce2(attr, dflt) {\n return Lib.coerce2(containerIn, containerOut, attributes, attr, dflt);\n }\n\n // set up some private properties\n if(options.name) {\n containerOut._name = options.name;\n containerOut._id = options.name;\n }\n\n // now figure out type and do some more initialization\n var axType = coerce('type');\n if(axType === '-') {\n if(options.data) setAutoType(containerOut, options.data);\n\n if(containerOut.type === '-') {\n containerOut.type = 'linear';\n } else {\n // copy autoType back to input axis\n // note that if this object didn't exist\n // in the input layout, we have to put it in\n // this happens in the main supplyDefaults function\n axType = containerIn.type = containerOut.type;\n }\n }\n\n coerce('smoothing');\n coerce('cheatertype');\n\n coerce('showticklabels');\n coerce('labelprefix', letter + ' = ');\n coerce('labelsuffix');\n coerce('showtickprefix');\n coerce('showticksuffix');\n\n coerce('separatethousands');\n coerce('tickformat');\n coerce('exponentformat');\n coerce('showexponent');\n coerce('categoryorder');\n\n coerce('tickmode');\n coerce('tickvals');\n coerce('ticktext');\n coerce('tick0');\n coerce('dtick');\n\n if(containerOut.tickmode === 'array') {\n coerce('arraytick0');\n coerce('arraydtick');\n }\n\n coerce('labelpadding');\n\n containerOut._hovertitle = letter;\n\n\n if(axType === 'date') {\n var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleDefaults');\n handleCalendarDefaults(containerIn, containerOut, 'calendar', options.calendar);\n }\n\n // we need some of the other functions setConvert attaches, but for\n // path finding, override pixel scaling to simple passthrough (identity)\n setConvert(containerOut, options.fullLayout);\n containerOut.c2p = Lib.identity;\n\n var dfltColor = coerce('color', options.dfltColor);\n // if axis.color was provided, use it for fonts too; otherwise,\n // inherit from global font color in case that was provided.\n var dfltFontColor = (dfltColor === containerIn.color) ? dfltColor : font.color;\n\n var title = coerce('title.text');\n if(title) {\n Lib.coerceFont(coerce, 'title.font', {\n family: font.family,\n size: Math.round(font.size * 1.2),\n color: dfltFontColor\n });\n coerce('title.offset');\n }\n\n coerce('tickangle');\n\n var autoRange = coerce('autorange', !containerOut.isValidRange(containerIn.range));\n\n if(autoRange) coerce('rangemode');\n\n coerce('range');\n containerOut.cleanRange();\n\n coerce('fixedrange');\n\n handleTickValueDefaults(containerIn, containerOut, coerce, axType);\n handleTickLabelDefaults(containerIn, containerOut, coerce, axType, options);\n handleCategoryOrderDefaults(containerIn, containerOut, coerce, {\n data: options.data,\n dataAttr: letter\n });\n\n var gridColor = coerce2('gridcolor', addOpacity(dfltColor, 0.3));\n var gridWidth = coerce2('gridwidth');\n var showGrid = coerce('showgrid');\n\n if(!showGrid) {\n delete containerOut.gridcolor;\n delete containerOut.gridwidth;\n }\n\n var startLineColor = coerce2('startlinecolor', dfltColor);\n var startLineWidth = coerce2('startlinewidth', gridWidth);\n var showStartLine = coerce('startline', containerOut.showgrid || !!startLineColor || !!startLineWidth);\n\n if(!showStartLine) {\n delete containerOut.startlinecolor;\n delete containerOut.startlinewidth;\n }\n\n var endLineColor = coerce2('endlinecolor', dfltColor);\n var endLineWidth = coerce2('endlinewidth', gridWidth);\n var showEndLine = coerce('endline', containerOut.showgrid || !!endLineColor || !!endLineWidth);\n\n if(!showEndLine) {\n delete containerOut.endlinecolor;\n delete containerOut.endlinewidth;\n }\n\n if(!showGrid) {\n delete containerOut.gridcolor;\n delete containerOut.gridWidth;\n } else {\n coerce('minorgridcount');\n coerce('minorgridwidth', gridWidth);\n coerce('minorgridcolor', addOpacity(gridColor, 0.06));\n\n if(!containerOut.minorgridcount) {\n delete containerOut.minorgridwidth;\n delete containerOut.minorgridcolor;\n }\n }\n\n if(containerOut.showticklabels === 'none') {\n delete containerOut.tickfont;\n delete containerOut.tickangle;\n delete containerOut.showexponent;\n delete containerOut.exponentformat;\n delete containerOut.tickformat;\n delete containerOut.showticksuffix;\n delete containerOut.showtickprefix;\n }\n\n if(!containerOut.showticksuffix) {\n delete containerOut.ticksuffix;\n }\n\n if(!containerOut.showtickprefix) {\n delete containerOut.tickprefix;\n }\n\n // It needs to be coerced, then something above overrides this deep in the axis code,\n // but no, we *actually* want to coerce this.\n coerce('tickmode');\n\n return containerOut;\n};\n\nfunction setAutoType(ax, data) {\n // new logic: let people specify any type they want,\n // only autotype if type is '-'\n if(ax.type !== '-') return;\n\n var id = ax._id;\n var axLetter = id.charAt(0);\n\n var calAttr = axLetter + 'calendar';\n var calendar = ax[calAttr];\n\n ax.type = autoType(data, calendar);\n}\n\n},{\"../../components/color\":595,\"../../lib\":728,\"../../plots/cartesian/axis_autotype\":777,\"../../plots/cartesian/category_order_defaults\":780,\"../../plots/cartesian/set_convert\":796,\"../../plots/cartesian/tick_label_defaults\":797,\"../../plots/cartesian/tick_value_defaults\":799,\"../../registry\":859,\"./attributes\":912}],916:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar isArray1D = _dereq_('../../lib').isArray1D;\nvar cheaterBasis = _dereq_('./cheater_basis');\nvar arrayMinmax = _dereq_('./array_minmax');\nvar calcGridlines = _dereq_('./calc_gridlines');\nvar calcLabels = _dereq_('./calc_labels');\nvar calcClipPath = _dereq_('./calc_clippath');\nvar clean2dArray = _dereq_('../heatmap/clean_2d_array');\nvar smoothFill2dArray = _dereq_('./smooth_fill_2d_array');\nvar convertColumnData = _dereq_('../heatmap/convert_column_xyz');\nvar setConvert = _dereq_('./set_convert');\n\nmodule.exports = function calc(gd, trace) {\n var xa = Axes.getFromId(gd, trace.xaxis);\n var ya = Axes.getFromId(gd, trace.yaxis);\n var aax = trace.aaxis;\n var bax = trace.baxis;\n\n var x = trace.x;\n var y = trace.y;\n var cols = [];\n if(x && isArray1D(x)) cols.push('x');\n if(y && isArray1D(y)) cols.push('y');\n\n if(cols.length) {\n convertColumnData(trace, aax, bax, 'a', 'b', cols);\n }\n\n var a = trace._a = trace._a || trace.a;\n var b = trace._b = trace._b || trace.b;\n x = trace._x || trace.x;\n y = trace._y || trace.y;\n\n var t = {};\n\n if(trace._cheater) {\n var avals = aax.cheatertype === 'index' ? a.length : a;\n var bvals = bax.cheatertype === 'index' ? b.length : b;\n x = cheaterBasis(avals, bvals, trace.cheaterslope);\n }\n\n trace._x = x = clean2dArray(x);\n trace._y = y = clean2dArray(y);\n\n // Fill in any undefined values with elliptic smoothing. This doesn't take\n // into account the spacing of the values. That is, the derivatives should\n // be modified to use a and b values. It's not that hard, but this is already\n // moderate overkill for just filling in missing values.\n smoothFill2dArray(x, a, b);\n smoothFill2dArray(y, a, b);\n\n setConvert(trace);\n\n // create conversion functions that depend on the data\n trace.setScale();\n\n // This is a rather expensive scan. Nothing guarantees monotonicity,\n // so we need to scan through all data to get proper ranges:\n var xrange = arrayMinmax(x);\n var yrange = arrayMinmax(y);\n\n var dx = 0.5 * (xrange[1] - xrange[0]);\n var xc = 0.5 * (xrange[1] + xrange[0]);\n\n var dy = 0.5 * (yrange[1] - yrange[0]);\n var yc = 0.5 * (yrange[1] + yrange[0]);\n\n // Expand the axes to fit the plot, except just grow it by a factor of 1.3\n // because the labels should be taken into account except that's difficult\n // hence 1.3.\n var grow = 1.3;\n xrange = [xc - dx * grow, xc + dx * grow];\n yrange = [yc - dy * grow, yc + dy * grow];\n\n trace._extremes[xa._id] = Axes.findExtremes(xa, xrange, {padded: true});\n trace._extremes[ya._id] = Axes.findExtremes(ya, yrange, {padded: true});\n\n // Enumerate the gridlines, both major and minor, and store them on the trace\n // object:\n calcGridlines(trace, 'a', 'b');\n calcGridlines(trace, 'b', 'a');\n\n // Calculate the text labels for each major gridline and store them on the\n // trace object:\n calcLabels(trace, aax);\n calcLabels(trace, bax);\n\n // Tabulate points for the four segments that bound the axes so that we can\n // map to pixel coordinates in the plot function and create a clip rect:\n t.clipsegments = calcClipPath(trace._xctrl, trace._yctrl, aax, bax);\n\n t.x = x;\n t.y = y;\n t.a = a;\n t.b = b;\n\n return [t];\n};\n\n},{\"../../lib\":728,\"../../plots/cartesian/axes\":776,\"../heatmap/clean_2d_array\":1015,\"../heatmap/convert_column_xyz\":1017,\"./array_minmax\":911,\"./calc_clippath\":917,\"./calc_gridlines\":918,\"./calc_labels\":919,\"./cheater_basis\":921,\"./set_convert\":934,\"./smooth_fill_2d_array\":935}],917:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nmodule.exports = function makeClipPath(xctrl, yctrl, aax, bax) {\n var i, x, y;\n var segments = [];\n\n var asmoothing = !!aax.smoothing;\n var bsmoothing = !!bax.smoothing;\n var nea1 = xctrl[0].length - 1;\n var neb1 = xctrl.length - 1;\n\n // Along the lower a axis:\n for(i = 0, x = [], y = []; i <= nea1; i++) {\n x[i] = xctrl[0][i];\n y[i] = yctrl[0][i];\n }\n segments.push({x: x, y: y, bicubic: asmoothing});\n\n // Along the upper b axis:\n for(i = 0, x = [], y = []; i <= neb1; i++) {\n x[i] = xctrl[i][nea1];\n y[i] = yctrl[i][nea1];\n }\n segments.push({x: x, y: y, bicubic: bsmoothing});\n\n // Backwards along the upper a axis:\n for(i = nea1, x = [], y = []; i >= 0; i--) {\n x[nea1 - i] = xctrl[neb1][i];\n y[nea1 - i] = yctrl[neb1][i];\n }\n segments.push({x: x, y: y, bicubic: asmoothing});\n\n // Backwards along the lower b axis:\n for(i = neb1, x = [], y = []; i >= 0; i--) {\n x[neb1 - i] = xctrl[i][0];\n y[neb1 - i] = yctrl[i][0];\n }\n segments.push({x: x, y: y, bicubic: bsmoothing});\n\n return segments;\n};\n\n},{}],918:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nmodule.exports = function calcGridlines(trace, axisLetter, crossAxisLetter) {\n var i, j, j0;\n var eps, bounds, n1, n2, n, value, v;\n var j1, v0, v1, d;\n\n var data = trace['_' + axisLetter];\n var axis = trace[axisLetter + 'axis'];\n\n var gridlines = axis._gridlines = [];\n var minorgridlines = axis._minorgridlines = [];\n var boundarylines = axis._boundarylines = [];\n\n var crossData = trace['_' + crossAxisLetter];\n var crossAxis = trace[crossAxisLetter + 'axis'];\n\n if(axis.tickmode === 'array') {\n axis.tickvals = data.slice();\n }\n\n var xcp = trace._xctrl;\n var ycp = trace._yctrl;\n var nea = xcp[0].length;\n var neb = xcp.length;\n var na = trace._a.length;\n var nb = trace._b.length;\n\n Axes.prepTicks(axis);\n\n // don't leave tickvals in axis looking like an attribute\n if(axis.tickmode === 'array') delete axis.tickvals;\n\n // The default is an empty array that will cause the join to remove the gridline if\n // it's just disappeared:\n // axis._startline = axis._endline = [];\n\n // If the cross axis uses bicubic interpolation, then the grid\n // lines fall once every three expanded grid row/cols:\n var stride = axis.smoothing ? 3 : 1;\n\n function constructValueGridline(value) {\n var i, j, j0, tj, pxy, i0, ti, xy, dxydi0, dxydi1, dxydj0, dxydj1;\n var xpoints = [];\n var ypoints = [];\n var ret = {};\n // Search for the fractional grid index giving this line:\n if(axisLetter === 'b') {\n // For the position we use just the i-j coordinates:\n j = trace.b2j(value);\n\n // The derivatives for catmull-rom splines are discontinuous across cell\n // boundaries though, so we need to provide both the cell and the position\n // within the cell separately:\n j0 = Math.floor(Math.max(0, Math.min(nb - 2, j)));\n tj = j - j0;\n\n ret.length = nb;\n ret.crossLength = na;\n\n ret.xy = function(i) {\n return trace.evalxy([], i, j);\n };\n\n ret.dxy = function(i0, ti) {\n return trace.dxydi([], i0, j0, ti, tj);\n };\n\n for(i = 0; i < na; i++) {\n i0 = Math.min(na - 2, i);\n ti = i - i0;\n xy = trace.evalxy([], i, j);\n\n if(crossAxis.smoothing && i > 0) {\n // First control point:\n dxydi0 = trace.dxydi([], i - 1, j0, 0, tj);\n xpoints.push(pxy[0] + dxydi0[0] / 3);\n ypoints.push(pxy[1] + dxydi0[1] / 3);\n\n // Second control point:\n dxydi1 = trace.dxydi([], i - 1, j0, 1, tj);\n xpoints.push(xy[0] - dxydi1[0] / 3);\n ypoints.push(xy[1] - dxydi1[1] / 3);\n }\n\n xpoints.push(xy[0]);\n ypoints.push(xy[1]);\n\n pxy = xy;\n }\n } else {\n i = trace.a2i(value);\n i0 = Math.floor(Math.max(0, Math.min(na - 2, i)));\n ti = i - i0;\n\n ret.length = na;\n ret.crossLength = nb;\n\n ret.xy = function(j) {\n return trace.evalxy([], i, j);\n };\n\n ret.dxy = function(j0, tj) {\n return trace.dxydj([], i0, j0, ti, tj);\n };\n\n for(j = 0; j < nb; j++) {\n j0 = Math.min(nb - 2, j);\n tj = j - j0;\n xy = trace.evalxy([], i, j);\n\n if(crossAxis.smoothing && j > 0) {\n // First control point:\n dxydj0 = trace.dxydj([], i0, j - 1, ti, 0);\n xpoints.push(pxy[0] + dxydj0[0] / 3);\n ypoints.push(pxy[1] + dxydj0[1] / 3);\n\n // Second control point:\n dxydj1 = trace.dxydj([], i0, j - 1, ti, 1);\n xpoints.push(xy[0] - dxydj1[0] / 3);\n ypoints.push(xy[1] - dxydj1[1] / 3);\n }\n\n xpoints.push(xy[0]);\n ypoints.push(xy[1]);\n\n pxy = xy;\n }\n }\n\n ret.axisLetter = axisLetter;\n ret.axis = axis;\n ret.crossAxis = crossAxis;\n ret.value = value;\n ret.constvar = crossAxisLetter;\n ret.index = n;\n ret.x = xpoints;\n ret.y = ypoints;\n ret.smoothing = crossAxis.smoothing;\n\n return ret;\n }\n\n function constructArrayGridline(idx) {\n var j, i0, j0, ti, tj;\n var xpoints = [];\n var ypoints = [];\n var ret = {};\n ret.length = data.length;\n ret.crossLength = crossData.length;\n\n if(axisLetter === 'b') {\n j0 = Math.max(0, Math.min(nb - 2, idx));\n tj = Math.min(1, Math.max(0, idx - j0));\n\n ret.xy = function(i) {\n return trace.evalxy([], i, idx);\n };\n\n ret.dxy = function(i0, ti) {\n return trace.dxydi([], i0, j0, ti, tj);\n };\n\n // In the tickmode: array case, this operation is a simple\n // transfer of data:\n for(j = 0; j < nea; j++) {\n xpoints[j] = xcp[idx * stride][j];\n ypoints[j] = ycp[idx * stride][j];\n }\n } else {\n i0 = Math.max(0, Math.min(na - 2, idx));\n ti = Math.min(1, Math.max(0, idx - i0));\n\n ret.xy = function(j) {\n return trace.evalxy([], idx, j);\n };\n\n ret.dxy = function(j0, tj) {\n return trace.dxydj([], i0, j0, ti, tj);\n };\n\n // In the tickmode: array case, this operation is a simple\n // transfer of data:\n for(j = 0; j < neb; j++) {\n xpoints[j] = xcp[j][idx * stride];\n ypoints[j] = ycp[j][idx * stride];\n }\n }\n\n ret.axisLetter = axisLetter;\n ret.axis = axis;\n ret.crossAxis = crossAxis;\n ret.value = data[idx];\n ret.constvar = crossAxisLetter;\n ret.index = idx;\n ret.x = xpoints;\n ret.y = ypoints;\n ret.smoothing = crossAxis.smoothing;\n\n return ret;\n }\n\n if(axis.tickmode === 'array') {\n // var j0 = axis.startline ? 1 : 0;\n // var j1 = data.length - (axis.endline ? 1 : 0);\n\n eps = 5e-15;\n bounds = [\n Math.floor(((data.length - 1) - axis.arraytick0) / axis.arraydtick * (1 + eps)),\n Math.ceil((- axis.arraytick0) / axis.arraydtick / (1 + eps))\n ].sort(function(a, b) {return a - b;});\n\n // Unpack sorted values so we can be sure to avoid infinite loops if something\n // is backwards:\n n1 = bounds[0] - 1;\n n2 = bounds[1] + 1;\n\n // If the axes fall along array lines, then this is a much simpler process since\n // we already have all the control points we need\n for(n = n1; n < n2; n++) {\n j = axis.arraytick0 + axis.arraydtick * n;\n if(j < 0 || j > data.length - 1) continue;\n gridlines.push(extendFlat(constructArrayGridline(j), {\n color: axis.gridcolor,\n width: axis.gridwidth\n }));\n }\n\n for(n = n1; n < n2; n++) {\n j0 = axis.arraytick0 + axis.arraydtick * n;\n j1 = Math.min(j0 + axis.arraydtick, data.length - 1);\n\n // TODO: fix the bounds computation so we don't have to do a large range and then throw\n // out unneeded numbers\n if(j0 < 0 || j0 > data.length - 1) continue;\n if(j1 < 0 || j1 > data.length - 1) continue;\n\n v0 = data[j0];\n v1 = data[j1];\n\n for(i = 0; i < axis.minorgridcount; i++) {\n d = j1 - j0;\n\n // TODO: fix the bounds computation so we don't have to do a large range and then throw\n // out unneeded numbers\n if(d <= 0) continue;\n\n // XXX: This calculation isn't quite right. Off by one somewhere?\n v = v0 + (v1 - v0) * (i + 1) / (axis.minorgridcount + 1) * (axis.arraydtick / d);\n\n // TODO: fix the bounds computation so we don't have to do a large range and then throw\n // out unneeded numbers\n if(v < data[0] || v > data[data.length - 1]) continue;\n minorgridlines.push(extendFlat(constructValueGridline(v), {\n color: axis.minorgridcolor,\n width: axis.minorgridwidth\n }));\n }\n }\n\n if(axis.startline) {\n boundarylines.push(extendFlat(constructArrayGridline(0), {\n color: axis.startlinecolor,\n width: axis.startlinewidth\n }));\n }\n\n if(axis.endline) {\n boundarylines.push(extendFlat(constructArrayGridline(data.length - 1), {\n color: axis.endlinecolor,\n width: axis.endlinewidth\n }));\n }\n } else {\n // If the lines do not fall along the axes, then we have to interpolate\n // the contro points and so some math to figure out where the lines are\n // in the first place.\n\n // Compute the integer boudns of tick0 + n * dtick that fall within the range\n // (roughly speaking):\n // Give this a nice generous epsilon. We use at as * (1 + eps) in order to make\n // inequalities a little tolerant in a more or less correct manner:\n eps = 5e-15;\n bounds = [\n Math.floor((data[data.length - 1] - axis.tick0) / axis.dtick * (1 + eps)),\n Math.ceil((data[0] - axis.tick0) / axis.dtick / (1 + eps))\n ].sort(function(a, b) {return a - b;});\n\n // Unpack sorted values so we can be sure to avoid infinite loops if something\n // is backwards:\n n1 = bounds[0];\n n2 = bounds[1];\n\n for(n = n1; n <= n2; n++) {\n value = axis.tick0 + axis.dtick * n;\n\n gridlines.push(extendFlat(constructValueGridline(value), {\n color: axis.gridcolor,\n width: axis.gridwidth\n }));\n }\n\n for(n = n1 - 1; n < n2 + 1; n++) {\n value = axis.tick0 + axis.dtick * n;\n\n for(i = 0; i < axis.minorgridcount; i++) {\n v = value + axis.dtick * (i + 1) / (axis.minorgridcount + 1);\n if(v < data[0] || v > data[data.length - 1]) continue;\n minorgridlines.push(extendFlat(constructValueGridline(v), {\n color: axis.minorgridcolor,\n width: axis.minorgridwidth\n }));\n }\n }\n\n if(axis.startline) {\n boundarylines.push(extendFlat(constructValueGridline(data[0]), {\n color: axis.startlinecolor,\n width: axis.startlinewidth\n }));\n }\n\n if(axis.endline) {\n boundarylines.push(extendFlat(constructValueGridline(data[data.length - 1]), {\n color: axis.endlinecolor,\n width: axis.endlinewidth\n }));\n }\n }\n};\n\n},{\"../../lib/extend\":719,\"../../plots/cartesian/axes\":776}],919:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nmodule.exports = function calcLabels(trace, axis) {\n var i, tobj, prefix, suffix, gridline;\n\n var labels = axis._labels = [];\n var gridlines = axis._gridlines;\n\n for(i = 0; i < gridlines.length; i++) {\n gridline = gridlines[i];\n\n if(['start', 'both'].indexOf(axis.showticklabels) !== -1) {\n tobj = Axes.tickText(axis, gridline.value);\n\n extendFlat(tobj, {\n prefix: prefix,\n suffix: suffix,\n endAnchor: true,\n xy: gridline.xy(0),\n dxy: gridline.dxy(0, 0),\n axis: gridline.axis,\n length: gridline.crossAxis.length,\n font: gridline.axis.tickfont,\n isFirst: i === 0,\n isLast: i === gridlines.length - 1\n });\n\n labels.push(tobj);\n }\n\n if(['end', 'both'].indexOf(axis.showticklabels) !== -1) {\n tobj = Axes.tickText(axis, gridline.value);\n\n extendFlat(tobj, {\n endAnchor: false,\n xy: gridline.xy(gridline.crossLength - 1),\n dxy: gridline.dxy(gridline.crossLength - 2, 1),\n axis: gridline.axis,\n length: gridline.crossAxis.length,\n font: gridline.axis.tickfont,\n isFirst: i === 0,\n isLast: i === gridlines.length - 1\n });\n\n labels.push(tobj);\n }\n }\n};\n\n},{\"../../lib/extend\":719,\"../../plots/cartesian/axes\":776}],920:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/*\n * Compute the tangent vector according to catmull-rom cubic splines (centripetal,\n * I think). That differs from the control point in two ways:\n * 1. It is a vector, not a position relative to the point\n * 2. the vector is longer than the position relative to p1 by a factor of 3\n *\n * Close to the boundaries, we'll use these as *quadratic control points, so that\n * to make a nice grid, we'll need to divide the tangent by 2 instead of 3. (The\n * math works out this way if you work through the bezier derivatives)\n */\nvar CatmullRomExp = 0.5;\nmodule.exports = function makeControlPoints(p0, p1, p2, smoothness) {\n var d1x = p0[0] - p1[0];\n var d1y = p0[1] - p1[1];\n var d2x = p2[0] - p1[0];\n var d2y = p2[1] - p1[1];\n var d1a = Math.pow(d1x * d1x + d1y * d1y, CatmullRomExp / 2);\n var d2a = Math.pow(d2x * d2x + d2y * d2y, CatmullRomExp / 2);\n var numx = (d2a * d2a * d1x - d1a * d1a * d2x) * smoothness;\n var numy = (d2a * d2a * d1y - d1a * d1a * d2y) * smoothness;\n var denom1 = d2a * (d1a + d2a) * 3;\n var denom2 = d1a * (d1a + d2a) * 3;\n\n return [[\n p1[0] + (denom1 && numx / denom1),\n p1[1] + (denom1 && numy / denom1)\n ], [\n p1[0] - (denom2 && numx / denom2),\n p1[1] - (denom2 && numy / denom2)\n ]];\n};\n\n},{}],921:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray;\n\n/*\n * Construct a 2D array of cheater values given a, b, and a slope.\n * If\n */\nmodule.exports = function(a, b, cheaterslope) {\n var i, j, ascal, bscal, aval, bval;\n var data = [];\n\n var na = isArrayOrTypedArray(a) ? a.length : a;\n var nb = isArrayOrTypedArray(b) ? b.length : b;\n var adata = isArrayOrTypedArray(a) ? a : null;\n var bdata = isArrayOrTypedArray(b) ? b : null;\n\n // If we're using data, scale it so that for data that's just barely\n // not evenly spaced, the switch to value-based indexing is continuous.\n // This means evenly spaced data should look the same whether value\n // or index cheatertype.\n if(adata) {\n ascal = (adata.length - 1) / (adata[adata.length - 1] - adata[0]) / (na - 1);\n }\n\n if(bdata) {\n bscal = (bdata.length - 1) / (bdata[bdata.length - 1] - bdata[0]) / (nb - 1);\n }\n\n var xval;\n var xmin = Infinity;\n var xmax = -Infinity;\n for(j = 0; j < nb; j++) {\n data[j] = [];\n bval = bdata ? (bdata[j] - bdata[0]) * bscal : j / (nb - 1);\n for(i = 0; i < na; i++) {\n aval = adata ? (adata[i] - adata[0]) * ascal : i / (na - 1);\n xval = aval - bval * cheaterslope;\n xmin = Math.min(xval, xmin);\n xmax = Math.max(xval, xmax);\n data[j][i] = xval;\n }\n }\n\n // Normalize cheater values to the 0-1 range. This comes into play when you have\n // multiple cheater plots. After careful consideration, it seems better if cheater\n // values are normalized to a consistent range. Otherwise one cheater affects the\n // layout of other cheaters on the same axis.\n var slope = 1.0 / (xmax - xmin);\n var offset = -xmin * slope;\n for(j = 0; j < nb; j++) {\n for(i = 0; i < na; i++) {\n data[j][i] = slope * data[j][i] + offset;\n }\n }\n\n return data;\n};\n\n},{\"../../lib\":728}],922:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar makeControlPoints = _dereq_('./catmull_rom');\nvar ensureArray = _dereq_('../../lib').ensureArray;\n\n/*\n * Turns a coarse grid into a fine grid with control points.\n *\n * Here's an ASCII representation:\n *\n * o ----- o ----- o ----- o\n * | | | |\n * | | | |\n * | | | |\n * o ----- o ----- o ----- o\n * | | | |\n * | | | |\n * ^ | | | |\n * | o ----- o ----- o ----- o\n * b | | | | |\n * | | | | |\n * | | | | |\n * o ----- o ----- o ----- o\n * ------>\n * a\n *\n * First of all, note that we want to do this in *cartesian* space. This means\n * we might run into problems when there are extreme differences in x/y scaling,\n * but the alternative is that the topology of the contours might actually be\n * view-dependent, which seems worse. As a fallback, the only parameter that\n * actually affects the result is the *aspect ratio*, so that we can at least\n * improve the situation a bit without going all the way to screen coordinates.\n *\n * This function flattens the points + tangents into a slightly denser grid of\n * *control points*. The resulting grid looks like this:\n *\n * 9 +--o-o--+ -o-o--+--o-o--+\n * 8 o o o o o o o o o o\n * | | | |\n * 7 o o o o o o o o o o\n * 6 +--o-o--+ -o-o--+--o-o--+\n * 5 o o o o o o o o o o\n * | | | |\n * ^ 4 o o o o o o o o o o\n * | 3 +--o-o--+ -o-o--+--o-o--+\n * b | 2 o o o o o o o o o o\n * | | | | |\n * | 1 o o o o o o o o o o\n * 0 +--o-o--+ -o-o--+--o-o--+\n * 0 1 2 3 4 5 6 7 8 9\n * ------>\n * a\n *\n * where `o`s represent newly-computed control points. the resulting dimension is\n *\n * (m - 1) * 3 + 1\n * = 3 * m - 2\n *\n * We could simply store the tangents separately, but that's a nightmare to organize\n * in two dimensions since we'll be slicing grid lines in both directions and since\n * that basically requires very nearly just as much storage as just storing the dense\n * grid.\n *\n * Wow!\n */\n\n\n/*\n * Catmull-rom is biased at the boundaries toward the interior and we actually\n * can't use catmull-rom to compute the control point closest to (but inside)\n * the boundary.\n *\n * A note on plotly's spline interpolation. It uses the catmull rom control point\n * closest to the boundary *as* a quadratic control point. This seems incorrect,\n * so I've elected not to follow that. Given control points 0 and 1, regular plotly\n * splines give *equivalent* cubic control points:\n *\n * Input:\n *\n * boundary\n * | |\n * p0 p2 p3 --> interior\n * 0.0 0.667 1.0\n * | |\n *\n * Cubic-equivalent of what plotly splines draw::\n *\n * boundary\n * | |\n * p0 p1 p2 p3 --> interior\n * 0.0 0.4444 0.8888 1.0\n * | |\n *\n * What this function fills in:\n *\n * boundary\n * | |\n * p0 p1 p2 p3 --> interior\n * 0.0 0.333 0.667 1.0\n * | |\n *\n * Parameters:\n * p0: boundary point\n * p2: catmull rom point based on computation at p3\n * p3: first grid point\n *\n * Of course it works whichever way it's oriented; you just need to interpret the\n * input/output accordingly.\n */\nfunction inferCubicControlPoint(p0, p2, p3) {\n // Extend p1 away from p0 by 50%. This is the equivalent quadratic point that\n // would give the same slope as catmull rom at p0.\n var p2e0 = -0.5 * p3[0] + 1.5 * p2[0];\n var p2e1 = -0.5 * p3[1] + 1.5 * p2[1];\n\n return [\n (2 * p2e0 + p0[0]) / 3,\n (2 * p2e1 + p0[1]) / 3,\n ];\n}\n\nmodule.exports = function computeControlPoints(xe, ye, x, y, asmoothing, bsmoothing) {\n var i, j, ie, je, xej, yej, xj, yj, cp, p1;\n // At this point, we know these dimensions are correct and representative of\n // the whole 2D arrays:\n var na = x[0].length;\n var nb = x.length;\n\n // (n)umber of (e)xpanded points:\n var nea = asmoothing ? 3 * na - 2 : na;\n var neb = bsmoothing ? 3 * nb - 2 : nb;\n\n xe = ensureArray(xe, neb);\n ye = ensureArray(ye, neb);\n\n for(ie = 0; ie < neb; ie++) {\n xe[ie] = ensureArray(xe[ie], nea);\n ye[ie] = ensureArray(ye[ie], nea);\n }\n\n // This loop fills in the X'd points:\n //\n // . . . .\n // . . . .\n // | | | |\n // | | | |\n // X ----- X ----- X ----- X\n // | | | |\n // | | | |\n // | | | |\n // X ----- X ----- X ----- X\n //\n //\n // ie = (i) (e)xpanded:\n for(j = 0, je = 0; j < nb; j++, je += bsmoothing ? 3 : 1) {\n xej = xe[je];\n yej = ye[je];\n xj = x[j];\n yj = y[j];\n\n // je = (j) (e)xpanded:\n for(i = 0, ie = 0; i < na; i++, ie += asmoothing ? 3 : 1) {\n xej[ie] = xj[i];\n yej[ie] = yj[i];\n }\n }\n\n if(asmoothing) {\n // If there's a-smoothing, this loop fills in the X'd points with catmull-rom\n // control points computed along the a-axis:\n // . . . .\n // . . . .\n // | | | |\n // | | | |\n // o -Y-X- o -X-X- o -X-Y- o\n // | | | |\n // | | | |\n // | | | |\n // o -Y-X- o -X-X- o -X-Y- o\n //\n // i: 0 1 2 3\n // ie: 0 1 3 3 4 5 6 7 8 9\n //\n // ------>\n // a\n //\n for(j = 0, je = 0; j < nb; j++, je += bsmoothing ? 3 : 1) {\n // Fill in the points marked X for this a-row:\n for(i = 1, ie = 3; i < na - 1; i++, ie += 3) {\n cp = makeControlPoints(\n [x[j][i - 1], y[j][i - 1]],\n [x[j][i ], y[j][i]],\n [x[j][i + 1], y[j][i + 1]],\n asmoothing\n );\n\n xe[je][ie - 1] = cp[0][0];\n ye[je][ie - 1] = cp[0][1];\n xe[je][ie + 1] = cp[1][0];\n ye[je][ie + 1] = cp[1][1];\n }\n\n // The very first cubic interpolation point (to the left for i = 1 above) is\n // used as a *quadratic* interpolation point by the spline drawing function\n // which isn't really correct. But for the sake of consistency, we'll use it\n // as such. Since we're using cubic splines, that means we need to shorten the\n // tangent by 1/3 and also construct a new cubic spline control point 1/3 from\n // the original to the i = 0 point.\n p1 = inferCubicControlPoint(\n [xe[je][0], ye[je][0]],\n [xe[je][2], ye[je][2]],\n [xe[je][3], ye[je][3]]\n );\n xe[je][1] = p1[0];\n ye[je][1] = p1[1];\n\n // Ditto last points, sans explanation:\n p1 = inferCubicControlPoint(\n [xe[je][nea - 1], ye[je][nea - 1]],\n [xe[je][nea - 3], ye[je][nea - 3]],\n [xe[je][nea - 4], ye[je][nea - 4]]\n );\n xe[je][nea - 2] = p1[0];\n ye[je][nea - 2] = p1[1];\n }\n }\n\n if(bsmoothing) {\n // If there's a-smoothing, this loop fills in the X'd points with catmull-rom\n // control points computed along the b-axis:\n // . . . .\n // X X X X X X X X X X\n // | | | |\n // X X X X X X X X X X\n // o -o-o- o -o-o- o -o-o- o\n // X X X X X X X X X X\n // | | | |\n // Y Y Y Y Y Y Y Y Y Y\n // o -o-o- o -o-o- o -o-o- o\n //\n // i: 0 1 2 3\n // ie: 0 1 3 3 4 5 6 7 8 9\n //\n // ------>\n // a\n //\n for(ie = 0; ie < nea; ie++) {\n for(je = 3; je < neb - 3; je += 3) {\n cp = makeControlPoints(\n [xe[je - 3][ie], ye[je - 3][ie]],\n [xe[je][ie], ye[je][ie]],\n [xe[je + 3][ie], ye[je + 3][ie]],\n bsmoothing\n );\n\n xe[je - 1][ie] = cp[0][0];\n ye[je - 1][ie] = cp[0][1];\n xe[je + 1][ie] = cp[1][0];\n ye[je + 1][ie] = cp[1][1];\n }\n // Do the same boundary condition magic for these control points marked Y above:\n p1 = inferCubicControlPoint(\n [xe[0][ie], ye[0][ie]],\n [xe[2][ie], ye[2][ie]],\n [xe[3][ie], ye[3][ie]]\n );\n xe[1][ie] = p1[0];\n ye[1][ie] = p1[1];\n\n p1 = inferCubicControlPoint(\n [xe[neb - 1][ie], ye[neb - 1][ie]],\n [xe[neb - 3][ie], ye[neb - 3][ie]],\n [xe[neb - 4][ie], ye[neb - 4][ie]]\n );\n xe[neb - 2][ie] = p1[0];\n ye[neb - 2][ie] = p1[1];\n }\n }\n\n if(asmoothing && bsmoothing) {\n // Do one more pass, this time recomputing exactly what we just computed.\n // It's overdetermined since we're peforming catmull-rom in two directions,\n // so we'll just average the overdetermined. These points don't lie along the\n // grid lines, so note that only grid lines will follow normal plotly spline\n // interpolation.\n //\n // Unless of course there was no b smoothing. Then these intermediate points\n // don't actually exist and this section is bypassed.\n // . . . .\n // o X X o X X o X X o\n // | | | |\n // o X X o X X o X X o\n // o -o-o- o -o-o- o -o-o- o\n // o X X o X X o X X o\n // | | | |\n // o Y Y o Y Y o Y Y o\n // o -o-o- o -o-o- o -o-o- o\n //\n // i: 0 1 2 3\n // ie: 0 1 3 3 4 5 6 7 8 9\n //\n // ------>\n // a\n //\n for(je = 1; je < neb; je += (je + 1) % 3 === 0 ? 2 : 1) {\n // Fill in the points marked X for this a-row:\n for(ie = 3; ie < nea - 3; ie += 3) {\n cp = makeControlPoints(\n [xe[je][ie - 3], ye[je][ie - 3]],\n [xe[je][ie], ye[je][ie]],\n [xe[je][ie + 3], ye[je][ie + 3]],\n asmoothing\n );\n\n xe[je][ie - 1] = 0.5 * (xe[je][ie - 1] + cp[0][0]);\n ye[je][ie - 1] = 0.5 * (ye[je][ie - 1] + cp[0][1]);\n xe[je][ie + 1] = 0.5 * (xe[je][ie + 1] + cp[1][0]);\n ye[je][ie + 1] = 0.5 * (ye[je][ie + 1] + cp[1][1]);\n }\n\n // This case is just slightly different. The computation is the same,\n // but having computed this, we'll average with the existing result.\n p1 = inferCubicControlPoint(\n [xe[je][0], ye[je][0]],\n [xe[je][2], ye[je][2]],\n [xe[je][3], ye[je][3]]\n );\n xe[je][1] = 0.5 * (xe[je][1] + p1[0]);\n ye[je][1] = 0.5 * (ye[je][1] + p1[1]);\n\n p1 = inferCubicControlPoint(\n [xe[je][nea - 1], ye[je][nea - 1]],\n [xe[je][nea - 3], ye[je][nea - 3]],\n [xe[je][nea - 4], ye[je][nea - 4]]\n );\n xe[je][nea - 2] = 0.5 * (xe[je][nea - 2] + p1[0]);\n ye[je][nea - 2] = 0.5 * (ye[je][nea - 2] + p1[1]);\n }\n }\n\n return [xe, ye];\n};\n\n},{\"../../lib\":728,\"./catmull_rom\":920}],923:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nmodule.exports = {\n RELATIVE_CULL_TOLERANCE: 1e-6\n};\n\n},{}],924:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/*\n * Evaluates the derivative of a list of control point arrays. That is, it expects an array or arrays\n * that are expanded relative to the raw data to include the bicubic control points, if applicable. If\n * only linear interpolation is desired, then the data points correspond 1-1 along that axis to the\n * data itself. Since it's catmull-rom splines in either direction note in particular that the\n * derivatives are discontinuous across cell boundaries. That's the reason you need both the *cell*\n * and the *point within the cell*.\n *\n * Also note that the discontinuity of the derivative is in magnitude only. The direction *is*\n * continuous across cell boundaries.\n *\n * For example, to compute the derivative of the xcoordinate halfway betwen the 7 and 8th i-gridpoints\n * and the 10th and 11th j-gridpoints given bicubic smoothing in both dimensions, you'd write:\n *\n * var deriv = createIDerivativeEvaluator([x], 1, 1);\n *\n * var dxdi = deriv([], 7, 10, 0.5, 0.5);\n * // => [0.12345]\n *\n * Since there'd be a bunch of duplicate computation to compute multiple derivatives, you can double\n * this up by providing more arrays:\n *\n * var deriv = createIDerivativeEvaluator([x, y], 1, 1);\n *\n * var dxdi = deriv([], 7, 10, 0.5, 0.5);\n * // => [0.12345, 0.78910]\n *\n * NB: It's presumed that at this point all data has been sanitized and is valid numerical data arrays\n * of the correct dimension.\n */\nmodule.exports = function(arrays, asmoothing, bsmoothing) {\n if(asmoothing && bsmoothing) {\n return function(out, i0, j0, u, v) {\n if(!out) out = [];\n var f0, f1, f2, f3, ak, k;\n\n // Since it's a grid of control points, the actual indices are * 3:\n i0 *= 3;\n j0 *= 3;\n\n // Precompute some numbers:\n var u2 = u * u;\n var ou = 1 - u;\n var ou2 = ou * ou;\n var ouu2 = ou * u * 2;\n var a = -3 * ou2;\n var b = 3 * (ou2 - ouu2);\n var c = 3 * (ouu2 - u2);\n var d = 3 * u2;\n\n var v2 = v * v;\n var v3 = v2 * v;\n var ov = 1 - v;\n var ov2 = ov * ov;\n var ov3 = ov2 * ov;\n\n for(k = 0; k < arrays.length; k++) {\n ak = arrays[k];\n // Compute the derivatives in the u-direction:\n f0 = a * ak[j0 ][i0] + b * ak[j0 ][i0 + 1] + c * ak[j0 ][i0 + 2] + d * ak[j0 ][i0 + 3];\n f1 = a * ak[j0 + 1][i0] + b * ak[j0 + 1][i0 + 1] + c * ak[j0 + 1][i0 + 2] + d * ak[j0 + 1][i0 + 3];\n f2 = a * ak[j0 + 2][i0] + b * ak[j0 + 2][i0 + 1] + c * ak[j0 + 2][i0 + 2] + d * ak[j0 + 2][i0 + 3];\n f3 = a * ak[j0 + 3][i0] + b * ak[j0 + 3][i0 + 1] + c * ak[j0 + 3][i0 + 2] + d * ak[j0 + 3][i0 + 3];\n\n // Now just interpolate in the v-direction since it's all separable:\n out[k] = ov3 * f0 + 3 * (ov2 * v * f1 + ov * v2 * f2) + v3 * f3;\n }\n\n return out;\n };\n } else if(asmoothing) {\n // Handle smooth in the a-direction but linear in the b-direction by performing four\n // linear interpolations followed by one cubic interpolation of the result\n return function(out, i0, j0, u, v) {\n if(!out) out = [];\n var f0, f1, k, ak;\n i0 *= 3;\n var u2 = u * u;\n var ou = 1 - u;\n var ou2 = ou * ou;\n var ouu2 = ou * u * 2;\n var a = -3 * ou2;\n var b = 3 * (ou2 - ouu2);\n var c = 3 * (ouu2 - u2);\n var d = 3 * u2;\n var ov = 1 - v;\n for(k = 0; k < arrays.length; k++) {\n ak = arrays[k];\n f0 = a * ak[j0 ][i0] + b * ak[j0 ][i0 + 1] + c * ak[j0 ][i0 + 2] + d * ak[j0 ][i0 + 3];\n f1 = a * ak[j0 + 1][i0] + b * ak[j0 + 1][i0 + 1] + c * ak[j0 + 1][i0 + 2] + d * ak[j0 + 1][i0 + 3];\n\n out[k] = ov * f0 + v * f1;\n }\n return out;\n };\n } else if(bsmoothing) {\n // Same as the above case, except reversed. I've disabled the no-unused vars rule\n // so that this function is fully interpolation-agnostic. Otherwise it would need\n // to be called differently in different cases. Which wouldn't be the worst, but\n /* eslint-disable no-unused-vars */\n return function(out, i0, j0, u, v) {\n /* eslint-enable no-unused-vars */\n if(!out) out = [];\n var f0, f1, f2, f3, k, ak;\n j0 *= 3;\n var v2 = v * v;\n var v3 = v2 * v;\n var ov = 1 - v;\n var ov2 = ov * ov;\n var ov3 = ov2 * ov;\n for(k = 0; k < arrays.length; k++) {\n ak = arrays[k];\n f0 = ak[j0][i0 + 1] - ak[j0][i0];\n f1 = ak[j0 + 1][i0 + 1] - ak[j0 + 1][i0];\n f2 = ak[j0 + 2][i0 + 1] - ak[j0 + 2][i0];\n f3 = ak[j0 + 3][i0 + 1] - ak[j0 + 3][i0];\n\n out[k] = ov3 * f0 + 3 * (ov2 * v * f1 + ov * v2 * f2) + v3 * f3;\n }\n return out;\n };\n } else {\n // Finally, both directions are linear:\n /* eslint-disable no-unused-vars */\n return function(out, i0, j0, u, v) {\n /* eslint-enable no-unused-vars */\n if(!out) out = [];\n var f0, f1, k, ak;\n var ov = 1 - v;\n for(k = 0; k < arrays.length; k++) {\n ak = arrays[k];\n f0 = ak[j0][i0 + 1] - ak[j0][i0];\n f1 = ak[j0 + 1][i0 + 1] - ak[j0 + 1][i0];\n\n out[k] = ov * f0 + v * f1;\n }\n return out;\n };\n }\n};\n\n},{}],925:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = function(arrays, asmoothing, bsmoothing) {\n if(asmoothing && bsmoothing) {\n return function(out, i0, j0, u, v) {\n if(!out) out = [];\n var f0, f1, f2, f3, ak, k;\n\n // Since it's a grid of control points, the actual indices are * 3:\n i0 *= 3;\n j0 *= 3;\n\n // Precompute some numbers:\n var u2 = u * u;\n var u3 = u2 * u;\n var ou = 1 - u;\n var ou2 = ou * ou;\n var ou3 = ou2 * ou;\n\n var v2 = v * v;\n var ov = 1 - v;\n var ov2 = ov * ov;\n var ovv2 = ov * v * 2;\n var a = -3 * ov2;\n var b = 3 * (ov2 - ovv2);\n var c = 3 * (ovv2 - v2);\n var d = 3 * v2;\n\n for(k = 0; k < arrays.length; k++) {\n ak = arrays[k];\n\n // Compute the derivatives in the v-direction:\n f0 = a * ak[j0][i0] + b * ak[j0 + 1][i0] + c * ak[j0 + 2][i0] + d * ak[j0 + 3][i0];\n f1 = a * ak[j0][i0 + 1] + b * ak[j0 + 1][i0 + 1] + c * ak[j0 + 2][i0 + 1] + d * ak[j0 + 3][i0 + 1];\n f2 = a * ak[j0][i0 + 2] + b * ak[j0 + 1][i0 + 2] + c * ak[j0 + 2][i0 + 2] + d * ak[j0 + 3][i0 + 2];\n f3 = a * ak[j0][i0 + 3] + b * ak[j0 + 1][i0 + 3] + c * ak[j0 + 2][i0 + 3] + d * ak[j0 + 3][i0 + 3];\n\n // Now just interpolate in the v-direction since it's all separable:\n out[k] = ou3 * f0 + 3 * (ou2 * u * f1 + ou * u2 * f2) + u3 * f3;\n }\n\n return out;\n };\n } else if(asmoothing) {\n // Handle smooth in the a-direction but linear in the b-direction by performing four\n // linear interpolations followed by one cubic interpolation of the result\n return function(out, i0, j0, v, u) {\n if(!out) out = [];\n var f0, f1, f2, f3, k, ak;\n i0 *= 3;\n var u2 = u * u;\n var u3 = u2 * u;\n var ou = 1 - u;\n var ou2 = ou * ou;\n var ou3 = ou2 * ou;\n for(k = 0; k < arrays.length; k++) {\n ak = arrays[k];\n\n f0 = ak[j0 + 1][i0] - ak[j0][i0];\n f1 = ak[j0 + 1][i0 + 1] - ak[j0][i0 + 1];\n f2 = ak[j0 + 1][i0 + 2] - ak[j0][i0 + 2];\n f3 = ak[j0 + 1][i0 + 3] - ak[j0][i0 + 3];\n\n out[k] = ou3 * f0 + 3 * (ou2 * u * f1 + ou * u2 * f2) + u3 * f3;\n\n // mathematically equivalent:\n // f0 = ou3 * ak[j0 ][i0] + 3 * (ou2 * u * ak[j0 ][i0 + 1] + ou * u2 * ak[j0 ][i0 + 2]) + u3 * ak[j0 ][i0 + 3];\n // f1 = ou3 * ak[j0 + 1][i0] + 3 * (ou2 * u * ak[j0 + 1][i0 + 1] + ou * u2 * ak[j0 + 1][i0 + 2]) + u3 * ak[j0 + 1][i0 + 3];\n // out[k] = f1 - f0;\n }\n return out;\n };\n } else if(bsmoothing) {\n // Same as the above case, except reversed:\n /* eslint-disable no-unused-vars */\n return function(out, i0, j0, u, v) {\n /* eslint-enable no-unused-vars */\n if(!out) out = [];\n var f0, f1, k, ak;\n j0 *= 3;\n var ou = 1 - u;\n var v2 = v * v;\n var ov = 1 - v;\n var ov2 = ov * ov;\n var ovv2 = ov * v * 2;\n var a = -3 * ov2;\n var b = 3 * (ov2 - ovv2);\n var c = 3 * (ovv2 - v2);\n var d = 3 * v2;\n for(k = 0; k < arrays.length; k++) {\n ak = arrays[k];\n f0 = a * ak[j0][i0] + b * ak[j0 + 1][i0] + c * ak[j0 + 2][i0] + d * ak[j0 + 3][i0];\n f1 = a * ak[j0][i0 + 1] + b * ak[j0 + 1][i0 + 1] + c * ak[j0 + 2][i0 + 1] + d * ak[j0 + 3][i0 + 1];\n\n out[k] = ou * f0 + u * f1;\n }\n return out;\n };\n } else {\n // Finally, both directions are linear:\n /* eslint-disable no-unused-vars */\n return function(out, i0, j0, v, u) {\n /* eslint-enable no-unused-vars */\n if(!out) out = [];\n var f0, f1, k, ak;\n var ov = 1 - v;\n for(k = 0; k < arrays.length; k++) {\n ak = arrays[k];\n f0 = ak[j0 + 1][i0] - ak[j0][i0];\n f1 = ak[j0 + 1][i0 + 1] - ak[j0][i0 + 1];\n\n out[k] = ov * f0 + v * f1;\n }\n return out;\n };\n }\n};\n\n},{}],926:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/*\n * Return a function that evaluates a set of linear or bicubic control points.\n * This will get evaluated a lot, so we'll at least do a bit of extra work to\n * flatten some of the choices. In particular, we'll unroll the linear/bicubic\n * combinations and we'll allow computing results in parallel to cut down\n * on repeated arithmetic.\n *\n * Take note that we don't search for the correct range in this function. The\n * reason is for consistency due to the corrresponding derivative function. In\n * particular, the derivatives aren't continuous across cells, so it's important\n * to be able control whether the derivative at a cell boundary is approached\n * from one side or the other.\n */\nmodule.exports = function(arrays, na, nb, asmoothing, bsmoothing) {\n var imax = na - 2;\n var jmax = nb - 2;\n\n if(asmoothing && bsmoothing) {\n return function(out, i, j) {\n if(!out) out = [];\n var f0, f1, f2, f3, ak, k;\n\n var i0 = Math.max(0, Math.min(Math.floor(i), imax));\n var j0 = Math.max(0, Math.min(Math.floor(j), jmax));\n var u = Math.max(0, Math.min(1, i - i0));\n var v = Math.max(0, Math.min(1, j - j0));\n\n // Since it's a grid of control points, the actual indices are * 3:\n i0 *= 3;\n j0 *= 3;\n\n // Precompute some numbers:\n var u2 = u * u;\n var u3 = u2 * u;\n var ou = 1 - u;\n var ou2 = ou * ou;\n var ou3 = ou2 * ou;\n\n var v2 = v * v;\n var v3 = v2 * v;\n var ov = 1 - v;\n var ov2 = ov * ov;\n var ov3 = ov2 * ov;\n\n for(k = 0; k < arrays.length; k++) {\n ak = arrays[k];\n f0 = ou3 * ak[j0][i0] + 3 * (ou2 * u * ak[j0][i0 + 1] + ou * u2 * ak[j0][i0 + 2]) + u3 * ak[j0][i0 + 3];\n f1 = ou3 * ak[j0 + 1][i0] + 3 * (ou2 * u * ak[j0 + 1][i0 + 1] + ou * u2 * ak[j0 + 1][i0 + 2]) + u3 * ak[j0 + 1][i0 + 3];\n f2 = ou3 * ak[j0 + 2][i0] + 3 * (ou2 * u * ak[j0 + 2][i0 + 1] + ou * u2 * ak[j0 + 2][i0 + 2]) + u3 * ak[j0 + 2][i0 + 3];\n f3 = ou3 * ak[j0 + 3][i0] + 3 * (ou2 * u * ak[j0 + 3][i0 + 1] + ou * u2 * ak[j0 + 3][i0 + 2]) + u3 * ak[j0 + 3][i0 + 3];\n out[k] = ov3 * f0 + 3 * (ov2 * v * f1 + ov * v2 * f2) + v3 * f3;\n }\n\n return out;\n };\n } else if(asmoothing) {\n // Handle smooth in the a-direction but linear in the b-direction by performing four\n // linear interpolations followed by one cubic interpolation of the result\n return function(out, i, j) {\n if(!out) out = [];\n\n var i0 = Math.max(0, Math.min(Math.floor(i), imax));\n var j0 = Math.max(0, Math.min(Math.floor(j), jmax));\n var u = Math.max(0, Math.min(1, i - i0));\n var v = Math.max(0, Math.min(1, j - j0));\n\n var f0, f1, f2, f3, k, ak;\n i0 *= 3;\n var u2 = u * u;\n var u3 = u2 * u;\n var ou = 1 - u;\n var ou2 = ou * ou;\n var ou3 = ou2 * ou;\n var ov = 1 - v;\n for(k = 0; k < arrays.length; k++) {\n ak = arrays[k];\n f0 = ov * ak[j0][i0] + v * ak[j0 + 1][i0];\n f1 = ov * ak[j0][i0 + 1] + v * ak[j0 + 1][i0 + 1];\n f2 = ov * ak[j0][i0 + 2] + v * ak[j0 + 1][i0 + 1];\n f3 = ov * ak[j0][i0 + 3] + v * ak[j0 + 1][i0 + 1];\n\n out[k] = ou3 * f0 + 3 * (ou2 * u * f1 + ou * u2 * f2) + u3 * f3;\n }\n return out;\n };\n } else if(bsmoothing) {\n // Same as the above case, except reversed:\n return function(out, i, j) {\n if(!out) out = [];\n\n var i0 = Math.max(0, Math.min(Math.floor(i), imax));\n var j0 = Math.max(0, Math.min(Math.floor(j), jmax));\n var u = Math.max(0, Math.min(1, i - i0));\n var v = Math.max(0, Math.min(1, j - j0));\n\n var f0, f1, f2, f3, k, ak;\n j0 *= 3;\n var v2 = v * v;\n var v3 = v2 * v;\n var ov = 1 - v;\n var ov2 = ov * ov;\n var ov3 = ov2 * ov;\n var ou = 1 - u;\n for(k = 0; k < arrays.length; k++) {\n ak = arrays[k];\n f0 = ou * ak[j0][i0] + u * ak[j0][i0 + 1];\n f1 = ou * ak[j0 + 1][i0] + u * ak[j0 + 1][i0 + 1];\n f2 = ou * ak[j0 + 2][i0] + u * ak[j0 + 2][i0 + 1];\n f3 = ou * ak[j0 + 3][i0] + u * ak[j0 + 3][i0 + 1];\n\n out[k] = ov3 * f0 + 3 * (ov2 * v * f1 + ov * v2 * f2) + v3 * f3;\n }\n return out;\n };\n } else {\n // Finally, both directions are linear:\n return function(out, i, j) {\n if(!out) out = [];\n\n var i0 = Math.max(0, Math.min(Math.floor(i), imax));\n var j0 = Math.max(0, Math.min(Math.floor(j), jmax));\n var u = Math.max(0, Math.min(1, i - i0));\n var v = Math.max(0, Math.min(1, j - j0));\n\n var f0, f1, k, ak;\n var ov = 1 - v;\n var ou = 1 - u;\n for(k = 0; k < arrays.length; k++) {\n ak = arrays[k];\n f0 = ou * ak[j0][i0] + u * ak[j0][i0 + 1];\n f1 = ou * ak[j0 + 1][i0] + u * ak[j0 + 1][i0 + 1];\n\n out[k] = ov * f0 + v * f1;\n }\n return out;\n };\n }\n};\n\n},{}],927:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar handleXYDefaults = _dereq_('./xy_defaults');\nvar handleABDefaults = _dereq_('./ab_defaults');\nvar attributes = _dereq_('./attributes');\nvar colorAttrs = _dereq_('../../components/color/attributes');\n\nmodule.exports = function supplyDefaults(traceIn, traceOut, dfltColor, fullLayout) {\n function coerce(attr, dflt) {\n return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);\n }\n\n traceOut._clipPathId = 'clip' + traceOut.uid + 'carpet';\n\n var defaultColor = coerce('color', colorAttrs.defaultLine);\n Lib.coerceFont(coerce, 'font');\n\n coerce('carpet');\n\n handleABDefaults(traceIn, traceOut, fullLayout, coerce, defaultColor);\n\n if(!traceOut.a || !traceOut.b) {\n traceOut.visible = false;\n return;\n }\n\n if(traceOut.a.length < 3) {\n traceOut.aaxis.smoothing = 0;\n }\n\n if(traceOut.b.length < 3) {\n traceOut.baxis.smoothing = 0;\n }\n\n // NB: the input is x/y arrays. You should know that the *first* dimension of x and y\n // corresponds to b and the second to a. This sounds backwards but ends up making sense\n // the important part to know is that when you write y[j][i], j goes from 0 to b.length - 1\n // and i goes from 0 to a.length - 1.\n var validData = handleXYDefaults(traceIn, traceOut, coerce);\n if(!validData) {\n traceOut.visible = false;\n }\n\n if(traceOut._cheater) {\n coerce('cheaterslope');\n }\n};\n\n},{\"../../components/color/attributes\":594,\"../../lib\":728,\"./ab_defaults\":910,\"./attributes\":912,\"./xy_defaults\":936}],928:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults'),\n plot: _dereq_('./plot'),\n calc: _dereq_('./calc'),\n animatable: true,\n isContainer: true, // so carpet traces get `calc` before other traces\n\n moduleType: 'trace',\n name: 'carpet',\n basePlotModule: _dereq_('../../plots/cartesian'),\n categories: ['cartesian', 'svg', 'carpet', 'carpetAxis', 'notLegendIsolatable', 'noMultiCategory', 'noHover', 'noSortingByValue'],\n meta: {\n \n }\n};\n\n},{\"../../plots/cartesian\":789,\"./attributes\":912,\"./calc\":916,\"./defaults\":927,\"./plot\":933}],929:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/*\n * Given a trace, look up the carpet axis by carpet.\n */\nmodule.exports = function(gd, trace) {\n var n = gd._fullData.length;\n var firstAxis;\n for(var i = 0; i < n; i++) {\n var maybeCarpet = gd._fullData[i];\n\n if(maybeCarpet.index === trace.index) continue;\n\n if(maybeCarpet.type === 'carpet') {\n if(!firstAxis) {\n firstAxis = maybeCarpet;\n }\n\n if(maybeCarpet.carpet === trace.carpet) {\n return maybeCarpet;\n }\n }\n }\n\n return firstAxis;\n};\n\n},{}],930:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = function makePath(xp, yp, isBicubic) {\n // Prevent d3 errors that would result otherwise:\n if(xp.length === 0) return '';\n\n var i;\n var path = [];\n var stride = isBicubic ? 3 : 1;\n for(i = 0; i < xp.length; i += stride) {\n path.push(xp[i] + ',' + yp[i]);\n\n if(isBicubic && i < xp.length - stride) {\n path.push('C');\n path.push([\n xp[i + 1] + ',' + yp[i + 1],\n xp[i + 2] + ',' + yp[i + 2] + ' ',\n ].join(' '));\n }\n }\n return path.join(isBicubic ? '' : 'L');\n};\n\n},{}],931:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray;\n\n/*\n * Map an array of x or y coordinates (c) to screen-space pixel coordinates (p).\n * The output array is optional, but if provided, it will be reused without\n * reallocation to the extent possible.\n */\nmodule.exports = function mapArray(out, data, func) {\n var i;\n\n if(!isArrayOrTypedArray(out)) {\n // If not an array, make it an array:\n out = [];\n } else if(out.length > data.length) {\n // If too long, truncate. (If too short, it will grow\n // automatically so we don't care about that case)\n out = out.slice(0, data.length);\n }\n\n for(i = 0; i < data.length; i++) {\n out[i] = func(data[i]);\n }\n\n return out;\n};\n\n},{\"../../lib\":728}],932:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nmodule.exports = function orientText(trace, xaxis, yaxis, xy, dxy, refDxy) {\n var dx = dxy[0] * trace.dpdx(xaxis);\n var dy = dxy[1] * trace.dpdy(yaxis);\n var flip = 1;\n\n var offsetMultiplier = 1.0;\n if(refDxy) {\n var l1 = Math.sqrt(dxy[0] * dxy[0] + dxy[1] * dxy[1]);\n var l2 = Math.sqrt(refDxy[0] * refDxy[0] + refDxy[1] * refDxy[1]);\n var dot = (dxy[0] * refDxy[0] + dxy[1] * refDxy[1]) / l1 / l2;\n offsetMultiplier = Math.max(0.0, dot);\n }\n\n var angle = Math.atan2(dy, dx) * 180 / Math.PI;\n if(angle < -90) {\n angle += 180;\n flip = -flip;\n } else if(angle > 90) {\n angle -= 180;\n flip = -flip;\n }\n\n return {\n angle: angle,\n flip: flip,\n p: trace.c2p(xy, xaxis, yaxis),\n offsetMultplier: offsetMultiplier\n };\n};\n\n},{}],933:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Drawing = _dereq_('../../components/drawing');\nvar map1dArray = _dereq_('./map_1d_array');\nvar makepath = _dereq_('./makepath');\nvar orientText = _dereq_('./orient_text');\nvar svgTextUtils = _dereq_('../../lib/svg_text_utils');\nvar Lib = _dereq_('../../lib');\nvar alignmentConstants = _dereq_('../../constants/alignment');\n\nmodule.exports = function plot(gd, plotinfo, cdcarpet, carpetLayer) {\n var xa = plotinfo.xaxis;\n var ya = plotinfo.yaxis;\n var fullLayout = gd._fullLayout;\n var clipLayer = fullLayout._clips;\n\n Lib.makeTraceGroups(carpetLayer, cdcarpet, 'trace').each(function(cd) {\n var axisLayer = d3.select(this);\n var cd0 = cd[0];\n var trace = cd0.trace;\n var aax = trace.aaxis;\n var bax = trace.baxis;\n\n var minorLayer = Lib.ensureSingle(axisLayer, 'g', 'minorlayer');\n var majorLayer = Lib.ensureSingle(axisLayer, 'g', 'majorlayer');\n var boundaryLayer = Lib.ensureSingle(axisLayer, 'g', 'boundarylayer');\n var labelLayer = Lib.ensureSingle(axisLayer, 'g', 'labellayer');\n\n axisLayer.style('opacity', trace.opacity);\n\n drawGridLines(xa, ya, majorLayer, aax, 'a', aax._gridlines, true);\n drawGridLines(xa, ya, majorLayer, bax, 'b', bax._gridlines, true);\n drawGridLines(xa, ya, minorLayer, aax, 'a', aax._minorgridlines, true);\n drawGridLines(xa, ya, minorLayer, bax, 'b', bax._minorgridlines, true);\n\n // NB: These are not ommitted if the lines are not active. The joins must be executed\n // in order for them to get cleaned up without a full redraw\n drawGridLines(xa, ya, boundaryLayer, aax, 'a-boundary', aax._boundarylines);\n drawGridLines(xa, ya, boundaryLayer, bax, 'b-boundary', bax._boundarylines);\n\n var labelOrientationA = drawAxisLabels(gd, xa, ya, trace, cd0, labelLayer, aax._labels, 'a-label');\n var labelOrientationB = drawAxisLabels(gd, xa, ya, trace, cd0, labelLayer, bax._labels, 'b-label');\n\n drawAxisTitles(gd, labelLayer, trace, cd0, xa, ya, labelOrientationA, labelOrientationB);\n\n drawClipPath(trace, cd0, clipLayer, xa, ya);\n });\n};\n\nfunction drawClipPath(trace, t, layer, xaxis, yaxis) {\n var seg, xp, yp, i;\n\n var clip = layer.select('#' + trace._clipPathId);\n\n if(!clip.size()) {\n clip = layer.append('clipPath')\n .classed('carpetclip', true);\n }\n\n var path = Lib.ensureSingle(clip, 'path', 'carpetboundary');\n var segments = t.clipsegments;\n var segs = [];\n\n for(i = 0; i < segments.length; i++) {\n seg = segments[i];\n xp = map1dArray([], seg.x, xaxis.c2p);\n yp = map1dArray([], seg.y, yaxis.c2p);\n segs.push(makepath(xp, yp, seg.bicubic));\n }\n\n // This could be optimized ever so slightly to avoid no-op L segments\n // at the corners, but it's so negligible that I don't think it's worth\n // the extra complexity\n var clipPathData = 'M' + segs.join('L') + 'Z';\n clip.attr('id', trace._clipPathId);\n path.attr('d', clipPathData);\n}\n\nfunction drawGridLines(xaxis, yaxis, layer, axis, axisLetter, gridlines) {\n var lineClass = 'const-' + axisLetter + '-lines';\n var gridJoin = layer.selectAll('.' + lineClass).data(gridlines);\n\n gridJoin.enter().append('path')\n .classed(lineClass, true)\n .style('vector-effect', 'non-scaling-stroke');\n\n gridJoin.each(function(d) {\n var gridline = d;\n var x = gridline.x;\n var y = gridline.y;\n\n var xp = map1dArray([], x, xaxis.c2p);\n var yp = map1dArray([], y, yaxis.c2p);\n\n var path = 'M' + makepath(xp, yp, gridline.smoothing);\n\n var el = d3.select(this);\n\n el.attr('d', path)\n .style('stroke-width', gridline.width)\n .style('stroke', gridline.color)\n .style('fill', 'none');\n });\n\n gridJoin.exit().remove();\n}\n\nfunction drawAxisLabels(gd, xaxis, yaxis, trace, t, layer, labels, labelClass) {\n var labelJoin = layer.selectAll('text.' + labelClass).data(labels);\n\n labelJoin.enter().append('text')\n .classed(labelClass, true);\n\n var maxExtent = 0;\n var labelOrientation = {};\n\n labelJoin.each(function(label, i) {\n // Most of the positioning is done in calc_labels. Only the parts that depend upon\n // the screen space representation of the x and y axes are here:\n var orientation;\n if(label.axis.tickangle === 'auto') {\n orientation = orientText(trace, xaxis, yaxis, label.xy, label.dxy);\n } else {\n var angle = (label.axis.tickangle + 180.0) * Math.PI / 180.0;\n orientation = orientText(trace, xaxis, yaxis, label.xy, [Math.cos(angle), Math.sin(angle)]);\n }\n\n if(!i) {\n // TODO: offsetMultiplier? Not currently used anywhere...\n labelOrientation = {angle: orientation.angle, flip: orientation.flip};\n }\n var direction = (label.endAnchor ? -1 : 1) * orientation.flip;\n\n var labelEl = d3.select(this)\n .attr({\n 'text-anchor': direction > 0 ? 'start' : 'end',\n 'data-notex': 1\n })\n .call(Drawing.font, label.font)\n .text(label.text)\n .call(svgTextUtils.convertToTspans, gd);\n\n var bbox = Drawing.bBox(this);\n\n labelEl.attr('transform',\n // Translate to the correct point:\n 'translate(' + orientation.p[0] + ',' + orientation.p[1] + ') ' +\n // Rotate to line up with grid line tangent:\n 'rotate(' + orientation.angle + ')' +\n // Adjust the baseline and indentation:\n 'translate(' + label.axis.labelpadding * direction + ',' + bbox.height * 0.3 + ')'\n );\n\n maxExtent = Math.max(maxExtent, bbox.width + label.axis.labelpadding);\n });\n\n labelJoin.exit().remove();\n\n labelOrientation.maxExtent = maxExtent;\n return labelOrientation;\n}\n\nfunction drawAxisTitles(gd, layer, trace, t, xa, ya, labelOrientationA, labelOrientationB) {\n var a, b, xy, dxy;\n\n var aMin = Lib.aggNums(Math.min, null, trace.a);\n var aMax = Lib.aggNums(Math.max, null, trace.a);\n var bMin = Lib.aggNums(Math.min, null, trace.b);\n var bMax = Lib.aggNums(Math.max, null, trace.b);\n\n a = 0.5 * (aMin + aMax);\n b = bMin;\n xy = trace.ab2xy(a, b, true);\n dxy = trace.dxyda_rough(a, b);\n if(labelOrientationA.angle === undefined) {\n Lib.extendFlat(labelOrientationA, orientText(trace, xa, ya, xy, trace.dxydb_rough(a, b)));\n }\n drawAxisTitle(gd, layer, trace, t, xy, dxy, trace.aaxis, xa, ya, labelOrientationA, 'a-title');\n\n a = aMin;\n b = 0.5 * (bMin + bMax);\n xy = trace.ab2xy(a, b, true);\n dxy = trace.dxydb_rough(a, b);\n if(labelOrientationB.angle === undefined) {\n Lib.extendFlat(labelOrientationB, orientText(trace, xa, ya, xy, trace.dxyda_rough(a, b)));\n }\n drawAxisTitle(gd, layer, trace, t, xy, dxy, trace.baxis, xa, ya, labelOrientationB, 'b-title');\n}\n\nvar lineSpacing = alignmentConstants.LINE_SPACING;\nvar midShift = ((1 - alignmentConstants.MID_SHIFT) / lineSpacing) + 1;\n\nfunction drawAxisTitle(gd, layer, trace, t, xy, dxy, axis, xa, ya, labelOrientation, labelClass) {\n var data = [];\n if(axis.title.text) data.push(axis.title.text);\n var titleJoin = layer.selectAll('text.' + labelClass).data(data);\n var offset = labelOrientation.maxExtent;\n\n titleJoin.enter().append('text')\n .classed(labelClass, true);\n\n // There's only one, but we'll do it as a join so it's updated nicely:\n titleJoin.each(function() {\n var orientation = orientText(trace, xa, ya, xy, dxy);\n\n if(['start', 'both'].indexOf(axis.showticklabels) === -1) {\n offset = 0;\n }\n\n // In addition to the size of the labels, add on some extra padding:\n var titleSize = axis.title.font.size;\n offset += titleSize + axis.title.offset;\n\n var labelNorm = labelOrientation.angle + (labelOrientation.flip < 0 ? 180 : 0);\n var angleDiff = (labelNorm - orientation.angle + 450) % 360;\n var reverseTitle = angleDiff > 90 && angleDiff < 270;\n\n var el = d3.select(this);\n\n el.text(axis.title.text)\n .call(svgTextUtils.convertToTspans, gd);\n\n if(reverseTitle) {\n offset = (-svgTextUtils.lineCount(el) + midShift) * lineSpacing * titleSize - offset;\n }\n\n el.attr('transform',\n 'translate(' + orientation.p[0] + ',' + orientation.p[1] + ') ' +\n 'rotate(' + orientation.angle + ') ' +\n 'translate(0,' + offset + ')'\n )\n .classed('user-select-none', true)\n .attr('text-anchor', 'middle')\n .call(Drawing.font, axis.title.font);\n });\n\n titleJoin.exit().remove();\n}\n\n},{\"../../components/drawing\":617,\"../../constants/alignment\":697,\"../../lib\":728,\"../../lib/svg_text_utils\":752,\"./makepath\":930,\"./map_1d_array\":931,\"./orient_text\":932,\"d3\":164}],934:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar constants = _dereq_('./constants');\nvar search = _dereq_('../../lib/search').findBin;\nvar computeControlPoints = _dereq_('./compute_control_points');\nvar createSplineEvaluator = _dereq_('./create_spline_evaluator');\nvar createIDerivativeEvaluator = _dereq_('./create_i_derivative_evaluator');\nvar createJDerivativeEvaluator = _dereq_('./create_j_derivative_evaluator');\n\n/*\n * Create conversion functions to go from one basis to another. In particular the letter\n * abbreviations are:\n *\n * i: i/j coordinates along the grid. Integer values correspond to data points\n * a: real-valued coordinates along the a/b axes\n * c: cartesian x-y coordinates\n * p: screen-space pixel coordinates\n */\nmodule.exports = function setConvert(trace) {\n var a = trace._a;\n var b = trace._b;\n var na = a.length;\n var nb = b.length;\n var aax = trace.aaxis;\n var bax = trace.baxis;\n\n // Grab the limits once rather than recomputing the bounds for every point\n // independently:\n var amin = a[0];\n var amax = a[na - 1];\n var bmin = b[0];\n var bmax = b[nb - 1];\n var arange = a[a.length - 1] - a[0];\n var brange = b[b.length - 1] - b[0];\n\n // Compute the tolerance so that points are visible slightly outside the\n // defined carpet axis:\n var atol = arange * constants.RELATIVE_CULL_TOLERANCE;\n var btol = brange * constants.RELATIVE_CULL_TOLERANCE;\n\n // Expand the limits to include the relative tolerance:\n amin -= atol;\n amax += atol;\n bmin -= btol;\n bmax += btol;\n\n trace.isVisible = function(a, b) {\n return a > amin && a < amax && b > bmin && b < bmax;\n };\n\n trace.isOccluded = function(a, b) {\n return a < amin || a > amax || b < bmin || b > bmax;\n };\n\n trace.setScale = function() {\n var x = trace._x;\n var y = trace._y;\n\n // This is potentially a very expensive step! It does the bulk of the work of constructing\n // an expanded basis of control points. Note in particular that it overwrites the existing\n // basis without creating a new array since that would potentially thrash the garbage\n // collector.\n var result = computeControlPoints(trace._xctrl, trace._yctrl, x, y, aax.smoothing, bax.smoothing);\n trace._xctrl = result[0];\n trace._yctrl = result[1];\n\n // This step is the second step in the process, but it's somewhat simpler. It just unrolls\n // some logic since it would be unnecessarily expensive to compute both interpolations\n // nearly identically but separately and to include a bunch of linear vs. bicubic logic in\n // every single call.\n trace.evalxy = createSplineEvaluator([trace._xctrl, trace._yctrl], na, nb, aax.smoothing, bax.smoothing);\n\n trace.dxydi = createIDerivativeEvaluator([trace._xctrl, trace._yctrl], aax.smoothing, bax.smoothing);\n trace.dxydj = createJDerivativeEvaluator([trace._xctrl, trace._yctrl], aax.smoothing, bax.smoothing);\n };\n\n /*\n * Convert from i/j data grid coordinates to a/b values. Note in particular that this\n * is *linear* interpolation, even if the data is interpolated bicubically.\n */\n trace.i2a = function(i) {\n var i0 = Math.max(0, Math.floor(i[0]), na - 2);\n var ti = i[0] - i0;\n return (1 - ti) * a[i0] + ti * a[i0 + 1];\n };\n\n trace.j2b = function(j) {\n var j0 = Math.max(0, Math.floor(j[1]), na - 2);\n var tj = j[1] - j0;\n return (1 - tj) * b[j0] + tj * b[j0 + 1];\n };\n\n trace.ij2ab = function(ij) {\n return [trace.i2a(ij[0]), trace.j2b(ij[1])];\n };\n\n /*\n * Convert from a/b coordinates to i/j grid-numbered coordinates. This requires searching\n * through the a/b data arrays and assumes they are monotonic, which is presumed to have\n * been enforced already.\n */\n trace.a2i = function(aval) {\n var i0 = Math.max(0, Math.min(search(aval, a), na - 2));\n var a0 = a[i0];\n var a1 = a[i0 + 1];\n return Math.max(0, Math.min(na - 1, i0 + (aval - a0) / (a1 - a0)));\n };\n\n trace.b2j = function(bval) {\n var j0 = Math.max(0, Math.min(search(bval, b), nb - 2));\n var b0 = b[j0];\n var b1 = b[j0 + 1];\n return Math.max(0, Math.min(nb - 1, j0 + (bval - b0) / (b1 - b0)));\n };\n\n trace.ab2ij = function(ab) {\n return [trace.a2i(ab[0]), trace.b2j(ab[1])];\n };\n\n /*\n * Convert from i/j coordinates to x/y caretesian coordinates. This means either bilinear\n * or bicubic spline evaluation, but the hard part is already done at this point.\n */\n trace.i2c = function(i, j) {\n return trace.evalxy([], i, j);\n };\n\n trace.ab2xy = function(aval, bval, extrapolate) {\n if(!extrapolate && (aval < a[0] || aval > a[na - 1] | bval < b[0] || bval > b[nb - 1])) {\n return [false, false];\n }\n var i = trace.a2i(aval);\n var j = trace.b2j(bval);\n\n var pt = trace.evalxy([], i, j);\n\n if(extrapolate) {\n // This section uses the boundary derivatives to extrapolate linearly outside\n // the defined range. Consider a scatter line with one point inside the carpet\n // axis and one point outside. If we don't extrapolate, we can't draw the line\n // at all.\n var iex = 0;\n var jex = 0;\n var der = [];\n\n var i0, ti, j0, tj;\n if(aval < a[0]) {\n i0 = 0;\n ti = 0;\n iex = (aval - a[0]) / (a[1] - a[0]);\n } else if(aval > a[na - 1]) {\n i0 = na - 2;\n ti = 1;\n iex = (aval - a[na - 1]) / (a[na - 1] - a[na - 2]);\n } else {\n i0 = Math.max(0, Math.min(na - 2, Math.floor(i)));\n ti = i - i0;\n }\n\n if(bval < b[0]) {\n j0 = 0;\n tj = 0;\n jex = (bval - b[0]) / (b[1] - b[0]);\n } else if(bval > b[nb - 1]) {\n j0 = nb - 2;\n tj = 1;\n jex = (bval - b[nb - 1]) / (b[nb - 1] - b[nb - 2]);\n } else {\n j0 = Math.max(0, Math.min(nb - 2, Math.floor(j)));\n tj = j - j0;\n }\n\n if(iex) {\n trace.dxydi(der, i0, j0, ti, tj);\n pt[0] += der[0] * iex;\n pt[1] += der[1] * iex;\n }\n\n if(jex) {\n trace.dxydj(der, i0, j0, ti, tj);\n pt[0] += der[0] * jex;\n pt[1] += der[1] * jex;\n }\n }\n\n return pt;\n };\n\n\n trace.c2p = function(xy, xa, ya) {\n return [xa.c2p(xy[0]), ya.c2p(xy[1])];\n };\n\n trace.p2x = function(p, xa, ya) {\n return [xa.p2c(p[0]), ya.p2c(p[1])];\n };\n\n trace.dadi = function(i /* , u*/) {\n // Right now only a piecewise linear a or b basis is permitted since smoother interpolation\n // would cause monotonicity problems. As a retult, u is entirely disregarded in this\n // computation, though we'll specify it as a parameter for the sake of completeness and\n // future-proofing. It would be possible to use monotonic cubic interpolation, for example.\n //\n // See: https://en.wikipedia.org/wiki/Monotone_cubic_interpolation\n\n // u = u || 0;\n\n var i0 = Math.max(0, Math.min(a.length - 2, i));\n\n // The step (demoninator) is implicitly 1 since that's the grid spacing.\n return a[i0 + 1] - a[i0];\n };\n\n trace.dbdj = function(j /* , v*/) {\n // See above caveats for dadi which also apply here\n var j0 = Math.max(0, Math.min(b.length - 2, j));\n\n // The step (demoninator) is implicitly 1 since that's the grid spacing.\n return b[j0 + 1] - b[j0];\n };\n\n // Takes: grid cell coordinate (i, j) and fractional grid cell coordinates (u, v)\n // Returns: (dx/da, dy/db)\n //\n // NB: separate grid cell + fractional grid cell coordinate format is due to the discontinuous\n // derivative, as described better in create_i_derivative_evaluator.js\n trace.dxyda = function(i0, j0, u, v) {\n var dxydi = trace.dxydi(null, i0, j0, u, v);\n var dadi = trace.dadi(i0, u);\n\n return [dxydi[0] / dadi, dxydi[1] / dadi];\n };\n\n trace.dxydb = function(i0, j0, u, v) {\n var dxydj = trace.dxydj(null, i0, j0, u, v);\n var dbdj = trace.dbdj(j0, v);\n\n return [dxydj[0] / dbdj, dxydj[1] / dbdj];\n };\n\n // Sometimes we don't care about precision and all we really want is decent rough\n // directions (as is the case with labels). In that case, we can do a very rough finite\n // difference and spare having to worry about precise grid coordinates:\n trace.dxyda_rough = function(a, b, reldiff) {\n var h = arange * (reldiff || 0.1);\n var plus = trace.ab2xy(a + h, b, true);\n var minus = trace.ab2xy(a - h, b, true);\n\n return [\n (plus[0] - minus[0]) * 0.5 / h,\n (plus[1] - minus[1]) * 0.5 / h\n ];\n };\n\n trace.dxydb_rough = function(a, b, reldiff) {\n var h = brange * (reldiff || 0.1);\n var plus = trace.ab2xy(a, b + h, true);\n var minus = trace.ab2xy(a, b - h, true);\n\n return [\n (plus[0] - minus[0]) * 0.5 / h,\n (plus[1] - minus[1]) * 0.5 / h\n ];\n };\n\n trace.dpdx = function(xa) {\n return xa._m;\n };\n\n trace.dpdy = function(ya) {\n return ya._m;\n };\n};\n\n},{\"../../lib/search\":747,\"./compute_control_points\":922,\"./constants\":923,\"./create_i_derivative_evaluator\":924,\"./create_j_derivative_evaluator\":925,\"./create_spline_evaluator\":926}],935:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\n/*\n * Given a 2D array as well as a basis in either direction, this function fills in the\n * 2D array using a combination of smoothing and extrapolation. This is rather important\n * for carpet plots since it's used for layout so that we can't simply omit or blank out\n * points. We need a reasonable guess so that the interpolation puts points somewhere\n * even if we were to somehow represent that the data was missing later on.\n *\n * input:\n * - data: 2D array of arrays\n * - a: array such that a.length === data[0].length\n * - b: array such that b.length === data.length\n */\nmodule.exports = function smoothFill2dArray(data, a, b) {\n var i, j, k;\n var ip = [];\n var jp = [];\n // var neighborCnts = [];\n\n var ni = data[0].length;\n var nj = data.length;\n\n function avgSurrounding(i, j) {\n // As a low-quality start, we can simply average surrounding points (in a not\n // non-uniform grid aware manner):\n var sum = 0.0;\n var val;\n var cnt = 0;\n if(i > 0 && (val = data[j][i - 1]) !== undefined) {\n cnt++;\n sum += val;\n }\n if(i < ni - 1 && (val = data[j][i + 1]) !== undefined) {\n cnt++;\n sum += val;\n }\n if(j > 0 && (val = data[j - 1][i]) !== undefined) {\n cnt++;\n sum += val;\n }\n if(j < nj - 1 && (val = data[j + 1][i]) !== undefined) {\n cnt++;\n sum += val;\n }\n return sum / Math.max(1, cnt);\n }\n\n // This loop iterates over all cells. Any cells that are null will be noted and those\n // are the only points we will loop over and update via laplace's equation. Points with\n // any neighbors will receive the average. If there are no neighboring points, then they\n // will be set to zero. Also as we go, track the maximum magnitude so that we can scale\n // our tolerance accordingly.\n var dmax = 0.0;\n for(i = 0; i < ni; i++) {\n for(j = 0; j < nj; j++) {\n if(data[j][i] === undefined) {\n ip.push(i);\n jp.push(j);\n\n data[j][i] = avgSurrounding(i, j);\n // neighborCnts.push(result.neighbors);\n }\n dmax = Math.max(dmax, Math.abs(data[j][i]));\n }\n }\n\n if(!ip.length) return data;\n\n // The tolerance doesn't need to be excessive. It's just for display positioning\n var dxp, dxm, dap, dam, dbp, dbm, c, d, diff, reldiff, overrelaxation;\n var tol = 1e-5;\n var resid = 0;\n var itermax = 100;\n var iter = 0;\n var n = ip.length;\n do {\n resid = 0;\n // Normally we'd loop in two dimensions, but not all points are blank and need\n // an update, so we instead loop only over the points that were tabulated above\n for(k = 0; k < n; k++) {\n i = ip[k];\n j = jp[k];\n // neighborCnt = neighborCnts[k];\n\n // Track a counter for how many contributions there are. We'll use this counter\n // to average at the end, which reduces to laplace's equation with neumann boundary\n // conditions on the first derivative (second derivative is zero so that we get\n // a nice linear extrapolation at the boundaries).\n var boundaryCnt = 0;\n var newVal = 0;\n\n var d0, d1, x0, x1, i0, j0;\n if(i === 0) {\n // If this lies along the i = 0 boundary, extrapolate from the two points\n // to the right of this point. Note that the finite differences take into\n // account non-uniform grid spacing:\n i0 = Math.min(ni - 1, 2);\n x0 = a[i0];\n x1 = a[1];\n d0 = data[j][i0];\n d1 = data[j][1];\n newVal += d1 + (d1 - d0) * (a[0] - x1) / (x1 - x0);\n boundaryCnt++;\n } else if(i === ni - 1) {\n // If along the high i boundary, extrapolate from the two points to the\n // left of this point\n i0 = Math.max(0, ni - 3);\n x0 = a[i0];\n x1 = a[ni - 2];\n d0 = data[j][i0];\n d1 = data[j][ni - 2];\n newVal += d1 + (d1 - d0) * (a[ni - 1] - x1) / (x1 - x0);\n boundaryCnt++;\n }\n\n if((i === 0 || i === ni - 1) && (j > 0 && j < nj - 1)) {\n // If along the min(i) or max(i) boundaries, also smooth vertically as long\n // as we're not in a corner. Note that the finite differences used here\n // are also aware of nonuniform grid spacing:\n dxp = b[j + 1] - b[j];\n dxm = b[j] - b[j - 1];\n newVal += (dxm * data[j + 1][i] + dxp * data[j - 1][i]) / (dxm + dxp);\n boundaryCnt++;\n }\n\n if(j === 0) {\n // If along the j = 0 boundary, extrpolate this point from the two points\n // above it\n j0 = Math.min(nj - 1, 2);\n x0 = b[j0];\n x1 = b[1];\n d0 = data[j0][i];\n d1 = data[1][i];\n newVal += d1 + (d1 - d0) * (b[0] - x1) / (x1 - x0);\n boundaryCnt++;\n } else if(j === nj - 1) {\n // Same for the max j boundary from the cells below it:\n j0 = Math.max(0, nj - 3);\n x0 = b[j0];\n x1 = b[nj - 2];\n d0 = data[j0][i];\n d1 = data[nj - 2][i];\n newVal += d1 + (d1 - d0) * (b[nj - 1] - x1) / (x1 - x0);\n boundaryCnt++;\n }\n\n if((j === 0 || j === nj - 1) && (i > 0 && i < ni - 1)) {\n // Now average points to the left/right as long as not in a corner:\n dxp = a[i + 1] - a[i];\n dxm = a[i] - a[i - 1];\n newVal += (dxm * data[j][i + 1] + dxp * data[j][i - 1]) / (dxm + dxp);\n boundaryCnt++;\n }\n\n if(!boundaryCnt) {\n // If none of the above conditions were triggered, then this is an interior\n // point and we can just do a laplace equation update. As above, these differences\n // are aware of nonuniform grid spacing:\n dap = a[i + 1] - a[i];\n dam = a[i] - a[i - 1];\n dbp = b[j + 1] - b[j];\n dbm = b[j] - b[j - 1];\n\n // These are just some useful constants for the iteration, which is perfectly\n // straightforward but a little long to derive from f_xx + f_yy = 0.\n c = dap * dam * (dap + dam);\n d = dbp * dbm * (dbp + dbm);\n\n newVal = (c * (dbm * data[j + 1][i] + dbp * data[j - 1][i]) +\n d * (dam * data[j][i + 1] + dap * data[j][i - 1])) /\n (d * (dam + dap) + c * (dbm + dbp));\n } else {\n // If we did have contributions from the boundary conditions, then average\n // the result from the various contributions:\n newVal /= boundaryCnt;\n }\n\n // Jacobi updates are ridiculously slow to converge, so this approach uses a\n // Gauss-seidel iteration which is dramatically faster.\n diff = newVal - data[j][i];\n reldiff = diff / dmax;\n resid += reldiff * reldiff;\n\n // Gauss-Seidel-ish iteration, omega chosen based on heuristics and some\n // quick tests.\n //\n // NB: Don't overrelax the boundarie. Otherwise set an overrelaxation factor\n // which is a little low but safely optimal-ish:\n overrelaxation = boundaryCnt ? 0 : 0.85;\n\n // If there are four non-null neighbors, then we want a simple average without\n // overrelaxation. If all the surrouding points are null, then we want the full\n // overrelaxation\n //\n // Based on experiments, this actually seems to slow down convergence just a bit.\n // I'll leave it here for reference in case this needs to be revisited, but\n // it seems to work just fine without this.\n // if (overrelaxation) overrelaxation *= (4 - neighborCnt) / 4;\n\n data[j][i] += diff * (1 + overrelaxation);\n }\n\n resid = Math.sqrt(resid);\n } while(iter++ < itermax && resid > tol);\n\n Lib.log('Smoother converged to', resid, 'after', iter, 'iterations');\n\n return data;\n};\n\n},{\"../../lib\":728}],936:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isArray1D = _dereq_('../../lib').isArray1D;\n\nmodule.exports = function handleXYDefaults(traceIn, traceOut, coerce) {\n var x = coerce('x');\n var hasX = x && x.length;\n var y = coerce('y');\n var hasY = y && y.length;\n if(!hasX && !hasY) return false;\n\n traceOut._cheater = !x;\n\n if((!hasX || isArray1D(x)) && (!hasY || isArray1D(y))) {\n var len = hasX ? x.length : Infinity;\n if(hasY) len = Math.min(len, y.length);\n if(traceOut.a && traceOut.a.length) len = Math.min(len, traceOut.a.length);\n if(traceOut.b && traceOut.b.length) len = Math.min(len, traceOut.b.length);\n traceOut._length = len;\n } else traceOut._length = null;\n\n return true;\n};\n\n},{\"../../lib\":728}],937:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar scatterGeoAttrs = _dereq_('../scattergeo/attributes');\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\nvar baseAttrs = _dereq_('../../plots/attributes');\nvar defaultLine = _dereq_('../../components/color/attributes').defaultLine;\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nvar scatterGeoMarkerLineAttrs = scatterGeoAttrs.marker.line;\n\nmodule.exports = extendFlat({\n locations: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n locationmode: scatterGeoAttrs.locationmode,\n z: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n geojson: extendFlat({}, scatterGeoAttrs.geojson, {\n \n }),\n featureidkey: scatterGeoAttrs.featureidkey,\n\n text: extendFlat({}, scatterGeoAttrs.text, {\n \n }),\n hovertext: extendFlat({}, scatterGeoAttrs.hovertext, {\n \n }),\n marker: {\n line: {\n color: extendFlat({}, scatterGeoMarkerLineAttrs.color, {dflt: defaultLine}),\n width: extendFlat({}, scatterGeoMarkerLineAttrs.width, {dflt: 1}),\n editType: 'calc'\n },\n opacity: {\n valType: 'number',\n arrayOk: true,\n min: 0,\n max: 1,\n dflt: 1,\n \n editType: 'style',\n \n },\n editType: 'calc'\n },\n\n selected: {\n marker: {\n opacity: scatterGeoAttrs.selected.marker.opacity,\n editType: 'plot'\n },\n editType: 'plot'\n },\n unselected: {\n marker: {\n opacity: scatterGeoAttrs.unselected.marker.opacity,\n editType: 'plot'\n },\n editType: 'plot'\n },\n\n hoverinfo: extendFlat({}, baseAttrs.hoverinfo, {\n editType: 'calc',\n flags: ['location', 'z', 'text', 'name']\n }),\n hovertemplate: hovertemplateAttrs(),\n showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})\n},\n\n colorScaleAttrs('', {\n cLetter: 'z',\n editTypeOverride: 'calc'\n })\n);\n\n},{\"../../components/color/attributes\":594,\"../../components/colorscale/attributes\":602,\"../../lib/extend\":719,\"../../plots/attributes\":773,\"../../plots/template_attributes\":854,\"../scattergeo/attributes\":1175}],938:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\n\nvar colorscaleCalc = _dereq_('../../components/colorscale/calc');\nvar arraysToCalcdata = _dereq_('../scatter/arrays_to_calcdata');\nvar calcSelection = _dereq_('../scatter/calc_selection');\n\nfunction isNonBlankString(v) {\n return v && typeof v === 'string';\n}\n\nmodule.exports = function calc(gd, trace) {\n var len = trace._length;\n var calcTrace = new Array(len);\n\n var isValidLoc;\n\n if(trace.geojson) {\n isValidLoc = function(v) { return isNonBlankString(v) || isNumeric(v); };\n } else {\n isValidLoc = isNonBlankString;\n }\n\n for(var i = 0; i < len; i++) {\n var calcPt = calcTrace[i] = {};\n var loc = trace.locations[i];\n var z = trace.z[i];\n\n if(isValidLoc(loc) && isNumeric(z)) {\n calcPt.loc = loc;\n calcPt.z = z;\n } else {\n calcPt.loc = null;\n calcPt.z = BADNUM;\n }\n\n calcPt.index = i;\n }\n\n arraysToCalcdata(calcTrace, trace);\n colorscaleCalc(gd, trace, {\n vals: trace.z,\n containerStr: '',\n cLetter: 'z'\n });\n calcSelection(calcTrace, trace);\n\n return calcTrace;\n};\n\n},{\"../../components/colorscale/calc\":603,\"../../constants/numerical\":704,\"../scatter/arrays_to_calcdata\":1133,\"../scatter/calc_selection\":1136,\"fast-isnumeric\":236}],939:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar colorscaleDefaults = _dereq_('../../components/colorscale/defaults');\nvar attributes = _dereq_('./attributes');\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 locations = coerce('locations');\n var z = coerce('z');\n\n if(!(locations && locations.length && Lib.isArrayOrTypedArray(z) && z.length)) {\n traceOut.visible = false;\n return;\n }\n\n traceOut._length = Math.min(locations.length, z.length);\n\n var geojson = coerce('geojson');\n\n var locationmodeDflt;\n if((typeof geojson === 'string' && geojson !== '') || Lib.isPlainObject(geojson)) {\n locationmodeDflt = 'geojson-id';\n }\n\n var locationMode = coerce('locationmode', locationmodeDflt);\n\n if(locationMode === 'geojson-id') {\n coerce('featureidkey');\n }\n\n coerce('text');\n coerce('hovertext');\n coerce('hovertemplate');\n\n var mlw = coerce('marker.line.width');\n if(mlw) coerce('marker.line.color');\n coerce('marker.opacity');\n\n colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'});\n\n Lib.coerceSelectionMarkerOpacity(traceOut, coerce);\n};\n\n},{\"../../components/colorscale/defaults\":605,\"../../lib\":728,\"./attributes\":937}],940:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = function eventData(out, pt, trace, cd, pointNumber) {\n out.location = pt.location;\n out.z = pt.z;\n\n // include feature properties from input geojson\n var cdi = cd[pointNumber];\n if(cdi.fIn && cdi.fIn.properties) {\n out.properties = cdi.fIn.properties;\n }\n out.ct = cdi.ct;\n\n return out;\n};\n\n},{}],941:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar attributes = _dereq_('./attributes');\nvar fillText = _dereq_('../../lib').fillText;\n\nmodule.exports = function hoverPoints(pointData, xval, yval) {\n var cd = pointData.cd;\n var trace = cd[0].trace;\n var geo = pointData.subplot;\n\n var pt, i, j, isInside;\n\n for(i = 0; i < cd.length; i++) {\n pt = cd[i];\n isInside = false;\n\n if(pt._polygons) {\n for(j = 0; j < pt._polygons.length; j++) {\n if(pt._polygons[j].contains([xval, yval])) {\n isInside = !isInside;\n }\n // for polygons that cross antimeridian as xval is in [-180, 180]\n if(pt._polygons[j].contains([xval + 360, yval])) {\n isInside = !isInside;\n }\n }\n\n if(isInside) break;\n }\n }\n\n if(!isInside || !pt) return;\n\n pointData.x0 = pointData.x1 = pointData.xa.c2p(pt.ct);\n pointData.y0 = pointData.y1 = pointData.ya.c2p(pt.ct);\n\n pointData.index = pt.index;\n pointData.location = pt.loc;\n pointData.z = pt.z;\n pointData.zLabel = Axes.tickText(geo.mockAxis, geo.mockAxis.c2l(pt.z), 'hover').text;\n pointData.hovertemplate = pt.hovertemplate;\n\n makeHoverInfo(pointData, trace, pt, geo.mockAxis);\n\n return [pointData];\n};\n\nfunction makeHoverInfo(pointData, trace, pt) {\n if(trace.hovertemplate) return;\n\n var hoverinfo = pt.hi || trace.hoverinfo;\n var loc = String(pt.loc);\n\n var parts = (hoverinfo === 'all') ?\n attributes.hoverinfo.flags :\n hoverinfo.split('+');\n\n var hasName = (parts.indexOf('name') !== -1);\n var hasLocation = (parts.indexOf('location') !== -1);\n var hasZ = (parts.indexOf('z') !== -1);\n var hasText = (parts.indexOf('text') !== -1);\n var hasIdAsNameLabel = !hasName && hasLocation;\n\n var text = [];\n\n if(hasIdAsNameLabel) {\n pointData.nameOverride = loc;\n } else {\n if(hasName) pointData.nameOverride = trace.name;\n if(hasLocation) text.push(loc);\n }\n\n if(hasZ) {\n text.push(pointData.zLabel);\n }\n if(hasText) {\n fillText(pt, trace, text);\n }\n\n pointData.extraText = text.join('
');\n}\n\n},{\"../../lib\":728,\"../../plots/cartesian/axes\":776,\"./attributes\":937}],942:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults'),\n colorbar: _dereq_('../heatmap/colorbar'),\n calc: _dereq_('./calc'),\n calcGeoJSON: _dereq_('./plot').calcGeoJSON,\n plot: _dereq_('./plot').plot,\n style: _dereq_('./style').style,\n styleOnSelect: _dereq_('./style').styleOnSelect,\n hoverPoints: _dereq_('./hover'),\n eventData: _dereq_('./event_data'),\n selectPoints: _dereq_('./select'),\n\n moduleType: 'trace',\n name: 'choropleth',\n basePlotModule: _dereq_('../../plots/geo'),\n categories: ['geo', 'noOpacity', 'showLegend'],\n meta: {\n \n }\n};\n\n},{\"../../plots/geo\":808,\"../heatmap/colorbar\":1016,\"./attributes\":937,\"./calc\":938,\"./defaults\":939,\"./event_data\":940,\"./hover\":941,\"./plot\":943,\"./select\":944,\"./style\":945}],943:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Lib = _dereq_('../../lib');\nvar geoUtils = _dereq_('../../lib/geo_location_utils');\nvar getTopojsonFeatures = _dereq_('../../lib/topojson_utils').getTopojsonFeatures;\nvar findExtremes = _dereq_('../../plots/cartesian/autorange').findExtremes;\n\nvar style = _dereq_('./style').style;\n\nfunction plot(gd, geo, calcData) {\n var choroplethLayer = geo.layers.backplot.select('.choroplethlayer');\n\n Lib.makeTraceGroups(choroplethLayer, calcData, 'trace choropleth').each(function(calcTrace) {\n var sel = d3.select(this);\n\n var paths = sel.selectAll('path.choroplethlocation')\n .data(Lib.identity);\n\n paths.enter().append('path')\n .classed('choroplethlocation', true);\n\n paths.exit().remove();\n\n // call style here within topojson request callback\n style(gd, calcTrace);\n });\n}\n\nfunction calcGeoJSON(calcTrace, fullLayout) {\n var trace = calcTrace[0].trace;\n var geoLayout = fullLayout[trace.geo];\n var geo = geoLayout._subplot;\n var locationmode = trace.locationmode;\n var len = trace._length;\n\n var features = locationmode === 'geojson-id' ?\n geoUtils.extractTraceFeature(calcTrace) :\n getTopojsonFeatures(trace, geo.topojson);\n\n var lonArray = [];\n var latArray = [];\n\n for(var i = 0; i < len; i++) {\n var calcPt = calcTrace[i];\n var feature = locationmode === 'geojson-id' ?\n calcPt.fOut :\n geoUtils.locationToFeature(locationmode, calcPt.loc, features);\n\n if(feature) {\n calcPt.geojson = feature;\n calcPt.ct = feature.properties.ct;\n calcPt._polygons = geoUtils.feature2polygons(feature);\n\n var bboxFeature = geoUtils.computeBbox(feature);\n lonArray.push(bboxFeature[0], bboxFeature[2]);\n latArray.push(bboxFeature[1], bboxFeature[3]);\n } else {\n calcPt.geojson = null;\n }\n }\n\n if(geoLayout.fitbounds === 'geojson' && locationmode === 'geojson-id') {\n var bboxGeojson = geoUtils.computeBbox(geoUtils.getTraceGeojson(trace));\n lonArray = [bboxGeojson[0], bboxGeojson[2]];\n latArray = [bboxGeojson[1], bboxGeojson[3]];\n }\n\n var opts = {padded: true};\n trace._extremes.lon = findExtremes(geoLayout.lonaxis._ax, lonArray, opts);\n trace._extremes.lat = findExtremes(geoLayout.lataxis._ax, latArray, opts);\n}\n\nmodule.exports = {\n calcGeoJSON: calcGeoJSON,\n plot: plot\n};\n\n},{\"../../lib\":728,\"../../lib/geo_location_utils\":722,\"../../lib/topojson_utils\":755,\"../../plots/cartesian/autorange\":775,\"./style\":945,\"d3\":164}],944:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\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\n var i, di, ct, x, y;\n\n if(selectionTester === false) {\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 ct = di.ct;\n\n if(!ct) continue;\n\n x = xa.c2p(ct);\n y = ya.c2p(ct);\n\n if(selectionTester.contains([x, y], null, i, searchInfo)) {\n selection.push({\n pointNumber: i,\n lon: ct[0],\n lat: ct[1]\n });\n di.selected = 1;\n } else {\n di.selected = 0;\n }\n }\n }\n\n return selection;\n};\n\n},{}],945:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Color = _dereq_('../../components/color');\nvar Drawing = _dereq_('../../components/drawing');\nvar Colorscale = _dereq_('../../components/colorscale');\n\nfunction style(gd, calcTrace) {\n if(calcTrace) styleTrace(gd, calcTrace);\n}\n\nfunction styleTrace(gd, calcTrace) {\n var trace = calcTrace[0].trace;\n var s = calcTrace[0].node3;\n var locs = s.selectAll('.choroplethlocation');\n var marker = trace.marker || {};\n var markerLine = marker.line || {};\n\n var sclFunc = Colorscale.makeColorScaleFuncFromTrace(trace);\n\n locs.each(function(d) {\n d3.select(this)\n .attr('fill', sclFunc(d.z))\n .call(Color.stroke, d.mlc || markerLine.color)\n .call(Drawing.dashLine, '', d.mlw || markerLine.width || 0)\n .style('opacity', marker.opacity);\n });\n\n Drawing.selectedPointStyle(locs, trace, gd);\n}\n\nfunction styleOnSelect(gd, calcTrace) {\n var s = calcTrace[0].node3;\n var trace = calcTrace[0].trace;\n\n if(trace.selectedpoints) {\n Drawing.selectedPointStyle(s.selectAll('.choroplethlocation'), trace, gd);\n } else {\n styleTrace(gd, calcTrace);\n }\n}\n\nmodule.exports = {\n style: style,\n styleOnSelect: styleOnSelect\n};\n\n},{\"../../components/color\":595,\"../../components/colorscale\":607,\"../../components/drawing\":617,\"d3\":164}],946:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar choroplethAttrs = _dereq_('../choropleth/attributes');\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar baseAttrs = _dereq_('../../plots/attributes');\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nmodule.exports = extendFlat({\n locations: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n\n // TODO\n // Maybe start with only one value (that we could name e.g. 'geojson-id'),\n // but eventually:\n // - we could also support for our own dist/topojson/*\n // .. and locationmode: choroplethAttrs.locationmode,\n\n z: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n\n // TODO maybe we could also set a \"key\" to dig out values out of the\n // GeoJSON feature `properties` fields?\n\n geojson: {\n valType: 'any',\n \n editType: 'calc',\n \n },\n featureidkey: extendFlat({}, choroplethAttrs.featureidkey, {\n \n }),\n\n // TODO agree on name / behaviour\n //\n // 'below' is used currently for layout.mapbox.layers,\n // even though it's not very plotly-esque.\n //\n // Note also, that the mapbox-gl style don't all have the same layers,\n // see https://codepen.io/etpinard/pen/ydVMwM for full list\n below: {\n valType: 'string',\n \n editType: 'plot',\n \n },\n\n text: choroplethAttrs.text,\n hovertext: choroplethAttrs.hovertext,\n\n marker: {\n line: {\n color: extendFlat({}, choroplethAttrs.marker.line.color, {editType: 'plot'}),\n width: extendFlat({}, choroplethAttrs.marker.line.width, {editType: 'plot'}),\n editType: 'calc'\n },\n // TODO maybe having a dflt less than 1, together with `below:''` would be better?\n opacity: extendFlat({}, choroplethAttrs.marker.opacity, {editType: 'plot'}),\n editType: 'calc'\n },\n\n selected: {\n marker: {\n opacity: extendFlat({}, choroplethAttrs.selected.marker.opacity, {editType: 'plot'}),\n editType: 'plot'\n },\n editType: 'plot'\n },\n unselected: {\n marker: {\n opacity: extendFlat({}, choroplethAttrs.unselected.marker.opacity, {editType: 'plot'}),\n editType: 'plot'\n },\n editType: 'plot'\n },\n\n hoverinfo: choroplethAttrs.hoverinfo,\n hovertemplate: hovertemplateAttrs({}, {keys: ['properties']}),\n showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})\n},\n\n colorScaleAttrs('', {\n cLetter: 'z',\n editTypeOverride: 'calc'\n })\n);\n\n},{\"../../components/colorscale/attributes\":602,\"../../lib/extend\":719,\"../../plots/attributes\":773,\"../../plots/template_attributes\":854,\"../choropleth/attributes\":937}],947:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Lib = _dereq_('../../lib');\nvar Colorscale = _dereq_('../../components/colorscale');\nvar Drawing = _dereq_('../../components/drawing');\n\nvar makeBlank = _dereq_('../../lib/geojson_utils').makeBlank;\nvar geoUtils = _dereq_('../../lib/geo_location_utils');\n\n/* N.B.\n *\n * We fetch the GeoJSON files \"ourselves\" (during\n * mapbox.prototype.fetchMapData) where they are stored in a global object\n * named `PlotlyGeoAssets` (same as for topojson files in `geo` subplots).\n *\n * Mapbox does allow using URLs as geojson sources, but does NOT allow filtering\n * features by feature `id` that are not numbers (more info in:\n * https://github.com/mapbox/mapbox-gl-js/issues/8088).\n */\n\nfunction convert(calcTrace) {\n var trace = calcTrace[0].trace;\n var isVisible = trace.visible === true && trace._length !== 0;\n\n var fill = {\n layout: {visibility: 'none'},\n paint: {}\n };\n\n var line = {\n layout: {visibility: 'none'},\n paint: {}\n };\n\n var opts = trace._opts = {\n fill: fill,\n line: line,\n geojson: makeBlank()\n };\n\n if(!isVisible) return opts;\n\n var features = geoUtils.extractTraceFeature(calcTrace);\n\n if(!features) return opts;\n\n var sclFunc = Colorscale.makeColorScaleFuncFromTrace(trace);\n var marker = trace.marker;\n var markerLine = marker.line || {};\n\n var opacityFn;\n if(Lib.isArrayOrTypedArray(marker.opacity)) {\n opacityFn = function(d) {\n var mo = d.mo;\n return isNumeric(mo) ? +Lib.constrain(mo, 0, 1) : 0;\n };\n }\n\n var lineColorFn;\n if(Lib.isArrayOrTypedArray(markerLine.color)) {\n lineColorFn = function(d) { return d.mlc; };\n }\n\n var lineWidthFn;\n if(Lib.isArrayOrTypedArray(markerLine.width)) {\n lineWidthFn = function(d) { return d.mlw; };\n }\n\n for(var i = 0; i < calcTrace.length; i++) {\n var cdi = calcTrace[i];\n var fOut = cdi.fOut;\n\n if(fOut) {\n var props = fOut.properties;\n props.fc = sclFunc(cdi.z);\n if(opacityFn) props.mo = opacityFn(cdi);\n if(lineColorFn) props.mlc = lineColorFn(cdi);\n if(lineWidthFn) props.mlw = lineWidthFn(cdi);\n cdi.ct = props.ct;\n cdi._polygons = geoUtils.feature2polygons(fOut);\n }\n }\n\n var opacitySetting = opacityFn ?\n {type: 'identity', property: 'mo'} :\n marker.opacity;\n\n Lib.extendFlat(fill.paint, {\n 'fill-color': {type: 'identity', property: 'fc'},\n 'fill-opacity': opacitySetting\n });\n\n Lib.extendFlat(line.paint, {\n 'line-color': lineColorFn ?\n {type: 'identity', property: 'mlc'} :\n markerLine.color,\n 'line-width': lineWidthFn ?\n {type: 'identity', property: 'mlw'} :\n markerLine.width,\n 'line-opacity': opacitySetting\n });\n\n fill.layout.visibility = 'visible';\n line.layout.visibility = 'visible';\n\n opts.geojson = {type: 'FeatureCollection', features: features};\n\n convertOnSelect(calcTrace);\n\n return opts;\n}\n\nfunction convertOnSelect(calcTrace) {\n var trace = calcTrace[0].trace;\n var opts = trace._opts;\n var opacitySetting;\n\n if(trace.selectedpoints) {\n var fns = Drawing.makeSelectedPointStyleFns(trace);\n\n for(var i = 0; i < calcTrace.length; i++) {\n var cdi = calcTrace[i];\n if(cdi.fOut) {\n cdi.fOut.properties.mo2 = fns.selectedOpacityFn(cdi);\n }\n }\n\n opacitySetting = {type: 'identity', property: 'mo2'};\n } else {\n opacitySetting = Lib.isArrayOrTypedArray(trace.marker.opacity) ?\n {type: 'identity', property: 'mo'} :\n trace.marker.opacity;\n }\n\n Lib.extendFlat(opts.fill.paint, {'fill-opacity': opacitySetting});\n Lib.extendFlat(opts.line.paint, {'line-opacity': opacitySetting});\n\n return opts;\n}\n\nmodule.exports = {\n convert: convert,\n convertOnSelect: convertOnSelect\n};\n\n},{\"../../components/colorscale\":607,\"../../components/drawing\":617,\"../../lib\":728,\"../../lib/geo_location_utils\":722,\"../../lib/geojson_utils\":723,\"fast-isnumeric\":236}],948:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar colorscaleDefaults = _dereq_('../../components/colorscale/defaults');\nvar attributes = _dereq_('./attributes');\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 locations = coerce('locations');\n var z = coerce('z');\n var geojson = coerce('geojson');\n\n if(!Lib.isArrayOrTypedArray(locations) || !locations.length ||\n !Lib.isArrayOrTypedArray(z) || !z.length ||\n !((typeof geojson === 'string' && geojson !== '') || Lib.isPlainObject(geojson))\n ) {\n traceOut.visible = false;\n return;\n }\n\n coerce('featureidkey');\n\n traceOut._length = Math.min(locations.length, z.length);\n\n coerce('below');\n\n coerce('text');\n coerce('hovertext');\n coerce('hovertemplate');\n\n var mlw = coerce('marker.line.width');\n if(mlw) coerce('marker.line.color');\n coerce('marker.opacity');\n\n colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'});\n\n Lib.coerceSelectionMarkerOpacity(traceOut, coerce);\n};\n\n},{\"../../components/colorscale/defaults\":605,\"../../lib\":728,\"./attributes\":946}],949:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults'),\n colorbar: _dereq_('../heatmap/colorbar'),\n calc: _dereq_('../choropleth/calc'),\n plot: _dereq_('./plot'),\n hoverPoints: _dereq_('../choropleth/hover'),\n eventData: _dereq_('../choropleth/event_data'),\n selectPoints: _dereq_('../choropleth/select'),\n\n styleOnSelect: function(_, cd) {\n if(cd) {\n var trace = cd[0].trace;\n trace._glTrace.updateOnSelect(cd);\n }\n },\n\n getBelow: function(trace, subplot) {\n var mapLayers = subplot.getMapLayers();\n\n // find layer just above top-most \"water\" layer\n // that is not a plotly layer\n for(var i = mapLayers.length - 2; i >= 0; i--) {\n var layerId = mapLayers[i].id;\n\n if(typeof layerId === 'string' &&\n layerId.indexOf('water') === 0\n ) {\n for(var j = i + 1; j < mapLayers.length; j++) {\n layerId = mapLayers[j].id;\n\n if(typeof layerId === 'string' &&\n layerId.indexOf('plotly-') === -1\n ) {\n return layerId;\n }\n }\n }\n }\n },\n\n moduleType: 'trace',\n name: 'choroplethmapbox',\n basePlotModule: _dereq_('../../plots/mapbox'),\n categories: ['mapbox', 'gl', 'noOpacity', 'showLegend'],\n meta: {\n hr_name: 'choropleth_mapbox',\n \n }\n};\n\n},{\"../../plots/mapbox\":833,\"../choropleth/calc\":938,\"../choropleth/event_data\":940,\"../choropleth/hover\":941,\"../choropleth/select\":944,\"../heatmap/colorbar\":1016,\"./attributes\":946,\"./defaults\":948,\"./plot\":950}],950:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar convert = _dereq_('./convert').convert;\nvar convertOnSelect = _dereq_('./convert').convertOnSelect;\nvar LAYER_PREFIX = _dereq_('../../plots/mapbox/constants').traceLayerPrefix;\n\nfunction ChoroplethMapbox(subplot, uid) {\n this.type = 'choroplethmapbox';\n this.subplot = subplot;\n this.uid = uid;\n\n // N.B. fill and line layers share same source\n this.sourceId = 'source-' + uid;\n\n this.layerList = [\n ['fill', LAYER_PREFIX + uid + '-fill'],\n ['line', LAYER_PREFIX + uid + '-line']\n ];\n\n // previous 'below' value,\n // need this to update it properly\n this.below = null;\n}\n\nvar proto = ChoroplethMapbox.prototype;\n\nproto.update = function(calcTrace) {\n this._update(convert(calcTrace));\n};\n\nproto.updateOnSelect = function(calcTrace) {\n this._update(convertOnSelect(calcTrace));\n};\n\nproto._update = function(optsAll) {\n var subplot = this.subplot;\n var layerList = this.layerList;\n var below = subplot.belowLookup['trace-' + this.uid];\n\n subplot.map\n .getSource(this.sourceId)\n .setData(optsAll.geojson);\n\n if(below !== this.below) {\n this._removeLayers();\n this._addLayers(optsAll, below);\n this.below = below;\n }\n\n for(var i = 0; i < layerList.length; i++) {\n var item = layerList[i];\n var k = item[0];\n var id = item[1];\n var opts = optsAll[k];\n\n subplot.setOptions(id, 'setLayoutProperty', opts.layout);\n\n if(opts.layout.visibility === 'visible') {\n subplot.setOptions(id, 'setPaintProperty', opts.paint);\n }\n }\n};\n\nproto._addLayers = function(optsAll, below) {\n var subplot = this.subplot;\n var layerList = this.layerList;\n var sourceId = this.sourceId;\n\n for(var i = 0; i < layerList.length; i++) {\n var item = layerList[i];\n var k = item[0];\n var opts = optsAll[k];\n\n subplot.addLayer({\n type: k,\n id: item[1],\n source: sourceId,\n layout: opts.layout,\n paint: opts.paint\n }, below);\n }\n};\n\nproto._removeLayers = function() {\n var map = this.subplot.map;\n var layerList = this.layerList;\n\n for(var i = layerList.length - 1; i >= 0; i--) {\n map.removeLayer(layerList[i][1]);\n }\n};\n\nproto.dispose = function() {\n var map = this.subplot.map;\n this._removeLayers();\n map.removeSource(this.sourceId);\n};\n\nmodule.exports = function createChoroplethMapbox(subplot, calcTrace) {\n var trace = calcTrace[0].trace;\n var choroplethMapbox = new ChoroplethMapbox(subplot, trace.uid);\n var sourceId = choroplethMapbox.sourceId;\n var optsAll = convert(calcTrace);\n var below = choroplethMapbox.below = subplot.belowLookup['trace-' + trace.uid];\n\n subplot.map.addSource(sourceId, {\n type: 'geojson',\n data: optsAll.geojson\n });\n\n choroplethMapbox._addLayers(optsAll, below);\n\n // link ref for quick update during selections\n calcTrace[0].trace._glTrace = choroplethMapbox;\n\n return choroplethMapbox;\n};\n\n},{\"../../plots/mapbox/constants\":831,\"./convert\":947}],951:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar mesh3dAttrs = _dereq_('../mesh3d/attributes');\nvar baseAttrs = _dereq_('../../plots/attributes');\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nvar attrs = {\n x: {\n valType: 'data_array',\n \n editType: 'calc+clearAxisTypes',\n \n },\n y: {\n valType: 'data_array',\n \n editType: 'calc+clearAxisTypes',\n \n },\n z: {\n valType: 'data_array',\n \n editType: 'calc+clearAxisTypes',\n \n },\n\n u: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n v: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n w: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n\n // TODO add way to specify cone positions independently of the vector field\n // provided, similar to MATLAB's coneplot Cx/Cy/Cz meshgrids,\n // see https://www.mathworks.com/help/matlab/ref/coneplot.html\n //\n // Alternatively, if our goal is only to 'fill in gaps' in the vector data,\n // we could try to extend the heatmap 'connectgaps' algorithm to 3D.\n // From AJ: this particular algorithm which amounts to a Poisson equation,\n // both for interpolation and extrapolation - is the right one to use for\n // cones too. It makes a field with zero divergence, which is a good\n // baseline assumption for vector fields.\n //\n // cones: {\n // // potential attributes to add:\n // //\n // // - meshmode: 'cartesian-product', 'pts', 'grid'\n // //\n // // under `meshmode: 'grid'`\n // // - (x|y|z)grid.start\n // // - (x|y|z)grid.end\n // // - (x|y|z)grid.size\n //\n // x: {\n // valType: 'data_array',\n // editType: 'calc',\n // \n // },\n // y: {\n // valType: 'data_array',\n // editType: 'calc',\n // \n // },\n // z: {\n // valType: 'data_array',\n // editType: 'calc',\n // \n // },\n //\n // editType: 'calc',\n // \n // },\n\n sizemode: {\n valType: 'enumerated',\n values: ['scaled', 'absolute'],\n \n editType: 'calc',\n dflt: 'scaled',\n \n },\n sizeref: {\n valType: 'number',\n \n editType: 'calc',\n min: 0,\n \n },\n\n anchor: {\n valType: 'enumerated',\n \n editType: 'calc',\n values: ['tip', 'tail', 'cm', 'center'],\n dflt: 'cm',\n \n },\n\n text: {\n valType: 'string',\n \n dflt: '',\n arrayOk: true,\n editType: 'calc',\n \n },\n hovertext: {\n valType: 'string',\n \n dflt: '',\n arrayOk: true,\n editType: 'calc',\n \n },\n\n hovertemplate: hovertemplateAttrs({editType: 'calc'}, {keys: ['norm']}),\n showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})\n};\n\nextendFlat(attrs, colorScaleAttrs('', {\n colorAttr: 'u/v/w norm',\n showScaleDflt: true,\n editTypeOverride: 'calc'\n}));\n\nvar fromMesh3d = ['opacity', 'lightposition', 'lighting'];\n\nfromMesh3d.forEach(function(k) {\n attrs[k] = mesh3dAttrs[k];\n});\n\nattrs.hoverinfo = extendFlat({}, baseAttrs.hoverinfo, {\n editType: 'calc',\n flags: ['x', 'y', 'z', 'u', 'v', 'w', 'norm', 'text', 'name'],\n dflt: 'x+y+z+norm+text+name'\n});\n\nattrs.transforms = undefined;\n\nmodule.exports = attrs;\n\n},{\"../../components/colorscale/attributes\":602,\"../../lib/extend\":719,\"../../plots/attributes\":773,\"../../plots/template_attributes\":854,\"../mesh3d/attributes\":1075}],952:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar colorscaleCalc = _dereq_('../../components/colorscale/calc');\n\nmodule.exports = function calc(gd, trace) {\n var u = trace.u;\n var v = trace.v;\n var w = trace.w;\n var len = Math.min(\n trace.x.length, trace.y.length, trace.z.length,\n u.length, v.length, w.length\n );\n var normMax = -Infinity;\n var normMin = Infinity;\n\n for(var i = 0; i < len; i++) {\n var uu = u[i];\n var vv = v[i];\n var ww = w[i];\n var norm = Math.sqrt(uu * uu + vv * vv + ww * ww);\n\n normMax = Math.max(normMax, norm);\n normMin = Math.min(normMin, norm);\n }\n\n trace._len = len;\n trace._normMax = normMax;\n\n colorscaleCalc(gd, trace, {\n vals: [normMin, normMax],\n containerStr: '',\n cLetter: 'c'\n });\n};\n\n},{\"../../components/colorscale/calc\":603}],953:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar conePlot = _dereq_('gl-cone3d');\nvar createConeMesh = _dereq_('gl-cone3d').createConeMesh;\n\nvar simpleMap = _dereq_('../../lib').simpleMap;\nvar parseColorScale = _dereq_('../../lib/gl_format_color').parseColorScale;\nvar extractOpts = _dereq_('../../components/colorscale').extractOpts;\nvar zip3 = _dereq_('../../plots/gl3d/zip3');\n\nfunction Cone(scene, uid) {\n this.scene = scene;\n this.uid = uid;\n this.mesh = null;\n this.data = null;\n}\n\nvar proto = Cone.prototype;\n\nproto.handlePick = function(selection) {\n if(selection.object === this.mesh) {\n var selectIndex = selection.index = selection.data.index;\n var xx = this.data.x[selectIndex];\n var yy = this.data.y[selectIndex];\n var zz = this.data.z[selectIndex];\n var uu = this.data.u[selectIndex];\n var vv = this.data.v[selectIndex];\n var ww = this.data.w[selectIndex];\n\n selection.traceCoordinate = [\n xx, yy, zz,\n uu, vv, ww,\n Math.sqrt(uu * uu + vv * vv + ww * ww)\n ];\n\n var text = this.data.hovertext || this.data.text;\n if(Array.isArray(text) && text[selectIndex] !== undefined) {\n selection.textLabel = text[selectIndex];\n } else if(text) {\n selection.textLabel = text;\n }\n\n return true;\n }\n};\n\nvar axisName2scaleIndex = {xaxis: 0, yaxis: 1, zaxis: 2};\nvar anchor2coneOffset = {tip: 1, tail: 0, cm: 0.25, center: 0.5};\nvar anchor2coneSpan = {tip: 1, tail: 1, cm: 0.75, center: 0.5};\n\nfunction convert(scene, trace) {\n var sceneLayout = scene.fullSceneLayout;\n var dataScale = scene.dataScale;\n var coneOpts = {};\n\n function toDataCoords(arr, axisName) {\n var ax = sceneLayout[axisName];\n var scale = dataScale[axisName2scaleIndex[axisName]];\n return simpleMap(arr, function(v) { return ax.d2l(v) * scale; });\n }\n\n coneOpts.vectors = zip3(\n toDataCoords(trace.u, 'xaxis'),\n toDataCoords(trace.v, 'yaxis'),\n toDataCoords(trace.w, 'zaxis'),\n trace._len\n );\n\n coneOpts.positions = zip3(\n toDataCoords(trace.x, 'xaxis'),\n toDataCoords(trace.y, 'yaxis'),\n toDataCoords(trace.z, 'zaxis'),\n trace._len\n );\n\n var cOpts = extractOpts(trace);\n coneOpts.colormap = parseColorScale(trace);\n coneOpts.vertexIntensityBounds = [cOpts.min / trace._normMax, cOpts.max / trace._normMax];\n coneOpts.coneOffset = anchor2coneOffset[trace.anchor];\n\n if(trace.sizemode === 'scaled') {\n // unitless sizeref\n coneOpts.coneSize = trace.sizeref || 0.5;\n } else {\n // sizeref here has unit of velocity\n coneOpts.coneSize = trace.sizeref && trace._normMax ?\n trace.sizeref / trace._normMax :\n 0.5;\n }\n\n var meshData = conePlot(coneOpts);\n\n // pass gl-mesh3d lighting attributes\n var lp = trace.lightposition;\n meshData.lightPosition = [lp.x, lp.y, lp.z];\n meshData.ambient = trace.lighting.ambient;\n meshData.diffuse = trace.lighting.diffuse;\n meshData.specular = trace.lighting.specular;\n meshData.roughness = trace.lighting.roughness;\n meshData.fresnel = trace.lighting.fresnel;\n meshData.opacity = trace.opacity;\n\n // stash autorange pad value\n trace._pad = anchor2coneSpan[trace.anchor] * meshData.vectorScale * meshData.coneScale * trace._normMax;\n\n return meshData;\n}\n\nproto.update = function(data) {\n this.data = data;\n\n var meshData = convert(this.scene, data);\n this.mesh.update(meshData);\n};\n\nproto.dispose = function() {\n this.scene.glplot.remove(this.mesh);\n this.mesh.dispose();\n};\n\nfunction createConeTrace(scene, data) {\n var gl = scene.glplot.gl;\n\n var meshData = convert(scene, data);\n var mesh = createConeMesh(gl, meshData);\n\n var cone = new Cone(scene, data.uid);\n cone.mesh = mesh;\n cone.data = data;\n mesh._trace = cone;\n\n scene.glplot.add(mesh);\n\n return cone;\n}\n\nmodule.exports = createConeTrace;\n\n},{\"../../components/colorscale\":607,\"../../lib\":728,\"../../lib/gl_format_color\":725,\"../../plots/gl3d/zip3\":829,\"gl-cone3d\":254}],954:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nvar colorscaleDefaults = _dereq_('../../components/colorscale/defaults');\nvar attributes = _dereq_('./attributes');\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 u = coerce('u');\n var v = coerce('v');\n var w = coerce('w');\n\n var x = coerce('x');\n var y = coerce('y');\n var z = coerce('z');\n\n if(\n !u || !u.length || !v || !v.length || !w || !w.length ||\n !x || !x.length || !y || !y.length || !z || !z.length\n ) {\n traceOut.visible = false;\n return;\n }\n\n coerce('sizeref');\n coerce('sizemode');\n\n coerce('anchor');\n\n coerce('lighting.ambient');\n coerce('lighting.diffuse');\n coerce('lighting.specular');\n coerce('lighting.roughness');\n coerce('lighting.fresnel');\n coerce('lightposition.x');\n coerce('lightposition.y');\n coerce('lightposition.z');\n\n colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'c'});\n\n coerce('text');\n coerce('hovertext');\n coerce('hovertemplate');\n\n // disable 1D transforms (for now)\n traceOut._length = null;\n};\n\n},{\"../../components/colorscale/defaults\":605,\"../../lib\":728,\"./attributes\":951}],955:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n moduleType: 'trace',\n name: 'cone',\n basePlotModule: _dereq_('../../plots/gl3d'),\n categories: ['gl3d', 'showLegend'],\n\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults'),\n colorbar: {\n min: 'cmin',\n max: 'cmax'\n },\n calc: _dereq_('./calc'),\n plot: _dereq_('./convert'),\n eventData: function(out, pt) {\n out.norm = pt.traceCoordinate[6];\n return out;\n },\n\n meta: {\n \n }\n};\n\n},{\"../../plots/gl3d\":818,\"./attributes\":951,\"./calc\":952,\"./convert\":953,\"./defaults\":954}],956:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar heatmapAttrs = _dereq_('../heatmap/attributes');\nvar scatterAttrs = _dereq_('../scatter/attributes');\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\nvar dash = _dereq_('../../components/drawing/attributes').dash;\nvar fontAttrs = _dereq_('../../plots/font_attributes');\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nvar filterOps = _dereq_('../../constants/filter_ops');\nvar COMPARISON_OPS2 = filterOps.COMPARISON_OPS2;\nvar INTERVAL_OPS = filterOps.INTERVAL_OPS;\n\nvar FORMAT_LINK = _dereq_('../../constants/docs').FORMAT_LINK;\n\nvar scatterLineAttrs = scatterAttrs.line;\n\nmodule.exports = extendFlat({\n z: heatmapAttrs.z,\n x: heatmapAttrs.x,\n x0: heatmapAttrs.x0,\n dx: heatmapAttrs.dx,\n y: heatmapAttrs.y,\n y0: heatmapAttrs.y0,\n dy: heatmapAttrs.dy,\n text: heatmapAttrs.text,\n hovertext: heatmapAttrs.hovertext,\n transpose: heatmapAttrs.transpose,\n xtype: heatmapAttrs.xtype,\n ytype: heatmapAttrs.ytype,\n zhoverformat: heatmapAttrs.zhoverformat,\n hovertemplate: heatmapAttrs.hovertemplate,\n hoverongaps: heatmapAttrs.hoverongaps,\n connectgaps: extendFlat({}, heatmapAttrs.connectgaps, {\n \n }),\n\n fillcolor: {\n valType: 'color',\n \n editType: 'calc',\n \n },\n\n autocontour: {\n valType: 'boolean',\n dflt: true,\n \n editType: 'calc',\n impliedEdits: {\n 'contours.start': undefined,\n 'contours.end': undefined,\n 'contours.size': undefined\n },\n \n },\n ncontours: {\n valType: 'integer',\n dflt: 15,\n min: 1,\n \n editType: 'calc',\n \n },\n\n contours: {\n type: {\n valType: 'enumerated',\n values: ['levels', 'constraint'],\n dflt: 'levels',\n \n editType: 'calc',\n \n },\n start: {\n valType: 'number',\n dflt: null,\n \n editType: 'plot',\n impliedEdits: {'^autocontour': false},\n \n },\n end: {\n valType: 'number',\n dflt: null,\n \n editType: 'plot',\n impliedEdits: {'^autocontour': false},\n \n },\n size: {\n valType: 'number',\n dflt: null,\n min: 0,\n \n editType: 'plot',\n impliedEdits: {'^autocontour': false},\n \n },\n coloring: {\n valType: 'enumerated',\n values: ['fill', 'heatmap', 'lines', 'none'],\n dflt: 'fill',\n \n editType: 'calc',\n \n },\n showlines: {\n valType: 'boolean',\n dflt: true,\n \n editType: 'plot',\n \n },\n showlabels: {\n valType: 'boolean',\n dflt: false,\n \n editType: 'plot',\n \n },\n labelfont: fontAttrs({\n editType: 'plot',\n colorEditType: 'style',\n \n }),\n labelformat: {\n valType: 'string',\n dflt: '',\n \n editType: 'plot',\n \n },\n operation: {\n valType: 'enumerated',\n values: [].concat(COMPARISON_OPS2).concat(INTERVAL_OPS),\n \n dflt: '=',\n editType: 'calc',\n \n },\n value: {\n valType: 'any',\n dflt: 0,\n \n editType: 'calc',\n \n },\n editType: 'calc',\n impliedEdits: {'autocontour': false}\n },\n\n line: {\n color: extendFlat({}, scatterLineAttrs.color, {\n editType: 'style+colorbars',\n \n }),\n width: {\n valType: 'number',\n min: 0,\n \n editType: 'style+colorbars',\n \n },\n dash: dash,\n smoothing: extendFlat({}, scatterLineAttrs.smoothing, {\n \n }),\n editType: 'plot'\n }\n},\n colorScaleAttrs('', {\n cLetter: 'z',\n autoColorDflt: false,\n editTypeOverride: 'calc'\n })\n);\n\n},{\"../../components/colorscale/attributes\":602,\"../../components/drawing/attributes\":616,\"../../constants/docs\":699,\"../../constants/filter_ops\":700,\"../../lib/extend\":719,\"../../plots/font_attributes\":804,\"../heatmap/attributes\":1013,\"../scatter/attributes\":1134}],957:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Colorscale = _dereq_('../../components/colorscale');\n\nvar heatmapCalc = _dereq_('../heatmap/calc');\nvar setContours = _dereq_('./set_contours');\nvar endPlus = _dereq_('./end_plus');\n\n// most is the same as heatmap calc, then adjust it\n// though a few things inside heatmap calc still look for\n// contour maps, because the makeBoundArray calls are too entangled\nmodule.exports = function calc(gd, trace) {\n var cd = heatmapCalc(gd, trace);\n\n var zOut = cd[0].z;\n setContours(trace, zOut);\n\n var contours = trace.contours;\n var cOpts = Colorscale.extractOpts(trace);\n var cVals;\n\n if(contours.coloring === 'heatmap' && cOpts.auto && trace.autocontour === false) {\n var start = contours.start;\n var end = endPlus(contours);\n var cs = contours.size || 1;\n var nc = Math.floor((end - start) / cs) + 1;\n\n if(!isFinite(cs)) {\n cs = 1;\n nc = 1;\n }\n\n var min0 = start - cs / 2;\n var max0 = min0 + nc * cs;\n cVals = [min0, max0];\n } else {\n cVals = zOut;\n }\n\n Colorscale.calc(gd, trace, {vals: cVals, cLetter: 'z'});\n\n return cd;\n};\n\n},{\"../../components/colorscale\":607,\"../heatmap/calc\":1014,\"./end_plus\":967,\"./set_contours\":975}],958:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = function(pathinfo, contours) {\n var pi0 = pathinfo[0];\n var z = pi0.z;\n var i;\n\n switch(contours.type) {\n case 'levels':\n // Why (just) use z[0][0] and z[0][1]?\n //\n // N.B. using boundaryMin instead of edgeVal2 here makes the\n // `contour_scatter` mock fail\n var edgeVal2 = Math.min(z[0][0], z[0][1]);\n\n for(i = 0; i < pathinfo.length; i++) {\n var pi = pathinfo[i];\n pi.prefixBoundary = !pi.edgepaths.length &&\n (edgeVal2 > pi.level || pi.starts.length && edgeVal2 === pi.level);\n }\n break;\n case 'constraint':\n // after convertToConstraints, pathinfo has length=0\n pi0.prefixBoundary = false;\n\n // joinAllPaths does enough already when edgepaths are present\n if(pi0.edgepaths.length) return;\n\n var na = pi0.x.length;\n var nb = pi0.y.length;\n var boundaryMax = -Infinity;\n var boundaryMin = Infinity;\n\n for(i = 0; i < nb; i++) {\n boundaryMin = Math.min(boundaryMin, z[i][0]);\n boundaryMin = Math.min(boundaryMin, z[i][na - 1]);\n boundaryMax = Math.max(boundaryMax, z[i][0]);\n boundaryMax = Math.max(boundaryMax, z[i][na - 1]);\n }\n for(i = 1; i < na - 1; i++) {\n boundaryMin = Math.min(boundaryMin, z[0][i]);\n boundaryMin = Math.min(boundaryMin, z[nb - 1][i]);\n boundaryMax = Math.max(boundaryMax, z[0][i]);\n boundaryMax = Math.max(boundaryMax, z[nb - 1][i]);\n }\n\n var contoursValue = contours.value;\n var v1, v2;\n\n switch(contours._operation) {\n case '>':\n if(contoursValue > boundaryMax) {\n pi0.prefixBoundary = true;\n }\n break;\n case '<':\n if(contoursValue < boundaryMin ||\n (pi0.starts.length && contoursValue === boundaryMin)) {\n pi0.prefixBoundary = true;\n }\n break;\n case '[]':\n v1 = Math.min(contoursValue[0], contoursValue[1]);\n v2 = Math.max(contoursValue[0], contoursValue[1]);\n if(v2 < boundaryMin || v1 > boundaryMax ||\n (pi0.starts.length && v2 === boundaryMin)) {\n pi0.prefixBoundary = true;\n }\n break;\n case '][':\n v1 = Math.min(contoursValue[0], contoursValue[1]);\n v2 = Math.max(contoursValue[0], contoursValue[1]);\n if(v1 < boundaryMin && v2 > boundaryMax) {\n pi0.prefixBoundary = true;\n }\n break;\n }\n break;\n }\n};\n\n},{}],959:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Colorscale = _dereq_('../../components/colorscale');\nvar makeColorMap = _dereq_('./make_color_map');\nvar endPlus = _dereq_('./end_plus');\n\nfunction calc(gd, trace, opts) {\n var contours = trace.contours;\n var line = trace.line;\n var cs = contours.size || 1;\n var coloring = contours.coloring;\n var colorMap = makeColorMap(trace, {isColorbar: true});\n\n if(coloring === 'heatmap') {\n var cOpts = Colorscale.extractOpts(trace);\n opts._fillgradient = cOpts.reversescale ?\n Colorscale.flipScale(cOpts.colorscale) :\n cOpts.colorscale;\n opts._zrange = [cOpts.min, cOpts.max];\n } else if(coloring === 'fill') {\n opts._fillcolor = colorMap;\n }\n\n opts._line = {\n color: coloring === 'lines' ? colorMap : line.color,\n width: contours.showlines !== false ? line.width : 0,\n dash: line.dash\n };\n\n opts._levels = {\n start: contours.start,\n end: endPlus(contours),\n size: cs\n };\n}\n\nmodule.exports = {\n min: 'zmin',\n max: 'zmax',\n calc: calc\n};\n\n},{\"../../components/colorscale\":607,\"./end_plus\":967,\"./make_color_map\":972}],960:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\nmodule.exports = {\n // some constants to help with marching squares algorithm\n // where does the path start for each index?\n BOTTOMSTART: [1, 9, 13, 104, 713],\n TOPSTART: [4, 6, 7, 104, 713],\n LEFTSTART: [8, 12, 14, 208, 1114],\n RIGHTSTART: [2, 3, 11, 208, 1114],\n\n // which way [dx,dy] do we leave a given index?\n // saddles are already disambiguated\n NEWDELTA: [\n null, [-1, 0], [0, -1], [-1, 0],\n [1, 0], null, [0, -1], [-1, 0],\n [0, 1], [0, 1], null, [0, 1],\n [1, 0], [1, 0], [0, -1]\n ],\n\n // for each saddle, the first index here is used\n // for dx||dy<0, the second for dx||dy>0\n CHOOSESADDLE: {\n 104: [4, 1],\n 208: [2, 8],\n 713: [7, 13],\n 1114: [11, 14]\n },\n\n // after one index has been used for a saddle, which do we\n // substitute to be used up later?\n SADDLEREMAINDER: {1: 4, 2: 8, 4: 1, 7: 13, 8: 2, 11: 14, 13: 7, 14: 11},\n\n // length of a contour, as a multiple of the plot area diagonal, per label\n LABELDISTANCE: 2,\n\n // number of contour levels after which we start increasing the number of\n // labels we draw. Many contours means they will generally be close\n // together, so it will be harder to follow a long way to find a label\n LABELINCREASE: 10,\n\n // minimum length of a contour line, as a multiple of the label length,\n // at which we draw *any* labels\n LABELMIN: 3,\n\n // max number of labels to draw on a single contour path, no matter how long\n LABELMAX: 10,\n\n // constants for the label position cost function\n LABELOPTIMIZER: {\n // weight given to edge proximity\n EDGECOST: 1,\n // weight given to the angle off horizontal\n ANGLECOST: 1,\n // weight given to distance from already-placed labels\n NEIGHBORCOST: 5,\n // cost multiplier for labels on the same level\n SAMELEVELFACTOR: 10,\n // minimum distance (as a multiple of the label length)\n // for labels on the same level\n SAMELEVELDISTANCE: 5,\n // maximum cost before we won't even place the label\n MAXCOST: 100,\n // number of evenly spaced points to look at in the first\n // iteration of the search\n INITIALSEARCHPOINTS: 10,\n // number of binary search iterations after the initial wide search\n ITERATIONS: 5\n }\n};\n\n},{}],961:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar handleLabelDefaults = _dereq_('./label_defaults');\n\nvar Color = _dereq_('../../components/color');\nvar addOpacity = Color.addOpacity;\nvar opacity = Color.opacity;\n\nvar filterOps = _dereq_('../../constants/filter_ops');\nvar CONSTRAINT_REDUCTION = filterOps.CONSTRAINT_REDUCTION;\nvar COMPARISON_OPS2 = filterOps.COMPARISON_OPS2;\n\nmodule.exports = function handleConstraintDefaults(traceIn, traceOut, coerce, layout, defaultColor, opts) {\n var contours = traceOut.contours;\n var showLines, lineColor, fillColor;\n\n var operation = coerce('contours.operation');\n contours._operation = CONSTRAINT_REDUCTION[operation];\n\n handleConstraintValueDefaults(coerce, contours);\n\n if(operation === '=') {\n showLines = contours.showlines = true;\n } else {\n showLines = coerce('contours.showlines');\n fillColor = coerce('fillcolor', addOpacity(\n (traceIn.line || {}).color || defaultColor, 0.5\n ));\n }\n\n if(showLines) {\n var lineDfltColor = fillColor && opacity(fillColor) ?\n addOpacity(traceOut.fillcolor, 1) :\n defaultColor;\n lineColor = coerce('line.color', lineDfltColor);\n coerce('line.width', 2);\n coerce('line.dash');\n }\n\n coerce('line.smoothing');\n\n handleLabelDefaults(coerce, layout, lineColor, opts);\n};\n\nfunction handleConstraintValueDefaults(coerce, contours) {\n var zvalue;\n\n if(COMPARISON_OPS2.indexOf(contours.operation) === -1) {\n // Requires an array of two numbers:\n coerce('contours.value', [0, 1]);\n\n if(!Array.isArray(contours.value)) {\n if(isNumeric(contours.value)) {\n zvalue = parseFloat(contours.value);\n contours.value = [zvalue, zvalue + 1];\n }\n } else if(contours.value.length > 2) {\n contours.value = contours.value.slice(2);\n } else if(contours.length === 0) {\n contours.value = [0, 1];\n } else if(contours.length < 2) {\n zvalue = parseFloat(contours.value[0]);\n contours.value = [zvalue, zvalue + 1];\n } else {\n contours.value = [\n parseFloat(contours.value[0]),\n parseFloat(contours.value[1])\n ];\n }\n } else {\n // Requires a single scalar:\n coerce('contours.value', 0);\n\n if(!isNumeric(contours.value)) {\n if(Array.isArray(contours.value)) {\n contours.value = parseFloat(contours.value[0]);\n } else {\n contours.value = 0;\n }\n }\n }\n}\n\n},{\"../../components/color\":595,\"../../constants/filter_ops\":700,\"./label_defaults\":971,\"fast-isnumeric\":236}],962:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar filterOps = _dereq_('../../constants/filter_ops');\nvar isNumeric = _dereq_('fast-isnumeric');\n\n// This syntax conforms to the existing filter transform syntax, but we don't care\n// about open vs. closed intervals for simply drawing contours constraints:\nmodule.exports = {\n '[]': makeRangeSettings('[]'),\n '][': makeRangeSettings(']['),\n '>': makeInequalitySettings('>'),\n '<': makeInequalitySettings('<'),\n '=': makeInequalitySettings('=')\n};\n\n// This does not in any way shape or form support calendars. It's adapted from\n// transforms/filter.js.\nfunction coerceValue(operation, value) {\n var hasArrayValue = Array.isArray(value);\n\n var coercedValue;\n\n function coerce(value) {\n return isNumeric(value) ? (+value) : null;\n }\n\n if(filterOps.COMPARISON_OPS2.indexOf(operation) !== -1) {\n coercedValue = hasArrayValue ? coerce(value[0]) : coerce(value);\n } else if(filterOps.INTERVAL_OPS.indexOf(operation) !== -1) {\n coercedValue = hasArrayValue ?\n [coerce(value[0]), coerce(value[1])] :\n [coerce(value), coerce(value)];\n } else if(filterOps.SET_OPS.indexOf(operation) !== -1) {\n coercedValue = hasArrayValue ? value.map(coerce) : [coerce(value)];\n }\n\n return coercedValue;\n}\n\n// Returns a parabola scaled so that the min/max is either +/- 1 and zero at the two values\n// provided. The data is mapped by this function when constructing intervals so that it's\n// very easy to construct contours as normal.\nfunction makeRangeSettings(operation) {\n return function(value) {\n value = coerceValue(operation, value);\n\n // Ensure proper ordering:\n var min = Math.min(value[0], value[1]);\n var max = Math.max(value[0], value[1]);\n\n return {\n start: min,\n end: max,\n size: max - min\n };\n };\n}\n\nfunction makeInequalitySettings(operation) {\n return function(value) {\n value = coerceValue(operation, value);\n\n return {\n start: value,\n end: Infinity,\n size: Infinity\n };\n };\n}\n\n},{\"../../constants/filter_ops\":700,\"fast-isnumeric\":236}],963:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = function handleContourDefaults(traceIn, traceOut, coerce, coerce2) {\n var contourStart = coerce2('contours.start');\n var contourEnd = coerce2('contours.end');\n var missingEnd = (contourStart === false) || (contourEnd === false);\n\n // normally we only need size if autocontour is off. But contour.calc\n // pushes its calculated contour size back to the input trace, so for\n // things like restyle that can call supplyDefaults without calc\n // after the initial draw, we can just reuse the previous calculation\n var contourSize = coerce('contours.size');\n var autoContour;\n\n if(missingEnd) autoContour = traceOut.autocontour = true;\n else autoContour = coerce('autocontour', false);\n\n if(autoContour || !contourSize) coerce('ncontours');\n};\n\n},{}],964:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\n// The contour extraction is great, except it totally fails for constraints because we\n// need weird range loops and flipped contours instead of the usual format. This function\n// does some weird manipulation of the extracted pathinfo data such that it magically\n// draws contours correctly *as* constraints.\n//\n// ** I do not know which \"weird range loops\" the comment above is referring to.\nmodule.exports = function(pathinfo, operation) {\n var i, pi0, pi1;\n\n var op0 = function(arr) { return arr.reverse(); };\n var op1 = function(arr) { return arr; };\n\n switch(operation) {\n case '=':\n case '<':\n return pathinfo;\n case '>':\n if(pathinfo.length !== 1) {\n Lib.warn('Contour data invalid for the specified inequality operation.');\n }\n\n // In this case there should be exactly one contour levels in pathinfo.\n // We flip all of the data. This will draw the contour as closed.\n pi0 = pathinfo[0];\n\n for(i = 0; i < pi0.edgepaths.length; i++) {\n pi0.edgepaths[i] = op0(pi0.edgepaths[i]);\n }\n for(i = 0; i < pi0.paths.length; i++) {\n pi0.paths[i] = op0(pi0.paths[i]);\n }\n for(i = 0; i < pi0.starts.length; i++) {\n pi0.starts[i] = op0(pi0.starts[i]);\n }\n\n return pathinfo;\n case '][':\n var tmp = op0;\n op0 = op1;\n op1 = tmp;\n // It's a nice rule, except this definitely *is* what's intended here.\n /* eslint-disable: no-fallthrough */\n case '[]':\n /* eslint-enable: no-fallthrough */\n if(pathinfo.length !== 2) {\n Lib.warn('Contour data invalid for the specified inequality range operation.');\n }\n\n // In this case there should be exactly two contour levels in pathinfo.\n // - We concatenate the info into one pathinfo.\n // - We must also flip all of the data in the `[]` case.\n // This will draw the contours as closed.\n pi0 = copyPathinfo(pathinfo[0]);\n pi1 = copyPathinfo(pathinfo[1]);\n\n for(i = 0; i < pi0.edgepaths.length; i++) {\n pi0.edgepaths[i] = op0(pi0.edgepaths[i]);\n }\n for(i = 0; i < pi0.paths.length; i++) {\n pi0.paths[i] = op0(pi0.paths[i]);\n }\n for(i = 0; i < pi0.starts.length; i++) {\n pi0.starts[i] = op0(pi0.starts[i]);\n }\n\n while(pi1.edgepaths.length) {\n pi0.edgepaths.push(op1(pi1.edgepaths.shift()));\n }\n while(pi1.paths.length) {\n pi0.paths.push(op1(pi1.paths.shift()));\n }\n while(pi1.starts.length) {\n pi0.starts.push(op1(pi1.starts.shift()));\n }\n\n return [pi0];\n }\n};\n\nfunction copyPathinfo(pi) {\n return Lib.extendFlat({}, pi, {\n edgepaths: Lib.extendDeep([], pi.edgepaths),\n paths: Lib.extendDeep([], pi.paths),\n starts: Lib.extendDeep([], pi.starts)\n });\n}\n\n},{\"../../lib\":728}],965:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nvar handleXYZDefaults = _dereq_('../heatmap/xyz_defaults');\nvar handleConstraintDefaults = _dereq_('./constraint_defaults');\nvar handleContoursDefaults = _dereq_('./contours_defaults');\nvar handleStyleDefaults = _dereq_('./style_defaults');\nvar attributes = _dereq_('./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 function coerce2(attr) {\n return Lib.coerce2(traceIn, traceOut, attributes, attr);\n }\n\n var len = handleXYZDefaults(traceIn, traceOut, coerce, layout);\n if(!len) {\n traceOut.visible = false;\n return;\n }\n\n coerce('text');\n coerce('hovertext');\n coerce('hovertemplate');\n coerce('hoverongaps');\n\n var isConstraint = (coerce('contours.type') === 'constraint');\n coerce('connectgaps', Lib.isArray1D(traceOut.z));\n\n if(isConstraint) {\n handleConstraintDefaults(traceIn, traceOut, coerce, layout, defaultColor);\n } else {\n handleContoursDefaults(traceIn, traceOut, coerce, coerce2);\n handleStyleDefaults(traceIn, traceOut, coerce, layout);\n }\n};\n\n},{\"../../lib\":728,\"../heatmap/xyz_defaults\":1027,\"./attributes\":956,\"./constraint_defaults\":961,\"./contours_defaults\":963,\"./style_defaults\":977}],966:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar constraintMapping = _dereq_('./constraint_mapping');\nvar endPlus = _dereq_('./end_plus');\n\nmodule.exports = function emptyPathinfo(contours, plotinfo, cd0) {\n var contoursFinal = (contours.type === 'constraint') ?\n constraintMapping[contours._operation](contours.value) :\n contours;\n\n var cs = contoursFinal.size;\n var pathinfo = [];\n var end = endPlus(contoursFinal);\n\n var carpet = cd0.trace._carpetTrace;\n\n var basePathinfo = carpet ? {\n // store axes so we can convert to px\n xaxis: carpet.aaxis,\n yaxis: carpet.baxis,\n // full data arrays to use for interpolation\n x: cd0.a,\n y: cd0.b\n } : {\n xaxis: plotinfo.xaxis,\n yaxis: plotinfo.yaxis,\n x: cd0.x,\n y: cd0.y\n };\n\n for(var ci = contoursFinal.start; ci < end; ci += cs) {\n pathinfo.push(Lib.extendFlat({\n level: ci,\n // all the cells with nontrivial marching index\n crossings: {},\n // starting points on the edges of the lattice for each contour\n starts: [],\n // all unclosed paths (may have less items than starts,\n // if a path is closed by rounding)\n edgepaths: [],\n // all closed paths\n paths: [],\n z: cd0.z,\n smoothing: cd0.trace.line.smoothing\n }, basePathinfo));\n\n if(pathinfo.length > 1000) {\n Lib.warn('Too many contours, clipping at 1000', contours);\n break;\n }\n }\n return pathinfo;\n};\n\n},{\"../../lib\":728,\"./constraint_mapping\":962,\"./end_plus\":967}],967:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n/*\n * tiny helper to move the end of the contours a little to prevent\n * losing the last contour to rounding errors\n */\nmodule.exports = function endPlus(contours) {\n return contours.end + contours.size / 1e6;\n};\n\n},{}],968:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar constants = _dereq_('./constants');\n\nmodule.exports = function findAllPaths(pathinfo, xtol, ytol) {\n var cnt,\n startLoc,\n i,\n pi,\n j;\n\n // Default just passes these values through as they were before:\n xtol = xtol || 0.01;\n ytol = ytol || 0.01;\n\n for(i = 0; i < pathinfo.length; i++) {\n pi = pathinfo[i];\n\n for(j = 0; j < pi.starts.length; j++) {\n startLoc = pi.starts[j];\n makePath(pi, startLoc, 'edge', xtol, ytol);\n }\n\n cnt = 0;\n while(Object.keys(pi.crossings).length && cnt < 10000) {\n cnt++;\n startLoc = Object.keys(pi.crossings)[0].split(',').map(Number);\n makePath(pi, startLoc, undefined, xtol, ytol);\n }\n if(cnt === 10000) Lib.log('Infinite loop in contour?');\n }\n};\n\nfunction equalPts(pt1, pt2, xtol, ytol) {\n return Math.abs(pt1[0] - pt2[0]) < xtol &&\n Math.abs(pt1[1] - pt2[1]) < ytol;\n}\n\n// distance in index units - uses the 3rd and 4th items in points\nfunction ptDist(pt1, pt2) {\n var dx = pt1[2] - pt2[2];\n var dy = pt1[3] - pt2[3];\n return Math.sqrt(dx * dx + dy * dy);\n}\n\nfunction makePath(pi, loc, edgeflag, xtol, ytol) {\n var locStr = loc.join(',');\n var mi = pi.crossings[locStr];\n var marchStep = getStartStep(mi, edgeflag, loc);\n // start by going backward a half step and finding the crossing point\n var pts = [getInterpPx(pi, loc, [-marchStep[0], -marchStep[1]])];\n var m = pi.z.length;\n var n = pi.z[0].length;\n var startLoc = loc.slice();\n var startStep = marchStep.slice();\n var cnt;\n\n // now follow the path\n for(cnt = 0; cnt < 10000; cnt++) { // just to avoid infinite loops\n if(mi > 20) {\n mi = constants.CHOOSESADDLE[mi][(marchStep[0] || marchStep[1]) < 0 ? 0 : 1];\n pi.crossings[locStr] = constants.SADDLEREMAINDER[mi];\n } else {\n delete pi.crossings[locStr];\n }\n\n marchStep = constants.NEWDELTA[mi];\n if(!marchStep) {\n Lib.log('Found bad marching index:', mi, loc, pi.level);\n break;\n }\n\n // find the crossing a half step forward, and then take the full step\n pts.push(getInterpPx(pi, loc, marchStep));\n loc[0] += marchStep[0];\n loc[1] += marchStep[1];\n locStr = loc.join(',');\n\n // don't include the same point multiple times\n if(equalPts(pts[pts.length - 1], pts[pts.length - 2], xtol, ytol)) pts.pop();\n\n var atEdge = (marchStep[0] && (loc[0] < 0 || loc[0] > n - 2)) ||\n (marchStep[1] && (loc[1] < 0 || loc[1] > m - 2));\n\n var closedLoop = loc[0] === startLoc[0] && loc[1] === startLoc[1] &&\n marchStep[0] === startStep[0] && marchStep[1] === startStep[1];\n\n // have we completed a loop, or reached an edge?\n if((closedLoop) || (edgeflag && atEdge)) break;\n\n mi = pi.crossings[locStr];\n }\n\n if(cnt === 10000) {\n Lib.log('Infinite loop in contour?');\n }\n var closedpath = equalPts(pts[0], pts[pts.length - 1], xtol, ytol);\n var totaldist = 0;\n var distThresholdFactor = 0.2 * pi.smoothing;\n var alldists = [];\n var cropstart = 0;\n var distgroup, cnt2, cnt3, newpt, ptcnt, ptavg, thisdist,\n i, j, edgepathi, edgepathj;\n\n /*\n * Check for points that are too close together (<1/5 the average dist\n * *in grid index units* (important for log axes and nonuniform grids),\n * less if less smoothed) and just take the center (or avg of center 2).\n * This cuts down on funny behavior when a point is very close to a\n * contour level.\n */\n for(cnt = 1; cnt < pts.length; cnt++) {\n thisdist = ptDist(pts[cnt], pts[cnt - 1]);\n totaldist += thisdist;\n alldists.push(thisdist);\n }\n\n var distThreshold = totaldist / alldists.length * distThresholdFactor;\n\n function getpt(i) { return pts[i % pts.length]; }\n\n for(cnt = pts.length - 2; cnt >= cropstart; cnt--) {\n distgroup = alldists[cnt];\n if(distgroup < distThreshold) {\n cnt3 = 0;\n for(cnt2 = cnt - 1; cnt2 >= cropstart; cnt2--) {\n if(distgroup + alldists[cnt2] < distThreshold) {\n distgroup += alldists[cnt2];\n } else break;\n }\n\n // closed path with close points wrapping around the boundary?\n if(closedpath && cnt === pts.length - 2) {\n for(cnt3 = 0; cnt3 < cnt2; cnt3++) {\n if(distgroup + alldists[cnt3] < distThreshold) {\n distgroup += alldists[cnt3];\n } else break;\n }\n }\n ptcnt = cnt - cnt2 + cnt3 + 1;\n ptavg = Math.floor((cnt + cnt2 + cnt3 + 2) / 2);\n\n // either endpoint included: keep the endpoint\n if(!closedpath && cnt === pts.length - 2) newpt = pts[pts.length - 1];\n else if(!closedpath && cnt2 === -1) newpt = pts[0];\n\n // odd # of points - just take the central one\n else if(ptcnt % 2) newpt = getpt(ptavg);\n\n // even # of pts - average central two\n else {\n newpt = [(getpt(ptavg)[0] + getpt(ptavg + 1)[0]) / 2,\n (getpt(ptavg)[1] + getpt(ptavg + 1)[1]) / 2];\n }\n\n pts.splice(cnt2 + 1, cnt - cnt2 + 1, newpt);\n cnt = cnt2 + 1;\n if(cnt3) cropstart = cnt3;\n if(closedpath) {\n if(cnt === pts.length - 2) pts[cnt3] = pts[pts.length - 1];\n else if(cnt === 0) pts[pts.length - 1] = pts[0];\n }\n }\n }\n pts.splice(0, cropstart);\n\n // done with the index parts - remove them so path generation works right\n // because it depends on only having [xpx, ypx]\n for(cnt = 0; cnt < pts.length; cnt++) pts[cnt].length = 2;\n\n // don't return single-point paths (ie all points were the same\n // so they got deleted?)\n if(pts.length < 2) return;\n else if(closedpath) {\n pts.pop();\n pi.paths.push(pts);\n } else {\n if(!edgeflag) {\n Lib.log('Unclosed interior contour?',\n pi.level, startLoc.join(','), pts.join('L'));\n }\n\n // edge path - does it start where an existing edge path ends, or vice versa?\n var merged = false;\n for(i = 0; i < pi.edgepaths.length; i++) {\n edgepathi = pi.edgepaths[i];\n if(!merged && equalPts(edgepathi[0], pts[pts.length - 1], xtol, ytol)) {\n pts.pop();\n merged = true;\n\n // now does it ALSO meet the end of another (or the same) path?\n var doublemerged = false;\n for(j = 0; j < pi.edgepaths.length; j++) {\n edgepathj = pi.edgepaths[j];\n if(equalPts(edgepathj[edgepathj.length - 1], pts[0], xtol, ytol)) {\n doublemerged = true;\n pts.shift();\n pi.edgepaths.splice(i, 1);\n if(j === i) {\n // the path is now closed\n pi.paths.push(pts.concat(edgepathj));\n } else {\n if(j > i) j--;\n pi.edgepaths[j] = edgepathj.concat(pts, edgepathi);\n }\n break;\n }\n }\n if(!doublemerged) {\n pi.edgepaths[i] = pts.concat(edgepathi);\n }\n }\n }\n for(i = 0; i < pi.edgepaths.length; i++) {\n if(merged) break;\n edgepathi = pi.edgepaths[i];\n if(equalPts(edgepathi[edgepathi.length - 1], pts[0], xtol, ytol)) {\n pts.shift();\n pi.edgepaths[i] = edgepathi.concat(pts);\n merged = true;\n }\n }\n\n if(!merged) pi.edgepaths.push(pts);\n }\n}\n\n// special function to get the marching step of the\n// first point in the path (leading to loc)\nfunction getStartStep(mi, edgeflag, loc) {\n var dx = 0;\n var dy = 0;\n if(mi > 20 && edgeflag) {\n // these saddles start at +/- x\n if(mi === 208 || mi === 1114) {\n // if we're starting at the left side, we must be going right\n dx = loc[0] === 0 ? 1 : -1;\n } else {\n // if we're starting at the bottom, we must be going up\n dy = loc[1] === 0 ? 1 : -1;\n }\n } else if(constants.BOTTOMSTART.indexOf(mi) !== -1) dy = 1;\n else if(constants.LEFTSTART.indexOf(mi) !== -1) dx = 1;\n else if(constants.TOPSTART.indexOf(mi) !== -1) dy = -1;\n else dx = -1;\n return [dx, dy];\n}\n\n/*\n * Find the pixel coordinates of a particular crossing\n *\n * @param {object} pi: the pathinfo object at this level\n * @param {array} loc: the grid index [x, y] of the crossing\n * @param {array} step: the direction [dx, dy] we're moving on the grid\n *\n * @return {array} [xpx, ypx, xi, yi]: the first two are the pixel location,\n * the next two are the interpolated grid indices, which we use for\n * distance calculations to delete points that are too close together.\n * This is important when the grid is nonuniform (and most dramatically when\n * we're on log axes and include invalid (0 or negative) values.\n * It's crucial to delete these extra two before turning an array of these\n * points into a path, because those routines require length-2 points.\n */\nfunction getInterpPx(pi, loc, step) {\n var locx = loc[0] + Math.max(step[0], 0);\n var locy = loc[1] + Math.max(step[1], 0);\n var zxy = pi.z[locy][locx];\n var xa = pi.xaxis;\n var ya = pi.yaxis;\n\n if(step[1]) {\n var dx = (pi.level - zxy) / (pi.z[locy][locx + 1] - zxy);\n\n return [xa.c2p((1 - dx) * pi.x[locx] + dx * pi.x[locx + 1], true),\n ya.c2p(pi.y[locy], true),\n locx + dx, locy];\n } else {\n var dy = (pi.level - zxy) / (pi.z[locy + 1][locx] - zxy);\n return [xa.c2p(pi.x[locx], true),\n ya.c2p((1 - dy) * pi.y[locy] + dy * pi.y[locy + 1], true),\n locx, locy + dy];\n }\n}\n\n},{\"../../lib\":728,\"./constants\":960}],969:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Color = _dereq_('../../components/color');\n\nvar heatmapHoverPoints = _dereq_('../heatmap/hover');\n\nmodule.exports = function hoverPoints(pointData, xval, yval, hovermode, hoverLayer) {\n var hoverData = heatmapHoverPoints(pointData, xval, yval, hovermode, hoverLayer, true);\n\n if(hoverData) {\n hoverData.forEach(function(hoverPt) {\n var trace = hoverPt.trace;\n if(trace.contours.type === 'constraint') {\n if(trace.fillcolor && Color.opacity(trace.fillcolor)) {\n hoverPt.color = Color.addOpacity(trace.fillcolor, 1);\n } else if(trace.contours.showlines && Color.opacity(trace.line.color)) {\n hoverPt.color = Color.addOpacity(trace.line.color, 1);\n }\n }\n });\n }\n\n return hoverData;\n};\n\n},{\"../../components/color\":595,\"../heatmap/hover\":1020}],970:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults'),\n calc: _dereq_('./calc'),\n plot: _dereq_('./plot').plot,\n style: _dereq_('./style'),\n colorbar: _dereq_('./colorbar'),\n hoverPoints: _dereq_('./hover'),\n\n moduleType: 'trace',\n name: 'contour',\n basePlotModule: _dereq_('../../plots/cartesian'),\n categories: ['cartesian', 'svg', '2dMap', 'contour', 'showLegend'],\n meta: {\n \n }\n};\n\n},{\"../../plots/cartesian\":789,\"./attributes\":956,\"./calc\":957,\"./colorbar\":959,\"./defaults\":965,\"./hover\":969,\"./plot\":974,\"./style\":976}],971:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nmodule.exports = function handleLabelDefaults(coerce, layout, lineColor, opts) {\n if(!opts) opts = {};\n var showLabels = coerce('contours.showlabels');\n if(showLabels) {\n var globalFont = layout.font;\n Lib.coerceFont(coerce, 'contours.labelfont', {\n family: globalFont.family,\n size: globalFont.size,\n color: lineColor\n });\n coerce('contours.labelformat');\n }\n\n if(opts.hasHover !== false) coerce('zhoverformat');\n};\n\n},{\"../../lib\":728}],972:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Colorscale = _dereq_('../../components/colorscale');\nvar endPlus = _dereq_('./end_plus');\n\nmodule.exports = function makeColorMap(trace) {\n var contours = trace.contours;\n var start = contours.start;\n var end = endPlus(contours);\n var cs = contours.size || 1;\n var nc = Math.floor((end - start) / cs) + 1;\n var extra = contours.coloring === 'lines' ? 0 : 1;\n var cOpts = Colorscale.extractOpts(trace);\n\n if(!isFinite(cs)) {\n cs = 1;\n nc = 1;\n }\n\n var scl = cOpts.reversescale ?\n Colorscale.flipScale(cOpts.colorscale) :\n cOpts.colorscale;\n\n var len = scl.length;\n var domain = new Array(len);\n var range = new Array(len);\n\n var si, i;\n\n if(contours.coloring === 'heatmap') {\n var zmin0 = cOpts.min;\n var zmax0 = cOpts.max;\n\n for(i = 0; i < len; i++) {\n si = scl[i];\n domain[i] = si[0] * (zmax0 - zmin0) + zmin0;\n range[i] = si[1];\n }\n\n // do the contours extend beyond the colorscale?\n // if so, extend the colorscale with constants\n var zRange = d3.extent([\n zmin0,\n zmax0,\n contours.start,\n contours.start + cs * (nc - 1)\n ]);\n var zmin = zRange[zmin0 < zmax0 ? 0 : 1];\n var zmax = zRange[zmin0 < zmax0 ? 1 : 0];\n\n if(zmin !== zmin0) {\n domain.splice(0, 0, zmin);\n range.splice(0, 0, range[0]);\n }\n\n if(zmax !== zmax0) {\n domain.push(zmax);\n range.push(range[range.length - 1]);\n }\n } else {\n for(i = 0; i < len; i++) {\n si = scl[i];\n domain[i] = (si[0] * (nc + extra - 1) - (extra / 2)) * cs + start;\n range[i] = si[1];\n }\n }\n\n return Colorscale.makeColorScaleFunc(\n {domain: domain, range: range},\n {noNumericCheck: true}\n );\n};\n\n},{\"../../components/colorscale\":607,\"./end_plus\":967,\"d3\":164}],973:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar constants = _dereq_('./constants');\n\n// Calculate all the marching indices, for ALL levels at once.\n// since we want to be exhaustive we'll check for contour crossings\n// at every intersection, rather than just following a path\n// TODO: shorten the inner loop to only the relevant levels\nmodule.exports = function makeCrossings(pathinfo) {\n var z = pathinfo[0].z;\n var m = z.length;\n var n = z[0].length; // we already made sure z isn't ragged in interp2d\n var twoWide = m === 2 || n === 2;\n var xi;\n var yi;\n var startIndices;\n var ystartIndices;\n var label;\n var corners;\n var mi;\n var pi;\n var i;\n\n for(yi = 0; yi < m - 1; yi++) {\n ystartIndices = [];\n if(yi === 0) ystartIndices = ystartIndices.concat(constants.BOTTOMSTART);\n if(yi === m - 2) ystartIndices = ystartIndices.concat(constants.TOPSTART);\n\n for(xi = 0; xi < n - 1; xi++) {\n startIndices = ystartIndices.slice();\n if(xi === 0) startIndices = startIndices.concat(constants.LEFTSTART);\n if(xi === n - 2) startIndices = startIndices.concat(constants.RIGHTSTART);\n\n label = xi + ',' + yi;\n corners = [[z[yi][xi], z[yi][xi + 1]],\n [z[yi + 1][xi], z[yi + 1][xi + 1]]];\n for(i = 0; i < pathinfo.length; i++) {\n pi = pathinfo[i];\n mi = getMarchingIndex(pi.level, corners);\n if(!mi) continue;\n\n pi.crossings[label] = mi;\n if(startIndices.indexOf(mi) !== -1) {\n pi.starts.push([xi, yi]);\n if(twoWide && startIndices.indexOf(mi,\n startIndices.indexOf(mi) + 1) !== -1) {\n // the same square has starts from opposite sides\n // it's not possible to have starts on opposite edges\n // of a corner, only a start and an end...\n // but if the array is only two points wide (either way)\n // you can have starts on opposite sides.\n pi.starts.push([xi, yi]);\n }\n }\n }\n }\n }\n};\n\n// modified marching squares algorithm,\n// so we disambiguate the saddle points from the start\n// and we ignore the cases with no crossings\n// the index I'm using is based on:\n// http://en.wikipedia.org/wiki/Marching_squares\n// except that the saddles bifurcate and I represent them\n// as the decimal combination of the two appropriate\n// non-saddle indices\nfunction getMarchingIndex(val, corners) {\n var mi = (corners[0][0] > val ? 0 : 1) +\n (corners[0][1] > val ? 0 : 2) +\n (corners[1][1] > val ? 0 : 4) +\n (corners[1][0] > val ? 0 : 8);\n if(mi === 5 || mi === 10) {\n var avg = (corners[0][0] + corners[0][1] +\n corners[1][0] + corners[1][1]) / 4;\n // two peaks with a big valley\n if(val > avg) return (mi === 5) ? 713 : 1114;\n // two valleys with a big ridge\n return (mi === 5) ? 104 : 208;\n }\n return (mi === 15) ? 0 : mi;\n}\n\n},{\"./constants\":960}],974:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Lib = _dereq_('../../lib');\nvar Drawing = _dereq_('../../components/drawing');\nvar Colorscale = _dereq_('../../components/colorscale');\nvar svgTextUtils = _dereq_('../../lib/svg_text_utils');\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar setConvert = _dereq_('../../plots/cartesian/set_convert');\n\nvar heatmapPlot = _dereq_('../heatmap/plot');\nvar makeCrossings = _dereq_('./make_crossings');\nvar findAllPaths = _dereq_('./find_all_paths');\nvar emptyPathinfo = _dereq_('./empty_pathinfo');\nvar convertToConstraints = _dereq_('./convert_to_constraints');\nvar closeBoundaries = _dereq_('./close_boundaries');\nvar constants = _dereq_('./constants');\nvar costConstants = constants.LABELOPTIMIZER;\n\nexports.plot = function plot(gd, plotinfo, cdcontours, contourLayer) {\n var xa = plotinfo.xaxis;\n var ya = plotinfo.yaxis;\n\n Lib.makeTraceGroups(contourLayer, cdcontours, 'contour').each(function(cd) {\n var plotGroup = d3.select(this);\n var cd0 = cd[0];\n var trace = cd0.trace;\n var x = cd0.x;\n var y = cd0.y;\n var contours = trace.contours;\n var pathinfo = emptyPathinfo(contours, plotinfo, cd0);\n\n // use a heatmap to fill - draw it behind the lines\n var heatmapColoringLayer = Lib.ensureSingle(plotGroup, 'g', 'heatmapcoloring');\n var cdheatmaps = [];\n if(contours.coloring === 'heatmap') {\n cdheatmaps = [cd];\n }\n heatmapPlot(gd, plotinfo, cdheatmaps, heatmapColoringLayer);\n\n makeCrossings(pathinfo);\n findAllPaths(pathinfo);\n\n var leftedge = xa.c2p(x[0], true);\n var rightedge = xa.c2p(x[x.length - 1], true);\n var bottomedge = ya.c2p(y[0], true);\n var topedge = ya.c2p(y[y.length - 1], true);\n var perimeter = [\n [leftedge, topedge],\n [rightedge, topedge],\n [rightedge, bottomedge],\n [leftedge, bottomedge]\n ];\n\n var fillPathinfo = pathinfo;\n if(contours.type === 'constraint') {\n // N.B. this also mutates pathinfo\n fillPathinfo = convertToConstraints(pathinfo, contours._operation);\n }\n\n // draw everything\n makeBackground(plotGroup, perimeter, contours);\n makeFills(plotGroup, fillPathinfo, perimeter, contours);\n makeLinesAndLabels(plotGroup, pathinfo, gd, cd0, contours);\n clipGaps(plotGroup, plotinfo, gd, cd0, perimeter);\n });\n};\n\nfunction makeBackground(plotgroup, perimeter, contours) {\n var bggroup = Lib.ensureSingle(plotgroup, 'g', 'contourbg');\n\n var bgfill = bggroup.selectAll('path')\n .data(contours.coloring === 'fill' ? [0] : []);\n bgfill.enter().append('path');\n bgfill.exit().remove();\n bgfill\n .attr('d', 'M' + perimeter.join('L') + 'Z')\n .style('stroke', 'none');\n}\n\nfunction makeFills(plotgroup, pathinfo, perimeter, contours) {\n var hasFills = contours.coloring === 'fill' || (contours.type === 'constraint' && contours._operation !== '=');\n var boundaryPath = 'M' + perimeter.join('L') + 'Z';\n\n // fills prefixBoundary in pathinfo items\n if(hasFills) {\n closeBoundaries(pathinfo, contours);\n }\n\n var fillgroup = Lib.ensureSingle(plotgroup, 'g', 'contourfill');\n\n var fillitems = fillgroup.selectAll('path').data(hasFills ? pathinfo : []);\n fillitems.enter().append('path');\n fillitems.exit().remove();\n fillitems.each(function(pi) {\n // join all paths for this level together into a single path\n // first follow clockwise around the perimeter to close any open paths\n // if the whole perimeter is above this level, start with a path\n // enclosing the whole thing. With all that, the parity should mean\n // that we always fill everything above the contour, nothing below\n var fullpath = (pi.prefixBoundary ? boundaryPath : '') +\n joinAllPaths(pi, perimeter);\n\n if(!fullpath) {\n d3.select(this).remove();\n } else {\n d3.select(this)\n .attr('d', fullpath)\n .style('stroke', 'none');\n }\n });\n}\n\nfunction joinAllPaths(pi, perimeter) {\n var fullpath = '';\n var i = 0;\n var startsleft = pi.edgepaths.map(function(v, i) { return i; });\n var newloop = true;\n var endpt;\n var newendpt;\n var cnt;\n var nexti;\n var possiblei;\n var addpath;\n\n function istop(pt) { return Math.abs(pt[1] - perimeter[0][1]) < 0.01; }\n function isbottom(pt) { return Math.abs(pt[1] - perimeter[2][1]) < 0.01; }\n function isleft(pt) { return Math.abs(pt[0] - perimeter[0][0]) < 0.01; }\n function isright(pt) { return Math.abs(pt[0] - perimeter[2][0]) < 0.01; }\n\n while(startsleft.length) {\n addpath = Drawing.smoothopen(pi.edgepaths[i], pi.smoothing);\n fullpath += newloop ? addpath : addpath.replace(/^M/, 'L');\n startsleft.splice(startsleft.indexOf(i), 1);\n endpt = pi.edgepaths[i][pi.edgepaths[i].length - 1];\n nexti = -1;\n\n // now loop through sides, moving our endpoint until we find a new start\n for(cnt = 0; cnt < 4; cnt++) { // just to prevent infinite loops\n if(!endpt) {\n Lib.log('Missing end?', i, pi);\n break;\n }\n\n if(istop(endpt) && !isright(endpt)) newendpt = perimeter[1]; // right top\n else if(isleft(endpt)) newendpt = perimeter[0]; // left top\n else if(isbottom(endpt)) newendpt = perimeter[3]; // right bottom\n else if(isright(endpt)) newendpt = perimeter[2]; // left bottom\n\n for(possiblei = 0; possiblei < pi.edgepaths.length; possiblei++) {\n var ptNew = pi.edgepaths[possiblei][0];\n // is ptNew on the (horz. or vert.) segment from endpt to newendpt?\n if(Math.abs(endpt[0] - newendpt[0]) < 0.01) {\n if(Math.abs(endpt[0] - ptNew[0]) < 0.01 &&\n (ptNew[1] - endpt[1]) * (newendpt[1] - ptNew[1]) >= 0) {\n newendpt = ptNew;\n nexti = possiblei;\n }\n } else if(Math.abs(endpt[1] - newendpt[1]) < 0.01) {\n if(Math.abs(endpt[1] - ptNew[1]) < 0.01 &&\n (ptNew[0] - endpt[0]) * (newendpt[0] - ptNew[0]) >= 0) {\n newendpt = ptNew;\n nexti = possiblei;\n }\n } else {\n Lib.log('endpt to newendpt is not vert. or horz.',\n endpt, newendpt, ptNew);\n }\n }\n\n endpt = newendpt;\n\n if(nexti >= 0) break;\n fullpath += 'L' + newendpt;\n }\n\n if(nexti === pi.edgepaths.length) {\n Lib.log('unclosed perimeter path');\n break;\n }\n\n i = nexti;\n\n // if we closed back on a loop we already included,\n // close it and start a new loop\n newloop = (startsleft.indexOf(i) === -1);\n if(newloop) {\n i = startsleft[0];\n fullpath += 'Z';\n }\n }\n\n // finally add the interior paths\n for(i = 0; i < pi.paths.length; i++) {\n fullpath += Drawing.smoothclosed(pi.paths[i], pi.smoothing);\n }\n\n return fullpath;\n}\n\nfunction makeLinesAndLabels(plotgroup, pathinfo, gd, cd0, contours) {\n var lineContainer = Lib.ensureSingle(plotgroup, 'g', 'contourlines');\n var showLines = contours.showlines !== false;\n var showLabels = contours.showlabels;\n var clipLinesForLabels = showLines && showLabels;\n\n // Even if we're not going to show lines, we need to create them\n // if we're showing labels, because the fill paths include the perimeter\n // so can't be used to position the labels correctly.\n // In this case we'll remove the lines after making the labels.\n var linegroup = exports.createLines(lineContainer, showLines || showLabels, pathinfo);\n\n var lineClip = exports.createLineClip(lineContainer, clipLinesForLabels, gd, cd0.trace.uid);\n\n var labelGroup = plotgroup.selectAll('g.contourlabels')\n .data(showLabels ? [0] : []);\n\n labelGroup.exit().remove();\n\n labelGroup.enter().append('g')\n .classed('contourlabels', true);\n\n if(showLabels) {\n var labelClipPathData = [];\n var labelData = [];\n\n // invalidate the getTextLocation cache in case paths changed\n Lib.clearLocationCache();\n\n var contourFormat = exports.labelFormatter(gd, cd0);\n\n var dummyText = Drawing.tester.append('text')\n .attr('data-notex', 1)\n .call(Drawing.font, contours.labelfont);\n\n var xa = pathinfo[0].xaxis;\n var ya = pathinfo[0].yaxis;\n var xLen = xa._length;\n var yLen = ya._length;\n var xRng = xa.range;\n var yRng = ya.range;\n var xMin = Lib.aggNums(Math.min, null, cd0.x);\n var xMax = Lib.aggNums(Math.max, null, cd0.x);\n var yMin = Lib.aggNums(Math.min, null, cd0.y);\n var yMax = Lib.aggNums(Math.max, null, cd0.y);\n var x0 = Math.max(xa.c2p(xMin, true), 0);\n var x1 = Math.min(xa.c2p(xMax, true), xLen);\n var y0 = Math.max(ya.c2p(yMax, true), 0);\n var y1 = Math.min(ya.c2p(yMin, true), yLen);\n\n // visible bounds of the contour trace (and the midpoints, to\n // help with cost calculations)\n var bounds = {};\n\n if(xRng[0] < xRng[1]) {\n bounds.left = x0;\n bounds.right = x1;\n } else {\n bounds.left = x1;\n bounds.right = x0;\n }\n\n if(yRng[0] < yRng[1]) {\n bounds.top = y0;\n bounds.bottom = y1;\n } else {\n bounds.top = y1;\n bounds.bottom = y0;\n }\n\n bounds.middle = (bounds.top + bounds.bottom) / 2;\n bounds.center = (bounds.left + bounds.right) / 2;\n\n labelClipPathData.push([\n [bounds.left, bounds.top],\n [bounds.right, bounds.top],\n [bounds.right, bounds.bottom],\n [bounds.left, bounds.bottom]\n ]);\n\n var plotDiagonal = Math.sqrt(xLen * xLen + yLen * yLen);\n\n // the path length to use to scale the number of labels to draw:\n var normLength = constants.LABELDISTANCE * plotDiagonal /\n Math.max(1, pathinfo.length / constants.LABELINCREASE);\n\n linegroup.each(function(d) {\n var textOpts = exports.calcTextOpts(d.level, contourFormat, dummyText, gd);\n\n d3.select(this).selectAll('path').each(function() {\n var path = this;\n var pathBounds = Lib.getVisibleSegment(path, bounds, textOpts.height / 2);\n if(!pathBounds) return;\n\n if(pathBounds.len < (textOpts.width + textOpts.height) * constants.LABELMIN) return;\n\n var maxLabels = Math.min(Math.ceil(pathBounds.len / normLength),\n constants.LABELMAX);\n\n for(var i = 0; i < maxLabels; i++) {\n var loc = exports.findBestTextLocation(path, pathBounds, textOpts,\n labelData, bounds);\n\n if(!loc) break;\n\n exports.addLabelData(loc, textOpts, labelData, labelClipPathData);\n }\n });\n });\n\n dummyText.remove();\n\n exports.drawLabels(labelGroup, labelData, gd, lineClip,\n clipLinesForLabels ? labelClipPathData : null);\n }\n\n if(showLabels && !showLines) linegroup.remove();\n}\n\nexports.createLines = function(lineContainer, makeLines, pathinfo) {\n var smoothing = pathinfo[0].smoothing;\n\n var linegroup = lineContainer.selectAll('g.contourlevel')\n .data(makeLines ? pathinfo : []);\n\n linegroup.exit().remove();\n linegroup.enter().append('g')\n .classed('contourlevel', true);\n\n if(makeLines) {\n // pedgepaths / ppaths are used by contourcarpet, for the paths transformed from a/b to x/y\n // edgepaths / paths are used by contour since it's in x/y from the start\n var opencontourlines = linegroup.selectAll('path.openline')\n .data(function(d) { return d.pedgepaths || d.edgepaths; });\n\n opencontourlines.exit().remove();\n opencontourlines.enter().append('path')\n .classed('openline', true);\n\n opencontourlines\n .attr('d', function(d) {\n return Drawing.smoothopen(d, smoothing);\n })\n .style('stroke-miterlimit', 1)\n .style('vector-effect', 'non-scaling-stroke');\n\n var closedcontourlines = linegroup.selectAll('path.closedline')\n .data(function(d) { return d.ppaths || d.paths; });\n\n closedcontourlines.exit().remove();\n closedcontourlines.enter().append('path')\n .classed('closedline', true);\n\n closedcontourlines\n .attr('d', function(d) {\n return Drawing.smoothclosed(d, smoothing);\n })\n .style('stroke-miterlimit', 1)\n .style('vector-effect', 'non-scaling-stroke');\n }\n\n return linegroup;\n};\n\nexports.createLineClip = function(lineContainer, clipLinesForLabels, gd, uid) {\n var clips = gd._fullLayout._clips;\n var clipId = clipLinesForLabels ? ('clipline' + uid) : null;\n\n var lineClip = clips.selectAll('#' + clipId)\n .data(clipLinesForLabels ? [0] : []);\n lineClip.exit().remove();\n\n lineClip.enter().append('clipPath')\n .classed('contourlineclip', true)\n .attr('id', clipId);\n\n Drawing.setClipUrl(lineContainer, clipId, gd);\n\n return lineClip;\n};\n\nexports.labelFormatter = function(gd, cd0) {\n var fullLayout = gd._fullLayout;\n var trace = cd0.trace;\n var contours = trace.contours;\n\n var formatAxis = {\n type: 'linear',\n _id: 'ycontour',\n showexponent: 'all',\n exponentformat: 'B'\n };\n\n if(contours.labelformat) {\n formatAxis.tickformat = contours.labelformat;\n setConvert(formatAxis, fullLayout);\n } else {\n var cOpts = Colorscale.extractOpts(trace);\n if(cOpts && cOpts.colorbar && cOpts.colorbar._axis) {\n formatAxis = cOpts.colorbar._axis;\n } else {\n if(contours.type === 'constraint') {\n var value = contours.value;\n if(Array.isArray(value)) {\n formatAxis.range = [value[0], value[value.length - 1]];\n } else formatAxis.range = [value, value];\n } else {\n formatAxis.range = [contours.start, contours.end];\n formatAxis.nticks = (contours.end - contours.start) / contours.size;\n }\n\n if(formatAxis.range[0] === formatAxis.range[1]) {\n formatAxis.range[1] += formatAxis.range[0] || 1;\n }\n if(!formatAxis.nticks) formatAxis.nticks = 1000;\n\n setConvert(formatAxis, fullLayout);\n Axes.prepTicks(formatAxis);\n formatAxis._tmin = null;\n formatAxis._tmax = null;\n }\n }\n\n return function(v) { return Axes.tickText(formatAxis, v).text; };\n};\n\nexports.calcTextOpts = function(level, contourFormat, dummyText, gd) {\n var text = contourFormat(level);\n dummyText.text(text)\n .call(svgTextUtils.convertToTspans, gd);\n\n var el = dummyText.node();\n var bBox = Drawing.bBox(el, true);\n\n return {\n text: text,\n width: bBox.width,\n height: bBox.height,\n fontSize: +(el.style['font-size'].replace('px', '')),\n level: level,\n dy: (bBox.top + bBox.bottom) / 2\n };\n};\n\nexports.findBestTextLocation = function(path, pathBounds, textOpts, labelData, plotBounds) {\n var textWidth = textOpts.width;\n\n var p0, dp, pMax, pMin, loc;\n if(pathBounds.isClosed) {\n dp = pathBounds.len / costConstants.INITIALSEARCHPOINTS;\n p0 = pathBounds.min + dp / 2;\n pMax = pathBounds.max;\n } else {\n dp = (pathBounds.len - textWidth) / (costConstants.INITIALSEARCHPOINTS + 1);\n p0 = pathBounds.min + dp + textWidth / 2;\n pMax = pathBounds.max - (dp + textWidth) / 2;\n }\n\n var cost = Infinity;\n for(var j = 0; j < costConstants.ITERATIONS; j++) {\n for(var p = p0; p < pMax; p += dp) {\n var newLocation = Lib.getTextLocation(path, pathBounds.total, p, textWidth);\n var newCost = locationCost(newLocation, textOpts, labelData, plotBounds);\n if(newCost < cost) {\n cost = newCost;\n loc = newLocation;\n pMin = p;\n }\n }\n if(cost > costConstants.MAXCOST * 2) break;\n\n // subsequent iterations just look half steps away from the\n // best we found in the previous iteration\n if(j) dp /= 2;\n p0 = pMin - dp / 2;\n pMax = p0 + dp * 1.5;\n }\n if(cost <= costConstants.MAXCOST) return loc;\n};\n\n/*\n * locationCost: a cost function for label locations\n * composed of three kinds of penalty:\n * - for open paths, being close to the end of the path\n * - the angle away from horizontal\n * - being too close to already placed neighbors\n */\nfunction locationCost(loc, textOpts, labelData, bounds) {\n var halfWidth = textOpts.width / 2;\n var halfHeight = textOpts.height / 2;\n var x = loc.x;\n var y = loc.y;\n var theta = loc.theta;\n var dx = Math.cos(theta) * halfWidth;\n var dy = Math.sin(theta) * halfWidth;\n\n // cost for being near an edge\n var normX = ((x > bounds.center) ? (bounds.right - x) : (x - bounds.left)) /\n (dx + Math.abs(Math.sin(theta) * halfHeight));\n var normY = ((y > bounds.middle) ? (bounds.bottom - y) : (y - bounds.top)) /\n (Math.abs(dy) + Math.cos(theta) * halfHeight);\n if(normX < 1 || normY < 1) return Infinity;\n var cost = costConstants.EDGECOST * (1 / (normX - 1) + 1 / (normY - 1));\n\n // cost for not being horizontal\n cost += costConstants.ANGLECOST * theta * theta;\n\n // cost for being close to other labels\n var x1 = x - dx;\n var y1 = y - dy;\n var x2 = x + dx;\n var y2 = y + dy;\n for(var i = 0; i < labelData.length; i++) {\n var labeli = labelData[i];\n var dxd = Math.cos(labeli.theta) * labeli.width / 2;\n var dyd = Math.sin(labeli.theta) * labeli.width / 2;\n var dist = Lib.segmentDistance(\n x1, y1,\n x2, y2,\n labeli.x - dxd, labeli.y - dyd,\n labeli.x + dxd, labeli.y + dyd\n ) * 2 / (textOpts.height + labeli.height);\n\n var sameLevel = labeli.level === textOpts.level;\n var distOffset = sameLevel ? costConstants.SAMELEVELDISTANCE : 1;\n\n if(dist <= distOffset) return Infinity;\n\n var distFactor = costConstants.NEIGHBORCOST *\n (sameLevel ? costConstants.SAMELEVELFACTOR : 1);\n\n cost += distFactor / (dist - distOffset);\n }\n\n return cost;\n}\n\nexports.addLabelData = function(loc, textOpts, labelData, labelClipPathData) {\n var fontSize = textOpts.fontSize;\n var w = textOpts.width + fontSize / 3;\n var h = Math.max(0, textOpts.height - fontSize / 3);\n\n var x = loc.x;\n var y = loc.y;\n var theta = loc.theta;\n\n var sin = Math.sin(theta);\n var cos = Math.cos(theta);\n\n var rotateXY = function(dx, dy) {\n return [\n x + dx * cos - dy * sin,\n y + dx * sin + dy * cos\n ];\n };\n\n var bBoxPts = [\n rotateXY(-w / 2, -h / 2),\n rotateXY(-w / 2, h / 2),\n rotateXY(w / 2, h / 2),\n rotateXY(w / 2, -h / 2)\n ];\n\n labelData.push({\n text: textOpts.text,\n x: x,\n y: y,\n dy: textOpts.dy,\n theta: theta,\n level: textOpts.level,\n width: w,\n height: h\n });\n\n labelClipPathData.push(bBoxPts);\n};\n\nexports.drawLabels = function(labelGroup, labelData, gd, lineClip, labelClipPathData) {\n var labels = labelGroup.selectAll('text')\n .data(labelData, function(d) {\n return d.text + ',' + d.x + ',' + d.y + ',' + d.theta;\n });\n\n labels.exit().remove();\n\n labels.enter().append('text')\n .attr({\n 'data-notex': 1,\n 'text-anchor': 'middle'\n })\n .each(function(d) {\n var x = d.x + Math.sin(d.theta) * d.dy;\n var y = d.y - Math.cos(d.theta) * d.dy;\n d3.select(this)\n .text(d.text)\n .attr({\n x: x,\n y: y,\n transform: 'rotate(' + (180 * d.theta / Math.PI) + ' ' + x + ' ' + y + ')'\n })\n .call(svgTextUtils.convertToTspans, gd);\n });\n\n if(labelClipPathData) {\n var clipPath = '';\n for(var i = 0; i < labelClipPathData.length; i++) {\n clipPath += 'M' + labelClipPathData[i].join('L') + 'Z';\n }\n\n var lineClipPath = Lib.ensureSingle(lineClip, 'path', '');\n lineClipPath.attr('d', clipPath);\n }\n};\n\nfunction clipGaps(plotGroup, plotinfo, gd, cd0, perimeter) {\n var trace = cd0.trace;\n var clips = gd._fullLayout._clips;\n var clipId = 'clip' + trace.uid;\n\n var clipPath = clips.selectAll('#' + clipId)\n .data(trace.connectgaps ? [] : [0]);\n clipPath.enter().append('clipPath')\n .classed('contourclip', true)\n .attr('id', clipId);\n clipPath.exit().remove();\n\n if(trace.connectgaps === false) {\n var clipPathInfo = {\n // fraction of the way from missing to present point\n // to draw the boundary.\n // if you make this 1 (or 1-epsilon) then a point in\n // a sea of missing data will disappear entirely.\n level: 0.9,\n crossings: {},\n starts: [],\n edgepaths: [],\n paths: [],\n xaxis: plotinfo.xaxis,\n yaxis: plotinfo.yaxis,\n x: cd0.x,\n y: cd0.y,\n // 0 = no data, 1 = data\n z: makeClipMask(cd0),\n smoothing: 0\n };\n\n makeCrossings([clipPathInfo]);\n findAllPaths([clipPathInfo]);\n closeBoundaries([clipPathInfo], {type: 'levels'});\n\n var path = Lib.ensureSingle(clipPath, 'path', '');\n path.attr('d',\n (clipPathInfo.prefixBoundary ? 'M' + perimeter.join('L') + 'Z' : '') +\n joinAllPaths(clipPathInfo, perimeter)\n );\n } else clipId = null;\n\n Drawing.setClipUrl(plotGroup, clipId, gd);\n}\n\nfunction makeClipMask(cd0) {\n var empties = cd0.trace._emptypoints;\n var z = [];\n var m = cd0.z.length;\n var n = cd0.z[0].length;\n var i;\n var row = [];\n var emptyPoint;\n\n for(i = 0; i < n; i++) row.push(1);\n for(i = 0; i < m; i++) z.push(row.slice());\n for(i = 0; i < empties.length; i++) {\n emptyPoint = empties[i];\n z[emptyPoint[0]][emptyPoint[1]] = 0;\n }\n // save this mask to determine whether to show this data in hover\n cd0.zmask = z;\n return z;\n}\n\n},{\"../../components/colorscale\":607,\"../../components/drawing\":617,\"../../lib\":728,\"../../lib/svg_text_utils\":752,\"../../plots/cartesian/axes\":776,\"../../plots/cartesian/set_convert\":796,\"../heatmap/plot\":1024,\"./close_boundaries\":958,\"./constants\":960,\"./convert_to_constraints\":964,\"./empty_pathinfo\":966,\"./find_all_paths\":968,\"./make_crossings\":973,\"d3\":164}],975:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar Lib = _dereq_('../../lib');\n\nmodule.exports = function setContours(trace, vals) {\n var contours = trace.contours;\n\n // check if we need to auto-choose contour levels\n if(trace.autocontour) {\n // N.B. do not try to use coloraxis cmin/cmax,\n // these values here are meant to remain \"per-trace\" for now\n var zmin = trace.zmin;\n var zmax = trace.zmax;\n if(trace.zauto || zmin === undefined) {\n zmin = Lib.aggNums(Math.min, null, vals);\n }\n if(trace.zauto || zmax === undefined) {\n zmax = Lib.aggNums(Math.max, null, vals);\n }\n\n var dummyAx = autoContours(zmin, zmax, trace.ncontours);\n contours.size = dummyAx.dtick;\n contours.start = Axes.tickFirst(dummyAx);\n dummyAx.range.reverse();\n contours.end = Axes.tickFirst(dummyAx);\n\n if(contours.start === zmin) contours.start += contours.size;\n if(contours.end === zmax) contours.end -= contours.size;\n\n // if you set a small ncontours, *and* the ends are exactly on zmin/zmax\n // there's an edge case where start > end now. Make sure there's at least\n // one meaningful contour, put it midway between the crossed values\n if(contours.start > contours.end) {\n contours.start = contours.end = (contours.start + contours.end) / 2;\n }\n\n // copy auto-contour info back to the source data.\n // previously we copied the whole contours object back, but that had\n // other info (coloring, showlines) that should be left to supplyDefaults\n if(!trace._input.contours) trace._input.contours = {};\n Lib.extendFlat(trace._input.contours, {\n start: contours.start,\n end: contours.end,\n size: contours.size\n });\n trace._input.autocontour = true;\n } else if(contours.type !== 'constraint') {\n // sanity checks on manually-supplied start/end/size\n var start = contours.start;\n var end = contours.end;\n var inputContours = trace._input.contours;\n\n if(start > end) {\n contours.start = inputContours.start = end;\n end = contours.end = inputContours.end = start;\n start = contours.start;\n }\n\n if(!(contours.size > 0)) {\n var sizeOut;\n if(start === end) sizeOut = 1;\n else sizeOut = autoContours(start, end, trace.ncontours).dtick;\n\n inputContours.size = contours.size = sizeOut;\n }\n }\n};\n\n\n/*\n * autoContours: make a dummy axis object with dtick we can use\n * as contours.size, and if needed we can use Axes.tickFirst\n * with this axis object to calculate the start and end too\n *\n * start: the value to start the contours at\n * end: the value to end at (must be > start)\n * ncontours: max number of contours to make, like roughDTick\n *\n * returns: an axis object\n */\nfunction autoContours(start, end, ncontours) {\n var dummyAx = {\n type: 'linear',\n range: [start, end]\n };\n\n Axes.autoTicks(\n dummyAx,\n (end - start) / (ncontours || 15)\n );\n\n return dummyAx;\n}\n\n},{\"../../lib\":728,\"../../plots/cartesian/axes\":776}],976:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Drawing = _dereq_('../../components/drawing');\nvar heatmapStyle = _dereq_('../heatmap/style');\n\nvar makeColorMap = _dereq_('./make_color_map');\n\n\nmodule.exports = function style(gd) {\n var contours = d3.select(gd).selectAll('g.contour');\n\n contours.style('opacity', function(d) {\n return d[0].trace.opacity;\n });\n\n contours.each(function(d) {\n var c = d3.select(this);\n var trace = d[0].trace;\n var contours = trace.contours;\n var line = trace.line;\n var cs = contours.size || 1;\n var start = contours.start;\n\n // for contourcarpet only - is this a constraint-type contour trace?\n var isConstraintType = contours.type === 'constraint';\n var colorLines = !isConstraintType && contours.coloring === 'lines';\n var colorFills = !isConstraintType && contours.coloring === 'fill';\n\n var colorMap = (colorLines || colorFills) ? makeColorMap(trace) : null;\n\n c.selectAll('g.contourlevel').each(function(d) {\n d3.select(this).selectAll('path')\n .call(Drawing.lineGroupStyle,\n line.width,\n colorLines ? colorMap(d.level) : line.color,\n line.dash);\n });\n\n var labelFont = contours.labelfont;\n c.selectAll('g.contourlabels text').each(function(d) {\n Drawing.font(d3.select(this), {\n family: labelFont.family,\n size: labelFont.size,\n color: labelFont.color || (colorLines ? colorMap(d.level) : line.color)\n });\n });\n\n if(isConstraintType) {\n c.selectAll('g.contourfill path')\n .style('fill', trace.fillcolor);\n } else if(colorFills) {\n var firstFill;\n\n c.selectAll('g.contourfill path')\n .style('fill', function(d) {\n if(firstFill === undefined) firstFill = d.level;\n return colorMap(d.level + 0.5 * cs);\n });\n\n if(firstFill === undefined) firstFill = start;\n\n c.selectAll('g.contourbg path')\n .style('fill', colorMap(firstFill - 0.5 * cs));\n }\n });\n\n heatmapStyle(gd);\n};\n\n},{\"../../components/drawing\":617,\"../heatmap/style\":1025,\"./make_color_map\":972,\"d3\":164}],977:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar colorscaleDefaults = _dereq_('../../components/colorscale/defaults');\nvar handleLabelDefaults = _dereq_('./label_defaults');\n\n\nmodule.exports = function handleStyleDefaults(traceIn, traceOut, coerce, layout, opts) {\n var coloring = coerce('contours.coloring');\n\n var showLines;\n var lineColor = '';\n if(coloring === 'fill') showLines = coerce('contours.showlines');\n\n if(showLines !== false) {\n if(coloring !== 'lines') lineColor = coerce('line.color', '#000');\n coerce('line.width', 0.5);\n coerce('line.dash');\n }\n\n if(coloring !== 'none') {\n // plots/plots always coerces showlegend to true, but in this case\n // we default to false and (by default) show a colorbar instead\n if(traceIn.showlegend !== true) traceOut.showlegend = false;\n traceOut._dfltShowLegend = false;\n\n colorscaleDefaults(\n traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'}\n );\n }\n\n coerce('line.smoothing');\n\n handleLabelDefaults(coerce, layout, lineColor, opts);\n};\n\n},{\"../../components/colorscale/defaults\":605,\"./label_defaults\":971}],978:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar heatmapAttrs = _dereq_('../heatmap/attributes');\nvar contourAttrs = _dereq_('../contour/attributes');\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nvar contourContourAttrs = contourAttrs.contours;\n\nmodule.exports = extendFlat({\n carpet: {\n valType: 'string',\n \n editType: 'calc',\n \n },\n z: heatmapAttrs.z,\n a: heatmapAttrs.x,\n a0: heatmapAttrs.x0,\n da: heatmapAttrs.dx,\n b: heatmapAttrs.y,\n b0: heatmapAttrs.y0,\n db: heatmapAttrs.dy,\n text: heatmapAttrs.text,\n hovertext: heatmapAttrs.hovertext,\n transpose: heatmapAttrs.transpose,\n atype: heatmapAttrs.xtype,\n btype: heatmapAttrs.ytype,\n\n fillcolor: contourAttrs.fillcolor,\n\n autocontour: contourAttrs.autocontour,\n ncontours: contourAttrs.ncontours,\n\n contours: {\n type: contourContourAttrs.type,\n start: contourContourAttrs.start,\n end: contourContourAttrs.end,\n size: contourContourAttrs.size,\n coloring: {\n // from contourAttrs.contours.coloring but no 'heatmap' option\n valType: 'enumerated',\n values: ['fill', 'lines', 'none'],\n dflt: 'fill',\n \n editType: 'calc',\n \n },\n showlines: contourContourAttrs.showlines,\n showlabels: contourContourAttrs.showlabels,\n labelfont: contourContourAttrs.labelfont,\n labelformat: contourContourAttrs.labelformat,\n operation: contourContourAttrs.operation,\n value: contourContourAttrs.value,\n editType: 'calc',\n impliedEdits: {'autocontour': false}\n },\n\n line: {\n color: contourAttrs.line.color,\n width: contourAttrs.line.width,\n dash: contourAttrs.line.dash,\n smoothing: contourAttrs.line.smoothing,\n editType: 'plot'\n },\n\n transforms: undefined\n},\n\n colorScaleAttrs('', {\n cLetter: 'z',\n autoColorDflt: false\n })\n);\n\n},{\"../../components/colorscale/attributes\":602,\"../../lib/extend\":719,\"../contour/attributes\":956,\"../heatmap/attributes\":1013}],979:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar colorscaleCalc = _dereq_('../../components/colorscale/calc');\nvar Lib = _dereq_('../../lib');\n\nvar convertColumnData = _dereq_('../heatmap/convert_column_xyz');\nvar clean2dArray = _dereq_('../heatmap/clean_2d_array');\nvar interp2d = _dereq_('../heatmap/interp2d');\nvar findEmpties = _dereq_('../heatmap/find_empties');\nvar makeBoundArray = _dereq_('../heatmap/make_bound_array');\nvar supplyDefaults = _dereq_('./defaults');\nvar lookupCarpet = _dereq_('../carpet/lookup_carpetid');\nvar setContours = _dereq_('../contour/set_contours');\n\n// most is the same as heatmap calc, then adjust it\n// though a few things inside heatmap calc still look for\n// contour maps, because the makeBoundArray calls are too entangled\nmodule.exports = function calc(gd, trace) {\n var carpet = trace._carpetTrace = lookupCarpet(gd, trace);\n if(!carpet || !carpet.visible || carpet.visible === 'legendonly') return;\n\n if(!trace.a || !trace.b) {\n // Look up the original incoming carpet data:\n var carpetdata = gd.data[carpet.index];\n\n // Look up the incoming trace data, *except* perform a shallow\n // copy so that we're not actually modifying it when we use it\n // to supply defaults:\n var tracedata = gd.data[trace.index];\n // var tracedata = extendFlat({}, gd.data[trace.index]);\n\n // If the data is not specified\n if(!tracedata.a) tracedata.a = carpetdata.a;\n if(!tracedata.b) tracedata.b = carpetdata.b;\n\n supplyDefaults(tracedata, trace, trace._defaultColor, gd._fullLayout);\n }\n\n var cd = heatmappishCalc(gd, trace);\n setContours(trace, trace._z);\n\n return cd;\n};\n\nfunction heatmappishCalc(gd, trace) {\n // prepare the raw data\n // run makeCalcdata on x and y even for heatmaps, in case of category mappings\n var carpet = trace._carpetTrace;\n var aax = carpet.aaxis;\n var bax = carpet.baxis;\n var a,\n a0,\n da,\n b,\n b0,\n db,\n z;\n\n // cancel minimum tick spacings (only applies to bars and boxes)\n aax._minDtick = 0;\n bax._minDtick = 0;\n\n if(Lib.isArray1D(trace.z)) convertColumnData(trace, aax, bax, 'a', 'b', ['z']);\n a = trace._a = trace._a || trace.a;\n b = trace._b = trace._b || trace.b;\n\n a = a ? aax.makeCalcdata(trace, '_a') : [];\n b = b ? bax.makeCalcdata(trace, '_b') : [];\n a0 = trace.a0 || 0;\n da = trace.da || 1;\n b0 = trace.b0 || 0;\n db = trace.db || 1;\n\n z = trace._z = clean2dArray(trace._z || trace.z, trace.transpose);\n\n trace._emptypoints = findEmpties(z);\n interp2d(z, trace._emptypoints);\n\n // create arrays of brick boundaries, to be used by autorange and heatmap.plot\n var xlen = Lib.maxRowLength(z);\n var xIn = trace.xtype === 'scaled' ? '' : a;\n var xArray = makeBoundArray(trace, xIn, a0, da, xlen, aax);\n var yIn = trace.ytype === 'scaled' ? '' : b;\n var yArray = makeBoundArray(trace, yIn, b0, db, z.length, bax);\n\n var cd0 = {\n a: xArray,\n b: yArray,\n z: z,\n };\n\n if(trace.contours.type === 'levels' && trace.contours.coloring !== 'none') {\n // auto-z and autocolorscale if applicable\n colorscaleCalc(gd, trace, {\n vals: z,\n containerStr: '',\n cLetter: 'z'\n });\n }\n\n return [cd0];\n}\n\n},{\"../../components/colorscale/calc\":603,\"../../lib\":728,\"../carpet/lookup_carpetid\":929,\"../contour/set_contours\":975,\"../heatmap/clean_2d_array\":1015,\"../heatmap/convert_column_xyz\":1017,\"../heatmap/find_empties\":1019,\"../heatmap/interp2d\":1022,\"../heatmap/make_bound_array\":1023,\"./defaults\":980}],980:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nvar handleXYZDefaults = _dereq_('../heatmap/xyz_defaults');\nvar attributes = _dereq_('./attributes');\nvar handleConstraintDefaults = _dereq_('../contour/constraint_defaults');\nvar handleContoursDefaults = _dereq_('../contour/contours_defaults');\nvar handleStyleDefaults = _dereq_('../contour/style_defaults');\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 function coerce2(attr) {\n return Lib.coerce2(traceIn, traceOut, attributes, attr);\n }\n\n coerce('carpet');\n\n // If either a or b is not present, then it's not a valid trace *unless* the carpet\n // axis has the a or b values we're looking for. So if these are not found, just defer\n // that decision until the calc step.\n //\n // NB: the calc step will modify the original data input by assigning whichever of\n // a or b are missing. This is necessary because panning goes right from supplyDefaults\n // to plot (skipping calc). That means on subsequent updates, this *will* need to be\n // able to find a and b.\n //\n // The long-term proper fix is that this should perhaps use underscored attributes to\n // at least modify the user input to a slightly lesser extent. Fully removing the\n // input mutation is challenging. The underscore approach is not currently taken since\n // it requires modification to all of the functions below that expect the coerced\n // attribute name to match the property name -- except '_a' !== 'a' so that is not\n // straightforward.\n if(traceIn.a && traceIn.b) {\n var len = handleXYZDefaults(traceIn, traceOut, coerce, layout, 'a', 'b');\n\n if(!len) {\n traceOut.visible = false;\n return;\n }\n\n coerce('text');\n var isConstraint = (coerce('contours.type') === 'constraint');\n\n if(isConstraint) {\n handleConstraintDefaults(traceIn, traceOut, coerce, layout, defaultColor, {hasHover: false});\n } else {\n handleContoursDefaults(traceIn, traceOut, coerce, coerce2);\n handleStyleDefaults(traceIn, traceOut, coerce, layout, {hasHover: false});\n }\n } else {\n traceOut._defaultColor = defaultColor;\n traceOut._length = null;\n }\n};\n\n},{\"../../lib\":728,\"../contour/constraint_defaults\":961,\"../contour/contours_defaults\":963,\"../contour/style_defaults\":977,\"../heatmap/xyz_defaults\":1027,\"./attributes\":978}],981:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults'),\n colorbar: _dereq_('../contour/colorbar'),\n calc: _dereq_('./calc'),\n plot: _dereq_('./plot'),\n style: _dereq_('../contour/style'),\n\n moduleType: 'trace',\n name: 'contourcarpet',\n basePlotModule: _dereq_('../../plots/cartesian'),\n categories: ['cartesian', 'svg', 'carpet', 'contour', 'symbols', 'showLegend', 'hasLines', 'carpetDependent', 'noHover', 'noSortingByValue'],\n meta: {\n \n \n }\n};\n\n},{\"../../plots/cartesian\":789,\"../contour/colorbar\":959,\"../contour/style\":976,\"./attributes\":978,\"./calc\":979,\"./defaults\":980,\"./plot\":982}],982:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar map1dArray = _dereq_('../carpet/map_1d_array');\nvar makepath = _dereq_('../carpet/makepath');\nvar Drawing = _dereq_('../../components/drawing');\nvar Lib = _dereq_('../../lib');\n\nvar makeCrossings = _dereq_('../contour/make_crossings');\nvar findAllPaths = _dereq_('../contour/find_all_paths');\nvar contourPlot = _dereq_('../contour/plot');\nvar constants = _dereq_('../contour/constants');\nvar convertToConstraints = _dereq_('../contour/convert_to_constraints');\nvar emptyPathinfo = _dereq_('../contour/empty_pathinfo');\nvar closeBoundaries = _dereq_('../contour/close_boundaries');\nvar lookupCarpet = _dereq_('../carpet/lookup_carpetid');\nvar axisAlignedLine = _dereq_('../carpet/axis_aligned_line');\n\nmodule.exports = function plot(gd, plotinfo, cdcontours, contourcarpetLayer) {\n var xa = plotinfo.xaxis;\n var ya = plotinfo.yaxis;\n\n Lib.makeTraceGroups(contourcarpetLayer, cdcontours, 'contour').each(function(cd) {\n var plotGroup = d3.select(this);\n var cd0 = cd[0];\n var trace = cd0.trace;\n\n var carpet = trace._carpetTrace = lookupCarpet(gd, trace);\n var carpetcd = gd.calcdata[carpet.index][0];\n\n if(!carpet.visible || carpet.visible === 'legendonly') return;\n\n var a = cd0.a;\n var b = cd0.b;\n var contours = trace.contours;\n var pathinfo = emptyPathinfo(contours, plotinfo, cd0);\n var isConstraint = contours.type === 'constraint';\n var operation = contours._operation;\n var coloring = isConstraint ? (operation === '=' ? 'lines' : 'fill') : contours.coloring;\n\n // Map [a, b] (data) --> [i, j] (pixels)\n function ab2p(ab) {\n var pt = carpet.ab2xy(ab[0], ab[1], true);\n return [xa.c2p(pt[0]), ya.c2p(pt[1])];\n }\n\n // Define the perimeter in a/b coordinates:\n var perimeter = [\n [a[0], b[b.length - 1]],\n [a[a.length - 1], b[b.length - 1]],\n [a[a.length - 1], b[0]],\n [a[0], b[0]]\n ];\n\n // Extract the contour levels:\n makeCrossings(pathinfo);\n var atol = (a[a.length - 1] - a[0]) * 1e-8;\n var btol = (b[b.length - 1] - b[0]) * 1e-8;\n findAllPaths(pathinfo, atol, btol);\n\n // Constraints might need to be draw inverted, which is not something contours\n // handle by default since they're assumed fully opaque so that they can be\n // drawn overlapping. This function flips the paths as necessary so that they're\n // drawn correctly.\n //\n // TODO: Perhaps this should be generalized and *all* paths should be drawn as\n // closed regions so that translucent contour levels would be valid.\n // See: https://github.com/plotly/plotly.js/issues/1356\n var fillPathinfo = pathinfo;\n if(contours.type === 'constraint') {\n fillPathinfo = convertToConstraints(pathinfo, operation);\n }\n\n // Map the paths in a/b coordinates to pixel coordinates:\n mapPathinfo(pathinfo, ab2p);\n\n // draw everything\n\n // Compute the boundary path\n var seg, xp, yp, i;\n var segs = [];\n for(i = carpetcd.clipsegments.length - 1; i >= 0; i--) {\n seg = carpetcd.clipsegments[i];\n xp = map1dArray([], seg.x, xa.c2p);\n yp = map1dArray([], seg.y, ya.c2p);\n xp.reverse();\n yp.reverse();\n segs.push(makepath(xp, yp, seg.bicubic));\n }\n\n var boundaryPath = 'M' + segs.join('L') + 'Z';\n\n // Draw the baseline background fill that fills in the space behind any other\n // contour levels:\n makeBackground(plotGroup, carpetcd.clipsegments, xa, ya, isConstraint, coloring);\n\n // Draw the specific contour fills. As a simplification, they're assumed to be\n // fully opaque so that it's easy to draw them simply overlapping. The alternative\n // would be to flip adjacent paths and draw closed paths for each level instead.\n makeFills(trace, plotGroup, xa, ya, fillPathinfo, perimeter, ab2p, carpet, carpetcd, coloring, boundaryPath);\n\n // Draw contour lines:\n makeLinesAndLabels(plotGroup, pathinfo, gd, cd0, contours, plotinfo, carpet);\n\n // Clip the boundary of the plot\n Drawing.setClipUrl(plotGroup, carpet._clipPathId, gd);\n });\n};\n\nfunction mapPathinfo(pathinfo, map) {\n var i, j, k, pi, pedgepaths, ppaths, pedgepath, ppath, path;\n\n for(i = 0; i < pathinfo.length; i++) {\n pi = pathinfo[i];\n pedgepaths = pi.pedgepaths = [];\n ppaths = pi.ppaths = [];\n for(j = 0; j < pi.edgepaths.length; j++) {\n path = pi.edgepaths[j];\n pedgepath = [];\n for(k = 0; k < path.length; k++) {\n pedgepath[k] = map(path[k]);\n }\n pedgepaths.push(pedgepath);\n }\n for(j = 0; j < pi.paths.length; j++) {\n path = pi.paths[j];\n ppath = [];\n for(k = 0; k < path.length; k++) {\n ppath[k] = map(path[k]);\n }\n ppaths.push(ppath);\n }\n }\n}\n\nfunction makeLinesAndLabels(plotgroup, pathinfo, gd, cd0, contours, plotinfo, carpet) {\n var lineContainer = Lib.ensureSingle(plotgroup, 'g', 'contourlines');\n var showLines = contours.showlines !== false;\n var showLabels = contours.showlabels;\n var clipLinesForLabels = showLines && showLabels;\n\n // Even if we're not going to show lines, we need to create them\n // if we're showing labels, because the fill paths include the perimeter\n // so can't be used to position the labels correctly.\n // In this case we'll remove the lines after making the labels.\n var linegroup = contourPlot.createLines(lineContainer, showLines || showLabels, pathinfo);\n\n var lineClip = contourPlot.createLineClip(lineContainer, clipLinesForLabels, gd, cd0.trace.uid);\n\n var labelGroup = plotgroup.selectAll('g.contourlabels')\n .data(showLabels ? [0] : []);\n\n labelGroup.exit().remove();\n\n labelGroup.enter().append('g')\n .classed('contourlabels', true);\n\n if(showLabels) {\n var xa = plotinfo.xaxis;\n var ya = plotinfo.yaxis;\n var xLen = xa._length;\n var yLen = ya._length;\n // for simplicity use the xy box for label clipping outline.\n var labelClipPathData = [[\n [0, 0],\n [xLen, 0],\n [xLen, yLen],\n [0, yLen]\n ]];\n\n\n var labelData = [];\n\n // invalidate the getTextLocation cache in case paths changed\n Lib.clearLocationCache();\n\n var contourFormat = contourPlot.labelFormatter(gd, cd0);\n\n var dummyText = Drawing.tester.append('text')\n .attr('data-notex', 1)\n .call(Drawing.font, contours.labelfont);\n\n // use `bounds` only to keep labels away from the x/y boundaries\n // `constrainToCarpet` below ensures labels don't go off the\n // carpet edges\n var bounds = {\n left: 0,\n right: xLen,\n center: xLen / 2,\n top: 0,\n bottom: yLen,\n middle: yLen / 2\n };\n\n var plotDiagonal = Math.sqrt(xLen * xLen + yLen * yLen);\n\n // the path length to use to scale the number of labels to draw:\n var normLength = constants.LABELDISTANCE * plotDiagonal /\n Math.max(1, pathinfo.length / constants.LABELINCREASE);\n\n linegroup.each(function(d) {\n var textOpts = contourPlot.calcTextOpts(d.level, contourFormat, dummyText, gd);\n\n d3.select(this).selectAll('path').each(function(pathData) {\n var path = this;\n var pathBounds = Lib.getVisibleSegment(path, bounds, textOpts.height / 2);\n if(!pathBounds) return;\n\n constrainToCarpet(path, pathData, d, pathBounds, carpet, textOpts.height);\n\n if(pathBounds.len < (textOpts.width + textOpts.height) * constants.LABELMIN) return;\n\n var maxLabels = Math.min(Math.ceil(pathBounds.len / normLength),\n constants.LABELMAX);\n\n for(var i = 0; i < maxLabels; i++) {\n var loc = contourPlot.findBestTextLocation(path, pathBounds, textOpts,\n labelData, bounds);\n\n if(!loc) break;\n\n contourPlot.addLabelData(loc, textOpts, labelData, labelClipPathData);\n }\n });\n });\n\n dummyText.remove();\n\n contourPlot.drawLabels(labelGroup, labelData, gd, lineClip,\n clipLinesForLabels ? labelClipPathData : null);\n }\n\n if(showLabels && !showLines) linegroup.remove();\n}\n\n// figure out if this path goes off the edge of the carpet\n// and shorten the part we call visible to keep labels away from the edge\nfunction constrainToCarpet(path, pathData, levelData, pathBounds, carpet, textHeight) {\n var pathABData;\n for(var i = 0; i < levelData.pedgepaths.length; i++) {\n if(pathData === levelData.pedgepaths[i]) {\n pathABData = levelData.edgepaths[i];\n }\n }\n if(!pathABData) return;\n\n var aMin = carpet.a[0];\n var aMax = carpet.a[carpet.a.length - 1];\n var bMin = carpet.b[0];\n var bMax = carpet.b[carpet.b.length - 1];\n\n function getOffset(abPt, pathVector) {\n var offset = 0;\n var edgeVector;\n var dAB = 0.1;\n if(Math.abs(abPt[0] - aMin) < dAB || Math.abs(abPt[0] - aMax) < dAB) {\n edgeVector = normalizeVector(carpet.dxydb_rough(abPt[0], abPt[1], dAB));\n offset = Math.max(offset, textHeight * vectorTan(pathVector, edgeVector) / 2);\n }\n\n if(Math.abs(abPt[1] - bMin) < dAB || Math.abs(abPt[1] - bMax) < dAB) {\n edgeVector = normalizeVector(carpet.dxyda_rough(abPt[0], abPt[1], dAB));\n offset = Math.max(offset, textHeight * vectorTan(pathVector, edgeVector) / 2);\n }\n return offset;\n }\n\n var startVector = getUnitVector(path, 0, 1);\n var endVector = getUnitVector(path, pathBounds.total, pathBounds.total - 1);\n var minStart = getOffset(pathABData[0], startVector);\n var maxEnd = pathBounds.total - getOffset(pathABData[pathABData.length - 1], endVector);\n\n if(pathBounds.min < minStart) pathBounds.min = minStart;\n if(pathBounds.max > maxEnd) pathBounds.max = maxEnd;\n\n pathBounds.len = pathBounds.max - pathBounds.min;\n}\n\nfunction getUnitVector(path, p0, p1) {\n var pt0 = path.getPointAtLength(p0);\n var pt1 = path.getPointAtLength(p1);\n var dx = pt1.x - pt0.x;\n var dy = pt1.y - pt0.y;\n var len = Math.sqrt(dx * dx + dy * dy);\n return [dx / len, dy / len];\n}\n\nfunction normalizeVector(v) {\n var len = Math.sqrt(v[0] * v[0] + v[1] * v[1]);\n return [v[0] / len, v[1] / len];\n}\n\nfunction vectorTan(v0, v1) {\n var cos = Math.abs(v0[0] * v1[0] + v0[1] * v1[1]);\n var sin = Math.sqrt(1 - cos * cos);\n return sin / cos;\n}\n\nfunction makeBackground(plotgroup, clipsegments, xaxis, yaxis, isConstraint, coloring) {\n var seg, xp, yp, i;\n var bggroup = Lib.ensureSingle(plotgroup, 'g', 'contourbg');\n\n var bgfill = bggroup.selectAll('path')\n .data((coloring === 'fill' && !isConstraint) ? [0] : []);\n bgfill.enter().append('path');\n bgfill.exit().remove();\n\n var segs = [];\n for(i = 0; i < clipsegments.length; i++) {\n seg = clipsegments[i];\n xp = map1dArray([], seg.x, xaxis.c2p);\n yp = map1dArray([], seg.y, yaxis.c2p);\n segs.push(makepath(xp, yp, seg.bicubic));\n }\n\n bgfill\n .attr('d', 'M' + segs.join('L') + 'Z')\n .style('stroke', 'none');\n}\n\nfunction makeFills(trace, plotgroup, xa, ya, pathinfo, perimeter, ab2p, carpet, carpetcd, coloring, boundaryPath) {\n var hasFills = coloring === 'fill';\n\n // fills prefixBoundary in pathinfo items\n if(hasFills) {\n closeBoundaries(pathinfo, trace.contours);\n }\n\n var fillgroup = Lib.ensureSingle(plotgroup, 'g', 'contourfill');\n var fillitems = fillgroup.selectAll('path').data(hasFills ? pathinfo : []);\n fillitems.enter().append('path');\n fillitems.exit().remove();\n fillitems.each(function(pi) {\n // join all paths for this level together into a single path\n // first follow clockwise around the perimeter to close any open paths\n // if the whole perimeter is above this level, start with a path\n // enclosing the whole thing. With all that, the parity should mean\n // that we always fill everything above the contour, nothing below\n var fullpath = (pi.prefixBoundary ? boundaryPath : '') +\n joinAllPaths(trace, pi, perimeter, ab2p, carpet, carpetcd, xa, ya);\n\n if(!fullpath) {\n d3.select(this).remove();\n } else {\n d3.select(this)\n .attr('d', fullpath)\n .style('stroke', 'none');\n }\n });\n}\n\nfunction joinAllPaths(trace, pi, perimeter, ab2p, carpet, carpetcd, xa, ya) {\n var i;\n var fullpath = '';\n\n var startsleft = pi.edgepaths.map(function(v, i) { return i; });\n var newloop = true;\n var endpt, newendpt, cnt, nexti, possiblei, addpath;\n\n var atol = Math.abs(perimeter[0][0] - perimeter[2][0]) * 1e-4;\n var btol = Math.abs(perimeter[0][1] - perimeter[2][1]) * 1e-4;\n\n function istop(pt) { return Math.abs(pt[1] - perimeter[0][1]) < btol; }\n function isbottom(pt) { return Math.abs(pt[1] - perimeter[2][1]) < btol; }\n function isleft(pt) { return Math.abs(pt[0] - perimeter[0][0]) < atol; }\n function isright(pt) { return Math.abs(pt[0] - perimeter[2][0]) < atol; }\n\n function pathto(pt0, pt1) {\n var i, j, segments, axis;\n var path = '';\n\n if((istop(pt0) && !isright(pt0)) || (isbottom(pt0) && !isleft(pt0))) {\n axis = carpet.aaxis;\n segments = axisAlignedLine(carpet, carpetcd, [pt0[0], pt1[0]], 0.5 * (pt0[1] + pt1[1]));\n } else {\n axis = carpet.baxis;\n segments = axisAlignedLine(carpet, carpetcd, 0.5 * (pt0[0] + pt1[0]), [pt0[1], pt1[1]]);\n }\n\n for(i = 1; i < segments.length; i++) {\n path += axis.smoothing ? 'C' : 'L';\n for(j = 0; j < segments[i].length; j++) {\n var pt = segments[i][j];\n path += [xa.c2p(pt[0]), ya.c2p(pt[1])] + ' ';\n }\n }\n\n return path;\n }\n\n i = 0;\n endpt = null;\n while(startsleft.length) {\n var startpt = pi.edgepaths[i][0];\n\n if(endpt) {\n fullpath += pathto(endpt, startpt);\n }\n\n addpath = Drawing.smoothopen(pi.edgepaths[i].map(ab2p), pi.smoothing);\n fullpath += newloop ? addpath : addpath.replace(/^M/, 'L');\n startsleft.splice(startsleft.indexOf(i), 1);\n endpt = pi.edgepaths[i][pi.edgepaths[i].length - 1];\n nexti = -1;\n\n // now loop through sides, moving our endpoint until we find a new start\n for(cnt = 0; cnt < 4; cnt++) { // just to prevent infinite loops\n if(!endpt) {\n Lib.log('Missing end?', i, pi);\n break;\n }\n\n if(istop(endpt) && !isright(endpt)) {\n newendpt = perimeter[1]; // left top ---> right top\n } else if(isleft(endpt)) {\n newendpt = perimeter[0]; // left bottom ---> left top\n } else if(isbottom(endpt)) {\n newendpt = perimeter[3]; // right bottom\n } else if(isright(endpt)) {\n newendpt = perimeter[2]; // left bottom\n }\n\n for(possiblei = 0; possiblei < pi.edgepaths.length; possiblei++) {\n var ptNew = pi.edgepaths[possiblei][0];\n // is ptNew on the (horz. or vert.) segment from endpt to newendpt?\n if(Math.abs(endpt[0] - newendpt[0]) < atol) {\n if(Math.abs(endpt[0] - ptNew[0]) < atol &&\n (ptNew[1] - endpt[1]) * (newendpt[1] - ptNew[1]) >= 0) {\n newendpt = ptNew;\n nexti = possiblei;\n }\n } else if(Math.abs(endpt[1] - newendpt[1]) < btol) {\n if(Math.abs(endpt[1] - ptNew[1]) < btol &&\n (ptNew[0] - endpt[0]) * (newendpt[0] - ptNew[0]) >= 0) {\n newendpt = ptNew;\n nexti = possiblei;\n }\n } else {\n Lib.log('endpt to newendpt is not vert. or horz.', endpt, newendpt, ptNew);\n }\n }\n\n if(nexti >= 0) break;\n fullpath += pathto(endpt, newendpt);\n endpt = newendpt;\n }\n\n if(nexti === pi.edgepaths.length) {\n Lib.log('unclosed perimeter path');\n break;\n }\n\n i = nexti;\n\n // if we closed back on a loop we already included,\n // close it and start a new loop\n newloop = (startsleft.indexOf(i) === -1);\n if(newloop) {\n i = startsleft[0];\n fullpath += pathto(endpt, newendpt) + 'Z';\n endpt = null;\n }\n }\n\n // finally add the interior paths\n for(i = 0; i < pi.paths.length; i++) {\n fullpath += Drawing.smoothclosed(pi.paths[i].map(ab2p), pi.smoothing);\n }\n\n return fullpath;\n}\n\n},{\"../../components/drawing\":617,\"../../lib\":728,\"../carpet/axis_aligned_line\":913,\"../carpet/lookup_carpetid\":929,\"../carpet/makepath\":930,\"../carpet/map_1d_array\":931,\"../contour/close_boundaries\":958,\"../contour/constants\":960,\"../contour/convert_to_constraints\":964,\"../contour/empty_pathinfo\":966,\"../contour/find_all_paths\":968,\"../contour/make_crossings\":973,\"../contour/plot\":974,\"d3\":164}],983:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar baseAttrs = _dereq_('../../plots/attributes');\nvar scatterMapboxAttrs = _dereq_('../scattermapbox/attributes');\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\n/*\n * - https://docs.mapbox.com/help/tutorials/make-a-heatmap-with-mapbox-gl-js/\n * - https://docs.mapbox.com/mapbox-gl-js/example/heatmap-layer/\n * - https://docs.mapbox.com/mapbox-gl-js/style-spec/#layers-heatmap\n * - https://blog.mapbox.com/introducing-heatmaps-in-mapbox-gl-js-71355ada9e6c\n *\n * Gotchas:\n * - https://github.com/mapbox/mapbox-gl-js/issues/6463\n * - https://github.com/mapbox/mapbox-gl-js/issues/6112\n */\n\n/*\n *\n * In mathematical terms, Mapbox GL heatmaps are a bivariate (2D) kernel density\n * estimation with a Gaussian kernel. It means that each data point has an area\n * of “influence” around it (called a kernel) where the numerical value of\n * influence (which we call density) decreases as you go further from the point.\n * If we sum density values of all points in every pixel of the screen, we get a\n * combined density value which we then map to a heatmap color.\n *\n */\n\nmodule.exports = extendFlat({\n lon: scatterMapboxAttrs.lon,\n lat: scatterMapboxAttrs.lat,\n\n z: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n\n radius: {\n valType: 'number',\n \n editType: 'plot',\n arrayOk: true,\n min: 1,\n dflt: 30,\n \n },\n\n below: {\n valType: 'string',\n \n editType: 'plot',\n \n },\n\n text: scatterMapboxAttrs.text,\n hovertext: scatterMapboxAttrs.hovertext,\n\n hoverinfo: extendFlat({}, baseAttrs.hoverinfo, {\n flags: ['lon', 'lat', 'z', 'text', 'name']\n }),\n hovertemplate: hovertemplateAttrs(),\n showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})\n},\n colorScaleAttrs('', {\n cLetter: 'z',\n editTypeOverride: 'calc'\n })\n);\n\n},{\"../../components/colorscale/attributes\":602,\"../../lib/extend\":719,\"../../plots/attributes\":773,\"../../plots/template_attributes\":854,\"../scattermapbox/attributes\":1198}],984:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray;\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\n\nvar colorscaleCalc = _dereq_('../../components/colorscale/calc');\nvar _ = _dereq_('../../lib')._;\n\nmodule.exports = function calc(gd, trace) {\n var len = trace._length;\n var calcTrace = new Array(len);\n var z = trace.z;\n var hasZ = isArrayOrTypedArray(z) && z.length;\n\n for(var i = 0; i < len; i++) {\n var cdi = calcTrace[i] = {};\n\n var lon = trace.lon[i];\n var lat = trace.lat[i];\n\n cdi.lonlat = isNumeric(lon) && isNumeric(lat) ?\n [+lon, +lat] :\n [BADNUM, BADNUM];\n\n if(hasZ) {\n var zi = z[i];\n cdi.z = isNumeric(zi) ? zi : BADNUM;\n }\n }\n\n colorscaleCalc(gd, trace, {\n vals: hasZ ? z : [0, 1],\n containerStr: '',\n cLetter: 'z'\n });\n\n if(len) {\n calcTrace[0].t = {\n labels: {\n lat: _(gd, 'lat:') + ' ',\n lon: _(gd, 'lon:') + ' '\n }\n };\n }\n\n return calcTrace;\n};\n\n},{\"../../components/colorscale/calc\":603,\"../../constants/numerical\":704,\"../../lib\":728,\"fast-isnumeric\":236}],985:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Lib = _dereq_('../../lib');\nvar Color = _dereq_('../../components/color');\nvar Colorscale = _dereq_('../../components/colorscale');\n\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\nvar makeBlank = _dereq_('../../lib/geojson_utils').makeBlank;\n\nmodule.exports = function convert(calcTrace) {\n var trace = calcTrace[0].trace;\n var isVisible = (trace.visible === true && trace._length !== 0);\n\n var heatmap = {\n layout: {visibility: 'none'},\n paint: {}\n };\n\n var opts = trace._opts = {\n heatmap: heatmap,\n geojson: makeBlank()\n };\n\n // early return if not visible or placeholder\n if(!isVisible) return opts;\n\n var features = [];\n var i;\n\n var z = trace.z;\n var radius = trace.radius;\n var hasZ = Lib.isArrayOrTypedArray(z) && z.length;\n var hasArrayRadius = Lib.isArrayOrTypedArray(radius);\n\n for(i = 0; i < calcTrace.length; i++) {\n var cdi = calcTrace[i];\n var lonlat = cdi.lonlat;\n\n if(lonlat[0] !== BADNUM) {\n var props = {};\n\n if(hasZ) {\n var zi = cdi.z;\n props.z = zi !== BADNUM ? zi : 0;\n }\n if(hasArrayRadius) {\n props.r = (isNumeric(radius[i]) && radius[i] > 0) ? +radius[i] : 0;\n }\n\n features.push({\n type: 'Feature',\n geometry: {type: 'Point', coordinates: lonlat},\n properties: props\n });\n }\n }\n\n var cOpts = Colorscale.extractOpts(trace);\n var scl = cOpts.reversescale ?\n Colorscale.flipScale(cOpts.colorscale) :\n cOpts.colorscale;\n\n // Add alpha channel to first colorscale step.\n // If not, we would essentially color the entire map.\n // See https://docs.mapbox.com/mapbox-gl-js/example/heatmap-layer/\n var scl01 = scl[0][1];\n var color0 = Color.opacity(scl01) < 1 ? scl01 : Color.addOpacity(scl01, 0);\n\n var heatmapColor = [\n 'interpolate', ['linear'],\n ['heatmap-density'],\n 0, color0\n ];\n for(i = 1; i < scl.length; i++) {\n heatmapColor.push(scl[i][0], scl[i][1]);\n }\n\n // Those \"weights\" have to be in [0, 1], we can do this either:\n // - as here using a mapbox-gl expression\n // - or, scale the 'z' property in the feature loop\n var zExp = [\n 'interpolate', ['linear'],\n ['get', 'z'],\n cOpts.min, 0,\n cOpts.max, 1\n ];\n\n Lib.extendFlat(opts.heatmap.paint, {\n 'heatmap-weight': hasZ ? zExp : 1 / (cOpts.max - cOpts.min),\n\n 'heatmap-color': heatmapColor,\n\n 'heatmap-radius': hasArrayRadius ?\n {type: 'identity', property: 'r'} :\n trace.radius,\n\n 'heatmap-opacity': trace.opacity\n });\n\n opts.geojson = {type: 'FeatureCollection', features: features};\n opts.heatmap.layout.visibility = 'visible';\n\n return opts;\n};\n\n},{\"../../components/color\":595,\"../../components/colorscale\":607,\"../../constants/numerical\":704,\"../../lib\":728,\"../../lib/geojson_utils\":723,\"fast-isnumeric\":236}],986:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar colorscaleDefaults = _dereq_('../../components/colorscale/defaults');\nvar attributes = _dereq_('./attributes');\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 lon = coerce('lon') || [];\n var lat = coerce('lat') || [];\n\n var len = Math.min(lon.length, lat.length);\n if(!len) {\n traceOut.visible = false;\n return;\n }\n\n traceOut._length = len;\n\n coerce('z');\n coerce('radius');\n coerce('below');\n\n coerce('text');\n coerce('hovertext');\n coerce('hovertemplate');\n\n colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'});\n};\n\n},{\"../../components/colorscale/defaults\":605,\"../../lib\":728,\"./attributes\":983}],987:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = function eventData(out, pt) {\n out.lon = pt.lon;\n out.lat = pt.lat;\n out.z = pt.z;\n return out;\n};\n\n},{}],988:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar scatterMapboxHoverPoints = _dereq_('../scattermapbox/hover');\n\nmodule.exports = function hoverPoints(pointData, xval, yval) {\n var pts = scatterMapboxHoverPoints(pointData, xval, yval);\n if(!pts) return;\n\n var newPointData = pts[0];\n var cd = newPointData.cd;\n var trace = cd[0].trace;\n var di = cd[newPointData.index];\n\n // let Fx.hover pick the color\n delete newPointData.color;\n\n if('z' in di) {\n var ax = newPointData.subplot.mockAxis;\n newPointData.z = di.z;\n newPointData.zLabel = Axes.tickText(ax, ax.c2l(di.z), 'hover').text;\n }\n\n newPointData.extraText = getExtraText(trace, di, cd[0].t.labels);\n\n return [newPointData];\n};\n\nfunction getExtraText(trace, di, labels) {\n if(trace.hovertemplate) return;\n\n var hoverinfo = di.hi || trace.hoverinfo;\n var parts = hoverinfo.split('+');\n var isAll = parts.indexOf('all') !== -1;\n var hasLon = parts.indexOf('lon') !== -1;\n var hasLat = parts.indexOf('lat') !== -1;\n var lonlat = di.lonlat;\n var text = [];\n\n function format(v) {\n return v + '\\u00B0';\n }\n\n if(isAll || (hasLon && hasLat)) {\n text.push('(' + format(lonlat[0]) + ', ' + format(lonlat[1]) + ')');\n } else if(hasLon) {\n text.push(labels.lon + format(lonlat[0]));\n } else if(hasLat) {\n text.push(labels.lat + format(lonlat[1]));\n }\n\n if(isAll || parts.indexOf('text') !== -1) {\n Lib.fillText(di, trace, text);\n }\n\n return text.join('
');\n}\n\n},{\"../../lib\":728,\"../../plots/cartesian/axes\":776,\"../scattermapbox/hover\":1203}],989:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults'),\n colorbar: _dereq_('../heatmap/colorbar'),\n formatLabels: _dereq_('../scattermapbox/format_labels'),\n calc: _dereq_('./calc'),\n plot: _dereq_('./plot'),\n hoverPoints: _dereq_('./hover'),\n eventData: _dereq_('./event_data'),\n\n getBelow: function(trace, subplot) {\n var mapLayers = subplot.getMapLayers();\n\n // find first layer with `type: 'symbol'`,\n // that is not a plotly layer\n for(var i = 0; i < mapLayers.length; i++) {\n var layer = mapLayers[i];\n var layerId = layer.id;\n if(layer.type === 'symbol' &&\n typeof layerId === 'string' && layerId.indexOf('plotly-') === -1\n ) {\n return layerId;\n }\n }\n },\n\n moduleType: 'trace',\n name: 'densitymapbox',\n basePlotModule: _dereq_('../../plots/mapbox'),\n categories: ['mapbox', 'gl', 'showLegend'],\n meta: {\n hr_name: 'density_mapbox',\n \n }\n};\n\n},{\"../../plots/mapbox\":833,\"../heatmap/colorbar\":1016,\"../scattermapbox/format_labels\":1202,\"./attributes\":983,\"./calc\":984,\"./defaults\":986,\"./event_data\":987,\"./hover\":988,\"./plot\":990}],990:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar convert = _dereq_('./convert');\nvar LAYER_PREFIX = _dereq_('../../plots/mapbox/constants').traceLayerPrefix;\n\nfunction DensityMapbox(subplot, uid) {\n this.type = 'densitymapbox';\n this.subplot = subplot;\n this.uid = uid;\n\n this.sourceId = 'source-' + uid;\n\n this.layerList = [\n ['heatmap', LAYER_PREFIX + uid + '-heatmap']\n ];\n\n // previous 'below' value,\n // need this to update it properly\n this.below = null;\n}\n\nvar proto = DensityMapbox.prototype;\n\nproto.update = function(calcTrace) {\n var subplot = this.subplot;\n var layerList = this.layerList;\n var optsAll = convert(calcTrace);\n var below = subplot.belowLookup['trace-' + this.uid];\n\n subplot.map\n .getSource(this.sourceId)\n .setData(optsAll.geojson);\n\n if(below !== this.below) {\n this._removeLayers();\n this._addLayers(optsAll, below);\n this.below = below;\n }\n\n for(var i = 0; i < layerList.length; i++) {\n var item = layerList[i];\n var k = item[0];\n var id = item[1];\n var opts = optsAll[k];\n\n subplot.setOptions(id, 'setLayoutProperty', opts.layout);\n\n if(opts.layout.visibility === 'visible') {\n subplot.setOptions(id, 'setPaintProperty', opts.paint);\n }\n }\n};\n\nproto._addLayers = function(optsAll, below) {\n var subplot = this.subplot;\n var layerList = this.layerList;\n var sourceId = this.sourceId;\n\n for(var i = 0; i < layerList.length; i++) {\n var item = layerList[i];\n var k = item[0];\n var opts = optsAll[k];\n\n subplot.addLayer({\n type: k,\n id: item[1],\n source: sourceId,\n layout: opts.layout,\n paint: opts.paint\n }, below);\n }\n};\n\nproto._removeLayers = function() {\n var map = this.subplot.map;\n var layerList = this.layerList;\n\n for(var i = layerList.length - 1; i >= 0; i--) {\n map.removeLayer(layerList[i][1]);\n }\n};\n\nproto.dispose = function() {\n var map = this.subplot.map;\n this._removeLayers();\n map.removeSource(this.sourceId);\n};\n\nmodule.exports = function createDensityMapbox(subplot, calcTrace) {\n var trace = calcTrace[0].trace;\n var densityMapbox = new DensityMapbox(subplot, trace.uid);\n var sourceId = densityMapbox.sourceId;\n var optsAll = convert(calcTrace);\n var below = densityMapbox.below = subplot.belowLookup['trace-' + trace.uid];\n\n subplot.map.addSource(sourceId, {\n type: 'geojson',\n data: optsAll.geojson\n });\n\n densityMapbox._addLayers(optsAll, below);\n\n return densityMapbox;\n};\n\n},{\"../../plots/mapbox/constants\":831,\"./convert\":985}],991:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\n// arrayOk attributes, merge them into calcdata array\nmodule.exports = function arraysToCalcdata(cd, trace) {\n for(var i = 0; i < cd.length; i++) cd[i].i = i;\n\n Lib.mergeArray(trace.text, cd, 'tx');\n Lib.mergeArray(trace.hovertext, cd, 'htx');\n\n var marker = trace.marker;\n if(marker) {\n Lib.mergeArray(marker.opacity, cd, 'mo');\n Lib.mergeArray(marker.color, cd, 'mc');\n\n var markerLine = marker.line;\n if(markerLine) {\n Lib.mergeArray(markerLine.color, cd, 'mlc');\n Lib.mergeArrayCastPositive(markerLine.width, cd, 'mlw');\n }\n }\n};\n\n},{\"../../lib\":728}],992:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar barAttrs = _dereq_('../bar/attributes');\nvar lineAttrs = _dereq_('../scatter/attributes').line;\nvar baseAttrs = _dereq_('../../plots/attributes');\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar texttemplateAttrs = _dereq_('../../plots/template_attributes').texttemplateAttrs;\nvar constants = _dereq_('./constants');\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\nvar Color = _dereq_('../../components/color');\n\nmodule.exports = {\n x: barAttrs.x,\n x0: barAttrs.x0,\n dx: barAttrs.dx,\n y: barAttrs.y,\n y0: barAttrs.y0,\n dy: barAttrs.dy,\n\n hovertext: barAttrs.hovertext,\n hovertemplate: hovertemplateAttrs({}, {\n keys: constants.eventDataKeys\n }),\n\n hoverinfo: extendFlat({}, baseAttrs.hoverinfo, {\n flags: ['name', 'x', 'y', 'text', 'percent initial', 'percent previous', 'percent total']\n }),\n\n textinfo: {\n valType: 'flaglist',\n flags: ['label', 'text', 'percent initial', 'percent previous', 'percent total', 'value'],\n extras: ['none'],\n \n editType: 'plot',\n arrayOk: false,\n \n },\n // TODO: incorporate `label` and `value` in the eventData\n texttemplate: texttemplateAttrs({editType: 'plot'}, {\n keys: constants.eventDataKeys.concat(['label', 'value'])\n }),\n\n text: barAttrs.text,\n textposition: extendFlat({}, barAttrs.textposition, {dflt: 'auto'}),\n insidetextanchor: extendFlat({}, barAttrs.insidetextanchor, {dflt: 'middle'}),\n textangle: extendFlat({}, barAttrs.textangle, {dflt: 0}),\n textfont: barAttrs.textfont,\n insidetextfont: barAttrs.insidetextfont,\n outsidetextfont: barAttrs.outsidetextfont,\n constraintext: barAttrs.constraintext,\n cliponaxis: barAttrs.cliponaxis,\n\n orientation: extendFlat({}, barAttrs.orientation, {\n \n }),\n\n offset: extendFlat({}, barAttrs.offset, {arrayOk: false}),\n width: extendFlat({}, barAttrs.width, {arrayOk: false}),\n\n marker: barAttrs.marker,\n\n connector: {\n fillcolor: {\n valType: 'color',\n \n editType: 'style',\n \n },\n line: {\n color: extendFlat({}, lineAttrs.color, {dflt: Color.defaultLine}),\n width: extendFlat({}, lineAttrs.width, {\n dflt: 0,\n editType: 'plot',\n }),\n dash: lineAttrs.dash,\n editType: 'style'\n },\n visible: {\n valType: 'boolean',\n dflt: true,\n \n editType: 'plot',\n \n },\n editType: 'plot'\n },\n\n offsetgroup: barAttrs.offsetgroup,\n alignmentgroup: barAttrs.alignmentgroup\n};\n\n},{\"../../components/color\":595,\"../../lib/extend\":719,\"../../plots/attributes\":773,\"../../plots/template_attributes\":854,\"../bar/attributes\":869,\"../scatter/attributes\":1134,\"./constants\":994}],993:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar arraysToCalcdata = _dereq_('./arrays_to_calcdata');\nvar calcSelection = _dereq_('../scatter/calc_selection');\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\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, i, cdi;\n\n if(trace.orientation === 'h') {\n size = xa.makeCalcdata(trace, 'x');\n pos = ya.makeCalcdata(trace, 'y');\n } else {\n size = ya.makeCalcdata(trace, 'y');\n pos = xa.makeCalcdata(trace, 'x');\n }\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 // Unlike other bar-like traces funnels do not support base attribute.\n // bases for funnels are computed internally in a way that\n // the mid-point of each bar are located on the axis line.\n trace._base = [];\n\n // set position and size\n for(i = 0; i < serieslen; i++) {\n // treat negative values as bad numbers\n if(size[i] < 0) size[i] = BADNUM;\n\n var connectToNext = false;\n if(size[i] !== BADNUM) {\n if(i + 1 < serieslen && size[i + 1] !== BADNUM) {\n connectToNext = true;\n }\n }\n\n cdi = cd[i] = {\n p: pos[i],\n s: size[i],\n cNext: connectToNext\n };\n\n trace._base[i] = -0.5 * cdi.s;\n\n if(trace.ids) {\n cdi.id = String(trace.ids[i]);\n }\n\n // calculate total values\n if(i === 0) cd[0].vTotal = 0;\n cd[0].vTotal += fixNum(cdi.s);\n\n // ratio from initial value\n cdi.begR = fixNum(cdi.s) / fixNum(cd[0].s);\n }\n\n var prevGoodNum;\n for(i = 0; i < serieslen; i++) {\n cdi = cd[i];\n if(cdi.s === BADNUM) continue;\n\n // ratio of total value\n cdi.sumR = cdi.s / cd[0].vTotal;\n\n // ratio of previous (good) value\n cdi.difR = (prevGoodNum !== undefined) ? cdi.s / prevGoodNum : 1;\n\n prevGoodNum = cdi.s;\n }\n\n arraysToCalcdata(cd, trace);\n calcSelection(cd, trace);\n\n return cd;\n};\n\nfunction fixNum(a) {\n return (a === BADNUM) ? 0 : a;\n}\n\n},{\"../../constants/numerical\":704,\"../../plots/cartesian/axes\":776,\"../scatter/calc_selection\":1136,\"./arrays_to_calcdata\":991}],994:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n eventDataKeys: [\n 'percentInitial',\n 'percentPrevious',\n 'percentTotal'\n ]\n};\n\n},{}],995:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar setGroupPositions = _dereq_('../bar/cross_trace_calc').setGroupPositions;\n\nmodule.exports = function crossTraceCalc(gd, plotinfo) {\n var fullLayout = gd._fullLayout;\n var fullData = gd._fullData;\n var calcdata = gd.calcdata;\n var xa = plotinfo.xaxis;\n var ya = plotinfo.yaxis;\n var funnels = [];\n var funnelsVert = [];\n var funnelsHorz = [];\n var cd, i;\n\n for(i = 0; i < fullData.length; i++) {\n var fullTrace = fullData[i];\n var isHorizontal = (fullTrace.orientation === 'h');\n\n if(\n fullTrace.visible === true &&\n fullTrace.xaxis === xa._id &&\n fullTrace.yaxis === ya._id &&\n fullTrace.type === 'funnel'\n ) {\n cd = calcdata[i];\n\n if(isHorizontal) {\n funnelsHorz.push(cd);\n } else {\n funnelsVert.push(cd);\n }\n\n funnels.push(cd);\n }\n }\n\n var opts = {\n mode: fullLayout.funnelmode,\n norm: fullLayout.funnelnorm,\n gap: fullLayout.funnelgap,\n groupgap: fullLayout.funnelgroupgap\n };\n\n setGroupPositions(gd, xa, ya, funnelsVert, opts);\n setGroupPositions(gd, ya, xa, funnelsHorz, opts);\n\n for(i = 0; i < funnels.length; i++) {\n cd = funnels[i];\n\n for(var j = 0; j < cd.length; j++) {\n if(j + 1 < cd.length) {\n cd[j].nextP0 = cd[j + 1].p0;\n cd[j].nextS0 = cd[j + 1].s0;\n\n cd[j].nextP1 = cd[j + 1].p1;\n cd[j].nextS1 = cd[j + 1].s1;\n }\n }\n }\n};\n\n},{\"../bar/cross_trace_calc\":872}],996:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nvar handleGroupingDefaults = _dereq_('../bar/defaults').handleGroupingDefaults;\nvar handleText = _dereq_('../bar/defaults').handleText;\nvar handleXYDefaults = _dereq_('../scatter/xy_defaults');\nvar attributes = _dereq_('./attributes');\nvar Color = _dereq_('../../components/color');\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 coerce('orientation', (traceOut.y && !traceOut.x) ? 'v' : 'h');\n coerce('offset');\n coerce('width');\n\n var text = coerce('text');\n\n coerce('hovertext');\n coerce('hovertemplate');\n\n var textposition = coerce('textposition');\n handleText(traceIn, traceOut, layout, coerce, textposition, {\n moduleHasSelected: false,\n moduleHasUnselected: false,\n moduleHasConstrain: true,\n moduleHasCliponaxis: true,\n moduleHasTextangle: true,\n moduleHasInsideanchor: true\n });\n\n if(traceOut.textposition !== 'none' && !traceOut.texttemplate) {\n coerce('textinfo', Array.isArray(text) ? 'text+value' : 'value');\n }\n\n var markerColor = coerce('marker.color', defaultColor);\n coerce('marker.line.color', Color.defaultLine);\n coerce('marker.line.width');\n\n var connectorVisible = coerce('connector.visible');\n if(connectorVisible) {\n coerce('connector.fillcolor', defaultFillColor(markerColor));\n\n var connectorLineWidth = coerce('connector.line.width');\n if(connectorLineWidth) {\n coerce('connector.line.color');\n coerce('connector.line.dash');\n }\n }\n}\n\nfunction defaultFillColor(markerColor) {\n var cBase = Lib.isArrayOrTypedArray(markerColor) ? '#000' : markerColor;\n\n return Color.addOpacity(cBase, 0.5 * Color.opacity(cBase));\n}\n\nfunction crossTraceDefaults(fullData, fullLayout) {\n var traceIn, traceOut;\n\n function coerce(attr) {\n return Lib.coerce(traceOut._input, traceOut, attributes, attr);\n }\n\n if(fullLayout.funnelmode === 'group') {\n for(var i = 0; i < fullData.length; i++) {\n traceOut = fullData[i];\n traceIn = traceOut._input;\n\n handleGroupingDefaults(traceIn, traceOut, fullLayout, coerce);\n }\n }\n}\n\nmodule.exports = {\n supplyDefaults: supplyDefaults,\n crossTraceDefaults: crossTraceDefaults\n};\n\n},{\"../../components/color\":595,\"../../lib\":728,\"../bar/defaults\":873,\"../scatter/xy_defaults\":1160,\"./attributes\":992}],997:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = function eventData(out, pt /* , trace, cd, pointNumber */) {\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\n // for funnel\n if('percentInitial' in pt) out.percentInitial = pt.percentInitial;\n if('percentPrevious' in pt) out.percentPrevious = pt.percentPrevious;\n if('percentTotal' in pt) out.percentTotal = pt.percentTotal;\n\n if(pt.xa) out.xaxis = pt.xa;\n if(pt.ya) out.yaxis = pt.ya;\n\n return out;\n};\n\n},{}],998:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar opacity = _dereq_('../../components/color').opacity;\nvar hoverOnBars = _dereq_('../bar/hover').hoverOnBars;\nvar formatPercent = _dereq_('../../lib').formatPercent;\n\nmodule.exports = function hoverPoints(pointData, xval, yval, hovermode) {\n var point = hoverOnBars(pointData, xval, yval, hovermode);\n if(!point) return;\n\n var cd = point.cd;\n var trace = cd[0].trace;\n var isHorizontal = (trace.orientation === 'h');\n\n // the closest data point\n var index = point.index;\n var di = cd[index];\n\n var sizeLetter = isHorizontal ? 'x' : 'y';\n point[sizeLetter + 'LabelVal'] = di.s;\n\n point.percentInitial = di.begR;\n point.percentInitialLabel = formatPercent(di.begR, 1);\n\n point.percentPrevious = di.difR;\n point.percentPreviousLabel = formatPercent(di.difR, 1);\n\n point.percentTotal = di.sumR;\n point.percentTotalLabel = formatPercent(di.sumR, 1);\n\n var hoverinfo = di.hi || trace.hoverinfo;\n var text = [];\n if(hoverinfo && hoverinfo !== 'none' && hoverinfo !== 'skip') {\n var isAll = (hoverinfo === 'all');\n var parts = hoverinfo.split('+');\n\n var hasFlag = function(flag) { return isAll || parts.indexOf(flag) !== -1; };\n\n if(hasFlag('percent initial')) {\n text.push(point.percentInitialLabel + ' of initial');\n }\n if(hasFlag('percent previous')) {\n text.push(point.percentPreviousLabel + ' of previous');\n }\n if(hasFlag('percent total')) {\n text.push(point.percentTotalLabel + ' of total');\n }\n }\n point.extraText = text.join('
');\n\n point.color = getTraceColor(trace, di);\n\n return [point];\n};\n\nfunction getTraceColor(trace, di) {\n var cont = trace.marker;\n var mc = di.mc || cont.color;\n var mlc = di.mlc || cont.line.color;\n var mlw = di.mlw || cont.line.width;\n if(opacity(mc)) return mc;\n else if(opacity(mlc) && mlw) return mlc;\n}\n\n},{\"../../components/color\":595,\"../../lib\":728,\"../bar/hover\":876}],999:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n attributes: _dereq_('./attributes'),\n layoutAttributes: _dereq_('./layout_attributes'),\n supplyDefaults: _dereq_('./defaults').supplyDefaults,\n crossTraceDefaults: _dereq_('./defaults').crossTraceDefaults,\n supplyLayoutDefaults: _dereq_('./layout_defaults'),\n calc: _dereq_('./calc'),\n crossTraceCalc: _dereq_('./cross_trace_calc'),\n plot: _dereq_('./plot'),\n style: _dereq_('./style').style,\n hoverPoints: _dereq_('./hover'),\n eventData: _dereq_('./event_data'),\n\n selectPoints: _dereq_('../bar/select'),\n\n moduleType: 'trace',\n name: 'funnel',\n basePlotModule: _dereq_('../../plots/cartesian'),\n categories: ['bar-like', 'cartesian', 'svg', 'oriented', 'showLegend', 'zoomScale'],\n meta: {\n \n }\n};\n\n},{\"../../plots/cartesian\":789,\"../bar/select\":881,\"./attributes\":992,\"./calc\":993,\"./cross_trace_calc\":995,\"./defaults\":996,\"./event_data\":997,\"./hover\":998,\"./layout_attributes\":1000,\"./layout_defaults\":1001,\"./plot\":1002,\"./style\":1003}],1000:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n funnelmode: {\n valType: 'enumerated',\n values: ['stack', 'group', 'overlay'],\n dflt: 'stack',\n \n editType: 'calc',\n \n },\n funnelgap: {\n valType: 'number',\n min: 0,\n max: 1,\n \n editType: 'calc',\n \n },\n funnelgroupgap: {\n valType: 'number',\n min: 0,\n max: 1,\n dflt: 0,\n \n editType: 'calc',\n \n }\n};\n\n},{}],1001:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar layoutAttributes = _dereq_('./layout_attributes');\n\nmodule.exports = function(layoutIn, layoutOut, fullData) {\n var hasTraceType = false;\n\n function coerce(attr, dflt) {\n return Lib.coerce(layoutIn, layoutOut, layoutAttributes, attr, dflt);\n }\n\n for(var i = 0; i < fullData.length; i++) {\n var trace = fullData[i];\n\n if(trace.visible && trace.type === 'funnel') {\n hasTraceType = true;\n break;\n }\n }\n\n if(hasTraceType) {\n coerce('funnelmode');\n coerce('funnelgap', 0.2);\n coerce('funnelgroupgap');\n }\n};\n\n},{\"../../lib\":728,\"./layout_attributes\":1000}],1002:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Lib = _dereq_('../../lib');\nvar Drawing = _dereq_('../../components/drawing');\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\nvar barPlot = _dereq_('../bar/plot');\nvar clearMinTextSize = _dereq_('../bar/uniform_text').clearMinTextSize;\n\nmodule.exports = function plot(gd, plotinfo, cdModule, traceLayer) {\n var fullLayout = gd._fullLayout;\n\n clearMinTextSize('funnel', fullLayout);\n\n plotConnectorRegions(gd, plotinfo, cdModule, traceLayer);\n plotConnectorLines(gd, plotinfo, cdModule, traceLayer);\n\n barPlot.plot(gd, plotinfo, cdModule, traceLayer, {\n mode: fullLayout.funnelmode,\n norm: fullLayout.funnelmode,\n gap: fullLayout.funnelgap,\n groupgap: fullLayout.funnelgroupgap\n });\n};\n\nfunction plotConnectorRegions(gd, plotinfo, cdModule, traceLayer) {\n var xa = plotinfo.xaxis;\n var ya = plotinfo.yaxis;\n\n Lib.makeTraceGroups(traceLayer, cdModule, 'trace bars').each(function(cd) {\n var plotGroup = d3.select(this);\n var trace = cd[0].trace;\n\n var group = Lib.ensureSingle(plotGroup, 'g', 'regions');\n\n if(!trace.connector || !trace.connector.visible) {\n group.remove();\n return;\n }\n\n var isHorizontal = (trace.orientation === 'h');\n\n var connectors = group.selectAll('g.region').data(Lib.identity);\n\n connectors.enter().append('g')\n .classed('region', true);\n\n connectors.exit().remove();\n\n var len = connectors.size();\n\n connectors.each(function(di, i) {\n // don't draw lines between nulls\n if(i !== len - 1 && !di.cNext) return;\n\n var xy = getXY(di, xa, ya, isHorizontal);\n var x = xy[0];\n var y = xy[1];\n\n var shape = '';\n\n if(\n x[0] !== BADNUM && y[0] !== BADNUM &&\n x[1] !== BADNUM && y[1] !== BADNUM &&\n x[2] !== BADNUM && y[2] !== BADNUM &&\n x[3] !== BADNUM && y[3] !== BADNUM\n ) {\n if(isHorizontal) {\n shape += 'M' + x[0] + ',' + y[1] + 'L' + x[2] + ',' + y[2] + 'H' + x[3] + 'L' + x[1] + ',' + y[1] + 'Z';\n } else {\n shape += 'M' + x[1] + ',' + y[1] + 'L' + x[2] + ',' + y[3] + 'V' + y[2] + 'L' + x[1] + ',' + y[0] + 'Z';\n }\n }\n\n if(shape === '') shape = 'M0,0Z';\n\n Lib.ensureSingle(d3.select(this), 'path')\n .attr('d', shape)\n .call(Drawing.setClipUrl, plotinfo.layerClipId, gd);\n });\n });\n}\n\nfunction plotConnectorLines(gd, plotinfo, cdModule, traceLayer) {\n var xa = plotinfo.xaxis;\n var ya = plotinfo.yaxis;\n\n Lib.makeTraceGroups(traceLayer, cdModule, 'trace bars').each(function(cd) {\n var plotGroup = d3.select(this);\n var trace = cd[0].trace;\n\n var group = Lib.ensureSingle(plotGroup, 'g', 'lines');\n\n if(!trace.connector || !trace.connector.visible || !trace.connector.line.width) {\n group.remove();\n return;\n }\n\n var isHorizontal = (trace.orientation === 'h');\n\n var connectors = group.selectAll('g.line').data(Lib.identity);\n\n connectors.enter().append('g')\n .classed('line', true);\n\n connectors.exit().remove();\n\n var len = connectors.size();\n\n connectors.each(function(di, i) {\n // don't draw lines between nulls\n if(i !== len - 1 && !di.cNext) return;\n\n var xy = getXY(di, xa, ya, isHorizontal);\n var x = xy[0];\n var y = xy[1];\n\n var shape = '';\n\n if(x[3] !== undefined && y[3] !== undefined) {\n if(isHorizontal) {\n shape += 'M' + x[0] + ',' + y[1] + 'L' + x[2] + ',' + y[2];\n shape += 'M' + x[1] + ',' + y[1] + 'L' + x[3] + ',' + y[2];\n } else {\n shape += 'M' + x[1] + ',' + y[1] + 'L' + x[2] + ',' + y[3];\n shape += 'M' + x[1] + ',' + y[0] + 'L' + x[2] + ',' + y[2];\n }\n }\n\n if(shape === '') shape = 'M0,0Z';\n\n Lib.ensureSingle(d3.select(this), 'path')\n .attr('d', shape)\n .call(Drawing.setClipUrl, plotinfo.layerClipId, gd);\n });\n });\n}\n\nfunction getXY(di, xa, ya, isHorizontal) {\n var s = [];\n var p = [];\n\n var sAxis = isHorizontal ? xa : ya;\n var pAxis = isHorizontal ? ya : xa;\n\n s[0] = sAxis.c2p(di.s0, true);\n p[0] = pAxis.c2p(di.p0, true);\n\n s[1] = sAxis.c2p(di.s1, true);\n p[1] = pAxis.c2p(di.p1, true);\n\n s[2] = sAxis.c2p(di.nextS0, true);\n p[2] = pAxis.c2p(di.nextP0, true);\n\n s[3] = sAxis.c2p(di.nextS1, true);\n p[3] = pAxis.c2p(di.nextP1, true);\n\n return isHorizontal ? [s, p] : [p, s];\n}\n\n},{\"../../components/drawing\":617,\"../../constants/numerical\":704,\"../../lib\":728,\"../bar/plot\":880,\"../bar/uniform_text\":885,\"d3\":164}],1003:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Drawing = _dereq_('../../components/drawing');\nvar Color = _dereq_('../../components/color');\nvar DESELECTDIM = _dereq_('../../constants/interactions').DESELECTDIM;\nvar barStyle = _dereq_('../bar/style');\nvar resizeText = _dereq_('../bar/uniform_text').resizeText;\nvar styleTextPoints = barStyle.styleTextPoints;\n\nfunction style(gd, cd, sel) {\n var s = sel ? sel : d3.select(gd).selectAll('g.funnellayer').selectAll('g.trace');\n resizeText(gd, s, 'funnel');\n\n s.style('opacity', function(d) { return d[0].trace.opacity; });\n\n s.each(function(d) {\n var gTrace = d3.select(this);\n var trace = d[0].trace;\n\n gTrace.selectAll('.point > path').each(function(di) {\n if(!di.isBlank) {\n var cont = trace.marker;\n\n d3.select(this)\n .call(Color.fill, di.mc || cont.color)\n .call(Color.stroke, di.mlc || cont.line.color)\n .call(Drawing.dashLine, cont.line.dash, di.mlw || cont.line.width)\n .style('opacity', trace.selectedpoints && !di.selected ? DESELECTDIM : 1);\n }\n });\n\n styleTextPoints(gTrace, trace, gd);\n\n gTrace.selectAll('.regions').each(function() {\n d3.select(this).selectAll('path').style('stroke-width', 0).call(Color.fill, trace.connector.fillcolor);\n });\n\n gTrace.selectAll('.lines').each(function() {\n var cont = trace.connector.line;\n\n Drawing.lineGroupStyle(\n d3.select(this).selectAll('path'),\n cont.width,\n cont.color,\n cont.dash\n );\n });\n });\n}\n\nmodule.exports = {\n style: style\n};\n\n},{\"../../components/color\":595,\"../../components/drawing\":617,\"../../constants/interactions\":703,\"../bar/style\":883,\"../bar/uniform_text\":885,\"d3\":164}],1004:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar pieAttrs = _dereq_('../pie/attributes');\nvar baseAttrs = _dereq_('../../plots/attributes');\nvar domainAttrs = _dereq_('../../plots/domain').attributes;\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar texttemplateAttrs = _dereq_('../../plots/template_attributes').texttemplateAttrs;\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nmodule.exports = {\n labels: pieAttrs.labels,\n // equivalent of x0 and dx, if label is missing\n label0: pieAttrs.label0,\n dlabel: pieAttrs.dlabel,\n values: pieAttrs.values,\n\n marker: {\n colors: pieAttrs.marker.colors,\n line: {\n color: extendFlat({}, pieAttrs.marker.line.color, {\n dflt: null,\n \n }),\n width: extendFlat({}, pieAttrs.marker.line.width, {dflt: 1}),\n editType: 'calc'\n },\n editType: 'calc'\n },\n\n text: pieAttrs.text,\n hovertext: pieAttrs.hovertext,\n\n scalegroup: extendFlat({}, pieAttrs.scalegroup, {\n \n }),\n\n textinfo: extendFlat({}, pieAttrs.textinfo, {\n flags: ['label', 'text', 'value', 'percent']\n }),\n\n texttemplate: texttemplateAttrs({editType: 'plot'}, {\n keys: ['label', 'color', 'value', 'text', 'percent']\n }),\n\n hoverinfo: extendFlat({}, baseAttrs.hoverinfo, {\n flags: ['label', 'text', 'value', 'percent', 'name']\n }),\n\n hovertemplate: hovertemplateAttrs({}, {\n keys: ['label', 'color', 'value', 'text', 'percent']\n }),\n\n textposition: extendFlat({}, pieAttrs.textposition, {\n values: ['inside', 'none'],\n dflt: 'inside'\n }),\n\n textfont: pieAttrs.textfont,\n insidetextfont: pieAttrs.insidetextfont,\n\n title: {\n text: pieAttrs.title.text,\n font: pieAttrs.title.font,\n position: extendFlat({}, pieAttrs.title.position, {\n values: ['top left', 'top center', 'top right'],\n dflt: 'top center'\n }),\n editType: 'plot'\n },\n\n domain: domainAttrs({name: 'funnelarea', trace: true, editType: 'calc'}),\n\n aspectratio: {\n valType: 'number',\n \n min: 0,\n dflt: 1,\n editType: 'plot',\n \n },\n\n baseratio: {\n valType: 'number',\n \n min: 0,\n max: 1,\n dflt: 0.333,\n editType: 'plot',\n \n }\n};\n\n},{\"../../lib/extend\":719,\"../../plots/attributes\":773,\"../../plots/domain\":803,\"../../plots/template_attributes\":854,\"../pie/attributes\":1108}],1005:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar plots = _dereq_('../../plots/plots');\n\nexports.name = 'funnelarea';\n\nexports.plot = function(gd, traces, transitionOpts, makeOnCompleteCallback) {\n plots.plotBasePlot(exports.name, gd, traces, transitionOpts, makeOnCompleteCallback);\n};\n\nexports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) {\n plots.cleanBasePlot(exports.name, newFullData, newFullLayout, oldFullData, oldFullLayout);\n};\n\n},{\"../../plots/plots\":839}],1006:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar pieCalc = _dereq_('../pie/calc');\n\nfunction calc(gd, trace) {\n return pieCalc.calc(gd, trace);\n}\n\nfunction crossTraceCalc(gd) {\n pieCalc.crossTraceCalc(gd, { type: 'funnelarea' });\n}\n\nmodule.exports = {\n calc: calc,\n crossTraceCalc: crossTraceCalc\n};\n\n},{\"../pie/calc\":1110}],1007:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar attributes = _dereq_('./attributes');\nvar handleDomainDefaults = _dereq_('../../plots/domain').defaults;\nvar handleText = _dereq_('../bar/defaults').handleText;\nvar handleLabelsAndValues = _dereq_('../pie/defaults').handleLabelsAndValues;\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 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 var lineWidth = coerce('marker.line.width');\n if(lineWidth) coerce('marker.line.color', layout.paper_bgcolor);\n\n coerce('marker.colors');\n\n coerce('scalegroup');\n\n var textData = coerce('text');\n var textTemplate = coerce('texttemplate');\n var textInfo;\n if(!textTemplate) textInfo = coerce('textinfo', Array.isArray(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\n handleDomainDefaults(traceOut, layout, coerce);\n\n var title = coerce('title.text');\n if(title) {\n coerce('title.position');\n Lib.coerceFont(coerce, 'title.font', layout.font);\n }\n\n coerce('aspectratio');\n coerce('baseratio');\n};\n\n},{\"../../lib\":728,\"../../plots/domain\":803,\"../bar/defaults\":873,\"../pie/defaults\":1111,\"./attributes\":1004}],1008:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n moduleType: 'trace',\n name: 'funnelarea',\n basePlotModule: _dereq_('./base_plot'),\n categories: ['pie-like', 'funnelarea', 'showLegend'],\n\n attributes: _dereq_('./attributes'),\n layoutAttributes: _dereq_('./layout_attributes'),\n supplyDefaults: _dereq_('./defaults'),\n supplyLayoutDefaults: _dereq_('./layout_defaults'),\n\n calc: _dereq_('./calc').calc,\n crossTraceCalc: _dereq_('./calc').crossTraceCalc,\n\n plot: _dereq_('./plot'),\n style: _dereq_('./style'),\n styleOne: _dereq_('../pie/style_one'),\n\n meta: {\n \n }\n};\n\n},{\"../pie/style_one\":1119,\"./attributes\":1004,\"./base_plot\":1005,\"./calc\":1006,\"./defaults\":1007,\"./layout_attributes\":1009,\"./layout_defaults\":1010,\"./plot\":1011,\"./style\":1012}],1009:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar hiddenlabels = _dereq_('../pie/layout_attributes').hiddenlabels;\n\nmodule.exports = {\n hiddenlabels: hiddenlabels,\n\n funnelareacolorway: {\n valType: 'colorlist',\n \n editType: 'calc',\n \n },\n extendfunnelareacolors: {\n valType: 'boolean',\n dflt: true,\n \n editType: 'calc',\n \n }\n};\n\n},{\"../pie/layout_attributes\":1115}],1010:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nvar layoutAttributes = _dereq_('./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('funnelareacolorway', layoutOut.colorway);\n coerce('extendfunnelareacolors');\n};\n\n},{\"../../lib\":728,\"./layout_attributes\":1009}],1011:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Drawing = _dereq_('../../components/drawing');\nvar Lib = _dereq_('../../lib');\nvar svgTextUtils = _dereq_('../../lib/svg_text_utils');\n\nvar barPlot = _dereq_('../bar/plot');\nvar toMoveInsideBar = barPlot.toMoveInsideBar;\nvar uniformText = _dereq_('../bar/uniform_text');\nvar recordMinTextSize = uniformText.recordMinTextSize;\nvar clearMinTextSize = uniformText.clearMinTextSize;\nvar pieHelpers = _dereq_('../pie/helpers');\nvar piePlot = _dereq_('../pie/plot');\n\nvar attachFxHandlers = piePlot.attachFxHandlers;\nvar determineInsideTextFont = piePlot.determineInsideTextFont;\n\nvar layoutAreas = piePlot.layoutAreas;\nvar prerenderTitles = piePlot.prerenderTitles;\nvar positionTitleOutside = piePlot.positionTitleOutside;\nvar formatSliceLabel = piePlot.formatSliceLabel;\n\nmodule.exports = function plot(gd, cdModule) {\n var fullLayout = gd._fullLayout;\n\n clearMinTextSize('funnelarea', fullLayout);\n\n prerenderTitles(cdModule, gd);\n layoutAreas(cdModule, fullLayout._size);\n\n Lib.makeTraceGroups(fullLayout._funnelarealayer, cdModule, 'trace').each(function(cd) {\n var plotGroup = d3.select(this);\n var cd0 = cd[0];\n var trace = cd0.trace;\n\n setCoords(cd);\n\n plotGroup.each(function() {\n var slices = d3.select(this).selectAll('g.slice').data(cd);\n\n slices.enter().append('g')\n .classed('slice', true);\n slices.exit().remove();\n\n slices.each(function(pt, i) {\n if(pt.hidden) {\n d3.select(this).selectAll('path,g').remove();\n return;\n }\n\n // to have consistent event data compared to other traces\n pt.pointNumber = pt.i;\n pt.curveNumber = trace.index;\n\n var cx = cd0.cx;\n var cy = cd0.cy;\n var sliceTop = d3.select(this);\n var slicePath = sliceTop.selectAll('path.surface').data([pt]);\n\n slicePath.enter().append('path')\n .classed('surface', true)\n .style({'pointer-events': 'all'});\n\n sliceTop.call(attachFxHandlers, gd, cd);\n\n var shape =\n 'M' + (cx + pt.TR[0]) + ',' + (cy + pt.TR[1]) +\n line(pt.TR, pt.BR) +\n line(pt.BR, pt.BL) +\n line(pt.BL, pt.TL) +\n 'Z';\n\n slicePath.attr('d', shape);\n\n // add text\n formatSliceLabel(gd, pt, cd0);\n var textPosition = pieHelpers.castOption(trace.textposition, pt.pts);\n var sliceTextGroup = sliceTop.selectAll('g.slicetext')\n .data(pt.text && (textPosition !== 'none') ? [0] : []);\n\n sliceTextGroup.enter().append('g')\n .classed('slicetext', true);\n sliceTextGroup.exit().remove();\n\n sliceTextGroup.each(function() {\n var sliceText = Lib.ensureSingle(d3.select(this), 'text', '', function(s) {\n // prohibit tex interpretation until we can handle\n // tex and regular text together\n s.attr('data-notex', 1);\n });\n\n var font = Lib.ensureUniformFontSize(gd, determineInsideTextFont(trace, pt, fullLayout.font));\n\n sliceText.text(pt.text)\n .attr({\n 'class': 'slicetext',\n transform: '',\n 'text-anchor': 'middle'\n })\n .call(Drawing.font, font)\n .call(svgTextUtils.convertToTspans, gd);\n\n // position the text relative to the slice\n var textBB = Drawing.bBox(sliceText.node());\n var transform;\n\n var x0, x1;\n var y0 = Math.min(pt.BL[1], pt.BR[1]) + cy;\n var y1 = Math.max(pt.TL[1], pt.TR[1]) + cy;\n\n x0 = Math.max(pt.TL[0], pt.BL[0]) + cx;\n x1 = Math.min(pt.TR[0], pt.BR[0]) + cx;\n\n transform = toMoveInsideBar(x0, x1, y0, y1, textBB, {\n isHorizontal: true,\n constrained: true,\n angle: 0,\n anchor: 'middle'\n });\n\n transform.fontSize = font.size;\n recordMinTextSize(trace.type, transform, fullLayout);\n cd[i].transform = transform;\n\n sliceText.attr('transform', Lib.getTextTransform(transform));\n });\n });\n\n // add the title\n var titleTextGroup = d3.select(this).selectAll('g.titletext')\n .data(trace.title.text ? [0] : []);\n\n titleTextGroup.enter().append('g')\n .classed('titletext', true);\n titleTextGroup.exit().remove();\n\n titleTextGroup.each(function() {\n var titleText = Lib.ensureSingle(d3.select(this), 'text', '', function(s) {\n // prohibit tex interpretation as above\n s.attr('data-notex', 1);\n });\n\n var txt = trace.title.text;\n if(trace._meta) {\n txt = Lib.templateString(txt, trace._meta);\n }\n\n titleText.text(txt)\n .attr({\n 'class': 'titletext',\n transform: '',\n 'text-anchor': 'middle',\n })\n .call(Drawing.font, trace.title.font)\n .call(svgTextUtils.convertToTspans, gd);\n\n var transform = positionTitleOutside(cd0, fullLayout._size);\n\n titleText.attr('transform',\n 'translate(' + transform.x + ',' + transform.y + ')' +\n (transform.scale < 1 ? ('scale(' + transform.scale + ')') : '') +\n 'translate(' + transform.tx + ',' + transform.ty + ')');\n });\n });\n });\n};\n\nfunction line(a, b) {\n var dx = b[0] - a[0];\n var dy = b[1] - a[1];\n\n return 'l' + dx + ',' + dy;\n}\n\nfunction getBetween(a, b) {\n return [\n 0.5 * (a[0] + b[0]),\n 0.5 * (a[1] + b[1])\n ];\n}\n\nfunction setCoords(cd) {\n if(!cd.length) return;\n\n var cd0 = cd[0];\n var trace = cd0.trace;\n\n var aspectratio = trace.aspectratio;\n\n var h = trace.baseratio;\n if(h > 0.999) h = 0.999; // TODO: may handle this case separately\n var h2 = Math.pow(h, 2);\n\n var v1 = cd0.vTotal;\n var v0 = v1 * h2 / (1 - h2);\n\n var totalValues = v1;\n var sumSteps = v0 / v1;\n\n function calcPos() {\n var q = Math.sqrt(sumSteps);\n return {\n x: q,\n y: -q\n };\n }\n\n function getPoint() {\n var pos = calcPos();\n return [pos.x, pos.y];\n }\n\n var p;\n var allPoints = [];\n allPoints.push(getPoint());\n\n var i, cdi;\n for(i = cd.length - 1; i > -1; i--) {\n cdi = cd[i];\n if(cdi.hidden) continue;\n\n var step = cdi.v / totalValues;\n sumSteps += step;\n\n allPoints.push(getPoint());\n }\n\n var minY = Infinity;\n var maxY = -Infinity;\n for(i = 0; i < allPoints.length; i++) {\n p = allPoints[i];\n minY = Math.min(minY, p[1]);\n maxY = Math.max(maxY, p[1]);\n }\n\n // center the shape\n for(i = 0; i < allPoints.length; i++) {\n allPoints[i][1] -= (maxY + minY) / 2;\n }\n\n var lastX = allPoints[allPoints.length - 1][0];\n\n // get pie r\n var r = cd0.r;\n\n var rY = (maxY - minY) / 2;\n var scaleX = r / lastX;\n var scaleY = r / rY * aspectratio;\n\n // set funnelarea r\n cd0.r = scaleY * rY;\n\n // scale the shape\n for(i = 0; i < allPoints.length; i++) {\n allPoints[i][0] *= scaleX;\n allPoints[i][1] *= scaleY;\n }\n\n // record first position\n p = allPoints[0];\n var prevLeft = [-p[0], p[1]];\n var prevRight = [p[0], p[1]];\n\n var n = 0; // note we skip the very first point.\n for(i = cd.length - 1; i > -1; i--) {\n cdi = cd[i];\n if(cdi.hidden) continue;\n\n n += 1;\n var x = allPoints[n][0];\n var y = allPoints[n][1];\n\n cdi.TL = [-x, y];\n cdi.TR = [x, y];\n\n cdi.BL = prevLeft;\n cdi.BR = prevRight;\n\n cdi.pxmid = getBetween(cdi.TR, cdi.BR);\n\n prevLeft = cdi.TL;\n prevRight = cdi.TR;\n }\n}\n\n},{\"../../components/drawing\":617,\"../../lib\":728,\"../../lib/svg_text_utils\":752,\"../bar/plot\":880,\"../bar/uniform_text\":885,\"../pie/helpers\":1113,\"../pie/plot\":1117,\"d3\":164}],1012:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar styleOne = _dereq_('../pie/style_one');\nvar resizeText = _dereq_('../bar/uniform_text').resizeText;\n\nmodule.exports = function style(gd) {\n var s = gd._fullLayout._funnelarealayer.selectAll('.trace');\n resizeText(gd, s, 'funnelarea');\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);\n });\n });\n};\n\n},{\"../bar/uniform_text\":885,\"../pie/style_one\":1119,\"d3\":164}],1013:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar scatterAttrs = _dereq_('../scatter/attributes');\nvar baseAttrs = _dereq_('../../plots/attributes');\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\nvar FORMAT_LINK = _dereq_('../../constants/docs').FORMAT_LINK;\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nmodule.exports = extendFlat({\n z: {\n valType: 'data_array',\n editType: 'calc',\n \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 text: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n hovertext: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n transpose: {\n valType: 'boolean',\n dflt: false,\n \n editType: 'calc',\n \n },\n xtype: {\n valType: 'enumerated',\n values: ['array', 'scaled'],\n \n editType: 'calc+clearAxisTypes',\n \n },\n ytype: {\n valType: 'enumerated',\n values: ['array', 'scaled'],\n \n editType: 'calc+clearAxisTypes',\n \n },\n zsmooth: {\n valType: 'enumerated',\n values: ['fast', 'best', false],\n dflt: false,\n \n editType: 'calc',\n \n },\n hoverongaps: {\n valType: 'boolean',\n dflt: true,\n \n editType: 'none',\n \n },\n connectgaps: {\n valType: 'boolean',\n \n editType: 'calc',\n \n },\n xgap: {\n valType: 'number',\n dflt: 0,\n min: 0,\n \n editType: 'plot',\n \n },\n ygap: {\n valType: 'number',\n dflt: 0,\n min: 0,\n \n editType: 'plot',\n \n },\n zhoverformat: {\n valType: 'string',\n dflt: '',\n \n editType: 'none',\n \n },\n hovertemplate: hovertemplateAttrs(),\n showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})\n}, {\n transforms: undefined\n},\n colorScaleAttrs('', {cLetter: 'z', autoColorDflt: false})\n);\n\n},{\"../../components/colorscale/attributes\":602,\"../../constants/docs\":699,\"../../lib/extend\":719,\"../../plots/attributes\":773,\"../../plots/template_attributes\":854,\"../scatter/attributes\":1134}],1014:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\nvar Axes = _dereq_('../../plots/cartesian/axes');\n\nvar histogram2dCalc = _dereq_('../histogram2d/calc');\nvar colorscaleCalc = _dereq_('../../components/colorscale/calc');\nvar convertColumnData = _dereq_('./convert_column_xyz');\nvar clean2dArray = _dereq_('./clean_2d_array');\nvar interp2d = _dereq_('./interp2d');\nvar findEmpties = _dereq_('./find_empties');\nvar makeBoundArray = _dereq_('./make_bound_array');\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\n\nmodule.exports = function calc(gd, trace) {\n // prepare the raw data\n // run makeCalcdata on x and y even for heatmaps, in case of category mappings\n var xa = Axes.getFromId(gd, trace.xaxis || 'x');\n var ya = Axes.getFromId(gd, trace.yaxis || 'y');\n var isContour = Registry.traceIs(trace, 'contour');\n var isHist = Registry.traceIs(trace, 'histogram');\n var isGL2D = Registry.traceIs(trace, 'gl2d');\n var zsmooth = isContour ? 'best' : trace.zsmooth;\n var x;\n var x0;\n var dx;\n var y;\n var y0;\n var dy;\n var z;\n var i;\n var binned;\n\n // cancel minimum tick spacings (only applies to bars and boxes)\n xa._minDtick = 0;\n ya._minDtick = 0;\n\n if(isHist) {\n binned = histogram2dCalc(gd, trace);\n x = binned.x;\n x0 = binned.x0;\n dx = binned.dx;\n y = binned.y;\n y0 = binned.y0;\n dy = binned.dy;\n z = binned.z;\n } else {\n var zIn = trace.z;\n if(Lib.isArray1D(zIn)) {\n convertColumnData(trace, xa, ya, 'x', 'y', ['z']);\n x = trace._x;\n y = trace._y;\n zIn = trace._z;\n } else {\n x = trace._x = trace.x ? xa.makeCalcdata(trace, 'x') : [];\n y = trace._y = trace.y ? ya.makeCalcdata(trace, 'y') : [];\n }\n\n x0 = trace.x0;\n dx = trace.dx;\n y0 = trace.y0;\n dy = trace.dy;\n\n z = clean2dArray(zIn, trace, xa, ya);\n }\n\n if(xa.rangebreaks || ya.rangebreaks) {\n z = dropZonBreaks(x, y, z);\n\n if(!isHist) {\n x = skipBreaks(x);\n y = skipBreaks(y);\n\n trace._x = x;\n trace._y = y;\n }\n }\n\n if(!isHist && (isContour || trace.connectgaps)) {\n trace._emptypoints = findEmpties(z);\n interp2d(z, trace._emptypoints);\n }\n\n function noZsmooth(msg) {\n zsmooth = trace._input.zsmooth = trace.zsmooth = false;\n Lib.warn('cannot use zsmooth: \"fast\": ' + msg);\n }\n\n // check whether we really can smooth (ie all boxes are about the same size)\n if(zsmooth === 'fast') {\n if(xa.type === 'log' || ya.type === 'log') {\n noZsmooth('log axis found');\n } else if(!isHist) {\n if(x.length) {\n var avgdx = (x[x.length - 1] - x[0]) / (x.length - 1);\n var maxErrX = Math.abs(avgdx / 100);\n for(i = 0; i < x.length - 1; i++) {\n if(Math.abs(x[i + 1] - x[i] - avgdx) > maxErrX) {\n noZsmooth('x scale is not linear');\n break;\n }\n }\n }\n if(y.length && zsmooth === 'fast') {\n var avgdy = (y[y.length - 1] - y[0]) / (y.length - 1);\n var maxErrY = Math.abs(avgdy / 100);\n for(i = 0; i < y.length - 1; i++) {\n if(Math.abs(y[i + 1] - y[i] - avgdy) > maxErrY) {\n noZsmooth('y scale is not linear');\n break;\n }\n }\n }\n }\n }\n\n // create arrays of brick boundaries, to be used by autorange and heatmap.plot\n var xlen = Lib.maxRowLength(z);\n var xIn = trace.xtype === 'scaled' ? '' : x;\n var xArray = makeBoundArray(trace, xIn, x0, dx, xlen, xa);\n var yIn = trace.ytype === 'scaled' ? '' : y;\n var yArray = makeBoundArray(trace, yIn, y0, dy, z.length, ya);\n\n // handled in gl2d convert step\n if(!isGL2D) {\n trace._extremes[xa._id] = Axes.findExtremes(xa, xArray);\n trace._extremes[ya._id] = Axes.findExtremes(ya, yArray);\n }\n\n var cd0 = {\n x: xArray,\n y: yArray,\n z: z,\n text: trace._text || trace.text,\n hovertext: trace._hovertext || trace.hovertext\n };\n\n if(xIn && xIn.length === xArray.length - 1) cd0.xCenter = xIn;\n if(yIn && yIn.length === yArray.length - 1) cd0.yCenter = yIn;\n\n if(isHist) {\n cd0.xRanges = binned.xRanges;\n cd0.yRanges = binned.yRanges;\n cd0.pts = binned.pts;\n }\n\n if(!isContour) {\n colorscaleCalc(gd, trace, {vals: z, cLetter: 'z'});\n }\n\n if(isContour && trace.contours && trace.contours.coloring === 'heatmap') {\n var dummyTrace = {\n type: trace.type === 'contour' ? 'heatmap' : 'histogram2d',\n xcalendar: trace.xcalendar,\n ycalendar: trace.ycalendar\n };\n cd0.xfill = makeBoundArray(dummyTrace, xIn, x0, dx, xlen, xa);\n cd0.yfill = makeBoundArray(dummyTrace, yIn, y0, dy, z.length, ya);\n }\n\n return [cd0];\n};\n\nfunction skipBreaks(a) {\n var b = [];\n var len = a.length;\n for(var i = 0; i < len; i++) {\n var v = a[i];\n if(v !== BADNUM) b.push(v);\n }\n return b;\n}\n\nfunction dropZonBreaks(x, y, z) {\n var newZ = [];\n var k = -1;\n for(var i = 0; i < z.length; i++) {\n if(y[i] === BADNUM) continue;\n k++;\n newZ[k] = [];\n for(var j = 0; j < z[i].length; j++) {\n if(x[j] === BADNUM) continue;\n\n newZ[k].push(z[i][j]);\n }\n }\n return newZ;\n}\n\n},{\"../../components/colorscale/calc\":603,\"../../constants/numerical\":704,\"../../lib\":728,\"../../plots/cartesian/axes\":776,\"../../registry\":859,\"../histogram2d/calc\":1046,\"./clean_2d_array\":1015,\"./convert_column_xyz\":1017,\"./find_empties\":1019,\"./interp2d\":1022,\"./make_bound_array\":1023}],1015:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar Lib = _dereq_('../../lib');\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\n\nmodule.exports = function clean2dArray(zOld, trace, xa, ya) {\n var rowlen, collen, getCollen, old2new, i, j;\n\n function cleanZvalue(v) {\n if(!isNumeric(v)) return undefined;\n return +v;\n }\n\n if(trace && trace.transpose) {\n rowlen = 0;\n for(i = 0; i < zOld.length; i++) rowlen = Math.max(rowlen, zOld[i].length);\n if(rowlen === 0) return false;\n getCollen = function(zOld) { return zOld.length; };\n old2new = function(zOld, i, j) { return (zOld[j] || [])[i]; };\n } else {\n rowlen = zOld.length;\n getCollen = function(zOld, i) { return zOld[i].length; };\n old2new = function(zOld, i, j) { return (zOld[i] || [])[j]; };\n }\n\n var padOld2new = function(zOld, i, j) {\n if(i === BADNUM || j === BADNUM) return BADNUM;\n return old2new(zOld, i, j);\n };\n\n function axisMapping(ax) {\n if(trace && trace.type !== 'carpet' && trace.type !== 'contourcarpet' &&\n ax && ax.type === 'category' && trace['_' + ax._id.charAt(0)].length) {\n var axLetter = ax._id.charAt(0);\n var axMapping = {};\n var traceCategories = trace['_' + axLetter + 'CategoryMap'] || trace[axLetter];\n for(i = 0; i < traceCategories.length; i++) {\n axMapping[traceCategories[i]] = i;\n }\n return function(i) {\n var ind = axMapping[ax._categories[i]];\n return ind + 1 ? ind : BADNUM;\n };\n } else {\n return Lib.identity;\n }\n }\n\n var xMap = axisMapping(xa);\n var yMap = axisMapping(ya);\n\n if(ya && ya.type === 'category') rowlen = ya._categories.length;\n var zNew = new Array(rowlen);\n\n for(i = 0; i < rowlen; i++) {\n if(xa && xa.type === 'category') {\n collen = xa._categories.length;\n } else {\n collen = getCollen(zOld, i);\n }\n zNew[i] = new Array(collen);\n for(j = 0; j < collen; j++) zNew[i][j] = cleanZvalue(padOld2new(zOld, yMap(i), xMap(j)));\n }\n\n return zNew;\n};\n\n},{\"../../constants/numerical\":704,\"../../lib\":728,\"fast-isnumeric\":236}],1016:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n min: 'zmin',\n max: 'zmax'\n};\n\n},{}],1017:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\n\nmodule.exports = function convertColumnData(trace, ax1, ax2, var1Name, var2Name, arrayVarNames) {\n var colLen = trace._length;\n var col1 = ax1.makeCalcdata(trace, var1Name);\n var col2 = ax2.makeCalcdata(trace, var2Name);\n var textCol = trace.text;\n var hasColumnText = (textCol !== undefined && Lib.isArray1D(textCol));\n var hoverTextCol = trace.hovertext;\n var hasColumnHoverText = (hoverTextCol !== undefined && Lib.isArray1D(hoverTextCol));\n var i, j;\n\n var col1dv = Lib.distinctVals(col1);\n var col1vals = col1dv.vals;\n var col2dv = Lib.distinctVals(col2);\n var col2vals = col2dv.vals;\n var newArrays = [];\n var text;\n var hovertext;\n\n var nI = col2vals.length;\n var nJ = col1vals.length;\n\n for(i = 0; i < arrayVarNames.length; i++) {\n newArrays[i] = Lib.init2dArray(nI, nJ);\n }\n\n if(hasColumnText) {\n text = Lib.init2dArray(nI, nJ);\n }\n if(hasColumnHoverText) {\n hovertext = Lib.init2dArray(nI, nJ);\n }\n\n var after2before = Lib.init2dArray(nI, nJ);\n\n for(i = 0; i < colLen; i++) {\n if(col1[i] !== BADNUM && col2[i] !== BADNUM) {\n var i1 = Lib.findBin(col1[i] + col1dv.minDiff / 2, col1vals);\n var i2 = Lib.findBin(col2[i] + col2dv.minDiff / 2, col2vals);\n\n for(j = 0; j < arrayVarNames.length; j++) {\n var arrayVarName = arrayVarNames[j];\n var arrayVar = trace[arrayVarName];\n var newArray = newArrays[j];\n newArray[i2][i1] = arrayVar[i];\n after2before[i2][i1] = i;\n }\n\n if(hasColumnText) text[i2][i1] = textCol[i];\n if(hasColumnHoverText) hovertext[i2][i1] = hoverTextCol[i];\n }\n }\n\n trace['_' + var1Name] = col1vals;\n trace['_' + var2Name] = col2vals;\n for(j = 0; j < arrayVarNames.length; j++) {\n trace['_' + arrayVarNames[j]] = newArrays[j];\n }\n if(hasColumnText) trace._text = text;\n if(hasColumnHoverText) trace._hovertext = hovertext;\n\n if(ax1 && ax1.type === 'category') {\n trace['_' + var1Name + 'CategoryMap'] = col1vals.map(function(v) { return ax1._categories[v];});\n }\n\n if(ax2 && ax2.type === 'category') {\n trace['_' + var2Name + 'CategoryMap'] = col2vals.map(function(v) { return ax2._categories[v];});\n }\n\n trace._after2before = after2before;\n};\n\n},{\"../../constants/numerical\":704,\"../../lib\":728}],1018:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nvar handleXYZDefaults = _dereq_('./xyz_defaults');\nvar handleStyleDefaults = _dereq_('./style_defaults');\nvar colorscaleDefaults = _dereq_('../../components/colorscale/defaults');\nvar attributes = _dereq_('./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 coerce('text');\n coerce('hovertext');\n coerce('hovertemplate');\n\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\n},{\"../../components/colorscale/defaults\":605,\"../../lib\":728,\"./attributes\":1013,\"./style_defaults\":1026,\"./xyz_defaults\":1027}],1019:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar maxRowLength = _dereq_('../../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\n},{\"../../lib\":728}],1020:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Fx = _dereq_('../../components/fx');\nvar Lib = _dereq_('../../lib');\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar extractOpts = _dereq_('../../components/colorscale').extractOpts;\n\nmodule.exports = function hoverPoints(pointData, xval, yval, hovermode, hoverLayer, contour) {\n var cd0 = pointData.cd[0];\n var trace = cd0.trace;\n var xa = pointData.xa;\n var ya = pointData.ya;\n var x = cd0.x;\n var y = cd0.y;\n var z = cd0.z;\n var xc = cd0.xCenter;\n var yc = cd0.yCenter;\n var zmask = cd0.zmask;\n var zhoverformat = trace.zhoverformat;\n var x2 = x;\n var y2 = y;\n\n var xl, yl, nx, ny;\n\n if(pointData.index !== false) {\n try {\n nx = Math.round(pointData.index[1]);\n ny = Math.round(pointData.index[0]);\n } catch(e) {\n Lib.error('Error hovering on heatmap, ' +\n 'pointNumber must be [row,col], found:', pointData.index);\n return;\n }\n if(nx < 0 || nx >= z[0].length || ny < 0 || ny > z.length) {\n return;\n }\n } else if(Fx.inbox(xval - x[0], xval - x[x.length - 1], 0) > 0 ||\n Fx.inbox(yval - y[0], yval - y[y.length - 1], 0) > 0) {\n return;\n } else {\n if(contour) {\n var i2;\n x2 = [2 * x[0] - x[1]];\n\n for(i2 = 1; i2 < x.length; i2++) {\n x2.push((x[i2] + x[i2 - 1]) / 2);\n }\n x2.push([2 * x[x.length - 1] - x[x.length - 2]]);\n\n y2 = [2 * y[0] - y[1]];\n for(i2 = 1; i2 < y.length; i2++) {\n y2.push((y[i2] + y[i2 - 1]) / 2);\n }\n y2.push([2 * y[y.length - 1] - y[y.length - 2]]);\n }\n nx = Math.max(0, Math.min(x2.length - 2, Lib.findBin(xval, x2)));\n ny = Math.max(0, Math.min(y2.length - 2, Lib.findBin(yval, y2)));\n }\n\n var x0 = xa.c2p(x[nx]);\n var x1 = xa.c2p(x[nx + 1]);\n var y0 = ya.c2p(y[ny]);\n var y1 = ya.c2p(y[ny + 1]);\n\n if(contour) {\n x1 = x0;\n xl = x[nx];\n y1 = y0;\n yl = y[ny];\n } else {\n xl = xc ? xc[nx] : ((x[nx] + x[nx + 1]) / 2);\n yl = yc ? yc[ny] : ((y[ny] + y[ny + 1]) / 2);\n\n if(xa && xa.type === 'category') xl = x[nx];\n if(ya && ya.type === 'category') yl = y[ny];\n\n if(trace.zsmooth) {\n x0 = x1 = xa.c2p(xl);\n y0 = y1 = ya.c2p(yl);\n }\n }\n\n var zVal = z[ny][nx];\n if(zmask && !zmask[ny][nx]) zVal = undefined;\n\n if(zVal === undefined && !trace.hoverongaps) return;\n\n var text;\n if(Array.isArray(cd0.hovertext) && Array.isArray(cd0.hovertext[ny])) {\n text = cd0.hovertext[ny][nx];\n } else if(Array.isArray(cd0.text) && Array.isArray(cd0.text[ny])) {\n text = cd0.text[ny][nx];\n }\n\n // dummy axis for formatting the z value\n var cOpts = extractOpts(trace);\n var dummyAx = {\n type: 'linear',\n range: [cOpts.min, cOpts.max],\n hoverformat: zhoverformat,\n _separators: xa._separators,\n _numFormat: xa._numFormat\n };\n var zLabel = Axes.tickText(dummyAx, zVal, 'hover').text;\n\n return [Lib.extendFlat(pointData, {\n index: trace._after2before ? trace._after2before[ny][nx] : [ny, nx],\n // never let a 2D override 1D type as closest point\n distance: pointData.maxHoverDistance,\n spikeDistance: pointData.maxSpikeDistance,\n x0: x0,\n x1: x1,\n y0: y0,\n y1: y1,\n xLabelVal: xl,\n yLabelVal: yl,\n zLabelVal: zVal,\n zLabel: zLabel,\n text: text\n })];\n};\n\n},{\"../../components/colorscale\":607,\"../../components/fx\":635,\"../../lib\":728,\"../../plots/cartesian/axes\":776}],1021:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults'),\n calc: _dereq_('./calc'),\n plot: _dereq_('./plot'),\n colorbar: _dereq_('./colorbar'),\n style: _dereq_('./style'),\n hoverPoints: _dereq_('./hover'),\n\n moduleType: 'trace',\n name: 'heatmap',\n basePlotModule: _dereq_('../../plots/cartesian'),\n categories: ['cartesian', 'svg', '2dMap', 'showLegend'],\n meta: {\n \n }\n};\n\n},{\"../../plots/cartesian\":789,\"./attributes\":1013,\"./calc\":1014,\"./colorbar\":1016,\"./defaults\":1018,\"./hover\":1020,\"./plot\":1024,\"./style\":1025}],1022:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../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\n},{\"../../lib\":728}],1023:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../../registry');\nvar isArrayOrTypedArray = _dereq_('../../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 = arrayIn.slice(0, numbricks);\n else if(numbricks === 1) {\n arrayOut = [arrayIn[0] - 0.5, arrayIn[0] + 0.5];\n } else {\n arrayOut = [1.5 * arrayIn[0] - 0.5 * arrayIn[1]];\n\n for(i = 1; i < len; i++) {\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 = lastPt - arrayOut[arrayOut.length - 2];\n\n for(i = len; i < numbricks; i++) {\n lastPt += delta;\n arrayOut.push(lastPt);\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\n},{\"../../lib\":728,\"../../registry\":859}],1024:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar tinycolor = _dereq_('tinycolor2');\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\nvar makeColorScaleFuncFromTrace = _dereq_('../../components/colorscale').makeColorScaleFuncFromTrace;\nvar xmlnsNamespaces = _dereq_('../../constants/xmlns_namespaces');\n\nmodule.exports = function(gd, plotinfo, cdheatmaps, heatmapLayer) {\n var xa = plotinfo.xaxis;\n var ya = plotinfo.yaxis;\n\n Lib.makeTraceGroups(heatmapLayer, cdheatmaps, 'hm').each(function(cd) {\n var plotGroup = d3.select(this);\n var cd0 = cd[0];\n var trace = cd0.trace;\n\n var z = cd0.z;\n var x = cd0.x;\n var y = cd0.y;\n var xc = cd0.xCenter;\n var yc = cd0.yCenter;\n var isContour = Registry.traceIs(trace, 'contour');\n var zsmooth = isContour ? 'best' : trace.zsmooth;\n\n // get z dims\n var m = z.length;\n var n = Lib.maxRowLength(z);\n var xrev = false;\n var yrev = false;\n\n var left, right, temp, top, bottom, i;\n\n // TODO: if there are multiple overlapping categorical heatmaps,\n // or if we allow category sorting, then the categories may not be\n // sequential... may need to reorder and/or expand z\n\n // Get edges of png in pixels (xa.c2p() maps axes coordinates to pixel coordinates)\n // figure out if either axis is reversed (y is usually reversed, in pixel coords)\n // also clip the image to maximum 50% outside the visible plot area\n // bigger image lets you pan more naturally, but slows performance.\n // TODO: use low-resolution images outside the visible plot for panning\n // these while loops find the first and last brick bounds that are defined\n // (in case of log of a negative)\n i = 0;\n while(left === undefined && i < x.length - 1) {\n left = xa.c2p(x[i]);\n i++;\n }\n i = x.length - 1;\n while(right === undefined && i > 0) {\n right = xa.c2p(x[i]);\n i--;\n }\n\n if(right < left) {\n temp = right;\n right = left;\n left = temp;\n xrev = true;\n }\n\n i = 0;\n while(top === undefined && i < y.length - 1) {\n top = ya.c2p(y[i]);\n i++;\n }\n i = y.length - 1;\n while(bottom === undefined && i > 0) {\n bottom = ya.c2p(y[i]);\n i--;\n }\n\n if(bottom < top) {\n temp = top;\n top = bottom;\n bottom = temp;\n yrev = true;\n }\n\n // for contours with heatmap fill, we generate the boundaries based on\n // brick centers but then use the brick edges for drawing the bricks\n if(isContour) {\n xc = x;\n yc = y;\n x = cd0.xfill;\n y = cd0.yfill;\n }\n\n // make an image that goes at most half a screen off either side, to keep\n // time reasonable when you zoom in. if zsmooth is true/fast, don't worry\n // about this, because zooming doesn't increase number of pixels\n // if zsmooth is best, don't include anything off screen because it takes too long\n if(zsmooth !== 'fast') {\n var extra = zsmooth === 'best' ? 0 : 0.5;\n left = Math.max(-extra * xa._length, left);\n right = Math.min((1 + extra) * xa._length, right);\n top = Math.max(-extra * ya._length, top);\n bottom = Math.min((1 + extra) * ya._length, bottom);\n }\n\n var imageWidth = Math.round(right - left);\n var imageHeight = Math.round(bottom - top);\n\n // setup image nodes\n\n // if image is entirely off-screen, don't even draw it\n var isOffScreen = (imageWidth <= 0 || imageHeight <= 0);\n\n if(isOffScreen) {\n var noImage = plotGroup.selectAll('image').data([]);\n noImage.exit().remove();\n return;\n }\n\n // generate image data\n\n var canvasW, canvasH;\n if(zsmooth === 'fast') {\n canvasW = n;\n canvasH = m;\n } else {\n canvasW = imageWidth;\n canvasH = imageHeight;\n }\n\n var canvas = document.createElement('canvas');\n canvas.width = canvasW;\n canvas.height = canvasH;\n var context = canvas.getContext('2d');\n\n var sclFunc = makeColorScaleFuncFromTrace(trace, {noNumericCheck: true, returnArray: true});\n\n // map brick boundaries to image pixels\n var xpx,\n ypx;\n if(zsmooth === 'fast') {\n xpx = xrev ?\n function(index) { return n - 1 - index; } :\n Lib.identity;\n ypx = yrev ?\n function(index) { return m - 1 - index; } :\n Lib.identity;\n } else {\n xpx = function(index) {\n return Lib.constrain(Math.round(xa.c2p(x[index]) - left),\n 0, imageWidth);\n };\n ypx = function(index) {\n return Lib.constrain(Math.round(ya.c2p(y[index]) - top),\n 0, imageHeight);\n };\n }\n\n // build the pixel map brick-by-brick\n // cruise through z-matrix row-by-row\n // build a brick at each z-matrix value\n var yi = ypx(0);\n var yb = [yi, yi];\n var xbi = xrev ? 0 : 1;\n var ybi = yrev ? 0 : 1;\n // for collecting an average luminosity of the heatmap\n var pixcount = 0;\n var rcount = 0;\n var gcount = 0;\n var bcount = 0;\n\n var xb, j, xi, v, row, c;\n\n function setColor(v, pixsize) {\n if(v !== undefined) {\n var c = sclFunc(v);\n c[0] = Math.round(c[0]);\n c[1] = Math.round(c[1]);\n c[2] = Math.round(c[2]);\n\n pixcount += pixsize;\n rcount += c[0] * pixsize;\n gcount += c[1] * pixsize;\n bcount += c[2] * pixsize;\n return c;\n }\n return [0, 0, 0, 0];\n }\n\n function interpColor(r0, r1, xinterp, yinterp) {\n var z00 = r0[xinterp.bin0];\n if(z00 === undefined) return setColor(undefined, 1);\n\n var z01 = r0[xinterp.bin1];\n var z10 = r1[xinterp.bin0];\n var z11 = r1[xinterp.bin1];\n var dx = (z01 - z00) || 0;\n var dy = (z10 - z00) || 0;\n var dxy;\n\n // the bilinear interpolation term needs different calculations\n // for all the different permutations of missing data\n // among the neighbors of the main point, to ensure\n // continuity across brick boundaries.\n if(z01 === undefined) {\n if(z11 === undefined) dxy = 0;\n else if(z10 === undefined) dxy = 2 * (z11 - z00);\n else dxy = (2 * z11 - z10 - z00) * 2 / 3;\n } else if(z11 === undefined) {\n if(z10 === undefined) dxy = 0;\n else dxy = (2 * z00 - z01 - z10) * 2 / 3;\n } else if(z10 === undefined) dxy = (2 * z11 - z01 - z00) * 2 / 3;\n else dxy = (z11 + z00 - z01 - z10);\n\n return setColor(z00 + xinterp.frac * dx + yinterp.frac * (dy + xinterp.frac * dxy));\n }\n\n if(zsmooth) { // best or fast, works fastest with imageData\n var pxIndex = 0;\n var pixels;\n\n try {\n pixels = new Uint8Array(imageWidth * imageHeight * 4);\n } catch(e) {\n pixels = new Array(imageWidth * imageHeight * 4);\n }\n\n if(zsmooth === 'best') {\n var xForPx = xc || x;\n var yForPx = yc || y;\n var xPixArray = new Array(xForPx.length);\n var yPixArray = new Array(yForPx.length);\n var xinterpArray = new Array(imageWidth);\n var findInterpX = xc ? findInterpFromCenters : findInterp;\n var findInterpY = yc ? findInterpFromCenters : findInterp;\n var yinterp, r0, r1;\n\n // first make arrays of x and y pixel locations of brick boundaries\n for(i = 0; i < xForPx.length; i++) xPixArray[i] = Math.round(xa.c2p(xForPx[i]) - left);\n for(i = 0; i < yForPx.length; i++) yPixArray[i] = Math.round(ya.c2p(yForPx[i]) - top);\n\n // then make arrays of interpolations\n // (bin0=closest, bin1=next, frac=fractional dist.)\n for(i = 0; i < imageWidth; i++) xinterpArray[i] = findInterpX(i, xPixArray);\n\n // now do the interpolations and fill the png\n for(j = 0; j < imageHeight; j++) {\n yinterp = findInterpY(j, yPixArray);\n r0 = z[yinterp.bin0];\n r1 = z[yinterp.bin1];\n for(i = 0; i < imageWidth; i++, pxIndex += 4) {\n c = interpColor(r0, r1, xinterpArray[i], yinterp);\n putColor(pixels, pxIndex, c);\n }\n }\n } else { // zsmooth = fast\n for(j = 0; j < m; j++) {\n row = z[j];\n yb = ypx(j);\n for(i = 0; i < imageWidth; i++) {\n c = setColor(row[i], 1);\n pxIndex = (yb * imageWidth + xpx(i)) * 4;\n putColor(pixels, pxIndex, c);\n }\n }\n }\n\n var imageData = context.createImageData(imageWidth, imageHeight);\n try {\n imageData.data.set(pixels);\n } catch(e) {\n var pxArray = imageData.data;\n var dlen = pxArray.length;\n for(j = 0; j < dlen; j ++) {\n pxArray[j] = pixels[j];\n }\n }\n\n context.putImageData(imageData, 0, 0);\n } else { // zsmooth = false -> filling potentially large bricks works fastest with fillRect\n // gaps do not need to be exact integers, but if they *are* we will get\n // cleaner edges by rounding at least one edge\n var xGap = trace.xgap;\n var yGap = trace.ygap;\n var xGapLeft = Math.floor(xGap / 2);\n var yGapTop = Math.floor(yGap / 2);\n\n for(j = 0; j < m; j++) {\n row = z[j];\n yb.reverse();\n yb[ybi] = ypx(j + 1);\n if(yb[0] === yb[1] || yb[0] === undefined || yb[1] === undefined) {\n continue;\n }\n xi = xpx(0);\n xb = [xi, xi];\n for(i = 0; i < n; i++) {\n // build one color brick!\n xb.reverse();\n xb[xbi] = xpx(i + 1);\n if(xb[0] === xb[1] || xb[0] === undefined || xb[1] === undefined) {\n continue;\n }\n v = row[i];\n c = setColor(v, (xb[1] - xb[0]) * (yb[1] - yb[0]));\n context.fillStyle = 'rgba(' + c.join(',') + ')';\n\n context.fillRect(xb[0] + xGapLeft, yb[0] + yGapTop,\n xb[1] - xb[0] - xGap, yb[1] - yb[0] - yGap);\n }\n }\n }\n\n rcount = Math.round(rcount / pixcount);\n gcount = Math.round(gcount / pixcount);\n bcount = Math.round(bcount / pixcount);\n var avgColor = tinycolor('rgb(' + rcount + ',' + gcount + ',' + bcount + ')');\n\n gd._hmpixcount = (gd._hmpixcount||0) + pixcount;\n gd._hmlumcount = (gd._hmlumcount||0) + pixcount * avgColor.getLuminance();\n\n var image3 = plotGroup.selectAll('image')\n .data(cd);\n\n image3.enter().append('svg:image').attr({\n xmlns: xmlnsNamespaces.svg,\n preserveAspectRatio: 'none'\n });\n\n image3.attr({\n height: imageHeight,\n width: imageWidth,\n x: left,\n y: top,\n 'xlink:href': canvas.toDataURL('image/png')\n });\n });\n};\n\n// get interpolated bin value. Returns {bin0:closest bin, frac:fractional dist to next, bin1:next bin}\nfunction findInterp(pixel, pixArray) {\n var maxBin = pixArray.length - 2;\n var bin = Lib.constrain(Lib.findBin(pixel, pixArray), 0, maxBin);\n var pix0 = pixArray[bin];\n var pix1 = pixArray[bin + 1];\n var interp = Lib.constrain(bin + (pixel - pix0) / (pix1 - pix0) - 0.5, 0, maxBin);\n var bin0 = Math.round(interp);\n var frac = Math.abs(interp - bin0);\n\n if(!interp || interp === maxBin || !frac) {\n return {\n bin0: bin0,\n bin1: bin0,\n frac: 0\n };\n }\n return {\n bin0: bin0,\n frac: frac,\n bin1: Math.round(bin0 + frac / (interp - bin0))\n };\n}\n\nfunction findInterpFromCenters(pixel, centerPixArray) {\n var maxBin = centerPixArray.length - 1;\n var bin = Lib.constrain(Lib.findBin(pixel, centerPixArray), 0, maxBin);\n var pix0 = centerPixArray[bin];\n var pix1 = centerPixArray[bin + 1];\n var frac = ((pixel - pix0) / (pix1 - pix0)) || 0;\n if(frac <= 0) {\n return {\n bin0: bin,\n bin1: bin,\n frac: 0\n };\n }\n if(frac < 0.5) {\n return {\n bin0: bin,\n bin1: bin + 1,\n frac: frac\n };\n }\n return {\n bin0: bin + 1,\n bin1: bin,\n frac: 1 - frac\n };\n}\n\nfunction putColor(pixels, pxIndex, c) {\n pixels[pxIndex] = c[0];\n pixels[pxIndex + 1] = c[1];\n pixels[pxIndex + 2] = c[2];\n pixels[pxIndex + 3] = Math.round(c[3] * 255);\n}\n\n},{\"../../components/colorscale\":607,\"../../constants/xmlns_namespaces\":705,\"../../lib\":728,\"../../registry\":859,\"d3\":164,\"tinycolor2\":528}],1025:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nmodule.exports = function style(gd) {\n d3.select(gd).selectAll('.hm image')\n .style('opacity', function(d) {\n return d.trace.opacity;\n });\n};\n\n},{\"d3\":164}],1026:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nmodule.exports = function handleStyleDefaults(traceIn, traceOut, coerce) {\n var zsmooth = coerce('zsmooth');\n if(zsmooth === false) {\n // ensure that xgap and ygap are coerced only when zsmooth allows them to have an effect.\n coerce('xgap');\n coerce('ygap');\n }\n\n coerce('zhoverformat');\n};\n\n},{}],1027:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar Lib = _dereq_('../../lib');\n\nvar Registry = _dereq_('../../registry');\n\nmodule.exports = function handleXYZDefaults(traceIn, traceOut, coerce, layout, xName, yName) {\n var z = coerce('z');\n xName = xName || 'x';\n yName = yName || 'y';\n var x, y;\n\n if(z === undefined || !z.length) return 0;\n\n if(Lib.isArray1D(traceIn.z)) {\n x = coerce(xName);\n y = coerce(yName);\n\n var xlen = Lib.minRowLength(x);\n var ylen = Lib.minRowLength(y);\n\n // column z must be accompanied by xName and yName arrays\n if(xlen === 0 || ylen === 0) return 0;\n\n traceOut._length = Math.min(xlen, ylen, z.length);\n } else {\n x = coordDefaults(xName, coerce);\n y = coordDefaults(yName, coerce);\n\n // TODO put z validation elsewhere\n if(!isValidZ(z)) return 0;\n\n coerce('transpose');\n\n traceOut._length = null;\n }\n\n if(\n traceIn.type === 'heatmapgl' ||\n traceIn.type === 'contourgl'\n ) return true; // skip calendars until we handle them in those traces\n\n var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');\n handleCalendarDefaults(traceIn, traceOut, [xName, yName], layout);\n\n return true;\n};\n\nfunction coordDefaults(coordStr, coerce) {\n var coord = coerce(coordStr);\n var coordType = coord ? coerce(coordStr + 'type', 'array') : 'scaled';\n\n if(coordType === 'scaled') {\n coerce(coordStr + '0');\n coerce('d' + coordStr);\n }\n\n return coord;\n}\n\nfunction isValidZ(z) {\n var allRowsAreArrays = true;\n var oneRowIsFilled = false;\n var hasOneNumber = false;\n var zi;\n\n /*\n * Without this step:\n *\n * hasOneNumber = false breaks contour but not heatmap\n * allRowsAreArrays = false breaks contour but not heatmap\n * oneRowIsFilled = false breaks both\n */\n\n for(var i = 0; i < z.length; i++) {\n zi = z[i];\n if(!Lib.isArrayOrTypedArray(zi)) {\n allRowsAreArrays = false;\n break;\n }\n if(zi.length > 0) oneRowIsFilled = true;\n for(var j = 0; j < zi.length; j++) {\n if(isNumeric(zi[j])) {\n hasOneNumber = true;\n break;\n }\n }\n }\n\n return (allRowsAreArrays && oneRowIsFilled && hasOneNumber);\n}\n\n},{\"../../lib\":728,\"../../registry\":859,\"fast-isnumeric\":236}],1028:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar heatmapAttrs = _dereq_('../heatmap/attributes');\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\nvar overrideAll = _dereq_('../../plot_api/edit_types').overrideAll;\n\nvar commonList = [\n 'z',\n 'x', 'x0', 'dx',\n 'y', 'y0', 'dy',\n 'text', 'transpose',\n 'xtype', 'ytype'\n];\n\nvar attrs = {};\n\nfor(var i = 0; i < commonList.length; i++) {\n var k = commonList[i];\n attrs[k] = heatmapAttrs[k];\n}\n\nextendFlat(\n attrs,\n colorScaleAttrs('', {cLetter: 'z', autoColorDflt: false})\n);\n\nmodule.exports = overrideAll(attrs, 'calc', 'nested');\n\n},{\"../../components/colorscale/attributes\":602,\"../../lib/extend\":719,\"../../plot_api/edit_types\":759,\"../heatmap/attributes\":1013}],1029:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar createHeatmap2D = _dereq_('gl-heatmap2d');\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar str2RGBArray = _dereq_('../../lib/str2rgbarray');\n\n\nfunction Heatmap(scene, uid) {\n this.scene = scene;\n this.uid = uid;\n this.type = 'heatmapgl';\n\n this.name = '';\n this.hoverinfo = 'all';\n\n this.xData = [];\n this.yData = [];\n this.zData = [];\n this.textLabels = [];\n\n this.idToIndex = [];\n this.bounds = [0, 0, 0, 0];\n\n this.options = {\n z: [],\n x: [],\n y: [],\n shape: [0, 0],\n colorLevels: [0],\n colorValues: [0, 0, 0, 1]\n };\n\n this.heatmap = createHeatmap2D(scene.glplot, this.options);\n this.heatmap._trace = this;\n}\n\nvar proto = Heatmap.prototype;\n\nproto.handlePick = function(pickResult) {\n var options = this.options;\n var shape = options.shape;\n var index = pickResult.pointId;\n var xIndex = index % shape[0];\n var yIndex = Math.floor(index / shape[0]);\n var zIndex = index;\n\n return {\n trace: this,\n dataCoord: pickResult.dataCoord,\n traceCoord: [\n options.x[xIndex],\n options.y[yIndex],\n options.z[zIndex]\n ],\n textLabel: this.textLabels[index],\n name: this.name,\n pointIndex: [yIndex, xIndex],\n hoverinfo: this.hoverinfo\n };\n};\n\nproto.update = function(fullTrace, calcTrace) {\n var calcPt = calcTrace[0];\n\n this.index = fullTrace.index;\n this.name = fullTrace.name;\n this.hoverinfo = fullTrace.hoverinfo;\n\n // convert z from 2D -> 1D\n var z = calcPt.z;\n this.options.z = [].concat.apply([], z);\n\n var rowLen = z[0].length;\n var colLen = z.length;\n this.options.shape = [rowLen, colLen];\n\n this.options.x = calcPt.x;\n this.options.y = calcPt.y;\n\n var colorOptions = convertColorscale(fullTrace);\n this.options.colorLevels = colorOptions.colorLevels;\n this.options.colorValues = colorOptions.colorValues;\n\n // convert text from 2D -> 1D\n this.textLabels = [].concat.apply([], fullTrace.text);\n\n this.heatmap.update(this.options);\n\n var xa = this.scene.xaxis;\n var ya = this.scene.yaxis;\n fullTrace._extremes[xa._id] = Axes.findExtremes(xa, calcPt.x);\n fullTrace._extremes[ya._id] = Axes.findExtremes(ya, calcPt.y);\n};\n\nproto.dispose = function() {\n this.heatmap.dispose();\n};\n\nfunction convertColorscale(fullTrace) {\n var scl = fullTrace.colorscale;\n var zmin = fullTrace.zmin;\n var zmax = fullTrace.zmax;\n\n var N = scl.length;\n var domain = new Array(N);\n var range = new Array(4 * N);\n\n for(var i = 0; i < N; i++) {\n var si = scl[i];\n var color = str2RGBArray(si[1]);\n\n domain[i] = zmin + si[0] * (zmax - zmin);\n\n for(var j = 0; j < 4; j++) {\n range[(4 * i) + j] = color[j];\n }\n }\n\n return {\n colorLevels: domain,\n colorValues: range\n };\n}\n\nfunction createHeatmap(scene, fullTrace, calcTrace) {\n var plot = new Heatmap(scene, fullTrace.uid);\n plot.update(fullTrace, calcTrace);\n return plot;\n}\n\nmodule.exports = createHeatmap;\n\n},{\"../../lib/str2rgbarray\":751,\"../../plots/cartesian/axes\":776,\"gl-heatmap2d\":263}],1030:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nvar handleXYZDefaults = _dereq_('../heatmap/xyz_defaults');\nvar colorscaleDefaults = _dereq_('../../components/colorscale/defaults');\nvar attributes = _dereq_('./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 coerce('text');\n\n colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'});\n};\n\n},{\"../../components/colorscale/defaults\":605,\"../../lib\":728,\"../heatmap/xyz_defaults\":1027,\"./attributes\":1028}],1031:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults'),\n colorbar: _dereq_('../heatmap/colorbar'),\n\n calc: _dereq_('../heatmap/calc'),\n plot: _dereq_('./convert'),\n\n moduleType: 'trace',\n name: 'heatmapgl',\n basePlotModule: _dereq_('../../plots/gl2d'),\n categories: ['gl', 'gl2d', '2dMap'],\n meta: {\n \n }\n};\n\n},{\"../../plots/gl2d\":816,\"../heatmap/calc\":1014,\"../heatmap/colorbar\":1016,\"./attributes\":1028,\"./convert\":1029,\"./defaults\":1030}],1032:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar barAttrs = _dereq_('../bar/attributes');\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar makeBinAttrs = _dereq_('./bin_attributes');\nvar constants = _dereq_('./constants');\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nmodule.exports = {\n x: {\n valType: 'data_array',\n editType: 'calc+clearAxisTypes',\n \n },\n y: {\n valType: 'data_array',\n editType: 'calc+clearAxisTypes',\n \n },\n\n text: extendFlat({}, barAttrs.text, {\n \n }),\n hovertext: extendFlat({}, barAttrs.hovertext, {\n \n }),\n orientation: barAttrs.orientation,\n\n histfunc: {\n valType: 'enumerated',\n values: ['count', 'sum', 'avg', 'min', 'max'],\n \n dflt: 'count',\n editType: 'calc',\n \n },\n histnorm: {\n valType: 'enumerated',\n values: ['', 'percent', 'probability', 'density', 'probability density'],\n dflt: '',\n \n editType: 'calc',\n \n },\n\n cumulative: {\n enabled: {\n valType: 'boolean',\n dflt: false,\n \n editType: 'calc',\n \n },\n\n direction: {\n valType: 'enumerated',\n values: ['increasing', 'decreasing'],\n dflt: 'increasing',\n \n editType: 'calc',\n \n },\n\n currentbin: {\n valType: 'enumerated',\n values: ['include', 'exclude', 'half'],\n dflt: 'include',\n \n editType: 'calc',\n \n },\n editType: 'calc'\n },\n nbinsx: {\n valType: 'integer',\n min: 0,\n dflt: 0,\n \n editType: 'calc',\n \n },\n xbins: makeBinAttrs('x', true),\n\n nbinsy: {\n valType: 'integer',\n min: 0,\n dflt: 0,\n \n editType: 'calc',\n \n },\n ybins: makeBinAttrs('y', true),\n autobinx: {\n valType: 'boolean',\n dflt: null,\n \n editType: 'calc',\n \n },\n autobiny: {\n valType: 'boolean',\n dflt: null,\n \n editType: 'calc',\n \n },\n\n bingroup: {\n valType: 'string',\n \n dflt: '',\n editType: 'calc',\n \n },\n\n hovertemplate: hovertemplateAttrs({}, {\n keys: constants.eventDataKeys\n }),\n\n marker: barAttrs.marker,\n\n offsetgroup: barAttrs.offsetgroup,\n alignmentgroup: barAttrs.alignmentgroup,\n\n selected: barAttrs.selected,\n unselected: barAttrs.unselected,\n\n _deprecated: {\n bardir: barAttrs._deprecated.bardir\n }\n};\n\n},{\"../../lib/extend\":719,\"../../plots/template_attributes\":854,\"../bar/attributes\":869,\"./bin_attributes\":1034,\"./constants\":1038}],1033:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\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\n},{}],1034:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = function makeBinAttrs(axLetter, match) {\n return {\n start: {\n valType: 'any', // for date axes\n \n editType: 'calc',\n \n },\n end: {\n valType: 'any', // for date axes\n \n editType: 'calc',\n \n },\n size: {\n valType: 'any', // for date axes\n \n editType: 'calc',\n \n },\n editType: 'calc'\n };\n};\n\n},{}],1035:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\n\nmodule.exports = {\n count: function(n, i, size) {\n size[n]++;\n return 1;\n },\n\n sum: function(n, i, size, counterData) {\n var v = counterData[i];\n if(isNumeric(v)) {\n v = Number(v);\n size[n] += v;\n return v;\n }\n return 0;\n },\n\n avg: function(n, i, size, counterData, counts) {\n var v = counterData[i];\n if(isNumeric(v)) {\n v = Number(v);\n size[n] += v;\n counts[n]++;\n }\n return 0;\n },\n\n min: function(n, i, size, counterData) {\n var v = counterData[i];\n if(isNumeric(v)) {\n v = Number(v);\n if(!isNumeric(size[n])) {\n size[n] = v;\n return v;\n } else if(size[n] > v) {\n var delta = v - size[n];\n size[n] = v;\n return delta;\n }\n }\n return 0;\n },\n\n max: function(n, i, size, counterData) {\n var v = counterData[i];\n if(isNumeric(v)) {\n v = Number(v);\n if(!isNumeric(size[n])) {\n size[n] = v;\n return v;\n } else if(size[n] < v) {\n var delta = v - size[n];\n size[n] = v;\n return delta;\n }\n }\n return 0;\n }\n};\n\n},{\"fast-isnumeric\":236}],1036:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar numConstants = _dereq_('../../constants/numerical');\nvar oneYear = numConstants.ONEAVGYEAR;\nvar oneMonth = numConstants.ONEAVGMONTH;\nvar oneDay = numConstants.ONEDAY;\nvar oneHour = numConstants.ONEHOUR;\nvar oneMin = numConstants.ONEMIN;\nvar oneSec = numConstants.ONESEC;\nvar tickIncrement = _dereq_('../../plots/cartesian/axes').tickIncrement;\n\n\n/*\n * make a function that will find rounded bin edges\n * @param {number} leftGap: how far from the left edge of any bin is the closest data value?\n * @param {number} rightGap: how far from the right edge of any bin is the closest data value?\n * @param {Array[number]} binEdges: the actual edge values used in binning\n * @param {object} pa: the position axis\n * @param {string} calendar: the data calendar\n *\n * @return {function(v, isRightEdge)}:\n * find the start (isRightEdge is falsy) or end (truthy) label value for a bin edge `v`\n */\nmodule.exports = function getBinSpanLabelRound(leftGap, rightGap, binEdges, pa, calendar) {\n // the rounding digit is the largest digit that changes in *all* of 4 regions:\n // - inside the rightGap before binEdges[0] (shifted 10% to the left)\n // - inside the leftGap after binEdges[0] (expanded by 10% of rightGap on each end)\n // - same for binEdges[1]\n var dv0 = -1.1 * rightGap;\n var dv1 = -0.1 * rightGap;\n var dv2 = leftGap - dv1;\n var edge0 = binEdges[0];\n var edge1 = binEdges[1];\n var leftDigit = Math.min(\n biggestDigitChanged(edge0 + dv1, edge0 + dv2, pa, calendar),\n biggestDigitChanged(edge1 + dv1, edge1 + dv2, pa, calendar)\n );\n var rightDigit = Math.min(\n biggestDigitChanged(edge0 + dv0, edge0 + dv1, pa, calendar),\n biggestDigitChanged(edge1 + dv0, edge1 + dv1, pa, calendar)\n );\n\n // normally we try to make the label for the right edge different from\n // the left edge label, so it's unambiguous which bin gets data on the edge.\n // but if this results in more than 3 extra digits (or for dates, more than\n // 2 fields ie hr&min or min&sec, which is 3600x), it'll be more clutter than\n // useful so keep the label cleaner instead\n var digit, disambiguateEdges;\n if(leftDigit > rightDigit && rightDigit < Math.abs(edge1 - edge0) / 4000) {\n digit = leftDigit;\n disambiguateEdges = false;\n } else {\n digit = Math.min(leftDigit, rightDigit);\n disambiguateEdges = true;\n }\n\n if(pa.type === 'date' && digit > oneDay) {\n var dashExclude = (digit === oneYear) ? 1 : 6;\n var increment = (digit === oneYear) ? 'M12' : 'M1';\n\n return function(v, isRightEdge) {\n var dateStr = pa.c2d(v, oneYear, calendar);\n var dashPos = dateStr.indexOf('-', dashExclude);\n if(dashPos > 0) dateStr = dateStr.substr(0, dashPos);\n var roundedV = pa.d2c(dateStr, 0, calendar);\n\n if(roundedV < v) {\n var nextV = tickIncrement(roundedV, increment, false, calendar);\n if((roundedV + nextV) / 2 < v + leftGap) roundedV = nextV;\n }\n\n if(isRightEdge && disambiguateEdges) {\n return tickIncrement(roundedV, increment, true, calendar);\n }\n\n return roundedV;\n };\n }\n\n return function(v, isRightEdge) {\n var roundedV = digit * Math.round(v / digit);\n // if we rounded down and we could round up and still be < leftGap\n // (or what leftGap values round to), do that\n if(roundedV + (digit / 10) < v && roundedV + (digit * 0.9) < v + leftGap) {\n roundedV += digit;\n }\n // finally for the right edge back off one digit - but only if we can do that\n // and not clip off any data that's potentially in the bin\n if(isRightEdge && disambiguateEdges) {\n roundedV -= digit;\n }\n return roundedV;\n };\n};\n\n/*\n * Find the largest digit that changes within a (calcdata) region [v1, v2]\n * if dates, \"digit\" means date/time part when it's bigger than a second\n * returns the unit value to round to this digit, eg 0.01 to round to hundredths, or\n * 100 to round to hundreds. returns oneMonth or oneYear for month or year rounding,\n * so that Math.min will work, rather than 'M1' and 'M12'\n */\nfunction biggestDigitChanged(v1, v2, pa, calendar) {\n // are we crossing zero? can't say anything.\n // in principle this doesn't apply to dates but turns out this doesn't matter.\n if(v1 * v2 <= 0) return Infinity;\n\n var dv = Math.abs(v2 - v1);\n var isDate = pa.type === 'date';\n var digit = biggestGuaranteedDigitChanged(dv, isDate);\n // see if a larger digit also changed\n for(var i = 0; i < 10; i++) {\n // numbers: next digit needs to be >10x but <100x then gets rounded down.\n // dates: next digit can be as much as 60x (then rounded down)\n var nextDigit = biggestGuaranteedDigitChanged(digit * 80, isDate);\n // if we get to years, the chain stops\n if(digit === nextDigit) break;\n if(didDigitChange(nextDigit, v1, v2, isDate, pa, calendar)) digit = nextDigit;\n else break;\n }\n return digit;\n}\n\n/*\n * Find the largest digit that *definitely* changes in a region [v, v + dv] for any v\n * for nonuniform date regions (months/years) pick the largest\n */\nfunction biggestGuaranteedDigitChanged(dv, isDate) {\n if(isDate && dv > oneSec) {\n // this is supposed to be the biggest *guaranteed* change\n // so compare to the longest month and year across any calendar,\n // and we'll iterate back up later\n // note: does not support rounding larger than one year. We could add\n // that if anyone wants it, but seems unusual and not strictly necessary.\n if(dv > oneDay) {\n if(dv > oneYear * 1.1) return oneYear;\n if(dv > oneMonth * 1.1) return oneMonth;\n return oneDay;\n }\n\n if(dv > oneHour) return oneHour;\n if(dv > oneMin) return oneMin;\n return oneSec;\n }\n return Math.pow(10, Math.floor(Math.log(dv) / Math.LN10));\n}\n\nfunction didDigitChange(digit, v1, v2, isDate, pa, calendar) {\n if(isDate && digit > oneDay) {\n var dateParts1 = dateParts(v1, pa, calendar);\n var dateParts2 = dateParts(v2, pa, calendar);\n var parti = (digit === oneYear) ? 0 : 1;\n return dateParts1[parti] !== dateParts2[parti];\n }\n return Math.floor(v2 / digit) - Math.floor(v1 / digit) > 0.1;\n}\n\nfunction dateParts(v, pa, calendar) {\n var parts = pa.c2d(v, oneYear, calendar).split('-');\n if(parts[0] === '') {\n parts.unshift();\n parts[0] = '-' + parts[0];\n }\n return parts;\n}\n\n},{\"../../constants/numerical\":704,\"../../plots/cartesian/axes\":776}],1037:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Lib = _dereq_('../../lib');\nvar Registry = _dereq_('../../registry');\nvar Axes = _dereq_('../../plots/cartesian/axes');\n\nvar arraysToCalcdata = _dereq_('../bar/arrays_to_calcdata');\nvar binFunctions = _dereq_('./bin_functions');\nvar normFunctions = _dereq_('./norm_functions');\nvar doAvg = _dereq_('./average');\nvar getBinSpanLabelRound = _dereq_('./bin_label_vals');\n\nfunction calc(gd, trace) {\n var pos = [];\n var size = [];\n var pa = Axes.getFromId(gd, trace.orientation === 'h' ? trace.yaxis : trace.xaxis);\n var mainData = trace.orientation === 'h' ? 'y' : 'x';\n var counterData = {x: 'y', y: 'x'}[mainData];\n var calendar = trace[mainData + 'calendar'];\n var cumulativeSpec = trace.cumulative;\n var i;\n\n var binsAndPos = calcAllAutoBins(gd, trace, pa, mainData);\n var binSpec = binsAndPos[0];\n var pos0 = binsAndPos[1];\n\n var nonuniformBins = typeof binSpec.size === 'string';\n var binEdges = [];\n var bins = nonuniformBins ? binEdges : binSpec;\n // make the empty bin array\n var inc = [];\n var counts = [];\n var inputPoints = [];\n var total = 0;\n var norm = trace.histnorm;\n var func = trace.histfunc;\n var densityNorm = norm.indexOf('density') !== -1;\n var i2, binEnd, n;\n\n if(cumulativeSpec.enabled && densityNorm) {\n // we treat \"cumulative\" like it means \"integral\" if you use a density norm,\n // which in the end means it's the same as without \"density\"\n norm = norm.replace(/ ?density$/, '');\n densityNorm = false;\n }\n\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 isAvg = false;\n var pr2c = function(v) { return pa.r2c(v, 0, calendar); };\n var rawCounterData;\n\n if(Lib.isArrayOrTypedArray(trace[counterData]) && func !== 'count') {\n rawCounterData = trace[counterData];\n isAvg = func === 'avg';\n binFunc = binFunctions[func];\n }\n\n // create the bins (and any extra arrays needed)\n // assume more than 1e6 bins is an error, so we don't crash the browser\n i = pr2c(binSpec.start);\n\n // decrease end a little in case of rounding errors\n binEnd = pr2c(binSpec.end) + (i - Axes.tickIncrement(i, binSpec.size, false, calendar)) / 1e6;\n\n while(i < binEnd && pos.length < 1e6) {\n i2 = Axes.tickIncrement(i, binSpec.size, false, calendar);\n pos.push((i + i2) / 2);\n size.push(sizeInit);\n inputPoints.push([]);\n // nonuniform bins (like months) we need to search,\n // rather than straight calculate the bin we're in\n binEdges.push(i);\n // nonuniform bins also need nonuniform normalization factors\n if(densityNorm) inc.push(1 / (i2 - i));\n if(isAvg) counts.push(0);\n // break to avoid infinite loops\n if(i2 <= i) break;\n i = i2;\n }\n binEdges.push(i);\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(!nonuniformBins && pa.type === 'date') {\n bins = {\n start: pr2c(bins.start),\n end: pr2c(bins.end),\n size: bins.size\n };\n }\n\n // stash left and right gaps by group\n if(!gd._fullLayout._roundFnOpts) gd._fullLayout._roundFnOpts = {};\n var groupName = trace['_' + mainData + 'bingroup'];\n var roundFnOpts = {leftGap: Infinity, rightGap: Infinity};\n if(groupName) {\n if(!gd._fullLayout._roundFnOpts[groupName]) gd._fullLayout._roundFnOpts[groupName] = roundFnOpts;\n roundFnOpts = gd._fullLayout._roundFnOpts[groupName];\n }\n\n // bin the data\n // and make histogram-specific pt-number-to-cd-index map object\n var nMax = size.length;\n var uniqueValsPerBin = true;\n var leftGap = roundFnOpts.leftGap;\n var rightGap = roundFnOpts.rightGap;\n var ptNumber2cdIndex = {};\n for(i = 0; i < pos0.length; i++) {\n var posi = pos0[i];\n n = Lib.findBin(posi, bins);\n if(n >= 0 && n < nMax) {\n total += binFunc(n, i, size, rawCounterData, counts);\n if(uniqueValsPerBin && inputPoints[n].length && posi !== pos0[inputPoints[n][0]]) {\n uniqueValsPerBin = false;\n }\n inputPoints[n].push(i);\n ptNumber2cdIndex[i] = n;\n\n leftGap = Math.min(leftGap, posi - binEdges[n]);\n rightGap = Math.min(rightGap, binEdges[n + 1] - posi);\n }\n }\n roundFnOpts.leftGap = leftGap;\n roundFnOpts.rightGap = rightGap;\n\n var roundFn;\n if(!uniqueValsPerBin) {\n roundFn = function(v, isRightEdge) {\n return function() {\n var roundFnOpts = gd._fullLayout._roundFnOpts[groupName];\n return getBinSpanLabelRound(\n roundFnOpts.leftGap,\n roundFnOpts.rightGap,\n binEdges, pa, calendar\n )(v, isRightEdge);\n };\n };\n }\n\n // average and/or normalize the data, if needed\n if(isAvg) total = doAvg(size, counts);\n if(normFunc) normFunc(size, total, inc);\n\n // after all normalization etc, now we can accumulate if desired\n if(cumulativeSpec.enabled) cdf(size, cumulativeSpec.direction, cumulativeSpec.currentbin);\n\n var seriesLen = Math.min(pos.length, size.length);\n var cd = [];\n var firstNonzero = 0;\n var lastNonzero = seriesLen - 1;\n\n // look for empty bins at the ends to remove, so autoscale omits them\n for(i = 0; i < seriesLen; i++) {\n if(size[i]) {\n firstNonzero = i;\n break;\n }\n }\n for(i = seriesLen - 1; i >= firstNonzero; i--) {\n if(size[i]) {\n lastNonzero = i;\n break;\n }\n }\n\n // create the \"calculated data\" to plot\n for(i = firstNonzero; i <= lastNonzero; i++) {\n if((isNumeric(pos[i]) && isNumeric(size[i]))) {\n var cdi = {\n p: pos[i],\n s: size[i],\n b: 0\n };\n\n // setup hover and event data fields,\n // N.B. pts and \"hover\" positions ph0/ph1 don't seem to make much sense\n // for cumulative distributions\n if(!cumulativeSpec.enabled) {\n cdi.pts = inputPoints[i];\n if(uniqueValsPerBin) {\n cdi.ph0 = cdi.ph1 = (inputPoints[i].length) ? pos0[inputPoints[i][0]] : pos[i];\n } else {\n // Defer evaluation of ph(0|1) in crossTraceCalc\n trace._computePh = true;\n cdi.ph0 = roundFn(binEdges[i]);\n cdi.ph1 = roundFn(binEdges[i + 1], true);\n }\n }\n cd.push(cdi);\n }\n }\n\n if(cd.length === 1) {\n // when we collapse to a single bin, calcdata no longer describes bin size\n // so we need to explicitly specify it\n cd[0].width1 = Axes.tickIncrement(cd[0].p, binSpec.size, false, calendar) - cd[0].p;\n }\n\n arraysToCalcdata(cd, trace);\n\n if(Lib.isArrayOrTypedArray(trace.selectedpoints)) {\n Lib.tagSelected(cd, trace, ptNumber2cdIndex);\n }\n\n return cd;\n}\n\n/*\n * calcAllAutoBins: we want all histograms inside the same bingroup\n * (see logic in Histogram.crossTraceDefaults) to share bin specs\n *\n * If the user has explicitly specified differing\n * bin specs, there's nothing we can do, but if possible we will try to use the\n * smallest bins of any of the auto values for all histograms inside the same\n * bingroup.\n */\nfunction calcAllAutoBins(gd, trace, pa, mainData, _overlayEdgeCase) {\n var binAttr = mainData + 'bins';\n var fullLayout = gd._fullLayout;\n var groupName = trace['_' + mainData + 'bingroup'];\n var binOpts = fullLayout._histogramBinOpts[groupName];\n var isOverlay = fullLayout.barmode === 'overlay';\n var i, traces, tracei, calendar, pos0, autoVals, cumulativeSpec;\n\n var r2c = function(v) { return pa.r2c(v, 0, calendar); };\n var c2r = function(v) { return pa.c2r(v, 0, calendar); };\n\n var cleanBound = pa.type === 'date' ?\n function(v) { return (v || v === 0) ? Lib.cleanDate(v, null, calendar) : null; } :\n function(v) { return isNumeric(v) ? Number(v) : null; };\n\n function setBound(attr, bins, newBins) {\n if(bins[attr + 'Found']) {\n bins[attr] = cleanBound(bins[attr]);\n if(bins[attr] === null) bins[attr] = newBins[attr];\n } else {\n autoVals[attr] = bins[attr] = newBins[attr];\n Lib.nestedProperty(traces[0], binAttr + '.' + attr).set(newBins[attr]);\n }\n }\n\n // all but the first trace in this group has already been marked finished\n // clear this flag, so next time we run calc we will run autobin again\n if(trace['_' + mainData + 'autoBinFinished']) {\n delete trace['_' + mainData + 'autoBinFinished'];\n } else {\n traces = binOpts.traces;\n var allPos = [];\n\n // Note: we're including `legendonly` traces here for autobin purposes,\n // so that showing & hiding from the legend won't affect bins.\n // But this complicates things a bit since those traces don't `calc`,\n // hence `isFirstVisible`.\n var isFirstVisible = true;\n var has2dMap = false;\n var hasHist2dContour = false;\n for(i = 0; i < traces.length; i++) {\n tracei = traces[i];\n\n if(tracei.visible) {\n var mainDatai = binOpts.dirs[i];\n pos0 = tracei['_' + mainDatai + 'pos0'] = pa.makeCalcdata(tracei, mainDatai);\n\n allPos = Lib.concat(allPos, pos0);\n delete tracei['_' + mainData + 'autoBinFinished'];\n\n if(trace.visible === true) {\n if(isFirstVisible) {\n isFirstVisible = false;\n } else {\n delete tracei._autoBin;\n tracei['_' + mainData + 'autoBinFinished'] = 1;\n }\n if(Registry.traceIs(tracei, '2dMap')) {\n has2dMap = true;\n }\n if(tracei.type === 'histogram2dcontour') {\n hasHist2dContour = true;\n }\n }\n }\n }\n\n calendar = traces[0][mainData + 'calendar'];\n var newBinSpec = Axes.autoBin(allPos, pa, binOpts.nbins, has2dMap, calendar, binOpts.sizeFound && binOpts.size);\n\n var autoBin = traces[0]._autoBin = {};\n autoVals = autoBin[binOpts.dirs[0]] = {};\n\n if(hasHist2dContour) {\n // the \"true\" 2nd argument reverses the tick direction (which we can't\n // just do with a minus sign because of month bins)\n if(!binOpts.size) {\n newBinSpec.start = c2r(Axes.tickIncrement(\n r2c(newBinSpec.start), newBinSpec.size, true, calendar));\n }\n if(binOpts.end === undefined) {\n newBinSpec.end = c2r(Axes.tickIncrement(\n r2c(newBinSpec.end), newBinSpec.size, false, calendar));\n }\n }\n\n // Edge case: single-valued histogram overlaying others\n // Use them all together to calculate the bin size for the single-valued one\n if(isOverlay && !Registry.traceIs(trace, '2dMap') && newBinSpec._dataSpan === 0 &&\n pa.type !== 'category' && pa.type !== 'multicategory') {\n // Several single-valued histograms! Stop infinite recursion,\n // just return an extra flag that tells handleSingleValueOverlays\n // to sort out this trace too\n if(_overlayEdgeCase) return [newBinSpec, pos0, true];\n\n newBinSpec = handleSingleValueOverlays(gd, trace, pa, mainData, binAttr);\n }\n\n // adjust for CDF edge cases\n cumulativeSpec = tracei.cumulative || {};\n if(cumulativeSpec.enabled && (cumulativeSpec.currentbin !== 'include')) {\n if(cumulativeSpec.direction === 'decreasing') {\n newBinSpec.start = c2r(Axes.tickIncrement(\n r2c(newBinSpec.start), newBinSpec.size, true, calendar));\n } else {\n newBinSpec.end = c2r(Axes.tickIncrement(\n r2c(newBinSpec.end), newBinSpec.size, false, calendar));\n }\n }\n\n binOpts.size = newBinSpec.size;\n if(!binOpts.sizeFound) {\n autoVals.size = newBinSpec.size;\n Lib.nestedProperty(traces[0], binAttr + '.size').set(newBinSpec.size);\n }\n\n setBound('start', binOpts, newBinSpec);\n setBound('end', binOpts, newBinSpec);\n }\n\n pos0 = trace['_' + mainData + 'pos0'];\n delete trace['_' + mainData + 'pos0'];\n\n // Each trace can specify its own start/end, or if omitted\n // we ensure they're beyond the bounds of this trace's data,\n // and we need to make sure start is aligned with the main start\n var traceInputBins = trace._input[binAttr] || {};\n var traceBinOptsCalc = Lib.extendFlat({}, binOpts);\n var mainStart = binOpts.start;\n var startIn = pa.r2l(traceInputBins.start);\n var hasStart = startIn !== undefined;\n if((binOpts.startFound || hasStart) && startIn !== pa.r2l(mainStart)) {\n // We have an explicit start to reconcile across traces\n // if this trace has an explicit start, shift it down to a bin edge\n // if another trace had an explicit start, shift it down to a\n // bin edge past our data\n var traceStart = hasStart ?\n startIn :\n Lib.aggNums(Math.min, null, pos0);\n\n var dummyAx = {\n type: (pa.type === 'category' || pa.type === 'multicategory') ? 'linear' : pa.type,\n r2l: pa.r2l,\n dtick: binOpts.size,\n tick0: mainStart,\n calendar: calendar,\n range: ([traceStart, Axes.tickIncrement(traceStart, binOpts.size, false, calendar)]).map(pa.l2r)\n };\n var newStart = Axes.tickFirst(dummyAx);\n if(newStart > pa.r2l(traceStart)) {\n newStart = Axes.tickIncrement(newStart, binOpts.size, true, calendar);\n }\n traceBinOptsCalc.start = pa.l2r(newStart);\n if(!hasStart) Lib.nestedProperty(trace, binAttr + '.start').set(traceBinOptsCalc.start);\n }\n\n var mainEnd = binOpts.end;\n var endIn = pa.r2l(traceInputBins.end);\n var hasEnd = endIn !== undefined;\n if((binOpts.endFound || hasEnd) && endIn !== pa.r2l(mainEnd)) {\n // Reconciling an explicit end is easier, as it doesn't need to\n // match bin edges\n var traceEnd = hasEnd ?\n endIn :\n Lib.aggNums(Math.max, null, pos0);\n\n traceBinOptsCalc.end = pa.l2r(traceEnd);\n if(!hasEnd) Lib.nestedProperty(trace, binAttr + '.start').set(traceBinOptsCalc.end);\n }\n\n // Backward compatibility for one-time autobinning.\n // autobin: true is handled in cleanData, but autobin: false\n // needs to be here where we have determined the values.\n var autoBinAttr = 'autobin' + mainData;\n if(trace._input[autoBinAttr] === false) {\n trace._input[binAttr] = Lib.extendFlat({}, trace[binAttr] || {});\n delete trace._input[autoBinAttr];\n delete trace[autoBinAttr];\n }\n\n return [traceBinOptsCalc, pos0];\n}\n\n/*\n * Adjust single-value histograms in overlay mode to make as good a\n * guess as we can at autobin values the user would like.\n *\n * Returns the binSpec for the trace that sparked all this\n */\nfunction handleSingleValueOverlays(gd, trace, pa, mainData, binAttr) {\n var fullLayout = gd._fullLayout;\n var overlaidTraceGroup = getConnectedHistograms(gd, trace);\n var pastThisTrace = false;\n var minSize = Infinity;\n var singleValuedTraces = [trace];\n var i, tracei, binOpts;\n\n // first collect all the:\n // - min bin size from all multi-valued traces\n // - single-valued traces\n for(i = 0; i < overlaidTraceGroup.length; i++) {\n tracei = overlaidTraceGroup[i];\n\n if(tracei === trace) {\n pastThisTrace = true;\n } else if(!pastThisTrace) {\n // This trace has already had its autobins calculated, so either:\n // - it is part of a bingroup\n // - it is NOT a single-valued trace\n binOpts = fullLayout._histogramBinOpts[tracei['_' + mainData + 'bingroup']];\n minSize = Math.min(minSize, binOpts.size || tracei[binAttr].size);\n } else {\n var resulti = calcAllAutoBins(gd, tracei, pa, mainData, true);\n var binSpeci = resulti[0];\n var isSingleValued = resulti[2];\n\n // so we can use this result when we get to tracei in the normal\n // course of events, mark it as done and put _pos0 back\n tracei['_' + mainData + 'autoBinFinished'] = 1;\n tracei['_' + mainData + 'pos0'] = resulti[1];\n\n if(isSingleValued) {\n singleValuedTraces.push(tracei);\n } else {\n minSize = Math.min(minSize, binSpeci.size);\n }\n }\n }\n\n // find the real data values for each single-valued trace\n // hunt through pos0 for the first valid value\n var dataVals = new Array(singleValuedTraces.length);\n for(i = 0; i < singleValuedTraces.length; i++) {\n var pos0 = singleValuedTraces[i]['_' + mainData + 'pos0'];\n for(var j = 0; j < pos0.length; j++) {\n if(pos0[j] !== undefined) {\n dataVals[i] = pos0[j];\n break;\n }\n }\n }\n\n // are ALL traces are single-valued? use the min difference between\n // all of their values (which defaults to 1 if there's still only one)\n if(!isFinite(minSize)) {\n minSize = Lib.distinctVals(dataVals).minDiff;\n }\n\n // now apply the min size we found to all single-valued traces\n for(i = 0; i < singleValuedTraces.length; i++) {\n tracei = singleValuedTraces[i];\n var calendar = tracei[mainData + 'calendar'];\n\n var newBins = {\n start: pa.c2r(dataVals[i] - minSize / 2, 0, calendar),\n end: pa.c2r(dataVals[i] + minSize / 2, 0, calendar),\n size: minSize\n };\n\n tracei._input[binAttr] = tracei[binAttr] = newBins;\n\n binOpts = fullLayout._histogramBinOpts[tracei['_' + mainData + 'bingroup']];\n if(binOpts) Lib.extendFlat(binOpts, newBins);\n }\n\n return trace[binAttr];\n}\n\n/*\n * Return an array of histograms that share axes and orientation.\n *\n * Only considers histograms. In principle we could include bars in a\n * similar way to how we do manually binned histograms, though this\n * would have tons of edge cases and value judgments to make.\n */\nfunction getConnectedHistograms(gd, trace) {\n var xid = trace.xaxis;\n var yid = trace.yaxis;\n var orientation = trace.orientation;\n\n var out = [];\n var fullData = gd._fullData;\n for(var i = 0; i < fullData.length; i++) {\n var tracei = fullData[i];\n if(tracei.type === 'histogram' &&\n tracei.visible === true &&\n tracei.orientation === orientation &&\n tracei.xaxis === xid && tracei.yaxis === yid\n ) {\n out.push(tracei);\n }\n }\n\n return out;\n}\n\nfunction cdf(size, direction, currentBin) {\n var i, vi, prevSum;\n\n function firstHalfPoint(i) {\n prevSum = size[i];\n size[i] /= 2;\n }\n\n function nextHalfPoint(i) {\n vi = size[i];\n size[i] = prevSum + vi / 2;\n prevSum += vi;\n }\n\n if(currentBin === 'half') {\n if(direction === 'increasing') {\n firstHalfPoint(0);\n for(i = 1; i < size.length; i++) {\n nextHalfPoint(i);\n }\n } else {\n firstHalfPoint(size.length - 1);\n for(i = size.length - 2; i >= 0; i--) {\n nextHalfPoint(i);\n }\n }\n } else if(direction === 'increasing') {\n for(i = 1; i < size.length; i++) {\n size[i] += size[i - 1];\n }\n\n // 'exclude' is identical to 'include' just shifted one bin over\n if(currentBin === 'exclude') {\n size.unshift(0);\n size.pop();\n }\n } else {\n for(i = size.length - 2; i >= 0; i--) {\n size[i] += size[i + 1];\n }\n\n if(currentBin === 'exclude') {\n size.push(0);\n size.shift();\n }\n }\n}\n\nmodule.exports = {\n calc: calc,\n calcAllAutoBins: calcAllAutoBins\n};\n\n},{\"../../lib\":728,\"../../plots/cartesian/axes\":776,\"../../registry\":859,\"../bar/arrays_to_calcdata\":868,\"./average\":1033,\"./bin_functions\":1035,\"./bin_label_vals\":1036,\"./norm_functions\":1044,\"fast-isnumeric\":236}],1038:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nmodule.exports = {\n eventDataKeys: ['binNumber']\n};\n\n},{}],1039:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar axisIds = _dereq_('../../plots/cartesian/axis_ids');\n\nvar traceIs = _dereq_('../../registry').traceIs;\nvar handleGroupingDefaults = _dereq_('../bar/defaults').handleGroupingDefaults;\n\nvar nestedProperty = Lib.nestedProperty;\nvar getAxisGroup = axisIds.getAxisGroup;\n\nvar BINATTRS = [\n {aStr: {x: 'xbins.start', y: 'ybins.start'}, name: 'start'},\n {aStr: {x: 'xbins.end', y: 'ybins.end'}, name: 'end'},\n {aStr: {x: 'xbins.size', y: 'ybins.size'}, name: 'size'},\n {aStr: {x: 'nbinsx', y: 'nbinsy'}, name: 'nbins'}\n];\n\nvar BINDIRECTIONS = ['x', 'y'];\n\n// handle bin attrs and relink auto-determined values so fullData is complete\nmodule.exports = function crossTraceDefaults(fullData, fullLayout) {\n var allBinOpts = fullLayout._histogramBinOpts = {};\n var histTraces = [];\n var mustMatchTracesLookup = {};\n var otherTracesList = [];\n\n var traceOut, traces, groupName, binDir;\n var i, j, k;\n\n function coerce(attr, dflt) {\n return Lib.coerce(traceOut._input, traceOut, traceOut._module.attributes, attr, dflt);\n }\n\n function orientation2binDir(traceOut) {\n return traceOut.orientation === 'v' ? 'x' : 'y';\n }\n\n function getAxisType(traceOut, binDir) {\n var ax = axisIds.getFromTrace({_fullLayout: fullLayout}, traceOut, binDir);\n return ax.type;\n }\n\n function fillBinOpts(traceOut, groupName, binDir) {\n // N.B. group traces that don't have a bingroup with themselves\n var fallbackGroupName = traceOut.uid + '__' + binDir;\n if(!groupName) groupName = fallbackGroupName;\n\n var axType = getAxisType(traceOut, binDir);\n var calendar = traceOut[binDir + 'calendar'] || '';\n var binOpts = allBinOpts[groupName];\n var needsNewItem = true;\n\n if(binOpts) {\n if(axType === binOpts.axType && calendar === binOpts.calendar) {\n needsNewItem = false;\n binOpts.traces.push(traceOut);\n binOpts.dirs.push(binDir);\n } else {\n groupName = fallbackGroupName;\n\n if(axType !== binOpts.axType) {\n Lib.warn([\n 'Attempted to group the bins of trace', traceOut.index,\n 'set on a', 'type:' + axType, 'axis',\n 'with bins on', 'type:' + binOpts.axType, 'axis.'\n ].join(' '));\n }\n if(calendar !== binOpts.calendar) {\n // prohibit bingroup for traces using different calendar,\n // there's probably a way to make this work, but skip for now\n Lib.warn([\n 'Attempted to group the bins of trace', traceOut.index,\n 'set with a', calendar, 'calendar',\n 'with bins',\n (binOpts.calendar ? 'on a ' + binOpts.calendar + ' calendar' : 'w/o a set calendar')\n ].join(' '));\n }\n }\n }\n\n if(needsNewItem) {\n allBinOpts[groupName] = {\n traces: [traceOut],\n dirs: [binDir],\n axType: axType,\n calendar: traceOut[binDir + 'calendar'] || ''\n };\n }\n traceOut['_' + binDir + 'bingroup'] = groupName;\n }\n\n for(i = 0; i < fullData.length; i++) {\n traceOut = fullData[i];\n\n if(traceIs(traceOut, 'histogram')) {\n histTraces.push(traceOut);\n\n // TODO: this shouldn't be relinked as it's only used within calc\n // https://github.com/plotly/plotly.js/issues/749\n delete traceOut._xautoBinFinished;\n delete traceOut._yautoBinFinished;\n\n // N.B. need to coerce *alignmentgroup* before *bingroup*, as traces\n // in same alignmentgroup \"have to match\"\n if(!traceIs(traceOut, '2dMap')) {\n handleGroupingDefaults(traceOut._input, traceOut, fullLayout, coerce);\n }\n }\n }\n\n var alignmentOpts = fullLayout._alignmentOpts || {};\n\n // Look for traces that \"have to match\", that is:\n // - 1d histogram traces on the same subplot with same orientation under barmode:stack,\n // - 1d histogram traces on the same subplot with same orientation under barmode:group\n // - 1d histogram traces on the same position axis with the same orientation\n // and the same *alignmentgroup* (coerced under barmode:group)\n // - Once `stackgroup` gets implemented (see https://github.com/plotly/plotly.js/issues/3614),\n // traces within the same stackgroup will also \"have to match\"\n for(i = 0; i < histTraces.length; i++) {\n traceOut = histTraces[i];\n groupName = '';\n\n if(!traceIs(traceOut, '2dMap')) {\n binDir = orientation2binDir(traceOut);\n\n if(fullLayout.barmode === 'group' && traceOut.alignmentgroup) {\n var pa = traceOut[binDir + 'axis'];\n var aGroupId = getAxisGroup(fullLayout, pa) + traceOut.orientation;\n if((alignmentOpts[aGroupId] || {})[traceOut.alignmentgroup]) {\n groupName = aGroupId;\n }\n }\n\n if(!groupName && fullLayout.barmode !== 'overlay') {\n groupName = (\n getAxisGroup(fullLayout, traceOut.xaxis) +\n getAxisGroup(fullLayout, traceOut.yaxis) +\n orientation2binDir(traceOut)\n );\n }\n }\n\n if(groupName) {\n if(!mustMatchTracesLookup[groupName]) {\n mustMatchTracesLookup[groupName] = [];\n }\n mustMatchTracesLookup[groupName].push(traceOut);\n } else {\n otherTracesList.push(traceOut);\n }\n }\n\n // Setup binOpts for traces that have to match,\n // if the traces have a valid bingroup, use that\n // if not use axis+binDir groupName\n for(groupName in mustMatchTracesLookup) {\n traces = mustMatchTracesLookup[groupName];\n\n // no need to 'force' anything when a single\n // trace is detected as \"must match\"\n if(traces.length === 1) {\n otherTracesList.push(traces[0]);\n continue;\n }\n\n var binGroupFound = false;\n for(i = 0; i < traces.length; i++) {\n traceOut = traces[i];\n binGroupFound = coerce('bingroup');\n break;\n }\n\n groupName = binGroupFound || groupName;\n\n for(i = 0; i < traces.length; i++) {\n traceOut = traces[i];\n var bingroupIn = traceOut._input.bingroup;\n if(bingroupIn && bingroupIn !== groupName) {\n Lib.warn([\n 'Trace', traceOut.index, 'must match',\n 'within bingroup', groupName + '.',\n 'Ignoring its bingroup:', bingroupIn, 'setting.'\n ].join(' '));\n }\n traceOut.bingroup = groupName;\n\n // N.B. no need to worry about 2dMap case\n // (where both bin direction are set in each trace)\n // as 2dMap trace never \"have to match\"\n fillBinOpts(traceOut, groupName, orientation2binDir(traceOut));\n }\n }\n\n // setup binOpts for traces that can but don't have to match,\n // notice that these traces can be matched with traces that have to match\n for(i = 0; i < otherTracesList.length; i++) {\n traceOut = otherTracesList[i];\n\n var binGroup = coerce('bingroup');\n\n if(traceIs(traceOut, '2dMap')) {\n for(k = 0; k < 2; k++) {\n binDir = BINDIRECTIONS[k];\n var binGroupInDir = coerce(binDir + 'bingroup',\n binGroup ? binGroup + '__' + binDir : null\n );\n fillBinOpts(traceOut, binGroupInDir, binDir);\n }\n } else {\n fillBinOpts(traceOut, binGroup, orientation2binDir(traceOut));\n }\n }\n\n // coerce bin attrs!\n for(groupName in allBinOpts) {\n var binOpts = allBinOpts[groupName];\n traces = binOpts.traces;\n\n for(j = 0; j < BINATTRS.length; j++) {\n var attrSpec = BINATTRS[j];\n var attr = attrSpec.name;\n var aStr;\n var autoVals;\n\n // nbins(x|y) is moot if we have a size. This depends on\n // nbins coming after size in binAttrs.\n if(attr === 'nbins' && binOpts.sizeFound) continue;\n\n for(i = 0; i < traces.length; i++) {\n traceOut = traces[i];\n binDir = binOpts.dirs[i];\n aStr = attrSpec.aStr[binDir];\n\n if(nestedProperty(traceOut._input, aStr).get() !== undefined) {\n binOpts[attr] = coerce(aStr);\n binOpts[attr + 'Found'] = true;\n break;\n }\n\n autoVals = (traceOut._autoBin || {})[binDir] || {};\n if(autoVals[attr]) {\n // if this is the *first* autoval\n nestedProperty(traceOut, aStr).set(autoVals[attr]);\n }\n }\n\n // start and end we need to coerce anyway, after having collected the\n // first of each into binOpts, in case a trace wants to restrict its\n // data to a certain range\n if(attr === 'start' || attr === 'end') {\n for(; i < traces.length; i++) {\n traceOut = traces[i];\n if(traceOut['_' + binDir + 'bingroup']) {\n autoVals = (traceOut._autoBin || {})[binDir] || {};\n coerce(aStr, autoVals[attr]);\n }\n }\n }\n\n if(attr === 'nbins' && !binOpts.sizeFound && !binOpts.nbinsFound) {\n traceOut = traces[0];\n binOpts[attr] = coerce(aStr);\n }\n }\n }\n};\n\n},{\"../../lib\":728,\"../../plots/cartesian/axis_ids\":779,\"../../registry\":859,\"../bar/defaults\":873}],1040:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\nvar Color = _dereq_('../../components/color');\n\nvar handleStyleDefaults = _dereq_('../bar/style_defaults');\nvar attributes = _dereq_('./attributes');\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 x = coerce('x');\n var y = coerce('y');\n\n var cumulative = coerce('cumulative.enabled');\n if(cumulative) {\n coerce('cumulative.direction');\n coerce('cumulative.currentbin');\n }\n\n coerce('text');\n coerce('hovertext');\n coerce('hovertemplate');\n\n var orientation = coerce('orientation', (y && !x) ? 'h' : 'v');\n var sampleLetter = orientation === 'v' ? 'x' : 'y';\n var aggLetter = orientation === 'v' ? 'y' : 'x';\n\n var len = (x && y) ?\n Math.min(Lib.minRowLength(x) && Lib.minRowLength(y)) :\n Lib.minRowLength(traceOut[sampleLetter] || []);\n\n if(!len) {\n traceOut.visible = false;\n return;\n }\n\n traceOut._length = len;\n\n var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');\n handleCalendarDefaults(traceIn, traceOut, ['x', 'y'], layout);\n\n var hasAggregationData = traceOut[aggLetter];\n if(hasAggregationData) coerce('histfunc');\n coerce('histnorm');\n\n // Note: bin defaults are now handled in Histogram.crossTraceDefaults\n // autobin(x|y) are only included here to appease Plotly.validate\n coerce('autobin' + sampleLetter);\n\n handleStyleDefaults(traceIn, traceOut, coerce, defaultColor, layout);\n\n Lib.coerceSelectionMarkerOpacity(traceOut, coerce);\n\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\n},{\"../../components/color\":595,\"../../lib\":728,\"../../registry\":859,\"../bar/style_defaults\":884,\"./attributes\":1032}],1041:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = function eventData(out, pt, trace, cd, pointNumber) {\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\n // for 2d histograms\n if('zLabelVal' in pt) out.z = pt.zLabelVal;\n\n if(pt.xa) out.xaxis = pt.xa;\n if(pt.ya) out.yaxis = pt.ya;\n\n // specific to histogram - CDFs do not have pts (yet?)\n if(!(trace.cumulative || {}).enabled) {\n var pts = Array.isArray(pointNumber) ?\n cd[0].pts[pointNumber[0]][pointNumber[1]] :\n cd[pointNumber].pts;\n\n out.pointNumbers = pts;\n out.binNumber = out.pointNumber;\n delete out.pointNumber;\n delete out.pointIndex;\n\n var pointIndices;\n if(trace._indexToPoints) {\n pointIndices = [];\n for(var i = 0; i < pts.length; i++) {\n pointIndices = pointIndices.concat(trace._indexToPoints[pts[i]]);\n }\n } else {\n pointIndices = pts;\n }\n\n out.pointIndices = pointIndices;\n }\n\n return out;\n};\n\n},{}],1042:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar barHover = _dereq_('../bar/hover').hoverPoints;\nvar hoverLabelText = _dereq_('../../plots/cartesian/axes').hoverLabelText;\n\nmodule.exports = function hoverPoints(pointData, xval, yval, hovermode) {\n var pts = barHover(pointData, xval, yval, hovermode);\n\n if(!pts) return;\n\n pointData = pts[0];\n var di = pointData.cd[pointData.index];\n var trace = pointData.cd[0].trace;\n\n if(!trace.cumulative.enabled) {\n var posLetter = trace.orientation === 'h' ? 'y' : 'x';\n\n pointData[posLetter + 'Label'] = hoverLabelText(pointData[posLetter + 'a'], di.ph0, di.ph1);\n }\n\n return pts;\n};\n\n},{\"../../plots/cartesian/axes\":776,\"../bar/hover\":876}],1043:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/**\n * Histogram has its own attribute, defaults and calc steps,\n * but uses bar's plot to display\n * and bar's crossTraceCalc (formerly known as setPositions) for stacking and grouping\n */\n\n/**\n * histogram errorBarsOK is debatable, but it's put in for backward compat.\n * there are use cases for it - sqrt for a simple histogram works right now,\n * constant and % work but they're not so meaningful. I guess it could be cool\n * to allow quadrature combination of errors in summed histograms...\n */\n\nmodule.exports = {\n attributes: _dereq_('./attributes'),\n layoutAttributes: _dereq_('../bar/layout_attributes'),\n supplyDefaults: _dereq_('./defaults'),\n crossTraceDefaults: _dereq_('./cross_trace_defaults'),\n supplyLayoutDefaults: _dereq_('../bar/layout_defaults'),\n calc: _dereq_('./calc').calc,\n crossTraceCalc: _dereq_('../bar/cross_trace_calc').crossTraceCalc,\n plot: _dereq_('../bar/plot').plot,\n layerName: 'barlayer',\n style: _dereq_('../bar/style').style,\n styleOnSelect: _dereq_('../bar/style').styleOnSelect,\n colorbar: _dereq_('../scatter/marker_colorbar'),\n hoverPoints: _dereq_('./hover'),\n selectPoints: _dereq_('../bar/select'),\n eventData: _dereq_('./event_data'),\n\n moduleType: 'trace',\n name: 'histogram',\n basePlotModule: _dereq_('../../plots/cartesian'),\n categories: ['bar-like', 'cartesian', 'svg', 'bar', 'histogram', 'oriented', 'errorBarsOK', 'showLegend'],\n meta: {\n \n }\n};\n\n},{\"../../plots/cartesian\":789,\"../bar/cross_trace_calc\":872,\"../bar/layout_attributes\":878,\"../bar/layout_defaults\":879,\"../bar/plot\":880,\"../bar/select\":881,\"../bar/style\":883,\"../scatter/marker_colorbar\":1152,\"./attributes\":1032,\"./calc\":1037,\"./cross_trace_defaults\":1039,\"./defaults\":1040,\"./event_data\":1041,\"./hover\":1042}],1044:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\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\n},{}],1045:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar histogramAttrs = _dereq_('../histogram/attributes');\nvar makeBinAttrs = _dereq_('../histogram/bin_attributes');\nvar heatmapAttrs = _dereq_('../heatmap/attributes');\nvar baseAttrs = _dereq_('../../plots/attributes');\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nmodule.exports = extendFlat(\n {\n x: histogramAttrs.x,\n y: histogramAttrs.y,\n\n z: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n marker: {\n color: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n editType: 'calc'\n },\n\n histnorm: histogramAttrs.histnorm,\n histfunc: histogramAttrs.histfunc,\n nbinsx: histogramAttrs.nbinsx,\n xbins: makeBinAttrs('x'),\n nbinsy: histogramAttrs.nbinsy,\n ybins: makeBinAttrs('y'),\n autobinx: histogramAttrs.autobinx,\n autobiny: histogramAttrs.autobiny,\n\n bingroup: extendFlat({}, histogramAttrs.bingroup, {\n \n }),\n xbingroup: extendFlat({}, histogramAttrs.bingroup, {\n \n }),\n ybingroup: extendFlat({}, histogramAttrs.bingroup, {\n \n }),\n\n xgap: heatmapAttrs.xgap,\n ygap: heatmapAttrs.ygap,\n zsmooth: heatmapAttrs.zsmooth,\n zhoverformat: heatmapAttrs.zhoverformat,\n hovertemplate: hovertemplateAttrs({}, {keys: 'z'}),\n showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})\n },\n colorScaleAttrs('', {cLetter: 'z', autoColorDflt: false})\n);\n\n},{\"../../components/colorscale/attributes\":602,\"../../lib/extend\":719,\"../../plots/attributes\":773,\"../../plots/template_attributes\":854,\"../heatmap/attributes\":1013,\"../histogram/attributes\":1032,\"../histogram/bin_attributes\":1034}],1046:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Axes = _dereq_('../../plots/cartesian/axes');\n\nvar binFunctions = _dereq_('../histogram/bin_functions');\nvar normFunctions = _dereq_('../histogram/norm_functions');\nvar doAvg = _dereq_('../histogram/average');\nvar getBinSpanLabelRound = _dereq_('../histogram/bin_label_vals');\nvar calcAllAutoBins = _dereq_('../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\n},{\"../../lib\":728,\"../../plots/cartesian/axes\":776,\"../histogram/average\":1033,\"../histogram/bin_functions\":1035,\"../histogram/bin_label_vals\":1036,\"../histogram/calc\":1037,\"../histogram/norm_functions\":1044}],1047:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nvar handleSampleDefaults = _dereq_('./sample_defaults');\nvar handleStyleDefaults = _dereq_('../heatmap/style_defaults');\nvar colorscaleDefaults = _dereq_('../../components/colorscale/defaults');\nvar attributes = _dereq_('./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 handleSampleDefaults(traceIn, traceOut, coerce, layout);\n if(traceOut.visible === false) return;\n\n handleStyleDefaults(traceIn, traceOut, coerce, layout);\n colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'});\n coerce('hovertemplate');\n};\n\n},{\"../../components/colorscale/defaults\":605,\"../../lib\":728,\"../heatmap/style_defaults\":1026,\"./attributes\":1045,\"./sample_defaults\":1050}],1048:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar heatmapHover = _dereq_('../heatmap/hover');\nvar hoverLabelText = _dereq_('../../plots/cartesian/axes').hoverLabelText;\n\nmodule.exports = function hoverPoints(pointData, xval, yval, hovermode, hoverLayer, contour) {\n var pts = heatmapHover(pointData, xval, yval, hovermode, hoverLayer, contour);\n\n if(!pts) return;\n\n pointData = pts[0];\n var indices = pointData.index;\n var ny = indices[0];\n var nx = indices[1];\n var cd0 = pointData.cd[0];\n var xRange = cd0.xRanges[nx];\n var yRange = cd0.yRanges[ny];\n\n pointData.xLabel = hoverLabelText(pointData.xa, xRange[0], xRange[1]);\n pointData.yLabel = hoverLabelText(pointData.ya, yRange[0], yRange[1]);\n\n return pts;\n};\n\n},{\"../../plots/cartesian/axes\":776,\"../heatmap/hover\":1020}],1049:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults'),\n crossTraceDefaults: _dereq_('../histogram/cross_trace_defaults'),\n calc: _dereq_('../heatmap/calc'),\n plot: _dereq_('../heatmap/plot'),\n layerName: 'heatmaplayer',\n colorbar: _dereq_('../heatmap/colorbar'),\n style: _dereq_('../heatmap/style'),\n hoverPoints: _dereq_('./hover'),\n eventData: _dereq_('../histogram/event_data'),\n\n moduleType: 'trace',\n name: 'histogram2d',\n basePlotModule: _dereq_('../../plots/cartesian'),\n categories: ['cartesian', 'svg', '2dMap', 'histogram', 'showLegend'],\n meta: {\n \n \n }\n};\n\n},{\"../../plots/cartesian\":789,\"../heatmap/calc\":1014,\"../heatmap/colorbar\":1016,\"../heatmap/plot\":1024,\"../heatmap/style\":1025,\"../histogram/cross_trace_defaults\":1039,\"../histogram/event_data\":1041,\"./attributes\":1045,\"./defaults\":1047,\"./hover\":1048}],1050:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\n\nmodule.exports = function handleSampleDefaults(traceIn, traceOut, coerce, layout) {\n var x = coerce('x');\n var y = coerce('y');\n var xlen = Lib.minRowLength(x);\n var ylen = Lib.minRowLength(y);\n\n // we could try to accept x0 and dx, etc...\n // but that's a pretty weird use case.\n // for now require both x and y explicitly specified.\n if(!xlen || !ylen) {\n traceOut.visible = false;\n return;\n }\n\n traceOut._length = Math.min(xlen, ylen);\n\n var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');\n handleCalendarDefaults(traceIn, traceOut, ['x', 'y'], layout);\n\n // if marker.color is an array, we can use it in aggregation instead of z\n var hasAggregationData = coerce('z') || coerce('marker.color');\n\n if(hasAggregationData) coerce('histfunc');\n coerce('histnorm');\n\n // Note: bin defaults are now handled in Histogram2D.crossTraceDefaults\n // autobin(x|y) are only included here to appease Plotly.validate\n coerce('autobinx');\n coerce('autobiny');\n};\n\n},{\"../../lib\":728,\"../../registry\":859}],1051:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar histogram2dAttrs = _dereq_('../histogram2d/attributes');\nvar contourAttrs = _dereq_('../contour/attributes');\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nmodule.exports = extendFlat({\n x: histogram2dAttrs.x,\n y: histogram2dAttrs.y,\n z: histogram2dAttrs.z,\n marker: histogram2dAttrs.marker,\n\n histnorm: histogram2dAttrs.histnorm,\n histfunc: histogram2dAttrs.histfunc,\n nbinsx: histogram2dAttrs.nbinsx,\n xbins: histogram2dAttrs.xbins,\n nbinsy: histogram2dAttrs.nbinsy,\n ybins: histogram2dAttrs.ybins,\n autobinx: histogram2dAttrs.autobinx,\n autobiny: histogram2dAttrs.autobiny,\n\n bingroup: histogram2dAttrs.bingroup,\n xbingroup: histogram2dAttrs.xbingroup,\n ybingroup: histogram2dAttrs.ybingroup,\n\n autocontour: contourAttrs.autocontour,\n ncontours: contourAttrs.ncontours,\n contours: contourAttrs.contours,\n line: {\n color: contourAttrs.line.color,\n width: extendFlat({}, contourAttrs.line.width, {\n dflt: 0.5,\n \n }),\n dash: contourAttrs.line.dash,\n smoothing: contourAttrs.line.smoothing,\n editType: 'plot'\n },\n zhoverformat: histogram2dAttrs.zhoverformat,\n hovertemplate: histogram2dAttrs.hovertemplate\n},\n colorScaleAttrs('', {\n cLetter: 'z',\n editTypeOverride: 'calc'\n })\n);\n\n},{\"../../components/colorscale/attributes\":602,\"../../lib/extend\":719,\"../contour/attributes\":956,\"../histogram2d/attributes\":1045}],1052:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nvar handleSampleDefaults = _dereq_('../histogram2d/sample_defaults');\nvar handleContoursDefaults = _dereq_('../contour/contours_defaults');\nvar handleStyleDefaults = _dereq_('../contour/style_defaults');\nvar attributes = _dereq_('./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 function coerce2(attr) {\n return Lib.coerce2(traceIn, traceOut, attributes, attr);\n }\n\n handleSampleDefaults(traceIn, traceOut, coerce, layout);\n if(traceOut.visible === false) return;\n\n handleContoursDefaults(traceIn, traceOut, coerce, coerce2);\n handleStyleDefaults(traceIn, traceOut, coerce, layout);\n coerce('hovertemplate');\n};\n\n},{\"../../lib\":728,\"../contour/contours_defaults\":963,\"../contour/style_defaults\":977,\"../histogram2d/sample_defaults\":1050,\"./attributes\":1051}],1053:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults'),\n crossTraceDefaults: _dereq_('../histogram/cross_trace_defaults'),\n calc: _dereq_('../contour/calc'),\n plot: _dereq_('../contour/plot').plot,\n layerName: 'contourlayer',\n style: _dereq_('../contour/style'),\n colorbar: _dereq_('../contour/colorbar'),\n hoverPoints: _dereq_('../contour/hover'),\n\n moduleType: 'trace',\n name: 'histogram2dcontour',\n basePlotModule: _dereq_('../../plots/cartesian'),\n categories: ['cartesian', 'svg', '2dMap', 'contour', 'histogram', 'showLegend'],\n meta: {\n \n \n }\n};\n\n},{\"../../plots/cartesian\":789,\"../contour/calc\":957,\"../contour/colorbar\":959,\"../contour/hover\":969,\"../contour/plot\":974,\"../contour/style\":976,\"../histogram/cross_trace_defaults\":1039,\"./attributes\":1051,\"./defaults\":1052}],1054:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar baseAttrs = _dereq_('../../plots/attributes');\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\nvar colormodel = _dereq_('./constants').colormodel;\n\nvar cm = ['rgb', 'rgba', 'hsl', 'hsla'];\nvar zminDesc = [];\nvar zmaxDesc = [];\nfor(var i = 0; i < cm.length; i++) {\n zminDesc.push('For the `' + cm[i] + '` colormodel, it is [' + colormodel[cm[i]].min.join(', ') + '].');\n zmaxDesc.push('For the `' + cm[i] + '` colormodel, it is [' + colormodel[cm[i]].max.join(', ') + '].');\n}\n\nmodule.exports = extendFlat({\n z: {\n valType: 'data_array',\n \n editType: 'calc',\n \n },\n colormodel: {\n valType: 'enumerated',\n values: cm,\n dflt: 'rgb',\n \n editType: 'calc',\n \n },\n zmin: {\n valType: 'info_array',\n items: [\n {valType: 'number', editType: 'calc'},\n {valType: 'number', editType: 'calc'},\n {valType: 'number', editType: 'calc'},\n {valType: 'number', editType: 'calc'}\n ],\n \n editType: 'calc',\n \n },\n zmax: {\n valType: 'info_array',\n items: [\n {valType: 'number', editType: 'calc'},\n {valType: 'number', editType: 'calc'},\n {valType: 'number', editType: 'calc'},\n {valType: 'number', editType: 'calc'}\n ],\n \n editType: 'calc',\n \n },\n x0: {\n valType: 'any',\n dflt: 0,\n \n editType: 'calc+clearAxisTypes',\n \n },\n y0: {\n valType: 'any',\n dflt: 0,\n \n editType: 'calc+clearAxisTypes',\n \n },\n dx: {\n valType: 'number',\n dflt: 1,\n \n editType: 'calc',\n \n },\n dy: {\n valType: 'number',\n dflt: 1,\n \n editType: 'calc',\n \n },\n text: {\n valType: 'data_array',\n editType: 'plot',\n \n },\n hovertext: {\n valType: 'data_array',\n editType: 'plot',\n \n },\n hoverinfo: extendFlat({}, baseAttrs.hoverinfo, {\n flags: ['x', 'y', 'z', 'color', 'name', 'text'],\n dflt: 'x+y+z+text+name'\n }),\n hovertemplate: hovertemplateAttrs({}, {\n keys: ['z', 'color', 'colormodel']\n }),\n\n transforms: undefined\n});\n\n},{\"../../lib/extend\":719,\"../../plots/attributes\":773,\"../../plots/template_attributes\":854,\"./constants\":1056}],1055:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar constants = _dereq_('./constants');\nvar isNumeric = _dereq_('fast-isnumeric');\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar maxRowLength = _dereq_('../../lib').maxRowLength;\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\n var x0 = xa.d2c(trace.x0) - trace.dx / 2;\n var y0 = ya.d2c(trace.y0) - trace.dy / 2;\n var h = trace.z.length;\n var w = maxRowLength(trace.z);\n\n // Set axis range\n var i;\n var xrange = [x0, x0 + w * trace.dx];\n var yrange = [y0, y0 + h * trace.dy];\n if(xa && xa.type === 'log') for(i = 0; i < w; i++) xrange.push(x0 + i * trace.dx);\n if(ya && ya.type === 'log') for(i = 0; i < h; i++) yrange.push(y0 + i * trace.dy);\n trace._extremes[xa._id] = Axes.findExtremes(xa, xrange);\n trace._extremes[ya._id] = Axes.findExtremes(ya, yrange);\n trace._scaler = makeScaler(trace);\n\n var cd0 = {\n x0: x0,\n y0: y0,\n z: trace.z,\n w: w,\n h: h\n };\n return [cd0];\n};\n\nfunction scale(zero, ratio, min, max) {\n return function(c) {\n return Lib.constrain((c - zero) * ratio, min, max);\n };\n}\n\nfunction constrain(min, max) {\n return function(c) { return Lib.constrain(c, min, max);};\n}\n\n// Generate a function to scale color components according to zmin/zmax and the colormodel\nfunction makeScaler(trace) {\n var colormodel = trace.colormodel;\n var n = colormodel.length;\n var cr = constants.colormodel[colormodel];\n\n trace._sArray = [];\n // Loop over all color components\n for(var k = 0; k < n; k++) {\n if(cr.min[k] !== trace.zmin[k] || cr.max[k] !== trace.zmax[k]) {\n trace._sArray.push(scale(\n trace.zmin[k],\n (cr.max[k] - cr.min[k]) / (trace.zmax[k] - trace.zmin[k]),\n cr.min[k],\n cr.max[k]\n ));\n } else {\n trace._sArray.push(constrain(cr.min[k], cr.max[k]));\n }\n }\n\n return function(pixel) {\n var c = pixel.slice(0, n);\n for(var k = 0; k < n; k++) {\n var ck = c[k];\n if(!isNumeric(ck)) return false;\n c[k] = trace._sArray[k](ck);\n }\n return c;\n };\n}\n\n},{\"../../lib\":728,\"../../plots/cartesian/axes\":776,\"./constants\":1056,\"fast-isnumeric\":236}],1056:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n colormodel: {\n rgb: {\n min: [0, 0, 0],\n max: [255, 255, 255],\n fmt: function(c) {return c.slice(0, 3);},\n suffix: ['', '', '']\n },\n rgba: {\n min: [0, 0, 0, 0],\n max: [255, 255, 255, 1],\n fmt: function(c) {return c.slice(0, 4);},\n suffix: ['', '', '', '']\n },\n hsl: {\n min: [0, 0, 0],\n max: [360, 100, 100],\n fmt: function(c) {\n var p = c.slice(0, 3);\n p[1] = p[1] + '%';\n p[2] = p[2] + '%';\n return p;\n },\n suffix: ['°', '%', '%']\n },\n hsla: {\n min: [0, 0, 0, 0],\n max: [360, 100, 100, 1],\n fmt: function(c) {\n var p = c.slice(0, 4);\n p[1] = p[1] + '%';\n p[2] = p[2] + '%';\n return p;\n },\n suffix: ['°', '%', '%', '']\n }\n }\n};\n\n},{}],1057:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar attributes = _dereq_('./attributes');\nvar constants = _dereq_('./constants');\n\nmodule.exports = function supplyDefaults(traceIn, traceOut) {\n function coerce(attr, dflt) {\n return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);\n }\n var z = coerce('z');\n if(z === undefined || !z.length || !z[0] || !z[0].length) {\n traceOut.visible = false;\n return;\n }\n\n coerce('x0');\n coerce('y0');\n coerce('dx');\n coerce('dy');\n var colormodel = coerce('colormodel');\n\n coerce('zmin', constants.colormodel[colormodel].min);\n coerce('zmax', constants.colormodel[colormodel].max);\n\n coerce('text');\n coerce('hovertext');\n coerce('hovertemplate');\n\n traceOut._length = null;\n};\n\n},{\"../../lib\":728,\"./attributes\":1054,\"./constants\":1056}],1058:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = function eventData(out, pt) {\n if('xVal' in pt) out.x = pt.xVal;\n if('yVal' in pt) out.y = pt.yVal;\n if(pt.xa) out.xaxis = pt.xa;\n if(pt.ya) out.yaxis = pt.ya;\n out.color = pt.color;\n out.colormodel = pt.trace.colormodel;\n return out;\n};\n\n},{}],1059:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Fx = _dereq_('../../components/fx');\nvar Lib = _dereq_('../../lib');\nvar constants = _dereq_('./constants');\n\nmodule.exports = function hoverPoints(pointData, xval, yval) {\n var cd0 = pointData.cd[0];\n var trace = cd0.trace;\n var xa = pointData.xa;\n var ya = pointData.ya;\n\n // Return early if not on image\n if(Fx.inbox(xval - cd0.x0, xval - (cd0.x0 + cd0.w * trace.dx), 0) > 0 ||\n Fx.inbox(yval - cd0.y0, yval - (cd0.y0 + cd0.h * trace.dy), 0) > 0) {\n return;\n }\n\n // Find nearest pixel's index\n var nx = Math.floor((xval - cd0.x0) / trace.dx);\n var ny = Math.floor(Math.abs(yval - cd0.y0) / trace.dy);\n\n // return early if pixel is undefined\n if(!cd0.z[ny][nx]) return;\n\n var hoverinfo = cd0.hi || trace.hoverinfo;\n var fmtColor;\n if(hoverinfo) {\n var parts = hoverinfo.split('+');\n if(parts.indexOf('all') !== -1) parts = ['color'];\n if(parts.indexOf('color') !== -1) fmtColor = true;\n }\n\n var colormodel = trace.colormodel;\n var dims = colormodel.length;\n var c = trace._scaler(cd0.z[ny][nx]);\n var s = constants.colormodel[colormodel].suffix;\n\n var colorstring = [];\n if(trace.hovertemplate || fmtColor) {\n colorstring.push('[' + [c[0] + s[0], c[1] + s[1], c[2] + s[2]].join(', '));\n if(dims === 4) colorstring.push(', ' + c[3] + s[3]);\n colorstring.push(']');\n colorstring = colorstring.join('');\n pointData.extraText = colormodel.toUpperCase() + ': ' + colorstring;\n }\n\n var text;\n if(Array.isArray(trace.hovertext) && Array.isArray(trace.hovertext[ny])) {\n text = trace.hovertext[ny][nx];\n } else if(Array.isArray(trace.text) && Array.isArray(trace.text[ny])) {\n text = trace.text[ny][nx];\n }\n\n // TODO: for color model with 3 dims, display something useful for hovertemplate `%{color[3]}`\n var py = ya.c2p(cd0.y0 + (ny + 0.5) * trace.dy);\n var xVal = cd0.x0 + (nx + 0.5) * trace.dx;\n var yVal = cd0.y0 + (ny + 0.5) * trace.dy;\n var zLabel = '[' + cd0.z[ny][nx].slice(0, trace.colormodel.length).join(', ') + ']';\n return [Lib.extendFlat(pointData, {\n index: [ny, nx],\n x0: xa.c2p(cd0.x0 + nx * trace.dx),\n x1: xa.c2p(cd0.x0 + (nx + 1) * trace.dx),\n y0: py,\n y1: py,\n color: c,\n xVal: xVal,\n xLabelVal: xVal,\n yVal: yVal,\n yLabelVal: yVal,\n zLabelVal: zLabel,\n text: text,\n hovertemplateLabels: {\n 'zLabel': zLabel,\n 'colorLabel': colorstring,\n 'color[0]Label': c[0] + s[0],\n 'color[1]Label': c[1] + s[1],\n 'color[2]Label': c[2] + s[2],\n 'color[3]Label': c[3] + s[3]\n }\n })];\n};\n\n},{\"../../components/fx\":635,\"../../lib\":728,\"./constants\":1056}],1060:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults'),\n calc: _dereq_('./calc'),\n plot: _dereq_('./plot'),\n style: _dereq_('./style'),\n hoverPoints: _dereq_('./hover'),\n eventData: _dereq_('./event_data'),\n\n moduleType: 'trace',\n name: 'image',\n basePlotModule: _dereq_('../../plots/cartesian'),\n categories: ['cartesian', 'svg', '2dMap', 'noSortingByValue'],\n animatable: false,\n meta: {\n \n }\n};\n\n},{\"../../plots/cartesian\":789,\"./attributes\":1054,\"./calc\":1055,\"./defaults\":1057,\"./event_data\":1058,\"./hover\":1059,\"./plot\":1061,\"./style\":1062}],1061:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Lib = _dereq_('../../lib');\nvar xmlnsNamespaces = _dereq_('../../constants/xmlns_namespaces');\nvar constants = _dereq_('./constants');\n\nmodule.exports = function plot(gd, plotinfo, cdimage, imageLayer) {\n var xa = plotinfo.xaxis;\n var ya = plotinfo.yaxis;\n\n Lib.makeTraceGroups(imageLayer, cdimage, 'im').each(function(cd) {\n var plotGroup = d3.select(this);\n var cd0 = cd[0];\n var trace = cd0.trace;\n\n var z = cd0.z;\n var x0 = cd0.x0;\n var y0 = cd0.y0;\n var w = cd0.w;\n var h = cd0.h;\n var dx = trace.dx;\n var dy = trace.dy;\n\n var left, right, temp, top, bottom, i;\n // in case of log of a negative\n i = 0;\n while(left === undefined && i < w) {\n left = xa.c2p(x0 + i * dx);\n i++;\n }\n i = w;\n while(right === undefined && i > 0) {\n right = xa.c2p(x0 + i * dx);\n i--;\n }\n i = 0;\n while(top === undefined && i < h) {\n top = ya.c2p(y0 + i * dy);\n i++;\n }\n i = h;\n while(bottom === undefined && i > 0) {\n bottom = ya.c2p(y0 + i * dy);\n i--;\n }\n\n if(right < left) {\n temp = right;\n right = left;\n left = temp;\n }\n\n if(bottom < top) {\n temp = top;\n top = bottom;\n bottom = temp;\n }\n\n // Reduce image size when zoomed in to save memory\n var extra = 0.5; // half the axis size\n left = Math.max(-extra * xa._length, left);\n right = Math.min((1 + extra) * xa._length, right);\n top = Math.max(-extra * ya._length, top);\n bottom = Math.min((1 + extra) * ya._length, bottom);\n var imageWidth = Math.round(right - left);\n var imageHeight = Math.round(bottom - top);\n\n // if image is entirely off-screen, don't even draw it\n var isOffScreen = (imageWidth <= 0 || imageHeight <= 0);\n if(isOffScreen) {\n var noImage = plotGroup.selectAll('image').data([]);\n noImage.exit().remove();\n return;\n }\n\n // Draw each pixel\n var canvas = document.createElement('canvas');\n canvas.width = imageWidth;\n canvas.height = imageHeight;\n var context = canvas.getContext('2d');\n\n var ipx = function(i) {return Lib.constrain(Math.round(xa.c2p(x0 + i * dx) - left), 0, imageWidth);};\n var jpx = function(j) {return Lib.constrain(Math.round(ya.c2p(y0 + j * dy) - top), 0, imageHeight);};\n\n var fmt = constants.colormodel[trace.colormodel].fmt;\n var c;\n for(i = 0; i < cd0.w; i++) {\n var ipx0 = ipx(i); var ipx1 = ipx(i + 1);\n if(ipx1 === ipx0 || isNaN(ipx1) || isNaN(ipx0)) continue;\n for(var j = 0; j < cd0.h; j++) {\n var jpx0 = jpx(j); var jpx1 = jpx(j + 1);\n if(jpx1 === jpx0 || isNaN(jpx1) || isNaN(jpx0) || !z[j][i]) continue;\n c = trace._scaler(z[j][i]);\n if(c) {\n context.fillStyle = trace.colormodel + '(' + fmt(c).join(',') + ')';\n } else {\n // Return a transparent pixel\n context.fillStyle = 'rgba(0,0,0,0)';\n }\n context.fillRect(ipx0, jpx0, ipx1 - ipx0, jpx1 - jpx0);\n }\n }\n\n var image3 = plotGroup.selectAll('image')\n .data(cd);\n\n image3.enter().append('svg:image').attr({\n xmlns: xmlnsNamespaces.svg,\n preserveAspectRatio: 'none'\n });\n\n image3.attr({\n height: imageHeight,\n width: imageWidth,\n x: left,\n y: top,\n 'xlink:href': canvas.toDataURL('image/png')\n });\n });\n};\n\n},{\"../../constants/xmlns_namespaces\":705,\"../../lib\":728,\"./constants\":1056,\"d3\":164}],1062:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nmodule.exports = function style(gd) {\n d3.select(gd).selectAll('.im image')\n .style('opacity', function(d) {\n return d.trace.opacity;\n });\n};\n\n},{\"d3\":164}],1063:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\nvar extendDeep = _dereq_('../../lib/extend').extendDeep;\nvar overrideAll = _dereq_('../../plot_api/edit_types').overrideAll;\nvar fontAttrs = _dereq_('../../plots/font_attributes');\nvar colorAttrs = _dereq_('../../components/color/attributes');\nvar domainAttrs = _dereq_('../../plots/domain').attributes;\nvar axesAttrs = _dereq_('../../plots/cartesian/layout_attributes');\nvar templatedArray = _dereq_('../../plot_api/plot_template').templatedArray;\nvar delta = _dereq_('../../constants/delta.js');\nvar FORMAT_LINK = _dereq_('../../constants/docs').FORMAT_LINK;\n\nvar textFontAttrs = fontAttrs({\n editType: 'plot',\n colorEditType: 'plot'\n});\n\nvar gaugeBarAttrs = {\n color: {\n valType: 'color',\n editType: 'plot',\n \n \n },\n line: {\n color: {\n valType: 'color',\n \n dflt: colorAttrs.defaultLine,\n editType: 'plot',\n \n },\n width: {\n valType: 'number',\n \n min: 0,\n dflt: 0,\n editType: 'plot',\n \n },\n editType: 'calc'\n },\n thickness: {\n valType: 'number',\n \n min: 0,\n max: 1,\n dflt: 1,\n editType: 'plot',\n \n },\n editType: 'calc'\n};\n\nvar rangeAttr = {\n valType: 'info_array',\n \n items: [\n {valType: 'number', editType: 'plot'},\n {valType: 'number', editType: 'plot'}\n ],\n editType: 'plot',\n \n};\n\nvar stepsAttrs = templatedArray('step', extendDeep({}, gaugeBarAttrs, {\n range: rangeAttr\n}));\n\nmodule.exports = {\n mode: {\n valType: 'flaglist',\n editType: 'calc',\n \n flags: ['number', 'delta', 'gauge'],\n dflt: 'number',\n \n },\n value: {\n valType: 'number',\n editType: 'calc',\n \n anim: true,\n \n },\n align: {\n valType: 'enumerated',\n values: ['left', 'center', 'right'],\n \n editType: 'plot',\n \n },\n // position\n domain: domainAttrs({name: 'indicator', trace: true, editType: 'calc'}),\n\n title: {\n text: {\n valType: 'string',\n \n editType: 'plot',\n \n },\n align: {\n valType: 'enumerated',\n values: ['left', 'center', 'right'],\n \n editType: 'plot',\n \n },\n font: extendFlat({}, textFontAttrs, {\n \n }),\n editType: 'plot'\n },\n number: {\n valueformat: {\n valType: 'string',\n dflt: '',\n \n editType: 'plot',\n \n },\n font: extendFlat({}, textFontAttrs, {\n \n }),\n prefix: {\n valType: 'string',\n dflt: '',\n \n editType: 'plot',\n \n },\n suffix: {\n valType: 'string',\n dflt: '',\n \n editType: 'plot',\n \n },\n editType: 'plot'\n },\n delta: {\n reference: {\n valType: 'number',\n \n editType: 'calc',\n \n },\n position: {\n valType: 'enumerated',\n values: ['top', 'bottom', 'left', 'right'],\n \n dflt: 'bottom',\n editType: 'plot',\n \n },\n relative: {\n valType: 'boolean',\n editType: 'plot',\n \n dflt: false,\n \n },\n valueformat: {\n valType: 'string',\n \n editType: 'plot',\n \n },\n increasing: {\n symbol: {\n valType: 'string',\n \n dflt: delta.INCREASING.SYMBOL,\n editType: 'plot',\n \n },\n color: {\n valType: 'color',\n \n dflt: delta.INCREASING.COLOR,\n editType: 'plot',\n \n },\n // TODO: add attribute to show sign\n editType: 'plot'\n },\n decreasing: {\n symbol: {\n valType: 'string',\n \n dflt: delta.DECREASING.SYMBOL,\n editType: 'plot',\n \n },\n color: {\n valType: 'color',\n \n dflt: delta.DECREASING.COLOR,\n editType: 'plot',\n \n },\n // TODO: add attribute to hide sign\n editType: 'plot'\n },\n font: extendFlat({}, textFontAttrs, {\n \n }),\n editType: 'calc'\n },\n gauge: {\n shape: {\n valType: 'enumerated',\n editType: 'plot',\n \n dflt: 'angular',\n values: ['angular', 'bullet'],\n \n },\n bar: extendDeep({}, gaugeBarAttrs, {\n color: {dflt: 'green'},\n \n }),\n // Background of the gauge\n bgcolor: {\n valType: 'color',\n \n editType: 'plot',\n \n },\n bordercolor: {\n valType: 'color',\n dflt: colorAttrs.defaultLine,\n \n editType: 'plot',\n \n },\n borderwidth: {\n valType: 'number',\n min: 0,\n dflt: 1,\n \n editType: 'plot',\n \n },\n axis: overrideAll({\n range: rangeAttr,\n visible: extendFlat({}, axesAttrs.visible, {\n dflt: true\n }),\n // tick and title properties named and function exactly as in axes\n tickmode: axesAttrs.tickmode,\n nticks: axesAttrs.nticks,\n tick0: axesAttrs.tick0,\n dtick: axesAttrs.dtick,\n tickvals: axesAttrs.tickvals,\n ticktext: axesAttrs.ticktext,\n ticks: extendFlat({}, axesAttrs.ticks, {dflt: 'outside'}),\n ticklen: axesAttrs.ticklen,\n tickwidth: axesAttrs.tickwidth,\n tickcolor: axesAttrs.tickcolor,\n showticklabels: axesAttrs.showticklabels,\n tickfont: fontAttrs({\n \n }),\n tickangle: axesAttrs.tickangle,\n tickformat: axesAttrs.tickformat,\n tickformatstops: axesAttrs.tickformatstops,\n tickprefix: axesAttrs.tickprefix,\n showtickprefix: axesAttrs.showtickprefix,\n ticksuffix: axesAttrs.ticksuffix,\n showticksuffix: axesAttrs.showticksuffix,\n separatethousands: axesAttrs.separatethousands,\n exponentformat: axesAttrs.exponentformat,\n showexponent: axesAttrs.showexponent,\n editType: 'plot'\n }, 'plot'),\n // Steps (or ranges) and thresholds\n steps: stepsAttrs,\n threshold: {\n line: {\n color: extendFlat({}, gaugeBarAttrs.line.color, {\n \n }),\n width: extendFlat({}, gaugeBarAttrs.line.width, {\n dflt: 1,\n \n }),\n editType: 'plot'\n },\n thickness: extendFlat({}, gaugeBarAttrs.thickness, {\n dflt: 0.85,\n \n }),\n value: {\n valType: 'number',\n editType: 'calc',\n dflt: false,\n \n \n },\n editType: 'plot'\n },\n \n editType: 'plot'\n // TODO: in future version, add marker: (bar|needle)\n }\n};\n\n},{\"../../components/color/attributes\":594,\"../../constants/delta.js\":698,\"../../constants/docs\":699,\"../../lib/extend\":719,\"../../plot_api/edit_types\":759,\"../../plot_api/plot_template\":766,\"../../plots/cartesian/layout_attributes\":790,\"../../plots/domain\":803,\"../../plots/font_attributes\":804}],1064:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar plots = _dereq_('../../plots/plots');\n\nexports.name = 'indicator';\n\nexports.plot = function(gd, traces, transitionOpts, makeOnCompleteCallback) {\n plots.plotBasePlot(exports.name, gd, traces, transitionOpts, makeOnCompleteCallback);\n};\n\nexports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) {\n plots.cleanBasePlot(exports.name, newFullData, newFullLayout, oldFullData, oldFullLayout);\n};\n\n},{\"../../plots/plots\":839}],1065:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n// var Lib = require('../../lib');\n\nfunction calc(gd, trace) {\n var cd = [];\n\n var lastReading = trace.value;\n if(!(typeof trace._lastValue === 'number')) trace._lastValue = trace.value;\n var secondLastReading = trace._lastValue;\n var deltaRef = secondLastReading;\n if(trace._hasDelta && typeof trace.delta.reference === 'number') {\n deltaRef = trace.delta.reference;\n }\n cd[0] = {\n y: lastReading,\n lastY: secondLastReading,\n\n delta: lastReading - deltaRef,\n relativeDelta: (lastReading - deltaRef) / deltaRef,\n };\n return cd;\n}\n\nmodule.exports = {\n calc: calc\n};\n\n},{}],1066:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n // Defaults for delta\n defaultNumberFontSize: 80,\n bulletNumberDomainSize: 0.25,\n bulletPadding: 0.025,\n innerRadius: 0.75,\n valueThickness: 0.5, // thickness of value bars relative to full thickness,\n titlePadding: 5,\n horizontalPadding: 10\n};\n\n},{}],1067:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar attributes = _dereq_('./attributes');\nvar handleDomainDefaults = _dereq_('../../plots/domain').defaults;\nvar Template = _dereq_('../../plot_api/plot_template');\nvar handleArrayContainerDefaults = _dereq_('../../plots/array_container_defaults');\nvar cn = _dereq_('./constants.js');\n\nvar handleTickValueDefaults = _dereq_('../../plots/cartesian/tick_value_defaults');\nvar handleTickMarkDefaults = _dereq_('../../plots/cartesian/tick_mark_defaults');\nvar handleTickLabelDefaults = _dereq_('../../plots/cartesian/tick_label_defaults');\n\nfunction supplyDefaults(traceIn, traceOut, defaultColor, layout) {\n function coerce(attr, dflt) {\n return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);\n }\n\n handleDomainDefaults(traceOut, layout, coerce);\n\n // Mode\n coerce('mode');\n traceOut._hasNumber = traceOut.mode.indexOf('number') !== -1;\n traceOut._hasDelta = traceOut.mode.indexOf('delta') !== -1;\n traceOut._hasGauge = traceOut.mode.indexOf('gauge') !== -1;\n\n var value = coerce('value');\n traceOut._range = [0, (typeof value === 'number' ? 1.5 * value : 1)];\n\n // Number attributes\n var auto = new Array(2);\n var bignumberFontSize;\n if(traceOut._hasNumber) {\n coerce('number.valueformat');\n coerce('number.font.color', layout.font.color);\n coerce('number.font.family', layout.font.family);\n coerce('number.font.size');\n if(traceOut.number.font.size === undefined) {\n traceOut.number.font.size = cn.defaultNumberFontSize;\n auto[0] = true;\n }\n coerce('number.prefix');\n coerce('number.suffix');\n bignumberFontSize = traceOut.number.font.size;\n }\n\n // delta attributes\n var deltaFontSize;\n if(traceOut._hasDelta) {\n coerce('delta.font.color', layout.font.color);\n coerce('delta.font.family', layout.font.family);\n coerce('delta.font.size');\n if(traceOut.delta.font.size === undefined) {\n traceOut.delta.font.size = (traceOut._hasNumber ? 0.5 : 1) * (bignumberFontSize || cn.defaultNumberFontSize);\n auto[1] = true;\n }\n coerce('delta.reference', traceOut.value);\n coerce('delta.relative');\n coerce('delta.valueformat', traceOut.delta.relative ? '2%' : '');\n coerce('delta.increasing.symbol');\n coerce('delta.increasing.color');\n coerce('delta.decreasing.symbol');\n coerce('delta.decreasing.color');\n coerce('delta.position');\n deltaFontSize = traceOut.delta.font.size;\n }\n traceOut._scaleNumbers = (!traceOut._hasNumber || auto[0]) && (!traceOut._hasDelta || auto[1]) || false;\n\n // Title attributes\n coerce('title.font.color', layout.font.color);\n coerce('title.font.family', layout.font.family);\n coerce('title.font.size', 0.25 * (bignumberFontSize || deltaFontSize || cn.defaultNumberFontSize));\n coerce('title.text');\n\n // Gauge attributes\n var gaugeIn, gaugeOut, axisIn, axisOut;\n function coerceGauge(attr, dflt) {\n return Lib.coerce(gaugeIn, gaugeOut, attributes.gauge, attr, dflt);\n }\n function coerceGaugeAxis(attr, dflt) {\n return Lib.coerce(axisIn, axisOut, attributes.gauge.axis, attr, dflt);\n }\n\n if(traceOut._hasGauge) {\n gaugeIn = traceIn.gauge;\n if(!gaugeIn) gaugeIn = {};\n gaugeOut = Template.newContainer(traceOut, 'gauge');\n coerceGauge('shape');\n var isBullet = traceOut._isBullet = traceOut.gauge.shape === 'bullet';\n if(!isBullet) {\n coerce('title.align', 'center');\n }\n var isAngular = traceOut._isAngular = traceOut.gauge.shape === 'angular';\n if(!isAngular) {\n coerce('align', 'center');\n }\n\n // gauge background\n coerceGauge('bgcolor', layout.paper_bgcolor);\n coerceGauge('borderwidth');\n coerceGauge('bordercolor');\n\n // gauge bar indicator\n coerceGauge('bar.color');\n coerceGauge('bar.line.color');\n coerceGauge('bar.line.width');\n var defaultBarThickness = cn.valueThickness * (traceOut.gauge.shape === 'bullet' ? 0.5 : 1);\n coerceGauge('bar.thickness', defaultBarThickness);\n\n // Gauge steps\n handleArrayContainerDefaults(gaugeIn, gaugeOut, {\n name: 'steps',\n handleItemDefaults: stepDefaults\n });\n\n // Gauge threshold\n coerceGauge('threshold.value');\n coerceGauge('threshold.thickness');\n coerceGauge('threshold.line.width');\n coerceGauge('threshold.line.color');\n\n // Gauge axis\n axisIn = {};\n if(gaugeIn) axisIn = gaugeIn.axis || {};\n axisOut = Template.newContainer(gaugeOut, 'axis');\n coerceGaugeAxis('visible');\n traceOut._range = coerceGaugeAxis('range', traceOut._range);\n\n var opts = {outerTicks: true};\n handleTickValueDefaults(axisIn, axisOut, coerceGaugeAxis, 'linear');\n handleTickLabelDefaults(axisIn, axisOut, coerceGaugeAxis, 'linear', opts);\n handleTickMarkDefaults(axisIn, axisOut, coerceGaugeAxis, opts);\n } else {\n coerce('title.align', 'center');\n coerce('align', 'center');\n traceOut._isAngular = traceOut._isBullet = false;\n }\n\n // disable 1D transforms\n traceOut._length = null;\n}\n\nfunction stepDefaults(stepIn, stepOut) {\n function coerce(attr, dflt) {\n return Lib.coerce(stepIn, stepOut, attributes.gauge.steps, attr, dflt);\n }\n\n coerce('color');\n coerce('line.color');\n coerce('line.width');\n coerce('range');\n coerce('thickness');\n}\n\nmodule.exports = {\n supplyDefaults: supplyDefaults\n};\n\n},{\"../../lib\":728,\"../../plot_api/plot_template\":766,\"../../plots/array_container_defaults\":772,\"../../plots/cartesian/tick_label_defaults\":797,\"../../plots/cartesian/tick_mark_defaults\":798,\"../../plots/cartesian/tick_value_defaults\":799,\"../../plots/domain\":803,\"./attributes\":1063,\"./constants.js\":1066}],1068:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n moduleType: 'trace',\n name: 'indicator',\n basePlotModule: _dereq_('./base_plot'),\n categories: ['svg', 'noOpacity', 'noHover'],\n animatable: true,\n\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults').supplyDefaults,\n\n calc: _dereq_('./calc').calc,\n\n plot: _dereq_('./plot'),\n\n meta: {\n \n }\n};\n\n},{\"./attributes\":1063,\"./base_plot\":1064,\"./calc\":1065,\"./defaults\":1067,\"./plot\":1069}],1069:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Lib = _dereq_('../../lib');\nvar rad2deg = Lib.rad2deg;\nvar MID_SHIFT = _dereq_('../../constants/alignment').MID_SHIFT;\nvar Drawing = _dereq_('../../components/drawing');\nvar cn = _dereq_('./constants');\nvar svgTextUtils = _dereq_('../../lib/svg_text_utils');\n\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar handleAxisDefaults = _dereq_('../../plots/cartesian/axis_defaults');\nvar handleAxisPositionDefaults = _dereq_('../../plots/cartesian/position_defaults');\nvar axisLayoutAttrs = _dereq_('../../plots/cartesian/layout_attributes');\n\nvar Color = _dereq_('../../components/color');\nvar anchor = {\n 'left': 'start',\n 'center': 'middle',\n 'right': 'end'\n};\nvar position = {\n 'left': 0,\n 'center': 0.5,\n 'right': 1\n};\n\nvar SI_PREFIX = /[yzafpnµmkMGTPEZY]/;\n\nfunction hasTransition(transitionOpts) {\n // If transition config is provided, then it is only a partial replot and traces not\n // updated are removed.\n return transitionOpts && transitionOpts.duration > 0;\n}\n\nmodule.exports = function plot(gd, cdModule, transitionOpts, makeOnCompleteCallback) {\n var fullLayout = gd._fullLayout;\n var onComplete;\n\n if(hasTransition(transitionOpts)) {\n if(makeOnCompleteCallback) {\n // If it was passed a callback to register completion, make a callback. If\n // this is created, then it must be executed on completion, otherwise the\n // pos-transition redraw will not execute:\n onComplete = makeOnCompleteCallback();\n }\n }\n\n Lib.makeTraceGroups(fullLayout._indicatorlayer, cdModule, 'trace').each(function(cd) {\n var cd0 = cd[0];\n var trace = cd0.trace;\n\n var plotGroup = d3.select(this);\n\n // Elements in trace\n var hasGauge = trace._hasGauge;\n var isAngular = trace._isAngular;\n var isBullet = trace._isBullet;\n\n // Domain size\n var domain = trace.domain;\n var size = {\n w: fullLayout._size.w * (domain.x[1] - domain.x[0]),\n h: fullLayout._size.h * (domain.y[1] - domain.y[0]),\n l: fullLayout._size.l + fullLayout._size.w * domain.x[0],\n r: fullLayout._size.r + fullLayout._size.w * (1 - domain.x[1]),\n t: fullLayout._size.t + fullLayout._size.h * (1 - domain.y[1]),\n b: fullLayout._size.b + fullLayout._size.h * (domain.y[0])\n };\n var centerX = size.l + size.w / 2;\n var centerY = size.t + size.h / 2;\n\n // Angular gauge size\n var radius = Math.min(size.w / 2, size.h); // fill domain\n var innerRadius = cn.innerRadius * radius;\n\n // Position numbers based on mode and set the scaling logic\n var numbersX, numbersY, numbersScaler;\n var numbersAlign = trace.align || 'center';\n\n numbersY = centerY;\n if(!hasGauge) {\n numbersX = size.l + position[numbersAlign] * size.w;\n numbersScaler = function(el) {\n return fitTextInsideBox(el, size.w, size.h);\n };\n } else {\n if(isAngular) {\n numbersX = centerX;\n numbersY = centerY + radius / 2;\n numbersScaler = function(el) {\n return fitTextInsideCircle(el, 0.9 * innerRadius);\n };\n }\n if(isBullet) {\n var padding = cn.bulletPadding;\n var p = (1 - cn.bulletNumberDomainSize) + padding;\n numbersX = size.l + (p + (1 - p) * position[numbersAlign]) * size.w;\n numbersScaler = function(el) {\n return fitTextInsideBox(el, (cn.bulletNumberDomainSize - padding) * size.w, size.h);\n };\n }\n }\n\n // Draw numbers\n drawNumbers(gd, plotGroup, cd, {\n numbersX: numbersX,\n numbersY: numbersY,\n numbersScaler: numbersScaler,\n transitionOpts: transitionOpts,\n onComplete: onComplete\n });\n\n // Reexpress our gauge background attributes for drawing\n var gaugeBg, gaugeOutline;\n if(hasGauge) {\n gaugeBg = {\n range: trace.gauge.axis.range,\n color: trace.gauge.bgcolor,\n line: {\n color: trace.gauge.bordercolor,\n width: 0\n },\n thickness: 1\n };\n\n gaugeOutline = {\n range: trace.gauge.axis.range,\n color: 'rgba(0, 0, 0, 0)',\n line: {\n color: trace.gauge.bordercolor,\n width: trace.gauge.borderwidth\n },\n thickness: 1\n };\n }\n\n // Prepare angular gauge layers\n var angularGauge = plotGroup.selectAll('g.angular').data(isAngular ? cd : []);\n angularGauge.exit().remove();\n var angularaxisLayer = plotGroup.selectAll('g.angularaxis').data(isAngular ? cd : []);\n angularaxisLayer.exit().remove();\n\n if(isAngular) {\n drawAngularGauge(gd, plotGroup, cd, {\n radius: radius,\n innerRadius: innerRadius,\n\n gauge: angularGauge,\n layer: angularaxisLayer,\n size: size,\n gaugeBg: gaugeBg,\n gaugeOutline: gaugeOutline,\n transitionOpts: transitionOpts,\n onComplete: onComplete\n });\n }\n\n // Prepare bullet layers\n var bulletGauge = plotGroup.selectAll('g.bullet').data(isBullet ? cd : []);\n bulletGauge.exit().remove();\n var bulletaxisLayer = plotGroup.selectAll('g.bulletaxis').data(isBullet ? cd : []);\n bulletaxisLayer.exit().remove();\n\n if(isBullet) {\n drawBulletGauge(gd, plotGroup, cd, {\n gauge: bulletGauge,\n layer: bulletaxisLayer,\n size: size,\n gaugeBg: gaugeBg,\n gaugeOutline: gaugeOutline,\n transitionOpts: transitionOpts,\n onComplete: onComplete\n });\n }\n\n // title\n var title = plotGroup.selectAll('text.title').data(cd);\n title.exit().remove();\n title.enter().append('text').classed('title', true);\n title\n .attr('text-anchor', function() {\n return isBullet ? anchor.right : anchor[trace.title.align];\n })\n .text(trace.title.text)\n .call(Drawing.font, trace.title.font)\n .call(svgTextUtils.convertToTspans, gd);\n\n // Position title\n title.attr('transform', function() {\n var titleX = size.l + size.w * position[trace.title.align];\n var titleY;\n var titlePadding = cn.titlePadding;\n var titlebBox = Drawing.bBox(title.node());\n if(hasGauge) {\n if(isAngular) {\n // position above axis ticks/labels\n if(trace.gauge.axis.visible) {\n var bBox = Drawing.bBox(angularaxisLayer.node());\n titleY = (bBox.top - titlePadding) - titlebBox.bottom;\n } else {\n titleY = size.t + size.h / 2 - radius / 2 - titlebBox.bottom - titlePadding;\n }\n }\n if(isBullet) {\n // position outside domain\n titleY = numbersY - (titlebBox.top + titlebBox.bottom) / 2;\n titleX = size.l - cn.bulletPadding * size.w; // Outside domain, on the left\n }\n } else {\n // position above numbers\n titleY = (trace._numbersTop - titlePadding) - titlebBox.bottom;\n }\n return strTranslate(titleX, titleY);\n });\n });\n};\n\nfunction drawBulletGauge(gd, plotGroup, cd, opts) {\n var trace = cd[0].trace;\n\n var bullet = opts.gauge;\n var axisLayer = opts.layer;\n var gaugeBg = opts.gaugeBg;\n var gaugeOutline = opts.gaugeOutline;\n var size = opts.size;\n var domain = trace.domain;\n\n var transitionOpts = opts.transitionOpts;\n var onComplete = opts.onComplete;\n\n // preparing axis\n var ax, vals, transFn, tickSign, shift;\n\n // Enter bullet, axis\n bullet.enter().append('g').classed('bullet', true);\n bullet.attr('transform', 'translate(' + size.l + ', ' + size.t + ')');\n\n axisLayer.enter().append('g')\n .classed('bulletaxis', true)\n .classed('crisp', true);\n axisLayer.selectAll('g.' + 'xbulletaxis' + 'tick,path,text').remove();\n\n // Draw bullet\n var bulletHeight = size.h; // use all vertical domain\n var innerBulletHeight = trace.gauge.bar.thickness * bulletHeight;\n var bulletLeft = domain.x[0];\n var bulletRight = domain.x[0] + (domain.x[1] - domain.x[0]) * ((trace._hasNumber || trace._hasDelta) ? (1 - cn.bulletNumberDomainSize) : 1);\n\n ax = mockAxis(gd, trace.gauge.axis);\n ax._id = 'xbulletaxis';\n ax.domain = [bulletLeft, bulletRight];\n ax.setScale();\n\n vals = Axes.calcTicks(ax);\n transFn = Axes.makeTransFn(ax);\n tickSign = Axes.getTickSigns(ax)[2];\n\n shift = size.t + size.h;\n if(ax.visible) {\n Axes.drawTicks(gd, ax, {\n vals: ax.ticks === 'inside' ? Axes.clipEnds(ax, vals) : vals,\n layer: axisLayer,\n path: Axes.makeTickPath(ax, shift, tickSign),\n transFn: transFn\n });\n\n Axes.drawLabels(gd, ax, {\n vals: vals,\n layer: axisLayer,\n transFn: transFn,\n labelFns: Axes.makeLabelFns(ax, shift)\n });\n }\n\n function drawRect(s) {\n s\n .attr('width', function(d) { return Math.max(0, ax.c2p(d.range[1]) - ax.c2p(d.range[0]));})\n .attr('x', function(d) { return ax.c2p(d.range[0]);})\n .attr('y', function(d) { return 0.5 * (1 - d.thickness) * bulletHeight;})\n .attr('height', function(d) { return d.thickness * bulletHeight; });\n }\n\n // Draw bullet background, steps\n var boxes = [gaugeBg].concat(trace.gauge.steps);\n var bgBullet = bullet.selectAll('g.bg-bullet').data(boxes);\n bgBullet.enter().append('g').classed('bg-bullet', true).append('rect');\n bgBullet.select('rect')\n .call(drawRect)\n .call(styleShape);\n bgBullet.exit().remove();\n\n // Draw value bar with transitions\n var fgBullet = bullet.selectAll('g.value-bullet').data([trace.gauge.bar]);\n fgBullet.enter().append('g').classed('value-bullet', true).append('rect');\n fgBullet.select('rect')\n .attr('height', innerBulletHeight)\n .attr('y', (bulletHeight - innerBulletHeight) / 2)\n .call(styleShape);\n if(hasTransition(transitionOpts)) {\n fgBullet.select('rect')\n .transition()\n .duration(transitionOpts.duration)\n .ease(transitionOpts.easing)\n .each('end', function() { onComplete && onComplete(); })\n .each('interrupt', function() { onComplete && onComplete(); })\n .attr('width', Math.max(0, ax.c2p(Math.min(trace.gauge.axis.range[1], cd[0].y))));\n } else {\n fgBullet.select('rect')\n .attr('width', typeof cd[0].y === 'number' ?\n Math.max(0, ax.c2p(Math.min(trace.gauge.axis.range[1], cd[0].y))) :\n 0);\n }\n fgBullet.exit().remove();\n\n var data = cd.filter(function() {return trace.gauge.threshold.value;});\n var threshold = bullet.selectAll('g.threshold-bullet').data(data);\n threshold.enter().append('g').classed('threshold-bullet', true).append('line');\n threshold.select('line')\n .attr('x1', ax.c2p(trace.gauge.threshold.value))\n .attr('x2', ax.c2p(trace.gauge.threshold.value))\n .attr('y1', (1 - trace.gauge.threshold.thickness) / 2 * bulletHeight)\n .attr('y2', (1 - (1 - trace.gauge.threshold.thickness) / 2) * bulletHeight)\n .call(Color.stroke, trace.gauge.threshold.line.color)\n .style('stroke-width', trace.gauge.threshold.line.width);\n threshold.exit().remove();\n\n var bulletOutline = bullet.selectAll('g.gauge-outline').data([gaugeOutline]);\n bulletOutline.enter().append('g').classed('gauge-outline', true).append('rect');\n bulletOutline.select('rect')\n .call(drawRect)\n .call(styleShape);\n bulletOutline.exit().remove();\n}\n\nfunction drawAngularGauge(gd, plotGroup, cd, opts) {\n var trace = cd[0].trace;\n\n var size = opts.size;\n var radius = opts.radius;\n var innerRadius = opts.innerRadius;\n var gaugeBg = opts.gaugeBg;\n var gaugeOutline = opts.gaugeOutline;\n var gaugePosition = [size.l + size.w / 2, size.t + size.h / 2 + radius / 2];\n var gauge = opts.gauge;\n var axisLayer = opts.layer;\n\n var transitionOpts = opts.transitionOpts;\n var onComplete = opts.onComplete;\n\n // circular gauge\n var theta = Math.PI / 2;\n function valueToAngle(v) {\n var min = trace.gauge.axis.range[0];\n var max = trace.gauge.axis.range[1];\n var angle = (v - min) / (max - min) * Math.PI - theta;\n if(angle < -theta) return -theta;\n if(angle > theta) return theta;\n return angle;\n }\n\n function arcPathGenerator(size) {\n return d3.svg.arc()\n .innerRadius((innerRadius + radius) / 2 - size / 2 * (radius - innerRadius))\n .outerRadius((innerRadius + radius) / 2 + size / 2 * (radius - innerRadius))\n .startAngle(-theta);\n }\n\n function drawArc(p) {\n p\n .attr('d', function(d) {\n return arcPathGenerator(d.thickness)\n .startAngle(valueToAngle(d.range[0]))\n .endAngle(valueToAngle(d.range[1]))();\n });\n }\n\n // preparing axis\n var ax, vals, transFn, tickSign;\n\n // Enter gauge and axis\n gauge.enter().append('g').classed('angular', true);\n gauge.attr('transform', strTranslate(gaugePosition[0], gaugePosition[1]));\n\n axisLayer.enter().append('g')\n .classed('angularaxis', true)\n .classed('crisp', true);\n axisLayer.selectAll('g.' + 'xangularaxis' + 'tick,path,text').remove();\n\n ax = mockAxis(gd, trace.gauge.axis);\n ax.type = 'linear';\n ax.range = trace.gauge.axis.range;\n ax._id = 'xangularaxis'; // or 'y', but I don't think this makes a difference here\n ax.setScale();\n\n // 't'ick to 'g'eometric radians is used all over the place here\n var t2g = function(d) {\n return (ax.range[0] - d.x) / (ax.range[1] - ax.range[0]) * Math.PI + Math.PI;\n };\n\n var labelFns = {};\n var out = Axes.makeLabelFns(ax, 0);\n var labelStandoff = out.labelStandoff;\n labelFns.xFn = function(d) {\n var rad = t2g(d);\n return Math.cos(rad) * labelStandoff;\n };\n labelFns.yFn = function(d) {\n var rad = t2g(d);\n var ff = Math.sin(rad) > 0 ? 0.2 : 1;\n return -Math.sin(rad) * (labelStandoff + d.fontSize * ff) +\n Math.abs(Math.cos(rad)) * (d.fontSize * MID_SHIFT);\n };\n labelFns.anchorFn = function(d) {\n var rad = t2g(d);\n var cos = Math.cos(rad);\n return Math.abs(cos) < 0.1 ?\n 'middle' :\n (cos > 0 ? 'start' : 'end');\n };\n labelFns.heightFn = function(d, a, h) {\n var rad = t2g(d);\n return -0.5 * (1 + Math.sin(rad)) * h;\n };\n var _transFn = function(rad) {\n return strTranslate(\n gaugePosition[0] + radius * Math.cos(rad),\n gaugePosition[1] - radius * Math.sin(rad)\n );\n };\n transFn = function(d) {\n return _transFn(t2g(d));\n };\n var transFn2 = function(d) {\n var rad = t2g(d);\n return _transFn(rad) + 'rotate(' + -rad2deg(rad) + ')';\n };\n vals = Axes.calcTicks(ax);\n tickSign = Axes.getTickSigns(ax)[2];\n if(ax.visible) {\n tickSign = ax.ticks === 'inside' ? -1 : 1;\n var pad = (ax.linewidth || 1) / 2;\n Axes.drawTicks(gd, ax, {\n vals: vals,\n layer: axisLayer,\n path: 'M' + (tickSign * pad) + ',0h' + (tickSign * ax.ticklen),\n transFn: transFn2\n });\n Axes.drawLabels(gd, ax, {\n vals: vals,\n layer: axisLayer,\n transFn: transFn,\n labelFns: labelFns\n });\n }\n\n // Draw background + steps\n var arcs = [gaugeBg].concat(trace.gauge.steps);\n var bgArc = gauge.selectAll('g.bg-arc').data(arcs);\n bgArc.enter().append('g').classed('bg-arc', true).append('path');\n bgArc.select('path').call(drawArc).call(styleShape);\n bgArc.exit().remove();\n\n // Draw foreground with transition\n var valueArcPathGenerator = arcPathGenerator(trace.gauge.bar.thickness);\n var valueArc = gauge.selectAll('g.value-arc').data([trace.gauge.bar]);\n valueArc.enter().append('g').classed('value-arc', true).append('path');\n var valueArcPath = valueArc.select('path');\n if(hasTransition(transitionOpts)) {\n valueArcPath\n .transition()\n .duration(transitionOpts.duration)\n .ease(transitionOpts.easing)\n .each('end', function() { onComplete && onComplete(); })\n .each('interrupt', function() { onComplete && onComplete(); })\n .attrTween('d', arcTween(valueArcPathGenerator, valueToAngle(cd[0].lastY), valueToAngle(cd[0].y)));\n trace._lastValue = cd[0].y;\n } else {\n valueArcPath.attr('d', typeof cd[0].y === 'number' ?\n valueArcPathGenerator.endAngle(valueToAngle(cd[0].y)) :\n 'M0,0Z');\n }\n valueArcPath.call(styleShape);\n valueArc.exit().remove();\n\n // Draw threshold\n arcs = [];\n var v = trace.gauge.threshold.value;\n if(v) {\n arcs.push({\n range: [v, v],\n color: trace.gauge.threshold.color,\n line: {\n color: trace.gauge.threshold.line.color,\n width: trace.gauge.threshold.line.width\n },\n thickness: trace.gauge.threshold.thickness\n });\n }\n var thresholdArc = gauge.selectAll('g.threshold-arc').data(arcs);\n thresholdArc.enter().append('g').classed('threshold-arc', true).append('path');\n thresholdArc.select('path').call(drawArc).call(styleShape);\n thresholdArc.exit().remove();\n\n // Draw border last\n var gaugeBorder = gauge.selectAll('g.gauge-outline').data([gaugeOutline]);\n gaugeBorder.enter().append('g').classed('gauge-outline', true).append('path');\n gaugeBorder.select('path').call(drawArc).call(styleShape);\n gaugeBorder.exit().remove();\n}\n\nfunction drawNumbers(gd, plotGroup, cd, opts) {\n var trace = cd[0].trace;\n\n var numbersX = opts.numbersX;\n var numbersY = opts.numbersY;\n var numbersAlign = trace.align || 'center';\n var numbersAnchor = anchor[numbersAlign];\n\n var transitionOpts = opts.transitionOpts;\n var onComplete = opts.onComplete;\n\n var numbers = Lib.ensureSingle(plotGroup, 'g', 'numbers');\n var bignumberbBox, deltabBox;\n var numbersbBox;\n\n var data = [];\n if(trace._hasNumber) data.push('number');\n if(trace._hasDelta) {\n data.push('delta');\n if(trace.delta.position === 'left') data.reverse();\n }\n var sel = numbers.selectAll('text').data(data);\n sel.enter().append('text');\n sel\n .attr('text-anchor', function() {return numbersAnchor;})\n .attr('class', function(d) { return d;})\n .attr('x', null)\n .attr('y', null)\n .attr('dx', null)\n .attr('dy', null);\n sel.exit().remove();\n\n // Function to override the number formatting used during transitions\n function transitionFormat(valueformat, fmt, from, to) {\n // For now, do not display SI prefix if start and end value do not have any\n if(valueformat.match('s') && // If using SI prefix\n (from >= 0 !== to >= 0) && // If sign change\n (!fmt(from).slice(-1).match(SI_PREFIX) && !fmt(to).slice(-1).match(SI_PREFIX)) // Has no SI prefix\n ) {\n var transitionValueFormat = valueformat.slice().replace('s', 'f').replace(/\\d+/, function(m) { return parseInt(m) - 1;});\n var transitionAx = mockAxis(gd, {tickformat: transitionValueFormat});\n return function(v) {\n // Switch to fixed precision if number is smaller than one\n if(Math.abs(v) < 1) return Axes.tickText(transitionAx, v).text;\n return fmt(v);\n };\n } else {\n return fmt;\n }\n }\n\n function drawBignumber() {\n var bignumberAx = mockAxis(gd, {tickformat: trace.number.valueformat}, trace._range);\n bignumberAx.setScale();\n Axes.prepTicks(bignumberAx);\n\n var fmt = function(v) { return Axes.tickText(bignumberAx, v).text;};\n var bignumberSuffix = trace.number.suffix;\n var bignumberPrefix = trace.number.prefix;\n\n var number = numbers.select('text.number');\n\n function writeNumber() {\n var txt = typeof cd[0].y === 'number' ?\n bignumberPrefix + fmt(cd[0].y) + bignumberSuffix :\n '-';\n number.text(txt)\n .call(Drawing.font, trace.number.font)\n .call(svgTextUtils.convertToTspans, gd);\n }\n\n if(hasTransition(transitionOpts)) {\n number\n .transition()\n .duration(transitionOpts.duration)\n .ease(transitionOpts.easing)\n .each('end', function() { writeNumber(); onComplete && onComplete(); })\n .each('interrupt', function() { writeNumber(); onComplete && onComplete(); })\n .attrTween('text', function() {\n var that = d3.select(this);\n var interpolator = d3.interpolateNumber(cd[0].lastY, cd[0].y);\n trace._lastValue = cd[0].y;\n\n var transitionFmt = transitionFormat(trace.number.valueformat, fmt, cd[0].lastY, cd[0].y);\n return function(t) {\n that.text(bignumberPrefix + transitionFmt(interpolator(t)) + bignumberSuffix);\n };\n });\n } else {\n writeNumber();\n }\n\n bignumberbBox = measureText(bignumberPrefix + fmt(cd[0].y) + bignumberSuffix, trace.number.font, numbersAnchor, gd);\n return number;\n }\n\n function drawDelta() {\n var deltaAx = mockAxis(gd, {tickformat: trace.delta.valueformat}, trace._range);\n deltaAx.setScale();\n Axes.prepTicks(deltaAx);\n\n var deltaFmt = function(v) { return Axes.tickText(deltaAx, v).text;};\n var deltaValue = function(d) {\n var value = trace.delta.relative ? d.relativeDelta : d.delta;\n return value;\n };\n var deltaFormatText = function(value, numberFmt) {\n if(value === 0 || typeof value !== 'number' || isNaN(value)) return '-';\n return (value > 0 ? trace.delta.increasing.symbol : trace.delta.decreasing.symbol) + numberFmt(value);\n };\n var deltaFill = function(d) {\n return d.delta >= 0 ? trace.delta.increasing.color : trace.delta.decreasing.color;\n };\n if(trace._deltaLastValue === undefined) {\n trace._deltaLastValue = deltaValue(cd[0]);\n }\n var delta = numbers.select('text.delta');\n delta\n .call(Drawing.font, trace.delta.font)\n .call(Color.fill, deltaFill({delta: trace._deltaLastValue}));\n\n function writeDelta() {\n delta.text(deltaFormatText(deltaValue(cd[0]), deltaFmt))\n .call(Color.fill, deltaFill(cd[0]))\n .call(svgTextUtils.convertToTspans, gd);\n }\n\n if(hasTransition(transitionOpts)) {\n delta\n .transition()\n .duration(transitionOpts.duration)\n .ease(transitionOpts.easing)\n .tween('text', function() {\n var that = d3.select(this);\n var to = deltaValue(cd[0]);\n var from = trace._deltaLastValue;\n var transitionFmt = transitionFormat(trace.delta.valueformat, deltaFmt, from, to);\n var interpolator = d3.interpolateNumber(from, to);\n trace._deltaLastValue = to;\n return function(t) {\n that.text(deltaFormatText(interpolator(t), transitionFmt));\n that.call(Color.fill, deltaFill({delta: interpolator(t)}));\n };\n })\n .each('end', function() { writeDelta(); onComplete && onComplete(); })\n .each('interrupt', function() { writeDelta(); onComplete && onComplete(); });\n } else {\n writeDelta();\n }\n\n deltabBox = measureText(deltaFormatText(deltaValue(cd[0]), deltaFmt), trace.delta.font, numbersAnchor, gd);\n return delta;\n }\n\n var key = trace.mode + trace.align;\n var delta;\n if(trace._hasDelta) {\n delta = drawDelta();\n key += trace.delta.position + trace.delta.font.size + trace.delta.font.family + trace.delta.valueformat;\n key += trace.delta.increasing.symbol + trace.delta.decreasing.symbol;\n numbersbBox = deltabBox;\n }\n if(trace._hasNumber) {\n drawBignumber();\n key += trace.number.font.size + trace.number.font.family + trace.number.valueformat + trace.number.suffix + trace.number.prefix;\n numbersbBox = bignumberbBox;\n }\n\n // Position delta relative to bignumber\n if(trace._hasDelta && trace._hasNumber) {\n var bignumberCenter = [\n (bignumberbBox.left + bignumberbBox.right) / 2,\n (bignumberbBox.top + bignumberbBox.bottom) / 2\n ];\n var deltaCenter = [\n (deltabBox.left + deltabBox.right) / 2,\n (deltabBox.top + deltabBox.bottom) / 2\n ];\n\n var dx, dy;\n var padding = 0.75 * trace.delta.font.size;\n if(trace.delta.position === 'left') {\n dx = cache(trace, 'deltaPos', 0, -1 * (bignumberbBox.width * (position[trace.align]) + deltabBox.width * (1 - position[trace.align]) + padding), key, Math.min);\n dy = bignumberCenter[1] - deltaCenter[1];\n\n numbersbBox = {\n width: bignumberbBox.width + deltabBox.width + padding,\n height: Math.max(bignumberbBox.height, deltabBox.height),\n left: deltabBox.left + dx,\n right: bignumberbBox.right,\n top: Math.min(bignumberbBox.top, deltabBox.top + dy),\n bottom: Math.max(bignumberbBox.bottom, deltabBox.bottom + dy)\n };\n }\n if(trace.delta.position === 'right') {\n dx = cache(trace, 'deltaPos', 0, bignumberbBox.width * (1 - position[trace.align]) + deltabBox.width * position[trace.align] + padding, key, Math.max);\n dy = bignumberCenter[1] - deltaCenter[1];\n\n numbersbBox = {\n width: bignumberbBox.width + deltabBox.width + padding,\n height: Math.max(bignumberbBox.height, deltabBox.height),\n left: bignumberbBox.left,\n right: deltabBox.right + dx,\n top: Math.min(bignumberbBox.top, deltabBox.top + dy),\n bottom: Math.max(bignumberbBox.bottom, deltabBox.bottom + dy)\n };\n }\n if(trace.delta.position === 'bottom') {\n dx = null;\n dy = deltabBox.height;\n\n numbersbBox = {\n width: Math.max(bignumberbBox.width, deltabBox.width),\n height: bignumberbBox.height + deltabBox.height,\n left: Math.min(bignumberbBox.left, deltabBox.left),\n right: Math.max(bignumberbBox.right, deltabBox.right),\n top: bignumberbBox.bottom - bignumberbBox.height,\n bottom: bignumberbBox.bottom + deltabBox.height\n };\n }\n if(trace.delta.position === 'top') {\n dx = null;\n dy = bignumberbBox.top;\n\n numbersbBox = {\n width: Math.max(bignumberbBox.width, deltabBox.width),\n height: bignumberbBox.height + deltabBox.height,\n left: Math.min(bignumberbBox.left, deltabBox.left),\n right: Math.max(bignumberbBox.right, deltabBox.right),\n top: bignumberbBox.bottom - bignumberbBox.height - deltabBox.height,\n bottom: bignumberbBox.bottom\n };\n }\n\n delta.attr({dx: dx, dy: dy});\n }\n\n // Resize numbers to fit within space and position\n if(trace._hasNumber || trace._hasDelta) {\n numbers.attr('transform', function() {\n var m = opts.numbersScaler(numbersbBox);\n key += m[2];\n var scaleRatio = cache(trace, 'numbersScale', 1, m[0], key, Math.min);\n var translateY;\n if(!trace._scaleNumbers) scaleRatio = 1;\n if(trace._isAngular) {\n // align vertically to bottom\n translateY = numbersY - scaleRatio * numbersbBox.bottom;\n } else {\n // align vertically to center\n translateY = numbersY - scaleRatio * (numbersbBox.top + numbersbBox.bottom) / 2;\n }\n\n // Stash the top position of numbersbBox for title positioning\n trace._numbersTop = scaleRatio * (numbersbBox.top) + translateY;\n\n var ref = numbersbBox[numbersAlign];\n if(numbersAlign === 'center') ref = (numbersbBox.left + numbersbBox.right) / 2;\n var translateX = numbersX - scaleRatio * ref;\n\n // Stash translateX\n translateX = cache(trace, 'numbersTranslate', 0, translateX, key, Math.max);\n return strTranslate(translateX, translateY) + ' scale(' + scaleRatio + ')';\n });\n }\n}\n\n// Apply fill, stroke, stroke-width to SVG shape\nfunction styleShape(p) {\n p\n .each(function(d) { Color.stroke(d3.select(this), d.line.color);})\n .each(function(d) { Color.fill(d3.select(this), d.color);})\n .style('stroke-width', function(d) { return d.line.width;});\n}\n\n// Returns a tween for a transition’s \"d\" attribute, transitioning any selected\n// arcs from their current angle to the specified new angle.\nfunction arcTween(arc, endAngle, newAngle) {\n return function() {\n var interpolate = d3.interpolate(endAngle, newAngle);\n return function(t) {\n return arc.endAngle(interpolate(t))();\n };\n };\n}\n\n// mocks our axis\nfunction mockAxis(gd, opts, zrange) {\n var fullLayout = gd._fullLayout;\n\n var axisIn = Lib.extendFlat({\n type: 'linear',\n ticks: 'outside',\n range: zrange,\n showline: true\n }, opts);\n\n var axisOut = {\n type: 'linear',\n _id: 'x' + opts._id\n };\n\n var axisOptions = {\n letter: 'x',\n font: fullLayout.font,\n noHover: true,\n noTickson: true\n };\n\n function coerce(attr, dflt) {\n return Lib.coerce(axisIn, axisOut, axisLayoutAttrs, attr, dflt);\n }\n\n handleAxisDefaults(axisIn, axisOut, coerce, axisOptions, fullLayout);\n handleAxisPositionDefaults(axisIn, axisOut, coerce, axisOptions);\n\n return axisOut;\n}\n\nfunction strTranslate(x, y) {\n return 'translate(' + x + ',' + y + ')';\n}\n\nfunction fitTextInsideBox(textBB, width, height) {\n // compute scaling ratio to have text fit within specified width and height\n var ratio = Math.min(width / textBB.width, height / textBB.height);\n return [ratio, textBB, width + 'x' + height];\n}\n\nfunction fitTextInsideCircle(textBB, radius) {\n // compute scaling ratio to have text fit within specified radius\n var elRadius = Math.sqrt((textBB.width / 2) * (textBB.width / 2) + textBB.height * textBB.height);\n var ratio = radius / elRadius;\n return [ratio, textBB, radius];\n}\n\nfunction measureText(txt, font, textAnchor, gd) {\n var element = document.createElementNS('http://www.w3.org/2000/svg', 'text');\n var sel = d3.select(element);\n sel.text(txt)\n .attr('x', 0)\n .attr('y', 0)\n .attr('text-anchor', textAnchor)\n .attr('data-unformatted', txt)\n .call(svgTextUtils.convertToTspans, gd)\n .call(Drawing.font, font);\n return Drawing.bBox(sel.node());\n}\n\nfunction cache(trace, name, initialValue, value, key, fn) {\n var objName = '_cache' + name;\n if(!(trace[objName] && trace[objName].key === key)) {\n trace[objName] = {key: key, value: initialValue};\n }\n var v = Lib.aggNums(fn, null, [trace[objName].value, value], 2);\n trace[objName].value = v;\n\n return v;\n}\n\n},{\"../../components/color\":595,\"../../components/drawing\":617,\"../../constants/alignment\":697,\"../../lib\":728,\"../../lib/svg_text_utils\":752,\"../../plots/cartesian/axes\":776,\"../../plots/cartesian/axis_defaults\":778,\"../../plots/cartesian/layout_attributes\":790,\"../../plots/cartesian/position_defaults\":793,\"./constants\":1066,\"d3\":164}],1070:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar meshAttrs = _dereq_('../mesh3d/attributes');\nvar baseAttrs = _dereq_('../../plots/attributes');\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\nvar overrideAll = _dereq_('../../plot_api/edit_types').overrideAll;\n\nfunction makeSliceAttr(axLetter) {\n return {\n show: {\n valType: 'boolean',\n \n dflt: false,\n \n },\n locations: {\n valType: 'data_array',\n dflt: [],\n \n \n },\n fill: {\n valType: 'number',\n \n min: 0,\n max: 1,\n dflt: 1,\n \n }\n };\n}\n\nfunction makeCapAttr(axLetter) {\n return {\n show: {\n valType: 'boolean',\n \n dflt: true,\n \n },\n fill: {\n valType: 'number',\n \n min: 0,\n max: 1,\n dflt: 1,\n \n }\n };\n}\n\nvar attrs = module.exports = overrideAll(extendFlat({\n x: {\n valType: 'data_array',\n \n \n },\n y: {\n valType: 'data_array',\n \n \n },\n z: {\n valType: 'data_array',\n \n \n },\n value: {\n valType: 'data_array',\n \n \n },\n isomin: {\n valType: 'number',\n \n \n },\n isomax: {\n valType: 'number',\n \n \n },\n\n surface: {\n show: {\n valType: 'boolean',\n \n dflt: true,\n \n },\n count: {\n valType: 'integer',\n \n dflt: 2,\n min: 1,\n \n },\n fill: {\n valType: 'number',\n \n min: 0,\n max: 1,\n dflt: 1,\n \n },\n pattern: {\n valType: 'flaglist',\n flags: ['A', 'B', 'C', 'D', 'E'],\n extras: ['all', 'odd', 'even'],\n dflt: 'all',\n \n \n }\n },\n\n spaceframe: {\n show: {\n valType: 'boolean',\n \n dflt: false,\n \n },\n fill: {\n valType: 'number',\n \n min: 0,\n max: 1,\n dflt: 0.15,\n \n }\n },\n\n slices: {\n x: makeSliceAttr('x'),\n y: makeSliceAttr('y'),\n z: makeSliceAttr('z')\n },\n\n caps: {\n x: makeCapAttr('x'),\n y: makeCapAttr('y'),\n z: makeCapAttr('z')\n },\n\n text: {\n valType: 'string',\n \n dflt: '',\n arrayOk: true,\n \n },\n hovertext: {\n valType: 'string',\n \n dflt: '',\n arrayOk: true,\n \n },\n hovertemplate: hovertemplateAttrs(),\n showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})\n},\n\ncolorScaleAttrs('', {\n colorAttr: '`value`',\n showScaleDflt: true,\n editTypeOverride: 'calc'\n}), {\n opacity: meshAttrs.opacity,\n lightposition: meshAttrs.lightposition,\n lighting: meshAttrs.lighting,\n flatshading: meshAttrs.flatshading,\n contour: meshAttrs.contour,\n\n hoverinfo: extendFlat({}, baseAttrs.hoverinfo)\n}), 'calc', 'nested');\n\n// required defaults to speed up surface normal calculations\nattrs.flatshading.dflt = true; attrs.lighting.facenormalsepsilon.dflt = 0;\n\nattrs.x.editType = attrs.y.editType = attrs.z.editType = attrs.value.editType = 'calc+clearAxisTypes';\nattrs.transforms = undefined;\n\n},{\"../../components/colorscale/attributes\":602,\"../../lib/extend\":719,\"../../plot_api/edit_types\":759,\"../../plots/attributes\":773,\"../../plots/template_attributes\":854,\"../mesh3d/attributes\":1075}],1071:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar colorscaleCalc = _dereq_('../../components/colorscale/calc');\nvar processGrid = _dereq_('../streamtube/calc').processGrid;\nvar filter = _dereq_('../streamtube/calc').filter;\n\nmodule.exports = function calc(gd, trace) {\n trace._len = Math.min(\n trace.x.length,\n trace.y.length,\n trace.z.length,\n trace.value.length\n );\n\n trace._x = filter(trace.x, trace._len);\n trace._y = filter(trace.y, trace._len);\n trace._z = filter(trace.z, trace._len);\n trace._value = filter(trace.value, trace._len);\n\n var grid = processGrid(trace);\n trace._gridFill = grid.fill;\n trace._Xs = grid.Xs;\n trace._Ys = grid.Ys;\n trace._Zs = grid.Zs;\n trace._len = grid.len;\n\n var min = Infinity;\n var max = -Infinity;\n for(var i = 0; i < trace._len; i++) {\n var v = trace._value[i];\n min = Math.min(min, v);\n max = Math.max(max, v);\n }\n\n trace._minValues = min;\n trace._maxValues = max;\n trace._vMin = (trace.isomin === undefined || trace.isomin === null) ? min : trace.isomin;\n trace._vMax = (trace.isomax === undefined || trace.isomin === null) ? max : trace.isomax;\n\n colorscaleCalc(gd, trace, {\n vals: [trace._vMin, trace._vMax],\n containerStr: '',\n cLetter: 'c'\n });\n};\n\n},{\"../../components/colorscale/calc\":603,\"../streamtube/calc\":1241}],1072:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar createMesh = _dereq_('gl-mesh3d');\nvar parseColorScale = _dereq_('../../lib/gl_format_color').parseColorScale;\nvar str2RgbaArray = _dereq_('../../lib/str2rgbarray');\nvar extractOpts = _dereq_('../../components/colorscale').extractOpts;\nvar zip3 = _dereq_('../../plots/gl3d/zip3');\n\nvar findNearestOnAxis = function(w, arr) {\n for(var q = arr.length - 1; q > 0; q--) {\n var min = Math.min(arr[q], arr[q - 1]);\n var max = Math.max(arr[q], arr[q - 1]);\n if(max > min && min < w && w <= max) {\n return {\n id: q,\n distRatio: (max - w) / (max - min)\n };\n }\n }\n return {\n id: 0,\n distRatio: 0\n };\n};\n\nfunction IsosurfaceTrace(scene, mesh, uid) {\n this.scene = scene;\n this.uid = uid;\n this.mesh = mesh;\n this.name = '';\n this.data = null;\n this.showContour = false;\n}\n\nvar proto = IsosurfaceTrace.prototype;\n\nproto.handlePick = function(selection) {\n if(selection.object === this.mesh) {\n var rawId = selection.data.index;\n\n var x = this.data._meshX[rawId];\n var y = this.data._meshY[rawId];\n var z = this.data._meshZ[rawId];\n\n var height = this.data._Ys.length;\n var depth = this.data._Zs.length;\n\n var i = findNearestOnAxis(x, this.data._Xs).id;\n var j = findNearestOnAxis(y, this.data._Ys).id;\n var k = findNearestOnAxis(z, this.data._Zs).id;\n\n var selectIndex = selection.index = k + depth * j + depth * height * i;\n\n selection.traceCoordinate = [\n this.data._meshX[selectIndex],\n this.data._meshY[selectIndex],\n this.data._meshZ[selectIndex],\n this.data._value[selectIndex]\n ];\n\n var text = this.data.hovertext || this.data.text;\n if(Array.isArray(text) && text[selectIndex] !== undefined) {\n selection.textLabel = text[selectIndex];\n } else if(text) {\n selection.textLabel = text;\n }\n\n return true;\n }\n};\n\nproto.update = function(data) {\n var scene = this.scene;\n var layout = scene.fullSceneLayout;\n\n this.data = generateIsoMeshes(data);\n\n // Unpack position data\n function toDataCoords(axis, coord, scale, calendar) {\n return coord.map(function(x) {\n return axis.d2l(x, 0, calendar) * scale;\n });\n }\n\n var positions = zip3(\n toDataCoords(layout.xaxis, data._meshX, scene.dataScale[0], data.xcalendar),\n toDataCoords(layout.yaxis, data._meshY, scene.dataScale[1], data.ycalendar),\n toDataCoords(layout.zaxis, data._meshZ, scene.dataScale[2], data.zcalendar));\n\n var cells = zip3(data._meshI, data._meshJ, data._meshK);\n\n var config = {\n positions: positions,\n cells: cells,\n lightPosition: [data.lightposition.x, data.lightposition.y, data.lightposition.z],\n ambient: data.lighting.ambient,\n diffuse: data.lighting.diffuse,\n specular: data.lighting.specular,\n roughness: data.lighting.roughness,\n fresnel: data.lighting.fresnel,\n vertexNormalsEpsilon: data.lighting.vertexnormalsepsilon,\n faceNormalsEpsilon: data.lighting.facenormalsepsilon,\n opacity: data.opacity,\n contourEnable: data.contour.show,\n contourColor: str2RgbaArray(data.contour.color).slice(0, 3),\n contourWidth: data.contour.width,\n useFacetNormals: data.flatshading\n };\n\n var cOpts = extractOpts(data);\n config.vertexIntensity = data._meshIntensity;\n config.vertexIntensityBounds = [cOpts.min, cOpts.max];\n config.colormap = parseColorScale(data);\n\n // Update mesh\n this.mesh.update(config);\n};\n\nproto.dispose = function() {\n this.scene.glplot.remove(this.mesh);\n this.mesh.dispose();\n};\n\nvar GRID_TYPES = ['xyz', 'xzy', 'yxz', 'yzx', 'zxy', 'zyx'];\n\nfunction generateIsoMeshes(data) {\n data._meshI = [];\n data._meshJ = [];\n data._meshK = [];\n\n var showSurface = data.surface.show;\n var showSpaceframe = data.spaceframe.show;\n\n var surfaceFill = data.surface.fill;\n var spaceframeFill = data.spaceframe.fill;\n\n var drawingSurface = false;\n var drawingSpaceframe = false;\n\n var numFaces = 0;\n var numVertices;\n var beginVertextLength;\n\n var Xs = data._Xs;\n var Ys = data._Ys;\n var Zs = data._Zs;\n\n var width = Xs.length;\n var height = Ys.length;\n var depth = Zs.length;\n\n var filled = GRID_TYPES.indexOf(data._gridFill.replace(/-/g, '').replace(/\\+/g, ''));\n\n var getIndex = function(i, j, k) {\n switch(filled) {\n case 5: // 'zyx'\n return k + depth * j + depth * height * i;\n case 4: // 'zxy'\n return k + depth * i + depth * width * j;\n case 3: // 'yzx'\n return j + height * k + height * depth * i;\n case 2: // 'yxz'\n return j + height * i + height * width * k;\n case 1: // 'xzy'\n return i + width * k + width * depth * j;\n default: // case 0: // 'xyz'\n return i + width * j + width * height * k;\n }\n };\n\n var minValues = data._minValues;\n var maxValues = data._maxValues;\n\n var vMin = data._vMin;\n var vMax = data._vMax;\n\n var allXs;\n var allYs;\n var allZs;\n var allVs;\n\n function findVertexId(x, y, z) {\n // could be used to find the vertex id of previously generated vertex within the group\n\n var len = allVs.length;\n for(var f = beginVertextLength; f < len; f++) {\n if(\n x === allXs[f] &&\n y === allYs[f] &&\n z === allZs[f]\n ) {\n return f;\n }\n }\n return -1;\n }\n\n function beginGroup() {\n beginVertextLength = numVertices;\n }\n\n function emptyVertices() {\n allXs = [];\n allYs = [];\n allZs = [];\n allVs = [];\n numVertices = 0;\n\n beginGroup();\n }\n\n function addVertex(x, y, z, v) {\n allXs.push(x);\n allYs.push(y);\n allZs.push(z);\n allVs.push(v);\n numVertices++;\n\n return numVertices - 1;\n }\n\n function addFace(a, b, c) {\n data._meshI.push(a);\n data._meshJ.push(b);\n data._meshK.push(c);\n numFaces++;\n\n return numFaces - 1;\n }\n\n function getCenter(A, B, C) {\n var M = [];\n for(var i = 0; i < A.length; i++) {\n M[i] = (A[i] + B[i] + C[i]) / 3.0;\n }\n return M;\n }\n\n function getBetween(A, B, r) {\n var M = [];\n for(var i = 0; i < A.length; i++) {\n M[i] = A[i] * (1 - r) + r * B[i];\n }\n return M;\n }\n\n var activeFill;\n function setFill(fill) {\n activeFill = fill;\n }\n\n function createOpenTri(xyzv, abc) {\n var A = xyzv[0];\n var B = xyzv[1];\n var C = xyzv[2];\n var G = getCenter(A, B, C);\n\n var r = Math.sqrt(1 - activeFill);\n var p1 = getBetween(G, A, r);\n var p2 = getBetween(G, B, r);\n var p3 = getBetween(G, C, r);\n\n var a = abc[0];\n var b = abc[1];\n var c = abc[2];\n\n return {\n xyzv: [\n [A, B, p2], [p2, p1, A],\n [B, C, p3], [p3, p2, B],\n [C, A, p1], [p1, p3, C]\n ],\n abc: [\n [a, b, -1], [-1, -1, a],\n [b, c, -1], [-1, -1, b],\n [c, a, -1], [-1, -1, c]\n ]\n };\n }\n\n function styleIncludes(style, char) {\n if(style === 'all' || style === null) return true;\n return (style.indexOf(char) > -1);\n }\n\n function mapValue(style, value) {\n if(style === null) return value;\n return style;\n }\n\n function drawTri(style, xyzv, abc) {\n beginGroup();\n\n var allXYZVs = [xyzv];\n var allABCs = [abc];\n if(activeFill >= 1) {\n allXYZVs = [xyzv];\n allABCs = [abc];\n } else if(activeFill > 0) {\n var openTri = createOpenTri(xyzv, abc);\n allXYZVs = openTri.xyzv;\n allABCs = openTri.abc;\n }\n\n for(var f = 0; f < allXYZVs.length; f++) {\n xyzv = allXYZVs[f];\n abc = allABCs[f];\n\n var pnts = [];\n for(var i = 0; i < 3; i++) {\n var x = xyzv[i][0];\n var y = xyzv[i][1];\n var z = xyzv[i][2];\n var v = xyzv[i][3];\n\n var id = (abc[i] > -1) ? abc[i] : findVertexId(x, y, z);\n if(id > -1) {\n pnts[i] = id;\n } else {\n pnts[i] = addVertex(x, y, z, mapValue(style, v));\n }\n }\n\n addFace(pnts[0], pnts[1], pnts[2]);\n }\n }\n\n function drawQuad(style, xyzv, abcd) {\n var makeTri = function(i, j, k) {\n drawTri(style, [xyzv[i], xyzv[j], xyzv[k]], [abcd[i], abcd[j], abcd[k]]);\n };\n\n makeTri(0, 1, 2);\n makeTri(2, 3, 0);\n }\n\n function drawTetra(style, xyzv, abcd) {\n var makeTri = function(i, j, k) {\n drawTri(style, [xyzv[i], xyzv[j], xyzv[k]], [abcd[i], abcd[j], abcd[k]]);\n };\n\n makeTri(0, 1, 2);\n makeTri(3, 0, 1);\n makeTri(2, 3, 0);\n makeTri(1, 2, 3);\n }\n\n function calcIntersection(pointOut, pointIn, min, max) {\n var value = pointOut[3];\n\n if(value < min) value = min;\n if(value > max) value = max;\n\n var ratio = (pointOut[3] - value) / (pointOut[3] - pointIn[3] + 0.000000001); // we had to add this error to force solve the tiny caps\n\n var result = [];\n for(var s = 0; s < 4; s++) {\n result[s] = (1 - ratio) * pointOut[s] + ratio * pointIn[s];\n }\n return result;\n }\n\n function inRange(value, min, max) {\n return (\n value >= min &&\n value <= max\n );\n }\n\n function almostInFinalRange(value) {\n var vErr = 0.001 * (vMax - vMin);\n return (\n value >= vMin - vErr &&\n value <= vMax + vErr\n );\n }\n\n function getXYZV(indecies) {\n var xyzv = [];\n for(var q = 0; q < 4; q++) {\n var index = indecies[q];\n xyzv.push(\n [\n data._x[index],\n data._y[index],\n data._z[index],\n data._value[index]\n ]\n );\n }\n\n return xyzv;\n }\n\n var MAX_PASS = 3;\n\n function tryCreateTri(style, xyzv, abc, min, max, nPass) {\n if(!nPass) nPass = 1;\n\n abc = [-1, -1, -1]; // Note: for the moment we override indices\n // to run faster! But it is possible to comment this line\n // to reduce the number of vertices.\n\n var result = false;\n\n var ok = [\n inRange(xyzv[0][3], min, max),\n inRange(xyzv[1][3], min, max),\n inRange(xyzv[2][3], min, max)\n ];\n\n if(!ok[0] && !ok[1] && !ok[2]) {\n return false;\n }\n\n var tryDrawTri = function(style, xyzv, abc) {\n if( // we check here if the points are in `real` iso-min/max range\n almostInFinalRange(xyzv[0][3]) &&\n almostInFinalRange(xyzv[1][3]) &&\n almostInFinalRange(xyzv[2][3])\n ) {\n drawTri(style, xyzv, abc);\n return true;\n } else if(nPass < MAX_PASS) {\n return tryCreateTri(style, xyzv, abc, vMin, vMax, ++nPass); // i.e. second pass using actual vMin vMax bounds\n }\n return false;\n };\n\n if(ok[0] && ok[1] && ok[2]) {\n return tryDrawTri(style, xyzv, abc) || result;\n }\n\n var interpolated = false;\n\n [\n [0, 1, 2],\n [2, 0, 1],\n [1, 2, 0]\n ].forEach(function(e) {\n if(ok[e[0]] && ok[e[1]] && !ok[e[2]]) {\n var A = xyzv[e[0]];\n var B = xyzv[e[1]];\n var C = xyzv[e[2]];\n\n var p1 = calcIntersection(C, A, min, max);\n var p2 = calcIntersection(C, B, min, max);\n\n result = tryDrawTri(style, [p2, p1, A], [-1, -1, abc[e[0]]]) || result;\n result = tryDrawTri(style, [A, B, p2], [abc[e[0]], abc[e[1]], -1]) || result;\n\n interpolated = true;\n }\n });\n if(interpolated) return result;\n\n [\n [0, 1, 2],\n [1, 2, 0],\n [2, 0, 1]\n ].forEach(function(e) {\n if(ok[e[0]] && !ok[e[1]] && !ok[e[2]]) {\n var A = xyzv[e[0]];\n var B = xyzv[e[1]];\n var C = xyzv[e[2]];\n\n var p1 = calcIntersection(B, A, min, max);\n var p2 = calcIntersection(C, A, min, max);\n\n result = tryDrawTri(style, [p2, p1, A], [-1, -1, abc[e[0]]]) || result;\n\n interpolated = true;\n }\n });\n return result;\n }\n\n function tryCreateTetra(style, abcd, min, max) {\n var result = false;\n\n var xyzv = getXYZV(abcd);\n\n var ok = [\n inRange(xyzv[0][3], min, max),\n inRange(xyzv[1][3], min, max),\n inRange(xyzv[2][3], min, max),\n inRange(xyzv[3][3], min, max)\n ];\n\n if(!ok[0] && !ok[1] && !ok[2] && !ok[3]) {\n return result;\n }\n\n if(ok[0] && ok[1] && ok[2] && ok[3]) {\n if(drawingSpaceframe) {\n result = drawTetra(style, xyzv, abcd) || result;\n }\n return result;\n }\n\n var interpolated = false;\n\n [\n [0, 1, 2, 3],\n [3, 0, 1, 2],\n [2, 3, 0, 1],\n [1, 2, 3, 0]\n ].forEach(function(e) {\n if(ok[e[0]] && ok[e[1]] && ok[e[2]] && !ok[e[3]]) {\n var A = xyzv[e[0]];\n var B = xyzv[e[1]];\n var C = xyzv[e[2]];\n var D = xyzv[e[3]];\n\n if(drawingSpaceframe) {\n result = drawTri(style, [A, B, C], [abcd[e[0]], abcd[e[1]], abcd[e[2]]]) || result;\n } else {\n var p1 = calcIntersection(D, A, min, max);\n var p2 = calcIntersection(D, B, min, max);\n var p3 = calcIntersection(D, C, min, max);\n\n result = drawTri(null, [p1, p2, p3], [-1, -1, -1]) || result;\n }\n\n interpolated = true;\n }\n });\n if(interpolated) return result;\n\n [\n [0, 1, 2, 3],\n [1, 2, 3, 0],\n [2, 3, 0, 1],\n [3, 0, 1, 2],\n [0, 2, 3, 1],\n [1, 3, 2, 0]\n ].forEach(function(e) {\n if(ok[e[0]] && ok[e[1]] && !ok[e[2]] && !ok[e[3]]) {\n var A = xyzv[e[0]];\n var B = xyzv[e[1]];\n var C = xyzv[e[2]];\n var D = xyzv[e[3]];\n\n var p1 = calcIntersection(C, A, min, max);\n var p2 = calcIntersection(C, B, min, max);\n var p3 = calcIntersection(D, B, min, max);\n var p4 = calcIntersection(D, A, min, max);\n\n if(drawingSpaceframe) {\n result = drawTri(style, [A, p4, p1], [abcd[e[0]], -1, -1]) || result;\n result = drawTri(style, [B, p2, p3], [abcd[e[1]], -1, -1]) || result;\n } else {\n result = drawQuad(null, [p1, p2, p3, p4], [-1, -1, -1, -1]) || result;\n }\n\n interpolated = true;\n }\n });\n if(interpolated) return result;\n\n [\n [0, 1, 2, 3],\n [1, 2, 3, 0],\n [2, 3, 0, 1],\n [3, 0, 1, 2]\n ].forEach(function(e) {\n if(ok[e[0]] && !ok[e[1]] && !ok[e[2]] && !ok[e[3]]) {\n var A = xyzv[e[0]];\n var B = xyzv[e[1]];\n var C = xyzv[e[2]];\n var D = xyzv[e[3]];\n\n var p1 = calcIntersection(B, A, min, max);\n var p2 = calcIntersection(C, A, min, max);\n var p3 = calcIntersection(D, A, min, max);\n\n if(drawingSpaceframe) {\n result = drawTri(style, [A, p1, p2], [abcd[e[0]], -1, -1]) || result;\n result = drawTri(style, [A, p2, p3], [abcd[e[0]], -1, -1]) || result;\n result = drawTri(style, [A, p3, p1], [abcd[e[0]], -1, -1]) || result;\n } else {\n result = drawTri(null, [p1, p2, p3], [-1, -1, -1]) || result;\n }\n\n interpolated = true;\n }\n });\n return result;\n }\n\n function addCube(style, p000, p001, p010, p011, p100, p101, p110, p111, min, max) {\n var result = false;\n\n if(drawingSurface) {\n if(styleIncludes(style, 'A')) {\n result = tryCreateTetra(null, [p000, p001, p010, p100], min, max) || result;\n }\n if(styleIncludes(style, 'B')) {\n result = tryCreateTetra(null, [p001, p010, p011, p111], min, max) || result;\n }\n if(styleIncludes(style, 'C')) {\n result = tryCreateTetra(null, [p001, p100, p101, p111], min, max) || result;\n }\n if(styleIncludes(style, 'D')) {\n result = tryCreateTetra(null, [p010, p100, p110, p111], min, max) || result;\n }\n if(styleIncludes(style, 'E')) {\n result = tryCreateTetra(null, [p001, p010, p100, p111], min, max) || result;\n }\n }\n\n if(drawingSpaceframe) {\n result = tryCreateTetra(style, [p001, p010, p100, p111], min, max) || result;\n }\n\n return result;\n }\n\n function addRect(style, a, b, c, d, min, max, previousResult) {\n return [\n (previousResult[0] === true) ? true :\n tryCreateTri(style, getXYZV([a, b, c]), [a, b, c], min, max),\n (previousResult[1] === true) ? true :\n tryCreateTri(style, getXYZV([c, d, a]), [c, d, a], min, max)\n ];\n }\n\n function begin2dCell(style, p00, p01, p10, p11, min, max, isEven, previousResult) {\n // used to create caps and/or slices on exact axis points\n if(isEven) {\n return addRect(style, p00, p01, p11, p10, min, max, previousResult);\n } else {\n return addRect(style, p01, p11, p10, p00, min, max, previousResult);\n }\n }\n\n function beginSection(style, i, j, k, min, max, distRatios) {\n // used to create slices between axis points\n\n var result = false;\n var A, B, C, D;\n\n var makeSection = function() {\n result = tryCreateTri(style, [A, B, C], [-1, -1, -1], min, max) || result;\n result = tryCreateTri(style, [C, D, A], [-1, -1, -1], min, max) || result;\n };\n\n var rX = distRatios[0];\n var rY = distRatios[1];\n var rZ = distRatios[2];\n\n if(rX) {\n A = getBetween(getXYZV([getIndex(i, j - 0, k - 0)])[0], getXYZV([getIndex(i - 1, j - 0, k - 0)])[0], rX);\n B = getBetween(getXYZV([getIndex(i, j - 0, k - 1)])[0], getXYZV([getIndex(i - 1, j - 0, k - 1)])[0], rX);\n C = getBetween(getXYZV([getIndex(i, j - 1, k - 1)])[0], getXYZV([getIndex(i - 1, j - 1, k - 1)])[0], rX);\n D = getBetween(getXYZV([getIndex(i, j - 1, k - 0)])[0], getXYZV([getIndex(i - 1, j - 1, k - 0)])[0], rX);\n makeSection();\n }\n\n if(rY) {\n A = getBetween(getXYZV([getIndex(i - 0, j, k - 0)])[0], getXYZV([getIndex(i - 0, j - 1, k - 0)])[0], rY);\n B = getBetween(getXYZV([getIndex(i - 0, j, k - 1)])[0], getXYZV([getIndex(i - 0, j - 1, k - 1)])[0], rY);\n C = getBetween(getXYZV([getIndex(i - 1, j, k - 1)])[0], getXYZV([getIndex(i - 1, j - 1, k - 1)])[0], rY);\n D = getBetween(getXYZV([getIndex(i - 1, j, k - 0)])[0], getXYZV([getIndex(i - 1, j - 1, k - 0)])[0], rY);\n makeSection();\n }\n\n if(rZ) {\n A = getBetween(getXYZV([getIndex(i - 0, j - 0, k)])[0], getXYZV([getIndex(i - 0, j - 0, k - 1)])[0], rZ);\n B = getBetween(getXYZV([getIndex(i - 0, j - 1, k)])[0], getXYZV([getIndex(i - 0, j - 1, k - 1)])[0], rZ);\n C = getBetween(getXYZV([getIndex(i - 1, j - 1, k)])[0], getXYZV([getIndex(i - 1, j - 1, k - 1)])[0], rZ);\n D = getBetween(getXYZV([getIndex(i - 1, j - 0, k)])[0], getXYZV([getIndex(i - 1, j - 0, k - 1)])[0], rZ);\n makeSection();\n }\n\n return result;\n }\n\n function begin3dCell(style, p000, p001, p010, p011, p100, p101, p110, p111, min, max, isEven) {\n // used to create spaceframe and/or iso-surfaces\n\n var cellStyle = style;\n if(isEven) {\n if(drawingSurface && style === 'even') cellStyle = null;\n return addCube(cellStyle, p000, p001, p010, p011, p100, p101, p110, p111, min, max);\n } else {\n if(drawingSurface && style === 'odd') cellStyle = null;\n return addCube(cellStyle, p111, p110, p101, p100, p011, p010, p001, p000, min, max);\n }\n }\n\n function draw2dX(style, items, min, max, previousResult) {\n var result = [];\n var n = 0;\n for(var q = 0; q < items.length; q++) {\n var i = items[q];\n for(var k = 1; k < depth; k++) {\n for(var j = 1; j < height; j++) {\n result.push(\n begin2dCell(style,\n getIndex(i, j - 1, k - 1),\n getIndex(i, j - 1, k),\n getIndex(i, j, k - 1),\n getIndex(i, j, k),\n min,\n max,\n (i + j + k) % 2,\n (previousResult && previousResult[n]) ? previousResult[n] : []\n )\n );\n n++;\n }\n }\n }\n return result;\n }\n\n function draw2dY(style, items, min, max, previousResult) {\n var result = [];\n var n = 0;\n for(var q = 0; q < items.length; q++) {\n var j = items[q];\n for(var i = 1; i < width; i++) {\n for(var k = 1; k < depth; k++) {\n result.push(\n begin2dCell(style,\n getIndex(i - 1, j, k - 1),\n getIndex(i, j, k - 1),\n getIndex(i - 1, j, k),\n getIndex(i, j, k),\n min,\n max,\n (i + j + k) % 2,\n (previousResult && previousResult[n]) ? previousResult[n] : []\n )\n );\n n++;\n }\n }\n }\n return result;\n }\n\n function draw2dZ(style, items, min, max, previousResult) {\n var result = [];\n var n = 0;\n for(var q = 0; q < items.length; q++) {\n var k = items[q];\n for(var j = 1; j < height; j++) {\n for(var i = 1; i < width; i++) {\n result.push(\n begin2dCell(style,\n getIndex(i - 1, j - 1, k),\n getIndex(i - 1, j, k),\n getIndex(i, j - 1, k),\n getIndex(i, j, k),\n min,\n max,\n (i + j + k) % 2,\n (previousResult && previousResult[n]) ? previousResult[n] : []\n )\n );\n n++;\n }\n }\n }\n return result;\n }\n\n function draw3d(style, min, max) {\n for(var k = 1; k < depth; k++) {\n for(var j = 1; j < height; j++) {\n for(var i = 1; i < width; i++) {\n begin3dCell(style,\n getIndex(i - 1, j - 1, k - 1),\n getIndex(i - 1, j - 1, k),\n getIndex(i - 1, j, k - 1),\n getIndex(i - 1, j, k),\n getIndex(i, j - 1, k - 1),\n getIndex(i, j - 1, k),\n getIndex(i, j, k - 1),\n getIndex(i, j, k),\n min,\n max,\n (i + j + k) % 2\n );\n }\n }\n }\n }\n\n function drawSpaceframe(style, min, max) {\n drawingSpaceframe = true;\n draw3d(style, min, max);\n drawingSpaceframe = false;\n }\n\n function drawSurface(style, min, max) {\n drawingSurface = true;\n draw3d(style, min, max);\n drawingSurface = false;\n }\n\n function drawSectionX(style, items, min, max, distRatios, previousResult) {\n var result = [];\n var n = 0;\n for(var q = 0; q < items.length; q++) {\n var i = items[q];\n for(var k = 1; k < depth; k++) {\n for(var j = 1; j < height; j++) {\n result.push(\n beginSection(style, i, j, k, min, max, distRatios[q],\n (previousResult && previousResult[n]) ? previousResult[n] : []\n )\n );\n n++;\n }\n }\n }\n return result;\n }\n\n function drawSectionY(style, items, min, max, distRatios, previousResult) {\n var result = [];\n var n = 0;\n for(var q = 0; q < items.length; q++) {\n var j = items[q];\n for(var i = 1; i < width; i++) {\n for(var k = 1; k < depth; k++) {\n result.push(\n beginSection(style, i, j, k, min, max, distRatios[q],\n (previousResult && previousResult[n]) ? previousResult[n] : []\n )\n );\n n++;\n }\n }\n }\n return result;\n }\n\n function drawSectionZ(style, items, min, max, distRatios, previousResult) {\n var result = [];\n var n = 0;\n for(var q = 0; q < items.length; q++) {\n var k = items[q];\n for(var j = 1; j < height; j++) {\n for(var i = 1; i < width; i++) {\n result.push(\n beginSection(style, i, j, k, min, max, distRatios[q],\n (previousResult && previousResult[n]) ? previousResult[n] : []\n )\n );\n n++;\n }\n }\n }\n return result;\n }\n\n function createRange(a, b) {\n var range = [];\n for(var q = a; q < b; q++) {\n range.push(q);\n }\n return range;\n }\n\n function insertGridPoints() {\n for(var i = 0; i < width; i++) {\n for(var j = 0; j < height; j++) {\n for(var k = 0; k < depth; k++) {\n var index = getIndex(i, j, k);\n addVertex(\n data._x[index],\n data._y[index],\n data._z[index],\n data._value[index]\n );\n }\n }\n }\n }\n\n function drawAll() {\n emptyVertices();\n\n // insert grid points\n insertGridPoints();\n\n var activeStyle = null;\n\n // draw spaceframes\n if(showSpaceframe && spaceframeFill) {\n setFill(spaceframeFill);\n\n drawSpaceframe(activeStyle, vMin, vMax);\n }\n\n // draw iso-surfaces\n if(showSurface && surfaceFill) {\n setFill(surfaceFill);\n\n var surfacePattern = data.surface.pattern;\n var surfaceCount = data.surface.count;\n for(var q = 0; q < surfaceCount; q++) {\n var ratio = (surfaceCount === 1) ? 0.5 : q / (surfaceCount - 1);\n var level = (1 - ratio) * vMin + ratio * vMax;\n\n var d1 = Math.abs(level - minValues);\n var d2 = Math.abs(level - maxValues);\n var ranges = (d1 > d2) ?\n [minValues, level] :\n [level, maxValues];\n\n drawSurface(surfacePattern, ranges[0], ranges[1]);\n }\n }\n\n var setupMinMax = [\n [ Math.min(vMin, maxValues), Math.max(vMin, maxValues) ],\n [ Math.min(minValues, vMax), Math.max(minValues, vMax) ]\n ];\n\n ['x', 'y', 'z'].forEach(function(e) {\n var preRes = [];\n for(var s = 0; s < setupMinMax.length; s++) {\n var count = 0;\n\n var activeMin = setupMinMax[s][0];\n var activeMax = setupMinMax[s][1];\n\n // draw slices\n var slice = data.slices[e];\n if(slice.show && slice.fill) {\n setFill(slice.fill);\n\n var exactIndices = [];\n var ceilIndices = [];\n var distRatios = [];\n if(slice.locations.length) {\n for(var q = 0; q < slice.locations.length; q++) {\n var near = findNearestOnAxis(\n slice.locations[q],\n (e === 'x') ? Xs :\n (e === 'y') ? Ys : Zs\n );\n\n if(near.distRatio === 0) {\n exactIndices.push(near.id);\n } else if(near.id > 0) {\n ceilIndices.push(near.id);\n if(e === 'x') {\n distRatios.push([near.distRatio, 0, 0]);\n } else if(e === 'y') {\n distRatios.push([0, near.distRatio, 0]);\n } else {\n distRatios.push([0, 0, near.distRatio]);\n }\n }\n }\n } else {\n if(e === 'x') {\n exactIndices = createRange(1, width - 1);\n } else if(e === 'y') {\n exactIndices = createRange(1, height - 1);\n } else {\n exactIndices = createRange(1, depth - 1);\n }\n }\n\n if(ceilIndices.length > 0) {\n if(e === 'x') {\n preRes[count] = drawSectionX(activeStyle, ceilIndices, activeMin, activeMax, distRatios, preRes[count]);\n } else if(e === 'y') {\n preRes[count] = drawSectionY(activeStyle, ceilIndices, activeMin, activeMax, distRatios, preRes[count]);\n } else {\n preRes[count] = drawSectionZ(activeStyle, ceilIndices, activeMin, activeMax, distRatios, preRes[count]);\n }\n count++;\n }\n\n if(exactIndices.length > 0) {\n if(e === 'x') {\n preRes[count] = draw2dX(activeStyle, exactIndices, activeMin, activeMax, preRes[count]);\n } else if(e === 'y') {\n preRes[count] = draw2dY(activeStyle, exactIndices, activeMin, activeMax, preRes[count]);\n } else {\n preRes[count] = draw2dZ(activeStyle, exactIndices, activeMin, activeMax, preRes[count]);\n }\n count++;\n }\n }\n\n // draw caps\n var cap = data.caps[e];\n if(cap.show && cap.fill) {\n setFill(cap.fill);\n if(e === 'x') {\n preRes[count] = draw2dX(activeStyle, [0, width - 1], activeMin, activeMax, preRes[count]);\n } else if(e === 'y') {\n preRes[count] = draw2dY(activeStyle, [0, height - 1], activeMin, activeMax, preRes[count]);\n } else {\n preRes[count] = draw2dZ(activeStyle, [0, depth - 1], activeMin, activeMax, preRes[count]);\n }\n count++;\n }\n }\n });\n\n // remove vertices arrays (i.e. grid points) in case no face was created.\n if(numFaces === 0) {\n emptyVertices();\n }\n\n data._meshX = allXs;\n data._meshY = allYs;\n data._meshZ = allZs;\n data._meshIntensity = allVs;\n\n data._Xs = Xs;\n data._Ys = Ys;\n data._Zs = Zs;\n }\n\n drawAll();\n\n return data;\n}\n\nfunction createIsosurfaceTrace(scene, data) {\n var gl = scene.glplot.gl;\n var mesh = createMesh({gl: gl});\n var result = new IsosurfaceTrace(scene, mesh, data.uid);\n\n mesh._trace = result;\n result.update(data);\n scene.glplot.add(mesh);\n return result;\n}\n\nmodule.exports = {\n findNearestOnAxis: findNearestOnAxis,\n generateIsoMeshes: generateIsoMeshes,\n createIsosurfaceTrace: createIsosurfaceTrace,\n};\n\n},{\"../../components/colorscale\":607,\"../../lib/gl_format_color\":725,\"../../lib/str2rgbarray\":751,\"../../plots/gl3d/zip3\":829,\"gl-mesh3d\":287}],1073:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Registry = _dereq_('../../registry');\nvar attributes = _dereq_('./attributes');\nvar colorscaleDefaults = _dereq_('../../components/colorscale/defaults');\n\nfunction supplyDefaults(traceIn, traceOut, defaultColor, layout) {\n function coerce(attr, dflt) {\n return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);\n }\n\n supplyIsoDefaults(traceIn, traceOut, defaultColor, layout, coerce);\n}\n\nfunction supplyIsoDefaults(traceIn, traceOut, defaultColor, layout, coerce) {\n var isomin = coerce('isomin');\n var isomax = coerce('isomax');\n\n if(isomax !== undefined && isomax !== null &&\n isomin !== undefined && isomin !== null &&\n isomin > isomax) {\n // applying default values in this case:\n traceOut.isomin = null;\n traceOut.isomax = null;\n }\n\n var x = coerce('x');\n var y = coerce('y');\n var z = coerce('z');\n var value = coerce('value');\n\n if(\n !x || !x.length ||\n !y || !y.length ||\n !z || !z.length ||\n !value || !value.length\n ) {\n traceOut.visible = false;\n return;\n }\n\n var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');\n handleCalendarDefaults(traceIn, traceOut, ['x', 'y', 'z'], layout);\n\n ['x', 'y', 'z'].forEach(function(dim) {\n var capDim = 'caps.' + dim;\n var showCap = coerce(capDim + '.show');\n if(showCap) {\n coerce(capDim + '.fill');\n }\n\n var sliceDim = 'slices.' + dim;\n var showSlice = coerce(sliceDim + '.show');\n if(showSlice) {\n coerce(sliceDim + '.fill');\n coerce(sliceDim + '.locations');\n }\n });\n\n var showSpaceframe = coerce('spaceframe.show');\n if(showSpaceframe) {\n coerce('spaceframe.fill');\n }\n\n var showSurface = coerce('surface.show');\n if(showSurface) {\n coerce('surface.count');\n coerce('surface.fill');\n coerce('surface.pattern');\n }\n\n var showContour = coerce('contour.show');\n if(showContour) {\n coerce('contour.color');\n coerce('contour.width');\n }\n\n // Coerce remaining properties\n [\n 'text',\n 'hovertext',\n 'hovertemplate',\n 'lighting.ambient',\n 'lighting.diffuse',\n 'lighting.specular',\n 'lighting.roughness',\n 'lighting.fresnel',\n 'lighting.vertexnormalsepsilon',\n 'lighting.facenormalsepsilon',\n 'lightposition.x',\n 'lightposition.y',\n 'lightposition.z',\n 'flatshading',\n 'opacity'\n ].forEach(function(x) { coerce(x); });\n\n colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'c'});\n\n // disable 1D transforms (for now)\n traceOut._length = null;\n}\n\nmodule.exports = {\n supplyDefaults: supplyDefaults,\n supplyIsoDefaults: supplyIsoDefaults\n};\n\n},{\"../../components/colorscale/defaults\":605,\"../../lib\":728,\"../../registry\":859,\"./attributes\":1070}],1074:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults').supplyDefaults,\n calc: _dereq_('./calc'),\n colorbar: {\n min: 'cmin',\n max: 'cmax'\n },\n plot: _dereq_('./convert').createIsosurfaceTrace,\n\n moduleType: 'trace',\n name: 'isosurface',\n basePlotModule: _dereq_('../../plots/gl3d'),\n categories: ['gl3d', 'showLegend'],\n meta: {\n \n }\n};\n\n},{\"../../plots/gl3d\":818,\"./attributes\":1070,\"./calc\":1071,\"./convert\":1072,\"./defaults\":1073}],1075:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar surfaceAttrs = _dereq_('../surface/attributes');\nvar baseAttrs = _dereq_('../../plots/attributes');\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nmodule.exports = extendFlat({\n x: {\n valType: 'data_array',\n editType: 'calc+clearAxisTypes',\n \n },\n y: {\n valType: 'data_array',\n editType: 'calc+clearAxisTypes',\n \n },\n z: {\n valType: 'data_array',\n editType: 'calc+clearAxisTypes',\n \n },\n\n i: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n j: {\n valType: 'data_array',\n editType: 'calc',\n \n\n },\n k: {\n valType: 'data_array',\n editType: 'calc',\n \n\n },\n\n text: {\n valType: 'string',\n \n dflt: '',\n arrayOk: true,\n editType: 'calc',\n \n },\n hovertext: {\n valType: 'string',\n \n dflt: '',\n arrayOk: true,\n editType: 'calc',\n \n },\n hovertemplate: hovertemplateAttrs({editType: 'calc'}),\n\n delaunayaxis: {\n valType: 'enumerated',\n \n values: [ 'x', 'y', 'z' ],\n dflt: 'z',\n editType: 'calc',\n \n },\n\n alphahull: {\n valType: 'number',\n \n dflt: -1,\n editType: 'calc',\n \n },\n\n intensity: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n intensitymode: {\n valType: 'enumerated',\n values: ['vertex', 'cell'],\n dflt: 'vertex',\n editType: 'calc',\n \n \n },\n\n // Color field\n color: {\n valType: 'color',\n \n editType: 'calc',\n \n },\n vertexcolor: {\n valType: 'data_array',\n \n editType: 'calc',\n \n },\n facecolor: {\n valType: 'data_array',\n \n editType: 'calc',\n \n },\n transforms: undefined\n},\n\ncolorScaleAttrs('', {\n colorAttr: '`intensity`',\n showScaleDflt: true,\n editTypeOverride: 'calc'\n}), {\n opacity: surfaceAttrs.opacity,\n\n // Flat shaded mode\n flatshading: {\n valType: 'boolean',\n \n dflt: false,\n editType: 'calc',\n \n },\n\n contour: {\n show: extendFlat({}, surfaceAttrs.contours.x.show, {\n \n }),\n color: surfaceAttrs.contours.x.color,\n width: surfaceAttrs.contours.x.width,\n editType: 'calc'\n },\n\n lightposition: {\n x: extendFlat({}, surfaceAttrs.lightposition.x, {dflt: 1e5}),\n y: extendFlat({}, surfaceAttrs.lightposition.y, {dflt: 1e5}),\n z: extendFlat({}, surfaceAttrs.lightposition.z, {dflt: 0}),\n editType: 'calc'\n },\n lighting: extendFlat({\n vertexnormalsepsilon: {\n valType: 'number',\n \n min: 0.00,\n max: 1,\n dflt: 1e-12, // otherwise finely tessellated things eg. the brain will have no specular light reflection\n editType: 'calc',\n \n },\n facenormalsepsilon: {\n valType: 'number',\n \n min: 0.00,\n max: 1,\n dflt: 1e-6, // even the brain model doesn't appear to need finer than this\n editType: 'calc',\n \n },\n editType: 'calc'\n }, surfaceAttrs.lighting),\n\n hoverinfo: extendFlat({}, baseAttrs.hoverinfo, {editType: 'calc'}),\n showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})\n});\n\n},{\"../../components/colorscale/attributes\":602,\"../../lib/extend\":719,\"../../plots/attributes\":773,\"../../plots/template_attributes\":854,\"../surface/attributes\":1257}],1076:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar colorscaleCalc = _dereq_('../../components/colorscale/calc');\n\nmodule.exports = function calc(gd, trace) {\n if(trace.intensity) {\n colorscaleCalc(gd, trace, {\n vals: trace.intensity,\n containerStr: '',\n cLetter: 'c'\n });\n }\n};\n\n},{\"../../components/colorscale/calc\":603}],1077:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar createMesh = _dereq_('gl-mesh3d');\nvar triangulate = _dereq_('delaunay-triangulate');\nvar alphaShape = _dereq_('alpha-shape');\nvar convexHull = _dereq_('convex-hull');\n\nvar parseColorScale = _dereq_('../../lib/gl_format_color').parseColorScale;\nvar str2RgbaArray = _dereq_('../../lib/str2rgbarray');\nvar extractOpts = _dereq_('../../components/colorscale').extractOpts;\nvar zip3 = _dereq_('../../plots/gl3d/zip3');\n\nfunction Mesh3DTrace(scene, mesh, uid) {\n this.scene = scene;\n this.uid = uid;\n this.mesh = mesh;\n this.name = '';\n this.color = '#fff';\n this.data = null;\n this.showContour = false;\n}\n\nvar proto = Mesh3DTrace.prototype;\n\nproto.handlePick = function(selection) {\n if(selection.object === this.mesh) {\n var selectIndex = selection.index = selection.data.index;\n\n if(selection.data._cellCenter) {\n selection.traceCoordinate = selection.data.dataCoordinate;\n } else {\n selection.traceCoordinate = [\n this.data.x[selectIndex],\n this.data.y[selectIndex],\n this.data.z[selectIndex]\n ];\n }\n\n var text = this.data.hovertext || this.data.text;\n if(Array.isArray(text) && text[selectIndex] !== undefined) {\n selection.textLabel = text[selectIndex];\n } else if(text) {\n selection.textLabel = text;\n }\n\n return true;\n }\n};\n\nfunction parseColorArray(colors) {\n var b = [];\n var len = colors.length;\n for(var i = 0; i < len; i++) {\n b[i] = str2RgbaArray(colors[i]);\n }\n return b;\n}\n\n// Unpack position data\nfunction toDataCoords(axis, coord, scale, calendar) {\n var b = [];\n var len = coord.length;\n for(var i = 0; i < len; i++) {\n b[i] = axis.d2l(coord[i], 0, calendar) * scale;\n }\n return b;\n}\n\n// Round indices if passed as floats\nfunction toRoundIndex(a) {\n var b = [];\n var len = a.length;\n for(var i = 0; i < len; i++) {\n b[i] = Math.round(a[i]);\n }\n return b;\n}\n\nfunction delaunayCells(delaunayaxis, positions) {\n var d = ['x', 'y', 'z'].indexOf(delaunayaxis);\n var b = [];\n var len = positions.length;\n for(var i = 0; i < len; i++) {\n b[i] = [positions[i][(d + 1) % 3], positions[i][(d + 2) % 3]];\n }\n return triangulate(b);\n}\n\n// Validate indices\nfunction hasValidIndices(list, numVertices) {\n var len = list.length;\n for(var i = 0; i < len; i++) {\n if(list[i] <= -0.5 || list[i] >= numVertices - 0.5) { // Note: the indices would be rounded -0.49 is valid.\n return false;\n }\n }\n return true;\n}\n\nproto.update = function(data) {\n var scene = this.scene;\n var layout = scene.fullSceneLayout;\n\n this.data = data;\n\n var numVertices = data.x.length;\n\n var positions = zip3(\n toDataCoords(layout.xaxis, data.x, scene.dataScale[0], data.xcalendar),\n toDataCoords(layout.yaxis, data.y, scene.dataScale[1], data.ycalendar),\n toDataCoords(layout.zaxis, data.z, scene.dataScale[2], data.zcalendar)\n );\n\n var cells;\n if(data.i && data.j && data.k) {\n if(\n data.i.length !== data.j.length ||\n data.j.length !== data.k.length ||\n !hasValidIndices(data.i, numVertices) ||\n !hasValidIndices(data.j, numVertices) ||\n !hasValidIndices(data.k, numVertices)\n ) {\n return;\n }\n cells = zip3(\n toRoundIndex(data.i),\n toRoundIndex(data.j),\n toRoundIndex(data.k)\n );\n } else if(data.alphahull === 0) {\n cells = convexHull(positions);\n } else if(data.alphahull > 0) {\n cells = alphaShape(data.alphahull, positions);\n } else {\n cells = delaunayCells(data.delaunayaxis, positions);\n }\n\n var config = {\n positions: positions,\n cells: cells,\n lightPosition: [data.lightposition.x, data.lightposition.y, data.lightposition.z],\n ambient: data.lighting.ambient,\n diffuse: data.lighting.diffuse,\n specular: data.lighting.specular,\n roughness: data.lighting.roughness,\n fresnel: data.lighting.fresnel,\n vertexNormalsEpsilon: data.lighting.vertexnormalsepsilon,\n faceNormalsEpsilon: data.lighting.facenormalsepsilon,\n opacity: data.opacity,\n contourEnable: data.contour.show,\n contourColor: str2RgbaArray(data.contour.color).slice(0, 3),\n contourWidth: data.contour.width,\n useFacetNormals: data.flatshading\n };\n\n if(data.intensity) {\n var cOpts = extractOpts(data);\n this.color = '#fff';\n var mode = data.intensitymode;\n config[mode + 'Intensity'] = data.intensity;\n config[mode + 'IntensityBounds'] = [cOpts.min, cOpts.max];\n config.colormap = parseColorScale(data);\n } else if(data.vertexcolor) {\n this.color = data.vertexcolor[0];\n config.vertexColors = parseColorArray(data.vertexcolor);\n } else if(data.facecolor) {\n this.color = data.facecolor[0];\n config.cellColors = parseColorArray(data.facecolor);\n } else {\n this.color = data.color;\n config.meshColor = str2RgbaArray(data.color);\n }\n\n // Update mesh\n this.mesh.update(config);\n};\n\nproto.dispose = function() {\n this.scene.glplot.remove(this.mesh);\n this.mesh.dispose();\n};\n\nfunction createMesh3DTrace(scene, data) {\n var gl = scene.glplot.gl;\n var mesh = createMesh({gl: gl});\n var result = new Mesh3DTrace(scene, mesh, data.uid);\n mesh._trace = result;\n result.update(data);\n scene.glplot.add(mesh);\n return result;\n}\n\nmodule.exports = createMesh3DTrace;\n\n},{\"../../components/colorscale\":607,\"../../lib/gl_format_color\":725,\"../../lib/str2rgbarray\":751,\"../../plots/gl3d/zip3\":829,\"alpha-shape\":67,\"convex-hull\":132,\"delaunay-triangulate\":166,\"gl-mesh3d\":287}],1078:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\nvar colorscaleDefaults = _dereq_('../../components/colorscale/defaults');\nvar attributes = _dereq_('./attributes');\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 // read in face/vertex properties\n function readComponents(array) {\n var ret = array.map(function(attr) {\n var result = coerce(attr);\n\n if(result && Lib.isArrayOrTypedArray(result)) return result;\n return null;\n });\n\n return ret.every(function(x) {\n return x && x.length === ret[0].length;\n }) && ret;\n }\n\n var coords = readComponents(['x', 'y', 'z']);\n if(!coords) {\n traceOut.visible = false;\n return;\n }\n\n readComponents(['i', 'j', 'k']);\n // three indices should be all provided or not\n if(\n (traceOut.i && (!traceOut.j || !traceOut.k)) ||\n (traceOut.j && (!traceOut.k || !traceOut.i)) ||\n (traceOut.k && (!traceOut.i || !traceOut.j))\n ) {\n traceOut.visible = false;\n return;\n }\n\n var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');\n handleCalendarDefaults(traceIn, traceOut, ['x', 'y', 'z'], layout);\n\n // Coerce remaining properties\n [\n 'lighting.ambient',\n 'lighting.diffuse',\n 'lighting.specular',\n 'lighting.roughness',\n 'lighting.fresnel',\n 'lighting.vertexnormalsepsilon',\n 'lighting.facenormalsepsilon',\n 'lightposition.x',\n 'lightposition.y',\n 'lightposition.z',\n 'flatshading',\n 'alphahull',\n 'delaunayaxis',\n 'opacity'\n ].forEach(function(x) { coerce(x); });\n\n var showContour = coerce('contour.show');\n if(showContour) {\n coerce('contour.color');\n coerce('contour.width');\n }\n\n if('intensity' in traceIn) {\n coerce('intensity');\n coerce('intensitymode');\n colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'c'});\n } else {\n traceOut.showscale = false;\n\n if('facecolor' in traceIn) coerce('facecolor');\n else if('vertexcolor' in traceIn) coerce('vertexcolor');\n else coerce('color', defaultColor);\n }\n\n coerce('text');\n coerce('hovertext');\n coerce('hovertemplate');\n\n // disable 1D transforms\n // x/y/z should match lengths, and i/j/k should match as well, but\n // the two sets have different lengths so transforms wouldn't work.\n traceOut._length = null;\n};\n\n},{\"../../components/colorscale/defaults\":605,\"../../lib\":728,\"../../registry\":859,\"./attributes\":1075}],1079:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults'),\n calc: _dereq_('./calc'),\n colorbar: {\n min: 'cmin',\n max: 'cmax'\n },\n plot: _dereq_('./convert'),\n\n moduleType: 'trace',\n name: 'mesh3d',\n basePlotModule: _dereq_('../../plots/gl3d'),\n categories: ['gl3d', 'showLegend'],\n meta: {\n \n }\n};\n\n},{\"../../plots/gl3d\":818,\"./attributes\":1075,\"./calc\":1076,\"./convert\":1077,\"./defaults\":1078}],1080:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar extendFlat = _dereq_('../../lib').extendFlat;\nvar scatterAttrs = _dereq_('../scatter/attributes');\nvar dash = _dereq_('../../components/drawing/attributes').dash;\nvar fxAttrs = _dereq_('../../components/fx/attributes');\nvar delta = _dereq_('../../constants/delta.js');\n\nvar INCREASING_COLOR = delta.INCREASING.COLOR;\nvar DECREASING_COLOR = delta.DECREASING.COLOR;\n\nvar lineAttrs = scatterAttrs.line;\n\nfunction directionAttrs(lineColorDefault) {\n return {\n line: {\n color: extendFlat({}, lineAttrs.color, {dflt: lineColorDefault}),\n width: lineAttrs.width,\n dash: dash,\n editType: 'style'\n },\n editType: 'style'\n };\n}\n\nmodule.exports = {\n\n x: {\n valType: 'data_array',\n editType: 'calc+clearAxisTypes',\n \n },\n\n open: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n\n high: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n\n low: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n\n close: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n\n line: {\n width: extendFlat({}, lineAttrs.width, {\n \n }),\n dash: extendFlat({}, dash, {\n \n }),\n editType: 'style'\n },\n\n increasing: directionAttrs(INCREASING_COLOR),\n\n decreasing: directionAttrs(DECREASING_COLOR),\n\n text: {\n valType: 'string',\n \n dflt: '',\n arrayOk: true,\n editType: 'calc',\n \n },\n hovertext: {\n valType: 'string',\n \n dflt: '',\n arrayOk: true,\n editType: 'calc',\n \n },\n\n tickwidth: {\n valType: 'number',\n min: 0,\n max: 0.5,\n dflt: 0.3,\n \n editType: 'calc',\n \n },\n\n hoverlabel: extendFlat({}, fxAttrs.hoverlabel, {\n split: {\n valType: 'boolean',\n \n dflt: false,\n editType: 'style',\n \n }\n }),\n};\n\n},{\"../../components/drawing/attributes\":616,\"../../components/fx/attributes\":626,\"../../constants/delta.js\":698,\"../../lib\":728,\"../scatter/attributes\":1134}],1081:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar _ = Lib._;\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\n\nfunction calc(gd, trace) {\n var xa = Axes.getFromId(gd, trace.xaxis);\n var ya = Axes.getFromId(gd, trace.yaxis);\n\n var tickLen = convertTickWidth(gd, xa, trace);\n var minDiff = trace._minDiff;\n trace._minDiff = null;\n var x = trace._xcalc;\n trace._xcalc = null;\n\n var cd = calcCommon(gd, trace, x, ya, ptFunc);\n\n trace._extremes[xa._id] = Axes.findExtremes(xa, x, {vpad: minDiff / 2});\n if(cd.length) {\n Lib.extendFlat(cd[0].t, {\n wHover: minDiff / 2,\n tickLen: tickLen\n });\n return cd;\n } else {\n return [{t: {empty: true}}];\n }\n}\n\nfunction ptFunc(o, h, l, c) {\n return {\n o: o,\n h: h,\n l: l,\n c: c\n };\n}\n\n\n// shared between OHLC and candlestick\n// ptFunc makes a calcdata point specific to each trace type, from oi, hi, li, ci\nfunction calcCommon(gd, trace, x, ya, ptFunc) {\n var o = ya.makeCalcdata(trace, 'open');\n var h = ya.makeCalcdata(trace, 'high');\n var l = ya.makeCalcdata(trace, 'low');\n var c = ya.makeCalcdata(trace, 'close');\n\n var hasTextArray = Array.isArray(trace.text);\n var hasHovertextArray = Array.isArray(trace.hovertext);\n\n // we're optimists - before we have any changing data, assume increasing\n var increasing = true;\n var cPrev = null;\n\n var cd = [];\n for(var i = 0; i < x.length; i++) {\n var xi = x[i];\n var oi = o[i];\n var hi = h[i];\n var li = l[i];\n var ci = c[i];\n\n if(xi !== BADNUM && oi !== BADNUM && hi !== BADNUM && li !== BADNUM && ci !== BADNUM) {\n if(ci === oi) {\n // if open == close, look for a change from the previous close\n if(cPrev !== null && ci !== cPrev) increasing = ci > cPrev;\n // else (c === cPrev or cPrev is null) no change\n } else increasing = ci > oi;\n\n cPrev = ci;\n\n var pt = ptFunc(oi, hi, li, ci);\n\n pt.pos = xi;\n pt.yc = (oi + ci) / 2;\n pt.i = i;\n pt.dir = increasing ? 'increasing' : 'decreasing';\n\n // For categoryorder, store low and high\n pt.x = pt.pos;\n pt.y = [li, hi];\n\n if(hasTextArray) pt.tx = trace.text[i];\n if(hasHovertextArray) pt.htx = trace.hovertext[i];\n\n cd.push(pt);\n } else {\n cd.push({pos: xi, empty: true});\n }\n }\n\n trace._extremes[ya._id] = Axes.findExtremes(ya, Lib.concat(l, h), {padded: true});\n\n if(cd.length) {\n cd[0].t = {\n labels: {\n open: _(gd, 'open:') + ' ',\n high: _(gd, 'high:') + ' ',\n low: _(gd, 'low:') + ' ',\n close: _(gd, 'close:') + ' '\n }\n };\n }\n\n return cd;\n}\n\n/*\n * find min x-coordinates difference of all traces\n * attached to this x-axis and stash the result in _minDiff\n * in all traces; when a trace uses this in its\n * calc step it deletes _minDiff, so that next calc this is\n * done again in case the data changed.\n * also since we need it here, stash _xcalc on the trace\n */\nfunction convertTickWidth(gd, xa, trace) {\n var minDiff = trace._minDiff;\n\n if(!minDiff) {\n var fullData = gd._fullData;\n var ohlcTracesOnThisXaxis = [];\n\n minDiff = Infinity;\n\n var i;\n\n for(i = 0; i < fullData.length; i++) {\n var tracei = fullData[i];\n\n if(tracei.type === 'ohlc' &&\n tracei.visible === true &&\n tracei.xaxis === xa._id\n ) {\n ohlcTracesOnThisXaxis.push(tracei);\n\n var xcalc = xa.makeCalcdata(tracei, 'x');\n tracei._xcalc = xcalc;\n\n var _minDiff = Lib.distinctVals(xcalc).minDiff;\n if(_minDiff && isFinite(_minDiff)) {\n minDiff = Math.min(minDiff, _minDiff);\n }\n }\n }\n\n // if minDiff is still Infinity here, set it to 1\n if(minDiff === Infinity) minDiff = 1;\n\n for(i = 0; i < ohlcTracesOnThisXaxis.length; i++) {\n ohlcTracesOnThisXaxis[i]._minDiff = minDiff;\n }\n }\n\n return minDiff * trace.tickwidth;\n}\n\nmodule.exports = {\n calc: calc,\n calcCommon: calcCommon\n};\n\n},{\"../../constants/numerical\":704,\"../../lib\":728,\"../../plots/cartesian/axes\":776}],1082:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar handleOHLC = _dereq_('./ohlc_defaults');\nvar attributes = _dereq_('./attributes');\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 len = handleOHLC(traceIn, traceOut, coerce, layout);\n if(!len) {\n traceOut.visible = false;\n return;\n }\n\n coerce('line.width');\n coerce('line.dash');\n\n handleDirection(traceIn, traceOut, coerce, 'increasing');\n handleDirection(traceIn, traceOut, coerce, 'decreasing');\n\n coerce('text');\n coerce('hovertext');\n coerce('tickwidth');\n\n layout._requestRangeslider[traceOut.xaxis] = true;\n};\n\nfunction handleDirection(traceIn, traceOut, coerce, direction) {\n coerce(direction + '.line.color');\n coerce(direction + '.line.width', traceOut.line.width);\n coerce(direction + '.line.dash', traceOut.line.dash);\n}\n\n},{\"../../lib\":728,\"./attributes\":1080,\"./ohlc_defaults\":1085}],1083:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar Lib = _dereq_('../../lib');\nvar Fx = _dereq_('../../components/fx');\nvar Color = _dereq_('../../components/color');\nvar fillText = _dereq_('../../lib').fillText;\nvar delta = _dereq_('../../constants/delta.js');\n\nvar DIRSYMBOL = {\n increasing: delta.INCREASING.SYMBOL,\n decreasing: delta.DECREASING.SYMBOL\n};\n\nfunction hoverPoints(pointData, xval, yval, hovermode) {\n var cd = pointData.cd;\n var trace = cd[0].trace;\n\n if(trace.hoverlabel.split) {\n return hoverSplit(pointData, xval, yval, hovermode);\n }\n\n return hoverOnPoints(pointData, xval, yval, hovermode);\n}\n\nfunction getClosestPoint(pointData, xval, yval, hovermode) {\n var cd = pointData.cd;\n var xa = pointData.xa;\n var trace = cd[0].trace;\n var t = cd[0].t;\n\n var type = trace.type;\n var minAttr = type === 'ohlc' ? 'l' : 'min';\n var maxAttr = type === 'ohlc' ? 'h' : 'max';\n\n var hoverPseudoDistance, spikePseudoDistance;\n\n // potentially shift xval for grouped candlesticks\n var centerShift = t.bPos || 0;\n var shiftPos = function(di) { return di.pos + centerShift - xval; };\n\n // ohlc and candlestick call displayHalfWidth different things...\n var displayHalfWidth = t.bdPos || t.tickLen;\n var hoverHalfWidth = t.wHover;\n\n // if two figures are overlaying, let the narrowest one win\n var pseudoDistance = Math.min(1, displayHalfWidth / Math.abs(xa.r2c(xa.range[1]) - xa.r2c(xa.range[0])));\n hoverPseudoDistance = pointData.maxHoverDistance - pseudoDistance;\n spikePseudoDistance = pointData.maxSpikeDistance - pseudoDistance;\n\n function dx(di) {\n var pos = shiftPos(di);\n return Fx.inbox(pos - hoverHalfWidth, pos + hoverHalfWidth, hoverPseudoDistance);\n }\n\n function dy(di) {\n var min = di[minAttr];\n var max = di[maxAttr];\n return min === max || Fx.inbox(min - yval, max - yval, hoverPseudoDistance);\n }\n\n function dxy(di) { return (dx(di) + dy(di)) / 2; }\n\n var distfn = Fx.getDistanceFunction(hovermode, dx, dy, dxy);\n Fx.getClosest(cd, distfn, pointData);\n\n if(pointData.index === false) return null;\n\n var di = cd[pointData.index];\n\n if(di.empty) return null;\n\n var dir = di.dir;\n var container = trace[dir];\n var lc = container.line.color;\n\n if(Color.opacity(lc) && container.line.width) pointData.color = lc;\n else pointData.color = container.fillcolor;\n\n pointData.x0 = xa.c2p(di.pos + centerShift - displayHalfWidth, true);\n pointData.x1 = xa.c2p(di.pos + centerShift + displayHalfWidth, true);\n\n pointData.xLabelVal = di.pos;\n\n pointData.spikeDistance = dxy(di) * spikePseudoDistance / hoverPseudoDistance;\n pointData.xSpike = xa.c2p(di.pos, true);\n\n return pointData;\n}\n\nfunction hoverSplit(pointData, xval, yval, hovermode) {\n var cd = pointData.cd;\n var ya = pointData.ya;\n var trace = cd[0].trace;\n var t = cd[0].t;\n var closeBoxData = [];\n\n var closestPoint = getClosestPoint(pointData, xval, yval, hovermode);\n // skip the rest (for this trace) if we didn't find a close point\n if(!closestPoint) return [];\n\n var cdIndex = closestPoint.index;\n var di = cd[cdIndex];\n var hoverinfo = di.hi || trace.hoverinfo;\n var hoverParts = hoverinfo.split('+');\n var isAll = hoverinfo === 'all';\n var hasY = isAll || hoverParts.indexOf('y') !== -1;\n\n // similar to hoverOnPoints, we return nothing\n // if all or y is not present.\n if(!hasY) return [];\n\n var attrs = ['high', 'open', 'close', 'low'];\n\n // several attributes can have the same y-coordinate. We will\n // bunch them together in a single text block. For this, we keep\n // a dictionary mapping y-coord -> point data.\n var usedVals = {};\n\n for(var i = 0; i < attrs.length; i++) {\n var attr = attrs[i];\n\n var val = trace[attr][closestPoint.index];\n var valPx = ya.c2p(val, true);\n var pointData2;\n if(val in usedVals) {\n pointData2 = usedVals[val];\n pointData2.yLabel += '
' + t.labels[attr] + Axes.hoverLabelText(ya, val);\n } else {\n // copy out to a new object for each new y-value to label\n pointData2 = Lib.extendFlat({}, closestPoint);\n\n pointData2.y0 = pointData2.y1 = valPx;\n pointData2.yLabelVal = val;\n pointData2.yLabel = t.labels[attr] + Axes.hoverLabelText(ya, val);\n\n pointData2.name = '';\n\n closeBoxData.push(pointData2);\n usedVals[val] = pointData2;\n }\n }\n\n return closeBoxData;\n}\n\nfunction hoverOnPoints(pointData, xval, yval, hovermode) {\n var cd = pointData.cd;\n var ya = pointData.ya;\n var trace = cd[0].trace;\n var t = cd[0].t;\n\n var closestPoint = getClosestPoint(pointData, xval, yval, hovermode);\n // skip the rest (for this trace) if we didn't find a close point\n if(!closestPoint) return [];\n\n // we don't make a calcdata point if we're missing any piece (x/o/h/l/c)\n // so we need to fix the index here to point to the data arrays\n var cdIndex = closestPoint.index;\n var di = cd[cdIndex];\n var i = closestPoint.index = di.i;\n var dir = di.dir;\n\n function getLabelLine(attr) {\n return t.labels[attr] + Axes.hoverLabelText(ya, trace[attr][i]);\n }\n\n var hoverinfo = di.hi || trace.hoverinfo;\n var hoverParts = hoverinfo.split('+');\n var isAll = hoverinfo === 'all';\n var hasY = isAll || hoverParts.indexOf('y') !== -1;\n var hasText = isAll || hoverParts.indexOf('text') !== -1;\n\n var textParts = hasY ? [\n getLabelLine('open'),\n getLabelLine('high'),\n getLabelLine('low'),\n getLabelLine('close') + ' ' + DIRSYMBOL[dir]\n ] : [];\n if(hasText) fillText(di, trace, textParts);\n\n // don't make .yLabelVal or .text, since we're managing hoverinfo\n // put it all in .extraText\n closestPoint.extraText = textParts.join('
');\n\n // this puts the label *and the spike* at the midpoint of the box, ie\n // halfway between open and close, not between high and low.\n closestPoint.y0 = closestPoint.y1 = ya.c2p(di.yc, true);\n\n return [closestPoint];\n}\n\nmodule.exports = {\n hoverPoints: hoverPoints,\n hoverSplit: hoverSplit,\n hoverOnPoints: hoverOnPoints\n};\n\n},{\"../../components/color\":595,\"../../components/fx\":635,\"../../constants/delta.js\":698,\"../../lib\":728,\"../../plots/cartesian/axes\":776}],1084:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n moduleType: 'trace',\n name: 'ohlc',\n basePlotModule: _dereq_('../../plots/cartesian'),\n categories: ['cartesian', 'svg', 'showLegend'],\n meta: {\n \n },\n\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults'),\n calc: _dereq_('./calc').calc,\n plot: _dereq_('./plot'),\n style: _dereq_('./style'),\n hoverPoints: _dereq_('./hover').hoverPoints,\n selectPoints: _dereq_('./select')\n};\n\n},{\"../../plots/cartesian\":789,\"./attributes\":1080,\"./calc\":1081,\"./defaults\":1082,\"./hover\":1083,\"./plot\":1086,\"./select\":1087,\"./style\":1088}],1085:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\n\nmodule.exports = function handleOHLC(traceIn, traceOut, coerce, layout) {\n var x = coerce('x');\n var open = coerce('open');\n var high = coerce('high');\n var low = coerce('low');\n var close = coerce('close');\n\n coerce('hoverlabel.split');\n\n var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');\n handleCalendarDefaults(traceIn, traceOut, ['x'], layout);\n\n if(!(open && high && low && close)) return;\n\n var len = Math.min(open.length, high.length, low.length, close.length);\n if(x) len = Math.min(len, Lib.minRowLength(x));\n traceOut._length = len;\n\n return len;\n};\n\n},{\"../../lib\":728,\"../../registry\":859}],1086:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Lib = _dereq_('../../lib');\n\nmodule.exports = function plot(gd, plotinfo, cdOHLC, ohlcLayer) {\n var ya = plotinfo.yaxis;\n var xa = plotinfo.xaxis;\n var posHasRangeBreaks = !!xa.rangebreaks;\n\n Lib.makeTraceGroups(ohlcLayer, cdOHLC, 'trace ohlc').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 if(trace.visible !== true || t.empty) {\n plotGroup.remove();\n return;\n }\n\n var tickLen = t.tickLen;\n\n var paths = plotGroup.selectAll('path').data(Lib.identity);\n\n paths.enter().append('path');\n\n paths.exit().remove();\n\n paths.attr('d', function(d) {\n if(d.empty) return 'M0,0Z';\n\n var xo = xa.c2p(d.pos - tickLen, true);\n var xc = xa.c2p(d.pos + tickLen, true);\n var x = posHasRangeBreaks ? (xo + xc) / 2 : xa.c2p(d.pos, true);\n\n var yo = ya.c2p(d.o, true);\n var yh = ya.c2p(d.h, true);\n var yl = ya.c2p(d.l, true);\n var yc = ya.c2p(d.c, true);\n\n return 'M' + xo + ',' + yo + 'H' + x +\n 'M' + x + ',' + yh + 'V' + yl +\n 'M' + xc + ',' + yc + 'H' + x;\n });\n });\n};\n\n},{\"../../lib\":728,\"d3\":164}],1087:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\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 i;\n // for (potentially grouped) candlesticks\n var posOffset = cd[0].t.bPos || 0;\n\n if(selectionTester === false) {\n // 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 var di = cd[i];\n\n if(selectionTester.contains([xa.c2p(di.pos + posOffset), ya.c2p(di.yc)], null, di.i, searchInfo)) {\n selection.push({\n pointNumber: di.i,\n x: xa.c2d(di.pos),\n y: ya.c2d(di.yc)\n });\n di.selected = 1;\n } else {\n di.selected = 0;\n }\n }\n }\n\n return selection;\n};\n\n},{}],1088:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Drawing = _dereq_('../../components/drawing');\nvar Color = _dereq_('../../components/color');\n\nmodule.exports = function style(gd, cd, sel) {\n var s = sel ? sel : d3.select(gd).selectAll('g.ohlclayer').selectAll('g.trace');\n\n s.style('opacity', function(d) {\n return d[0].trace.opacity;\n });\n\n s.each(function(d) {\n var trace = d[0].trace;\n\n d3.select(this).selectAll('path').each(function(di) {\n if(di.empty) return;\n\n var dirLine = trace[di.dir].line;\n d3.select(this)\n .style('fill', 'none')\n .call(Color.stroke, dirLine.color)\n .call(Drawing.dashLine, dirLine.dash, dirLine.width)\n // TODO: custom selection style for OHLC\n .style('opacity', trace.selectedpoints && !di.selected ? 0.3 : 1);\n });\n });\n};\n\n},{\"../../components/color\":595,\"../../components/drawing\":617,\"d3\":164}],1089:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\nvar baseAttrs = _dereq_('../../plots/attributes');\nvar fontAttrs = _dereq_('../../plots/font_attributes');\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar domainAttrs = _dereq_('../../plots/domain').attributes;\n\nvar line = extendFlat(\n {editType: 'calc'},\n colorScaleAttrs('line', {editTypeOverride: 'calc'}),\n {\n shape: {\n valType: 'enumerated',\n values: ['linear', 'hspline'],\n dflt: 'linear',\n \n editType: 'plot',\n \n },\n\n hovertemplate: hovertemplateAttrs({\n editType: 'plot',\n arrayOk: false\n }, {\n keys: ['count', 'probability'],\n \n })\n }\n);\n\nmodule.exports = {\n domain: domainAttrs({name: 'parcats', trace: true, editType: 'calc'}),\n\n hoverinfo: extendFlat({}, baseAttrs.hoverinfo, {\n flags: ['count', 'probability'],\n editType: 'plot',\n arrayOk: false\n }),\n hoveron: {\n valType: 'enumerated',\n values: ['category', 'color', 'dimension'],\n dflt: 'category',\n \n editType: 'plot',\n \n },\n hovertemplate: hovertemplateAttrs({\n editType: 'plot',\n arrayOk: false\n }, {\n keys: [\n 'count', 'probability', 'category',\n 'categorycount', 'colorcount', 'bandcolorcount'\n ],\n \n }),\n\n arrangement: {\n valType: 'enumerated',\n values: ['perpendicular', 'freeform', 'fixed'],\n dflt: 'perpendicular',\n \n editType: 'plot',\n \n },\n bundlecolors: {\n valType: 'boolean',\n dflt: true,\n \n editType: 'plot',\n \n },\n sortpaths: {\n valType: 'enumerated',\n values: ['forward', 'backward'],\n dflt: 'forward',\n \n editType: 'plot',\n \n },\n labelfont: fontAttrs({\n editType: 'calc',\n \n }),\n\n tickfont: fontAttrs({\n editType: 'calc',\n \n }),\n\n dimensions: {\n _isLinkedToArray: 'dimension',\n label: {\n valType: 'string',\n \n editType: 'calc',\n \n },\n categoryorder: {\n valType: 'enumerated',\n values: [\n 'trace', 'category ascending', 'category descending', 'array'\n ],\n dflt: 'trace',\n \n editType: 'calc',\n \n },\n categoryarray: {\n valType: 'data_array',\n \n editType: 'calc',\n \n },\n ticktext: {\n valType: 'data_array',\n \n editType: 'calc',\n \n },\n values: {\n valType: 'data_array',\n \n dflt: [],\n editType: 'calc',\n \n },\n displayindex: {\n valType: 'integer',\n \n editType: 'calc',\n \n },\n editType: 'calc',\n \n visible: {\n valType: 'boolean',\n dflt: true,\n \n editType: 'calc',\n \n }\n },\n\n line: line,\n counts: {\n valType: 'number',\n min: 0,\n dflt: 1,\n arrayOk: true,\n \n editType: 'calc',\n \n },\n\n // Hide unsupported top-level properties from plot-schema\n customdata: undefined,\n hoverlabel: undefined,\n ids: undefined,\n legendgroup: undefined,\n opacity: undefined,\n selectedpoints: undefined,\n showlegend: undefined\n};\n\n},{\"../../components/colorscale/attributes\":602,\"../../lib/extend\":719,\"../../plots/attributes\":773,\"../../plots/domain\":803,\"../../plots/font_attributes\":804,\"../../plots/template_attributes\":854}],1090:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar getModuleCalcData = _dereq_('../../plots/get_data').getModuleCalcData;\nvar parcatsPlot = _dereq_('./plot');\n\nvar PARCATS = 'parcats';\nexports.name = PARCATS;\n\nexports.plot = function(gd, traces, transitionOpts, makeOnCompleteCallback) {\n var cdModuleAndOthers = getModuleCalcData(gd.calcdata, PARCATS);\n\n if(cdModuleAndOthers.length) {\n var calcData = cdModuleAndOthers[0];\n parcatsPlot(gd, calcData, transitionOpts, makeOnCompleteCallback);\n }\n};\n\nexports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) {\n var hadTable = (oldFullLayout._has && oldFullLayout._has('parcats'));\n var hasTable = (newFullLayout._has && newFullLayout._has('parcats'));\n\n if(hadTable && !hasTable) {\n oldFullLayout._paperdiv.selectAll('.parcats').remove();\n }\n};\n\n},{\"../../plots/get_data\":813,\"./plot\":1095}],1091:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n// Requirements\n// ============\nvar wrap = _dereq_('../../lib/gup').wrap;\nvar hasColorscale = _dereq_('../../components/colorscale/helpers').hasColorscale;\nvar colorscaleCalc = _dereq_('../../components/colorscale/calc');\nvar filterUnique = _dereq_('../../lib/filter_unique.js');\nvar Drawing = _dereq_('../../components/drawing');\nvar Lib = _dereq_('../../lib');\nvar isNumeric = _dereq_('fast-isnumeric');\n\n/**\n * Create a wrapped ParcatsModel object from trace\n *\n * Note: trace defaults have already been applied\n * @param {Object} gd\n * @param {Object} trace\n * @return {Array.}\n */\nmodule.exports = function calc(gd, trace) {\n var visibleDims = Lib.filterVisible(trace.dimensions);\n\n if(visibleDims.length === 0) return [];\n\n var uniqueInfoDims = visibleDims.map(function(dim) {\n var categoryValues;\n if(dim.categoryorder === 'trace') {\n // Use order of first occurrence in trace\n categoryValues = null;\n } else if(dim.categoryorder === 'array') {\n // Use categories specified in `categoryarray` first,\n // then add extra to the end in trace order\n categoryValues = dim.categoryarray;\n } else {\n // Get all categories up front\n categoryValues = filterUnique(dim.values);\n\n // order them\n var allNumeric = true;\n for(var i = 0; i < categoryValues.length; i++) {\n if(!isNumeric(categoryValues[i])) {\n allNumeric = false;\n break;\n }\n }\n categoryValues.sort(allNumeric ? Lib.sorterAsc : undefined);\n\n if(dim.categoryorder === 'category descending') {\n categoryValues = categoryValues.reverse();\n }\n }\n return getUniqueInfo(dim.values, categoryValues);\n });\n\n var counts,\n count,\n totalCount;\n if(Lib.isArrayOrTypedArray(trace.counts)) {\n counts = trace.counts;\n } else {\n counts = [trace.counts];\n }\n\n validateDimensionDisplayInds(visibleDims);\n\n visibleDims.forEach(function(dim, dimInd) {\n validateCategoryProperties(dim, uniqueInfoDims[dimInd]);\n });\n\n // Handle path colors\n // ------------------\n var line = trace.line;\n var markerColorscale;\n\n // Process colorscale\n if(line) {\n if(hasColorscale(trace, 'line')) {\n colorscaleCalc(gd, trace, {\n vals: trace.line.color,\n containerStr: 'line',\n cLetter: 'c'\n });\n }\n markerColorscale = Drawing.tryColorscale(line);\n } else {\n markerColorscale = Lib.identity;\n }\n\n // Build color generation function\n function getMarkerColorInfo(index) {\n var value, rawColor;\n if(Lib.isArrayOrTypedArray(line.color)) {\n value = line.color[index % line.color.length];\n rawColor = value;\n } else {\n value = line.color;\n }\n\n return {color: markerColorscale(value), rawColor: rawColor};\n }\n\n // Number of values and counts\n // ---------------------------\n var numValues = visibleDims[0].values.length;\n\n // Build path info\n // ---------------\n // Mapping from category inds to PathModel objects\n var pathModels = {};\n\n // Category inds array for each dimension\n var categoryIndsDims = uniqueInfoDims.map(function(di) {return di.inds;});\n\n // Initialize total count\n totalCount = 0;\n var valueInd;\n var d;\n\n for(valueInd = 0; valueInd < numValues; valueInd++) {\n // Category inds for this input value across dimensions\n var categoryIndsPath = [];\n for(d = 0; d < categoryIndsDims.length; d++) {\n categoryIndsPath.push(categoryIndsDims[d][valueInd]);\n }\n\n // Count\n count = counts[valueInd % counts.length];\n\n // Update total count\n totalCount += count;\n\n // Path color\n var pathColorInfo = getMarkerColorInfo(valueInd);\n\n // path key\n var pathKey = categoryIndsPath + '-' + pathColorInfo.rawColor;\n\n // Create / Update PathModel\n if(pathModels[pathKey] === undefined) {\n pathModels[pathKey] = createPathModel(categoryIndsPath,\n pathColorInfo.color,\n pathColorInfo.rawColor);\n }\n updatePathModel(pathModels[pathKey], valueInd, count);\n }\n\n var dimensionModels = visibleDims.map(function(di, i) {\n return createDimensionModel(i, di._index, di._displayindex, di.label, totalCount);\n });\n\n\n for(valueInd = 0; valueInd < numValues; valueInd++) {\n count = counts[valueInd % counts.length];\n\n for(d = 0; d < dimensionModels.length; d++) {\n var containerInd = dimensionModels[d].containerInd;\n var catInd = uniqueInfoDims[d].inds[valueInd];\n var cats = dimensionModels[d].categories;\n\n if(cats[catInd] === undefined) {\n var catValue = trace.dimensions[containerInd]._categoryarray[catInd];\n var catLabel = trace.dimensions[containerInd]._ticktext[catInd];\n cats[catInd] = createCategoryModel(d, catInd, catValue, catLabel);\n }\n\n updateCategoryModel(cats[catInd], valueInd, count);\n }\n }\n\n // Compute unique\n return wrap(createParcatsModel(dimensionModels, pathModels, totalCount));\n};\n\n// Models\n// ======\n\n// Parcats Model\n// -------------\n/**\n * @typedef {Object} ParcatsModel\n * Object containing calculated information about a parcats trace\n *\n * @property {Array.} dimensions\n * Array of dimension models\n * @property {Object.} paths\n * Dictionary from category inds string (e.g. \"1,2,1,1\") to path model\n * @property {Number} maxCats\n * The maximum number of categories of any dimension in the diagram\n * @property {Number} count\n * Total number of input values\n * @property {Object} trace\n */\n\n/**\n * Create and new ParcatsModel object\n * @param {Array.} dimensions\n * @param {Object.} paths\n * @param {Number} count\n * @return {ParcatsModel}\n */\nfunction createParcatsModel(dimensions, paths, count) {\n var maxCats = dimensions\n .map(function(d) {return d.categories.length;})\n .reduce(function(v1, v2) {return Math.max(v1, v2);});\n return {dimensions: dimensions, paths: paths, trace: undefined, maxCats: maxCats, count: count};\n}\n\n// Dimension Model\n// ---------------\n/**\n * @typedef {Object} DimensionModel\n * Object containing calculated information about a single dimension\n *\n * @property {Number} dimensionInd\n * The index of this dimension among the *visible* dimensions\n * @property {Number} containerInd\n * The index of this dimension in the original dimensions container,\n * irrespective of dimension visibility\n * @property {Number} displayInd\n * The display index of this dimension (where 0 is the left most dimension)\n * @property {String} dimensionLabel\n * The label of this dimension\n * @property {Number} count\n * Total number of input values\n * @property {Array.} categories\n * @property {Number|null} dragX\n * The x position of dimension that is currently being dragged. null if not being dragged\n */\n\n/**\n * Create and new DimensionModel object with an empty categories array\n * @param {Number} dimensionInd\n * @param {Number} containerInd\n * @param {Number} displayInd\n * @param {String} dimensionLabel\n * @param {Number} count\n * Total number of input values\n * @return {DimensionModel}\n */\nfunction createDimensionModel(dimensionInd, containerInd, displayInd, dimensionLabel, count) {\n return {\n dimensionInd: dimensionInd,\n containerInd: containerInd,\n displayInd: displayInd,\n dimensionLabel: dimensionLabel,\n count: count,\n categories: [],\n dragX: null\n };\n}\n\n// Category Model\n// --------------\n/**\n * @typedef {Object} CategoryModel\n * Object containing calculated information about a single category.\n *\n * @property {Number} dimensionInd\n * The index of this categories dimension\n * @property {Number} categoryInd\n * The index of this category\n * @property {Number} displayInd\n * The display index of this category (where 0 is the topmost category)\n * @property {String} categoryLabel\n * The name of this category\n * @property categoryValue: Raw value of the category\n * @property {Array} valueInds\n * Array of indices (into the original value array) of all samples in this category\n * @property {Number} count\n * The number of elements from the original array in this path\n * @property {Number|null} dragY\n * The y position of category that is currently being dragged. null if not being dragged\n */\n\n/**\n * Create and return a new CategoryModel object\n * @param {Number} dimensionInd\n * @param {Number} categoryInd\n * The display index of this category (where 0 is the topmost category)\n * @param {String} categoryValue\n * @param {String} categoryLabel\n * @return {CategoryModel}\n */\nfunction createCategoryModel(dimensionInd, categoryInd, categoryValue, categoryLabel) {\n return {\n dimensionInd: dimensionInd,\n categoryInd: categoryInd,\n categoryValue: categoryValue,\n displayInd: categoryInd,\n categoryLabel: categoryLabel,\n valueInds: [],\n count: 0,\n dragY: null\n };\n}\n\n/**\n * Update a CategoryModel object with a new value index\n * Note: The calling parameter is modified in place.\n *\n * @param {CategoryModel} categoryModel\n * @param {Number} valueInd\n * @param {Number} count\n */\nfunction updateCategoryModel(categoryModel, valueInd, count) {\n categoryModel.valueInds.push(valueInd);\n categoryModel.count += count;\n}\n\n\n// Path Model\n// ----------\n/**\n * @typedef {Object} PathModel\n * Object containing calculated information about the samples in a path.\n *\n * @property {Array} categoryInds\n * Array of category indices for each dimension (length `numDimensions`)\n * @param {String} pathColor\n * Color of this path. (Note: Any colorscaling has already taken place)\n * @property {Array} valueInds\n * Array of indices (into the original value array) of all samples in this path\n * @property {Number} count\n * The number of elements from the original array in this path\n * @property {String} color\n * The path's color (ass CSS color string)\n * @property rawColor\n * The raw color value specified by the user. May be a CSS color string or a Number\n */\n\n/**\n * Create and return a new PathModel object\n * @param {Array} categoryInds\n * @param color\n * @param rawColor\n * @return {PathModel}\n */\nfunction createPathModel(categoryInds, color, rawColor) {\n return {\n categoryInds: categoryInds,\n color: color,\n rawColor: rawColor,\n valueInds: [],\n count: 0\n };\n}\n\n/**\n * Update a PathModel object with a new value index\n * Note: The calling parameter is modified in place.\n *\n * @param {PathModel} pathModel\n * @param {Number} valueInd\n * @param {Number} count\n */\nfunction updatePathModel(pathModel, valueInd, count) {\n pathModel.valueInds.push(valueInd);\n pathModel.count += count;\n}\n\n// Unique calculations\n// ===================\n/**\n * @typedef {Object} UniqueInfo\n * Object containing information about the unique values of an input array\n *\n * @property {Array} uniqueValues\n * The unique values in the input array\n * @property {Array} uniqueCounts\n * The number of times each entry in uniqueValues occurs in input array.\n * This has the same length as `uniqueValues`\n * @property {Array} inds\n * Indices into uniqueValues that would reproduce original input array\n */\n\n/**\n * Compute unique value information for an array\n *\n * IMPORTANT: Note that values are considered unique\n * if their string representations are unique.\n *\n * @param {Array} values\n * @param {Array|undefined} uniqueValues\n * Array of expected unique values. The uniqueValues property of the resulting UniqueInfo object will begin with\n * these entries. Entries are included even if there are zero occurrences in the values array. Entries found in\n * the values array that are not present in uniqueValues will be included at the end of the array in the\n * UniqueInfo object.\n * @return {UniqueInfo}\n */\nfunction getUniqueInfo(values, uniqueValues) {\n // Initialize uniqueValues if not specified\n if(uniqueValues === undefined || uniqueValues === null) {\n uniqueValues = [];\n } else {\n // Shallow copy so append below doesn't alter input array\n uniqueValues = uniqueValues.map(function(e) {return e;});\n }\n\n // Initialize Variables\n var uniqueValueCounts = {};\n var uniqueValueInds = {};\n var inds = [];\n\n // Initialize uniqueValueCounts and\n uniqueValues.forEach(function(uniqueVal, valInd) {\n uniqueValueCounts[uniqueVal] = 0;\n uniqueValueInds[uniqueVal] = valInd;\n });\n\n // Compute the necessary unique info in a single pass\n for(var i = 0; i < values.length; i++) {\n var item = values[i];\n var itemInd;\n\n if(uniqueValueCounts[item] === undefined) {\n // This item has a previously unseen value\n uniqueValueCounts[item] = 1;\n itemInd = uniqueValues.push(item) - 1;\n uniqueValueInds[item] = itemInd;\n } else {\n // Increment count for this item\n uniqueValueCounts[item]++;\n itemInd = uniqueValueInds[item];\n }\n inds.push(itemInd);\n }\n\n // Build UniqueInfo\n var uniqueCounts = uniqueValues.map(function(v) { return uniqueValueCounts[v]; });\n\n return {\n uniqueValues: uniqueValues,\n uniqueCounts: uniqueCounts,\n inds: inds\n };\n}\n\n\n/**\n * Validate the requested display order for the dimensions.\n * If the display order is a permutation of 0 through dimensions.length - 1, link to _displayindex\n * Otherwise, replace the display order with the dimension order\n * @param {Object} trace\n */\nfunction validateDimensionDisplayInds(visibleDims) {\n var displayInds = visibleDims.map(function(d) { return d.displayindex; });\n var i;\n\n if(isRangePermutation(displayInds)) {\n for(i = 0; i < visibleDims.length; i++) {\n visibleDims[i]._displayindex = visibleDims[i].displayindex;\n }\n } else {\n for(i = 0; i < visibleDims.length; i++) {\n visibleDims[i]._displayindex = i;\n }\n }\n}\n\n\n/**\n * Update category properties based on the unique values found for this dimension\n * @param {Object} dim\n * @param {UniqueInfo} uniqueInfoDim\n */\nfunction validateCategoryProperties(dim, uniqueInfoDim) {\n // Update categoryarray\n dim._categoryarray = uniqueInfoDim.uniqueValues;\n\n // Handle ticktext\n if(dim.ticktext === null || dim.ticktext === undefined) {\n dim._ticktext = [];\n } else {\n // Shallow copy to avoid modifying input array\n dim._ticktext = dim.ticktext.slice();\n }\n\n // Extend ticktext with elements from uniqueInfoDim.uniqueValues\n for(var i = dim._ticktext.length; i < uniqueInfoDim.uniqueValues.length; i++) {\n dim._ticktext.push(uniqueInfoDim.uniqueValues[i]);\n }\n}\n\n/**\n * Determine whether an array contains a permutation of the integers from 0 to the array's length - 1\n * @param {Array} inds\n * @return {boolean}\n */\nfunction isRangePermutation(inds) {\n var indsSpecified = new Array(inds.length);\n\n for(var i = 0; i < inds.length; i++) {\n // Check for out of bounds\n if(inds[i] < 0 || inds[i] >= inds.length) {\n return false;\n }\n\n // Check for collisions with already specified index\n if(indsSpecified[inds[i]] !== undefined) {\n return false;\n }\n\n indsSpecified[inds[i]] = true;\n }\n\n // Nothing out of bounds and no collisions. We have a permutation\n return true;\n}\n\n},{\"../../components/colorscale/calc\":603,\"../../components/colorscale/helpers\":606,\"../../components/drawing\":617,\"../../lib\":728,\"../../lib/filter_unique.js\":720,\"../../lib/gup\":726,\"fast-isnumeric\":236}],1092:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar hasColorscale = _dereq_('../../components/colorscale/helpers').hasColorscale;\nvar colorscaleDefaults = _dereq_('../../components/colorscale/defaults');\nvar handleDomainDefaults = _dereq_('../../plots/domain').defaults;\nvar handleArrayContainerDefaults = _dereq_('../../plots/array_container_defaults');\n\nvar attributes = _dereq_('./attributes');\nvar mergeLength = _dereq_('../parcoords/merge_length');\n\nfunction handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce) {\n coerce('line.shape');\n coerce('line.hovertemplate');\n\n var lineColor = coerce('line.color', layout.colorway[0]);\n if(hasColorscale(traceIn, 'line') && Lib.isArrayOrTypedArray(lineColor)) {\n if(lineColor.length) {\n coerce('line.colorscale');\n colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: 'line.', cLetter: 'c'});\n return lineColor.length;\n } else {\n traceOut.line.color = defaultColor;\n }\n }\n return Infinity;\n}\n\nfunction dimensionDefaults(dimensionIn, dimensionOut) {\n function coerce(attr, dflt) {\n return Lib.coerce(dimensionIn, dimensionOut, attributes.dimensions, attr, dflt);\n }\n\n var values = coerce('values');\n var visible = coerce('visible');\n if(!(values && values.length)) {\n visible = dimensionOut.visible = false;\n }\n\n if(visible) {\n // Dimension level\n coerce('label');\n coerce('displayindex', dimensionOut._index);\n\n // Category level\n var arrayIn = dimensionIn.categoryarray;\n var isValidArray = (Array.isArray(arrayIn) && arrayIn.length > 0);\n\n var orderDefault;\n if(isValidArray) orderDefault = 'array';\n var order = coerce('categoryorder', orderDefault);\n\n // coerce 'categoryarray' only in array order case\n if(order === 'array') {\n coerce('categoryarray');\n coerce('ticktext');\n } else {\n delete dimensionIn.categoryarray;\n delete dimensionIn.ticktext;\n }\n\n // cannot set 'categoryorder' to 'array' with an invalid 'categoryarray'\n if(!isValidArray && order === 'array') {\n dimensionOut.categoryorder = 'trace';\n }\n }\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 dimensions = handleArrayContainerDefaults(traceIn, traceOut, {\n name: 'dimensions',\n handleItemDefaults: dimensionDefaults\n });\n\n var len = handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce);\n\n handleDomainDefaults(traceOut, layout, coerce);\n\n if(!Array.isArray(dimensions) || !dimensions.length) {\n traceOut.visible = false;\n }\n\n mergeLength(traceOut, dimensions, 'values', len);\n\n coerce('hoveron');\n coerce('hovertemplate');\n coerce('arrangement');\n coerce('bundlecolors');\n coerce('sortpaths');\n coerce('counts');\n\n var labelfontDflt = {\n family: layout.font.family,\n size: Math.round(layout.font.size),\n color: layout.font.color\n };\n\n Lib.coerceFont(coerce, 'labelfont', labelfontDflt);\n\n var categoryfontDefault = {\n family: layout.font.family,\n size: Math.round(layout.font.size / 1.2),\n color: layout.font.color\n };\n\n Lib.coerceFont(coerce, 'tickfont', categoryfontDefault);\n};\n\n},{\"../../components/colorscale/defaults\":605,\"../../components/colorscale/helpers\":606,\"../../lib\":728,\"../../plots/array_container_defaults\":772,\"../../plots/domain\":803,\"../parcoords/merge_length\":1105,\"./attributes\":1089}],1093:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults'),\n calc: _dereq_('./calc'),\n plot: _dereq_('./plot'),\n colorbar: {\n container: 'line',\n min: 'cmin',\n max: 'cmax'\n },\n\n moduleType: 'trace',\n name: 'parcats',\n basePlotModule: _dereq_('./base_plot'),\n categories: ['noOpacity'],\n meta: {\n \n }\n};\n\n},{\"./attributes\":1089,\"./base_plot\":1090,\"./calc\":1091,\"./defaults\":1092,\"./plot\":1095}],1094:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Plotly = _dereq_('../../plot_api/plot_api');\nvar Fx = _dereq_('../../components/fx');\nvar Lib = _dereq_('../../lib');\nvar Drawing = _dereq_('../../components/drawing');\nvar tinycolor = _dereq_('tinycolor2');\nvar svgTextUtils = _dereq_('../../lib/svg_text_utils');\n\nfunction performPlot(parcatsModels, graphDiv, layout, svg) {\n var viewModels = parcatsModels.map(createParcatsViewModel.bind(0, graphDiv, layout));\n\n // Get (potentially empty) parcatslayer selection with bound data to single element array\n var layerSelection = svg.selectAll('g.parcatslayer').data([null]);\n\n // Initialize single parcatslayer group if it doesn't exist\n layerSelection.enter()\n .append('g')\n .attr('class', 'parcatslayer')\n .style('pointer-events', 'all');\n\n // Bind data to children of layerSelection and get reference to traceSelection\n var traceSelection = layerSelection\n .selectAll('g.trace.parcats')\n .data(viewModels, key);\n\n // Initialize group for each trace/dimensions\n var traceEnter = traceSelection.enter()\n .append('g')\n .attr('class', 'trace parcats');\n\n // Update properties for each trace\n traceSelection\n .attr('transform', function(d) {\n return 'translate(' + d.x + ', ' + d.y + ')';\n });\n\n // Initialize paths group\n traceEnter\n .append('g')\n .attr('class', 'paths');\n\n // Update paths transform\n var pathsSelection = traceSelection\n .select('g.paths');\n\n // Get paths selection\n var pathSelection = pathsSelection\n .selectAll('path.path')\n .data(function(d) {\n return d.paths;\n }, key);\n\n // Update existing path colors\n pathSelection\n .attr('fill', function(d) {\n return d.model.color;\n });\n\n // Create paths\n var pathSelectionEnter = pathSelection\n .enter()\n .append('path')\n .attr('class', 'path')\n .attr('stroke-opacity', 0)\n .attr('fill', function(d) {\n return d.model.color;\n })\n .attr('fill-opacity', 0);\n\n stylePathsNoHover(pathSelectionEnter);\n\n // Set path geometry\n pathSelection\n .attr('d', function(d) {\n return d.svgD;\n });\n\n // sort paths\n if(!pathSelectionEnter.empty()) {\n // Only sort paths if there has been a change.\n // Otherwise paths are already sorted or a hover operation may be in progress\n pathSelection.sort(compareRawColor);\n }\n\n // Remove any old paths\n pathSelection.exit().remove();\n\n // Path hover\n pathSelection\n .on('mouseover', mouseoverPath)\n .on('mouseout', mouseoutPath)\n .on('click', clickPath);\n\n // Initialize dimensions group\n traceEnter.append('g').attr('class', 'dimensions');\n\n // Update dimensions transform\n var dimensionsSelection = traceSelection\n .select('g.dimensions');\n\n // Get dimension selection\n var dimensionSelection = dimensionsSelection\n .selectAll('g.dimension')\n .data(function(d) {\n return d.dimensions;\n }, key);\n\n // Create dimension groups\n dimensionSelection.enter()\n .append('g')\n .attr('class', 'dimension');\n\n // Update dimension group transforms\n dimensionSelection.attr('transform', function(d) {\n return 'translate(' + d.x + ', 0)';\n });\n\n // Remove any old dimensions\n dimensionSelection.exit().remove();\n\n // Get category selection\n var categorySelection = dimensionSelection\n .selectAll('g.category')\n .data(function(d) {\n return d.categories;\n }, key);\n\n // Initialize category groups\n var categoryGroupEnterSelection = categorySelection\n .enter()\n .append('g')\n .attr('class', 'category');\n\n // Update category transforms\n categorySelection\n .attr('transform', function(d) {\n return 'translate(0, ' + d.y + ')';\n });\n\n\n // Initialize rectangle\n categoryGroupEnterSelection\n .append('rect')\n .attr('class', 'catrect')\n .attr('pointer-events', 'none');\n\n\n // Update rectangle\n categorySelection.select('rect.catrect')\n .attr('fill', 'none')\n .attr('width', function(d) {\n return d.width;\n })\n .attr('height', function(d) {\n return d.height;\n });\n\n styleCategoriesNoHover(categoryGroupEnterSelection);\n\n // Initialize color band rects\n var bandSelection = categorySelection\n .selectAll('rect.bandrect')\n .data(\n /** @param {CategoryViewModel} catViewModel*/\n function(catViewModel) {\n return catViewModel.bands;\n }, key);\n\n // Raise all update bands to the top so that fading enter/exit bands will be behind\n bandSelection.each(function() {Lib.raiseToTop(this);});\n\n // Update band color\n bandSelection\n .attr('fill', function(d) {\n return d.color;\n });\n\n var bandsSelectionEnter = bandSelection.enter()\n .append('rect')\n .attr('class', 'bandrect')\n .attr('stroke-opacity', 0)\n .attr('fill', function(d) {\n return d.color;\n })\n .attr('fill-opacity', 0);\n\n bandSelection\n .attr('fill', function(d) {\n return d.color;\n })\n .attr('width', function(d) {\n return d.width;\n })\n .attr('height', function(d) {\n return d.height;\n })\n .attr('y', function(d) {\n return d.y;\n })\n .attr('cursor',\n /** @param {CategoryBandViewModel} bandModel*/\n function(bandModel) {\n if(bandModel.parcatsViewModel.arrangement === 'fixed') {\n return 'default';\n } else if(bandModel.parcatsViewModel.arrangement === 'perpendicular') {\n return 'ns-resize';\n } else {\n return 'move';\n }\n });\n\n styleBandsNoHover(bandsSelectionEnter);\n\n bandSelection.exit().remove();\n\n // Initialize category label\n categoryGroupEnterSelection\n .append('text')\n .attr('class', 'catlabel')\n .attr('pointer-events', 'none');\n\n var paperColor = graphDiv._fullLayout.paper_bgcolor;\n\n // Update category label\n categorySelection.select('text.catlabel')\n .attr('text-anchor',\n function(d) {\n if(catInRightDim(d)) {\n // Place label to the right of category\n return 'start';\n } else {\n // Place label to the left of category\n return 'end';\n }\n })\n .attr('alignment-baseline', 'middle')\n\n .style('text-shadow',\n paperColor + ' -1px 1px 2px, ' +\n paperColor + ' 1px 1px 2px, ' +\n paperColor + ' 1px -1px 2px, ' +\n paperColor + ' -1px -1px 2px')\n .style('fill', 'rgb(0, 0, 0)')\n .attr('x',\n function(d) {\n if(catInRightDim(d)) {\n // Place label to the right of category\n return d.width + 5;\n } else {\n // Place label to the left of category\n return -5;\n }\n })\n .attr('y', function(d) {\n return d.height / 2;\n })\n .text(function(d) {\n return d.model.categoryLabel;\n })\n .each(\n /** @param {CategoryViewModel} catModel*/\n function(catModel) {\n Drawing.font(d3.select(this), catModel.parcatsViewModel.categorylabelfont);\n svgTextUtils.convertToTspans(d3.select(this), graphDiv);\n });\n\n // Initialize dimension label\n categoryGroupEnterSelection\n .append('text')\n .attr('class', 'dimlabel');\n\n // Update dimension label\n categorySelection.select('text.dimlabel')\n .attr('text-anchor', 'middle')\n .attr('alignment-baseline', 'baseline')\n .attr('cursor',\n /** @param {CategoryViewModel} catModel*/\n function(catModel) {\n if(catModel.parcatsViewModel.arrangement === 'fixed') {\n return 'default';\n } else {\n return 'ew-resize';\n }\n })\n .attr('x', function(d) {\n return d.width / 2;\n })\n .attr('y', -5)\n .text(function(d, i) {\n if(i === 0) {\n // Add dimension label above topmost category\n return d.parcatsViewModel.model.dimensions[d.model.dimensionInd].dimensionLabel;\n } else {\n return null;\n }\n })\n .each(\n /** @param {CategoryViewModel} catModel*/\n function(catModel) {\n Drawing.font(d3.select(this), catModel.parcatsViewModel.labelfont);\n });\n\n // Category hover\n // categorySelection.select('rect.catrect')\n categorySelection.selectAll('rect.bandrect')\n .on('mouseover', mouseoverCategoryBand)\n .on('mouseout', mouseoutCategory);\n\n // Remove unused categories\n categorySelection.exit().remove();\n\n // Setup drag\n dimensionSelection.call(d3.behavior.drag()\n .origin(function(d) {\n return {x: d.x, y: 0};\n })\n .on('dragstart', dragDimensionStart)\n .on('drag', dragDimension)\n .on('dragend', dragDimensionEnd));\n\n\n // Save off selections to view models\n traceSelection.each(function(d) {\n d.traceSelection = d3.select(this);\n d.pathSelection = d3.select(this).selectAll('g.paths').selectAll('path.path');\n d.dimensionSelection = d3.select(this).selectAll('g.dimensions').selectAll('g.dimension');\n });\n\n // Remove any orphan traces\n traceSelection.exit().remove();\n}\n\n/**\n * Create / update parcat traces\n *\n * @param {Object} graphDiv\n * @param {Object} svg\n * @param {Array.} parcatsModels\n * @param {Layout} layout\n */\nmodule.exports = function(graphDiv, svg, parcatsModels, layout) {\n performPlot(parcatsModels, graphDiv, layout, svg);\n};\n\n/**\n * Function the returns the key property of an object for use with as D3 join function\n * @param d\n */\nfunction key(d) {\n return d.key;\n}\n\n /** True if a category view model is in the right-most display dimension\n * @param {CategoryViewModel} d */\nfunction catInRightDim(d) {\n var numDims = d.parcatsViewModel.dimensions.length;\n var leftDimInd = d.parcatsViewModel.dimensions[numDims - 1].model.dimensionInd;\n return d.model.dimensionInd === leftDimInd;\n}\n\n/**\n * @param {PathViewModel} a\n * @param {PathViewModel} b\n */\nfunction compareRawColor(a, b) {\n if(a.model.rawColor > b.model.rawColor) {\n return 1;\n } else if(a.model.rawColor < b.model.rawColor) {\n return -1;\n } else {\n return 0;\n }\n}\n\n/**\n * Handle path mouseover\n * @param {PathViewModel} d\n */\nfunction mouseoverPath(d) {\n if(!d.parcatsViewModel.dragDimension) {\n // We're not currently dragging\n\n if(d.parcatsViewModel.hoverinfoItems.indexOf('skip') === -1) {\n // hoverinfo is not skip, so we at least style the paths and emit interaction events\n\n // Raise path to top\n Lib.raiseToTop(this);\n\n stylePathsHover(d3.select(this));\n\n // Emit hover event\n var points = buildPointsArrayForPath(d);\n var constraints = buildConstraintsForPath(d);\n d.parcatsViewModel.graphDiv.emit('plotly_hover', {\n points: points, event: d3.event, constraints: constraints\n });\n\n // Handle hover label\n if(d.parcatsViewModel.hoverinfoItems.indexOf('none') === -1) {\n // hoverinfo is a combination of 'count' and 'probability'\n\n // Mouse\n var hoverX = d3.mouse(this)[0];\n\n // Label\n var gd = d.parcatsViewModel.graphDiv;\n var trace = d.parcatsViewModel.trace;\n var fullLayout = gd._fullLayout;\n var rootBBox = fullLayout._paperdiv.node().getBoundingClientRect();\n var graphDivBBox = d.parcatsViewModel.graphDiv.getBoundingClientRect();\n\n // Find path center in path coordinates\n var pathCenterX,\n pathCenterY,\n dimInd;\n\n for(dimInd = 0; dimInd < (d.leftXs.length - 1); dimInd++) {\n if(d.leftXs[dimInd] + d.dimWidths[dimInd] - 2 <= hoverX && hoverX <= d.leftXs[dimInd + 1] + 2) {\n var leftDim = d.parcatsViewModel.dimensions[dimInd];\n var rightDim = d.parcatsViewModel.dimensions[dimInd + 1];\n pathCenterX = (leftDim.x + leftDim.width + rightDim.x) / 2;\n pathCenterY = (d.topYs[dimInd] + d.topYs[dimInd + 1] + d.height) / 2;\n break;\n }\n }\n\n // Find path center in root coordinates\n var hoverCenterX = d.parcatsViewModel.x + pathCenterX;\n var hoverCenterY = d.parcatsViewModel.y + pathCenterY;\n\n var textColor = tinycolor.mostReadable(d.model.color, ['black', 'white']);\n\n var count = d.model.count;\n var prob = count / d.parcatsViewModel.model.count;\n var labels = {\n countLabel: count,\n probabilityLabel: prob.toFixed(3)\n };\n\n // Build hover text\n var hovertextParts = [];\n if(d.parcatsViewModel.hoverinfoItems.indexOf('count') !== -1) {\n hovertextParts.push(['Count:', labels.countLabel].join(' '));\n }\n if(d.parcatsViewModel.hoverinfoItems.indexOf('probability') !== -1) {\n hovertextParts.push(['P:', labels.probabilityLabel].join(' '));\n }\n\n var hovertext = hovertextParts.join('
');\n var mouseX = d3.mouse(gd)[0];\n\n Fx.loneHover({\n trace: trace,\n x: hoverCenterX - rootBBox.left + graphDivBBox.left,\n y: hoverCenterY - rootBBox.top + graphDivBBox.top,\n text: hovertext,\n color: d.model.color,\n borderColor: 'black',\n fontFamily: 'Monaco, \"Courier New\", monospace',\n fontSize: 10,\n fontColor: textColor,\n idealAlign: mouseX < hoverCenterX ? 'right' : 'left',\n hovertemplate: (trace.line || {}).hovertemplate,\n hovertemplateLabels: labels,\n eventData: [{\n data: trace._input,\n fullData: trace,\n count: count,\n probability: prob\n }]\n }, {\n container: fullLayout._hoverlayer.node(),\n outerContainer: fullLayout._paper.node(),\n gd: gd\n });\n }\n }\n }\n}\n\n/**\n * Handle path mouseout\n * @param {PathViewModel} d\n */\nfunction mouseoutPath(d) {\n if(!d.parcatsViewModel.dragDimension) {\n // We're not currently dragging\n stylePathsNoHover(d3.select(this));\n\n // Remove and hover label\n Fx.loneUnhover(d.parcatsViewModel.graphDiv._fullLayout._hoverlayer.node());\n\n // Restore path order\n d.parcatsViewModel.pathSelection.sort(compareRawColor);\n\n // Emit unhover event\n if(d.parcatsViewModel.hoverinfoItems.indexOf('skip') === -1) {\n var points = buildPointsArrayForPath(d);\n var constraints = buildConstraintsForPath(d);\n d.parcatsViewModel.graphDiv.emit('plotly_unhover', {\n points: points, event: d3.event, constraints: constraints\n });\n }\n }\n}\n\n/**\n * Build array of point objects for a path\n *\n * For use in click/hover events\n * @param {PathViewModel} d\n */\nfunction buildPointsArrayForPath(d) {\n var points = [];\n var curveNumber = getTraceIndex(d.parcatsViewModel);\n\n for(var i = 0; i < d.model.valueInds.length; i++) {\n var pointNumber = d.model.valueInds[i];\n points.push({\n curveNumber: curveNumber,\n pointNumber: pointNumber\n });\n }\n return points;\n}\n\n/**\n * Build constraints object for a path\n *\n * For use in click/hover events\n * @param {PathViewModel} d\n */\nfunction buildConstraintsForPath(d) {\n var constraints = {};\n var dimensions = d.parcatsViewModel.model.dimensions;\n\n // dimensions\n for(var i = 0; i < dimensions.length; i++) {\n var dimension = dimensions[i];\n var category = dimension.categories[d.model.categoryInds[i]];\n constraints[dimension.containerInd] = category.categoryValue;\n }\n\n // color\n if(d.model.rawColor !== undefined) {\n constraints.color = d.model.rawColor;\n }\n return constraints;\n}\n\n/**\n * Handle path click\n * @param {PathViewModel} d\n */\nfunction clickPath(d) {\n if(d.parcatsViewModel.hoverinfoItems.indexOf('skip') === -1) {\n // hoverinfo it's skip, so interaction events aren't disabled\n var points = buildPointsArrayForPath(d);\n var constraints = buildConstraintsForPath(d);\n d.parcatsViewModel.graphDiv.emit('plotly_click', {\n points: points, event: d3.event, constraints: constraints\n });\n }\n}\n\nfunction stylePathsNoHover(pathSelection) {\n pathSelection\n .attr('fill', function(d) {\n return d.model.color;\n })\n .attr('fill-opacity', 0.6)\n .attr('stroke', 'lightgray')\n .attr('stroke-width', 0.2)\n .attr('stroke-opacity', 1.0);\n}\n\nfunction stylePathsHover(pathSelection) {\n pathSelection\n .attr('fill-opacity', 0.8)\n .attr('stroke', function(d) {\n return tinycolor.mostReadable(d.model.color, ['black', 'white']);\n })\n .attr('stroke-width', 0.3);\n}\n\nfunction styleCategoryHover(categorySelection) {\n categorySelection\n .select('rect.catrect')\n .attr('stroke', 'black')\n .attr('stroke-width', 2.5);\n}\n\nfunction styleCategoriesNoHover(categorySelection) {\n categorySelection\n .select('rect.catrect')\n .attr('stroke', 'black')\n .attr('stroke-width', 1)\n .attr('stroke-opacity', 1);\n}\n\nfunction styleBandsHover(bandsSelection) {\n bandsSelection\n .attr('stroke', 'black')\n .attr('stroke-width', 1.5);\n}\n\nfunction styleBandsNoHover(bandsSelection) {\n bandsSelection\n .attr('stroke', 'black')\n .attr('stroke-width', 0.2)\n .attr('stroke-opacity', 1.0)\n .attr('fill-opacity', 1.0);\n}\n\n/**\n * Return selection of all paths that pass through the specified category\n * @param {CategoryBandViewModel} catBandViewModel\n */\nfunction selectPathsThroughCategoryBandColor(catBandViewModel) {\n var allPaths = catBandViewModel.parcatsViewModel.pathSelection;\n var dimInd = catBandViewModel.categoryViewModel.model.dimensionInd;\n var catInd = catBandViewModel.categoryViewModel.model.categoryInd;\n\n return allPaths\n .filter(\n /** @param {PathViewModel} pathViewModel */\n function(pathViewModel) {\n return pathViewModel.model.categoryInds[dimInd] === catInd &&\n pathViewModel.model.color === catBandViewModel.color;\n });\n}\n\n\n/**\n * Perform hover styling for all paths that pass though the specified band element's category\n *\n * @param {HTMLElement} bandElement\n * HTML element for band\n *\n */\nfunction styleForCategoryHovermode(bandElement) {\n // Get all bands in the current category\n var bandSel = d3.select(bandElement.parentNode).selectAll('rect.bandrect');\n\n // Raise and style paths\n bandSel.each(function(bvm) {\n var paths = selectPathsThroughCategoryBandColor(bvm);\n stylePathsHover(paths);\n paths.each(function() {\n // Raise path to top\n Lib.raiseToTop(this);\n });\n });\n\n // Style category\n styleCategoryHover(d3.select(bandElement.parentNode));\n}\n\n/**\n * Perform hover styling for all paths that pass though the category of the specified band element and share the\n * same color\n *\n * @param {HTMLElement} bandElement\n * HTML element for band\n *\n */\nfunction styleForColorHovermode(bandElement) {\n var bandViewModel = d3.select(bandElement).datum();\n var catPaths = selectPathsThroughCategoryBandColor(bandViewModel);\n stylePathsHover(catPaths);\n catPaths.each(function() {\n // Raise path to top\n Lib.raiseToTop(this);\n });\n\n // Style category for drag\n d3.select(bandElement.parentNode)\n .selectAll('rect.bandrect')\n .filter(function(b) {return b.color === bandViewModel.color;})\n .each(function() {\n Lib.raiseToTop(this);\n styleBandsHover(d3.select(this));\n });\n}\n\n\n/**\n * @param {HTMLElement} bandElement\n * HTML element for band\n * @param eventName\n * Event name (plotly_hover or plotly_click)\n * @param event\n * Mouse Event\n */\nfunction emitPointsEventCategoryHovermode(bandElement, eventName, event) {\n // Get all bands in the current category\n var bandViewModel = d3.select(bandElement).datum();\n var categoryModel = bandViewModel.categoryViewModel.model;\n var gd = bandViewModel.parcatsViewModel.graphDiv;\n var bandSel = d3.select(bandElement.parentNode).selectAll('rect.bandrect');\n\n var points = [];\n bandSel.each(function(bvm) {\n var paths = selectPathsThroughCategoryBandColor(bvm);\n paths.each(function(pathViewModel) {\n // Extend points array\n Array.prototype.push.apply(points, buildPointsArrayForPath(pathViewModel));\n });\n });\n\n var constraints = {};\n constraints[categoryModel.dimensionInd] = categoryModel.categoryValue;\n gd.emit(eventName, {\n points: points, event: event, constraints: constraints\n });\n}\n\n/**\n * @param {HTMLElement} bandElement\n * HTML element for band\n * @param eventName\n * Event name (plotly_hover or plotly_click)\n * @param event\n * Mouse Event\n */\nfunction emitPointsEventColorHovermode(bandElement, eventName, event) {\n var bandViewModel = d3.select(bandElement).datum();\n var categoryModel = bandViewModel.categoryViewModel.model;\n var gd = bandViewModel.parcatsViewModel.graphDiv;\n var paths = selectPathsThroughCategoryBandColor(bandViewModel);\n\n var points = [];\n paths.each(function(pathViewModel) {\n // Extend points array\n Array.prototype.push.apply(points, buildPointsArrayForPath(pathViewModel));\n });\n\n var constraints = {};\n constraints[categoryModel.dimensionInd] = categoryModel.categoryValue;\n // color\n if(bandViewModel.rawColor !== undefined) {\n constraints.color = bandViewModel.rawColor;\n }\n gd.emit(eventName, {\n points: points, event: event, constraints: constraints\n });\n}\n\n/**\n * Create hover label for a band element's category (for use when hoveron === 'category')\n *\n * @param {ClientRect} rootBBox\n * Client bounding box for root of figure\n * @param {HTMLElement} bandElement\n * HTML element for band\n *\n */\nfunction createHoverLabelForCategoryHovermode(rootBBox, bandElement) {\n // Selections\n var rectSelection = d3.select(bandElement.parentNode).select('rect.catrect');\n var rectBoundingBox = rectSelection.node().getBoundingClientRect();\n\n // Models\n /** @type {CategoryViewModel} */\n var catViewModel = rectSelection.datum();\n var parcatsViewModel = catViewModel.parcatsViewModel;\n var dimensionModel = parcatsViewModel.model.dimensions[catViewModel.model.dimensionInd];\n var trace = parcatsViewModel.trace;\n\n // Positions\n var hoverCenterY = rectBoundingBox.top + rectBoundingBox.height / 2;\n var hoverCenterX,\n hoverLabelIdealAlign;\n\n if(parcatsViewModel.dimensions.length > 1 &&\n dimensionModel.displayInd === parcatsViewModel.dimensions.length - 1) {\n // right most dimension\n hoverCenterX = rectBoundingBox.left;\n hoverLabelIdealAlign = 'left';\n } else {\n hoverCenterX = rectBoundingBox.left + rectBoundingBox.width;\n hoverLabelIdealAlign = 'right';\n }\n\n var count = catViewModel.model.count;\n var catLabel = catViewModel.model.categoryLabel;\n var prob = count / catViewModel.parcatsViewModel.model.count;\n var labels = {\n countLabel: count,\n categoryLabel: catLabel,\n probabilityLabel: prob.toFixed(3)\n };\n\n // Hover label text\n var hoverinfoParts = [];\n if(catViewModel.parcatsViewModel.hoverinfoItems.indexOf('count') !== -1) {\n hoverinfoParts.push(['Count:', labels.countLabel].join(' '));\n }\n if(catViewModel.parcatsViewModel.hoverinfoItems.indexOf('probability') !== -1) {\n hoverinfoParts.push(['P(' + labels.categoryLabel + '):', labels.probabilityLabel].join(' '));\n }\n\n var hovertext = hoverinfoParts.join('
');\n return {\n trace: trace,\n x: hoverCenterX - rootBBox.left,\n y: hoverCenterY - rootBBox.top,\n text: hovertext,\n color: 'lightgray',\n borderColor: 'black',\n fontFamily: 'Monaco, \"Courier New\", monospace',\n fontSize: 12,\n fontColor: 'black',\n idealAlign: hoverLabelIdealAlign,\n hovertemplate: trace.hovertemplate,\n hovertemplateLabels: labels,\n eventData: [{\n data: trace._input,\n fullData: trace,\n count: count,\n category: catLabel,\n probability: prob\n }]\n };\n}\n\n/**\n * Create hover label for a band element's category (for use when hoveron === 'category')\n *\n * @param {ClientRect} rootBBox\n * Client bounding box for root of figure\n * @param {HTMLElement} bandElement\n * HTML element for band\n *\n */\nfunction createHoverLabelForDimensionHovermode(rootBBox, bandElement) {\n var allHoverlabels = [];\n\n d3.select(bandElement.parentNode.parentNode)\n .selectAll('g.category')\n .select('rect.catrect')\n .each(function() {\n var bandNode = this;\n allHoverlabels.push(createHoverLabelForCategoryHovermode(rootBBox, bandNode));\n });\n\n return allHoverlabels;\n}\n\n/**\n * Create hover labels for a band element's category (for use when hoveron === 'dimension')\n *\n * @param {ClientRect} rootBBox\n * Client bounding box for root of figure\n * @param {HTMLElement} bandElement\n * HTML element for band\n *\n */\nfunction createHoverLabelForColorHovermode(rootBBox, bandElement) {\n var bandBoundingBox = bandElement.getBoundingClientRect();\n\n // Models\n /** @type {CategoryBandViewModel} */\n var bandViewModel = d3.select(bandElement).datum();\n var catViewModel = bandViewModel.categoryViewModel;\n var parcatsViewModel = catViewModel.parcatsViewModel;\n var dimensionModel = parcatsViewModel.model.dimensions[catViewModel.model.dimensionInd];\n var trace = parcatsViewModel.trace;\n\n // positions\n var hoverCenterY = bandBoundingBox.y + bandBoundingBox.height / 2;\n\n var hoverCenterX,\n hoverLabelIdealAlign;\n if(parcatsViewModel.dimensions.length > 1 &&\n dimensionModel.displayInd === parcatsViewModel.dimensions.length - 1) {\n // right most dimension\n hoverCenterX = bandBoundingBox.left;\n hoverLabelIdealAlign = 'left';\n } else {\n hoverCenterX = bandBoundingBox.left + bandBoundingBox.width;\n hoverLabelIdealAlign = 'right';\n }\n\n // Labels\n var catLabel = catViewModel.model.categoryLabel;\n\n // Counts\n var totalCount = bandViewModel.parcatsViewModel.model.count;\n\n var bandColorCount = 0;\n bandViewModel.categoryViewModel.bands.forEach(function(b) {\n if(b.color === bandViewModel.color) {\n bandColorCount += b.count;\n }\n });\n\n var catCount = catViewModel.model.count;\n\n var colorCount = 0;\n parcatsViewModel.pathSelection.each(\n /** @param {PathViewModel} pathViewModel */\n function(pathViewModel) {\n if(pathViewModel.model.color === bandViewModel.color) {\n colorCount += pathViewModel.model.count;\n }\n });\n\n var pColorAndCat = bandColorCount / totalCount;\n var pCatGivenColor = bandColorCount / colorCount;\n var pColorGivenCat = bandColorCount / catCount;\n\n var labels = {\n countLabel: totalCount,\n categoryLabel: catLabel,\n probabilityLabel: pColorAndCat.toFixed(3)\n };\n\n // Hover label text\n var hoverinfoParts = [];\n if(catViewModel.parcatsViewModel.hoverinfoItems.indexOf('count') !== -1) {\n hoverinfoParts.push(['Count:', labels.countLabel].join(' '));\n }\n if(catViewModel.parcatsViewModel.hoverinfoItems.indexOf('probability') !== -1) {\n hoverinfoParts.push('P(color ∩ ' + catLabel + '): ' + labels.probabilityLabel);\n hoverinfoParts.push('P(' + catLabel + ' | color): ' + pCatGivenColor.toFixed(3));\n hoverinfoParts.push('P(color | ' + catLabel + '): ' + pColorGivenCat.toFixed(3));\n }\n\n var hovertext = hoverinfoParts.join('
');\n\n // Compute text color\n var textColor = tinycolor.mostReadable(bandViewModel.color, ['black', 'white']);\n\n return {\n trace: trace,\n x: hoverCenterX - rootBBox.left,\n y: hoverCenterY - rootBBox.top,\n // name: 'NAME',\n text: hovertext,\n color: bandViewModel.color,\n borderColor: 'black',\n fontFamily: 'Monaco, \"Courier New\", monospace',\n fontColor: textColor,\n fontSize: 10,\n idealAlign: hoverLabelIdealAlign,\n hovertemplate: trace.hovertemplate,\n hovertemplateLabels: labels,\n eventData: [{\n data: trace._input,\n fullData: trace,\n category: catLabel,\n count: totalCount,\n probability: pColorAndCat,\n categorycount: catCount,\n colorcount: colorCount,\n bandcolorcount: bandColorCount\n }]\n };\n}\n\n/**\n * Handle dimension mouseover\n * @param {CategoryBandViewModel} bandViewModel\n */\nfunction mouseoverCategoryBand(bandViewModel) {\n if(!bandViewModel.parcatsViewModel.dragDimension) {\n // We're not currently dragging\n\n if(bandViewModel.parcatsViewModel.hoverinfoItems.indexOf('skip') === -1) {\n // hoverinfo is not skip, so we at least style the bands and emit interaction events\n\n // Mouse\n var mouseY = d3.mouse(this)[1];\n if(mouseY < -1) {\n // Hover is above above the category rectangle (probably the dimension title text)\n return;\n }\n\n var gd = bandViewModel.parcatsViewModel.graphDiv;\n var fullLayout = gd._fullLayout;\n var rootBBox = fullLayout._paperdiv.node().getBoundingClientRect();\n var hoveron = bandViewModel.parcatsViewModel.hoveron;\n\n /** @type {HTMLElement} */\n var bandElement = this;\n\n // Handle style and events\n if(hoveron === 'color') {\n styleForColorHovermode(bandElement);\n emitPointsEventColorHovermode(bandElement, 'plotly_hover', d3.event);\n } else {\n styleForCategoryHovermode(bandElement);\n emitPointsEventCategoryHovermode(bandElement, 'plotly_hover', d3.event);\n }\n\n // Handle hover label\n if(bandViewModel.parcatsViewModel.hoverinfoItems.indexOf('none') === -1) {\n var hoverItems;\n if(hoveron === 'category') {\n hoverItems = createHoverLabelForCategoryHovermode(rootBBox, bandElement);\n } else if(hoveron === 'color') {\n hoverItems = createHoverLabelForColorHovermode(rootBBox, bandElement);\n } else if(hoveron === 'dimension') {\n hoverItems = createHoverLabelForDimensionHovermode(rootBBox, bandElement);\n }\n\n if(hoverItems) {\n Fx.loneHover(hoverItems, {\n container: fullLayout._hoverlayer.node(),\n outerContainer: fullLayout._paper.node(),\n gd: gd\n });\n }\n }\n }\n }\n}\n\n\n/**\n * Handle dimension mouseover\n * @param {CategoryBandViewModel} bandViewModel\n */\nfunction mouseoutCategory(bandViewModel) {\n var parcatsViewModel = bandViewModel.parcatsViewModel;\n\n if(!parcatsViewModel.dragDimension) {\n // We're not dragging anything\n\n // Reset unhovered styles\n stylePathsNoHover(parcatsViewModel.pathSelection);\n styleCategoriesNoHover(parcatsViewModel.dimensionSelection.selectAll('g.category'));\n styleBandsNoHover(parcatsViewModel.dimensionSelection.selectAll('g.category').selectAll('rect.bandrect'));\n\n // Remove hover label\n Fx.loneUnhover(parcatsViewModel.graphDiv._fullLayout._hoverlayer.node());\n\n // Restore path order\n parcatsViewModel.pathSelection.sort(compareRawColor);\n\n // Emit unhover event\n if(parcatsViewModel.hoverinfoItems.indexOf('skip') === -1) {\n var hoveron = bandViewModel.parcatsViewModel.hoveron;\n var bandElement = this;\n\n // Handle style and events\n if(hoveron === 'color') {\n emitPointsEventColorHovermode(bandElement, 'plotly_unhover', d3.event);\n } else {\n emitPointsEventCategoryHovermode(bandElement, 'plotly_unhover', d3.event);\n }\n }\n }\n}\n\n\n/**\n * Handle dimension drag start\n * @param {DimensionViewModel} d\n */\nfunction dragDimensionStart(d) {\n // Check if dragging is supported\n if(d.parcatsViewModel.arrangement === 'fixed') {\n return;\n }\n\n // Save off initial drag indexes for dimension\n d.dragDimensionDisplayInd = d.model.displayInd;\n d.initialDragDimensionDisplayInds = d.parcatsViewModel.model.dimensions.map(function(d) {return d.displayInd;});\n d.dragHasMoved = false;\n\n // Check for category hit\n d.dragCategoryDisplayInd = null;\n d3.select(this)\n .selectAll('g.category')\n .select('rect.catrect')\n .each(\n /** @param {CategoryViewModel} catViewModel */\n function(catViewModel) {\n var catMouseX = d3.mouse(this)[0];\n var catMouseY = d3.mouse(this)[1];\n\n\n if(-2 <= catMouseX && catMouseX <= catViewModel.width + 2 &&\n -2 <= catMouseY && catMouseY <= catViewModel.height + 2) {\n // Save off initial drag indexes for categories\n d.dragCategoryDisplayInd = catViewModel.model.displayInd;\n d.initialDragCategoryDisplayInds = d.model.categories.map(function(c) {\n return c.displayInd;\n });\n\n // Initialize categories dragY to be the current y position\n catViewModel.model.dragY = catViewModel.y;\n\n // Raise category\n Lib.raiseToTop(this.parentNode);\n\n // Get band element\n d3.select(this.parentNode)\n .selectAll('rect.bandrect')\n /** @param {CategoryBandViewModel} bandViewModel */\n .each(function(bandViewModel) {\n if(bandViewModel.y < catMouseY && catMouseY <= bandViewModel.y + bandViewModel.height) {\n d.potentialClickBand = this;\n }\n });\n }\n });\n\n // Update toplevel drag dimension\n d.parcatsViewModel.dragDimension = d;\n\n // Remove hover label if any\n Fx.loneUnhover(d.parcatsViewModel.graphDiv._fullLayout._hoverlayer.node());\n}\n\n/**\n * Handle dimension drag\n * @param {DimensionViewModel} d\n */\nfunction dragDimension(d) {\n // Check if dragging is supported\n if(d.parcatsViewModel.arrangement === 'fixed') {\n return;\n }\n\n d.dragHasMoved = true;\n\n if(d.dragDimensionDisplayInd === null) {\n return;\n }\n\n var dragDimInd = d.dragDimensionDisplayInd;\n var prevDimInd = dragDimInd - 1;\n var nextDimInd = dragDimInd + 1;\n\n var dragDimension = d.parcatsViewModel\n .dimensions[dragDimInd];\n\n // Update category\n if(d.dragCategoryDisplayInd !== null) {\n var dragCategory = dragDimension.categories[d.dragCategoryDisplayInd];\n\n // Update dragY by dy\n dragCategory.model.dragY += d3.event.dy;\n var categoryY = dragCategory.model.dragY;\n\n // Check for category drag swaps\n var catDisplayInd = dragCategory.model.displayInd;\n var dimCategoryViews = dragDimension.categories;\n\n var catAbove = dimCategoryViews[catDisplayInd - 1];\n var catBelow = dimCategoryViews[catDisplayInd + 1];\n\n // Check for overlap above\n if(catAbove !== undefined) {\n if(categoryY < (catAbove.y + catAbove.height / 2.0)) {\n // Swap display inds\n dragCategory.model.displayInd = catAbove.model.displayInd;\n catAbove.model.displayInd = catDisplayInd;\n }\n }\n\n if(catBelow !== undefined) {\n if((categoryY + dragCategory.height) > (catBelow.y + catBelow.height / 2.0)) {\n // Swap display inds\n dragCategory.model.displayInd = catBelow.model.displayInd;\n catBelow.model.displayInd = catDisplayInd;\n }\n }\n\n // Update category drag display index\n d.dragCategoryDisplayInd = dragCategory.model.displayInd;\n }\n\n // Update dimension position\n if(d.dragCategoryDisplayInd === null || d.parcatsViewModel.arrangement === 'freeform') {\n dragDimension.model.dragX = d3.event.x;\n\n // Check for dimension swaps\n var prevDimension = d.parcatsViewModel.dimensions[prevDimInd];\n var nextDimension = d.parcatsViewModel.dimensions[nextDimInd];\n\n if(prevDimension !== undefined) {\n if(dragDimension.model.dragX < (prevDimension.x + prevDimension.width)) {\n // Swap display inds\n dragDimension.model.displayInd = prevDimension.model.displayInd;\n prevDimension.model.displayInd = dragDimInd;\n }\n }\n\n if(nextDimension !== undefined) {\n if((dragDimension.model.dragX + dragDimension.width) > nextDimension.x) {\n // Swap display inds\n dragDimension.model.displayInd = nextDimension.model.displayInd;\n nextDimension.model.displayInd = d.dragDimensionDisplayInd;\n }\n }\n\n // Update drag display index\n d.dragDimensionDisplayInd = dragDimension.model.displayInd;\n }\n\n // Update view models\n updateDimensionViewModels(d.parcatsViewModel);\n updatePathViewModels(d.parcatsViewModel);\n\n // Update svg geometry\n updateSvgCategories(d.parcatsViewModel);\n updateSvgPaths(d.parcatsViewModel);\n}\n\n\n/**\n * Handle dimension drag end\n * @param {DimensionViewModel} d\n */\nfunction dragDimensionEnd(d) {\n // Check if dragging is supported\n if(d.parcatsViewModel.arrangement === 'fixed') {\n return;\n }\n\n if(d.dragDimensionDisplayInd === null) {\n return;\n }\n\n d3.select(this).selectAll('text').attr('font-weight', 'normal');\n\n // Compute restyle command\n // -----------------------\n var restyleData = {};\n var traceInd = getTraceIndex(d.parcatsViewModel);\n\n // ### Handle dimension reordering ###\n var finalDragDimensionDisplayInds = d.parcatsViewModel.model.dimensions.map(function(d) {return d.displayInd;});\n var anyDimsReordered = d.initialDragDimensionDisplayInds.some(function(initDimDisplay, dimInd) {\n return initDimDisplay !== finalDragDimensionDisplayInds[dimInd];\n });\n\n if(anyDimsReordered) {\n finalDragDimensionDisplayInds.forEach(function(finalDimDisplay, dimInd) {\n var containerInd = d.parcatsViewModel.model.dimensions[dimInd].containerInd;\n restyleData['dimensions[' + containerInd + '].displayindex'] = finalDimDisplay;\n });\n }\n\n // ### Handle category reordering ###\n var anyCatsReordered = false;\n if(d.dragCategoryDisplayInd !== null) {\n var finalDragCategoryDisplayInds = d.model.categories.map(function(c) {\n return c.displayInd;\n });\n\n anyCatsReordered = d.initialDragCategoryDisplayInds.some(function(initCatDisplay, catInd) {\n return initCatDisplay !== finalDragCategoryDisplayInds[catInd];\n });\n\n if(anyCatsReordered) {\n // Sort a shallow copy of the category models by display index\n var sortedCategoryModels = d.model.categories.slice().sort(\n function(a, b) { return a.displayInd - b.displayInd; });\n\n // Get new categoryarray and ticktext values\n var newCategoryArray = sortedCategoryModels.map(function(v) { return v.categoryValue; });\n var newCategoryLabels = sortedCategoryModels.map(function(v) { return v.categoryLabel; });\n\n restyleData['dimensions[' + d.model.containerInd + '].categoryarray'] = [newCategoryArray];\n restyleData['dimensions[' + d.model.containerInd + '].ticktext'] = [newCategoryLabels];\n restyleData['dimensions[' + d.model.containerInd + '].categoryorder'] = 'array';\n }\n }\n\n // Handle potential click event\n // ----------------------------\n if(d.parcatsViewModel.hoverinfoItems.indexOf('skip') === -1) {\n if(!d.dragHasMoved && d.potentialClickBand) {\n if(d.parcatsViewModel.hoveron === 'color') {\n emitPointsEventColorHovermode(d.potentialClickBand, 'plotly_click', d3.event.sourceEvent);\n } else {\n emitPointsEventCategoryHovermode(d.potentialClickBand, 'plotly_click', d3.event.sourceEvent);\n }\n }\n }\n\n // Nullify drag states\n // -------------------\n d.model.dragX = null;\n if(d.dragCategoryDisplayInd !== null) {\n var dragCategory = d.parcatsViewModel\n .dimensions[d.dragDimensionDisplayInd]\n .categories[d.dragCategoryDisplayInd];\n\n dragCategory.model.dragY = null;\n d.dragCategoryDisplayInd = null;\n }\n\n d.dragDimensionDisplayInd = null;\n d.parcatsViewModel.dragDimension = null;\n d.dragHasMoved = null;\n d.potentialClickBand = null;\n\n // Update view models\n // ------------------\n updateDimensionViewModels(d.parcatsViewModel);\n updatePathViewModels(d.parcatsViewModel);\n\n // Perform transition\n // ------------------\n var transition = d3.transition()\n .duration(300)\n .ease('cubic-in-out');\n\n transition\n .each(function() {\n updateSvgCategories(d.parcatsViewModel, true);\n updateSvgPaths(d.parcatsViewModel, true);\n })\n .each('end', function() {\n if(anyDimsReordered || anyCatsReordered) {\n // Perform restyle if the order of categories or dimensions changed\n Plotly.restyle(d.parcatsViewModel.graphDiv, restyleData, [traceInd]);\n }\n });\n}\n\n/**\n *\n * @param {ParcatsViewModel} parcatsViewModel\n */\nfunction getTraceIndex(parcatsViewModel) {\n var traceInd;\n var allTraces = parcatsViewModel.graphDiv._fullData;\n for(var i = 0; i < allTraces.length; i++) {\n if(parcatsViewModel.key === allTraces[i].uid) {\n traceInd = i;\n break;\n }\n }\n return traceInd;\n}\n\n/** Update the svg paths for view model\n * @param {ParcatsViewModel} parcatsViewModel\n * @param {boolean} hasTransition Whether to update element with transition\n */\nfunction updateSvgPaths(parcatsViewModel, hasTransition) {\n if(hasTransition === undefined) {\n hasTransition = false;\n }\n\n function transition(selection) {\n return hasTransition ? selection.transition() : selection;\n }\n\n // Update binding\n parcatsViewModel.pathSelection.data(function(d) {\n return d.paths;\n }, key);\n\n // Update paths\n transition(parcatsViewModel.pathSelection).attr('d', function(d) {\n return d.svgD;\n });\n}\n\n/** Update the svg paths for view model\n * @param {ParcatsViewModel} parcatsViewModel\n * @param {boolean} hasTransition Whether to update element with transition\n */\nfunction updateSvgCategories(parcatsViewModel, hasTransition) {\n if(hasTransition === undefined) {\n hasTransition = false;\n }\n\n function transition(selection) {\n return hasTransition ? selection.transition() : selection;\n }\n\n // Update binding\n parcatsViewModel.dimensionSelection\n .data(function(d) {\n return d.dimensions;\n }, key);\n\n var categorySelection = parcatsViewModel.dimensionSelection\n .selectAll('g.category')\n .data(function(d) {return d.categories;}, key);\n\n // Update dimension position\n transition(parcatsViewModel.dimensionSelection)\n .attr('transform', function(d) {\n return 'translate(' + d.x + ', 0)';\n });\n\n // Update category position\n transition(categorySelection)\n .attr('transform', function(d) {\n return 'translate(0, ' + d.y + ')';\n });\n\n var dimLabelSelection = categorySelection.select('.dimlabel');\n\n // ### Update dimension label\n // Only the top-most display category should have the dimension label\n dimLabelSelection\n .text(function(d, i) {\n if(i === 0) {\n // Add dimension label above topmost category\n return d.parcatsViewModel.model.dimensions[d.model.dimensionInd].dimensionLabel;\n } else {\n return null;\n }\n });\n\n // Update category label\n // Categories in the right-most display dimension have their labels on\n // the right, all others on the left\n var catLabelSelection = categorySelection.select('.catlabel');\n catLabelSelection\n .attr('text-anchor',\n function(d) {\n if(catInRightDim(d)) {\n // Place label to the right of category\n return 'start';\n } else {\n // Place label to the left of category\n return 'end';\n }\n })\n .attr('x',\n function(d) {\n if(catInRightDim(d)) {\n // Place label to the right of category\n return d.width + 5;\n } else {\n // Place label to the left of category\n return -5;\n }\n })\n .each(function(d) {\n // Update attriubutes of elements\n var newX;\n var newAnchor;\n if(catInRightDim(d)) {\n // Place label to the right of category\n newX = d.width + 5;\n newAnchor = 'start';\n } else {\n // Place label to the left of category\n newX = -5;\n newAnchor = 'end';\n }\n d3.select(this)\n .selectAll('tspan')\n .attr('x', newX)\n .attr('text-anchor', newAnchor);\n });\n\n // Update bands\n // Initialize color band rects\n var bandSelection = categorySelection\n .selectAll('rect.bandrect')\n .data(\n /** @param {CategoryViewModel} catViewModel*/\n function(catViewModel) {\n return catViewModel.bands;\n }, key);\n\n var bandsSelectionEnter = bandSelection.enter()\n .append('rect')\n .attr('class', 'bandrect')\n .attr('cursor', 'move')\n .attr('stroke-opacity', 0)\n .attr('fill', function(d) {\n return d.color;\n })\n .attr('fill-opacity', 0);\n\n bandSelection\n .attr('fill', function(d) {\n return d.color;\n })\n .attr('width', function(d) {\n return d.width;\n })\n .attr('height', function(d) {\n return d.height;\n })\n .attr('y', function(d) {\n return d.y;\n });\n\n styleBandsNoHover(bandsSelectionEnter);\n\n // Raise bands to the top\n bandSelection.each(function() {Lib.raiseToTop(this);});\n\n // Remove unused bands\n bandSelection.exit().remove();\n}\n\n/**\n * Create a ParcatsViewModel traces\n * @param {Object} graphDiv\n * Top-level graph div element\n * @param {Layout} layout\n * SVG layout object\n * @param {Array.} wrappedParcatsModel\n * Wrapped ParcatsModel for this trace\n * @return {ParcatsViewModel}\n */\nfunction createParcatsViewModel(graphDiv, layout, wrappedParcatsModel) {\n // Unwrap model\n var parcatsModel = wrappedParcatsModel[0];\n\n // Compute margin\n var margin = layout.margin || {l: 80, r: 80, t: 100, b: 80};\n\n // Compute pixel position/extents\n var trace = parcatsModel.trace;\n var domain = trace.domain;\n var figureWidth = layout.width;\n var figureHeight = layout.height;\n var traceWidth = Math.floor(figureWidth * (domain.x[1] - domain.x[0]));\n var traceHeight = Math.floor(figureHeight * (domain.y[1] - domain.y[0]));\n var traceX = domain.x[0] * figureWidth + margin.l;\n var traceY = layout.height - domain.y[1] * layout.height + margin.t;\n\n // Handle path shape\n // -----------------\n var pathShape = trace.line.shape;\n\n // Handle hover info\n // -----------------\n var hoverinfoItems;\n if(trace.hoverinfo === 'all') {\n hoverinfoItems = ['count', 'probability'];\n } else {\n hoverinfoItems = (trace.hoverinfo || '').split('+');\n }\n\n // Construct parcatsViewModel\n // --------------------------\n var parcatsViewModel = {\n trace: trace,\n key: trace.uid,\n model: parcatsModel,\n x: traceX,\n y: traceY,\n width: traceWidth,\n height: traceHeight,\n hoveron: trace.hoveron,\n hoverinfoItems: hoverinfoItems,\n arrangement: trace.arrangement,\n bundlecolors: trace.bundlecolors,\n sortpaths: trace.sortpaths,\n labelfont: trace.labelfont,\n categorylabelfont: trace.tickfont,\n pathShape: pathShape,\n dragDimension: null,\n margin: margin,\n paths: [],\n dimensions: [],\n graphDiv: graphDiv,\n traceSelection: null,\n pathSelection: null,\n dimensionSelection: null\n };\n\n // Update dimension view models if we have at least 1 dimension\n if(parcatsModel.dimensions) {\n updateDimensionViewModels(parcatsViewModel);\n\n // Update path view models if we have at least 2 dimensions\n updatePathViewModels(parcatsViewModel);\n }\n // Inside a categories view model\n return parcatsViewModel;\n}\n\n/**\n * Build the SVG string to represents a parallel categories path\n * @param {Array.} leftXPositions\n * Array of the x positions of the left edge of each dimension (in display order)\n * @param {Array.} pathYs\n * Array of the y positions of the top of the path at each dimension (in display order)\n * @param {Array.} dimWidths\n * Array of the widths of each dimension in display order\n * @param {Number} pathHeight\n * The height of the path in pixels\n * @param {Number} curvature\n * The curvature factor for the path. 0 results in a straight line and values greater than zero result in curved paths\n * @return {string}\n */\nfunction buildSvgPath(leftXPositions, pathYs, dimWidths, pathHeight, curvature) {\n // Compute the x midpoint of each path segment\n var xRefPoints1 = [];\n var xRefPoints2 = [];\n var refInterpolator;\n var d;\n\n for(d = 0; d < dimWidths.length - 1; d++) {\n refInterpolator = d3.interpolateNumber(dimWidths[d] + leftXPositions[d], leftXPositions[d + 1]);\n xRefPoints1.push(refInterpolator(curvature));\n xRefPoints2.push(refInterpolator(1 - curvature));\n }\n\n // Move to top of path on left edge of left-most category\n var svgD = 'M ' + leftXPositions[0] + ',' + pathYs[0];\n\n // Horizontal line to right edge\n svgD += 'l' + dimWidths[0] + ',0 ';\n\n // Horizontal line to right edge\n for(d = 1; d < dimWidths.length; d++) {\n // Curve to left edge of category\n svgD += 'C' + xRefPoints1[d - 1] + ',' + pathYs[d - 1] +\n ' ' + xRefPoints2[d - 1] + ',' + pathYs[d] +\n ' ' + leftXPositions[d] + ',' + pathYs[d];\n\n // svgD += 'L' + leftXPositions[d] + ',' + pathYs[d];\n\n // Horizontal line to right edge\n svgD += 'l' + dimWidths[d] + ',0 ';\n }\n\n // Line down\n svgD += 'l' + '0,' + pathHeight + ' ';\n\n // Line to left edge of right-most category\n svgD += 'l -' + dimWidths[dimWidths.length - 1] + ',0 ';\n\n for(d = dimWidths.length - 2; d >= 0; d--) {\n // Curve to right edge of category\n svgD += 'C' + xRefPoints2[d] + ',' + (pathYs[d + 1] + pathHeight) +\n ' ' + xRefPoints1[d] + ',' + (pathYs[d] + pathHeight) +\n ' ' + (leftXPositions[d] + dimWidths[d]) + ',' + (pathYs[d] + pathHeight);\n\n // svgD += 'L' + (leftXPositions[d] + dimWidths[d]) + ',' + (pathYs[d] + pathHeight);\n\n // Horizontal line to right edge\n svgD += 'l-' + dimWidths[d] + ',0 ';\n }\n\n // Close path\n svgD += 'Z';\n return svgD;\n}\n\n/**\n * Update the path view models based on the dimension view models in a ParcatsViewModel\n *\n * @param {ParcatsViewModel} parcatsViewModel\n * View model for trace\n */\nfunction updatePathViewModels(parcatsViewModel) {\n // Initialize an array of the y position of the top of the next path to be added to each category.\n //\n // nextYPositions[d][c] is the y position of the next path through category with index c of dimension with index d\n var dimensionViewModels = parcatsViewModel.dimensions;\n var parcatsModel = parcatsViewModel.model;\n var nextYPositions = dimensionViewModels.map(\n function(d) {\n return d.categories.map(\n function(c) {\n return c.y;\n });\n });\n\n // Array from category index to category display index for each true dimension index\n var catToDisplayIndPerDim = parcatsViewModel.model.dimensions.map(\n function(d) {\n return d.categories.map(function(c) {return c.displayInd;});\n });\n\n // Array from true dimension index to dimension display index\n var dimToDisplayInd = parcatsViewModel.model.dimensions.map(function(d) {return d.displayInd;});\n var displayToDimInd = parcatsViewModel.dimensions.map(function(d) {return d.model.dimensionInd;});\n\n // Array of the x position of the left edge of the rectangles for each dimension\n var leftXPositions = dimensionViewModels.map(\n function(d) {\n return d.x;\n });\n\n // Compute dimension widths\n var dimWidths = dimensionViewModels.map(function(d) {return d.width;});\n\n // Build sorted Array of PathModel objects\n var pathModels = [];\n for(var p in parcatsModel.paths) {\n if(parcatsModel.paths.hasOwnProperty(p)) {\n pathModels.push(parcatsModel.paths[p]);\n }\n }\n\n // Compute category display inds to use for sorting paths\n function pathDisplayCategoryInds(pathModel) {\n var dimensionInds = pathModel.categoryInds.map(function(catInd, dimInd) {return catToDisplayIndPerDim[dimInd][catInd];});\n var displayInds = displayToDimInd.map(function(dimInd) {\n return dimensionInds[dimInd];\n });\n return displayInds;\n }\n\n // Sort in ascending order by display index array\n pathModels.sort(function(v1, v2) {\n // Build display inds for each path\n var sortArray1 = pathDisplayCategoryInds(v1);\n var sortArray2 = pathDisplayCategoryInds(v2);\n\n // Handle path sort order\n if(parcatsViewModel.sortpaths === 'backward') {\n sortArray1.reverse();\n sortArray2.reverse();\n }\n\n // Append the first value index of the path to break ties\n sortArray1.push(v1.valueInds[0]);\n sortArray2.push(v2.valueInds[0]);\n\n // Handle color bundling\n if(parcatsViewModel.bundlecolors) {\n // Prepend sort array with the raw color value\n sortArray1.unshift(v1.rawColor);\n sortArray2.unshift(v2.rawColor);\n }\n\n // colors equal, sort by display categories\n if(sortArray1 < sortArray2) {\n return -1;\n }\n if(sortArray1 > sortArray2) {\n return 1;\n }\n\n return 0;\n });\n\n // Create path models\n var pathViewModels = new Array(pathModels.length);\n var totalCount = dimensionViewModels[0].model.count;\n var totalHeight = dimensionViewModels[0].categories\n .map(function(c) { return c.height; })\n .reduce(function(v1, v2) { return v1 + v2; });\n\n\n for(var pathNumber = 0; pathNumber < pathModels.length; pathNumber++) {\n var pathModel = pathModels[pathNumber];\n\n var pathHeight;\n if(totalCount > 0) {\n pathHeight = totalHeight * (pathModel.count / totalCount);\n } else {\n pathHeight = 0;\n }\n\n // Build path y coords\n var pathYs = new Array(nextYPositions.length);\n for(var d = 0; d < pathModel.categoryInds.length; d++) {\n var catInd = pathModel.categoryInds[d];\n var catDisplayInd = catToDisplayIndPerDim[d][catInd];\n var dimDisplayInd = dimToDisplayInd[d];\n\n // Update next y position\n pathYs[dimDisplayInd] = nextYPositions[dimDisplayInd][catDisplayInd];\n nextYPositions[dimDisplayInd][catDisplayInd] += pathHeight;\n\n // Update category color information\n var catViewModle = parcatsViewModel.dimensions[dimDisplayInd].categories[catDisplayInd];\n var numBands = catViewModle.bands.length;\n var lastCatBand = catViewModle.bands[numBands - 1];\n\n if(lastCatBand === undefined || pathModel.rawColor !== lastCatBand.rawColor) {\n // Create a new band\n var bandY = lastCatBand === undefined ? 0 : lastCatBand.y + lastCatBand.height;\n catViewModle.bands.push({\n key: bandY,\n color: pathModel.color,\n rawColor: pathModel.rawColor,\n height: pathHeight,\n width: catViewModle.width,\n count: pathModel.count,\n y: bandY,\n categoryViewModel: catViewModle,\n parcatsViewModel: parcatsViewModel\n });\n } else {\n // Extend current band\n var currentBand = catViewModle.bands[numBands - 1];\n currentBand.height += pathHeight;\n currentBand.count += pathModel.count;\n }\n }\n\n // build svg path\n var svgD;\n if(parcatsViewModel.pathShape === 'hspline') {\n svgD = buildSvgPath(leftXPositions, pathYs, dimWidths, pathHeight, 0.5);\n } else {\n svgD = buildSvgPath(leftXPositions, pathYs, dimWidths, pathHeight, 0);\n }\n\n pathViewModels[pathNumber] = {\n key: pathModel.valueInds[0],\n model: pathModel,\n height: pathHeight,\n leftXs: leftXPositions,\n topYs: pathYs,\n dimWidths: dimWidths,\n svgD: svgD,\n parcatsViewModel: parcatsViewModel\n };\n }\n\n parcatsViewModel.paths = pathViewModels;\n\n // * @property key\n // * Unique key for this model\n // * @property {PathModel} model\n // * Source path model\n // * @property {Number} height\n // * Height of this path (pixels)\n // * @property {String} svgD\n // * SVG path \"d\" attribute string\n}\n\n/**\n * Update the dimension view models based on the dimension models in a ParcatsViewModel\n *\n * @param {ParcatsViewModel} parcatsViewModel\n * View model for trace\n */\nfunction updateDimensionViewModels(parcatsViewModel) {\n // Compute dimension ordering\n var dimensionsIndInfo = parcatsViewModel.model.dimensions.map(function(d) {\n return {displayInd: d.displayInd, dimensionInd: d.dimensionInd};\n });\n\n dimensionsIndInfo.sort(function(a, b) {\n return a.displayInd - b.displayInd;\n });\n\n var dimensions = [];\n for(var displayInd in dimensionsIndInfo) {\n var dimensionInd = dimensionsIndInfo[displayInd].dimensionInd;\n var dimModel = parcatsViewModel.model.dimensions[dimensionInd];\n dimensions.push(createDimensionViewModel(parcatsViewModel, dimModel));\n }\n\n parcatsViewModel.dimensions = dimensions;\n}\n\n/**\n * Create a parcats DimensionViewModel\n *\n * @param {ParcatsViewModel} parcatsViewModel\n * View model for trace\n * @param {DimensionModel} dimensionModel\n * @return {DimensionViewModel}\n */\nfunction createDimensionViewModel(parcatsViewModel, dimensionModel) {\n // Compute dimension x position\n var categoryLabelPad = 40;\n var dimWidth = 16;\n var numDimensions = parcatsViewModel.model.dimensions.length;\n var displayInd = dimensionModel.displayInd;\n\n // Compute x coordinate values\n var dimDx;\n var dimX0;\n var dimX;\n\n if(numDimensions > 1) {\n dimDx = (parcatsViewModel.width - 2 * categoryLabelPad - dimWidth) / (numDimensions - 1);\n } else {\n dimDx = 0;\n }\n dimX0 = categoryLabelPad;\n dimX = dimX0 + dimDx * displayInd;\n\n // Compute categories\n var categories = [];\n var maxCats = parcatsViewModel.model.maxCats;\n var numCats = dimensionModel.categories.length;\n var catSpacing = 8;\n var totalCount = dimensionModel.count;\n var totalHeight = parcatsViewModel.height - catSpacing * (maxCats - 1);\n var nextCatHeight;\n var nextCatModel;\n var nextCat;\n var catInd;\n var catDisplayInd;\n\n // Compute starting Y offset\n var nextCatY = (maxCats - numCats) * catSpacing / 2.0;\n\n // Compute category ordering\n var categoryIndInfo = dimensionModel.categories.map(function(c) {\n return {displayInd: c.displayInd, categoryInd: c.categoryInd};\n });\n\n categoryIndInfo.sort(function(a, b) {\n return a.displayInd - b.displayInd;\n });\n\n for(catDisplayInd = 0; catDisplayInd < numCats; catDisplayInd++) {\n catInd = categoryIndInfo[catDisplayInd].categoryInd;\n nextCatModel = dimensionModel.categories[catInd];\n\n if(totalCount > 0) {\n nextCatHeight = (nextCatModel.count / totalCount) * totalHeight;\n } else {\n nextCatHeight = 0;\n }\n\n nextCat = {\n key: nextCatModel.valueInds[0],\n model: nextCatModel,\n width: dimWidth,\n height: nextCatHeight,\n y: nextCatModel.dragY !== null ? nextCatModel.dragY : nextCatY,\n bands: [],\n parcatsViewModel: parcatsViewModel\n };\n\n nextCatY = nextCatY + nextCatHeight + catSpacing;\n categories.push(nextCat);\n }\n\n return {\n key: dimensionModel.dimensionInd,\n x: dimensionModel.dragX !== null ? dimensionModel.dragX : dimX,\n y: 0,\n width: dimWidth,\n model: dimensionModel,\n categories: categories,\n parcatsViewModel: parcatsViewModel,\n dragCategoryDisplayInd: null,\n dragDimensionDisplayInd: null,\n initialDragDimensionDisplayInds: null,\n initialDragCategoryDisplayInds: null,\n dragHasMoved: null,\n potentialClickBand: null\n };\n}\n\n// JSDoc typedefs\n// ==============\n/**\n * @typedef {Object} Layout\n * Object containing svg layout information\n *\n * @property {Number} width (pixels)\n * Usable width for Figure (after margins are removed)\n * @property {Number} height (pixels)\n * Usable height for Figure (after margins are removed)\n * @property {Margin} margin\n * Margin around the Figure (pixels)\n */\n\n/**\n * @typedef {Object} Margin\n * Object containing padding information in pixels\n *\n * @property {Number} t\n * Top margin\n * @property {Number} r\n * Right margin\n * @property {Number} b\n * Bottom margin\n * @property {Number} l\n * Left margin\n */\n\n/**\n * @typedef {Object} Font\n * Object containing font information\n *\n * @property {Number} size: Font size\n * @property {String} color: Font color\n * @property {String} family: Font family\n */\n\n/**\n * @typedef {Object} ParcatsViewModel\n * Object containing calculated parcats view information\n *\n * These are quantities that require Layout information to calculate\n * @property key\n * Unique key for this model\n * @property {ParcatsModel} model\n * Source parcats model\n * @property {Array.} dimensions\n * Array of dimension view models\n * @property {Number} width\n * Width for this trace (pixels)\n * @property {Number} height\n * Height for this trace (pixels)\n * @property {Number} x\n * X position of this trace with respect to the Figure (pixels)\n * @property {Number} y\n * Y position of this trace with respect to the Figure (pixels)\n * @property {String} hoveron\n * Hover interaction mode. One of: 'category', 'color', or 'dimension'\n * @property {Array.} hoverinfoItems\n * Info to display on hover. Array with a combination of 'counts' and/or 'probabilities', or 'none', or 'skip'\n * @property {String} arrangement\n * Category arrangement. One of: 'perpendicular', 'freeform', or 'fixed'\n * @property {Boolean} bundlecolors\n * Whether paths should be sorted so that like colors are bundled together as they pass through categories\n * @property {String} sortpaths\n * If 'forward' then sort paths based on dimensions from left to right. If 'backward' sort based on dimensions\n * from right to left\n * @property {Font} labelfont\n * Font for the dimension labels\n * @property {Font} categorylabelfont\n * Font for the category labels\n * @property {String} pathShape\n * The shape of the paths. Either 'linear' or 'hspline'.\n * @property {DimensionViewModel|null} dragDimension\n * Dimension currently being dragged. Null if no drag in progress\n * @property {Margin} margin\n * Margin around the Figure\n * @property {Object} graphDiv\n * Top-level graph div element\n * @property {Object} traceSelection\n * D3 selection of this view models trace group element\n * @property {Object} pathSelection\n * D3 selection of this view models path elements\n * @property {Object} dimensionSelection\n * D3 selection of this view models dimension group element\n */\n\n/**\n * @typedef {Object} DimensionViewModel\n * Object containing calculated parcats dimension view information\n *\n * These are quantities that require Layout information to calculate\n * @property key\n * Unique key for this model\n * @property {DimensionModel} model\n * Source dimension model\n * @property {Number} x\n * X position of the center of this dimension with respect to the Figure (pixels)\n * @property {Number} y\n * Y position of the top of this dimension with respect to the Figure (pixels)\n * @property {Number} width\n * Width of categories in this dimension (pixels)\n * @property {ParcatsViewModel} parcatsViewModel\n * The parent trace's view model\n * @property {Array.} categories\n * Dimensions category view models\n * @property {Number|null} dragCategoryDisplayInd\n * Display index of category currently being dragged. null if no category is being dragged\n * @property {Number|null} dragDimensionDisplayInd\n * Display index of the dimension being dragged. null if no dimension is being dragged\n * @property {Array.|null} initialDragDimensionDisplayInds\n * Dimensions display indexes at the beginning of the current drag. null if no dimension is being dragged\n * @property {Array.|null} initialDragCategoryDisplayInds\n * Category display indexes for the at the beginning of the current drag. null if no category is being dragged\n * @property {HTMLElement} potentialClickBand\n * Band under mouse when current drag began. If no drag movement takes place then a click will be emitted for this\n * band. Null if not drag in progress.\n * @property {Boolean} dragHasMoved\n * True if there is an active drag and the drag has moved. If drag doesn't move before being ended then\n * this may be interpreted as a click. Null if no drag in progress\n */\n\n/**\n * @typedef {Object} CategoryViewModel\n * Object containing calculated parcats category view information\n *\n * These are quantities that require Layout information to calculate\n * @property key\n * Unique key for this model\n * @property {CategoryModel} model\n * Source category model\n * @property {Number} width\n * Width for this category (pixels)\n * @property {Number} height\n * Height for this category (pixels)\n * @property {Number} y\n * Y position of this cateogry with respect to the Figure (pixels)\n * @property {Array.} bands\n * Array of color bands inside the category\n * @property {ParcatsViewModel} parcatsViewModel\n * The parent trace's view model\n */\n\n/**\n * @typedef {Object} CategoryBandViewModel\n * Object containing calculated category band information. A category band is a region inside a category covering\n * paths of a single color\n *\n * @property key\n * Unique key for this model\n * @property color\n * Band color\n * @property rawColor\n * Raw color value for band\n * @property {Number} width\n * Band width\n * @property {Number} height\n * Band height\n * @property {Number} y\n * Y position of top of the band with respect to the category\n * @property {Number} count\n * The number of samples represented by the band\n * @property {CategoryViewModel} categoryViewModel\n * The parent categorie's view model\n * @property {ParcatsViewModel} parcatsViewModel\n * The parent trace's view model\n */\n\n/**\n * @typedef {Object} PathViewModel\n * Object containing calculated parcats path view information\n *\n * These are quantities that require Layout information to calculate\n * @property key\n * Unique key for this model\n * @property {PathModel} model\n * Source path model\n * @property {Number} height\n * Height of this path (pixels)\n * @property {Array.} leftXs\n * The x position of the left edge of each display dimension\n * @property {Array.} topYs\n * The y position of the top of the path for each display dimension\n * @property {Array.} dimWidths\n * The width of each display dimension\n * @property {String} svgD\n * SVG path \"d\" attribute string\n * @property {ParcatsViewModel} parcatsViewModel\n * The parent trace's view model\n */\n\n},{\"../../components/drawing\":617,\"../../components/fx\":635,\"../../lib\":728,\"../../lib/svg_text_utils\":752,\"../../plot_api/plot_api\":763,\"d3\":164,\"tinycolor2\":528}],1095:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n\nvar parcats = _dereq_('./parcats');\n\n/**\n * Create / update parcat traces\n *\n * @param {Object} graphDiv\n * @param {Array.} parcatsModels\n */\nmodule.exports = function plot(graphDiv, parcatsModels, transitionOpts, makeOnCompleteCallback) {\n var fullLayout = graphDiv._fullLayout;\n var svg = fullLayout._paper;\n var size = fullLayout._size;\n\n parcats(\n graphDiv,\n svg,\n parcatsModels,\n {\n width: size.w,\n height: size.h,\n margin: {\n t: size.t,\n r: size.r,\n b: size.b,\n l: size.l\n }\n },\n transitionOpts,\n makeOnCompleteCallback\n );\n};\n\n},{\"./parcats\":1094}],1096:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\nvar axesAttrs = _dereq_('../../plots/cartesian/layout_attributes');\nvar fontAttrs = _dereq_('../../plots/font_attributes');\nvar domainAttrs = _dereq_('../../plots/domain').attributes;\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\nvar templatedArray = _dereq_('../../plot_api/plot_template').templatedArray;\n\nmodule.exports = {\n domain: domainAttrs({name: 'parcoords', trace: true, editType: 'plot'}),\n\n labelangle: {\n valType: 'angle',\n dflt: 0,\n \n editType: 'plot',\n \n },\n\n labelside: {\n valType: 'enumerated',\n \n values: ['top', 'bottom'],\n dflt: 'top',\n editType: 'plot',\n \n },\n\n labelfont: fontAttrs({\n editType: 'plot',\n \n }),\n tickfont: fontAttrs({\n editType: 'plot',\n \n }),\n rangefont: fontAttrs({\n editType: 'plot',\n \n }),\n\n dimensions: templatedArray('dimension', {\n label: {\n valType: 'string',\n \n editType: 'plot',\n \n },\n // TODO: better way to determine ordinal vs continuous axes,\n // so users can use tickvals/ticktext with a continuous axis.\n tickvals: extendFlat({}, axesAttrs.tickvals, {\n editType: 'plot',\n \n }),\n ticktext: extendFlat({}, axesAttrs.ticktext, {\n editType: 'plot',\n \n }),\n tickformat: extendFlat({}, axesAttrs.tickformat, {\n editType: 'plot'\n }),\n visible: {\n valType: 'boolean',\n dflt: true,\n \n editType: 'plot',\n \n },\n range: {\n valType: 'info_array',\n \n items: [\n {valType: 'number', editType: 'plot'},\n {valType: 'number', editType: 'plot'}\n ],\n editType: 'plot',\n \n },\n constraintrange: {\n valType: 'info_array',\n \n freeLength: true,\n dimensions: '1-2',\n items: [\n {valType: 'number', editType: 'plot'},\n {valType: 'number', editType: 'plot'}\n ],\n editType: 'plot',\n \n },\n multiselect: {\n valType: 'boolean',\n dflt: true,\n \n editType: 'plot',\n \n },\n values: {\n valType: 'data_array',\n \n editType: 'calc',\n \n },\n editType: 'calc',\n \n }),\n\n line: extendFlat({editType: 'calc'},\n colorScaleAttrs('line', {\n // the default autocolorscale isn't quite usable for parcoords due to context ambiguity around 0 (grey, off-white)\n // autocolorscale therefore defaults to false too, to avoid being overridden by the blue-white-red autocolor palette\n colorscaleDflt: 'Viridis',\n autoColorDflt: false,\n editTypeOverride: 'calc'\n })\n )\n};\n\n},{\"../../components/colorscale/attributes\":602,\"../../lib/extend\":719,\"../../plot_api/plot_template\":766,\"../../plots/cartesian/layout_attributes\":790,\"../../plots/domain\":803,\"../../plots/font_attributes\":804}],1097:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar c = _dereq_('./constants');\nvar d3 = _dereq_('d3');\nvar keyFun = _dereq_('../../lib/gup').keyFun;\nvar repeat = _dereq_('../../lib/gup').repeat;\nvar sortAsc = _dereq_('../../lib').sorterAsc;\n\nvar snapRatio = c.bar.snapRatio;\nfunction snapOvershoot(v, vAdjacent) { return v * (1 - snapRatio) + vAdjacent * snapRatio; }\n\nvar snapClose = c.bar.snapClose;\nfunction closeToCovering(v, vAdjacent) { return v * (1 - snapClose) + vAdjacent * snapClose; }\n\n// snap for the low end of a range on an ordinal scale\n// on an ordinal scale, always show some overshoot from the exact value,\n// so it's clear we're covering it\n// find the interval we're in, and snap to 1/4 the distance to the next\n// these two could be unified at a slight loss of readability / perf\nfunction ordinalScaleSnap(isHigh, a, v, existingRanges) {\n if(overlappingExisting(v, existingRanges)) return v;\n\n var dir = isHigh ? -1 : 1;\n\n var first = 0;\n var last = a.length - 1;\n if(dir < 0) {\n var tmp = first;\n first = last;\n last = tmp;\n }\n\n var aHere = a[first];\n var aPrev = aHere;\n for(var i = first; dir * i < dir * last; i += dir) {\n var nextI = i + dir;\n var aNext = a[nextI];\n\n // very close to the previous - snap down to it\n if(dir * v < dir * closeToCovering(aHere, aNext)) return snapOvershoot(aHere, aPrev);\n if(dir * v < dir * aNext || nextI === last) return snapOvershoot(aNext, aHere);\n\n aPrev = aHere;\n aHere = aNext;\n }\n}\n\nfunction overlappingExisting(v, existingRanges) {\n for(var i = 0; i < existingRanges.length; i++) {\n if(v >= existingRanges[i][0] && v <= existingRanges[i][1]) return true;\n }\n return false;\n}\n\nfunction barHorizontalSetup(selection) {\n selection\n .attr('x', -c.bar.captureWidth / 2)\n .attr('width', c.bar.captureWidth);\n}\n\nfunction backgroundBarHorizontalSetup(selection) {\n selection\n .attr('visibility', 'visible')\n .style('visibility', 'visible')\n .attr('fill', 'yellow')\n .attr('opacity', 0);\n}\n\nfunction setHighlight(d) {\n if(!d.brush.filterSpecified) {\n return '0,' + d.height;\n }\n\n var pixelRanges = unitToPx(d.brush.filter.getConsolidated(), d.height);\n var dashArray = [0]; // we start with a 0 length selection as filter ranges are inclusive, not exclusive\n var p, sectionHeight, iNext;\n var currentGap = pixelRanges.length ? pixelRanges[0][0] : null;\n for(var i = 0; i < pixelRanges.length; i++) {\n p = pixelRanges[i];\n sectionHeight = p[1] - p[0];\n dashArray.push(currentGap);\n dashArray.push(sectionHeight);\n iNext = i + 1;\n if(iNext < pixelRanges.length) {\n currentGap = pixelRanges[iNext][0] - p[1];\n }\n }\n dashArray.push(d.height);\n // d.height is added at the end to ensure that (1) we have an even number of dasharray points, MDN page says\n // \"If an odd number of values is provided, then the list of values is repeated to yield an even number of values.\"\n // and (2) it's _at least_ as long as the full height (even if range is minuscule and at the bottom) though this\n // may not be necessary, maybe duplicating the last point would do too. But no harm in a longer dasharray than line.\n return dashArray;\n}\n\nfunction unitToPx(unitRanges, height) {\n return unitRanges.map(function(pr) {\n return pr.map(function(v) { return Math.max(0, v * height); }).sort(sortAsc);\n });\n}\n\n// is the cursor over the north, middle, or south of a bar?\n// the end handles extend over the last 10% of the bar\nfunction getRegion(fPix, y) {\n var pad = c.bar.handleHeight;\n if(y > fPix[1] + pad || y < fPix[0] - pad) return;\n if(y >= 0.9 * fPix[1] + 0.1 * fPix[0]) return 'n';\n if(y <= 0.9 * fPix[0] + 0.1 * fPix[1]) return 's';\n return 'ns';\n}\n\nfunction clearCursor() {\n d3.select(document.body)\n .style('cursor', null);\n}\n\nfunction styleHighlight(selection) {\n // stroke-dasharray is used to minimize the number of created DOM nodes, because the requirement calls for up to\n // 1000 individual selections on an axis, and there can be 60 axes per parcoords, and multiple parcoords per\n // dashboard. The technique is similar to https://codepen.io/monfera/pen/rLYqWR and using a `polyline` with\n // multiple sections, or a `path` element via its `d` attribute would also be DOM-sparing alternatives.\n selection.attr('stroke-dasharray', setHighlight);\n}\n\nfunction renderHighlight(root, tweenCallback) {\n var bar = d3.select(root).selectAll('.highlight, .highlight-shadow');\n var barToStyle = tweenCallback ? bar.transition().duration(c.bar.snapDuration).each('end', tweenCallback) : bar;\n styleHighlight(barToStyle);\n}\n\nfunction getInterval(d, y) {\n var b = d.brush;\n var active = b.filterSpecified;\n var closestInterval = NaN;\n var out = {};\n var i;\n\n if(active) {\n var height = d.height;\n var intervals = b.filter.getConsolidated();\n var pixIntervals = unitToPx(intervals, height);\n var hoveredInterval = NaN;\n var previousInterval = NaN;\n var nextInterval = NaN;\n for(i = 0; i <= pixIntervals.length; i++) {\n var p = pixIntervals[i];\n if(p && p[0] <= y && y <= p[1]) {\n // over a bar\n hoveredInterval = i;\n break;\n } else {\n // between bars, or before/after the first/last bar\n previousInterval = i ? i - 1 : NaN;\n if(p && p[0] > y) {\n nextInterval = i;\n break; // no point continuing as intervals are non-overlapping and sorted; could use log search\n }\n }\n }\n\n closestInterval = hoveredInterval;\n if(isNaN(closestInterval)) {\n if(isNaN(previousInterval) || isNaN(nextInterval)) {\n closestInterval = isNaN(previousInterval) ? nextInterval : previousInterval;\n } else {\n closestInterval = (y - pixIntervals[previousInterval][1] < pixIntervals[nextInterval][0] - y) ?\n previousInterval : nextInterval;\n }\n }\n\n if(!isNaN(closestInterval)) {\n var fPix = pixIntervals[closestInterval];\n var region = getRegion(fPix, y);\n\n if(region) {\n out.interval = intervals[closestInterval];\n out.intervalPix = fPix;\n out.region = region;\n }\n }\n }\n\n if(d.ordinal && !out.region) {\n var a = d.unitTickvals;\n var unitLocation = d.unitToPaddedPx.invert(y);\n for(i = 0; i < a.length; i++) {\n var rangei = [\n a[Math.max(i - 1, 0)] * 0.25 + a[i] * 0.75,\n a[Math.min(i + 1, a.length - 1)] * 0.25 + a[i] * 0.75\n ];\n if(unitLocation >= rangei[0] && unitLocation <= rangei[1]) {\n out.clickableOrdinalRange = rangei;\n break;\n }\n }\n }\n\n return out;\n}\n\nfunction dragstart(lThis, d) {\n d3.event.sourceEvent.stopPropagation();\n var y = d.height - d3.mouse(lThis)[1] - 2 * c.verticalPadding;\n var unitLocation = d.unitToPaddedPx.invert(y);\n var b = d.brush;\n var interval = getInterval(d, y);\n var unitRange = interval.interval;\n var s = b.svgBrush;\n s.wasDragged = false; // we start assuming there won't be a drag - useful for reset\n s.grabbingBar = interval.region === 'ns';\n if(s.grabbingBar) {\n var pixelRange = unitRange.map(d.unitToPaddedPx);\n s.grabPoint = y - pixelRange[0] - c.verticalPadding;\n s.barLength = pixelRange[1] - pixelRange[0];\n }\n s.clickableOrdinalRange = interval.clickableOrdinalRange;\n s.stayingIntervals = (d.multiselect && b.filterSpecified) ? b.filter.getConsolidated() : [];\n if(unitRange) {\n s.stayingIntervals = s.stayingIntervals.filter(function(int2) {\n return int2[0] !== unitRange[0] && int2[1] !== unitRange[1];\n });\n }\n s.startExtent = interval.region ? unitRange[interval.region === 's' ? 1 : 0] : unitLocation;\n d.parent.inBrushDrag = true;\n s.brushStartCallback();\n}\n\nfunction drag(lThis, d) {\n d3.event.sourceEvent.stopPropagation();\n var y = d.height - d3.mouse(lThis)[1] - 2 * c.verticalPadding;\n var s = d.brush.svgBrush;\n s.wasDragged = true;\n s._dragging = true;\n\n if(s.grabbingBar) { // moving the bar\n s.newExtent = [y - s.grabPoint, y + s.barLength - s.grabPoint].map(d.unitToPaddedPx.invert);\n } else { // south/north drag or new bar creation\n s.newExtent = [s.startExtent, d.unitToPaddedPx.invert(y)].sort(sortAsc);\n }\n\n d.brush.filterSpecified = true;\n s.extent = s.stayingIntervals.concat([s.newExtent]);\n s.brushCallback(d);\n renderHighlight(lThis.parentNode);\n}\n\nfunction dragend(lThis, d) {\n var brush = d.brush;\n var filter = brush.filter;\n var s = brush.svgBrush;\n\n if(!s._dragging) { // i.e. click\n // mock zero drag\n mousemove(lThis, d);\n drag(lThis, d);\n // remember it is a click not a drag\n d.brush.svgBrush.wasDragged = false;\n }\n s._dragging = false;\n\n var e = d3.event;\n e.sourceEvent.stopPropagation();\n var grabbingBar = s.grabbingBar;\n s.grabbingBar = false;\n s.grabLocation = undefined;\n d.parent.inBrushDrag = false;\n clearCursor(); // instead of clearing, a nicer thing would be to set it according to current location\n if(!s.wasDragged) { // a click+release on the same spot (ie. w/o dragging) means a bar or full reset\n s.wasDragged = undefined; // logic-wise unneeded, just shows `wasDragged` has no longer a meaning\n if(s.clickableOrdinalRange) {\n if(brush.filterSpecified && d.multiselect) {\n s.extent.push(s.clickableOrdinalRange);\n } else {\n s.extent = [s.clickableOrdinalRange];\n brush.filterSpecified = true;\n }\n } else if(grabbingBar) {\n s.extent = s.stayingIntervals;\n if(s.extent.length === 0) {\n brushClear(brush);\n }\n } else {\n brushClear(brush);\n }\n s.brushCallback(d);\n renderHighlight(lThis.parentNode);\n s.brushEndCallback(brush.filterSpecified ? filter.getConsolidated() : []);\n return; // no need to fuse intervals or snap to ordinals, so we can bail early\n }\n\n var mergeIntervals = function() {\n // Key piece of logic: once the button is released, possibly overlapping intervals will be fused:\n // Here it's done immediately on click release while on ordinal snap transition it's done at the end\n filter.set(filter.getConsolidated());\n };\n\n if(d.ordinal) {\n var a = d.unitTickvals;\n if(a[a.length - 1] < a[0]) a.reverse();\n s.newExtent = [\n ordinalScaleSnap(0, a, s.newExtent[0], s.stayingIntervals),\n ordinalScaleSnap(1, a, s.newExtent[1], s.stayingIntervals)\n ];\n var hasNewExtent = s.newExtent[1] > s.newExtent[0];\n s.extent = s.stayingIntervals.concat(hasNewExtent ? [s.newExtent] : []);\n if(!s.extent.length) {\n brushClear(brush);\n }\n s.brushCallback(d);\n if(hasNewExtent) {\n // merging intervals post the snap tween\n renderHighlight(lThis.parentNode, mergeIntervals);\n } else {\n // if no new interval, don't animate, just redraw the highlight immediately\n mergeIntervals();\n renderHighlight(lThis.parentNode);\n }\n } else {\n mergeIntervals(); // merging intervals immediately\n }\n s.brushEndCallback(brush.filterSpecified ? filter.getConsolidated() : []);\n}\n\nfunction mousemove(lThis, d) {\n var y = d.height - d3.mouse(lThis)[1] - 2 * c.verticalPadding;\n var interval = getInterval(d, y);\n\n var cursor = 'crosshair';\n if(interval.clickableOrdinalRange) cursor = 'pointer';\n else if(interval.region) cursor = interval.region + '-resize';\n d3.select(document.body)\n .style('cursor', cursor);\n}\n\nfunction attachDragBehavior(selection) {\n // There's some fiddling with pointer cursor styling so that the cursor preserves its shape while dragging a brush\n // even if the cursor strays from the interacting bar, which is bound to happen as bars are thin and the user\n // will inevitably leave the hotspot strip. In this regard, it does something similar to what the D3 brush would do.\n selection\n .on('mousemove', function(d) {\n d3.event.preventDefault();\n if(!d.parent.inBrushDrag) mousemove(this, d);\n })\n .on('mouseleave', function(d) {\n if(!d.parent.inBrushDrag) clearCursor();\n })\n .call(d3.behavior.drag()\n .on('dragstart', function(d) { dragstart(this, d); })\n .on('drag', function(d) { drag(this, d); })\n .on('dragend', function(d) { dragend(this, d); })\n );\n}\n\nfunction startAsc(a, b) { return a[0] - b[0]; }\n\nfunction renderAxisBrush(axisBrush) {\n var background = axisBrush.selectAll('.background').data(repeat);\n\n background.enter()\n .append('rect')\n .classed('background', true)\n .call(barHorizontalSetup)\n .call(backgroundBarHorizontalSetup)\n .style('pointer-events', 'auto') // parent pointer events are disabled; we must have it to register events\n .attr('transform', 'translate(0 ' + c.verticalPadding + ')');\n\n background\n .call(attachDragBehavior)\n .attr('height', function(d) {\n return d.height - c.verticalPadding;\n });\n\n var highlightShadow = axisBrush.selectAll('.highlight-shadow').data(repeat); // we have a set here, can't call it `extent`\n\n highlightShadow.enter()\n .append('line')\n .classed('highlight-shadow', true)\n .attr('x', -c.bar.width / 2)\n .attr('stroke-width', c.bar.width + c.bar.strokeWidth)\n .attr('stroke', c.bar.strokeColor)\n .attr('opacity', c.bar.strokeOpacity)\n .attr('stroke-linecap', 'butt');\n\n highlightShadow\n .attr('y1', function(d) { return d.height; })\n .call(styleHighlight);\n\n var highlight = axisBrush.selectAll('.highlight').data(repeat); // we have a set here, can't call it `extent`\n\n highlight.enter()\n .append('line')\n .classed('highlight', true)\n .attr('x', -c.bar.width / 2)\n .attr('stroke-width', c.bar.width - c.bar.strokeWidth)\n .attr('stroke', c.bar.fillColor)\n .attr('opacity', c.bar.fillOpacity)\n .attr('stroke-linecap', 'butt');\n\n highlight\n .attr('y1', function(d) { return d.height; })\n .call(styleHighlight);\n}\n\nfunction ensureAxisBrush(axisOverlays) {\n var axisBrush = axisOverlays.selectAll('.' + c.cn.axisBrush)\n .data(repeat, keyFun);\n\n axisBrush.enter()\n .append('g')\n .classed(c.cn.axisBrush, true);\n\n renderAxisBrush(axisBrush);\n}\n\nfunction getBrushExtent(brush) {\n return brush.svgBrush.extent.map(function(e) {return e.slice();});\n}\n\nfunction brushClear(brush) {\n brush.filterSpecified = false;\n brush.svgBrush.extent = [[-Infinity, Infinity]];\n}\n\nfunction axisBrushMoved(callback) {\n return function axisBrushMoved(dimension) {\n var brush = dimension.brush;\n var extent = getBrushExtent(brush);\n var newExtent = extent.slice();\n brush.filter.set(newExtent);\n callback();\n };\n}\n\nfunction dedupeRealRanges(intervals) {\n // Fuses elements of intervals if they overlap, yielding discontiguous intervals, results.length <= intervals.length\n // Currently uses closed intervals, ie. dedupeRealRanges([[400, 800], [300, 400]]) -> [300, 800]\n var queue = intervals.slice();\n var result = [];\n var currentInterval;\n var current = queue.shift();\n while(current) { // [].shift === undefined, so we don't descend into an empty array\n currentInterval = current.slice();\n while((current = queue.shift()) && current[0] <= /* right-open interval would need `<` */ currentInterval[1]) {\n currentInterval[1] = Math.max(currentInterval[1], current[1]);\n }\n result.push(currentInterval);\n }\n\n if(\n result.length === 1 &&\n result[0][0] > result[0][1]\n ) {\n // discard result\n result = [];\n }\n\n return result;\n}\n\nfunction makeFilter() {\n var filter = [];\n var consolidated;\n var bounds;\n return {\n set: function(a) {\n filter = a\n .map(function(d) { return d.slice().sort(sortAsc); })\n .sort(startAsc);\n\n // handle unselected case\n if(filter.length === 1 &&\n filter[0][0] === -Infinity &&\n filter[0][1] === Infinity) {\n filter = [[0, -1]];\n }\n\n consolidated = dedupeRealRanges(filter);\n bounds = filter.reduce(function(p, n) {\n return [Math.min(p[0], n[0]), Math.max(p[1], n[1])];\n }, [Infinity, -Infinity]);\n },\n get: function() { return filter.slice(); },\n getConsolidated: function() { return consolidated; },\n getBounds: function() { return bounds; }\n };\n}\n\nfunction makeBrush(state, rangeSpecified, initialRange, brushStartCallback, brushCallback, brushEndCallback) {\n var filter = makeFilter();\n filter.set(initialRange);\n return {\n filter: filter,\n filterSpecified: rangeSpecified, // there's a difference between not filtering and filtering a non-proper subset\n svgBrush: {\n extent: [], // this is where the svgBrush writes contents into\n brushStartCallback: brushStartCallback,\n brushCallback: axisBrushMoved(brushCallback),\n brushEndCallback: brushEndCallback\n }\n };\n}\n\n// for use by supplyDefaults, but it needed tons of pieces from here so\n// seemed to make more sense just to put the whole routine here\nfunction cleanRanges(ranges, dimension) {\n if(Array.isArray(ranges[0])) {\n ranges = ranges.map(function(ri) { return ri.sort(sortAsc); });\n\n if(!dimension.multiselect) ranges = [ranges[0]];\n else ranges = dedupeRealRanges(ranges.sort(startAsc));\n } else ranges = [ranges.sort(sortAsc)];\n\n // ordinal snapping\n if(dimension.tickvals) {\n var sortedTickVals = dimension.tickvals.slice().sort(sortAsc);\n ranges = ranges.map(function(ri) {\n var rSnapped = [\n ordinalScaleSnap(0, sortedTickVals, ri[0], []),\n ordinalScaleSnap(1, sortedTickVals, ri[1], [])\n ];\n if(rSnapped[1] > rSnapped[0]) return rSnapped;\n })\n .filter(function(ri) { return ri; });\n\n if(!ranges.length) return;\n }\n return ranges.length > 1 ? ranges : ranges[0];\n}\n\nmodule.exports = {\n makeBrush: makeBrush,\n ensureAxisBrush: ensureAxisBrush,\n cleanRanges: cleanRanges\n};\n\n},{\"../../lib\":728,\"../../lib/gup\":726,\"./constants\":1100,\"d3\":164}],1098:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar getModuleCalcData = _dereq_('../../plots/get_data').getModuleCalcData;\nvar parcoordsPlot = _dereq_('./plot');\nvar xmlnsNamespaces = _dereq_('../../constants/xmlns_namespaces');\n\nexports.name = 'parcoords';\n\nexports.plot = function(gd) {\n var calcData = getModuleCalcData(gd.calcdata, 'parcoords')[0];\n if(calcData.length) parcoordsPlot(gd, calcData);\n};\n\nexports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) {\n var hadParcoords = (oldFullLayout._has && oldFullLayout._has('parcoords'));\n var hasParcoords = (newFullLayout._has && newFullLayout._has('parcoords'));\n\n if(hadParcoords && !hasParcoords) {\n oldFullLayout._paperdiv.selectAll('.parcoords').remove();\n oldFullLayout._glimages.selectAll('*').remove();\n }\n};\n\nexports.toSVG = function(gd) {\n var imageRoot = gd._fullLayout._glimages;\n var root = d3.select(gd).selectAll('.svg-container');\n var canvases = root.filter(function(d, i) {return i === root.size() - 1;})\n .selectAll('.gl-canvas-context, .gl-canvas-focus');\n\n function canvasToImage() {\n var canvas = this;\n var imageData = canvas.toDataURL('image/png');\n var image = imageRoot.append('svg:image');\n\n image.attr({\n xmlns: xmlnsNamespaces.svg,\n 'xlink:href': imageData,\n preserveAspectRatio: 'none',\n x: 0,\n y: 0,\n width: canvas.width,\n height: canvas.height\n });\n }\n\n canvases.each(canvasToImage);\n\n // Chrome / Safari bug workaround - browser apparently loses connection to the defined pattern\n // Without the workaround, these browsers 'lose' the filter brush styling (color etc.) after a snapshot\n // on a subsequent interaction.\n // Firefox works fine without this workaround\n window.setTimeout(function() {\n d3.selectAll('#filterBarPattern')\n .attr('id', 'filterBarPattern');\n }, 60);\n};\n\n},{\"../../constants/xmlns_namespaces\":705,\"../../plots/get_data\":813,\"./plot\":1107,\"d3\":164}],1099:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray;\nvar Colorscale = _dereq_('../../components/colorscale');\nvar wrap = _dereq_('../../lib/gup').wrap;\n\nmodule.exports = function calc(gd, trace) {\n var lineColor;\n var cscale;\n\n if(Colorscale.hasColorscale(trace, 'line') && isArrayOrTypedArray(trace.line.color)) {\n lineColor = trace.line.color;\n cscale = Colorscale.extractOpts(trace.line).colorscale;\n\n Colorscale.calc(gd, trace, {\n vals: lineColor,\n containerStr: 'line',\n cLetter: 'c'\n });\n } else {\n lineColor = constHalf(trace._length);\n cscale = [[0, trace.line.color], [1, trace.line.color]];\n }\n\n return wrap({lineColor: lineColor, cscale: cscale});\n};\n\nfunction constHalf(len) {\n var out = new Array(len);\n for(var i = 0; i < len; i++) {\n out[i] = 0.5;\n }\n return out;\n}\n\n},{\"../../components/colorscale\":607,\"../../lib\":728,\"../../lib/gup\":726}],1100:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n\nmodule.exports = {\n maxDimensionCount: 60, // this cannot be increased without WebGL code refactoring\n overdrag: 45,\n verticalPadding: 2, // otherwise, horizontal lines on top or bottom are of lower width\n tickDistance: 50,\n canvasPixelRatio: 1,\n blockLineCount: 5000,\n layers: ['contextLineLayer', 'focusLineLayer', 'pickLineLayer'],\n axisTitleOffset: 28,\n axisExtentOffset: 10,\n deselectedLineColor: '#777',\n bar: {\n width: 4, // Visible width of the filter bar\n captureWidth: 10, // Mouse-sensitive width for interaction (Fitts law)\n fillColor: 'magenta', // Color of the filter bar fill\n fillOpacity: 1, // Filter bar fill opacity\n snapDuration: 150, // tween duration in ms for brush snap for ordinal axes\n snapRatio: 0.25, // ratio of bar extension relative to the distance between two adjacent ordinal values\n snapClose: 0.01, // fraction of inter-value distance to snap to the closer one, even if you're not over it\n strokeColor: 'white', // Color of the filter bar side lines\n strokeOpacity: 1, // Filter bar side stroke opacity\n strokeWidth: 1, // Filter bar side stroke width in pixels\n handleHeight: 8, // Height of the filter bar vertical resize areas on top and bottom\n handleOpacity: 1, // Opacity of the filter bar vertical resize areas on top and bottom\n handleOverlap: 0 // A larger than 0 value causes overlaps with the filter bar, represented as pixels\n },\n cn: {\n axisExtentText: 'axis-extent-text',\n parcoordsLineLayers: 'parcoords-line-layers',\n parcoordsLineLayer: 'parcoords-lines',\n parcoords: 'parcoords',\n parcoordsControlView: 'parcoords-control-view',\n yAxis: 'y-axis',\n axisOverlays: 'axis-overlays',\n axis: 'axis',\n axisHeading: 'axis-heading',\n axisTitle: 'axis-title',\n axisExtent: 'axis-extent',\n axisExtentTop: 'axis-extent-top',\n axisExtentTopText: 'axis-extent-top-text',\n axisExtentBottom: 'axis-extent-bottom',\n axisExtentBottomText: 'axis-extent-bottom-text',\n axisBrush: 'axis-brush'\n },\n id: {\n filterBarPattern: 'filter-bar-pattern'\n\n }\n};\n\n},{}],1101:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar hasColorscale = _dereq_('../../components/colorscale/helpers').hasColorscale;\nvar colorscaleDefaults = _dereq_('../../components/colorscale/defaults');\nvar handleDomainDefaults = _dereq_('../../plots/domain').defaults;\nvar handleArrayContainerDefaults = _dereq_('../../plots/array_container_defaults');\nvar Axes = _dereq_('../../plots/cartesian/axes');\n\nvar attributes = _dereq_('./attributes');\nvar axisBrush = _dereq_('./axisbrush');\nvar maxDimensionCount = _dereq_('./constants').maxDimensionCount;\nvar mergeLength = _dereq_('./merge_length');\n\nfunction handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce) {\n var lineColor = coerce('line.color', defaultColor);\n\n if(hasColorscale(traceIn, 'line') && Lib.isArrayOrTypedArray(lineColor)) {\n if(lineColor.length) {\n coerce('line.colorscale');\n colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: 'line.', cLetter: 'c'});\n // TODO: I think it would be better to keep showing lines beyond the last line color\n // but I'm not sure what color to give these lines - probably black or white\n // depending on the background color?\n return lineColor.length;\n } else {\n traceOut.line.color = defaultColor;\n }\n }\n return Infinity;\n}\n\nfunction dimensionDefaults(dimensionIn, dimensionOut, parentOut, opts) {\n function coerce(attr, dflt) {\n return Lib.coerce(dimensionIn, dimensionOut, attributes.dimensions, attr, dflt);\n }\n\n var values = coerce('values');\n var visible = coerce('visible');\n if(!(values && values.length)) {\n visible = dimensionOut.visible = false;\n }\n\n if(visible) {\n coerce('label');\n coerce('tickvals');\n coerce('ticktext');\n coerce('tickformat');\n var range = coerce('range');\n\n dimensionOut._ax = {\n _id: 'y',\n type: 'linear',\n showexponent: 'all',\n exponentformat: 'B',\n range: range\n };\n\n Axes.setConvert(dimensionOut._ax, opts.layout);\n\n coerce('multiselect');\n var constraintRange = coerce('constraintrange');\n if(constraintRange) {\n dimensionOut.constraintrange = axisBrush.cleanRanges(constraintRange, dimensionOut);\n }\n }\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 dimensionsIn = traceIn.dimensions;\n if(Array.isArray(dimensionsIn) && dimensionsIn.length > maxDimensionCount) {\n Lib.log('parcoords traces support up to ' + maxDimensionCount + ' dimensions at the moment');\n dimensionsIn.splice(maxDimensionCount);\n }\n\n var dimensions = handleArrayContainerDefaults(traceIn, traceOut, {\n name: 'dimensions',\n layout: layout,\n handleItemDefaults: dimensionDefaults\n });\n\n var len = handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce);\n\n handleDomainDefaults(traceOut, layout, coerce);\n\n if(!Array.isArray(dimensions) || !dimensions.length) {\n traceOut.visible = false;\n }\n\n mergeLength(traceOut, dimensions, 'values', len);\n\n // make default font size 10px (default is 12),\n // scale linearly with global font size\n var fontDflt = {\n family: layout.font.family,\n size: Math.round(layout.font.size / 1.2),\n color: layout.font.color\n };\n\n Lib.coerceFont(coerce, 'labelfont', fontDflt);\n Lib.coerceFont(coerce, 'tickfont', fontDflt);\n Lib.coerceFont(coerce, 'rangefont', fontDflt);\n\n coerce('labelangle');\n coerce('labelside');\n};\n\n},{\"../../components/colorscale/defaults\":605,\"../../components/colorscale/helpers\":606,\"../../lib\":728,\"../../plots/array_container_defaults\":772,\"../../plots/cartesian/axes\":776,\"../../plots/domain\":803,\"./attributes\":1096,\"./axisbrush\":1097,\"./constants\":1100,\"./merge_length\":1105}],1102:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isTypedArray = _dereq_('../../lib').isTypedArray;\n\nexports.convertTypedArray = function(a) {\n return isTypedArray(a) ? Array.prototype.slice.call(a) : a;\n};\n\nexports.isOrdinal = function(dimension) {\n return !!dimension.tickvals;\n};\n\nexports.isVisible = function(dimension) {\n return dimension.visible || !('visible' in dimension);\n};\n\n},{\"../../lib\":728}],1103:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults'),\n calc: _dereq_('./calc'),\n plot: _dereq_('./plot'),\n colorbar: {\n container: 'line',\n min: 'cmin',\n max: 'cmax'\n },\n\n moduleType: 'trace',\n name: 'parcoords',\n basePlotModule: _dereq_('./base_plot'),\n categories: ['gl', 'regl', 'noOpacity', 'noHover'],\n meta: {\n \n }\n};\n\n},{\"./attributes\":1096,\"./base_plot\":1098,\"./calc\":1099,\"./defaults\":1101,\"./plot\":1107}],1104:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar glslify = _dereq_('glslify');\nvar vertexShaderSource = glslify([\"precision highp float;\\n#define GLSLIFY 1\\n\\nvarying vec4 fragColor;\\n\\nattribute vec4 p01_04, p05_08, p09_12, p13_16,\\n p17_20, p21_24, p25_28, p29_32,\\n p33_36, p37_40, p41_44, p45_48,\\n p49_52, p53_56, p57_60, colors;\\n\\nuniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,\\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\\n\\nuniform vec2 resolution, viewBoxPos, viewBoxSize;\\nuniform sampler2D mask, palette;\\nuniform float maskHeight;\\nuniform float drwLayer; // 0: context, 1: focus, 2: pick\\nuniform vec4 contextColor;\\n\\nbool isPick = (drwLayer > 1.5);\\nbool isContext = (drwLayer < 0.5);\\n\\nconst vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);\\nconst vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);\\n\\nfloat val(mat4 p, mat4 v) {\\n return dot(matrixCompMult(p, v) * UNITS, UNITS);\\n}\\n\\nfloat axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {\\n float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);\\n float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);\\n return y1 * (1.0 - ratio) + y2 * ratio;\\n}\\n\\nint iMod(int a, int b) {\\n return a - b * (a / b);\\n}\\n\\nbool fOutside(float p, float lo, float hi) {\\n return (lo < hi) && (lo > p || p > hi);\\n}\\n\\nbool vOutside(vec4 p, vec4 lo, vec4 hi) {\\n return (\\n fOutside(p[0], lo[0], hi[0]) ||\\n fOutside(p[1], lo[1], hi[1]) ||\\n fOutside(p[2], lo[2], hi[2]) ||\\n fOutside(p[3], lo[3], hi[3])\\n );\\n}\\n\\nbool mOutside(mat4 p, mat4 lo, mat4 hi) {\\n return (\\n vOutside(p[0], lo[0], hi[0]) ||\\n vOutside(p[1], lo[1], hi[1]) ||\\n vOutside(p[2], lo[2], hi[2]) ||\\n vOutside(p[3], lo[3], hi[3])\\n );\\n}\\n\\nbool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {\\n return mOutside(A, loA, hiA) ||\\n mOutside(B, loB, hiB) ||\\n mOutside(C, loC, hiC) ||\\n mOutside(D, loD, hiD);\\n}\\n\\nbool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {\\n mat4 pnts[4];\\n pnts[0] = A;\\n pnts[1] = B;\\n pnts[2] = C;\\n pnts[3] = D;\\n\\n for(int i = 0; i < 4; ++i) {\\n for(int j = 0; j < 4; ++j) {\\n for(int k = 0; k < 4; ++k) {\\n if(0 == iMod(\\n int(255.0 * texture2D(mask,\\n vec2(\\n (float(i * 2 + j / 2) + 0.5) / 8.0,\\n (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight\\n ))[3]\\n ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),\\n 2\\n )) return true;\\n }\\n }\\n }\\n return false;\\n}\\n\\nvec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {\\n float x = 0.5 * sign(v) + 0.5;\\n float y = axisY(x, A, B, C, D);\\n float z = 1.0 - abs(v);\\n\\n z += isContext ? 0.0 : 2.0 * float(\\n outsideBoundingBox(A, B, C, D) ||\\n outsideRasterMask(A, B, C, D)\\n );\\n\\n return vec4(\\n 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,\\n z,\\n 1.0\\n );\\n}\\n\\nvoid main() {\\n mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);\\n mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);\\n mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);\\n mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);\\n\\n float v = colors[3];\\n\\n gl_Position = position(isContext, v, A, B, C, D);\\n\\n fragColor =\\n isContext ? vec4(contextColor) :\\n isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));\\n}\\n\"]);\nvar fragmentShaderSource = glslify([\"precision highp float;\\n#define GLSLIFY 1\\n\\nvarying vec4 fragColor;\\n\\nvoid main() {\\n gl_FragColor = fragColor;\\n}\\n\"]);\nvar maxDim = _dereq_('./constants').maxDimensionCount;\n\nvar Lib = _dereq_('../../lib');\n\n// don't change; otherwise near/far plane lines are lost\nvar depthLimitEpsilon = 1e-6;\n\n// precision of multiselect is the full range divided into this many parts\nvar maskHeight = 2048;\n\nvar dummyPixel = new Uint8Array(4);\nvar dataPixel = new Uint8Array(4);\n\nvar paletteTextureConfig = {\n shape: [256, 1],\n format: 'rgba',\n type: 'uint8',\n mag: 'nearest',\n min: 'nearest'\n};\n\nfunction ensureDraw(regl) {\n regl.read({\n x: 0,\n y: 0,\n width: 1,\n height: 1,\n data: dummyPixel\n });\n}\n\nfunction clear(regl, x, y, width, height) {\n var gl = regl._gl;\n gl.enable(gl.SCISSOR_TEST);\n gl.scissor(x, y, width, height);\n regl.clear({color: [0, 0, 0, 0], depth: 1}); // clearing is done in scissored panel only\n}\n\nfunction renderBlock(regl, glAes, renderState, blockLineCount, sampleCount, item) {\n var rafKey = item.key;\n\n function render(blockNumber) {\n var count = Math.min(blockLineCount, sampleCount - blockNumber * blockLineCount);\n\n if(blockNumber === 0) {\n // stop drawing possibly stale glyphs before clearing\n window.cancelAnimationFrame(renderState.currentRafs[rafKey]);\n delete renderState.currentRafs[rafKey];\n clear(regl, item.scissorX, item.scissorY, item.scissorWidth, item.viewBoxSize[1]);\n }\n\n if(renderState.clearOnly) {\n return;\n }\n\n item.count = 2 * count;\n item.offset = 2 * blockNumber * blockLineCount;\n glAes(item);\n\n if(blockNumber * blockLineCount + count < sampleCount) {\n renderState.currentRafs[rafKey] = window.requestAnimationFrame(function() {\n render(blockNumber + 1);\n });\n }\n\n renderState.drawCompleted = false;\n }\n\n if(!renderState.drawCompleted) {\n ensureDraw(regl);\n renderState.drawCompleted = true;\n }\n\n // start with rendering item 0; recursion handles the rest\n render(0);\n}\n\nfunction adjustDepth(d) {\n // WebGL matrix operations use floats with limited precision, potentially causing a number near a border of [0, 1]\n // to end up slightly outside the border. With an epsilon, we reduce the chance that a line gets clipped by the\n // near or the far plane.\n return Math.max(depthLimitEpsilon, Math.min(1 - depthLimitEpsilon, d));\n}\n\nfunction palette(unitToColor, opacity) {\n var result = new Array(256);\n for(var i = 0; i < 256; i++) {\n result[i] = unitToColor(i / 255).concat(opacity);\n }\n return result;\n}\n\n// Maps the sample index [0...sampleCount - 1] to a range of [0, 1] as the shader expects colors in the [0, 1] range.\n// but first it shifts the sample index by 0, 8 or 16 bits depending on rgbIndex [0..2]\n// with the end result that each line will be of a unique color, making it possible for the pick handler\n// to uniquely identify which line is hovered over (bijective mapping).\n// The inverse, i.e. readPixel is invoked from 'parcoords.js'\nfunction calcPickColor(i, rgbIndex) {\n return (i >>> 8 * rgbIndex) % 256 / 255;\n}\n\nfunction makePoints(sampleCount, dims, color) {\n var points = new Array(sampleCount * (maxDim + 4));\n var n = 0;\n for(var i = 0; i < sampleCount; i++) {\n for(var k = 0; k < maxDim; k++) {\n points[n++] = (k < dims.length) ? dims[k].paddedUnitValues[i] : 0.5;\n }\n points[n++] = calcPickColor(i, 2);\n points[n++] = calcPickColor(i, 1);\n points[n++] = calcPickColor(i, 0);\n points[n++] = adjustDepth(color[i]);\n }\n return points;\n}\n\nfunction makeVecAttr(vecIndex, sampleCount, points) {\n var pointPairs = new Array(sampleCount * 8);\n var n = 0;\n for(var i = 0; i < sampleCount; i++) {\n for(var j = 0; j < 2; j++) {\n for(var k = 0; k < 4; k++) {\n var q = vecIndex * 4 + k;\n var v = points[i * 64 + q];\n if(q === 63 && j === 0) {\n v *= -1;\n }\n pointPairs[n++] = v;\n }\n }\n }\n return pointPairs;\n}\n\nfunction pad2(num) {\n var s = '0' + num;\n return s.substr(s.length - 2);\n}\n\nfunction getAttrName(i) {\n return (i < maxDim) ? 'p' + pad2(i + 1) + '_' + pad2(i + 4) : 'colors';\n}\n\nfunction setAttributes(attributes, sampleCount, points) {\n for(var i = 0; i <= maxDim; i += 4) {\n attributes[getAttrName(i)](makeVecAttr(i / 4, sampleCount, points));\n }\n}\n\nfunction emptyAttributes(regl) {\n var attributes = {};\n for(var i = 0; i <= maxDim; i += 4) {\n attributes[getAttrName(i)] = regl.buffer({usage: 'dynamic', type: 'float', data: new Uint8Array(0)});\n }\n return attributes;\n}\n\nfunction makeItem(model, leftmost, rightmost, itemNumber, i0, i1, x, y, panelSizeX, panelSizeY, crossfilterDimensionIndex, drwLayer, constraints) {\n var dims = [[], []];\n for(var k = 0; k < 64; k++) {\n dims[0][k] = (k === i0) ? 1 : 0;\n dims[1][k] = (k === i1) ? 1 : 0;\n }\n\n var overdrag = model.lines.canvasOverdrag;\n var domain = model.domain;\n var canvasWidth = model.canvasWidth;\n var canvasHeight = model.canvasHeight;\n\n var deselectedLinesColor = model.deselectedLines.color;\n\n var itemModel = Lib.extendFlat({\n key: crossfilterDimensionIndex,\n resolution: [canvasWidth, canvasHeight],\n viewBoxPos: [x + overdrag, y],\n viewBoxSize: [panelSizeX, panelSizeY],\n i0: i0,\n i1: i1,\n\n dim0A: dims[0].slice(0, 16),\n dim0B: dims[0].slice(16, 32),\n dim0C: dims[0].slice(32, 48),\n dim0D: dims[0].slice(48, 64),\n dim1A: dims[1].slice(0, 16),\n dim1B: dims[1].slice(16, 32),\n dim1C: dims[1].slice(32, 48),\n dim1D: dims[1].slice(48, 64),\n\n drwLayer: drwLayer,\n contextColor: [\n deselectedLinesColor[0] / 255,\n deselectedLinesColor[1] / 255,\n deselectedLinesColor[2] / 255,\n deselectedLinesColor[3] < 1 ?\n deselectedLinesColor[3] :\n Math.max(1 / 255, Math.pow(1 / model.lines.color.length, 1 / 3))\n ],\n\n scissorX: (itemNumber === leftmost ? 0 : x + overdrag) + (model.pad.l - overdrag) + model.layoutWidth * domain.x[0],\n scissorWidth: (itemNumber === rightmost ? canvasWidth - x + overdrag : panelSizeX + 0.5) + (itemNumber === leftmost ? x + overdrag : 0),\n scissorY: y + model.pad.b + model.layoutHeight * domain.y[0],\n scissorHeight: panelSizeY,\n\n viewportX: model.pad.l - overdrag + model.layoutWidth * domain.x[0],\n viewportY: model.pad.b + model.layoutHeight * domain.y[0],\n viewportWidth: canvasWidth,\n viewportHeight: canvasHeight\n }, constraints);\n\n return itemModel;\n}\n\nfunction expandedPixelRange(bounds) {\n var dh = maskHeight - 1;\n var a = Math.max(0, Math.floor(bounds[0] * dh), 0);\n var b = Math.min(dh, Math.ceil(bounds[1] * dh), dh);\n return [\n Math.min(a, b),\n Math.max(a, b)\n ];\n}\n\nmodule.exports = function(canvasGL, d) {\n // context & pick describe which canvas we're talking about - won't change with new data\n var isContext = d.context;\n var isPick = d.pick;\n\n var regl = d.regl;\n\n var renderState = {\n currentRafs: {},\n drawCompleted: true,\n clearOnly: false\n };\n\n // state to be set by update and used later\n var model;\n var vm;\n var initialDims;\n var sampleCount;\n var attributes = emptyAttributes(regl);\n var maskTexture;\n var paletteTexture = regl.texture(paletteTextureConfig);\n\n var prevAxisOrder = [];\n\n update(d);\n\n var glAes = regl({\n\n profile: false,\n\n blend: {\n enable: isContext,\n func: {\n srcRGB: 'src alpha',\n dstRGB: 'one minus src alpha',\n srcAlpha: 1,\n dstAlpha: 1 // 'one minus src alpha'\n },\n equation: {\n rgb: 'add',\n alpha: 'add'\n },\n color: [0, 0, 0, 0]\n },\n\n depth: {\n enable: !isContext,\n mask: true,\n func: 'less',\n range: [0, 1]\n },\n\n // for polygons\n cull: {\n enable: true,\n face: 'back'\n },\n\n scissor: {\n enable: true,\n box: {\n x: regl.prop('scissorX'),\n y: regl.prop('scissorY'),\n width: regl.prop('scissorWidth'),\n height: regl.prop('scissorHeight')\n }\n },\n\n viewport: {\n x: regl.prop('viewportX'),\n y: regl.prop('viewportY'),\n width: regl.prop('viewportWidth'),\n height: regl.prop('viewportHeight')\n },\n\n dither: false,\n\n vert: vertexShaderSource,\n\n frag: fragmentShaderSource,\n\n primitive: 'lines',\n lineWidth: 1,\n attributes: attributes,\n uniforms: {\n resolution: regl.prop('resolution'),\n viewBoxPos: regl.prop('viewBoxPos'),\n viewBoxSize: regl.prop('viewBoxSize'),\n dim0A: regl.prop('dim0A'),\n dim1A: regl.prop('dim1A'),\n dim0B: regl.prop('dim0B'),\n dim1B: regl.prop('dim1B'),\n dim0C: regl.prop('dim0C'),\n dim1C: regl.prop('dim1C'),\n dim0D: regl.prop('dim0D'),\n dim1D: regl.prop('dim1D'),\n loA: regl.prop('loA'),\n hiA: regl.prop('hiA'),\n loB: regl.prop('loB'),\n hiB: regl.prop('hiB'),\n loC: regl.prop('loC'),\n hiC: regl.prop('hiC'),\n loD: regl.prop('loD'),\n hiD: regl.prop('hiD'),\n palette: paletteTexture,\n contextColor: regl.prop('contextColor'),\n mask: regl.prop('maskTexture'),\n drwLayer: regl.prop('drwLayer'),\n maskHeight: regl.prop('maskHeight')\n },\n offset: regl.prop('offset'),\n count: regl.prop('count')\n });\n\n function update(dNew) {\n model = dNew.model;\n vm = dNew.viewModel;\n initialDims = vm.dimensions.slice();\n sampleCount = initialDims[0] ? initialDims[0].values.length : 0;\n\n var lines = model.lines;\n var color = isPick ? lines.color.map(function(_, i) {return i / lines.color.length;}) : lines.color;\n\n var points = makePoints(sampleCount, initialDims, color);\n setAttributes(attributes, sampleCount, points);\n\n if(!isContext && !isPick) {\n paletteTexture = regl.texture(Lib.extendFlat({\n data: palette(model.unitToColor, 255)\n }, paletteTextureConfig));\n }\n }\n\n function makeConstraints(isContext) {\n var i, j, k;\n\n var limits = [[], []];\n for(k = 0; k < 64; k++) {\n var p = (!isContext && k < initialDims.length) ?\n initialDims[k].brush.filter.getBounds() : [-Infinity, Infinity];\n\n limits[0][k] = p[0];\n limits[1][k] = p[1];\n }\n\n var len = maskHeight * 8;\n var mask = new Array(len);\n for(i = 0; i < len; i++) {\n mask[i] = 255;\n }\n if(!isContext) {\n for(i = 0; i < initialDims.length; i++) {\n var u = i % 8;\n var v = (i - u) / 8;\n var bitMask = Math.pow(2, u);\n var dim = initialDims[i];\n var ranges = dim.brush.filter.get();\n if(ranges.length < 2) continue; // bail if the bounding box based filter is sufficient\n\n var prevEnd = expandedPixelRange(ranges[0])[1];\n for(j = 1; j < ranges.length; j++) {\n var nextRange = expandedPixelRange(ranges[j]);\n for(k = prevEnd + 1; k < nextRange[0]; k++) {\n mask[k * 8 + v] &= ~bitMask;\n }\n prevEnd = Math.max(prevEnd, nextRange[1]);\n }\n }\n }\n\n var textureData = {\n // 8 units x 8 bits = 64 bits, just sufficient for the almost 64 dimensions we support\n shape: [8, maskHeight],\n format: 'alpha',\n type: 'uint8',\n mag: 'nearest',\n min: 'nearest',\n data: mask\n };\n if(maskTexture) maskTexture(textureData);\n else maskTexture = regl.texture(textureData);\n\n return {\n maskTexture: maskTexture,\n maskHeight: maskHeight,\n loA: limits[0].slice(0, 16),\n loB: limits[0].slice(16, 32),\n loC: limits[0].slice(32, 48),\n loD: limits[0].slice(48, 64),\n hiA: limits[1].slice(0, 16),\n hiB: limits[1].slice(16, 32),\n hiC: limits[1].slice(32, 48),\n hiD: limits[1].slice(48, 64),\n };\n }\n\n function renderGLParcoords(panels, setChanged, clearOnly) {\n var panelCount = panels.length;\n var i;\n\n var leftmost;\n var rightmost;\n var lowestX = Infinity;\n var highestX = -Infinity;\n\n for(i = 0; i < panelCount; i++) {\n if(panels[i].dim0.canvasX < lowestX) {\n lowestX = panels[i].dim0.canvasX;\n leftmost = i;\n }\n if(panels[i].dim1.canvasX > highestX) {\n highestX = panels[i].dim1.canvasX;\n rightmost = i;\n }\n }\n\n if(panelCount === 0) {\n // clear canvas here, as the panel iteration below will not enter the loop body\n clear(regl, 0, 0, model.canvasWidth, model.canvasHeight);\n }\n var constraints = makeConstraints(isContext);\n\n for(i = 0; i < panelCount; i++) {\n var p = panels[i];\n var i0 = p.dim0.crossfilterDimensionIndex;\n var i1 = p.dim1.crossfilterDimensionIndex;\n var x = p.canvasX;\n var y = p.canvasY;\n var nextX = x + p.panelSizeX;\n if(setChanged ||\n !prevAxisOrder[i0] ||\n prevAxisOrder[i0][0] !== x ||\n prevAxisOrder[i0][1] !== nextX\n ) {\n prevAxisOrder[i0] = [x, nextX];\n\n var item = makeItem(\n model,\n leftmost, rightmost, i, i0, i1, x, y,\n p.panelSizeX, p.panelSizeY,\n p.dim0.crossfilterDimensionIndex,\n isContext ? 0 : isPick ? 2 : 1,\n constraints\n );\n\n renderState.clearOnly = clearOnly;\n\n var blockLineCount = setChanged ? model.lines.blockLineCount : sampleCount;\n renderBlock(\n regl, glAes, renderState, blockLineCount, sampleCount, item\n );\n }\n }\n }\n\n function readPixel(canvasX, canvasY) {\n regl.read({\n x: canvasX,\n y: canvasY,\n width: 1,\n height: 1,\n data: dataPixel\n });\n return dataPixel;\n }\n\n function readPixels(canvasX, canvasY, width, height) {\n var pixelArray = new Uint8Array(4 * width * height);\n regl.read({\n x: canvasX,\n y: canvasY,\n width: width,\n height: height,\n data: pixelArray\n });\n return pixelArray;\n }\n\n function destroy() {\n canvasGL.style['pointer-events'] = 'none';\n paletteTexture.destroy();\n if(maskTexture) maskTexture.destroy();\n for(var k in attributes) attributes[k].destroy();\n }\n\n return {\n render: renderGLParcoords,\n readPixel: readPixel,\n readPixels: readPixels,\n destroy: destroy,\n update: update\n };\n};\n\n},{\"../../lib\":728,\"./constants\":1100,\"glslify\":408}],1105:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n/**\n * mergeLength: set trace length as the minimum of all dimension data lengths\n * and propagates this length into each dimension\n *\n * @param {object} traceOut: the fullData trace\n * @param {Array(object)} dimensions: array of dimension objects\n * @param {string} dataAttr: the attribute of each dimension containing the data\n * @param {integer} len: an already-existing length from other attributes\n */\nmodule.exports = function(traceOut, dimensions, dataAttr, len) {\n if(!len) len = Infinity;\n var i, dimi;\n for(i = 0; i < dimensions.length; i++) {\n dimi = dimensions[i];\n if(dimi.visible) len = Math.min(len, dimi[dataAttr].length);\n }\n if(len === Infinity) len = 0;\n\n traceOut._length = len;\n for(i = 0; i < dimensions.length; i++) {\n dimi = dimensions[i];\n if(dimi.visible) dimi._length = len;\n }\n\n return len;\n};\n\n},{}],1106:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar rgba = _dereq_('color-rgba');\n\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar Lib = _dereq_('../../lib');\nvar svgTextUtils = _dereq_('../../lib/svg_text_utils');\nvar Drawing = _dereq_('../../components/drawing');\nvar Colorscale = _dereq_('../../components/colorscale');\n\nvar gup = _dereq_('../../lib/gup');\nvar keyFun = gup.keyFun;\nvar repeat = gup.repeat;\nvar unwrap = gup.unwrap;\n\nvar helpers = _dereq_('./helpers');\nvar c = _dereq_('./constants');\nvar brush = _dereq_('./axisbrush');\nvar lineLayerMaker = _dereq_('./lines');\n\nfunction findExtreme(fn, values, len) {\n return Lib.aggNums(fn, null, values, len);\n}\n\nfunction findExtremes(values, len) {\n return fixExtremes(\n findExtreme(Math.min, values, len),\n findExtreme(Math.max, values, len)\n );\n}\n\nfunction dimensionExtent(dimension) {\n var range = dimension.range;\n return range ?\n fixExtremes(range[0], range[1]) :\n findExtremes(dimension.values, dimension._length);\n}\n\nfunction fixExtremes(lo, hi) {\n if(isNaN(lo) || !isFinite(lo)) {\n lo = 0;\n }\n\n if(isNaN(hi) || !isFinite(hi)) {\n hi = 0;\n }\n\n // avoid a degenerate (zero-width) domain\n if(lo === hi) {\n if(lo === 0) {\n // no use to multiplying zero, so add/subtract in this case\n lo -= 1;\n hi += 1;\n } else {\n // this keeps the range in the order of magnitude of the data\n lo *= 0.9;\n hi *= 1.1;\n }\n }\n\n return [lo, hi];\n}\n\nfunction toText(formatter, texts) {\n if(texts) {\n return function(v, i) {\n var text = texts[i];\n if(text === null || text === undefined) return formatter(v);\n return text;\n };\n }\n return formatter;\n}\n\nfunction domainScale(height, padding, dimension, tickvals, ticktext) {\n var extent = dimensionExtent(dimension);\n if(tickvals) {\n return d3.scale.ordinal()\n .domain(tickvals.map(toText(d3.format(dimension.tickformat), ticktext)))\n .range(tickvals\n .map(function(d) {\n var unitVal = (d - extent[0]) / (extent[1] - extent[0]);\n return (height - padding + unitVal * (2 * padding - height));\n })\n );\n }\n return d3.scale.linear()\n .domain(extent)\n .range([height - padding, padding]);\n}\n\nfunction unitToPaddedPx(height, padding) {\n return d3.scale.linear().range([padding, height - padding]);\n}\n\nfunction domainToPaddedUnitScale(dimension, padFraction) {\n return d3.scale.linear()\n .domain(dimensionExtent(dimension))\n .range([padFraction, 1 - padFraction]);\n}\n\nfunction ordinalScale(dimension) {\n if(!dimension.tickvals) return;\n\n var extent = dimensionExtent(dimension);\n return d3.scale.ordinal()\n .domain(dimension.tickvals)\n .range(dimension.tickvals.map(function(d) {\n return (d - extent[0]) / (extent[1] - extent[0]);\n }));\n}\n\nfunction unitToColorScale(cscale) {\n var colorStops = cscale.map(function(d) { return d[0]; });\n var colorTuples = cscale.map(function(d) {\n var RGBA = rgba(d[1]);\n return d3.rgb('rgb(' + RGBA[0] + ',' + RGBA[1] + ',' + RGBA[2] + ')');\n });\n var prop = function(n) { return function(o) { return o[n]; }; };\n\n // We can't use d3 color interpolation as we may have non-uniform color palette raster\n // (various color stop distances).\n var polylinearUnitScales = 'rgb'.split('').map(function(key) {\n return d3.scale.linear()\n .clamp(true)\n .domain(colorStops)\n .range(colorTuples.map(prop(key)));\n });\n\n return function(d) {\n return polylinearUnitScales.map(function(s) {\n return s(d);\n });\n };\n}\n\nfunction someFiltersActive(view) {\n return view.dimensions.some(function(p) {\n return p.brush.filterSpecified;\n });\n}\n\nfunction model(layout, d, i) {\n var cd0 = unwrap(d);\n var trace = cd0.trace;\n var lineColor = helpers.convertTypedArray(cd0.lineColor);\n var line = trace.line;\n var deselectedLines = {color: rgba(c.deselectedLineColor)};\n var cOpts = Colorscale.extractOpts(line);\n var cscale = cOpts.reversescale ? Colorscale.flipScale(cd0.cscale) : cd0.cscale;\n var domain = trace.domain;\n var dimensions = trace.dimensions;\n var width = layout.width;\n var labelAngle = trace.labelangle;\n var labelSide = trace.labelside;\n var labelFont = trace.labelfont;\n var tickFont = trace.tickfont;\n var rangeFont = trace.rangefont;\n\n var lines = Lib.extendDeepNoArrays({}, line, {\n color: lineColor.map(d3.scale.linear().domain(\n dimensionExtent({\n values: lineColor,\n range: [cOpts.min, cOpts.max],\n _length: trace._length\n })\n )),\n blockLineCount: c.blockLineCount,\n canvasOverdrag: c.overdrag * c.canvasPixelRatio\n });\n\n var groupWidth = Math.floor(width * (domain.x[1] - domain.x[0]));\n var groupHeight = Math.floor(layout.height * (domain.y[1] - domain.y[0]));\n\n var pad = layout.margin || {l: 80, r: 80, t: 100, b: 80};\n var rowContentWidth = groupWidth;\n var rowHeight = groupHeight;\n\n return {\n key: i,\n colCount: dimensions.filter(helpers.isVisible).length,\n dimensions: dimensions,\n tickDistance: c.tickDistance,\n unitToColor: unitToColorScale(cscale),\n lines: lines,\n deselectedLines: deselectedLines,\n labelAngle: labelAngle,\n labelSide: labelSide,\n labelFont: labelFont,\n tickFont: tickFont,\n rangeFont: rangeFont,\n layoutWidth: width,\n layoutHeight: layout.height,\n domain: domain,\n translateX: domain.x[0] * width,\n translateY: layout.height - domain.y[1] * layout.height,\n pad: pad,\n canvasWidth: rowContentWidth * c.canvasPixelRatio + 2 * lines.canvasOverdrag,\n canvasHeight: rowHeight * c.canvasPixelRatio,\n width: rowContentWidth,\n height: rowHeight,\n canvasPixelRatio: c.canvasPixelRatio\n };\n}\n\nfunction viewModel(state, callbacks, model) {\n var width = model.width;\n var height = model.height;\n var dimensions = model.dimensions;\n var canvasPixelRatio = model.canvasPixelRatio;\n\n var xScale = function(d) {return width * d / Math.max(1, model.colCount - 1);};\n\n var unitPad = c.verticalPadding / height;\n var _unitToPaddedPx = unitToPaddedPx(height, c.verticalPadding);\n\n var vm = {\n key: model.key,\n xScale: xScale,\n model: model,\n inBrushDrag: false // consider factoring it out and putting it in a centralized global-ish gesture state object\n };\n\n var uniqueKeys = {};\n\n vm.dimensions = dimensions.filter(helpers.isVisible).map(function(dimension, i) {\n var domainToPaddedUnit = domainToPaddedUnitScale(dimension, unitPad);\n var foundKey = uniqueKeys[dimension.label];\n uniqueKeys[dimension.label] = (foundKey || 0) + 1;\n var key = dimension.label + (foundKey ? '__' + foundKey : '');\n var specifiedConstraint = dimension.constraintrange;\n var filterRangeSpecified = specifiedConstraint && specifiedConstraint.length;\n if(filterRangeSpecified && !Array.isArray(specifiedConstraint[0])) {\n specifiedConstraint = [specifiedConstraint];\n }\n var filterRange = filterRangeSpecified ?\n specifiedConstraint.map(function(d) { return d.map(domainToPaddedUnit); }) :\n [[-Infinity, Infinity]];\n var brushMove = function() {\n var p = vm;\n p.focusLayer && p.focusLayer.render(p.panels, true);\n var filtersActive = someFiltersActive(p);\n if(!state.contextShown() && filtersActive) {\n p.contextLayer && p.contextLayer.render(p.panels, true);\n state.contextShown(true);\n } else if(state.contextShown() && !filtersActive) {\n p.contextLayer && p.contextLayer.render(p.panels, true, true);\n state.contextShown(false);\n }\n };\n\n var truncatedValues = dimension.values;\n if(truncatedValues.length > dimension._length) {\n truncatedValues = truncatedValues.slice(0, dimension._length);\n }\n\n var tickvals = dimension.tickvals;\n var ticktext;\n function makeTickItem(v, i) { return {val: v, text: ticktext[i]}; }\n function sortTickItem(a, b) { return a.val - b.val; }\n if(Array.isArray(tickvals) && tickvals.length) {\n ticktext = dimension.ticktext;\n\n // ensure ticktext and tickvals have same length\n if(!Array.isArray(ticktext) || !ticktext.length) {\n ticktext = tickvals.map(d3.format(dimension.tickformat));\n } else if(ticktext.length > tickvals.length) {\n ticktext = ticktext.slice(0, tickvals.length);\n } else if(tickvals.length > ticktext.length) {\n tickvals = tickvals.slice(0, ticktext.length);\n }\n\n // check if we need to sort tickvals/ticktext\n for(var j = 1; j < tickvals.length; j++) {\n if(tickvals[j] < tickvals[j - 1]) {\n var tickItems = tickvals.map(makeTickItem).sort(sortTickItem);\n for(var k = 0; k < tickvals.length; k++) {\n tickvals[k] = tickItems[k].val;\n ticktext[k] = tickItems[k].text;\n }\n break;\n }\n }\n } else tickvals = undefined;\n\n truncatedValues = helpers.convertTypedArray(truncatedValues);\n\n return {\n key: key,\n label: dimension.label,\n tickFormat: dimension.tickformat,\n tickvals: tickvals,\n ticktext: ticktext,\n ordinal: helpers.isOrdinal(dimension),\n multiselect: dimension.multiselect,\n xIndex: i,\n crossfilterDimensionIndex: i,\n visibleIndex: dimension._index,\n height: height,\n values: truncatedValues,\n paddedUnitValues: truncatedValues.map(domainToPaddedUnit),\n unitTickvals: tickvals && tickvals.map(domainToPaddedUnit),\n xScale: xScale,\n x: xScale(i),\n canvasX: xScale(i) * canvasPixelRatio,\n unitToPaddedPx: _unitToPaddedPx,\n domainScale: domainScale(height, c.verticalPadding, dimension, tickvals, ticktext),\n ordinalScale: ordinalScale(dimension),\n parent: vm,\n model: model,\n brush: brush.makeBrush(\n state,\n filterRangeSpecified,\n filterRange,\n function() {\n state.linePickActive(false);\n },\n brushMove,\n function(f) {\n vm.focusLayer.render(vm.panels, true);\n vm.pickLayer && vm.pickLayer.render(vm.panels, true);\n state.linePickActive(true);\n if(callbacks && callbacks.filterChanged) {\n var invScale = domainToPaddedUnit.invert;\n\n // update gd.data as if a Plotly.restyle were fired\n var newRanges = f.map(function(r) {\n return r.map(invScale).sort(Lib.sorterAsc);\n }).sort(function(a, b) { return a[0] - b[0]; });\n callbacks.filterChanged(vm.key, dimension._index, newRanges);\n }\n }\n )\n };\n });\n\n return vm;\n}\n\nfunction styleExtentTexts(selection) {\n selection\n .classed(c.cn.axisExtentText, true)\n .attr('text-anchor', 'middle')\n .style('cursor', 'default')\n .style('user-select', 'none');\n}\n\nfunction parcoordsInteractionState() {\n var linePickActive = true;\n var contextShown = false;\n return {\n linePickActive: function(val) {return arguments.length ? linePickActive = !!val : linePickActive;},\n contextShown: function(val) {return arguments.length ? contextShown = !!val : contextShown;}\n };\n}\n\nfunction calcTilt(angle, position) {\n var dir = (position === 'top') ? 1 : -1;\n var radians = angle * Math.PI / 180;\n var dx = Math.sin(radians);\n var dy = Math.cos(radians);\n return {\n dir: dir,\n dx: dx,\n dy: dy,\n degrees: angle\n };\n}\n\nfunction updatePanelLayout(yAxis, vm) {\n var panels = vm.panels || (vm.panels = []);\n var data = yAxis.data();\n for(var i = 0; i < data.length - 1; i++) {\n var p = panels[i] || (panels[i] = {});\n var dim0 = data[i];\n var dim1 = data[i + 1];\n p.dim0 = dim0;\n p.dim1 = dim1;\n p.canvasX = dim0.canvasX;\n p.panelSizeX = dim1.canvasX - dim0.canvasX;\n p.panelSizeY = vm.model.canvasHeight;\n p.y = 0;\n p.canvasY = 0;\n }\n}\n\nfunction calcAllTicks(cd) {\n for(var i = 0; i < cd.length; i++) {\n for(var j = 0; j < cd[i].length; j++) {\n var trace = cd[i][j].trace;\n var dimensions = trace.dimensions;\n\n for(var k = 0; k < dimensions.length; k++) {\n var values = dimensions[k].values;\n var dim = dimensions[k]._ax;\n\n if(dim) {\n if(!dim.range) {\n dim.range = findExtremes(values, trace._length);\n } else {\n dim.range = fixExtremes(dim.range[0], dim.range[1]);\n }\n\n if(!dim.dtick) {\n dim.dtick = 0.01 * (Math.abs(dim.range[1] - dim.range[0]) || 1);\n }\n\n dim.tickformat = dimensions[k].tickformat;\n Axes.calcTicks(dim);\n dim.cleanRange();\n }\n }\n }\n }\n}\n\nfunction linearFormat(dim, v) {\n return Axes.tickText(dim._ax, v, false).text;\n}\n\nfunction extremeText(d, isTop) {\n if(d.ordinal) return '';\n var domain = d.domainScale.domain();\n var v = (domain[isTop ? domain.length - 1 : 0]);\n\n return linearFormat(d.model.dimensions[d.visibleIndex], v);\n}\n\n\nmodule.exports = function parcoords(gd, cdModule, layout, callbacks) {\n var fullLayout = gd._fullLayout;\n var svg = fullLayout._toppaper;\n var glContainer = fullLayout._glcontainer;\n\n calcAllTicks(cdModule);\n\n var state = parcoordsInteractionState();\n\n var vm = cdModule\n .filter(function(d) { return unwrap(d).trace.visible; })\n .map(model.bind(0, layout))\n .map(viewModel.bind(0, state, callbacks));\n\n glContainer.each(function(d, i) {\n return Lib.extendFlat(d, vm[i]);\n });\n\n var glLayers = glContainer.selectAll('.gl-canvas')\n .each(function(d) {\n // FIXME: figure out how to handle multiple instances\n d.viewModel = vm[0];\n d.model = d.viewModel ? d.viewModel.model : null;\n });\n\n var lastHovered = null;\n\n var pickLayer = glLayers.filter(function(d) {return d.pick;});\n\n // emit hover / unhover event\n pickLayer\n .style('pointer-events', 'auto')\n .on('mousemove', function(d) {\n if(state.linePickActive() && d.lineLayer && callbacks && callbacks.hover) {\n var event = d3.event;\n var cw = this.width;\n var ch = this.height;\n var pointer = d3.mouse(this);\n var x = pointer[0];\n var y = pointer[1];\n\n if(x < 0 || y < 0 || x >= cw || y >= ch) {\n return;\n }\n var pixel = d.lineLayer.readPixel(x, ch - 1 - y);\n var found = pixel[3] !== 0;\n // inverse of the calcPickColor in `lines.js`; detailed comment there\n var curveNumber = found ? pixel[2] + 256 * (pixel[1] + 256 * pixel[0]) : null;\n var eventData = {\n x: x,\n y: y,\n clientX: event.clientX,\n clientY: event.clientY,\n dataIndex: d.model.key,\n curveNumber: curveNumber\n };\n if(curveNumber !== lastHovered) { // don't unnecessarily repeat the same hit (or miss)\n if(found) {\n callbacks.hover(eventData);\n } else if(callbacks.unhover) {\n callbacks.unhover(eventData);\n }\n lastHovered = curveNumber;\n }\n }\n });\n\n glLayers\n .style('opacity', function(d) {return d.pick ? 0 : 1;});\n\n svg.style('background', 'rgba(255, 255, 255, 0)');\n var controlOverlay = svg.selectAll('.' + c.cn.parcoords)\n .data(vm, keyFun);\n\n controlOverlay.exit().remove();\n\n controlOverlay.enter()\n .append('g')\n .classed(c.cn.parcoords, true)\n .style('shape-rendering', 'crispEdges')\n .style('pointer-events', 'none');\n\n controlOverlay.attr('transform', function(d) {\n return 'translate(' + d.model.translateX + ',' + d.model.translateY + ')';\n });\n\n var parcoordsControlView = controlOverlay.selectAll('.' + c.cn.parcoordsControlView)\n .data(repeat, keyFun);\n\n parcoordsControlView.enter()\n .append('g')\n .classed(c.cn.parcoordsControlView, true);\n\n parcoordsControlView.attr('transform', function(d) {\n return 'translate(' + d.model.pad.l + ',' + d.model.pad.t + ')';\n });\n\n var yAxis = parcoordsControlView.selectAll('.' + c.cn.yAxis)\n .data(function(p) { return p.dimensions; }, keyFun);\n\n yAxis.enter()\n .append('g')\n .classed(c.cn.yAxis, true);\n\n parcoordsControlView.each(function(p) {\n updatePanelLayout(yAxis, p);\n });\n\n glLayers\n .each(function(d) {\n if(d.viewModel) {\n if(!d.lineLayer || callbacks) { // recreate in case of having callbacks e.g. restyle. Should we test for callback to be a restyle?\n d.lineLayer = lineLayerMaker(this, d);\n } else d.lineLayer.update(d);\n\n if(d.key || d.key === 0) d.viewModel[d.key] = d.lineLayer;\n\n var setChanged = (!d.context || // don't update background\n callbacks); // unless there is a callback on the context layer. Should we test the callback?\n\n d.lineLayer.render(d.viewModel.panels, setChanged);\n }\n });\n\n yAxis.attr('transform', function(d) {\n return 'translate(' + d.xScale(d.xIndex) + ', 0)';\n });\n\n // drag column for reordering columns\n yAxis.call(d3.behavior.drag()\n .origin(function(d) { return d; })\n .on('drag', function(d) {\n var p = d.parent;\n state.linePickActive(false);\n d.x = Math.max(-c.overdrag, Math.min(d.model.width + c.overdrag, d3.event.x));\n d.canvasX = d.x * d.model.canvasPixelRatio;\n yAxis\n .sort(function(a, b) { return a.x - b.x; })\n .each(function(e, i) {\n e.xIndex = i;\n e.x = d === e ? e.x : e.xScale(e.xIndex);\n e.canvasX = e.x * e.model.canvasPixelRatio;\n });\n\n updatePanelLayout(yAxis, p);\n\n yAxis.filter(function(e) { return Math.abs(d.xIndex - e.xIndex) !== 0; })\n .attr('transform', function(d) { return 'translate(' + d.xScale(d.xIndex) + ', 0)'; });\n d3.select(this).attr('transform', 'translate(' + d.x + ', 0)');\n yAxis.each(function(e, i0, i1) { if(i1 === d.parent.key) p.dimensions[i0] = e; });\n p.contextLayer && p.contextLayer.render(p.panels, false, !someFiltersActive(p));\n p.focusLayer.render && p.focusLayer.render(p.panels);\n })\n .on('dragend', function(d) {\n var p = d.parent;\n d.x = d.xScale(d.xIndex);\n d.canvasX = d.x * d.model.canvasPixelRatio;\n updatePanelLayout(yAxis, p);\n d3.select(this)\n .attr('transform', function(d) { return 'translate(' + d.x + ', 0)'; });\n p.contextLayer && p.contextLayer.render(p.panels, false, !someFiltersActive(p));\n p.focusLayer && p.focusLayer.render(p.panels);\n p.pickLayer && p.pickLayer.render(p.panels, true);\n state.linePickActive(true);\n\n if(callbacks && callbacks.axesMoved) {\n callbacks.axesMoved(p.key, p.dimensions.map(function(e) {return e.crossfilterDimensionIndex;}));\n }\n })\n );\n\n yAxis.exit()\n .remove();\n\n var axisOverlays = yAxis.selectAll('.' + c.cn.axisOverlays)\n .data(repeat, keyFun);\n\n axisOverlays.enter()\n .append('g')\n .classed(c.cn.axisOverlays, true);\n\n axisOverlays.selectAll('.' + c.cn.axis).remove();\n\n var axis = axisOverlays.selectAll('.' + c.cn.axis)\n .data(repeat, keyFun);\n\n axis.enter()\n .append('g')\n .classed(c.cn.axis, true);\n\n axis\n .each(function(d) {\n var wantedTickCount = d.model.height / d.model.tickDistance;\n var scale = d.domainScale;\n var sdom = scale.domain();\n d3.select(this)\n .call(d3.svg.axis()\n .orient('left')\n .tickSize(4)\n .outerTickSize(2)\n .ticks(wantedTickCount, d.tickFormat) // works for continuous scales only...\n .tickValues(d.ordinal ? // and this works for ordinal scales\n sdom :\n null)\n .tickFormat(function(v) {\n return helpers.isOrdinal(d) ? v : linearFormat(d.model.dimensions[d.visibleIndex], v);\n })\n .scale(scale));\n Drawing.font(axis.selectAll('text'), d.model.tickFont);\n });\n\n axis.selectAll('.domain, .tick>line')\n .attr('fill', 'none')\n .attr('stroke', 'black')\n .attr('stroke-opacity', 0.25)\n .attr('stroke-width', '1px');\n\n axis.selectAll('text')\n .style('text-shadow', '1px 1px 1px #fff, -1px -1px 1px #fff, 1px -1px 1px #fff, -1px 1px 1px #fff')\n .style('cursor', 'default')\n .style('user-select', 'none');\n\n var axisHeading = axisOverlays.selectAll('.' + c.cn.axisHeading)\n .data(repeat, keyFun);\n\n axisHeading.enter()\n .append('g')\n .classed(c.cn.axisHeading, true);\n\n var axisTitle = axisHeading.selectAll('.' + c.cn.axisTitle)\n .data(repeat, keyFun);\n\n axisTitle.enter()\n .append('text')\n .classed(c.cn.axisTitle, true)\n .attr('text-anchor', 'middle')\n .style('cursor', 'ew-resize')\n .style('user-select', 'none')\n .style('pointer-events', 'auto');\n\n axisTitle\n .text(function(d) { return d.label; })\n .each(function(d) {\n var e = d3.select(this);\n Drawing.font(e, d.model.labelFont);\n svgTextUtils.convertToTspans(e, gd);\n })\n .attr('transform', function(d) {\n var tilt = calcTilt(d.model.labelAngle, d.model.labelSide);\n var r = c.axisTitleOffset;\n return (\n (tilt.dir > 0 ? '' : 'translate(0,' + (2 * r + d.model.height) + ')') +\n 'rotate(' + tilt.degrees + ')' +\n 'translate(' + (-r * tilt.dx) + ',' + (-r * tilt.dy) + ')'\n );\n })\n .attr('text-anchor', function(d) {\n var tilt = calcTilt(d.model.labelAngle, d.model.labelSide);\n var adx = Math.abs(tilt.dx);\n var ady = Math.abs(tilt.dy);\n\n if(2 * adx > ady) {\n return (tilt.dir * tilt.dx < 0) ? 'start' : 'end';\n } else {\n return 'middle';\n }\n });\n\n var axisExtent = axisOverlays.selectAll('.' + c.cn.axisExtent)\n .data(repeat, keyFun);\n\n axisExtent.enter()\n .append('g')\n .classed(c.cn.axisExtent, true);\n\n var axisExtentTop = axisExtent.selectAll('.' + c.cn.axisExtentTop)\n .data(repeat, keyFun);\n\n axisExtentTop.enter()\n .append('g')\n .classed(c.cn.axisExtentTop, true);\n\n axisExtentTop\n .attr('transform', 'translate(' + 0 + ',' + -c.axisExtentOffset + ')');\n\n var axisExtentTopText = axisExtentTop.selectAll('.' + c.cn.axisExtentTopText)\n .data(repeat, keyFun);\n\n axisExtentTopText.enter()\n .append('text')\n .classed(c.cn.axisExtentTopText, true)\n .call(styleExtentTexts);\n\n axisExtentTopText\n .text(function(d) { return extremeText(d, true); })\n .each(function(d) { Drawing.font(d3.select(this), d.model.rangeFont); });\n\n var axisExtentBottom = axisExtent.selectAll('.' + c.cn.axisExtentBottom)\n .data(repeat, keyFun);\n\n axisExtentBottom.enter()\n .append('g')\n .classed(c.cn.axisExtentBottom, true);\n\n axisExtentBottom\n .attr('transform', function(d) {\n return 'translate(' + 0 + ',' + (d.model.height + c.axisExtentOffset) + ')';\n });\n\n var axisExtentBottomText = axisExtentBottom.selectAll('.' + c.cn.axisExtentBottomText)\n .data(repeat, keyFun);\n\n axisExtentBottomText.enter()\n .append('text')\n .classed(c.cn.axisExtentBottomText, true)\n .attr('dy', '0.75em')\n .call(styleExtentTexts);\n\n axisExtentBottomText\n .text(function(d) { return extremeText(d, false); })\n .each(function(d) { Drawing.font(d3.select(this), d.model.rangeFont); });\n\n brush.ensureAxisBrush(axisOverlays);\n};\n\n},{\"../../components/colorscale\":607,\"../../components/drawing\":617,\"../../lib\":728,\"../../lib/gup\":726,\"../../lib/svg_text_utils\":752,\"../../plots/cartesian/axes\":776,\"./axisbrush\":1097,\"./constants\":1100,\"./helpers\":1102,\"./lines\":1104,\"color-rgba\":124,\"d3\":164}],1107:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar parcoords = _dereq_('./parcoords');\nvar prepareRegl = _dereq_('../../lib/prepare_regl');\nvar isVisible = _dereq_('./helpers').isVisible;\n\nfunction newIndex(visibleIndices, orig, dim) {\n var origIndex = orig.indexOf(dim);\n var currentIndex = visibleIndices.indexOf(origIndex);\n if(currentIndex === -1) {\n // invisible dimensions initially go to the end\n currentIndex += orig.length;\n }\n return currentIndex;\n}\n\nfunction sorter(visibleIndices, orig) {\n return function sorter(d1, d2) {\n return (\n newIndex(visibleIndices, orig, d1) -\n newIndex(visibleIndices, orig, d2)\n );\n };\n}\n\nmodule.exports = function plot(gd, cdModule) {\n var fullLayout = gd._fullLayout;\n\n var success = prepareRegl(gd);\n if(!success) return;\n\n var currentDims = {};\n var initialDims = {};\n var fullIndices = {};\n var inputIndices = {};\n\n var size = fullLayout._size;\n\n cdModule.forEach(function(d, i) {\n var trace = d[0].trace;\n fullIndices[i] = trace.index;\n var iIn = inputIndices[i] = trace._fullInput.index;\n currentDims[i] = gd.data[iIn].dimensions;\n initialDims[i] = gd.data[iIn].dimensions.slice();\n });\n\n var filterChanged = function(i, initialDimIndex, newRanges) {\n // Have updated `constraintrange` data on `gd.data` and raise `Plotly.restyle` event\n // without having to incur heavy UI blocking due to an actual `Plotly.restyle` call\n\n var dim = initialDims[i][initialDimIndex];\n var newConstraints = newRanges.map(function(r) { return r.slice(); });\n\n // Store constraint range in preGUI\n // This one doesn't work if it's stored in pieces in _storeDirectGUIEdit\n // because it's an array of variable dimensionality. So store the whole\n // thing at once manually.\n var aStr = 'dimensions[' + initialDimIndex + '].constraintrange';\n var preGUI = fullLayout._tracePreGUI[gd._fullData[fullIndices[i]]._fullInput.uid];\n if(preGUI[aStr] === undefined) {\n var initialVal = dim.constraintrange;\n preGUI[aStr] = initialVal || null;\n }\n\n var fullDimension = gd._fullData[fullIndices[i]].dimensions[initialDimIndex];\n\n if(!newConstraints.length) {\n delete dim.constraintrange;\n delete fullDimension.constraintrange;\n newConstraints = null;\n } else {\n if(newConstraints.length === 1) newConstraints = newConstraints[0];\n dim.constraintrange = newConstraints;\n fullDimension.constraintrange = newConstraints.slice();\n // wrap in another array for restyle event data\n newConstraints = [newConstraints];\n }\n\n var restyleData = {};\n restyleData[aStr] = newConstraints;\n gd.emit('plotly_restyle', [restyleData, [inputIndices[i]]]);\n };\n\n var hover = function(eventData) {\n gd.emit('plotly_hover', eventData);\n };\n\n var unhover = function(eventData) {\n gd.emit('plotly_unhover', eventData);\n };\n\n var axesMoved = function(i, visibleIndices) {\n // Have updated order data on `gd.data` and raise `Plotly.restyle` event\n // without having to incur heavy UI blocking due to an actual `Plotly.restyle` call\n\n // drag&drop sorting of the visible dimensions\n var orig = sorter(visibleIndices, initialDims[i].filter(isVisible));\n currentDims[i].sort(orig);\n\n // invisible dimensions are not interpreted in the context of drag&drop sorting as an invisible dimension\n // cannot be dragged; they're interspersed into their original positions by this subsequent merging step\n initialDims[i].filter(function(d) {return !isVisible(d);})\n .sort(function(d) {\n // subsequent splicing to be done left to right, otherwise indices may be incorrect\n return initialDims[i].indexOf(d);\n })\n .forEach(function(d) {\n currentDims[i].splice(currentDims[i].indexOf(d), 1); // remove from the end\n currentDims[i].splice(initialDims[i].indexOf(d), 0, d); // insert at original index\n });\n\n // TODO: we can't really store this part of the interaction state\n // directly as below, since it incudes data arrays. If we want to\n // persist column order we may have to do something special for this\n // case to just store the order itself.\n // Registry.call('_storeDirectGUIEdit',\n // gd.data[inputIndices[i]],\n // fullLayout._tracePreGUI[gd._fullData[fullIndices[i]]._fullInput.uid],\n // {dimensions: currentDims[i]}\n // );\n\n gd.emit('plotly_restyle', [{dimensions: [currentDims[i]]}, [inputIndices[i]]]);\n };\n\n parcoords(\n gd,\n cdModule,\n { // layout\n width: size.w,\n height: size.h,\n margin: {\n t: size.t,\n r: size.r,\n b: size.b,\n l: size.l\n }\n },\n { // callbacks\n filterChanged: filterChanged,\n hover: hover,\n unhover: unhover,\n axesMoved: axesMoved\n }\n );\n};\n\n},{\"../../lib/prepare_regl\":741,\"./helpers\":1102,\"./parcoords\":1106}],1108:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar baseAttrs = _dereq_('../../plots/attributes');\nvar domainAttrs = _dereq_('../../plots/domain').attributes;\nvar fontAttrs = _dereq_('../../plots/font_attributes');\nvar colorAttrs = _dereq_('../../components/color/attributes');\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar texttemplateAttrs = _dereq_('../../plots/template_attributes').texttemplateAttrs;\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nvar textFontAttrs = fontAttrs({\n editType: 'plot',\n arrayOk: true,\n colorEditType: 'plot',\n \n});\n\nmodule.exports = {\n labels: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n // equivalent of x0 and dx, if label is missing\n label0: {\n valType: 'number',\n \n dflt: 0,\n editType: 'calc',\n \n },\n dlabel: {\n valType: 'number',\n \n dflt: 1,\n editType: 'calc',\n \n },\n\n values: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n\n marker: {\n colors: {\n valType: 'data_array', // TODO 'color_array' ?\n editType: 'calc',\n \n },\n\n line: {\n color: {\n valType: 'color',\n \n dflt: colorAttrs.defaultLine,\n arrayOk: true,\n editType: 'style',\n \n },\n width: {\n valType: 'number',\n \n min: 0,\n dflt: 0,\n arrayOk: true,\n editType: 'style',\n \n },\n editType: 'calc'\n },\n editType: 'calc'\n },\n\n text: {\n valType: 'data_array',\n editType: 'plot',\n \n },\n hovertext: {\n valType: 'string',\n \n dflt: '',\n arrayOk: true,\n editType: 'style',\n \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 \n dflt: '',\n editType: 'calc',\n \n },\n\n // labels (legend is handled by plots.attributes.showlegend and layout.hiddenlabels)\n textinfo: {\n valType: 'flaglist',\n \n flags: ['label', 'text', 'value', 'percent'],\n extras: ['none'],\n editType: 'calc',\n \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 \n values: ['inside', 'outside', 'auto', 'none'],\n dflt: 'auto',\n arrayOk: true,\n editType: 'plot',\n \n },\n textfont: extendFlat({}, textFontAttrs, {\n \n }),\n insidetextorientation: {\n valType: 'enumerated',\n \n values: ['horizontal', 'radial', 'tangential', 'auto'],\n dflt: 'auto',\n editType: 'plot',\n \n },\n insidetextfont: extendFlat({}, textFontAttrs, {\n \n }),\n outsidetextfont: extendFlat({}, textFontAttrs, {\n \n }),\n automargin: {\n valType: 'boolean',\n dflt: false,\n \n editType: 'plot',\n \n },\n\n title: {\n text: {\n valType: 'string',\n dflt: '',\n \n editType: 'plot',\n \n },\n font: extendFlat({}, textFontAttrs, {\n \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 \n editType: 'plot',\n \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 \n min: 0,\n max: 1,\n dflt: 0,\n editType: 'calc',\n \n },\n\n // ordering and direction\n sort: {\n valType: 'boolean',\n \n dflt: true,\n editType: 'calc',\n \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 \n dflt: 'counterclockwise',\n editType: 'calc',\n \n },\n rotation: {\n valType: 'number',\n \n min: -360,\n max: 360,\n dflt: 0,\n editType: 'calc',\n \n },\n\n pull: {\n valType: 'number',\n \n min: 0,\n max: 1,\n dflt: 0,\n arrayOk: true,\n editType: 'calc',\n \n },\n\n _deprecated: {\n title: {\n valType: 'string',\n dflt: '',\n \n editType: 'calc',\n \n },\n titlefont: extendFlat({}, textFontAttrs, {\n \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 \n editType: 'calc',\n \n }\n }\n};\n\n},{\"../../components/color/attributes\":594,\"../../lib/extend\":719,\"../../plots/attributes\":773,\"../../plots/domain\":803,\"../../plots/font_attributes\":804,\"../../plots/template_attributes\":854}],1109:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar plots = _dereq_('../../plots/plots');\n\nexports.name = 'pie';\n\nexports.plot = function(gd, traces, transitionOpts, makeOnCompleteCallback) {\n plots.plotBasePlot(exports.name, gd, traces, transitionOpts, makeOnCompleteCallback);\n};\n\nexports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) {\n plots.cleanBasePlot(exports.name, newFullData, newFullLayout, oldFullData, oldFullLayout);\n};\n\n},{\"../../plots/plots\":839}],1110:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar tinycolor = _dereq_('tinycolor2');\n\nvar Color = _dereq_('../../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 if(v < 0) continue;\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 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\n},{\"../../components/color\":595,\"fast-isnumeric\":236,\"tinycolor2\":528}],1111:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar Lib = _dereq_('../../lib');\nvar attributes = _dereq_('./attributes');\nvar handleDomainDefaults = _dereq_('../../plots/domain').defaults;\nvar handleText = _dereq_('../bar/defaults').handleText;\n\nfunction handleLabelsAndValues(labels, values) {\n var hasLabels = Array.isArray(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 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 var lineWidth = coerce('marker.line.width');\n if(lineWidth) coerce('marker.line.color');\n\n coerce('marker.colors');\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', Array.isArray(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 supplyDefaults: supplyDefaults\n};\n\n},{\"../../lib\":728,\"../../plots/domain\":803,\"../bar/defaults\":873,\"./attributes\":1108,\"fast-isnumeric\":236}],1112:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar appendArrayMultiPointValues = _dereq_('../../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\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\n},{\"../../components/fx/helpers\":631}],1113:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nexports.formatPiePercent = function formatPiePercent(v, separators) {\n var vRounded = (v * 100).toPrecision(3);\n if(vRounded.lastIndexOf('.') !== -1) {\n vRounded = vRounded.replace(/[.]?0+$/, '');\n }\n return Lib.numSeparate(vRounded, separators) + '%';\n};\n\nexports.formatPieValue = function formatPieValue(v, separators) {\n var vRounded = v.toPrecision(10);\n if(vRounded.lastIndexOf('.') !== -1) {\n vRounded = vRounded.replace(/[.]?0+$/, '');\n }\n return Lib.numSeparate(vRounded, separators);\n};\n\nexports.getFirstFilled = function getFirstFilled(array, indices) {\n if(!Array.isArray(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(Array.isArray(item)) return exports.getFirstFilled(item, indices);\n else if(item) return item;\n};\n\n},{\"../../lib\":728}],1114:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults').supplyDefaults,\n supplyLayoutDefaults: _dereq_('./layout_defaults'),\n layoutAttributes: _dereq_('./layout_attributes'),\n\n calc: _dereq_('./calc').calc,\n crossTraceCalc: _dereq_('./calc').crossTraceCalc,\n\n plot: _dereq_('./plot').plot,\n style: _dereq_('./style'),\n styleOne: _dereq_('./style_one'),\n\n moduleType: 'trace',\n name: 'pie',\n basePlotModule: _dereq_('./base_plot'),\n categories: ['pie-like', 'pie', 'showLegend'],\n meta: {\n \n }\n};\n\n},{\"./attributes\":1108,\"./base_plot\":1109,\"./calc\":1110,\"./defaults\":1111,\"./layout_attributes\":1115,\"./layout_defaults\":1116,\"./plot\":1117,\"./style\":1118,\"./style_one\":1119}],1115:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n hiddenlabels: {\n valType: 'data_array',\n \n editType: 'calc',\n \n },\n piecolorway: {\n valType: 'colorlist',\n \n editType: 'calc',\n \n },\n extendpiecolors: {\n valType: 'boolean',\n dflt: true,\n \n editType: 'calc',\n \n }\n};\n\n},{}],1116:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nvar layoutAttributes = _dereq_('./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\n},{\"../../lib\":728,\"./layout_attributes\":1115}],1117:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Plots = _dereq_('../../plots/plots');\nvar Fx = _dereq_('../../components/fx');\nvar Color = _dereq_('../../components/color');\nvar Drawing = _dereq_('../../components/drawing');\nvar Lib = _dereq_('../../lib');\nvar svgTextUtils = _dereq_('../../lib/svg_text_utils');\nvar uniformText = _dereq_('../bar/uniform_text');\nvar recordMinTextSize = uniformText.recordMinTextSize;\nvar clearMinTextSize = uniformText.clearMinTextSize;\nvar TEXTPAD = _dereq_('../bar/constants').TEXTPAD;\n\nvar helpers = _dereq_('./helpers');\nvar eventData = _dereq_('./event_data');\nvar isValidTextValue = _dereq_('../../lib').isValidTextValue;\n\nfunction plot(gd, cdModule) {\n var fullLayout = gd._fullLayout;\n var gs = fullLayout._size;\n\n clearMinTextSize('pie', fullLayout);\n\n prerenderTitles(cdModule, gd);\n layoutAreas(cdModule, gs);\n\n var plotGroups = Lib.makeTraceGroups(fullLayout._pielayer, cdModule, 'trace').each(function(cd) {\n var plotGroup = d3.select(this);\n var cd0 = cd[0];\n var trace = cd0.trace;\n\n setCoords(cd);\n\n // TODO: miter might look better but can sometimes cause problems\n // maybe miter with a small-ish stroke-miterlimit?\n plotGroup.attr('stroke-linejoin', 'round');\n\n plotGroup.each(function() {\n var slices = d3.select(this).selectAll('g.slice').data(cd);\n\n slices.enter().append('g')\n .classed('slice', true);\n slices.exit().remove();\n\n var quadrants = [\n [[], []], // y<0: x<0, x>=0\n [[], []] // y>=0: x<0, x>=0\n ];\n var hasOutsideText = false;\n\n slices.each(function(pt, i) {\n if(pt.hidden) {\n d3.select(this).selectAll('path,g').remove();\n return;\n }\n\n // to have consistent event data compared to other traces\n pt.pointNumber = pt.i;\n pt.curveNumber = trace.index;\n\n quadrants[pt.pxmid[1] < 0 ? 0 : 1][pt.pxmid[0] < 0 ? 0 : 1].push(pt);\n\n var cx = cd0.cx;\n var cy = cd0.cy;\n var sliceTop = d3.select(this);\n var slicePath = sliceTop.selectAll('path.surface').data([pt]);\n\n slicePath.enter().append('path')\n .classed('surface', true)\n .style({'pointer-events': 'all'});\n\n sliceTop.call(attachFxHandlers, gd, cd);\n\n if(trace.pull) {\n var pull = +helpers.castOption(trace.pull, pt.pts) || 0;\n if(pull > 0) {\n cx += pull * pt.pxmid[0];\n cy += pull * pt.pxmid[1];\n }\n }\n\n pt.cxFinal = cx;\n pt.cyFinal = cy;\n\n function arc(start, finish, cw, scale) {\n var dx = scale * (finish[0] - start[0]);\n var dy = scale * (finish[1] - start[1]);\n\n return 'a' +\n (scale * cd0.r) + ',' + (scale * cd0.r) + ' 0 ' +\n pt.largeArc + (cw ? ' 1 ' : ' 0 ') + dx + ',' + dy;\n }\n\n var hole = trace.hole;\n if(pt.v === cd0.vTotal) { // 100% fails bcs arc start and end are identical\n var outerCircle = 'M' + (cx + pt.px0[0]) + ',' + (cy + pt.px0[1]) +\n arc(pt.px0, pt.pxmid, true, 1) +\n arc(pt.pxmid, pt.px0, true, 1) + 'Z';\n if(hole) {\n slicePath.attr('d',\n 'M' + (cx + hole * pt.px0[0]) + ',' + (cy + hole * pt.px0[1]) +\n arc(pt.px0, pt.pxmid, false, hole) +\n arc(pt.pxmid, pt.px0, false, hole) +\n 'Z' + outerCircle);\n } else slicePath.attr('d', outerCircle);\n } else {\n var outerArc = arc(pt.px0, pt.px1, true, 1);\n\n if(hole) {\n var rim = 1 - hole;\n slicePath.attr('d',\n 'M' + (cx + hole * pt.px1[0]) + ',' + (cy + hole * pt.px1[1]) +\n arc(pt.px1, pt.px0, false, hole) +\n 'l' + (rim * pt.px0[0]) + ',' + (rim * pt.px0[1]) +\n outerArc +\n 'Z');\n } else {\n slicePath.attr('d',\n 'M' + cx + ',' + cy +\n 'l' + pt.px0[0] + ',' + pt.px0[1] +\n outerArc +\n 'Z');\n }\n }\n\n // add text\n formatSliceLabel(gd, pt, cd0);\n var textPosition = helpers.castOption(trace.textposition, pt.pts);\n var sliceTextGroup = sliceTop.selectAll('g.slicetext')\n .data(pt.text && (textPosition !== 'none') ? [0] : []);\n\n sliceTextGroup.enter().append('g')\n .classed('slicetext', true);\n sliceTextGroup.exit().remove();\n\n sliceTextGroup.each(function() {\n var sliceText = Lib.ensureSingle(d3.select(this), 'text', '', function(s) {\n // prohibit tex interpretation until we can handle\n // tex and regular text together\n s.attr('data-notex', 1);\n });\n\n var font = Lib.ensureUniformFontSize(gd, textPosition === 'outside' ?\n determineOutsideTextFont(trace, pt, fullLayout.font) :\n determineInsideTextFont(trace, pt, fullLayout.font)\n );\n\n sliceText.text(pt.text)\n .attr({\n 'class': 'slicetext',\n transform: '',\n 'text-anchor': 'middle'\n })\n .call(Drawing.font, font)\n .call(svgTextUtils.convertToTspans, gd);\n\n // position the text relative to the slice\n var textBB = Drawing.bBox(sliceText.node());\n var transform;\n\n if(textPosition === 'outside') {\n transform = transformOutsideText(textBB, pt);\n } else {\n transform = transformInsideText(textBB, pt, cd0);\n if(textPosition === 'auto' && transform.scale < 1) {\n var newFont = Lib.ensureUniformFontSize(gd, trace.outsidetextfont);\n\n sliceText.call(Drawing.font, newFont);\n textBB = Drawing.bBox(sliceText.node());\n\n transform = transformOutsideText(textBB, pt);\n }\n }\n\n var textPosAngle = transform.textPosAngle;\n var textXY = textPosAngle === undefined ? pt.pxmid : getCoords(cd0.r, textPosAngle);\n transform.targetX = cx + textXY[0] * transform.rCenter + (transform.x || 0);\n transform.targetY = cy + textXY[1] * transform.rCenter + (transform.y || 0);\n computeTransform(transform, textBB);\n\n // save some stuff to use later ensure no labels overlap\n if(transform.outside) {\n var targetY = transform.targetY;\n pt.yLabelMin = targetY - textBB.height / 2;\n pt.yLabelMid = targetY;\n pt.yLabelMax = targetY + textBB.height / 2;\n pt.labelExtraX = 0;\n pt.labelExtraY = 0;\n hasOutsideText = true;\n }\n\n transform.fontSize = font.size;\n recordMinTextSize(trace.type, transform, fullLayout);\n cd[i].transform = transform;\n\n sliceText.attr('transform', Lib.getTextTransform(transform));\n });\n });\n\n // add the title\n var titleTextGroup = d3.select(this).selectAll('g.titletext')\n .data(trace.title.text ? [0] : []);\n\n titleTextGroup.enter().append('g')\n .classed('titletext', true);\n titleTextGroup.exit().remove();\n\n titleTextGroup.each(function() {\n var titleText = Lib.ensureSingle(d3.select(this), 'text', '', function(s) {\n // prohibit tex interpretation as above\n s.attr('data-notex', 1);\n });\n\n var txt = trace.title.text;\n if(trace._meta) {\n txt = Lib.templateString(txt, trace._meta);\n }\n\n titleText.text(txt)\n .attr({\n 'class': 'titletext',\n transform: '',\n 'text-anchor': 'middle',\n })\n .call(Drawing.font, trace.title.font)\n .call(svgTextUtils.convertToTspans, gd);\n\n var transform;\n\n if(trace.title.position === 'middle center') {\n transform = positionTitleInside(cd0);\n } else {\n transform = positionTitleOutside(cd0, gs);\n }\n\n titleText.attr('transform',\n 'translate(' + transform.x + ',' + transform.y + ')' +\n (transform.scale < 1 ? ('scale(' + transform.scale + ')') : '') +\n 'translate(' + transform.tx + ',' + transform.ty + ')');\n });\n\n // now make sure no labels overlap (at least within one pie)\n if(hasOutsideText) scootLabels(quadrants, trace);\n\n plotTextLines(slices, trace);\n\n if(hasOutsideText && trace.automargin) {\n // TODO if we ever want to improve perf,\n // we could reuse the textBB computed above together\n // with the sliceText transform info\n var traceBbox = Drawing.bBox(plotGroup.node());\n\n var domain = trace.domain;\n var vpw = gs.w * (domain.x[1] - domain.x[0]);\n var vph = gs.h * (domain.y[1] - domain.y[0]);\n var xgap = (0.5 * vpw - cd0.r) / gs.w;\n var ygap = (0.5 * vph - cd0.r) / gs.h;\n\n Plots.autoMargin(gd, 'pie.' + trace.uid + '.automargin', {\n xl: domain.x[0] - xgap,\n xr: domain.x[1] + xgap,\n yb: domain.y[0] - ygap,\n yt: domain.y[1] + ygap,\n l: Math.max(cd0.cx - cd0.r - traceBbox.left, 0),\n r: Math.max(traceBbox.right - (cd0.cx + cd0.r), 0),\n b: Math.max(traceBbox.bottom - (cd0.cy + cd0.r), 0),\n t: Math.max(cd0.cy - cd0.r - traceBbox.top, 0),\n pad: 5\n });\n }\n });\n });\n\n // This is for a bug in Chrome (as of 2015-07-22, and does not affect FF)\n // if insidetextfont and outsidetextfont are different sizes, sometimes the size\n // of an \"em\" gets taken from the wrong element at first so lines are\n // spaced wrong. You just have to tell it to try again later and it gets fixed.\n // I have no idea why we haven't seen this in other contexts. Also, sometimes\n // it gets the initial draw correct but on redraw it gets confused.\n setTimeout(function() {\n plotGroups.selectAll('tspan').each(function() {\n var s = d3.select(this);\n if(s.attr('dy')) s.attr('dy', s.attr('dy'));\n });\n }, 0);\n}\n\n// TODO add support for transition\nfunction plotTextLines(slices, trace) {\n slices.each(function(pt) {\n var sliceTop = d3.select(this);\n\n if(!pt.labelExtraX && !pt.labelExtraY) {\n sliceTop.select('path.textline').remove();\n return;\n }\n\n // first move the text to its new location\n var sliceText = sliceTop.select('g.slicetext text');\n\n pt.transform.targetX += pt.labelExtraX;\n pt.transform.targetY += pt.labelExtraY;\n\n sliceText.attr('transform', Lib.getTextTransform(pt.transform));\n\n // then add a line to the new location\n var lineStartX = pt.cxFinal + pt.pxmid[0];\n var lineStartY = pt.cyFinal + pt.pxmid[1];\n var textLinePath = 'M' + lineStartX + ',' + lineStartY;\n var finalX = (pt.yLabelMax - pt.yLabelMin) * (pt.pxmid[0] < 0 ? -1 : 1) / 4;\n\n if(pt.labelExtraX) {\n var yFromX = pt.labelExtraX * pt.pxmid[1] / pt.pxmid[0];\n var yNet = pt.yLabelMid + pt.labelExtraY - (pt.cyFinal + pt.pxmid[1]);\n\n if(Math.abs(yFromX) > Math.abs(yNet)) {\n textLinePath +=\n 'l' + (yNet * pt.pxmid[0] / pt.pxmid[1]) + ',' + yNet +\n 'H' + (lineStartX + pt.labelExtraX + finalX);\n } else {\n textLinePath += 'l' + pt.labelExtraX + ',' + yFromX +\n 'v' + (yNet - yFromX) +\n 'h' + finalX;\n }\n } else {\n textLinePath +=\n 'V' + (pt.yLabelMid + pt.labelExtraY) +\n 'h' + finalX;\n }\n\n Lib.ensureSingle(sliceTop, 'path', 'textline')\n .call(Color.stroke, trace.outsidetextfont.color)\n .attr({\n 'stroke-width': Math.min(2, trace.outsidetextfont.size / 8),\n d: textLinePath,\n fill: 'none'\n });\n });\n}\n\nfunction attachFxHandlers(sliceTop, gd, cd) {\n var cd0 = cd[0];\n var trace = cd0.trace;\n var cx = cd0.cx;\n var cy = cd0.cy;\n\n // hover state vars\n // have we drawn a hover label, so it should be cleared later\n if(!('_hasHoverLabel' in trace)) trace._hasHoverLabel = false;\n // have we emitted a hover event, so later an unhover event should be emitted\n // note that click events do not depend on this - you can still get them\n // with hovermode: false or if you were earlier dragging, then clicked\n // in the same slice that you moused up in\n if(!('_hasHoverEvent' in trace)) trace._hasHoverEvent = false;\n\n sliceTop.on('mouseover', function(pt) {\n // in case fullLayout or fullData has changed without a replot\n var fullLayout2 = gd._fullLayout;\n var trace2 = gd._fullData[trace.index];\n\n if(gd._dragging || fullLayout2.hovermode === false) return;\n\n var hoverinfo = trace2.hoverinfo;\n if(Array.isArray(hoverinfo)) {\n // super hacky: we need to pull out the *first* hoverinfo from\n // pt.pts, then put it back into an array in a dummy trace\n // and call castHoverinfo on that.\n // TODO: do we want to have Fx.castHoverinfo somehow handle this?\n // it already takes an array for index, for 2D, so this seems tricky.\n hoverinfo = Fx.castHoverinfo({\n hoverinfo: [helpers.castOption(hoverinfo, pt.pts)],\n _module: trace._module\n }, fullLayout2, 0);\n }\n\n if(hoverinfo === 'all') hoverinfo = 'label+text+value+percent+name';\n\n // in case we dragged over the pie from another subplot,\n // or if hover is turned off\n if(trace2.hovertemplate || (hoverinfo !== 'none' && hoverinfo !== 'skip' && hoverinfo)) {\n var rInscribed = pt.rInscribed || 0;\n var hoverCenterX = cx + pt.pxmid[0] * (1 - rInscribed);\n var hoverCenterY = cy + pt.pxmid[1] * (1 - rInscribed);\n var separators = fullLayout2.separators;\n var text = [];\n\n if(hoverinfo && hoverinfo.indexOf('label') !== -1) text.push(pt.label);\n pt.text = helpers.castOption(trace2.hovertext || trace2.text, pt.pts);\n if(hoverinfo && hoverinfo.indexOf('text') !== -1) {\n var tx = pt.text;\n if(Lib.isValidTextValue(tx)) text.push(tx);\n }\n pt.value = pt.v;\n pt.valueLabel = helpers.formatPieValue(pt.v, separators);\n if(hoverinfo && hoverinfo.indexOf('value') !== -1) text.push(pt.valueLabel);\n pt.percent = pt.v / cd0.vTotal;\n pt.percentLabel = helpers.formatPiePercent(pt.percent, separators);\n if(hoverinfo && hoverinfo.indexOf('percent') !== -1) text.push(pt.percentLabel);\n\n var hoverLabel = trace2.hoverlabel;\n var hoverFont = hoverLabel.font;\n\n Fx.loneHover({\n trace: trace,\n x0: hoverCenterX - rInscribed * cd0.r,\n x1: hoverCenterX + rInscribed * cd0.r,\n y: hoverCenterY,\n text: text.join('
'),\n name: (trace2.hovertemplate || hoverinfo.indexOf('name') !== -1) ? trace2.name : undefined,\n idealAlign: pt.pxmid[0] < 0 ? 'left' : 'right',\n color: helpers.castOption(hoverLabel.bgcolor, pt.pts) || pt.color,\n borderColor: helpers.castOption(hoverLabel.bordercolor, pt.pts),\n fontFamily: helpers.castOption(hoverFont.family, pt.pts),\n fontSize: helpers.castOption(hoverFont.size, pt.pts),\n fontColor: helpers.castOption(hoverFont.color, pt.pts),\n nameLength: helpers.castOption(hoverLabel.namelength, pt.pts),\n textAlign: helpers.castOption(hoverLabel.align, pt.pts),\n hovertemplate: helpers.castOption(trace2.hovertemplate, pt.pts),\n hovertemplateLabels: pt,\n eventData: [eventData(pt, trace2)]\n }, {\n container: fullLayout2._hoverlayer.node(),\n outerContainer: fullLayout2._paper.node(),\n gd: gd\n });\n\n trace._hasHoverLabel = true;\n }\n\n trace._hasHoverEvent = true;\n gd.emit('plotly_hover', {\n points: [eventData(pt, trace2)],\n event: d3.event\n });\n });\n\n sliceTop.on('mouseout', function(evt) {\n var fullLayout2 = gd._fullLayout;\n var trace2 = gd._fullData[trace.index];\n var pt = d3.select(this).datum();\n\n if(trace._hasHoverEvent) {\n evt.originalEvent = d3.event;\n gd.emit('plotly_unhover', {\n points: [eventData(pt, trace2)],\n event: d3.event\n });\n trace._hasHoverEvent = false;\n }\n\n if(trace._hasHoverLabel) {\n Fx.loneUnhover(fullLayout2._hoverlayer.node());\n trace._hasHoverLabel = false;\n }\n });\n\n sliceTop.on('click', function(pt) {\n // TODO: this does not support right-click. If we want to support it, we\n // would likely need to change pie to use dragElement instead of straight\n // mapbox event binding. Or perhaps better, make a simple wrapper with the\n // right mousedown, mousemove, and mouseup handlers just for a left/right click\n // mapbox would use this too.\n var fullLayout2 = gd._fullLayout;\n var trace2 = gd._fullData[trace.index];\n\n if(gd._dragging || fullLayout2.hovermode === false) return;\n\n gd._hoverdata = [eventData(pt, trace2)];\n Fx.click(gd, d3.event);\n });\n}\n\nfunction determineOutsideTextFont(trace, pt, layoutFont) {\n var color =\n helpers.castOption(trace.outsidetextfont.color, pt.pts) ||\n helpers.castOption(trace.textfont.color, pt.pts) ||\n layoutFont.color;\n\n var family =\n helpers.castOption(trace.outsidetextfont.family, pt.pts) ||\n helpers.castOption(trace.textfont.family, pt.pts) ||\n layoutFont.family;\n\n var size =\n helpers.castOption(trace.outsidetextfont.size, pt.pts) ||\n helpers.castOption(trace.textfont.size, pt.pts) ||\n layoutFont.size;\n\n return {\n color: color,\n family: family,\n size: size\n };\n}\n\nfunction determineInsideTextFont(trace, pt, layoutFont) {\n var customColor = helpers.castOption(trace.insidetextfont.color, pt.pts);\n if(!customColor && trace._input.textfont) {\n // Why not simply using trace.textfont? Because if not set, it\n // defaults to layout.font which has a default color. But if\n // textfont.color and insidetextfont.color don't supply a value,\n // a contrasting color shall be used.\n customColor = helpers.castOption(trace._input.textfont.color, pt.pts);\n }\n\n var family =\n helpers.castOption(trace.insidetextfont.family, pt.pts) ||\n helpers.castOption(trace.textfont.family, pt.pts) ||\n layoutFont.family;\n\n var size =\n helpers.castOption(trace.insidetextfont.size, pt.pts) ||\n helpers.castOption(trace.textfont.size, pt.pts) ||\n layoutFont.size;\n\n return {\n color: customColor || Color.contrast(pt.color),\n family: family,\n size: size\n };\n}\n\nfunction prerenderTitles(cdModule, gd) {\n var cd0, trace;\n\n // Determine the width and height of the title for each pie.\n for(var i = 0; i < cdModule.length; i++) {\n cd0 = cdModule[i][0];\n trace = cd0.trace;\n\n if(trace.title.text) {\n var txt = trace.title.text;\n if(trace._meta) {\n txt = Lib.templateString(txt, trace._meta);\n }\n\n var dummyTitle = Drawing.tester.append('text')\n .attr('data-notex', 1)\n .text(txt)\n .call(Drawing.font, trace.title.font)\n .call(svgTextUtils.convertToTspans, gd);\n var bBox = Drawing.bBox(dummyTitle.node(), true);\n cd0.titleBox = {\n width: bBox.width,\n height: bBox.height,\n };\n dummyTitle.remove();\n }\n }\n}\n\nfunction transformInsideText(textBB, pt, cd0) {\n var r = cd0.r || pt.rpx1;\n var rInscribed = pt.rInscribed;\n\n var isEmpty = pt.startangle === pt.stopangle;\n if(isEmpty) {\n return {\n rCenter: 1 - rInscribed,\n scale: 0,\n rotate: 0,\n textPosAngle: 0\n };\n }\n\n var ring = pt.ring;\n var isCircle = (ring === 1) && (Math.abs(pt.startangle - pt.stopangle) === Math.PI * 2);\n\n var halfAngle = pt.halfangle;\n var midAngle = pt.midangle;\n\n var orientation = cd0.trace.insidetextorientation;\n var isHorizontal = orientation === 'horizontal';\n var isTangential = orientation === 'tangential';\n var isRadial = orientation === 'radial';\n var isAuto = orientation === 'auto';\n\n var allTransforms = [];\n var newT;\n\n if(!isAuto) {\n // max size if text is placed (horizontally) at the top or bottom of the arc\n\n var considerCrossing = function(angle, key) {\n if(isCrossing(pt, angle)) {\n var dStart = Math.abs(angle - pt.startangle);\n var dStop = Math.abs(angle - pt.stopangle);\n\n var closestEdge = dStart < dStop ? dStart : dStop;\n\n if(key === 'tan') {\n newT = calcTanTransform(textBB, r, ring, closestEdge, 0);\n } else { // case of 'rad'\n newT = calcRadTransform(textBB, r, ring, closestEdge, Math.PI / 2);\n }\n newT.textPosAngle = angle;\n\n allTransforms.push(newT);\n }\n };\n\n // to cover all cases with trace.rotation added\n var i;\n if(isHorizontal || isTangential) {\n // top\n for(i = 4; i >= -4; i -= 2) considerCrossing(Math.PI * i, 'tan');\n // bottom\n for(i = 4; i >= -4; i -= 2) considerCrossing(Math.PI * (i + 1), 'tan');\n }\n if(isHorizontal || isRadial) {\n // left\n for(i = 4; i >= -4; i -= 2) considerCrossing(Math.PI * (i + 1.5), 'rad');\n // right\n for(i = 4; i >= -4; i -= 2) considerCrossing(Math.PI * (i + 0.5), 'rad');\n }\n }\n\n if(isCircle || isAuto || isHorizontal) {\n // max size text can be inserted inside without rotating it\n // this inscribes the text rectangle in a circle, which is then inscribed\n // in the slice, so it will be an underestimate, which some day we may want\n // to improve so this case can get more use\n var textDiameter = Math.sqrt(textBB.width * textBB.width + textBB.height * textBB.height);\n\n newT = {\n scale: rInscribed * r * 2 / textDiameter,\n\n // and the center position and rotation in this case\n rCenter: 1 - rInscribed,\n rotate: 0\n };\n\n newT.textPosAngle = (pt.startangle + pt.stopangle) / 2;\n if(newT.scale >= 1) return newT;\n\n allTransforms.push(newT);\n }\n\n if(isAuto || isRadial) {\n newT = calcRadTransform(textBB, r, ring, halfAngle, midAngle);\n newT.textPosAngle = (pt.startangle + pt.stopangle) / 2;\n allTransforms.push(newT);\n }\n\n if(isAuto || isTangential) {\n newT = calcTanTransform(textBB, r, ring, halfAngle, midAngle);\n newT.textPosAngle = (pt.startangle + pt.stopangle) / 2;\n allTransforms.push(newT);\n }\n\n var id = 0;\n var maxScale = 0;\n for(var k = 0; k < allTransforms.length; k++) {\n var s = allTransforms[k].scale;\n if(maxScale < s) {\n maxScale = s;\n id = k;\n }\n\n if(!isAuto && maxScale >= 1) {\n // respect test order for non-auto options\n break;\n }\n }\n return allTransforms[id];\n}\n\nfunction isCrossing(pt, angle) {\n var start = pt.startangle;\n var stop = pt.stopangle;\n return (\n (start > angle && angle > stop) ||\n (start < angle && angle < stop)\n );\n}\n\nfunction calcRadTransform(textBB, r, ring, halfAngle, midAngle) {\n r = Math.max(0, r - 2 * TEXTPAD);\n\n // max size if text is rotated radially\n var a = textBB.width / textBB.height;\n var s = calcMaxHalfSize(a, halfAngle, r, ring);\n return {\n scale: s * 2 / textBB.height,\n rCenter: calcRCenter(a, s / r),\n rotate: calcRotate(midAngle)\n };\n}\n\nfunction calcTanTransform(textBB, r, ring, halfAngle, midAngle) {\n r = Math.max(0, r - 2 * TEXTPAD);\n\n // max size if text is rotated tangentially\n var a = textBB.height / textBB.width;\n var s = calcMaxHalfSize(a, halfAngle, r, ring);\n return {\n scale: s * 2 / textBB.width,\n rCenter: calcRCenter(a, s / r),\n rotate: calcRotate(midAngle + Math.PI / 2)\n };\n}\n\nfunction calcRCenter(a, b) {\n return Math.cos(b) - a * b;\n}\n\nfunction calcRotate(t) {\n return (180 / Math.PI * t + 720) % 180 - 90;\n}\n\nfunction calcMaxHalfSize(a, halfAngle, r, ring) {\n var q = a + 1 / (2 * Math.tan(halfAngle));\n return r * Math.min(\n 1 / (Math.sqrt(q * q + 0.5) + q),\n ring / (Math.sqrt(a * a + ring / 2) + a)\n );\n}\n\nfunction getInscribedRadiusFraction(pt, cd0) {\n if(pt.v === cd0.vTotal && !cd0.trace.hole) return 1;// special case of 100% with no hole\n\n return Math.min(1 / (1 + 1 / Math.sin(pt.halfangle)), pt.ring / 2);\n}\n\nfunction transformOutsideText(textBB, pt) {\n var x = pt.pxmid[0];\n var y = pt.pxmid[1];\n var dx = textBB.width / 2;\n var dy = textBB.height / 2;\n\n if(x < 0) dx *= -1;\n if(y < 0) dy *= -1;\n\n return {\n scale: 1,\n rCenter: 1,\n rotate: 0,\n x: dx + Math.abs(dy) * (dx > 0 ? 1 : -1) / 2,\n y: dy / (1 + x * x / (y * y)),\n outside: true\n };\n}\n\nfunction positionTitleInside(cd0) {\n var textDiameter =\n Math.sqrt(cd0.titleBox.width * cd0.titleBox.width + cd0.titleBox.height * cd0.titleBox.height);\n return {\n x: cd0.cx,\n y: cd0.cy,\n scale: cd0.trace.hole * cd0.r * 2 / textDiameter,\n tx: 0,\n ty: - cd0.titleBox.height / 2 + cd0.trace.title.font.size\n };\n}\n\nfunction positionTitleOutside(cd0, plotSize) {\n var scaleX = 1;\n var scaleY = 1;\n var maxPull;\n\n var trace = cd0.trace;\n // position of the baseline point of the text box in the plot, before scaling.\n // we anchored the text in the middle, so the baseline is on the bottom middle\n // of the first line of text.\n var topMiddle = {\n x: cd0.cx,\n y: cd0.cy\n };\n // relative translation of the text box after scaling\n var translate = {\n tx: 0,\n ty: 0\n };\n\n // we reason below as if the baseline is the top middle point of the text box.\n // so we must add the font size to approximate the y-coord. of the top.\n // note that this correction must happen after scaling.\n translate.ty += trace.title.font.size;\n maxPull = getMaxPull(trace);\n\n if(trace.title.position.indexOf('top') !== -1) {\n topMiddle.y -= (1 + maxPull) * cd0.r;\n translate.ty -= cd0.titleBox.height;\n } else if(trace.title.position.indexOf('bottom') !== -1) {\n topMiddle.y += (1 + maxPull) * cd0.r;\n }\n\n var rx = applyAspectRatio(cd0.r, cd0.trace.aspectratio);\n\n var maxWidth = plotSize.w * (trace.domain.x[1] - trace.domain.x[0]) / 2;\n if(trace.title.position.indexOf('left') !== -1) {\n // we start the text at the left edge of the pie\n maxWidth = maxWidth + rx;\n topMiddle.x -= (1 + maxPull) * rx;\n translate.tx += cd0.titleBox.width / 2;\n } else if(trace.title.position.indexOf('center') !== -1) {\n maxWidth *= 2;\n } else if(trace.title.position.indexOf('right') !== -1) {\n maxWidth = maxWidth + rx;\n topMiddle.x += (1 + maxPull) * rx;\n translate.tx -= cd0.titleBox.width / 2;\n }\n scaleX = maxWidth / cd0.titleBox.width;\n scaleY = getTitleSpace(cd0, plotSize) / cd0.titleBox.height;\n return {\n x: topMiddle.x,\n y: topMiddle.y,\n scale: Math.min(scaleX, scaleY),\n tx: translate.tx,\n ty: translate.ty\n };\n}\n\nfunction applyAspectRatio(x, aspectratio) {\n return x / ((aspectratio === undefined) ? 1 : aspectratio);\n}\n\nfunction getTitleSpace(cd0, plotSize) {\n var trace = cd0.trace;\n var pieBoxHeight = plotSize.h * (trace.domain.y[1] - trace.domain.y[0]);\n // use at most half of the plot for the title\n return Math.min(cd0.titleBox.height, pieBoxHeight / 2);\n}\n\nfunction getMaxPull(trace) {\n var maxPull = trace.pull;\n if(!maxPull) return 0;\n\n var j;\n if(Array.isArray(maxPull)) {\n maxPull = 0;\n for(j = 0; j < trace.pull.length; j++) {\n if(trace.pull[j] > maxPull) maxPull = trace.pull[j];\n }\n }\n return maxPull;\n}\n\nfunction scootLabels(quadrants, trace) {\n var xHalf, yHalf, equatorFirst, farthestX, farthestY,\n xDiffSign, yDiffSign, thisQuad, oppositeQuad,\n wholeSide, i, thisQuadOutside, firstOppositeOutsidePt;\n\n function topFirst(a, b) { return a.pxmid[1] - b.pxmid[1]; }\n function bottomFirst(a, b) { return b.pxmid[1] - a.pxmid[1]; }\n\n function scootOneLabel(thisPt, prevPt) {\n if(!prevPt) prevPt = {};\n\n var prevOuterY = prevPt.labelExtraY + (yHalf ? prevPt.yLabelMax : prevPt.yLabelMin);\n var thisInnerY = yHalf ? thisPt.yLabelMin : thisPt.yLabelMax;\n var thisOuterY = yHalf ? thisPt.yLabelMax : thisPt.yLabelMin;\n var thisSliceOuterY = thisPt.cyFinal + farthestY(thisPt.px0[1], thisPt.px1[1]);\n var newExtraY = prevOuterY - thisInnerY;\n\n var xBuffer, i, otherPt, otherOuterY, otherOuterX, newExtraX;\n\n // make sure this label doesn't overlap other labels\n // this *only* has us move these labels vertically\n if(newExtraY * yDiffSign > 0) thisPt.labelExtraY = newExtraY;\n\n // make sure this label doesn't overlap any slices\n if(!Array.isArray(trace.pull)) return; // this can only happen with array pulls\n\n for(i = 0; i < wholeSide.length; i++) {\n otherPt = wholeSide[i];\n\n // overlap can only happen if the other point is pulled more than this one\n if(otherPt === thisPt || (\n (helpers.castOption(trace.pull, thisPt.pts) || 0) >=\n (helpers.castOption(trace.pull, otherPt.pts) || 0))\n ) {\n continue;\n }\n\n if((thisPt.pxmid[1] - otherPt.pxmid[1]) * yDiffSign > 0) {\n // closer to the equator - by construction all of these happen first\n // move the text vertically to get away from these slices\n otherOuterY = otherPt.cyFinal + farthestY(otherPt.px0[1], otherPt.px1[1]);\n newExtraY = otherOuterY - thisInnerY - thisPt.labelExtraY;\n\n if(newExtraY * yDiffSign > 0) thisPt.labelExtraY += newExtraY;\n } else if((thisOuterY + thisPt.labelExtraY - thisSliceOuterY) * yDiffSign > 0) {\n // farther from the equator - happens after we've done all the\n // vertical moving we're going to do\n // move horizontally to get away from these more polar slices\n\n // if we're moving horz. based on a slice that's several slices away from this one\n // then we need some extra space for the lines to labels between them\n xBuffer = 3 * xDiffSign * Math.abs(i - wholeSide.indexOf(thisPt));\n\n otherOuterX = otherPt.cxFinal + farthestX(otherPt.px0[0], otherPt.px1[0]);\n newExtraX = otherOuterX + xBuffer - (thisPt.cxFinal + thisPt.pxmid[0]) - thisPt.labelExtraX;\n\n if(newExtraX * xDiffSign > 0) thisPt.labelExtraX += newExtraX;\n }\n }\n }\n\n for(yHalf = 0; yHalf < 2; yHalf++) {\n equatorFirst = yHalf ? topFirst : bottomFirst;\n farthestY = yHalf ? Math.max : Math.min;\n yDiffSign = yHalf ? 1 : -1;\n\n for(xHalf = 0; xHalf < 2; xHalf++) {\n farthestX = xHalf ? Math.max : Math.min;\n xDiffSign = xHalf ? 1 : -1;\n\n // first sort the array\n // note this is a copy of cd, so cd itself doesn't get sorted\n // but we can still modify points in place.\n thisQuad = quadrants[yHalf][xHalf];\n thisQuad.sort(equatorFirst);\n\n oppositeQuad = quadrants[1 - yHalf][xHalf];\n wholeSide = oppositeQuad.concat(thisQuad);\n\n thisQuadOutside = [];\n for(i = 0; i < thisQuad.length; i++) {\n if(thisQuad[i].yLabelMid !== undefined) thisQuadOutside.push(thisQuad[i]);\n }\n\n firstOppositeOutsidePt = false;\n for(i = 0; yHalf && i < oppositeQuad.length; i++) {\n if(oppositeQuad[i].yLabelMid !== undefined) {\n firstOppositeOutsidePt = oppositeQuad[i];\n break;\n }\n }\n\n // each needs to avoid the previous\n for(i = 0; i < thisQuadOutside.length; i++) {\n var prevPt = i && thisQuadOutside[i - 1];\n // bottom half needs to avoid the first label of the top half\n // top half we still need to call scootOneLabel on the first slice\n // so we can avoid other slices, but we don't pass a prevPt\n if(firstOppositeOutsidePt && !i) prevPt = firstOppositeOutsidePt;\n scootOneLabel(thisQuadOutside[i], prevPt);\n }\n }\n }\n}\n\nfunction layoutAreas(cdModule, plotSize) {\n var scaleGroups = [];\n\n // figure out the center and maximum radius\n for(var i = 0; i < cdModule.length; i++) {\n var cd0 = cdModule[i][0];\n var trace = cd0.trace;\n\n var domain = trace.domain;\n var width = plotSize.w * (domain.x[1] - domain.x[0]);\n var height = plotSize.h * (domain.y[1] - domain.y[0]);\n // leave some space for the title, if it will be displayed outside\n if(trace.title.text && trace.title.position !== 'middle center') {\n height -= getTitleSpace(cd0, plotSize);\n }\n\n var rx = width / 2;\n var ry = height / 2;\n if(trace.type === 'funnelarea' && !trace.scalegroup) {\n ry /= trace.aspectratio;\n }\n\n cd0.r = Math.min(rx, ry) / (1 + getMaxPull(trace));\n\n cd0.cx = plotSize.l + plotSize.w * (trace.domain.x[1] + trace.domain.x[0]) / 2;\n cd0.cy = plotSize.t + plotSize.h * (1 - trace.domain.y[0]) - height / 2;\n if(trace.title.text && trace.title.position.indexOf('bottom') !== -1) {\n cd0.cy -= getTitleSpace(cd0, plotSize);\n }\n\n if(trace.scalegroup && scaleGroups.indexOf(trace.scalegroup) === -1) {\n scaleGroups.push(trace.scalegroup);\n }\n }\n\n groupScale(cdModule, scaleGroups);\n}\n\nfunction groupScale(cdModule, scaleGroups) {\n var cd0, i, trace;\n\n // scale those that are grouped\n for(var k = 0; k < scaleGroups.length; k++) {\n var min = Infinity;\n var g = scaleGroups[k];\n\n for(i = 0; i < cdModule.length; i++) {\n cd0 = cdModule[i][0];\n trace = cd0.trace;\n\n if(trace.scalegroup === g) {\n var area;\n if(trace.type === 'pie') {\n area = cd0.r * cd0.r;\n } else if(trace.type === 'funnelarea') {\n var rx, ry;\n\n if(trace.aspectratio > 1) {\n rx = cd0.r;\n ry = rx / trace.aspectratio;\n } else {\n ry = cd0.r;\n rx = ry * trace.aspectratio;\n }\n\n rx *= (1 + trace.baseratio) / 2;\n\n area = rx * ry;\n }\n\n min = Math.min(min, area / cd0.vTotal);\n }\n }\n\n for(i = 0; i < cdModule.length; i++) {\n cd0 = cdModule[i][0];\n trace = cd0.trace;\n if(trace.scalegroup === g) {\n var v = min * cd0.vTotal;\n if(trace.type === 'funnelarea') {\n v /= (1 + trace.baseratio) / 2;\n v /= trace.aspectratio;\n }\n\n cd0.r = Math.sqrt(v);\n }\n }\n }\n}\n\nfunction setCoords(cd) {\n var cd0 = cd[0];\n var r = cd0.r;\n var trace = cd0.trace;\n var currentAngle = trace.rotation * Math.PI / 180;\n var angleFactor = 2 * Math.PI / cd0.vTotal;\n var firstPt = 'px0';\n var lastPt = 'px1';\n\n var i, cdi, currentCoords;\n\n if(trace.direction === 'counterclockwise') {\n for(i = 0; i < cd.length; i++) {\n if(!cd[i].hidden) break; // find the first non-hidden slice\n }\n if(i === cd.length) return; // all slices hidden\n\n currentAngle += angleFactor * cd[i].v;\n angleFactor *= -1;\n firstPt = 'px1';\n lastPt = 'px0';\n }\n\n currentCoords = getCoords(r, currentAngle);\n\n for(i = 0; i < cd.length; i++) {\n cdi = cd[i];\n if(cdi.hidden) continue;\n\n cdi[firstPt] = currentCoords;\n\n cdi.startangle = currentAngle;\n currentAngle += angleFactor * cdi.v / 2;\n cdi.pxmid = getCoords(r, currentAngle);\n cdi.midangle = currentAngle;\n currentAngle += angleFactor * cdi.v / 2;\n currentCoords = getCoords(r, currentAngle);\n cdi.stopangle = currentAngle;\n\n cdi[lastPt] = currentCoords;\n\n cdi.largeArc = (cdi.v > cd0.vTotal / 2) ? 1 : 0;\n\n cdi.halfangle = Math.PI * Math.min(cdi.v / cd0.vTotal, 0.5);\n cdi.ring = 1 - trace.hole;\n cdi.rInscribed = getInscribedRadiusFraction(cdi, cd0);\n }\n}\n\nfunction getCoords(r, angle) {\n return [r * Math.sin(angle), -r * Math.cos(angle)];\n}\n\nfunction formatSliceLabel(gd, pt, cd0) {\n var fullLayout = gd._fullLayout;\n var trace = cd0.trace;\n // look for textemplate\n var texttemplate = trace.texttemplate;\n\n // now insert text\n var textinfo = trace.textinfo;\n if(!texttemplate && textinfo && textinfo !== 'none') {\n var parts = textinfo.split('+');\n var hasFlag = function(flag) { return parts.indexOf(flag) !== -1; };\n var hasLabel = hasFlag('label');\n var hasText = hasFlag('text');\n var hasValue = hasFlag('value');\n var hasPercent = hasFlag('percent');\n\n var separators = fullLayout.separators;\n var text;\n\n text = hasLabel ? [pt.label] : [];\n if(hasText) {\n var tx = helpers.getFirstFilled(trace.text, pt.pts);\n if(isValidTextValue(tx)) text.push(tx);\n }\n if(hasValue) text.push(helpers.formatPieValue(pt.v, separators));\n if(hasPercent) text.push(helpers.formatPiePercent(pt.v / cd0.vTotal, separators));\n pt.text = text.join('
');\n }\n\n function makeTemplateVariables(pt) {\n return {\n label: pt.label,\n value: pt.v,\n valueLabel: helpers.formatPieValue(pt.v, fullLayout.separators),\n percent: pt.v / cd0.vTotal,\n percentLabel: helpers.formatPiePercent(pt.v / cd0.vTotal, fullLayout.separators),\n color: pt.color,\n text: pt.text,\n customdata: Lib.castOption(trace, pt.i, 'customdata')\n };\n }\n\n if(texttemplate) {\n var txt = Lib.castOption(trace, pt.i, 'texttemplate');\n if(!txt) {\n pt.text = '';\n } else {\n var obj = makeTemplateVariables(pt);\n var ptTx = helpers.getFirstFilled(trace.text, pt.pts);\n if(isValidTextValue(ptTx) || ptTx === '') obj.text = ptTx;\n pt.text = Lib.texttemplateString(txt, obj, gd._fullLayout._d3locale, obj, trace._meta || {});\n }\n }\n}\n\nfunction computeTransform(\n transform, // inout\n textBB // in\n) {\n var a = transform.rotate * Math.PI / 180;\n var cosA = Math.cos(a);\n var sinA = Math.sin(a);\n var midX = (textBB.left + textBB.right) / 2;\n var midY = (textBB.top + textBB.bottom) / 2;\n transform.textX = midX * cosA - midY * sinA;\n transform.textY = midX * sinA + midY * cosA;\n transform.noCenter = true;\n}\n\nmodule.exports = {\n plot: plot,\n formatSliceLabel: formatSliceLabel,\n transformInsideText: transformInsideText,\n determineInsideTextFont: determineInsideTextFont,\n positionTitleOutside: positionTitleOutside,\n prerenderTitles: prerenderTitles,\n layoutAreas: layoutAreas,\n attachFxHandlers: attachFxHandlers,\n computeTransform: computeTransform\n};\n\n},{\"../../components/color\":595,\"../../components/drawing\":617,\"../../components/fx\":635,\"../../lib\":728,\"../../lib/svg_text_utils\":752,\"../../plots/plots\":839,\"../bar/constants\":871,\"../bar/uniform_text\":885,\"./event_data\":1112,\"./helpers\":1113,\"d3\":164}],1118:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar styleOne = _dereq_('./style_one');\nvar resizeText = _dereq_('../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);\n });\n });\n};\n\n},{\"../bar/uniform_text\":885,\"./style_one\":1119,\"d3\":164}],1119:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Color = _dereq_('../../components/color');\nvar castOption = _dereq_('./helpers').castOption;\n\nmodule.exports = function styleOne(s, pt, trace) {\n var line = trace.marker.line;\n var lineColor = castOption(line.color, pt.pts) || Color.defaultLine;\n var lineWidth = castOption(line.width, pt.pts) || 0;\n\n s.style('stroke-width', lineWidth)\n .call(Color.fill, pt.color)\n .call(Color.stroke, lineColor);\n};\n\n},{\"../../components/color\":595,\"./helpers\":1113}],1120:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar scatterglAttrs = _dereq_('../scatter/attributes');\n\nmodule.exports = {\n x: scatterglAttrs.x,\n y: scatterglAttrs.y,\n xy: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n indices: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n xbounds: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n ybounds: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n text: scatterglAttrs.text,\n marker: {\n color: {\n valType: 'color',\n arrayOk: false,\n \n editType: 'calc',\n \n },\n opacity: {\n valType: 'number',\n min: 0,\n max: 1,\n dflt: 1,\n arrayOk: false,\n \n editType: 'calc',\n \n },\n blend: {\n valType: 'boolean',\n dflt: null,\n \n editType: 'calc',\n \n },\n sizemin: {\n valType: 'number',\n min: 0.1,\n max: 2,\n dflt: 0.5,\n \n editType: 'calc',\n \n },\n sizemax: {\n valType: 'number',\n min: 0.1,\n dflt: 20,\n \n editType: 'calc',\n \n },\n border: {\n color: {\n valType: 'color',\n arrayOk: false,\n \n editType: 'calc',\n \n },\n arearatio: {\n valType: 'number',\n min: 0,\n max: 1,\n dflt: 0,\n \n editType: 'calc',\n \n },\n editType: 'calc'\n },\n editType: 'calc'\n },\n transforms: undefined\n};\n\n},{\"../scatter/attributes\":1134}],1121:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar createPointCloudRenderer = _dereq_('gl-pointcloud2d');\n\nvar str2RGBArray = _dereq_('../../lib/str2rgbarray');\nvar findExtremes = _dereq_('../../plots/cartesian/autorange').findExtremes;\nvar getTraceColor = _dereq_('../scatter/get_trace_color');\n\nfunction Pointcloud(scene, uid) {\n this.scene = scene;\n this.uid = uid;\n this.type = 'pointcloud';\n\n this.pickXData = [];\n this.pickYData = [];\n this.xData = [];\n this.yData = [];\n this.textLabels = [];\n this.color = 'rgb(0, 0, 0)';\n this.name = '';\n this.hoverinfo = 'all';\n\n this.idToIndex = new Int32Array(0);\n this.bounds = [0, 0, 0, 0];\n\n this.pointcloudOptions = {\n positions: new Float32Array(0),\n idToIndex: this.idToIndex,\n sizemin: 0.5,\n sizemax: 12,\n color: [0, 0, 0, 1],\n areaRatio: 1,\n borderColor: [0, 0, 0, 1]\n };\n this.pointcloud = createPointCloudRenderer(scene.glplot, this.pointcloudOptions);\n this.pointcloud._trace = this; // scene2d requires this prop\n}\n\nvar proto = Pointcloud.prototype;\n\nproto.handlePick = function(pickResult) {\n var index = this.idToIndex[pickResult.pointId];\n\n // prefer the readout from XY, if present\n return {\n trace: this,\n dataCoord: pickResult.dataCoord,\n traceCoord: this.pickXYData ?\n [this.pickXYData[index * 2], this.pickXYData[index * 2 + 1]] :\n [this.pickXData[index], this.pickYData[index]],\n textLabel: Array.isArray(this.textLabels) ?\n this.textLabels[index] :\n this.textLabels,\n color: this.color,\n name: this.name,\n pointIndex: index,\n hoverinfo: this.hoverinfo\n };\n};\n\nproto.update = function(options) {\n this.index = options.index;\n this.textLabels = options.text;\n this.name = options.name;\n this.hoverinfo = options.hoverinfo;\n this.bounds = [Infinity, Infinity, -Infinity, -Infinity];\n\n this.updateFast(options);\n\n this.color = getTraceColor(options, {});\n};\n\nproto.updateFast = function(options) {\n var x = this.xData = this.pickXData = options.x;\n var y = this.yData = this.pickYData = options.y;\n var xy = this.pickXYData = options.xy;\n\n var userBounds = options.xbounds && options.ybounds;\n var index = options.indices;\n\n var len;\n var idToIndex;\n var positions;\n var bounds = this.bounds;\n\n var xx, yy, i;\n\n if(xy) {\n positions = xy;\n\n // dividing xy.length by 2 and truncating to integer if xy.length was not even\n len = xy.length >>> 1;\n\n if(userBounds) {\n bounds[0] = options.xbounds[0];\n bounds[2] = options.xbounds[1];\n bounds[1] = options.ybounds[0];\n bounds[3] = options.ybounds[1];\n } else {\n for(i = 0; i < len; i++) {\n xx = positions[i * 2];\n yy = positions[i * 2 + 1];\n\n if(xx < bounds[0]) bounds[0] = xx;\n if(xx > bounds[2]) bounds[2] = xx;\n if(yy < bounds[1]) bounds[1] = yy;\n if(yy > bounds[3]) bounds[3] = yy;\n }\n }\n\n if(index) {\n idToIndex = index;\n } else {\n idToIndex = new Int32Array(len);\n\n for(i = 0; i < len; i++) {\n idToIndex[i] = i;\n }\n }\n } else {\n len = x.length;\n\n positions = new Float32Array(2 * len);\n idToIndex = new Int32Array(len);\n\n for(i = 0; i < len; i++) {\n xx = x[i];\n yy = y[i];\n\n idToIndex[i] = i;\n\n positions[i * 2] = xx;\n positions[i * 2 + 1] = yy;\n\n if(xx < bounds[0]) bounds[0] = xx;\n if(xx > bounds[2]) bounds[2] = xx;\n if(yy < bounds[1]) bounds[1] = yy;\n if(yy > bounds[3]) bounds[3] = yy;\n }\n }\n\n this.idToIndex = idToIndex;\n this.pointcloudOptions.idToIndex = idToIndex;\n\n this.pointcloudOptions.positions = positions;\n\n var markerColor = str2RGBArray(options.marker.color);\n var borderColor = str2RGBArray(options.marker.border.color);\n var opacity = options.opacity * options.marker.opacity;\n\n markerColor[3] *= opacity;\n this.pointcloudOptions.color = markerColor;\n\n // detect blending from the number of points, if undefined\n // because large data with blending hits performance\n var blend = options.marker.blend;\n if(blend === null) {\n var maxPoints = 100;\n blend = x.length < maxPoints || y.length < maxPoints;\n }\n this.pointcloudOptions.blend = blend;\n\n borderColor[3] *= opacity;\n this.pointcloudOptions.borderColor = borderColor;\n\n var markerSizeMin = options.marker.sizemin;\n var markerSizeMax = Math.max(options.marker.sizemax, options.marker.sizemin);\n this.pointcloudOptions.sizeMin = markerSizeMin;\n this.pointcloudOptions.sizeMax = markerSizeMax;\n this.pointcloudOptions.areaRatio = options.marker.border.arearatio;\n\n this.pointcloud.update(this.pointcloudOptions);\n\n // add item for autorange routine\n var xa = this.scene.xaxis;\n var ya = this.scene.yaxis;\n var pad = markerSizeMax / 2 || 0.5;\n options._extremes[xa._id] = findExtremes(xa, [bounds[0], bounds[2]], {ppad: pad});\n options._extremes[ya._id] = findExtremes(ya, [bounds[1], bounds[3]], {ppad: pad});\n};\n\nproto.dispose = function() {\n this.pointcloud.dispose();\n};\n\nfunction createPointcloud(scene, data) {\n var plot = new Pointcloud(scene, data.uid);\n plot.update(data);\n return plot;\n}\n\nmodule.exports = createPointcloud;\n\n},{\"../../lib/str2rgbarray\":751,\"../../plots/cartesian/autorange\":775,\"../scatter/get_trace_color\":1144,\"gl-pointcloud2d\":298}],1122:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nvar attributes = _dereq_('./attributes');\n\nmodule.exports = function supplyDefaults(traceIn, traceOut, defaultColor) {\n function coerce(attr, dflt) {\n return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);\n }\n\n coerce('x');\n coerce('y');\n\n coerce('xbounds');\n coerce('ybounds');\n\n if(traceIn.xy && traceIn.xy instanceof Float32Array) {\n traceOut.xy = traceIn.xy;\n }\n\n if(traceIn.indices && traceIn.indices instanceof Int32Array) {\n traceOut.indices = traceIn.indices;\n }\n\n coerce('text');\n coerce('marker.color', defaultColor);\n coerce('marker.opacity');\n coerce('marker.blend');\n coerce('marker.sizemin');\n coerce('marker.sizemax');\n coerce('marker.border.color', defaultColor);\n coerce('marker.border.arearatio');\n\n // disable 1D transforms - that would defeat the purpose of this trace type, performance!\n traceOut._length = null;\n};\n\n},{\"../../lib\":728,\"./attributes\":1120}],1123:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults'),\n\n // reuse the Scatter3D 'dummy' calc step so that legends know what to do\n calc: _dereq_('../scatter3d/calc'),\n plot: _dereq_('./convert'),\n\n moduleType: 'trace',\n name: 'pointcloud',\n basePlotModule: _dereq_('../../plots/gl2d'),\n categories: ['gl', 'gl2d', 'showLegend'],\n meta: {\n \n }\n};\n\n},{\"../../plots/gl2d\":816,\"../scatter3d/calc\":1162,\"./attributes\":1120,\"./convert\":1121,\"./defaults\":1122}],1124:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar fontAttrs = _dereq_('../../plots/font_attributes');\nvar baseAttrs = _dereq_('../../plots/attributes');\nvar colorAttrs = _dereq_('../../components/color/attributes');\nvar fxAttrs = _dereq_('../../components/fx/attributes');\nvar domainAttrs = _dereq_('../../plots/domain').attributes;\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar colorAttributes = _dereq_('../../components/colorscale/attributes');\nvar templatedArray = _dereq_('../../plot_api/plot_template').templatedArray;\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\nvar overrideAll = _dereq_('../../plot_api/edit_types').overrideAll;\n\nvar FORMAT_LINK = _dereq_('../../constants/docs').FORMAT_LINK;\n\nvar attrs = module.exports = overrideAll({\n hoverinfo: extendFlat({}, baseAttrs.hoverinfo, {\n flags: [],\n arrayOk: false,\n \n }),\n hoverlabel: fxAttrs.hoverlabel,\n domain: domainAttrs({name: 'sankey', trace: true}),\n\n orientation: {\n valType: 'enumerated',\n values: ['v', 'h'],\n dflt: 'h',\n \n \n },\n\n valueformat: {\n valType: 'string',\n dflt: '.3s',\n \n \n },\n\n valuesuffix: {\n valType: 'string',\n dflt: '',\n \n \n },\n\n arrangement: {\n valType: 'enumerated',\n values: ['snap', 'perpendicular', 'freeform', 'fixed'],\n dflt: 'snap',\n \n \n },\n\n textfont: fontAttrs({\n \n }),\n\n // Remove top-level customdata\n customdata: undefined,\n\n node: {\n label: {\n valType: 'data_array',\n dflt: [],\n \n \n },\n groups: {\n valType: 'info_array',\n impliedEdits: {'x': [], 'y': []},\n dimensions: 2,\n freeLength: true,\n dflt: [],\n items: {valType: 'number', editType: 'calc'},\n \n \n },\n x: {\n valType: 'data_array',\n dflt: [],\n \n \n },\n y: {\n valType: 'data_array',\n dflt: [],\n \n \n },\n color: {\n valType: 'color',\n \n arrayOk: true,\n \n },\n customdata: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n line: {\n color: {\n valType: 'color',\n \n dflt: colorAttrs.defaultLine,\n arrayOk: true,\n \n },\n width: {\n valType: 'number',\n \n min: 0,\n dflt: 0.5,\n arrayOk: true,\n \n }\n },\n pad: {\n valType: 'number',\n arrayOk: false,\n min: 0,\n dflt: 20,\n \n \n },\n thickness: {\n valType: 'number',\n arrayOk: false,\n min: 1,\n dflt: 20,\n \n \n },\n hoverinfo: {\n valType: 'enumerated',\n values: ['all', 'none', 'skip'],\n dflt: 'all',\n \n \n },\n hoverlabel: fxAttrs.hoverlabel, // needs editType override,\n hovertemplate: hovertemplateAttrs({}, {\n \n keys: ['value', 'label']\n }),\n \n },\n\n link: {\n label: {\n valType: 'data_array',\n dflt: [],\n \n \n },\n color: {\n valType: 'color',\n \n arrayOk: true,\n \n },\n customdata: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n line: {\n color: {\n valType: 'color',\n \n dflt: colorAttrs.defaultLine,\n arrayOk: true,\n \n },\n width: {\n valType: 'number',\n \n min: 0,\n dflt: 0,\n arrayOk: true,\n \n }\n },\n source: {\n valType: 'data_array',\n \n dflt: [],\n \n },\n target: {\n valType: 'data_array',\n \n dflt: [],\n \n },\n value: {\n valType: 'data_array',\n dflt: [],\n \n \n },\n hoverinfo: {\n valType: 'enumerated',\n values: ['all', 'none', 'skip'],\n dflt: 'all',\n \n \n },\n hoverlabel: fxAttrs.hoverlabel, // needs editType override,\n hovertemplate: hovertemplateAttrs({}, {\n \n keys: ['value', 'label']\n }),\n colorscales: templatedArray('concentrationscales', {\n editType: 'calc',\n label: {\n valType: 'string',\n \n editType: 'calc',\n \n dflt: ''\n },\n cmax: {\n valType: 'number',\n \n editType: 'calc',\n dflt: 1,\n \n },\n cmin: {\n valType: 'number',\n \n editType: 'calc',\n dflt: 0,\n \n },\n colorscale: extendFlat(colorAttributes().colorscale, {dflt: [[0, 'white'], [1, 'black']]})\n }),\n \n \n }\n}, 'calc', 'nested');\nattrs.transforms = undefined;\n\n},{\"../../components/color/attributes\":594,\"../../components/colorscale/attributes\":602,\"../../components/fx/attributes\":626,\"../../constants/docs\":699,\"../../lib/extend\":719,\"../../plot_api/edit_types\":759,\"../../plot_api/plot_template\":766,\"../../plots/attributes\":773,\"../../plots/domain\":803,\"../../plots/font_attributes\":804,\"../../plots/template_attributes\":854}],1125:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar overrideAll = _dereq_('../../plot_api/edit_types').overrideAll;\nvar getModuleCalcData = _dereq_('../../plots/get_data').getModuleCalcData;\nvar plot = _dereq_('./plot');\nvar fxAttrs = _dereq_('../../components/fx/layout_attributes');\n\nvar setCursor = _dereq_('../../lib/setcursor');\nvar dragElement = _dereq_('../../components/dragelement');\nvar prepSelect = _dereq_('../../plots/cartesian/select').prepSelect;\nvar Lib = _dereq_('../../lib');\nvar Registry = _dereq_('../../registry');\n\nvar SANKEY = 'sankey';\n\nexports.name = SANKEY;\n\nexports.baseLayoutAttrOverrides = overrideAll({\n hoverlabel: fxAttrs.hoverlabel\n}, 'plot', 'nested');\n\nexports.plot = function(gd) {\n var calcData = getModuleCalcData(gd.calcdata, SANKEY)[0];\n plot(gd, calcData);\n exports.updateFx(gd);\n};\n\nexports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) {\n var hadPlot = (oldFullLayout._has && oldFullLayout._has(SANKEY));\n var hasPlot = (newFullLayout._has && newFullLayout._has(SANKEY));\n\n if(hadPlot && !hasPlot) {\n oldFullLayout._paperdiv.selectAll('.sankey').remove();\n oldFullLayout._paperdiv.selectAll('.bgsankey').remove();\n }\n};\n\nexports.updateFx = function(gd) {\n for(var i = 0; i < gd._fullData.length; i++) {\n subplotUpdateFx(gd, i);\n }\n};\n\nfunction subplotUpdateFx(gd, index) {\n var trace = gd._fullData[index];\n var fullLayout = gd._fullLayout;\n\n var dragMode = fullLayout.dragmode;\n var cursor = fullLayout.dragmode === 'pan' ? 'move' : 'crosshair';\n var bgRect = trace._bgRect;\n\n if(dragMode === 'pan' || dragMode === 'zoom') return;\n\n setCursor(bgRect, cursor);\n\n var xaxis = {\n _id: 'x',\n c2p: Lib.identity,\n _offset: trace._sankey.translateX,\n _length: trace._sankey.width\n };\n var yaxis = {\n _id: 'y',\n c2p: Lib.identity,\n _offset: trace._sankey.translateY,\n _length: trace._sankey.height\n };\n\n // Note: dragOptions is needed to be declared for all dragmodes because\n // it's the object that holds persistent selection state.\n var dragOptions = {\n gd: gd,\n element: bgRect.node(),\n plotinfo: {\n id: index,\n xaxis: xaxis,\n yaxis: yaxis,\n fillRangeItems: Lib.noop\n },\n subplot: index,\n // create mock x/y axes for hover routine\n xaxes: [xaxis],\n yaxes: [yaxis],\n doneFnCompleted: function(selection) {\n var traceNow = gd._fullData[index];\n var newGroups;\n var oldGroups = traceNow.node.groups.slice();\n var newGroup = [];\n\n function findNode(pt) {\n var nodes = traceNow._sankey.graph.nodes;\n for(var i = 0; i < nodes.length; i++) {\n if(nodes[i].pointNumber === pt) return nodes[i];\n }\n }\n\n for(var j = 0; j < selection.length; j++) {\n var node = findNode(selection[j].pointNumber);\n if(!node) continue;\n\n // If the node represents a group\n if(node.group) {\n // Add all its children to the current selection\n for(var k = 0; k < node.childrenNodes.length; k++) {\n newGroup.push(node.childrenNodes[k].pointNumber);\n }\n // Flag group for removal from existing list of groups\n oldGroups[node.pointNumber - traceNow.node._count] = false;\n } else {\n newGroup.push(node.pointNumber);\n }\n }\n\n newGroups = oldGroups\n .filter(Boolean)\n .concat([newGroup]);\n\n Registry.call('_guiRestyle', gd, {\n 'node.groups': [ newGroups ]\n }, index);\n }\n };\n\n dragOptions.prepFn = function(e, startX, startY) {\n prepSelect(e, startX, startY, dragOptions, dragMode);\n };\n\n dragElement.init(dragOptions);\n}\n\n},{\"../../components/dragelement\":614,\"../../components/fx/layout_attributes\":636,\"../../lib\":728,\"../../lib/setcursor\":748,\"../../plot_api/edit_types\":759,\"../../plots/cartesian/select\":795,\"../../plots/get_data\":813,\"../../registry\":859,\"./plot\":1130}],1126:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar tarjan = _dereq_('strongly-connected-components');\nvar Lib = _dereq_('../../lib');\nvar wrap = _dereq_('../../lib/gup').wrap;\n\nvar isArrayOrTypedArray = Lib.isArrayOrTypedArray;\nvar isIndex = Lib.isIndex;\nvar Colorscale = _dereq_('../../components/colorscale');\n\nfunction convertToD3Sankey(trace) {\n var nodeSpec = trace.node;\n var linkSpec = trace.link;\n\n var links = [];\n var hasLinkColorArray = isArrayOrTypedArray(linkSpec.color);\n var hasLinkCustomdataArray = isArrayOrTypedArray(linkSpec.customdata);\n var linkedNodes = {};\n\n var components = {};\n var componentCount = linkSpec.colorscales.length;\n var i;\n for(i = 0; i < componentCount; i++) {\n var cscale = linkSpec.colorscales[i];\n var specs = Colorscale.extractScale(cscale, {cLetter: 'c'});\n var scale = Colorscale.makeColorScaleFunc(specs);\n components[cscale.label] = scale;\n }\n\n var maxNodeId = 0;\n for(i = 0; i < linkSpec.value.length; i++) {\n if(linkSpec.source[i] > maxNodeId) maxNodeId = linkSpec.source[i];\n if(linkSpec.target[i] > maxNodeId) maxNodeId = linkSpec.target[i];\n }\n var nodeCount = maxNodeId + 1;\n trace.node._count = nodeCount;\n\n // Group nodes\n var j;\n var groups = trace.node.groups;\n var groupLookup = {};\n for(i = 0; i < groups.length; i++) {\n var group = groups[i];\n // Build a lookup table to quickly find in which group a node is\n for(j = 0; j < group.length; j++) {\n var nodeIndex = group[j];\n var groupIndex = nodeCount + i;\n if(groupLookup.hasOwnProperty(nodeIndex)) {\n Lib.warn('Node ' + nodeIndex + ' is already part of a group.');\n } else {\n groupLookup[nodeIndex] = groupIndex;\n }\n }\n }\n\n // Process links\n var groupedLinks = {\n source: [],\n target: []\n };\n for(i = 0; i < linkSpec.value.length; i++) {\n var val = linkSpec.value[i];\n // remove negative values, but keep zeros with special treatment\n var source = linkSpec.source[i];\n var target = linkSpec.target[i];\n if(!(val > 0 && isIndex(source, nodeCount) && isIndex(target, nodeCount))) {\n continue;\n }\n\n // Remove links that are within the same group\n if(groupLookup.hasOwnProperty(source) && groupLookup.hasOwnProperty(target) && groupLookup[source] === groupLookup[target]) {\n continue;\n }\n\n // if link targets a node in the group, relink target to that group\n if(groupLookup.hasOwnProperty(target)) {\n target = groupLookup[target];\n }\n\n // if link originates from a node in a group, relink source to that group\n if(groupLookup.hasOwnProperty(source)) {\n source = groupLookup[source];\n }\n\n source = +source;\n target = +target;\n linkedNodes[source] = linkedNodes[target] = true;\n\n var label = '';\n if(linkSpec.label && linkSpec.label[i]) label = linkSpec.label[i];\n\n var concentrationscale = null;\n if(label && components.hasOwnProperty(label)) concentrationscale = components[label];\n\n links.push({\n pointNumber: i,\n label: label,\n color: hasLinkColorArray ? linkSpec.color[i] : linkSpec.color,\n customdata: hasLinkCustomdataArray ? linkSpec.customdata[i] : linkSpec.customdata,\n concentrationscale: concentrationscale,\n source: source,\n target: target,\n value: +val\n });\n\n groupedLinks.source.push(source);\n groupedLinks.target.push(target);\n }\n\n // Process nodes\n var totalCount = nodeCount + groups.length;\n var hasNodeColorArray = isArrayOrTypedArray(nodeSpec.color);\n var hasNodeCustomdataArray = isArrayOrTypedArray(nodeSpec.customdata);\n var nodes = [];\n for(i = 0; i < totalCount; i++) {\n if(!linkedNodes[i]) continue;\n var l = nodeSpec.label[i];\n\n nodes.push({\n group: (i > nodeCount - 1),\n childrenNodes: [],\n pointNumber: i,\n label: l,\n color: hasNodeColorArray ? nodeSpec.color[i] : nodeSpec.color,\n customdata: hasNodeCustomdataArray ? nodeSpec.customdata[i] : nodeSpec.customdata\n });\n }\n\n // Check if we have circularity on the resulting graph\n var circular = false;\n if(circularityPresent(totalCount, groupedLinks.source, groupedLinks.target)) {\n circular = true;\n }\n\n return {\n circular: circular,\n links: links,\n nodes: nodes,\n\n // Data structure for groups\n groups: groups,\n groupLookup: groupLookup\n };\n}\n\nfunction circularityPresent(nodeLen, sources, targets) {\n var nodes = Lib.init2dArray(nodeLen, 0);\n\n for(var i = 0; i < Math.min(sources.length, targets.length); i++) {\n if(Lib.isIndex(sources[i], nodeLen) && Lib.isIndex(targets[i], nodeLen)) {\n if(sources[i] === targets[i]) {\n return true; // self-link which is also a scc of one\n }\n nodes[sources[i]].push(targets[i]);\n }\n }\n\n var scc = tarjan(nodes);\n\n // Tarján's strongly connected components algorithm coded by Mikola Lysenko\n // returns at least one non-singular component if there's circularity in the graph\n return scc.components.some(function(c) {\n return c.length > 1;\n });\n}\n\nmodule.exports = function calc(gd, trace) {\n var result = convertToD3Sankey(trace);\n\n return wrap({\n circular: result.circular,\n _nodes: result.nodes,\n _links: result.links,\n\n // Data structure for grouping\n _groups: result.groups,\n _groupLookup: result.groupLookup,\n });\n};\n\n},{\"../../components/colorscale\":607,\"../../lib\":728,\"../../lib/gup\":726,\"strongly-connected-components\":521}],1127:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n nodeTextOffsetHorizontal: 4,\n nodeTextOffsetVertical: 3,\n nodePadAcross: 10,\n sankeyIterations: 50,\n forceIterations: 5,\n forceTicksPerFrame: 10,\n duration: 500,\n ease: 'linear',\n cn: {\n sankey: 'sankey',\n sankeyLinks: 'sankey-links',\n sankeyLink: 'sankey-link',\n sankeyNodeSet: 'sankey-node-set',\n sankeyNode: 'sankey-node',\n nodeRect: 'node-rect',\n nodeCapture: 'node-capture',\n nodeCentered: 'node-entered',\n nodeLabelGuide: 'node-label-guide',\n nodeLabel: 'node-label',\n nodeLabelTextPath: 'node-label-text-path'\n }\n};\n\n},{}],1128:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar attributes = _dereq_('./attributes');\nvar Color = _dereq_('../../components/color');\nvar tinycolor = _dereq_('tinycolor2');\nvar handleDomainDefaults = _dereq_('../../plots/domain').defaults;\nvar handleHoverLabelDefaults = _dereq_('../../components/fx/hoverlabel_defaults');\nvar Template = _dereq_('../../plot_api/plot_template');\nvar handleArrayContainerDefaults = _dereq_('../../plots/array_container_defaults');\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 hoverlabelDefault = Lib.extendDeep(layout.hoverlabel, traceIn.hoverlabel);\n\n // node attributes\n var nodeIn = traceIn.node;\n var nodeOut = Template.newContainer(traceOut, 'node');\n\n function coerceNode(attr, dflt) {\n return Lib.coerce(nodeIn, nodeOut, attributes.node, attr, dflt);\n }\n coerceNode('label');\n coerceNode('groups');\n coerceNode('x');\n coerceNode('y');\n coerceNode('pad');\n coerceNode('thickness');\n coerceNode('line.color');\n coerceNode('line.width');\n coerceNode('hoverinfo', traceIn.hoverinfo);\n handleHoverLabelDefaults(nodeIn, nodeOut, coerceNode, hoverlabelDefault);\n coerceNode('hovertemplate');\n\n var colors = layout.colorway;\n\n var defaultNodePalette = function(i) {return colors[i % colors.length];};\n\n coerceNode('color', nodeOut.label.map(function(d, i) {\n return Color.addOpacity(defaultNodePalette(i), 0.8);\n }));\n coerceNode('customdata');\n\n // link attributes\n var linkIn = traceIn.link || {};\n var linkOut = Template.newContainer(traceOut, 'link');\n\n function coerceLink(attr, dflt) {\n return Lib.coerce(linkIn, linkOut, attributes.link, attr, dflt);\n }\n coerceLink('label');\n coerceLink('source');\n coerceLink('target');\n coerceLink('value');\n coerceLink('line.color');\n coerceLink('line.width');\n coerceLink('hoverinfo', traceIn.hoverinfo);\n handleHoverLabelDefaults(linkIn, linkOut, coerceLink, hoverlabelDefault);\n coerceLink('hovertemplate');\n\n var defaultLinkColor = tinycolor(layout.paper_bgcolor).getLuminance() < 0.333 ?\n 'rgba(255, 255, 255, 0.6)' :\n 'rgba(0, 0, 0, 0.2)';\n\n coerceLink('color', Lib.repeat(defaultLinkColor, linkOut.value.length));\n coerceLink('customdata');\n\n handleArrayContainerDefaults(linkIn, linkOut, {\n name: 'colorscales',\n handleItemDefaults: concentrationscalesDefaults\n });\n\n handleDomainDefaults(traceOut, layout, coerce);\n\n coerce('orientation');\n coerce('valueformat');\n coerce('valuesuffix');\n\n var dfltArrangement;\n if(nodeOut.x.length && nodeOut.y.length) {\n dfltArrangement = 'freeform';\n }\n coerce('arrangement', dfltArrangement);\n\n Lib.coerceFont(coerce, 'textfont', Lib.extendFlat({}, layout.font));\n\n // disable 1D transforms - arrays here are 1D but their lengths/meanings\n // don't match, between nodes and links\n traceOut._length = null;\n};\n\nfunction concentrationscalesDefaults(In, Out) {\n function coerce(attr, dflt) {\n return Lib.coerce(In, Out, attributes.link.colorscales, attr, dflt);\n }\n\n coerce('label');\n coerce('cmin');\n coerce('cmax');\n coerce('colorscale');\n}\n\n},{\"../../components/color\":595,\"../../components/fx/hoverlabel_defaults\":633,\"../../lib\":728,\"../../plot_api/plot_template\":766,\"../../plots/array_container_defaults\":772,\"../../plots/domain\":803,\"./attributes\":1124,\"tinycolor2\":528}],1129:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults'),\n calc: _dereq_('./calc'),\n plot: _dereq_('./plot'),\n\n moduleType: 'trace',\n name: 'sankey',\n basePlotModule: _dereq_('./base_plot'),\n selectPoints: _dereq_('./select.js'),\n categories: ['noOpacity'],\n meta: {\n \n }\n};\n\n},{\"./attributes\":1124,\"./base_plot\":1125,\"./calc\":1126,\"./defaults\":1128,\"./plot\":1130,\"./select.js\":1132}],1130:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar render = _dereq_('./render');\nvar Fx = _dereq_('../../components/fx');\nvar Color = _dereq_('../../components/color');\nvar Lib = _dereq_('../../lib');\nvar cn = _dereq_('./constants').cn;\n\nvar _ = Lib._;\n\nfunction renderableValuePresent(d) {return d !== '';}\n\nfunction ownTrace(selection, d) {\n return selection.filter(function(s) {return s.key === d.traceId;});\n}\n\nfunction makeTranslucent(element, alpha) {\n d3.select(element)\n .select('path')\n .style('fill-opacity', alpha);\n d3.select(element)\n .select('rect')\n .style('fill-opacity', alpha);\n}\n\nfunction makeTextContrasty(element) {\n d3.select(element)\n .select('text.name')\n .style('fill', 'black');\n}\n\nfunction relatedLinks(d) {\n return function(l) {\n return d.node.sourceLinks.indexOf(l.link) !== -1 || d.node.targetLinks.indexOf(l.link) !== -1;\n };\n}\n\nfunction relatedNodes(l) {\n return function(d) {\n return d.node.sourceLinks.indexOf(l.link) !== -1 || d.node.targetLinks.indexOf(l.link) !== -1;\n };\n}\n\nfunction nodeHoveredStyle(sankeyNode, d, sankey) {\n if(d && sankey) {\n ownTrace(sankey, d)\n .selectAll('.' + cn.sankeyLink)\n .filter(relatedLinks(d))\n .call(linkHoveredStyle.bind(0, d, sankey, false));\n }\n}\n\nfunction nodeNonHoveredStyle(sankeyNode, d, sankey) {\n if(d && sankey) {\n ownTrace(sankey, d)\n .selectAll('.' + cn.sankeyLink)\n .filter(relatedLinks(d))\n .call(linkNonHoveredStyle.bind(0, d, sankey, false));\n }\n}\n\nfunction linkHoveredStyle(d, sankey, visitNodes, sankeyLink) {\n var label = sankeyLink.datum().link.label;\n\n sankeyLink.style('fill-opacity', function(l) {\n if(!l.link.concentrationscale) {\n return 0.4;\n }\n });\n\n if(label) {\n ownTrace(sankey, d)\n .selectAll('.' + cn.sankeyLink)\n .filter(function(l) {return l.link.label === label;})\n .style('fill-opacity', function(l) {\n if(!l.link.concentrationscale) {\n return 0.4;\n }\n });\n }\n\n if(visitNodes) {\n ownTrace(sankey, d)\n .selectAll('.' + cn.sankeyNode)\n .filter(relatedNodes(d))\n .call(nodeHoveredStyle);\n }\n}\n\nfunction linkNonHoveredStyle(d, sankey, visitNodes, sankeyLink) {\n var label = sankeyLink.datum().link.label;\n\n sankeyLink.style('fill-opacity', function(d) {return d.tinyColorAlpha;});\n if(label) {\n ownTrace(sankey, d)\n .selectAll('.' + cn.sankeyLink)\n .filter(function(l) {return l.link.label === label;})\n .style('fill-opacity', function(d) {return d.tinyColorAlpha;});\n }\n\n if(visitNodes) {\n ownTrace(sankey, d)\n .selectAll(cn.sankeyNode)\n .filter(relatedNodes(d))\n .call(nodeNonHoveredStyle);\n }\n}\n\n// does not support array values for now\nfunction castHoverOption(trace, attr) {\n var labelOpts = trace.hoverlabel || {};\n var val = Lib.nestedProperty(labelOpts, attr).get();\n return Array.isArray(val) ? false : val;\n}\n\nmodule.exports = function plot(gd, calcData) {\n var fullLayout = gd._fullLayout;\n var svg = fullLayout._paper;\n var size = fullLayout._size;\n\n // stash initial view\n for(var i = 0; i < gd._fullData.length; i++) {\n if(!gd._fullData[i].visible) continue;\n if(gd._fullData[i].type !== cn.sankey) continue;\n if(!gd._fullData[i]._viewInitial) {\n var node = gd._fullData[i].node;\n gd._fullData[i]._viewInitial = {\n node: {\n groups: node.groups.slice(),\n x: node.x.slice(),\n y: node.y.slice()\n }\n };\n }\n }\n\n var linkSelect = function(element, d) {\n var evt = d.link;\n evt.originalEvent = d3.event;\n gd._hoverdata = [evt];\n Fx.click(gd, { target: true });\n };\n\n var linkHover = function(element, d, sankey) {\n if(gd._fullLayout.hovermode === false) return;\n d3.select(element).call(linkHoveredStyle.bind(0, d, sankey, true));\n if(d.link.trace.link.hoverinfo !== 'skip') {\n d.link.fullData = d.link.trace;\n gd.emit('plotly_hover', {\n event: d3.event,\n points: [d.link]\n });\n }\n };\n\n var sourceLabel = _(gd, 'source:') + ' ';\n var targetLabel = _(gd, 'target:') + ' ';\n var concentrationLabel = _(gd, 'concentration:') + ' ';\n var incomingLabel = _(gd, 'incoming flow count:') + ' ';\n var outgoingLabel = _(gd, 'outgoing flow count:') + ' ';\n\n var linkHoverFollow = function(element, d) {\n if(gd._fullLayout.hovermode === false) return;\n var obj = d.link.trace.link;\n if(obj.hoverinfo === 'none' || obj.hoverinfo === 'skip') return;\n\n var hoverItems = [];\n\n function hoverCenterPosition(link) {\n var hoverCenterX, hoverCenterY;\n if(link.circular) {\n hoverCenterX = (link.circularPathData.leftInnerExtent + link.circularPathData.rightInnerExtent) / 2;\n hoverCenterY = link.circularPathData.verticalFullExtent;\n } else {\n hoverCenterX = (link.source.x1 + link.target.x0) / 2;\n hoverCenterY = (link.y0 + link.y1) / 2;\n }\n var center = [hoverCenterX, hoverCenterY];\n if(link.trace.orientation === 'v') center.reverse();\n center[0] += d.parent.translateX;\n center[1] += d.parent.translateY;\n return center;\n }\n\n // For each related links, create a hoverItem\n var anchorIndex = 0;\n for(var i = 0; i < d.flow.links.length; i++) {\n var link = d.flow.links[i];\n if(gd._fullLayout.hovermode === 'closest' && d.link.pointNumber !== link.pointNumber) continue;\n if(d.link.pointNumber === link.pointNumber) anchorIndex = i;\n link.fullData = link.trace;\n obj = d.link.trace.link;\n var hoverCenter = hoverCenterPosition(link);\n var hovertemplateLabels = {valueLabel: d3.format(d.valueFormat)(link.value) + d.valueSuffix};\n\n hoverItems.push({\n x: hoverCenter[0],\n y: hoverCenter[1],\n name: hovertemplateLabels.valueLabel,\n text: [\n link.label || '',\n sourceLabel + link.source.label,\n targetLabel + link.target.label,\n link.concentrationscale ? concentrationLabel + d3.format('%0.2f')(link.flow.labelConcentration) : ''\n ].filter(renderableValuePresent).join('
'),\n color: castHoverOption(obj, 'bgcolor') || Color.addOpacity(link.color, 1),\n borderColor: castHoverOption(obj, 'bordercolor'),\n fontFamily: castHoverOption(obj, 'font.family'),\n fontSize: castHoverOption(obj, 'font.size'),\n fontColor: castHoverOption(obj, 'font.color'),\n nameLength: castHoverOption(obj, 'namelength'),\n textAlign: castHoverOption(obj, 'align'),\n idealAlign: d3.event.x < hoverCenter[0] ? 'right' : 'left',\n\n hovertemplate: obj.hovertemplate,\n hovertemplateLabels: hovertemplateLabels,\n eventData: [link]\n });\n }\n\n var tooltips = Fx.loneHover(hoverItems, {\n container: fullLayout._hoverlayer.node(),\n outerContainer: fullLayout._paper.node(),\n gd: gd,\n anchorIndex: anchorIndex\n });\n\n tooltips.each(function() {\n var tooltip = this;\n if(!d.link.concentrationscale) {\n makeTranslucent(tooltip, 0.65);\n }\n makeTextContrasty(tooltip);\n });\n };\n\n var linkUnhover = function(element, d, sankey) {\n if(gd._fullLayout.hovermode === false) return;\n d3.select(element).call(linkNonHoveredStyle.bind(0, d, sankey, true));\n if(d.link.trace.link.hoverinfo !== 'skip') {\n d.link.fullData = d.link.trace;\n gd.emit('plotly_unhover', {\n event: d3.event,\n points: [d.link]\n });\n }\n\n Fx.loneUnhover(fullLayout._hoverlayer.node());\n };\n\n var nodeSelect = function(element, d, sankey) {\n var evt = d.node;\n evt.originalEvent = d3.event;\n gd._hoverdata = [evt];\n d3.select(element).call(nodeNonHoveredStyle, d, sankey);\n Fx.click(gd, { target: true });\n };\n\n var nodeHover = function(element, d, sankey) {\n if(gd._fullLayout.hovermode === false) return;\n d3.select(element).call(nodeHoveredStyle, d, sankey);\n if(d.node.trace.node.hoverinfo !== 'skip') {\n d.node.fullData = d.node.trace;\n gd.emit('plotly_hover', {\n event: d3.event,\n points: [d.node]\n });\n }\n };\n\n var nodeHoverFollow = function(element, d) {\n if(gd._fullLayout.hovermode === false) return;\n\n var obj = d.node.trace.node;\n if(obj.hoverinfo === 'none' || obj.hoverinfo === 'skip') return;\n var nodeRect = d3.select(element).select('.' + cn.nodeRect);\n var rootBBox = gd._fullLayout._paperdiv.node().getBoundingClientRect();\n var boundingBox = nodeRect.node().getBoundingClientRect();\n var hoverCenterX0 = boundingBox.left - 2 - rootBBox.left;\n var hoverCenterX1 = boundingBox.right + 2 - rootBBox.left;\n var hoverCenterY = boundingBox.top + boundingBox.height / 4 - rootBBox.top;\n\n var hovertemplateLabels = {valueLabel: d3.format(d.valueFormat)(d.node.value) + d.valueSuffix};\n d.node.fullData = d.node.trace;\n\n var tooltip = Fx.loneHover({\n x0: hoverCenterX0,\n x1: hoverCenterX1,\n y: hoverCenterY,\n name: d3.format(d.valueFormat)(d.node.value) + d.valueSuffix,\n text: [\n d.node.label,\n incomingLabel + d.node.targetLinks.length,\n outgoingLabel + d.node.sourceLinks.length\n ].filter(renderableValuePresent).join('
'),\n color: castHoverOption(obj, 'bgcolor') || d.tinyColorHue,\n borderColor: castHoverOption(obj, 'bordercolor'),\n fontFamily: castHoverOption(obj, 'font.family'),\n fontSize: castHoverOption(obj, 'font.size'),\n fontColor: castHoverOption(obj, 'font.color'),\n nameLength: castHoverOption(obj, 'namelength'),\n textAlign: castHoverOption(obj, 'align'),\n idealAlign: 'left',\n\n hovertemplate: obj.hovertemplate,\n hovertemplateLabels: hovertemplateLabels,\n eventData: [d.node]\n }, {\n container: fullLayout._hoverlayer.node(),\n outerContainer: fullLayout._paper.node(),\n gd: gd\n });\n\n makeTranslucent(tooltip, 0.85);\n makeTextContrasty(tooltip);\n };\n\n var nodeUnhover = function(element, d, sankey) {\n if(gd._fullLayout.hovermode === false) return;\n d3.select(element).call(nodeNonHoveredStyle, d, sankey);\n if(d.node.trace.node.hoverinfo !== 'skip') {\n d.node.fullData = d.node.trace;\n gd.emit('plotly_unhover', {\n event: d3.event,\n points: [d.node]\n });\n }\n\n Fx.loneUnhover(fullLayout._hoverlayer.node());\n };\n\n render(\n gd,\n svg,\n calcData,\n {\n width: size.w,\n height: size.h,\n margin: {\n t: size.t,\n r: size.r,\n b: size.b,\n l: size.l\n }\n },\n {\n linkEvents: {\n hover: linkHover,\n follow: linkHoverFollow,\n unhover: linkUnhover,\n select: linkSelect\n },\n nodeEvents: {\n hover: nodeHover,\n follow: nodeHoverFollow,\n unhover: nodeUnhover,\n select: nodeSelect\n }\n }\n );\n};\n\n},{\"../../components/color\":595,\"../../components/fx\":635,\"../../lib\":728,\"./constants\":1127,\"./render\":1131,\"d3\":164}],1131:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar c = _dereq_('./constants');\nvar d3 = _dereq_('d3');\nvar tinycolor = _dereq_('tinycolor2');\nvar Color = _dereq_('../../components/color');\nvar Drawing = _dereq_('../../components/drawing');\nvar d3Sankey = _dereq_('@plotly/d3-sankey');\nvar d3SankeyCircular = _dereq_('@plotly/d3-sankey-circular');\nvar d3Force = _dereq_('d3-force');\nvar Lib = _dereq_('../../lib');\nvar gup = _dereq_('../../lib/gup');\nvar keyFun = gup.keyFun;\nvar repeat = gup.repeat;\nvar unwrap = gup.unwrap;\nvar interpolateNumber = _dereq_('d3-interpolate').interpolateNumber;\n\nvar Registry = _dereq_('../../registry');\n\n// view models\n\nfunction sankeyModel(layout, d, traceIndex) {\n var calcData = unwrap(d);\n var trace = calcData.trace;\n var domain = trace.domain;\n var horizontal = trace.orientation === 'h';\n var nodePad = trace.node.pad;\n var nodeThickness = trace.node.thickness;\n\n var width = layout.width * (domain.x[1] - domain.x[0]);\n var height = layout.height * (domain.y[1] - domain.y[0]);\n\n var nodes = calcData._nodes;\n var links = calcData._links;\n var circular = calcData.circular;\n\n // Select Sankey generator\n var sankey;\n if(circular) {\n sankey = d3SankeyCircular\n .sankeyCircular()\n .circularLinkGap(0);\n } else {\n sankey = d3Sankey.sankey();\n }\n\n sankey\n .iterations(c.sankeyIterations)\n .size(horizontal ? [width, height] : [height, width])\n .nodeWidth(nodeThickness)\n .nodePadding(nodePad)\n .nodeId(function(d) {\n return d.pointNumber;\n })\n .nodes(nodes)\n .links(links);\n\n var graph = sankey();\n\n if(sankey.nodePadding() < nodePad) {\n Lib.warn('node.pad was reduced to ', sankey.nodePadding(), ' to fit within the figure.');\n }\n\n // Counters for nested loops\n var i, j, k;\n\n // Create transient nodes for animations\n for(var nodePointNumber in calcData._groupLookup) {\n var groupIndex = parseInt(calcData._groupLookup[nodePointNumber]);\n\n // Find node representing groupIndex\n var groupingNode;\n\n for(i = 0; i < graph.nodes.length; i++) {\n if(graph.nodes[i].pointNumber === groupIndex) {\n groupingNode = graph.nodes[i];\n break;\n }\n }\n // If groupinNode is undefined, no links are targeting this group\n if(!groupingNode) continue;\n\n var child = {\n pointNumber: parseInt(nodePointNumber),\n x0: groupingNode.x0,\n x1: groupingNode.x1,\n y0: groupingNode.y0,\n y1: groupingNode.y1,\n partOfGroup: true,\n sourceLinks: [],\n targetLinks: []\n };\n\n graph.nodes.unshift(child);\n groupingNode.childrenNodes.unshift(child);\n }\n\n function computeLinkConcentrations() {\n for(i = 0; i < graph.nodes.length; i++) {\n var node = graph.nodes[i];\n // Links connecting the same two nodes are part of a flow\n var flows = {};\n var flowKey;\n var link;\n for(j = 0; j < node.targetLinks.length; j++) {\n link = node.targetLinks[j];\n flowKey = link.source.pointNumber + ':' + link.target.pointNumber;\n if(!flows.hasOwnProperty(flowKey)) flows[flowKey] = [];\n flows[flowKey].push(link);\n }\n\n // Compute statistics for each flow\n var keys = Object.keys(flows);\n for(j = 0; j < keys.length; j++) {\n flowKey = keys[j];\n var flowLinks = flows[flowKey];\n\n // Find the total size of the flow and total size per label\n var total = 0;\n var totalPerLabel = {};\n for(k = 0; k < flowLinks.length; k++) {\n link = flowLinks[k];\n if(!totalPerLabel[link.label]) totalPerLabel[link.label] = 0;\n totalPerLabel[link.label] += link.value;\n total += link.value;\n }\n\n // Find the ratio of the link's value and the size of the flow\n for(k = 0; k < flowLinks.length; k++) {\n link = flowLinks[k];\n link.flow = {\n value: total,\n labelConcentration: totalPerLabel[link.label] / total,\n concentration: link.value / total,\n links: flowLinks\n };\n if(link.concentrationscale) {\n link.color = tinycolor(link.concentrationscale(link.flow.labelConcentration));\n }\n }\n }\n\n // Gather statistics of all links at current node\n var totalOutflow = 0;\n for(j = 0; j < node.sourceLinks.length; j++) {\n totalOutflow += node.sourceLinks[j].value;\n }\n for(j = 0; j < node.sourceLinks.length; j++) {\n link = node.sourceLinks[j];\n link.concentrationOut = link.value / totalOutflow;\n }\n\n var totalInflow = 0;\n for(j = 0; j < node.targetLinks.length; j++) {\n totalInflow += node.targetLinks[j].value;\n }\n\n for(j = 0; j < node.targetLinks.length; j++) {\n link = node.targetLinks[j];\n link.concenrationIn = link.value / totalInflow;\n }\n }\n }\n computeLinkConcentrations();\n\n // Push any overlapping nodes down.\n function resolveCollisionsTopToBottom(columns) {\n columns.forEach(function(nodes) {\n var node;\n var dy;\n var y = 0;\n var n = nodes.length;\n var i;\n nodes.sort(function(a, b) {\n return a.y0 - b.y0;\n });\n for(i = 0; i < n; ++i) {\n node = nodes[i];\n if(node.y0 >= y) {\n // No overlap\n } else {\n dy = (y - node.y0);\n if(dy > 1e-6) node.y0 += dy, node.y1 += dy;\n }\n y = node.y1 + nodePad;\n }\n });\n }\n\n // Group nodes into columns based on their x position\n function snapToColumns(nodes) {\n // Sort nodes by x position\n var orderedNodes = nodes.map(function(n, i) {\n return {\n x0: n.x0,\n index: i\n };\n })\n .sort(function(a, b) {\n return a.x0 - b.x0;\n });\n\n var columns = [];\n var colNumber = -1;\n var colX; // Position of column\n var lastX = -Infinity; // Position of last node\n var dx;\n for(i = 0; i < orderedNodes.length; i++) {\n var node = nodes[orderedNodes[i].index];\n // If the node does not overlap with the last one\n if(node.x0 > lastX + nodeThickness) {\n // Start a new column\n colNumber += 1;\n colX = node.x0;\n }\n lastX = node.x0;\n\n // Add node to its associated column\n if(!columns[colNumber]) columns[colNumber] = [];\n columns[colNumber].push(node);\n\n // Change node's x position to align it with its column\n dx = colX - node.x0;\n node.x0 += dx, node.x1 += dx;\n }\n return columns;\n }\n\n // Force node position\n if(trace.node.x.length && trace.node.y.length) {\n for(i = 0; i < Math.min(trace.node.x.length, trace.node.y.length, graph.nodes.length); i++) {\n if(trace.node.x[i] && trace.node.y[i]) {\n var pos = [trace.node.x[i] * width, trace.node.y[i] * height];\n graph.nodes[i].x0 = pos[0] - nodeThickness / 2;\n graph.nodes[i].x1 = pos[0] + nodeThickness / 2;\n\n var nodeHeight = graph.nodes[i].y1 - graph.nodes[i].y0;\n graph.nodes[i].y0 = pos[1] - nodeHeight / 2;\n graph.nodes[i].y1 = pos[1] + nodeHeight / 2;\n }\n }\n if(trace.arrangement === 'snap') {\n nodes = graph.nodes;\n var columns = snapToColumns(nodes);\n resolveCollisionsTopToBottom(columns);\n }\n // Update links\n sankey.update(graph);\n }\n\n\n return {\n circular: circular,\n key: traceIndex,\n trace: trace,\n guid: Lib.randstr(),\n horizontal: horizontal,\n width: width,\n height: height,\n nodePad: trace.node.pad,\n nodeLineColor: trace.node.line.color,\n nodeLineWidth: trace.node.line.width,\n linkLineColor: trace.link.line.color,\n linkLineWidth: trace.link.line.width,\n valueFormat: trace.valueformat,\n valueSuffix: trace.valuesuffix,\n textFont: trace.textfont,\n translateX: domain.x[0] * layout.width + layout.margin.l,\n translateY: layout.height - domain.y[1] * layout.height + layout.margin.t,\n dragParallel: horizontal ? height : width,\n dragPerpendicular: horizontal ? width : height,\n arrangement: trace.arrangement,\n sankey: sankey,\n graph: graph,\n forceLayouts: {},\n interactionState: {\n dragInProgress: false,\n hovered: false\n }\n };\n}\n\nfunction linkModel(d, l, i) {\n var tc = tinycolor(l.color);\n var basicKey = l.source.label + '|' + l.target.label;\n var key = basicKey + '__' + i;\n\n // for event data\n l.trace = d.trace;\n l.curveNumber = d.trace.index;\n\n return {\n circular: d.circular,\n key: key,\n traceId: d.key,\n pointNumber: l.pointNumber,\n link: l,\n tinyColorHue: Color.tinyRGB(tc),\n tinyColorAlpha: tc.getAlpha(),\n linkPath: linkPath,\n linkLineColor: d.linkLineColor,\n linkLineWidth: d.linkLineWidth,\n valueFormat: d.valueFormat,\n valueSuffix: d.valueSuffix,\n sankey: d.sankey,\n parent: d,\n interactionState: d.interactionState,\n flow: l.flow\n };\n}\n\nfunction createCircularClosedPathString(link) {\n // Using coordinates computed by d3-sankey-circular\n var pathString = '';\n var offset = link.width / 2;\n var coords = link.circularPathData;\n if(link.circularLinkType === 'top') {\n // Top path\n pathString =\n // start at the left of the target node\n 'M ' +\n coords.targetX + ' ' + (coords.targetY + offset) + ' ' +\n 'L' +\n coords.rightInnerExtent + ' ' + (coords.targetY + offset) +\n 'A' +\n (coords.rightLargeArcRadius + offset) + ' ' + (coords.rightSmallArcRadius + offset) + ' 0 0 1 ' +\n (coords.rightFullExtent - offset) + ' ' + (coords.targetY - coords.rightSmallArcRadius) +\n 'L' +\n (coords.rightFullExtent - offset) + ' ' + coords.verticalRightInnerExtent +\n 'A' +\n (coords.rightLargeArcRadius + offset) + ' ' + (coords.rightLargeArcRadius + offset) + ' 0 0 1 ' +\n coords.rightInnerExtent + ' ' + (coords.verticalFullExtent - offset) +\n 'L' +\n coords.leftInnerExtent + ' ' + (coords.verticalFullExtent - offset) +\n 'A' +\n (coords.leftLargeArcRadius + offset) + ' ' + (coords.leftLargeArcRadius + offset) + ' 0 0 1 ' +\n (coords.leftFullExtent + offset) + ' ' + coords.verticalLeftInnerExtent +\n 'L' +\n (coords.leftFullExtent + offset) + ' ' + (coords.sourceY - coords.leftSmallArcRadius) +\n 'A' +\n (coords.leftLargeArcRadius + offset) + ' ' + (coords.leftSmallArcRadius + offset) + ' 0 0 1 ' +\n coords.leftInnerExtent + ' ' + (coords.sourceY + offset) +\n 'L' +\n coords.sourceX + ' ' + (coords.sourceY + offset) +\n\n // Walking back\n 'L' +\n coords.sourceX + ' ' + (coords.sourceY - offset) +\n 'L' +\n coords.leftInnerExtent + ' ' + (coords.sourceY - offset) +\n 'A' +\n (coords.leftLargeArcRadius - offset) + ' ' + (coords.leftSmallArcRadius - offset) + ' 0 0 0 ' +\n (coords.leftFullExtent - offset) + ' ' + (coords.sourceY - coords.leftSmallArcRadius) +\n 'L' +\n (coords.leftFullExtent - offset) + ' ' + coords.verticalLeftInnerExtent +\n 'A' +\n (coords.leftLargeArcRadius - offset) + ' ' + (coords.leftLargeArcRadius - offset) + ' 0 0 0 ' +\n coords.leftInnerExtent + ' ' + (coords.verticalFullExtent + offset) +\n 'L' +\n coords.rightInnerExtent + ' ' + (coords.verticalFullExtent + offset) +\n 'A' +\n (coords.rightLargeArcRadius - offset) + ' ' + (coords.rightLargeArcRadius - offset) + ' 0 0 0 ' +\n (coords.rightFullExtent + offset) + ' ' + coords.verticalRightInnerExtent +\n 'L' +\n (coords.rightFullExtent + offset) + ' ' + (coords.targetY - coords.rightSmallArcRadius) +\n 'A' +\n (coords.rightLargeArcRadius - offset) + ' ' + (coords.rightSmallArcRadius - offset) + ' 0 0 0 ' +\n coords.rightInnerExtent + ' ' + (coords.targetY - offset) +\n 'L' +\n coords.targetX + ' ' + (coords.targetY - offset) +\n 'Z';\n } else {\n // Bottom path\n pathString =\n // start at the left of the target node\n 'M ' +\n coords.targetX + ' ' + (coords.targetY - offset) + ' ' +\n 'L' +\n coords.rightInnerExtent + ' ' + (coords.targetY - offset) +\n 'A' +\n (coords.rightLargeArcRadius + offset) + ' ' + (coords.rightSmallArcRadius + offset) + ' 0 0 0 ' +\n (coords.rightFullExtent - offset) + ' ' + (coords.targetY + coords.rightSmallArcRadius) +\n 'L' +\n (coords.rightFullExtent - offset) + ' ' + coords.verticalRightInnerExtent +\n 'A' +\n (coords.rightLargeArcRadius + offset) + ' ' + (coords.rightLargeArcRadius + offset) + ' 0 0 0 ' +\n coords.rightInnerExtent + ' ' + (coords.verticalFullExtent + offset) +\n 'L' +\n coords.leftInnerExtent + ' ' + (coords.verticalFullExtent + offset) +\n 'A' +\n (coords.leftLargeArcRadius + offset) + ' ' + (coords.leftLargeArcRadius + offset) + ' 0 0 0 ' +\n (coords.leftFullExtent + offset) + ' ' + coords.verticalLeftInnerExtent +\n 'L' +\n (coords.leftFullExtent + offset) + ' ' + (coords.sourceY + coords.leftSmallArcRadius) +\n 'A' +\n (coords.leftLargeArcRadius + offset) + ' ' + (coords.leftSmallArcRadius + offset) + ' 0 0 0 ' +\n coords.leftInnerExtent + ' ' + (coords.sourceY - offset) +\n 'L' +\n coords.sourceX + ' ' + (coords.sourceY - offset) +\n\n // Walking back\n 'L' +\n coords.sourceX + ' ' + (coords.sourceY + offset) +\n 'L' +\n coords.leftInnerExtent + ' ' + (coords.sourceY + offset) +\n 'A' +\n (coords.leftLargeArcRadius - offset) + ' ' + (coords.leftSmallArcRadius - offset) + ' 0 0 1 ' +\n (coords.leftFullExtent - offset) + ' ' + (coords.sourceY + coords.leftSmallArcRadius) +\n 'L' +\n (coords.leftFullExtent - offset) + ' ' + coords.verticalLeftInnerExtent +\n 'A' +\n (coords.leftLargeArcRadius - offset) + ' ' + (coords.leftLargeArcRadius - offset) + ' 0 0 1 ' +\n coords.leftInnerExtent + ' ' + (coords.verticalFullExtent - offset) +\n 'L' +\n coords.rightInnerExtent + ' ' + (coords.verticalFullExtent - offset) +\n 'A' +\n (coords.rightLargeArcRadius - offset) + ' ' + (coords.rightLargeArcRadius - offset) + ' 0 0 1 ' +\n (coords.rightFullExtent + offset) + ' ' + coords.verticalRightInnerExtent +\n 'L' +\n (coords.rightFullExtent + offset) + ' ' + (coords.targetY + coords.rightSmallArcRadius) +\n 'A' +\n (coords.rightLargeArcRadius - offset) + ' ' + (coords.rightSmallArcRadius - offset) + ' 0 0 1 ' +\n coords.rightInnerExtent + ' ' + (coords.targetY + offset) +\n 'L' +\n coords.targetX + ' ' + (coords.targetY + offset) +\n 'Z';\n }\n return pathString;\n}\n\nfunction linkPath() {\n var curvature = 0.5;\n function path(d) {\n if(d.link.circular) {\n return createCircularClosedPathString(d.link);\n } else {\n var x0 = d.link.source.x1;\n var x1 = d.link.target.x0;\n var xi = interpolateNumber(x0, x1);\n var x2 = xi(curvature);\n var x3 = xi(1 - curvature);\n var y0a = d.link.y0 - d.link.width / 2;\n var y0b = d.link.y0 + d.link.width / 2;\n var y1a = d.link.y1 - d.link.width / 2;\n var y1b = d.link.y1 + d.link.width / 2;\n return 'M' + x0 + ',' + y0a +\n 'C' + x2 + ',' + y0a +\n ' ' + x3 + ',' + y1a +\n ' ' + x1 + ',' + y1a +\n 'L' + x1 + ',' + y1b +\n 'C' + x3 + ',' + y1b +\n ' ' + x2 + ',' + y0b +\n ' ' + x0 + ',' + y0b +\n 'Z';\n }\n }\n return path;\n}\n\nfunction nodeModel(d, n) {\n var tc = tinycolor(n.color);\n var zoneThicknessPad = c.nodePadAcross;\n var zoneLengthPad = d.nodePad / 2;\n n.dx = n.x1 - n.x0;\n n.dy = n.y1 - n.y0;\n var visibleThickness = n.dx;\n var visibleLength = Math.max(0.5, n.dy);\n\n var key = 'node_' + n.pointNumber;\n // If it's a group, it's mutable and should be unique\n if(n.group) {\n key = Lib.randstr();\n }\n\n // for event data\n n.trace = d.trace;\n n.curveNumber = d.trace.index;\n\n return {\n index: n.pointNumber,\n key: key,\n partOfGroup: n.partOfGroup || false,\n group: n.group,\n traceId: d.key,\n trace: d.trace,\n node: n,\n nodePad: d.nodePad,\n nodeLineColor: d.nodeLineColor,\n nodeLineWidth: d.nodeLineWidth,\n textFont: d.textFont,\n size: d.horizontal ? d.height : d.width,\n visibleWidth: Math.ceil(visibleThickness),\n visibleHeight: visibleLength,\n zoneX: -zoneThicknessPad,\n zoneY: -zoneLengthPad,\n zoneWidth: visibleThickness + 2 * zoneThicknessPad,\n zoneHeight: visibleLength + 2 * zoneLengthPad,\n labelY: d.horizontal ? n.dy / 2 + 1 : n.dx / 2 + 1,\n left: n.originalLayer === 1,\n sizeAcross: d.width,\n forceLayouts: d.forceLayouts,\n horizontal: d.horizontal,\n darkBackground: tc.getBrightness() <= 128,\n tinyColorHue: Color.tinyRGB(tc),\n tinyColorAlpha: tc.getAlpha(),\n valueFormat: d.valueFormat,\n valueSuffix: d.valueSuffix,\n sankey: d.sankey,\n graph: d.graph,\n arrangement: d.arrangement,\n uniqueNodeLabelPathId: [d.guid, d.key, key].join('_'),\n interactionState: d.interactionState,\n figure: d\n };\n}\n\n// rendering snippets\n\nfunction updateNodePositions(sankeyNode) {\n sankeyNode\n .attr('transform', function(d) {\n return 'translate(' + d.node.x0.toFixed(3) + ', ' + (d.node.y0).toFixed(3) + ')';\n });\n}\n\nfunction updateNodeShapes(sankeyNode) {\n sankeyNode.call(updateNodePositions);\n}\n\nfunction updateShapes(sankeyNode, sankeyLink) {\n sankeyNode.call(updateNodeShapes);\n sankeyLink.attr('d', linkPath());\n}\n\nfunction sizeNode(rect) {\n rect\n .attr('width', function(d) {return d.node.x1 - d.node.x0;})\n .attr('height', function(d) {return d.visibleHeight;});\n}\n\nfunction salientEnough(d) {return (d.link.width > 1 || d.linkLineWidth > 0);}\n\nfunction sankeyTransform(d) {\n var offset = 'translate(' + d.translateX + ',' + d.translateY + ')';\n return offset + (d.horizontal ? 'matrix(1 0 0 1 0 0)' : 'matrix(0 1 1 0 0 0)');\n}\n\nfunction nodeCentering(d) {\n return 'translate(' + (d.horizontal ? 0 : d.labelY) + ' ' + (d.horizontal ? d.labelY : 0) + ')';\n}\n\nfunction textGuidePath(d) {\n return d3.svg.line()([\n [d.horizontal ? (d.left ? -d.sizeAcross : d.visibleWidth + c.nodeTextOffsetHorizontal) : c.nodeTextOffsetHorizontal, 0],\n [d.horizontal ? (d.left ? - c.nodeTextOffsetHorizontal : d.sizeAcross) : d.visibleHeight - c.nodeTextOffsetHorizontal, 0]\n ]);\n}\n\nfunction sankeyInverseTransform(d) {return d.horizontal ? 'matrix(1 0 0 1 0 0)' : 'matrix(0 1 1 0 0 0)';}\nfunction textFlip(d) {return d.horizontal ? 'scale(1 1)' : 'scale(-1 1)';}\nfunction nodeTextColor(d) {return d.darkBackground && !d.horizontal ? 'rgb(255,255,255)' : 'rgb(0,0,0)';}\nfunction nodeTextOffset(d) {return d.horizontal && d.left ? '100%' : '0%';}\n\n// event handling\n\nfunction attachPointerEvents(selection, sankey, eventSet) {\n selection\n .on('.basic', null) // remove any preexisting handlers\n .on('mouseover.basic', function(d) {\n if(!d.interactionState.dragInProgress && !d.partOfGroup) {\n eventSet.hover(this, d, sankey);\n d.interactionState.hovered = [this, d];\n }\n })\n .on('mousemove.basic', function(d) {\n if(!d.interactionState.dragInProgress && !d.partOfGroup) {\n eventSet.follow(this, d);\n d.interactionState.hovered = [this, d];\n }\n })\n .on('mouseout.basic', function(d) {\n if(!d.interactionState.dragInProgress && !d.partOfGroup) {\n eventSet.unhover(this, d, sankey);\n d.interactionState.hovered = false;\n }\n })\n .on('click.basic', function(d) {\n if(d.interactionState.hovered) {\n eventSet.unhover(this, d, sankey);\n d.interactionState.hovered = false;\n }\n if(!d.interactionState.dragInProgress && !d.partOfGroup) {\n eventSet.select(this, d, sankey);\n }\n });\n}\n\nfunction attachDragHandler(sankeyNode, sankeyLink, callbacks, gd) {\n var dragBehavior = d3.behavior.drag()\n .origin(function(d) {\n return {\n x: d.node.x0 + d.visibleWidth / 2,\n y: d.node.y0 + d.visibleHeight / 2\n };\n })\n\n .on('dragstart', function(d) {\n if(d.arrangement === 'fixed') return;\n Lib.ensureSingle(gd._fullLayout._infolayer, 'g', 'dragcover', function(s) {\n gd._fullLayout._dragCover = s;\n });\n Lib.raiseToTop(this);\n d.interactionState.dragInProgress = d.node;\n\n saveCurrentDragPosition(d.node);\n if(d.interactionState.hovered) {\n callbacks.nodeEvents.unhover.apply(0, d.interactionState.hovered);\n d.interactionState.hovered = false;\n }\n if(d.arrangement === 'snap') {\n var forceKey = d.traceId + '|' + d.key;\n if(d.forceLayouts[forceKey]) {\n d.forceLayouts[forceKey].alpha(1);\n } else { // make a forceLayout if needed\n attachForce(sankeyNode, forceKey, d, gd);\n }\n startForce(sankeyNode, sankeyLink, d, forceKey, gd);\n }\n })\n\n .on('drag', function(d) {\n if(d.arrangement === 'fixed') return;\n var x = d3.event.x;\n var y = d3.event.y;\n if(d.arrangement === 'snap') {\n d.node.x0 = x - d.visibleWidth / 2;\n d.node.x1 = x + d.visibleWidth / 2;\n d.node.y0 = y - d.visibleHeight / 2;\n d.node.y1 = y + d.visibleHeight / 2;\n } else {\n if(d.arrangement === 'freeform') {\n d.node.x0 = x - d.visibleWidth / 2;\n d.node.x1 = x + d.visibleWidth / 2;\n }\n y = Math.max(0, Math.min(d.size - d.visibleHeight / 2, y));\n d.node.y0 = y - d.visibleHeight / 2;\n d.node.y1 = y + d.visibleHeight / 2;\n }\n\n saveCurrentDragPosition(d.node);\n if(d.arrangement !== 'snap') {\n d.sankey.update(d.graph);\n updateShapes(sankeyNode.filter(sameLayer(d)), sankeyLink);\n }\n })\n\n .on('dragend', function(d) {\n if(d.arrangement === 'fixed') return;\n d.interactionState.dragInProgress = false;\n for(var i = 0; i < d.node.childrenNodes.length; i++) {\n d.node.childrenNodes[i].x = d.node.x;\n d.node.childrenNodes[i].y = d.node.y;\n }\n if(d.arrangement !== 'snap') persistFinalNodePositions(d, gd);\n });\n\n sankeyNode\n .on('.drag', null) // remove possible previous handlers\n .call(dragBehavior);\n}\n\nfunction attachForce(sankeyNode, forceKey, d, gd) {\n // Attach force to nodes in the same column (same x coordinate)\n switchToForceFormat(d.graph.nodes);\n var nodes = d.graph.nodes\n .filter(function(n) {return n.originalX === d.node.originalX;})\n // Filter out children\n .filter(function(n) {return !n.partOfGroup;});\n d.forceLayouts[forceKey] = d3Force.forceSimulation(nodes)\n .alphaDecay(0)\n .force('collide', d3Force.forceCollide()\n .radius(function(n) {return n.dy / 2 + d.nodePad / 2;})\n .strength(1)\n .iterations(c.forceIterations))\n .force('constrain', snappingForce(sankeyNode, forceKey, nodes, d, gd))\n .stop();\n}\n\nfunction startForce(sankeyNode, sankeyLink, d, forceKey, gd) {\n window.requestAnimationFrame(function faster() {\n var i;\n for(i = 0; i < c.forceTicksPerFrame; i++) {\n d.forceLayouts[forceKey].tick();\n }\n\n var nodes = d.graph.nodes;\n switchToSankeyFormat(nodes);\n\n d.sankey.update(d.graph);\n updateShapes(sankeyNode.filter(sameLayer(d)), sankeyLink);\n\n if(d.forceLayouts[forceKey].alpha() > 0) {\n window.requestAnimationFrame(faster);\n } else {\n // Make sure the final x position is equal to its original value\n // because the force simulation will have numerical error\n var x = d.node.originalX;\n d.node.x0 = x - d.visibleWidth / 2;\n d.node.x1 = x + d.visibleWidth / 2;\n\n persistFinalNodePositions(d, gd);\n }\n });\n}\n\nfunction snappingForce(sankeyNode, forceKey, nodes, d) {\n return function _snappingForce() {\n var maxVelocity = 0;\n for(var i = 0; i < nodes.length; i++) {\n var n = nodes[i];\n if(n === d.interactionState.dragInProgress) { // constrain node position to the dragging pointer\n n.x = n.lastDraggedX;\n n.y = n.lastDraggedY;\n } else {\n n.vx = (n.originalX - n.x) / c.forceTicksPerFrame; // snap to layer\n n.y = Math.min(d.size - n.dy / 2, Math.max(n.dy / 2, n.y)); // constrain to extent\n }\n maxVelocity = Math.max(maxVelocity, Math.abs(n.vx), Math.abs(n.vy));\n }\n if(!d.interactionState.dragInProgress && maxVelocity < 0.1 && d.forceLayouts[forceKey].alpha() > 0) {\n d.forceLayouts[forceKey].alpha(0); // This will stop the animation loop\n }\n };\n}\n\n// basic data utilities\n\nfunction persistFinalNodePositions(d, gd) {\n var x = [];\n var y = [];\n for(var i = 0; i < d.graph.nodes.length; i++) {\n var nodeX = (d.graph.nodes[i].x0 + d.graph.nodes[i].x1) / 2;\n var nodeY = (d.graph.nodes[i].y0 + d.graph.nodes[i].y1) / 2;\n x.push(nodeX / d.figure.width);\n y.push(nodeY / d.figure.height);\n }\n Registry.call('_guiRestyle', gd, {\n 'node.x': [x],\n 'node.y': [y]\n }, d.trace.index)\n .then(function() {\n if(gd._fullLayout._dragCover) gd._fullLayout._dragCover.remove();\n });\n}\n\nfunction persistOriginalPlace(nodes) {\n var distinctLayerPositions = [];\n var i;\n for(i = 0; i < nodes.length; i++) {\n nodes[i].originalX = (nodes[i].x0 + nodes[i].x1) / 2;\n nodes[i].originalY = (nodes[i].y0 + nodes[i].y1) / 2;\n if(distinctLayerPositions.indexOf(nodes[i].originalX) === -1) {\n distinctLayerPositions.push(nodes[i].originalX);\n }\n }\n distinctLayerPositions.sort(function(a, b) {return a - b;});\n for(i = 0; i < nodes.length; i++) {\n nodes[i].originalLayerIndex = distinctLayerPositions.indexOf(nodes[i].originalX);\n nodes[i].originalLayer = nodes[i].originalLayerIndex / (distinctLayerPositions.length - 1);\n }\n}\n\nfunction saveCurrentDragPosition(d) {\n d.lastDraggedX = d.x0 + d.dx / 2;\n d.lastDraggedY = d.y0 + d.dy / 2;\n}\n\nfunction sameLayer(d) {\n return function(n) {return n.node.originalX === d.node.originalX;};\n}\n\nfunction switchToForceFormat(nodes) {\n // force uses x, y as centers\n for(var i = 0; i < nodes.length; i++) {\n nodes[i].y = (nodes[i].y0 + nodes[i].y1) / 2;\n nodes[i].x = (nodes[i].x0 + nodes[i].x1) / 2;\n }\n}\n\nfunction switchToSankeyFormat(nodes) {\n // sankey uses x0, x1, y0, y1\n for(var i = 0; i < nodes.length; i++) {\n nodes[i].y0 = nodes[i].y - nodes[i].dy / 2;\n nodes[i].y1 = nodes[i].y0 + nodes[i].dy;\n\n nodes[i].x0 = nodes[i].x - nodes[i].dx / 2;\n nodes[i].x1 = nodes[i].x0 + nodes[i].dx;\n }\n}\n\n// scene graph\nmodule.exports = function(gd, svg, calcData, layout, callbacks) {\n // To prevent animation on first render\n var firstRender = false;\n Lib.ensureSingle(gd._fullLayout._infolayer, 'g', 'first-render', function() {\n firstRender = true;\n });\n\n // To prevent animation on dragging\n var dragcover = gd._fullLayout._dragCover;\n\n var styledData = calcData\n .filter(function(d) {return unwrap(d).trace.visible;})\n .map(sankeyModel.bind(null, layout));\n\n var sankey = svg.selectAll('.' + c.cn.sankey)\n .data(styledData, keyFun);\n\n sankey.exit()\n .remove();\n\n sankey.enter()\n .append('g')\n .classed(c.cn.sankey, true)\n .style('box-sizing', 'content-box')\n .style('position', 'absolute')\n .style('left', 0)\n .style('shape-rendering', 'geometricPrecision')\n .style('pointer-events', 'auto')\n .attr('transform', sankeyTransform);\n\n sankey.each(function(d, i) {\n gd._fullData[i]._sankey = d;\n // Create dragbox if missing\n var dragboxClassName = 'bgsankey-' + d.trace.uid + '-' + i;\n Lib.ensureSingle(gd._fullLayout._draggers, 'rect', dragboxClassName);\n\n gd._fullData[i]._bgRect = d3.select('.' + dragboxClassName);\n\n // Style dragbox\n gd._fullData[i]._bgRect\n .style('pointer-events', 'all')\n .attr('width', d.width)\n .attr('height', d.height)\n .attr('x', d.translateX)\n .attr('y', d.translateY)\n .classed('bgsankey', true)\n .style({fill: 'transparent', 'stroke-width': 0});\n });\n\n sankey.transition()\n .ease(c.ease).duration(c.duration)\n .attr('transform', sankeyTransform);\n\n var sankeyLinks = sankey.selectAll('.' + c.cn.sankeyLinks)\n .data(repeat, keyFun);\n\n sankeyLinks.enter()\n .append('g')\n .classed(c.cn.sankeyLinks, true)\n .style('fill', 'none');\n\n var sankeyLink = sankeyLinks.selectAll('.' + c.cn.sankeyLink)\n .data(function(d) {\n var links = d.graph.links;\n return links\n .filter(function(l) {return l.value;})\n .map(linkModel.bind(null, d));\n }, keyFun);\n\n sankeyLink\n .enter().append('path')\n .classed(c.cn.sankeyLink, true)\n .call(attachPointerEvents, sankey, callbacks.linkEvents);\n\n sankeyLink\n .style('stroke', function(d) {\n return salientEnough(d) ? Color.tinyRGB(tinycolor(d.linkLineColor)) : d.tinyColorHue;\n })\n .style('stroke-opacity', function(d) {\n return salientEnough(d) ? Color.opacity(d.linkLineColor) : d.tinyColorAlpha;\n })\n .style('fill', function(d) {\n return d.tinyColorHue;\n })\n .style('fill-opacity', function(d) {\n return d.tinyColorAlpha;\n })\n .style('stroke-width', function(d) {\n return salientEnough(d) ? d.linkLineWidth : 1;\n })\n .attr('d', linkPath());\n\n sankeyLink\n .style('opacity', function() { return (gd._context.staticPlot || firstRender || dragcover) ? 1 : 0;})\n .transition()\n .ease(c.ease).duration(c.duration)\n .style('opacity', 1);\n\n sankeyLink.exit()\n .transition()\n .ease(c.ease).duration(c.duration)\n .style('opacity', 0)\n .remove();\n\n var sankeyNodeSet = sankey.selectAll('.' + c.cn.sankeyNodeSet)\n .data(repeat, keyFun);\n\n sankeyNodeSet.enter()\n .append('g')\n .classed(c.cn.sankeyNodeSet, true);\n\n sankeyNodeSet\n .style('cursor', function(d) {\n switch(d.arrangement) {\n case 'fixed': return 'default';\n case 'perpendicular': return 'ns-resize';\n default: return 'move';\n }\n });\n\n var sankeyNode = sankeyNodeSet.selectAll('.' + c.cn.sankeyNode)\n .data(function(d) {\n var nodes = d.graph.nodes;\n persistOriginalPlace(nodes);\n return nodes\n .map(nodeModel.bind(null, d));\n }, keyFun);\n\n sankeyNode.enter()\n .append('g')\n .classed(c.cn.sankeyNode, true)\n .call(updateNodePositions)\n .style('opacity', function(n) { return ((gd._context.staticPlot || firstRender) && !n.partOfGroup) ? 1 : 0;});\n\n sankeyNode\n .call(attachPointerEvents, sankey, callbacks.nodeEvents)\n .call(attachDragHandler, sankeyLink, callbacks, gd); // has to be here as it binds sankeyLink\n\n sankeyNode\n .transition()\n .ease(c.ease).duration(c.duration)\n .call(updateNodePositions)\n .style('opacity', function(n) { return n.partOfGroup ? 0 : 1;});\n\n sankeyNode.exit()\n .transition()\n .ease(c.ease).duration(c.duration)\n .style('opacity', 0)\n .remove();\n\n var nodeRect = sankeyNode.selectAll('.' + c.cn.nodeRect)\n .data(repeat);\n\n nodeRect.enter()\n .append('rect')\n .classed(c.cn.nodeRect, true)\n .call(sizeNode);\n\n nodeRect\n .style('stroke-width', function(d) {return d.nodeLineWidth;})\n .style('stroke', function(d) {return Color.tinyRGB(tinycolor(d.nodeLineColor));})\n .style('stroke-opacity', function(d) {return Color.opacity(d.nodeLineColor);})\n .style('fill', function(d) {return d.tinyColorHue;})\n .style('fill-opacity', function(d) {return d.tinyColorAlpha;});\n\n nodeRect.transition()\n .ease(c.ease).duration(c.duration)\n .call(sizeNode);\n\n var nodeCapture = sankeyNode.selectAll('.' + c.cn.nodeCapture)\n .data(repeat);\n\n nodeCapture.enter()\n .append('rect')\n .classed(c.cn.nodeCapture, true)\n .style('fill-opacity', 0);\n\n nodeCapture\n .attr('x', function(d) {return d.zoneX;})\n .attr('y', function(d) {return d.zoneY;})\n .attr('width', function(d) {return d.zoneWidth;})\n .attr('height', function(d) {return d.zoneHeight;});\n\n var nodeCentered = sankeyNode.selectAll('.' + c.cn.nodeCentered)\n .data(repeat);\n\n nodeCentered.enter()\n .append('g')\n .classed(c.cn.nodeCentered, true)\n .attr('transform', nodeCentering);\n\n nodeCentered\n .transition()\n .ease(c.ease).duration(c.duration)\n .attr('transform', nodeCentering);\n\n var nodeLabelGuide = nodeCentered.selectAll('.' + c.cn.nodeLabelGuide)\n .data(repeat);\n\n nodeLabelGuide.enter()\n .append('path')\n .classed(c.cn.nodeLabelGuide, true)\n .attr('id', function(d) {return d.uniqueNodeLabelPathId;})\n .attr('d', textGuidePath)\n .attr('transform', sankeyInverseTransform);\n\n nodeLabelGuide\n .transition()\n .ease(c.ease).duration(c.duration)\n .attr('d', textGuidePath)\n .attr('transform', sankeyInverseTransform);\n\n var nodeLabel = nodeCentered.selectAll('.' + c.cn.nodeLabel)\n .data(repeat);\n\n nodeLabel.enter()\n .append('text')\n .classed(c.cn.nodeLabel, true)\n .attr('transform', textFlip)\n .style('user-select', 'none')\n .style('cursor', 'default')\n .style('fill', 'black');\n\n nodeLabel\n .style('text-shadow', function(d) {\n return d.horizontal ? '-1px 1px 1px #fff, 1px 1px 1px #fff, 1px -1px 1px #fff, -1px -1px 1px #fff' : 'none';\n })\n .each(function(d) {Drawing.font(nodeLabel, d.textFont);});\n\n nodeLabel\n .transition()\n .ease(c.ease).duration(c.duration)\n .attr('transform', textFlip);\n\n var nodeLabelTextPath = nodeLabel.selectAll('.' + c.cn.nodeLabelTextPath)\n .data(repeat);\n\n nodeLabelTextPath.enter()\n .append('textPath')\n .classed(c.cn.nodeLabelTextPath, true)\n .attr('alignment-baseline', 'middle')\n .attr('xlink:href', function(d) {return '#' + d.uniqueNodeLabelPathId;})\n .attr('startOffset', nodeTextOffset)\n .style('fill', nodeTextColor);\n\n nodeLabelTextPath\n .text(function(d) {return d.horizontal || d.node.dy > 5 ? d.node.label : '';})\n .attr('text-anchor', function(d) {return d.horizontal && d.left ? 'end' : 'start';});\n\n nodeLabelTextPath\n .transition()\n .ease(c.ease).duration(c.duration)\n .attr('startOffset', nodeTextOffset)\n .style('fill', nodeTextColor);\n};\n\n},{\"../../components/color\":595,\"../../components/drawing\":617,\"../../lib\":728,\"../../lib/gup\":726,\"../../registry\":859,\"./constants\":1127,\"@plotly/d3-sankey\":56,\"@plotly/d3-sankey-circular\":55,\"d3\":164,\"d3-force\":157,\"d3-interpolate\":159,\"tinycolor2\":528}],1132:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = function selectPoints(searchInfo, selectionTester) {\n var cd = searchInfo.cd;\n var selection = [];\n var fullData = cd[0].trace;\n\n var nodes = fullData._sankey.graph.nodes;\n\n for(var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n if(node.partOfGroup) continue; // Those are invisible\n\n // Position of node's centroid\n var pos = [(node.x0 + node.x1) / 2, (node.y0 + node.y1) / 2];\n\n // Swap x and y if trace is vertical\n if(fullData.orientation === 'v') pos.reverse();\n\n if(selectionTester && selectionTester.contains(pos, false, i, searchInfo)) {\n selection.push({\n pointNumber: node.pointNumber\n // TODO: add eventData\n });\n }\n }\n return selection;\n};\n\n},{}],1133:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\n\n// arrayOk attributes, merge them into calcdata array\nmodule.exports = function arraysToCalcdata(cd, trace) {\n // so each point knows which index it originally came from\n for(var i = 0; i < cd.length; i++) cd[i].i = i;\n\n Lib.mergeArray(trace.text, cd, 'tx');\n Lib.mergeArray(trace.texttemplate, cd, 'txt');\n Lib.mergeArray(trace.hovertext, cd, 'htx');\n Lib.mergeArray(trace.customdata, cd, 'data');\n Lib.mergeArray(trace.textposition, cd, 'tp');\n if(trace.textfont) {\n Lib.mergeArrayCastPositive(trace.textfont.size, cd, 'ts');\n Lib.mergeArray(trace.textfont.color, cd, 'tc');\n Lib.mergeArray(trace.textfont.family, cd, 'tf');\n }\n\n var marker = trace.marker;\n if(marker) {\n Lib.mergeArrayCastPositive(marker.size, cd, 'ms');\n Lib.mergeArrayCastPositive(marker.opacity, cd, 'mo');\n Lib.mergeArray(marker.symbol, cd, 'mx');\n Lib.mergeArray(marker.color, cd, 'mc');\n\n var markerLine = marker.line;\n if(marker.line) {\n Lib.mergeArray(markerLine.color, cd, 'mlc');\n Lib.mergeArrayCastPositive(markerLine.width, cd, 'mlw');\n }\n\n var markerGradient = marker.gradient;\n if(markerGradient && markerGradient.type !== 'none') {\n Lib.mergeArray(markerGradient.type, cd, 'mgt');\n Lib.mergeArray(markerGradient.color, cd, 'mgc');\n }\n }\n};\n\n},{\"../../lib\":728}],1134:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar texttemplateAttrs = _dereq_('../../plots/template_attributes').texttemplateAttrs;\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\nvar fontAttrs = _dereq_('../../plots/font_attributes');\nvar dash = _dereq_('../../components/drawing/attributes').dash;\n\nvar Drawing = _dereq_('../../components/drawing');\nvar constants = _dereq_('./constants');\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nmodule.exports = {\n x: {\n valType: 'data_array',\n editType: 'calc+clearAxisTypes',\n anim: true,\n \n },\n x0: {\n valType: 'any',\n dflt: 0,\n \n editType: 'calc+clearAxisTypes',\n anim: true,\n \n },\n dx: {\n valType: 'number',\n dflt: 1,\n \n editType: 'calc',\n anim: true,\n \n },\n y: {\n valType: 'data_array',\n editType: 'calc+clearAxisTypes',\n anim: true,\n \n },\n y0: {\n valType: 'any',\n dflt: 0,\n \n editType: 'calc+clearAxisTypes',\n anim: true,\n \n },\n dy: {\n valType: 'number',\n dflt: 1,\n \n editType: 'calc',\n anim: true,\n \n },\n\n stackgroup: {\n valType: 'string',\n \n dflt: '',\n editType: 'calc',\n \n },\n orientation: {\n valType: 'enumerated',\n \n values: ['v', 'h'],\n editType: 'calc',\n \n },\n groupnorm: {\n valType: 'enumerated',\n values: ['', 'fraction', 'percent'],\n dflt: '',\n \n editType: 'calc',\n \n },\n stackgaps: {\n valType: 'enumerated',\n values: ['infer zero', 'interpolate'],\n dflt: 'infer zero',\n \n editType: 'calc',\n \n },\n\n text: {\n valType: 'string',\n \n dflt: '',\n arrayOk: true,\n editType: 'calc',\n \n },\n\n texttemplate: texttemplateAttrs({}, {\n\n }),\n hovertext: {\n valType: 'string',\n \n dflt: '',\n arrayOk: true,\n editType: 'style',\n \n },\n mode: {\n valType: 'flaglist',\n flags: ['lines', 'markers', 'text'],\n extras: ['none'],\n \n editType: 'calc',\n \n },\n hoveron: {\n valType: 'flaglist',\n flags: ['points', 'fills'],\n \n editType: 'style',\n \n },\n hovertemplate: hovertemplateAttrs({}, {\n keys: constants.eventDataKeys\n }),\n line: {\n color: {\n valType: 'color',\n \n editType: 'style',\n anim: true,\n \n },\n width: {\n valType: 'number',\n min: 0,\n dflt: 2,\n \n editType: 'style',\n anim: true,\n \n },\n shape: {\n valType: 'enumerated',\n values: ['linear', 'spline', 'hv', 'vh', 'hvh', 'vhv'],\n dflt: 'linear',\n \n editType: 'plot',\n \n },\n smoothing: {\n valType: 'number',\n min: 0,\n max: 1.3,\n dflt: 1,\n \n editType: 'plot',\n \n },\n dash: extendFlat({}, dash, {editType: 'style'}),\n simplify: {\n valType: 'boolean',\n dflt: true,\n \n editType: 'plot',\n \n },\n editType: 'plot'\n },\n\n connectgaps: {\n valType: 'boolean',\n dflt: false,\n \n editType: 'calc',\n \n },\n cliponaxis: {\n valType: 'boolean',\n dflt: true,\n \n editType: 'plot',\n \n },\n\n fill: {\n valType: 'enumerated',\n values: ['none', 'tozeroy', 'tozerox', 'tonexty', 'tonextx', 'toself', 'tonext'],\n \n editType: 'calc',\n \n },\n fillcolor: {\n valType: 'color',\n \n editType: 'style',\n anim: true,\n \n },\n marker: extendFlat({\n symbol: {\n valType: 'enumerated',\n values: Drawing.symbolList,\n dflt: 'circle',\n arrayOk: true,\n \n editType: 'style',\n \n },\n opacity: {\n valType: 'number',\n min: 0,\n max: 1,\n arrayOk: true,\n \n editType: 'style',\n anim: true,\n \n },\n size: {\n valType: 'number',\n min: 0,\n dflt: 6,\n arrayOk: true,\n \n editType: 'calc',\n anim: true,\n \n },\n maxdisplayed: {\n valType: 'number',\n min: 0,\n dflt: 0,\n \n editType: 'plot',\n \n },\n sizeref: {\n valType: 'number',\n dflt: 1,\n \n editType: 'calc',\n \n },\n sizemin: {\n valType: 'number',\n min: 0,\n dflt: 0,\n \n editType: 'calc',\n \n },\n sizemode: {\n valType: 'enumerated',\n values: ['diameter', 'area'],\n dflt: 'diameter',\n \n editType: 'calc',\n \n },\n\n line: extendFlat({\n width: {\n valType: 'number',\n min: 0,\n arrayOk: true,\n \n editType: 'style',\n anim: true,\n \n },\n editType: 'calc'\n },\n colorScaleAttrs('marker.line', {anim: true})\n ),\n gradient: {\n type: {\n valType: 'enumerated',\n values: ['radial', 'horizontal', 'vertical', 'none'],\n arrayOk: true,\n dflt: 'none',\n \n editType: 'calc',\n \n },\n color: {\n valType: 'color',\n arrayOk: true,\n \n editType: 'calc',\n \n },\n editType: 'calc'\n },\n editType: 'calc'\n },\n colorScaleAttrs('marker', {anim: true})\n ),\n selected: {\n marker: {\n opacity: {\n valType: 'number',\n min: 0,\n max: 1,\n \n editType: 'style',\n \n },\n color: {\n valType: 'color',\n \n editType: 'style',\n \n },\n size: {\n valType: 'number',\n min: 0,\n \n editType: 'style',\n \n },\n editType: 'style'\n },\n textfont: {\n color: {\n valType: 'color',\n \n editType: 'style',\n \n },\n editType: 'style'\n },\n editType: 'style'\n },\n unselected: {\n marker: {\n opacity: {\n valType: 'number',\n min: 0,\n max: 1,\n \n editType: 'style',\n \n },\n color: {\n valType: 'color',\n \n editType: 'style',\n \n },\n size: {\n valType: 'number',\n min: 0,\n \n editType: 'style',\n \n },\n editType: 'style'\n },\n textfont: {\n color: {\n valType: 'color',\n \n editType: 'style',\n \n },\n editType: 'style'\n },\n editType: 'style'\n },\n\n textposition: {\n valType: 'enumerated',\n values: [\n 'top left', 'top center', 'top right',\n 'middle left', 'middle center', 'middle right',\n 'bottom left', 'bottom center', 'bottom right'\n ],\n dflt: 'middle center',\n arrayOk: true,\n \n editType: 'calc',\n \n },\n textfont: fontAttrs({\n editType: 'calc',\n colorEditType: 'style',\n arrayOk: true,\n \n }),\n\n r: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n t: {\n valType: 'data_array',\n editType: 'calc',\n \n }\n};\n\n},{\"../../components/colorscale/attributes\":602,\"../../components/drawing\":617,\"../../components/drawing/attributes\":616,\"../../lib/extend\":719,\"../../plots/font_attributes\":804,\"../../plots/template_attributes\":854,\"./constants\":1138}],1135:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar Lib = _dereq_('../../lib');\n\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\n\nvar subTypes = _dereq_('./subtypes');\nvar calcColorscale = _dereq_('./colorscale_calc');\nvar arraysToCalcdata = _dereq_('./arrays_to_calcdata');\nvar calcSelection = _dereq_('./calc_selection');\n\nfunction 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 x = xa.makeCalcdata(trace, 'x');\n var y = ya.makeCalcdata(trace, 'y');\n var serieslen = trace._length;\n var cd = new Array(serieslen);\n var ids = trace.ids;\n var stackGroupOpts = getStackOpts(trace, fullLayout, xa, ya);\n var interpolateGaps = false;\n var isV, i, j, k, interpolate, vali;\n\n setFirstScatter(fullLayout, trace);\n\n var xAttr = 'x';\n var yAttr = 'y';\n var posAttr;\n if(stackGroupOpts) {\n Lib.pushUnique(stackGroupOpts.traceIndices, trace._expandedIndex);\n isV = stackGroupOpts.orientation === 'v';\n\n // size, like we use for bar\n if(isV) {\n yAttr = 's';\n posAttr = 'x';\n } else {\n xAttr = 's';\n posAttr = 'y';\n }\n interpolate = stackGroupOpts.stackgaps === 'interpolate';\n } else {\n var ppad = calcMarkerSize(trace, serieslen);\n calcAxisExpansion(gd, trace, xa, ya, x, y, ppad);\n }\n\n for(i = 0; i < serieslen; i++) {\n var cdi = cd[i] = {};\n var xValid = isNumeric(x[i]);\n var yValid = isNumeric(y[i]);\n if(xValid && yValid) {\n cdi[xAttr] = x[i];\n cdi[yAttr] = y[i];\n } else if(stackGroupOpts && (isV ? xValid : yValid)) {\n // if we're stacking we need to hold on to all valid positions\n // even with invalid sizes\n\n cdi[posAttr] = isV ? x[i] : y[i];\n cdi.gap = true;\n if(interpolate) {\n cdi.s = BADNUM;\n interpolateGaps = true;\n } else {\n cdi.s = 0;\n }\n } else {\n cdi[xAttr] = cdi[yAttr] = BADNUM;\n }\n\n if(ids) {\n cdi.id = String(ids[i]);\n }\n }\n\n arraysToCalcdata(cd, trace);\n calcColorscale(gd, trace);\n calcSelection(cd, trace);\n\n if(stackGroupOpts) {\n // remove bad positions and sort\n // note that original indices get added to cd in arraysToCalcdata\n i = 0;\n while(i < cd.length) {\n if(cd[i][posAttr] === BADNUM) {\n cd.splice(i, 1);\n } else i++;\n }\n\n Lib.sort(cd, function(a, b) {\n return (a[posAttr] - b[posAttr]) || (a.i - b.i);\n });\n\n if(interpolateGaps) {\n // first fill the beginning with constant from the first point\n i = 0;\n while(i < cd.length - 1 && cd[i].gap) {\n i++;\n }\n vali = cd[i].s;\n if(!vali) vali = cd[i].s = 0; // in case of no data AT ALL in this trace - use 0\n for(j = 0; j < i; j++) {\n cd[j].s = vali;\n }\n // then fill the end with constant from the last point\n k = cd.length - 1;\n while(k > i && cd[k].gap) {\n k--;\n }\n vali = cd[k].s;\n for(j = cd.length - 1; j > k; j--) {\n cd[j].s = vali;\n }\n // now interpolate internal gaps linearly\n while(i < k) {\n i++;\n if(cd[i].gap) {\n j = i + 1;\n while(cd[j].gap) {\n j++;\n }\n var pos0 = cd[i - 1][posAttr];\n var size0 = cd[i - 1].s;\n var m = (cd[j].s - size0) / (cd[j][posAttr] - pos0);\n while(i < j) {\n cd[i].s = size0 + (cd[i][posAttr] - pos0) * m;\n i++;\n }\n }\n }\n }\n }\n\n return cd;\n}\n\nfunction calcAxisExpansion(gd, trace, xa, ya, x, y, ppad) {\n var serieslen = trace._length;\n var fullLayout = gd._fullLayout;\n var xId = xa._id;\n var yId = ya._id;\n var firstScatter = fullLayout._firstScatter[firstScatterGroup(trace)] === trace.uid;\n var stackOrientation = (getStackOpts(trace, fullLayout, xa, ya) || {}).orientation;\n var fill = trace.fill;\n\n // cancel minimum tick spacings (only applies to bars and boxes)\n xa._minDtick = 0;\n ya._minDtick = 0;\n\n // check whether bounds should be tight, padded, extended to zero...\n // most cases both should be padded on both ends, so start with that.\n var xOptions = {padded: true};\n var yOptions = {padded: true};\n\n if(ppad) {\n xOptions.ppad = yOptions.ppad = ppad;\n }\n\n // TODO: text size\n\n var openEnded = serieslen < 2 || (x[0] !== x[serieslen - 1]) || (y[0] !== y[serieslen - 1]);\n\n if(openEnded && (\n (fill === 'tozerox') ||\n ((fill === 'tonextx') && (firstScatter || stackOrientation === 'h'))\n )) {\n // include zero (tight) and extremes (padded) if fill to zero\n // (unless the shape is closed, then it's just filling the shape regardless)\n\n xOptions.tozero = true;\n } else if(!(trace.error_y || {}).visible && (\n // if no error bars, markers or text, or fill to y=0 remove x padding\n\n (fill === 'tonexty' || fill === 'tozeroy') ||\n (!subTypes.hasMarkers(trace) && !subTypes.hasText(trace))\n )) {\n xOptions.padded = false;\n xOptions.ppad = 0;\n }\n\n if(openEnded && (\n (fill === 'tozeroy') ||\n ((fill === 'tonexty') && (firstScatter || stackOrientation === 'v'))\n )) {\n // now check for y - rather different logic, though still mostly padded both ends\n // include zero (tight) and extremes (padded) if fill to zero\n // (unless the shape is closed, then it's just filling the shape regardless)\n\n yOptions.tozero = true;\n } else if(fill === 'tonextx' || fill === 'tozerox') {\n // tight y: any x fill\n\n yOptions.padded = false;\n }\n\n // N.B. asymmetric splom traces call this with blank {} xa or ya\n if(xId) trace._extremes[xId] = Axes.findExtremes(xa, x, xOptions);\n if(yId) trace._extremes[yId] = Axes.findExtremes(ya, y, yOptions);\n}\n\nfunction calcMarkerSize(trace, serieslen) {\n if(!subTypes.hasMarkers(trace)) return;\n\n // Treat size like x or y arrays --- Run d2c\n // this needs to go before ppad computation\n var marker = trace.marker;\n var sizeref = 1.6 * (trace.marker.sizeref || 1);\n var markerTrans;\n\n if(trace.marker.sizemode === 'area') {\n markerTrans = function(v) {\n return Math.max(Math.sqrt((v || 0) / sizeref), 3);\n };\n } else {\n markerTrans = function(v) {\n return Math.max((v || 0) / sizeref, 3);\n };\n }\n\n if(Lib.isArrayOrTypedArray(marker.size)) {\n // I tried auto-type but category and dates dont make much sense.\n var ax = {type: 'linear'};\n Axes.setConvert(ax);\n\n var s = ax.makeCalcdata(trace.marker, 'size');\n\n var sizeOut = new Array(serieslen);\n for(var i = 0; i < serieslen; i++) {\n sizeOut[i] = markerTrans(s[i]);\n }\n return sizeOut;\n } else {\n return markerTrans(marker.size);\n }\n}\n\n/**\n * mark the first scatter trace for each subplot\n * note that scatter and scattergl each get their own first trace\n * note also that I'm doing this during calc rather than supplyDefaults\n * so I don't need to worry about transforms, but if we ever do\n * per-trace calc this will get confused.\n */\nfunction setFirstScatter(fullLayout, trace) {\n var group = firstScatterGroup(trace);\n var firstScatter = fullLayout._firstScatter;\n if(!firstScatter[group]) firstScatter[group] = trace.uid;\n}\n\nfunction firstScatterGroup(trace) {\n var stackGroup = trace.stackgroup;\n return trace.xaxis + trace.yaxis + trace.type +\n (stackGroup ? '-' + stackGroup : '');\n}\n\nfunction getStackOpts(trace, fullLayout, xa, ya) {\n var stackGroup = trace.stackgroup;\n if(!stackGroup) return;\n var stackOpts = fullLayout._scatterStackOpts[xa._id + ya._id][stackGroup];\n var stackAx = stackOpts.orientation === 'v' ? ya : xa;\n // Allow stacking only on numeric axes\n // calc is a little late to be figuring this out, but during supplyDefaults\n // we don't know the axis type yet\n if(stackAx.type === 'linear' || stackAx.type === 'log') return stackOpts;\n}\n\nmodule.exports = {\n calc: calc,\n calcMarkerSize: calcMarkerSize,\n calcAxisExpansion: calcAxisExpansion,\n setFirstScatter: setFirstScatter,\n getStackOpts: getStackOpts\n};\n\n},{\"../../constants/numerical\":704,\"../../lib\":728,\"../../plots/cartesian/axes\":776,\"./arrays_to_calcdata\":1133,\"./calc_selection\":1136,\"./colorscale_calc\":1137,\"./subtypes\":1158,\"fast-isnumeric\":236}],1136:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nmodule.exports = function calcSelection(cd, trace) {\n if(Lib.isArrayOrTypedArray(trace.selectedpoints)) {\n Lib.tagSelected(cd, trace);\n }\n};\n\n},{\"../../lib\":728}],1137:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar hasColorscale = _dereq_('../../components/colorscale/helpers').hasColorscale;\nvar calcColorscale = _dereq_('../../components/colorscale/calc');\n\nvar subTypes = _dereq_('./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\n},{\"../../components/colorscale/calc\":603,\"../../components/colorscale/helpers\":606,\"./subtypes\":1158}],1138:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\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\n},{}],1139:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar calc = _dereq_('./calc');\n\n/*\n * Scatter stacking & normalization calculations\n * runs per subplot, and can handle multiple stacking groups\n */\n\nmodule.exports = function crossTraceCalc(gd, plotinfo) {\n var xa = plotinfo.xaxis;\n var ya = plotinfo.yaxis;\n var subplot = xa._id + ya._id;\n\n var subplotStackOpts = gd._fullLayout._scatterStackOpts[subplot];\n if(!subplotStackOpts) return;\n\n var calcTraces = gd.calcdata;\n\n var i, j, k, i2, cd, cd0, posj, sumj, norm;\n var groupOpts, interpolate, groupnorm, posAttr, valAttr;\n var hasAnyBlanks;\n\n for(var stackGroup in subplotStackOpts) {\n groupOpts = subplotStackOpts[stackGroup];\n var indices = groupOpts.traceIndices;\n\n // can get here with no indices if the stack axis is non-numeric\n if(!indices.length) continue;\n\n interpolate = groupOpts.stackgaps === 'interpolate';\n groupnorm = groupOpts.groupnorm;\n if(groupOpts.orientation === 'v') {\n posAttr = 'x';\n valAttr = 'y';\n } else {\n posAttr = 'y';\n valAttr = 'x';\n }\n hasAnyBlanks = new Array(indices.length);\n for(i = 0; i < hasAnyBlanks.length; i++) {\n hasAnyBlanks[i] = false;\n }\n\n // Collect the complete set of all positions across ALL traces.\n // Start with the first trace, then interleave items from later traces\n // as needed.\n // Fill in mising items as we go.\n cd0 = calcTraces[indices[0]];\n var allPositions = new Array(cd0.length);\n for(i = 0; i < cd0.length; i++) {\n allPositions[i] = cd0[i][posAttr];\n }\n\n for(i = 1; i < indices.length; i++) {\n cd = calcTraces[indices[i]];\n\n for(j = k = 0; j < cd.length; j++) {\n posj = cd[j][posAttr];\n for(; posj > allPositions[k] && k < allPositions.length; k++) {\n // the current trace is missing a position from some previous trace(s)\n insertBlank(cd, j, allPositions[k], i, hasAnyBlanks, interpolate, posAttr);\n j++;\n }\n if(posj !== allPositions[k]) {\n // previous trace(s) are missing a position from the current trace\n for(i2 = 0; i2 < i; i2++) {\n insertBlank(calcTraces[indices[i2]], k, posj, i2, hasAnyBlanks, interpolate, posAttr);\n }\n allPositions.splice(k, 0, posj);\n }\n k++;\n }\n for(; k < allPositions.length; k++) {\n insertBlank(cd, j, allPositions[k], i, hasAnyBlanks, interpolate, posAttr);\n j++;\n }\n }\n\n var serieslen = allPositions.length;\n\n // stack (and normalize)!\n for(j = 0; j < cd0.length; j++) {\n sumj = cd0[j][valAttr] = cd0[j].s;\n for(i = 1; i < indices.length; i++) {\n cd = calcTraces[indices[i]];\n cd[0].trace._rawLength = cd[0].trace._length;\n cd[0].trace._length = serieslen;\n sumj += cd[j].s;\n cd[j][valAttr] = sumj;\n }\n\n if(groupnorm) {\n norm = ((groupnorm === 'fraction') ? sumj : (sumj / 100)) || 1;\n for(i = 0; i < indices.length; i++) {\n var cdj = calcTraces[indices[i]][j];\n cdj[valAttr] /= norm;\n cdj.sNorm = cdj.s / norm;\n }\n }\n }\n\n // autorange\n for(i = 0; i < indices.length; i++) {\n cd = calcTraces[indices[i]];\n var trace = cd[0].trace;\n var ppad = calc.calcMarkerSize(trace, trace._rawLength);\n var arrayPad = Array.isArray(ppad);\n if((ppad && hasAnyBlanks[i]) || arrayPad) {\n var ppadRaw = ppad;\n ppad = new Array(serieslen);\n for(j = 0; j < serieslen; j++) {\n ppad[j] = cd[j].gap ? 0 : (arrayPad ? ppadRaw[cd[j].i] : ppadRaw);\n }\n }\n var x = new Array(serieslen);\n var y = new Array(serieslen);\n for(j = 0; j < serieslen; j++) {\n x[j] = cd[j].x;\n y[j] = cd[j].y;\n }\n calc.calcAxisExpansion(gd, trace, xa, ya, x, y, ppad);\n\n // while we're here (in a loop over all traces in the stack)\n // record the orientation, so hover can find it easily\n cd[0].t.orientation = groupOpts.orientation;\n }\n }\n};\n\nfunction insertBlank(calcTrace, index, position, traceIndex, hasAnyBlanks, interpolate, posAttr) {\n hasAnyBlanks[traceIndex] = true;\n var newEntry = {\n i: null,\n gap: true,\n s: 0\n };\n newEntry[posAttr] = position;\n calcTrace.splice(index, 0, newEntry);\n // Even if we're not interpolating, if one trace has multiple\n // values at the same position and this trace only has one value there,\n // we just duplicate that one value rather than insert a zero.\n // We also make it look like a real point - because it's ambiguous which\n // one really is the real one!\n if(index && position === calcTrace[index - 1][posAttr]) {\n var prevEntry = calcTrace[index - 1];\n newEntry.s = prevEntry.s;\n // TODO is it going to cause any problems to have multiple\n // calcdata points with the same index?\n newEntry.i = prevEntry.i;\n newEntry.gap = prevEntry.gap;\n } else if(interpolate) {\n newEntry.s = getInterp(calcTrace, index, position, posAttr);\n }\n if(!index) {\n // t and trace need to stay on the first cd entry\n calcTrace[0].t = calcTrace[1].t;\n calcTrace[0].trace = calcTrace[1].trace;\n delete calcTrace[1].t;\n delete calcTrace[1].trace;\n }\n}\n\nfunction getInterp(calcTrace, index, position, posAttr) {\n var pt0 = calcTrace[index - 1];\n var pt1 = calcTrace[index + 1];\n if(!pt1) return pt0.s;\n if(!pt0) return pt1.s;\n return pt0.s + (pt1.s - pt0.s) * (position - pt0[posAttr]) / (pt1[posAttr] - pt0[posAttr]);\n}\n\n},{\"./calc\":1135}],1140:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\n// remove opacity for any trace that has a fill or is filled to\nmodule.exports = function crossTraceDefaults(fullData) {\n for(var 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\n},{}],1141:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Registry = _dereq_('../../registry');\n\nvar attributes = _dereq_('./attributes');\nvar constants = _dereq_('./constants');\nvar subTypes = _dereq_('./subtypes');\nvar handleXYDefaults = _dereq_('./xy_defaults');\nvar handleStackDefaults = _dereq_('./stack_defaults');\nvar handleMarkerDefaults = _dereq_('./marker_defaults');\nvar handleLineDefaults = _dereq_('./line_defaults');\nvar handleLineShapeDefaults = _dereq_('./line_shape_defaults');\nvar handleTextDefaults = _dereq_('./text_defaults');\nvar handleFillColorDefaults = _dereq_('./fillcolor_defaults');\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 len = handleXYDefaults(traceIn, traceOut, layout, coerce);\n if(!len) traceOut.visible = false;\n\n if(!traceOut.visible) return;\n\n var stackGroupOpts = handleStackDefaults(traceIn, traceOut, layout, coerce);\n\n var defaultMode = !stackGroupOpts && (len < constants.PTS_LINESONLY) ?\n 'lines+markers' : 'lines';\n coerce('text');\n coerce('hovertext');\n coerce('mode', defaultMode);\n\n if(subTypes.hasLines(traceOut)) {\n handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce);\n handleLineShapeDefaults(traceIn, traceOut, coerce);\n coerce('connectgaps');\n coerce('line.simplify');\n }\n\n if(subTypes.hasMarkers(traceOut)) {\n handleMarkerDefaults(traceIn, traceOut, defaultColor, layout, coerce, {gradient: true});\n }\n\n if(subTypes.hasText(traceOut)) {\n coerce('texttemplate');\n handleTextDefaults(traceIn, traceOut, layout, coerce);\n }\n\n var dfltHoverOn = [];\n\n if(subTypes.hasMarkers(traceOut) || subTypes.hasText(traceOut)) {\n coerce('cliponaxis');\n coerce('marker.maxdisplayed');\n dfltHoverOn.push('points');\n }\n\n // It's possible for this default to be changed by a later trace.\n // We handle that case in some hacky code inside handleStackDefaults.\n coerce('fill', stackGroupOpts ? stackGroupOpts.fillDflt : 'none');\n if(traceOut.fill !== 'none') {\n handleFillColorDefaults(traceIn, traceOut, defaultColor, coerce);\n if(!subTypes.hasLines(traceOut)) handleLineShapeDefaults(traceIn, traceOut, coerce);\n }\n\n var lineColor = (traceOut.line || {}).color;\n var markerColor = (traceOut.marker || {}).color;\n\n if(traceOut.fill === 'tonext' || traceOut.fill === 'toself') {\n dfltHoverOn.push('fills');\n }\n coerce('hoveron', dfltHoverOn.join('+') || 'points');\n if(traceOut.hoveron !== 'fills') coerce('hovertemplate');\n var errorBarsSupplyDefaults = Registry.getComponentMethod('errorbars', 'supplyDefaults');\n errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'y'});\n errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'x', inherit: 'y'});\n\n Lib.coerceSelectionMarkerOpacity(traceOut, coerce);\n};\n\n},{\"../../lib\":728,\"../../registry\":859,\"./attributes\":1134,\"./constants\":1138,\"./fillcolor_defaults\":1142,\"./line_defaults\":1147,\"./line_shape_defaults\":1149,\"./marker_defaults\":1153,\"./stack_defaults\":1156,\"./subtypes\":1158,\"./text_defaults\":1159,\"./xy_defaults\":1160}],1142:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Color = _dereq_('../../components/color');\nvar isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray;\n\nmodule.exports = function fillColorDefaults(traceIn, traceOut, defaultColor, coerce) {\n var inheritColorFromMarker = false;\n\n if(traceOut.marker) {\n // don't try to inherit a color array\n var markerColor = traceOut.marker.color;\n var markerLineColor = (traceOut.marker.line || {}).color;\n\n if(markerColor && !isArrayOrTypedArray(markerColor)) {\n inheritColorFromMarker = markerColor;\n } else if(markerLineColor && !isArrayOrTypedArray(markerLineColor)) {\n inheritColorFromMarker = markerLineColor;\n }\n }\n\n coerce('fillcolor', Color.addOpacity(\n (traceOut.line || {}).color ||\n inheritColorFromMarker ||\n defaultColor, 0.5\n ));\n};\n\n},{\"../../components/color\":595,\"../../lib\":728}],1143:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Axes = _dereq_('../../plots/cartesian/axes');\n\nmodule.exports = function formatLabels(cdi, trace, fullLayout) {\n var labels = {};\n\n var mockGd = {_fullLayout: fullLayout};\n var xa = Axes.getFromTrace(mockGd, trace, 'x');\n var ya = Axes.getFromTrace(mockGd, trace, 'y');\n\n labels.xLabel = Axes.tickText(xa, cdi.x, true).text;\n labels.yLabel = Axes.tickText(ya, cdi.y, true).text;\n\n return labels;\n};\n\n},{\"../../plots/cartesian/axes\":776}],1144:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Color = _dereq_('../../components/color');\nvar subtypes = _dereq_('./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\n},{\"../../components/color\":595,\"./subtypes\":1158}],1145:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Fx = _dereq_('../../components/fx');\nvar Registry = _dereq_('../../registry');\nvar getTraceColor = _dereq_('./get_trace_color');\nvar Color = _dereq_('../../components/color');\nvar fillText = Lib.fillText;\n\nmodule.exports = function hoverPoints(pointData, xval, yval, hovermode) {\n var cd = pointData.cd;\n var trace = cd[0].trace;\n var xa = pointData.xa;\n var ya = pointData.ya;\n var xpx = xa.c2p(xval);\n var ypx = ya.c2p(yval);\n var pt = [xpx, ypx];\n var hoveron = trace.hoveron || '';\n var minRad = (trace.mode.indexOf('markers') !== -1) ? 3 : 0.5;\n\n // look for points to hover on first, then take fills only if we\n // didn't find a point\n if(hoveron.indexOf('points') !== -1) {\n var dx = function(di) {\n // dx and dy are used in compare modes - here we want to always\n // prioritize the closest data point, at least as long as markers are\n // the same size or nonexistent, but still try to prioritize small markers too.\n var rad = Math.max(3, di.mrc || 0);\n var kink = 1 - 1 / rad;\n var dxRaw = Math.abs(xa.c2p(di.x) - xpx);\n var d = (dxRaw < rad) ? (kink * dxRaw / rad) : (dxRaw - rad + kink);\n return d;\n };\n var dy = function(di) {\n var rad = Math.max(3, di.mrc || 0);\n var kink = 1 - 1 / rad;\n var dyRaw = Math.abs(ya.c2p(di.y) - ypx);\n return (dyRaw < rad) ? (kink * dyRaw / rad) : (dyRaw - rad + kink);\n };\n var dxy = function(di) {\n // scatter points: d.mrc is the calculated marker radius\n // adjust the distance so if you're inside the marker it\n // always will show up regardless of point size, but\n // prioritize smaller points\n var rad = Math.max(minRad, di.mrc || 0);\n var dx = xa.c2p(di.x) - xpx;\n var dy = ya.c2p(di.y) - ypx;\n return Math.max(Math.sqrt(dx * dx + dy * dy) - rad, 1 - minRad / rad);\n };\n var distfn = Fx.getDistanceFunction(hovermode, dx, dy, dxy);\n\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) {\n // the closest data point\n var di = cd[pointData.index];\n var xc = xa.c2p(di.x, true);\n var yc = ya.c2p(di.y, true);\n var rad = di.mrc || 1;\n\n // now we're done using the whole `calcdata` array, replace the\n // index with the original index (in case of inserted point from\n // stacked area)\n pointData.index = di.i;\n\n var orientation = cd[0].t.orientation;\n // TODO: for scatter and bar, option to show (sub)totals and\n // raw data? Currently stacked and/or normalized bars just show\n // the normalized individual sizes, so that's what I'm doing here\n // for now.\n var sizeVal = orientation && (di.sNorm || di.s);\n var xLabelVal = (orientation === 'h') ? sizeVal : di.x;\n var yLabelVal = (orientation === 'v') ? sizeVal : di.y;\n\n Lib.extendFlat(pointData, {\n color: getTraceColor(trace, di),\n\n x0: xc - rad,\n x1: xc + rad,\n xLabelVal: xLabelVal,\n\n y0: yc - rad,\n y1: yc + rad,\n yLabelVal: yLabelVal,\n\n spikeDistance: dxy(di),\n hovertemplate: trace.hovertemplate\n });\n\n fillText(di, trace, pointData);\n Registry.getComponentMethod('errorbars', 'hoverInfo')(di, trace, pointData);\n\n return [pointData];\n }\n }\n\n // even if hoveron is 'fills', only use it if we have polygons too\n if(hoveron.indexOf('fills') !== -1 && trace._polygons) {\n var polygons = trace._polygons;\n var polygonsIn = [];\n var inside = false;\n var xmin = Infinity;\n var xmax = -Infinity;\n var ymin = Infinity;\n var ymax = -Infinity;\n\n var i, j, polygon, pts, xCross, x0, x1, y0, y1;\n\n for(i = 0; i < polygons.length; i++) {\n polygon = polygons[i];\n // TODO: this is not going to work right for curved edges, it will\n // act as though they're straight. That's probably going to need\n // the elements themselves to capture the events. Worth it?\n if(polygon.contains(pt)) {\n inside = !inside;\n // TODO: need better than just the overall bounding box\n polygonsIn.push(polygon);\n ymin = Math.min(ymin, polygon.ymin);\n ymax = Math.max(ymax, polygon.ymax);\n }\n }\n\n if(inside) {\n // constrain ymin/max to the visible plot, so the label goes\n // at the middle of the piece you can see\n ymin = Math.max(ymin, 0);\n ymax = Math.min(ymax, ya._length);\n\n // find the overall left-most and right-most points of the\n // polygon(s) we're inside at their combined vertical midpoint.\n // This is where we will draw the hover label.\n // Note that this might not be the vertical midpoint of the\n // whole trace, if it's disjoint.\n var yAvg = (ymin + ymax) / 2;\n for(i = 0; i < polygonsIn.length; i++) {\n pts = polygonsIn[i].pts;\n for(j = 1; j < pts.length; j++) {\n y0 = pts[j - 1][1];\n y1 = pts[j][1];\n if((y0 > yAvg) !== (y1 >= yAvg)) {\n x0 = pts[j - 1][0];\n x1 = pts[j][0];\n if(y1 - y0) {\n xCross = x0 + (x1 - x0) * (yAvg - y0) / (y1 - y0);\n xmin = Math.min(xmin, xCross);\n xmax = Math.max(xmax, xCross);\n }\n }\n }\n }\n\n // constrain xmin/max to the visible plot now too\n xmin = Math.max(xmin, 0);\n xmax = Math.min(xmax, xa._length);\n\n // get only fill or line color for the hover color\n var color = Color.defaultLine;\n if(Color.opacity(trace.fillcolor)) color = trace.fillcolor;\n else if(Color.opacity((trace.line || {}).color)) {\n color = trace.line.color;\n }\n\n Lib.extendFlat(pointData, {\n // never let a 2D override 1D type as closest point\n // also: no spikeDistance, it's not allowed for fills\n distance: pointData.maxHoverDistance,\n x0: xmin,\n x1: xmax,\n y0: yAvg,\n y1: yAvg,\n color: color,\n hovertemplate: false\n });\n\n delete pointData.index;\n\n if(trace.text && !Array.isArray(trace.text)) {\n pointData.text = String(trace.text);\n } else pointData.text = trace.name;\n\n return [pointData];\n }\n }\n};\n\n},{\"../../components/color\":595,\"../../components/fx\":635,\"../../lib\":728,\"../../registry\":859,\"./get_trace_color\":1144}],1146:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar subtypes = _dereq_('./subtypes');\n\nmodule.exports = {\n hasLines: subtypes.hasLines,\n hasMarkers: subtypes.hasMarkers,\n hasText: subtypes.hasText,\n isBubble: subtypes.isBubble,\n\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults'),\n crossTraceDefaults: _dereq_('./cross_trace_defaults'),\n calc: _dereq_('./calc').calc,\n crossTraceCalc: _dereq_('./cross_trace_calc'),\n arraysToCalcdata: _dereq_('./arrays_to_calcdata'),\n plot: _dereq_('./plot'),\n colorbar: _dereq_('./marker_colorbar'),\n formatLabels: _dereq_('./format_labels'),\n style: _dereq_('./style').style,\n styleOnSelect: _dereq_('./style').styleOnSelect,\n hoverPoints: _dereq_('./hover'),\n selectPoints: _dereq_('./select'),\n animatable: true,\n\n moduleType: 'trace',\n name: 'scatter',\n basePlotModule: _dereq_('../../plots/cartesian'),\n categories: [\n 'cartesian', 'svg', 'symbols', 'errorBarsOK', 'showLegend', 'scatter-like',\n 'zoomScale'\n ],\n meta: {\n \n }\n};\n\n},{\"../../plots/cartesian\":789,\"./arrays_to_calcdata\":1133,\"./attributes\":1134,\"./calc\":1135,\"./cross_trace_calc\":1139,\"./cross_trace_defaults\":1140,\"./defaults\":1141,\"./format_labels\":1143,\"./hover\":1145,\"./marker_colorbar\":1152,\"./plot\":1154,\"./select\":1155,\"./style\":1157,\"./subtypes\":1158}],1147:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray;\nvar hasColorscale = _dereq_('../../components/colorscale/helpers').hasColorscale;\nvar colorscaleDefaults = _dereq_('../../components/colorscale/defaults');\n\nmodule.exports = function lineDefaults(traceIn, traceOut, defaultColor, layout, coerce, opts) {\n var markerColor = (traceIn.marker || {}).color;\n\n coerce('line.color', defaultColor);\n\n if(hasColorscale(traceIn, 'line')) {\n colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: 'line.', cLetter: 'c'});\n } else {\n var lineColorDflt = (isArrayOrTypedArray(markerColor) ? false : markerColor) || defaultColor;\n coerce('line.color', lineColorDflt);\n }\n\n coerce('line.width');\n if(!(opts || {}).noDash) coerce('line.dash');\n};\n\n},{\"../../components/colorscale/defaults\":605,\"../../components/colorscale/helpers\":606,\"../../lib\":728}],1148:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar numConstants = _dereq_('../../constants/numerical');\nvar BADNUM = numConstants.BADNUM;\nvar LOG_CLIP = numConstants.LOG_CLIP;\nvar LOG_CLIP_PLUS = LOG_CLIP + 0.5;\nvar LOG_CLIP_MINUS = LOG_CLIP - 0.5;\nvar Lib = _dereq_('../../lib');\nvar segmentsIntersect = Lib.segmentsIntersect;\nvar constrain = Lib.constrain;\nvar constants = _dereq_('./constants');\n\n\nmodule.exports = function linePoints(d, opts) {\n var xa = opts.xaxis;\n var ya = opts.yaxis;\n var xLog = xa.type === 'log';\n var yLog = ya.type === 'log';\n var xLen = xa._length;\n var yLen = ya._length;\n var connectGaps = opts.connectGaps;\n var baseTolerance = opts.baseTolerance;\n var shape = opts.shape;\n var linear = shape === 'linear';\n var fill = opts.fill && opts.fill !== 'none';\n var segments = [];\n var minTolerance = constants.minTolerance;\n var len = d.length;\n var pts = new Array(len);\n var pti = 0;\n\n var i;\n\n // pt variables are pixel coordinates [x,y] of one point\n // these four are the outputs of clustering on a line\n var clusterStartPt, clusterEndPt, clusterHighPt, clusterLowPt;\n\n // \"this\" is the next point we're considering adding to the cluster\n var thisPt;\n\n // did we encounter the high point first, then a low point, or vice versa?\n var clusterHighFirst;\n\n // the first two points in the cluster determine its unit vector\n // so the second is always in the \"High\" direction\n var clusterUnitVector;\n\n // the pixel delta from clusterStartPt\n var thisVector;\n\n // val variables are (signed) pixel distances along the cluster vector\n var clusterRefDist, clusterHighVal, clusterLowVal, thisVal;\n\n // deviation variables are (signed) pixel distances normal to the cluster vector\n var clusterMinDeviation, clusterMaxDeviation, thisDeviation;\n\n // turn one calcdata point into pixel coordinates\n function getPt(index) {\n var di = d[index];\n if(!di) return false;\n var x = opts.linearized ? xa.l2p(di.x) : xa.c2p(di.x);\n var y = opts.linearized ? ya.l2p(di.y) : ya.c2p(di.y);\n\n // if non-positive log values, set them VERY far off-screen\n // so the line looks essentially straight from the previous point.\n if(x === BADNUM) {\n if(xLog) x = xa.c2p(di.x, true);\n if(x === BADNUM) return false;\n // If BOTH were bad log values, make the line follow a constant\n // exponent rather than a constant slope\n if(yLog && y === BADNUM) {\n x *= Math.abs(xa._m * yLen * (xa._m > 0 ? LOG_CLIP_PLUS : LOG_CLIP_MINUS) /\n (ya._m * xLen * (ya._m > 0 ? LOG_CLIP_PLUS : LOG_CLIP_MINUS)));\n }\n x *= 1000;\n }\n if(y === BADNUM) {\n if(yLog) y = ya.c2p(di.y, true);\n if(y === BADNUM) return false;\n y *= 1000;\n }\n return [x, y];\n }\n\n function crossesViewport(xFrac0, yFrac0, xFrac1, yFrac1) {\n var dx = xFrac1 - xFrac0;\n var dy = yFrac1 - yFrac0;\n var dx0 = 0.5 - xFrac0;\n var dy0 = 0.5 - yFrac0;\n var norm2 = dx * dx + dy * dy;\n var dot = dx * dx0 + dy * dy0;\n if(dot > 0 && dot < norm2) {\n var cross = dx0 * dy - dy0 * dx;\n if(cross * cross < norm2) return true;\n }\n }\n\n var latestXFrac, latestYFrac;\n // if we're off-screen, increase tolerance over baseTolerance\n function getTolerance(pt, nextPt) {\n var xFrac = pt[0] / xLen;\n var yFrac = pt[1] / yLen;\n var offScreenFraction = Math.max(0, -xFrac, xFrac - 1, -yFrac, yFrac - 1);\n if(offScreenFraction && (latestXFrac !== undefined) &&\n crossesViewport(xFrac, yFrac, latestXFrac, latestYFrac)\n ) {\n offScreenFraction = 0;\n }\n if(offScreenFraction && nextPt &&\n crossesViewport(xFrac, yFrac, nextPt[0] / xLen, nextPt[1] / yLen)\n ) {\n offScreenFraction = 0;\n }\n\n return (1 + constants.toleranceGrowth * offScreenFraction) * baseTolerance;\n }\n\n function ptDist(pt1, pt2) {\n var dx = pt1[0] - pt2[0];\n var dy = pt1[1] - pt2[1];\n return Math.sqrt(dx * dx + dy * dy);\n }\n\n // last bit of filtering: clip paths that are VERY far off-screen\n // so we don't get near the browser's hard limit (+/- 2^29 px in Chrome and FF)\n\n var maxScreensAway = constants.maxScreensAway;\n\n // find the intersections between the segment from pt1 to pt2\n // and the large rectangle maxScreensAway around the viewport\n // if one of pt1 and pt2 is inside and the other outside, there\n // will be only one intersection.\n // if both are outside there will be 0 or 2 intersections\n // (or 1 if it's right at a corner - we'll treat that like 0)\n // returns an array of intersection pts\n var xEdge0 = -xLen * maxScreensAway;\n var xEdge1 = xLen * (1 + maxScreensAway);\n var yEdge0 = -yLen * maxScreensAway;\n var yEdge1 = yLen * (1 + maxScreensAway);\n var edges = [\n [xEdge0, yEdge0, xEdge1, yEdge0],\n [xEdge1, yEdge0, xEdge1, yEdge1],\n [xEdge1, yEdge1, xEdge0, yEdge1],\n [xEdge0, yEdge1, xEdge0, yEdge0]\n ];\n var xEdge, yEdge, lastXEdge, lastYEdge, lastFarPt, edgePt;\n\n // for linear line shape, edge intersections should be linearly interpolated\n // spline uses this too, which isn't precisely correct but is actually pretty\n // good, because Catmull-Rom weights far-away points less in creating the curvature\n function getLinearEdgeIntersections(pt1, pt2) {\n var out = [];\n var ptCount = 0;\n for(var i = 0; i < 4; i++) {\n var edge = edges[i];\n var ptInt = segmentsIntersect(\n pt1[0], pt1[1], pt2[0], pt2[1],\n edge[0], edge[1], edge[2], edge[3]\n );\n if(ptInt && (!ptCount ||\n Math.abs(ptInt.x - out[0][0]) > 1 ||\n Math.abs(ptInt.y - out[0][1]) > 1\n )) {\n ptInt = [ptInt.x, ptInt.y];\n // if we have 2 intersections, make sure the closest one to pt1 comes first\n if(ptCount && ptDist(ptInt, pt1) < ptDist(out[0], pt1)) out.unshift(ptInt);\n else out.push(ptInt);\n ptCount++;\n }\n }\n return out;\n }\n\n function onlyConstrainedPoint(pt) {\n if(pt[0] < xEdge0 || pt[0] > xEdge1 || pt[1] < yEdge0 || pt[1] > yEdge1) {\n return [constrain(pt[0], xEdge0, xEdge1), constrain(pt[1], yEdge0, yEdge1)];\n }\n }\n\n function sameEdge(pt1, pt2) {\n if(pt1[0] === pt2[0] && (pt1[0] === xEdge0 || pt1[0] === xEdge1)) return true;\n if(pt1[1] === pt2[1] && (pt1[1] === yEdge0 || pt1[1] === yEdge1)) return true;\n }\n\n // for line shapes hv and vh, movement in the two dimensions is decoupled,\n // so all we need to do is constrain each dimension independently\n function getHVEdgeIntersections(pt1, pt2) {\n var out = [];\n var ptInt1 = onlyConstrainedPoint(pt1);\n var ptInt2 = onlyConstrainedPoint(pt2);\n if(ptInt1 && ptInt2 && sameEdge(ptInt1, ptInt2)) return out;\n\n if(ptInt1) out.push(ptInt1);\n if(ptInt2) out.push(ptInt2);\n return out;\n }\n\n // hvh and vhv we sometimes have to move one of the intersection points\n // out BEYOND the clipping rect, by a maximum of a factor of 2, so that\n // the midpoint line is drawn in the right place\n function getABAEdgeIntersections(dim, limit0, limit1) {\n return function(pt1, pt2) {\n var ptInt1 = onlyConstrainedPoint(pt1);\n var ptInt2 = onlyConstrainedPoint(pt2);\n\n var out = [];\n if(ptInt1 && ptInt2 && sameEdge(ptInt1, ptInt2)) return out;\n\n if(ptInt1) out.push(ptInt1);\n if(ptInt2) out.push(ptInt2);\n\n var midShift = 2 * Lib.constrain((pt1[dim] + pt2[dim]) / 2, limit0, limit1) -\n ((ptInt1 || pt1)[dim] + (ptInt2 || pt2)[dim]);\n if(midShift) {\n var ptToAlter;\n if(ptInt1 && ptInt2) {\n ptToAlter = (midShift > 0 === ptInt1[dim] > ptInt2[dim]) ? ptInt1 : ptInt2;\n } else ptToAlter = ptInt1 || ptInt2;\n\n ptToAlter[dim] += midShift;\n }\n\n return out;\n };\n }\n\n var getEdgeIntersections;\n if(shape === 'linear' || shape === 'spline') {\n getEdgeIntersections = getLinearEdgeIntersections;\n } else if(shape === 'hv' || shape === 'vh') {\n getEdgeIntersections = getHVEdgeIntersections;\n } else if(shape === 'hvh') getEdgeIntersections = getABAEdgeIntersections(0, xEdge0, xEdge1);\n else if(shape === 'vhv') getEdgeIntersections = getABAEdgeIntersections(1, yEdge0, yEdge1);\n\n // a segment pt1->pt2 entirely outside the nearby region:\n // find the corner it gets closest to touching\n function getClosestCorner(pt1, pt2) {\n var dx = pt2[0] - pt1[0];\n var m = (pt2[1] - pt1[1]) / dx;\n var b = (pt1[1] * pt2[0] - pt2[1] * pt1[0]) / dx;\n\n if(b > 0) return [m > 0 ? xEdge0 : xEdge1, yEdge1];\n else return [m > 0 ? xEdge1 : xEdge0, yEdge0];\n }\n\n function updateEdge(pt) {\n var x = pt[0];\n var y = pt[1];\n var xSame = x === pts[pti - 1][0];\n var ySame = y === pts[pti - 1][1];\n // duplicate point?\n if(xSame && ySame) return;\n if(pti > 1) {\n // backtracking along an edge?\n var xSame2 = x === pts[pti - 2][0];\n var ySame2 = y === pts[pti - 2][1];\n if(xSame && (x === xEdge0 || x === xEdge1) && xSame2) {\n if(ySame2) pti--; // backtracking exactly - drop prev pt and don't add\n else pts[pti - 1] = pt; // not exact: replace the prev pt\n } else if(ySame && (y === yEdge0 || y === yEdge1) && ySame2) {\n if(xSame2) pti--;\n else pts[pti - 1] = pt;\n } else pts[pti++] = pt;\n } else pts[pti++] = pt;\n }\n\n function updateEdgesForReentry(pt) {\n // if we're outside the nearby region and going back in,\n // we may need to loop around a corner point\n if(pts[pti - 1][0] !== pt[0] && pts[pti - 1][1] !== pt[1]) {\n updateEdge([lastXEdge, lastYEdge]);\n }\n updateEdge(pt);\n lastFarPt = null;\n lastXEdge = lastYEdge = 0;\n }\n\n function addPt(pt) {\n latestXFrac = pt[0] / xLen;\n latestYFrac = pt[1] / yLen;\n // Are we more than maxScreensAway off-screen any direction?\n // if so, clip to this box, but in such a way that on-screen\n // drawing is unchanged\n xEdge = (pt[0] < xEdge0) ? xEdge0 : (pt[0] > xEdge1) ? xEdge1 : 0;\n yEdge = (pt[1] < yEdge0) ? yEdge0 : (pt[1] > yEdge1) ? yEdge1 : 0;\n if(xEdge || yEdge) {\n if(!pti) {\n // to get fills right - if first point is far, push it toward the\n // screen in whichever direction(s) are far\n\n pts[pti++] = [xEdge || pt[0], yEdge || pt[1]];\n } else if(lastFarPt) {\n // both this point and the last are outside the nearby region\n // check if we're crossing the nearby region\n var intersections = getEdgeIntersections(lastFarPt, pt);\n if(intersections.length > 1) {\n updateEdgesForReentry(intersections[0]);\n pts[pti++] = intersections[1];\n }\n } else {\n // we're leaving the nearby region - add the point where we left it\n\n edgePt = getEdgeIntersections(pts[pti - 1], pt)[0];\n pts[pti++] = edgePt;\n }\n\n var lastPt = pts[pti - 1];\n if(xEdge && yEdge && (lastPt[0] !== xEdge || lastPt[1] !== yEdge)) {\n // we've gone out beyond a new corner: add the corner too\n // so that the next point will take the right winding\n if(lastFarPt) {\n if(lastXEdge !== xEdge && lastYEdge !== yEdge) {\n if(lastXEdge && lastYEdge) {\n // we've gone around to an opposite corner - we\n // need to add the correct extra corner\n // in order to get the right winding\n updateEdge(getClosestCorner(lastFarPt, pt));\n } else {\n // we're coming from a far edge - the extra corner\n // we need is determined uniquely by the sectors\n updateEdge([lastXEdge || xEdge, lastYEdge || yEdge]);\n }\n } else if(lastXEdge && lastYEdge) {\n updateEdge([lastXEdge, lastYEdge]);\n }\n }\n updateEdge([xEdge, yEdge]);\n } else if((lastXEdge - xEdge) && (lastYEdge - yEdge)) {\n // we're coming from an edge or far corner to an edge - again the\n // extra corner we need is uniquely determined by the sectors\n updateEdge([xEdge || lastXEdge, yEdge || lastYEdge]);\n }\n lastFarPt = pt;\n lastXEdge = xEdge;\n lastYEdge = yEdge;\n } else {\n if(lastFarPt) {\n // this point is in range but the previous wasn't: add its entry pt first\n updateEdgesForReentry(getEdgeIntersections(lastFarPt, pt)[0]);\n }\n\n pts[pti++] = pt;\n }\n }\n\n // loop over ALL points in this trace\n for(i = 0; i < len; i++) {\n clusterStartPt = getPt(i);\n if(!clusterStartPt) continue;\n\n pti = 0;\n lastFarPt = null;\n addPt(clusterStartPt);\n\n // loop over one segment of the trace\n for(i++; i < len; i++) {\n clusterHighPt = getPt(i);\n if(!clusterHighPt) {\n if(connectGaps) continue;\n else break;\n }\n\n // can't decimate if nonlinear line shape\n // TODO: we *could* decimate [hv]{2,3} shapes if we restricted clusters to horz or vert again\n // but spline would be verrry awkward to decimate\n if(!linear || !opts.simplify) {\n addPt(clusterHighPt);\n continue;\n }\n\n var nextPt = getPt(i + 1);\n\n clusterRefDist = ptDist(clusterHighPt, clusterStartPt);\n\n // #3147 - always include the very first and last points for fills\n if(!(fill && (pti === 0 || pti === len - 1)) &&\n clusterRefDist < getTolerance(clusterHighPt, nextPt) * minTolerance) continue;\n\n clusterUnitVector = [\n (clusterHighPt[0] - clusterStartPt[0]) / clusterRefDist,\n (clusterHighPt[1] - clusterStartPt[1]) / clusterRefDist\n ];\n\n clusterLowPt = clusterStartPt;\n clusterHighVal = clusterRefDist;\n clusterLowVal = clusterMinDeviation = clusterMaxDeviation = 0;\n clusterHighFirst = false;\n clusterEndPt = clusterHighPt;\n\n // loop over one cluster of points that collapse onto one line\n for(i++; i < d.length; i++) {\n thisPt = nextPt;\n nextPt = getPt(i + 1);\n if(!thisPt) {\n if(connectGaps) continue;\n else break;\n }\n thisVector = [\n thisPt[0] - clusterStartPt[0],\n thisPt[1] - clusterStartPt[1]\n ];\n // cross product (or dot with normal to the cluster vector)\n thisDeviation = thisVector[0] * clusterUnitVector[1] - thisVector[1] * clusterUnitVector[0];\n clusterMinDeviation = Math.min(clusterMinDeviation, thisDeviation);\n clusterMaxDeviation = Math.max(clusterMaxDeviation, thisDeviation);\n\n if(clusterMaxDeviation - clusterMinDeviation > getTolerance(thisPt, nextPt)) break;\n\n clusterEndPt = thisPt;\n thisVal = thisVector[0] * clusterUnitVector[0] + thisVector[1] * clusterUnitVector[1];\n\n if(thisVal > clusterHighVal) {\n clusterHighVal = thisVal;\n clusterHighPt = thisPt;\n clusterHighFirst = false;\n } else if(thisVal < clusterLowVal) {\n clusterLowVal = thisVal;\n clusterLowPt = thisPt;\n clusterHighFirst = true;\n }\n }\n\n // insert this cluster into pts\n // we've already inserted the start pt, now check if we have high and low pts\n if(clusterHighFirst) {\n addPt(clusterHighPt);\n if(clusterEndPt !== clusterLowPt) addPt(clusterLowPt);\n } else {\n if(clusterLowPt !== clusterStartPt) addPt(clusterLowPt);\n if(clusterEndPt !== clusterHighPt) addPt(clusterHighPt);\n }\n // and finally insert the end pt\n addPt(clusterEndPt);\n\n // have we reached the end of this segment?\n if(i >= d.length || !thisPt) break;\n\n // otherwise we have an out-of-cluster point to insert as next clusterStartPt\n addPt(thisPt);\n clusterStartPt = thisPt;\n }\n\n // to get fills right - repeat what we did at the start\n if(lastFarPt) updateEdge([lastXEdge || lastFarPt[0], lastYEdge || lastFarPt[1]]);\n\n segments.push(pts.slice(0, pti));\n }\n\n return segments;\n};\n\n},{\"../../constants/numerical\":704,\"../../lib\":728,\"./constants\":1138}],1149:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\n// common to 'scatter' and 'scatterternary'\nmodule.exports = function handleLineShapeDefaults(traceIn, traceOut, coerce) {\n var shape = coerce('line.shape');\n if(shape === 'spline') coerce('line.smoothing');\n};\n\n},{}],1150:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar LINKEDFILLS = {tonextx: 1, tonexty: 1, tonext: 1};\n\nmodule.exports = function linkTraces(gd, plotinfo, cdscatter) {\n var trace, i, group, prevtrace, groupIndex;\n\n // first sort traces to keep stacks & filled-together groups together\n var groupIndices = {};\n var needsSort = false;\n var prevGroupIndex = -1;\n var nextGroupIndex = 0;\n var prevUnstackedGroupIndex = -1;\n for(i = 0; i < cdscatter.length; i++) {\n trace = cdscatter[i][0].trace;\n group = trace.stackgroup || '';\n if(group) {\n if(group in groupIndices) {\n groupIndex = groupIndices[group];\n } else {\n groupIndex = groupIndices[group] = nextGroupIndex;\n nextGroupIndex++;\n }\n } else if(trace.fill in LINKEDFILLS && prevUnstackedGroupIndex >= 0) {\n groupIndex = prevUnstackedGroupIndex;\n } else {\n groupIndex = prevUnstackedGroupIndex = nextGroupIndex;\n nextGroupIndex++;\n }\n\n if(groupIndex < prevGroupIndex) needsSort = true;\n trace._groupIndex = prevGroupIndex = groupIndex;\n }\n\n var cdscatterSorted = cdscatter.slice();\n if(needsSort) {\n cdscatterSorted.sort(function(a, b) {\n var traceA = a[0].trace;\n var traceB = b[0].trace;\n return (traceA._groupIndex - traceB._groupIndex) ||\n (traceA.index - traceB.index);\n });\n }\n\n // now link traces to each other\n var prevtraces = {};\n for(i = 0; i < cdscatterSorted.length; i++) {\n trace = cdscatterSorted[i][0].trace;\n group = trace.stackgroup || '';\n\n // Note: The check which ensures all cdscatter here are for the same axis and\n // are either cartesian or scatterternary has been removed. This code assumes\n // the passed scattertraces have been filtered to the proper plot types and\n // the proper subplots.\n if(trace.visible === true) {\n trace._nexttrace = null;\n\n if(trace.fill in LINKEDFILLS) {\n prevtrace = prevtraces[group];\n trace._prevtrace = prevtrace || null;\n\n if(prevtrace) {\n prevtrace._nexttrace = trace;\n }\n }\n\n trace._ownfill = (trace.fill && (\n trace.fill.substr(0, 6) === 'tozero' ||\n trace.fill === 'toself' ||\n (trace.fill.substr(0, 2) === 'to' && !trace._prevtrace)\n ));\n\n prevtraces[group] = trace;\n } else {\n trace._prevtrace = trace._nexttrace = trace._ownfill = null;\n }\n }\n\n return cdscatterSorted;\n};\n\n},{}],1151:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\n\n// used in the drawing step for 'scatter' and 'scattegeo' and\n// in the convert step for 'scatter3d'\nmodule.exports = function makeBubbleSizeFn(trace) {\n var marker = trace.marker;\n var sizeRef = marker.sizeref || 1;\n var sizeMin = marker.sizemin || 0;\n\n // for bubble charts, allow scaling the provided value linearly\n // and by area or diameter.\n // Note this only applies to the array-value sizes\n\n var baseFn = (marker.sizemode === 'area') ?\n function(v) { return Math.sqrt(v / sizeRef); } :\n function(v) { return v / sizeRef; };\n\n // TODO add support for position/negative bubbles?\n // TODO add 'sizeoffset' attribute?\n return function(v) {\n var baseSize = baseFn(v / 2);\n\n // don't show non-numeric and negative sizes\n return (isNumeric(baseSize) && (baseSize > 0)) ?\n Math.max(baseSize, sizeMin) :\n 0;\n };\n};\n\n},{\"fast-isnumeric\":236}],1152:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nmodule.exports = {\n container: 'marker',\n min: 'cmin',\n max: 'cmax'\n};\n\n},{}],1153:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Color = _dereq_('../../components/color');\nvar hasColorscale = _dereq_('../../components/colorscale/helpers').hasColorscale;\nvar colorscaleDefaults = _dereq_('../../components/colorscale/defaults');\n\nvar subTypes = _dereq_('./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\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\n},{\"../../components/color\":595,\"../../components/colorscale/defaults\":605,\"../../components/colorscale/helpers\":606,\"./subtypes\":1158}],1154:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\nvar ensureSingle = Lib.ensureSingle;\nvar identity = Lib.identity;\nvar Drawing = _dereq_('../../components/drawing');\n\nvar subTypes = _dereq_('./subtypes');\nvar linePoints = _dereq_('./line_points');\nvar linkTraces = _dereq_('./link_traces');\nvar polygonTester = _dereq_('../../lib/polygon').tester;\n\nmodule.exports = function plot(gd, plotinfo, cdscatter, scatterLayer, transitionOpts, makeOnCompleteCallback) {\n var join, onComplete;\n\n // If transition config is provided, then it is only a partial replot and traces not\n // updated are removed.\n var isFullReplot = !transitionOpts;\n var hasTransition = !!transitionOpts && transitionOpts.duration > 0;\n\n // Link traces so the z-order of fill layers is correct\n var cdscatterSorted = linkTraces(gd, plotinfo, cdscatter);\n\n join = scatterLayer.selectAll('g.trace')\n .data(cdscatterSorted, function(d) { return d[0].trace.uid; });\n\n // Append new traces:\n join.enter().append('g')\n .attr('class', function(d) {\n return 'trace scatter trace' + d[0].trace.uid;\n })\n .style('stroke-miterlimit', 2);\n join.order();\n\n createFills(gd, join, plotinfo);\n\n if(hasTransition) {\n if(makeOnCompleteCallback) {\n // If it was passed a callback to register completion, make a callback. If\n // this is created, then it must be executed on completion, otherwise the\n // pos-transition redraw will not execute:\n onComplete = makeOnCompleteCallback();\n }\n\n var transition = d3.transition()\n .duration(transitionOpts.duration)\n .ease(transitionOpts.easing)\n .each('end', function() {\n onComplete && onComplete();\n })\n .each('interrupt', function() {\n onComplete && onComplete();\n });\n\n transition.each(function() {\n // Must run the selection again since otherwise enters/updates get grouped together\n // and these get executed out of order. Except we need them in order!\n scatterLayer.selectAll('g.trace').each(function(d, i) {\n plotOne(gd, i, plotinfo, d, cdscatterSorted, this, transitionOpts);\n });\n });\n } else {\n join.each(function(d, i) {\n plotOne(gd, i, plotinfo, d, cdscatterSorted, this, transitionOpts);\n });\n }\n\n if(isFullReplot) {\n join.exit().remove();\n }\n\n // remove paths that didn't get used\n scatterLayer.selectAll('path:not([d])').remove();\n};\n\nfunction createFills(gd, traceJoin, plotinfo) {\n traceJoin.each(function(d) {\n var fills = ensureSingle(d3.select(this), 'g', 'fills');\n Drawing.setClipUrl(fills, plotinfo.layerClipId, gd);\n\n var trace = d[0].trace;\n\n var fillData = [];\n if(trace._ownfill) fillData.push('_ownFill');\n if(trace._nexttrace) fillData.push('_nextFill');\n\n var fillJoin = fills.selectAll('g').data(fillData, identity);\n\n fillJoin.enter().append('g');\n\n fillJoin.exit()\n .each(function(d) { trace[d] = null; })\n .remove();\n\n fillJoin.order().each(function(d) {\n // make a path element inside the fill group, just so\n // we can give it its own data later on and the group can\n // keep its simple '_*Fill' data\n trace[d] = ensureSingle(d3.select(this), 'path', 'js-fill');\n });\n });\n}\n\nfunction plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transitionOpts) {\n var i;\n\n // Since this has been reorganized and we're executing this on individual traces,\n // we need to pass it the full list of cdscatter as well as this trace's index (idx)\n // since it does an internal n^2 loop over comparisons with other traces:\n selectMarkers(gd, idx, plotinfo, cdscatter, cdscatterAll);\n\n var hasTransition = !!transitionOpts && transitionOpts.duration > 0;\n\n function transition(selection) {\n return hasTransition ? selection.transition() : selection;\n }\n\n var xa = plotinfo.xaxis;\n var ya = plotinfo.yaxis;\n\n var trace = cdscatter[0].trace;\n var line = trace.line;\n var tr = d3.select(element);\n\n var errorBarGroup = ensureSingle(tr, 'g', 'errorbars');\n var lines = ensureSingle(tr, 'g', 'lines');\n var points = ensureSingle(tr, 'g', 'points');\n var text = ensureSingle(tr, 'g', 'text');\n\n // error bars are at the bottom\n Registry.getComponentMethod('errorbars', 'plot')(gd, errorBarGroup, plotinfo, transitionOpts);\n\n if(trace.visible !== true) return;\n\n transition(tr).style('opacity', trace.opacity);\n\n // BUILD LINES AND FILLS\n var ownFillEl3, tonext;\n var ownFillDir = trace.fill.charAt(trace.fill.length - 1);\n if(ownFillDir !== 'x' && ownFillDir !== 'y') ownFillDir = '';\n\n // store node for tweaking by selectPoints\n cdscatter[0][plotinfo.isRangePlot ? 'nodeRangePlot3' : 'node3'] = tr;\n\n var prevRevpath = '';\n var prevPolygons = [];\n var prevtrace = trace._prevtrace;\n\n if(prevtrace) {\n prevRevpath = prevtrace._prevRevpath || '';\n tonext = prevtrace._nextFill;\n prevPolygons = prevtrace._polygons;\n }\n\n var thispath;\n var thisrevpath;\n // fullpath is all paths for this curve, joined together straight\n // across gaps, for filling\n var fullpath = '';\n // revpath is fullpath reversed, for fill-to-next\n var revpath = '';\n // functions for converting a point array to a path\n var pathfn, revpathbase, revpathfn;\n // variables used before and after the data join\n var pt0, lastSegment, pt1, thisPolygons;\n\n // initialize line join data / method\n var segments = [];\n var makeUpdate = Lib.noop;\n\n ownFillEl3 = trace._ownFill;\n\n if(subTypes.hasLines(trace) || trace.fill !== 'none') {\n if(tonext) {\n // This tells .style which trace to use for fill information:\n tonext.datum(cdscatter);\n }\n\n if(['hv', 'vh', 'hvh', 'vhv'].indexOf(line.shape) !== -1) {\n pathfn = Drawing.steps(line.shape);\n revpathbase = Drawing.steps(\n line.shape.split('').reverse().join('')\n );\n } else if(line.shape === 'spline') {\n pathfn = revpathbase = function(pts) {\n var pLast = pts[pts.length - 1];\n if(pts.length > 1 && pts[0][0] === pLast[0] && pts[0][1] === pLast[1]) {\n // identical start and end points: treat it as a\n // closed curve so we don't get a kink\n return Drawing.smoothclosed(pts.slice(1), line.smoothing);\n } else {\n return Drawing.smoothopen(pts, line.smoothing);\n }\n };\n } else {\n pathfn = revpathbase = function(pts) {\n return 'M' + pts.join('L');\n };\n }\n\n revpathfn = function(pts) {\n // note: this is destructive (reverses pts in place) so can't use pts after this\n return revpathbase(pts.reverse());\n };\n\n segments = linePoints(cdscatter, {\n xaxis: xa,\n yaxis: ya,\n connectGaps: trace.connectgaps,\n baseTolerance: Math.max(line.width || 1, 3) / 4,\n shape: line.shape,\n simplify: line.simplify,\n fill: trace.fill\n });\n\n // since we already have the pixel segments here, use them to make\n // polygons for hover on fill\n // TODO: can we skip this if hoveron!=fills? That would mean we\n // need to redraw when you change hoveron...\n thisPolygons = trace._polygons = new Array(segments.length);\n for(i = 0; i < segments.length; i++) {\n trace._polygons[i] = polygonTester(segments[i]);\n }\n\n if(segments.length) {\n pt0 = segments[0][0];\n lastSegment = segments[segments.length - 1];\n pt1 = lastSegment[lastSegment.length - 1];\n }\n\n makeUpdate = function(isEnter) {\n return function(pts) {\n thispath = pathfn(pts);\n thisrevpath = revpathfn(pts);\n if(!fullpath) {\n fullpath = thispath;\n revpath = thisrevpath;\n } else if(ownFillDir) {\n fullpath += 'L' + thispath.substr(1);\n revpath = thisrevpath + ('L' + revpath.substr(1));\n } else {\n fullpath += 'Z' + thispath;\n revpath = thisrevpath + 'Z' + revpath;\n }\n\n if(subTypes.hasLines(trace) && pts.length > 1) {\n var el = d3.select(this);\n\n // This makes the coloring work correctly:\n el.datum(cdscatter);\n\n if(isEnter) {\n transition(el.style('opacity', 0)\n .attr('d', thispath)\n .call(Drawing.lineGroupStyle))\n .style('opacity', 1);\n } else {\n var sel = transition(el);\n sel.attr('d', thispath);\n Drawing.singleLineStyle(cdscatter, sel);\n }\n }\n };\n };\n }\n\n var lineJoin = lines.selectAll('.js-line').data(segments);\n\n transition(lineJoin.exit())\n .style('opacity', 0)\n .remove();\n\n lineJoin.each(makeUpdate(false));\n\n lineJoin.enter().append('path')\n .classed('js-line', true)\n .style('vector-effect', 'non-scaling-stroke')\n .call(Drawing.lineGroupStyle)\n .each(makeUpdate(true));\n\n Drawing.setClipUrl(lineJoin, plotinfo.layerClipId, gd);\n\n function clearFill(selection) {\n transition(selection).attr('d', 'M0,0Z');\n }\n\n if(segments.length) {\n if(ownFillEl3) {\n ownFillEl3.datum(cdscatter);\n if(pt0 && pt1) {\n if(ownFillDir) {\n if(ownFillDir === 'y') {\n pt0[1] = pt1[1] = ya.c2p(0, true);\n } else if(ownFillDir === 'x') {\n pt0[0] = pt1[0] = xa.c2p(0, true);\n }\n\n // fill to zero: full trace path, plus extension of\n // the endpoints to the appropriate axis\n // For the sake of animations, wrap the points around so that\n // the points on the axes are the first two points. Otherwise\n // animations get a little crazy if the number of points changes.\n transition(ownFillEl3).attr('d', 'M' + pt1 + 'L' + pt0 + 'L' + fullpath.substr(1))\n .call(Drawing.singleFillStyle);\n } else {\n // fill to self: just join the path to itself\n transition(ownFillEl3).attr('d', fullpath + 'Z')\n .call(Drawing.singleFillStyle);\n }\n }\n } else if(tonext) {\n if(trace.fill.substr(0, 6) === 'tonext' && fullpath && prevRevpath) {\n // fill to next: full trace path, plus the previous path reversed\n if(trace.fill === 'tonext') {\n // tonext: for use by concentric shapes, like manually constructed\n // contours, we just add the two paths closed on themselves.\n // This makes strange results if one path is *not* entirely\n // inside the other, but then that is a strange usage.\n transition(tonext).attr('d', fullpath + 'Z' + prevRevpath + 'Z')\n .call(Drawing.singleFillStyle);\n } else {\n // tonextx/y: for now just connect endpoints with lines. This is\n // the correct behavior if the endpoints are at the same value of\n // y/x, but if they *aren't*, we should ideally do more complicated\n // things depending on whether the new endpoint projects onto the\n // existing curve or off the end of it\n transition(tonext).attr('d', fullpath + 'L' + prevRevpath.substr(1) + 'Z')\n .call(Drawing.singleFillStyle);\n }\n trace._polygons = trace._polygons.concat(prevPolygons);\n } else {\n clearFill(tonext);\n trace._polygons = null;\n }\n }\n trace._prevRevpath = revpath;\n trace._prevPolygons = thisPolygons;\n } else {\n if(ownFillEl3) clearFill(ownFillEl3);\n else if(tonext) clearFill(tonext);\n trace._polygons = trace._prevRevpath = trace._prevPolygons = null;\n }\n\n\n function visFilter(d) {\n return d.filter(function(v) { return !v.gap && v.vis; });\n }\n\n function visFilterWithGaps(d) {\n return d.filter(function(v) { return v.vis; });\n }\n\n function gapFilter(d) {\n return d.filter(function(v) { return !v.gap; });\n }\n\n function keyFunc(d) {\n return d.id;\n }\n\n // Returns a function if the trace is keyed, otherwise returns undefined\n function getKeyFunc(trace) {\n if(trace.ids) {\n return keyFunc;\n }\n }\n\n function hideFilter() {\n return false;\n }\n\n function makePoints(points, text, cdscatter) {\n var join, selection, hasNode;\n\n var trace = cdscatter[0].trace;\n var showMarkers = subTypes.hasMarkers(trace);\n var showText = subTypes.hasText(trace);\n\n var keyFunc = getKeyFunc(trace);\n var markerFilter = hideFilter;\n var textFilter = hideFilter;\n\n if(showMarkers || showText) {\n var showFilter = identity;\n // if we're stacking, \"infer zero\" gap mode gets markers in the\n // gap points - because we've inferred a zero there - but other\n // modes (currently \"interpolate\", later \"interrupt\" hopefully)\n // we don't draw generated markers\n var stackGroup = trace.stackgroup;\n var isInferZero = stackGroup && (\n gd._fullLayout._scatterStackOpts[xa._id + ya._id][stackGroup].stackgaps === 'infer zero');\n if(trace.marker.maxdisplayed || trace._needsCull) {\n showFilter = isInferZero ? visFilterWithGaps : visFilter;\n } else if(stackGroup && !isInferZero) {\n showFilter = gapFilter;\n }\n\n if(showMarkers) markerFilter = showFilter;\n if(showText) textFilter = showFilter;\n }\n\n // marker points\n\n selection = points.selectAll('path.point');\n\n join = selection.data(markerFilter, keyFunc);\n\n var enter = join.enter().append('path')\n .classed('point', true);\n\n if(hasTransition) {\n enter\n .call(Drawing.pointStyle, trace, gd)\n .call(Drawing.translatePoints, xa, ya)\n .style('opacity', 0)\n .transition()\n .style('opacity', 1);\n }\n\n join.order();\n\n var styleFns;\n if(showMarkers) {\n styleFns = Drawing.makePointStyleFns(trace);\n }\n\n join.each(function(d) {\n var el = d3.select(this);\n var sel = transition(el);\n hasNode = Drawing.translatePoint(d, sel, xa, ya);\n\n if(hasNode) {\n Drawing.singlePointStyle(d, sel, trace, styleFns, gd);\n\n if(plotinfo.layerClipId) {\n Drawing.hideOutsideRangePoint(d, sel, xa, ya, trace.xcalendar, trace.ycalendar);\n }\n\n if(trace.customdata) {\n el.classed('plotly-customdata', d.data !== null && d.data !== undefined);\n }\n } else {\n sel.remove();\n }\n });\n\n if(hasTransition) {\n join.exit().transition()\n .style('opacity', 0)\n .remove();\n } else {\n join.exit().remove();\n }\n\n // text points\n selection = text.selectAll('g');\n join = selection.data(textFilter, keyFunc);\n\n // each text needs to go in its own 'g' in case\n // it gets converted to mathjax\n join.enter().append('g').classed('textpoint', true).append('text');\n\n join.order();\n\n join.each(function(d) {\n var g = d3.select(this);\n var sel = transition(g.select('text'));\n hasNode = Drawing.translatePoint(d, sel, xa, ya);\n\n if(hasNode) {\n if(plotinfo.layerClipId) {\n Drawing.hideOutsideRangePoint(d, g, xa, ya, trace.xcalendar, trace.ycalendar);\n }\n } else {\n g.remove();\n }\n });\n\n join.selectAll('text')\n .call(Drawing.textPointStyle, trace, gd)\n .each(function(d) {\n // This just *has* to be totally custom becuase of SVG text positioning :(\n // It's obviously copied from translatePoint; we just can't use that\n var x = xa.c2p(d.x);\n var y = ya.c2p(d.y);\n\n d3.select(this).selectAll('tspan.line').each(function() {\n transition(d3.select(this)).attr({x: x, y: y});\n });\n });\n\n join.exit().remove();\n }\n\n points.datum(cdscatter);\n text.datum(cdscatter);\n makePoints(points, text, cdscatter);\n\n // lastly, clip points groups of `cliponaxis !== false` traces\n // on `plotinfo._hasClipOnAxisFalse === true` subplots\n var hasClipOnAxisFalse = trace.cliponaxis === false;\n var clipUrl = hasClipOnAxisFalse ? null : plotinfo.layerClipId;\n Drawing.setClipUrl(points, clipUrl, gd);\n Drawing.setClipUrl(text, clipUrl, gd);\n}\n\nfunction selectMarkers(gd, idx, plotinfo, cdscatter, cdscatterAll) {\n var xa = plotinfo.xaxis;\n var ya = plotinfo.yaxis;\n var xr = d3.extent(Lib.simpleMap(xa.range, xa.r2c));\n var yr = d3.extent(Lib.simpleMap(ya.range, ya.r2c));\n\n var trace = cdscatter[0].trace;\n if(!subTypes.hasMarkers(trace)) return;\n // if marker.maxdisplayed is used, select a maximum of\n // mnum markers to show, from the set that are in the viewport\n var mnum = trace.marker.maxdisplayed;\n\n // TODO: remove some as we get away from the viewport?\n if(mnum === 0) return;\n\n var cd = cdscatter.filter(function(v) {\n return v.x >= xr[0] && v.x <= xr[1] && v.y >= yr[0] && v.y <= yr[1];\n });\n var inc = Math.ceil(cd.length / mnum);\n var tnum = 0;\n cdscatterAll.forEach(function(cdj, j) {\n var tracei = cdj[0].trace;\n if(subTypes.hasMarkers(tracei) &&\n tracei.marker.maxdisplayed > 0 && j < idx) {\n tnum++;\n }\n });\n\n // if multiple traces use maxdisplayed, stagger which markers we\n // display this formula offsets successive traces by 1/3 of the\n // increment, adding an extra small amount after each triplet so\n // it's not quite periodic\n var i0 = Math.round(tnum * inc / 3 + Math.floor(tnum / 3) * inc / 7.1);\n\n // for error bars: save in cd which markers to show\n // so we don't have to repeat this\n cdscatter.forEach(function(v) { delete v.vis; });\n cd.forEach(function(v, i) {\n if(Math.round((i + i0) % inc) === 0) v.vis = true;\n });\n}\n\n},{\"../../components/drawing\":617,\"../../lib\":728,\"../../lib/polygon\":740,\"../../registry\":859,\"./line_points\":1148,\"./link_traces\":1150,\"./subtypes\":1158,\"d3\":164}],1155:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar subtypes = _dereq_('./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\n},{\"./subtypes\":1158}],1156:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar perStackAttrs = ['orientation', 'groupnorm', 'stackgaps'];\n\nmodule.exports = function handleStackDefaults(traceIn, traceOut, layout, coerce) {\n var stackOpts = layout._scatterStackOpts;\n\n var stackGroup = coerce('stackgroup');\n if(stackGroup) {\n // use independent stacking options per subplot\n var subplot = traceOut.xaxis + traceOut.yaxis;\n var subplotStackOpts = stackOpts[subplot];\n if(!subplotStackOpts) subplotStackOpts = stackOpts[subplot] = {};\n\n var groupOpts = subplotStackOpts[stackGroup];\n var firstTrace = false;\n if(groupOpts) {\n groupOpts.traces.push(traceOut);\n } else {\n groupOpts = subplotStackOpts[stackGroup] = {\n // keep track of trace indices for use during stacking calculations\n // this will be filled in during `calc` and used during `crossTraceCalc`\n // so it's OK if we don't recreate it during a non-calc edit\n traceIndices: [],\n // Hold on to the whole set of prior traces\n // First one is most important, so we can clear defaults\n // there if we find explicit values only in later traces.\n // We're only going to *use* the values stored in groupOpts,\n // but for the editor and validate we want things self-consistent\n // The full set of traces is used only to fix `fill` default if\n // we find `orientation: 'h'` beyond the first trace\n traces: [traceOut]\n };\n firstTrace = true;\n }\n // TODO: how is this going to work with groupby transforms?\n // in principle it should be OK I guess, as long as explicit group styles\n // don't override explicit base-trace styles?\n\n var dflts = {\n orientation: (traceOut.x && !traceOut.y) ? 'h' : 'v'\n };\n\n for(var i = 0; i < perStackAttrs.length; i++) {\n var attr = perStackAttrs[i];\n var attrFound = attr + 'Found';\n if(!groupOpts[attrFound]) {\n var traceHasAttr = traceIn[attr] !== undefined;\n var isOrientation = attr === 'orientation';\n if(traceHasAttr || firstTrace) {\n groupOpts[attr] = coerce(attr, dflts[attr]);\n\n if(isOrientation) {\n groupOpts.fillDflt = groupOpts[attr] === 'h' ?\n 'tonextx' : 'tonexty';\n }\n\n if(traceHasAttr) {\n // Note: this will show a value here even if it's invalid\n // in which case it will revert to default.\n groupOpts[attrFound] = true;\n\n // Note: only one trace in the stack will get a _fullData\n // entry for a given stack-wide attribute. If no traces\n // (or the first trace) specify that attribute, the\n // first trace will get it. If the first trace does NOT\n // specify it but some later trace does, then it gets\n // removed from the first trace and only included in the\n // one that specified it. This is mostly important for\n // editors (that want to see the full values to know\n // what settings are available) and Plotly.react diffing.\n // Editors may want to use fullLayout._scatterStackOpts\n // directly and make these settings available from all\n // traces in the stack... then set the new value into\n // the first trace, and clear all later traces.\n if(!firstTrace) {\n delete groupOpts.traces[0][attr];\n\n // orientation can affect default fill of previous traces\n if(isOrientation) {\n for(var j = 0; j < groupOpts.traces.length - 1; j++) {\n var trace2 = groupOpts.traces[j];\n if(trace2._input.fill !== trace2.fill) {\n trace2.fill = groupOpts.fillDflt;\n }\n }\n }\n }\n }\n }\n }\n }\n return groupOpts;\n }\n};\n\n},{}],1157:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Drawing = _dereq_('../../components/drawing');\nvar Registry = _dereq_('../../registry');\n\nfunction style(gd) {\n var s = d3.select(gd).selectAll('g.trace.scatter');\n\n s.style('opacity', function(d) {\n return d[0].trace.opacity;\n });\n\n s.selectAll('g.points').each(function(d) {\n var sel = d3.select(this);\n var trace = d.trace || d[0].trace;\n stylePoints(sel, trace, gd);\n });\n\n s.selectAll('g.text').each(function(d) {\n var sel = d3.select(this);\n var trace = d.trace || d[0].trace;\n styleText(sel, trace, gd);\n });\n\n s.selectAll('g.trace path.js-line')\n .call(Drawing.lineGroupStyle);\n\n s.selectAll('g.trace path.js-fill')\n .call(Drawing.fillGroupStyle);\n\n Registry.getComponentMethod('errorbars', 'style')(s);\n}\n\nfunction stylePoints(sel, trace, gd) {\n Drawing.pointStyle(sel.selectAll('path.point'), trace, gd);\n}\n\nfunction styleText(sel, trace, gd) {\n Drawing.textPointStyle(sel.selectAll('text'), trace, gd);\n}\n\nfunction styleOnSelect(gd, cd, sel) {\n var trace = cd[0].trace;\n\n if(trace.selectedpoints) {\n Drawing.selectedPointStyle(sel.selectAll('path.point'), trace);\n Drawing.selectedTextStyle(sel.selectAll('text'), trace);\n } else {\n stylePoints(sel, trace, gd);\n styleText(sel, trace, gd);\n }\n}\n\nmodule.exports = {\n style: style,\n stylePoints: stylePoints,\n styleText: styleText,\n styleOnSelect: styleOnSelect\n};\n\n},{\"../../components/drawing\":617,\"../../registry\":859,\"d3\":164}],1158:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nmodule.exports = {\n hasLines: function(trace) {\n return trace.visible && trace.mode &&\n trace.mode.indexOf('lines') !== -1;\n },\n\n hasMarkers: function(trace) {\n return trace.visible && (\n (trace.mode && trace.mode.indexOf('markers') !== -1) ||\n // until splom implements 'mode'\n trace.type === 'splom'\n );\n },\n\n hasText: function(trace) {\n return trace.visible && trace.mode &&\n trace.mode.indexOf('text') !== -1;\n },\n\n isBubble: function(trace) {\n return Lib.isPlainObject(trace.marker) &&\n Lib.isArrayOrTypedArray(trace.marker.size);\n }\n};\n\n},{\"../../lib\":728}],1159:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../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', layout.font);\n\n if(!opts.noSelect) {\n coerce('selected.textfont.color');\n coerce('unselected.textfont.color');\n }\n};\n\n},{\"../../lib\":728}],1160:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Registry = _dereq_('../../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\n},{\"../../lib\":728,\"../../registry\":859}],1161:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar scatterAttrs = _dereq_('../scatter/attributes');\nvar colorAttributes = _dereq_('../../components/colorscale/attributes');\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar texttemplateAttrs = _dereq_('../../plots/template_attributes').texttemplateAttrs;\nvar baseAttrs = _dereq_('../../plots/attributes');\nvar DASHES = _dereq_('../../constants/gl3d_dashes');\n\nvar MARKER_SYMBOLS = _dereq_('../../constants/gl3d_markers');\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\nvar overrideAll = _dereq_('../../plot_api/edit_types').overrideAll;\n\nvar scatterLineAttrs = scatterAttrs.line;\nvar scatterMarkerAttrs = scatterAttrs.marker;\nvar scatterMarkerLineAttrs = scatterMarkerAttrs.line;\n\nvar lineAttrs = extendFlat({\n width: scatterLineAttrs.width,\n dash: {\n valType: 'enumerated',\n values: Object.keys(DASHES),\n dflt: 'solid',\n \n \n }\n}, colorAttributes('line'));\n\nfunction makeProjectionAttr(axLetter) {\n return {\n show: {\n valType: 'boolean',\n \n dflt: false,\n \n },\n opacity: {\n valType: 'number',\n \n min: 0,\n max: 1,\n dflt: 1,\n \n },\n scale: {\n valType: 'number',\n \n min: 0,\n max: 10,\n dflt: 2 / 3,\n \n }\n };\n}\n\nvar attrs = module.exports = overrideAll({\n x: scatterAttrs.x,\n y: scatterAttrs.y,\n z: {\n valType: 'data_array',\n \n },\n\n text: extendFlat({}, scatterAttrs.text, {\n \n }),\n texttemplate: texttemplateAttrs({}, {\n\n }),\n hovertext: extendFlat({}, scatterAttrs.hovertext, {\n \n }),\n hovertemplate: hovertemplateAttrs(),\n\n mode: extendFlat({}, scatterAttrs.mode, // shouldn't this be on-par with 2D?\n {dflt: 'lines+markers'}),\n surfaceaxis: {\n valType: 'enumerated',\n \n values: [-1, 0, 1, 2],\n dflt: -1,\n \n },\n surfacecolor: {\n valType: 'color',\n \n \n },\n projection: {\n x: makeProjectionAttr('x'),\n y: makeProjectionAttr('y'),\n z: makeProjectionAttr('z')\n },\n\n connectgaps: scatterAttrs.connectgaps,\n line: lineAttrs,\n\n marker: extendFlat({ // Parity with scatter.js?\n symbol: {\n valType: 'enumerated',\n values: Object.keys(MARKER_SYMBOLS),\n \n dflt: 'circle',\n arrayOk: true,\n \n },\n size: extendFlat({}, scatterMarkerAttrs.size, {dflt: 8}),\n sizeref: scatterMarkerAttrs.sizeref,\n sizemin: scatterMarkerAttrs.sizemin,\n sizemode: scatterMarkerAttrs.sizemode,\n opacity: extendFlat({}, scatterMarkerAttrs.opacity, {\n arrayOk: false,\n \n }),\n colorbar: scatterMarkerAttrs.colorbar,\n\n line: extendFlat({\n width: extendFlat({}, scatterMarkerLineAttrs.width, {arrayOk: false})\n },\n colorAttributes('marker.line')\n )\n },\n colorAttributes('marker')\n ),\n\n textposition: extendFlat({}, scatterAttrs.textposition, {dflt: 'top center'}),\n textfont: {\n color: scatterAttrs.textfont.color,\n size: scatterAttrs.textfont.size,\n family: extendFlat({}, scatterAttrs.textfont.family, {arrayOk: false})\n },\n\n hoverinfo: extendFlat({}, baseAttrs.hoverinfo)\n}, 'calc', 'nested');\n\nattrs.x.editType = attrs.y.editType = attrs.z.editType = 'calc+clearAxisTypes';\n\n},{\"../../components/colorscale/attributes\":602,\"../../constants/gl3d_dashes\":701,\"../../constants/gl3d_markers\":702,\"../../lib/extend\":719,\"../../plot_api/edit_types\":759,\"../../plots/attributes\":773,\"../../plots/template_attributes\":854,\"../scatter/attributes\":1134}],1162:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar arraysToCalcdata = _dereq_('../scatter/arrays_to_calcdata');\nvar calcColorscale = _dereq_('../scatter/colorscale_calc');\n\n/**\n * This is a kludge to put the array attributes into\n * calcdata the way Scatter.plot does, so that legends and\n * popovers know what to do with them.\n */\nmodule.exports = function calc(gd, trace) {\n var cd = [{x: false, y: false, trace: trace, t: {}}];\n\n arraysToCalcdata(cd, trace);\n calcColorscale(gd, trace);\n\n return cd;\n};\n\n},{\"../scatter/arrays_to_calcdata\":1133,\"../scatter/colorscale_calc\":1137}],1163:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../../registry');\n\nfunction calculateAxisErrors(data, params, scaleFactor, axis) {\n if(!params || !params.visible) return null;\n\n var computeError = Registry.getComponentMethod('errorbars', 'makeComputeError')(params);\n var result = new Array(data.length);\n\n for(var i = 0; i < data.length; i++) {\n var errors = computeError(+data[i], i);\n\n if(axis.type === 'log') {\n var point = axis.c2l(data[i]);\n var min = data[i] - errors[0];\n var max = data[i] + errors[1];\n\n result[i] = [\n (axis.c2l(min, true) - point) * scaleFactor,\n (axis.c2l(max, true) - point) * scaleFactor\n ];\n\n // Keep track of the lower error bound which isn't negative!\n if(min > 0) {\n var lower = axis.c2l(min);\n if(!axis._lowerLogErrorBound) axis._lowerLogErrorBound = lower;\n axis._lowerErrorBound = Math.min(axis._lowerLogErrorBound, lower);\n }\n } else {\n result[i] = [\n -errors[0] * scaleFactor,\n errors[1] * scaleFactor\n ];\n }\n }\n\n return result;\n}\n\nfunction dataLength(array) {\n for(var i = 0; i < array.length; i++) {\n if(array[i]) return array[i].length;\n }\n return 0;\n}\n\nfunction calculateErrors(data, scaleFactor, sceneLayout) {\n var errors = [\n calculateAxisErrors(data.x, data.error_x, scaleFactor[0], sceneLayout.xaxis),\n calculateAxisErrors(data.y, data.error_y, scaleFactor[1], sceneLayout.yaxis),\n calculateAxisErrors(data.z, data.error_z, scaleFactor[2], sceneLayout.zaxis)\n ];\n\n var n = dataLength(errors);\n if(n === 0) return null;\n\n var errorBounds = new Array(n);\n\n for(var i = 0; i < n; i++) {\n var bound = [[0, 0, 0], [0, 0, 0]];\n\n for(var j = 0; j < 3; j++) {\n if(errors[j]) {\n for(var k = 0; k < 2; k++) {\n bound[k][j] = errors[j][i][k];\n }\n }\n }\n\n errorBounds[i] = bound;\n }\n\n return errorBounds;\n}\n\nmodule.exports = calculateErrors;\n\n},{\"../../registry\":859}],1164:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar createLinePlot = _dereq_('gl-line3d');\nvar createScatterPlot = _dereq_('gl-scatter3d');\nvar createErrorBars = _dereq_('gl-error3d');\nvar createMesh = _dereq_('gl-mesh3d');\nvar triangulate = _dereq_('delaunay-triangulate');\n\nvar Lib = _dereq_('../../lib');\nvar str2RgbaArray = _dereq_('../../lib/str2rgbarray');\nvar formatColor = _dereq_('../../lib/gl_format_color').formatColor;\nvar makeBubbleSizeFn = _dereq_('../scatter/make_bubble_size_func');\nvar DASH_PATTERNS = _dereq_('../../constants/gl3d_dashes');\nvar MARKER_SYMBOLS = _dereq_('../../constants/gl3d_markers');\n\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar appendArrayPointValue = _dereq_('../../components/fx/helpers').appendArrayPointValue;\n\nvar calculateError = _dereq_('./calc_errors');\n\nfunction LineWithMarkers(scene, uid) {\n this.scene = scene;\n this.uid = uid;\n this.linePlot = null;\n this.scatterPlot = null;\n this.errorBars = null;\n this.textMarkers = null;\n this.delaunayMesh = null;\n this.color = null;\n this.mode = '';\n this.dataPoints = [];\n this.axesBounds = [\n [-Infinity, -Infinity, -Infinity],\n [Infinity, Infinity, Infinity]\n ];\n this.textLabels = null;\n this.data = null;\n}\n\nvar proto = LineWithMarkers.prototype;\n\nproto.handlePick = function(selection) {\n if(selection.object &&\n (selection.object === this.linePlot ||\n selection.object === this.delaunayMesh ||\n selection.object === this.textMarkers ||\n selection.object === this.scatterPlot)\n ) {\n var ind = selection.index = selection.data.index;\n\n if(selection.object.highlight) {\n selection.object.highlight(null);\n }\n if(this.scatterPlot) {\n selection.object = this.scatterPlot;\n this.scatterPlot.highlight(selection.data);\n }\n\n selection.textLabel = '';\n if(this.textLabels) {\n if(Array.isArray(this.textLabels)) {\n if(this.textLabels[ind] || this.textLabels[ind] === 0) {\n selection.textLabel = this.textLabels[ind];\n }\n } else {\n selection.textLabel = this.textLabels;\n }\n }\n\n selection.traceCoordinate = [\n this.data.x[ind],\n this.data.y[ind],\n this.data.z[ind]\n ];\n\n return true;\n }\n};\n\nfunction constructDelaunay(points, color, axis) {\n var u = (axis + 1) % 3;\n var v = (axis + 2) % 3;\n var filteredPoints = [];\n var filteredIds = [];\n var i;\n\n for(i = 0; i < points.length; ++i) {\n var p = points[i];\n if(isNaN(p[u]) || !isFinite(p[u]) ||\n isNaN(p[v]) || !isFinite(p[v])) {\n continue;\n }\n filteredPoints.push([p[u], p[v]]);\n filteredIds.push(i);\n }\n var cells = triangulate(filteredPoints);\n for(i = 0; i < cells.length; ++i) {\n var c = cells[i];\n for(var j = 0; j < c.length; ++j) {\n c[j] = filteredIds[c[j]];\n }\n }\n return {\n positions: points,\n cells: cells,\n meshColor: color\n };\n}\n\nfunction calculateErrorParams(errors) {\n var capSize = [0.0, 0.0, 0.0];\n var color = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];\n var lineWidth = [1.0, 1.0, 1.0];\n\n for(var i = 0; i < 3; i++) {\n var e = errors[i];\n\n if(e && e.copy_zstyle !== false && errors[2].visible !== false) e = errors[2];\n if(!e || !e.visible) continue;\n\n capSize[i] = e.width / 2; // ballpark rescaling\n color[i] = str2RgbaArray(e.color);\n lineWidth[i] = e.thickness;\n }\n\n return {capSize: capSize, color: color, lineWidth: lineWidth};\n}\n\nfunction parseAlignmentX(a) {\n if(a === null || a === undefined) return 0;\n\n return (a.indexOf('left') > -1) ? -1 :\n (a.indexOf('right') > -1) ? 1 : 0;\n}\n\nfunction parseAlignmentY(a) {\n if(a === null || a === undefined) return 0;\n\n return (a.indexOf('top') > -1) ? -1 :\n (a.indexOf('bottom') > -1) ? 1 : 0;\n}\n\nfunction calculateTextOffset(tp) {\n // Read out text properties\n\n var defaultAlignmentX = 0;\n var defaultAlignmentY = 0;\n\n var textOffset = [\n defaultAlignmentX,\n defaultAlignmentY\n ];\n\n if(Array.isArray(tp)) {\n for(var i = 0; i < tp.length; i++) {\n textOffset[i] = [\n defaultAlignmentX,\n defaultAlignmentY\n ];\n if(tp[i]) {\n textOffset[i][0] = parseAlignmentX(tp[i]);\n textOffset[i][1] = parseAlignmentY(tp[i]);\n }\n }\n } else {\n textOffset[0] = parseAlignmentX(tp);\n textOffset[1] = parseAlignmentY(tp);\n }\n\n return textOffset;\n}\n\n\nfunction calculateSize(sizeIn, sizeFn) {\n // rough parity with Plotly 2D markers\n return sizeFn(sizeIn * 4);\n}\n\nfunction calculateSymbol(symbolIn) {\n return MARKER_SYMBOLS[symbolIn];\n}\n\nfunction formatParam(paramIn, len, calculate, dflt, extraFn) {\n var paramOut = null;\n\n if(Lib.isArrayOrTypedArray(paramIn)) {\n paramOut = [];\n\n for(var i = 0; i < len; i++) {\n if(paramIn[i] === undefined) paramOut[i] = dflt;\n else paramOut[i] = calculate(paramIn[i], extraFn);\n }\n } else paramOut = calculate(paramIn, Lib.identity);\n\n return paramOut;\n}\n\n\nfunction convertPlotlyOptions(scene, data) {\n var points = [];\n var sceneLayout = scene.fullSceneLayout;\n var scaleFactor = scene.dataScale;\n var xaxis = sceneLayout.xaxis;\n var yaxis = sceneLayout.yaxis;\n var zaxis = sceneLayout.zaxis;\n var marker = data.marker;\n var line = data.line;\n var x = data.x || [];\n var y = data.y || [];\n var z = data.z || [];\n var len = x.length;\n var xcalendar = data.xcalendar;\n var ycalendar = data.ycalendar;\n var zcalendar = data.zcalendar;\n var xc, yc, zc;\n var params, i;\n var text;\n\n // Convert points\n for(i = 0; i < len; i++) {\n // sanitize numbers and apply transforms based on axes.type\n xc = xaxis.d2l(x[i], 0, xcalendar) * scaleFactor[0];\n yc = yaxis.d2l(y[i], 0, ycalendar) * scaleFactor[1];\n zc = zaxis.d2l(z[i], 0, zcalendar) * scaleFactor[2];\n\n points[i] = [xc, yc, zc];\n }\n\n // convert text\n if(Array.isArray(data.text)) text = data.text;\n else if(data.text !== undefined) {\n text = new Array(len);\n for(i = 0; i < len; i++) text[i] = data.text;\n }\n\n function formatter(axName, val) {\n var ax = sceneLayout[axName];\n return Axes.tickText(ax, ax.d2l(val), true).text;\n }\n\n // check texttemplate\n var texttemplate = data.texttemplate;\n if(texttemplate) {\n var fullLayout = scene.fullLayout;\n var d3locale = fullLayout._d3locale;\n var isArray = Array.isArray(texttemplate);\n var N = isArray ? Math.min(texttemplate.length, len) : len;\n var txt = isArray ?\n function(i) { return texttemplate[i]; } :\n function() { return texttemplate; };\n\n text = new Array(N);\n\n for(i = 0; i < N; i++) {\n var d = {x: x[i], y: y[i], z: z[i]};\n var labels = {\n xLabel: formatter('xaxis', x[i]),\n yLabel: formatter('yaxis', y[i]),\n zLabel: formatter('zaxis', z[i])\n };\n var pointValues = {};\n appendArrayPointValue(pointValues, data, i);\n var meta = data._meta || {};\n text[i] = Lib.texttemplateString(txt(i), labels, d3locale, pointValues, d, meta);\n }\n }\n\n // Build object parameters\n params = {\n position: points,\n mode: data.mode,\n text: text\n };\n\n if('line' in data) {\n params.lineColor = formatColor(line, 1, len);\n params.lineWidth = line.width;\n params.lineDashes = line.dash;\n }\n\n if('marker' in data) {\n var sizeFn = makeBubbleSizeFn(data);\n\n params.scatterColor = formatColor(marker, 1, len);\n params.scatterSize = formatParam(marker.size, len, calculateSize, 20, sizeFn);\n params.scatterMarker = formatParam(marker.symbol, len, calculateSymbol, '●');\n params.scatterLineWidth = marker.line.width; // arrayOk === false\n params.scatterLineColor = formatColor(marker.line, 1, len);\n params.scatterAngle = 0;\n }\n\n if('textposition' in data) {\n params.textOffset = calculateTextOffset(data.textposition);\n params.textColor = formatColor(data.textfont, 1, len);\n params.textSize = formatParam(data.textfont.size, len, Lib.identity, 12);\n params.textFont = data.textfont.family; // arrayOk === false\n params.textAngle = 0;\n }\n\n var dims = ['x', 'y', 'z'];\n params.project = [false, false, false];\n params.projectScale = [1, 1, 1];\n params.projectOpacity = [1, 1, 1];\n for(i = 0; i < 3; ++i) {\n var projection = data.projection[dims[i]];\n if((params.project[i] = projection.show)) {\n params.projectOpacity[i] = projection.opacity;\n params.projectScale[i] = projection.scale;\n }\n }\n\n params.errorBounds = calculateError(data, scaleFactor, sceneLayout);\n\n var errorParams = calculateErrorParams([data.error_x, data.error_y, data.error_z]);\n params.errorColor = errorParams.color;\n params.errorLineWidth = errorParams.lineWidth;\n params.errorCapSize = errorParams.capSize;\n\n params.delaunayAxis = data.surfaceaxis;\n params.delaunayColor = str2RgbaArray(data.surfacecolor);\n\n return params;\n}\n\nfunction arrayToColor(color) {\n if(Array.isArray(color)) {\n var c = color[0];\n\n if(Array.isArray(c)) color = c;\n\n return 'rgb(' + color.slice(0, 3).map(function(x) {\n return Math.round(x * 255);\n }) + ')';\n }\n\n return null;\n}\n\nproto.update = function(data) {\n var gl = this.scene.glplot.gl;\n var lineOptions;\n var scatterOptions;\n var errorOptions;\n var textOptions;\n var dashPattern = DASH_PATTERNS.solid;\n\n // Save data\n this.data = data;\n\n // Run data conversion\n var options = convertPlotlyOptions(this.scene, data);\n\n if('mode' in options) {\n this.mode = options.mode;\n }\n if('lineDashes' in options) {\n if(options.lineDashes in DASH_PATTERNS) {\n dashPattern = DASH_PATTERNS[options.lineDashes];\n }\n }\n\n this.color = arrayToColor(options.scatterColor) ||\n arrayToColor(options.lineColor);\n\n // Save data points\n this.dataPoints = options.position;\n\n lineOptions = {\n gl: this.scene.glplot.gl,\n position: options.position,\n color: options.lineColor,\n lineWidth: options.lineWidth || 1,\n dashes: dashPattern[0],\n dashScale: dashPattern[1],\n opacity: data.opacity,\n connectGaps: data.connectgaps\n };\n\n if(this.mode.indexOf('lines') !== -1) {\n if(this.linePlot) this.linePlot.update(lineOptions);\n else {\n this.linePlot = createLinePlot(lineOptions);\n this.linePlot._trace = this;\n this.scene.glplot.add(this.linePlot);\n }\n } else if(this.linePlot) {\n this.scene.glplot.remove(this.linePlot);\n this.linePlot.dispose();\n this.linePlot = null;\n }\n\n // N.B. marker.opacity must be a scalar for performance\n var scatterOpacity = data.opacity;\n if(data.marker && data.marker.opacity) scatterOpacity *= data.marker.opacity;\n\n scatterOptions = {\n gl: this.scene.glplot.gl,\n position: options.position,\n color: options.scatterColor,\n size: options.scatterSize,\n glyph: options.scatterMarker,\n opacity: scatterOpacity,\n orthographic: true,\n lineWidth: options.scatterLineWidth,\n lineColor: options.scatterLineColor,\n project: options.project,\n projectScale: options.projectScale,\n projectOpacity: options.projectOpacity\n };\n\n if(this.mode.indexOf('markers') !== -1) {\n if(this.scatterPlot) this.scatterPlot.update(scatterOptions);\n else {\n this.scatterPlot = createScatterPlot(scatterOptions);\n this.scatterPlot._trace = this;\n this.scatterPlot.highlightScale = 1;\n this.scene.glplot.add(this.scatterPlot);\n }\n } else if(this.scatterPlot) {\n this.scene.glplot.remove(this.scatterPlot);\n this.scatterPlot.dispose();\n this.scatterPlot = null;\n }\n\n textOptions = {\n gl: this.scene.glplot.gl,\n position: options.position,\n glyph: options.text,\n color: options.textColor,\n size: options.textSize,\n angle: options.textAngle,\n alignment: options.textOffset,\n font: options.textFont,\n orthographic: true,\n lineWidth: 0,\n project: false,\n opacity: data.opacity\n };\n\n this.textLabels = data.hovertext || data.text;\n\n if(this.mode.indexOf('text') !== -1) {\n if(this.textMarkers) this.textMarkers.update(textOptions);\n else {\n this.textMarkers = createScatterPlot(textOptions);\n this.textMarkers._trace = this;\n this.textMarkers.highlightScale = 1;\n this.scene.glplot.add(this.textMarkers);\n }\n } else if(this.textMarkers) {\n this.scene.glplot.remove(this.textMarkers);\n this.textMarkers.dispose();\n this.textMarkers = null;\n }\n\n errorOptions = {\n gl: this.scene.glplot.gl,\n position: options.position,\n color: options.errorColor,\n error: options.errorBounds,\n lineWidth: options.errorLineWidth,\n capSize: options.errorCapSize,\n opacity: data.opacity\n };\n if(this.errorBars) {\n if(options.errorBounds) {\n this.errorBars.update(errorOptions);\n } else {\n this.scene.glplot.remove(this.errorBars);\n this.errorBars.dispose();\n this.errorBars = null;\n }\n } else if(options.errorBounds) {\n this.errorBars = createErrorBars(errorOptions);\n this.errorBars._trace = this;\n this.scene.glplot.add(this.errorBars);\n }\n\n if(options.delaunayAxis >= 0) {\n var delaunayOptions = constructDelaunay(\n options.position,\n options.delaunayColor,\n options.delaunayAxis\n );\n delaunayOptions.opacity = data.opacity;\n\n if(this.delaunayMesh) {\n this.delaunayMesh.update(delaunayOptions);\n } else {\n delaunayOptions.gl = gl;\n this.delaunayMesh = createMesh(delaunayOptions);\n this.delaunayMesh._trace = this;\n this.scene.glplot.add(this.delaunayMesh);\n }\n } else if(this.delaunayMesh) {\n this.scene.glplot.remove(this.delaunayMesh);\n this.delaunayMesh.dispose();\n this.delaunayMesh = null;\n }\n};\n\nproto.dispose = function() {\n if(this.linePlot) {\n this.scene.glplot.remove(this.linePlot);\n this.linePlot.dispose();\n }\n if(this.scatterPlot) {\n this.scene.glplot.remove(this.scatterPlot);\n this.scatterPlot.dispose();\n }\n if(this.errorBars) {\n this.scene.glplot.remove(this.errorBars);\n this.errorBars.dispose();\n }\n if(this.textMarkers) {\n this.scene.glplot.remove(this.textMarkers);\n this.textMarkers.dispose();\n }\n if(this.delaunayMesh) {\n this.scene.glplot.remove(this.delaunayMesh);\n this.delaunayMesh.dispose();\n }\n};\n\nfunction createLineWithMarkers(scene, data) {\n var plot = new LineWithMarkers(scene, data.uid);\n plot.update(data);\n return plot;\n}\n\nmodule.exports = createLineWithMarkers;\n\n},{\"../../components/fx/helpers\":631,\"../../constants/gl3d_dashes\":701,\"../../constants/gl3d_markers\":702,\"../../lib\":728,\"../../lib/gl_format_color\":725,\"../../lib/str2rgbarray\":751,\"../../plots/cartesian/axes\":776,\"../scatter/make_bubble_size_func\":1151,\"./calc_errors\":1163,\"delaunay-triangulate\":166,\"gl-error3d\":259,\"gl-line3d\":266,\"gl-mesh3d\":287,\"gl-scatter3d\":303}],1165:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\n\nvar subTypes = _dereq_('../scatter/subtypes');\nvar handleMarkerDefaults = _dereq_('../scatter/marker_defaults');\nvar handleLineDefaults = _dereq_('../scatter/line_defaults');\nvar handleTextDefaults = _dereq_('../scatter/text_defaults');\n\nvar attributes = _dereq_('./attributes');\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 len = handleXYZDefaults(traceIn, traceOut, coerce, layout);\n if(!len) {\n traceOut.visible = false;\n return;\n }\n\n coerce('text');\n coerce('hovertext');\n coerce('hovertemplate');\n coerce('mode');\n\n if(subTypes.hasLines(traceOut)) {\n coerce('connectgaps');\n handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce);\n }\n\n if(subTypes.hasMarkers(traceOut)) {\n handleMarkerDefaults(traceIn, traceOut, defaultColor, layout, coerce, {noSelect: true});\n }\n\n if(subTypes.hasText(traceOut)) {\n coerce('texttemplate');\n handleTextDefaults(traceIn, traceOut, layout, coerce, {noSelect: true});\n }\n\n var lineColor = (traceOut.line || {}).color;\n var markerColor = (traceOut.marker || {}).color;\n if(coerce('surfaceaxis') >= 0) coerce('surfacecolor', lineColor || markerColor);\n\n var dims = ['x', 'y', 'z'];\n for(var i = 0; i < 3; ++i) {\n var projection = 'projection.' + dims[i];\n if(coerce(projection + '.show')) {\n coerce(projection + '.opacity');\n coerce(projection + '.scale');\n }\n }\n\n var errorBarsSupplyDefaults = Registry.getComponentMethod('errorbars', 'supplyDefaults');\n errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'z'});\n errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'y', inherit: 'z'});\n errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'x', inherit: 'z'});\n};\n\nfunction handleXYZDefaults(traceIn, traceOut, coerce, layout) {\n var len = 0;\n var x = coerce('x');\n var y = coerce('y');\n var z = coerce('z');\n\n var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');\n handleCalendarDefaults(traceIn, traceOut, ['x', 'y', 'z'], layout);\n\n if(x && y && z) {\n // TODO: what happens if one is missing?\n len = Math.min(x.length, y.length, z.length);\n traceOut._length = traceOut._xlength = traceOut._ylength = traceOut._zlength = len;\n }\n\n return len;\n}\n\n},{\"../../lib\":728,\"../../registry\":859,\"../scatter/line_defaults\":1147,\"../scatter/marker_defaults\":1153,\"../scatter/subtypes\":1158,\"../scatter/text_defaults\":1159,\"./attributes\":1161}],1166:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n plot: _dereq_('./convert'),\n attributes: _dereq_('./attributes'),\n markerSymbols: _dereq_('../../constants/gl3d_markers'),\n supplyDefaults: _dereq_('./defaults'),\n colorbar: [\n {\n container: 'marker',\n min: 'cmin',\n max: 'cmax'\n }, {\n container: 'line',\n min: 'cmin',\n max: 'cmax'\n }\n ],\n calc: _dereq_('./calc'),\n\n moduleType: 'trace',\n name: 'scatter3d',\n basePlotModule: _dereq_('../../plots/gl3d'),\n categories: ['gl3d', 'symbols', 'showLegend', 'scatter-like'],\n meta: {\n \n \n }\n};\n\n},{\"../../constants/gl3d_markers\":702,\"../../plots/gl3d\":818,\"./attributes\":1161,\"./calc\":1162,\"./convert\":1164,\"./defaults\":1165}],1167:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar scatterAttrs = _dereq_('../scatter/attributes');\nvar baseAttrs = _dereq_('../../plots/attributes');\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar texttemplateAttrs = _dereq_('../../plots/template_attributes').texttemplateAttrs;\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nvar scatterMarkerAttrs = scatterAttrs.marker;\nvar scatterLineAttrs = scatterAttrs.line;\nvar scatterMarkerLineAttrs = scatterMarkerAttrs.line;\n\nmodule.exports = {\n carpet: {\n valType: 'string',\n \n editType: 'calc',\n \n },\n a: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n b: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n mode: extendFlat({}, scatterAttrs.mode, {dflt: 'markers'}),\n text: extendFlat({}, scatterAttrs.text, {\n \n }),\n texttemplate: texttemplateAttrs({editType: 'plot'}, {\n keys: ['a', 'b', 'text']\n }),\n hovertext: extendFlat({}, scatterAttrs.hovertext, {\n \n }),\n line: {\n color: scatterLineAttrs.color,\n width: scatterLineAttrs.width,\n dash: scatterLineAttrs.dash,\n shape: extendFlat({}, scatterLineAttrs.shape,\n {values: ['linear', 'spline']}),\n smoothing: scatterLineAttrs.smoothing,\n editType: 'calc'\n },\n connectgaps: scatterAttrs.connectgaps,\n fill: extendFlat({}, scatterAttrs.fill, {\n values: ['none', 'toself', 'tonext'],\n dflt: 'none',\n \n }),\n fillcolor: scatterAttrs.fillcolor,\n marker: extendFlat({\n symbol: scatterMarkerAttrs.symbol,\n opacity: scatterMarkerAttrs.opacity,\n maxdisplayed: scatterMarkerAttrs.maxdisplayed,\n size: scatterMarkerAttrs.size,\n sizeref: scatterMarkerAttrs.sizeref,\n sizemin: scatterMarkerAttrs.sizemin,\n sizemode: scatterMarkerAttrs.sizemode,\n line: extendFlat({\n width: scatterMarkerLineAttrs.width,\n editType: 'calc'\n },\n colorScaleAttrs('marker.line')\n ),\n gradient: scatterMarkerAttrs.gradient,\n editType: 'calc'\n },\n colorScaleAttrs('marker')\n ),\n\n textfont: scatterAttrs.textfont,\n textposition: scatterAttrs.textposition,\n\n selected: scatterAttrs.selected,\n unselected: scatterAttrs.unselected,\n\n hoverinfo: extendFlat({}, baseAttrs.hoverinfo, {\n flags: ['a', 'b', 'text', 'name']\n }),\n hoveron: scatterAttrs.hoveron,\n hovertemplate: hovertemplateAttrs()\n};\n\n},{\"../../components/colorscale/attributes\":602,\"../../lib/extend\":719,\"../../plots/attributes\":773,\"../../plots/template_attributes\":854,\"../scatter/attributes\":1134}],1168:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar calcColorscale = _dereq_('../scatter/colorscale_calc');\nvar arraysToCalcdata = _dereq_('../scatter/arrays_to_calcdata');\nvar calcSelection = _dereq_('../scatter/calc_selection');\nvar calcMarkerSize = _dereq_('../scatter/calc').calcMarkerSize;\nvar lookupCarpet = _dereq_('../carpet/lookup_carpetid');\n\nmodule.exports = function calc(gd, trace) {\n var carpet = trace._carpetTrace = lookupCarpet(gd, trace);\n if(!carpet || !carpet.visible || carpet.visible === 'legendonly') return;\n var i;\n\n // Transfer this over from carpet before plotting since this is a necessary\n // condition in order for cartesian to actually plot this trace:\n trace.xaxis = carpet.xaxis;\n trace.yaxis = carpet.yaxis;\n\n // make the calcdata array\n var serieslen = trace._length;\n var cd = new Array(serieslen);\n var a, b;\n var needsCull = false;\n for(i = 0; i < serieslen; i++) {\n a = trace.a[i];\n b = trace.b[i];\n if(isNumeric(a) && isNumeric(b)) {\n var xy = carpet.ab2xy(+a, +b, true);\n var visible = carpet.isVisible(+a, +b);\n if(!visible) needsCull = true;\n cd[i] = {x: xy[0], y: xy[1], a: a, b: b, vis: visible};\n } else cd[i] = {x: false, y: false};\n }\n\n trace._needsCull = needsCull;\n\n cd[0].carpet = carpet;\n cd[0].trace = trace;\n\n calcMarkerSize(trace, serieslen);\n calcColorscale(gd, trace);\n arraysToCalcdata(cd, trace);\n calcSelection(cd, trace);\n\n return cd;\n};\n\n},{\"../carpet/lookup_carpetid\":929,\"../scatter/arrays_to_calcdata\":1133,\"../scatter/calc\":1135,\"../scatter/calc_selection\":1136,\"../scatter/colorscale_calc\":1137,\"fast-isnumeric\":236}],1169:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nvar constants = _dereq_('../scatter/constants');\nvar subTypes = _dereq_('../scatter/subtypes');\nvar handleMarkerDefaults = _dereq_('../scatter/marker_defaults');\nvar handleLineDefaults = _dereq_('../scatter/line_defaults');\nvar handleLineShapeDefaults = _dereq_('../scatter/line_shape_defaults');\nvar handleTextDefaults = _dereq_('../scatter/text_defaults');\nvar handleFillColorDefaults = _dereq_('../scatter/fillcolor_defaults');\n\nvar attributes = _dereq_('./attributes');\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 coerce('carpet');\n\n // XXX: Don't hard code this\n traceOut.xaxis = 'x';\n traceOut.yaxis = 'y';\n\n var a = coerce('a');\n var b = coerce('b');\n var len = Math.min(a.length, b.length);\n\n if(!len) {\n traceOut.visible = false;\n return;\n }\n\n traceOut._length = len;\n\n coerce('text');\n coerce('texttemplate');\n coerce('hovertext');\n\n var defaultMode = len < constants.PTS_LINESONLY ? 'lines+markers' : 'lines';\n coerce('mode', defaultMode);\n\n if(subTypes.hasLines(traceOut)) {\n handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce);\n handleLineShapeDefaults(traceIn, traceOut, coerce);\n coerce('connectgaps');\n }\n\n if(subTypes.hasMarkers(traceOut)) {\n handleMarkerDefaults(traceIn, traceOut, defaultColor, layout, coerce, {gradient: true});\n }\n\n if(subTypes.hasText(traceOut)) {\n handleTextDefaults(traceIn, traceOut, layout, coerce);\n }\n\n var dfltHoverOn = [];\n\n if(subTypes.hasMarkers(traceOut) || subTypes.hasText(traceOut)) {\n coerce('marker.maxdisplayed');\n dfltHoverOn.push('points');\n }\n\n coerce('fill');\n if(traceOut.fill !== 'none') {\n handleFillColorDefaults(traceIn, traceOut, defaultColor, coerce);\n if(!subTypes.hasLines(traceOut)) handleLineShapeDefaults(traceIn, traceOut, coerce);\n }\n\n if(traceOut.fill === 'tonext' || traceOut.fill === 'toself') {\n dfltHoverOn.push('fills');\n }\n\n var hoverOn = coerce('hoveron', dfltHoverOn.join('+') || 'points');\n if(hoverOn !== 'fills') coerce('hovertemplate');\n\n Lib.coerceSelectionMarkerOpacity(traceOut, coerce);\n};\n\n},{\"../../lib\":728,\"../scatter/constants\":1138,\"../scatter/fillcolor_defaults\":1142,\"../scatter/line_defaults\":1147,\"../scatter/line_shape_defaults\":1149,\"../scatter/marker_defaults\":1153,\"../scatter/subtypes\":1158,\"../scatter/text_defaults\":1159,\"./attributes\":1167}],1170:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = function eventData(out, pt, trace, cd, pointNumber) {\n var cdi = cd[pointNumber];\n\n out.a = cdi.a;\n out.b = cdi.b;\n out.y = cdi.y;\n\n return out;\n};\n\n},{}],1171:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = function formatLabels(cdi, trace) {\n var labels = {};\n\n var carpet = trace._carpet;\n var ij = carpet.ab2ij([cdi.a, cdi.b]);\n var i0 = Math.floor(ij[0]);\n var ti = ij[0] - i0;\n var j0 = Math.floor(ij[1]);\n var tj = ij[1] - j0;\n var xy = carpet.evalxy([], i0, j0, ti, tj);\n\n labels.yLabel = xy[1].toFixed(3);\n\n return labels;\n};\n\n},{}],1172:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar scatterHover = _dereq_('../scatter/hover');\nvar fillText = _dereq_('../../lib').fillText;\n\nmodule.exports = function hoverPoints(pointData, xval, yval, hovermode) {\n var scatterPointData = scatterHover(pointData, xval, yval, hovermode);\n if(!scatterPointData || scatterPointData[0].index === false) return;\n\n var newPointData = scatterPointData[0];\n\n // if hovering on a fill, we don't show any point data so the label is\n // unchanged from what scatter gives us - except that it needs to\n // be constrained to the trianglular plot area, not just the rectangular\n // area defined by the synthetic x and y axes\n // TODO: in some cases the vertical middle of the shape is not within\n // the triangular viewport at all, so the label can become disconnected\n // from the shape entirely. But calculating what portion of the shape\n // is actually visible, as constrained by the diagonal axis lines, is not\n // so easy and anyway we lost the information we would have needed to do\n // this inside scatterHover.\n if(newPointData.index === undefined) {\n var yFracUp = 1 - (newPointData.y0 / pointData.ya._length);\n var xLen = pointData.xa._length;\n var xMin = xLen * yFracUp / 2;\n var xMax = xLen - xMin;\n newPointData.x0 = Math.max(Math.min(newPointData.x0, xMax), xMin);\n newPointData.x1 = Math.max(Math.min(newPointData.x1, xMax), xMin);\n return scatterPointData;\n }\n\n var cdi = newPointData.cd[newPointData.index];\n\n newPointData.a = cdi.a;\n newPointData.b = cdi.b;\n\n newPointData.xLabelVal = undefined;\n newPointData.yLabelVal = undefined;\n // TODO: nice formatting, and label by axis title, for a, b, and c?\n\n var trace = newPointData.trace;\n var carpet = trace._carpet;\n\n var labels = trace._module.formatLabels(cdi, trace);\n newPointData.yLabel = labels.yLabel;\n\n delete newPointData.text;\n var text = [];\n\n function textPart(ax, val) {\n var prefix;\n\n if(ax.labelprefix && ax.labelprefix.length > 0) {\n prefix = ax.labelprefix.replace(/ = $/, '');\n } else {\n prefix = ax._hovertitle;\n }\n\n text.push(prefix + ': ' + val.toFixed(3) + ax.labelsuffix);\n }\n\n\n if(!trace.hovertemplate) {\n var hoverinfo = cdi.hi || trace.hoverinfo;\n var parts = hoverinfo.split('+');\n\n if(parts.indexOf('all') !== -1) parts = ['a', 'b', 'text'];\n if(parts.indexOf('a') !== -1) textPart(carpet.aaxis, cdi.a);\n if(parts.indexOf('b') !== -1) textPart(carpet.baxis, cdi.b);\n\n text.push('y: ' + newPointData.yLabel);\n\n if(parts.indexOf('text') !== -1) {\n fillText(cdi, trace, text);\n }\n\n newPointData.extraText = text.join('
');\n }\n\n return scatterPointData;\n};\n\n},{\"../../lib\":728,\"../scatter/hover\":1145}],1173:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults'),\n colorbar: _dereq_('../scatter/marker_colorbar'),\n formatLabels: _dereq_('./format_labels'),\n calc: _dereq_('./calc'),\n plot: _dereq_('./plot'),\n style: _dereq_('../scatter/style').style,\n styleOnSelect: _dereq_('../scatter/style').styleOnSelect,\n hoverPoints: _dereq_('./hover'),\n selectPoints: _dereq_('../scatter/select'),\n eventData: _dereq_('./event_data'),\n\n moduleType: 'trace',\n name: 'scattercarpet',\n basePlotModule: _dereq_('../../plots/cartesian'),\n categories: ['svg', 'carpet', 'symbols', 'showLegend', 'carpetDependent', 'zoomScale'],\n meta: {\n \n \n }\n};\n\n},{\"../../plots/cartesian\":789,\"../scatter/marker_colorbar\":1152,\"../scatter/select\":1155,\"../scatter/style\":1157,\"./attributes\":1167,\"./calc\":1168,\"./defaults\":1169,\"./event_data\":1170,\"./format_labels\":1171,\"./hover\":1172,\"./plot\":1174}],1174:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar scatterPlot = _dereq_('../scatter/plot');\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar Drawing = _dereq_('../../components/drawing');\n\nmodule.exports = function plot(gd, plotinfoproxy, data, layer) {\n var i, trace, node;\n\n var carpet = data[0][0].carpet;\n // mimic cartesian plotinfo\n var plotinfo = {\n xaxis: Axes.getFromId(gd, carpet.xaxis || 'x'),\n yaxis: Axes.getFromId(gd, carpet.yaxis || 'y'),\n plot: plotinfoproxy.plot,\n };\n\n scatterPlot(gd, plotinfo, data, layer);\n\n for(i = 0; i < data.length; i++) {\n trace = data[i][0].trace;\n\n // Note: .select is adequate but seems to mutate the node data,\n // which is at least a bit suprising and causes problems elsewhere\n node = layer.selectAll('g.trace' + trace.uid + ' .js-line');\n\n // Note: it would be more efficient if this didn't need to be applied\n // separately to all scattercarpet traces, but that would require\n // lots of reorganization of scatter traces that is otherwise not\n // necessary. That makes this a potential optimization.\n Drawing.setClipUrl(node, data[i][0].carpet._clipPathId, gd);\n }\n};\n\n},{\"../../components/drawing\":617,\"../../plots/cartesian/axes\":776,\"../scatter/plot\":1154}],1175:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar texttemplateAttrs = _dereq_('../../plots/template_attributes').texttemplateAttrs;\nvar scatterAttrs = _dereq_('../scatter/attributes');\nvar baseAttrs = _dereq_('../../plots/attributes');\nvar colorAttributes = _dereq_('../../components/colorscale/attributes');\nvar dash = _dereq_('../../components/drawing/attributes').dash;\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\nvar overrideAll = _dereq_('../../plot_api/edit_types').overrideAll;\n\nvar scatterMarkerAttrs = scatterAttrs.marker;\nvar scatterLineAttrs = scatterAttrs.line;\nvar scatterMarkerLineAttrs = scatterMarkerAttrs.line;\n\nmodule.exports = overrideAll({\n lon: {\n valType: 'data_array',\n \n },\n lat: {\n valType: 'data_array',\n \n },\n\n locations: {\n valType: 'data_array',\n \n },\n locationmode: {\n valType: 'enumerated',\n values: ['ISO-3', 'USA-states', 'country names', 'geojson-id'],\n \n dflt: 'ISO-3',\n \n },\n\n geojson: {\n valType: 'any',\n \n editType: 'calc',\n \n },\n featureidkey: {\n valType: 'string',\n \n editType: 'calc',\n dflt: 'id',\n \n },\n\n mode: extendFlat({}, scatterAttrs.mode, {dflt: 'markers'}),\n\n text: extendFlat({}, scatterAttrs.text, {\n \n }),\n texttemplate: texttemplateAttrs({editType: 'plot'}, {\n keys: ['lat', 'lon', 'location', 'text']\n }),\n hovertext: extendFlat({}, scatterAttrs.hovertext, {\n \n }),\n\n textfont: scatterAttrs.textfont,\n textposition: scatterAttrs.textposition,\n\n line: {\n color: scatterLineAttrs.color,\n width: scatterLineAttrs.width,\n dash: dash\n },\n connectgaps: scatterAttrs.connectgaps,\n\n marker: extendFlat({\n symbol: scatterMarkerAttrs.symbol,\n opacity: scatterMarkerAttrs.opacity,\n size: scatterMarkerAttrs.size,\n sizeref: scatterMarkerAttrs.sizeref,\n sizemin: scatterMarkerAttrs.sizemin,\n sizemode: scatterMarkerAttrs.sizemode,\n colorbar: scatterMarkerAttrs.colorbar,\n line: extendFlat({\n width: scatterMarkerLineAttrs.width\n },\n colorAttributes('marker.line')\n ),\n gradient: scatterMarkerAttrs.gradient\n },\n colorAttributes('marker')\n ),\n\n fill: {\n valType: 'enumerated',\n values: ['none', 'toself'],\n dflt: 'none',\n \n \n },\n fillcolor: scatterAttrs.fillcolor,\n\n selected: scatterAttrs.selected,\n unselected: scatterAttrs.unselected,\n\n hoverinfo: extendFlat({}, baseAttrs.hoverinfo, {\n flags: ['lon', 'lat', 'location', 'text', 'name']\n }),\n hovertemplate: hovertemplateAttrs(),\n}, 'calc', 'nested');\n\n},{\"../../components/colorscale/attributes\":602,\"../../components/drawing/attributes\":616,\"../../lib/extend\":719,\"../../plot_api/edit_types\":759,\"../../plots/attributes\":773,\"../../plots/template_attributes\":854,\"../scatter/attributes\":1134}],1176:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\n\nvar calcMarkerColorscale = _dereq_('../scatter/colorscale_calc');\nvar arraysToCalcdata = _dereq_('../scatter/arrays_to_calcdata');\nvar calcSelection = _dereq_('../scatter/calc_selection');\n\nvar _ = _dereq_('../../lib')._;\n\nfunction isNonBlankString(v) {\n return v && typeof v === 'string';\n}\n\nmodule.exports = function calc(gd, trace) {\n var hasLocationData = Array.isArray(trace.locations);\n var len = hasLocationData ? trace.locations.length : trace._length;\n var calcTrace = new Array(len);\n\n var isValidLoc;\n if(trace.geojson) {\n isValidLoc = function(v) { return isNonBlankString(v) || isNumeric(v); };\n } else {\n isValidLoc = isNonBlankString;\n }\n\n for(var i = 0; i < len; i++) {\n var calcPt = calcTrace[i] = {};\n\n if(hasLocationData) {\n var loc = trace.locations[i];\n calcPt.loc = isValidLoc(loc) ? loc : null;\n } else {\n var lon = trace.lon[i];\n var lat = trace.lat[i];\n\n if(isNumeric(lon) && isNumeric(lat)) calcPt.lonlat = [+lon, +lat];\n else calcPt.lonlat = [BADNUM, BADNUM];\n }\n }\n\n arraysToCalcdata(calcTrace, trace);\n calcMarkerColorscale(gd, trace);\n calcSelection(calcTrace, trace);\n\n if(len) {\n calcTrace[0].t = {\n labels: {\n lat: _(gd, 'lat:') + ' ',\n lon: _(gd, 'lon:') + ' '\n }\n };\n }\n\n return calcTrace;\n};\n\n},{\"../../constants/numerical\":704,\"../../lib\":728,\"../scatter/arrays_to_calcdata\":1133,\"../scatter/calc_selection\":1136,\"../scatter/colorscale_calc\":1137,\"fast-isnumeric\":236}],1177:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nvar subTypes = _dereq_('../scatter/subtypes');\nvar handleMarkerDefaults = _dereq_('../scatter/marker_defaults');\nvar handleLineDefaults = _dereq_('../scatter/line_defaults');\nvar handleTextDefaults = _dereq_('../scatter/text_defaults');\nvar handleFillColorDefaults = _dereq_('../scatter/fillcolor_defaults');\n\nvar attributes = _dereq_('./attributes');\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 locations = coerce('locations');\n var len;\n\n if(locations && locations.length) {\n var geojson = coerce('geojson');\n var locationmodeDflt;\n if((typeof geojson === 'string' && geojson !== '') || Lib.isPlainObject(geojson)) {\n locationmodeDflt = 'geojson-id';\n }\n\n var locationMode = coerce('locationmode', locationmodeDflt);\n\n if(locationMode === 'geojson-id') {\n coerce('featureidkey');\n }\n\n len = locations.length;\n } else {\n var lon = coerce('lon') || [];\n var lat = coerce('lat') || [];\n len = Math.min(lon.length, lat.length);\n }\n\n if(!len) {\n traceOut.visible = false;\n return;\n }\n\n traceOut._length = len;\n\n coerce('text');\n coerce('hovertext');\n coerce('hovertemplate');\n coerce('mode');\n\n if(subTypes.hasLines(traceOut)) {\n handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce);\n coerce('connectgaps');\n }\n\n if(subTypes.hasMarkers(traceOut)) {\n handleMarkerDefaults(traceIn, traceOut, defaultColor, layout, coerce, {gradient: true});\n }\n\n if(subTypes.hasText(traceOut)) {\n coerce('texttemplate');\n handleTextDefaults(traceIn, traceOut, layout, coerce);\n }\n\n coerce('fill');\n if(traceOut.fill !== 'none') {\n handleFillColorDefaults(traceIn, traceOut, defaultColor, coerce);\n }\n\n Lib.coerceSelectionMarkerOpacity(traceOut, coerce);\n};\n\n},{\"../../lib\":728,\"../scatter/fillcolor_defaults\":1142,\"../scatter/line_defaults\":1147,\"../scatter/marker_defaults\":1153,\"../scatter/subtypes\":1158,\"../scatter/text_defaults\":1159,\"./attributes\":1175}],1178:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\nmodule.exports = function eventData(out, pt, trace, cd, pointNumber) {\n out.lon = pt.lon;\n out.lat = pt.lat;\n out.location = pt.loc ? pt.loc : null;\n\n // include feature properties from input geojson\n var cdi = cd[pointNumber];\n if(cdi.fIn && cdi.fIn.properties) {\n out.properties = cdi.fIn.properties;\n }\n\n return out;\n};\n\n},{}],1179:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Axes = _dereq_('../../plots/cartesian/axes');\n\nmodule.exports = function formatLabels(cdi, trace, fullLayout) {\n var labels = {};\n\n var geo = fullLayout[trace.geo]._subplot;\n var ax = geo.mockAxis;\n var lonlat = cdi.lonlat;\n labels.lonLabel = Axes.tickText(ax, ax.c2l(lonlat[0]), true).text;\n labels.latLabel = Axes.tickText(ax, ax.c2l(lonlat[1]), true).text;\n\n return labels;\n};\n\n},{\"../../plots/cartesian/axes\":776}],1180:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Fx = _dereq_('../../components/fx');\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\n\nvar getTraceColor = _dereq_('../scatter/get_trace_color');\nvar fillText = _dereq_('../../lib').fillText;\nvar attributes = _dereq_('./attributes');\n\nmodule.exports = function hoverPoints(pointData, xval, yval) {\n var cd = pointData.cd;\n var trace = cd[0].trace;\n var xa = pointData.xa;\n var ya = pointData.ya;\n var geo = pointData.subplot;\n\n var isLonLatOverEdges = geo.projection.isLonLatOverEdges;\n var project = geo.project;\n\n function distFn(d) {\n var lonlat = d.lonlat;\n\n if(lonlat[0] === BADNUM) return Infinity;\n if(isLonLatOverEdges(lonlat)) return Infinity;\n\n var pt = project(lonlat);\n var px = project([xval, yval]);\n var dx = Math.abs(pt[0] - px[0]);\n var dy = Math.abs(pt[1] - px[1]);\n var rad = Math.max(3, d.mrc || 0);\n\n // N.B. d.mrc is the calculated marker radius\n // which is only set for trace with 'markers' mode.\n\n return Math.max(Math.sqrt(dx * dx + dy * dy) - rad, 1 - 3 / rad);\n }\n\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 var di = cd[pointData.index];\n var lonlat = di.lonlat;\n var pos = [xa.c2p(lonlat), ya.c2p(lonlat)];\n var rad = di.mrc || 1;\n\n pointData.x0 = pos[0] - rad;\n pointData.x1 = pos[0] + rad;\n pointData.y0 = pos[1] - rad;\n pointData.y1 = pos[1] + rad;\n\n pointData.loc = di.loc;\n pointData.lon = lonlat[0];\n pointData.lat = lonlat[1];\n\n var fullLayout = {};\n fullLayout[trace.geo] = {_subplot: geo};\n var labels = trace._module.formatLabels(di, trace, fullLayout);\n pointData.lonLabel = labels.lonLabel;\n pointData.latLabel = labels.latLabel;\n\n pointData.color = getTraceColor(trace, di);\n pointData.extraText = getExtraText(trace, di, pointData, cd[0].t.labels);\n pointData.hovertemplate = trace.hovertemplate;\n\n return [pointData];\n};\n\nfunction getExtraText(trace, pt, pointData, labels) {\n if(trace.hovertemplate) return;\n\n var hoverinfo = pt.hi || trace.hoverinfo;\n\n var parts = hoverinfo === 'all' ?\n attributes.hoverinfo.flags :\n hoverinfo.split('+');\n\n var hasLocation = parts.indexOf('location') !== -1 && Array.isArray(trace.locations);\n var hasLon = (parts.indexOf('lon') !== -1);\n var hasLat = (parts.indexOf('lat') !== -1);\n var hasText = (parts.indexOf('text') !== -1);\n var text = [];\n\n function format(val) { return val + '\\u00B0'; }\n\n if(hasLocation) {\n text.push(pt.loc);\n } else if(hasLon && hasLat) {\n text.push('(' + format(pointData.lonLabel) + ', ' + format(pointData.latLabel) + ')');\n } else if(hasLon) {\n text.push(labels.lon + format(pointData.lonLabel));\n } else if(hasLat) {\n text.push(labels.lat + format(pointData.latLabel));\n }\n\n if(hasText) {\n fillText(pt, trace, text);\n }\n\n return text.join('
');\n}\n\n},{\"../../components/fx\":635,\"../../constants/numerical\":704,\"../../lib\":728,\"../scatter/get_trace_color\":1144,\"./attributes\":1175}],1181:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults'),\n colorbar: _dereq_('../scatter/marker_colorbar'),\n formatLabels: _dereq_('./format_labels'),\n calc: _dereq_('./calc'),\n calcGeoJSON: _dereq_('./plot').calcGeoJSON,\n plot: _dereq_('./plot').plot,\n style: _dereq_('./style'),\n styleOnSelect: _dereq_('../scatter/style').styleOnSelect,\n hoverPoints: _dereq_('./hover'),\n eventData: _dereq_('./event_data'),\n selectPoints: _dereq_('./select'),\n\n moduleType: 'trace',\n name: 'scattergeo',\n basePlotModule: _dereq_('../../plots/geo'),\n categories: ['geo', 'symbols', 'showLegend', 'scatter-like'],\n meta: {\n \n \n }\n};\n\n},{\"../../plots/geo\":808,\"../scatter/marker_colorbar\":1152,\"../scatter/style\":1157,\"./attributes\":1175,\"./calc\":1176,\"./defaults\":1177,\"./event_data\":1178,\"./format_labels\":1179,\"./hover\":1180,\"./plot\":1182,\"./select\":1183,\"./style\":1184}],1182:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Lib = _dereq_('../../lib');\nvar getTopojsonFeatures = _dereq_('../../lib/topojson_utils').getTopojsonFeatures;\nvar geoJsonUtils = _dereq_('../../lib/geojson_utils');\nvar geoUtils = _dereq_('../../lib/geo_location_utils');\nvar findExtremes = _dereq_('../../plots/cartesian/autorange').findExtremes;\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\n\nvar calcMarkerSize = _dereq_('../scatter/calc').calcMarkerSize;\nvar subTypes = _dereq_('../scatter/subtypes');\nvar style = _dereq_('./style');\n\nfunction plot(gd, geo, calcData) {\n var scatterLayer = geo.layers.frontplot.select('.scatterlayer');\n var gTraces = Lib.makeTraceGroups(scatterLayer, calcData, 'trace scattergeo');\n\n function removeBADNUM(d, node) {\n if(d.lonlat[0] === BADNUM) {\n d3.select(node).remove();\n }\n }\n\n // TODO find a way to order the inner nodes on update\n gTraces.selectAll('*').remove();\n\n gTraces.each(function(calcTrace) {\n var s = d3.select(this);\n var trace = calcTrace[0].trace;\n\n if(subTypes.hasLines(trace) || trace.fill !== 'none') {\n var lineCoords = geoJsonUtils.calcTraceToLineCoords(calcTrace);\n\n var lineData = (trace.fill !== 'none') ?\n geoJsonUtils.makePolygon(lineCoords) :\n geoJsonUtils.makeLine(lineCoords);\n\n s.selectAll('path.js-line')\n .data([{geojson: lineData, trace: trace}])\n .enter().append('path')\n .classed('js-line', true)\n .style('stroke-miterlimit', 2);\n }\n\n if(subTypes.hasMarkers(trace)) {\n s.selectAll('path.point')\n .data(Lib.identity)\n .enter().append('path')\n .classed('point', true)\n .each(function(calcPt) { removeBADNUM(calcPt, this); });\n }\n\n if(subTypes.hasText(trace)) {\n s.selectAll('g')\n .data(Lib.identity)\n .enter().append('g')\n .append('text')\n .each(function(calcPt) { removeBADNUM(calcPt, this); });\n }\n\n // call style here within topojson request callback\n style(gd, calcTrace);\n });\n}\n\nfunction calcGeoJSON(calcTrace, fullLayout) {\n var trace = calcTrace[0].trace;\n var geoLayout = fullLayout[trace.geo];\n var geo = geoLayout._subplot;\n var len = trace._length;\n var i, calcPt;\n\n if(Array.isArray(trace.locations)) {\n var locationmode = trace.locationmode;\n var features = locationmode === 'geojson-id' ?\n geoUtils.extractTraceFeature(calcTrace) :\n getTopojsonFeatures(trace, geo.topojson);\n\n for(i = 0; i < len; i++) {\n calcPt = calcTrace[i];\n\n var feature = locationmode === 'geojson-id' ?\n calcPt.fOut :\n geoUtils.locationToFeature(locationmode, calcPt.loc, features);\n\n calcPt.lonlat = feature ? feature.properties.ct : [BADNUM, BADNUM];\n }\n }\n\n var opts = {padded: true};\n var lonArray;\n var latArray;\n\n if(geoLayout.fitbounds === 'geojson' && trace.locationmode === 'geojson-id') {\n var bboxGeojson = geoUtils.computeBbox(geoUtils.getTraceGeojson(trace));\n lonArray = [bboxGeojson[0], bboxGeojson[2]];\n latArray = [bboxGeojson[1], bboxGeojson[3]];\n } else {\n lonArray = new Array(len);\n latArray = new Array(len);\n for(i = 0; i < len; i++) {\n calcPt = calcTrace[i];\n lonArray[i] = calcPt.lonlat[0];\n latArray[i] = calcPt.lonlat[1];\n }\n\n opts.ppad = calcMarkerSize(trace, len);\n }\n\n trace._extremes.lon = findExtremes(geoLayout.lonaxis._ax, lonArray, opts);\n trace._extremes.lat = findExtremes(geoLayout.lataxis._ax, latArray, opts);\n}\n\nmodule.exports = {\n calcGeoJSON: calcGeoJSON,\n plot: plot\n};\n\n},{\"../../constants/numerical\":704,\"../../lib\":728,\"../../lib/geo_location_utils\":722,\"../../lib/geojson_utils\":723,\"../../lib/topojson_utils\":755,\"../../plots/cartesian/autorange\":775,\"../scatter/calc\":1135,\"../scatter/subtypes\":1158,\"./style\":1184,\"d3\":164}],1183:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar subtypes = _dereq_('../scatter/subtypes');\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\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\n var di, lonlat, x, y, i;\n\n var hasOnlyLines = (!subtypes.hasMarkers(trace) && !subtypes.hasText(trace));\n if(hasOnlyLines) return [];\n\n if(selectionTester === false) {\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 lonlat = di.lonlat;\n\n // some projection types can't handle BADNUMs\n if(lonlat[0] === BADNUM) continue;\n\n x = xa.c2p(lonlat);\n y = ya.c2p(lonlat);\n\n if(selectionTester.contains([x, y], null, i, searchInfo)) {\n selection.push({\n pointNumber: i,\n lon: lonlat[0],\n lat: lonlat[1]\n });\n di.selected = 1;\n } else {\n di.selected = 0;\n }\n }\n }\n\n return selection;\n};\n\n},{\"../../constants/numerical\":704,\"../scatter/subtypes\":1158}],1184:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Drawing = _dereq_('../../components/drawing');\nvar Color = _dereq_('../../components/color');\n\nvar scatterStyle = _dereq_('../scatter/style');\nvar stylePoints = scatterStyle.stylePoints;\nvar styleText = scatterStyle.styleText;\n\nmodule.exports = function style(gd, calcTrace) {\n if(calcTrace) styleTrace(gd, calcTrace);\n};\n\nfunction styleTrace(gd, calcTrace) {\n var trace = calcTrace[0].trace;\n var s = calcTrace[0].node3;\n\n s.style('opacity', calcTrace[0].trace.opacity);\n\n stylePoints(s, trace, gd);\n styleText(s, trace, gd);\n\n // this part is incompatible with Drawing.lineGroupStyle\n s.selectAll('path.js-line')\n .style('fill', 'none')\n .each(function(d) {\n var path = d3.select(this);\n var trace = d.trace;\n var line = trace.line || {};\n\n path.call(Color.stroke, line.color)\n .call(Drawing.dashLine, line.dash || '', line.width || 0);\n\n if(trace.fill !== 'none') {\n path.call(Color.fill, trace.fillcolor);\n }\n });\n}\n\n},{\"../../components/color\":595,\"../../components/drawing\":617,\"../scatter/style\":1157,\"d3\":164}],1185:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar baseAttrs = _dereq_('../../plots/attributes');\nvar scatterAttrs = _dereq_('../scatter/attributes');\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\nvar overrideAll = _dereq_('../../plot_api/edit_types').overrideAll;\nvar DASHES = _dereq_('./constants').DASHES;\n\nvar scatterLineAttrs = scatterAttrs.line;\nvar scatterMarkerAttrs = scatterAttrs.marker;\nvar scatterMarkerLineAttrs = scatterMarkerAttrs.line;\n\nvar attrs = module.exports = overrideAll({\n x: scatterAttrs.x,\n x0: scatterAttrs.x0,\n dx: scatterAttrs.dx,\n y: scatterAttrs.y,\n y0: scatterAttrs.y0,\n dy: scatterAttrs.dy,\n\n text: scatterAttrs.text,\n hovertext: scatterAttrs.hovertext,\n\n textposition: scatterAttrs.textposition,\n textfont: scatterAttrs.textfont,\n\n mode: {\n valType: 'flaglist',\n flags: ['lines', 'markers', 'text'],\n extras: ['none'],\n \n \n },\n line: {\n color: scatterLineAttrs.color,\n width: scatterLineAttrs.width,\n shape: {\n valType: 'enumerated',\n values: ['linear', 'hv', 'vh', 'hvh', 'vhv'],\n dflt: 'linear',\n \n editType: 'plot',\n \n },\n dash: {\n valType: 'enumerated',\n values: Object.keys(DASHES),\n dflt: 'solid',\n \n \n }\n },\n marker: extendFlat({}, colorScaleAttrs('marker'), {\n symbol: scatterMarkerAttrs.symbol,\n size: scatterMarkerAttrs.size,\n sizeref: scatterMarkerAttrs.sizeref,\n sizemin: scatterMarkerAttrs.sizemin,\n sizemode: scatterMarkerAttrs.sizemode,\n opacity: scatterMarkerAttrs.opacity,\n colorbar: scatterMarkerAttrs.colorbar,\n line: extendFlat({}, colorScaleAttrs('marker.line'), {\n width: scatterMarkerLineAttrs.width\n })\n }),\n connectgaps: scatterAttrs.connectgaps,\n fill: extendFlat({}, scatterAttrs.fill, {dflt: 'none'}),\n fillcolor: scatterAttrs.fillcolor,\n\n // no hoveron\n\n selected: {\n marker: scatterAttrs.selected.marker,\n textfont: scatterAttrs.selected.textfont\n },\n unselected: {\n marker: scatterAttrs.unselected.marker,\n textfont: scatterAttrs.unselected.textfont\n },\n\n opacity: baseAttrs.opacity\n\n}, 'calc', 'nested');\n\nattrs.x.editType = attrs.y.editType = attrs.x0.editType = attrs.y0.editType = 'calc+clearAxisTypes';\nattrs.hovertemplate = scatterAttrs.hovertemplate;\nattrs.texttemplate = scatterAttrs.texttemplate;\n\n},{\"../../components/colorscale/attributes\":602,\"../../lib/extend\":719,\"../../plot_api/edit_types\":759,\"../../plots/attributes\":773,\"../scatter/attributes\":1134,\"./constants\":1187}],1186:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar cluster = _dereq_('point-cluster');\n\nvar Lib = _dereq_('../../lib');\nvar AxisIDs = _dereq_('../../plots/cartesian/axis_ids');\nvar findExtremes = _dereq_('../../plots/cartesian/autorange').findExtremes;\n\nvar scatterCalc = _dereq_('../scatter/calc');\nvar calcMarkerSize = scatterCalc.calcMarkerSize;\nvar calcAxisExpansion = scatterCalc.calcAxisExpansion;\nvar setFirstScatter = scatterCalc.setFirstScatter;\nvar calcColorscale = _dereq_('../scatter/colorscale_calc');\nvar convert = _dereq_('./convert');\nvar sceneUpdate = _dereq_('./scene_update');\n\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\nvar TOO_MANY_POINTS = _dereq_('./constants').TOO_MANY_POINTS;\n\nmodule.exports = function calc(gd, trace) {\n var fullLayout = gd._fullLayout;\n var xa = AxisIDs.getFromId(gd, trace.xaxis);\n var ya = AxisIDs.getFromId(gd, trace.yaxis);\n var subplot = fullLayout._plots[trace.xaxis + trace.yaxis];\n var len = trace._length;\n var hasTooManyPoints = len >= TOO_MANY_POINTS;\n var len2 = len * 2;\n var stash = {};\n var i, xx, yy;\n\n var x = trace._x = xa.makeCalcdata(trace, 'x');\n var y = trace._y = ya.makeCalcdata(trace, 'y');\n\n // we need hi-precision for scatter2d,\n // regl-scatter2d uses NaNs for bad/missing values\n var positions = new Array(len2);\n for(i = 0; i < len; i++) {\n xx = x[i];\n yy = y[i];\n positions[i * 2] = xx === BADNUM ? NaN : xx;\n positions[i * 2 + 1] = yy === BADNUM ? NaN : yy;\n }\n\n if(xa.type === 'log') {\n for(i = 0; i < len2; i += 2) {\n positions[i] = xa.c2l(positions[i]);\n }\n }\n if(ya.type === 'log') {\n for(i = 1; i < len2; i += 2) {\n positions[i] = ya.c2l(positions[i]);\n }\n }\n\n // we don't build a tree for log axes since it takes long to convert log2px\n // and it is also\n if(hasTooManyPoints && (xa.type !== 'log' && ya.type !== 'log')) {\n // FIXME: delegate this to webworker\n stash.tree = cluster(positions);\n } else {\n var ids = stash.ids = new Array(len);\n for(i = 0; i < len; i++) {\n ids[i] = i;\n }\n }\n\n // create scene options and scene\n calcColorscale(gd, trace);\n var opts = sceneOptions(gd, subplot, trace, positions, x, y);\n var scene = sceneUpdate(gd, subplot);\n\n // Reuse SVG scatter axis expansion routine.\n // For graphs with very large number of points and array marker.size,\n // use average marker size instead to speed things up.\n setFirstScatter(fullLayout, trace);\n var ppad;\n if(!hasTooManyPoints) {\n ppad = calcMarkerSize(trace, len);\n } else if(opts.marker) {\n ppad = 2 * (opts.marker.sizeAvg || Math.max(opts.marker.size, 3));\n }\n calcAxisExpansion(gd, trace, xa, ya, x, y, ppad);\n if(opts.errorX) expandForErrorBars(trace, xa, opts.errorX);\n if(opts.errorY) expandForErrorBars(trace, ya, opts.errorY);\n\n // set flags to create scene renderers\n if(opts.fill && !scene.fill2d) scene.fill2d = true;\n if(opts.marker && !scene.scatter2d) scene.scatter2d = true;\n if(opts.line && !scene.line2d) scene.line2d = true;\n if((opts.errorX || opts.errorY) && !scene.error2d) scene.error2d = true;\n if(opts.text && !scene.glText) scene.glText = true;\n if(opts.marker) opts.marker.snap = len;\n\n scene.lineOptions.push(opts.line);\n scene.errorXOptions.push(opts.errorX);\n scene.errorYOptions.push(opts.errorY);\n scene.fillOptions.push(opts.fill);\n scene.markerOptions.push(opts.marker);\n scene.markerSelectedOptions.push(opts.markerSel);\n scene.markerUnselectedOptions.push(opts.markerUnsel);\n scene.textOptions.push(opts.text);\n scene.textSelectedOptions.push(opts.textSel);\n scene.textUnselectedOptions.push(opts.textUnsel);\n scene.selectBatch.push([]);\n scene.unselectBatch.push([]);\n\n stash._scene = scene;\n stash.index = scene.count;\n stash.x = x;\n stash.y = y;\n stash.positions = positions;\n scene.count++;\n\n return [{x: false, y: false, t: stash, trace: trace}];\n};\n\nfunction expandForErrorBars(trace, ax, opts) {\n var extremes = trace._extremes[ax._id];\n var errExt = findExtremes(ax, opts._bnds, {padded: true});\n extremes.min = extremes.min.concat(errExt.min);\n extremes.max = extremes.max.concat(errExt.max);\n}\n\nfunction sceneOptions(gd, subplot, trace, positions, x, y) {\n var opts = convert.style(gd, trace);\n\n if(opts.marker) {\n opts.marker.positions = positions;\n }\n\n if(opts.line && positions.length > 1) {\n Lib.extendFlat(\n opts.line,\n convert.linePositions(gd, trace, positions)\n );\n }\n\n if(opts.errorX || opts.errorY) {\n var errors = convert.errorBarPositions(gd, trace, positions, x, y);\n\n if(opts.errorX) {\n Lib.extendFlat(opts.errorX, errors.x);\n }\n if(opts.errorY) {\n Lib.extendFlat(opts.errorY, errors.y);\n }\n }\n\n if(opts.text) {\n Lib.extendFlat(\n opts.text,\n {positions: positions},\n convert.textPosition(gd, trace, opts.text, opts.marker)\n );\n Lib.extendFlat(\n opts.textSel,\n {positions: positions},\n convert.textPosition(gd, trace, opts.text, opts.markerSel)\n );\n Lib.extendFlat(\n opts.textUnsel,\n {positions: positions},\n convert.textPosition(gd, trace, opts.text, opts.markerUnsel)\n );\n }\n\n return opts;\n}\n\n},{\"../../constants/numerical\":704,\"../../lib\":728,\"../../plots/cartesian/autorange\":775,\"../../plots/cartesian/axis_ids\":779,\"../scatter/calc\":1135,\"../scatter/colorscale_calc\":1137,\"./constants\":1187,\"./convert\":1188,\"./scene_update\":1196,\"point-cluster\":467}],1187:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar SYMBOL_SIZE = 20;\n\nmodule.exports = {\n TOO_MANY_POINTS: 1e5,\n\n SYMBOL_SDF_SIZE: 200,\n SYMBOL_SIZE: SYMBOL_SIZE,\n SYMBOL_STROKE: SYMBOL_SIZE / 20,\n\n DOT_RE: /-dot/,\n OPEN_RE: /-open/,\n\n DASHES: {\n solid: [1],\n dot: [1, 1],\n dash: [4, 1],\n longdash: [8, 1],\n dashdot: [4, 1, 1, 1],\n longdashdot: [8, 1, 1, 1]\n }\n};\n\n},{}],1188:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar svgSdf = _dereq_('svg-path-sdf');\nvar rgba = _dereq_('color-normalize');\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\nvar Drawing = _dereq_('../../components/drawing');\nvar AxisIDs = _dereq_('../../plots/cartesian/axis_ids');\n\nvar formatColor = _dereq_('../../lib/gl_format_color').formatColor;\nvar subTypes = _dereq_('../scatter/subtypes');\nvar makeBubbleSizeFn = _dereq_('../scatter/make_bubble_size_func');\n\nvar helpers = _dereq_('./helpers');\nvar constants = _dereq_('./constants');\nvar DESELECTDIM = _dereq_('../../constants/interactions').DESELECTDIM;\n\nvar TEXTOFFSETSIGN = {\n start: 1, left: 1, end: -1, right: -1, middle: 0, center: 0, bottom: 1, top: -1\n};\n\nvar appendArrayPointValue = _dereq_('../../components/fx/helpers').appendArrayPointValue;\n\nfunction convertStyle(gd, trace) {\n var i;\n\n var opts = {\n marker: undefined,\n markerSel: undefined,\n markerUnsel: undefined,\n line: undefined,\n fill: undefined,\n errorX: undefined,\n errorY: undefined,\n text: undefined,\n textSel: undefined,\n textUnsel: undefined\n };\n\n if(trace.visible !== true) return opts;\n\n if(subTypes.hasText(trace)) {\n opts.text = convertTextStyle(gd, trace);\n opts.textSel = convertTextSelection(gd, trace, trace.selected);\n opts.textUnsel = convertTextSelection(gd, trace, trace.unselected);\n }\n\n if(subTypes.hasMarkers(trace)) {\n opts.marker = convertMarkerStyle(trace);\n opts.markerSel = convertMarkerSelection(trace, trace.selected);\n opts.markerUnsel = convertMarkerSelection(trace, trace.unselected);\n\n if(!trace.unselected && Lib.isArrayOrTypedArray(trace.marker.opacity)) {\n var mo = trace.marker.opacity;\n opts.markerUnsel.opacity = new Array(mo.length);\n for(i = 0; i < mo.length; i++) {\n opts.markerUnsel.opacity[i] = DESELECTDIM * mo[i];\n }\n }\n }\n\n if(subTypes.hasLines(trace)) {\n opts.line = {\n overlay: true,\n thickness: trace.line.width,\n color: trace.line.color,\n opacity: trace.opacity\n };\n\n var dashes = (constants.DASHES[trace.line.dash] || [1]).slice();\n for(i = 0; i < dashes.length; ++i) {\n dashes[i] *= trace.line.width;\n }\n opts.line.dashes = dashes;\n }\n\n if(trace.error_x && trace.error_x.visible) {\n opts.errorX = convertErrorBarStyle(trace, trace.error_x);\n }\n\n if(trace.error_y && trace.error_y.visible) {\n opts.errorY = convertErrorBarStyle(trace, trace.error_y);\n }\n\n if(!!trace.fill && trace.fill !== 'none') {\n opts.fill = {\n closed: true,\n fill: trace.fillcolor,\n thickness: 0\n };\n }\n\n return opts;\n}\n\nfunction convertTextStyle(gd, trace) {\n var fullLayout = gd._fullLayout;\n var count = trace._length;\n var textfontIn = trace.textfont;\n var textpositionIn = trace.textposition;\n var textPos = Array.isArray(textpositionIn) ? textpositionIn : [textpositionIn];\n var tfc = textfontIn.color;\n var tfs = textfontIn.size;\n var tff = textfontIn.family;\n var optsOut = {};\n var i;\n\n var texttemplate = trace.texttemplate;\n if(texttemplate) {\n optsOut.text = [];\n\n var d3locale = fullLayout._d3locale;\n var isArray = Array.isArray(texttemplate);\n var N = isArray ? Math.min(texttemplate.length, count) : count;\n var txt = isArray ?\n function(i) { return texttemplate[i]; } :\n function() { return texttemplate; };\n\n for(i = 0; i < N; i++) {\n var d = {i: i};\n var labels = trace._module.formatLabels(d, trace, fullLayout);\n var pointValues = {};\n appendArrayPointValue(pointValues, trace, i);\n var meta = trace._meta || {};\n optsOut.text.push(Lib.texttemplateString(txt(i), labels, d3locale, pointValues, d, meta));\n }\n } else {\n if(Array.isArray(trace.text) && trace.text.length < count) {\n // if text array is shorter, we'll need to append to it, so let's slice to prevent mutating\n optsOut.text = trace.text.slice();\n } else {\n optsOut.text = trace.text;\n }\n }\n // pad text array with empty strings\n if(Array.isArray(optsOut.text)) {\n for(i = optsOut.text.length; i < count; i++) {\n optsOut.text[i] = '';\n }\n }\n\n optsOut.opacity = trace.opacity;\n optsOut.font = {};\n optsOut.align = [];\n optsOut.baseline = [];\n\n for(i = 0; i < textPos.length; i++) {\n var tp = textPos[i].split(/\\s+/);\n\n switch(tp[1]) {\n case 'left':\n optsOut.align.push('right');\n break;\n case 'right':\n optsOut.align.push('left');\n break;\n default:\n optsOut.align.push(tp[1]);\n }\n switch(tp[0]) {\n case 'top':\n optsOut.baseline.push('bottom');\n break;\n case 'bottom':\n optsOut.baseline.push('top');\n break;\n default:\n optsOut.baseline.push(tp[0]);\n }\n }\n\n if(Array.isArray(tfc)) {\n optsOut.color = new Array(count);\n for(i = 0; i < count; i++) {\n optsOut.color[i] = tfc[i];\n }\n } else {\n optsOut.color = tfc;\n }\n\n if(Lib.isArrayOrTypedArray(tfs) || Array.isArray(tff)) {\n // if any textfont param is array - make render a batch\n optsOut.font = new Array(count);\n for(i = 0; i < count; i++) {\n var fonti = optsOut.font[i] = {};\n\n fonti.size = (\n Lib.isTypedArray(tfs) ? tfs[i] :\n Array.isArray(tfs) ? (\n isNumeric(tfs[i]) ? tfs[i] : 0\n ) : tfs\n );\n\n fonti.family = Array.isArray(tff) ? tff[i] : tff;\n }\n } else {\n // if both are single values, make render fast single-value\n optsOut.font = {size: tfs, family: tff};\n }\n\n return optsOut;\n}\n\n\nfunction convertMarkerStyle(trace) {\n var count = trace._length;\n var optsIn = trace.marker;\n var optsOut = {};\n var i;\n\n var multiSymbol = Lib.isArrayOrTypedArray(optsIn.symbol);\n var multiColor = Lib.isArrayOrTypedArray(optsIn.color);\n var multiLineColor = Lib.isArrayOrTypedArray(optsIn.line.color);\n var multiOpacity = Lib.isArrayOrTypedArray(optsIn.opacity);\n var multiSize = Lib.isArrayOrTypedArray(optsIn.size);\n var multiLineWidth = Lib.isArrayOrTypedArray(optsIn.line.width);\n\n var isOpen;\n if(!multiSymbol) isOpen = helpers.isOpenSymbol(optsIn.symbol);\n\n // prepare colors\n if(multiSymbol || multiColor || multiLineColor || multiOpacity) {\n optsOut.colors = new Array(count);\n optsOut.borderColors = new Array(count);\n\n var colors = formatColor(optsIn, optsIn.opacity, count);\n var borderColors = formatColor(optsIn.line, optsIn.opacity, count);\n\n if(!Array.isArray(borderColors[0])) {\n var borderColor = borderColors;\n borderColors = Array(count);\n for(i = 0; i < count; i++) {\n borderColors[i] = borderColor;\n }\n }\n if(!Array.isArray(colors[0])) {\n var color = colors;\n colors = Array(count);\n for(i = 0; i < count; i++) {\n colors[i] = color;\n }\n }\n\n optsOut.colors = colors;\n optsOut.borderColors = borderColors;\n\n for(i = 0; i < count; i++) {\n if(multiSymbol) {\n var symbol = optsIn.symbol[i];\n isOpen = helpers.isOpenSymbol(symbol);\n }\n if(isOpen) {\n borderColors[i] = colors[i].slice();\n colors[i] = colors[i].slice();\n colors[i][3] = 0;\n }\n }\n\n optsOut.opacity = trace.opacity;\n } else {\n if(isOpen) {\n optsOut.color = rgba(optsIn.color, 'uint8');\n optsOut.color[3] = 0;\n optsOut.borderColor = rgba(optsIn.color, 'uint8');\n } else {\n optsOut.color = rgba(optsIn.color, 'uint8');\n optsOut.borderColor = rgba(optsIn.line.color, 'uint8');\n }\n\n optsOut.opacity = trace.opacity * optsIn.opacity;\n }\n\n // prepare symbols\n if(multiSymbol) {\n optsOut.markers = new Array(count);\n for(i = 0; i < count; i++) {\n optsOut.markers[i] = getSymbolSdf(optsIn.symbol[i]);\n }\n } else {\n optsOut.marker = getSymbolSdf(optsIn.symbol);\n }\n\n // prepare sizes\n var markerSizeFunc = makeBubbleSizeFn(trace);\n var s;\n\n if(multiSize || multiLineWidth) {\n var sizes = optsOut.sizes = new Array(count);\n var borderSizes = optsOut.borderSizes = new Array(count);\n var sizeTotal = 0;\n var sizeAvg;\n\n if(multiSize) {\n for(i = 0; i < count; i++) {\n sizes[i] = markerSizeFunc(optsIn.size[i]);\n sizeTotal += sizes[i];\n }\n sizeAvg = sizeTotal / count;\n } else {\n s = markerSizeFunc(optsIn.size);\n for(i = 0; i < count; i++) {\n sizes[i] = s;\n }\n }\n\n // See https://github.com/plotly/plotly.js/pull/1781#discussion_r121820798\n if(multiLineWidth) {\n for(i = 0; i < count; i++) {\n borderSizes[i] = optsIn.line.width[i] / 2;\n }\n } else {\n s = optsIn.line.width / 2;\n for(i = 0; i < count; i++) {\n borderSizes[i] = s;\n }\n }\n\n optsOut.sizeAvg = sizeAvg;\n } else {\n optsOut.size = markerSizeFunc(optsIn && optsIn.size || 10);\n optsOut.borderSizes = markerSizeFunc(optsIn.line.width);\n }\n\n return optsOut;\n}\n\nfunction convertMarkerSelection(trace, target) {\n var optsIn = trace.marker;\n var optsOut = {};\n\n if(!target) return optsOut;\n\n if(target.marker && target.marker.symbol) {\n optsOut = convertMarkerStyle(Lib.extendFlat({}, optsIn, target.marker));\n } else if(target.marker) {\n if(target.marker.size) optsOut.size = target.marker.size / 2;\n if(target.marker.color) optsOut.colors = target.marker.color;\n if(target.marker.opacity !== undefined) optsOut.opacity = target.marker.opacity;\n }\n\n return optsOut;\n}\n\nfunction convertTextSelection(gd, trace, target) {\n var optsOut = {};\n\n if(!target) return optsOut;\n\n if(target.textfont) {\n var optsIn = {\n opacity: 1,\n text: trace.text,\n texttemplate: trace.texttemplate,\n textposition: trace.textposition,\n textfont: Lib.extendFlat({}, trace.textfont)\n };\n if(target.textfont) {\n Lib.extendFlat(optsIn.textfont, target.textfont);\n }\n optsOut = convertTextStyle(gd, optsIn);\n }\n\n return optsOut;\n}\n\nfunction convertErrorBarStyle(trace, target) {\n var optsOut = {\n capSize: target.width * 2,\n lineWidth: target.thickness,\n color: target.color\n };\n\n if(target.copy_ystyle) {\n optsOut = trace.error_y;\n }\n\n return optsOut;\n}\n\nvar SYMBOL_SDF_SIZE = constants.SYMBOL_SDF_SIZE;\nvar SYMBOL_SIZE = constants.SYMBOL_SIZE;\nvar SYMBOL_STROKE = constants.SYMBOL_STROKE;\nvar SYMBOL_SDF = {};\nvar SYMBOL_SVG_CIRCLE = Drawing.symbolFuncs[0](SYMBOL_SIZE * 0.05);\n\nfunction getSymbolSdf(symbol) {\n if(symbol === 'circle') return null;\n\n var symbolPath, symbolSdf;\n var symbolNumber = Drawing.symbolNumber(symbol);\n var symbolFunc = Drawing.symbolFuncs[symbolNumber % 100];\n var symbolNoDot = !!Drawing.symbolNoDot[symbolNumber % 100];\n var symbolNoFill = !!Drawing.symbolNoFill[symbolNumber % 100];\n\n var isDot = helpers.isDotSymbol(symbol);\n\n // get symbol sdf from cache or generate it\n if(SYMBOL_SDF[symbol]) return SYMBOL_SDF[symbol];\n\n if(isDot && !symbolNoDot) {\n symbolPath = symbolFunc(SYMBOL_SIZE * 1.1) + SYMBOL_SVG_CIRCLE;\n } else {\n symbolPath = symbolFunc(SYMBOL_SIZE);\n }\n\n symbolSdf = svgSdf(symbolPath, {\n w: SYMBOL_SDF_SIZE,\n h: SYMBOL_SDF_SIZE,\n viewBox: [-SYMBOL_SIZE, -SYMBOL_SIZE, SYMBOL_SIZE, SYMBOL_SIZE],\n stroke: symbolNoFill ? SYMBOL_STROKE : -SYMBOL_STROKE\n });\n SYMBOL_SDF[symbol] = symbolSdf;\n\n return symbolSdf || null;\n}\n\nfunction convertLinePositions(gd, trace, positions) {\n var len = positions.length;\n var count = len / 2;\n var linePositions;\n var i;\n\n if(subTypes.hasLines(trace) && count) {\n if(trace.line.shape === 'hv') {\n linePositions = [];\n for(i = 0; i < count - 1; i++) {\n if(isNaN(positions[i * 2]) || isNaN(positions[i * 2 + 1])) {\n linePositions.push(NaN, NaN, NaN, NaN);\n } else {\n linePositions.push(positions[i * 2], positions[i * 2 + 1]);\n if(!isNaN(positions[i * 2 + 2]) && !isNaN(positions[i * 2 + 3])) {\n linePositions.push(positions[i * 2 + 2], positions[i * 2 + 1]);\n } else {\n linePositions.push(NaN, NaN);\n }\n }\n }\n linePositions.push(positions[len - 2], positions[len - 1]);\n } else if(trace.line.shape === 'hvh') {\n linePositions = [];\n for(i = 0; i < count - 1; i++) {\n if(isNaN(positions[i * 2]) || isNaN(positions[i * 2 + 1]) || isNaN(positions[i * 2 + 2]) || isNaN(positions[i * 2 + 3])) {\n if(!isNaN(positions[i * 2]) && !isNaN(positions[i * 2 + 1])) {\n linePositions.push(positions[i * 2], positions[i * 2 + 1]);\n } else {\n linePositions.push(NaN, NaN);\n }\n linePositions.push(NaN, NaN);\n } else {\n var midPtX = (positions[i * 2] + positions[i * 2 + 2]) / 2;\n linePositions.push(\n positions[i * 2],\n positions[i * 2 + 1],\n midPtX,\n positions[i * 2 + 1],\n midPtX,\n positions[i * 2 + 3]\n );\n }\n }\n linePositions.push(positions[len - 2], positions[len - 1]);\n } else if(trace.line.shape === 'vhv') {\n linePositions = [];\n for(i = 0; i < count - 1; i++) {\n if(isNaN(positions[i * 2]) || isNaN(positions[i * 2 + 1]) || isNaN(positions[i * 2 + 2]) || isNaN(positions[i * 2 + 3])) {\n if(!isNaN(positions[i * 2]) && !isNaN(positions[i * 2 + 1])) {\n linePositions.push(positions[i * 2], positions[i * 2 + 1]);\n } else {\n linePositions.push(NaN, NaN);\n }\n linePositions.push(NaN, NaN);\n } else {\n var midPtY = (positions[i * 2 + 1] + positions[i * 2 + 3]) / 2;\n linePositions.push(\n positions[i * 2],\n positions[i * 2 + 1],\n positions[i * 2],\n midPtY,\n positions[i * 2 + 2],\n midPtY\n );\n }\n }\n linePositions.push(positions[len - 2], positions[len - 1]);\n } else if(trace.line.shape === 'vh') {\n linePositions = [];\n for(i = 0; i < count - 1; i++) {\n if(isNaN(positions[i * 2]) || isNaN(positions[i * 2 + 1])) {\n linePositions.push(NaN, NaN, NaN, NaN);\n } else {\n linePositions.push(positions[i * 2], positions[i * 2 + 1]);\n if(!isNaN(positions[i * 2 + 2]) && !isNaN(positions[i * 2 + 3])) {\n linePositions.push(positions[i * 2], positions[i * 2 + 3]);\n } else {\n linePositions.push(NaN, NaN);\n }\n }\n }\n linePositions.push(positions[len - 2], positions[len - 1]);\n } else {\n linePositions = positions;\n }\n }\n\n // If we have data with gaps, we ought to use rect joins\n // FIXME: get rid of this\n var hasNaN = false;\n for(i = 0; i < linePositions.length; i++) {\n if(isNaN(linePositions[i])) {\n hasNaN = true;\n break;\n }\n }\n\n var join = (hasNaN || linePositions.length > constants.TOO_MANY_POINTS) ? 'rect' :\n subTypes.hasMarkers(trace) ? 'rect' : 'round';\n\n // fill gaps\n if(hasNaN && trace.connectgaps) {\n var lastX = linePositions[0];\n var lastY = linePositions[1];\n\n for(i = 0; i < linePositions.length; i += 2) {\n if(isNaN(linePositions[i]) || isNaN(linePositions[i + 1])) {\n linePositions[i] = lastX;\n linePositions[i + 1] = lastY;\n } else {\n lastX = linePositions[i];\n lastY = linePositions[i + 1];\n }\n }\n }\n\n return {\n join: join,\n positions: linePositions\n };\n}\n\nfunction convertErrorBarPositions(gd, trace, positions, x, y) {\n var makeComputeError = Registry.getComponentMethod('errorbars', 'makeComputeError');\n var xa = AxisIDs.getFromId(gd, trace.xaxis);\n var ya = AxisIDs.getFromId(gd, trace.yaxis);\n var count = positions.length / 2;\n var out = {};\n\n function convertOneAxis(coords, ax) {\n var axLetter = ax._id.charAt(0);\n var opts = trace['error_' + axLetter];\n\n if(opts && opts.visible && (ax.type === 'linear' || ax.type === 'log')) {\n var computeError = makeComputeError(opts);\n var pOffset = {x: 0, y: 1}[axLetter];\n var eOffset = {x: [0, 1, 2, 3], y: [2, 3, 0, 1]}[axLetter];\n var errors = new Float64Array(4 * count);\n var minShoe = Infinity;\n var maxHat = -Infinity;\n\n for(var i = 0, j = 0; i < count; i++, j += 4) {\n var dc = coords[i];\n\n if(isNumeric(dc)) {\n var dl = positions[i * 2 + pOffset];\n var vals = computeError(dc, i);\n var lv = vals[0];\n var hv = vals[1];\n\n if(isNumeric(lv) && isNumeric(hv)) {\n var shoe = dc - lv;\n var hat = dc + hv;\n\n errors[j + eOffset[0]] = dl - ax.c2l(shoe);\n errors[j + eOffset[1]] = ax.c2l(hat) - dl;\n errors[j + eOffset[2]] = 0;\n errors[j + eOffset[3]] = 0;\n\n minShoe = Math.min(minShoe, dc - lv);\n maxHat = Math.max(maxHat, dc + hv);\n }\n }\n }\n\n out[axLetter] = {\n positions: positions,\n errors: errors,\n _bnds: [minShoe, maxHat]\n };\n }\n }\n\n convertOneAxis(x, xa);\n convertOneAxis(y, ya);\n return out;\n}\n\nfunction convertTextPosition(gd, trace, textOpts, markerOpts) {\n var count = trace._length;\n var out = {};\n var i;\n\n // corresponds to textPointPosition from component.drawing\n if(subTypes.hasMarkers(trace)) {\n var fontOpts = textOpts.font;\n var align = textOpts.align;\n var baseline = textOpts.baseline;\n out.offset = new Array(count);\n\n for(i = 0; i < count; i++) {\n var ms = markerOpts.sizes ? markerOpts.sizes[i] : markerOpts.size;\n var fs = Array.isArray(fontOpts) ? fontOpts[i].size : fontOpts.size;\n\n var a = Array.isArray(align) ?\n (align.length > 1 ? align[i] : align[0]) :\n align;\n var b = Array.isArray(baseline) ?\n (baseline.length > 1 ? baseline[i] : baseline[0]) :\n baseline;\n\n var hSign = TEXTOFFSETSIGN[a];\n var vSign = TEXTOFFSETSIGN[b];\n var xPad = ms ? ms / 0.8 + 1 : 0;\n var yPad = -vSign * xPad - vSign * 0.5;\n out.offset[i] = [hSign * xPad / fs, yPad / fs];\n }\n }\n\n return out;\n}\n\nmodule.exports = {\n style: convertStyle,\n\n markerStyle: convertMarkerStyle,\n markerSelection: convertMarkerSelection,\n\n linePositions: convertLinePositions,\n errorBarPositions: convertErrorBarPositions,\n textPosition: convertTextPosition\n};\n\n},{\"../../components/drawing\":617,\"../../components/fx/helpers\":631,\"../../constants/interactions\":703,\"../../lib\":728,\"../../lib/gl_format_color\":725,\"../../plots/cartesian/axis_ids\":779,\"../../registry\":859,\"../scatter/make_bubble_size_func\":1151,\"../scatter/subtypes\":1158,\"./constants\":1187,\"./helpers\":1192,\"color-normalize\":122,\"fast-isnumeric\":236,\"svg-path-sdf\":526}],1189:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Registry = _dereq_('../../registry');\n\nvar helpers = _dereq_('./helpers');\nvar attributes = _dereq_('./attributes');\nvar constants = _dereq_('../scatter/constants');\nvar subTypes = _dereq_('../scatter/subtypes');\nvar handleXYDefaults = _dereq_('../scatter/xy_defaults');\nvar handleMarkerDefaults = _dereq_('../scatter/marker_defaults');\nvar handleLineDefaults = _dereq_('../scatter/line_defaults');\nvar handleFillColorDefaults = _dereq_('../scatter/fillcolor_defaults');\nvar handleTextDefaults = _dereq_('../scatter/text_defaults');\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 isOpen = traceIn.marker ? helpers.isOpenSymbol(traceIn.marker.symbol) : false;\n var isBubble = subTypes.isBubble(traceIn);\n\n var len = handleXYDefaults(traceIn, traceOut, layout, coerce);\n if(!len) {\n traceOut.visible = false;\n return;\n }\n var defaultMode = len < constants.PTS_LINESONLY ? 'lines+markers' : 'lines';\n\n coerce('text');\n coerce('hovertext');\n coerce('hovertemplate');\n coerce('mode', defaultMode);\n\n if(subTypes.hasLines(traceOut)) {\n coerce('connectgaps');\n handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce);\n coerce('line.shape');\n }\n\n if(subTypes.hasMarkers(traceOut)) {\n handleMarkerDefaults(traceIn, traceOut, defaultColor, layout, coerce);\n coerce('marker.line.width', isOpen || isBubble ? 1 : 0);\n }\n\n if(subTypes.hasText(traceOut)) {\n coerce('texttemplate');\n handleTextDefaults(traceIn, traceOut, layout, coerce);\n }\n\n var lineColor = (traceOut.line || {}).color;\n var markerColor = (traceOut.marker || {}).color;\n\n coerce('fill');\n if(traceOut.fill !== 'none') {\n handleFillColorDefaults(traceIn, traceOut, defaultColor, coerce);\n }\n\n var errorBarsSupplyDefaults = Registry.getComponentMethod('errorbars', 'supplyDefaults');\n errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'y'});\n errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'x', inherit: 'y'});\n\n Lib.coerceSelectionMarkerOpacity(traceOut, coerce);\n};\n\n},{\"../../lib\":728,\"../../registry\":859,\"../scatter/constants\":1138,\"../scatter/fillcolor_defaults\":1142,\"../scatter/line_defaults\":1147,\"../scatter/marker_defaults\":1153,\"../scatter/subtypes\":1158,\"../scatter/text_defaults\":1159,\"../scatter/xy_defaults\":1160,\"./attributes\":1185,\"./helpers\":1192}],1190:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Color = _dereq_('../../components/color');\n\nvar DESELECTDIM = _dereq_('../../constants/interactions').DESELECTDIM;\n\nfunction styleTextSelection(cd) {\n var cd0 = cd[0];\n var trace = cd0.trace;\n var stash = cd0.t;\n var scene = stash._scene;\n var index = stash.index;\n var els = scene.selectBatch[index];\n var unels = scene.unselectBatch[index];\n var baseOpts = scene.textOptions[index];\n var selOpts = scene.textSelectedOptions[index] || {};\n var unselOpts = scene.textUnselectedOptions[index] || {};\n var opts = Lib.extendFlat({}, baseOpts);\n var i, j;\n\n if(els.length || unels.length) {\n var stc = selOpts.color;\n var utc = unselOpts.color;\n var base = baseOpts.color;\n var hasArrayBase = Array.isArray(base);\n opts.color = new Array(trace._length);\n\n for(i = 0; i < els.length; i++) {\n j = els[i];\n opts.color[j] = stc || (hasArrayBase ? base[j] : base);\n }\n for(i = 0; i < unels.length; i++) {\n j = unels[i];\n var basej = hasArrayBase ? base[j] : base;\n opts.color[j] = utc ? utc :\n stc ? basej : Color.addOpacity(basej, DESELECTDIM);\n }\n }\n\n scene.glText[index].update(opts);\n}\n\nmodule.exports = {\n styleTextSelection: styleTextSelection\n};\n\n},{\"../../components/color\":595,\"../../constants/interactions\":703,\"../../lib\":728}],1191:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar scatterFormatLabels = _dereq_('../scatter/format_labels');\n\nmodule.exports = function formatLabels(cdi, trace, fullLayout) {\n var i = cdi.i;\n if(!('x' in cdi)) cdi.x = trace._x[i];\n if(!('y' in cdi)) cdi.y = trace._y[i];\n return scatterFormatLabels(cdi, trace, fullLayout);\n};\n\n},{\"../scatter/format_labels\":1143}],1192:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar constants = _dereq_('./constants');\n\nexports.isOpenSymbol = function(symbol) {\n return (typeof symbol === 'string') ?\n constants.OPEN_RE.test(symbol) :\n symbol % 200 > 100;\n};\n\nexports.isDotSymbol = function(symbol) {\n return (typeof symbol === 'string') ?\n constants.DOT_RE.test(symbol) :\n symbol > 200;\n};\n\n},{\"./constants\":1187}],1193:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\nvar getTraceColor = _dereq_('../scatter/get_trace_color');\n\nfunction hoverPoints(pointData, xval, yval, hovermode) {\n var cd = pointData.cd;\n var stash = cd[0].t;\n var trace = cd[0].trace;\n var xa = pointData.xa;\n var ya = pointData.ya;\n var x = stash.x;\n var y = stash.y;\n var xpx = xa.c2p(xval);\n var ypx = ya.c2p(yval);\n var maxDistance = pointData.distance;\n var ids;\n\n // FIXME: make sure this is a proper way to calc search radius\n if(stash.tree) {\n var xl = xa.p2c(xpx - maxDistance);\n var xr = xa.p2c(xpx + maxDistance);\n var yl = ya.p2c(ypx - maxDistance);\n var yr = ya.p2c(ypx + maxDistance);\n\n if(hovermode === 'x') {\n ids = stash.tree.range(\n Math.min(xl, xr), Math.min(ya._rl[0], ya._rl[1]),\n Math.max(xl, xr), Math.max(ya._rl[0], ya._rl[1])\n );\n } else {\n ids = stash.tree.range(\n Math.min(xl, xr), Math.min(yl, yr),\n Math.max(xl, xr), Math.max(yl, yr)\n );\n }\n } else {\n ids = stash.ids;\n }\n\n // pick the id closest to the point\n // note that point possibly may not be found\n var id, ptx, pty, i, dx, dy, dist, dxy;\n\n var minDist = maxDistance;\n if(hovermode === 'x') {\n for(i = 0; i < ids.length; i++) {\n ptx = x[ids[i]];\n dx = Math.abs(xa.c2p(ptx) - xpx);\n if(dx < minDist) {\n minDist = dx;\n dy = ya.c2p(y[ids[i]]) - ypx;\n dxy = Math.sqrt(dx * dx + dy * dy);\n id = ids[i];\n }\n }\n } else {\n for(i = ids.length - 1; i > -1; i--) {\n ptx = x[ids[i]];\n pty = y[ids[i]];\n dx = xa.c2p(ptx) - xpx;\n dy = ya.c2p(pty) - ypx;\n\n dist = Math.sqrt(dx * dx + dy * dy);\n if(dist < minDist) {\n minDist = dxy = dist;\n id = ids[i];\n }\n }\n }\n\n pointData.index = id;\n pointData.distance = minDist;\n pointData.dxy = dxy;\n\n if(id === undefined) return [pointData];\n\n return [calcHover(pointData, x, y, trace)];\n}\n\nfunction calcHover(pointData, x, y, trace) {\n var xa = pointData.xa;\n var ya = pointData.ya;\n var minDist = pointData.distance;\n var dxy = pointData.dxy;\n var id = pointData.index;\n\n // the closest data point\n var di = {\n pointNumber: id,\n x: x[id],\n y: y[id]\n };\n\n // that is single-item arrays_to_calcdata excerpt, since we are doing it for a single point and we don't have to do it beforehead for 1e6 points\n di.tx = Array.isArray(trace.text) ? trace.text[id] : trace.text;\n di.htx = Array.isArray(trace.hovertext) ? trace.hovertext[id] : trace.hovertext;\n di.data = Array.isArray(trace.customdata) ? trace.customdata[id] : trace.customdata;\n di.tp = Array.isArray(trace.textposition) ? trace.textposition[id] : trace.textposition;\n\n var font = trace.textfont;\n if(font) {\n di.ts = Lib.isArrayOrTypedArray(font.size) ? font.size[id] : font.size;\n di.tc = Array.isArray(font.color) ? font.color[id] : font.color;\n di.tf = Array.isArray(font.family) ? font.family[id] : font.family;\n }\n\n var marker = trace.marker;\n if(marker) {\n di.ms = Lib.isArrayOrTypedArray(marker.size) ? marker.size[id] : marker.size;\n di.mo = Lib.isArrayOrTypedArray(marker.opacity) ? marker.opacity[id] : marker.opacity;\n di.mx = Lib.isArrayOrTypedArray(marker.symbol) ? marker.symbol[id] : marker.symbol;\n di.mc = Lib.isArrayOrTypedArray(marker.color) ? marker.color[id] : marker.color;\n }\n\n var line = marker && marker.line;\n if(line) {\n di.mlc = Array.isArray(line.color) ? line.color[id] : line.color;\n di.mlw = Lib.isArrayOrTypedArray(line.width) ? line.width[id] : line.width;\n }\n\n var grad = marker && marker.gradient;\n if(grad && grad.type !== 'none') {\n di.mgt = Array.isArray(grad.type) ? grad.type[id] : grad.type;\n di.mgc = Array.isArray(grad.color) ? grad.color[id] : grad.color;\n }\n\n var xp = xa.c2p(di.x, true);\n var yp = ya.c2p(di.y, true);\n var rad = di.mrc || 1;\n\n var hoverlabel = trace.hoverlabel;\n\n if(hoverlabel) {\n di.hbg = Array.isArray(hoverlabel.bgcolor) ? hoverlabel.bgcolor[id] : hoverlabel.bgcolor;\n di.hbc = Array.isArray(hoverlabel.bordercolor) ? hoverlabel.bordercolor[id] : hoverlabel.bordercolor;\n di.hts = Lib.isArrayOrTypedArray(hoverlabel.font.size) ? hoverlabel.font.size[id] : hoverlabel.font.size;\n di.htc = Array.isArray(hoverlabel.font.color) ? hoverlabel.font.color[id] : hoverlabel.font.color;\n di.htf = Array.isArray(hoverlabel.font.family) ? hoverlabel.font.family[id] : hoverlabel.font.family;\n di.hnl = Lib.isArrayOrTypedArray(hoverlabel.namelength) ? hoverlabel.namelength[id] : hoverlabel.namelength;\n }\n var hoverinfo = trace.hoverinfo;\n if(hoverinfo) {\n di.hi = Array.isArray(hoverinfo) ? hoverinfo[id] : hoverinfo;\n }\n\n var hovertemplate = trace.hovertemplate;\n if(hovertemplate) {\n di.ht = Array.isArray(hovertemplate) ? hovertemplate[id] : hovertemplate;\n }\n\n var fakeCd = {};\n fakeCd[pointData.index] = di;\n\n var pointData2 = Lib.extendFlat({}, pointData, {\n color: getTraceColor(trace, di),\n\n x0: xp - rad,\n x1: xp + rad,\n xLabelVal: di.x,\n\n y0: yp - rad,\n y1: yp + rad,\n yLabelVal: di.y,\n\n cd: fakeCd,\n distance: minDist,\n spikeDistance: dxy,\n\n hovertemplate: di.ht\n });\n\n if(di.htx) pointData2.text = di.htx;\n else if(di.tx) pointData2.text = di.tx;\n else if(trace.text) pointData2.text = trace.text;\n\n Lib.fillText(di, trace, pointData2);\n Registry.getComponentMethod('errorbars', 'hoverInfo')(di, trace, pointData2);\n\n return pointData2;\n}\n\nmodule.exports = {\n hoverPoints: hoverPoints,\n calcHover: calcHover\n};\n\n},{\"../../lib\":728,\"../../registry\":859,\"../scatter/get_trace_color\":1144}],1194:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar hover = _dereq_('./hover');\n\nmodule.exports = {\n moduleType: 'trace',\n name: 'scattergl',\n basePlotModule: _dereq_('../../plots/cartesian'),\n categories: ['gl', 'regl', 'cartesian', 'symbols', 'errorBarsOK', 'showLegend', 'scatter-like'],\n\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults'),\n crossTraceDefaults: _dereq_('../scatter/cross_trace_defaults'),\n colorbar: _dereq_('../scatter/marker_colorbar'),\n formatLabels: _dereq_('./format_labels'),\n calc: _dereq_('./calc'),\n plot: _dereq_('./plot'),\n hoverPoints: hover.hoverPoints,\n selectPoints: _dereq_('./select'),\n\n meta: {\n \n \n }\n};\n\n},{\"../../plots/cartesian\":789,\"../scatter/cross_trace_defaults\":1140,\"../scatter/marker_colorbar\":1152,\"./attributes\":1185,\"./calc\":1186,\"./defaults\":1189,\"./format_labels\":1191,\"./hover\":1193,\"./plot\":1195,\"./select\":1197}],1195:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar createScatter = _dereq_('regl-scatter2d');\nvar createLine = _dereq_('regl-line2d');\nvar createError = _dereq_('regl-error2d');\nvar Text = _dereq_('gl-text');\n\nvar Lib = _dereq_('../../lib');\nvar selectMode = _dereq_('../../components/dragelement/helpers').selectMode;\nvar prepareRegl = _dereq_('../../lib/prepare_regl');\n\nvar subTypes = _dereq_('../scatter/subtypes');\nvar linkTraces = _dereq_('../scatter/link_traces');\n\nvar styleTextSelection = _dereq_('./edit_style').styleTextSelection;\n\nfunction getViewport(fullLayout, xaxis, yaxis) {\n var gs = fullLayout._size;\n var width = fullLayout.width;\n var height = fullLayout.height;\n return [\n gs.l + xaxis.domain[0] * gs.w,\n gs.b + yaxis.domain[0] * gs.h,\n (width - gs.r) - (1 - xaxis.domain[1]) * gs.w,\n (height - gs.t) - (1 - yaxis.domain[1]) * gs.h\n ];\n}\n\nmodule.exports = function plot(gd, subplot, cdata) {\n if(!cdata.length) return;\n\n var fullLayout = gd._fullLayout;\n var scene = subplot._scene;\n var xaxis = subplot.xaxis;\n var yaxis = subplot.yaxis;\n var i, j;\n\n // we may have more subplots than initialized data due to Axes.getSubplots method\n if(!scene) return;\n\n var success = prepareRegl(gd, ['ANGLE_instanced_arrays', 'OES_element_index_uint']);\n if(!success) {\n scene.init();\n return;\n }\n\n var count = scene.count;\n var regl = fullLayout._glcanvas.data()[0].regl;\n\n // that is needed for fills\n linkTraces(gd, subplot, cdata);\n\n if(scene.dirty) {\n // make sure scenes are created\n if(scene.error2d === true) {\n scene.error2d = createError(regl);\n }\n if(scene.line2d === true) {\n scene.line2d = createLine(regl);\n }\n if(scene.scatter2d === true) {\n scene.scatter2d = createScatter(regl);\n }\n if(scene.fill2d === true) {\n scene.fill2d = createLine(regl);\n }\n if(scene.glText === true) {\n scene.glText = new Array(count);\n for(i = 0; i < count; i++) {\n scene.glText[i] = new Text(regl);\n }\n }\n\n // update main marker options\n if(scene.glText) {\n if(count > scene.glText.length) {\n // add gl text marker\n var textsToAdd = count - scene.glText.length;\n for(i = 0; i < textsToAdd; i++) {\n scene.glText.push(new Text(regl));\n }\n } else if(count < scene.glText.length) {\n // remove gl text marker\n var textsToRemove = scene.glText.length - count;\n var removedTexts = scene.glText.splice(count, textsToRemove);\n removedTexts.forEach(function(text) { text.destroy(); });\n }\n\n for(i = 0; i < count; i++) {\n scene.glText[i].update(scene.textOptions[i]);\n }\n }\n if(scene.line2d) {\n scene.line2d.update(scene.lineOptions);\n scene.lineOptions = scene.lineOptions.map(function(lineOptions) {\n if(lineOptions && lineOptions.positions) {\n var srcPos = lineOptions.positions;\n\n var firstptdef = 0;\n while(firstptdef < srcPos.length && (isNaN(srcPos[firstptdef]) || isNaN(srcPos[firstptdef + 1]))) {\n firstptdef += 2;\n }\n var lastptdef = srcPos.length - 2;\n while(lastptdef > firstptdef && (isNaN(srcPos[lastptdef]) || isNaN(srcPos[lastptdef + 1]))) {\n lastptdef -= 2;\n }\n lineOptions.positions = srcPos.slice(firstptdef, lastptdef + 2);\n }\n return lineOptions;\n });\n scene.line2d.update(scene.lineOptions);\n }\n if(scene.error2d) {\n var errorBatch = (scene.errorXOptions || []).concat(scene.errorYOptions || []);\n scene.error2d.update(errorBatch);\n }\n if(scene.scatter2d) {\n scene.scatter2d.update(scene.markerOptions);\n }\n\n // fill requires linked traces, so we generate it's positions here\n scene.fillOrder = Lib.repeat(null, count);\n if(scene.fill2d) {\n scene.fillOptions = scene.fillOptions.map(function(fillOptions, i) {\n var cdscatter = cdata[i];\n if(!fillOptions || !cdscatter || !cdscatter[0] || !cdscatter[0].trace) return;\n var cd = cdscatter[0];\n var trace = cd.trace;\n var stash = cd.t;\n var lineOptions = scene.lineOptions[i];\n var last, j;\n\n var fillData = [];\n if(trace._ownfill) fillData.push(i);\n if(trace._nexttrace) fillData.push(i + 1);\n if(fillData.length) scene.fillOrder[i] = fillData;\n\n var pos = [];\n var srcPos = (lineOptions && lineOptions.positions) || stash.positions;\n var firstptdef, lastptdef;\n\n if(trace.fill === 'tozeroy') {\n firstptdef = 0;\n while(firstptdef < srcPos.length && isNaN(srcPos[firstptdef + 1])) {\n firstptdef += 2;\n }\n lastptdef = srcPos.length - 2;\n while(lastptdef > firstptdef && isNaN(srcPos[lastptdef + 1])) {\n lastptdef -= 2;\n }\n if(srcPos[firstptdef + 1] !== 0) {\n pos = [srcPos[firstptdef], 0];\n }\n pos = pos.concat(srcPos.slice(firstptdef, lastptdef + 2));\n if(srcPos[lastptdef + 1] !== 0) {\n pos = pos.concat([srcPos[lastptdef], 0]);\n }\n } else if(trace.fill === 'tozerox') {\n firstptdef = 0;\n while(firstptdef < srcPos.length && isNaN(srcPos[firstptdef])) {\n firstptdef += 2;\n }\n lastptdef = srcPos.length - 2;\n while(lastptdef > firstptdef && isNaN(srcPos[lastptdef])) {\n lastptdef -= 2;\n }\n if(srcPos[firstptdef] !== 0) {\n pos = [0, srcPos[firstptdef + 1]];\n }\n pos = pos.concat(srcPos.slice(firstptdef, lastptdef + 2));\n if(srcPos[lastptdef] !== 0) {\n pos = pos.concat([ 0, srcPos[lastptdef + 1]]);\n }\n } else if(trace.fill === 'toself' || trace.fill === 'tonext') {\n pos = [];\n last = 0;\n for(j = 0; j < srcPos.length; j += 2) {\n if(isNaN(srcPos[j]) || isNaN(srcPos[j + 1])) {\n pos = pos.concat(srcPos.slice(last, j));\n pos.push(srcPos[last], srcPos[last + 1]);\n last = j + 2;\n }\n }\n pos = pos.concat(srcPos.slice(last));\n if(last) {\n pos.push(srcPos[last], srcPos[last + 1]);\n }\n } else {\n var nextTrace = trace._nexttrace;\n\n if(nextTrace) {\n var nextOptions = scene.lineOptions[i + 1];\n\n if(nextOptions) {\n var nextPos = nextOptions.positions;\n if(trace.fill === 'tonexty') {\n pos = srcPos.slice();\n\n for(i = Math.floor(nextPos.length / 2); i--;) {\n var xx = nextPos[i * 2];\n var yy = nextPos[i * 2 + 1];\n if(isNaN(xx) || isNaN(yy)) continue;\n pos.push(xx, yy);\n }\n fillOptions.fill = nextTrace.fillcolor;\n }\n }\n }\n }\n\n // detect prev trace positions to exclude from current fill\n if(trace._prevtrace && trace._prevtrace.fill === 'tonext') {\n var prevLinePos = scene.lineOptions[i - 1].positions;\n\n // FIXME: likely this logic should be tested better\n var offset = pos.length / 2;\n last = offset;\n var hole = [last];\n for(j = 0; j < prevLinePos.length; j += 2) {\n if(isNaN(prevLinePos[j]) || isNaN(prevLinePos[j + 1])) {\n hole.push(j / 2 + offset + 1);\n last = j + 2;\n }\n }\n\n pos = pos.concat(prevLinePos);\n fillOptions.hole = hole;\n }\n fillOptions.fillmode = trace.fill;\n fillOptions.opacity = trace.opacity;\n fillOptions.positions = pos;\n\n return fillOptions;\n });\n\n scene.fill2d.update(scene.fillOptions);\n }\n }\n\n // form batch arrays, and check for selected points\n var dragmode = fullLayout.dragmode;\n var isSelectMode = selectMode(dragmode);\n var clickSelectEnabled = fullLayout.clickmode.indexOf('select') > -1;\n\n for(i = 0; i < count; i++) {\n var cd0 = cdata[i][0];\n var trace = cd0.trace;\n var stash = cd0.t;\n var index = stash.index;\n var len = trace._length;\n var x = stash.x;\n var y = stash.y;\n\n if(trace.selectedpoints || isSelectMode || clickSelectEnabled) {\n if(!isSelectMode) isSelectMode = true;\n\n // regenerate scene batch, if traces number changed during selection\n if(trace.selectedpoints) {\n var selPts = scene.selectBatch[index] = Lib.selIndices2selPoints(trace);\n\n var selDict = {};\n for(j = 0; j < selPts.length; j++) {\n selDict[selPts[j]] = 1;\n }\n var unselPts = [];\n for(j = 0; j < len; j++) {\n if(!selDict[j]) unselPts.push(j);\n }\n scene.unselectBatch[index] = unselPts;\n }\n\n // precalculate px coords since we are not going to pan during select\n // TODO, could do better here e.g.\n // - spin that in a webworker\n // - compute selection from polygons in data coordinates\n // (maybe just for linear axes)\n var xpx = stash.xpx = new Array(len);\n var ypx = stash.ypx = new Array(len);\n for(j = 0; j < len; j++) {\n xpx[j] = xaxis.c2p(x[j]);\n ypx[j] = yaxis.c2p(y[j]);\n }\n } else {\n stash.xpx = stash.ypx = null;\n }\n }\n\n if(isSelectMode) {\n // create scatter instance by cloning scatter2d\n if(!scene.select2d) {\n scene.select2d = createScatter(fullLayout._glcanvas.data()[1].regl);\n }\n\n // use unselected styles on 'context' canvas\n if(scene.scatter2d) {\n var unselOpts = new Array(count);\n for(i = 0; i < count; i++) {\n unselOpts[i] = scene.selectBatch[i].length || scene.unselectBatch[i].length ?\n scene.markerUnselectedOptions[i] :\n {};\n }\n scene.scatter2d.update(unselOpts);\n }\n\n // use selected style on 'focus' canvas\n if(scene.select2d) {\n scene.select2d.update(scene.markerOptions);\n scene.select2d.update(scene.markerSelectedOptions);\n }\n\n if(scene.glText) {\n cdata.forEach(function(cdscatter) {\n var trace = ((cdscatter || [])[0] || {}).trace || {};\n if(subTypes.hasText(trace)) {\n styleTextSelection(cdscatter);\n }\n });\n }\n } else {\n // reset 'context' scatter2d opts to base opts,\n // thus unsetting markerUnselectedOptions from selection\n if(scene.scatter2d) {\n scene.scatter2d.update(scene.markerOptions);\n }\n }\n\n // provide viewport and range\n var vpRange0 = {\n viewport: getViewport(fullLayout, xaxis, yaxis),\n // TODO do we need those fallbacks?\n range: [\n (xaxis._rl || xaxis.range)[0],\n (yaxis._rl || yaxis.range)[0],\n (xaxis._rl || xaxis.range)[1],\n (yaxis._rl || yaxis.range)[1]\n ]\n };\n var vpRange = Lib.repeat(vpRange0, scene.count);\n\n // upload viewport/range data to GPU\n if(scene.fill2d) {\n scene.fill2d.update(vpRange);\n }\n if(scene.line2d) {\n scene.line2d.update(vpRange);\n }\n if(scene.error2d) {\n scene.error2d.update(vpRange.concat(vpRange));\n }\n if(scene.scatter2d) {\n scene.scatter2d.update(vpRange);\n }\n if(scene.select2d) {\n scene.select2d.update(vpRange);\n }\n if(scene.glText) {\n scene.glText.forEach(function(text) { text.update(vpRange0); });\n }\n};\n\n},{\"../../components/dragelement/helpers\":613,\"../../lib\":728,\"../../lib/prepare_regl\":741,\"../scatter/link_traces\":1150,\"../scatter/subtypes\":1158,\"./edit_style\":1190,\"gl-text\":321,\"regl-error2d\":488,\"regl-line2d\":489,\"regl-scatter2d\":490}],1196:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\n// make sure scene exists on subplot, return it\nmodule.exports = function sceneUpdate(gd, subplot) {\n var scene = subplot._scene;\n\n var resetOpts = {\n // number of traces in subplot, since scene:subplot -> 1:1\n count: 0,\n // whether scene requires init hook in plot call (dirty plot call)\n dirty: true,\n // last used options\n lineOptions: [],\n fillOptions: [],\n markerOptions: [],\n markerSelectedOptions: [],\n markerUnselectedOptions: [],\n errorXOptions: [],\n errorYOptions: [],\n textOptions: [],\n textSelectedOptions: [],\n textUnselectedOptions: [],\n // selection batches\n selectBatch: [],\n unselectBatch: []\n };\n\n // regl- component stubs, initialized in dirty plot call\n var initOpts = {\n fill2d: false,\n scatter2d: false,\n error2d: false,\n line2d: false,\n glText: false,\n select2d: false\n };\n\n if(!subplot._scene) {\n scene = subplot._scene = {};\n\n scene.init = function init() {\n Lib.extendFlat(scene, initOpts, resetOpts);\n };\n\n scene.init();\n\n // apply new option to all regl components (used on drag)\n scene.update = function update(opt) {\n var opts = Lib.repeat(opt, scene.count);\n\n if(scene.fill2d) scene.fill2d.update(opts);\n if(scene.scatter2d) scene.scatter2d.update(opts);\n if(scene.line2d) scene.line2d.update(opts);\n if(scene.error2d) scene.error2d.update(opts.concat(opts));\n if(scene.select2d) scene.select2d.update(opts);\n if(scene.glText) {\n for(var i = 0; i < scene.count; i++) {\n scene.glText[i].update(opt);\n }\n }\n };\n\n // draw traces in proper order\n scene.draw = function draw() {\n var count = scene.count;\n var fill2d = scene.fill2d;\n var error2d = scene.error2d;\n var line2d = scene.line2d;\n var scatter2d = scene.scatter2d;\n var glText = scene.glText;\n var select2d = scene.select2d;\n var selectBatch = scene.selectBatch;\n var unselectBatch = scene.unselectBatch;\n\n for(var i = 0; i < count; i++) {\n if(fill2d && scene.fillOrder[i]) {\n fill2d.draw(scene.fillOrder[i]);\n }\n if(line2d && scene.lineOptions[i]) {\n line2d.draw(i);\n }\n if(error2d) {\n if(scene.errorXOptions[i]) error2d.draw(i);\n if(scene.errorYOptions[i]) error2d.draw(i + count);\n }\n if(scatter2d && scene.markerOptions[i]) {\n if(unselectBatch[i].length) {\n var arg = Lib.repeat([], scene.count);\n arg[i] = unselectBatch[i];\n scatter2d.draw(arg);\n } else if(!selectBatch[i].length) {\n scatter2d.draw(i);\n }\n }\n if(glText[i] && scene.textOptions[i]) {\n glText[i].render();\n }\n }\n\n if(select2d) {\n select2d.draw(selectBatch);\n }\n\n scene.dirty = false;\n };\n\n // remove scene resources\n scene.destroy = function destroy() {\n if(scene.fill2d && scene.fill2d.destroy) scene.fill2d.destroy();\n if(scene.scatter2d && scene.scatter2d.destroy) scene.scatter2d.destroy();\n if(scene.error2d && scene.error2d.destroy) scene.error2d.destroy();\n if(scene.line2d && scene.line2d.destroy) scene.line2d.destroy();\n if(scene.select2d && scene.select2d.destroy) scene.select2d.destroy();\n if(scene.glText) {\n scene.glText.forEach(function(text) {\n if(text.destroy) text.destroy();\n });\n }\n\n scene.lineOptions = null;\n scene.fillOptions = null;\n scene.markerOptions = null;\n scene.markerSelectedOptions = null;\n scene.markerUnselectedOptions = null;\n scene.errorXOptions = null;\n scene.errorYOptions = null;\n scene.textOptions = null;\n scene.textSelectedOptions = null;\n scene.textUnselectedOptions = null;\n\n scene.selectBatch = null;\n scene.unselectBatch = null;\n\n // we can't just delete _scene, because `destroy` is called in the\n // middle of supplyDefaults, before relinkPrivateKeys which will put it back.\n subplot._scene = null;\n };\n }\n\n // in case if we have scene from the last calc - reset data\n if(!scene.dirty) {\n Lib.extendFlat(scene, resetOpts);\n }\n\n return scene;\n};\n\n},{\"../../lib\":728}],1197:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar subTypes = _dereq_('../scatter/subtypes');\nvar styleTextSelection = _dereq_('./edit_style').styleTextSelection;\n\nmodule.exports = function select(searchInfo, selectionTester) {\n var cd = searchInfo.cd;\n var selection = [];\n var trace = cd[0].trace;\n var stash = cd[0].t;\n var len = trace._length;\n var x = stash.x;\n var y = stash.y;\n var scene = stash._scene;\n var index = stash.index;\n\n if(!scene) return selection;\n\n var hasText = subTypes.hasText(trace);\n var hasMarkers = subTypes.hasMarkers(trace);\n var hasOnlyLines = !hasMarkers && !hasText;\n\n if(trace.visible !== true || hasOnlyLines) return selection;\n\n var els = [];\n var unels = [];\n\n // degenerate polygon does not enable selection\n // filter out points by visible scatter ones\n if(selectionTester !== false && !selectionTester.degenerate) {\n for(var i = 0; i < len; i++) {\n if(selectionTester.contains([stash.xpx[i], stash.ypx[i]], false, i, searchInfo)) {\n els.push(i);\n selection.push({\n pointNumber: i,\n x: x[i],\n y: y[i]\n });\n } else {\n unels.push(i);\n }\n }\n }\n\n if(hasMarkers) {\n var scatter2d = scene.scatter2d;\n\n if(!els.length && !unels.length) {\n // reset to base styles when clearing\n var baseOpts = new Array(scene.count);\n baseOpts[index] = scene.markerOptions[index];\n scatter2d.update.apply(scatter2d, baseOpts);\n } else if(!scene.selectBatch[index].length && !scene.unselectBatch[index].length) {\n // set unselected styles on 'context' canvas (if not done already)\n var unselOpts = new Array(scene.count);\n unselOpts[index] = scene.markerUnselectedOptions[index];\n scatter2d.update.apply(scatter2d, unselOpts);\n }\n }\n\n scene.selectBatch[index] = els;\n scene.unselectBatch[index] = unels;\n\n if(hasText) {\n styleTextSelection(cd);\n }\n\n return selection;\n};\n\n},{\"../scatter/subtypes\":1158,\"./edit_style\":1190}],1198:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar texttemplateAttrs = _dereq_('../../plots/template_attributes').texttemplateAttrs;\nvar scatterGeoAttrs = _dereq_('../scattergeo/attributes');\nvar scatterAttrs = _dereq_('../scatter/attributes');\nvar mapboxAttrs = _dereq_('../../plots/mapbox/layout_attributes');\nvar baseAttrs = _dereq_('../../plots/attributes');\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\nvar overrideAll = _dereq_('../../plot_api/edit_types').overrideAll;\n\nvar lineAttrs = scatterGeoAttrs.line;\nvar markerAttrs = scatterGeoAttrs.marker;\n\nmodule.exports = overrideAll({\n lon: scatterGeoAttrs.lon,\n lat: scatterGeoAttrs.lat,\n\n // locations\n // locationmode\n\n mode: extendFlat({}, scatterAttrs.mode, {\n dflt: 'markers',\n \n }),\n\n text: extendFlat({}, scatterAttrs.text, {\n \n }),\n texttemplate: texttemplateAttrs({editType: 'plot'}, {\n keys: ['lat', 'lon', 'text']\n }),\n hovertext: extendFlat({}, scatterAttrs.hovertext, {\n \n }),\n\n line: {\n color: lineAttrs.color,\n width: lineAttrs.width\n\n // TODO\n // dash: dash\n },\n\n connectgaps: scatterAttrs.connectgaps,\n\n marker: extendFlat({\n symbol: {\n valType: 'string',\n dflt: 'circle',\n \n arrayOk: true,\n \n },\n angle: {\n valType: 'number',\n dflt: 'auto',\n \n arrayOk: true,\n \n },\n allowoverlap: {\n valType: 'boolean',\n dflt: false,\n \n \n },\n opacity: markerAttrs.opacity,\n size: markerAttrs.size,\n sizeref: markerAttrs.sizeref,\n sizemin: markerAttrs.sizemin,\n sizemode: markerAttrs.sizemode\n },\n colorScaleAttrs('marker')\n // line\n ),\n\n fill: scatterGeoAttrs.fill,\n fillcolor: scatterAttrs.fillcolor,\n\n textfont: mapboxAttrs.layers.symbol.textfont,\n textposition: mapboxAttrs.layers.symbol.textposition,\n\n below: {\n valType: 'string',\n \n \n },\n\n selected: {\n marker: scatterAttrs.selected.marker\n },\n unselected: {\n marker: scatterAttrs.unselected.marker\n },\n\n hoverinfo: extendFlat({}, baseAttrs.hoverinfo, {\n flags: ['lon', 'lat', 'text', 'name']\n }),\n hovertemplate: hovertemplateAttrs(),\n}, 'calc', 'nested');\n\n},{\"../../components/colorscale/attributes\":602,\"../../lib/extend\":719,\"../../plot_api/edit_types\":759,\"../../plots/attributes\":773,\"../../plots/mapbox/layout_attributes\":835,\"../../plots/template_attributes\":854,\"../scatter/attributes\":1134,\"../scattergeo/attributes\":1175}],1199:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Lib = _dereq_('../../lib');\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\nvar geoJsonUtils = _dereq_('../../lib/geojson_utils');\n\nvar Colorscale = _dereq_('../../components/colorscale');\nvar Drawing = _dereq_('../../components/drawing');\nvar makeBubbleSizeFn = _dereq_('../scatter/make_bubble_size_func');\nvar subTypes = _dereq_('../scatter/subtypes');\nvar convertTextOpts = _dereq_('../../plots/mapbox/convert_text_opts');\nvar appendArrayPointValue = _dereq_('../../components/fx/helpers').appendArrayPointValue;\n\nvar NEWLINES = _dereq_('../../lib/svg_text_utils').NEWLINES;\nvar BR_TAG_ALL = _dereq_('../../lib/svg_text_utils').BR_TAG_ALL;\n\nmodule.exports = function convert(gd, calcTrace) {\n var trace = calcTrace[0].trace;\n\n var isVisible = (trace.visible === true && trace._length !== 0);\n var hasFill = (trace.fill !== 'none');\n var hasLines = subTypes.hasLines(trace);\n var hasMarkers = subTypes.hasMarkers(trace);\n var hasText = subTypes.hasText(trace);\n var hasCircles = (hasMarkers && trace.marker.symbol === 'circle');\n var hasSymbols = (hasMarkers && trace.marker.symbol !== 'circle');\n\n var fill = initContainer();\n var line = initContainer();\n var circle = initContainer();\n var symbol = initContainer();\n\n var opts = {\n fill: fill,\n line: line,\n circle: circle,\n symbol: symbol\n };\n\n // early return if not visible or placeholder\n if(!isVisible) return opts;\n\n // fill layer and line layer use the same coords\n var lineCoords;\n if(hasFill || hasLines) {\n lineCoords = geoJsonUtils.calcTraceToLineCoords(calcTrace);\n }\n\n if(hasFill) {\n fill.geojson = geoJsonUtils.makePolygon(lineCoords);\n fill.layout.visibility = 'visible';\n\n Lib.extendFlat(fill.paint, {\n 'fill-color': trace.fillcolor\n });\n }\n\n if(hasLines) {\n line.geojson = geoJsonUtils.makeLine(lineCoords);\n line.layout.visibility = 'visible';\n\n Lib.extendFlat(line.paint, {\n 'line-width': trace.line.width,\n 'line-color': trace.line.color,\n 'line-opacity': trace.opacity\n });\n\n // TODO convert line.dash into line-dasharray\n }\n\n if(hasCircles) {\n var circleOpts = makeCircleOpts(calcTrace);\n circle.geojson = circleOpts.geojson;\n circle.layout.visibility = 'visible';\n\n Lib.extendFlat(circle.paint, {\n 'circle-color': circleOpts.mcc,\n 'circle-radius': circleOpts.mrc,\n 'circle-opacity': circleOpts.mo\n });\n }\n\n if(hasSymbols || hasText) {\n symbol.geojson = makeSymbolGeoJSON(calcTrace, gd);\n\n Lib.extendFlat(symbol.layout, {\n visibility: 'visible',\n 'icon-image': '{symbol}-15',\n 'text-field': '{text}'\n });\n\n if(hasSymbols) {\n Lib.extendFlat(symbol.layout, {\n 'icon-size': trace.marker.size / 10\n });\n\n if('angle' in trace.marker && trace.marker.angle !== 'auto') {\n Lib.extendFlat(symbol.layout, {\n // unfortunately cant use {angle} do to this issue:\n // https://github.com/mapbox/mapbox-gl-js/issues/873\n 'icon-rotate': {\n type: 'identity', property: 'angle'\n },\n 'icon-rotation-alignment': 'map'\n });\n }\n\n symbol.layout['icon-allow-overlap'] = trace.marker.allowoverlap;\n\n Lib.extendFlat(symbol.paint, {\n 'icon-opacity': trace.opacity * trace.marker.opacity,\n\n // TODO does not work ??\n 'icon-color': trace.marker.color\n });\n }\n\n if(hasText) {\n var iconSize = (trace.marker || {}).size;\n var textOpts = convertTextOpts(trace.textposition, iconSize);\n\n // all data-driven below !!\n\n Lib.extendFlat(symbol.layout, {\n 'text-size': trace.textfont.size,\n 'text-anchor': textOpts.anchor,\n 'text-offset': textOpts.offset\n\n // TODO font family\n // 'text-font': symbol.textfont.family.split(', '),\n });\n\n Lib.extendFlat(symbol.paint, {\n 'text-color': trace.textfont.color,\n 'text-opacity': trace.opacity\n });\n }\n }\n\n return opts;\n};\n\nfunction initContainer() {\n return {\n geojson: geoJsonUtils.makeBlank(),\n layout: { visibility: 'none' },\n paint: {}\n };\n}\n\nfunction makeCircleOpts(calcTrace) {\n var trace = calcTrace[0].trace;\n var marker = trace.marker;\n var selectedpoints = trace.selectedpoints;\n var arrayColor = Lib.isArrayOrTypedArray(marker.color);\n var arraySize = Lib.isArrayOrTypedArray(marker.size);\n var arrayOpacity = Lib.isArrayOrTypedArray(marker.opacity);\n var i;\n\n function addTraceOpacity(o) { return trace.opacity * o; }\n\n function size2radius(s) { return s / 2; }\n\n var colorFn;\n if(arrayColor) {\n if(Colorscale.hasColorscale(trace, 'marker')) {\n colorFn = Colorscale.makeColorScaleFuncFromTrace(marker);\n } else {\n colorFn = Lib.identity;\n }\n }\n\n var sizeFn;\n if(arraySize) {\n sizeFn = makeBubbleSizeFn(trace);\n }\n\n var opacityFn;\n if(arrayOpacity) {\n opacityFn = function(mo) {\n var mo2 = isNumeric(mo) ? +Lib.constrain(mo, 0, 1) : 0;\n return addTraceOpacity(mo2);\n };\n }\n\n var features = [];\n for(i = 0; i < calcTrace.length; i++) {\n var calcPt = calcTrace[i];\n var lonlat = calcPt.lonlat;\n\n if(isBADNUM(lonlat)) continue;\n\n var props = {};\n if(colorFn) props.mcc = calcPt.mcc = colorFn(calcPt.mc);\n if(sizeFn) props.mrc = calcPt.mrc = sizeFn(calcPt.ms);\n if(opacityFn) props.mo = opacityFn(calcPt.mo);\n if(selectedpoints) props.selected = calcPt.selected || 0;\n\n features.push({\n type: 'Feature',\n geometry: {type: 'Point', coordinates: lonlat},\n properties: props\n });\n }\n\n var fns;\n if(selectedpoints) {\n fns = Drawing.makeSelectedPointStyleFns(trace);\n\n for(i = 0; i < features.length; i++) {\n var d = features[i].properties;\n\n if(fns.selectedOpacityFn) {\n d.mo = addTraceOpacity(fns.selectedOpacityFn(d));\n }\n if(fns.selectedColorFn) {\n d.mcc = fns.selectedColorFn(d);\n }\n if(fns.selectedSizeFn) {\n d.mrc = fns.selectedSizeFn(d);\n }\n }\n }\n\n return {\n geojson: {type: 'FeatureCollection', features: features},\n mcc: arrayColor || (fns && fns.selectedColorFn) ?\n {type: 'identity', property: 'mcc'} :\n marker.color,\n mrc: arraySize || (fns && fns.selectedSizeFn) ?\n {type: 'identity', property: 'mrc'} :\n size2radius(marker.size),\n mo: arrayOpacity || (fns && fns.selectedOpacityFn) ?\n {type: 'identity', property: 'mo'} :\n addTraceOpacity(marker.opacity)\n };\n}\n\nfunction makeSymbolGeoJSON(calcTrace, gd) {\n var fullLayout = gd._fullLayout;\n var trace = calcTrace[0].trace;\n\n var marker = trace.marker || {};\n var symbol = marker.symbol;\n var angle = marker.angle;\n\n var fillSymbol = (symbol !== 'circle') ?\n getFillFunc(symbol) :\n blankFillFunc;\n\n var fillAngle = (angle !== 'auto') ?\n getFillFunc(angle, true) :\n blankFillFunc;\n\n var fillText = subTypes.hasText(trace) ?\n getFillFunc(trace.text) :\n blankFillFunc;\n\n\n var features = [];\n\n for(var i = 0; i < calcTrace.length; i++) {\n var calcPt = calcTrace[i];\n\n if(isBADNUM(calcPt.lonlat)) continue;\n\n var texttemplate = trace.texttemplate;\n var text;\n\n if(texttemplate) {\n var tt = Array.isArray(texttemplate) ? (texttemplate[i] || '') : texttemplate;\n var labels = trace._module.formatLabels(calcPt, trace, fullLayout);\n var pointValues = {};\n appendArrayPointValue(pointValues, trace, calcPt.i);\n var meta = trace._meta || {};\n text = Lib.texttemplateString(tt, labels, fullLayout._d3locale, pointValues, calcPt, meta);\n } else {\n text = fillText(i);\n }\n\n if(text) {\n text = text.replace(NEWLINES, '').replace(BR_TAG_ALL, '\\n');\n }\n\n features.push({\n type: 'Feature',\n geometry: {\n type: 'Point',\n coordinates: calcPt.lonlat\n },\n properties: {\n symbol: fillSymbol(i),\n angle: fillAngle(i),\n text: text\n }\n });\n }\n\n return {\n type: 'FeatureCollection',\n features: features\n };\n}\n\nfunction getFillFunc(attr, numeric) {\n if(Lib.isArrayOrTypedArray(attr)) {\n if(numeric) {\n return function(i) { return isNumeric(attr[i]) ? +attr[i] : 0; };\n }\n return function(i) { return attr[i]; };\n } else if(attr) {\n return function() { return attr; };\n } else {\n return blankFillFunc;\n }\n}\n\nfunction blankFillFunc() { return ''; }\n\n// only need to check lon (OR lat)\nfunction isBADNUM(lonlat) {\n return lonlat[0] === BADNUM;\n}\n\n},{\"../../components/colorscale\":607,\"../../components/drawing\":617,\"../../components/fx/helpers\":631,\"../../constants/numerical\":704,\"../../lib\":728,\"../../lib/geojson_utils\":723,\"../../lib/svg_text_utils\":752,\"../../plots/mapbox/convert_text_opts\":832,\"../scatter/make_bubble_size_func\":1151,\"../scatter/subtypes\":1158,\"fast-isnumeric\":236}],1200:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nvar subTypes = _dereq_('../scatter/subtypes');\nvar handleMarkerDefaults = _dereq_('../scatter/marker_defaults');\nvar handleLineDefaults = _dereq_('../scatter/line_defaults');\nvar handleTextDefaults = _dereq_('../scatter/text_defaults');\nvar handleFillColorDefaults = _dereq_('../scatter/fillcolor_defaults');\nvar attributes = _dereq_('./attributes');\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 len = handleLonLatDefaults(traceIn, traceOut, coerce);\n if(!len) {\n traceOut.visible = false;\n return;\n }\n\n coerce('text');\n coerce('texttemplate');\n coerce('hovertext');\n coerce('hovertemplate');\n coerce('mode');\n coerce('below');\n\n if(subTypes.hasLines(traceOut)) {\n handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce, {noDash: true});\n coerce('connectgaps');\n }\n\n if(subTypes.hasMarkers(traceOut)) {\n handleMarkerDefaults(traceIn, traceOut, defaultColor, layout, coerce, {noLine: true});\n\n coerce('marker.allowoverlap');\n coerce('marker.angle');\n\n // array marker.size and marker.color are only supported with circles\n var marker = traceOut.marker;\n if(marker.symbol !== 'circle') {\n if(Lib.isArrayOrTypedArray(marker.size)) marker.size = marker.size[0];\n if(Lib.isArrayOrTypedArray(marker.color)) marker.color = marker.color[0];\n }\n }\n\n if(subTypes.hasText(traceOut)) {\n handleTextDefaults(traceIn, traceOut, layout, coerce, {noSelect: true});\n }\n\n coerce('fill');\n if(traceOut.fill !== 'none') {\n handleFillColorDefaults(traceIn, traceOut, defaultColor, coerce);\n }\n\n Lib.coerceSelectionMarkerOpacity(traceOut, coerce);\n};\n\nfunction handleLonLatDefaults(traceIn, traceOut, coerce) {\n var lon = coerce('lon') || [];\n var lat = coerce('lat') || [];\n var len = Math.min(lon.length, lat.length);\n traceOut._length = len;\n\n return len;\n}\n\n},{\"../../lib\":728,\"../scatter/fillcolor_defaults\":1142,\"../scatter/line_defaults\":1147,\"../scatter/marker_defaults\":1153,\"../scatter/subtypes\":1158,\"../scatter/text_defaults\":1159,\"./attributes\":1198}],1201:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\n\nmodule.exports = function eventData(out, pt) {\n out.lon = pt.lon;\n out.lat = pt.lat;\n\n return out;\n};\n\n},{}],1202:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Axes = _dereq_('../../plots/cartesian/axes');\n\nmodule.exports = function formatLabels(cdi, trace, fullLayout) {\n var labels = {};\n\n var subplot = fullLayout[trace.subplot]._subplot;\n var ax = subplot.mockAxis;\n\n var lonlat = cdi.lonlat;\n labels.lonLabel = Axes.tickText(ax, ax.c2l(lonlat[0]), true).text;\n labels.latLabel = Axes.tickText(ax, ax.c2l(lonlat[1]), true).text;\n\n return labels;\n};\n\n},{\"../../plots/cartesian/axes\":776}],1203:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Fx = _dereq_('../../components/fx');\nvar Lib = _dereq_('../../lib');\nvar getTraceColor = _dereq_('../scatter/get_trace_color');\nvar fillText = Lib.fillText;\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\n\nmodule.exports = function hoverPoints(pointData, xval, yval) {\n var cd = pointData.cd;\n var trace = cd[0].trace;\n var xa = pointData.xa;\n var ya = pointData.ya;\n var subplot = pointData.subplot;\n\n // compute winding number about [-180, 180] globe\n var winding = (xval >= 0) ?\n Math.floor((xval + 180) / 360) :\n Math.ceil((xval - 180) / 360);\n\n // shift longitude to [-180, 180] to determine closest point\n var lonShift = winding * 360;\n var xval2 = xval - lonShift;\n\n function distFn(d) {\n var lonlat = d.lonlat;\n if(lonlat[0] === BADNUM) return Infinity;\n\n var lon = Lib.modHalf(lonlat[0], 360);\n var lat = lonlat[1];\n var pt = subplot.project([lon, lat]);\n var dx = pt.x - xa.c2p([xval2, lat]);\n var dy = pt.y - ya.c2p([lon, yval]);\n var rad = Math.max(3, d.mrc || 0);\n\n return Math.max(Math.sqrt(dx * dx + dy * dy) - rad, 1 - 3 / rad);\n }\n\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 var di = cd[pointData.index];\n var lonlat = di.lonlat;\n var lonlatShifted = [Lib.modHalf(lonlat[0], 360) + lonShift, lonlat[1]];\n\n // shift labels back to original winded globe\n var xc = xa.c2p(lonlatShifted);\n var yc = ya.c2p(lonlatShifted);\n var rad = di.mrc || 1;\n\n pointData.x0 = xc - rad;\n pointData.x1 = xc + rad;\n pointData.y0 = yc - rad;\n pointData.y1 = yc + rad;\n\n var fullLayout = {};\n fullLayout[trace.subplot] = {_subplot: subplot};\n var labels = trace._module.formatLabels(di, trace, fullLayout);\n pointData.lonLabel = labels.lonLabel;\n pointData.latLabel = labels.latLabel;\n\n pointData.color = getTraceColor(trace, di);\n pointData.extraText = getExtraText(trace, di, cd[0].t.labels);\n pointData.hovertemplate = trace.hovertemplate;\n\n return [pointData];\n};\n\nfunction getExtraText(trace, di, labels) {\n if(trace.hovertemplate) return;\n\n var hoverinfo = di.hi || trace.hoverinfo;\n var parts = hoverinfo.split('+');\n var isAll = parts.indexOf('all') !== -1;\n var hasLon = parts.indexOf('lon') !== -1;\n var hasLat = parts.indexOf('lat') !== -1;\n var lonlat = di.lonlat;\n var text = [];\n\n // TODO should we use a mock axis to format hover?\n // If so, we'll need to make precision be zoom-level dependent\n function format(v) {\n return v + '\\u00B0';\n }\n\n if(isAll || (hasLon && hasLat)) {\n text.push('(' + format(lonlat[0]) + ', ' + format(lonlat[1]) + ')');\n } else if(hasLon) {\n text.push(labels.lon + format(lonlat[0]));\n } else if(hasLat) {\n text.push(labels.lat + format(lonlat[1]));\n }\n\n if(isAll || parts.indexOf('text') !== -1) {\n fillText(di, trace, text);\n }\n\n return text.join('
');\n}\n\n},{\"../../components/fx\":635,\"../../constants/numerical\":704,\"../../lib\":728,\"../scatter/get_trace_color\":1144}],1204:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults'),\n colorbar: _dereq_('../scatter/marker_colorbar'),\n formatLabels: _dereq_('./format_labels'),\n calc: _dereq_('../scattergeo/calc'),\n plot: _dereq_('./plot'),\n hoverPoints: _dereq_('./hover'),\n eventData: _dereq_('./event_data'),\n selectPoints: _dereq_('./select'),\n\n styleOnSelect: function(_, cd) {\n if(cd) {\n var trace = cd[0].trace;\n trace._glTrace.update(cd);\n }\n },\n\n moduleType: 'trace',\n name: 'scattermapbox',\n basePlotModule: _dereq_('../../plots/mapbox'),\n categories: ['mapbox', 'gl', 'symbols', 'showLegend', 'scatter-like'],\n meta: {\n \n \n }\n};\n\n},{\"../../plots/mapbox\":833,\"../scatter/marker_colorbar\":1152,\"../scattergeo/calc\":1176,\"./attributes\":1198,\"./defaults\":1200,\"./event_data\":1201,\"./format_labels\":1202,\"./hover\":1203,\"./plot\":1205,\"./select\":1206}],1205:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar convert = _dereq_('./convert');\nvar LAYER_PREFIX = _dereq_('../../plots/mapbox/constants').traceLayerPrefix;\nvar ORDER = ['fill', 'line', 'circle', 'symbol'];\n\nfunction ScatterMapbox(subplot, uid) {\n this.type = 'scattermapbox';\n this.subplot = subplot;\n this.uid = uid;\n\n this.sourceIds = {\n fill: 'source-' + uid + '-fill',\n line: 'source-' + uid + '-line',\n circle: 'source-' + uid + '-circle',\n symbol: 'source-' + uid + '-symbol'\n };\n\n this.layerIds = {\n fill: LAYER_PREFIX + uid + '-fill',\n line: LAYER_PREFIX + uid + '-line',\n circle: LAYER_PREFIX + uid + '-circle',\n symbol: LAYER_PREFIX + uid + '-symbol'\n };\n\n // We could merge the 'fill' source with the 'line' source and\n // the 'circle' source with the 'symbol' source if ever having\n // for up-to 4 sources per 'scattermapbox' traces becomes a problem.\n\n // previous 'below' value,\n // need this to update it properly\n this.below = null;\n}\n\nvar proto = ScatterMapbox.prototype;\n\nproto.addSource = function(k, opts) {\n this.subplot.map.addSource(this.sourceIds[k], {\n type: 'geojson',\n data: opts.geojson\n });\n};\n\nproto.setSourceData = function(k, opts) {\n this.subplot.map\n .getSource(this.sourceIds[k])\n .setData(opts.geojson);\n};\n\nproto.addLayer = function(k, opts, below) {\n this.subplot.addLayer({\n type: k,\n id: this.layerIds[k],\n source: this.sourceIds[k],\n layout: opts.layout,\n paint: opts.paint\n }, below);\n};\n\nproto.update = function update(calcTrace) {\n var subplot = this.subplot;\n var map = subplot.map;\n var optsAll = convert(subplot.gd, calcTrace);\n var below = subplot.belowLookup['trace-' + this.uid];\n var i, k, opts;\n\n if(below !== this.below) {\n for(i = ORDER.length - 1; i >= 0; i--) {\n k = ORDER[i];\n map.removeLayer(this.layerIds[k]);\n }\n for(i = 0; i < ORDER.length; i++) {\n k = ORDER[i];\n opts = optsAll[k];\n this.addLayer(k, opts, below);\n }\n this.below = below;\n }\n\n for(i = 0; i < ORDER.length; i++) {\n k = ORDER[i];\n opts = optsAll[k];\n\n subplot.setOptions(this.layerIds[k], 'setLayoutProperty', opts.layout);\n\n if(opts.layout.visibility === 'visible') {\n this.setSourceData(k, opts);\n subplot.setOptions(this.layerIds[k], 'setPaintProperty', opts.paint);\n }\n }\n\n // link ref for quick update during selections\n calcTrace[0].trace._glTrace = this;\n};\n\nproto.dispose = function dispose() {\n var map = this.subplot.map;\n\n for(var i = ORDER.length - 1; i >= 0; i--) {\n var k = ORDER[i];\n map.removeLayer(this.layerIds[k]);\n map.removeSource(this.sourceIds[k]);\n }\n};\n\nmodule.exports = function createScatterMapbox(subplot, calcTrace) {\n var trace = calcTrace[0].trace;\n var scatterMapbox = new ScatterMapbox(subplot, trace.uid);\n var optsAll = convert(subplot.gd, calcTrace);\n var below = scatterMapbox.below = subplot.belowLookup['trace-' + trace.uid];\n\n for(var i = 0; i < ORDER.length; i++) {\n var k = ORDER[i];\n var opts = optsAll[k];\n scatterMapbox.addSource(k, opts);\n scatterMapbox.addLayer(k, opts, below);\n }\n\n // link ref for quick update during selections\n calcTrace[0].trace._glTrace = scatterMapbox;\n\n return scatterMapbox;\n};\n\n},{\"../../plots/mapbox/constants\":831,\"./convert\":1199}],1206:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar subtypes = _dereq_('../scatter/subtypes');\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\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\n if(!subtypes.hasMarkers(trace)) return [];\n\n if(selectionTester === false) {\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 var di = cd[i];\n var lonlat = di.lonlat;\n\n if(lonlat[0] !== BADNUM) {\n var lonlat2 = [Lib.modHalf(lonlat[0], 360), lonlat[1]];\n var xy = [xa.c2p(lonlat2), ya.c2p(lonlat2)];\n\n if(selectionTester.contains(xy, null, i, searchInfo)) {\n selection.push({\n pointNumber: i,\n lon: lonlat[0],\n lat: lonlat[1]\n });\n di.selected = 1;\n } else {\n di.selected = 0;\n }\n }\n }\n }\n\n return selection;\n};\n\n},{\"../../constants/numerical\":704,\"../../lib\":728,\"../scatter/subtypes\":1158}],1207:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar texttemplateAttrs = _dereq_('../../plots/template_attributes').texttemplateAttrs;\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\nvar scatterAttrs = _dereq_('../scatter/attributes');\nvar baseAttrs = _dereq_('../../plots/attributes');\nvar lineAttrs = scatterAttrs.line;\n\nmodule.exports = {\n mode: scatterAttrs.mode,\n\n r: {\n valType: 'data_array',\n editType: 'calc+clearAxisTypes',\n \n },\n\n theta: {\n valType: 'data_array',\n editType: 'calc+clearAxisTypes',\n \n },\n\n r0: {\n valType: 'any',\n dflt: 0,\n \n editType: 'calc+clearAxisTypes',\n \n },\n dr: {\n valType: 'number',\n dflt: 1,\n \n editType: 'calc',\n \n },\n\n theta0: {\n valType: 'any',\n dflt: 0,\n \n editType: 'calc+clearAxisTypes',\n \n },\n dtheta: {\n valType: 'number',\n \n editType: 'calc',\n \n },\n\n thetaunit: {\n valType: 'enumerated',\n values: ['radians', 'degrees', 'gradians'],\n dflt: 'degrees',\n \n editType: 'calc+clearAxisTypes',\n \n },\n\n text: scatterAttrs.text,\n texttemplate: texttemplateAttrs({editType: 'plot'}, {\n keys: ['r', 'theta', 'text']\n }),\n hovertext: scatterAttrs.hovertext,\n\n line: {\n color: lineAttrs.color,\n width: lineAttrs.width,\n dash: lineAttrs.dash,\n shape: extendFlat({}, lineAttrs.shape, {\n values: ['linear', 'spline']\n }),\n smoothing: lineAttrs.smoothing,\n editType: 'calc'\n },\n connectgaps: scatterAttrs.connectgaps,\n\n marker: scatterAttrs.marker,\n cliponaxis: extendFlat({}, scatterAttrs.cliponaxis, {dflt: false}),\n\n textposition: scatterAttrs.textposition,\n textfont: scatterAttrs.textfont,\n\n fill: extendFlat({}, scatterAttrs.fill, {\n values: ['none', 'toself', 'tonext'],\n dflt: 'none',\n \n }),\n fillcolor: scatterAttrs.fillcolor,\n\n // TODO error bars\n // https://stackoverflow.com/a/26597487/4068492\n // error_x (error_r, error_theta)\n // error_y\n\n hoverinfo: extendFlat({}, baseAttrs.hoverinfo, {\n flags: ['r', 'theta', 'text', 'name']\n }),\n hoveron: scatterAttrs.hoveron,\n hovertemplate: hovertemplateAttrs(),\n\n selected: scatterAttrs.selected,\n unselected: scatterAttrs.unselected\n};\n\n},{\"../../lib/extend\":719,\"../../plots/attributes\":773,\"../../plots/template_attributes\":854,\"../scatter/attributes\":1134}],1208:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\n\nvar Axes = _dereq_('../../plots/cartesian/axes');\n\nvar calcColorscale = _dereq_('../scatter/colorscale_calc');\nvar arraysToCalcdata = _dereq_('../scatter/arrays_to_calcdata');\nvar calcSelection = _dereq_('../scatter/calc_selection');\nvar calcMarkerSize = _dereq_('../scatter/calc').calcMarkerSize;\n\nmodule.exports = function calc(gd, trace) {\n var fullLayout = gd._fullLayout;\n var subplotId = trace.subplot;\n var radialAxis = fullLayout[subplotId].radialaxis;\n var angularAxis = fullLayout[subplotId].angularaxis;\n var rArray = radialAxis.makeCalcdata(trace, 'r');\n var thetaArray = angularAxis.makeCalcdata(trace, 'theta');\n var len = trace._length;\n var cd = new Array(len);\n\n for(var i = 0; i < len; i++) {\n var r = rArray[i];\n var theta = thetaArray[i];\n var cdi = cd[i] = {};\n\n if(isNumeric(r) && isNumeric(theta)) {\n cdi.r = r;\n cdi.theta = theta;\n } else {\n cdi.r = BADNUM;\n }\n }\n\n var ppad = calcMarkerSize(trace, len);\n trace._extremes.x = Axes.findExtremes(radialAxis, rArray, {ppad: ppad});\n\n calcColorscale(gd, trace);\n arraysToCalcdata(cd, trace);\n calcSelection(cd, trace);\n\n return cd;\n};\n\n},{\"../../constants/numerical\":704,\"../../plots/cartesian/axes\":776,\"../scatter/arrays_to_calcdata\":1133,\"../scatter/calc\":1135,\"../scatter/calc_selection\":1136,\"../scatter/colorscale_calc\":1137,\"fast-isnumeric\":236}],1209:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nvar subTypes = _dereq_('../scatter/subtypes');\nvar handleMarkerDefaults = _dereq_('../scatter/marker_defaults');\nvar handleLineDefaults = _dereq_('../scatter/line_defaults');\nvar handleLineShapeDefaults = _dereq_('../scatter/line_shape_defaults');\nvar handleTextDefaults = _dereq_('../scatter/text_defaults');\nvar handleFillColorDefaults = _dereq_('../scatter/fillcolor_defaults');\nvar PTS_LINESONLY = _dereq_('../scatter/constants').PTS_LINESONLY;\n\nvar attributes = _dereq_('./attributes');\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 = handleRThetaDefaults(traceIn, traceOut, layout, coerce);\n if(!len) {\n traceOut.visible = false;\n return;\n }\n\n coerce('thetaunit');\n coerce('mode', len < PTS_LINESONLY ? 'lines+markers' : 'lines');\n coerce('text');\n coerce('hovertext');\n if(traceOut.hoveron !== 'fills') coerce('hovertemplate');\n\n if(subTypes.hasLines(traceOut)) {\n handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce);\n handleLineShapeDefaults(traceIn, traceOut, coerce);\n coerce('connectgaps');\n }\n\n if(subTypes.hasMarkers(traceOut)) {\n handleMarkerDefaults(traceIn, traceOut, defaultColor, layout, coerce, {gradient: true});\n }\n\n if(subTypes.hasText(traceOut)) {\n coerce('texttemplate');\n handleTextDefaults(traceIn, traceOut, layout, coerce);\n }\n\n var dfltHoverOn = [];\n\n if(subTypes.hasMarkers(traceOut) || subTypes.hasText(traceOut)) {\n coerce('cliponaxis');\n coerce('marker.maxdisplayed');\n dfltHoverOn.push('points');\n }\n\n coerce('fill');\n\n if(traceOut.fill !== 'none') {\n handleFillColorDefaults(traceIn, traceOut, defaultColor, coerce);\n if(!subTypes.hasLines(traceOut)) handleLineShapeDefaults(traceIn, traceOut, coerce);\n }\n\n if(traceOut.fill === 'tonext' || traceOut.fill === 'toself') {\n dfltHoverOn.push('fills');\n }\n coerce('hoveron', dfltHoverOn.join('+') || 'points');\n\n Lib.coerceSelectionMarkerOpacity(traceOut, coerce);\n}\n\nfunction handleRThetaDefaults(traceIn, traceOut, layout, coerce) {\n var r = coerce('r');\n var theta = coerce('theta');\n var len;\n\n if(r) {\n if(theta) {\n len = Math.min(r.length, theta.length);\n } else {\n len = r.length;\n coerce('theta0');\n coerce('dtheta');\n }\n } else {\n if(!theta) return 0;\n len = traceOut.theta.length;\n coerce('r0');\n coerce('dr');\n }\n\n traceOut._length = len;\n return len;\n}\n\nmodule.exports = {\n handleRThetaDefaults: handleRThetaDefaults,\n supplyDefaults: supplyDefaults\n};\n\n},{\"../../lib\":728,\"../scatter/constants\":1138,\"../scatter/fillcolor_defaults\":1142,\"../scatter/line_defaults\":1147,\"../scatter/line_shape_defaults\":1149,\"../scatter/marker_defaults\":1153,\"../scatter/subtypes\":1158,\"../scatter/text_defaults\":1159,\"./attributes\":1207}],1210:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Axes = _dereq_('../../plots/cartesian/axes');\n\nmodule.exports = function formatLabels(cdi, trace, fullLayout) {\n var labels = {};\n\n var subplot = fullLayout[trace.subplot]._subplot;\n var radialAxis;\n var angularAxis;\n\n // for scatterpolargl texttemplate, _subplot is NOT defined, this takes part during the convert step\n // TODO we should consider moving the texttemplate formatting logic to the plot step\n if(!subplot) {\n subplot = fullLayout[trace.subplot];\n radialAxis = subplot.radialaxis;\n angularAxis = subplot.angularaxis;\n } else {\n radialAxis = subplot.radialAxis;\n angularAxis = subplot.angularAxis;\n }\n\n var rVal = radialAxis.c2l(cdi.r);\n labels.rLabel = Axes.tickText(radialAxis, rVal, true).text;\n\n // N.B here the ° sign is part of the formatted value for thetaunit:'degrees'\n var thetaVal = angularAxis.thetaunit === 'degrees' ? Lib.rad2deg(cdi.theta) : cdi.theta;\n labels.thetaLabel = Axes.tickText(angularAxis, thetaVal, true).text;\n\n return labels;\n};\n\n},{\"../../lib\":728,\"../../plots/cartesian/axes\":776}],1211:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar scatterHover = _dereq_('../scatter/hover');\n\nfunction hoverPoints(pointData, xval, yval, hovermode) {\n var scatterPointData = scatterHover(pointData, xval, yval, hovermode);\n if(!scatterPointData || scatterPointData[0].index === false) return;\n\n var newPointData = scatterPointData[0];\n\n // hovering on fill case\n if(newPointData.index === undefined) {\n return scatterPointData;\n }\n\n var subplot = pointData.subplot;\n var cdi = newPointData.cd[newPointData.index];\n var trace = newPointData.trace;\n\n if(!subplot.isPtInside(cdi)) return;\n\n newPointData.xLabelVal = undefined;\n newPointData.yLabelVal = undefined;\n makeHoverPointText(cdi, trace, subplot, newPointData);\n newPointData.hovertemplate = trace.hovertemplate;\n return scatterPointData;\n}\n\nfunction makeHoverPointText(cdi, trace, subplot, pointData) {\n var radialAxis = subplot.radialAxis;\n var angularAxis = subplot.angularAxis;\n radialAxis._hovertitle = 'r';\n angularAxis._hovertitle = 'θ';\n\n var fullLayout = {};\n fullLayout[trace.subplot] = {_subplot: subplot};\n var labels = trace._module.formatLabels(cdi, trace, fullLayout);\n pointData.rLabel = labels.rLabel;\n pointData.thetaLabel = labels.thetaLabel;\n\n var hoverinfo = cdi.hi || trace.hoverinfo;\n var text = [];\n function textPart(ax, val) {\n text.push(ax._hovertitle + ': ' + val);\n }\n\n if(!trace.hovertemplate) {\n var parts = hoverinfo.split('+');\n\n if(parts.indexOf('all') !== -1) parts = ['r', 'theta', 'text'];\n if(parts.indexOf('r') !== -1) textPart(radialAxis, pointData.rLabel);\n if(parts.indexOf('theta') !== -1) textPart(angularAxis, pointData.thetaLabel);\n\n if(parts.indexOf('text') !== -1 && pointData.text) {\n text.push(pointData.text);\n delete pointData.text;\n }\n\n pointData.extraText = text.join('
');\n }\n}\n\nmodule.exports = {\n hoverPoints: hoverPoints,\n makeHoverPointText: makeHoverPointText\n};\n\n},{\"../scatter/hover\":1145}],1212:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n moduleType: 'trace',\n name: 'scatterpolar',\n basePlotModule: _dereq_('../../plots/polar'),\n categories: ['polar', 'symbols', 'showLegend', 'scatter-like'],\n\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults').supplyDefaults,\n colorbar: _dereq_('../scatter/marker_colorbar'),\n formatLabels: _dereq_('./format_labels'),\n calc: _dereq_('./calc'),\n plot: _dereq_('./plot'),\n style: _dereq_('../scatter/style').style,\n styleOnSelect: _dereq_('../scatter/style').styleOnSelect,\n hoverPoints: _dereq_('./hover').hoverPoints,\n selectPoints: _dereq_('../scatter/select'),\n\n meta: {\n \n \n }\n};\n\n},{\"../../plots/polar\":842,\"../scatter/marker_colorbar\":1152,\"../scatter/select\":1155,\"../scatter/style\":1157,\"./attributes\":1207,\"./calc\":1208,\"./defaults\":1209,\"./format_labels\":1210,\"./hover\":1211,\"./plot\":1213}],1213:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar scatterPlot = _dereq_('../scatter/plot');\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\n\nmodule.exports = function plot(gd, subplot, moduleCalcData) {\n var mlayer = subplot.layers.frontplot.select('g.scatterlayer');\n\n var plotinfo = {\n xaxis: subplot.xaxis,\n yaxis: subplot.yaxis,\n plot: subplot.framework,\n layerClipId: subplot._hasClipOnAxisFalse ? subplot.clipIds.forTraces : null\n };\n\n var radialAxis = subplot.radialAxis;\n var angularAxis = subplot.angularAxis;\n\n // convert:\n // 'c' (r,theta) -> 'geometric' (r,theta) -> (x,y)\n for(var i = 0; i < moduleCalcData.length; i++) {\n var cdi = moduleCalcData[i];\n\n for(var j = 0; j < cdi.length; j++) {\n var cd = cdi[j];\n var r = cd.r;\n\n if(r === BADNUM) {\n cd.x = cd.y = BADNUM;\n } else {\n var rg = radialAxis.c2g(r);\n var thetag = angularAxis.c2g(cd.theta);\n cd.x = rg * Math.cos(thetag);\n cd.y = rg * Math.sin(thetag);\n }\n }\n }\n\n scatterPlot(gd, plotinfo, moduleCalcData, mlayer);\n};\n\n},{\"../../constants/numerical\":704,\"../scatter/plot\":1154}],1214:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar scatterPolarAttrs = _dereq_('../scatterpolar/attributes');\nvar scatterGlAttrs = _dereq_('../scattergl/attributes');\nvar texttemplateAttrs = _dereq_('../../plots/template_attributes').texttemplateAttrs;\n\nmodule.exports = {\n mode: scatterPolarAttrs.mode,\n r: scatterPolarAttrs.r,\n theta: scatterPolarAttrs.theta,\n r0: scatterPolarAttrs.r0,\n dr: scatterPolarAttrs.dr,\n theta0: scatterPolarAttrs.theta0,\n dtheta: scatterPolarAttrs.dtheta,\n thetaunit: scatterPolarAttrs.thetaunit,\n\n text: scatterPolarAttrs.text,\n texttemplate: texttemplateAttrs({editType: 'plot'}, {\n keys: ['r', 'theta', 'text']\n }),\n hovertext: scatterPolarAttrs.hovertext,\n hovertemplate: scatterPolarAttrs.hovertemplate,\n\n line: scatterGlAttrs.line,\n connectgaps: scatterGlAttrs.connectgaps,\n\n marker: scatterGlAttrs.marker,\n // no cliponaxis\n\n fill: scatterGlAttrs.fill,\n fillcolor: scatterGlAttrs.fillcolor,\n\n textposition: scatterGlAttrs.textposition,\n textfont: scatterGlAttrs.textfont,\n\n hoverinfo: scatterPolarAttrs.hoverinfo,\n // no hoveron\n\n selected: scatterPolarAttrs.selected,\n unselected: scatterPolarAttrs.unselected\n};\n\n},{\"../../plots/template_attributes\":854,\"../scattergl/attributes\":1185,\"../scatterpolar/attributes\":1207}],1215:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar calcColorscale = _dereq_('../scatter/colorscale_calc');\nvar calcMarkerSize = _dereq_('../scatter/calc').calcMarkerSize;\nvar convert = _dereq_('../scattergl/convert');\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar TOO_MANY_POINTS = _dereq_('../scattergl/constants').TOO_MANY_POINTS;\n\nmodule.exports = function calc(gd, trace) {\n var fullLayout = gd._fullLayout;\n var subplotId = trace.subplot;\n var radialAxis = fullLayout[subplotId].radialaxis;\n var angularAxis = fullLayout[subplotId].angularaxis;\n var rArray = trace._r = radialAxis.makeCalcdata(trace, 'r');\n var thetaArray = trace._theta = angularAxis.makeCalcdata(trace, 'theta');\n var len = trace._length;\n var stash = {};\n\n if(len < rArray.length) rArray = rArray.slice(0, len);\n if(len < thetaArray.length) thetaArray = thetaArray.slice(0, len);\n\n stash.r = rArray;\n stash.theta = thetaArray;\n\n calcColorscale(gd, trace);\n\n // only compute 'style' options in calc, as position options\n // depend on the radial range and must be set in plot\n var opts = stash.opts = convert.style(gd, trace);\n\n // For graphs with very large number of points and array marker.size,\n // use average marker size instead to speed things up.\n var ppad;\n if(len < TOO_MANY_POINTS) {\n ppad = calcMarkerSize(trace, len);\n } else if(opts.marker) {\n ppad = 2 * (opts.marker.sizeAvg || Math.max(opts.marker.size, 3));\n }\n trace._extremes.x = Axes.findExtremes(radialAxis, rArray, {ppad: ppad});\n\n return [{x: false, y: false, t: stash, trace: trace}];\n};\n\n},{\"../../plots/cartesian/axes\":776,\"../scatter/calc\":1135,\"../scatter/colorscale_calc\":1137,\"../scattergl/constants\":1187,\"../scattergl/convert\":1188}],1216:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nvar subTypes = _dereq_('../scatter/subtypes');\nvar handleRThetaDefaults = _dereq_('../scatterpolar/defaults').handleRThetaDefaults;\nvar handleMarkerDefaults = _dereq_('../scatter/marker_defaults');\nvar handleLineDefaults = _dereq_('../scatter/line_defaults');\nvar handleTextDefaults = _dereq_('../scatter/text_defaults');\nvar handleFillColorDefaults = _dereq_('../scatter/fillcolor_defaults');\nvar PTS_LINESONLY = _dereq_('../scatter/constants').PTS_LINESONLY;\n\nvar attributes = _dereq_('./attributes');\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 len = handleRThetaDefaults(traceIn, traceOut, layout, coerce);\n if(!len) {\n traceOut.visible = false;\n return;\n }\n\n coerce('thetaunit');\n coerce('mode', len < PTS_LINESONLY ? 'lines+markers' : 'lines');\n coerce('text');\n coerce('hovertext');\n if(traceOut.hoveron !== 'fills') coerce('hovertemplate');\n\n if(subTypes.hasLines(traceOut)) {\n handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce);\n coerce('connectgaps');\n }\n\n if(subTypes.hasMarkers(traceOut)) {\n handleMarkerDefaults(traceIn, traceOut, defaultColor, layout, coerce);\n }\n\n if(subTypes.hasText(traceOut)) {\n coerce('texttemplate');\n handleTextDefaults(traceIn, traceOut, layout, coerce);\n }\n\n coerce('fill');\n if(traceOut.fill !== 'none') {\n handleFillColorDefaults(traceIn, traceOut, defaultColor, coerce);\n }\n\n Lib.coerceSelectionMarkerOpacity(traceOut, coerce);\n};\n\n},{\"../../lib\":728,\"../scatter/constants\":1138,\"../scatter/fillcolor_defaults\":1142,\"../scatter/line_defaults\":1147,\"../scatter/marker_defaults\":1153,\"../scatter/subtypes\":1158,\"../scatter/text_defaults\":1159,\"../scatterpolar/defaults\":1209,\"./attributes\":1214}],1217:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar scatterPolarFormatLabels = _dereq_('../scatterpolar/format_labels');\n\nmodule.exports = function formatLabels(cdi, trace, fullLayout) {\n var i = cdi.i;\n if(!('r' in cdi)) cdi.r = trace._r[i];\n if(!('theta' in cdi)) cdi.theta = trace._theta[i];\n return scatterPolarFormatLabels(cdi, trace, fullLayout);\n};\n\n},{\"../scatterpolar/format_labels\":1210}],1218:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar hover = _dereq_('../scattergl/hover');\nvar makeHoverPointText = _dereq_('../scatterpolar/hover').makeHoverPointText;\n\nfunction hoverPoints(pointData, xval, yval, hovermode) {\n var cd = pointData.cd;\n var stash = cd[0].t;\n var rArray = stash.r;\n var thetaArray = stash.theta;\n\n var scatterPointData = hover.hoverPoints(pointData, xval, yval, hovermode);\n if(!scatterPointData || scatterPointData[0].index === false) return;\n\n var newPointData = scatterPointData[0];\n\n if(newPointData.index === undefined) {\n return scatterPointData;\n }\n\n var subplot = pointData.subplot;\n var cdi = newPointData.cd[newPointData.index];\n var trace = newPointData.trace;\n\n // augment pointData with r/theta param\n cdi.r = rArray[newPointData.index];\n cdi.theta = thetaArray[newPointData.index];\n\n if(!subplot.isPtInside(cdi)) return;\n\n newPointData.xLabelVal = undefined;\n newPointData.yLabelVal = undefined;\n makeHoverPointText(cdi, trace, subplot, newPointData);\n\n return scatterPointData;\n}\n\nmodule.exports = {\n hoverPoints: hoverPoints\n};\n\n},{\"../scattergl/hover\":1193,\"../scatterpolar/hover\":1211}],1219:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n moduleType: 'trace',\n name: 'scatterpolargl',\n basePlotModule: _dereq_('../../plots/polar'),\n categories: ['gl', 'regl', 'polar', 'symbols', 'showLegend', 'scatter-like'],\n\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults'),\n colorbar: _dereq_('../scatter/marker_colorbar'),\n formatLabels: _dereq_('./format_labels'),\n\n calc: _dereq_('./calc'),\n plot: _dereq_('./plot'),\n hoverPoints: _dereq_('./hover').hoverPoints,\n selectPoints: _dereq_('../scattergl/select'),\n\n meta: {\n \n \n }\n};\n\n},{\"../../plots/polar\":842,\"../scatter/marker_colorbar\":1152,\"../scattergl/select\":1197,\"./attributes\":1214,\"./calc\":1215,\"./defaults\":1216,\"./format_labels\":1217,\"./hover\":1218,\"./plot\":1220}],1220:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar cluster = _dereq_('point-cluster');\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar scatterglPlot = _dereq_('../scattergl/plot');\nvar sceneUpdate = _dereq_('../scattergl/scene_update');\nvar convert = _dereq_('../scattergl/convert');\n\nvar Lib = _dereq_('../../lib');\n\nvar TOO_MANY_POINTS = _dereq_('../scattergl/constants').TOO_MANY_POINTS;\n\nmodule.exports = function plot(gd, subplot, cdata) {\n if(!cdata.length) return;\n\n var radialAxis = subplot.radialAxis;\n var angularAxis = subplot.angularAxis;\n var scene = sceneUpdate(gd, subplot);\n\n cdata.forEach(function(cdscatter) {\n if(!cdscatter || !cdscatter[0] || !cdscatter[0].trace) return;\n var cd = cdscatter[0];\n var trace = cd.trace;\n var stash = cd.t;\n var len = trace._length;\n var rArray = stash.r;\n var thetaArray = stash.theta;\n var opts = stash.opts;\n var i;\n\n var subRArray = rArray.slice();\n var subThetaArray = thetaArray.slice();\n\n // filter out by range\n for(i = 0; i < rArray.length; i++) {\n if(!subplot.isPtInside({r: rArray[i], theta: thetaArray[i]})) {\n subRArray[i] = NaN;\n subThetaArray[i] = NaN;\n }\n }\n\n var positions = new Array(len * 2);\n var x = Array(len);\n var y = Array(len);\n\n for(i = 0; i < len; i++) {\n var r = subRArray[i];\n var xx, yy;\n\n if(isNumeric(r)) {\n var rg = radialAxis.c2g(r);\n var thetag = angularAxis.c2g(subThetaArray[i], trace.thetaunit);\n xx = rg * Math.cos(thetag);\n yy = rg * Math.sin(thetag);\n } else {\n xx = yy = NaN;\n }\n x[i] = positions[i * 2] = xx;\n y[i] = positions[i * 2 + 1] = yy;\n }\n\n stash.tree = cluster(positions);\n\n // FIXME: see scattergl.js#109\n if(opts.marker && len >= TOO_MANY_POINTS) {\n opts.marker.cluster = stash.tree;\n }\n\n if(opts.marker) {\n opts.markerSel.positions = opts.markerUnsel.positions = opts.marker.positions = positions;\n }\n\n if(opts.line && positions.length > 1) {\n Lib.extendFlat(\n opts.line,\n convert.linePositions(gd, trace, positions)\n );\n }\n\n if(opts.text) {\n Lib.extendFlat(\n opts.text,\n {positions: positions},\n convert.textPosition(gd, trace, opts.text, opts.marker)\n );\n Lib.extendFlat(\n opts.textSel,\n {positions: positions},\n convert.textPosition(gd, trace, opts.text, opts.markerSel)\n );\n Lib.extendFlat(\n opts.textUnsel,\n {positions: positions},\n convert.textPosition(gd, trace, opts.text, opts.markerUnsel)\n );\n }\n\n if(opts.fill && !scene.fill2d) scene.fill2d = true;\n if(opts.marker && !scene.scatter2d) scene.scatter2d = true;\n if(opts.line && !scene.line2d) scene.line2d = true;\n if(opts.text && !scene.glText) scene.glText = true;\n\n scene.lineOptions.push(opts.line);\n scene.fillOptions.push(opts.fill);\n scene.markerOptions.push(opts.marker);\n scene.markerSelectedOptions.push(opts.markerSel);\n scene.markerUnselectedOptions.push(opts.markerUnsel);\n scene.textOptions.push(opts.text);\n scene.textSelectedOptions.push(opts.textSel);\n scene.textUnselectedOptions.push(opts.textUnsel);\n scene.selectBatch.push([]);\n scene.unselectBatch.push([]);\n\n stash.x = x;\n stash.y = y;\n stash.rawx = x;\n stash.rawy = y;\n stash.r = rArray;\n stash.theta = thetaArray;\n stash.positions = positions;\n stash._scene = scene;\n stash.index = scene.count;\n scene.count++;\n });\n\n return scatterglPlot(gd, subplot, cdata);\n};\n\n},{\"../../lib\":728,\"../scattergl/constants\":1187,\"../scattergl/convert\":1188,\"../scattergl/plot\":1195,\"../scattergl/scene_update\":1196,\"fast-isnumeric\":236,\"point-cluster\":467}],1221:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar texttemplateAttrs = _dereq_('../../plots/template_attributes').texttemplateAttrs;\nvar scatterAttrs = _dereq_('../scatter/attributes');\nvar baseAttrs = _dereq_('../../plots/attributes');\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\nvar dash = _dereq_('../../components/drawing/attributes').dash;\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nvar scatterMarkerAttrs = scatterAttrs.marker;\nvar scatterLineAttrs = scatterAttrs.line;\nvar scatterMarkerLineAttrs = scatterMarkerAttrs.line;\n\nmodule.exports = {\n a: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n b: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n c: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n sum: {\n valType: 'number',\n \n dflt: 0,\n min: 0,\n editType: 'calc',\n \n },\n mode: extendFlat({}, scatterAttrs.mode, {dflt: 'markers'}),\n text: extendFlat({}, scatterAttrs.text, {\n \n }),\n texttemplate: texttemplateAttrs({editType: 'plot'}, {\n keys: ['a', 'b', 'c', 'text']\n }),\n hovertext: extendFlat({}, scatterAttrs.hovertext, {\n \n }),\n line: {\n color: scatterLineAttrs.color,\n width: scatterLineAttrs.width,\n dash: dash,\n shape: extendFlat({}, scatterLineAttrs.shape,\n {values: ['linear', 'spline']}),\n smoothing: scatterLineAttrs.smoothing,\n editType: 'calc'\n },\n connectgaps: scatterAttrs.connectgaps,\n cliponaxis: scatterAttrs.cliponaxis,\n fill: extendFlat({}, scatterAttrs.fill, {\n values: ['none', 'toself', 'tonext'],\n dflt: 'none',\n \n }),\n fillcolor: scatterAttrs.fillcolor,\n marker: extendFlat({\n symbol: scatterMarkerAttrs.symbol,\n opacity: scatterMarkerAttrs.opacity,\n maxdisplayed: scatterMarkerAttrs.maxdisplayed,\n size: scatterMarkerAttrs.size,\n sizeref: scatterMarkerAttrs.sizeref,\n sizemin: scatterMarkerAttrs.sizemin,\n sizemode: scatterMarkerAttrs.sizemode,\n line: extendFlat({\n width: scatterMarkerLineAttrs.width,\n editType: 'calc'\n },\n colorScaleAttrs('marker.line')\n ),\n gradient: scatterMarkerAttrs.gradient,\n editType: 'calc'\n },\n colorScaleAttrs('marker')\n ),\n\n textfont: scatterAttrs.textfont,\n textposition: scatterAttrs.textposition,\n\n selected: scatterAttrs.selected,\n unselected: scatterAttrs.unselected,\n\n hoverinfo: extendFlat({}, baseAttrs.hoverinfo, {\n flags: ['a', 'b', 'c', 'text', 'name']\n }),\n hoveron: scatterAttrs.hoveron,\n hovertemplate: hovertemplateAttrs(),\n};\n\n},{\"../../components/colorscale/attributes\":602,\"../../components/drawing/attributes\":616,\"../../lib/extend\":719,\"../../plots/attributes\":773,\"../../plots/template_attributes\":854,\"../scatter/attributes\":1134}],1222:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar calcColorscale = _dereq_('../scatter/colorscale_calc');\nvar arraysToCalcdata = _dereq_('../scatter/arrays_to_calcdata');\nvar calcSelection = _dereq_('../scatter/calc_selection');\nvar calcMarkerSize = _dereq_('../scatter/calc').calcMarkerSize;\n\nvar dataArrays = ['a', 'b', 'c'];\nvar arraysToFill = {a: ['b', 'c'], b: ['a', 'c'], c: ['a', 'b']};\n\nmodule.exports = function calc(gd, trace) {\n var ternary = gd._fullLayout[trace.subplot];\n var displaySum = ternary.sum;\n var normSum = trace.sum || displaySum;\n var arrays = {a: trace.a, b: trace.b, c: trace.c};\n\n var i, j, dataArray, newArray, fillArray1, fillArray2;\n\n // fill in one missing component\n for(i = 0; i < dataArrays.length; i++) {\n dataArray = dataArrays[i];\n if(arrays[dataArray]) continue;\n\n fillArray1 = arrays[arraysToFill[dataArray][0]];\n fillArray2 = arrays[arraysToFill[dataArray][1]];\n newArray = new Array(fillArray1.length);\n for(j = 0; j < fillArray1.length; j++) {\n newArray[j] = normSum - fillArray1[j] - fillArray2[j];\n }\n arrays[dataArray] = newArray;\n }\n\n // make the calcdata array\n var serieslen = trace._length;\n var cd = new Array(serieslen);\n var a, b, c, norm, x, y;\n for(i = 0; i < serieslen; i++) {\n a = arrays.a[i];\n b = arrays.b[i];\n c = arrays.c[i];\n if(isNumeric(a) && isNumeric(b) && isNumeric(c)) {\n a = +a;\n b = +b;\n c = +c;\n norm = displaySum / (a + b + c);\n if(norm !== 1) {\n a *= norm;\n b *= norm;\n c *= norm;\n }\n // map a, b, c onto x and y where the full scale of y\n // is [0, sum], and x is [-sum, sum]\n // TODO: this makes `a` always the top, `b` the bottom left,\n // and `c` the bottom right. Do we want options to rearrange\n // these?\n y = a;\n x = c - b;\n cd[i] = {x: x, y: y, a: a, b: b, c: c};\n } else cd[i] = {x: false, y: false};\n }\n\n calcMarkerSize(trace, serieslen);\n calcColorscale(gd, trace);\n arraysToCalcdata(cd, trace);\n calcSelection(cd, trace);\n\n return cd;\n};\n\n},{\"../scatter/arrays_to_calcdata\":1133,\"../scatter/calc\":1135,\"../scatter/calc_selection\":1136,\"../scatter/colorscale_calc\":1137,\"fast-isnumeric\":236}],1223:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nvar constants = _dereq_('../scatter/constants');\nvar subTypes = _dereq_('../scatter/subtypes');\nvar handleMarkerDefaults = _dereq_('../scatter/marker_defaults');\nvar handleLineDefaults = _dereq_('../scatter/line_defaults');\nvar handleLineShapeDefaults = _dereq_('../scatter/line_shape_defaults');\nvar handleTextDefaults = _dereq_('../scatter/text_defaults');\nvar handleFillColorDefaults = _dereq_('../scatter/fillcolor_defaults');\n\nvar attributes = _dereq_('./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 a = coerce('a');\n var b = coerce('b');\n var c = coerce('c');\n var len;\n\n // allow any one array to be missing, len is the minimum length of those\n // present. Note that after coerce data_array's are either Arrays (which\n // are truthy even if empty) or undefined. As in scatter, an empty array\n // is different from undefined, because it can signify that this data is\n // not known yet but expected in the future\n if(a) {\n len = a.length;\n if(b) {\n len = Math.min(len, b.length);\n if(c) len = Math.min(len, c.length);\n } else if(c) len = Math.min(len, c.length);\n else len = 0;\n } else if(b && c) {\n len = Math.min(b.length, c.length);\n }\n\n if(!len) {\n traceOut.visible = false;\n return;\n }\n\n traceOut._length = len;\n\n coerce('sum');\n\n coerce('text');\n coerce('hovertext');\n if(traceOut.hoveron !== 'fills') coerce('hovertemplate');\n\n var defaultMode = len < constants.PTS_LINESONLY ? 'lines+markers' : 'lines';\n coerce('mode', defaultMode);\n\n if(subTypes.hasLines(traceOut)) {\n handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce);\n handleLineShapeDefaults(traceIn, traceOut, coerce);\n coerce('connectgaps');\n }\n\n if(subTypes.hasMarkers(traceOut)) {\n handleMarkerDefaults(traceIn, traceOut, defaultColor, layout, coerce, {gradient: true});\n }\n\n if(subTypes.hasText(traceOut)) {\n coerce('texttemplate');\n handleTextDefaults(traceIn, traceOut, layout, coerce);\n }\n\n var dfltHoverOn = [];\n\n if(subTypes.hasMarkers(traceOut) || subTypes.hasText(traceOut)) {\n coerce('cliponaxis');\n coerce('marker.maxdisplayed');\n dfltHoverOn.push('points');\n }\n\n coerce('fill');\n if(traceOut.fill !== 'none') {\n handleFillColorDefaults(traceIn, traceOut, defaultColor, coerce);\n if(!subTypes.hasLines(traceOut)) handleLineShapeDefaults(traceIn, traceOut, coerce);\n }\n\n if(traceOut.fill === 'tonext' || traceOut.fill === 'toself') {\n dfltHoverOn.push('fills');\n }\n coerce('hoveron', dfltHoverOn.join('+') || 'points');\n\n Lib.coerceSelectionMarkerOpacity(traceOut, coerce);\n};\n\n},{\"../../lib\":728,\"../scatter/constants\":1138,\"../scatter/fillcolor_defaults\":1142,\"../scatter/line_defaults\":1147,\"../scatter/line_shape_defaults\":1149,\"../scatter/marker_defaults\":1153,\"../scatter/subtypes\":1158,\"../scatter/text_defaults\":1159,\"./attributes\":1221}],1224:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = function eventData(out, pt, trace, cd, pointNumber) {\n if(pt.xa) out.xaxis = pt.xa;\n if(pt.ya) out.yaxis = pt.ya;\n\n if(cd[pointNumber]) {\n var cdi = cd[pointNumber];\n\n // N.B. These are the normalized coordinates.\n out.a = cdi.a;\n out.b = cdi.b;\n out.c = cdi.c;\n } else {\n // for fill-hover only\n out.a = pt.a;\n out.b = pt.b;\n out.c = pt.c;\n }\n\n return out;\n};\n\n},{}],1225:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Axes = _dereq_('../../plots/cartesian/axes');\n\nmodule.exports = function formatLabels(cdi, trace, fullLayout) {\n var labels = {};\n\n var subplot = fullLayout[trace.subplot]._subplot;\n labels.aLabel = Axes.tickText(subplot.aaxis, cdi.a, true).text;\n labels.bLabel = Axes.tickText(subplot.baxis, cdi.b, true).text;\n labels.cLabel = Axes.tickText(subplot.caxis, cdi.c, true).text;\n\n return labels;\n};\n\n},{\"../../plots/cartesian/axes\":776}],1226:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar scatterHover = _dereq_('../scatter/hover');\n\nmodule.exports = function hoverPoints(pointData, xval, yval, hovermode) {\n var scatterPointData = scatterHover(pointData, xval, yval, hovermode);\n if(!scatterPointData || scatterPointData[0].index === false) return;\n\n var newPointData = scatterPointData[0];\n\n // if hovering on a fill, we don't show any point data so the label is\n // unchanged from what scatter gives us - except that it needs to\n // be constrained to the trianglular plot area, not just the rectangular\n // area defined by the synthetic x and y axes\n // TODO: in some cases the vertical middle of the shape is not within\n // the triangular viewport at all, so the label can become disconnected\n // from the shape entirely. But calculating what portion of the shape\n // is actually visible, as constrained by the diagonal axis lines, is not\n // so easy and anyway we lost the information we would have needed to do\n // this inside scatterHover.\n if(newPointData.index === undefined) {\n var yFracUp = 1 - (newPointData.y0 / pointData.ya._length);\n var xLen = pointData.xa._length;\n var xMin = xLen * yFracUp / 2;\n var xMax = xLen - xMin;\n newPointData.x0 = Math.max(Math.min(newPointData.x0, xMax), xMin);\n newPointData.x1 = Math.max(Math.min(newPointData.x1, xMax), xMin);\n return scatterPointData;\n }\n\n var cdi = newPointData.cd[newPointData.index];\n var trace = newPointData.trace;\n var subplot = newPointData.subplot;\n\n newPointData.a = cdi.a;\n newPointData.b = cdi.b;\n newPointData.c = cdi.c;\n\n newPointData.xLabelVal = undefined;\n newPointData.yLabelVal = undefined;\n\n var fullLayout = {};\n fullLayout[trace.subplot] = {_subplot: subplot};\n var labels = trace._module.formatLabels(cdi, trace, fullLayout);\n newPointData.aLabel = labels.aLabel;\n newPointData.bLabel = labels.bLabel;\n newPointData.cLabel = labels.cLabel;\n\n var hoverinfo = cdi.hi || trace.hoverinfo;\n var text = [];\n function textPart(ax, val) {\n text.push(ax._hovertitle + ': ' + val);\n }\n if(!trace.hovertemplate) {\n var parts = hoverinfo.split('+');\n if(parts.indexOf('all') !== -1) parts = ['a', 'b', 'c'];\n if(parts.indexOf('a') !== -1) textPart(subplot.aaxis, newPointData.aLabel);\n if(parts.indexOf('b') !== -1) textPart(subplot.baxis, newPointData.bLabel);\n if(parts.indexOf('c') !== -1) textPart(subplot.caxis, newPointData.cLabel);\n }\n newPointData.extraText = text.join('
');\n newPointData.hovertemplate = trace.hovertemplate;\n return scatterPointData;\n};\n\n},{\"../scatter/hover\":1145}],1227:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults'),\n colorbar: _dereq_('../scatter/marker_colorbar'),\n formatLabels: _dereq_('./format_labels'),\n calc: _dereq_('./calc'),\n plot: _dereq_('./plot'),\n style: _dereq_('../scatter/style').style,\n styleOnSelect: _dereq_('../scatter/style').styleOnSelect,\n hoverPoints: _dereq_('./hover'),\n selectPoints: _dereq_('../scatter/select'),\n eventData: _dereq_('./event_data'),\n\n moduleType: 'trace',\n name: 'scatterternary',\n basePlotModule: _dereq_('../../plots/ternary'),\n categories: ['ternary', 'symbols', 'showLegend', 'scatter-like'],\n meta: {\n \n \n }\n};\n\n},{\"../../plots/ternary\":855,\"../scatter/marker_colorbar\":1152,\"../scatter/select\":1155,\"../scatter/style\":1157,\"./attributes\":1221,\"./calc\":1222,\"./defaults\":1223,\"./event_data\":1224,\"./format_labels\":1225,\"./hover\":1226,\"./plot\":1228}],1228:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar scatterPlot = _dereq_('../scatter/plot');\n\nmodule.exports = function plot(gd, ternary, moduleCalcData) {\n var plotContainer = ternary.plotContainer;\n\n // remove all nodes inside the scatter layer\n plotContainer.select('.scatterlayer').selectAll('*').remove();\n\n // mimic cartesian plotinfo\n var plotinfo = {\n xaxis: ternary.xaxis,\n yaxis: ternary.yaxis,\n plot: plotContainer,\n layerClipId: ternary._hasClipOnAxisFalse ? ternary.clipIdRelative : null\n };\n\n var scatterLayer = ternary.layers.frontplot.select('g.scatterlayer');\n\n scatterPlot(gd, plotinfo, moduleCalcData, scatterLayer);\n};\n\n},{\"../scatter/plot\":1154}],1229:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar scatterAttrs = _dereq_('../scatter/attributes');\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar scatterGlAttrs = _dereq_('../scattergl/attributes');\nvar cartesianIdRegex = _dereq_('../../plots/cartesian/constants').idRegex;\nvar templatedArray = _dereq_('../../plot_api/plot_template').templatedArray;\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nvar scatterMarkerAttrs = scatterAttrs.marker;\nvar scatterMarkerLineAttrs = scatterMarkerAttrs.line;\n\nvar markerLineAttrs = extendFlat(colorScaleAttrs('marker.line', {editTypeOverride: 'calc'}), {\n width: extendFlat({}, scatterMarkerLineAttrs.width, {editType: 'calc'}),\n editType: 'calc'\n});\n\nvar markerAttrs = extendFlat(colorScaleAttrs('marker'), {\n symbol: scatterMarkerAttrs.symbol,\n size: extendFlat({}, scatterMarkerAttrs.size, {editType: 'markerSize'}),\n sizeref: scatterMarkerAttrs.sizeref,\n sizemin: scatterMarkerAttrs.sizemin,\n sizemode: scatterMarkerAttrs.sizemode,\n opacity: scatterMarkerAttrs.opacity,\n colorbar: scatterMarkerAttrs.colorbar,\n line: markerLineAttrs,\n editType: 'calc'\n});\n\nmarkerAttrs.color.editType = markerAttrs.cmin.editType = markerAttrs.cmax.editType = 'style';\n\nfunction makeAxesValObject(axLetter) {\n return {\n valType: 'info_array',\n freeLength: true,\n \n editType: 'calc',\n items: {\n valType: 'subplotid',\n regex: cartesianIdRegex[axLetter],\n editType: 'plot'\n },\n \n };\n}\n\nmodule.exports = {\n dimensions: templatedArray('dimension', {\n visible: {\n valType: 'boolean',\n \n dflt: true,\n editType: 'calc',\n \n },\n label: {\n valType: 'string',\n \n editType: 'calc',\n \n },\n values: {\n valType: 'data_array',\n \n editType: 'calc+clearAxisTypes',\n \n },\n\n axis: {\n type: {\n valType: 'enumerated',\n values: ['linear', 'log', 'date', 'category'],\n \n editType: 'calc+clearAxisTypes',\n \n },\n\n // TODO make 'true' the default in v2?\n matches: {\n valType: 'boolean',\n dflt: false,\n \n editType: 'calc',\n \n },\n\n editType: 'calc+clearAxisTypes'\n },\n\n // TODO should add an attribute to pin down x only vars and y only vars\n // like https://seaborn.pydata.org/generated/seaborn.pairplot.html\n // x_vars and y_vars\n\n // maybe more axis defaulting option e.g. `showgrid: false`\n\n editType: 'calc+clearAxisTypes'\n }),\n\n // mode: {}, (only 'markers' for now)\n\n text: extendFlat({}, scatterGlAttrs.text, {\n \n }),\n hovertext: extendFlat({}, scatterGlAttrs.hovertext, {\n \n }),\n\n hovertemplate: hovertemplateAttrs(),\n\n marker: markerAttrs,\n\n xaxes: makeAxesValObject('x'),\n yaxes: makeAxesValObject('y'),\n\n diagonal: {\n visible: {\n valType: 'boolean',\n \n dflt: true,\n editType: 'calc',\n \n },\n\n // type: 'scattergl' | 'histogram' | 'box' | 'violin'\n // ...\n // more options\n\n editType: 'calc'\n },\n\n showupperhalf: {\n valType: 'boolean',\n \n dflt: true,\n editType: 'calc',\n \n },\n showlowerhalf: {\n valType: 'boolean',\n \n dflt: true,\n editType: 'calc',\n \n },\n\n selected: {\n marker: scatterGlAttrs.selected.marker,\n editType: 'calc'\n },\n unselected: {\n marker: scatterGlAttrs.unselected.marker,\n editType: 'calc'\n },\n\n opacity: scatterGlAttrs.opacity\n};\n\n},{\"../../components/colorscale/attributes\":602,\"../../lib/extend\":719,\"../../plot_api/plot_template\":766,\"../../plots/cartesian/constants\":782,\"../../plots/template_attributes\":854,\"../scatter/attributes\":1134,\"../scattergl/attributes\":1185}],1230:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar createLine = _dereq_('regl-line2d');\n\nvar Registry = _dereq_('../../registry');\nvar prepareRegl = _dereq_('../../lib/prepare_regl');\nvar getModuleCalcData = _dereq_('../../plots/get_data').getModuleCalcData;\nvar Cartesian = _dereq_('../../plots/cartesian');\nvar getFromId = _dereq_('../../plots/cartesian/axis_ids').getFromId;\nvar shouldShowZeroLine = _dereq_('../../plots/cartesian/axes').shouldShowZeroLine;\n\nvar SPLOM = 'splom';\n\nfunction plot(gd) {\n var fullLayout = gd._fullLayout;\n var _module = Registry.getModule(SPLOM);\n var splomCalcData = getModuleCalcData(gd.calcdata, _module)[0];\n\n var success = prepareRegl(gd, ['ANGLE_instanced_arrays', 'OES_element_index_uint']);\n if(!success) return;\n\n if(fullLayout._hasOnlyLargeSploms) {\n updateGrid(gd);\n }\n\n _module.plot(gd, {}, splomCalcData);\n}\n\nfunction drag(gd) {\n var cd = gd.calcdata;\n var fullLayout = gd._fullLayout;\n\n if(fullLayout._hasOnlyLargeSploms) {\n updateGrid(gd);\n }\n\n for(var i = 0; i < cd.length; i++) {\n var cd0 = cd[i][0];\n var trace = cd0.trace;\n var scene = fullLayout._splomScenes[trace.uid];\n\n if(trace.type === 'splom' && scene && scene.matrix) {\n dragOne(gd, trace, scene);\n }\n }\n}\n\nfunction dragOne(gd, trace, scene) {\n var visibleLength = scene.matrixOptions.data.length;\n var visibleDims = trace._visibleDims;\n var ranges = scene.viewOpts.ranges = new Array(visibleLength);\n\n for(var k = 0; k < visibleDims.length; k++) {\n var i = visibleDims[k];\n var rng = ranges[k] = new Array(4);\n\n var xa = getFromId(gd, trace._diag[i][0]);\n if(xa) {\n rng[0] = xa.r2l(xa.range[0]);\n rng[2] = xa.r2l(xa.range[1]);\n }\n\n var ya = getFromId(gd, trace._diag[i][1]);\n if(ya) {\n rng[1] = ya.r2l(ya.range[0]);\n rng[3] = ya.r2l(ya.range[1]);\n }\n }\n\n if(scene.selectBatch.length || scene.unselectBatch.length) {\n scene.matrix.update({ranges: ranges}, {ranges: ranges});\n } else {\n scene.matrix.update({ranges: ranges});\n }\n}\n\nfunction updateGrid(gd) {\n var fullLayout = gd._fullLayout;\n var regl = fullLayout._glcanvas.data()[0].regl;\n var splomGrid = fullLayout._splomGrid;\n\n if(!splomGrid) {\n splomGrid = fullLayout._splomGrid = createLine(regl);\n }\n splomGrid.update(makeGridData(gd));\n}\n\nfunction makeGridData(gd) {\n var fullLayout = gd._fullLayout;\n var gs = fullLayout._size;\n var fullView = [0, 0, fullLayout.width, fullLayout.height];\n var lookup = {};\n var k;\n\n function push(prefix, ax, x0, x1, y0, y1) {\n var lcolor = ax[prefix + 'color'];\n var lwidth = ax[prefix + 'width'];\n var key = String(lcolor + lwidth);\n\n if(key in lookup) {\n lookup[key].data.push(NaN, NaN, x0, x1, y0, y1);\n } else {\n lookup[key] = {\n data: [x0, x1, y0, y1],\n join: 'rect',\n thickness: lwidth,\n color: lcolor,\n viewport: fullView,\n range: fullView,\n overlay: false\n };\n }\n }\n\n for(k in fullLayout._splomSubplots) {\n var sp = fullLayout._plots[k];\n var xa = sp.xaxis;\n var ya = sp.yaxis;\n var xVals = xa._gridVals;\n var yVals = ya._gridVals;\n // ya.l2p assumes top-to-bottom coordinate system (a la SVG),\n // we need to compute bottom-to-top offsets and slopes:\n var yOffset = gs.b + ya.domain[0] * gs.h;\n var ym = -ya._m;\n var yb = -ym * ya.r2l(ya.range[0], ya.calendar);\n var x, y;\n\n if(xa.showgrid) {\n for(k = 0; k < xVals.length; k++) {\n x = xa._offset + xa.l2p(xVals[k].x);\n push('grid', xa, x, yOffset, x, yOffset + ya._length);\n }\n }\n if(ya.showgrid) {\n for(k = 0; k < yVals.length; k++) {\n y = yOffset + yb + ym * yVals[k].x;\n push('grid', ya, xa._offset, y, xa._offset + xa._length, y);\n }\n }\n if(shouldShowZeroLine(gd, xa, ya)) {\n x = xa._offset + xa.l2p(0);\n push('zeroline', xa, x, yOffset, x, yOffset + ya._length);\n }\n if(shouldShowZeroLine(gd, ya, xa)) {\n y = yOffset + yb + 0;\n push('zeroline', ya, xa._offset, y, xa._offset + xa._length, y);\n }\n }\n\n var gridBatches = [];\n for(k in lookup) {\n gridBatches.push(lookup[k]);\n }\n\n return gridBatches;\n}\n\nfunction clean(newFullData, newFullLayout, oldFullData, oldFullLayout) {\n var lookup = {};\n var i;\n\n if(oldFullLayout._splomScenes) {\n for(i = 0; i < newFullData.length; i++) {\n var newTrace = newFullData[i];\n if(newTrace.type === 'splom') {\n lookup[newTrace.uid] = 1;\n }\n }\n for(i = 0; i < oldFullData.length; i++) {\n var oldTrace = oldFullData[i];\n if(!lookup[oldTrace.uid]) {\n var scene = oldFullLayout._splomScenes[oldTrace.uid];\n if(scene && scene.destroy) scene.destroy();\n // must first set scene to null in order to get garbage collected\n oldFullLayout._splomScenes[oldTrace.uid] = null;\n delete oldFullLayout._splomScenes[oldTrace.uid];\n }\n }\n }\n\n if(Object.keys(oldFullLayout._splomScenes || {}).length === 0) {\n delete oldFullLayout._splomScenes;\n }\n\n if(oldFullLayout._splomGrid &&\n (!newFullLayout._hasOnlyLargeSploms && oldFullLayout._hasOnlyLargeSploms)) {\n // must first set scene to null in order to get garbage collected\n oldFullLayout._splomGrid.destroy();\n oldFullLayout._splomGrid = null;\n delete oldFullLayout._splomGrid;\n }\n\n Cartesian.clean(newFullData, newFullLayout, oldFullData, oldFullLayout);\n}\n\nmodule.exports = {\n name: SPLOM,\n attr: Cartesian.attr,\n attrRegex: Cartesian.attrRegex,\n layoutAttributes: Cartesian.layoutAttributes,\n supplyLayoutDefaults: Cartesian.supplyLayoutDefaults,\n drawFramework: Cartesian.drawFramework,\n plot: plot,\n drag: drag,\n updateGrid: updateGrid,\n clean: clean,\n updateFx: Cartesian.updateFx,\n toSVG: Cartesian.toSVG\n};\n\n},{\"../../lib/prepare_regl\":741,\"../../plots/cartesian\":789,\"../../plots/cartesian/axes\":776,\"../../plots/cartesian/axis_ids\":779,\"../../plots/get_data\":813,\"../../registry\":859,\"regl-line2d\":489}],1231:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar AxisIDs = _dereq_('../../plots/cartesian/axis_ids');\n\nvar calcMarkerSize = _dereq_('../scatter/calc').calcMarkerSize;\nvar calcAxisExpansion = _dereq_('../scatter/calc').calcAxisExpansion;\nvar calcColorscale = _dereq_('../scatter/colorscale_calc');\nvar convertMarkerSelection = _dereq_('../scattergl/convert').markerSelection;\nvar convertMarkerStyle = _dereq_('../scattergl/convert').markerStyle;\nvar sceneUpdate = _dereq_('./scene_update');\n\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\nvar TOO_MANY_POINTS = _dereq_('../scattergl/constants').TOO_MANY_POINTS;\n\nmodule.exports = function calc(gd, trace) {\n var dimensions = trace.dimensions;\n var commonLength = trace._length;\n var opts = {};\n // 'c' for calculated, 'l' for linear,\n // only differ here for log axes, pass ldata to createMatrix as 'data'\n var cdata = opts.cdata = [];\n var ldata = opts.data = [];\n // keep track of visible dimensions\n var visibleDims = trace._visibleDims = [];\n var i, k, dim, xa, ya;\n\n function makeCalcdata(ax, dim) {\n // call makeCalcdata with fake input\n var ccol = ax.makeCalcdata({\n v: dim.values,\n vcalendar: trace.calendar\n }, 'v');\n\n for(var j = 0; j < ccol.length; j++) {\n ccol[j] = ccol[j] === BADNUM ? NaN : ccol[j];\n }\n cdata.push(ccol);\n ldata.push(ax.type === 'log' ? Lib.simpleMap(ccol, ax.c2l) : ccol);\n }\n\n for(i = 0; i < dimensions.length; i++) {\n dim = dimensions[i];\n\n if(dim.visible) {\n xa = AxisIDs.getFromId(gd, trace._diag[i][0]);\n ya = AxisIDs.getFromId(gd, trace._diag[i][1]);\n\n // if corresponding x & y axes don't have matching types, skip dim\n if(xa && ya && xa.type !== ya.type) {\n Lib.log('Skipping splom dimension ' + i + ' with conflicting axis types');\n continue;\n }\n\n if(xa) {\n makeCalcdata(xa, dim);\n if(ya && ya.type === 'category') {\n ya._categories = xa._categories.slice();\n }\n } else {\n // should not make it here, if both xa and ya undefined\n makeCalcdata(ya, dim);\n }\n\n visibleDims.push(i);\n }\n }\n\n calcColorscale(gd, trace);\n Lib.extendFlat(opts, convertMarkerStyle(trace));\n\n var visibleLength = cdata.length;\n var hasTooManyPoints = (visibleLength * commonLength) > TOO_MANY_POINTS;\n\n // Reuse SVG scatter axis expansion routine.\n // For graphs with very large number of points and array marker.size,\n // use average marker size instead to speed things up.\n var ppad;\n if(hasTooManyPoints) {\n ppad = 2 * (opts.sizeAvg || Math.max(opts.size, 3));\n } else {\n ppad = calcMarkerSize(trace, commonLength);\n }\n\n for(k = 0; k < visibleDims.length; k++) {\n i = visibleDims[k];\n dim = dimensions[i];\n xa = AxisIDs.getFromId(gd, trace._diag[i][0]) || {};\n ya = AxisIDs.getFromId(gd, trace._diag[i][1]) || {};\n calcAxisExpansion(gd, trace, xa, ya, cdata[k], cdata[k], ppad);\n }\n\n var scene = sceneUpdate(gd, trace);\n if(!scene.matrix) scene.matrix = true;\n scene.matrixOptions = opts;\n\n scene.selectedOptions = convertMarkerSelection(trace, trace.selected);\n scene.unselectedOptions = convertMarkerSelection(trace, trace.unselected);\n\n return [{x: false, y: false, t: {}, trace: trace}];\n};\n\n},{\"../../constants/numerical\":704,\"../../lib\":728,\"../../plots/cartesian/axis_ids\":779,\"../scatter/calc\":1135,\"../scatter/colorscale_calc\":1137,\"../scattergl/constants\":1187,\"../scattergl/convert\":1188,\"./scene_update\":1238}],1232:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar handleArrayContainerDefaults = _dereq_('../../plots/array_container_defaults');\n\nvar attributes = _dereq_('./attributes');\nvar subTypes = _dereq_('../scatter/subtypes');\nvar handleMarkerDefaults = _dereq_('../scatter/marker_defaults');\nvar mergeLength = _dereq_('../parcoords/merge_length');\nvar isOpenSymbol = _dereq_('../scattergl/helpers').isOpenSymbol;\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 dimensions = handleArrayContainerDefaults(traceIn, traceOut, {\n name: 'dimensions',\n handleItemDefaults: dimensionDefaults\n });\n\n var showDiag = coerce('diagonal.visible');\n var showUpper = coerce('showupperhalf');\n var showLower = coerce('showlowerhalf');\n\n var dimLength = mergeLength(traceOut, dimensions, 'values');\n\n if(!dimLength || (!showDiag && !showUpper && !showLower)) {\n traceOut.visible = false;\n return;\n }\n\n coerce('text');\n coerce('hovertext');\n coerce('hovertemplate');\n\n handleMarkerDefaults(traceIn, traceOut, defaultColor, layout, coerce);\n\n var isOpen = isOpenSymbol(traceOut.marker.symbol);\n var isBubble = subTypes.isBubble(traceOut);\n coerce('marker.line.width', isOpen || isBubble ? 1 : 0);\n\n handleAxisDefaults(traceIn, traceOut, layout, coerce);\n\n Lib.coerceSelectionMarkerOpacity(traceOut, coerce);\n};\n\nfunction dimensionDefaults(dimIn, dimOut) {\n function coerce(attr, dflt) {\n return Lib.coerce(dimIn, dimOut, attributes.dimensions, attr, dflt);\n }\n\n coerce('label');\n var values = coerce('values');\n\n if(!(values && values.length)) dimOut.visible = false;\n else coerce('visible');\n\n coerce('axis.type');\n coerce('axis.matches');\n}\n\nfunction handleAxisDefaults(traceIn, traceOut, layout, coerce) {\n var dimensions = traceOut.dimensions;\n var dimLength = dimensions.length;\n var showUpper = traceOut.showupperhalf;\n var showLower = traceOut.showlowerhalf;\n var showDiag = traceOut.diagonal.visible;\n var i, j;\n\n var xAxesDflt = new Array(dimLength);\n var yAxesDflt = new Array(dimLength);\n\n for(i = 0; i < dimLength; i++) {\n var suffix = i ? i + 1 : '';\n xAxesDflt[i] = 'x' + suffix;\n yAxesDflt[i] = 'y' + suffix;\n }\n\n var xaxes = coerce('xaxes', xAxesDflt);\n var yaxes = coerce('yaxes', yAxesDflt);\n\n // build list of [x,y] axis corresponding to each dimensions[i],\n // very useful for passing options to regl-splom\n var diag = traceOut._diag = new Array(dimLength);\n\n // lookup for 'drawn' x|y axes, to avoid costly indexOf downstream\n traceOut._xaxes = {};\n traceOut._yaxes = {};\n\n // list of 'drawn' x|y axes, use to generate list of subplots\n var xList = [];\n var yList = [];\n\n function fillAxisStashes(axId, counterAxId, dim, list) {\n if(!axId) return;\n\n var axLetter = axId.charAt(0);\n var stash = layout._splomAxes[axLetter];\n\n traceOut['_' + axLetter + 'axes'][axId] = 1;\n list.push(axId);\n\n if(!(axId in stash)) {\n var s = stash[axId] = {};\n if(dim) {\n s.label = dim.label || '';\n if(dim.visible && dim.axis) {\n if(dim.axis.type) s.type = dim.axis.type;\n if(dim.axis.matches) s.matches = counterAxId;\n }\n }\n }\n }\n\n // cases where showDiag and showLower or showUpper are false\n // no special treatment as the 'drawn' x-axes and y-axes no longer match\n // the dimensions items and xaxes|yaxes 1-to-1\n var mustShiftX = !showDiag && !showLower;\n var mustShiftY = !showDiag && !showUpper;\n\n traceOut._axesDim = {};\n for(i = 0; i < dimLength; i++) {\n var dim = dimensions[i];\n var i0 = i === 0;\n var iN = i === dimLength - 1;\n\n var xaId = (i0 && mustShiftX) || (iN && mustShiftY) ?\n undefined :\n xaxes[i];\n\n var yaId = (i0 && mustShiftY) || (iN && mustShiftX) ?\n undefined :\n yaxes[i];\n\n fillAxisStashes(xaId, yaId, dim, xList);\n fillAxisStashes(yaId, xaId, dim, yList);\n diag[i] = [xaId, yaId];\n traceOut._axesDim[xaId] = i;\n traceOut._axesDim[yaId] = i;\n }\n\n // fill in splom subplot keys\n for(i = 0; i < xList.length; i++) {\n for(j = 0; j < yList.length; j++) {\n var id = xList[i] + yList[j];\n\n if(i > j && showUpper) {\n layout._splomSubplots[id] = 1;\n } else if(i < j && showLower) {\n layout._splomSubplots[id] = 1;\n } else if(i === j && (showDiag || !showLower || !showUpper)) {\n // need to include diagonal subplots when\n // hiding one half and the diagonal\n layout._splomSubplots[id] = 1;\n }\n }\n }\n\n // when lower half is omitted, or when just the diagonal is gone,\n // override grid default to make sure axes remain on\n // the left/bottom of the plot area\n if(!showLower || (!showDiag && showUpper && showLower)) {\n layout._splomGridDflt.xside = 'bottom';\n layout._splomGridDflt.yside = 'left';\n }\n}\n\n},{\"../../lib\":728,\"../../plots/array_container_defaults\":772,\"../parcoords/merge_length\":1105,\"../scatter/marker_defaults\":1153,\"../scatter/subtypes\":1158,\"../scattergl/helpers\":1192,\"./attributes\":1229}],1233:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar calcColorscale = _dereq_('../scatter/colorscale_calc');\nvar convertMarkerStyle = _dereq_('../scattergl/convert').markerStyle;\n\nmodule.exports = function editStyle(gd, cd0) {\n var trace = cd0.trace;\n var scene = gd._fullLayout._splomScenes[trace.uid];\n\n if(scene) {\n calcColorscale(gd, trace);\n\n Lib.extendFlat(scene.matrixOptions, convertMarkerStyle(trace));\n // TODO [un]selected styles?\n\n var opts = Lib.extendFlat({}, scene.matrixOptions, scene.viewOpts);\n\n // TODO this is too long for arrayOk attributes!\n scene.matrix.update(opts, null);\n }\n};\n\n},{\"../../lib\":728,\"../scatter/colorscale_calc\":1137,\"../scattergl/convert\":1188}],1234:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nexports.getDimIndex = function getDimIndex(trace, ax) {\n var axId = ax._id;\n var axLetter = axId.charAt(0);\n var ind = {x: 0, y: 1}[axLetter];\n var visibleDims = trace._visibleDims;\n\n for(var k = 0; k < visibleDims.length; k++) {\n var i = visibleDims[k];\n if(trace._diag[i][ind] === axId) return k;\n }\n return false;\n};\n\n},{}],1235:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar helpers = _dereq_('./helpers');\nvar calcHover = _dereq_('../scattergl/hover').calcHover;\n\nfunction hoverPoints(pointData, xval, yval) {\n var cd = pointData.cd;\n var trace = cd[0].trace;\n var scene = pointData.scene;\n var cdata = scene.matrixOptions.cdata;\n var xa = pointData.xa;\n var ya = pointData.ya;\n var xpx = xa.c2p(xval);\n var ypx = ya.c2p(yval);\n var maxDistance = pointData.distance;\n\n var xi = helpers.getDimIndex(trace, xa);\n var yi = helpers.getDimIndex(trace, ya);\n if(xi === false || yi === false) return [pointData];\n\n var x = cdata[xi];\n var y = cdata[yi];\n\n var id, dxy;\n var minDist = maxDistance;\n\n for(var i = 0; i < x.length; i++) {\n var ptx = x[i];\n var pty = y[i];\n var dx = xa.c2p(ptx) - xpx;\n var dy = ya.c2p(pty) - ypx;\n var dist = Math.sqrt(dx * dx + dy * dy);\n\n if(dist < minDist) {\n minDist = dxy = dist;\n id = i;\n }\n }\n\n pointData.index = id;\n pointData.distance = minDist;\n pointData.dxy = dxy;\n\n if(id === undefined) return [pointData];\n\n return [calcHover(pointData, x, y, trace)];\n}\n\nmodule.exports = {\n hoverPoints: hoverPoints\n};\n\n},{\"../scattergl/hover\":1193,\"./helpers\":1234}],1236:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../../registry');\nvar Grid = _dereq_('../../components/grid');\n\nmodule.exports = {\n moduleType: 'trace',\n name: 'splom',\n\n basePlotModule: _dereq_('./base_plot'),\n categories: ['gl', 'regl', 'cartesian', 'symbols', 'showLegend', 'scatter-like'],\n\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults'),\n colorbar: _dereq_('../scatter/marker_colorbar'),\n\n calc: _dereq_('./calc'),\n plot: _dereq_('./plot'),\n hoverPoints: _dereq_('./hover').hoverPoints,\n selectPoints: _dereq_('./select'),\n editStyle: _dereq_('./edit_style'),\n\n meta: {\n \n }\n};\n\n// splom traces use the 'grid' component to generate their axes,\n// register it here\nRegistry.register(Grid);\n\n},{\"../../components/grid\":639,\"../../registry\":859,\"../scatter/marker_colorbar\":1152,\"./attributes\":1229,\"./base_plot\":1230,\"./calc\":1231,\"./defaults\":1232,\"./edit_style\":1233,\"./hover\":1235,\"./plot\":1237,\"./select\":1239}],1237:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar createMatrix = _dereq_('regl-splom');\n\nvar Lib = _dereq_('../../lib');\nvar AxisIDs = _dereq_('../../plots/cartesian/axis_ids');\nvar selectMode = _dereq_('../../components/dragelement/helpers').selectMode;\n\nmodule.exports = function plot(gd, _, splomCalcData) {\n if(!splomCalcData.length) return;\n\n for(var i = 0; i < splomCalcData.length; i++) {\n plotOne(gd, splomCalcData[i][0]);\n }\n};\n\nfunction plotOne(gd, cd0) {\n var fullLayout = gd._fullLayout;\n var gs = fullLayout._size;\n var trace = cd0.trace;\n var stash = cd0.t;\n var scene = fullLayout._splomScenes[trace.uid];\n var matrixOpts = scene.matrixOptions;\n var cdata = matrixOpts.cdata;\n var regl = fullLayout._glcanvas.data()[0].regl;\n var dragmode = fullLayout.dragmode;\n var xa, ya;\n var i, j, k;\n\n if(cdata.length === 0) return;\n\n // augment options with proper upper/lower halves\n // regl-splom's default grid starts from bottom-left\n matrixOpts.lower = trace.showupperhalf;\n matrixOpts.upper = trace.showlowerhalf;\n matrixOpts.diagonal = trace.diagonal.visible;\n\n var visibleDims = trace._visibleDims;\n var visibleLength = cdata.length;\n var viewOpts = scene.viewOpts = {};\n viewOpts.ranges = new Array(visibleLength);\n viewOpts.domains = new Array(visibleLength);\n\n for(k = 0; k < visibleDims.length; k++) {\n i = visibleDims[k];\n\n var rng = viewOpts.ranges[k] = new Array(4);\n var dmn = viewOpts.domains[k] = new Array(4);\n\n xa = AxisIDs.getFromId(gd, trace._diag[i][0]);\n if(xa) {\n rng[0] = xa._rl[0];\n rng[2] = xa._rl[1];\n dmn[0] = xa.domain[0];\n dmn[2] = xa.domain[1];\n }\n\n ya = AxisIDs.getFromId(gd, trace._diag[i][1]);\n if(ya) {\n rng[1] = ya._rl[0];\n rng[3] = ya._rl[1];\n dmn[1] = ya.domain[0];\n dmn[3] = ya.domain[1];\n }\n }\n\n viewOpts.viewport = [gs.l, gs.b, gs.w + gs.l, gs.h + gs.b];\n\n if(scene.matrix === true) {\n scene.matrix = createMatrix(regl);\n }\n\n var clickSelectEnabled = fullLayout.clickmode.indexOf('select') > -1;\n var isSelectMode = selectMode(dragmode) ||\n !!trace.selectedpoints || clickSelectEnabled;\n var needsBaseUpdate = true;\n\n if(isSelectMode) {\n var commonLength = trace._length;\n\n // regenerate scene batch, if traces number changed during selection\n if(trace.selectedpoints) {\n scene.selectBatch = trace.selectedpoints;\n\n var selPts = trace.selectedpoints;\n var selDict = {};\n for(i = 0; i < selPts.length; i++) {\n selDict[selPts[i]] = true;\n }\n var unselPts = [];\n for(i = 0; i < commonLength; i++) {\n if(!selDict[i]) unselPts.push(i);\n }\n scene.unselectBatch = unselPts;\n }\n\n // precalculate px coords since we are not going to pan during select\n var xpx = stash.xpx = new Array(visibleLength);\n var ypx = stash.ypx = new Array(visibleLength);\n\n for(k = 0; k < visibleDims.length; k++) {\n i = visibleDims[k];\n\n xa = AxisIDs.getFromId(gd, trace._diag[i][0]);\n if(xa) {\n xpx[k] = new Array(commonLength);\n for(j = 0; j < commonLength; j++) {\n xpx[k][j] = xa.c2p(cdata[k][j]);\n }\n }\n\n ya = AxisIDs.getFromId(gd, trace._diag[i][1]);\n if(ya) {\n ypx[k] = new Array(commonLength);\n for(j = 0; j < commonLength; j++) {\n ypx[k][j] = ya.c2p(cdata[k][j]);\n }\n }\n }\n\n if(scene.selectBatch.length || scene.unselectBatch.length) {\n var unselOpts = Lib.extendFlat({}, matrixOpts, scene.unselectedOptions, viewOpts);\n var selOpts = Lib.extendFlat({}, matrixOpts, scene.selectedOptions, viewOpts);\n scene.matrix.update(unselOpts, selOpts);\n needsBaseUpdate = false;\n }\n } else {\n stash.xpx = stash.ypx = null;\n }\n\n if(needsBaseUpdate) {\n var opts = Lib.extendFlat({}, matrixOpts, viewOpts);\n scene.matrix.update(opts, null);\n }\n}\n\n},{\"../../components/dragelement/helpers\":613,\"../../lib\":728,\"../../plots/cartesian/axis_ids\":779,\"regl-splom\":491}],1238:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nmodule.exports = function sceneUpdate(gd, trace) {\n var fullLayout = gd._fullLayout;\n var uid = trace.uid;\n\n // must place ref to 'scene' in fullLayout, so that:\n // - it can be relinked properly on updates\n // - it can be destroyed properly when needed\n var splomScenes = fullLayout._splomScenes;\n if(!splomScenes) splomScenes = fullLayout._splomScenes = {};\n\n var reset = {\n dirty: true,\n selectBatch: [],\n unselectBatch: []\n };\n\n var first = {\n matrix: false,\n selectBatch: [],\n unselectBatch: []\n };\n\n var scene = splomScenes[trace.uid];\n\n if(!scene) {\n scene = splomScenes[uid] = Lib.extendFlat({}, reset, first);\n\n scene.draw = function draw() {\n if(scene.matrix && scene.matrix.draw) {\n if(scene.selectBatch.length || scene.unselectBatch.length) {\n scene.matrix.draw(scene.unselectBatch, scene.selectBatch);\n } else {\n scene.matrix.draw();\n }\n }\n\n scene.dirty = false;\n };\n\n // remove scene resources\n scene.destroy = function destroy() {\n if(scene.matrix && scene.matrix.destroy) {\n scene.matrix.destroy();\n }\n scene.matrixOptions = null;\n scene.selectBatch = null;\n scene.unselectBatch = null;\n scene = null;\n };\n }\n\n // In case if we have scene from the last calc - reset data\n if(!scene.dirty) {\n Lib.extendFlat(scene, reset);\n }\n\n return scene;\n};\n\n},{\"../../lib\":728}],1239:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar subTypes = _dereq_('../scatter/subtypes');\nvar helpers = _dereq_('./helpers');\n\nmodule.exports = function select(searchInfo, selectionTester) {\n var cd = searchInfo.cd;\n var trace = cd[0].trace;\n var stash = cd[0].t;\n var scene = searchInfo.scene;\n var cdata = scene.matrixOptions.cdata;\n var xa = searchInfo.xaxis;\n var ya = searchInfo.yaxis;\n var selection = [];\n\n if(!scene) return selection;\n\n var hasOnlyLines = (!subTypes.hasMarkers(trace) && !subTypes.hasText(trace));\n if(trace.visible !== true || hasOnlyLines) return selection;\n\n var xi = helpers.getDimIndex(trace, xa);\n var yi = helpers.getDimIndex(trace, ya);\n if(xi === false || yi === false) return selection;\n\n var xpx = stash.xpx[xi];\n var ypx = stash.ypx[yi];\n var x = cdata[xi];\n var y = cdata[yi];\n var els = [];\n var unels = [];\n\n // degenerate polygon does not enable selection\n // filter out points by visible scatter ones\n if(selectionTester !== false && !selectionTester.degenerate) {\n for(var i = 0; i < x.length; i++) {\n if(selectionTester.contains([xpx[i], ypx[i]], null, i, searchInfo)) {\n els.push(i);\n selection.push({\n pointNumber: i,\n x: x[i],\n y: y[i]\n });\n } else {\n unels.push(i);\n }\n }\n }\n\n var matrixOpts = scene.matrixOptions;\n\n if(!els.length && !unels.length) {\n scene.matrix.update(matrixOpts, null);\n } else if(!scene.selectBatch.length && !scene.unselectBatch.length) {\n scene.matrix.update(\n scene.unselectedOptions,\n Lib.extendFlat({}, matrixOpts, scene.selectedOptions, scene.viewOpts)\n );\n }\n\n scene.selectBatch = els;\n scene.unselectBatch = unels;\n\n return selection;\n};\n\n},{\"../../lib\":728,\"../scatter/subtypes\":1158,\"./helpers\":1234}],1240:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar mesh3dAttrs = _dereq_('../mesh3d/attributes');\nvar baseAttrs = _dereq_('../../plots/attributes');\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nvar attrs = {\n x: {\n valType: 'data_array',\n \n editType: 'calc+clearAxisTypes',\n \n },\n y: {\n valType: 'data_array',\n \n editType: 'calc+clearAxisTypes',\n \n },\n z: {\n valType: 'data_array',\n \n editType: 'calc+clearAxisTypes',\n \n },\n\n u: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n v: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n w: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n\n starts: {\n x: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n y: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n z: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n editType: 'calc'\n },\n\n maxdisplayed: {\n valType: 'integer',\n min: 0,\n dflt: 1000,\n \n editType: 'calc',\n \n },\n\n // TODO\n //\n // Should add 'absolute' (like cone traces have), but currently gl-streamtube3d's\n // `absoluteTubeSize` doesn't behave well enough for our needs.\n //\n // 'fixed' would be a nice addition to plot stream 'lines', see\n // https://github.com/plotly/plotly.js/commit/812be20750e21e0a1831975001c248d365850f73#r29129877\n //\n // sizemode: {\n // valType: 'enumerated',\n // values: ['scaled', 'absolute', 'fixed'],\n // dflt: 'scaled',\n // \n // editType: 'calc',\n // \n // },\n\n sizeref: {\n valType: 'number',\n \n editType: 'calc',\n min: 0,\n dflt: 1,\n \n },\n\n text: {\n valType: 'string',\n \n dflt: '',\n editType: 'calc',\n \n },\n hovertext: {\n valType: 'string',\n \n dflt: '',\n editType: 'calc',\n \n },\n hovertemplate: hovertemplateAttrs({editType: 'calc'}, {\n keys: [\n 'tubex', 'tubey', 'tubez',\n 'tubeu', 'tubev', 'tubew',\n 'norm', 'divergence'\n ]\n }),\n showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})\n};\n\nextendFlat(attrs, colorScaleAttrs('', {\n colorAttr: 'u/v/w norm',\n showScaleDflt: true,\n editTypeOverride: 'calc'\n}));\n\nvar fromMesh3d = ['opacity', 'lightposition', 'lighting'];\nfromMesh3d.forEach(function(k) {\n attrs[k] = mesh3dAttrs[k];\n});\n\nattrs.hoverinfo = extendFlat({}, baseAttrs.hoverinfo, {\n editType: 'calc',\n flags: ['x', 'y', 'z', 'u', 'v', 'w', 'norm', 'divergence', 'text', 'name'],\n dflt: 'x+y+z+norm+text+name'\n});\n\nattrs.transforms = undefined;\n\nmodule.exports = attrs;\n\n},{\"../../components/colorscale/attributes\":602,\"../../lib/extend\":719,\"../../plots/attributes\":773,\"../../plots/template_attributes\":854,\"../mesh3d/attributes\":1075}],1241:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar colorscaleCalc = _dereq_('../../components/colorscale/calc');\n\nfunction calc(gd, trace) {\n trace._len = Math.min(\n trace.u.length,\n trace.v.length,\n trace.w.length,\n trace.x.length,\n trace.y.length,\n trace.z.length\n );\n\n trace._u = filter(trace.u, trace._len);\n trace._v = filter(trace.v, trace._len);\n trace._w = filter(trace.w, trace._len);\n trace._x = filter(trace.x, trace._len);\n trace._y = filter(trace.y, trace._len);\n trace._z = filter(trace.z, trace._len);\n\n var grid = processGrid(trace);\n trace._gridFill = grid.fill;\n trace._Xs = grid.Xs;\n trace._Ys = grid.Ys;\n trace._Zs = grid.Zs;\n trace._len = grid.len;\n\n var slen = 0;\n var startx, starty, startz;\n if(trace.starts) {\n startx = filter(trace.starts.x || []);\n starty = filter(trace.starts.y || []);\n startz = filter(trace.starts.z || []);\n slen = Math.min(startx.length, starty.length, startz.length);\n }\n trace._startsX = startx || [];\n trace._startsY = starty || [];\n trace._startsZ = startz || [];\n\n var normMax = 0;\n var normMin = Infinity;\n var i;\n for(i = 0; i < trace._len; i++) {\n var u = trace._u[i];\n var v = trace._v[i];\n var w = trace._w[i];\n var norm = Math.sqrt(u * u + v * v + w * w);\n\n normMax = Math.max(normMax, norm);\n normMin = Math.min(normMin, norm);\n }\n\n colorscaleCalc(gd, trace, {\n vals: [normMin, normMax],\n containerStr: '',\n cLetter: 'c'\n });\n\n for(i = 0; i < slen; i++) {\n var sx = startx[i];\n grid.xMax = Math.max(grid.xMax, sx);\n grid.xMin = Math.min(grid.xMin, sx);\n\n var sy = starty[i];\n grid.yMax = Math.max(grid.yMax, sy);\n grid.yMin = Math.min(grid.yMin, sy);\n\n var sz = startz[i];\n grid.zMax = Math.max(grid.zMax, sz);\n grid.zMin = Math.min(grid.zMin, sz);\n }\n\n trace._slen = slen;\n trace._normMax = normMax;\n trace._xbnds = [grid.xMin, grid.xMax];\n trace._ybnds = [grid.yMin, grid.yMax];\n trace._zbnds = [grid.zMin, grid.zMax];\n}\n\nfunction processGrid(trace) {\n var x = trace._x;\n var y = trace._y;\n var z = trace._z;\n var len = trace._len;\n\n var i, j, k;\n\n var xMax = -Infinity;\n var xMin = Infinity;\n var yMax = -Infinity;\n var yMin = Infinity;\n var zMax = -Infinity;\n var zMin = Infinity;\n\n var gridFill = '';\n var filledX;\n var filledY;\n var filledZ;\n var firstX, lastX;\n var firstY, lastY;\n var firstZ, lastZ;\n if(len) {\n firstX = x[0];\n firstY = y[0];\n firstZ = z[0];\n }\n if(len > 1) {\n lastX = x[len - 1];\n lastY = y[len - 1];\n lastZ = z[len - 1];\n }\n\n for(i = 0; i < len; i++) {\n xMax = Math.max(xMax, x[i]);\n xMin = Math.min(xMin, x[i]);\n\n yMax = Math.max(yMax, y[i]);\n yMin = Math.min(yMin, y[i]);\n\n zMax = Math.max(zMax, z[i]);\n zMin = Math.min(zMin, z[i]);\n\n if(!filledX && x[i] !== firstX) {\n filledX = true;\n gridFill += 'x';\n }\n if(!filledY && y[i] !== firstY) {\n filledY = true;\n gridFill += 'y';\n }\n if(!filledZ && z[i] !== firstZ) {\n filledZ = true;\n gridFill += 'z';\n }\n }\n // fill if not filled - case of having dimension(s) with one item\n if(!filledX) gridFill += 'x';\n if(!filledY) gridFill += 'y';\n if(!filledZ) gridFill += 'z';\n\n var Xs = distinctVals(trace._x);\n var Ys = distinctVals(trace._y);\n var Zs = distinctVals(trace._z);\n\n gridFill = gridFill.replace('x', (firstX > lastX ? '-' : '+') + 'x');\n gridFill = gridFill.replace('y', (firstY > lastY ? '-' : '+') + 'y');\n gridFill = gridFill.replace('z', (firstZ > lastZ ? '-' : '+') + 'z');\n\n var empty = function() {\n len = 0;\n Xs = [];\n Ys = [];\n Zs = [];\n };\n\n // Over-specified mesh case, this would error in tube2mesh\n if(!len || len < Xs.length * Ys.length * Zs.length) empty();\n\n var getArray = function(c) { return c === 'x' ? x : c === 'y' ? y : z; };\n var getVals = function(c) { return c === 'x' ? Xs : c === 'y' ? Ys : Zs; };\n var getDir = function(c) { return c[len - 1] < c[0] ? -1 : 1; };\n\n var arrK = getArray(gridFill[1]);\n var arrJ = getArray(gridFill[3]);\n var arrI = getArray(gridFill[5]);\n var nk = getVals(gridFill[1]).length;\n var nj = getVals(gridFill[3]).length;\n var ni = getVals(gridFill[5]).length;\n\n var arbitrary = false;\n\n var getIndex = function(_i, _j, _k) {\n return nk * (nj * _i + _j) + _k;\n };\n\n var dirK = getDir(getArray(gridFill[1]));\n var dirJ = getDir(getArray(gridFill[3]));\n var dirI = getDir(getArray(gridFill[5]));\n\n for(i = 0; i < ni - 1; i++) {\n for(j = 0; j < nj - 1; j++) {\n for(k = 0; k < nk - 1; k++) {\n var q000 = getIndex(i, j, k);\n var q001 = getIndex(i, j, k + 1);\n var q010 = getIndex(i, j + 1, k);\n var q100 = getIndex(i + 1, j, k);\n\n if(\n !(arrK[q000] * dirK < arrK[q001] * dirK) ||\n !(arrJ[q000] * dirJ < arrJ[q010] * dirJ) ||\n !(arrI[q000] * dirI < arrI[q100] * dirI)\n ) {\n arbitrary = true;\n }\n\n if(arbitrary) break;\n }\n if(arbitrary) break;\n }\n if(arbitrary) break;\n }\n\n if(arbitrary) {\n Lib.warn('Encountered arbitrary coordinates! Unable to input data grid.');\n empty();\n }\n\n return {\n xMin: xMin,\n yMin: yMin,\n zMin: zMin,\n xMax: xMax,\n yMax: yMax,\n zMax: zMax,\n Xs: Xs,\n Ys: Ys,\n Zs: Zs,\n len: len,\n fill: gridFill\n };\n}\n\nfunction distinctVals(col) {\n return Lib.distinctVals(col).vals;\n}\n\nfunction filter(arr, len) {\n if(len === undefined) len = arr.length;\n\n // no need for casting typed arrays to numbers\n if(Lib.isTypedArray(arr)) return arr.subarray(0, len);\n\n var values = [];\n for(var i = 0; i < len; i++) {\n values[i] = +arr[i];\n }\n return values;\n}\n\nmodule.exports = {\n calc: calc,\n filter: filter,\n processGrid: processGrid\n};\n\n},{\"../../components/colorscale/calc\":603,\"../../lib\":728}],1242:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar tube2mesh = _dereq_('gl-streamtube3d');\nvar createTubeMesh = tube2mesh.createTubeMesh;\n\nvar Lib = _dereq_('../../lib');\nvar parseColorScale = _dereq_('../../lib/gl_format_color').parseColorScale;\nvar extractOpts = _dereq_('../../components/colorscale').extractOpts;\nvar zip3 = _dereq_('../../plots/gl3d/zip3');\n\nvar axisName2scaleIndex = {xaxis: 0, yaxis: 1, zaxis: 2};\n\nfunction Streamtube(scene, uid) {\n this.scene = scene;\n this.uid = uid;\n this.mesh = null;\n this.data = null;\n}\n\nvar proto = Streamtube.prototype;\n\nproto.handlePick = function(selection) {\n var sceneLayout = this.scene.fullSceneLayout;\n var dataScale = this.scene.dataScale;\n\n function fromDataScale(v, axisName) {\n var ax = sceneLayout[axisName];\n var scale = dataScale[axisName2scaleIndex[axisName]];\n return ax.l2c(v) / scale;\n }\n\n if(selection.object === this.mesh) {\n var pos = selection.data.position;\n var uvx = selection.data.velocity;\n\n selection.traceCoordinate = [\n fromDataScale(pos[0], 'xaxis'),\n fromDataScale(pos[1], 'yaxis'),\n fromDataScale(pos[2], 'zaxis'),\n\n fromDataScale(uvx[0], 'xaxis'),\n fromDataScale(uvx[1], 'yaxis'),\n fromDataScale(uvx[2], 'zaxis'),\n\n // u/v/w norm\n selection.data.intensity * this.data._normMax,\n // divergence\n selection.data.divergence\n ];\n\n selection.textLabel = this.data.hovertext || this.data.text;\n\n return true;\n }\n};\n\nfunction getDfltStartingPositions(vec) {\n var len = vec.length;\n var s;\n\n if(len > 2) {\n s = vec.slice(1, len - 1);\n } else if(len === 2) {\n s = [(vec[0] + vec[1]) / 2];\n } else {\n s = vec;\n }\n return s;\n}\n\nfunction getBoundPads(vec) {\n var len = vec.length;\n if(len === 1) {\n return [0.5, 0.5];\n } else {\n return [vec[1] - vec[0], vec[len - 1] - vec[len - 2]];\n }\n}\n\nfunction convert(scene, trace) {\n var sceneLayout = scene.fullSceneLayout;\n var dataScale = scene.dataScale;\n var len = trace._len;\n var tubeOpts = {};\n\n function toDataCoords(arr, axisName) {\n var ax = sceneLayout[axisName];\n var scale = dataScale[axisName2scaleIndex[axisName]];\n return Lib.simpleMap(arr, function(v) { return ax.d2l(v) * scale; });\n }\n\n tubeOpts.vectors = zip3(\n toDataCoords(trace._u, 'xaxis'),\n toDataCoords(trace._v, 'yaxis'),\n toDataCoords(trace._w, 'zaxis'),\n len\n );\n\n // Over-specified mesh case, this would error in tube2mesh\n if(!len) {\n return {\n positions: [],\n cells: []\n };\n }\n\n var meshx = toDataCoords(trace._Xs, 'xaxis');\n var meshy = toDataCoords(trace._Ys, 'yaxis');\n var meshz = toDataCoords(trace._Zs, 'zaxis');\n\n tubeOpts.meshgrid = [meshx, meshy, meshz];\n tubeOpts.gridFill = trace._gridFill;\n\n var slen = trace._slen;\n if(slen) {\n tubeOpts.startingPositions = zip3(\n toDataCoords(trace._startsX, 'xaxis'),\n toDataCoords(trace._startsY, 'yaxis'),\n toDataCoords(trace._startsZ, 'zaxis')\n );\n } else {\n // Default starting positions:\n //\n // if len>2, cut xz plane at min-y,\n // takes all x/y/z pts on that plane except those on the edges\n // to generate \"well-defined\" tubes,\n //\n // if len=2, take position halfway between two the pts,\n //\n // if len=1, take that pt\n var sy0 = meshy[0];\n var sx = getDfltStartingPositions(meshx);\n var sz = getDfltStartingPositions(meshz);\n var startingPositions = new Array(sx.length * sz.length);\n var m = 0;\n\n for(var i = 0; i < sx.length; i++) {\n for(var k = 0; k < sz.length; k++) {\n startingPositions[m++] = [sx[i], sy0, sz[k]];\n }\n }\n tubeOpts.startingPositions = startingPositions;\n }\n\n tubeOpts.colormap = parseColorScale(trace);\n tubeOpts.tubeSize = trace.sizeref;\n tubeOpts.maxLength = trace.maxdisplayed;\n\n // add some padding around the bounds\n // to e.g. allow tubes starting from a slice of the x/y/z mesh\n // to go beyond bounds a little bit w/o getting clipped\n var xbnds = toDataCoords(trace._xbnds, 'xaxis');\n var ybnds = toDataCoords(trace._ybnds, 'yaxis');\n var zbnds = toDataCoords(trace._zbnds, 'zaxis');\n var xpads = getBoundPads(meshx);\n var ypads = getBoundPads(meshy);\n var zpads = getBoundPads(meshz);\n\n var bounds = [\n [xbnds[0] - xpads[0], ybnds[0] - ypads[0], zbnds[0] - zpads[0]],\n [xbnds[1] + xpads[1], ybnds[1] + ypads[1], zbnds[1] + zpads[1]]\n ];\n\n var meshData = tube2mesh(tubeOpts, bounds);\n\n // N.B. cmin/cmax correspond to the min/max vector norm\n // in the u/v/w arrays, which in general is NOT equal to max\n // intensity that colors the tubes.\n var cOpts = extractOpts(trace);\n meshData.vertexIntensityBounds = [cOpts.min / trace._normMax, cOpts.max / trace._normMax];\n\n // pass gl-mesh3d lighting attributes\n var lp = trace.lightposition;\n meshData.lightPosition = [lp.x, lp.y, lp.z];\n meshData.ambient = trace.lighting.ambient;\n meshData.diffuse = trace.lighting.diffuse;\n meshData.specular = trace.lighting.specular;\n meshData.roughness = trace.lighting.roughness;\n meshData.fresnel = trace.lighting.fresnel;\n meshData.opacity = trace.opacity;\n\n // stash autorange pad value\n trace._pad = meshData.tubeScale * trace.sizeref * 2;\n\n return meshData;\n}\n\nproto.update = function(data) {\n this.data = data;\n\n var meshData = convert(this.scene, data);\n this.mesh.update(meshData);\n};\n\nproto.dispose = function() {\n this.scene.glplot.remove(this.mesh);\n this.mesh.dispose();\n};\n\nfunction createStreamtubeTrace(scene, data) {\n var gl = scene.glplot.gl;\n\n var meshData = convert(scene, data);\n var mesh = createTubeMesh(gl, meshData);\n\n var streamtube = new Streamtube(scene, data.uid);\n streamtube.mesh = mesh;\n streamtube.data = data;\n mesh._trace = streamtube;\n\n scene.glplot.add(mesh);\n\n return streamtube;\n}\n\nmodule.exports = createStreamtubeTrace;\n\n},{\"../../components/colorscale\":607,\"../../lib\":728,\"../../lib/gl_format_color\":725,\"../../plots/gl3d/zip3\":829,\"gl-streamtube3d\":318}],1243:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nvar colorscaleDefaults = _dereq_('../../components/colorscale/defaults');\nvar attributes = _dereq_('./attributes');\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 u = coerce('u');\n var v = coerce('v');\n var w = coerce('w');\n\n var x = coerce('x');\n var y = coerce('y');\n var z = coerce('z');\n\n if(\n !u || !u.length || !v || !v.length || !w || !w.length ||\n !x || !x.length || !y || !y.length || !z || !z.length\n ) {\n traceOut.visible = false;\n return;\n }\n\n coerce('starts.x');\n coerce('starts.y');\n coerce('starts.z');\n\n coerce('maxdisplayed');\n coerce('sizeref');\n\n coerce('lighting.ambient');\n coerce('lighting.diffuse');\n coerce('lighting.specular');\n coerce('lighting.roughness');\n coerce('lighting.fresnel');\n coerce('lightposition.x');\n coerce('lightposition.y');\n coerce('lightposition.z');\n\n colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'c'});\n\n coerce('text');\n coerce('hovertext');\n coerce('hovertemplate');\n\n // disable 1D transforms (for now)\n // x/y/z and u/v/w have matching lengths,\n // but they don't have to match with starts.(x|y|z)\n traceOut._length = null;\n};\n\n},{\"../../components/colorscale/defaults\":605,\"../../lib\":728,\"./attributes\":1240}],1244:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n moduleType: 'trace',\n name: 'streamtube',\n basePlotModule: _dereq_('../../plots/gl3d'),\n categories: ['gl3d', 'showLegend'],\n\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults'),\n colorbar: {\n min: 'cmin',\n max: 'cmax'\n },\n calc: _dereq_('./calc').calc,\n plot: _dereq_('./convert'),\n eventData: function(out, pt) {\n out.tubex = out.x;\n out.tubey = out.y;\n out.tubez = out.z;\n\n out.tubeu = pt.traceCoordinate[3];\n out.tubev = pt.traceCoordinate[4];\n out.tubew = pt.traceCoordinate[5];\n\n out.norm = pt.traceCoordinate[6];\n out.divergence = pt.traceCoordinate[7];\n\n // Does not correspond to input x/y/z, so delete them\n delete out.x;\n delete out.y;\n delete out.z;\n\n return out;\n },\n\n meta: {\n \n }\n};\n\n},{\"../../plots/gl3d\":818,\"./attributes\":1240,\"./calc\":1241,\"./convert\":1242,\"./defaults\":1243}],1245:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar baseAttrs = _dereq_('../../plots/attributes');\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar texttemplateAttrs = _dereq_('../../plots/template_attributes').texttemplateAttrs;\n\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\nvar domainAttrs = _dereq_('../../plots/domain').attributes;\nvar pieAttrs = _dereq_('../pie/attributes');\nvar constants = _dereq_('./constants');\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nmodule.exports = {\n labels: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n parents: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n\n values: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n branchvalues: {\n valType: 'enumerated',\n values: ['remainder', 'total'],\n dflt: 'remainder',\n editType: 'calc',\n \n \n },\n count: {\n valType: 'flaglist',\n flags: [\n 'branches',\n 'leaves'\n ],\n dflt: 'leaves',\n editType: 'calc',\n \n \n },\n\n level: {\n valType: 'any',\n editType: 'plot',\n anim: true,\n \n \n },\n maxdepth: {\n valType: 'integer',\n editType: 'plot',\n \n dflt: -1,\n \n },\n\n marker: extendFlat({\n colors: {\n valType: 'data_array',\n editType: 'calc',\n \n },\n\n // colorinheritance: {\n // valType: 'enumerated',\n // values: ['per-branch', 'per-label', false]\n // },\n\n line: {\n color: extendFlat({}, pieAttrs.marker.line.color, {\n dflt: null,\n \n }),\n width: extendFlat({}, pieAttrs.marker.line.width, {dflt: 1}),\n editType: 'calc'\n },\n editType: 'calc'\n },\n colorScaleAttrs('marker', {\n colorAttr: 'colors',\n anim: false // TODO: set to anim: true?\n })\n ),\n\n leaf: {\n opacity: {\n valType: 'number',\n editType: 'style',\n \n min: 0,\n max: 1,\n \n },\n editType: 'plot'\n },\n\n text: pieAttrs.text,\n textinfo: {\n valType: 'flaglist',\n \n flags: [\n 'label',\n 'text',\n 'value',\n 'current path',\n 'percent root',\n 'percent entry',\n 'percent parent'\n ],\n extras: ['none'],\n editType: 'plot',\n \n },\n\n // TODO: incorporate `label` and `value` in the eventData\n texttemplate: texttemplateAttrs({editType: 'plot'}, {\n keys: constants.eventDataKeys.concat(['label', 'value'])\n }),\n\n hovertext: pieAttrs.hovertext,\n hoverinfo: extendFlat({}, baseAttrs.hoverinfo, {\n flags: [\n 'label',\n 'text',\n 'value',\n 'name',\n 'current path',\n 'percent root',\n 'percent entry',\n 'percent parent'\n ],\n dflt: 'label+text+value+name'\n }),\n hovertemplate: hovertemplateAttrs({}, {\n keys: constants.eventDataKeys\n }),\n\n textfont: pieAttrs.textfont,\n insidetextorientation: pieAttrs.insidetextorientation,\n insidetextfont: pieAttrs.insidetextfont,\n outsidetextfont: extendFlat({}, pieAttrs.outsidetextfont, {\n \n }),\n\n domain: domainAttrs({name: 'sunburst', trace: true, editType: 'calc'})\n};\n\n},{\"../../components/colorscale/attributes\":602,\"../../lib/extend\":719,\"../../plots/attributes\":773,\"../../plots/domain\":803,\"../../plots/template_attributes\":854,\"../pie/attributes\":1108,\"./constants\":1248}],1246:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar plots = _dereq_('../../plots/plots');\n\nexports.name = 'sunburst';\n\nexports.plot = function(gd, traces, transitionOpts, makeOnCompleteCallback) {\n plots.plotBasePlot(exports.name, gd, traces, transitionOpts, makeOnCompleteCallback);\n};\n\nexports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) {\n plots.cleanBasePlot(exports.name, newFullData, newFullLayout, oldFullData, oldFullLayout);\n};\n\n},{\"../../plots/plots\":839}],1247:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3Hierarchy = _dereq_('d3-hierarchy');\nvar isNumeric = _dereq_('fast-isnumeric');\n\nvar Lib = _dereq_('../../lib');\nvar makeColorScaleFn = _dereq_('../../components/colorscale').makeColorScaleFuncFromTrace;\nvar makePullColorFn = _dereq_('../pie/calc').makePullColorFn;\nvar generateExtendedColors = _dereq_('../pie/calc').generateExtendedColors;\nvar colorscaleCalc = _dereq_('../../components/colorscale').calc;\n\nvar ALMOST_EQUAL = _dereq_('../../constants/numerical').ALMOST_EQUAL;\n\nvar sunburstExtendedColorWays = {};\nvar treemapExtendedColorWays = {};\n\nexports.calc = function(gd, trace) {\n var fullLayout = gd._fullLayout;\n var ids = trace.ids;\n var hasIds = Lib.isArrayOrTypedArray(ids);\n var labels = trace.labels;\n var parents = trace.parents;\n var values = trace.values;\n var hasValues = Lib.isArrayOrTypedArray(values);\n var cd = [];\n\n var parent2children = {};\n var refs = {};\n var addToLookup = function(parent, v) {\n if(parent2children[parent]) parent2children[parent].push(v);\n else parent2children[parent] = [v];\n refs[v] = 1;\n };\n\n // treat number `0` as valid\n var isValidKey = function(k) {\n return k || typeof k === 'number';\n };\n\n var isValidVal = function(i) {\n return !hasValues || (isNumeric(values[i]) && values[i] >= 0);\n };\n\n var len;\n var isValid;\n var getId;\n\n if(hasIds) {\n len = Math.min(ids.length, parents.length);\n isValid = function(i) { return isValidKey(ids[i]) && isValidVal(i); };\n getId = function(i) { return String(ids[i]); };\n } else {\n len = Math.min(labels.length, parents.length);\n isValid = function(i) { return isValidKey(labels[i]) && isValidVal(i); };\n // TODO We could allow some label / parent duplication\n //\n // From AJ:\n // It would work OK for one level\n // (multiple rows with the same name and different parents -\n // or even the same parent) but if that name is then used as a parent\n // which one is it?\n getId = function(i) { return String(labels[i]); };\n }\n\n if(hasValues) len = Math.min(len, values.length);\n\n for(var i = 0; i < len; i++) {\n if(isValid(i)) {\n var id = getId(i);\n var pid = isValidKey(parents[i]) ? String(parents[i]) : '';\n\n var cdi = {\n i: i,\n id: id,\n pid: pid,\n label: isValidKey(labels[i]) ? String(labels[i]) : ''\n };\n\n if(hasValues) cdi.v = +values[i];\n cd.push(cdi);\n addToLookup(pid, id);\n }\n }\n\n if(!parent2children['']) {\n var impliedRoots = [];\n var k;\n for(k in parent2children) {\n if(!refs[k]) {\n impliedRoots.push(k);\n }\n }\n\n // if an `id` has no ref in the `parents` array,\n // take it as being the root node\n\n if(impliedRoots.length === 1) {\n k = impliedRoots[0];\n cd.unshift({\n hasImpliedRoot: true,\n id: k,\n pid: '',\n label: k\n });\n } else {\n return Lib.warn('Multiple implied roots, cannot build ' + trace.type + ' hierarchy.');\n }\n } else if(parent2children[''].length > 1) {\n var dummyId = Lib.randstr();\n\n // if multiple rows linked to the root node,\n // add dummy \"root of roots\" node to make d3 build the hierarchy successfully\n\n for(var j = 0; j < cd.length; j++) {\n if(cd[j].pid === '') {\n cd[j].pid = dummyId;\n }\n }\n\n cd.unshift({\n hasMultipleRoots: true,\n id: dummyId,\n pid: '',\n label: ''\n });\n }\n\n // TODO might be better to replace stratify() with our own algorithm\n var root;\n try {\n root = d3Hierarchy.stratify()\n .id(function(d) { return d.id; })\n .parentId(function(d) { return d.pid; })(cd);\n } catch(e) {\n return Lib.warn('Failed to build ' + trace.type + ' hierarchy. Error: ' + e.message);\n }\n\n var hierarchy = d3Hierarchy.hierarchy(root);\n var failed = false;\n\n if(hasValues) {\n switch(trace.branchvalues) {\n case 'remainder':\n hierarchy.sum(function(d) { return d.data.v; });\n break;\n case 'total':\n hierarchy.each(function(d) {\n var cdi = d.data.data;\n var v = cdi.v;\n\n if(d.children) {\n var partialSum = d.children.reduce(function(a, c) {\n return a + c.data.data.v;\n }, 0);\n\n // N.B. we must fill in `value` for generated sectors\n // with the partialSum to compute the correct partition\n if(cdi.hasImpliedRoot || cdi.hasMultipleRoots) {\n v = partialSum;\n }\n\n if(v < partialSum * ALMOST_EQUAL) {\n failed = true;\n return Lib.warn([\n 'Total value for node', d.data.data.id,\n 'is smaller than the sum of its children.',\n '\\nparent value =', v,\n '\\nchildren sum =', partialSum\n ].join(' '));\n }\n }\n\n d.value = v;\n });\n break;\n }\n } else {\n countDescendants(hierarchy, trace, {\n branches: trace.count.indexOf('branches') !== -1,\n leaves: trace.count.indexOf('leaves') !== -1\n });\n }\n\n if(failed) return;\n\n // TODO add way to sort by height also?\n hierarchy.sort(function(a, b) { return b.value - a.value; });\n\n var pullColor;\n var scaleColor;\n var colors = trace.marker.colors || [];\n var hasColors = !!colors.length;\n\n if(trace._hasColorscale) {\n if(!hasColors) {\n colors = hasValues ? trace.values : trace._values;\n }\n\n colorscaleCalc(gd, trace, {\n vals: colors,\n containerStr: 'marker',\n cLetter: 'c'\n });\n\n scaleColor = makeColorScaleFn(trace.marker);\n } else {\n pullColor = makePullColorFn(fullLayout['_' + trace.type + 'colormap']);\n }\n\n // TODO keep track of 'root-children' (i.e. branch) for hover info etc.\n\n hierarchy.each(function(d) {\n var cdi = d.data.data;\n // N.B. this mutates items in `cd`\n cdi.color = trace._hasColorscale ?\n scaleColor(colors[cdi.i]) :\n pullColor(colors[cdi.i], cdi.id);\n });\n\n cd[0].hierarchy = hierarchy;\n\n return cd;\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 */\nexports._runCrossTraceCalc = function(desiredType, gd) {\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,\n desiredType === 'treemap' ? treemapExtendedColorWays : sunburstExtendedColorWays\n );\n }\n var dfltColorCount = 0;\n\n function pickColor(d) {\n var cdi = d.data.data;\n var id = cdi.id;\n\n if(cdi.color === false) {\n if(colorMap[id]) {\n // have we seen this label and assigned a color to it in a previous trace?\n cdi.color = colorMap[id];\n } else if(d.parent) {\n if(d.parent.parent) {\n // from third-level on, inherit from parent\n cdi.color = d.parent.data.data.color;\n } else {\n // pick new color for second level\n colorMap[id] = cdi.color = colorWay[dfltColorCount % colorWay.length];\n dfltColorCount++;\n }\n } else {\n // root gets no coloring by default\n cdi.color = 'rgba(0,0,0,0)';\n }\n }\n }\n\n for(var i = 0; i < calcdata.length; i++) {\n var cd = calcdata[i];\n var cd0 = cd[0];\n if(cd0.trace.type === desiredType && cd0.hierarchy) {\n cd0.hierarchy.each(pickColor);\n }\n }\n};\n\nexports.crossTraceCalc = function(gd) {\n return exports._runCrossTraceCalc('sunburst', gd);\n};\n\nfunction countDescendants(node, trace, opts) {\n var nChild = 0;\n\n var children = node.children;\n if(children) {\n var len = children.length;\n\n for(var i = 0; i < len; i++) {\n nChild += countDescendants(children[i], trace, opts);\n }\n\n if(opts.branches) nChild++; // count this branch\n } else {\n if(opts.leaves) nChild++; // count this leaf\n }\n\n // save to the node\n node.value = node.data.data.value = nChild;\n\n // save to the trace\n if(!trace._values) trace._values = [];\n trace._values[node.data.data.i] = nChild;\n\n return nChild;\n}\n\n},{\"../../components/colorscale\":607,\"../../constants/numerical\":704,\"../../lib\":728,\"../pie/calc\":1110,\"d3-hierarchy\":158,\"fast-isnumeric\":236}],1248:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n CLICK_TRANSITION_TIME: 750,\n CLICK_TRANSITION_EASING: 'linear',\n eventDataKeys: [\n // string\n 'currentPath',\n 'root',\n 'entry',\n // no need to add 'parent' here\n\n // percentages i.e. ratios\n 'percentRoot',\n 'percentEntry',\n 'percentParent'\n ]\n};\n\n},{}],1249:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar attributes = _dereq_('./attributes');\nvar handleDomainDefaults = _dereq_('../../plots/domain').defaults;\nvar handleText = _dereq_('../bar/defaults').handleText;\n\nvar Colorscale = _dereq_('../../components/colorscale');\nvar hasColorscale = Colorscale.hasColorscale;\nvar colorscaleDefaults = Colorscale.handleDefaults;\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 labels = coerce('labels');\n var parents = coerce('parents');\n\n if(!labels || !labels.length || !parents || !parents.length) {\n traceOut.visible = false;\n return;\n }\n\n var vals = coerce('values');\n if(vals && vals.length) {\n coerce('branchvalues');\n } else {\n coerce('count');\n }\n\n coerce('level');\n coerce('maxdepth');\n\n var lineWidth = coerce('marker.line.width');\n if(lineWidth) coerce('marker.line.color', layout.paper_bgcolor);\n\n coerce('marker.colors');\n var withColorscale = traceOut._hasColorscale = (\n hasColorscale(traceIn, 'marker', 'colors') ||\n (traceIn.marker || {}).coloraxis // N.B. special logic to consider \"values\" colorscales\n );\n if(withColorscale) {\n colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: 'marker.', cLetter: 'c'});\n }\n\n coerce('leaf.opacity', withColorscale ? 1 : 0.7);\n\n var text = coerce('text');\n coerce('texttemplate');\n if(!traceOut.texttemplate) coerce('textinfo', Array.isArray(text) ? 'text+label' : 'label');\n\n coerce('hovertext');\n coerce('hovertemplate');\n\n var textposition = 'auto';\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 coerce('insidetextorientation');\n\n handleDomainDefaults(traceOut, layout, coerce);\n\n // do not support transforms for now\n traceOut._length = null;\n};\n\n},{\"../../components/colorscale\":607,\"../../lib\":728,\"../../plots/domain\":803,\"../bar/defaults\":873,\"./attributes\":1245}],1250:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Registry = _dereq_('../../registry');\nvar appendArrayPointValue = _dereq_('../../components/fx/helpers').appendArrayPointValue;\nvar Fx = _dereq_('../../components/fx');\nvar Lib = _dereq_('../../lib');\nvar Events = _dereq_('../../lib/events');\n\nvar helpers = _dereq_('./helpers');\nvar pieHelpers = _dereq_('../pie/helpers');\n\nvar formatValue = pieHelpers.formatPieValue;\n\nmodule.exports = function attachFxHandlers(sliceTop, entry, gd, cd, opts) {\n var cd0 = cd[0];\n var trace = cd0.trace;\n var hierarchy = cd0.hierarchy;\n\n var isSunburst = trace.type === 'sunburst';\n var isTreemap = trace.type === 'treemap';\n\n // hover state vars\n // have we drawn a hover label, so it should be cleared later\n if(!('_hasHoverLabel' in trace)) trace._hasHoverLabel = false;\n // have we emitted a hover event, so later an unhover event should be emitted\n // note that click events do not depend on this - you can still get them\n // with hovermode: false or if you were earlier dragging, then clicked\n // in the same slice that you moused up in\n if(!('_hasHoverEvent' in trace)) trace._hasHoverEvent = false;\n\n var onMouseOver = function(pt) {\n var fullLayoutNow = gd._fullLayout;\n\n if(gd._dragging || fullLayoutNow.hovermode === false) return;\n\n var traceNow = gd._fullData[trace.index];\n var cdi = pt.data.data;\n var ptNumber = cdi.i;\n var isRoot = helpers.isHierarchyRoot(pt);\n var parent = helpers.getParent(hierarchy, pt);\n\n var val = helpers.getValue(pt);\n\n var _cast = function(astr) {\n return Lib.castOption(traceNow, ptNumber, astr);\n };\n\n var hovertemplate = _cast('hovertemplate');\n var hoverinfo = Fx.castHoverinfo(traceNow, fullLayoutNow, ptNumber);\n var separators = fullLayoutNow.separators;\n\n if(hovertemplate || (hoverinfo && hoverinfo !== 'none' && hoverinfo !== 'skip')) {\n var hoverCenterX;\n var hoverCenterY;\n if(isSunburst) {\n hoverCenterX = cd0.cx + pt.pxmid[0] * (1 - pt.rInscribed);\n hoverCenterY = cd0.cy + pt.pxmid[1] * (1 - pt.rInscribed);\n }\n if(isTreemap) {\n hoverCenterX = pt._hoverX;\n hoverCenterY = pt._hoverY;\n }\n\n var hoverPt = {};\n var parts = [];\n var thisText = [];\n var hasFlag = function(flag) { return parts.indexOf(flag) !== -1; };\n\n if(hoverinfo) {\n parts = hoverinfo === 'all' ?\n traceNow._module.attributes.hoverinfo.flags :\n hoverinfo.split('+');\n }\n\n hoverPt.label = cdi.label;\n if(hasFlag('label') && hoverPt.label) thisText.push(hoverPt.label);\n\n if(cdi.hasOwnProperty('v')) {\n hoverPt.value = cdi.v;\n hoverPt.valueLabel = formatValue(hoverPt.value, separators);\n if(hasFlag('value')) thisText.push(hoverPt.valueLabel);\n }\n\n hoverPt.currentPath = pt.currentPath = helpers.getPath(pt.data);\n if(hasFlag('current path') && !isRoot) {\n thisText.push(hoverPt.currentPath);\n }\n\n var tx;\n var allPercents = [];\n var insertPercent = function() {\n if(allPercents.indexOf(tx) === -1) { // no need to add redundant info\n thisText.push(tx);\n allPercents.push(tx);\n }\n };\n\n hoverPt.percentParent = pt.percentParent = val / helpers.getValue(parent);\n hoverPt.parent = pt.parentString = helpers.getPtLabel(parent);\n if(hasFlag('percent parent')) {\n tx = helpers.formatPercent(hoverPt.percentParent, separators) + ' of ' + hoverPt.parent;\n insertPercent();\n }\n\n hoverPt.percentEntry = pt.percentEntry = val / helpers.getValue(entry);\n hoverPt.entry = pt.entry = helpers.getPtLabel(entry);\n if(hasFlag('percent entry') && !isRoot && !pt.onPathbar) {\n tx = helpers.formatPercent(hoverPt.percentEntry, separators) + ' of ' + hoverPt.entry;\n insertPercent();\n }\n\n hoverPt.percentRoot = pt.percentRoot = val / helpers.getValue(hierarchy);\n hoverPt.root = pt.root = helpers.getPtLabel(hierarchy);\n if(hasFlag('percent root') && !isRoot) {\n tx = helpers.formatPercent(hoverPt.percentRoot, separators) + ' of ' + hoverPt.root;\n insertPercent();\n }\n\n hoverPt.text = _cast('hovertext') || _cast('text');\n if(hasFlag('text')) {\n tx = hoverPt.text;\n if(Lib.isValidTextValue(tx)) thisText.push(tx);\n }\n\n var hoverItems = {\n trace: traceNow,\n y: hoverCenterY,\n text: thisText.join('
'),\n name: (hovertemplate || hasFlag('name')) ? traceNow.name : undefined,\n color: _cast('hoverlabel.bgcolor') || cdi.color,\n borderColor: _cast('hoverlabel.bordercolor'),\n fontFamily: _cast('hoverlabel.font.family'),\n fontSize: _cast('hoverlabel.font.size'),\n fontColor: _cast('hoverlabel.font.color'),\n nameLength: _cast('hoverlabel.namelength'),\n textAlign: _cast('hoverlabel.align'),\n hovertemplate: hovertemplate,\n hovertemplateLabels: hoverPt,\n eventData: [makeEventData(pt, traceNow, opts.eventDataKeys)]\n };\n\n if(isSunburst) {\n hoverItems.x0 = hoverCenterX - pt.rInscribed * pt.rpx1;\n hoverItems.x1 = hoverCenterX + pt.rInscribed * pt.rpx1;\n hoverItems.idealAlign = pt.pxmid[0] < 0 ? 'left' : 'right';\n }\n if(isTreemap) {\n hoverItems.x = hoverCenterX;\n hoverItems.idealAlign = hoverCenterX < 0 ? 'left' : 'right';\n }\n\n Fx.loneHover(hoverItems, {\n container: fullLayoutNow._hoverlayer.node(),\n outerContainer: fullLayoutNow._paper.node(),\n gd: gd\n });\n\n trace._hasHoverLabel = true;\n }\n\n if(isTreemap) {\n var slice = sliceTop.select('path.surface');\n opts.styleOne(slice, pt, traceNow, {\n hovered: true\n });\n }\n\n trace._hasHoverEvent = true;\n gd.emit('plotly_hover', {\n points: [makeEventData(pt, traceNow, opts.eventDataKeys)],\n event: d3.event\n });\n };\n\n var onMouseOut = function(evt) {\n var fullLayoutNow = gd._fullLayout;\n var traceNow = gd._fullData[trace.index];\n var pt = d3.select(this).datum();\n\n if(trace._hasHoverEvent) {\n evt.originalEvent = d3.event;\n gd.emit('plotly_unhover', {\n points: [makeEventData(pt, traceNow, opts.eventDataKeys)],\n event: d3.event\n });\n trace._hasHoverEvent = false;\n }\n\n if(trace._hasHoverLabel) {\n Fx.loneUnhover(fullLayoutNow._hoverlayer.node());\n trace._hasHoverLabel = false;\n }\n\n if(isTreemap) {\n var slice = sliceTop.select('path.surface');\n opts.styleOne(slice, pt, traceNow, {\n hovered: false\n });\n }\n };\n\n var onClick = function(pt) {\n // TODO: this does not support right-click. If we want to support it, we\n // would likely need to change pie to use dragElement instead of straight\n // mapbox event binding. Or perhaps better, make a simple wrapper with the\n // right mousedown, mousemove, and mouseup handlers just for a left/right click\n // mapbox would use this too.\n var fullLayoutNow = gd._fullLayout;\n var traceNow = gd._fullData[trace.index];\n\n var noTransition = isSunburst && (helpers.isHierarchyRoot(pt) || helpers.isLeaf(pt));\n\n var id = helpers.getPtId(pt);\n var nextEntry = helpers.isEntry(pt) ?\n helpers.findEntryWithChild(hierarchy, id) :\n helpers.findEntryWithLevel(hierarchy, id);\n var nextLevel = helpers.getPtId(nextEntry);\n\n var typeClickEvtData = {\n points: [makeEventData(pt, traceNow, opts.eventDataKeys)],\n event: d3.event\n };\n if(!noTransition) typeClickEvtData.nextLevel = nextLevel;\n\n var clickVal = Events.triggerHandler(gd, 'plotly_' + trace.type + 'click', typeClickEvtData);\n\n if(clickVal !== false && fullLayoutNow.hovermode) {\n gd._hoverdata = [makeEventData(pt, traceNow, opts.eventDataKeys)];\n Fx.click(gd, d3.event);\n }\n\n // if click does not trigger a transition, we're done!\n if(noTransition) return;\n\n // if custom handler returns false, we're done!\n if(clickVal === false) return;\n\n // skip if triggered from dragging a nearby cartesian subplot\n if(gd._dragging) return;\n\n // skip during transitions, to avoid potential bugs\n // we could remove this check later\n if(gd._transitioning) return;\n\n // store 'old' level in guiEdit stash, so that subsequent Plotly.react\n // calls with the same uirevision can start from the same entry\n Registry.call('_storeDirectGUIEdit', traceNow, fullLayoutNow._tracePreGUI[traceNow.uid], {\n level: traceNow.level\n });\n\n var frame = {\n data: [{level: nextLevel}],\n traces: [trace.index]\n };\n\n var animOpts = {\n frame: {\n redraw: false,\n duration: opts.transitionTime\n },\n transition: {\n duration: opts.transitionTime,\n easing: opts.transitionEasing\n },\n mode: 'immediate',\n fromcurrent: true\n };\n\n Fx.loneUnhover(fullLayoutNow._hoverlayer.node());\n Registry.call('animate', gd, frame, animOpts);\n };\n\n sliceTop.on('mouseover', onMouseOver);\n sliceTop.on('mouseout', onMouseOut);\n sliceTop.on('click', onClick);\n};\n\nfunction makeEventData(pt, trace, keys) {\n var cdi = pt.data.data;\n\n var out = {\n curveNumber: trace.index,\n pointNumber: cdi.i,\n data: trace._input,\n fullData: trace,\n\n // TODO more things like 'children', 'siblings', 'hierarchy?\n };\n\n for(var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if(key in pt) out[key] = pt[key];\n }\n // handle special case of parent\n if('parentString' in pt && !helpers.isHierarchyRoot(pt)) out.parent = pt.parentString;\n\n appendArrayPointValue(out, trace, cdi.i);\n\n return out;\n}\n\n},{\"../../components/fx\":635,\"../../components/fx/helpers\":631,\"../../lib\":728,\"../../lib/events\":718,\"../../registry\":859,\"../pie/helpers\":1113,\"./helpers\":1251,\"d3\":164}],1251:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Color = _dereq_('../../components/color');\nvar setCursor = _dereq_('../../lib/setcursor');\nvar pieHelpers = _dereq_('../pie/helpers');\n\nexports.findEntryWithLevel = function(hierarchy, level) {\n var out;\n if(level) {\n hierarchy.eachAfter(function(pt) {\n if(exports.getPtId(pt) === level) {\n return out = pt.copy();\n }\n });\n }\n return out || hierarchy;\n};\n\nexports.findEntryWithChild = function(hierarchy, childId) {\n var out;\n hierarchy.eachAfter(function(pt) {\n var children = pt.children || [];\n for(var i = 0; i < children.length; i++) {\n var child = children[i];\n if(exports.getPtId(child) === childId) {\n return out = pt.copy();\n }\n }\n });\n return out || hierarchy;\n};\n\nexports.isEntry = function(pt) {\n return !pt.parent;\n};\n\nexports.isLeaf = function(pt) {\n return !pt.children;\n};\n\nexports.getPtId = function(pt) {\n return pt.data.data.id;\n};\n\nexports.getPtLabel = function(pt) {\n return pt.data.data.label;\n};\n\nexports.getValue = function(d) {\n return d.value;\n};\n\nexports.isHierarchyRoot = function(pt) {\n return getParentId(pt) === '';\n};\n\nexports.setSliceCursor = function(sliceTop, gd, opts) {\n var hide = opts.isTransitioning;\n if(!hide) {\n var pt = sliceTop.datum();\n hide = (\n (opts.hideOnRoot && exports.isHierarchyRoot(pt)) ||\n (opts.hideOnLeaves && exports.isLeaf(pt))\n );\n }\n setCursor(sliceTop, hide ? null : 'pointer');\n};\n\nfunction determineOutsideTextFont(trace, pt, layoutFont) {\n return {\n color: exports.getOutsideTextFontKey('color', trace, pt, layoutFont),\n family: exports.getOutsideTextFontKey('family', trace, pt, layoutFont),\n size: exports.getOutsideTextFontKey('size', trace, pt, layoutFont)\n };\n}\n\nfunction determineInsideTextFont(trace, pt, layoutFont, opts) {\n var onPathbar = (opts || {}).onPathbar;\n\n var cdi = pt.data.data;\n var ptNumber = cdi.i;\n\n var customColor = Lib.castOption(trace, ptNumber,\n (onPathbar ? 'pathbar.textfont' : 'insidetextfont') + '.color'\n );\n\n if(!customColor && trace._input.textfont) {\n // Why not simply using trace.textfont? Because if not set, it\n // defaults to layout.font which has a default color. But if\n // textfont.color and insidetextfont.color don't supply a value,\n // a contrasting color shall be used.\n customColor = Lib.castOption(trace._input, ptNumber, 'textfont.color');\n }\n\n return {\n color: customColor || Color.contrast(cdi.color),\n family: exports.getInsideTextFontKey('family', trace, pt, layoutFont, opts),\n size: exports.getInsideTextFontKey('size', trace, pt, layoutFont, opts)\n };\n}\n\nexports.getInsideTextFontKey = function(keyStr, trace, pt, layoutFont, opts) {\n var onPathbar = (opts || {}).onPathbar;\n var cont = onPathbar ? 'pathbar.textfont' : 'insidetextfont';\n var ptNumber = pt.data.data.i;\n\n return (\n Lib.castOption(trace, ptNumber, cont + '.' + keyStr) ||\n Lib.castOption(trace, ptNumber, 'textfont.' + keyStr) ||\n layoutFont.size\n );\n};\n\nexports.getOutsideTextFontKey = function(keyStr, trace, pt, layoutFont) {\n var ptNumber = pt.data.data.i;\n\n return (\n Lib.castOption(trace, ptNumber, 'outsidetextfont.' + keyStr) ||\n Lib.castOption(trace, ptNumber, 'textfont.' + keyStr) ||\n layoutFont.size\n );\n};\n\nexports.isOutsideText = function(trace, pt) {\n return !trace._hasColorscale && exports.isHierarchyRoot(pt);\n};\n\nexports.determineTextFont = function(trace, pt, layoutFont, opts) {\n return exports.isOutsideText(trace, pt) ?\n determineOutsideTextFont(trace, pt, layoutFont) :\n determineInsideTextFont(trace, pt, layoutFont, opts);\n};\n\nexports.hasTransition = function(transitionOpts) {\n // We could optimize hasTransition per trace,\n // as sunburst & treemap have no cross-trace logic!\n return !!(transitionOpts && transitionOpts.duration > 0);\n};\n\nexports.getMaxDepth = function(trace) {\n return trace.maxdepth >= 0 ? trace.maxdepth : Infinity;\n};\n\nexports.isHeader = function(pt, trace) { // it is only used in treemap.\n return !(exports.isLeaf(pt) || pt.depth === trace._maxDepth - 1);\n};\n\nfunction getParentId(pt) {\n return pt.data.data.pid;\n}\n\nexports.getParent = function(hierarchy, pt) {\n return exports.findEntryWithLevel(hierarchy, getParentId(pt));\n};\n\nexports.listPath = function(d, keyStr) {\n var parent = d.parent;\n if(!parent) return [];\n var list = keyStr ? [parent.data[keyStr]] : [parent];\n return exports.listPath(parent, keyStr).concat(list);\n};\n\nexports.getPath = function(d) {\n return exports.listPath(d, 'label').join('/') + '/';\n};\n\nexports.formatValue = pieHelpers.formatPieValue;\n\n// TODO: should combine the two in a separate PR - Also please note Lib.formatPercent should support separators.\nexports.formatPercent = function(v, separators) {\n var tx = Lib.formatPercent(v, 0); // use funnel(area) version\n if(tx === '0%') tx = pieHelpers.formatPiePercent(v, separators); // use pie version\n return tx;\n};\n\n},{\"../../components/color\":595,\"../../lib\":728,\"../../lib/setcursor\":748,\"../pie/helpers\":1113}],1252:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n moduleType: 'trace',\n name: 'sunburst',\n basePlotModule: _dereq_('./base_plot'),\n categories: [],\n animatable: true,\n\n attributes: _dereq_('./attributes'),\n layoutAttributes: _dereq_('./layout_attributes'),\n supplyDefaults: _dereq_('./defaults'),\n supplyLayoutDefaults: _dereq_('./layout_defaults'),\n\n calc: _dereq_('./calc').calc,\n crossTraceCalc: _dereq_('./calc').crossTraceCalc,\n\n plot: _dereq_('./plot').plot,\n style: _dereq_('./style').style,\n\n colorbar: _dereq_('../scatter/marker_colorbar'),\n\n meta: {\n \n }\n};\n\n},{\"../scatter/marker_colorbar\":1152,\"./attributes\":1245,\"./base_plot\":1246,\"./calc\":1247,\"./defaults\":1249,\"./layout_attributes\":1253,\"./layout_defaults\":1254,\"./plot\":1255,\"./style\":1256}],1253:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n sunburstcolorway: {\n valType: 'colorlist',\n \n editType: 'calc',\n \n },\n extendsunburstcolors: {\n valType: 'boolean',\n dflt: true,\n \n editType: 'calc',\n \n }\n};\n\n},{}],1254:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar layoutAttributes = _dereq_('./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 coerce('sunburstcolorway', layoutOut.colorway);\n coerce('extendsunburstcolors');\n};\n\n},{\"../../lib\":728,\"./layout_attributes\":1253}],1255:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar d3Hierarchy = _dereq_('d3-hierarchy');\n\nvar Drawing = _dereq_('../../components/drawing');\nvar Lib = _dereq_('../../lib');\nvar svgTextUtils = _dereq_('../../lib/svg_text_utils');\nvar uniformText = _dereq_('../bar/uniform_text');\nvar recordMinTextSize = uniformText.recordMinTextSize;\nvar clearMinTextSize = uniformText.clearMinTextSize;\nvar piePlot = _dereq_('../pie/plot');\nvar computeTransform = piePlot.computeTransform;\nvar transformInsideText = piePlot.transformInsideText;\nvar styleOne = _dereq_('./style').styleOne;\nvar resizeText = _dereq_('../bar/style').resizeText;\nvar attachFxHandlers = _dereq_('./fx');\nvar constants = _dereq_('./constants');\nvar helpers = _dereq_('./helpers');\n\nexports.plot = function(gd, cdmodule, transitionOpts, makeOnCompleteCallback) {\n var fullLayout = gd._fullLayout;\n var layer = fullLayout._sunburstlayer;\n var join, onComplete;\n\n // If transition config is provided, then it is only a partial replot and traces not\n // updated are removed.\n var isFullReplot = !transitionOpts;\n var hasTransition = !fullLayout.uniformtext.mode && helpers.hasTransition(transitionOpts);\n\n clearMinTextSize('sunburst', fullLayout);\n\n join = layer.selectAll('g.trace.sunburst')\n .data(cdmodule, function(cd) { return cd[0].trace.uid; });\n\n // using same 'stroke-linejoin' as pie traces\n join.enter().append('g')\n .classed('trace', true)\n .classed('sunburst', true)\n .attr('stroke-linejoin', 'round');\n\n join.order();\n\n if(hasTransition) {\n if(makeOnCompleteCallback) {\n // If it was passed a callback to register completion, make a callback. If\n // this is created, then it must be executed on completion, otherwise the\n // pos-transition redraw will not execute:\n onComplete = makeOnCompleteCallback();\n }\n\n var transition = d3.transition()\n .duration(transitionOpts.duration)\n .ease(transitionOpts.easing)\n .each('end', function() { onComplete && onComplete(); })\n .each('interrupt', function() { onComplete && onComplete(); });\n\n transition.each(function() {\n // Must run the selection again since otherwise enters/updates get grouped together\n // and these get executed out of order. Except we need them in order!\n layer.selectAll('g.trace').each(function(cd) {\n plotOne(gd, cd, this, transitionOpts);\n });\n });\n } else {\n join.each(function(cd) {\n plotOne(gd, cd, this, transitionOpts);\n });\n\n if(fullLayout.uniformtext.mode) {\n resizeText(gd, fullLayout._sunburstlayer.selectAll('.trace'), 'sunburst');\n }\n }\n\n if(isFullReplot) {\n join.exit().remove();\n }\n};\n\nfunction plotOne(gd, cd, element, transitionOpts) {\n var fullLayout = gd._fullLayout;\n var hasTransition = !fullLayout.uniformtext.mode && helpers.hasTransition(transitionOpts);\n\n var gTrace = d3.select(element);\n var slices = gTrace.selectAll('g.slice');\n\n var cd0 = cd[0];\n var trace = cd0.trace;\n var hierarchy = cd0.hierarchy;\n var entry = helpers.findEntryWithLevel(hierarchy, trace.level);\n var maxDepth = helpers.getMaxDepth(trace);\n\n var gs = fullLayout._size;\n var domain = trace.domain;\n var vpw = gs.w * (domain.x[1] - domain.x[0]);\n var vph = gs.h * (domain.y[1] - domain.y[0]);\n var rMax = 0.5 * Math.min(vpw, vph);\n var cx = cd0.cx = gs.l + gs.w * (domain.x[1] + domain.x[0]) / 2;\n var cy = cd0.cy = gs.t + gs.h * (1 - domain.y[0]) - vph / 2;\n\n if(!entry) {\n return slices.remove();\n }\n\n // previous root 'pt' (can be empty)\n var prevEntry = null;\n // stash of 'previous' position data used by tweening functions\n var prevLookup = {};\n\n if(hasTransition) {\n // Important: do this before binding new sliceData!\n slices.each(function(pt) {\n prevLookup[helpers.getPtId(pt)] = {\n rpx0: pt.rpx0,\n rpx1: pt.rpx1,\n x0: pt.x0,\n x1: pt.x1,\n transform: pt.transform\n };\n\n if(!prevEntry && helpers.isEntry(pt)) {\n prevEntry = pt;\n }\n });\n }\n\n // N.B. slice data isn't the calcdata,\n // grab corresponding calcdata item in sliceData[i].data.data\n var sliceData = partition(entry).descendants();\n\n var maxHeight = entry.height + 1;\n var yOffset = 0;\n var cutoff = maxDepth;\n // N.B. handle multiple-root special case\n if(cd0.hasMultipleRoots && helpers.isHierarchyRoot(entry)) {\n sliceData = sliceData.slice(1);\n maxHeight -= 1;\n yOffset = 1;\n cutoff += 1;\n }\n\n // filter out slices that won't show up on graph\n sliceData = sliceData.filter(function(pt) { return pt.y1 <= cutoff; });\n\n // partition span ('y') to sector radial px value\n var maxY = Math.min(maxHeight, maxDepth);\n var y2rpx = function(y) { return (y - yOffset) / maxY * rMax; };\n // (radial px value, partition angle ('x')) to px [x,y]\n var rx2px = function(r, x) { return [r * Math.cos(x), -r * Math.sin(x)]; };\n // slice path generation fn\n var pathSlice = function(d) { return Lib.pathAnnulus(d.rpx0, d.rpx1, d.x0, d.x1, cx, cy); };\n // slice text translate x/y\n\n var getTargetX = function(d) { return cx + getTextXY(d)[0] * (d.transform.rCenter || 0) + (d.transform.x || 0); };\n var getTargetY = function(d) { return cy + getTextXY(d)[1] * (d.transform.rCenter || 0) + (d.transform.y || 0); };\n\n slices = slices.data(sliceData, helpers.getPtId);\n\n slices.enter().append('g')\n .classed('slice', true);\n\n if(hasTransition) {\n slices.exit().transition()\n .each(function() {\n var sliceTop = d3.select(this);\n\n var slicePath = sliceTop.select('path.surface');\n slicePath.transition().attrTween('d', function(pt2) {\n var interp = makeExitSliceInterpolator(pt2);\n return function(t) { return pathSlice(interp(t)); };\n });\n\n var sliceTextGroup = sliceTop.select('g.slicetext');\n sliceTextGroup.attr('opacity', 0);\n })\n .remove();\n } else {\n slices.exit().remove();\n }\n\n slices.order();\n\n // next x1 (i.e. sector end angle) of previous entry\n var nextX1ofPrevEntry = null;\n if(hasTransition && prevEntry) {\n var prevEntryId = helpers.getPtId(prevEntry);\n slices.each(function(pt) {\n if(nextX1ofPrevEntry === null && (helpers.getPtId(pt) === prevEntryId)) {\n nextX1ofPrevEntry = pt.x1;\n }\n });\n }\n\n var updateSlices = slices;\n if(hasTransition) {\n updateSlices = updateSlices.transition().each('end', function() {\n // N.B. gd._transitioning is (still) *true* by the time\n // transition updates get here\n var sliceTop = d3.select(this);\n helpers.setSliceCursor(sliceTop, gd, {\n hideOnRoot: true,\n hideOnLeaves: true,\n isTransitioning: false\n });\n });\n }\n\n updateSlices.each(function(pt) {\n var sliceTop = d3.select(this);\n\n var slicePath = Lib.ensureSingle(sliceTop, 'path', 'surface', function(s) {\n s.style('pointer-events', 'all');\n });\n\n pt.rpx0 = y2rpx(pt.y0);\n pt.rpx1 = y2rpx(pt.y1);\n pt.xmid = (pt.x0 + pt.x1) / 2;\n pt.pxmid = rx2px(pt.rpx1, pt.xmid);\n pt.midangle = -(pt.xmid - Math.PI / 2);\n pt.startangle = -(pt.x0 - Math.PI / 2);\n pt.stopangle = -(pt.x1 - Math.PI / 2);\n pt.halfangle = 0.5 * Math.min(Lib.angleDelta(pt.x0, pt.x1) || Math.PI, Math.PI);\n pt.ring = 1 - (pt.rpx0 / pt.rpx1);\n pt.rInscribed = getInscribedRadiusFraction(pt, trace);\n\n if(hasTransition) {\n slicePath.transition().attrTween('d', function(pt2) {\n var interp = makeUpdateSliceInterpolator(pt2);\n return function(t) { return pathSlice(interp(t)); };\n });\n } else {\n slicePath.attr('d', pathSlice);\n }\n\n sliceTop\n .call(attachFxHandlers, entry, gd, cd, {\n eventDataKeys: constants.eventDataKeys,\n transitionTime: constants.CLICK_TRANSITION_TIME,\n transitionEasing: constants.CLICK_TRANSITION_EASING\n })\n .call(helpers.setSliceCursor, gd, {\n hideOnRoot: true,\n hideOnLeaves: true,\n isTransitioning: gd._transitioning\n });\n\n slicePath.call(styleOne, pt, trace);\n\n var sliceTextGroup = Lib.ensureSingle(sliceTop, 'g', 'slicetext');\n var sliceText = Lib.ensureSingle(sliceTextGroup, 'text', '', function(s) {\n // prohibit tex interpretation until we can handle\n // tex and regular text together\n s.attr('data-notex', 1);\n });\n\n var font = Lib.ensureUniformFontSize(gd, helpers.determineTextFont(trace, pt, fullLayout.font));\n\n sliceText.text(exports.formatSliceLabel(pt, entry, trace, cd, fullLayout))\n .classed('slicetext', true)\n .attr('text-anchor', 'middle')\n .call(Drawing.font, font)\n .call(svgTextUtils.convertToTspans, gd);\n\n // position the text relative to the slice\n var textBB = Drawing.bBox(sliceText.node());\n pt.transform = transformInsideText(textBB, pt, cd0);\n pt.transform.targetX = getTargetX(pt);\n pt.transform.targetY = getTargetY(pt);\n\n var strTransform = function(d, textBB) {\n var transform = d.transform;\n computeTransform(transform, textBB);\n\n transform.fontSize = font.size;\n recordMinTextSize(trace.type, transform, fullLayout);\n\n return Lib.getTextTransform(transform);\n };\n\n if(hasTransition) {\n sliceText.transition().attrTween('transform', function(pt2) {\n var interp = makeUpdateTextInterpolator(pt2);\n return function(t) { return strTransform(interp(t), textBB); };\n });\n } else {\n sliceText.attr('transform', strTransform(pt, textBB));\n }\n });\n\n function makeExitSliceInterpolator(pt) {\n var id = helpers.getPtId(pt);\n var prev = prevLookup[id];\n var entryPrev = prevLookup[helpers.getPtId(entry)];\n var next;\n\n if(entryPrev) {\n var a = pt.x1 > entryPrev.x1 ? 2 * Math.PI : 0;\n // if pt to remove:\n // - if 'below' where the root-node used to be: shrink it radially inward\n // - otherwise, collapse it clockwise or counterclockwise which ever is shortest to theta=0\n next = pt.rpx1 < entryPrev.rpx1 ? {rpx0: 0, rpx1: 0} : {x0: a, x1: a};\n } else {\n // this happens when maxdepth is set, when leaves must\n // be removed and the rootPt is new (i.e. does not have a 'prev' object)\n var parent;\n var parentId = helpers.getPtId(pt.parent);\n slices.each(function(pt2) {\n if(helpers.getPtId(pt2) === parentId) {\n return parent = pt2;\n }\n });\n var parentChildren = parent.children;\n var ci;\n parentChildren.forEach(function(pt2, i) {\n if(helpers.getPtId(pt2) === id) {\n return ci = i;\n }\n });\n var n = parentChildren.length;\n var interp = d3.interpolate(parent.x0, parent.x1);\n next = {\n rpx0: rMax, rpx1: rMax,\n x0: interp(ci / n), x1: interp((ci + 1) / n)\n };\n }\n\n return d3.interpolate(prev, next);\n }\n\n function makeUpdateSliceInterpolator(pt) {\n var prev0 = prevLookup[helpers.getPtId(pt)];\n var prev;\n var next = {x0: pt.x0, x1: pt.x1, rpx0: pt.rpx0, rpx1: pt.rpx1};\n\n if(prev0) {\n // if pt already on graph, this is easy\n prev = prev0;\n } else {\n // for new pts:\n if(prevEntry) {\n // if trace was visible before\n if(pt.parent) {\n if(nextX1ofPrevEntry) {\n // if new branch, twist it in clockwise or\n // counterclockwise which ever is shorter to\n // its final angle\n var a = pt.x1 > nextX1ofPrevEntry ? 2 * Math.PI : 0;\n prev = {x0: a, x1: a};\n } else {\n // if new leaf (when maxdepth is set),\n // grow it radially and angularly from\n // its parent node\n prev = {rpx0: rMax, rpx1: rMax};\n Lib.extendFlat(prev, interpX0X1FromParent(pt));\n }\n } else {\n // if new root-node, grow it radially\n prev = {rpx0: 0, rpx1: 0};\n }\n } else {\n // start sector of new traces from theta=0\n prev = {x0: 0, x1: 0};\n }\n }\n\n return d3.interpolate(prev, next);\n }\n\n function makeUpdateTextInterpolator(pt) {\n var prev0 = prevLookup[helpers.getPtId(pt)];\n var prev;\n var transform = pt.transform;\n\n if(prev0) {\n prev = prev0;\n } else {\n prev = {\n rpx1: pt.rpx1,\n transform: {\n textPosAngle: transform.textPosAngle,\n scale: 0,\n rotate: transform.rotate,\n rCenter: transform.rCenter,\n x: transform.x,\n y: transform.y\n }\n };\n\n // for new pts:\n if(prevEntry) {\n // if trace was visible before\n if(pt.parent) {\n if(nextX1ofPrevEntry) {\n // if new branch, twist it in clockwise or\n // counterclockwise which ever is shorter to\n // its final angle\n var a = pt.x1 > nextX1ofPrevEntry ? 2 * Math.PI : 0;\n prev.x0 = prev.x1 = a;\n } else {\n // if leaf\n Lib.extendFlat(prev, interpX0X1FromParent(pt));\n }\n } else {\n // if new root-node\n prev.x0 = prev.x1 = 0;\n }\n } else {\n // on new traces\n prev.x0 = prev.x1 = 0;\n }\n }\n\n var textPosAngleFn = d3.interpolate(prev.transform.textPosAngle, pt.transform.textPosAngle);\n var rpx1Fn = d3.interpolate(prev.rpx1, pt.rpx1);\n var x0Fn = d3.interpolate(prev.x0, pt.x0);\n var x1Fn = d3.interpolate(prev.x1, pt.x1);\n var scaleFn = d3.interpolate(prev.transform.scale, transform.scale);\n var rotateFn = d3.interpolate(prev.transform.rotate, transform.rotate);\n\n // smooth out start/end from entry, to try to keep text inside sector\n // while keeping transition smooth\n var pow = transform.rCenter === 0 ? 3 :\n prev.transform.rCenter === 0 ? 1 / 3 :\n 1;\n var _rCenterFn = d3.interpolate(prev.transform.rCenter, transform.rCenter);\n var rCenterFn = function(t) { return _rCenterFn(Math.pow(t, pow)); };\n\n return function(t) {\n var rpx1 = rpx1Fn(t);\n var x0 = x0Fn(t);\n var x1 = x1Fn(t);\n var rCenter = rCenterFn(t);\n var pxmid = rx2px(rpx1, (x0 + x1) / 2);\n var textPosAngle = textPosAngleFn(t);\n\n var d = {\n pxmid: pxmid,\n rpx1: rpx1,\n transform: {\n textPosAngle: textPosAngle,\n rCenter: rCenter,\n x: transform.x,\n y: transform.y\n }\n };\n\n recordMinTextSize(trace.type, transform, fullLayout);\n return {\n transform: {\n targetX: getTargetX(d),\n targetY: getTargetY(d),\n scale: scaleFn(t),\n rotate: rotateFn(t),\n rCenter: rCenter\n }\n };\n };\n }\n\n function interpX0X1FromParent(pt) {\n var parent = pt.parent;\n var parentPrev = prevLookup[helpers.getPtId(parent)];\n var out = {};\n\n if(parentPrev) {\n // if parent is visible\n var parentChildren = parent.children;\n var ci = parentChildren.indexOf(pt);\n var n = parentChildren.length;\n var interp = d3.interpolate(parentPrev.x0, parentPrev.x1);\n out.x0 = interp(ci / n);\n out.x1 = interp(ci / n);\n } else {\n // w/o visible parent\n // TODO !!! HOW ???\n out.x0 = out.x1 = 0;\n }\n\n return out;\n }\n}\n\n// x[0-1] keys are angles [radians]\n// y[0-1] keys are hierarchy heights [integers]\nfunction partition(entry) {\n return d3Hierarchy.partition()\n .size([2 * Math.PI, entry.height + 1])(entry);\n}\n\nexports.formatSliceLabel = function(pt, entry, trace, cd, fullLayout) {\n var texttemplate = trace.texttemplate;\n var textinfo = trace.textinfo;\n\n if(!texttemplate && (!textinfo || textinfo === 'none')) {\n return '';\n }\n\n var separators = fullLayout.separators;\n var cd0 = cd[0];\n var cdi = pt.data.data;\n var hierarchy = cd0.hierarchy;\n var isRoot = helpers.isHierarchyRoot(pt);\n var parent = helpers.getParent(hierarchy, pt);\n var val = helpers.getValue(pt);\n\n if(!texttemplate) {\n var parts = textinfo.split('+');\n var hasFlag = function(flag) { return parts.indexOf(flag) !== -1; };\n var thisText = [];\n var tx;\n\n if(hasFlag('label') && cdi.label) {\n thisText.push(cdi.label);\n }\n\n if(cdi.hasOwnProperty('v') && hasFlag('value')) {\n thisText.push(helpers.formatValue(cdi.v, separators));\n }\n\n if(!isRoot) {\n if(hasFlag('current path')) {\n thisText.push(helpers.getPath(pt.data));\n }\n\n var nPercent = 0;\n if(hasFlag('percent parent')) nPercent++;\n if(hasFlag('percent entry')) nPercent++;\n if(hasFlag('percent root')) nPercent++;\n var hasMultiplePercents = nPercent > 1;\n\n if(nPercent) {\n var percent;\n var addPercent = function(key) {\n tx = helpers.formatPercent(percent, separators);\n\n if(hasMultiplePercents) tx += ' of ' + key;\n thisText.push(tx);\n };\n\n if(hasFlag('percent parent') && !isRoot) {\n percent = val / helpers.getValue(parent);\n addPercent('parent');\n }\n if(hasFlag('percent entry')) {\n percent = val / helpers.getValue(entry);\n addPercent('entry');\n }\n if(hasFlag('percent root')) {\n percent = val / helpers.getValue(hierarchy);\n addPercent('root');\n }\n }\n }\n\n if(hasFlag('text')) {\n tx = Lib.castOption(trace, cdi.i, 'text');\n if(Lib.isValidTextValue(tx)) thisText.push(tx);\n }\n\n return thisText.join('
');\n }\n\n var txt = Lib.castOption(trace, cdi.i, 'texttemplate');\n if(!txt) return '';\n var obj = {};\n if(cdi.label) obj.label = cdi.label;\n if(cdi.hasOwnProperty('v')) {\n obj.value = cdi.v;\n obj.valueLabel = helpers.formatValue(cdi.v, separators);\n }\n\n obj.currentPath = helpers.getPath(pt.data);\n\n if(!isRoot) {\n obj.percentParent = val / helpers.getValue(parent);\n obj.percentParentLabel = helpers.formatPercent(\n obj.percentParent, separators\n );\n obj.parent = helpers.getPtLabel(parent);\n }\n\n obj.percentEntry = val / helpers.getValue(entry);\n obj.percentEntryLabel = helpers.formatPercent(\n obj.percentEntry, separators\n );\n obj.entry = helpers.getPtLabel(entry);\n\n obj.percentRoot = val / helpers.getValue(hierarchy);\n obj.percentRootLabel = helpers.formatPercent(\n obj.percentRoot, separators\n );\n obj.root = helpers.getPtLabel(hierarchy);\n\n if(cdi.hasOwnProperty('color')) {\n obj.color = cdi.color;\n }\n var ptTx = Lib.castOption(trace, cdi.i, 'text');\n if(Lib.isValidTextValue(ptTx) || ptTx === '') obj.text = ptTx;\n obj.customdata = Lib.castOption(trace, cdi.i, 'customdata');\n return Lib.texttemplateString(txt, obj, fullLayout._d3locale, obj, trace._meta || {});\n};\n\nfunction getInscribedRadiusFraction(pt) {\n if(pt.rpx0 === 0 && Lib.isFullCircle([pt.x0, pt.x1])) {\n // special case of 100% with no hole\n return 1;\n } else {\n return Math.max(0, Math.min(\n 1 / (1 + 1 / Math.sin(pt.halfangle)),\n pt.ring / 2\n ));\n }\n}\n\nfunction getTextXY(d) {\n return getCoords(d.rpx1, d.transform.textPosAngle);\n}\n\nfunction getCoords(r, angle) {\n return [r * Math.sin(angle), -r * Math.cos(angle)];\n}\n\n},{\"../../components/drawing\":617,\"../../lib\":728,\"../../lib/svg_text_utils\":752,\"../bar/style\":883,\"../bar/uniform_text\":885,\"../pie/plot\":1117,\"./constants\":1248,\"./fx\":1250,\"./helpers\":1251,\"./style\":1256,\"d3\":164,\"d3-hierarchy\":158}],1256:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Color = _dereq_('../../components/color');\nvar Lib = _dereq_('../../lib');\nvar resizeText = _dereq_('../bar/uniform_text').resizeText;\n\nfunction style(gd) {\n var s = gd._fullLayout._sunburstlayer.selectAll('.trace');\n resizeText(gd, s, 'sunburst');\n\n s.each(function(cd) {\n var gTrace = d3.select(this);\n var cd0 = cd[0];\n var trace = cd0.trace;\n\n gTrace.style('opacity', trace.opacity);\n\n gTrace.selectAll('path.surface').each(function(pt) {\n d3.select(this).call(styleOne, pt, trace);\n });\n });\n}\n\nfunction styleOne(s, pt, trace) {\n var cdi = pt.data.data;\n var isLeaf = !pt.children;\n var ptNumber = cdi.i;\n var lineColor = Lib.castOption(trace, ptNumber, 'marker.line.color') || Color.defaultLine;\n var lineWidth = Lib.castOption(trace, ptNumber, 'marker.line.width') || 0;\n\n s.style('stroke-width', lineWidth)\n .call(Color.fill, cdi.color)\n .call(Color.stroke, lineColor)\n .style('opacity', isLeaf ? trace.leaf.opacity : null);\n}\n\nmodule.exports = {\n style: style,\n styleOne: styleOne\n};\n\n},{\"../../components/color\":595,\"../../lib\":728,\"../bar/uniform_text\":885,\"d3\":164}],1257:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Color = _dereq_('../../components/color');\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar baseAttrs = _dereq_('../../plots/attributes');\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\nvar overrideAll = _dereq_('../../plot_api/edit_types').overrideAll;\n\nfunction makeContourProjAttr(axLetter) {\n return {\n valType: 'boolean',\n \n dflt: false,\n \n };\n}\n\nfunction makeContourAttr(axLetter) {\n return {\n show: {\n valType: 'boolean',\n \n dflt: false,\n \n },\n start: {\n valType: 'number',\n dflt: null,\n \n editType: 'plot',\n // impliedEdits: {'^autocontour': false},\n \n },\n end: {\n valType: 'number',\n dflt: null,\n \n editType: 'plot',\n // impliedEdits: {'^autocontour': false},\n \n },\n size: {\n valType: 'number',\n dflt: null,\n min: 0,\n \n editType: 'plot',\n // impliedEdits: {'^autocontour': false},\n \n },\n project: {\n x: makeContourProjAttr('x'),\n y: makeContourProjAttr('y'),\n z: makeContourProjAttr('z')\n },\n color: {\n valType: 'color',\n \n dflt: Color.defaultLine,\n \n },\n usecolormap: {\n valType: 'boolean',\n \n dflt: false,\n \n },\n width: {\n valType: 'number',\n \n min: 1,\n max: 16,\n dflt: 2,\n \n },\n highlight: {\n valType: 'boolean',\n \n dflt: true,\n \n },\n highlightcolor: {\n valType: 'color',\n \n dflt: Color.defaultLine,\n \n },\n highlightwidth: {\n valType: 'number',\n \n min: 1,\n max: 16,\n dflt: 2,\n \n }\n };\n}\n\nvar attrs = module.exports = overrideAll(extendFlat({\n z: {\n valType: 'data_array',\n \n },\n x: {\n valType: 'data_array',\n \n },\n y: {\n valType: 'data_array',\n \n },\n\n text: {\n valType: 'string',\n \n dflt: '',\n arrayOk: true,\n \n },\n hovertext: {\n valType: 'string',\n \n dflt: '',\n arrayOk: true,\n \n },\n hovertemplate: hovertemplateAttrs(),\n\n connectgaps: {\n valType: 'boolean',\n dflt: false,\n \n editType: 'calc',\n \n },\n\n surfacecolor: {\n valType: 'data_array',\n \n },\n},\n\ncolorScaleAttrs('', {\n colorAttr: 'z or surfacecolor',\n showScaleDflt: true,\n autoColorDflt: false,\n editTypeOverride: 'calc'\n}), {\n contours: {\n x: makeContourAttr('x'),\n y: makeContourAttr('y'),\n z: makeContourAttr('z')\n },\n hidesurface: {\n valType: 'boolean',\n \n dflt: false,\n \n },\n\n lightposition: {\n x: {\n valType: 'number',\n \n min: -1e5,\n max: 1e5,\n dflt: 10,\n \n },\n y: {\n valType: 'number',\n \n min: -1e5,\n max: 1e5,\n dflt: 1e4,\n \n },\n z: {\n valType: 'number',\n \n min: -1e5,\n max: 1e5,\n dflt: 0,\n \n }\n },\n\n lighting: {\n ambient: {\n valType: 'number',\n \n min: 0.00,\n max: 1.0,\n dflt: 0.8,\n \n },\n diffuse: {\n valType: 'number',\n \n min: 0.00,\n max: 1.00,\n dflt: 0.8,\n \n },\n specular: {\n valType: 'number',\n \n min: 0.00,\n max: 2.00,\n dflt: 0.05,\n \n },\n roughness: {\n valType: 'number',\n \n min: 0.00,\n max: 1.00,\n dflt: 0.5,\n \n },\n fresnel: {\n valType: 'number',\n \n min: 0.00,\n max: 5.00,\n dflt: 0.2,\n \n }\n },\n\n opacity: {\n valType: 'number',\n \n min: 0,\n max: 1,\n dflt: 1,\n \n },\n\n opacityscale: {\n valType: 'any',\n \n editType: 'calc',\n \n },\n\n _deprecated: {\n zauto: extendFlat({}, colorScaleAttrs.zauto, {\n \n }),\n zmin: extendFlat({}, colorScaleAttrs.zmin, {\n \n }),\n zmax: extendFlat({}, colorScaleAttrs.zmax, {\n \n })\n },\n\n hoverinfo: extendFlat({}, baseAttrs.hoverinfo),\n showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false}),\n}), 'calc', 'nested');\n\nattrs.x.editType = attrs.y.editType = attrs.z.editType = 'calc+clearAxisTypes';\nattrs.transforms = undefined;\n\n},{\"../../components/color\":595,\"../../components/colorscale/attributes\":602,\"../../lib/extend\":719,\"../../plot_api/edit_types\":759,\"../../plots/attributes\":773,\"../../plots/template_attributes\":854}],1258:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar colorscaleCalc = _dereq_('../../components/colorscale/calc');\n\n\n// Compute auto-z and autocolorscale if applicable\nmodule.exports = function calc(gd, trace) {\n if(trace.surfacecolor) {\n colorscaleCalc(gd, trace, {\n vals: trace.surfacecolor,\n containerStr: '',\n cLetter: 'c'\n });\n } else {\n colorscaleCalc(gd, trace, {\n vals: trace.z,\n containerStr: '',\n cLetter: 'c'\n });\n }\n};\n\n},{\"../../components/colorscale/calc\":603}],1259:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n'use strict';\n\nvar createSurface = _dereq_('gl-surface3d');\n\nvar ndarray = _dereq_('ndarray');\nvar ndarrayInterp2d = _dereq_('ndarray-linear-interpolate').d2;\n\nvar interp2d = _dereq_('../heatmap/interp2d');\nvar findEmpties = _dereq_('../heatmap/find_empties');\n\nvar isArrayOrTypedArray = _dereq_('../../lib').isArrayOrTypedArray;\nvar parseColorScale = _dereq_('../../lib/gl_format_color').parseColorScale;\nvar str2RgbaArray = _dereq_('../../lib/str2rgbarray');\nvar extractOpts = _dereq_('../../components/colorscale').extractOpts;\n\nfunction SurfaceTrace(scene, surface, uid) {\n this.scene = scene;\n this.uid = uid;\n this.surface = surface;\n this.data = null;\n this.showContour = [false, false, false];\n this.contourStart = [null, null, null];\n this.contourEnd = [null, null, null];\n this.contourSize = [0, 0, 0];\n this.minValues = [Infinity, Infinity, Infinity];\n this.maxValues = [-Infinity, -Infinity, -Infinity];\n this.dataScaleX = 1.0;\n this.dataScaleY = 1.0;\n this.refineData = true;\n this.objectOffset = [0, 0, 0];\n}\n\nvar proto = SurfaceTrace.prototype;\n\nproto.getXat = function(a, b, calendar, axis) {\n var v = (\n (!isArrayOrTypedArray(this.data.x)) ?\n a :\n (isArrayOrTypedArray(this.data.x[0])) ?\n this.data.x[b][a] :\n this.data.x[a]\n );\n\n return (calendar === undefined) ? v : axis.d2l(v, 0, calendar);\n};\n\nproto.getYat = function(a, b, calendar, axis) {\n var v = (\n (!isArrayOrTypedArray(this.data.y)) ?\n b :\n (isArrayOrTypedArray(this.data.y[0])) ?\n this.data.y[b][a] :\n this.data.y[b]\n );\n\n return (calendar === undefined) ? v : axis.d2l(v, 0, calendar);\n};\n\nproto.getZat = function(a, b, calendar, axis) {\n var v = this.data.z[b][a];\n\n if(v === null && this.data.connectgaps && this.data._interpolatedZ) {\n v = this.data._interpolatedZ[b][a];\n }\n\n return (calendar === undefined) ? v : axis.d2l(v, 0, calendar);\n};\n\nproto.handlePick = function(selection) {\n if(selection.object === this.surface) {\n var xRatio = (selection.data.index[0] - 1) / this.dataScaleX - 1;\n var yRatio = (selection.data.index[1] - 1) / this.dataScaleY - 1;\n\n var j = Math.max(Math.min(Math.round(xRatio), this.data.z[0].length - 1), 0);\n var k = Math.max(Math.min(Math.round(yRatio), this.data._ylength - 1), 0);\n\n selection.index = [j, k];\n\n selection.traceCoordinate = [\n this.getXat(j, k),\n this.getYat(j, k),\n this.getZat(j, k)\n ];\n\n selection.dataCoordinate = [\n this.getXat(j, k, this.data.xcalendar, this.scene.fullSceneLayout.xaxis),\n this.getYat(j, k, this.data.ycalendar, this.scene.fullSceneLayout.yaxis),\n this.getZat(j, k, this.data.zcalendar, this.scene.fullSceneLayout.zaxis)\n ];\n\n for(var i = 0; i < 3; i++) {\n var v = selection.dataCoordinate[i];\n if(v !== null && v !== undefined) {\n selection.dataCoordinate[i] *= this.scene.dataScale[i];\n }\n }\n\n var text = this.data.hovertext || this.data.text;\n if(Array.isArray(text) && text[k] && text[k][j] !== undefined) {\n selection.textLabel = text[k][j];\n } else if(text) {\n selection.textLabel = text;\n } else {\n selection.textLabel = '';\n }\n\n selection.data.dataCoordinate = selection.dataCoordinate.slice();\n\n this.surface.highlight(selection.data);\n\n // Snap spikes to data coordinate\n this.scene.glplot.spikes.position = selection.dataCoordinate;\n\n return true;\n }\n};\n\nfunction isColormapCircular(colormap) {\n var first = colormap[0].rgb;\n var last = colormap[colormap.length - 1].rgb;\n\n return (\n first[0] === last[0] &&\n first[1] === last[1] &&\n first[2] === last[2] &&\n first[3] === last[3]\n );\n}\n\nvar shortPrimes = [\n 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97,\n 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199,\n 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293,\n 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397,\n 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499,\n 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599,\n 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691,\n 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797,\n 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887,\n 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997,\n 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097,\n 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193,\n 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297,\n 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399,\n 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499,\n 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597,\n 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699,\n 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789,\n 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889,\n 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999,\n 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099,\n 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179,\n 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297,\n 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399,\n 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477,\n 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593,\n 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699,\n 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797,\n 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897,\n 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999\n];\n\nfunction getPow(a, b) {\n if(a < b) return 0;\n var n = 0;\n while(Math.floor(a % b) === 0) {\n a /= b;\n n++;\n }\n return n;\n}\n\nfunction getFactors(a) {\n var powers = [];\n for(var i = 0; i < shortPrimes.length; i++) {\n var b = shortPrimes[i];\n powers.push(\n getPow(a, b)\n );\n }\n return powers;\n}\n\nfunction smallestDivisor(a) {\n var A = getFactors(a);\n var result = a;\n for(var i = 0; i < shortPrimes.length; i++) {\n if(A[i] > 0) {\n result = shortPrimes[i];\n break;\n }\n }\n return result;\n}\n\nfunction leastCommonMultiple(a, b) {\n if(a < 1 || b < 1) return undefined;\n var A = getFactors(a);\n var B = getFactors(b);\n var n = 1;\n for(var i = 0; i < shortPrimes.length; i++) {\n n *= Math.pow(\n shortPrimes[i], Math.max(A[i], B[i])\n );\n }\n return n;\n}\n\nfunction arrayLCM(A) {\n if(A.length === 0) return undefined;\n var n = 1;\n for(var i = 0; i < A.length; i++) {\n n = leastCommonMultiple(n, A[i]);\n }\n return n;\n}\n\nproto.calcXnums = function(xlen) {\n var i;\n var nums = [];\n for(i = 1; i < xlen; i++) {\n var a = this.getXat(i - 1, 0);\n var b = this.getXat(i, 0);\n\n if(b !== a &&\n a !== undefined && a !== null &&\n b !== undefined && b !== null) {\n nums[i - 1] = Math.abs(b - a);\n } else {\n nums[i - 1] = 0;\n }\n }\n\n var totalDist = 0;\n for(i = 1; i < xlen; i++) {\n totalDist += nums[i - 1];\n }\n\n for(i = 1; i < xlen; i++) {\n if(nums[i - 1] === 0) {\n nums[i - 1] = 1;\n } else {\n nums[i - 1] = Math.round(totalDist / nums[i - 1]);\n }\n }\n\n return nums;\n};\n\nproto.calcYnums = function(ylen) {\n var i;\n var nums = [];\n for(i = 1; i < ylen; i++) {\n var a = this.getYat(0, i - 1);\n var b = this.getYat(0, i);\n\n if(b !== a &&\n a !== undefined && a !== null &&\n b !== undefined && b !== null) {\n nums[i - 1] = Math.abs(b - a);\n } else {\n nums[i - 1] = 0;\n }\n }\n\n var totalDist = 0;\n for(i = 1; i < ylen; i++) {\n totalDist += nums[i - 1];\n }\n\n for(i = 1; i < ylen; i++) {\n if(nums[i - 1] === 0) {\n nums[i - 1] = 1;\n } else {\n nums[i - 1] = Math.round(totalDist / nums[i - 1]);\n }\n }\n\n return nums;\n};\n\nvar highlyComposites = [1, 2, 4, 6, 12, 24, 36, 48, 60, 120, 180, 240, 360, 720, 840, 1260];\n\nvar MIN_RESOLUTION = highlyComposites[9];\nvar MAX_RESOLUTION = highlyComposites[13];\n\nproto.estimateScale = function(resSrc, axis) {\n var nums = (axis === 0) ?\n this.calcXnums(resSrc) :\n this.calcYnums(resSrc);\n\n var resDst = 1 + arrayLCM(nums);\n\n while(resDst < MIN_RESOLUTION) {\n resDst *= 2;\n }\n\n while(resDst > MAX_RESOLUTION) {\n resDst--;\n resDst /= smallestDivisor(resDst);\n resDst++;\n\n if(resDst < MIN_RESOLUTION) {\n // resDst = MIN_RESOLUTION; // option 1: use min resolution\n resDst = MAX_RESOLUTION; // option 2: use max resolution\n }\n }\n\n var scale = Math.round(resDst / resSrc);\n return (scale > 1) ? scale : 1;\n};\n\n// based on Mikola Lysenko's ndarray-homography\n// see https://github.com/scijs/ndarray-homography\n\nfunction fnHomography(out, inp, X) {\n var w = X[8] + X[2] * inp[0] + X[5] * inp[1];\n out[0] = (X[6] + X[0] * inp[0] + X[3] * inp[1]) / w;\n out[1] = (X[7] + X[1] * inp[0] + X[4] * inp[1]) / w;\n return out;\n}\n\nfunction homography(dest, src, X) {\n warp(dest, src, fnHomography, X);\n return dest;\n}\n\n// based on Mikola Lysenko's ndarray-warp\n// see https://github.com/scijs/ndarray-warp\n\nfunction warp(dest, src, func, X) {\n var warped = [0, 0];\n var ni = dest.shape[0];\n var nj = dest.shape[1];\n for(var i = 0; i < ni; i++) {\n for(var j = 0; j < nj; j++) {\n func(warped, [i, j], X);\n dest.set(i, j, ndarrayInterp2d(src, warped[0], warped[1]));\n }\n }\n return dest;\n}\n\nproto.refineCoords = function(coords) {\n var scaleW = this.dataScaleX;\n var scaleH = this.dataScaleY;\n\n var width = coords[0].shape[0];\n var height = coords[0].shape[1];\n\n var newWidth = Math.floor(coords[0].shape[0] * scaleW + 1) | 0;\n var newHeight = Math.floor(coords[0].shape[1] * scaleH + 1) | 0;\n\n // Pad coords by +1\n var padWidth = 1 + width + 1;\n var padHeight = 1 + height + 1;\n var padImg = ndarray(new Float32Array(padWidth * padHeight), [padWidth, padHeight]);\n var X = [\n 1 / scaleW, 0, 0,\n 0, 1 / scaleH, 0,\n 0, 0, 1\n ];\n\n for(var i = 0; i < coords.length; ++i) {\n this.surface.padField(padImg, coords[i]);\n\n var scaledImg = ndarray(new Float32Array(newWidth * newHeight), [newWidth, newHeight]);\n homography(scaledImg, padImg, X);\n coords[i] = scaledImg;\n }\n};\n\nfunction insertIfNewLevel(arr, newValue) {\n var found = false;\n for(var k = 0; k < arr.length; k++) {\n if(newValue === arr[k]) {\n found = true;\n break;\n }\n }\n if(found === false) arr.push(newValue);\n}\n\nproto.setContourLevels = function() {\n var newLevels = [[], [], []];\n var useNewLevels = [false, false, false];\n var needsUpdate = false;\n\n var i, j, value;\n\n for(i = 0; i < 3; ++i) {\n if(this.showContour[i]) {\n needsUpdate = true;\n\n if(\n this.contourSize[i] > 0 &&\n this.contourStart[i] !== null &&\n this.contourEnd[i] !== null &&\n this.contourEnd[i] > this.contourStart[i]\n ) {\n useNewLevels[i] = true;\n\n for(j = this.contourStart[i]; j < this.contourEnd[i]; j += this.contourSize[i]) {\n value = j * this.scene.dataScale[i];\n\n insertIfNewLevel(newLevels[i], value);\n }\n }\n }\n }\n\n if(needsUpdate) {\n var allLevels = [[], [], []];\n for(i = 0; i < 3; ++i) {\n if(this.showContour[i]) {\n allLevels[i] = useNewLevels[i] ? newLevels[i] : this.scene.contourLevels[i];\n }\n }\n this.surface.update({ levels: allLevels });\n }\n};\n\nproto.update = function(data) {\n var scene = this.scene;\n var sceneLayout = scene.fullSceneLayout;\n var surface = this.surface;\n var alpha = data.opacity;\n var colormap = parseColorScale(data, alpha);\n var scaleFactor = scene.dataScale;\n var xlen = data.z[0].length;\n var ylen = data._ylength;\n var contourLevels = scene.contourLevels;\n\n // Save data\n this.data = data;\n\n /*\n * Fill and transpose zdata.\n * Consistent with 'heatmap' and 'contour', plotly 'surface'\n * 'z' are such that sub-arrays correspond to y-coords\n * and that the sub-array entries correspond to a x-coords,\n * which is the transpose of 'gl-surface-plot'.\n */\n\n var i, j, k, v;\n var rawCoords = [];\n for(i = 0; i < 3; i++) {\n rawCoords[i] = [];\n for(j = 0; j < xlen; j++) {\n rawCoords[i][j] = [];\n /*\n for(k = 0; k < ylen; k++) {\n rawCoords[i][j][k] = undefined;\n }\n */\n }\n }\n\n // coords x, y & z\n for(j = 0; j < xlen; j++) {\n for(k = 0; k < ylen; k++) {\n rawCoords[0][j][k] = this.getXat(j, k, data.xcalendar, sceneLayout.xaxis);\n rawCoords[1][j][k] = this.getYat(j, k, data.ycalendar, sceneLayout.yaxis);\n rawCoords[2][j][k] = this.getZat(j, k, data.zcalendar, sceneLayout.zaxis);\n }\n }\n\n if(data.connectgaps) {\n data._emptypoints = findEmpties(rawCoords[2]);\n interp2d(rawCoords[2], data._emptypoints);\n\n data._interpolatedZ = [];\n for(j = 0; j < xlen; j++) {\n data._interpolatedZ[j] = [];\n for(k = 0; k < ylen; k++) {\n data._interpolatedZ[j][k] = rawCoords[2][j][k];\n }\n }\n }\n\n // Note: log axes are not defined in surfaces yet.\n // but they could be defined here...\n\n for(i = 0; i < 3; i++) {\n for(j = 0; j < xlen; j++) {\n for(k = 0; k < ylen; k++) {\n v = rawCoords[i][j][k];\n if(v === null || v === undefined) {\n rawCoords[i][j][k] = NaN;\n } else {\n v = rawCoords[i][j][k] *= scaleFactor[i];\n }\n }\n }\n }\n\n for(i = 0; i < 3; i++) {\n for(j = 0; j < xlen; j++) {\n for(k = 0; k < ylen; k++) {\n v = rawCoords[i][j][k];\n if(v !== null && v !== undefined) {\n if(this.minValues[i] > v) {\n this.minValues[i] = v;\n }\n if(this.maxValues[i] < v) {\n this.maxValues[i] = v;\n }\n }\n }\n }\n }\n\n for(i = 0; i < 3; i++) {\n this.objectOffset[i] = 0.5 * (this.minValues[i] + this.maxValues[i]);\n }\n\n for(i = 0; i < 3; i++) {\n for(j = 0; j < xlen; j++) {\n for(k = 0; k < ylen; k++) {\n v = rawCoords[i][j][k];\n if(v !== null && v !== undefined) {\n rawCoords[i][j][k] -= this.objectOffset[i];\n }\n }\n }\n }\n\n // convert processed raw data to Float32 matrices\n var coords = [\n ndarray(new Float32Array(xlen * ylen), [xlen, ylen]),\n ndarray(new Float32Array(xlen * ylen), [xlen, ylen]),\n ndarray(new Float32Array(xlen * ylen), [xlen, ylen])\n ];\n for(i = 0; i < 3; i++) {\n for(j = 0; j < xlen; j++) {\n for(k = 0; k < ylen; k++) {\n coords[i].set(j, k, rawCoords[i][j][k]);\n }\n }\n }\n rawCoords = []; // free memory\n\n var params = {\n colormap: colormap,\n levels: [[], [], []],\n showContour: [true, true, true],\n showSurface: !data.hidesurface,\n contourProject: [\n [false, false, false],\n [false, false, false],\n [false, false, false]\n ],\n contourWidth: [1, 1, 1],\n contourColor: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]],\n contourTint: [1, 1, 1],\n dynamicColor: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]],\n dynamicWidth: [1, 1, 1],\n dynamicTint: [1, 1, 1],\n opacityscale: data.opacityscale,\n opacity: data.opacity\n };\n\n var cOpts = extractOpts(data);\n params.intensityBounds = [cOpts.min, cOpts.max];\n\n // Refine surface color if necessary\n if(data.surfacecolor) {\n var intensity = ndarray(new Float32Array(xlen * ylen), [xlen, ylen]);\n\n for(j = 0; j < xlen; j++) {\n for(k = 0; k < ylen; k++) {\n intensity.set(j, k, data.surfacecolor[k][j]);\n }\n }\n\n coords.push(intensity);\n } else {\n // when 'z' is used as 'intensity',\n // we must scale its value\n params.intensityBounds[0] *= scaleFactor[2];\n params.intensityBounds[1] *= scaleFactor[2];\n }\n\n if(MAX_RESOLUTION < coords[0].shape[0] ||\n MAX_RESOLUTION < coords[0].shape[1]) {\n this.refineData = false;\n }\n\n if(this.refineData === true) {\n this.dataScaleX = this.estimateScale(coords[0].shape[0], 0);\n this.dataScaleY = this.estimateScale(coords[0].shape[1], 1);\n if(this.dataScaleX !== 1 || this.dataScaleY !== 1) {\n this.refineCoords(coords);\n }\n }\n\n if(data.surfacecolor) {\n params.intensity = coords.pop();\n }\n\n var highlightEnable = [true, true, true];\n var axis = ['x', 'y', 'z'];\n\n for(i = 0; i < 3; ++i) {\n var contourParams = data.contours[axis[i]];\n highlightEnable[i] = contourParams.highlight;\n\n params.showContour[i] = contourParams.show || contourParams.highlight;\n if(!params.showContour[i]) continue;\n\n params.contourProject[i] = [\n contourParams.project.x,\n contourParams.project.y,\n contourParams.project.z\n ];\n\n if(contourParams.show) {\n this.showContour[i] = true;\n params.levels[i] = contourLevels[i];\n surface.highlightColor[i] = params.contourColor[i] = str2RgbaArray(contourParams.color);\n\n if(contourParams.usecolormap) {\n surface.highlightTint[i] = params.contourTint[i] = 0;\n } else {\n surface.highlightTint[i] = params.contourTint[i] = 1;\n }\n params.contourWidth[i] = contourParams.width;\n\n this.contourStart[i] = contourParams.start;\n this.contourEnd[i] = contourParams.end;\n this.contourSize[i] = contourParams.size;\n } else {\n this.showContour[i] = false;\n\n this.contourStart[i] = null;\n this.contourEnd[i] = null;\n this.contourSize[i] = 0;\n }\n\n if(contourParams.highlight) {\n params.dynamicColor[i] = str2RgbaArray(contourParams.highlightcolor);\n params.dynamicWidth[i] = contourParams.highlightwidth;\n }\n }\n\n // see https://github.com/plotly/plotly.js/issues/940\n if(isColormapCircular(colormap)) {\n params.vertexColor = true;\n }\n\n params.objectOffset = this.objectOffset;\n\n params.coords = coords;\n surface.update(params);\n\n surface.visible = data.visible;\n surface.enableDynamic = highlightEnable;\n surface.enableHighlight = highlightEnable;\n\n surface.snapToData = true;\n\n if('lighting' in data) {\n surface.ambientLight = data.lighting.ambient;\n surface.diffuseLight = data.lighting.diffuse;\n surface.specularLight = data.lighting.specular;\n surface.roughness = data.lighting.roughness;\n surface.fresnel = data.lighting.fresnel;\n }\n\n if('lightposition' in data) {\n surface.lightPosition = [data.lightposition.x, data.lightposition.y, data.lightposition.z];\n }\n\n if(alpha && alpha < 1) {\n surface.supportsTransparency = true;\n }\n};\n\nproto.dispose = function() {\n this.scene.glplot.remove(this.surface);\n this.surface.dispose();\n};\n\nfunction createSurfaceTrace(scene, data) {\n var gl = scene.glplot.gl;\n var surface = createSurface({ gl: gl });\n var result = new SurfaceTrace(scene, surface, data.uid);\n surface._trace = result;\n result.update(data);\n scene.glplot.add(surface);\n return result;\n}\n\nmodule.exports = createSurfaceTrace;\n\n},{\"../../components/colorscale\":607,\"../../lib\":728,\"../../lib/gl_format_color\":725,\"../../lib/str2rgbarray\":751,\"../heatmap/find_empties\":1019,\"../heatmap/interp2d\":1022,\"gl-surface3d\":320,\"ndarray\":448,\"ndarray-linear-interpolate\":442}],1260:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Registry = _dereq_('../../registry');\nvar Lib = _dereq_('../../lib');\n\nvar colorscaleDefaults = _dereq_('../../components/colorscale/defaults');\nvar attributes = _dereq_('./attributes');\n\nvar MIN = 0.1; // Note: often we don't want the data cube to be disappeared\n\nfunction createWave(n, minOpacity) {\n var arr = [];\n var steps = 32; // Max: 256\n for(var i = 0; i < steps; i++) {\n var u = i / (steps - 1);\n var v = minOpacity + (1 - minOpacity) * (1 - Math.pow(Math.sin(n * u * Math.PI), 2));\n arr.push([\n u,\n Math.max(0, Math.min(1, v))\n ]);\n }\n return arr;\n}\n\nfunction isValidScaleArray(scl) {\n var highestVal = 0;\n\n if(!Array.isArray(scl) || scl.length < 2) return false;\n\n if(!scl[0] || !scl[scl.length - 1]) return false;\n\n if(+scl[0][0] !== 0 || +scl[scl.length - 1][0] !== 1) return false;\n\n for(var i = 0; i < scl.length; i++) {\n var si = scl[i];\n\n if(si.length !== 2 || +si[0] < highestVal) {\n return false;\n }\n\n highestVal = +si[0];\n }\n\n return true;\n}\n\nfunction supplyDefaults(traceIn, traceOut, defaultColor, layout) {\n var i, j;\n\n function coerce(attr, dflt) {\n return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);\n }\n\n var x = coerce('x');\n var y = coerce('y');\n\n var z = coerce('z');\n if(!z || !z.length ||\n (x ? (x.length < 1) : false) ||\n (y ? (y.length < 1) : false)\n ) {\n traceOut.visible = false;\n return;\n }\n\n traceOut._xlength = (Array.isArray(x) && Lib.isArrayOrTypedArray(x[0])) ? z.length : z[0].length;\n traceOut._ylength = z.length;\n\n var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');\n handleCalendarDefaults(traceIn, traceOut, ['x', 'y', 'z'], layout);\n\n coerce('text');\n coerce('hovertext');\n coerce('hovertemplate');\n\n // Coerce remaining properties\n [\n 'lighting.ambient',\n 'lighting.diffuse',\n 'lighting.specular',\n 'lighting.roughness',\n 'lighting.fresnel',\n 'lightposition.x',\n 'lightposition.y',\n 'lightposition.z',\n 'hidesurface',\n 'connectgaps',\n 'opacity'\n ].forEach(function(x) { coerce(x); });\n\n var surfaceColor = coerce('surfacecolor');\n\n var dims = ['x', 'y', 'z'];\n for(i = 0; i < 3; ++i) {\n var contourDim = 'contours.' + dims[i];\n var show = coerce(contourDim + '.show');\n var highlight = coerce(contourDim + '.highlight');\n\n if(show || highlight) {\n for(j = 0; j < 3; ++j) {\n coerce(contourDim + '.project.' + dims[j]);\n }\n }\n\n if(show) {\n coerce(contourDim + '.color');\n coerce(contourDim + '.width');\n coerce(contourDim + '.usecolormap');\n }\n\n if(highlight) {\n coerce(contourDim + '.highlightcolor');\n coerce(contourDim + '.highlightwidth');\n }\n\n coerce(contourDim + '.start');\n coerce(contourDim + '.end');\n coerce(contourDim + '.size');\n }\n\n // backward compatibility block\n if(!surfaceColor) {\n mapLegacy(traceIn, 'zmin', 'cmin');\n mapLegacy(traceIn, 'zmax', 'cmax');\n mapLegacy(traceIn, 'zauto', 'cauto');\n }\n\n // TODO if contours.?.usecolormap are false and hidesurface is true\n // the colorbar shouldn't be shown by default\n\n colorscaleDefaults(\n traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'c'}\n );\n\n opacityscaleDefaults(traceIn, traceOut, layout, coerce);\n\n // disable 1D transforms - currently surface does NOT support column data like heatmap does\n // you can use mesh3d for this use case, but not surface\n traceOut._length = null;\n}\n\nfunction opacityscaleDefaults(traceIn, traceOut, layout, coerce) {\n var opacityscale = coerce('opacityscale');\n if(opacityscale === 'max') {\n traceOut.opacityscale = [[0, MIN], [1, 1]];\n } else if(opacityscale === 'min') {\n traceOut.opacityscale = [[0, 1], [1, MIN]];\n } else if(opacityscale === 'extremes') {\n traceOut.opacityscale = createWave(1, MIN);\n } else if(!isValidScaleArray(opacityscale)) {\n traceOut.opacityscale = undefined;\n }\n}\n\nfunction mapLegacy(traceIn, oldAttr, newAttr) {\n if(oldAttr in traceIn && !(newAttr in traceIn)) {\n traceIn[newAttr] = traceIn[oldAttr];\n }\n}\n\nmodule.exports = {\n supplyDefaults: supplyDefaults,\n opacityscaleDefaults: opacityscaleDefaults\n};\n\n},{\"../../components/colorscale/defaults\":605,\"../../lib\":728,\"../../registry\":859,\"./attributes\":1257}],1261:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults').supplyDefaults,\n colorbar: {\n min: 'cmin',\n max: 'cmax'\n },\n calc: _dereq_('./calc'),\n plot: _dereq_('./convert'),\n\n moduleType: 'trace',\n name: 'surface',\n basePlotModule: _dereq_('../../plots/gl3d'),\n categories: ['gl3d', '2dMap', 'showLegend'],\n meta: {\n \n }\n};\n\n},{\"../../plots/gl3d\":818,\"./attributes\":1257,\"./calc\":1258,\"./convert\":1259,\"./defaults\":1260}],1262:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar annAttrs = _dereq_('../../components/annotations/attributes');\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\nvar overrideAll = _dereq_('../../plot_api/edit_types').overrideAll;\nvar fontAttrs = _dereq_('../../plots/font_attributes');\nvar domainAttrs = _dereq_('../../plots/domain').attributes;\n\nvar FORMAT_LINK = _dereq_('../../constants/docs').FORMAT_LINK;\n\nvar attrs = module.exports = overrideAll({\n domain: domainAttrs({name: 'table', trace: true}),\n\n columnwidth: {\n valType: 'number',\n arrayOk: true,\n dflt: null,\n \n \n },\n\n columnorder: {\n valType: 'data_array',\n \n \n },\n\n header: {\n\n values: {\n valType: 'data_array',\n \n dflt: [],\n \n },\n\n format: {\n valType: 'data_array',\n \n dflt: [],\n \n },\n\n prefix: {\n valType: 'string',\n arrayOk: true,\n dflt: null,\n \n \n },\n\n suffix: {\n valType: 'string',\n arrayOk: true,\n dflt: null,\n \n \n },\n\n height: {\n valType: 'number',\n dflt: 28,\n \n \n },\n\n align: extendFlat({}, annAttrs.align, {arrayOk: true}),\n\n line: {\n width: {\n valType: 'number',\n arrayOk: true,\n dflt: 1,\n \n },\n color: {\n valType: 'color',\n arrayOk: true,\n dflt: 'grey',\n \n }\n },\n\n fill: {\n color: {\n valType: 'color',\n arrayOk: true,\n dflt: 'white',\n \n \n }\n },\n\n font: extendFlat({}, fontAttrs({arrayOk: true}))\n },\n\n cells: {\n\n values: {\n valType: 'data_array',\n \n dflt: [],\n \n },\n\n format: {\n valType: 'data_array',\n \n dflt: [],\n \n },\n\n prefix: {\n valType: 'string',\n arrayOk: true,\n dflt: null,\n \n \n },\n\n suffix: {\n valType: 'string',\n arrayOk: true,\n dflt: null,\n \n \n },\n\n height: {\n valType: 'number',\n dflt: 20,\n \n \n },\n\n align: extendFlat({}, annAttrs.align, {arrayOk: true}),\n\n line: {\n width: {\n valType: 'number',\n arrayOk: true,\n dflt: 1,\n \n },\n color: {\n valType: 'color',\n arrayOk: true,\n dflt: 'grey',\n \n }\n },\n\n fill: {\n color: {\n valType: 'color',\n arrayOk: true,\n \n dflt: 'white',\n \n }\n },\n\n font: extendFlat({}, fontAttrs({arrayOk: true}))\n }\n}, 'calc', 'from-root');\nattrs.transforms = undefined;\n\n},{\"../../components/annotations/attributes\":578,\"../../constants/docs\":699,\"../../lib/extend\":719,\"../../plot_api/edit_types\":759,\"../../plots/domain\":803,\"../../plots/font_attributes\":804}],1263:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar getModuleCalcData = _dereq_('../../plots/get_data').getModuleCalcData;\nvar tablePlot = _dereq_('./plot');\n\nvar TABLE = 'table';\n\nexports.name = TABLE;\n\nexports.plot = function(gd) {\n var calcData = getModuleCalcData(gd.calcdata, TABLE)[0];\n if(calcData.length) tablePlot(gd, calcData);\n};\n\nexports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) {\n var hadTable = (oldFullLayout._has && oldFullLayout._has(TABLE));\n var hasTable = (newFullLayout._has && newFullLayout._has(TABLE));\n\n if(hadTable && !hasTable) {\n oldFullLayout._paperdiv.selectAll('.table').remove();\n }\n};\n\n},{\"../../plots/get_data\":813,\"./plot\":1270}],1264:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar wrap = _dereq_('../../lib/gup').wrap;\n\nmodule.exports = function calc() {\n // we don't actually need to include the trace here, since that will be added\n // by Plots.doCalcdata, and that's all we actually need later.\n return wrap({});\n};\n\n},{\"../../lib/gup\":726}],1265:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n cellPad: 8,\n columnExtentOffset: 10,\n columnTitleOffset: 28,\n emptyHeaderHeight: 16,\n latexCheck: /^\\$.*\\$$/,\n goldenRatio: 1.618,\n lineBreaker: '
',\n maxDimensionCount: 60,\n overdrag: 45,\n releaseTransitionDuration: 120,\n releaseTransitionEase: 'cubic-out',\n scrollbarCaptureWidth: 18,\n scrollbarHideDelay: 1000,\n scrollbarHideDuration: 1000,\n scrollbarOffset: 5,\n scrollbarWidth: 8,\n transitionDuration: 100,\n transitionEase: 'cubic-out',\n uplift: 5,\n wrapSpacer: ' ',\n wrapSplitCharacter: ' ',\n cn: {\n // general class names\n table: 'table',\n tableControlView: 'table-control-view',\n scrollBackground: 'scroll-background',\n yColumn: 'y-column',\n columnBlock: 'column-block',\n scrollAreaClip: 'scroll-area-clip',\n scrollAreaClipRect: 'scroll-area-clip-rect',\n columnBoundary: 'column-boundary',\n columnBoundaryClippath: 'column-boundary-clippath',\n columnBoundaryRect: 'column-boundary-rect',\n columnCells: 'column-cells',\n columnCell: 'column-cell',\n cellRect: 'cell-rect',\n cellText: 'cell-text',\n cellTextHolder: 'cell-text-holder',\n\n // scroll related class names\n scrollbarKit: 'scrollbar-kit',\n scrollbar: 'scrollbar',\n scrollbarSlider: 'scrollbar-slider',\n scrollbarGlyph: 'scrollbar-glyph',\n scrollbarCaptureZone: 'scrollbar-capture-zone'\n }\n};\n\n},{}],1266:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar c = _dereq_('./constants');\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\nvar isNumeric = _dereq_('fast-isnumeric');\n\n// pure functions, don't alter but passes on `gd` and parts of `trace` without deep copying\nmodule.exports = function calc(gd, trace) {\n var cellsValues = squareStringMatrix(trace.cells.values);\n var slicer = function(a) {\n return a.slice(trace.header.values.length, a.length);\n };\n var headerValuesIn = squareStringMatrix(trace.header.values);\n if(headerValuesIn.length && !headerValuesIn[0].length) {\n headerValuesIn[0] = [''];\n headerValuesIn = squareStringMatrix(headerValuesIn);\n }\n var headerValues = headerValuesIn\n .concat(slicer(cellsValues).map(function() {\n return emptyStrings((headerValuesIn[0] || ['']).length);\n }));\n\n var domain = trace.domain;\n var groupWidth = Math.floor(gd._fullLayout._size.w * (domain.x[1] - domain.x[0]));\n var groupHeight = Math.floor(gd._fullLayout._size.h * (domain.y[1] - domain.y[0]));\n var headerRowHeights = trace.header.values.length ?\n headerValues[0].map(function() { return trace.header.height; }) :\n [c.emptyHeaderHeight];\n var rowHeights = cellsValues.length ? cellsValues[0].map(function() { return trace.cells.height; }) : [];\n var headerHeight = headerRowHeights.reduce(sum, 0);\n var scrollHeight = groupHeight - headerHeight;\n var minimumFillHeight = scrollHeight + c.uplift;\n var anchorToRowBlock = makeAnchorToRowBlock(rowHeights, minimumFillHeight);\n var anchorToHeaderRowBlock = makeAnchorToRowBlock(headerRowHeights, headerHeight);\n var headerRowBlocks = makeRowBlock(anchorToHeaderRowBlock, []);\n var rowBlocks = makeRowBlock(anchorToRowBlock, headerRowBlocks);\n var uniqueKeys = {};\n var columnOrder = trace._fullInput.columnorder.concat(slicer(cellsValues.map(function(d, i) {return i;})));\n var columnWidths = headerValues.map(function(d, i) {\n var value = Array.isArray(trace.columnwidth) ?\n trace.columnwidth[Math.min(i, trace.columnwidth.length - 1)] :\n trace.columnwidth;\n return isNumeric(value) ? Number(value) : 1;\n });\n var totalColumnWidths = columnWidths.reduce(sum, 0);\n\n // fit columns in the available vertical space as there's no vertical scrolling now\n columnWidths = columnWidths.map(function(d) { return d / totalColumnWidths * groupWidth; });\n\n var maxLineWidth = Math.max(arrayMax(trace.header.line.width), arrayMax(trace.cells.line.width));\n\n var calcdata = {\n // include staticPlot in the key so if it changes we delete and redraw\n key: trace.uid + gd._context.staticPlot,\n translateX: domain.x[0] * gd._fullLayout._size.w,\n translateY: gd._fullLayout._size.h * (1 - domain.y[1]),\n size: gd._fullLayout._size,\n width: groupWidth,\n maxLineWidth: maxLineWidth,\n height: groupHeight,\n columnOrder: columnOrder, // will be mutated on column move, todo use in callback\n groupHeight: groupHeight,\n rowBlocks: rowBlocks,\n headerRowBlocks: headerRowBlocks,\n scrollY: 0, // will be mutated on scroll\n cells: extendFlat({}, trace.cells, {values: cellsValues}),\n headerCells: extendFlat({}, trace.header, {values: headerValues}),\n gdColumns: headerValues.map(function(d) {return d[0];}),\n gdColumnsOriginalOrder: headerValues.map(function(d) {return d[0];}),\n prevPages: [0, 0],\n scrollbarState: {scrollbarScrollInProgress: false},\n columns: headerValues.map(function(label, i) {\n var foundKey = uniqueKeys[label];\n uniqueKeys[label] = (foundKey || 0) + 1;\n var key = label + '__' + uniqueKeys[label];\n return {\n key: key,\n label: label,\n specIndex: i,\n xIndex: columnOrder[i],\n xScale: xScale,\n x: undefined, // initialized below\n calcdata: undefined, // initialized below\n columnWidth: columnWidths[i]\n };\n })\n };\n\n calcdata.columns.forEach(function(col) {\n col.calcdata = calcdata;\n col.x = xScale(col);\n });\n\n return calcdata;\n};\n\nfunction arrayMax(maybeArray) {\n if(Array.isArray(maybeArray)) {\n var max = 0;\n for(var i = 0; i < maybeArray.length; i++) {\n max = Math.max(max, arrayMax(maybeArray[i]));\n }\n return max;\n }\n return maybeArray;\n}\n\nfunction sum(a, b) { return a + b; }\n\n// fill matrix in place to equal lengths\n// and ensure it's uniformly 2D\nfunction squareStringMatrix(matrixIn) {\n var matrix = matrixIn.slice();\n var minLen = Infinity;\n var maxLen = 0;\n var i;\n for(i = 0; i < matrix.length; i++) {\n if(!Array.isArray(matrix[i])) matrix[i] = [matrix[i]];\n minLen = Math.min(minLen, matrix[i].length);\n maxLen = Math.max(maxLen, matrix[i].length);\n }\n\n if(minLen !== maxLen) {\n for(i = 0; i < matrix.length; i++) {\n var padLen = maxLen - matrix[i].length;\n if(padLen) matrix[i] = matrix[i].concat(emptyStrings(padLen));\n }\n }\n return matrix;\n}\n\nfunction emptyStrings(len) {\n var padArray = new Array(len);\n for(var j = 0; j < len; j++) padArray[j] = '';\n return padArray;\n}\n\nfunction xScale(d) {\n return d.calcdata.columns.reduce(function(prev, next) {\n return next.xIndex < d.xIndex ? prev + next.columnWidth : prev;\n }, 0);\n}\n\nfunction makeRowBlock(anchorToRowBlock, auxiliary) {\n var blockAnchorKeys = Object.keys(anchorToRowBlock);\n return blockAnchorKeys.map(function(k) {return extendFlat({}, anchorToRowBlock[k], {auxiliaryBlocks: auxiliary});});\n}\n\nfunction makeAnchorToRowBlock(rowHeights, minimumFillHeight) {\n var anchorToRowBlock = {};\n var currentRowHeight;\n var currentAnchor = 0;\n var currentBlockHeight = 0;\n var currentBlock = makeIdentity();\n var currentFirstRowIndex = 0;\n var blockCounter = 0;\n for(var i = 0; i < rowHeights.length; i++) {\n currentRowHeight = rowHeights[i];\n currentBlock.rows.push({\n rowIndex: i,\n rowHeight: currentRowHeight\n });\n currentBlockHeight += currentRowHeight;\n if(currentBlockHeight >= minimumFillHeight || i === rowHeights.length - 1) {\n anchorToRowBlock[currentAnchor] = currentBlock;\n currentBlock.key = blockCounter++;\n currentBlock.firstRowIndex = currentFirstRowIndex;\n currentBlock.lastRowIndex = i;\n currentBlock = makeIdentity();\n currentAnchor += currentBlockHeight;\n currentFirstRowIndex = i + 1;\n currentBlockHeight = 0;\n }\n }\n\n return anchorToRowBlock;\n}\n\nfunction makeIdentity() {\n return {\n firstRowIndex: null,\n lastRowIndex: null,\n rows: []\n };\n}\n\n},{\"../../lib/extend\":719,\"./constants\":1265,\"fast-isnumeric\":236}],1267:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\n// pure functions, don't alter but passes on `gd` and parts of `trace` without deep copying\n\nexports.splitToPanels = function(d) {\n var prevPages = [0, 0];\n var headerPanel = extendFlat({}, d, {\n key: 'header',\n type: 'header',\n page: 0,\n prevPages: prevPages,\n currentRepaint: [null, null],\n dragHandle: true,\n values: d.calcdata.headerCells.values[d.specIndex],\n rowBlocks: d.calcdata.headerRowBlocks,\n calcdata: extendFlat({}, d.calcdata, {cells: d.calcdata.headerCells})\n });\n var revolverPanel1 = extendFlat({}, d, {\n key: 'cells1',\n type: 'cells',\n page: 0,\n prevPages: prevPages,\n currentRepaint: [null, null],\n dragHandle: false,\n values: d.calcdata.cells.values[d.specIndex],\n rowBlocks: d.calcdata.rowBlocks\n });\n var revolverPanel2 = extendFlat({}, d, {\n key: 'cells2',\n type: 'cells',\n page: 1,\n prevPages: prevPages,\n currentRepaint: [null, null],\n dragHandle: false,\n values: d.calcdata.cells.values[d.specIndex],\n rowBlocks: d.calcdata.rowBlocks\n });\n // order due to SVG using painter's algo:\n return [revolverPanel1, revolverPanel2, headerPanel];\n};\n\nexports.splitToCells = function(d) {\n var fromTo = rowFromTo(d);\n return (d.values || []).slice(fromTo[0], fromTo[1]).map(function(v, i) {\n // By keeping identical key, a DOM node removal, creation and addition is spared, important when visible\n // grid has a lot of elements (quadratic with xcol/ycol count).\n // But it has to be busted when `svgUtil.convertToTspans` is used as it reshapes cell subtrees asynchronously,\n // and by that time the user may have scrolled away, resulting in stale overwrites. The real solution will be\n // to turn `svgUtil.convertToTspans` into a cancelable request, in which case no key busting is needed.\n var buster = (typeof v === 'string') && v.match(/[<$&> ]/) ? '_keybuster_' + Math.random() : '';\n return {\n // keyWithinBlock: /*fromTo[0] + */i, // optimized future version - no busting\n // keyWithinBlock: fromTo[0] + i, // initial always-unoptimized version - janky scrolling with 5+ columns\n keyWithinBlock: i + buster, // current compromise: regular content is very fast; async content is possible\n key: fromTo[0] + i,\n column: d,\n calcdata: d.calcdata,\n page: d.page,\n rowBlocks: d.rowBlocks,\n value: v\n };\n });\n};\n\nfunction rowFromTo(d) {\n var rowBlock = d.rowBlocks[d.page];\n // fixme rowBlock truthiness check is due to ugly hack of placing 2nd panel as d.page = -1\n var rowFrom = rowBlock ? rowBlock.rows[0].rowIndex : 0;\n var rowTo = rowBlock ? rowFrom + rowBlock.rows.length : 0;\n return [rowFrom, rowTo];\n}\n\n},{\"../../lib/extend\":719}],1268:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar attributes = _dereq_('./attributes');\nvar handleDomainDefaults = _dereq_('../../plots/domain').defaults;\n\nfunction defaultColumnOrder(traceOut, coerce) {\n var specifiedColumnOrder = traceOut.columnorder || [];\n var commonLength = traceOut.header.values.length;\n var truncated = specifiedColumnOrder.slice(0, commonLength);\n var sorted = truncated.slice().sort(function(a, b) {return a - b;});\n var oneStepped = truncated.map(function(d) {return sorted.indexOf(d);});\n for(var i = oneStepped.length; i < commonLength; i++) {\n oneStepped.push(i);\n }\n coerce('columnorder', oneStepped);\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 handleDomainDefaults(traceOut, layout, coerce);\n\n coerce('columnwidth');\n\n coerce('header.values');\n coerce('header.format');\n coerce('header.align');\n\n coerce('header.prefix');\n coerce('header.suffix');\n coerce('header.height');\n coerce('header.line.width');\n coerce('header.line.color');\n coerce('header.fill.color');\n Lib.coerceFont(coerce, 'header.font', Lib.extendFlat({}, layout.font));\n\n defaultColumnOrder(traceOut, coerce);\n\n coerce('cells.values');\n coerce('cells.format');\n coerce('cells.align');\n coerce('cells.prefix');\n coerce('cells.suffix');\n coerce('cells.height');\n coerce('cells.line.width');\n coerce('cells.line.color');\n coerce('cells.fill.color');\n Lib.coerceFont(coerce, 'cells.font', Lib.extendFlat({}, layout.font));\n\n // disable 1D transforms\n traceOut._length = null;\n};\n\n},{\"../../lib\":728,\"../../plots/domain\":803,\"./attributes\":1262}],1269:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults'),\n calc: _dereq_('./calc'),\n plot: _dereq_('./plot'),\n\n moduleType: 'trace',\n name: 'table',\n basePlotModule: _dereq_('./base_plot'),\n categories: ['noOpacity'],\n meta: {\n \n }\n};\n\n},{\"./attributes\":1262,\"./base_plot\":1263,\"./calc\":1264,\"./defaults\":1268,\"./plot\":1270}],1270:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar c = _dereq_('./constants');\nvar d3 = _dereq_('d3');\nvar gup = _dereq_('../../lib/gup');\nvar Drawing = _dereq_('../../components/drawing');\nvar svgUtil = _dereq_('../../lib/svg_text_utils');\nvar raiseToTop = _dereq_('../../lib').raiseToTop;\nvar cancelEeaseColumn = _dereq_('../../lib').cancelTransition;\nvar prepareData = _dereq_('./data_preparation_helper');\nvar splitData = _dereq_('./data_split_helpers');\nvar Color = _dereq_('../../components/color');\n\nmodule.exports = function plot(gd, wrappedTraceHolders) {\n var dynamic = !gd._context.staticPlot;\n\n var table = gd._fullLayout._paper.selectAll('.' + c.cn.table)\n .data(wrappedTraceHolders.map(function(wrappedTraceHolder) {\n var traceHolder = gup.unwrap(wrappedTraceHolder);\n var trace = traceHolder.trace;\n return prepareData(gd, trace);\n }), gup.keyFun);\n\n table.exit().remove();\n\n table.enter()\n .append('g')\n .classed(c.cn.table, true)\n .attr('overflow', 'visible')\n .style('box-sizing', 'content-box')\n .style('position', 'absolute')\n .style('left', 0)\n .style('overflow', 'visible')\n .style('shape-rendering', 'crispEdges')\n .style('pointer-events', 'all');\n\n table\n .attr('width', function(d) {return d.width + d.size.l + d.size.r;})\n .attr('height', function(d) {return d.height + d.size.t + d.size.b;})\n .attr('transform', function(d) {\n return 'translate(' + d.translateX + ',' + d.translateY + ')';\n });\n\n var tableControlView = table.selectAll('.' + c.cn.tableControlView)\n .data(gup.repeat, gup.keyFun);\n\n var cvEnter = tableControlView.enter()\n .append('g')\n .classed(c.cn.tableControlView, true)\n .style('box-sizing', 'content-box');\n if(dynamic) {\n cvEnter\n .on('mousemove', function(d) {\n tableControlView\n .filter(function(dd) {return d === dd;})\n .call(renderScrollbarKit, gd);\n })\n .on('mousewheel', function(d) {\n if(d.scrollbarState.wheeling) return;\n d.scrollbarState.wheeling = true;\n var newY = d.scrollY + d3.event.deltaY;\n var noChange = makeDragRow(gd, tableControlView, null, newY)(d);\n if(!noChange) {\n d3.event.stopPropagation();\n d3.event.preventDefault();\n }\n d.scrollbarState.wheeling = false;\n })\n .call(renderScrollbarKit, gd, true);\n }\n\n tableControlView\n .attr('transform', function(d) {return 'translate(' + d.size.l + ' ' + d.size.t + ')';});\n\n // scrollBackground merely ensures that mouse events are captured even on crazy fast scrollwheeling\n // otherwise rendering glitches may occur\n var scrollBackground = tableControlView.selectAll('.' + c.cn.scrollBackground)\n .data(gup.repeat, gup.keyFun);\n\n scrollBackground.enter()\n .append('rect')\n .classed(c.cn.scrollBackground, true)\n .attr('fill', 'none');\n\n scrollBackground\n .attr('width', function(d) {return d.width;})\n .attr('height', function(d) {return d.height;});\n\n tableControlView.each(function(d) {\n Drawing.setClipUrl(d3.select(this), scrollAreaBottomClipKey(gd, d), gd);\n });\n\n var yColumn = tableControlView.selectAll('.' + c.cn.yColumn)\n .data(function(vm) {return vm.columns;}, gup.keyFun);\n\n yColumn.enter()\n .append('g')\n .classed(c.cn.yColumn, true);\n\n yColumn.exit().remove();\n\n yColumn.attr('transform', function(d) {return 'translate(' + d.x + ' 0)';});\n\n if(dynamic) {\n yColumn.call(d3.behavior.drag()\n .origin(function(d) {\n var movedColumn = d3.select(this);\n easeColumn(movedColumn, d, -c.uplift);\n raiseToTop(this);\n d.calcdata.columnDragInProgress = true;\n renderScrollbarKit(tableControlView.filter(function(dd) {return d.calcdata.key === dd.key;}), gd);\n return d;\n })\n .on('drag', function(d) {\n var movedColumn = d3.select(this);\n var getter = function(dd) {return (d === dd ? d3.event.x : dd.x) + dd.columnWidth / 2;};\n d.x = Math.max(-c.overdrag, Math.min(d.calcdata.width + c.overdrag - d.columnWidth, d3.event.x));\n\n var sortableColumns = flatData(yColumn).filter(function(dd) {return dd.calcdata.key === d.calcdata.key;});\n var newOrder = sortableColumns.sort(function(a, b) {return getter(a) - getter(b);});\n newOrder.forEach(function(dd, i) {\n dd.xIndex = i;\n dd.x = d === dd ? dd.x : dd.xScale(dd);\n });\n\n yColumn.filter(function(dd) {return d !== dd;})\n .transition()\n .ease(c.transitionEase)\n .duration(c.transitionDuration)\n .attr('transform', function(d) {return 'translate(' + d.x + ' 0)';});\n movedColumn\n .call(cancelEeaseColumn)\n .attr('transform', 'translate(' + d.x + ' -' + c.uplift + ' )');\n })\n .on('dragend', function(d) {\n var movedColumn = d3.select(this);\n var p = d.calcdata;\n d.x = d.xScale(d);\n d.calcdata.columnDragInProgress = false;\n easeColumn(movedColumn, d, 0);\n columnMoved(gd, p, p.columns.map(function(dd) {return dd.xIndex;}));\n })\n );\n }\n\n yColumn.each(function(d) {\n Drawing.setClipUrl(d3.select(this), columnBoundaryClipKey(gd, d), gd);\n });\n\n var columnBlock = yColumn.selectAll('.' + c.cn.columnBlock)\n .data(splitData.splitToPanels, gup.keyFun);\n\n columnBlock.enter()\n .append('g')\n .classed(c.cn.columnBlock, true)\n .attr('id', function(d) {return d.key;});\n\n columnBlock\n .style('cursor', function(d) {\n return d.dragHandle ? 'ew-resize' : d.calcdata.scrollbarState.barWiggleRoom ? 'ns-resize' : 'default';\n });\n\n var headerColumnBlock = columnBlock.filter(headerBlock);\n var cellsColumnBlock = columnBlock.filter(cellsBlock);\n\n if(dynamic) {\n cellsColumnBlock.call(d3.behavior.drag()\n .origin(function(d) {\n d3.event.stopPropagation();\n return d;\n })\n .on('drag', makeDragRow(gd, tableControlView, -1))\n .on('dragend', function() {\n // fixme emit plotly notification\n })\n );\n }\n\n // initial rendering: header is rendered first, as it may may have async LaTeX (show header first)\n // but blocks are _entered_ the way they are due to painter's algo (header on top)\n renderColumnCellTree(gd, tableControlView, headerColumnBlock, columnBlock);\n renderColumnCellTree(gd, tableControlView, cellsColumnBlock, columnBlock);\n\n var scrollAreaClip = tableControlView.selectAll('.' + c.cn.scrollAreaClip)\n .data(gup.repeat, gup.keyFun);\n\n scrollAreaClip.enter()\n .append('clipPath')\n .classed(c.cn.scrollAreaClip, true)\n .attr('id', function(d) {return scrollAreaBottomClipKey(gd, d);});\n\n var scrollAreaClipRect = scrollAreaClip.selectAll('.' + c.cn.scrollAreaClipRect)\n .data(gup.repeat, gup.keyFun);\n\n scrollAreaClipRect.enter()\n .append('rect')\n .classed(c.cn.scrollAreaClipRect, true)\n .attr('x', -c.overdrag)\n .attr('y', -c.uplift)\n .attr('fill', 'none');\n\n scrollAreaClipRect\n .attr('width', function(d) {return d.width + 2 * c.overdrag;})\n .attr('height', function(d) {return d.height + c.uplift;});\n\n var columnBoundary = yColumn.selectAll('.' + c.cn.columnBoundary)\n .data(gup.repeat, gup.keyFun);\n\n columnBoundary.enter()\n .append('g')\n .classed(c.cn.columnBoundary, true);\n\n var columnBoundaryClippath = yColumn.selectAll('.' + c.cn.columnBoundaryClippath)\n .data(gup.repeat, gup.keyFun);\n\n // SVG spec doesn't mandate wrapping into a and doesn't seem to cause a speed difference\n columnBoundaryClippath.enter()\n .append('clipPath')\n .classed(c.cn.columnBoundaryClippath, true);\n\n columnBoundaryClippath\n .attr('id', function(d) {return columnBoundaryClipKey(gd, d);});\n\n var columnBoundaryRect = columnBoundaryClippath.selectAll('.' + c.cn.columnBoundaryRect)\n .data(gup.repeat, gup.keyFun);\n\n columnBoundaryRect.enter()\n .append('rect')\n .classed(c.cn.columnBoundaryRect, true)\n .attr('fill', 'none');\n\n columnBoundaryRect\n .attr('width', function(d) { return d.columnWidth + 2 * roundHalfWidth(d); })\n .attr('height', function(d) {return d.calcdata.height + 2 * roundHalfWidth(d) + c.uplift;})\n .attr('x', function(d) { return -roundHalfWidth(d); })\n .attr('y', function(d) { return -roundHalfWidth(d); });\n\n updateBlockYPosition(null, cellsColumnBlock, tableControlView);\n};\n\nfunction roundHalfWidth(d) {\n return Math.ceil(d.calcdata.maxLineWidth / 2);\n}\n\nfunction scrollAreaBottomClipKey(gd, d) {\n return 'clip' + gd._fullLayout._uid + '_scrollAreaBottomClip_' + d.key;\n}\n\nfunction columnBoundaryClipKey(gd, d) {\n return 'clip' + gd._fullLayout._uid + '_columnBoundaryClippath_' + d.calcdata.key + '_' + d.specIndex;\n}\n\nfunction flatData(selection) {\n return [].concat.apply([], selection.map(function(g) {return g;}))\n .map(function(g) {return g.__data__;});\n}\n\nfunction renderScrollbarKit(tableControlView, gd, bypassVisibleBar) {\n function calcTotalHeight(d) {\n var blocks = d.rowBlocks;\n return firstRowAnchor(blocks, blocks.length - 1) + (blocks.length ? rowsHeight(blocks[blocks.length - 1], Infinity) : 1);\n }\n\n var scrollbarKit = tableControlView.selectAll('.' + c.cn.scrollbarKit)\n .data(gup.repeat, gup.keyFun);\n\n scrollbarKit.enter()\n .append('g')\n .classed(c.cn.scrollbarKit, true)\n .style('shape-rendering', 'geometricPrecision');\n\n scrollbarKit\n .each(function(d) {\n var s = d.scrollbarState;\n s.totalHeight = calcTotalHeight(d);\n s.scrollableAreaHeight = d.groupHeight - headerHeight(d);\n s.currentlyVisibleHeight = Math.min(s.totalHeight, s.scrollableAreaHeight);\n s.ratio = s.currentlyVisibleHeight / s.totalHeight;\n s.barLength = Math.max(s.ratio * s.currentlyVisibleHeight, c.goldenRatio * c.scrollbarWidth);\n s.barWiggleRoom = s.currentlyVisibleHeight - s.barLength;\n s.wiggleRoom = Math.max(0, s.totalHeight - s.scrollableAreaHeight);\n s.topY = s.barWiggleRoom === 0 ? 0 : (d.scrollY / s.wiggleRoom) * s.barWiggleRoom;\n s.bottomY = s.topY + s.barLength;\n s.dragMultiplier = s.wiggleRoom / s.barWiggleRoom;\n })\n .attr('transform', function(d) {\n var xPosition = d.width + c.scrollbarWidth / 2 + c.scrollbarOffset;\n return 'translate(' + xPosition + ' ' + headerHeight(d) + ')';\n });\n\n var scrollbar = scrollbarKit.selectAll('.' + c.cn.scrollbar)\n .data(gup.repeat, gup.keyFun);\n\n scrollbar.enter()\n .append('g')\n .classed(c.cn.scrollbar, true);\n\n var scrollbarSlider = scrollbar.selectAll('.' + c.cn.scrollbarSlider)\n .data(gup.repeat, gup.keyFun);\n\n scrollbarSlider.enter()\n .append('g')\n .classed(c.cn.scrollbarSlider, true);\n\n scrollbarSlider\n .attr('transform', function(d) {\n return 'translate(0 ' + (d.scrollbarState.topY || 0) + ')';\n });\n\n var scrollbarGlyph = scrollbarSlider.selectAll('.' + c.cn.scrollbarGlyph)\n .data(gup.repeat, gup.keyFun);\n\n scrollbarGlyph.enter()\n .append('line')\n .classed(c.cn.scrollbarGlyph, true)\n .attr('stroke', 'black')\n .attr('stroke-width', c.scrollbarWidth)\n .attr('stroke-linecap', 'round')\n .attr('y1', c.scrollbarWidth / 2);\n\n scrollbarGlyph\n .attr('y2', function(d) {\n return d.scrollbarState.barLength - c.scrollbarWidth / 2;\n })\n .attr('stroke-opacity', function(d) {\n return d.columnDragInProgress || !d.scrollbarState.barWiggleRoom || bypassVisibleBar ? 0 : 0.4;\n });\n\n // cancel transition: possible pending (also, delayed) transition\n scrollbarGlyph\n .transition().delay(0).duration(0);\n\n scrollbarGlyph\n .transition().delay(c.scrollbarHideDelay).duration(c.scrollbarHideDuration)\n .attr('stroke-opacity', 0);\n\n var scrollbarCaptureZone = scrollbar.selectAll('.' + c.cn.scrollbarCaptureZone)\n .data(gup.repeat, gup.keyFun);\n\n scrollbarCaptureZone.enter()\n .append('line')\n .classed(c.cn.scrollbarCaptureZone, true)\n .attr('stroke', 'white')\n .attr('stroke-opacity', 0.01) // some browser might get rid of a 0 opacity element\n .attr('stroke-width', c.scrollbarCaptureWidth)\n .attr('stroke-linecap', 'butt')\n .attr('y1', 0)\n .on('mousedown', function(d) {\n var y = d3.event.y;\n var bbox = this.getBoundingClientRect();\n var s = d.scrollbarState;\n var pixelVal = y - bbox.top;\n var inverseScale = d3.scale.linear().domain([0, s.scrollableAreaHeight]).range([0, s.totalHeight]).clamp(true);\n if(!(s.topY <= pixelVal && pixelVal <= s.bottomY)) {\n makeDragRow(gd, tableControlView, null, inverseScale(pixelVal - s.barLength / 2))(d);\n }\n })\n .call(d3.behavior.drag()\n .origin(function(d) {\n d3.event.stopPropagation();\n d.scrollbarState.scrollbarScrollInProgress = true;\n return d;\n })\n .on('drag', makeDragRow(gd, tableControlView))\n .on('dragend', function() {\n // fixme emit Plotly event\n })\n );\n\n scrollbarCaptureZone\n .attr('y2', function(d) {\n return d.scrollbarState.scrollableAreaHeight;\n });\n\n // Remove scroll glyph and capture zone on static plots\n // as they don't render properly when converted to PDF\n // in the Chrome PDF viewer\n // https://github.com/plotly/streambed/issues/11618\n if(gd._context.staticPlot) {\n scrollbarGlyph.remove();\n scrollbarCaptureZone.remove();\n }\n}\n\nfunction renderColumnCellTree(gd, tableControlView, columnBlock, allColumnBlock) {\n // fixme this perf hotspot\n // this is performance critical code as scrolling calls it on every revolver switch\n // it appears sufficiently fast but there are plenty of low-hanging fruits for performance optimization\n\n var columnCells = renderColumnCells(columnBlock);\n\n var columnCell = renderColumnCell(columnCells);\n\n supplyStylingValues(columnCell);\n\n var cellRect = renderCellRect(columnCell);\n\n sizeAndStyleRect(cellRect);\n\n var cellTextHolder = renderCellTextHolder(columnCell);\n\n var cellText = renderCellText(cellTextHolder);\n\n setFont(cellText);\n populateCellText(cellText, tableControlView, allColumnBlock, gd);\n\n // doing this at the end when text, and text stlying are set\n setCellHeightAndPositionY(columnCell);\n}\n\nfunction renderColumnCells(columnBlock) {\n var columnCells = columnBlock.selectAll('.' + c.cn.columnCells)\n .data(gup.repeat, gup.keyFun);\n\n columnCells.enter()\n .append('g')\n .classed(c.cn.columnCells, true);\n\n columnCells.exit()\n .remove();\n\n return columnCells;\n}\n\nfunction renderColumnCell(columnCells) {\n var columnCell = columnCells.selectAll('.' + c.cn.columnCell)\n .data(splitData.splitToCells, function(d) {return d.keyWithinBlock;});\n\n columnCell.enter()\n .append('g')\n .classed(c.cn.columnCell, true);\n\n columnCell.exit()\n .remove();\n\n return columnCell;\n}\n\nfunction renderCellRect(columnCell) {\n var cellRect = columnCell.selectAll('.' + c.cn.cellRect)\n .data(gup.repeat, function(d) {return d.keyWithinBlock;});\n\n cellRect.enter()\n .append('rect')\n .classed(c.cn.cellRect, true);\n\n return cellRect;\n}\n\nfunction renderCellText(cellTextHolder) {\n var cellText = cellTextHolder.selectAll('.' + c.cn.cellText)\n .data(gup.repeat, function(d) {return d.keyWithinBlock;});\n\n cellText.enter()\n .append('text')\n .classed(c.cn.cellText, true)\n .style('cursor', function() {return 'auto';})\n .on('mousedown', function() {d3.event.stopPropagation();});\n\n return cellText;\n}\n\nfunction renderCellTextHolder(columnCell) {\n var cellTextHolder = columnCell.selectAll('.' + c.cn.cellTextHolder)\n .data(gup.repeat, function(d) {return d.keyWithinBlock;});\n\n cellTextHolder.enter()\n .append('g')\n .classed(c.cn.cellTextHolder, true)\n .style('shape-rendering', 'geometricPrecision');\n\n return cellTextHolder;\n}\n\nfunction supplyStylingValues(columnCell) {\n columnCell\n .each(function(d, i) {\n var spec = d.calcdata.cells.font;\n var col = d.column.specIndex;\n var font = {\n size: gridPick(spec.size, col, i),\n color: gridPick(spec.color, col, i),\n family: gridPick(spec.family, col, i)\n };\n d.rowNumber = d.key;\n d.align = gridPick(d.calcdata.cells.align, col, i);\n d.cellBorderWidth = gridPick(d.calcdata.cells.line.width, col, i);\n d.font = font;\n });\n}\n\nfunction setFont(cellText) {\n cellText\n .each(function(d) {\n Drawing.font(d3.select(this), d.font);\n });\n}\n\nfunction sizeAndStyleRect(cellRect) {\n cellRect\n .attr('width', function(d) {return d.column.columnWidth;})\n .attr('stroke-width', function(d) {return d.cellBorderWidth;})\n .each(function(d) {\n var atomicSelection = d3.select(this);\n Color.stroke(atomicSelection, gridPick(d.calcdata.cells.line.color, d.column.specIndex, d.rowNumber));\n Color.fill(atomicSelection, gridPick(d.calcdata.cells.fill.color, d.column.specIndex, d.rowNumber));\n });\n}\n\nfunction populateCellText(cellText, tableControlView, allColumnBlock, gd) {\n cellText\n .text(function(d) {\n var col = d.column.specIndex;\n var row = d.rowNumber;\n\n var userSuppliedContent = d.value;\n var stringSupplied = (typeof userSuppliedContent === 'string');\n var hasBreaks = stringSupplied && userSuppliedContent.match(/
/i);\n var userBrokenText = !stringSupplied || hasBreaks;\n d.mayHaveMarkup = stringSupplied && userSuppliedContent.match(/[<&>]/);\n\n var latex = isLatex(userSuppliedContent);\n d.latex = latex;\n\n var prefix = latex ? '' : gridPick(d.calcdata.cells.prefix, col, row) || '';\n var suffix = latex ? '' : gridPick(d.calcdata.cells.suffix, col, row) || '';\n var format = latex ? null : gridPick(d.calcdata.cells.format, col, row) || null;\n\n var prefixSuffixedText = prefix + (format ? d3.format(format)(d.value) : d.value) + suffix;\n\n var hasWrapSplitCharacter;\n d.wrappingNeeded = !d.wrapped && !userBrokenText && !latex && (hasWrapSplitCharacter = hasWrapCharacter(prefixSuffixedText));\n d.cellHeightMayIncrease = hasBreaks || latex || d.mayHaveMarkup || (hasWrapSplitCharacter === void(0) ? hasWrapCharacter(prefixSuffixedText) : hasWrapSplitCharacter);\n d.needsConvertToTspans = d.mayHaveMarkup || d.wrappingNeeded || d.latex;\n\n var textToRender;\n if(d.wrappingNeeded) {\n var hrefPreservedText = c.wrapSplitCharacter === ' ' ? prefixSuffixedText.replace(/ pTop) {\n pages.push(blockIndex);\n }\n pTop += rowsHeight;\n\n // consider this nice final optimization; put it in `for` condition - caveat, currently the\n // block.allRowsHeight relies on being invalidated, so enabling this opt may not be safe\n // if(pages.length > 1) break;\n }\n\n return pages;\n}\n\nfunction updateBlockYPosition(gd, cellsColumnBlock, tableControlView) {\n var d = flatData(cellsColumnBlock)[0];\n if(d === undefined) return;\n var blocks = d.rowBlocks;\n var calcdata = d.calcdata;\n\n var bottom = firstRowAnchor(blocks, blocks.length);\n var scrollHeight = d.calcdata.groupHeight - headerHeight(d);\n var scrollY = calcdata.scrollY = Math.max(0, Math.min(bottom - scrollHeight, calcdata.scrollY));\n\n var pages = findPagesAndCacheHeights(blocks, scrollY, scrollHeight);\n if(pages.length === 1) {\n if(pages[0] === blocks.length - 1) {\n pages.unshift(pages[0] - 1);\n } else {\n pages.push(pages[0] + 1);\n }\n }\n\n // make phased out page jump by 2 while leaving stationary page intact\n if(pages[0] % 2) {\n pages.reverse();\n }\n\n cellsColumnBlock\n .each(function(d, i) {\n // these values will also be needed when a block is translated again due to growing cell height\n d.page = pages[i];\n d.scrollY = scrollY;\n });\n\n cellsColumnBlock\n .attr('transform', function(d) {\n var yTranslate = firstRowAnchor(d.rowBlocks, d.page) - d.scrollY;\n return 'translate(0 ' + yTranslate + ')';\n });\n\n // conditionally rerendering panel 0 and 1\n if(gd) {\n conditionalPanelRerender(gd, tableControlView, cellsColumnBlock, pages, d.prevPages, d, 0);\n conditionalPanelRerender(gd, tableControlView, cellsColumnBlock, pages, d.prevPages, d, 1);\n renderScrollbarKit(tableControlView, gd);\n }\n}\n\nfunction makeDragRow(gd, allTableControlView, optionalMultiplier, optionalPosition) {\n return function dragRow(eventD) {\n // may come from whichever DOM event target: drag, wheel, bar... eventD corresponds to event target\n var d = eventD.calcdata ? eventD.calcdata : eventD;\n var tableControlView = allTableControlView.filter(function(dd) {return d.key === dd.key;});\n var multiplier = optionalMultiplier || d.scrollbarState.dragMultiplier;\n\n var initialScrollY = d.scrollY;\n\n d.scrollY = optionalPosition === void(0) ? d.scrollY + multiplier * d3.event.dy : optionalPosition;\n var cellsColumnBlock = tableControlView.selectAll('.' + c.cn.yColumn).selectAll('.' + c.cn.columnBlock).filter(cellsBlock);\n updateBlockYPosition(gd, cellsColumnBlock, tableControlView);\n\n // return false if we've \"used\" the scroll, ie it did something,\n // so the event shouldn't bubble (if appropriate)\n return d.scrollY === initialScrollY;\n };\n}\n\nfunction conditionalPanelRerender(gd, tableControlView, cellsColumnBlock, pages, prevPages, d, revolverIndex) {\n var shouldComponentUpdate = pages[revolverIndex] !== prevPages[revolverIndex];\n if(shouldComponentUpdate) {\n clearTimeout(d.currentRepaint[revolverIndex]);\n d.currentRepaint[revolverIndex] = setTimeout(function() {\n // setTimeout might lag rendering but yields a smoother scroll, because fast scrolling makes\n // some repaints invisible ie. wasteful (DOM work blocks the main thread)\n var toRerender = cellsColumnBlock.filter(function(d, i) {return i === revolverIndex && pages[i] !== prevPages[i];});\n renderColumnCellTree(gd, tableControlView, toRerender, cellsColumnBlock);\n prevPages[revolverIndex] = pages[revolverIndex];\n });\n }\n}\n\nfunction wrapTextMaker(columnBlock, element, tableControlView, gd) {\n return function wrapText() {\n var cellTextHolder = d3.select(element.parentNode);\n cellTextHolder\n .each(function(d) {\n var fragments = d.fragments;\n cellTextHolder.selectAll('tspan.line').each(function(dd, i) {\n fragments[i].width = this.getComputedTextLength();\n });\n // last element is only for measuring the separator character, so it's ignored:\n var separatorLength = fragments[fragments.length - 1].width;\n var rest = fragments.slice(0, -1);\n var currentRow = [];\n var currentAddition, currentAdditionLength;\n var currentRowLength = 0;\n var rowLengthLimit = d.column.columnWidth - 2 * c.cellPad;\n d.value = '';\n while(rest.length) {\n currentAddition = rest.shift();\n currentAdditionLength = currentAddition.width + separatorLength;\n if(currentRowLength + currentAdditionLength > rowLengthLimit) {\n d.value += currentRow.join(c.wrapSpacer) + c.lineBreaker;\n currentRow = [];\n currentRowLength = 0;\n }\n currentRow.push(currentAddition.text);\n currentRowLength += currentAdditionLength;\n }\n if(currentRowLength) {\n d.value += currentRow.join(c.wrapSpacer);\n }\n d.wrapped = true;\n });\n\n // the pre-wrapped text was rendered only for the text measurements\n cellTextHolder.selectAll('tspan.line').remove();\n\n // resupply text, now wrapped\n populateCellText(cellTextHolder.select('.' + c.cn.cellText), tableControlView, columnBlock, gd);\n d3.select(element.parentNode.parentNode).call(setCellHeightAndPositionY);\n };\n}\n\nfunction updateYPositionMaker(columnBlock, element, tableControlView, gd, d) {\n return function updateYPosition() {\n if(d.settledY) return;\n var cellTextHolder = d3.select(element.parentNode);\n var l = getBlock(d);\n var rowIndex = d.key - l.firstRowIndex;\n\n var declaredRowHeight = l.rows[rowIndex].rowHeight;\n\n var requiredHeight = d.cellHeightMayIncrease ? element.parentNode.getBoundingClientRect().height + 2 * c.cellPad : declaredRowHeight;\n\n var finalHeight = Math.max(requiredHeight, declaredRowHeight);\n var increase = finalHeight - l.rows[rowIndex].rowHeight;\n\n if(increase) {\n // current row height increased\n l.rows[rowIndex].rowHeight = finalHeight;\n\n columnBlock\n .selectAll('.' + c.cn.columnCell)\n .call(setCellHeightAndPositionY);\n\n updateBlockYPosition(null, columnBlock.filter(cellsBlock), 0);\n\n // if d.column.type === 'header', then the scrollbar has to be pushed downward to the scrollable area\n // if d.column.type === 'cells', it can still be relevant if total scrolling content height is less than the\n // scrollable window, as increases to row heights may need scrollbar updates\n renderScrollbarKit(tableControlView, gd, true);\n }\n\n cellTextHolder\n .attr('transform', function() {\n // this code block is only invoked for items where d.cellHeightMayIncrease is truthy\n var element = this;\n var columnCellElement = element.parentNode;\n var box = columnCellElement.getBoundingClientRect();\n var rectBox = d3.select(element.parentNode).select('.' + c.cn.cellRect).node().getBoundingClientRect();\n var currentTransform = element.transform.baseVal.consolidate();\n var yPosition = rectBox.top - box.top + (currentTransform ? currentTransform.matrix.f : c.cellPad);\n return 'translate(' + xPosition(d, d3.select(element.parentNode).select('.' + c.cn.cellTextHolder).node().getBoundingClientRect().width) + ' ' + yPosition + ')';\n });\n\n d.settledY = true;\n };\n}\n\nfunction xPosition(d, optionalWidth) {\n switch(d.align) {\n case 'left': return c.cellPad;\n case 'right': return d.column.columnWidth - (optionalWidth || 0) - c.cellPad;\n case 'center': return (d.column.columnWidth - (optionalWidth || 0)) / 2;\n default: return c.cellPad;\n }\n}\n\nfunction setCellHeightAndPositionY(columnCell) {\n columnCell\n .attr('transform', function(d) {\n var headerHeight = d.rowBlocks[0].auxiliaryBlocks.reduce(function(p, n) {return p + rowsHeight(n, Infinity);}, 0);\n var l = getBlock(d);\n var rowAnchor = rowsHeight(l, d.key);\n var yOffset = rowAnchor + headerHeight;\n return 'translate(0 ' + yOffset + ')';\n })\n .selectAll('.' + c.cn.cellRect)\n .attr('height', function(d) {return getRow(getBlock(d), d.key).rowHeight;});\n}\n\nfunction firstRowAnchor(blocks, page) {\n var total = 0;\n for(var i = page - 1; i >= 0; i--) {\n total += allRowsHeight(blocks[i]);\n }\n return total;\n}\n\nfunction rowsHeight(rowBlock, key) {\n var total = 0;\n for(var i = 0; i < rowBlock.rows.length && rowBlock.rows[i].rowIndex < key; i++) {\n total += rowBlock.rows[i].rowHeight;\n }\n return total;\n}\n\nfunction allRowsHeight(rowBlock) {\n var cached = rowBlock.allRowsHeight;\n\n if(cached !== void(0)) {\n return cached;\n }\n\n var total = 0;\n for(var i = 0; i < rowBlock.rows.length; i++) {\n total += rowBlock.rows[i].rowHeight;\n }\n rowBlock.allRowsHeight = total;\n\n return total;\n}\n\nfunction getBlock(d) {return d.rowBlocks[d.page];}\nfunction getRow(l, i) {return l.rows[i - l.firstRowIndex];}\n\n},{\"../../components/color\":595,\"../../components/drawing\":617,\"../../lib\":728,\"../../lib/gup\":726,\"../../lib/svg_text_utils\":752,\"./constants\":1265,\"./data_preparation_helper\":1266,\"./data_split_helpers\":1267,\"d3\":164}],1271:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar texttemplateAttrs = _dereq_('../../plots/template_attributes').texttemplateAttrs;\n\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\nvar domainAttrs = _dereq_('../../plots/domain').attributes;\nvar pieAttrs = _dereq_('../pie/attributes');\nvar sunburstAttrs = _dereq_('../sunburst/attributes');\nvar constants = _dereq_('./constants');\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nmodule.exports = {\n labels: sunburstAttrs.labels,\n parents: sunburstAttrs.parents,\n\n values: sunburstAttrs.values,\n branchvalues: sunburstAttrs.branchvalues,\n count: sunburstAttrs.count,\n\n level: sunburstAttrs.level,\n maxdepth: sunburstAttrs.maxdepth,\n\n tiling: {\n packing: {\n valType: 'enumerated',\n values: [\n 'squarify',\n 'binary',\n 'dice',\n 'slice',\n 'slice-dice',\n 'dice-slice'\n ],\n dflt: 'squarify',\n \n editType: 'plot',\n \n },\n\n squarifyratio: {\n valType: 'number',\n \n min: 1,\n dflt: 1,\n editType: 'plot',\n \n },\n\n flip: {\n valType: 'flaglist',\n \n flags: [\n 'x',\n 'y'\n ],\n dflt: '',\n editType: 'plot',\n \n },\n\n pad: {\n valType: 'number',\n \n min: 0,\n dflt: 3,\n editType: 'plot',\n \n },\n\n editType: 'calc',\n },\n\n marker: extendFlat({\n pad: {\n t: {\n valType: 'number',\n \n min: 0,\n editType: 'plot',\n \n },\n l: {\n valType: 'number',\n \n min: 0,\n editType: 'plot',\n \n },\n r: {\n valType: 'number',\n \n min: 0,\n editType: 'plot',\n \n },\n b: {\n valType: 'number',\n \n min: 0,\n editType: 'plot',\n \n },\n\n editType: 'calc'\n },\n\n colors: sunburstAttrs.marker.colors,\n\n depthfade: {\n valType: 'enumerated',\n values: [true, false, 'reversed'],\n editType: 'style',\n \n \n },\n\n line: sunburstAttrs.marker.line,\n\n editType: 'calc'\n },\n colorScaleAttrs('marker', {\n colorAttr: 'colors',\n anim: false // TODO: set to anim: true?\n })\n ),\n\n pathbar: {\n visible: {\n valType: 'boolean',\n dflt: true,\n \n editType: 'plot',\n \n },\n\n side: {\n valType: 'enumerated',\n values: [\n 'top',\n 'bottom'\n ],\n dflt: 'top',\n \n editType: 'plot',\n \n },\n\n edgeshape: {\n valType: 'enumerated',\n values: [\n '>',\n '<',\n '|',\n '/',\n '\\\\'\n ],\n dflt: '>',\n \n editType: 'plot',\n \n },\n\n thickness: {\n valType: 'number',\n min: 12,\n \n editType: 'plot',\n \n },\n\n textfont: extendFlat({}, pieAttrs.textfont, {\n \n }),\n\n editType: 'calc'\n },\n\n text: pieAttrs.text,\n textinfo: sunburstAttrs.textinfo,\n // TODO: incorporate `label` and `value` in the eventData\n texttemplate: texttemplateAttrs({editType: 'plot'}, {\n keys: constants.eventDataKeys.concat(['label', 'value'])\n }),\n\n hovertext: pieAttrs.hovertext,\n hoverinfo: sunburstAttrs.hoverinfo,\n hovertemplate: hovertemplateAttrs({}, {\n keys: constants.eventDataKeys\n }),\n\n textfont: pieAttrs.textfont,\n insidetextfont: pieAttrs.insidetextfont,\n outsidetextfont: extendFlat({}, pieAttrs.outsidetextfont, {\n \n }),\n\n textposition: {\n valType: 'enumerated',\n values: [\n 'top left', 'top center', 'top right',\n 'middle left', 'middle center', 'middle right',\n 'bottom left', 'bottom center', 'bottom right'\n ],\n dflt: 'top left',\n \n editType: 'plot',\n \n },\n\n domain: domainAttrs({name: 'treemap', trace: true, editType: 'calc'}),\n};\n\n},{\"../../components/colorscale/attributes\":602,\"../../lib/extend\":719,\"../../plots/domain\":803,\"../../plots/template_attributes\":854,\"../pie/attributes\":1108,\"../sunburst/attributes\":1245,\"./constants\":1274}],1272:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar plots = _dereq_('../../plots/plots');\n\nexports.name = 'treemap';\n\nexports.plot = function(gd, traces, transitionOpts, makeOnCompleteCallback) {\n plots.plotBasePlot(exports.name, gd, traces, transitionOpts, makeOnCompleteCallback);\n};\n\nexports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) {\n plots.cleanBasePlot(exports.name, newFullData, newFullLayout, oldFullData, oldFullLayout);\n};\n\n},{\"../../plots/plots\":839}],1273:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar calc = _dereq_('../sunburst/calc');\n\nexports.calc = function(gd, trace) {\n return calc.calc(gd, trace);\n};\n\nexports.crossTraceCalc = function(gd) {\n return calc._runCrossTraceCalc('treemap', gd);\n};\n\n},{\"../sunburst/calc\":1247}],1274:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n CLICK_TRANSITION_TIME: 750,\n CLICK_TRANSITION_EASING: 'poly',\n eventDataKeys: [\n // string\n 'currentPath',\n 'root',\n 'entry',\n // no need to add 'parent' here\n\n // percentages i.e. ratios\n 'percentRoot',\n 'percentEntry',\n 'percentParent'\n ],\n gapWithPathbar: 1 // i.e. one pixel\n};\n\n},{}],1275:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar attributes = _dereq_('./attributes');\nvar Color = _dereq_('../../components/color');\nvar handleDomainDefaults = _dereq_('../../plots/domain').defaults;\nvar handleText = _dereq_('../bar/defaults').handleText;\nvar TEXTPAD = _dereq_('../bar/constants').TEXTPAD;\n\nvar Colorscale = _dereq_('../../components/colorscale');\nvar hasColorscale = Colorscale.hasColorscale;\nvar colorscaleDefaults = Colorscale.handleDefaults;\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 labels = coerce('labels');\n var parents = coerce('parents');\n\n if(!labels || !labels.length || !parents || !parents.length) {\n traceOut.visible = false;\n return;\n }\n\n var vals = coerce('values');\n if(vals && vals.length) {\n coerce('branchvalues');\n } else {\n coerce('count');\n }\n\n coerce('level');\n coerce('maxdepth');\n\n var packing = coerce('tiling.packing');\n if(packing === 'squarify') {\n coerce('tiling.squarifyratio');\n }\n\n coerce('tiling.flip');\n coerce('tiling.pad');\n\n var text = coerce('text');\n coerce('texttemplate');\n if(!traceOut.texttemplate) coerce('textinfo', Array.isArray(text) ? 'text+label' : 'label');\n\n coerce('hovertext');\n coerce('hovertemplate');\n\n var hasPathbar = coerce('pathbar.visible');\n\n var textposition = 'auto';\n handleText(traceIn, traceOut, layout, coerce, textposition, {\n hasPathbar: hasPathbar,\n moduleHasSelected: false,\n moduleHasUnselected: false,\n moduleHasConstrain: false,\n moduleHasCliponaxis: false,\n moduleHasTextangle: false,\n moduleHasInsideanchor: false\n });\n coerce('textposition');\n var bottomText = traceOut.textposition.indexOf('bottom') !== -1;\n\n var lineWidth = coerce('marker.line.width');\n if(lineWidth) coerce('marker.line.color', layout.paper_bgcolor);\n\n var colors = coerce('marker.colors');\n var withColorscale = traceOut._hasColorscale = (\n hasColorscale(traceIn, 'marker', 'colors') ||\n (traceIn.marker || {}).coloraxis // N.B. special logic to consider \"values\" colorscales\n );\n if(withColorscale) {\n colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: 'marker.', cLetter: 'c'});\n } else {\n coerce('marker.depthfade', !(colors || []).length);\n }\n\n var headerSize = traceOut.textfont.size * 2;\n\n coerce('marker.pad.t', bottomText ? headerSize / 4 : headerSize);\n coerce('marker.pad.l', headerSize / 4);\n coerce('marker.pad.r', headerSize / 4);\n coerce('marker.pad.b', bottomText ? headerSize : headerSize / 4);\n\n if(withColorscale) {\n colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: 'marker.', cLetter: 'c'});\n }\n\n traceOut._hovered = {\n marker: {\n line: {\n width: 2,\n color: Color.contrast(layout.paper_bgcolor)\n }\n }\n };\n\n if(hasPathbar) {\n // This works even for multi-line labels as treemap pathbar trim out line breaks\n coerce('pathbar.thickness', traceOut.pathbar.textfont.size + 2 * TEXTPAD);\n\n coerce('pathbar.side');\n coerce('pathbar.edgeshape');\n }\n\n handleDomainDefaults(traceOut, layout, coerce);\n\n // do not support transforms for now\n traceOut._length = null;\n};\n\n},{\"../../components/color\":595,\"../../components/colorscale\":607,\"../../lib\":728,\"../../plots/domain\":803,\"../bar/constants\":871,\"../bar/defaults\":873,\"./attributes\":1271}],1276:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Lib = _dereq_('../../lib');\nvar Drawing = _dereq_('../../components/drawing');\nvar svgTextUtils = _dereq_('../../lib/svg_text_utils');\n\nvar partition = _dereq_('./partition');\nvar styleOne = _dereq_('./style').styleOne;\nvar constants = _dereq_('./constants');\nvar helpers = _dereq_('../sunburst/helpers');\nvar attachFxHandlers = _dereq_('../sunburst/fx');\n\nvar onPathbar = true; // for Ancestors\n\nmodule.exports = function drawAncestors(gd, cd, entry, slices, opts) {\n var barDifY = opts.barDifY;\n var width = opts.width;\n var height = opts.height;\n var viewX = opts.viewX;\n var viewY = opts.viewY;\n var pathSlice = opts.pathSlice;\n var toMoveInsideSlice = opts.toMoveInsideSlice;\n var strTransform = opts.strTransform;\n var hasTransition = opts.hasTransition;\n var handleSlicesExit = opts.handleSlicesExit;\n var makeUpdateSliceInterpolator = opts.makeUpdateSliceInterpolator;\n var makeUpdateTextInterpolator = opts.makeUpdateTextInterpolator;\n var refRect = {};\n\n var fullLayout = gd._fullLayout;\n var cd0 = cd[0];\n var trace = cd0.trace;\n var hierarchy = cd0.hierarchy;\n\n var eachWidth = width / trace._entryDepth;\n\n var pathIds = helpers.listPath(entry.data, 'id');\n\n var sliceData = partition(hierarchy.copy(), [width, height], {\n packing: 'dice',\n pad: {\n inner: 0,\n top: 0,\n left: 0,\n right: 0,\n bottom: 0\n }\n }).descendants();\n\n // edit slices that show up on graph\n sliceData = sliceData.filter(function(pt) {\n var level = pathIds.indexOf(pt.data.id);\n if(level === -1) return false;\n\n pt.x0 = eachWidth * level;\n pt.x1 = eachWidth * (level + 1);\n pt.y0 = barDifY;\n pt.y1 = barDifY + height;\n\n pt.onPathbar = true;\n\n return true;\n });\n\n sliceData.reverse();\n\n slices = slices.data(sliceData, helpers.getPtId);\n\n slices.enter().append('g')\n .classed('pathbar', true);\n\n handleSlicesExit(slices, onPathbar, refRect, [width, height], pathSlice);\n\n slices.order();\n\n var updateSlices = slices;\n if(hasTransition) {\n updateSlices = updateSlices.transition().each('end', function() {\n // N.B. gd._transitioning is (still) *true* by the time\n // transition updates get here\n var sliceTop = d3.select(this);\n helpers.setSliceCursor(sliceTop, gd, {\n hideOnRoot: false,\n hideOnLeaves: false,\n isTransitioning: false\n });\n });\n }\n\n updateSlices.each(function(pt) {\n pt._hoverX = viewX(pt.x1 - Math.min(width, height) / 2);\n pt._hoverY = viewY(pt.y1 - height / 2);\n\n var sliceTop = d3.select(this);\n\n var slicePath = Lib.ensureSingle(sliceTop, 'path', 'surface', function(s) {\n s.style('pointer-events', 'all');\n });\n\n if(hasTransition) {\n slicePath.transition().attrTween('d', function(pt2) {\n var interp = makeUpdateSliceInterpolator(pt2, onPathbar, refRect, [width, height]);\n return function(t) { return pathSlice(interp(t)); };\n });\n } else {\n slicePath.attr('d', pathSlice);\n }\n\n sliceTop\n .call(attachFxHandlers, entry, gd, cd, {\n styleOne: styleOne,\n eventDataKeys: constants.eventDataKeys,\n transitionTime: constants.CLICK_TRANSITION_TIME,\n transitionEasing: constants.CLICK_TRANSITION_EASING\n })\n .call(helpers.setSliceCursor, gd, {\n hideOnRoot: false,\n hideOnLeaves: false,\n isTransitioning: gd._transitioning\n });\n\n slicePath.call(styleOne, pt, trace, {\n hovered: false\n });\n\n pt._text = (helpers.getPtLabel(pt) || '').split('
').join(' ') || '';\n\n var sliceTextGroup = Lib.ensureSingle(sliceTop, 'g', 'slicetext');\n var sliceText = Lib.ensureSingle(sliceTextGroup, 'text', '', function(s) {\n // prohibit tex interpretation until we can handle\n // tex and regular text together\n s.attr('data-notex', 1);\n });\n\n var font = Lib.ensureUniformFontSize(gd, helpers.determineTextFont(trace, pt, fullLayout.font, {\n onPathbar: true\n }));\n\n sliceText.text(pt._text || ' ') // use one space character instead of a blank string to avoid jumps during transition\n .classed('slicetext', true)\n .attr('text-anchor', 'start')\n .call(Drawing.font, font)\n .call(svgTextUtils.convertToTspans, gd);\n\n pt.textBB = Drawing.bBox(sliceText.node());\n pt.transform = toMoveInsideSlice(pt, {\n fontSize: font.size,\n onPathbar: true\n });\n pt.transform.fontSize = font.size;\n\n if(hasTransition) {\n sliceText.transition().attrTween('transform', function(pt2) {\n var interp = makeUpdateTextInterpolator(pt2, onPathbar, refRect, [width, height]);\n return function(t) { return strTransform(interp(t)); };\n });\n } else {\n sliceText.attr('transform', strTransform(pt));\n }\n });\n};\n\n},{\"../../components/drawing\":617,\"../../lib\":728,\"../../lib/svg_text_utils\":752,\"../sunburst/fx\":1250,\"../sunburst/helpers\":1251,\"./constants\":1274,\"./partition\":1281,\"./style\":1283,\"d3\":164}],1277:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Lib = _dereq_('../../lib');\nvar Drawing = _dereq_('../../components/drawing');\nvar svgTextUtils = _dereq_('../../lib/svg_text_utils');\n\nvar partition = _dereq_('./partition');\nvar styleOne = _dereq_('./style').styleOne;\nvar constants = _dereq_('./constants');\nvar helpers = _dereq_('../sunburst/helpers');\nvar attachFxHandlers = _dereq_('../sunburst/fx');\nvar formatSliceLabel = _dereq_('../sunburst/plot').formatSliceLabel;\n\nvar onPathbar = false; // for Descendants\n\nmodule.exports = function drawDescendants(gd, cd, entry, slices, opts) {\n var width = opts.width;\n var height = opts.height;\n var viewX = opts.viewX;\n var viewY = opts.viewY;\n var pathSlice = opts.pathSlice;\n var toMoveInsideSlice = opts.toMoveInsideSlice;\n var strTransform = opts.strTransform;\n var hasTransition = opts.hasTransition;\n var handleSlicesExit = opts.handleSlicesExit;\n var makeUpdateSliceInterpolator = opts.makeUpdateSliceInterpolator;\n var makeUpdateTextInterpolator = opts.makeUpdateTextInterpolator;\n var prevEntry = opts.prevEntry;\n var refRect = {};\n\n var fullLayout = gd._fullLayout;\n var cd0 = cd[0];\n var trace = cd0.trace;\n\n var hasLeft = trace.textposition.indexOf('left') !== -1;\n var hasRight = trace.textposition.indexOf('right') !== -1;\n var hasBottom = trace.textposition.indexOf('bottom') !== -1;\n\n var noRoomForHeader = (!hasBottom && !trace.marker.pad.t) || (hasBottom && !trace.marker.pad.b);\n\n // N.B. slice data isn't the calcdata,\n // grab corresponding calcdata item in sliceData[i].data.data\n var allData = partition(entry, [width, height], {\n packing: trace.tiling.packing,\n squarifyratio: trace.tiling.squarifyratio,\n flipX: trace.tiling.flip.indexOf('x') > -1,\n flipY: trace.tiling.flip.indexOf('y') > -1,\n pad: {\n inner: trace.tiling.pad,\n top: trace.marker.pad.t,\n left: trace.marker.pad.l,\n right: trace.marker.pad.r,\n bottom: trace.marker.pad.b,\n }\n });\n\n var sliceData = allData.descendants();\n\n var minVisibleDepth = Infinity;\n var maxVisibleDepth = -Infinity;\n sliceData.forEach(function(pt) {\n var depth = pt.depth;\n if(depth >= trace._maxDepth) {\n // hide slices that won't show up on graph\n pt.x0 = pt.x1 = (pt.x0 + pt.x1) / 2;\n pt.y0 = pt.y1 = (pt.y0 + pt.y1) / 2;\n } else {\n minVisibleDepth = Math.min(minVisibleDepth, depth);\n maxVisibleDepth = Math.max(maxVisibleDepth, depth);\n }\n });\n\n slices = slices.data(sliceData, helpers.getPtId);\n\n trace._maxVisibleLayers = isFinite(maxVisibleDepth) ? maxVisibleDepth - minVisibleDepth + 1 : 0;\n\n slices.enter().append('g')\n .classed('slice', true);\n\n handleSlicesExit(slices, onPathbar, refRect, [width, height], pathSlice);\n\n slices.order();\n\n // next coords of previous entry\n var nextOfPrevEntry = null;\n if(hasTransition && prevEntry) {\n var prevEntryId = helpers.getPtId(prevEntry);\n slices.each(function(pt) {\n if(nextOfPrevEntry === null && (helpers.getPtId(pt) === prevEntryId)) {\n nextOfPrevEntry = {\n x0: pt.x0,\n x1: pt.x1,\n y0: pt.y0,\n y1: pt.y1\n };\n }\n });\n }\n\n var getRefRect = function() {\n return nextOfPrevEntry || {\n x0: 0,\n x1: width,\n y0: 0,\n y1: height\n };\n };\n\n var updateSlices = slices;\n if(hasTransition) {\n updateSlices = updateSlices.transition().each('end', function() {\n // N.B. gd._transitioning is (still) *true* by the time\n // transition updates get here\n var sliceTop = d3.select(this);\n helpers.setSliceCursor(sliceTop, gd, {\n hideOnRoot: true,\n hideOnLeaves: false,\n isTransitioning: false\n });\n });\n }\n\n updateSlices.each(function(pt) {\n var isHeader = helpers.isHeader(pt, trace);\n\n pt._hoverX = viewX(pt.x1 - trace.marker.pad.r),\n pt._hoverY = hasBottom ?\n viewY(pt.y1 - trace.marker.pad.b / 2) :\n viewY(pt.y0 + trace.marker.pad.t / 2);\n\n var sliceTop = d3.select(this);\n\n var slicePath = Lib.ensureSingle(sliceTop, 'path', 'surface', function(s) {\n s.style('pointer-events', 'all');\n });\n\n if(hasTransition) {\n slicePath.transition().attrTween('d', function(pt2) {\n var interp = makeUpdateSliceInterpolator(pt2, onPathbar, getRefRect(), [width, height]);\n return function(t) { return pathSlice(interp(t)); };\n });\n } else {\n slicePath.attr('d', pathSlice);\n }\n\n sliceTop\n .call(attachFxHandlers, entry, gd, cd, {\n styleOne: styleOne,\n eventDataKeys: constants.eventDataKeys,\n transitionTime: constants.CLICK_TRANSITION_TIME,\n transitionEasing: constants.CLICK_TRANSITION_EASING\n })\n .call(helpers.setSliceCursor, gd, { isTransitioning: gd._transitioning });\n\n slicePath.call(styleOne, pt, trace, {\n hovered: false\n });\n\n if(pt.x0 === pt.x1 || pt.y0 === pt.y1) {\n pt._text = '';\n } else {\n if(isHeader) {\n pt._text = noRoomForHeader ? '' : helpers.getPtLabel(pt) || '';\n } else {\n pt._text = formatSliceLabel(pt, entry, trace, cd, fullLayout) || '';\n }\n }\n\n var sliceTextGroup = Lib.ensureSingle(sliceTop, 'g', 'slicetext');\n var sliceText = Lib.ensureSingle(sliceTextGroup, 'text', '', function(s) {\n // prohibit tex interpretation until we can handle\n // tex and regular text together\n s.attr('data-notex', 1);\n });\n\n var font = Lib.ensureUniformFontSize(gd, helpers.determineTextFont(trace, pt, fullLayout.font));\n\n sliceText.text(pt._text || ' ') // use one space character instead of a blank string to avoid jumps during transition\n .classed('slicetext', true)\n .attr('text-anchor', hasRight ? 'end' : (hasLeft || isHeader) ? 'start' : 'middle')\n .call(Drawing.font, font)\n .call(svgTextUtils.convertToTspans, gd);\n\n pt.textBB = Drawing.bBox(sliceText.node());\n pt.transform = toMoveInsideSlice(pt, {\n fontSize: font.size,\n isHeader: isHeader\n });\n pt.transform.fontSize = font.size;\n\n if(hasTransition) {\n sliceText.transition().attrTween('transform', function(pt2) {\n var interp = makeUpdateTextInterpolator(pt2, onPathbar, getRefRect(), [width, height]);\n return function(t) { return strTransform(interp(t)); };\n });\n } else {\n sliceText.attr('transform', strTransform(pt));\n }\n });\n\n return nextOfPrevEntry;\n};\n\n},{\"../../components/drawing\":617,\"../../lib\":728,\"../../lib/svg_text_utils\":752,\"../sunburst/fx\":1250,\"../sunburst/helpers\":1251,\"../sunburst/plot\":1255,\"./constants\":1274,\"./partition\":1281,\"./style\":1283,\"d3\":164}],1278:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n moduleType: 'trace',\n name: 'treemap',\n basePlotModule: _dereq_('./base_plot'),\n categories: [],\n animatable: true,\n\n attributes: _dereq_('./attributes'),\n layoutAttributes: _dereq_('./layout_attributes'),\n supplyDefaults: _dereq_('./defaults'),\n supplyLayoutDefaults: _dereq_('./layout_defaults'),\n\n calc: _dereq_('./calc').calc,\n crossTraceCalc: _dereq_('./calc').crossTraceCalc,\n\n plot: _dereq_('./plot'),\n style: _dereq_('./style').style,\n\n colorbar: _dereq_('../scatter/marker_colorbar'),\n\n meta: {\n \n }\n};\n\n},{\"../scatter/marker_colorbar\":1152,\"./attributes\":1271,\"./base_plot\":1272,\"./calc\":1273,\"./defaults\":1275,\"./layout_attributes\":1279,\"./layout_defaults\":1280,\"./plot\":1282,\"./style\":1283}],1279:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n treemapcolorway: {\n valType: 'colorlist',\n \n editType: 'calc',\n \n },\n extendtreemapcolors: {\n valType: 'boolean',\n dflt: true,\n \n editType: 'calc',\n \n }\n};\n\n},{}],1280:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar layoutAttributes = _dereq_('./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 coerce('treemapcolorway', layoutOut.colorway);\n coerce('extendtreemapcolors');\n};\n\n},{\"../../lib\":728,\"./layout_attributes\":1279}],1281:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3Hierarchy = _dereq_('d3-hierarchy');\n\nmodule.exports = function partition(entry, size, opts) {\n var flipX = opts.flipX;\n var flipY = opts.flipY;\n var swapXY = opts.packing === 'dice-slice';\n\n var top = opts.pad[flipY ? 'bottom' : 'top'];\n var left = opts.pad[flipX ? 'right' : 'left'];\n var right = opts.pad[flipX ? 'left' : 'right'];\n var bottom = opts.pad[flipY ? 'top' : 'bottom'];\n\n var tmp;\n if(swapXY) {\n tmp = left;\n left = top;\n top = tmp;\n\n tmp = right;\n right = bottom;\n bottom = tmp;\n }\n\n var result = d3Hierarchy\n .treemap()\n .tile(getTilingMethod(opts.packing, opts.squarifyratio))\n .paddingInner(opts.pad.inner)\n .paddingLeft(left)\n .paddingRight(right)\n .paddingTop(top)\n .paddingBottom(bottom)\n .size(\n swapXY ? [size[1], size[0]] : size\n )(entry);\n\n if(swapXY || flipX || flipY) {\n flipTree(result, size, {\n swapXY: swapXY,\n flipX: flipX,\n flipY: flipY\n });\n }\n return result;\n};\n\nfunction getTilingMethod(key, squarifyratio) {\n switch(key) {\n case 'squarify':\n return d3Hierarchy.treemapSquarify.ratio(squarifyratio);\n case 'binary':\n return d3Hierarchy.treemapBinary;\n case 'dice':\n return d3Hierarchy.treemapDice;\n case 'slice':\n return d3Hierarchy.treemapSlice;\n default: // i.e. 'slice-dice' | 'dice-slice'\n return d3Hierarchy.treemapSliceDice;\n }\n}\n\nfunction flipTree(node, size, opts) {\n var tmp;\n\n if(opts.swapXY) {\n // swap x0 and y0\n tmp = node.x0;\n node.x0 = node.y0;\n node.y0 = tmp;\n\n // swap x1 and y1\n tmp = node.x1;\n node.x1 = node.y1;\n node.y1 = tmp;\n }\n\n if(opts.flipX) {\n tmp = node.x0;\n node.x0 = size[0] - node.x1;\n node.x1 = size[0] - tmp;\n }\n\n if(opts.flipY) {\n tmp = node.y0;\n node.y0 = size[1] - node.y1;\n node.y1 = size[1] - tmp;\n }\n\n var children = node.children;\n if(children) {\n for(var i = 0; i < children.length; i++) {\n flipTree(children[i], size, opts);\n }\n }\n}\n\n},{\"d3-hierarchy\":158}],1282:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar helpers = _dereq_('../sunburst/helpers');\n\nvar Lib = _dereq_('../../lib');\nvar TEXTPAD = _dereq_('../bar/constants').TEXTPAD;\nvar barPlot = _dereq_('../bar/plot');\nvar toMoveInsideBar = barPlot.toMoveInsideBar;\nvar uniformText = _dereq_('../bar/uniform_text');\nvar recordMinTextSize = uniformText.recordMinTextSize;\nvar clearMinTextSize = uniformText.clearMinTextSize;\nvar resizeText = _dereq_('../bar/style').resizeText;\nvar constants = _dereq_('./constants');\nvar drawDescendants = _dereq_('./draw_descendants');\nvar drawAncestors = _dereq_('./draw_ancestors');\n\nmodule.exports = function(gd, cdmodule, transitionOpts, makeOnCompleteCallback) {\n var fullLayout = gd._fullLayout;\n var layer = fullLayout._treemaplayer;\n var join, onComplete;\n\n // If transition config is provided, then it is only a partial replot and traces not\n // updated are removed.\n var isFullReplot = !transitionOpts;\n\n clearMinTextSize('treemap', fullLayout);\n\n join = layer.selectAll('g.trace.treemap')\n .data(cdmodule, function(cd) { return cd[0].trace.uid; });\n\n join.enter().append('g')\n .classed('trace', true)\n .classed('treemap', true);\n\n join.order();\n\n if(!fullLayout.uniformtext.mode && helpers.hasTransition(transitionOpts)) {\n if(makeOnCompleteCallback) {\n // If it was passed a callback to register completion, make a callback. If\n // this is created, then it must be executed on completion, otherwise the\n // pos-transition redraw will not execute:\n onComplete = makeOnCompleteCallback();\n }\n\n var transition = d3.transition()\n .duration(transitionOpts.duration)\n .ease(transitionOpts.easing)\n .each('end', function() { onComplete && onComplete(); })\n .each('interrupt', function() { onComplete && onComplete(); });\n\n transition.each(function() {\n // Must run the selection again since otherwise enters/updates get grouped together\n // and these get executed out of order. Except we need them in order!\n layer.selectAll('g.trace').each(function(cd) {\n plotOne(gd, cd, this, transitionOpts);\n });\n });\n } else {\n join.each(function(cd) {\n plotOne(gd, cd, this, transitionOpts);\n });\n\n if(fullLayout.uniformtext.mode) {\n resizeText(gd, fullLayout._treemaplayer.selectAll('.trace'), 'treemap');\n }\n }\n\n if(isFullReplot) {\n join.exit().remove();\n }\n};\n\nfunction getKey(pt) {\n return helpers.isHierarchyRoot(pt) ?\n '' : // don't use the dummyId\n helpers.getPtId(pt);\n}\n\nfunction plotOne(gd, cd, element, transitionOpts) {\n var fullLayout = gd._fullLayout;\n var cd0 = cd[0];\n var trace = cd0.trace;\n var hierarchy = cd0.hierarchy;\n var entry = helpers.findEntryWithLevel(hierarchy, trace.level);\n\n var gTrace = d3.select(element);\n var selAncestors = gTrace.selectAll('g.pathbar');\n var selDescendants = gTrace.selectAll('g.slice');\n\n if(!entry) {\n selAncestors.remove();\n selDescendants.remove();\n return;\n }\n\n var isRoot = helpers.isHierarchyRoot(entry);\n var hasTransition = !fullLayout.uniformtext.mode && helpers.hasTransition(transitionOpts);\n\n var maxDepth = helpers.getMaxDepth(trace);\n var hasVisibleDepth = function(pt) {\n return pt.data.depth - entry.data.depth < maxDepth;\n };\n\n var gs = fullLayout._size;\n var domain = trace.domain;\n\n var vpw = gs.w * (domain.x[1] - domain.x[0]);\n var vph = gs.h * (domain.y[1] - domain.y[0]);\n var barW = vpw;\n var barH = trace.pathbar.thickness;\n var barPad = trace.marker.line.width + constants.gapWithPathbar;\n var barDifY = !trace.pathbar.visible ? 0 :\n trace.pathbar.side.indexOf('bottom') > -1 ? vph + barPad : -(barH + barPad);\n\n var pathbarOrigin = {\n x0: barW, // slide to the right\n x1: barW,\n y0: barDifY,\n y1: barDifY + barH\n };\n\n var findClosestEdge = function(pt, ref, size) {\n var e = trace.tiling.pad;\n var isLeftOfRect = function(x) { return x - e <= ref.x0; };\n var isRightOfRect = function(x) { return x + e >= ref.x1; };\n var isBottomOfRect = function(y) { return y - e <= ref.y0; };\n var isTopOfRect = function(y) { return y + e >= ref.y1; };\n\n return {\n x0: isLeftOfRect(pt.x0 - e) ? 0 : isRightOfRect(pt.x0 - e) ? size[0] : pt.x0,\n x1: isLeftOfRect(pt.x1 + e) ? 0 : isRightOfRect(pt.x1 + e) ? size[0] : pt.x1,\n y0: isBottomOfRect(pt.y0 - e) ? 0 : isTopOfRect(pt.y0 - e) ? size[1] : pt.y0,\n y1: isBottomOfRect(pt.y1 + e) ? 0 : isTopOfRect(pt.y1 + e) ? size[1] : pt.y1\n };\n };\n\n // stash of 'previous' position data used by tweening functions\n var prevEntry = null;\n var prevLookupPathbar = {};\n var prevLookupSlices = {};\n var nextOfPrevEntry = null;\n var getPrev = function(pt, onPathbar) {\n return onPathbar ?\n prevLookupPathbar[getKey(pt)] :\n prevLookupSlices[getKey(pt)];\n };\n\n var getOrigin = function(pt, onPathbar, refRect, size) {\n if(onPathbar) {\n return prevLookupPathbar[getKey(hierarchy)] || pathbarOrigin;\n } else {\n var ref = prevLookupSlices[trace.level] || refRect;\n\n if(hasVisibleDepth(pt)) { // case of an empty object - happens when maxdepth is set\n return findClosestEdge(pt, ref, size);\n }\n }\n return {};\n };\n\n // N.B. handle multiple-root special case\n if(cd0.hasMultipleRoots && isRoot) {\n maxDepth++;\n }\n\n trace._maxDepth = maxDepth;\n trace._backgroundColor = fullLayout.paper_bgcolor;\n trace._entryDepth = entry.data.depth;\n trace._atRootLevel = isRoot;\n\n var cenX = -vpw / 2 + gs.l + gs.w * (domain.x[1] + domain.x[0]) / 2;\n var cenY = -vph / 2 + gs.t + gs.h * (1 - (domain.y[1] + domain.y[0]) / 2);\n\n var viewMapX = function(x) { return cenX + x; };\n var viewMapY = function(y) { return cenY + y; };\n\n var barY0 = viewMapY(0);\n var barX0 = viewMapX(0);\n\n var viewBarX = function(x) { return barX0 + x; };\n var viewBarY = function(y) { return barY0 + y; };\n\n function pos(x, y) {\n return x + ',' + y;\n }\n\n var xStart = viewBarX(0);\n var limitX0 = function(p) { p.x = Math.max(xStart, p.x); };\n\n var edgeshape = trace.pathbar.edgeshape;\n\n // pathbar(directory) path generation fn\n var pathAncestor = function(d) {\n var _x0 = viewBarX(Math.max(Math.min(d.x0, d.x0), 0));\n var _x1 = viewBarX(Math.min(Math.max(d.x1, d.x1), barW));\n var _y0 = viewBarY(d.y0);\n var _y1 = viewBarY(d.y1);\n\n var halfH = barH / 2;\n\n var pL = {};\n var pR = {};\n\n pL.x = _x0;\n pR.x = _x1;\n\n pL.y = pR.y = (_y0 + _y1) / 2;\n\n var pA = {x: _x0, y: _y0};\n var pB = {x: _x1, y: _y0};\n var pC = {x: _x1, y: _y1};\n var pD = {x: _x0, y: _y1};\n\n if(edgeshape === '>') {\n pA.x -= halfH;\n pB.x -= halfH;\n pC.x -= halfH;\n pD.x -= halfH;\n } else if(edgeshape === '/') {\n pC.x -= halfH;\n pD.x -= halfH;\n pL.x -= halfH / 2;\n pR.x -= halfH / 2;\n } else if(edgeshape === '\\\\') {\n pA.x -= halfH;\n pB.x -= halfH;\n pL.x -= halfH / 2;\n pR.x -= halfH / 2;\n } else if(edgeshape === '<') {\n pL.x -= halfH;\n pR.x -= halfH;\n }\n\n limitX0(pA);\n limitX0(pD);\n limitX0(pL);\n\n limitX0(pB);\n limitX0(pC);\n limitX0(pR);\n\n return (\n 'M' + pos(pA.x, pA.y) +\n 'L' + pos(pB.x, pB.y) +\n 'L' + pos(pR.x, pR.y) +\n 'L' + pos(pC.x, pC.y) +\n 'L' + pos(pD.x, pD.y) +\n 'L' + pos(pL.x, pL.y) +\n 'Z'\n );\n };\n\n // slice path generation fn\n var pathDescendant = function(d) {\n var _x0 = viewMapX(d.x0);\n var _x1 = viewMapX(d.x1);\n var _y0 = viewMapY(d.y0);\n var _y1 = viewMapY(d.y1);\n\n var dx = _x1 - _x0;\n var dy = _y1 - _y0;\n if(!dx || !dy) return '';\n\n var FILLET = 0; // TODO: may expose this constant\n\n var r = (\n dx > 2 * FILLET &&\n dy > 2 * FILLET\n ) ? FILLET : 0;\n\n var arc = function(rx, ry) { return r ? 'a' + pos(r, r) + ' 0 0 1 ' + pos(rx, ry) : ''; };\n\n return (\n 'M' + pos(_x0, _y0 + r) +\n arc(r, -r) +\n 'L' + pos(_x1 - r, _y0) +\n arc(r, r) +\n 'L' + pos(_x1, _y1 - r) +\n arc(-r, r) +\n 'L' + pos(_x0 + r, _y1) +\n arc(-r, -r) + 'Z'\n );\n };\n\n var toMoveInsideSlice = function(pt, opts) {\n var x0 = pt.x0;\n var x1 = pt.x1;\n var y0 = pt.y0;\n var y1 = pt.y1;\n var textBB = pt.textBB;\n\n var hasFlag = function(f) { return trace.textposition.indexOf(f) !== -1; };\n\n var hasBottom = hasFlag('bottom');\n var hasTop = hasFlag('top') || (opts.isHeader && !hasBottom);\n\n var anchor =\n hasTop ? 'start' :\n hasBottom ? 'end' : 'middle';\n\n var hasRight = hasFlag('right');\n var hasLeft = hasFlag('left') || opts.onPathbar;\n\n var leftToRight =\n hasLeft ? -1 :\n hasRight ? 1 : 0;\n\n var pad = trace.marker.pad;\n if(opts.isHeader) {\n x0 += pad.l - TEXTPAD;\n x1 -= pad.r - TEXTPAD;\n if(x0 >= x1) {\n var mid = (x0 + x1) / 2;\n x0 = mid;\n x1 = mid;\n }\n\n // limit the drawing area for headers\n var limY;\n if(hasBottom) {\n limY = y1 - pad.b;\n if(y0 < limY && limY < y1) y0 = limY;\n } else {\n limY = y0 + pad.t;\n if(y0 < limY && limY < y1) y1 = limY;\n }\n }\n\n // position the text relative to the slice\n var transform = toMoveInsideBar(x0, x1, y0, y1, textBB, {\n isHorizontal: false,\n constrained: true,\n angle: 0,\n anchor: anchor,\n leftToRight: leftToRight\n });\n transform.fontSize = opts.fontSize;\n\n transform.targetX = viewMapX(transform.targetX);\n transform.targetY = viewMapY(transform.targetY);\n\n if(isNaN(transform.targetX) || isNaN(transform.targetY)) {\n return {};\n }\n\n if(x0 !== x1 && y0 !== y1) {\n recordMinTextSize(trace.type, transform, fullLayout);\n }\n\n return {\n scale: transform.scale,\n rotate: transform.rotate,\n textX: transform.textX,\n textY: transform.textY,\n anchorX: transform.anchorX,\n anchorY: transform.anchorY,\n targetX: transform.targetX,\n targetY: transform.targetY\n };\n };\n\n var interpFromParent = function(pt, onPathbar) {\n var parentPrev;\n var i = 0;\n var Q = pt;\n while(!parentPrev && i < maxDepth) { // loop to find a parent/grandParent on the previous graph\n i++;\n Q = Q.parent;\n if(Q) {\n parentPrev = getPrev(Q, onPathbar);\n } else i = maxDepth;\n }\n return parentPrev || {};\n };\n\n var makeExitSliceInterpolator = function(pt, onPathbar, refRect, size) {\n var prev = getPrev(pt, onPathbar);\n var next;\n\n if(onPathbar) {\n next = pathbarOrigin;\n } else {\n var entryPrev = getPrev(entry, onPathbar);\n if(entryPrev) {\n // 'entryPrev' is here has the previous coordinates of the entry\n // node, which corresponds to the last \"clicked\" node when zooming in\n next = findClosestEdge(pt, entryPrev, size);\n } else {\n // this happens when maxdepth is set, when leaves must\n // be removed and the entry is new (i.e. does not have a 'prev' object)\n next = {};\n }\n }\n\n return d3.interpolate(prev, next);\n };\n\n var makeUpdateSliceInterpolator = function(pt, onPathbar, refRect, size) {\n var prev0 = getPrev(pt, onPathbar);\n var prev;\n\n if(prev0) {\n // if pt already on graph, this is easy\n prev = prev0;\n } else {\n // for new pts:\n if(onPathbar) {\n prev = pathbarOrigin;\n } else {\n if(prevEntry) {\n // if trace was visible before\n if(pt.parent) {\n var ref = nextOfPrevEntry || refRect;\n\n if(ref && !onPathbar) {\n prev = findClosestEdge(pt, ref, size);\n } else {\n // if new leaf (when maxdepth is set),\n // grow it from its parent node\n prev = {};\n Lib.extendFlat(prev, interpFromParent(pt, onPathbar));\n }\n } else {\n prev = pt;\n }\n } else {\n prev = {};\n }\n }\n }\n\n return d3.interpolate(prev, {\n x0: pt.x0,\n x1: pt.x1,\n y0: pt.y0,\n y1: pt.y1\n });\n };\n\n var makeUpdateTextInterpolator = function(pt, onPathbar, refRect, size) {\n var prev0 = getPrev(pt, onPathbar);\n var prev = {};\n var origin = getOrigin(pt, onPathbar, refRect, size);\n\n Lib.extendFlat(prev, {\n transform: toMoveInsideSlice({\n x0: origin.x0,\n x1: origin.x1,\n y0: origin.y0,\n y1: origin.y1,\n textBB: pt.textBB,\n _text: pt._text\n }, {\n isHeader: helpers.isHeader(pt, trace)\n })\n });\n\n if(prev0) {\n // if pt already on graph, this is easy\n prev = prev0;\n } else {\n // for new pts:\n if(pt.parent) {\n Lib.extendFlat(prev, interpFromParent(pt, onPathbar));\n }\n }\n\n var transform = pt.transform;\n if(pt.x0 !== pt.x1 && pt.y0 !== pt.y1) {\n recordMinTextSize(trace.type, transform, fullLayout);\n }\n\n return d3.interpolate(prev, {\n transform: {\n scale: transform.scale,\n rotate: transform.rotate,\n textX: transform.textX,\n textY: transform.textY,\n anchorX: transform.anchorX,\n anchorY: transform.anchorY,\n targetX: transform.targetX,\n targetY: transform.targetY\n }\n });\n };\n\n var handleSlicesExit = function(slices, onPathbar, refRect, size, pathSlice) {\n var width = size[0];\n var height = size[1];\n\n if(hasTransition) {\n slices.exit().transition()\n .each(function() {\n var sliceTop = d3.select(this);\n\n var slicePath = sliceTop.select('path.surface');\n slicePath.transition().attrTween('d', function(pt2) {\n var interp = makeExitSliceInterpolator(pt2, onPathbar, refRect, [width, height]);\n return function(t) { return pathSlice(interp(t)); };\n });\n\n var sliceTextGroup = sliceTop.select('g.slicetext');\n sliceTextGroup.attr('opacity', 0);\n })\n .remove();\n } else {\n slices.exit().remove();\n }\n };\n\n var strTransform = function(d) {\n var transform = d.transform;\n\n if(d.x0 !== d.x1 && d.y0 !== d.y1) {\n recordMinTextSize(trace.type, transform, fullLayout);\n }\n\n return Lib.getTextTransform({\n textX: transform.textX,\n textY: transform.textY,\n anchorX: transform.anchorX,\n anchorY: transform.anchorY,\n targetX: transform.targetX,\n targetY: transform.targetY,\n scale: transform.scale,\n rotate: transform.rotate\n });\n };\n\n if(hasTransition) {\n // Important: do this before binding new sliceData!\n\n selAncestors.each(function(pt) {\n prevLookupPathbar[getKey(pt)] = {\n x0: pt.x0,\n x1: pt.x1,\n y0: pt.y0,\n y1: pt.y1\n };\n\n if(pt.transform) {\n prevLookupPathbar[getKey(pt)].transform = {\n textX: pt.transform.textX,\n textY: pt.transform.textY,\n anchorX: pt.transform.anchorX,\n anchorY: pt.transform.anchorY,\n targetX: pt.transform.targetX,\n targetY: pt.transform.targetY,\n scale: pt.transform.scale,\n rotate: pt.transform.rotate\n };\n }\n });\n\n selDescendants.each(function(pt) {\n prevLookupSlices[getKey(pt)] = {\n x0: pt.x0,\n x1: pt.x1,\n y0: pt.y0,\n y1: pt.y1\n };\n\n if(pt.transform) {\n prevLookupSlices[getKey(pt)].transform = {\n textX: pt.transform.textX,\n textY: pt.transform.textY,\n anchorX: pt.transform.anchorX,\n anchorY: pt.transform.anchorY,\n targetX: pt.transform.targetX,\n targetY: pt.transform.targetY,\n scale: pt.transform.scale,\n rotate: pt.transform.rotate\n };\n }\n\n if(!prevEntry && helpers.isEntry(pt)) {\n prevEntry = pt;\n }\n });\n }\n\n nextOfPrevEntry = drawDescendants(gd, cd, entry, selDescendants, {\n width: vpw,\n height: vph,\n\n viewX: viewMapX,\n viewY: viewMapY,\n\n pathSlice: pathDescendant,\n toMoveInsideSlice: toMoveInsideSlice,\n\n prevEntry: prevEntry,\n makeUpdateSliceInterpolator: makeUpdateSliceInterpolator,\n makeUpdateTextInterpolator: makeUpdateTextInterpolator,\n\n handleSlicesExit: handleSlicesExit,\n hasTransition: hasTransition,\n strTransform: strTransform\n });\n\n if(trace.pathbar.visible) {\n drawAncestors(gd, cd, entry, selAncestors, {\n barDifY: barDifY,\n width: barW,\n height: barH,\n\n viewX: viewBarX,\n viewY: viewBarY,\n\n pathSlice: pathAncestor,\n toMoveInsideSlice: toMoveInsideSlice,\n\n makeUpdateSliceInterpolator: makeUpdateSliceInterpolator,\n makeUpdateTextInterpolator: makeUpdateTextInterpolator,\n\n handleSlicesExit: handleSlicesExit,\n hasTransition: hasTransition,\n strTransform: strTransform\n });\n } else {\n selAncestors.remove();\n }\n}\n\n},{\"../../lib\":728,\"../bar/constants\":871,\"../bar/plot\":880,\"../bar/style\":883,\"../bar/uniform_text\":885,\"../sunburst/helpers\":1251,\"./constants\":1274,\"./draw_ancestors\":1276,\"./draw_descendants\":1277,\"d3\":164}],1283:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Color = _dereq_('../../components/color');\nvar Lib = _dereq_('../../lib');\nvar helpers = _dereq_('../sunburst/helpers');\nvar resizeText = _dereq_('../bar/uniform_text').resizeText;\n\nfunction style(gd) {\n var s = gd._fullLayout._treemaplayer.selectAll('.trace');\n resizeText(gd, s, 'treemap');\n\n s.each(function(cd) {\n var gTrace = d3.select(this);\n var cd0 = cd[0];\n var trace = cd0.trace;\n\n gTrace.style('opacity', trace.opacity);\n\n gTrace.selectAll('path.surface').each(function(pt) {\n d3.select(this).call(styleOne, pt, trace, {\n hovered: false\n });\n });\n });\n}\n\nfunction styleOne(s, pt, trace, opts) {\n var hovered = (opts || {}).hovered;\n var cdi = pt.data.data;\n var ptNumber = cdi.i;\n var lineColor;\n var lineWidth;\n var fillColor = cdi.color;\n var isRoot = helpers.isHierarchyRoot(pt);\n var opacity = 1;\n\n if(hovered) {\n lineColor = trace._hovered.marker.line.color;\n lineWidth = trace._hovered.marker.line.width;\n } else {\n if(isRoot && fillColor === 'rgba(0,0,0,0)') {\n opacity = 0;\n lineColor = 'rgba(0,0,0,0)';\n lineWidth = 0;\n } else {\n lineColor = Lib.castOption(trace, ptNumber, 'marker.line.color') || Color.defaultLine;\n lineWidth = Lib.castOption(trace, ptNumber, 'marker.line.width') || 0;\n\n if(!trace._hasColorscale && !pt.onPathbar) {\n var depthfade = trace.marker.depthfade;\n if(depthfade) {\n var fadedColor = Color.combine(Color.addOpacity(trace._backgroundColor, 0.75), fillColor);\n var n;\n\n if(depthfade === true) {\n var maxDepth = helpers.getMaxDepth(trace);\n if(isFinite(maxDepth)) {\n if(helpers.isLeaf(pt)) {\n n = 0;\n } else {\n n = (trace._maxVisibleLayers) - (pt.data.depth - trace._entryDepth);\n }\n } else {\n n = pt.data.height + 1;\n }\n } else { // i.e. case of depthfade === 'reversed'\n n = pt.data.depth - trace._entryDepth;\n if(!trace._atRootLevel) n++;\n }\n\n if(n > 0) {\n for(var i = 0; i < n; i++) {\n var ratio = 0.5 * i / n;\n fillColor = Color.combine(Color.addOpacity(fadedColor, ratio), fillColor);\n }\n }\n }\n }\n }\n }\n\n s.style('stroke-width', lineWidth)\n .call(Color.fill, fillColor)\n .call(Color.stroke, lineColor)\n .style('opacity', opacity);\n}\n\nmodule.exports = {\n style: style,\n styleOne: styleOne\n};\n\n},{\"../../components/color\":595,\"../../lib\":728,\"../bar/uniform_text\":885,\"../sunburst/helpers\":1251,\"d3\":164}],1284:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar boxAttrs = _dereq_('../box/attributes');\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\n\nmodule.exports = {\n y: boxAttrs.y,\n x: boxAttrs.x,\n x0: boxAttrs.x0,\n y0: boxAttrs.y0,\n name: extendFlat({}, boxAttrs.name, {\n \n }),\n orientation: extendFlat({}, boxAttrs.orientation, {\n \n }),\n\n bandwidth: {\n valType: 'number',\n min: 0,\n \n editType: 'calc',\n \n },\n\n scalegroup: {\n valType: 'string',\n \n dflt: '',\n editType: 'calc',\n \n },\n scalemode: {\n valType: 'enumerated',\n values: ['width', 'count'],\n dflt: 'width',\n \n editType: 'calc',\n \n },\n\n spanmode: {\n valType: 'enumerated',\n values: ['soft', 'hard', 'manual'],\n dflt: 'soft',\n \n editType: 'calc',\n \n },\n span: {\n valType: 'info_array',\n items: [\n {valType: 'any', editType: 'calc'},\n {valType: 'any', editType: 'calc'}\n ],\n \n editType: 'calc',\n \n },\n\n line: {\n color: {\n valType: 'color',\n \n editType: 'style',\n \n },\n width: {\n valType: 'number',\n \n min: 0,\n dflt: 2,\n editType: 'style',\n \n },\n editType: 'plot'\n },\n fillcolor: boxAttrs.fillcolor,\n\n points: extendFlat({}, boxAttrs.boxpoints, {\n \n }),\n jitter: extendFlat({}, boxAttrs.jitter, {\n \n }),\n pointpos: extendFlat({}, boxAttrs.pointpos, {\n \n }),\n\n width: extendFlat({}, boxAttrs.width, {\n \n }),\n\n marker: boxAttrs.marker,\n text: boxAttrs.text,\n hovertext: boxAttrs.hovertext,\n hovertemplate: boxAttrs.hovertemplate,\n\n box: {\n visible: {\n valType: 'boolean',\n dflt: false,\n \n editType: 'plot',\n \n },\n width: {\n valType: 'number',\n min: 0,\n max: 1,\n dflt: 0.25,\n \n editType: 'plot',\n \n },\n fillcolor: {\n valType: 'color',\n \n editType: 'style',\n \n },\n line: {\n color: {\n valType: 'color',\n \n editType: 'style',\n \n },\n width: {\n valType: 'number',\n min: 0,\n \n editType: 'style',\n \n },\n editType: 'style'\n },\n editType: 'plot'\n },\n\n meanline: {\n visible: {\n valType: 'boolean',\n dflt: false,\n \n editType: 'plot',\n \n },\n color: {\n valType: 'color',\n \n editType: 'style',\n \n },\n width: {\n valType: 'number',\n min: 0,\n \n editType: 'style',\n \n },\n editType: 'plot'\n },\n\n side: {\n valType: 'enumerated',\n values: ['both', 'positive', 'negative'],\n dflt: 'both',\n \n editType: 'calc',\n \n },\n\n offsetgroup: boxAttrs.offsetgroup,\n alignmentgroup: boxAttrs.alignmentgroup,\n\n selected: boxAttrs.selected,\n unselected: boxAttrs.unselected,\n\n hoveron: {\n valType: 'flaglist',\n flags: ['violins', 'points', 'kde'],\n dflt: 'violins+points+kde',\n extras: ['all'],\n \n editType: 'style',\n \n }\n};\n\n},{\"../../lib/extend\":719,\"../box/attributes\":894}],1285:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar boxCalc = _dereq_('../box/calc');\nvar helpers = _dereq_('./helpers');\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\n\nmodule.exports = function calc(gd, trace) {\n var cd = boxCalc(gd, trace);\n\n if(cd[0].t.empty) return cd;\n\n var fullLayout = gd._fullLayout;\n var valAxis = Axes.getFromId(\n gd,\n trace[trace.orientation === 'h' ? 'xaxis' : 'yaxis']\n );\n\n var spanMin = Infinity;\n var spanMax = -Infinity;\n var maxKDE = 0;\n var maxCount = 0;\n\n for(var i = 0; i < cd.length; i++) {\n var cdi = cd[i];\n var vals = cdi.pts.map(helpers.extractVal);\n\n var bandwidth = cdi.bandwidth = calcBandwidth(trace, cdi, vals);\n var span = cdi.span = calcSpan(trace, cdi, valAxis, bandwidth);\n\n if(cdi.min === cdi.max && bandwidth === 0) {\n // if span is zero and bandwidth is zero, we want a violin with zero width\n span = cdi.span = [cdi.min, cdi.max];\n cdi.density = [{v: 1, t: span[0]}];\n cdi.bandwidth = bandwidth;\n maxKDE = Math.max(maxKDE, 1);\n } else {\n // step that well covers the bandwidth and is multiple of span distance\n var dist = span[1] - span[0];\n var n = Math.ceil(dist / (bandwidth / 3));\n var step = dist / n;\n\n if(!isFinite(step) || !isFinite(n)) {\n Lib.error('Something went wrong with computing the violin span');\n cd[0].t.empty = true;\n return cd;\n }\n\n var kde = helpers.makeKDE(cdi, trace, vals);\n cdi.density = new Array(n);\n\n for(var k = 0, t = span[0]; t < (span[1] + step / 2); k++, t += step) {\n var v = kde(t);\n cdi.density[k] = {v: v, t: t};\n maxKDE = Math.max(maxKDE, v);\n }\n }\n\n maxCount = Math.max(maxCount, vals.length);\n spanMin = Math.min(spanMin, span[0]);\n spanMax = Math.max(spanMax, span[1]);\n }\n\n var extremes = Axes.findExtremes(valAxis, [spanMin, spanMax], {padded: true});\n trace._extremes[valAxis._id] = extremes;\n\n if(trace.width) {\n cd[0].t.maxKDE = maxKDE;\n } else {\n var violinScaleGroupStats = fullLayout._violinScaleGroupStats;\n var scaleGroup = trace.scalegroup;\n var groupStats = violinScaleGroupStats[scaleGroup];\n\n if(groupStats) {\n groupStats.maxKDE = Math.max(groupStats.maxKDE, maxKDE);\n groupStats.maxCount = Math.max(groupStats.maxCount, maxCount);\n } else {\n violinScaleGroupStats[scaleGroup] = {\n maxKDE: maxKDE,\n maxCount: maxCount\n };\n }\n }\n\n cd[0].t.labels.kde = Lib._(gd, 'kde:');\n\n return cd;\n};\n\n// Default to Silveman's rule of thumb\n// - https://stats.stackexchange.com/a/6671\n// - https://en.wikipedia.org/wiki/Kernel_density_estimation#A_rule-of-thumb_bandwidth_estimator\n// - https://github.com/statsmodels/statsmodels/blob/master/statsmodels/nonparametric/bandwidths.py\nfunction silvermanRule(len, ssd, iqr) {\n var a = Math.min(ssd, iqr / 1.349);\n return 1.059 * a * Math.pow(len, -0.2);\n}\n\nfunction calcBandwidth(trace, cdi, vals) {\n var span = cdi.max - cdi.min;\n\n // If span is zero\n if(!span) {\n if(trace.bandwidth) {\n return trace.bandwidth;\n } else {\n // if span is zero and no bandwidth is specified\n // it returns zero bandwidth which is a special case\n return 0;\n }\n }\n\n // Limit how small the bandwidth can be.\n //\n // Silverman's rule of thumb can be \"very\" small\n // when IQR does a poor job at describing the spread\n // of the distribution.\n // We also want to limit custom bandwidths\n // to not blow up kde computations.\n\n if(trace.bandwidth) {\n return Math.max(trace.bandwidth, span / 1e4);\n } else {\n var len = vals.length;\n var ssd = Lib.stdev(vals, len - 1, cdi.mean);\n return Math.max(\n silvermanRule(len, ssd, cdi.q3 - cdi.q1),\n span / 100\n );\n }\n}\n\nfunction calcSpan(trace, cdi, valAxis, bandwidth) {\n var spanmode = trace.spanmode;\n var spanIn = trace.span || [];\n var spanTight = [cdi.min, cdi.max];\n var spanLoose = [cdi.min - 2 * bandwidth, cdi.max + 2 * bandwidth];\n var spanOut;\n\n function calcSpanItem(index) {\n var s = spanIn[index];\n var sc = valAxis.type === 'multicategory' ?\n valAxis.r2c(s) :\n valAxis.d2c(s, 0, trace[cdi.valLetter + 'calendar']);\n return sc === BADNUM ? spanLoose[index] : sc;\n }\n\n if(spanmode === 'soft') {\n spanOut = spanLoose;\n } else if(spanmode === 'hard') {\n spanOut = spanTight;\n } else {\n spanOut = [calcSpanItem(0), calcSpanItem(1)];\n }\n\n // to reuse the equal-range-item block\n var dummyAx = {\n type: 'linear',\n range: spanOut\n };\n Axes.setConvert(dummyAx);\n dummyAx.cleanRange();\n\n return spanOut;\n}\n\n},{\"../../constants/numerical\":704,\"../../lib\":728,\"../../plots/cartesian/axes\":776,\"../box/calc\":895,\"./helpers\":1288}],1286:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar setPositionOffset = _dereq_('../box/cross_trace_calc').setPositionOffset;\nvar orientations = ['v', 'h'];\n\nmodule.exports = function crossTraceCalc(gd, plotinfo) {\n var calcdata = gd.calcdata;\n var xa = plotinfo.xaxis;\n var ya = plotinfo.yaxis;\n\n for(var i = 0; i < orientations.length; i++) {\n var orientation = orientations[i];\n var posAxis = orientation === 'h' ? ya : xa;\n var violinList = [];\n\n for(var j = 0; j < calcdata.length; j++) {\n var cd = calcdata[j];\n var t = cd[0].t;\n var trace = cd[0].trace;\n\n if(trace.visible === true && trace.type === 'violin' &&\n !t.empty &&\n trace.orientation === orientation &&\n trace.xaxis === xa._id &&\n trace.yaxis === ya._id\n ) {\n violinList.push(j);\n }\n }\n\n setPositionOffset('violin', gd, violinList, posAxis);\n }\n};\n\n},{\"../box/cross_trace_calc\":896}],1287:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Color = _dereq_('../../components/color');\n\nvar boxDefaults = _dereq_('../box/defaults');\nvar attributes = _dereq_('./attributes');\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 function coerce2(attr, dflt) {\n return Lib.coerce2(traceIn, traceOut, attributes, attr, dflt);\n }\n\n boxDefaults.handleSampleDefaults(traceIn, traceOut, coerce, layout);\n if(traceOut.visible === false) return;\n\n coerce('bandwidth');\n coerce('side');\n\n var width = coerce('width');\n if(!width) {\n coerce('scalegroup', traceOut.name);\n coerce('scalemode');\n }\n\n var span = coerce('span');\n var spanmodeDflt;\n if(Array.isArray(span)) spanmodeDflt = 'manual';\n coerce('spanmode', spanmodeDflt);\n\n var lineColor = coerce('line.color', (traceIn.marker || {}).color || defaultColor);\n var lineWidth = coerce('line.width');\n var fillColor = coerce('fillcolor', Color.addOpacity(traceOut.line.color, 0.5));\n\n boxDefaults.handlePointsDefaults(traceIn, traceOut, coerce, {prefix: ''});\n\n var boxWidth = coerce2('box.width');\n var boxFillColor = coerce2('box.fillcolor', fillColor);\n var boxLineColor = coerce2('box.line.color', lineColor);\n var boxLineWidth = coerce2('box.line.width', lineWidth);\n var boxVisible = coerce('box.visible', Boolean(boxWidth || boxFillColor || boxLineColor || boxLineWidth));\n if(!boxVisible) traceOut.box = {visible: false};\n\n var meanLineColor = coerce2('meanline.color', lineColor);\n var meanLineWidth = coerce2('meanline.width', lineWidth);\n var meanLineVisible = coerce('meanline.visible', Boolean(meanLineColor || meanLineWidth));\n if(!meanLineVisible) traceOut.meanline = {visible: false};\n};\n\n},{\"../../components/color\":595,\"../../lib\":728,\"../box/defaults\":897,\"./attributes\":1284}],1288:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\n// Maybe add kernels more down the road,\n// but note that the default `spanmode: 'soft'` bounds might have\n// to become kernel-dependent\nvar kernels = {\n gaussian: function(v) {\n return (1 / Math.sqrt(2 * Math.PI)) * Math.exp(-0.5 * v * v);\n }\n};\n\nexports.makeKDE = function(calcItem, trace, vals) {\n var len = vals.length;\n var kernel = kernels.gaussian;\n var bandwidth = calcItem.bandwidth;\n var factor = 1 / (len * bandwidth);\n\n // don't use Lib.aggNums to skip isNumeric checks\n return function(x) {\n var sum = 0;\n for(var i = 0; i < len; i++) {\n sum += kernel((x - vals[i]) / bandwidth);\n }\n return factor * sum;\n };\n};\n\nexports.getPositionOnKdePath = function(calcItem, trace, valuePx) {\n var posLetter, valLetter;\n\n if(trace.orientation === 'h') {\n posLetter = 'y';\n valLetter = 'x';\n } else {\n posLetter = 'x';\n valLetter = 'y';\n }\n\n var pointOnPath = Lib.findPointOnPath(\n calcItem.path,\n valuePx,\n valLetter,\n {pathLength: calcItem.pathLength}\n );\n\n var posCenterPx = calcItem.posCenterPx;\n var posOnPath0 = pointOnPath[posLetter];\n var posOnPath1 = trace.side === 'both' ?\n 2 * posCenterPx - posOnPath0 :\n posCenterPx;\n\n return [posOnPath0, posOnPath1];\n};\n\nexports.getKdeValue = function(calcItem, trace, valueDist) {\n var vals = calcItem.pts.map(exports.extractVal);\n var kde = exports.makeKDE(calcItem, trace, vals);\n return kde(valueDist) / calcItem.posDensityScale;\n};\n\nexports.extractVal = function(o) { return o.v; };\n\n},{\"../../lib\":728}],1289:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar boxHoverPoints = _dereq_('../box/hover');\nvar helpers = _dereq_('./helpers');\n\nmodule.exports = function hoverPoints(pointData, xval, yval, hovermode, hoverLayer) {\n var cd = pointData.cd;\n var trace = cd[0].trace;\n var hoveron = trace.hoveron;\n var hasHoveronViolins = hoveron.indexOf('violins') !== -1;\n var hasHoveronKDE = hoveron.indexOf('kde') !== -1;\n var closeData = [];\n var closePtData;\n var violinLineAttrs;\n\n if(hasHoveronViolins || hasHoveronKDE) {\n var closeBoxData = boxHoverPoints.hoverOnBoxes(pointData, xval, yval, hovermode);\n\n if(hasHoveronKDE && closeBoxData.length > 0) {\n var xa = pointData.xa;\n var ya = pointData.ya;\n var pLetter, vLetter, pAxis, vAxis, vVal;\n\n if(trace.orientation === 'h') {\n vVal = xval;\n pLetter = 'y';\n pAxis = ya;\n vLetter = 'x';\n vAxis = xa;\n } else {\n vVal = yval;\n pLetter = 'x';\n pAxis = xa;\n vLetter = 'y';\n vAxis = ya;\n }\n\n var di = cd[pointData.index];\n\n if(vVal >= di.span[0] && vVal <= di.span[1]) {\n var kdePointData = Lib.extendFlat({}, pointData);\n var vValPx = vAxis.c2p(vVal, true);\n var kdeVal = helpers.getKdeValue(di, trace, vVal);\n var pOnPath = helpers.getPositionOnKdePath(di, trace, vValPx);\n var paOffset = pAxis._offset;\n var paLength = pAxis._length;\n\n kdePointData[pLetter + '0'] = pOnPath[0];\n kdePointData[pLetter + '1'] = pOnPath[1];\n kdePointData[vLetter + '0'] = kdePointData[vLetter + '1'] = vValPx;\n kdePointData[vLetter + 'Label'] = vLetter + ': ' + Axes.hoverLabelText(vAxis, vVal) + ', ' + cd[0].t.labels.kde + ' ' + kdeVal.toFixed(3);\n\n // move the spike to the KDE point\n kdePointData.spikeDistance = closeBoxData[0].spikeDistance;\n var spikePosAttr = pLetter + 'Spike';\n kdePointData[spikePosAttr] = closeBoxData[0][spikePosAttr];\n closeBoxData[0].spikeDistance = undefined;\n closeBoxData[0][spikePosAttr] = undefined;\n\n // no hovertemplate support yet\n kdePointData.hovertemplate = false;\n\n closeData.push(kdePointData);\n\n violinLineAttrs = {stroke: pointData.color};\n violinLineAttrs[pLetter + '1'] = Lib.constrain(paOffset + pOnPath[0], paOffset, paOffset + paLength);\n violinLineAttrs[pLetter + '2'] = Lib.constrain(paOffset + pOnPath[1], paOffset, paOffset + paLength);\n violinLineAttrs[vLetter + '1'] = violinLineAttrs[vLetter + '2'] = vAxis._offset + vValPx;\n }\n }\n\n if(hasHoveronViolins) {\n closeData = closeData.concat(closeBoxData);\n }\n }\n\n if(hoveron.indexOf('points') !== -1) {\n closePtData = boxHoverPoints.hoverOnPoints(pointData, xval, yval);\n }\n\n // update violin line (if any)\n var violinLine = hoverLayer.selectAll('.violinline-' + trace.uid)\n .data(violinLineAttrs ? [0] : []);\n violinLine.enter().append('line')\n .classed('violinline-' + trace.uid, true)\n .attr('stroke-width', 1.5);\n violinLine.exit().remove();\n violinLine.attr(violinLineAttrs);\n\n // same combine logic as box hoverPoints\n if(hovermode === 'closest') {\n if(closePtData) return [closePtData];\n return closeData;\n }\n if(closePtData) {\n closeData.push(closePtData);\n return closeData;\n }\n return closeData;\n};\n\n},{\"../../lib\":728,\"../../plots/cartesian/axes\":776,\"../box/hover\":899,\"./helpers\":1288}],1290:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n attributes: _dereq_('./attributes'),\n layoutAttributes: _dereq_('./layout_attributes'),\n supplyDefaults: _dereq_('./defaults'),\n crossTraceDefaults: _dereq_('../box/defaults').crossTraceDefaults,\n supplyLayoutDefaults: _dereq_('./layout_defaults'),\n calc: _dereq_('./calc'),\n crossTraceCalc: _dereq_('./cross_trace_calc'),\n plot: _dereq_('./plot'),\n style: _dereq_('./style'),\n styleOnSelect: _dereq_('../scatter/style').styleOnSelect,\n hoverPoints: _dereq_('./hover'),\n selectPoints: _dereq_('../box/select'),\n\n moduleType: 'trace',\n name: 'violin',\n basePlotModule: _dereq_('../../plots/cartesian'),\n categories: ['cartesian', 'svg', 'symbols', 'oriented', 'box-violin', 'showLegend', 'violinLayout', 'zoomScale'],\n meta: {\n \n }\n};\n\n},{\"../../plots/cartesian\":789,\"../box/defaults\":897,\"../box/select\":904,\"../scatter/style\":1157,\"./attributes\":1284,\"./calc\":1285,\"./cross_trace_calc\":1286,\"./defaults\":1287,\"./hover\":1289,\"./layout_attributes\":1291,\"./layout_defaults\":1292,\"./plot\":1293,\"./style\":1294}],1291:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar boxLayoutAttrs = _dereq_('../box/layout_attributes');\nvar extendFlat = _dereq_('../../lib').extendFlat;\n\nmodule.exports = {\n violinmode: extendFlat({}, boxLayoutAttrs.boxmode, {\n \n }),\n violingap: extendFlat({}, boxLayoutAttrs.boxgap, {\n \n }),\n violingroupgap: extendFlat({}, boxLayoutAttrs.boxgroupgap, {\n \n })\n};\n\n},{\"../../lib\":728,\"../box/layout_attributes\":901}],1292:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar layoutAttributes = _dereq_('./layout_attributes');\nvar boxLayoutDefaults = _dereq_('../box/layout_defaults');\n\nmodule.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {\n function coerce(attr, dflt) {\n return Lib.coerce(layoutIn, layoutOut, layoutAttributes, attr, dflt);\n }\n boxLayoutDefaults._supply(layoutIn, layoutOut, fullData, coerce, 'violin');\n};\n\n},{\"../../lib\":728,\"../box/layout_defaults\":902,\"./layout_attributes\":1291}],1293:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Lib = _dereq_('../../lib');\nvar Drawing = _dereq_('../../components/drawing');\n\nvar boxPlot = _dereq_('../box/plot');\nvar linePoints = _dereq_('../scatter/line_points');\nvar helpers = _dereq_('./helpers');\n\nmodule.exports = function plot(gd, plotinfo, cdViolins, violinLayer) {\n var fullLayout = gd._fullLayout;\n var xa = plotinfo.xaxis;\n var ya = plotinfo.yaxis;\n\n function makePath(pts) {\n var segments = linePoints(pts, {\n xaxis: xa,\n yaxis: ya,\n connectGaps: true,\n baseTolerance: 0.75,\n shape: 'spline',\n simplify: true,\n linearized: true\n });\n return Drawing.smoothopen(segments[0], 1);\n }\n\n Lib.makeTraceGroups(violinLayer, cdViolins, 'trace violins').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 if(trace.visible !== true || t.empty) {\n plotGroup.remove();\n return;\n }\n\n var bPos = t.bPos;\n var bdPos = t.bdPos;\n var valAxis = plotinfo[t.valLetter + 'axis'];\n var posAxis = plotinfo[t.posLetter + 'axis'];\n var hasBothSides = trace.side === 'both';\n var hasPositiveSide = hasBothSides || trace.side === 'positive';\n var hasNegativeSide = hasBothSides || trace.side === 'negative';\n\n var violins = plotGroup.selectAll('path.violin').data(Lib.identity);\n\n violins.enter().append('path')\n .style('vector-effect', 'non-scaling-stroke')\n .attr('class', 'violin');\n\n violins.exit().remove();\n\n violins.each(function(d) {\n var pathSel = d3.select(this);\n var density = d.density;\n var len = density.length;\n var posCenter = posAxis.c2l(d.pos + bPos, true);\n var posCenterPx = posAxis.l2p(posCenter);\n\n var scale;\n if(trace.width) {\n scale = t.maxKDE / bdPos;\n } else {\n var groupStats = fullLayout._violinScaleGroupStats[trace.scalegroup];\n scale = trace.scalemode === 'count' ?\n (groupStats.maxKDE / bdPos) * (groupStats.maxCount / d.pts.length) :\n groupStats.maxKDE / bdPos;\n }\n\n var pathPos, pathNeg, path;\n var i, k, pts, pt;\n\n if(hasPositiveSide) {\n pts = new Array(len);\n for(i = 0; i < len; i++) {\n pt = pts[i] = {};\n pt[t.posLetter] = posCenter + (density[i].v / scale);\n pt[t.valLetter] = valAxis.c2l(density[i].t, true);\n }\n pathPos = makePath(pts);\n }\n\n if(hasNegativeSide) {\n pts = new Array(len);\n for(k = 0, i = len - 1; k < len; k++, i--) {\n pt = pts[k] = {};\n pt[t.posLetter] = posCenter - (density[i].v / scale);\n pt[t.valLetter] = valAxis.c2l(density[i].t, true);\n }\n pathNeg = makePath(pts);\n }\n\n if(hasBothSides) {\n path = pathPos + 'L' + pathNeg.substr(1) + 'Z';\n } else {\n var startPt = [posCenterPx, valAxis.c2p(density[0].t)];\n var endPt = [posCenterPx, valAxis.c2p(density[len - 1].t)];\n\n if(trace.orientation === 'h') {\n startPt.reverse();\n endPt.reverse();\n }\n\n if(hasPositiveSide) {\n path = 'M' + startPt + 'L' + pathPos.substr(1) + 'L' + endPt;\n } else {\n path = 'M' + endPt + 'L' + pathNeg.substr(1) + 'L' + startPt;\n }\n }\n pathSel.attr('d', path);\n\n // save a few things used in getPositionOnKdePath, getKdeValue\n // on hover and for meanline draw block below\n d.posCenterPx = posCenterPx;\n d.posDensityScale = scale * bdPos;\n d.path = pathSel.node();\n d.pathLength = d.path.getTotalLength() / (hasBothSides ? 2 : 1);\n });\n\n var boxAttrs = trace.box;\n var boxWidth = boxAttrs.width;\n var boxLineWidth = (boxAttrs.line || {}).width;\n var bdPosScaled;\n var bPosPxOffset;\n\n if(hasBothSides) {\n bdPosScaled = bdPos * boxWidth;\n bPosPxOffset = 0;\n } else if(hasPositiveSide) {\n bdPosScaled = [0, bdPos * boxWidth / 2];\n bPosPxOffset = boxLineWidth * {x: 1, y: -1}[t.posLetter];\n } else {\n bdPosScaled = [bdPos * boxWidth / 2, 0];\n bPosPxOffset = boxLineWidth * {x: -1, y: 1}[t.posLetter];\n }\n\n // inner box\n boxPlot.plotBoxAndWhiskers(plotGroup, {pos: posAxis, val: valAxis}, trace, {\n bPos: bPos,\n bdPos: bdPosScaled,\n bPosPxOffset: bPosPxOffset\n });\n\n // meanline insider box\n boxPlot.plotBoxMean(plotGroup, {pos: posAxis, val: valAxis}, trace, {\n bPos: bPos,\n bdPos: bdPosScaled,\n bPosPxOffset: bPosPxOffset\n });\n\n var fn;\n if(!trace.box.visible && trace.meanline.visible) {\n fn = Lib.identity;\n }\n\n // N.B. use different class name than boxPlot.plotBoxMean,\n // to avoid selectAll conflict\n var meanPaths = plotGroup.selectAll('path.meanline').data(fn || []);\n meanPaths.enter().append('path')\n .attr('class', 'meanline')\n .style('fill', 'none')\n .style('vector-effect', 'non-scaling-stroke');\n meanPaths.exit().remove();\n meanPaths.each(function(d) {\n var v = valAxis.c2p(d.mean, true);\n var p = helpers.getPositionOnKdePath(d, trace, v);\n\n d3.select(this).attr('d',\n trace.orientation === 'h' ?\n 'M' + v + ',' + p[0] + 'V' + p[1] :\n 'M' + p[0] + ',' + v + 'H' + p[1]\n );\n });\n\n boxPlot.plotPoints(plotGroup, {x: xa, y: ya}, trace, t);\n });\n};\n\n},{\"../../components/drawing\":617,\"../../lib\":728,\"../box/plot\":903,\"../scatter/line_points\":1148,\"./helpers\":1288,\"d3\":164}],1294:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Color = _dereq_('../../components/color');\nvar stylePoints = _dereq_('../scatter/style').stylePoints;\n\nmodule.exports = function style(gd) {\n var s = d3.select(gd).selectAll('g.trace.violins');\n\n s.style('opacity', function(d) { return d[0].trace.opacity; });\n\n s.each(function(d) {\n var trace = d[0].trace;\n var sel = d3.select(this);\n var box = trace.box || {};\n var boxLine = box.line || {};\n var meanline = trace.meanline || {};\n var meanLineWidth = meanline.width;\n\n sel.selectAll('path.violin')\n .style('stroke-width', trace.line.width + 'px')\n .call(Color.stroke, trace.line.color)\n .call(Color.fill, trace.fillcolor);\n\n sel.selectAll('path.box')\n .style('stroke-width', boxLine.width + 'px')\n .call(Color.stroke, boxLine.color)\n .call(Color.fill, box.fillcolor);\n\n var meanLineStyle = {\n 'stroke-width': meanLineWidth + 'px',\n 'stroke-dasharray': (2 * meanLineWidth) + 'px,' + meanLineWidth + 'px'\n };\n\n sel.selectAll('path.mean')\n .style(meanLineStyle)\n .call(Color.stroke, meanline.color);\n\n sel.selectAll('path.meanline')\n .style(meanLineStyle)\n .call(Color.stroke, meanline.color);\n\n stylePoints(sel, trace, gd);\n });\n};\n\n},{\"../../components/color\":595,\"../scatter/style\":1157,\"d3\":164}],1295:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar colorScaleAttrs = _dereq_('../../components/colorscale/attributes');\nvar isosurfaceAttrs = _dereq_('../isosurface/attributes');\nvar surfaceAttrs = _dereq_('../surface/attributes');\nvar baseAttrs = _dereq_('../../plots/attributes');\n\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\nvar overrideAll = _dereq_('../../plot_api/edit_types').overrideAll;\n\nvar attrs = module.exports = overrideAll(extendFlat({\n x: isosurfaceAttrs.x,\n y: isosurfaceAttrs.y,\n z: isosurfaceAttrs.z,\n value: isosurfaceAttrs.value,\n isomin: isosurfaceAttrs.isomin,\n isomax: isosurfaceAttrs.isomax,\n surface: isosurfaceAttrs.surface,\n spaceframe: {\n show: {\n valType: 'boolean',\n \n dflt: false,\n \n },\n fill: {\n valType: 'number',\n \n min: 0,\n max: 1,\n dflt: 1,\n \n }\n },\n\n slices: isosurfaceAttrs.slices,\n caps: isosurfaceAttrs.caps,\n text: isosurfaceAttrs.text,\n hovertext: isosurfaceAttrs.hovertext,\n hovertemplate: isosurfaceAttrs.hovertemplate\n},\n\ncolorScaleAttrs('', {\n colorAttr: '`value`',\n showScaleDflt: true,\n editTypeOverride: 'calc'\n}), {\n\n colorbar: isosurfaceAttrs.colorbar,\n opacity: isosurfaceAttrs.opacity,\n opacityscale: surfaceAttrs.opacityscale,\n\n lightposition: isosurfaceAttrs.lightposition,\n lighting: isosurfaceAttrs.lighting,\n flatshading: isosurfaceAttrs.flatshading,\n contour: isosurfaceAttrs.contour,\n\n hoverinfo: extendFlat({}, baseAttrs.hoverinfo),\n showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})\n}), 'calc', 'nested');\n\nattrs.x.editType = attrs.y.editType = attrs.z.editType = attrs.value.editType = 'calc+clearAxisTypes';\nattrs.transforms = undefined;\n\n},{\"../../components/colorscale/attributes\":602,\"../../lib/extend\":719,\"../../plot_api/edit_types\":759,\"../../plots/attributes\":773,\"../isosurface/attributes\":1070,\"../surface/attributes\":1257}],1296:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar createMesh = _dereq_('gl-mesh3d');\n\nvar parseColorScale = _dereq_('../../lib/gl_format_color').parseColorScale;\nvar str2RgbaArray = _dereq_('../../lib/str2rgbarray');\nvar extractOpts = _dereq_('../../components/colorscale').extractOpts;\nvar zip3 = _dereq_('../../plots/gl3d/zip3');\n\nvar findNearestOnAxis = _dereq_('../isosurface/convert').findNearestOnAxis;\nvar generateIsoMeshes = _dereq_('../isosurface/convert').generateIsoMeshes;\n\nfunction VolumeTrace(scene, mesh, uid) {\n this.scene = scene;\n this.uid = uid;\n this.mesh = mesh;\n this.name = '';\n this.data = null;\n this.showContour = false;\n}\n\nvar proto = VolumeTrace.prototype;\n\nproto.handlePick = function(selection) {\n if(selection.object === this.mesh) {\n var rawId = selection.data.index;\n\n var x = this.data._meshX[rawId];\n var y = this.data._meshY[rawId];\n var z = this.data._meshZ[rawId];\n\n var height = this.data._Ys.length;\n var depth = this.data._Zs.length;\n\n var i = findNearestOnAxis(x, this.data._Xs).id;\n var j = findNearestOnAxis(y, this.data._Ys).id;\n var k = findNearestOnAxis(z, this.data._Zs).id;\n\n var selectIndex = selection.index = k + depth * j + depth * height * i;\n\n selection.traceCoordinate = [\n this.data._meshX[selectIndex],\n this.data._meshY[selectIndex],\n this.data._meshZ[selectIndex],\n this.data._value[selectIndex]\n ];\n\n var text = this.data.hovertext || this.data.text;\n if(Array.isArray(text) && text[selectIndex] !== undefined) {\n selection.textLabel = text[selectIndex];\n } else if(text) {\n selection.textLabel = text;\n }\n\n return true;\n }\n};\n\nproto.update = function(data) {\n var scene = this.scene;\n var layout = scene.fullSceneLayout;\n\n this.data = generateIsoMeshes(data);\n\n // Unpack position data\n function toDataCoords(axis, coord, scale, calendar) {\n return coord.map(function(x) {\n return axis.d2l(x, 0, calendar) * scale;\n });\n }\n\n var positions = zip3(\n toDataCoords(layout.xaxis, data._meshX, scene.dataScale[0], data.xcalendar),\n toDataCoords(layout.yaxis, data._meshY, scene.dataScale[1], data.ycalendar),\n toDataCoords(layout.zaxis, data._meshZ, scene.dataScale[2], data.zcalendar));\n\n var cells = zip3(data._meshI, data._meshJ, data._meshK);\n\n var config = {\n positions: positions,\n cells: cells,\n lightPosition: [data.lightposition.x, data.lightposition.y, data.lightposition.z],\n ambient: data.lighting.ambient,\n diffuse: data.lighting.diffuse,\n specular: data.lighting.specular,\n roughness: data.lighting.roughness,\n fresnel: data.lighting.fresnel,\n vertexNormalsEpsilon: data.lighting.vertexnormalsepsilon,\n faceNormalsEpsilon: data.lighting.facenormalsepsilon,\n opacity: data.opacity,\n opacityscale: data.opacityscale,\n contourEnable: data.contour.show,\n contourColor: str2RgbaArray(data.contour.color).slice(0, 3),\n contourWidth: data.contour.width,\n useFacetNormals: data.flatshading\n };\n\n var cOpts = extractOpts(data);\n config.vertexIntensity = data._meshIntensity;\n config.vertexIntensityBounds = [cOpts.min, cOpts.max];\n config.colormap = parseColorScale(data);\n\n // Update mesh\n this.mesh.update(config);\n};\n\nproto.dispose = function() {\n this.scene.glplot.remove(this.mesh);\n this.mesh.dispose();\n};\n\nfunction createVolumeTrace(scene, data) {\n var gl = scene.glplot.gl;\n var mesh = createMesh({gl: gl});\n var result = new VolumeTrace(scene, mesh, data.uid);\n\n mesh._trace = result;\n result.update(data);\n scene.glplot.add(mesh);\n return result;\n}\n\nmodule.exports = createVolumeTrace;\n\n},{\"../../components/colorscale\":607,\"../../lib/gl_format_color\":725,\"../../lib/str2rgbarray\":751,\"../../plots/gl3d/zip3\":829,\"../isosurface/convert\":1072,\"gl-mesh3d\":287}],1297:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar attributes = _dereq_('./attributes');\nvar supplyIsoDefaults = _dereq_('../isosurface/defaults').supplyIsoDefaults;\nvar opacityscaleDefaults = _dereq_('../surface/defaults').opacityscaleDefaults;\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 supplyIsoDefaults(traceIn, traceOut, defaultColor, layout, coerce);\n\n opacityscaleDefaults(traceIn, traceOut, layout, coerce);\n};\n\n},{\"../../lib\":728,\"../isosurface/defaults\":1073,\"../surface/defaults\":1260,\"./attributes\":1295}],1298:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n attributes: _dereq_('./attributes'),\n supplyDefaults: _dereq_('./defaults'),\n calc: _dereq_('../isosurface/calc'),\n colorbar: {\n min: 'cmin',\n max: 'cmax'\n },\n plot: _dereq_('./convert'),\n\n moduleType: 'trace',\n name: 'volume',\n basePlotModule: _dereq_('../../plots/gl3d'),\n categories: ['gl3d', 'showLegend'],\n meta: {\n \n }\n};\n\n},{\"../../plots/gl3d\":818,\"../isosurface/calc\":1071,\"./attributes\":1295,\"./convert\":1296,\"./defaults\":1297}],1299:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar barAttrs = _dereq_('../bar/attributes');\nvar lineAttrs = _dereq_('../scatter/attributes').line;\nvar baseAttrs = _dereq_('../../plots/attributes');\nvar hovertemplateAttrs = _dereq_('../../plots/template_attributes').hovertemplateAttrs;\nvar texttemplateAttrs = _dereq_('../../plots/template_attributes').texttemplateAttrs;\nvar constants = _dereq_('./constants');\nvar extendFlat = _dereq_('../../lib/extend').extendFlat;\nvar Color = _dereq_('../../components/color');\n\nfunction directionAttrs(dirTxt) {\n return {\n marker: {\n color: extendFlat({}, barAttrs.marker.color, {\n arrayOk: false,\n editType: 'style',\n \n }),\n line: {\n color: extendFlat({}, barAttrs.marker.line.color, {\n arrayOk: false,\n editType: 'style',\n \n }),\n width: extendFlat({}, barAttrs.marker.line.width, {\n arrayOk: false,\n editType: 'style',\n \n }),\n editType: 'style',\n },\n editType: 'style'\n },\n editType: 'style'\n };\n}\n\nmodule.exports = {\n measure: {\n valType: 'data_array',\n dflt: [],\n \n editType: 'calc',\n \n },\n\n base: {\n valType: 'number',\n dflt: null,\n arrayOk: false,\n \n editType: 'calc',\n \n },\n\n x: barAttrs.x,\n x0: barAttrs.x0,\n dx: barAttrs.dx,\n y: barAttrs.y,\n y0: barAttrs.y0,\n dy: barAttrs.dy,\n\n hovertext: barAttrs.hovertext,\n hovertemplate: hovertemplateAttrs({}, {\n keys: constants.eventDataKeys\n }),\n\n hoverinfo: extendFlat({}, baseAttrs.hoverinfo, {\n flags: ['name', 'x', 'y', 'text', 'initial', 'delta', 'final']\n }),\n\n textinfo: {\n valType: 'flaglist',\n flags: ['label', 'text', 'initial', 'delta', 'final'],\n extras: ['none'],\n \n editType: 'plot',\n arrayOk: false,\n \n },\n // TODO: incorporate `label` and `value` in the eventData\n texttemplate: texttemplateAttrs({editType: 'plot'}, {\n keys: constants.eventDataKeys.concat(['label'])\n }),\n text: barAttrs.text,\n textposition: barAttrs.textposition,\n insidetextanchor: barAttrs.insidetextanchor,\n textangle: barAttrs.textangle,\n textfont: barAttrs.textfont,\n insidetextfont: barAttrs.insidetextfont,\n outsidetextfont: barAttrs.outsidetextfont,\n constraintext: barAttrs.constraintext,\n\n cliponaxis: barAttrs.cliponaxis,\n orientation: barAttrs.orientation,\n\n offset: barAttrs.offset,\n width: barAttrs.width,\n\n increasing: directionAttrs('increasing'),\n decreasing: directionAttrs('decreasing'),\n totals: directionAttrs('intermediate sums and total'),\n\n connector: {\n line: {\n color: extendFlat({}, lineAttrs.color, {dflt: Color.defaultLine}),\n width: extendFlat({}, lineAttrs.width, {\n editType: 'plot', // i.e. to adjust bars is mode: 'between'. See https://github.com/plotly/plotly.js/issues/3787\n }),\n dash: lineAttrs.dash,\n editType: 'plot'\n },\n mode: {\n valType: 'enumerated',\n values: ['spanning', 'between'],\n dflt: 'between',\n \n editType: 'plot',\n \n },\n visible: {\n valType: 'boolean',\n dflt: true,\n \n editType: 'plot',\n \n },\n editType: 'plot'\n },\n\n offsetgroup: barAttrs.offsetgroup,\n alignmentgroup: barAttrs.alignmentgroup\n};\n\n},{\"../../components/color\":595,\"../../lib/extend\":719,\"../../plots/attributes\":773,\"../../plots/template_attributes\":854,\"../bar/attributes\":869,\"../scatter/attributes\":1134,\"./constants\":1301}],1300:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Axes = _dereq_('../../plots/cartesian/axes');\nvar mergeArray = _dereq_('../../lib').mergeArray;\nvar calcSelection = _dereq_('../scatter/calc_selection');\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\n\nfunction isAbsolute(a) {\n return (a === 'a' || a === 'absolute');\n}\n\nfunction isTotal(a) {\n return (a === 't' || a === 'total');\n}\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;\n\n if(trace.orientation === 'h') {\n size = xa.makeCalcdata(trace, 'x');\n pos = ya.makeCalcdata(trace, 'y');\n } else {\n size = ya.makeCalcdata(trace, 'y');\n pos = xa.makeCalcdata(trace, 'x');\n }\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 (as well as for waterfall total size)\n var previousSum = 0;\n var newSize;\n // trace-wide flags\n var hasTotals = false;\n\n for(var i = 0; i < serieslen; i++) {\n var amount = size[i] || 0;\n\n var connectToNext = false;\n if(size[i] !== BADNUM || isTotal(trace.measure[i]) || isAbsolute(trace.measure[i])) {\n if(i + 1 < serieslen && (size[i + 1] !== BADNUM || isTotal(trace.measure[i + 1]) || isAbsolute(trace.measure[i + 1]))) {\n connectToNext = true;\n }\n }\n\n var cdi = cd[i] = {\n i: i,\n p: pos[i],\n s: amount,\n rawS: amount,\n cNext: connectToNext\n };\n\n if(isAbsolute(trace.measure[i])) {\n previousSum = cdi.s;\n\n cdi.isSum = true;\n cdi.dir = 'totals';\n cdi.s = previousSum;\n } else if(isTotal(trace.measure[i])) {\n cdi.isSum = true;\n cdi.dir = 'totals';\n cdi.s = previousSum;\n } else {\n // default: relative\n cdi.isSum = false;\n cdi.dir = cdi.rawS < 0 ? 'decreasing' : 'increasing';\n newSize = cdi.s;\n cdi.s = previousSum + newSize;\n previousSum += newSize;\n }\n\n if(cdi.dir === 'totals') {\n hasTotals = true;\n }\n\n if(trace.ids) {\n cdi.id = String(trace.ids[i]);\n }\n\n cdi.v = (trace.base || 0) + previousSum;\n }\n\n if(cd.length) cd[0].hasTotals = hasTotals;\n\n mergeArray(trace.text, cd, 'tx');\n mergeArray(trace.hovertext, cd, 'htx');\n calcSelection(cd, trace);\n\n return cd;\n};\n\n},{\"../../constants/numerical\":704,\"../../lib\":728,\"../../plots/cartesian/axes\":776,\"../scatter/calc_selection\":1136}],1301:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n eventDataKeys: [\n 'initial',\n 'delta',\n 'final'\n ]\n};\n\n},{}],1302:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar setGroupPositions = _dereq_('../bar/cross_trace_calc').setGroupPositions;\n\nmodule.exports = function crossTraceCalc(gd, plotinfo) {\n var fullLayout = gd._fullLayout;\n var fullData = gd._fullData;\n var calcdata = gd.calcdata;\n var xa = plotinfo.xaxis;\n var ya = plotinfo.yaxis;\n var waterfalls = [];\n var waterfallsVert = [];\n var waterfallsHorz = [];\n var cd, i;\n\n for(i = 0; i < fullData.length; i++) {\n var fullTrace = fullData[i];\n\n if(\n fullTrace.visible === true &&\n fullTrace.xaxis === xa._id &&\n fullTrace.yaxis === ya._id &&\n fullTrace.type === 'waterfall'\n ) {\n cd = calcdata[i];\n\n if(fullTrace.orientation === 'h') {\n waterfallsHorz.push(cd);\n } else {\n waterfallsVert.push(cd);\n }\n\n waterfalls.push(cd);\n }\n }\n\n var opts = {\n mode: fullLayout.waterfallmode,\n norm: fullLayout.waterfallnorm,\n gap: fullLayout.waterfallgap,\n groupgap: fullLayout.waterfallgroupgap\n };\n\n setGroupPositions(gd, xa, ya, waterfallsVert, opts);\n setGroupPositions(gd, ya, xa, waterfallsHorz, opts);\n\n for(i = 0; i < waterfalls.length; i++) {\n cd = waterfalls[i];\n\n for(var j = 0; j < cd.length; j++) {\n var di = cd[j];\n\n if(di.isSum === false) {\n di.s0 += (j === 0) ? 0 : cd[j - 1].s;\n }\n\n if(j + 1 < cd.length) {\n cd[j].nextP0 = cd[j + 1].p0;\n cd[j].nextS0 = cd[j + 1].s0;\n }\n }\n }\n};\n\n},{\"../bar/cross_trace_calc\":872}],1303:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\n\nvar handleGroupingDefaults = _dereq_('../bar/defaults').handleGroupingDefaults;\nvar handleText = _dereq_('../bar/defaults').handleText;\nvar handleXYDefaults = _dereq_('../scatter/xy_defaults');\nvar attributes = _dereq_('./attributes');\nvar Color = _dereq_('../../components/color');\nvar delta = _dereq_('../../constants/delta.js');\n\nvar INCREASING_COLOR = delta.INCREASING.COLOR;\nvar DECREASING_COLOR = delta.DECREASING.COLOR;\nvar TOTALS_COLOR = '#4499FF';\n\nfunction handleDirection(coerce, direction, defaultColor) {\n coerce(direction + '.marker.color', defaultColor);\n coerce(direction + '.marker.line.color', Color.defaultLine);\n coerce(direction + '.marker.line.width');\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 len = handleXYDefaults(traceIn, traceOut, layout, coerce);\n if(!len) {\n traceOut.visible = false;\n return;\n }\n\n coerce('measure');\n\n coerce('orientation', (traceOut.x && !traceOut.y) ? 'h' : 'v');\n coerce('base');\n coerce('offset');\n coerce('width');\n\n coerce('text');\n\n coerce('hovertext');\n coerce('hovertemplate');\n\n var textposition = coerce('textposition');\n handleText(traceIn, traceOut, layout, coerce, textposition, {\n moduleHasSelected: false,\n moduleHasUnselected: false,\n moduleHasConstrain: true,\n moduleHasCliponaxis: true,\n moduleHasTextangle: true,\n moduleHasInsideanchor: true\n });\n\n\n if(traceOut.textposition !== 'none') {\n coerce('texttemplate');\n if(!traceOut.texttemplate) coerce('textinfo');\n }\n\n handleDirection(coerce, 'increasing', INCREASING_COLOR);\n handleDirection(coerce, 'decreasing', DECREASING_COLOR);\n handleDirection(coerce, 'totals', TOTALS_COLOR);\n\n var connectorVisible = coerce('connector.visible');\n if(connectorVisible) {\n coerce('connector.mode');\n var connectorLineWidth = coerce('connector.line.width');\n if(connectorLineWidth) {\n coerce('connector.line.color');\n coerce('connector.line.dash');\n }\n }\n}\n\nfunction crossTraceDefaults(fullData, fullLayout) {\n var traceIn, traceOut;\n\n function coerce(attr) {\n return Lib.coerce(traceOut._input, traceOut, attributes, attr);\n }\n\n if(fullLayout.waterfallmode === 'group') {\n for(var i = 0; i < fullData.length; i++) {\n traceOut = fullData[i];\n traceIn = traceOut._input;\n\n handleGroupingDefaults(traceIn, traceOut, fullLayout, coerce);\n }\n }\n}\n\nmodule.exports = {\n supplyDefaults: supplyDefaults,\n crossTraceDefaults: crossTraceDefaults\n};\n\n},{\"../../components/color\":595,\"../../constants/delta.js\":698,\"../../lib\":728,\"../bar/defaults\":873,\"../scatter/xy_defaults\":1160,\"./attributes\":1299}],1304:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = function eventData(out, pt /* , trace, cd, pointNumber */) {\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\n // for funnel\n if('initial' in pt) out.initial = pt.initial;\n if('delta' in pt) out.delta = pt.delta;\n if('final' in pt) out.final = pt.final;\n\n if(pt.xa) out.xaxis = pt.xa;\n if(pt.ya) out.yaxis = pt.ya;\n\n return out;\n};\n\n},{}],1305:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar hoverLabelText = _dereq_('../../plots/cartesian/axes').hoverLabelText;\nvar opacity = _dereq_('../../components/color').opacity;\nvar hoverOnBars = _dereq_('../bar/hover').hoverOnBars;\nvar delta = _dereq_('../../constants/delta.js');\n\nvar DIRSYMBOL = {\n increasing: delta.INCREASING.SYMBOL,\n decreasing: delta.DECREASING.SYMBOL\n};\n\nmodule.exports = function hoverPoints(pointData, xval, yval, hovermode) {\n var point = hoverOnBars(pointData, xval, yval, hovermode);\n if(!point) return;\n\n var cd = point.cd;\n var trace = cd[0].trace;\n var isHorizontal = (trace.orientation === 'h');\n\n var vAxis = isHorizontal ? pointData.xa : pointData.ya;\n\n function formatNumber(a) {\n return hoverLabelText(vAxis, a);\n }\n\n // the closest data point\n var index = point.index;\n var di = cd[index];\n\n var size = (di.isSum) ? di.b + di.s : di.rawS;\n\n if(!di.isSum) {\n point.initial = di.b + di.s - size;\n point.delta = size;\n point.final = point.initial + point.delta;\n\n var v = formatNumber(Math.abs(point.delta));\n point.deltaLabel = size < 0 ? '(' + v + ')' : v;\n point.finalLabel = formatNumber(point.final);\n point.initialLabel = formatNumber(point.initial);\n }\n\n var hoverinfo = di.hi || trace.hoverinfo;\n var text = [];\n if(hoverinfo && hoverinfo !== 'none' && hoverinfo !== 'skip') {\n var isAll = (hoverinfo === 'all');\n var parts = hoverinfo.split('+');\n\n var hasFlag = function(flag) { return isAll || parts.indexOf(flag) !== -1; };\n\n if(!di.isSum) {\n if(hasFlag('final') &&\n (isHorizontal ? !hasFlag('x') : !hasFlag('y')) // don't display redundant info.\n ) {\n text.push(point.finalLabel);\n }\n if(hasFlag('delta')) {\n if(size < 0) {\n text.push(point.deltaLabel + ' ' + DIRSYMBOL.decreasing);\n } else {\n text.push(point.deltaLabel + ' ' + DIRSYMBOL.increasing);\n }\n }\n if(hasFlag('initial')) {\n text.push('Initial: ' + point.initialLabel);\n }\n }\n }\n\n if(text.length) point.extraText = text.join('
');\n\n point.color = getTraceColor(trace, di);\n\n return [point];\n};\n\nfunction getTraceColor(trace, di) {\n var cont = trace[di.dir].marker;\n var mc = cont.color;\n var mlc = cont.line.color;\n var mlw = cont.line.width;\n if(opacity(mc)) return mc;\n else if(opacity(mlc) && mlw) return mlc;\n}\n\n},{\"../../components/color\":595,\"../../constants/delta.js\":698,\"../../plots/cartesian/axes\":776,\"../bar/hover\":876}],1306:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n attributes: _dereq_('./attributes'),\n layoutAttributes: _dereq_('./layout_attributes'),\n supplyDefaults: _dereq_('./defaults').supplyDefaults,\n crossTraceDefaults: _dereq_('./defaults').crossTraceDefaults,\n supplyLayoutDefaults: _dereq_('./layout_defaults'),\n calc: _dereq_('./calc'),\n crossTraceCalc: _dereq_('./cross_trace_calc'),\n plot: _dereq_('./plot'),\n style: _dereq_('./style').style,\n hoverPoints: _dereq_('./hover'),\n eventData: _dereq_('./event_data'),\n\n selectPoints: _dereq_('../bar/select'),\n\n moduleType: 'trace',\n name: 'waterfall',\n basePlotModule: _dereq_('../../plots/cartesian'),\n categories: ['bar-like', 'cartesian', 'svg', 'oriented', 'showLegend', 'zoomScale'],\n meta: {\n \n }\n};\n\n},{\"../../plots/cartesian\":789,\"../bar/select\":881,\"./attributes\":1299,\"./calc\":1300,\"./cross_trace_calc\":1302,\"./defaults\":1303,\"./event_data\":1304,\"./hover\":1305,\"./layout_attributes\":1307,\"./layout_defaults\":1308,\"./plot\":1309,\"./style\":1310}],1307:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nmodule.exports = {\n waterfallmode: {\n valType: 'enumerated',\n values: ['group', 'overlay'],\n dflt: 'group',\n \n editType: 'calc',\n \n },\n waterfallgap: {\n valType: 'number',\n min: 0,\n max: 1,\n \n editType: 'calc',\n \n },\n waterfallgroupgap: {\n valType: 'number',\n min: 0,\n max: 1,\n dflt: 0,\n \n editType: 'calc',\n \n }\n};\n\n},{}],1308:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../../lib');\nvar layoutAttributes = _dereq_('./layout_attributes');\n\nmodule.exports = function(layoutIn, layoutOut, fullData) {\n var hasTraceType = false;\n\n function coerce(attr, dflt) {\n return Lib.coerce(layoutIn, layoutOut, layoutAttributes, attr, dflt);\n }\n\n for(var i = 0; i < fullData.length; i++) {\n var trace = fullData[i];\n\n if(trace.visible && trace.type === 'waterfall') {\n hasTraceType = true;\n break;\n }\n }\n\n if(hasTraceType) {\n coerce('waterfallmode');\n coerce('waterfallgap', 0.2);\n coerce('waterfallgroupgap');\n }\n};\n\n},{\"../../lib\":728,\"./layout_attributes\":1307}],1309:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\nvar Lib = _dereq_('../../lib');\nvar Drawing = _dereq_('../../components/drawing');\nvar BADNUM = _dereq_('../../constants/numerical').BADNUM;\nvar barPlot = _dereq_('../bar/plot');\nvar clearMinTextSize = _dereq_('../bar/uniform_text').clearMinTextSize;\n\nmodule.exports = function plot(gd, plotinfo, cdModule, traceLayer) {\n var fullLayout = gd._fullLayout;\n\n clearMinTextSize('waterfall', fullLayout);\n\n barPlot.plot(gd, plotinfo, cdModule, traceLayer, {\n mode: fullLayout.waterfallmode,\n norm: fullLayout.waterfallmode,\n gap: fullLayout.waterfallgap,\n groupgap: fullLayout.waterfallgroupgap\n });\n\n plotConnectors(gd, plotinfo, cdModule, traceLayer);\n};\n\nfunction plotConnectors(gd, plotinfo, cdModule, traceLayer) {\n var xa = plotinfo.xaxis;\n var ya = plotinfo.yaxis;\n\n Lib.makeTraceGroups(traceLayer, cdModule, 'trace bars').each(function(cd) {\n var plotGroup = d3.select(this);\n var trace = cd[0].trace;\n\n var group = Lib.ensureSingle(plotGroup, 'g', 'lines');\n\n if(!trace.connector || !trace.connector.visible) {\n group.remove();\n return;\n }\n\n var isHorizontal = (trace.orientation === 'h');\n var mode = trace.connector.mode;\n\n var connectors = group.selectAll('g.line').data(Lib.identity);\n\n connectors.enter().append('g')\n .classed('line', true);\n\n connectors.exit().remove();\n\n var len = connectors.size();\n\n connectors.each(function(di, i) {\n // don't draw lines between nulls\n if(i !== len - 1 && !di.cNext) return;\n\n var xy = getXY(di, xa, ya, isHorizontal);\n var x = xy[0];\n var y = xy[1];\n\n var shape = '';\n\n if(\n x[0] !== BADNUM && y[0] !== BADNUM &&\n x[1] !== BADNUM && y[1] !== BADNUM\n ) {\n if(mode === 'spanning') {\n if(!di.isSum && i > 0) {\n if(isHorizontal) {\n shape += 'M' + x[0] + ',' + y[1] + 'V' + y[0];\n } else {\n shape += 'M' + x[1] + ',' + y[0] + 'H' + x[0];\n }\n }\n }\n\n if(mode !== 'between') {\n if(di.isSum || i < len - 1) {\n if(isHorizontal) {\n shape += 'M' + x[1] + ',' + y[0] + 'V' + y[1];\n } else {\n shape += 'M' + x[0] + ',' + y[1] + 'H' + x[1];\n }\n }\n }\n\n if(x[2] !== BADNUM && y[2] !== BADNUM) {\n if(isHorizontal) {\n shape += 'M' + x[1] + ',' + y[1] + 'V' + y[2];\n } else {\n shape += 'M' + x[1] + ',' + y[1] + 'H' + x[2];\n }\n }\n }\n\n if(shape === '') shape = 'M0,0Z';\n\n Lib.ensureSingle(d3.select(this), 'path')\n .attr('d', shape)\n .call(Drawing.setClipUrl, plotinfo.layerClipId, gd);\n });\n });\n}\n\nfunction getXY(di, xa, ya, isHorizontal) {\n var s = [];\n var p = [];\n\n var sAxis = isHorizontal ? xa : ya;\n var pAxis = isHorizontal ? ya : xa;\n\n s[0] = sAxis.c2p(di.s0, true);\n p[0] = pAxis.c2p(di.p0, true);\n\n s[1] = sAxis.c2p(di.s1, true);\n p[1] = pAxis.c2p(di.p1, true);\n\n s[2] = sAxis.c2p(di.nextS0, true);\n p[2] = pAxis.c2p(di.nextP0, true);\n\n return isHorizontal ? [s, p] : [p, s];\n}\n\n},{\"../../components/drawing\":617,\"../../constants/numerical\":704,\"../../lib\":728,\"../bar/plot\":880,\"../bar/uniform_text\":885,\"d3\":164}],1310:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar d3 = _dereq_('d3');\n\nvar Drawing = _dereq_('../../components/drawing');\nvar Color = _dereq_('../../components/color');\nvar DESELECTDIM = _dereq_('../../constants/interactions').DESELECTDIM;\nvar barStyle = _dereq_('../bar/style');\nvar resizeText = _dereq_('../bar/uniform_text').resizeText;\nvar styleTextPoints = barStyle.styleTextPoints;\n\nfunction style(gd, cd, sel) {\n var s = sel ? sel : d3.select(gd).selectAll('g.waterfalllayer').selectAll('g.trace');\n resizeText(gd, s, 'waterfall');\n\n s.style('opacity', function(d) { return d[0].trace.opacity; });\n\n s.each(function(d) {\n var gTrace = d3.select(this);\n var trace = d[0].trace;\n\n gTrace.selectAll('.point > path').each(function(di) {\n if(!di.isBlank) {\n var cont = trace[di.dir].marker;\n\n d3.select(this)\n .call(Color.fill, cont.color)\n .call(Color.stroke, cont.line.color)\n .call(Drawing.dashLine, cont.line.dash, cont.line.width)\n .style('opacity', trace.selectedpoints && !di.selected ? DESELECTDIM : 1);\n }\n });\n\n styleTextPoints(gTrace, trace, gd);\n\n gTrace.selectAll('.lines').each(function() {\n var cont = trace.connector.line;\n\n Drawing.lineGroupStyle(\n d3.select(this).selectAll('path'),\n cont.width,\n cont.color,\n cont.dash\n );\n });\n });\n}\n\nmodule.exports = {\n style: style\n};\n\n},{\"../../components/color\":595,\"../../components/drawing\":617,\"../../constants/interactions\":703,\"../bar/style\":883,\"../bar/uniform_text\":885,\"d3\":164}],1311:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Axes = _dereq_('../plots/cartesian/axes');\nvar Lib = _dereq_('../lib');\nvar PlotSchema = _dereq_('../plot_api/plot_schema');\nvar pointsAccessorFunction = _dereq_('./helpers').pointsAccessorFunction;\nvar BADNUM = _dereq_('../constants/numerical').BADNUM;\n\nexports.moduleType = 'transform';\n\nexports.name = 'aggregate';\n\nvar attrs = exports.attributes = {\n enabled: {\n valType: 'boolean',\n dflt: true,\n \n editType: 'calc',\n \n },\n groups: {\n // TODO: groupby should support string or array grouping this way too\n // currently groupby only allows a grouping array\n valType: 'string',\n strict: true,\n noBlank: true,\n arrayOk: true,\n dflt: 'x',\n \n editType: 'calc',\n \n },\n aggregations: {\n _isLinkedToArray: 'aggregation',\n target: {\n valType: 'string',\n \n editType: 'calc',\n \n },\n func: {\n valType: 'enumerated',\n values: ['count', 'sum', 'avg', 'median', 'mode', 'rms', 'stddev', 'min', 'max', 'first', 'last', 'change', 'range'],\n dflt: 'first',\n \n editType: 'calc',\n \n },\n funcmode: {\n valType: 'enumerated',\n values: ['sample', 'population'],\n dflt: 'sample',\n \n editType: 'calc',\n \n },\n enabled: {\n valType: 'boolean',\n dflt: true,\n \n editType: 'calc',\n \n },\n editType: 'calc'\n },\n editType: 'calc'\n};\n\nvar aggAttrs = attrs.aggregations;\n\n/**\n * Supply transform attributes defaults\n *\n * @param {object} transformIn\n * object linked to trace.transforms[i] with 'func' set to exports.name\n * @param {object} traceOut\n * the _fullData trace this transform applies to\n * @param {object} layout\n * the plot's (not-so-full) layout\n * @param {object} traceIn\n * the input data trace this transform applies to\n *\n * @return {object} transformOut\n * copy of transformIn that contains attribute defaults\n */\nexports.supplyDefaults = function(transformIn, traceOut) {\n var transformOut = {};\n var i;\n\n function coerce(attr, dflt) {\n return Lib.coerce(transformIn, transformOut, attrs, attr, dflt);\n }\n\n var enabled = coerce('enabled');\n\n if(!enabled) return transformOut;\n\n /*\n * Normally _arrayAttrs is calculated during doCalc, but that comes later.\n * Anyway this can change due to *count* aggregations (see below) so it's not\n * necessarily the same set.\n *\n * For performance we turn it into an object of truthy values\n * we'll use 1 for arrays we haven't aggregated yet, 0 for finished arrays,\n * as distinct from undefined which means this array isn't present in the input\n * missing arrays can still be aggregate outputs for *count* aggregations.\n */\n var arrayAttrArray = PlotSchema.findArrayAttributes(traceOut);\n var arrayAttrs = {};\n for(i = 0; i < arrayAttrArray.length; i++) arrayAttrs[arrayAttrArray[i]] = 1;\n\n var groups = coerce('groups');\n\n if(!Array.isArray(groups)) {\n if(!arrayAttrs[groups]) {\n transformOut.enabled = false;\n return transformOut;\n }\n arrayAttrs[groups] = 0;\n }\n\n var aggregationsIn = transformIn.aggregations || [];\n var aggregationsOut = transformOut.aggregations = new Array(aggregationsIn.length);\n var aggregationOut;\n\n function coercei(attr, dflt) {\n return Lib.coerce(aggregationsIn[i], aggregationOut, aggAttrs, attr, dflt);\n }\n\n for(i = 0; i < aggregationsIn.length; i++) {\n aggregationOut = {_index: i};\n var target = coercei('target');\n var func = coercei('func');\n var enabledi = coercei('enabled');\n\n // add this aggregation to the output only if it's the first instance\n // of a valid target attribute - or an unused target attribute with \"count\"\n if(enabledi && target && (arrayAttrs[target] || (func === 'count' && arrayAttrs[target] === undefined))) {\n if(func === 'stddev') coercei('funcmode');\n\n arrayAttrs[target] = 0;\n aggregationsOut[i] = aggregationOut;\n } else aggregationsOut[i] = {enabled: false, _index: i};\n }\n\n // any array attributes we haven't yet covered, fill them with the default aggregation\n for(i = 0; i < arrayAttrArray.length; i++) {\n if(arrayAttrs[arrayAttrArray[i]]) {\n aggregationsOut.push({\n target: arrayAttrArray[i],\n func: aggAttrs.func.dflt,\n enabled: true,\n _index: -1\n });\n }\n }\n\n return transformOut;\n};\n\n\nexports.calcTransform = function(gd, trace, opts) {\n if(!opts.enabled) return;\n\n var groups = opts.groups;\n\n var groupArray = Lib.getTargetArray(trace, {target: groups});\n if(!groupArray) return;\n\n var i, vi, groupIndex, newGrouping;\n\n var groupIndices = {};\n var indexToPoints = {};\n var groupings = [];\n\n var originalPointsAccessor = pointsAccessorFunction(trace.transforms, opts);\n\n var len = groupArray.length;\n if(trace._length) len = Math.min(len, trace._length);\n\n for(i = 0; i < len; i++) {\n vi = groupArray[i];\n groupIndex = groupIndices[vi];\n if(groupIndex === undefined) {\n groupIndices[vi] = groupings.length;\n newGrouping = [i];\n groupings.push(newGrouping);\n indexToPoints[groupIndices[vi]] = originalPointsAccessor(i);\n } else {\n groupings[groupIndex].push(i);\n indexToPoints[groupIndices[vi]] = (indexToPoints[groupIndices[vi]] || []).concat(originalPointsAccessor(i));\n }\n }\n\n opts._indexToPoints = indexToPoints;\n\n var aggregations = opts.aggregations;\n\n for(i = 0; i < aggregations.length; i++) {\n aggregateOneArray(gd, trace, groupings, aggregations[i]);\n }\n\n if(typeof groups === 'string') {\n aggregateOneArray(gd, trace, groupings, {\n target: groups,\n func: 'first',\n enabled: true\n });\n }\n\n trace._length = groupings.length;\n};\n\nfunction aggregateOneArray(gd, trace, groupings, aggregation) {\n if(!aggregation.enabled) return;\n\n var attr = aggregation.target;\n var targetNP = Lib.nestedProperty(trace, attr);\n var arrayIn = targetNP.get();\n var conversions = Axes.getDataConversions(gd, trace, attr, arrayIn);\n var func = getAggregateFunction(aggregation, conversions);\n\n var arrayOut = new Array(groupings.length);\n for(var i = 0; i < groupings.length; i++) {\n arrayOut[i] = func(arrayIn, groupings[i]);\n }\n targetNP.set(arrayOut);\n\n if(aggregation.func === 'count') {\n // count does not depend on an input array, so it's likely not part of _arrayAttrs yet\n // but after this transform it most definitely *is* an array attribute.\n Lib.pushUnique(trace._arrayAttrs, attr);\n }\n}\n\nfunction getAggregateFunction(opts, conversions) {\n var func = opts.func;\n var d2c = conversions.d2c;\n var c2d = conversions.c2d;\n\n switch(func) {\n // count, first, and last don't depend on anything about the data\n // point back to pure functions for performance\n case 'count':\n return count;\n case 'first':\n return first;\n case 'last':\n return last;\n\n case 'sum':\n // This will produce output in all cases even though it's nonsensical\n // for date or category data.\n return function(array, indices) {\n var total = 0;\n for(var i = 0; i < indices.length; i++) {\n var vi = d2c(array[indices[i]]);\n if(vi !== BADNUM) total += vi;\n }\n return c2d(total);\n };\n\n case 'avg':\n // Generally meaningless for category data but it still does something.\n return function(array, indices) {\n var total = 0;\n var cnt = 0;\n for(var i = 0; i < indices.length; i++) {\n var vi = d2c(array[indices[i]]);\n if(vi !== BADNUM) {\n total += vi;\n cnt++;\n }\n }\n return cnt ? c2d(total / cnt) : BADNUM;\n };\n\n case 'min':\n return function(array, indices) {\n var out = Infinity;\n for(var i = 0; i < indices.length; i++) {\n var vi = d2c(array[indices[i]]);\n if(vi !== BADNUM) out = Math.min(out, vi);\n }\n return (out === Infinity) ? BADNUM : c2d(out);\n };\n\n case 'max':\n return function(array, indices) {\n var out = -Infinity;\n for(var i = 0; i < indices.length; i++) {\n var vi = d2c(array[indices[i]]);\n if(vi !== BADNUM) out = Math.max(out, vi);\n }\n return (out === -Infinity) ? BADNUM : c2d(out);\n };\n\n case 'range':\n return function(array, indices) {\n var min = Infinity;\n var max = -Infinity;\n for(var i = 0; i < indices.length; i++) {\n var vi = d2c(array[indices[i]]);\n if(vi !== BADNUM) {\n min = Math.min(min, vi);\n max = Math.max(max, vi);\n }\n }\n return (max === -Infinity || min === Infinity) ? BADNUM : c2d(max - min);\n };\n\n case 'change':\n return function(array, indices) {\n var first = d2c(array[indices[0]]);\n var last = d2c(array[indices[indices.length - 1]]);\n return (first === BADNUM || last === BADNUM) ? BADNUM : c2d(last - first);\n };\n\n case 'median':\n return function(array, indices) {\n var sortCalc = [];\n for(var i = 0; i < indices.length; i++) {\n var vi = d2c(array[indices[i]]);\n if(vi !== BADNUM) sortCalc.push(vi);\n }\n if(!sortCalc.length) return BADNUM;\n sortCalc.sort(Lib.sorterAsc);\n var mid = (sortCalc.length - 1) / 2;\n return c2d((sortCalc[Math.floor(mid)] + sortCalc[Math.ceil(mid)]) / 2);\n };\n\n case 'mode':\n return function(array, indices) {\n var counts = {};\n var maxCnt = 0;\n var out = BADNUM;\n for(var i = 0; i < indices.length; i++) {\n var vi = d2c(array[indices[i]]);\n if(vi !== BADNUM) {\n var counti = counts[vi] = (counts[vi] || 0) + 1;\n if(counti > maxCnt) {\n maxCnt = counti;\n out = vi;\n }\n }\n }\n return maxCnt ? c2d(out) : BADNUM;\n };\n\n case 'rms':\n return function(array, indices) {\n var total = 0;\n var cnt = 0;\n for(var i = 0; i < indices.length; i++) {\n var vi = d2c(array[indices[i]]);\n if(vi !== BADNUM) {\n total += vi * vi;\n cnt++;\n }\n }\n return cnt ? c2d(Math.sqrt(total / cnt)) : BADNUM;\n };\n\n case 'stddev':\n return function(array, indices) {\n // balance numerical stability with performance:\n // so that we call d2c once per element but don't need to\n // store them, reference all to the first element\n var total = 0;\n var total2 = 0;\n var cnt = 1;\n var v0 = BADNUM;\n var i;\n for(i = 0; i < indices.length && v0 === BADNUM; i++) {\n v0 = d2c(array[indices[i]]);\n }\n if(v0 === BADNUM) return BADNUM;\n\n for(; i < indices.length; i++) {\n var vi = d2c(array[indices[i]]);\n if(vi !== BADNUM) {\n var dv = vi - v0;\n total += dv;\n total2 += dv * dv;\n cnt++;\n }\n }\n\n // This is population std dev, if we want sample std dev\n // we would need (...) / (cnt - 1)\n // Also note there's no c2d here - that means for dates the result\n // is a number of milliseconds, and for categories it's a number\n // of category differences, which is not generically meaningful but\n // as in other cases we don't forbid it.\n var norm = (opts.funcmode === 'sample') ? (cnt - 1) : cnt;\n // this is debatable: should a count of 1 return sample stddev of\n // 0 or undefined?\n if(!norm) return 0;\n return Math.sqrt((total2 - (total * total / cnt)) / norm);\n };\n }\n}\n\nfunction count(array, indices) {\n return indices.length;\n}\n\nfunction first(array, indices) {\n return array[indices[0]];\n}\n\nfunction last(array, indices) {\n return array[indices[indices.length - 1]];\n}\n\n},{\"../constants/numerical\":704,\"../lib\":728,\"../plot_api/plot_schema\":765,\"../plots/cartesian/axes\":776,\"./helpers\":1314}],1312:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../lib');\nvar Registry = _dereq_('../registry');\nvar Axes = _dereq_('../plots/cartesian/axes');\nvar pointsAccessorFunction = _dereq_('./helpers').pointsAccessorFunction;\n\nvar filterOps = _dereq_('../constants/filter_ops');\nvar COMPARISON_OPS = filterOps.COMPARISON_OPS;\nvar INTERVAL_OPS = filterOps.INTERVAL_OPS;\nvar SET_OPS = filterOps.SET_OPS;\n\nexports.moduleType = 'transform';\n\nexports.name = 'filter';\n\nexports.attributes = {\n enabled: {\n valType: 'boolean',\n dflt: true,\n \n editType: 'calc',\n \n },\n target: {\n valType: 'string',\n strict: true,\n noBlank: true,\n arrayOk: true,\n dflt: 'x',\n \n editType: 'calc',\n \n },\n operation: {\n valType: 'enumerated',\n values: []\n .concat(COMPARISON_OPS)\n .concat(INTERVAL_OPS)\n .concat(SET_OPS),\n dflt: '=',\n \n editType: 'calc',\n \n },\n value: {\n valType: 'any',\n dflt: 0,\n \n editType: 'calc',\n \n },\n preservegaps: {\n valType: 'boolean',\n dflt: false,\n \n editType: 'calc',\n \n },\n editType: 'calc'\n};\n\nexports.supplyDefaults = function(transformIn) {\n var transformOut = {};\n\n function coerce(attr, dflt) {\n return Lib.coerce(transformIn, transformOut, exports.attributes, attr, dflt);\n }\n\n var enabled = coerce('enabled');\n\n if(enabled) {\n var target = coerce('target');\n\n if(Lib.isArrayOrTypedArray(target) && target.length === 0) {\n transformOut.enabled = false;\n return transformOut;\n }\n\n coerce('preservegaps');\n coerce('operation');\n coerce('value');\n\n var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleDefaults');\n handleCalendarDefaults(transformIn, transformOut, 'valuecalendar', null);\n handleCalendarDefaults(transformIn, transformOut, 'targetcalendar', null);\n }\n\n return transformOut;\n};\n\nexports.calcTransform = function(gd, trace, opts) {\n if(!opts.enabled) return;\n\n var targetArray = Lib.getTargetArray(trace, opts);\n if(!targetArray) return;\n\n var target = opts.target;\n\n var len = targetArray.length;\n if(trace._length) len = Math.min(len, trace._length);\n\n var targetCalendar = opts.targetcalendar;\n var arrayAttrs = trace._arrayAttrs;\n var preservegaps = opts.preservegaps;\n\n // even if you provide targetcalendar, if target is a string and there\n // is a calendar attribute matching target it will get used instead.\n if(typeof target === 'string') {\n var attrTargetCalendar = Lib.nestedProperty(trace, target + 'calendar').get();\n if(attrTargetCalendar) targetCalendar = attrTargetCalendar;\n }\n\n var d2c = Axes.getDataToCoordFunc(gd, trace, target, targetArray);\n var filterFunc = getFilterFunc(opts, d2c, targetCalendar);\n var originalArrays = {};\n var indexToPoints = {};\n var index = 0;\n\n function forAllAttrs(fn, index) {\n for(var j = 0; j < arrayAttrs.length; j++) {\n var np = Lib.nestedProperty(trace, arrayAttrs[j]);\n fn(np, index);\n }\n }\n\n var initFn;\n var fillFn;\n if(preservegaps) {\n initFn = function(np) {\n originalArrays[np.astr] = Lib.extendDeep([], np.get());\n np.set(new Array(len));\n };\n fillFn = function(np, index) {\n var val = originalArrays[np.astr][index];\n np.get()[index] = val;\n };\n } else {\n initFn = function(np) {\n originalArrays[np.astr] = Lib.extendDeep([], np.get());\n np.set([]);\n };\n fillFn = function(np, index) {\n var val = originalArrays[np.astr][index];\n np.get().push(val);\n };\n }\n\n // copy all original array attribute values, and clear arrays in trace\n forAllAttrs(initFn);\n\n var originalPointsAccessor = pointsAccessorFunction(trace.transforms, opts);\n\n // loop through filter array, fill trace arrays if passed\n for(var i = 0; i < len; i++) {\n var passed = filterFunc(targetArray[i]);\n if(passed) {\n forAllAttrs(fillFn, i);\n indexToPoints[index++] = originalPointsAccessor(i);\n } else if(preservegaps) index++;\n }\n\n opts._indexToPoints = indexToPoints;\n trace._length = index;\n};\n\nfunction getFilterFunc(opts, d2c, targetCalendar) {\n var operation = opts.operation;\n var value = opts.value;\n var hasArrayValue = Array.isArray(value);\n\n function isOperationIn(array) {\n return array.indexOf(operation) !== -1;\n }\n\n var d2cValue = function(v) { return d2c(v, 0, opts.valuecalendar); };\n var d2cTarget = function(v) { return d2c(v, 0, targetCalendar); };\n\n var coercedValue;\n\n if(isOperationIn(COMPARISON_OPS)) {\n coercedValue = hasArrayValue ? d2cValue(value[0]) : d2cValue(value);\n } else if(isOperationIn(INTERVAL_OPS)) {\n coercedValue = hasArrayValue ?\n [d2cValue(value[0]), d2cValue(value[1])] :\n [d2cValue(value), d2cValue(value)];\n } else if(isOperationIn(SET_OPS)) {\n coercedValue = hasArrayValue ? value.map(d2cValue) : [d2cValue(value)];\n }\n\n switch(operation) {\n case '=':\n return function(v) { return d2cTarget(v) === coercedValue; };\n\n case '!=':\n return function(v) { return d2cTarget(v) !== coercedValue; };\n\n case '<':\n return function(v) { return d2cTarget(v) < coercedValue; };\n\n case '<=':\n return function(v) { return d2cTarget(v) <= coercedValue; };\n\n case '>':\n return function(v) { return d2cTarget(v) > coercedValue; };\n\n case '>=':\n return function(v) { return d2cTarget(v) >= coercedValue; };\n\n case '[]':\n return function(v) {\n var cv = d2cTarget(v);\n return cv >= coercedValue[0] && cv <= coercedValue[1];\n };\n\n case '()':\n return function(v) {\n var cv = d2cTarget(v);\n return cv > coercedValue[0] && cv < coercedValue[1];\n };\n\n case '[)':\n return function(v) {\n var cv = d2cTarget(v);\n return cv >= coercedValue[0] && cv < coercedValue[1];\n };\n\n case '(]':\n return function(v) {\n var cv = d2cTarget(v);\n return cv > coercedValue[0] && cv <= coercedValue[1];\n };\n\n case '][':\n return function(v) {\n var cv = d2cTarget(v);\n return cv <= coercedValue[0] || cv >= coercedValue[1];\n };\n\n case ')(':\n return function(v) {\n var cv = d2cTarget(v);\n return cv < coercedValue[0] || cv > coercedValue[1];\n };\n\n case '](':\n return function(v) {\n var cv = d2cTarget(v);\n return cv <= coercedValue[0] || cv > coercedValue[1];\n };\n\n case ')[':\n return function(v) {\n var cv = d2cTarget(v);\n return cv < coercedValue[0] || cv >= coercedValue[1];\n };\n\n case '{}':\n return function(v) {\n return coercedValue.indexOf(d2cTarget(v)) !== -1;\n };\n\n case '}{':\n return function(v) {\n return coercedValue.indexOf(d2cTarget(v)) === -1;\n };\n }\n}\n\n},{\"../constants/filter_ops\":700,\"../lib\":728,\"../plots/cartesian/axes\":776,\"../registry\":859,\"./helpers\":1314}],1313:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../lib');\nvar PlotSchema = _dereq_('../plot_api/plot_schema');\nvar Plots = _dereq_('../plots/plots');\nvar pointsAccessorFunction = _dereq_('./helpers').pointsAccessorFunction;\n\nexports.moduleType = 'transform';\n\nexports.name = 'groupby';\n\nexports.attributes = {\n enabled: {\n valType: 'boolean',\n dflt: true,\n \n editType: 'calc',\n \n },\n groups: {\n valType: 'data_array',\n dflt: [],\n \n editType: 'calc',\n \n },\n nameformat: {\n valType: 'string',\n \n editType: 'calc',\n \n },\n styles: {\n _isLinkedToArray: 'style',\n target: {\n valType: 'string',\n \n editType: 'calc',\n \n },\n value: {\n valType: 'any',\n \n dflt: {},\n editType: 'calc',\n \n _compareAsJSON: true\n },\n editType: 'calc'\n },\n editType: 'calc'\n};\n\n/**\n * Supply transform attributes defaults\n *\n * @param {object} transformIn\n * object linked to trace.transforms[i] with 'type' set to exports.name\n * @param {object} traceOut\n * the _fullData trace this transform applies to\n * @param {object} layout\n * the plot's (not-so-full) layout\n * @param {object} traceIn\n * the input data trace this transform applies to\n *\n * @return {object} transformOut\n * copy of transformIn that contains attribute defaults\n */\nexports.supplyDefaults = function(transformIn, traceOut, layout) {\n var i;\n var transformOut = {};\n\n function coerce(attr, dflt) {\n return Lib.coerce(transformIn, transformOut, exports.attributes, attr, dflt);\n }\n\n var enabled = coerce('enabled');\n\n if(!enabled) return transformOut;\n\n coerce('groups');\n coerce('nameformat', layout._dataLength > 1 ? '%{group} (%{trace})' : '%{group}');\n\n var styleIn = transformIn.styles;\n var styleOut = transformOut.styles = [];\n\n if(styleIn) {\n for(i = 0; i < styleIn.length; i++) {\n var thisStyle = styleOut[i] = {};\n Lib.coerce(styleIn[i], styleOut[i], exports.attributes.styles, 'target');\n var value = Lib.coerce(styleIn[i], styleOut[i], exports.attributes.styles, 'value');\n\n // so that you can edit value in place and have Plotly.react notice it, or\n // rebuild it every time and have Plotly.react NOT think it changed:\n // use _compareAsJSON to say we should diff the _JSON_value\n if(Lib.isPlainObject(value)) thisStyle.value = Lib.extendDeep({}, value);\n else if(value) delete thisStyle.value;\n }\n }\n\n return transformOut;\n};\n\n\n/**\n * Apply transform !!!\n *\n * @param {array} data\n * array of transformed traces (is [fullTrace] upon first transform)\n *\n * @param {object} state\n * state object which includes:\n * - transform {object} full transform attributes\n * - fullTrace {object} full trace object which is being transformed\n * - fullData {array} full pre-transform(s) data array\n * - layout {object} the plot's (not-so-full) layout\n *\n * @return {object} newData\n * array of transformed traces\n */\nexports.transform = function(data, state) {\n var newTraces, i, j;\n var newData = [];\n\n for(i = 0; i < data.length; i++) {\n newTraces = transformOne(data[i], state);\n\n for(j = 0; j < newTraces.length; j++) {\n newData.push(newTraces[j]);\n }\n }\n\n return newData;\n};\n\nfunction transformOne(trace, state) {\n var i, j, k, attr, srcArray, groupName, newTrace, transforms, arrayLookup;\n var groupNameObj;\n\n var opts = state.transform;\n var transformIndex = state.transformIndex;\n var groups = trace.transforms[transformIndex].groups;\n var originalPointsAccessor = pointsAccessorFunction(trace.transforms, opts);\n\n if(!(Lib.isArrayOrTypedArray(groups)) || groups.length === 0) {\n return [trace];\n }\n\n var groupNames = Lib.filterUnique(groups);\n var newData = new Array(groupNames.length);\n var len = groups.length;\n\n var arrayAttrs = PlotSchema.findArrayAttributes(trace);\n\n var styles = opts.styles || [];\n var styleLookup = {};\n for(i = 0; i < styles.length; i++) {\n styleLookup[styles[i].target] = styles[i].value;\n }\n\n if(opts.styles) {\n groupNameObj = Lib.keyedContainer(opts, 'styles', 'target', 'value.name');\n }\n\n // An index to map group name --> expanded trace index\n var indexLookup = {};\n var indexCnts = {};\n\n for(i = 0; i < groupNames.length; i++) {\n groupName = groupNames[i];\n indexLookup[groupName] = i;\n indexCnts[groupName] = 0;\n\n // Start with a deep extend that just copies array references.\n newTrace = newData[i] = Lib.extendDeepNoArrays({}, trace);\n newTrace._group = groupName;\n newTrace.transforms[transformIndex]._indexToPoints = {};\n\n var suppliedName = null;\n if(groupNameObj) {\n suppliedName = groupNameObj.get(groupName);\n }\n\n if(suppliedName || suppliedName === '') {\n newTrace.name = suppliedName;\n } else {\n newTrace.name = Lib.templateString(opts.nameformat, {\n trace: trace.name,\n group: groupName\n });\n }\n\n // In order for groups to apply correctly to other transform data (e.g.\n // a filter transform), we have to break the connection and clone the\n // transforms so that each group writes grouped values into a different\n // destination. This function does not break the array reference\n // connection between the split transforms it creates. That's handled in\n // initialize, which creates a new empty array for each arrayAttr.\n transforms = newTrace.transforms;\n newTrace.transforms = [];\n for(j = 0; j < transforms.length; j++) {\n newTrace.transforms[j] = Lib.extendDeepNoArrays({}, transforms[j]);\n }\n\n // Initialize empty arrays for the arrayAttrs, to be split in the next step\n for(j = 0; j < arrayAttrs.length; j++) {\n Lib.nestedProperty(newTrace, arrayAttrs[j]).set([]);\n }\n }\n\n // For each array attribute including those nested inside this and other\n // transforms (small note that we technically only need to do this for\n // transforms that have not yet been applied):\n for(k = 0; k < arrayAttrs.length; k++) {\n attr = arrayAttrs[k];\n\n // Cache all the arrays to which we'll push:\n for(j = 0, arrayLookup = []; j < groupNames.length; j++) {\n arrayLookup[j] = Lib.nestedProperty(newData[j], attr).get();\n }\n\n // Get the input data:\n srcArray = Lib.nestedProperty(trace, attr).get();\n\n // Send each data point to the appropriate expanded trace:\n for(j = 0; j < len; j++) {\n // Map group data --> trace index --> array and push data onto it\n arrayLookup[indexLookup[groups[j]]].push(srcArray[j]);\n }\n }\n\n for(j = 0; j < len; j++) {\n newTrace = newData[indexLookup[groups[j]]];\n\n var indexToPoints = newTrace.transforms[transformIndex]._indexToPoints;\n indexToPoints[indexCnts[groups[j]]] = originalPointsAccessor(j);\n indexCnts[groups[j]]++;\n }\n\n for(i = 0; i < groupNames.length; i++) {\n groupName = groupNames[i];\n newTrace = newData[i];\n\n Plots.clearExpandedTraceDefaultColors(newTrace);\n\n // there's no need to coerce styleLookup[groupName] here\n // as another round of supplyDefaults is done on the transformed traces\n newTrace = Lib.extendDeepNoArrays(newTrace, styleLookup[groupName] || {});\n }\n\n return newData;\n}\n\n},{\"../lib\":728,\"../plot_api/plot_schema\":765,\"../plots/plots\":839,\"./helpers\":1314}],1314:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nexports.pointsAccessorFunction = function(transforms, opts) {\n var tr;\n var prevIndexToPoints;\n for(var i = 0; i < transforms.length; i++) {\n tr = transforms[i];\n if(tr === opts) break;\n if(!tr._indexToPoints || tr.enabled === false) continue;\n prevIndexToPoints = tr._indexToPoints;\n }\n var originalPointsAccessor = prevIndexToPoints ?\n function(i) {return prevIndexToPoints[i];} :\n function(i) {return [i];};\n return originalPointsAccessor;\n};\n\n},{}],1315:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\nvar Lib = _dereq_('../lib');\nvar Axes = _dereq_('../plots/cartesian/axes');\nvar pointsAccessorFunction = _dereq_('./helpers').pointsAccessorFunction;\n\nvar BADNUM = _dereq_('../constants/numerical').BADNUM;\n\nexports.moduleType = 'transform';\n\nexports.name = 'sort';\n\nexports.attributes = {\n enabled: {\n valType: 'boolean',\n dflt: true,\n \n editType: 'calc',\n \n },\n target: {\n valType: 'string',\n strict: true,\n noBlank: true,\n arrayOk: true,\n dflt: 'x',\n \n editType: 'calc',\n \n },\n order: {\n valType: 'enumerated',\n values: ['ascending', 'descending'],\n dflt: 'ascending',\n \n editType: 'calc',\n \n },\n editType: 'calc'\n};\n\nexports.supplyDefaults = function(transformIn) {\n var transformOut = {};\n\n function coerce(attr, dflt) {\n return Lib.coerce(transformIn, transformOut, exports.attributes, attr, dflt);\n }\n\n var enabled = coerce('enabled');\n\n if(enabled) {\n coerce('target');\n coerce('order');\n }\n\n return transformOut;\n};\n\nexports.calcTransform = function(gd, trace, opts) {\n if(!opts.enabled) return;\n\n var targetArray = Lib.getTargetArray(trace, opts);\n if(!targetArray) return;\n\n var target = opts.target;\n\n var len = targetArray.length;\n if(trace._length) len = Math.min(len, trace._length);\n\n var arrayAttrs = trace._arrayAttrs;\n var d2c = Axes.getDataToCoordFunc(gd, trace, target, targetArray);\n var indices = getIndices(opts, targetArray, d2c, len);\n var originalPointsAccessor = pointsAccessorFunction(trace.transforms, opts);\n var indexToPoints = {};\n var i, j;\n\n for(i = 0; i < arrayAttrs.length; i++) {\n var np = Lib.nestedProperty(trace, arrayAttrs[i]);\n var arrayOld = np.get();\n var arrayNew = new Array(len);\n\n for(j = 0; j < len; j++) {\n arrayNew[j] = arrayOld[indices[j]];\n }\n\n np.set(arrayNew);\n }\n\n for(j = 0; j < len; j++) {\n indexToPoints[j] = originalPointsAccessor(indices[j]);\n }\n\n opts._indexToPoints = indexToPoints;\n trace._length = len;\n};\n\nfunction getIndices(opts, targetArray, d2c, len) {\n var sortedArray = new Array(len);\n var indices = new Array(len);\n var i;\n\n for(i = 0; i < len; i++) {\n sortedArray[i] = {v: targetArray[i], i: i};\n }\n\n sortedArray.sort(getSortFunc(opts, d2c));\n\n for(i = 0; i < len; i++) {\n indices[i] = sortedArray[i].i;\n }\n\n return indices;\n}\n\nfunction getSortFunc(opts, d2c) {\n switch(opts.order) {\n case 'ascending':\n return function(a, b) {\n var ac = d2c(a.v);\n var bc = d2c(b.v);\n if(ac === BADNUM) {\n return 1;\n }\n if(bc === BADNUM) {\n return -1;\n }\n return ac - bc;\n };\n case 'descending':\n return function(a, b) {\n var ac = d2c(a.v);\n var bc = d2c(b.v);\n if(ac === BADNUM) {\n return 1;\n }\n if(bc === BADNUM) {\n return -1;\n }\n return bc - ac;\n };\n }\n}\n\n},{\"../constants/numerical\":704,\"../lib\":728,\"../plots/cartesian/axes\":776,\"./helpers\":1314}],1316:[function(_dereq_,module,exports){\n/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n'use strict';\n\n// package version injected by `npm run preprocess`\nexports.version = '1.54.6';\n\n},{}]},{},[26])(26)\n});\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/plotly.js/dist/plotly.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/components/annotations/arrow_paths.js": /*!**************************************************************************!*\ !*** ./node_modules/plotly.js/src/components/annotations/arrow_paths.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\n/**\n * All paths are tuned for maximum scalability of the arrowhead,\n * ie throughout arrowwidth=0.3..3 the head is joined smoothly\n * to the line, with the line coming from the left and ending at (0, 0).\n *\n * `backoff` is the distance to move the arrowhead and the end of the line,\n * in order that the arrowhead points to the desired place, either at\n * the tip of the arrow or (in the case of circle or square)\n * the center of the symbol.\n *\n * `noRotate`, if truthy, says that this arrowhead should not rotate with the\n * arrow. That's the case for squares, which should always be straight, and\n * circles, for which it's irrelevant.\n */\n\nmodule.exports = [\n // no arrow\n {\n path: '',\n backoff: 0\n },\n // wide with flat back\n {\n path: 'M-2.4,-3V3L0.6,0Z',\n backoff: 0.6\n },\n // narrower with flat back\n {\n path: 'M-3.7,-2.5V2.5L1.3,0Z',\n backoff: 1.3\n },\n // barbed\n {\n path: 'M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z',\n backoff: 1.55\n },\n // wide line-drawn\n {\n path: 'M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z',\n backoff: 1.6\n },\n // narrower line-drawn\n {\n path: 'M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z',\n backoff: 2\n },\n // circle\n {\n path: 'M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z',\n backoff: 0,\n noRotate: true\n },\n // square\n {\n path: 'M2,2V-2H-2V2Z',\n backoff: 0,\n noRotate: true\n }\n];\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/components/annotations/arrow_paths.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/components/color/attributes.js": /*!*******************************************************************!*\ !*** ./node_modules/plotly.js/src/components/color/attributes.js ***! \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\n\n// IMPORTANT - default colors should be in hex for compatibility\nexports.defaults = [\n '#1f77b4', // muted blue\n '#ff7f0e', // safety orange\n '#2ca02c', // cooked asparagus green\n '#d62728', // brick red\n '#9467bd', // muted purple\n '#8c564b', // chestnut brown\n '#e377c2', // raspberry yogurt pink\n '#7f7f7f', // middle gray\n '#bcbd22', // curry yellow-green\n '#17becf' // blue-teal\n];\n\nexports.defaultLine = '#444';\n\nexports.lightLine = '#eee';\n\nexports.background = '#fff';\n\nexports.borderLine = '#BEC8D9';\n\n// with axis.color and Color.interp we aren't using lightLine\n// itself anymore, instead interpolating between axis.color\n// and the background color using tinycolor.mix. lightFraction\n// gives back exactly lightLine if the other colors are defaults.\nexports.lightFraction = 100 * (0xe - 0x4) / (0xf - 0x4);\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/components/color/attributes.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/components/colorscale/scales.js": /*!********************************************************************!*\ !*** ./node_modules/plotly.js/src/components/colorscale/scales.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\nvar tinycolor = __webpack_require__(/*! tinycolor2 */ \"./node_modules/tinycolor2/tinycolor.js\");\n\nvar scales = {\n 'Greys': [\n [0, 'rgb(0,0,0)'], [1, 'rgb(255,255,255)']\n ],\n\n 'YlGnBu': [\n [0, 'rgb(8,29,88)'], [0.125, 'rgb(37,52,148)'],\n [0.25, 'rgb(34,94,168)'], [0.375, 'rgb(29,145,192)'],\n [0.5, 'rgb(65,182,196)'], [0.625, 'rgb(127,205,187)'],\n [0.75, 'rgb(199,233,180)'], [0.875, 'rgb(237,248,217)'],\n [1, 'rgb(255,255,217)']\n ],\n\n 'Greens': [\n [0, 'rgb(0,68,27)'], [0.125, 'rgb(0,109,44)'],\n [0.25, 'rgb(35,139,69)'], [0.375, 'rgb(65,171,93)'],\n [0.5, 'rgb(116,196,118)'], [0.625, 'rgb(161,217,155)'],\n [0.75, 'rgb(199,233,192)'], [0.875, 'rgb(229,245,224)'],\n [1, 'rgb(247,252,245)']\n ],\n\n 'YlOrRd': [\n [0, 'rgb(128,0,38)'], [0.125, 'rgb(189,0,38)'],\n [0.25, 'rgb(227,26,28)'], [0.375, 'rgb(252,78,42)'],\n [0.5, 'rgb(253,141,60)'], [0.625, 'rgb(254,178,76)'],\n [0.75, 'rgb(254,217,118)'], [0.875, 'rgb(255,237,160)'],\n [1, 'rgb(255,255,204)']\n ],\n\n 'Bluered': [\n [0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']\n ],\n\n // modified RdBu based on\n // http://www.kennethmoreland.com/color-maps/\n 'RdBu': [\n [0, 'rgb(5,10,172)'], [0.35, 'rgb(106,137,247)'],\n [0.5, 'rgb(190,190,190)'], [0.6, 'rgb(220,170,132)'],\n [0.7, 'rgb(230,145,90)'], [1, 'rgb(178,10,28)']\n ],\n\n // Scale for non-negative numeric values\n 'Reds': [\n [0, 'rgb(220,220,220)'], [0.2, 'rgb(245,195,157)'],\n [0.4, 'rgb(245,160,105)'], [1, 'rgb(178,10,28)']\n ],\n\n // Scale for non-positive numeric values\n 'Blues': [\n [0, 'rgb(5,10,172)'], [0.35, 'rgb(40,60,190)'],\n [0.5, 'rgb(70,100,245)'], [0.6, 'rgb(90,120,245)'],\n [0.7, 'rgb(106,137,247)'], [1, 'rgb(220,220,220)']\n ],\n\n 'Picnic': [\n [0, 'rgb(0,0,255)'], [0.1, 'rgb(51,153,255)'],\n [0.2, 'rgb(102,204,255)'], [0.3, 'rgb(153,204,255)'],\n [0.4, 'rgb(204,204,255)'], [0.5, 'rgb(255,255,255)'],\n [0.6, 'rgb(255,204,255)'], [0.7, 'rgb(255,153,255)'],\n [0.8, 'rgb(255,102,204)'], [0.9, 'rgb(255,102,102)'],\n [1, 'rgb(255,0,0)']\n ],\n\n 'Rainbow': [\n [0, 'rgb(150,0,90)'], [0.125, 'rgb(0,0,200)'],\n [0.25, 'rgb(0,25,255)'], [0.375, 'rgb(0,152,255)'],\n [0.5, 'rgb(44,255,150)'], [0.625, 'rgb(151,255,0)'],\n [0.75, 'rgb(255,234,0)'], [0.875, 'rgb(255,111,0)'],\n [1, 'rgb(255,0,0)']\n ],\n\n 'Portland': [\n [0, 'rgb(12,51,131)'], [0.25, 'rgb(10,136,186)'],\n [0.5, 'rgb(242,211,56)'], [0.75, 'rgb(242,143,56)'],\n [1, 'rgb(217,30,30)']\n ],\n\n 'Jet': [\n [0, 'rgb(0,0,131)'], [0.125, 'rgb(0,60,170)'],\n [0.375, 'rgb(5,255,255)'], [0.625, 'rgb(255,255,0)'],\n [0.875, 'rgb(250,0,0)'], [1, 'rgb(128,0,0)']\n ],\n\n 'Hot': [\n [0, 'rgb(0,0,0)'], [0.3, 'rgb(230,0,0)'],\n [0.6, 'rgb(255,210,0)'], [1, 'rgb(255,255,255)']\n ],\n\n 'Blackbody': [\n [0, 'rgb(0,0,0)'], [0.2, 'rgb(230,0,0)'],\n [0.4, 'rgb(230,210,0)'], [0.7, 'rgb(255,255,255)'],\n [1, 'rgb(160,200,255)']\n ],\n\n 'Earth': [\n [0, 'rgb(0,0,130)'], [0.1, 'rgb(0,180,180)'],\n [0.2, 'rgb(40,210,40)'], [0.4, 'rgb(230,230,50)'],\n [0.6, 'rgb(120,70,20)'], [1, 'rgb(255,255,255)']\n ],\n\n 'Electric': [\n [0, 'rgb(0,0,0)'], [0.15, 'rgb(30,0,100)'],\n [0.4, 'rgb(120,0,100)'], [0.6, 'rgb(160,90,0)'],\n [0.8, 'rgb(230,200,0)'], [1, 'rgb(255,250,220)']\n ],\n\n 'Viridis': [\n [0, '#440154'], [0.06274509803921569, '#48186a'],\n [0.12549019607843137, '#472d7b'], [0.18823529411764706, '#424086'],\n [0.25098039215686274, '#3b528b'], [0.3137254901960784, '#33638d'],\n [0.3764705882352941, '#2c728e'], [0.4392156862745098, '#26828e'],\n [0.5019607843137255, '#21918c'], [0.5647058823529412, '#1fa088'],\n [0.6274509803921569, '#28ae80'], [0.6901960784313725, '#3fbc73'],\n [0.7529411764705882, '#5ec962'], [0.8156862745098039, '#84d44b'],\n [0.8784313725490196, '#addc30'], [0.9411764705882353, '#d8e219'],\n [1, '#fde725']\n ],\n\n 'Cividis': [\n [0.000000, 'rgb(0,32,76)'], [0.058824, 'rgb(0,42,102)'],\n [0.117647, 'rgb(0,52,110)'], [0.176471, 'rgb(39,63,108)'],\n [0.235294, 'rgb(60,74,107)'], [0.294118, 'rgb(76,85,107)'],\n [0.352941, 'rgb(91,95,109)'], [0.411765, 'rgb(104,106,112)'],\n [0.470588, 'rgb(117,117,117)'], [0.529412, 'rgb(131,129,120)'],\n [0.588235, 'rgb(146,140,120)'], [0.647059, 'rgb(161,152,118)'],\n [0.705882, 'rgb(176,165,114)'], [0.764706, 'rgb(192,177,109)'],\n [0.823529, 'rgb(209,191,102)'], [0.882353, 'rgb(225,204,92)'],\n [0.941176, 'rgb(243,219,79)'], [1.000000, 'rgb(255,233,69)']\n ]\n};\n\nvar defaultScale = scales.RdBu;\n\nfunction getScale(scl, dflt) {\n if(!dflt) dflt = defaultScale;\n if(!scl) return dflt;\n\n function parseScale() {\n try {\n scl = scales[scl] || JSON.parse(scl);\n } catch(e) {\n scl = dflt;\n }\n }\n\n if(typeof scl === 'string') {\n parseScale();\n // occasionally scl is double-JSON encoded...\n if(typeof scl === 'string') parseScale();\n }\n\n if(!isValidScaleArray(scl)) return dflt;\n return scl;\n}\n\n\nfunction isValidScaleArray(scl) {\n var highestVal = 0;\n\n if(!Array.isArray(scl) || scl.length < 2) return false;\n\n if(!scl[0] || !scl[scl.length - 1]) return false;\n\n if(+scl[0][0] !== 0 || +scl[scl.length - 1][0] !== 1) return false;\n\n for(var i = 0; i < scl.length; i++) {\n var si = scl[i];\n\n if(si.length !== 2 || +si[0] < highestVal || !tinycolor(si[1]).isValid()) {\n return false;\n }\n\n highestVal = +si[0];\n }\n\n return true;\n}\n\nfunction isValidScale(scl) {\n if(scales[scl] !== undefined) return true;\n else return isValidScaleArray(scl);\n}\n\nmodule.exports = {\n scales: scales,\n defaultScale: defaultScale,\n\n get: getScale,\n isValid: isValidScale\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/components/colorscale/scales.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/components/drawing/attributes.js": /*!*********************************************************************!*\ !*** ./node_modules/plotly.js/src/components/drawing/attributes.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\n\nexports.dash = {\n valType: 'string',\n // string type usually doesn't take values... this one should really be\n // a special type or at least a special coercion function, from the GUI\n // you only get these values but elsewhere the user can supply a list of\n // dash lengths in px, and it will be honored\n values: ['solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'],\n dflt: 'solid',\n role: 'style',\n editType: 'style',\n description: [\n 'Sets the dash style of lines. Set to a dash type string',\n '(*solid*, *dot*, *dash*, *longdash*, *dashdot*, or *longdashdot*)',\n 'or a dash length list in px (eg *5px,10px,2px,2px*).'\n ].join(' ')\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/components/drawing/attributes.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/components/fx/attributes.js": /*!****************************************************************!*\ !*** ./node_modules/plotly.js/src/components/fx/attributes.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\nvar fontAttrs = __webpack_require__(/*! ../../plots/font_attributes */ \"./node_modules/plotly.js/src/plots/font_attributes.js\");\nvar hoverLabelAttrs = __webpack_require__(/*! ./layout_attributes */ \"./node_modules/plotly.js/src/components/fx/layout_attributes.js\").hoverlabel;\nvar extendFlat = __webpack_require__(/*! ../../lib/extend */ \"./node_modules/plotly.js/src/lib/extend.js\").extendFlat;\n\nmodule.exports = {\n hoverlabel: {\n bgcolor: extendFlat({}, hoverLabelAttrs.bgcolor, {\n arrayOk: true,\n description: 'Sets the background color of the hover labels for this trace'\n }),\n bordercolor: extendFlat({}, hoverLabelAttrs.bordercolor, {\n arrayOk: true,\n description: 'Sets the border color of the hover labels for this trace.'\n }),\n font: fontAttrs({\n arrayOk: true,\n editType: 'none',\n description: 'Sets the font used in hover labels.'\n }),\n align: extendFlat({}, hoverLabelAttrs.align, {arrayOk: true}),\n namelength: extendFlat({}, hoverLabelAttrs.namelength, {arrayOk: true}),\n editType: 'none'\n }\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/components/fx/attributes.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/components/fx/constants.js": /*!***************************************************************!*\ !*** ./node_modules/plotly.js/src/components/fx/constants.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\nmodule.exports = {\n // hover labels for multiple horizontal bars get tilted by this angle\n YANGLE: 60,\n\n // size and display constants for hover text\n\n // pixel size of hover arrows\n HOVERARROWSIZE: 6,\n // pixels padding around text\n HOVERTEXTPAD: 3,\n // hover font\n HOVERFONTSIZE: 13,\n HOVERFONT: 'Arial, sans-serif',\n\n // minimum time (msec) between hover calls\n HOVERMINTIME: 50,\n\n // ID suffix (with fullLayout._uid) for hover events in the throttle cache\n HOVERID: '-hover'\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/components/fx/constants.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/components/fx/layout_attributes.js": /*!***********************************************************************!*\ !*** ./node_modules/plotly.js/src/components/fx/layout_attributes.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\nvar constants = __webpack_require__(/*! ./constants */ \"./node_modules/plotly.js/src/components/fx/constants.js\");\n\nvar fontAttrs = __webpack_require__(/*! ../../plots/font_attributes */ \"./node_modules/plotly.js/src/plots/font_attributes.js\")({\n editType: 'none',\n description: 'Sets the default hover label font used by all traces on the graph.'\n});\nfontAttrs.family.dflt = constants.HOVERFONT;\nfontAttrs.size.dflt = constants.HOVERFONTSIZE;\n\nmodule.exports = {\n clickmode: {\n valType: 'flaglist',\n role: 'info',\n flags: ['event', 'select'],\n dflt: 'event',\n editType: 'plot',\n extras: ['none'],\n description: [\n 'Determines the mode of single click interactions.',\n '*event* is the default value and emits the `plotly_click`',\n 'event. In addition this mode emits the `plotly_selected` event',\n 'in drag modes *lasso* and *select*, but with no event data attached',\n '(kept for compatibility reasons).',\n 'The *select* flag enables selecting single',\n 'data points via click. This mode also supports persistent selections,',\n 'meaning that pressing Shift while clicking, adds to / subtracts from an',\n 'existing selection. *select* with `hovermode`: *x* can be confusing, consider',\n 'explicitly setting `hovermode`: *closest* when using this feature.',\n 'Selection events are sent accordingly as long as *event* flag is set as well.',\n 'When the *event* flag is missing, `plotly_click` and `plotly_selected`',\n 'events are not fired.'\n ].join(' ')\n },\n dragmode: {\n valType: 'enumerated',\n role: 'info',\n values: [\n 'zoom',\n 'pan',\n 'select',\n 'lasso',\n 'drawclosedpath',\n 'drawopenpath',\n 'drawline',\n 'drawrect',\n 'drawcircle',\n 'orbit',\n 'turntable',\n false\n ],\n dflt: 'zoom',\n editType: 'modebar',\n description: [\n 'Determines the mode of drag interactions.',\n '*select* and *lasso* apply only to scatter traces with',\n 'markers or text. *orbit* and *turntable* apply only to',\n '3D scenes.'\n ].join(' ')\n },\n hovermode: {\n valType: 'enumerated',\n role: 'info',\n values: ['x', 'y', 'closest', false, 'x unified', 'y unified'],\n editType: 'modebar',\n description: [\n 'Determines the mode of hover interactions.',\n 'If *closest*, a single hoverlabel will appear',\n 'for the *closest* point within the `hoverdistance`.',\n 'If *x* (or *y*), multiple hoverlabels will appear for multiple points',\n 'at the *closest* x- (or y-) coordinate within the `hoverdistance`,',\n 'with the caveat that no more than one hoverlabel will appear per trace.',\n 'If *x unified* (or *y unified*), a single hoverlabel will appear',\n 'multiple points at the closest x- (or y-) coordinate within the `hoverdistance`',\n 'with the caveat that no more than one hoverlabel will appear per trace.',\n 'In this mode, spikelines are enabled by default perpendicular to the specified axis.',\n 'If false, hover interactions are disabled.',\n 'If `clickmode` includes the *select* flag,',\n '`hovermode` defaults to *closest*.',\n 'If `clickmode` lacks the *select* flag,',\n 'it defaults to *x* or *y* (depending on the trace\\'s',\n '`orientation` value) for plots based on',\n 'cartesian coordinates. For anything else the default',\n 'value is *closest*.',\n ].join(' ')\n },\n hoverdistance: {\n valType: 'integer',\n min: -1,\n dflt: 20,\n role: 'info',\n editType: 'none',\n description: [\n 'Sets the default distance (in pixels) to look for data',\n 'to add hover labels (-1 means no cutoff, 0 means no looking for data).',\n 'This is only a real distance for hovering on point-like objects,',\n 'like scatter points. For area-like objects (bars, scatter fills, etc)',\n 'hovering is on inside the area and off outside, but these objects',\n 'will not supersede hover on point-like objects in case of conflict.'\n ].join(' ')\n },\n spikedistance: {\n valType: 'integer',\n min: -1,\n dflt: 20,\n role: 'info',\n editType: 'none',\n description: [\n 'Sets the default distance (in pixels) to look for data to draw',\n 'spikelines to (-1 means no cutoff, 0 means no looking for data).',\n 'As with hoverdistance, distance does not apply to area-like objects.',\n 'In addition, some objects can be hovered on but will not generate',\n 'spikelines, such as scatter fills.'\n ].join(' ')\n },\n hoverlabel: {\n bgcolor: {\n valType: 'color',\n role: 'style',\n editType: 'none',\n description: [\n 'Sets the background color of all hover labels on graph'\n ].join(' ')\n },\n bordercolor: {\n valType: 'color',\n role: 'style',\n editType: 'none',\n description: [\n 'Sets the border color of all hover labels on graph.'\n ].join(' ')\n },\n font: fontAttrs,\n align: {\n valType: 'enumerated',\n values: ['left', 'right', 'auto'],\n dflt: 'auto',\n role: 'style',\n editType: 'none',\n description: [\n 'Sets the horizontal alignment of the text content within hover label box.',\n 'Has an effect only if the hover label text spans more two or more lines'\n ].join(' ')\n },\n namelength: {\n valType: 'integer',\n min: -1,\n dflt: 15,\n role: 'style',\n editType: 'none',\n description: [\n 'Sets the default length (in number of characters) of the trace name in',\n 'the hover labels for all traces. -1 shows the whole name',\n 'regardless of length. 0-3 shows the first 0-3 characters, and',\n 'an integer >3 will show the whole name if it is less than that',\n 'many characters, but if it is longer, will truncate to',\n '`namelength - 3` characters and add an ellipsis.'\n ].join(' ')\n },\n editType: 'none'\n },\n selectdirection: {\n valType: 'enumerated',\n role: 'info',\n values: ['h', 'v', 'd', 'any'],\n dflt: 'any',\n description: [\n 'When `dragmode` is set to *select*, this limits the selection of the drag to',\n 'horizontal, vertical or diagonal. *h* only allows horizontal selection,',\n '*v* only vertical, *d* only diagonal and *any* sets no limit.'\n ].join(' '),\n editType: 'none'\n }\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/components/fx/layout_attributes.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/components/shapes/draw_newshape/attributes.js": /*!**********************************************************************************!*\ !*** ./node_modules/plotly.js/src/components/shapes/draw_newshape/attributes.js ***! \**********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\nvar dash = __webpack_require__(/*! ../../drawing/attributes */ \"./node_modules/plotly.js/src/components/drawing/attributes.js\").dash;\nvar extendFlat = __webpack_require__(/*! ../../../lib/extend */ \"./node_modules/plotly.js/src/lib/extend.js\").extendFlat;\n\nmodule.exports = {\n newshape: {\n line: {\n color: {\n valType: 'color',\n editType: 'none',\n role: 'info',\n description: [\n 'Sets the line color.',\n 'By default uses either dark grey or white',\n 'to increase contrast with background color.'\n ].join(' ')\n },\n width: {\n valType: 'number',\n min: 0,\n dflt: 4,\n role: 'info',\n editType: 'none',\n description: 'Sets the line width (in px).'\n },\n dash: extendFlat({}, dash, {\n dflt: 'solid',\n editType: 'none'\n }),\n role: 'info',\n editType: 'none'\n },\n fillcolor: {\n valType: 'color',\n dflt: 'rgba(0,0,0,0)',\n role: 'info',\n editType: 'none',\n description: [\n 'Sets the color filling new shapes\\' interior.',\n 'Please note that if using a fillcolor with alpha greater than half,',\n 'drag inside the active shape starts moving the shape underneath,',\n 'otherwise a new shape could be started over.'\n ].join(' ')\n },\n fillrule: {\n valType: 'enumerated',\n values: ['evenodd', 'nonzero'],\n dflt: 'evenodd',\n role: 'info',\n editType: 'none',\n description: [\n 'Determines the path\\'s interior.',\n 'For more info please visit https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule'\n ].join(' ')\n },\n opacity: {\n valType: 'number',\n min: 0,\n max: 1,\n dflt: 1,\n role: 'info',\n editType: 'none',\n description: 'Sets the opacity of new shapes.'\n },\n layer: {\n valType: 'enumerated',\n values: ['below', 'above'],\n dflt: 'above',\n role: 'info',\n editType: 'none',\n description: 'Specifies whether new shapes are drawn below or above traces.'\n },\n drawdirection: {\n valType: 'enumerated',\n role: 'info',\n values: ['ortho', 'horizontal', 'vertical', 'diagonal'],\n dflt: 'diagonal',\n editType: 'none',\n description: [\n 'When `dragmode` is set to *drawrect*, *drawline* or *drawcircle*',\n 'this limits the drag to be horizontal, vertical or diagonal.',\n 'Using *diagonal* there is no limit e.g. in drawing lines in any direction.',\n '*ortho* limits the draw to be either horizontal or vertical.',\n '*horizontal* allows horizontal extend.',\n '*vertical* allows vertical extend.'\n ].join(' ')\n },\n\n editType: 'none'\n },\n\n activeshape: {\n fillcolor: {\n valType: 'color',\n dflt: 'rgb(255,0,255)',\n role: 'style',\n editType: 'none',\n description: 'Sets the color filling the active shape\\' interior.'\n },\n opacity: {\n valType: 'number',\n min: 0,\n max: 1,\n dflt: 0.5,\n role: 'info',\n editType: 'none',\n description: 'Sets the opacity of the active shape.'\n },\n editType: 'none'\n }\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/components/shapes/draw_newshape/attributes.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/constants/interactions.js": /*!**************************************************************!*\ !*** ./node_modules/plotly.js/src/constants/interactions.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\n\nmodule.exports = {\n /**\n * Timing information for interactive elements\n */\n SHOW_PLACEHOLDER: 100,\n HIDE_PLACEHOLDER: 1000,\n\n // opacity dimming fraction for points that are not in selection\n DESELECTDIM: 0.2\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/constants/interactions.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/constants/numerical.js": /*!***********************************************************!*\ !*** ./node_modules/plotly.js/src/constants/numerical.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\n\nmodule.exports = {\n /**\n * Standardize all missing data in calcdata to use undefined\n * never null or NaN.\n * That way we can use !==undefined, or !== BADNUM,\n * to test for real data\n */\n BADNUM: undefined,\n\n /*\n * Limit certain operations to well below floating point max value\n * to avoid glitches: Make sure that even when you multiply it by the\n * number of pixels on a giant screen it still works\n */\n FP_SAFE: Number.MAX_VALUE / 10000,\n\n /*\n * conversion of date units to milliseconds\n * year and month constants are marked \"AVG\"\n * to remind us that not all years and months\n * have the same length\n */\n ONEAVGYEAR: 31557600000, // 365.25 days\n ONEAVGMONTH: 2629800000, // 1/12 of ONEAVGYEAR\n ONEDAY: 86400000,\n ONEHOUR: 3600000,\n ONEMIN: 60000,\n ONESEC: 1000,\n\n /*\n * For fast conversion btwn world calendars and epoch ms, the Julian Day Number\n * of the unix epoch. From calendars.instance().newDate(1970, 1, 1).toJD()\n */\n EPOCHJD: 2440587.5,\n\n /*\n * Are two values nearly equal? Compare to 1PPM\n */\n ALMOST_EQUAL: 1 - 1e-6,\n\n /*\n * If we're asked to clip a non-positive log value, how far off-screen\n * do we put it?\n */\n LOG_CLIP: 10,\n\n /*\n * not a number, but for displaying numbers: the \"minus sign\" symbol is\n * wider than the regular ascii dash \"-\"\n */\n MINUS_SIGN: '\\u2212'\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/constants/numerical.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/lib/anchor_utils.js": /*!********************************************************!*\ !*** ./node_modules/plotly.js/src/lib/anchor_utils.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\n\n\n/**\n * Determine the position anchor property of x/y xanchor/yanchor components.\n *\n * - values < 1/3 align the low side at that fraction,\n * - values [1/3, 2/3] align the center at that fraction,\n * - values > 2/3 align the right at that fraction.\n */\n\n\nexports.isLeftAnchor = function isLeftAnchor(opts) {\n return (\n opts.xanchor === 'left' ||\n (opts.xanchor === 'auto' && opts.x <= 1 / 3)\n );\n};\n\nexports.isCenterAnchor = function isCenterAnchor(opts) {\n return (\n opts.xanchor === 'center' ||\n (opts.xanchor === 'auto' && opts.x > 1 / 3 && opts.x < 2 / 3)\n );\n};\n\nexports.isRightAnchor = function isRightAnchor(opts) {\n return (\n opts.xanchor === 'right' ||\n (opts.xanchor === 'auto' && opts.x >= 2 / 3)\n );\n};\n\nexports.isTopAnchor = function isTopAnchor(opts) {\n return (\n opts.yanchor === 'top' ||\n (opts.yanchor === 'auto' && opts.y >= 2 / 3)\n );\n};\n\nexports.isMiddleAnchor = function isMiddleAnchor(opts) {\n return (\n opts.yanchor === 'middle' ||\n (opts.yanchor === 'auto' && opts.y > 1 / 3 && opts.y < 2 / 3)\n );\n};\n\nexports.isBottomAnchor = function isBottomAnchor(opts) {\n return (\n opts.yanchor === 'bottom' ||\n (opts.yanchor === 'auto' && opts.y <= 1 / 3)\n );\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/lib/anchor_utils.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/lib/angles.js": /*!**************************************************!*\ !*** ./node_modules/plotly.js/src/lib/angles.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\nvar modModule = __webpack_require__(/*! ./mod */ \"./node_modules/plotly.js/src/lib/mod.js\");\nvar mod = modModule.mod;\nvar modHalf = modModule.modHalf;\n\nvar PI = Math.PI;\nvar twoPI = 2 * PI;\n\nfunction deg2rad(deg) { return deg / 180 * PI; }\n\nfunction rad2deg(rad) { return rad / PI * 180; }\n\n/**\n * is sector a full circle?\n * ... this comes up a lot in SVG path-drawing routines\n *\n * N.B. we consider all sectors that span more that 2pi 'full' circles\n *\n * @param {2-item array} aBnds : angular bounds in *radians*\n * @return {boolean}\n */\nfunction isFullCircle(aBnds) {\n return Math.abs(aBnds[1] - aBnds[0]) > twoPI - 1e-14;\n}\n\n/**\n * angular delta between angle 'a' and 'b'\n * solution taken from: https://stackoverflow.com/a/2007279\n *\n * @param {number} a : first angle in *radians*\n * @param {number} b : second angle in *radians*\n * @return {number} angular delta in *radians*\n */\nfunction angleDelta(a, b) {\n return modHalf(b - a, twoPI);\n}\n\n/**\n * angular distance between angle 'a' and 'b'\n *\n * @param {number} a : first angle in *radians*\n * @param {number} b : second angle in *radians*\n * @return {number} angular distance in *radians*\n */\nfunction angleDist(a, b) {\n return Math.abs(angleDelta(a, b));\n}\n\n/**\n * is angle inside sector?\n *\n * @param {number} a : angle to test in *radians*\n * @param {2-item array} aBnds : sector's angular bounds in *radians*\n * @param {boolean}\n */\nfunction isAngleInsideSector(a, aBnds) {\n if(isFullCircle(aBnds)) return true;\n\n var s0, s1;\n\n if(aBnds[0] < aBnds[1]) {\n s0 = aBnds[0];\n s1 = aBnds[1];\n } else {\n s0 = aBnds[1];\n s1 = aBnds[0];\n }\n\n s0 = mod(s0, twoPI);\n s1 = mod(s1, twoPI);\n if(s0 > s1) s1 += twoPI;\n\n var a0 = mod(a, twoPI);\n var a1 = a0 + twoPI;\n\n return (a0 >= s0 && a0 <= s1) || (a1 >= s0 && a1 <= s1);\n}\n\n/**\n * is pt (r,a) inside sector?\n *\n * @param {number} r : pt's radial coordinate\n * @param {number} a : pt's angular coordinate in *radians*\n * @param {2-item array} rBnds : sector's radial bounds\n * @param {2-item array} aBnds : sector's angular bounds in *radians*\n * @return {boolean}\n */\nfunction isPtInsideSector(r, a, rBnds, aBnds) {\n if(!isAngleInsideSector(a, aBnds)) return false;\n\n var r0, r1;\n\n if(rBnds[0] < rBnds[1]) {\n r0 = rBnds[0];\n r1 = rBnds[1];\n } else {\n r0 = rBnds[1];\n r1 = rBnds[0];\n }\n\n return r >= r0 && r <= r1;\n}\n\n// common to pathArc, pathSector and pathAnnulus\nfunction _path(r0, r1, a0, a1, cx, cy, isClosed) {\n cx = cx || 0;\n cy = cy || 0;\n\n var isCircle = isFullCircle([a0, a1]);\n var aStart, aMid, aEnd;\n var rStart, rEnd;\n\n if(isCircle) {\n aStart = 0;\n aMid = PI;\n aEnd = twoPI;\n } else {\n if(a0 < a1) {\n aStart = a0;\n aEnd = a1;\n } else {\n aStart = a1;\n aEnd = a0;\n }\n }\n\n if(r0 < r1) {\n rStart = r0;\n rEnd = r1;\n } else {\n rStart = r1;\n rEnd = r0;\n }\n\n // N.B. svg coordinates here, where y increases downward\n function pt(r, a) {\n return [r * Math.cos(a) + cx, cy - r * Math.sin(a)];\n }\n\n var largeArc = Math.abs(aEnd - aStart) <= PI ? 0 : 1;\n function arc(r, a, cw) {\n return 'A' + [r, r] + ' ' + [0, largeArc, cw] + ' ' + pt(r, a);\n }\n\n var p;\n\n if(isCircle) {\n if(rStart === null) {\n p = 'M' + pt(rEnd, aStart) +\n arc(rEnd, aMid, 0) +\n arc(rEnd, aEnd, 0) + 'Z';\n } else {\n p = 'M' + pt(rStart, aStart) +\n arc(rStart, aMid, 0) +\n arc(rStart, aEnd, 0) + 'Z' +\n 'M' + pt(rEnd, aStart) +\n arc(rEnd, aMid, 1) +\n arc(rEnd, aEnd, 1) + 'Z';\n }\n } else {\n if(rStart === null) {\n p = 'M' + pt(rEnd, aStart) + arc(rEnd, aEnd, 0);\n if(isClosed) p += 'L0,0Z';\n } else {\n p = 'M' + pt(rStart, aStart) +\n 'L' + pt(rEnd, aStart) +\n arc(rEnd, aEnd, 0) +\n 'L' + pt(rStart, aEnd) +\n arc(rStart, aStart, 1) + 'Z';\n }\n }\n\n return p;\n}\n\n/**\n * path an arc\n *\n * @param {number} r : radius\n * @param {number} a0 : first angular coordinate in *radians*\n * @param {number} a1 : second angular coordinate in *radians*\n * @param {number (optional)} cx : x coordinate of center\n * @param {number (optional)} cy : y coordinate of center\n * @return {string} svg path\n */\nfunction pathArc(r, a0, a1, cx, cy) {\n return _path(null, r, a0, a1, cx, cy, 0);\n}\n\n/**\n * path a sector\n *\n * @param {number} r : radius\n * @param {number} a0 : first angular coordinate in *radians*\n * @param {number} a1 : second angular coordinate in *radians*\n * @param {number (optional)} cx : x coordinate of center\n * @param {number (optional)} cy : y coordinate of center\n * @return {string} svg path\n */\nfunction pathSector(r, a0, a1, cx, cy) {\n return _path(null, r, a0, a1, cx, cy, 1);\n}\n\n/**\n * path an annulus\n *\n * @param {number} r0 : first radial coordinate\n * @param {number} r1 : second radial coordinate\n * @param {number} a0 : first angular coordinate in *radians*\n * @param {number} a1 : second angular coordinate in *radians*\n * @param {number (optional)} cx : x coordinate of center\n * @param {number (optional)} cy : y coordinate of center\n * @return {string} svg path\n */\nfunction pathAnnulus(r0, r1, a0, a1, cx, cy) {\n return _path(r0, r1, a0, a1, cx, cy, 1);\n}\n\nmodule.exports = {\n deg2rad: deg2rad,\n rad2deg: rad2deg,\n angleDelta: angleDelta,\n angleDist: angleDist,\n isFullCircle: isFullCircle,\n isAngleInsideSector: isAngleInsideSector,\n isPtInsideSector: isPtInsideSector,\n pathArc: pathArc,\n pathSector: pathSector,\n pathAnnulus: pathAnnulus\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/lib/angles.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/lib/array.js": /*!*************************************************!*\ !*** ./node_modules/plotly.js/src/lib/array.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\nvar isArray = Array.isArray;\n\n// IE9 fallbacks\n\nvar ab = (typeof ArrayBuffer === 'undefined' || !ArrayBuffer.isView) ?\n {isView: function() { return false; }} :\n ArrayBuffer;\n\nvar dv = (typeof DataView === 'undefined') ?\n function() {} :\n DataView;\n\nfunction isTypedArray(a) {\n return ab.isView(a) && !(a instanceof dv);\n}\nexports.isTypedArray = isTypedArray;\n\nfunction isArrayOrTypedArray(a) {\n return isArray(a) || isTypedArray(a);\n}\nexports.isArrayOrTypedArray = isArrayOrTypedArray;\n\n/*\n * Test whether an input object is 1D.\n *\n * Assumes we already know the object is an array.\n *\n * Looks only at the first element, if the dimensionality is\n * not consistent we won't figure that out here.\n */\nfunction isArray1D(a) {\n return !isArrayOrTypedArray(a[0]);\n}\nexports.isArray1D = isArray1D;\n\n/*\n * Ensures an array has the right amount of storage space. If it doesn't\n * exist, it creates an array. If it does exist, it returns it if too\n * short or truncates it in-place.\n *\n * The goal is to just reuse memory to avoid a bit of excessive garbage\n * collection.\n */\nexports.ensureArray = function(out, n) {\n // TODO: typed array support here? This is only used in\n // traces/carpet/compute_control_points\n if(!isArray(out)) out = [];\n\n // If too long, truncate. (If too short, it will grow\n // automatically so we don't care about that case)\n out.length = n;\n\n return out;\n};\n\n/*\n * TypedArray-compatible concatenation of n arrays\n * if all arrays are the same type it will preserve that type,\n * otherwise it falls back on Array.\n * Also tries to avoid copying, in case one array has zero length\n * But never mutates an existing array\n */\nexports.concat = function() {\n var args = [];\n var allArray = true;\n var totalLen = 0;\n\n var _constructor, arg0, i, argi, posi, leni, out, j;\n\n for(i = 0; i < arguments.length; i++) {\n argi = arguments[i];\n leni = argi.length;\n if(leni) {\n if(arg0) args.push(argi);\n else {\n arg0 = argi;\n posi = leni;\n }\n\n if(isArray(argi)) {\n _constructor = false;\n } else {\n allArray = false;\n if(!totalLen) {\n _constructor = argi.constructor;\n } else if(_constructor !== argi.constructor) {\n // TODO: in principle we could upgrade here,\n // ie keep typed array but convert all to Float64Array?\n _constructor = false;\n }\n }\n\n totalLen += leni;\n }\n }\n\n if(!totalLen) return [];\n if(!args.length) return arg0;\n\n if(allArray) return arg0.concat.apply(arg0, args);\n if(_constructor) {\n // matching typed arrays\n out = new _constructor(totalLen);\n out.set(arg0);\n for(i = 0; i < args.length; i++) {\n argi = args[i];\n out.set(argi, posi);\n posi += argi.length;\n }\n return out;\n }\n\n // mismatched types or Array + typed\n out = new Array(totalLen);\n for(j = 0; j < arg0.length; j++) out[j] = arg0[j];\n for(i = 0; i < args.length; i++) {\n argi = args[i];\n for(j = 0; j < argi.length; j++) out[posi + j] = argi[j];\n posi += j;\n }\n return out;\n};\n\nexports.maxRowLength = function(z) {\n return _rowLength(z, Math.max, 0);\n};\n\nexports.minRowLength = function(z) {\n return _rowLength(z, Math.min, Infinity);\n};\n\nfunction _rowLength(z, fn, len0) {\n if(isArrayOrTypedArray(z)) {\n if(isArrayOrTypedArray(z[0])) {\n var len = len0;\n for(var i = 0; i < z.length; i++) {\n len = fn(len, z[i].length);\n }\n return len;\n } else {\n return z.length;\n }\n }\n return 0;\n}\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/lib/array.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/lib/clean_number.js": /*!********************************************************!*\ !*** ./node_modules/plotly.js/src/lib/clean_number.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\n\nvar isNumeric = __webpack_require__(/*! fast-isnumeric */ \"./node_modules/fast-isnumeric/index.js\");\n\nvar BADNUM = __webpack_require__(/*! ../constants/numerical */ \"./node_modules/plotly.js/src/constants/numerical.js\").BADNUM;\n\n// precompile for speed\nvar JUNK = /^['\"%,$#\\s']+|[, ]|['\"%,$#\\s']+$/g;\n\n/**\n * cleanNumber: remove common leading and trailing cruft\n * Always returns either a number or BADNUM.\n */\nmodule.exports = function cleanNumber(v) {\n if(typeof v === 'string') {\n v = v.replace(JUNK, '');\n }\n\n if(isNumeric(v)) return Number(v);\n\n return BADNUM;\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/lib/clean_number.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/lib/clear_responsive.js": /*!************************************************************!*\ !*** ./node_modules/plotly.js/src/lib/clear_responsive.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\n/**\n * Clear responsive handlers (if any).\n *\n * @param {DOM node or object} gd : graph div object\n */\nmodule.exports = function clearResponsive(gd) {\n if(gd._responsiveChartHandler) {\n window.removeEventListener('resize', gd._responsiveChartHandler);\n delete gd._responsiveChartHandler;\n }\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/lib/clear_responsive.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/lib/coerce.js": /*!**************************************************!*\ !*** ./node_modules/plotly.js/src/lib/coerce.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\nvar isNumeric = __webpack_require__(/*! fast-isnumeric */ \"./node_modules/fast-isnumeric/index.js\");\nvar tinycolor = __webpack_require__(/*! tinycolor2 */ \"./node_modules/tinycolor2/tinycolor.js\");\n\nvar baseTraceAttrs = __webpack_require__(/*! ../plots/attributes */ \"./node_modules/plotly.js/src/plots/attributes.js\");\nvar colorscales = __webpack_require__(/*! ../components/colorscale/scales */ \"./node_modules/plotly.js/src/components/colorscale/scales.js\");\nvar DESELECTDIM = __webpack_require__(/*! ../constants/interactions */ \"./node_modules/plotly.js/src/constants/interactions.js\").DESELECTDIM;\n\nvar nestedProperty = __webpack_require__(/*! ./nested_property */ \"./node_modules/plotly.js/src/lib/nested_property.js\");\nvar counterRegex = __webpack_require__(/*! ./regex */ \"./node_modules/plotly.js/src/lib/regex.js\").counter;\nvar modHalf = __webpack_require__(/*! ./mod */ \"./node_modules/plotly.js/src/lib/mod.js\").modHalf;\nvar isArrayOrTypedArray = __webpack_require__(/*! ./array */ \"./node_modules/plotly.js/src/lib/array.js\").isArrayOrTypedArray;\n\nexports.valObjectMeta = {\n data_array: {\n // You can use *dflt=[] to force said array to exist though.\n description: [\n 'An {array} of data.',\n 'The value MUST be an {array}, or we ignore it.',\n 'Note that typed arrays (e.g. Float32Array) are supported.'\n ].join(' '),\n requiredOpts: [],\n otherOpts: ['dflt'],\n coerceFunction: function(v, propOut, dflt) {\n // TODO maybe `v: {type: 'float32', vals: [/* ... */]}` also\n if(isArrayOrTypedArray(v)) propOut.set(v);\n else if(dflt !== undefined) propOut.set(dflt);\n }\n },\n enumerated: {\n description: [\n 'Enumerated value type. The available values are listed',\n 'in `values`.'\n ].join(' '),\n requiredOpts: ['values'],\n otherOpts: ['dflt', 'coerceNumber', 'arrayOk'],\n coerceFunction: function(v, propOut, dflt, opts) {\n if(opts.coerceNumber) v = +v;\n if(opts.values.indexOf(v) === -1) propOut.set(dflt);\n else propOut.set(v);\n },\n validateFunction: function(v, opts) {\n if(opts.coerceNumber) v = +v;\n\n var values = opts.values;\n for(var i = 0; i < values.length; i++) {\n var k = String(values[i]);\n\n if((k.charAt(0) === '/' && k.charAt(k.length - 1) === '/')) {\n var regex = new RegExp(k.substr(1, k.length - 2));\n if(regex.test(v)) return true;\n } else if(v === values[i]) return true;\n }\n return false;\n }\n },\n 'boolean': {\n description: 'A boolean (true/false) value.',\n requiredOpts: [],\n otherOpts: ['dflt'],\n coerceFunction: function(v, propOut, dflt) {\n if(v === true || v === false) propOut.set(v);\n else propOut.set(dflt);\n }\n },\n number: {\n description: [\n 'A number or a numeric value',\n '(e.g. a number inside a string).',\n 'When applicable, values greater (less) than `max` (`min`)',\n 'are coerced to the `dflt`.'\n ].join(' '),\n requiredOpts: [],\n otherOpts: ['dflt', 'min', 'max', 'arrayOk'],\n coerceFunction: function(v, propOut, dflt, opts) {\n if(!isNumeric(v) ||\n (opts.min !== undefined && v < opts.min) ||\n (opts.max !== undefined && v > opts.max)) {\n propOut.set(dflt);\n } else propOut.set(+v);\n }\n },\n integer: {\n description: [\n 'An integer or an integer inside a string.',\n 'When applicable, values greater (less) than `max` (`min`)',\n 'are coerced to the `dflt`.'\n ].join(' '),\n requiredOpts: [],\n otherOpts: ['dflt', 'min', 'max', 'arrayOk'],\n coerceFunction: function(v, propOut, dflt, opts) {\n if(v % 1 || !isNumeric(v) ||\n (opts.min !== undefined && v < opts.min) ||\n (opts.max !== undefined && v > opts.max)) {\n propOut.set(dflt);\n } else propOut.set(+v);\n }\n },\n string: {\n description: [\n 'A string value.',\n 'Numbers are converted to strings except for attributes with',\n '`strict` set to true.'\n ].join(' '),\n requiredOpts: [],\n // TODO 'values shouldn't be in there (edge case: 'dash' in Scatter)\n otherOpts: ['dflt', 'noBlank', 'strict', 'arrayOk', 'values'],\n coerceFunction: function(v, propOut, dflt, opts) {\n if(typeof v !== 'string') {\n var okToCoerce = (typeof v === 'number');\n\n if(opts.strict === true || !okToCoerce) propOut.set(dflt);\n else propOut.set(String(v));\n } else if(opts.noBlank && !v) propOut.set(dflt);\n else propOut.set(v);\n }\n },\n color: {\n description: [\n 'A string describing color.',\n 'Supported formats:',\n '- hex (e.g. \\'#d3d3d3\\')',\n '- rgb (e.g. \\'rgb(255, 0, 0)\\')',\n '- rgba (e.g. \\'rgb(255, 0, 0, 0.5)\\')',\n '- hsl (e.g. \\'hsl(0, 100%, 50%)\\')',\n '- hsv (e.g. \\'hsv(0, 100%, 100%)\\')',\n '- named colors (full list: http://www.w3.org/TR/css3-color/#svg-color)'\n ].join(' '),\n requiredOpts: [],\n otherOpts: ['dflt', 'arrayOk'],\n coerceFunction: function(v, propOut, dflt) {\n if(tinycolor(v).isValid()) propOut.set(v);\n else propOut.set(dflt);\n }\n },\n colorlist: {\n description: [\n 'A list of colors.',\n 'Must be an {array} containing valid colors.',\n ].join(' '),\n requiredOpts: [],\n otherOpts: ['dflt'],\n coerceFunction: function(v, propOut, dflt) {\n function isColor(color) {\n return tinycolor(color).isValid();\n }\n if(!Array.isArray(v) || !v.length) propOut.set(dflt);\n else if(v.every(isColor)) propOut.set(v);\n else propOut.set(dflt);\n }\n },\n colorscale: {\n description: [\n 'A Plotly colorscale either picked by a name:',\n '(any of', Object.keys(colorscales.scales).join(', '), ')',\n 'customized as an {array} of 2-element {arrays} where',\n 'the first element is the normalized color level value',\n '(starting at *0* and ending at *1*),',\n 'and the second item is a valid color string.'\n ].join(' '),\n requiredOpts: [],\n otherOpts: ['dflt'],\n coerceFunction: function(v, propOut, dflt) {\n propOut.set(colorscales.get(v, dflt));\n }\n },\n angle: {\n description: [\n 'A number (in degree) between -180 and 180.'\n ].join(' '),\n requiredOpts: [],\n otherOpts: ['dflt'],\n coerceFunction: function(v, propOut, dflt) {\n if(v === 'auto') propOut.set('auto');\n else if(!isNumeric(v)) propOut.set(dflt);\n else propOut.set(modHalf(+v, 360));\n }\n },\n subplotid: {\n description: [\n 'An id string of a subplot type (given by dflt), optionally',\n 'followed by an integer >1. e.g. if dflt=\\'geo\\', we can have',\n '\\'geo\\', \\'geo2\\', \\'geo3\\', ...'\n ].join(' '),\n requiredOpts: ['dflt'],\n otherOpts: ['regex'],\n coerceFunction: function(v, propOut, dflt, opts) {\n var regex = opts.regex || counterRegex(dflt);\n if(typeof v === 'string' && regex.test(v)) {\n propOut.set(v);\n return;\n }\n propOut.set(dflt);\n },\n validateFunction: function(v, opts) {\n var dflt = opts.dflt;\n\n if(v === dflt) return true;\n if(typeof v !== 'string') return false;\n if(counterRegex(dflt).test(v)) return true;\n\n return false;\n }\n },\n flaglist: {\n description: [\n 'A string representing a combination of flags',\n '(order does not matter here).',\n 'Combine any of the available `flags` with *+*.',\n '(e.g. (\\'lines+markers\\')).',\n 'Values in `extras` cannot be combined.'\n ].join(' '),\n requiredOpts: ['flags'],\n otherOpts: ['dflt', 'extras', 'arrayOk'],\n coerceFunction: function(v, propOut, dflt, opts) {\n if(typeof v !== 'string') {\n propOut.set(dflt);\n return;\n }\n if((opts.extras || []).indexOf(v) !== -1) {\n propOut.set(v);\n return;\n }\n var vParts = v.split('+');\n var i = 0;\n while(i < vParts.length) {\n var vi = vParts[i];\n if(opts.flags.indexOf(vi) === -1 || vParts.indexOf(vi) < i) {\n vParts.splice(i, 1);\n } else i++;\n }\n if(!vParts.length) propOut.set(dflt);\n else propOut.set(vParts.join('+'));\n }\n },\n any: {\n description: 'Any type.',\n requiredOpts: [],\n otherOpts: ['dflt', 'values', 'arrayOk'],\n coerceFunction: function(v, propOut, dflt) {\n if(v === undefined) propOut.set(dflt);\n else propOut.set(v);\n }\n },\n info_array: {\n description: [\n 'An {array} of plot information.'\n ].join(' '),\n requiredOpts: ['items'],\n // set `dimensions=2` for a 2D array or '1-2' for either\n // `items` may be a single object instead of an array, in which case\n // `freeLength` must be true.\n // if `dimensions='1-2'` and items is a 1D array, then the value can\n // either be a matching 1D array or an array of such matching 1D arrays\n otherOpts: ['dflt', 'freeLength', 'dimensions'],\n coerceFunction: function(v, propOut, dflt, opts) {\n // simplified coerce function just for array items\n function coercePart(v, opts, dflt) {\n var out;\n var propPart = {set: function(v) { out = v; }};\n\n if(dflt === undefined) dflt = opts.dflt;\n\n exports.valObjectMeta[opts.valType].coerceFunction(v, propPart, dflt, opts);\n\n return out;\n }\n\n var twoD = opts.dimensions === 2 || (opts.dimensions === '1-2' && Array.isArray(v) && Array.isArray(v[0]));\n\n if(!Array.isArray(v)) {\n propOut.set(dflt);\n return;\n }\n\n var items = opts.items;\n var vOut = [];\n var arrayItems = Array.isArray(items);\n var arrayItems2D = arrayItems && twoD && Array.isArray(items[0]);\n var innerItemsOnly = twoD && arrayItems && !arrayItems2D;\n var len = (arrayItems && !innerItemsOnly) ? items.length : v.length;\n\n var i, j, row, item, len2, vNew;\n\n dflt = Array.isArray(dflt) ? dflt : [];\n\n if(twoD) {\n for(i = 0; i < len; i++) {\n vOut[i] = [];\n row = Array.isArray(v[i]) ? v[i] : [];\n if(innerItemsOnly) len2 = items.length;\n else if(arrayItems) len2 = items[i].length;\n else len2 = row.length;\n\n for(j = 0; j < len2; j++) {\n if(innerItemsOnly) item = items[j];\n else if(arrayItems) item = items[i][j];\n else item = items;\n\n vNew = coercePart(row[j], item, (dflt[i] || [])[j]);\n if(vNew !== undefined) vOut[i][j] = vNew;\n }\n }\n } else {\n for(i = 0; i < len; i++) {\n vNew = coercePart(v[i], arrayItems ? items[i] : items, dflt[i]);\n if(vNew !== undefined) vOut[i] = vNew;\n }\n }\n\n propOut.set(vOut);\n },\n validateFunction: function(v, opts) {\n if(!Array.isArray(v)) return false;\n\n var items = opts.items;\n var arrayItems = Array.isArray(items);\n var twoD = opts.dimensions === 2;\n\n // when free length is off, input and declared lengths must match\n if(!opts.freeLength && v.length !== items.length) return false;\n\n // valid when all input items are valid\n for(var i = 0; i < v.length; i++) {\n if(twoD) {\n if(!Array.isArray(v[i]) || (!opts.freeLength && v[i].length !== items[i].length)) {\n return false;\n }\n for(var j = 0; j < v[i].length; j++) {\n if(!validate(v[i][j], arrayItems ? items[i][j] : items)) {\n return false;\n }\n }\n } else if(!validate(v[i], arrayItems ? items[i] : items)) return false;\n }\n\n return true;\n }\n }\n};\n\n/**\n * Ensures that container[attribute] has a valid value.\n *\n * attributes[attribute] is an object with possible keys:\n * - valType: data_array, enumerated, boolean, ... as in valObjectMeta\n * - values: (enumerated only) array of allowed vals\n * - min, max: (number, integer only) inclusive bounds on allowed vals\n * either or both may be omitted\n * - dflt: if attribute is invalid or missing, use this default\n * if dflt is provided as an argument to lib.coerce it takes precedence\n * as a convenience, returns the value it finally set\n */\nexports.coerce = function(containerIn, containerOut, attributes, attribute, dflt) {\n return _coerce(containerIn, containerOut, attributes, attribute, dflt).val;\n};\n\nfunction _coerce(containerIn, containerOut, attributes, attribute, dflt, opts) {\n var shouldValidate = (opts || {}).shouldValidate;\n\n var attr = nestedProperty(attributes, attribute).get();\n if(dflt === undefined) dflt = attr.dflt;\n var src = false;\n\n var propIn = nestedProperty(containerIn, attribute);\n var propOut = nestedProperty(containerOut, attribute);\n var valIn = propIn.get();\n\n var template = containerOut._template;\n if(valIn === undefined && template) {\n valIn = nestedProperty(template, attribute).get();\n src = (valIn !== undefined);\n\n // already used the template value, so short-circuit the second check\n template = 0;\n }\n\n /**\n * arrayOk: value MAY be an array, then we do no value checking\n * at this point, because it can be more complicated than the\n * individual form (eg. some array vals can be numbers, even if the\n * single values must be color strings)\n */\n if(attr.arrayOk && isArrayOrTypedArray(valIn)) {\n propOut.set(valIn);\n return {\n inp: valIn,\n val: valIn,\n src: true\n };\n }\n\n var coerceFunction = exports.valObjectMeta[attr.valType].coerceFunction;\n coerceFunction(valIn, propOut, dflt, attr);\n\n var valOut = propOut.get();\n src = (valOut !== undefined) && shouldValidate && validate(valIn, attr);\n\n // in case v was provided but invalid, try the template again so it still\n // overrides the regular default\n if(template && valOut === dflt && !validate(valIn, attr)) {\n valIn = nestedProperty(template, attribute).get();\n coerceFunction(valIn, propOut, dflt, attr);\n valOut = propOut.get();\n\n src = (valOut !== undefined) && shouldValidate && validate(valIn, attr);\n }\n\n return {\n inp: valIn,\n val: valOut,\n src: src\n };\n}\n\n/**\n * Variation on coerce\n * useful when setting an attribute to a valid value\n * can change the default for another attribute.\n *\n * Uses coerce to get attribute value if user input is valid,\n * returns attribute default if user input it not valid or\n * returns false if there is no user input.\n */\nexports.coerce2 = function(containerIn, containerOut, attributes, attribute, dflt) {\n var out = _coerce(containerIn, containerOut, attributes, attribute, dflt, {\n shouldValidate: true\n });\n return (out.src && out.inp !== undefined) ? out.val : false;\n};\n\n/*\n * Shortcut to coerce the three font attributes\n *\n * 'coerce' is a lib.coerce wrapper with implied first three arguments\n */\nexports.coerceFont = function(coerce, attr, dfltObj) {\n var out = {};\n\n dfltObj = dfltObj || {};\n\n out.family = coerce(attr + '.family', dfltObj.family);\n out.size = coerce(attr + '.size', dfltObj.size);\n out.color = coerce(attr + '.color', dfltObj.color);\n\n return out;\n};\n\n/** Coerce shortcut for 'hoverinfo'\n * handling 1-vs-multi-trace dflt logic\n *\n * @param {object} traceIn : user trace object\n * @param {object} traceOut : full trace object (requires _module ref)\n * @param {object} layoutOut : full layout object (require _dataLength ref)\n * @return {any} : the coerced value\n */\nexports.coerceHoverinfo = function(traceIn, traceOut, layoutOut) {\n var moduleAttrs = traceOut._module.attributes;\n var attrs = moduleAttrs.hoverinfo ? moduleAttrs : baseTraceAttrs;\n\n var valObj = attrs.hoverinfo;\n var dflt;\n\n if(layoutOut._dataLength === 1) {\n var flags = valObj.dflt === 'all' ?\n valObj.flags.slice() :\n valObj.dflt.split('+');\n\n flags.splice(flags.indexOf('name'), 1);\n dflt = flags.join('+');\n }\n\n return exports.coerce(traceIn, traceOut, attrs, 'hoverinfo', dflt);\n};\n\n/** Coerce shortcut for [un]selected.marker.opacity,\n * which has special default logic, to ensure that it corresponds to the\n * default selection behavior while allowing to be overtaken by any other\n * [un]selected attribute.\n *\n * N.B. This must be called *after* coercing all the other [un]selected attrs,\n * to give the intended result.\n *\n * @param {object} traceOut : fullData item\n * @param {function} coerce : lib.coerce wrapper with implied first three arguments\n */\nexports.coerceSelectionMarkerOpacity = function(traceOut, coerce) {\n if(!traceOut.marker) return;\n\n var mo = traceOut.marker.opacity;\n // you can still have a `marker` container with no markers if there's text\n if(mo === undefined) return;\n\n var smoDflt;\n var usmoDflt;\n\n // Don't give [un]selected.marker.opacity a default value if\n // marker.opacity is an array: handle this during style step.\n //\n // Only give [un]selected.marker.opacity a default value if you don't\n // set any other [un]selected attributes.\n if(!isArrayOrTypedArray(mo) && !traceOut.selected && !traceOut.unselected) {\n smoDflt = mo;\n usmoDflt = DESELECTDIM * mo;\n }\n\n coerce('selected.marker.opacity', smoDflt);\n coerce('unselected.marker.opacity', usmoDflt);\n};\n\nfunction validate(value, opts) {\n var valObjectDef = exports.valObjectMeta[opts.valType];\n\n if(opts.arrayOk && isArrayOrTypedArray(value)) return true;\n\n if(valObjectDef.validateFunction) {\n return valObjectDef.validateFunction(value, opts);\n }\n\n var failed = {};\n var out = failed;\n var propMock = { set: function(v) { out = v; } };\n\n // 'failed' just something mutable that won't be === anything else\n\n valObjectDef.coerceFunction(value, propMock, failed, opts);\n return out !== failed;\n}\nexports.validate = validate;\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/lib/coerce.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/lib/dates.js": /*!*************************************************!*\ !*** ./node_modules/plotly.js/src/lib/dates.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\n\nvar d3 = __webpack_require__(/*! d3 */ \"./node_modules/d3/d3.js\");\nvar isNumeric = __webpack_require__(/*! fast-isnumeric */ \"./node_modules/fast-isnumeric/index.js\");\n\nvar Loggers = __webpack_require__(/*! ./loggers */ \"./node_modules/plotly.js/src/lib/loggers.js\");\nvar mod = __webpack_require__(/*! ./mod */ \"./node_modules/plotly.js/src/lib/mod.js\").mod;\n\nvar constants = __webpack_require__(/*! ../constants/numerical */ \"./node_modules/plotly.js/src/constants/numerical.js\");\nvar BADNUM = constants.BADNUM;\nvar ONEDAY = constants.ONEDAY;\nvar ONEHOUR = constants.ONEHOUR;\nvar ONEMIN = constants.ONEMIN;\nvar ONESEC = constants.ONESEC;\nvar EPOCHJD = constants.EPOCHJD;\n\nvar Registry = __webpack_require__(/*! ../registry */ \"./node_modules/plotly.js/src/registry.js\");\n\nvar utcFormat = d3.time.format.utc;\n\nvar DATETIME_REGEXP = /^\\s*(-?\\d\\d\\d\\d|\\d\\d)(-(\\d?\\d)(-(\\d?\\d)([ Tt]([01]?\\d|2[0-3])(:([0-5]\\d)(:([0-5]\\d(\\.\\d+)?))?(Z|z|[+\\-]\\d\\d:?\\d\\d)?)?)?)?)?\\s*$/m;\n// special regex for chinese calendars to support yyyy-mmi-dd etc for intercalary months\nvar DATETIME_REGEXP_CN = /^\\s*(-?\\d\\d\\d\\d|\\d\\d)(-(\\d?\\di?)(-(\\d?\\d)([ Tt]([01]?\\d|2[0-3])(:([0-5]\\d)(:([0-5]\\d(\\.\\d+)?))?(Z|z|[+\\-]\\d\\d:?\\d\\d)?)?)?)?)?\\s*$/m;\n\n// for 2-digit years, the first year we map them onto\nvar YFIRST = new Date().getFullYear() - 70;\n\nfunction isWorldCalendar(calendar) {\n return (\n calendar &&\n Registry.componentsRegistry.calendars &&\n typeof calendar === 'string' && calendar !== 'gregorian'\n );\n}\n\n/*\n * dateTick0: get the canonical tick for this calendar\n *\n * bool sunday is for week ticks, shift it to a Sunday.\n */\nexports.dateTick0 = function(calendar, sunday) {\n if(isWorldCalendar(calendar)) {\n return sunday ?\n Registry.getComponentMethod('calendars', 'CANONICAL_SUNDAY')[calendar] :\n Registry.getComponentMethod('calendars', 'CANONICAL_TICK')[calendar];\n } else {\n return sunday ? '2000-01-02' : '2000-01-01';\n }\n};\n\n/*\n * dfltRange: for each calendar, give a valid default range\n */\nexports.dfltRange = function(calendar) {\n if(isWorldCalendar(calendar)) {\n return Registry.getComponentMethod('calendars', 'DFLTRANGE')[calendar];\n } else {\n return ['2000-01-01', '2001-01-01'];\n }\n};\n\n// is an object a javascript date?\nexports.isJSDate = function(v) {\n return typeof v === 'object' && v !== null && typeof v.getTime === 'function';\n};\n\n// The absolute limits of our date-time system\n// This is a little weird: we use MIN_MS and MAX_MS in dateTime2ms\n// but we use dateTime2ms to calculate them (after defining it!)\nvar MIN_MS, MAX_MS;\n\n/**\n * dateTime2ms - turn a date object or string s into milliseconds\n * (relative to 1970-01-01, per javascript standard)\n * optional calendar (string) to use a non-gregorian calendar\n *\n * Returns BADNUM if it doesn't find a date\n *\n * strings should have the form:\n *\n * -?YYYY-mm-ddHH:MM:SS.sss?\n *\n * : space (our normal standard) or T or t (ISO-8601)\n * : Z, z, or [+\\-]HH:?MM and we THROW IT AWAY\n * this format comes from https://tools.ietf.org/html/rfc3339#section-5.6\n * but we allow it even with a space as the separator\n *\n * May truncate after any full field, and sss can be any length\n * even >3 digits, though javascript dates truncate to milliseconds,\n * we keep as much as javascript numeric precision can hold, but we only\n * report back up to 100 microsecond precision, because most dates support\n * this precision (close to 1970 support more, very far away support less)\n *\n * Expanded to support negative years to -9999 but you must always\n * give 4 digits, except for 2-digit positive years which we assume are\n * near the present time.\n * Note that we follow ISO 8601:2004: there *is* a year 0, which\n * is 1BC/BCE, and -1===2BC etc.\n *\n * World calendars: not all of these *have* agreed extensions to this full range,\n * if you have another calendar system but want a date range outside its validity,\n * you can use a gregorian date string prefixed with 'G' or 'g'.\n *\n * Where to cut off 2-digit years between 1900s and 2000s?\n * from http://support.microsoft.com/kb/244664:\n * 1930-2029 (the most retro of all...)\n * but in my mac chrome from eg. d=new Date(Date.parse('8/19/50')):\n * 1950-2049\n * by Java, from http://stackoverflow.com/questions/2024273/:\n * now-80 - now+19\n * or FileMaker Pro, from\n * http://www.filemaker.com/12help/html/add_view_data.4.21.html:\n * now-70 - now+29\n * but python strptime etc, via\n * http://docs.python.org/py3k/library/time.html:\n * 1969-2068 (super forward-looking, but static, not sliding!)\n *\n * lets go with now-70 to now+29, and if anyone runs into this problem\n * they can learn the hard way not to use 2-digit years, as no choice we\n * make now will cover all possibilities. mostly this will all be taken\n * care of in initial parsing, should only be an issue for hand-entered data\n * currently (2016) this range is:\n * 1946-2045\n */\nexports.dateTime2ms = function(s, calendar) {\n // first check if s is a date object\n if(exports.isJSDate(s)) {\n // Convert to the UTC milliseconds that give the same\n // hours as this date has in the local timezone\n var tzOffset = s.getTimezoneOffset() * ONEMIN;\n var offsetTweak = (s.getUTCMinutes() - s.getMinutes()) * ONEMIN +\n (s.getUTCSeconds() - s.getSeconds()) * ONESEC +\n (s.getUTCMilliseconds() - s.getMilliseconds());\n\n if(offsetTweak) {\n var comb = 3 * ONEMIN;\n tzOffset = tzOffset - comb / 2 + mod(offsetTweak - tzOffset + comb / 2, comb);\n }\n s = Number(s) - tzOffset;\n if(s >= MIN_MS && s <= MAX_MS) return s;\n return BADNUM;\n }\n // otherwise only accept strings and numbers\n if(typeof s !== 'string' && typeof s !== 'number') return BADNUM;\n\n s = String(s);\n\n var isWorld = isWorldCalendar(calendar);\n\n // to handle out-of-range dates in international calendars, accept\n // 'G' as a prefix to force the built-in gregorian calendar.\n var s0 = s.charAt(0);\n if(isWorld && (s0 === 'G' || s0 === 'g')) {\n s = s.substr(1);\n calendar = '';\n }\n\n var isChinese = isWorld && calendar.substr(0, 7) === 'chinese';\n\n var match = s.match(isChinese ? DATETIME_REGEXP_CN : DATETIME_REGEXP);\n if(!match) return BADNUM;\n var y = match[1];\n var m = match[3] || '1';\n var d = Number(match[5] || 1);\n var H = Number(match[7] || 0);\n var M = Number(match[9] || 0);\n var S = Number(match[11] || 0);\n\n if(isWorld) {\n // disallow 2-digit years for world calendars\n if(y.length === 2) return BADNUM;\n y = Number(y);\n\n var cDate;\n try {\n var calInstance = Registry.getComponentMethod('calendars', 'getCal')(calendar);\n if(isChinese) {\n var isIntercalary = m.charAt(m.length - 1) === 'i';\n m = parseInt(m, 10);\n cDate = calInstance.newDate(y, calInstance.toMonthIndex(y, m, isIntercalary), d);\n } else {\n cDate = calInstance.newDate(y, Number(m), d);\n }\n } catch(e) { return BADNUM; } // Invalid ... date\n\n if(!cDate) return BADNUM;\n\n return ((cDate.toJD() - EPOCHJD) * ONEDAY) +\n (H * ONEHOUR) + (M * ONEMIN) + (S * ONESEC);\n }\n\n if(y.length === 2) {\n y = (Number(y) + 2000 - YFIRST) % 100 + YFIRST;\n } else y = Number(y);\n\n // new Date uses months from 0; subtract 1 here just so we\n // don't have to do it again during the validity test below\n m -= 1;\n\n // javascript takes new Date(0..99,m,d) to mean 1900-1999, so\n // to support years 0-99 we need to use setFullYear explicitly\n // Note that 2000 is a leap year.\n var date = new Date(Date.UTC(2000, m, d, H, M));\n date.setUTCFullYear(y);\n\n if(date.getUTCMonth() !== m) return BADNUM;\n if(date.getUTCDate() !== d) return BADNUM;\n\n return date.getTime() + S * ONESEC;\n};\n\nMIN_MS = exports.MIN_MS = exports.dateTime2ms('-9999');\nMAX_MS = exports.MAX_MS = exports.dateTime2ms('9999-12-31 23:59:59.9999');\n\n// is string s a date? (see above)\nexports.isDateTime = function(s, calendar) {\n return (exports.dateTime2ms(s, calendar) !== BADNUM);\n};\n\n// pad a number with zeroes, to given # of digits before the decimal point\nfunction lpad(val, digits) {\n return String(val + Math.pow(10, digits)).substr(1);\n}\n\n/**\n * Turn ms into string of the form YYYY-mm-dd HH:MM:SS.ssss\n * Crop any trailing zeros in time, except never stop right after hours\n * (we could choose to crop '-01' from date too but for now we always\n * show the whole date)\n * Optional range r is the data range that applies, also in ms.\n * If rng is big, the later parts of time will be omitted\n */\nvar NINETYDAYS = 90 * ONEDAY;\nvar THREEHOURS = 3 * ONEHOUR;\nvar FIVEMIN = 5 * ONEMIN;\nexports.ms2DateTime = function(ms, r, calendar) {\n if(typeof ms !== 'number' || !(ms >= MIN_MS && ms <= MAX_MS)) return BADNUM;\n\n if(!r) r = 0;\n\n var msecTenths = Math.floor(mod(ms + 0.05, 1) * 10);\n var msRounded = Math.round(ms - msecTenths / 10);\n var dateStr, h, m, s, msec10, d;\n\n if(isWorldCalendar(calendar)) {\n var dateJD = Math.floor(msRounded / ONEDAY) + EPOCHJD;\n var timeMs = Math.floor(mod(ms, ONEDAY));\n try {\n dateStr = Registry.getComponentMethod('calendars', 'getCal')(calendar)\n .fromJD(dateJD).formatDate('yyyy-mm-dd');\n } catch(e) {\n // invalid date in this calendar - fall back to Gyyyy-mm-dd\n dateStr = utcFormat('G%Y-%m-%d')(new Date(msRounded));\n }\n\n // yyyy does NOT guarantee 4-digit years. YYYY mostly does, but does\n // other things for a few calendars, so we can't trust it. Just pad\n // it manually (after the '-' if there is one)\n if(dateStr.charAt(0) === '-') {\n while(dateStr.length < 11) dateStr = '-0' + dateStr.substr(1);\n } else {\n while(dateStr.length < 10) dateStr = '0' + dateStr;\n }\n\n // TODO: if this is faster, we could use this block for extracting\n // the time components of regular gregorian too\n h = (r < NINETYDAYS) ? Math.floor(timeMs / ONEHOUR) : 0;\n m = (r < NINETYDAYS) ? Math.floor((timeMs % ONEHOUR) / ONEMIN) : 0;\n s = (r < THREEHOURS) ? Math.floor((timeMs % ONEMIN) / ONESEC) : 0;\n msec10 = (r < FIVEMIN) ? (timeMs % ONESEC) * 10 + msecTenths : 0;\n } else {\n d = new Date(msRounded);\n\n dateStr = utcFormat('%Y-%m-%d')(d);\n\n // <90 days: add hours and minutes - never *only* add hours\n h = (r < NINETYDAYS) ? d.getUTCHours() : 0;\n m = (r < NINETYDAYS) ? d.getUTCMinutes() : 0;\n // <3 hours: add seconds\n s = (r < THREEHOURS) ? d.getUTCSeconds() : 0;\n // <5 minutes: add ms (plus one extra digit, this is msec*10)\n msec10 = (r < FIVEMIN) ? d.getUTCMilliseconds() * 10 + msecTenths : 0;\n }\n\n return includeTime(dateStr, h, m, s, msec10);\n};\n\n// For converting old-style milliseconds to date strings,\n// we use the local timezone rather than UTC like we use\n// everywhere else, both for backward compatibility and\n// because that's how people mostly use javasript date objects.\n// Clip one extra day off our date range though so we can't get\n// thrown beyond the range by the timezone shift.\nexports.ms2DateTimeLocal = function(ms) {\n if(!(ms >= MIN_MS + ONEDAY && ms <= MAX_MS - ONEDAY)) return BADNUM;\n\n var msecTenths = Math.floor(mod(ms + 0.05, 1) * 10);\n var d = new Date(Math.round(ms - msecTenths / 10));\n var dateStr = d3.time.format('%Y-%m-%d')(d);\n var h = d.getHours();\n var m = d.getMinutes();\n var s = d.getSeconds();\n var msec10 = d.getUTCMilliseconds() * 10 + msecTenths;\n\n return includeTime(dateStr, h, m, s, msec10);\n};\n\nfunction includeTime(dateStr, h, m, s, msec10) {\n // include each part that has nonzero data in or after it\n if(h || m || s || msec10) {\n dateStr += ' ' + lpad(h, 2) + ':' + lpad(m, 2);\n if(s || msec10) {\n dateStr += ':' + lpad(s, 2);\n if(msec10) {\n var digits = 4;\n while(msec10 % 10 === 0) {\n digits -= 1;\n msec10 /= 10;\n }\n dateStr += '.' + lpad(msec10, digits);\n }\n }\n }\n return dateStr;\n}\n\n// normalize date format to date string, in case it starts as\n// a Date object or milliseconds\n// optional dflt is the return value if cleaning fails\nexports.cleanDate = function(v, dflt, calendar) {\n // let us use cleanDate to provide a missing default without an error\n if(v === BADNUM) return dflt;\n if(exports.isJSDate(v) || (typeof v === 'number' && isFinite(v))) {\n // do not allow milliseconds (old) or jsdate objects (inherently\n // described as gregorian dates) with world calendars\n if(isWorldCalendar(calendar)) {\n Loggers.error('JS Dates and milliseconds are incompatible with world calendars', v);\n return dflt;\n }\n\n // NOTE: if someone puts in a year as a number rather than a string,\n // this will mistakenly convert it thinking it's milliseconds from 1970\n // that is: '2012' -> Jan. 1, 2012, but 2012 -> 2012 epoch milliseconds\n v = exports.ms2DateTimeLocal(+v);\n if(!v && dflt !== undefined) return dflt;\n } else if(!exports.isDateTime(v, calendar)) {\n Loggers.error('unrecognized date', v);\n return dflt;\n }\n return v;\n};\n\n/*\n * Date formatting for ticks and hovertext\n */\n\n/*\n * modDateFormat: Support world calendars, and add one item to\n * d3's vocabulary:\n * %{n}f where n is the max number of digits of fractional seconds\n */\nvar fracMatch = /%\\d?f/g;\nfunction modDateFormat(fmt, x, formatter, calendar) {\n fmt = fmt.replace(fracMatch, function(match) {\n var digits = Math.min(+(match.charAt(1)) || 6, 6);\n var fracSecs = ((x / 1000 % 1) + 2)\n .toFixed(digits)\n .substr(2).replace(/0+$/, '') || '0';\n return fracSecs;\n });\n\n var d = new Date(Math.floor(x + 0.05));\n\n if(isWorldCalendar(calendar)) {\n try {\n fmt = Registry.getComponentMethod('calendars', 'worldCalFmt')(fmt, x, calendar);\n } catch(e) {\n return 'Invalid';\n }\n }\n return formatter(fmt)(d);\n}\n\n/*\n * formatTime: create a time string from:\n * x: milliseconds\n * tr: tickround ('M', 'S', or # digits)\n * only supports UTC times (where every day is 24 hours and 0 is at midnight)\n */\nvar MAXSECONDS = [59, 59.9, 59.99, 59.999, 59.9999];\nfunction formatTime(x, tr) {\n var timePart = mod(x + 0.05, ONEDAY);\n\n var timeStr = lpad(Math.floor(timePart / ONEHOUR), 2) + ':' +\n lpad(mod(Math.floor(timePart / ONEMIN), 60), 2);\n\n if(tr !== 'M') {\n if(!isNumeric(tr)) tr = 0; // should only be 'S'\n\n /*\n * this is a weird one - and shouldn't come up unless people\n * monkey with tick0 in weird ways, but we need to do something!\n * IN PARTICULAR we had better not display garbage (see below)\n * for numbers we always round to the nearest increment of the\n * precision we're showing, and this seems like the right way to\n * handle seconds and milliseconds, as they have a decimal point\n * and people will interpret that to mean rounding like numbers.\n * but for larger increments we floor the value: it's always\n * 2013 until the ball drops on the new year. We could argue about\n * which field it is where we start rounding (should 12:08:59\n * round to 12:09 if we're stopping at minutes?) but for now I'll\n * say we round seconds but floor everything else. BUT that means\n * we need to never round up to 60 seconds, ie 23:59:60\n */\n var sec = Math.min(mod(x / ONESEC, 60), MAXSECONDS[tr]);\n\n var secStr = (100 + sec).toFixed(tr).substr(1);\n if(tr > 0) {\n secStr = secStr.replace(/0+$/, '').replace(/[\\.]$/, '');\n }\n\n timeStr += ':' + secStr;\n }\n return timeStr;\n}\n\n/*\n * formatDate: turn a date into tick or hover label text.\n *\n * x: milliseconds, the value to convert\n * fmt: optional, an explicit format string (d3 format, even for world calendars)\n * tr: tickround ('y', 'm', 'd', 'M', 'S', or # digits)\n * used if no explicit fmt is provided\n * formatter: locale-aware d3 date formatter for standard gregorian calendars\n * should be the result of exports.getD3DateFormat(gd)\n * calendar: optional string, the world calendar system to use\n *\n * returns the date/time as a string, potentially with the leading portion\n * on a separate line (after '\\n')\n * Note that this means if you provide an explicit format which includes '\\n'\n * the axis may choose to strip things after it when they don't change from\n * one tick to the next (as it does with automatic formatting)\n */\nexports.formatDate = function(x, fmt, tr, formatter, calendar, extraFormat) {\n calendar = isWorldCalendar(calendar) && calendar;\n\n if(!fmt) {\n if(tr === 'y') fmt = extraFormat.year;\n else if(tr === 'm') fmt = extraFormat.month;\n else if(tr === 'd') {\n fmt = extraFormat.dayMonth + '\\n' + extraFormat.year;\n } else {\n return formatTime(x, tr) + '\\n' + modDateFormat(extraFormat.dayMonthYear, x, formatter, calendar);\n }\n }\n\n return modDateFormat(fmt, x, formatter, calendar);\n};\n\n/*\n * incrementMonth: make a new milliseconds value from the given one,\n * having changed the month\n *\n * special case for world calendars: multiples of 12 are treated as years,\n * even for calendar systems that don't have (always or ever) 12 months/year\n * TODO: perhaps we need a different code for year increments to support this?\n *\n * ms (number): the initial millisecond value\n * dMonth (int): the (signed) number of months to shift\n * calendar (string): the calendar system to use\n *\n * changing month does not (and CANNOT) always preserve day, since\n * months have different lengths. The worst example of this is:\n * d = new Date(1970,0,31); d.setMonth(1) -> Feb 31 turns into Mar 3\n *\n * But we want to be able to iterate over the last day of each month,\n * regardless of what its number is.\n * So shift 3 days forward, THEN set the new month, then unshift:\n * 1/31 -> 2/28 (or 29) -> 3/31 -> 4/30 -> ...\n *\n * Note that odd behavior still exists if you start from the 26th-28th:\n * 1/28 -> 2/28 -> 3/31\n * but at least you can't shift any dates into the wrong month,\n * and ticks on these days incrementing by month would be very unusual\n */\nvar THREEDAYS = 3 * ONEDAY;\nexports.incrementMonth = function(ms, dMonth, calendar) {\n calendar = isWorldCalendar(calendar) && calendar;\n\n // pull time out and operate on pure dates, then add time back at the end\n // this gives maximum precision - not that we *normally* care if we're\n // incrementing by month, but better to be safe!\n var timeMs = mod(ms, ONEDAY);\n ms = Math.round(ms - timeMs);\n\n if(calendar) {\n try {\n var dateJD = Math.round(ms / ONEDAY) + EPOCHJD;\n var calInstance = Registry.getComponentMethod('calendars', 'getCal')(calendar);\n var cDate = calInstance.fromJD(dateJD);\n\n if(dMonth % 12) calInstance.add(cDate, dMonth, 'm');\n else calInstance.add(cDate, dMonth / 12, 'y');\n\n return (cDate.toJD() - EPOCHJD) * ONEDAY + timeMs;\n } catch(e) {\n Loggers.error('invalid ms ' + ms + ' in calendar ' + calendar);\n // then keep going in gregorian even though the result will be 'Invalid'\n }\n }\n\n var y = new Date(ms + THREEDAYS);\n return y.setUTCMonth(y.getUTCMonth() + dMonth) + timeMs - THREEDAYS;\n};\n\n/*\n * findExactDates: what fraction of data is exact days, months, or years?\n *\n * data: array of millisecond values\n * calendar (string) the calendar to test against\n */\nexports.findExactDates = function(data, calendar) {\n var exactYears = 0;\n var exactMonths = 0;\n var exactDays = 0;\n var blankCount = 0;\n var d;\n var di;\n\n var calInstance = (\n isWorldCalendar(calendar) &&\n Registry.getComponentMethod('calendars', 'getCal')(calendar)\n );\n\n for(var i = 0; i < data.length; i++) {\n di = data[i];\n\n // not date data at all\n if(!isNumeric(di)) {\n blankCount ++;\n continue;\n }\n\n // not an exact date\n if(di % ONEDAY) continue;\n\n if(calInstance) {\n try {\n d = calInstance.fromJD(di / ONEDAY + EPOCHJD);\n if(d.day() === 1) {\n if(d.month() === 1) exactYears++;\n else exactMonths++;\n } else exactDays++;\n } catch(e) {\n // invalid date in this calendar - ignore it here.\n }\n } else {\n d = new Date(di);\n if(d.getUTCDate() === 1) {\n if(d.getUTCMonth() === 0) exactYears++;\n else exactMonths++;\n } else exactDays++;\n }\n }\n exactMonths += exactYears;\n exactDays += exactMonths;\n\n var dataCount = data.length - blankCount;\n\n return {\n exactYears: exactYears / dataCount,\n exactMonths: exactMonths / dataCount,\n exactDays: exactDays / dataCount\n };\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/lib/dates.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/lib/dom.js": /*!***********************************************!*\ !*** ./node_modules/plotly.js/src/lib/dom.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\nvar d3 = __webpack_require__(/*! d3 */ \"./node_modules/d3/d3.js\");\nvar loggers = __webpack_require__(/*! ./loggers */ \"./node_modules/plotly.js/src/lib/loggers.js\");\n\n/**\n * Allow referencing a graph DOM element either directly\n * or by its id string\n *\n * @param {HTMLDivElement|string} gd: a graph element or its id\n *\n * @returns {HTMLDivElement} the DOM element of the graph\n */\nfunction getGraphDiv(gd) {\n var gdElement;\n\n if(typeof gd === 'string') {\n gdElement = document.getElementById(gd);\n\n if(gdElement === null) {\n throw new Error('No DOM element with id \\'' + gd + '\\' exists on the page.');\n }\n\n return gdElement;\n } else if(gd === null || gd === undefined) {\n throw new Error('DOM element provided is null or undefined');\n }\n\n // otherwise assume that gd is a DOM element\n return gd;\n}\n\nfunction isPlotDiv(el) {\n var el3 = d3.select(el);\n return el3.node() instanceof HTMLElement &&\n el3.size() &&\n el3.classed('js-plotly-plot');\n}\n\nfunction removeElement(el) {\n var elParent = el && el.parentNode;\n if(elParent) elParent.removeChild(el);\n}\n\n/**\n * for dynamically adding style rules\n * makes one stylesheet that contains all rules added\n * by all calls to this function\n */\nfunction addStyleRule(selector, styleString) {\n addRelatedStyleRule('global', selector, styleString);\n}\n\n/**\n * for dynamically adding style rules\n * to a stylesheet uniquely identified by a uid\n */\nfunction addRelatedStyleRule(uid, selector, styleString) {\n var id = 'plotly.js-style-' + uid;\n var style = document.getElementById(id);\n if(!style) {\n style = document.createElement('style');\n style.setAttribute('id', id);\n // WebKit hack :(\n style.appendChild(document.createTextNode(''));\n document.head.appendChild(style);\n }\n var styleSheet = style.sheet;\n\n if(styleSheet.insertRule) {\n styleSheet.insertRule(selector + '{' + styleString + '}', 0);\n } else if(styleSheet.addRule) {\n styleSheet.addRule(selector, styleString, 0);\n } else loggers.warn('addStyleRule failed');\n}\n\n/**\n * to remove from the page a stylesheet identified by a given uid\n */\nfunction deleteRelatedStyleRule(uid) {\n var id = 'plotly.js-style-' + uid;\n var style = document.getElementById(id);\n if(style) removeElement(style);\n}\n\nmodule.exports = {\n getGraphDiv: getGraphDiv,\n isPlotDiv: isPlotDiv,\n removeElement: removeElement,\n addStyleRule: addStyleRule,\n addRelatedStyleRule: addRelatedStyleRule,\n deleteRelatedStyleRule: deleteRelatedStyleRule\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/lib/dom.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/lib/extend.js": /*!**************************************************!*\ !*** ./node_modules/plotly.js/src/lib/extend.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\n\nvar isPlainObject = __webpack_require__(/*! ./is_plain_object.js */ \"./node_modules/plotly.js/src/lib/is_plain_object.js\");\nvar isArray = Array.isArray;\n\nfunction primitivesLoopSplice(source, target) {\n var i, value;\n for(i = 0; i < source.length; i++) {\n value = source[i];\n if(value !== null && typeof(value) === 'object') {\n return false;\n }\n if(value !== void(0)) {\n target[i] = value;\n }\n }\n return true;\n}\n\nexports.extendFlat = function() {\n return _extend(arguments, false, false, false);\n};\n\nexports.extendDeep = function() {\n return _extend(arguments, true, false, false);\n};\n\nexports.extendDeepAll = function() {\n return _extend(arguments, true, true, false);\n};\n\nexports.extendDeepNoArrays = function() {\n return _extend(arguments, true, false, true);\n};\n\n/*\n * Inspired by https://github.com/justmoon/node-extend/blob/master/index.js\n * All credit to the jQuery authors for perfecting this amazing utility.\n *\n * API difference with jQuery version:\n * - No optional boolean (true -> deep extend) first argument,\n * use `extendFlat` for first-level only extend and\n * use `extendDeep` for a deep extend.\n *\n * Other differences with jQuery version:\n * - Uses a modern (and faster) isPlainObject routine.\n * - Expected to work with object {} and array [] arguments only.\n * - Does not check for circular structure.\n * FYI: jQuery only does a check across one level.\n * Warning: this might result in infinite loops.\n *\n */\nfunction _extend(inputs, isDeep, keepAllKeys, noArrayCopies) {\n var target = inputs[0];\n var length = inputs.length;\n\n var input, key, src, copy, copyIsArray, clone, allPrimitives;\n\n // TODO does this do the right thing for typed arrays?\n\n if(length === 2 && isArray(target) && isArray(inputs[1]) && target.length === 0) {\n allPrimitives = primitivesLoopSplice(inputs[1], target);\n\n if(allPrimitives) {\n return target;\n } else {\n target.splice(0, target.length); // reset target and continue to next block\n }\n }\n\n for(var i = 1; i < length; i++) {\n input = inputs[i];\n\n for(key in input) {\n src = target[key];\n copy = input[key];\n\n if(noArrayCopies && isArray(copy)) {\n // Stop early and just transfer the array if array copies are disallowed:\n\n target[key] = copy;\n } else if(isDeep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n // recurse if we're merging plain objects or arrays\n\n if(copyIsArray) {\n copyIsArray = false;\n clone = src && isArray(src) ? src : [];\n } else {\n clone = src && isPlainObject(src) ? src : {};\n }\n\n // never move original objects, clone them\n target[key] = _extend([clone, copy], isDeep, keepAllKeys, noArrayCopies);\n } else if(typeof copy !== 'undefined' || keepAllKeys) {\n // don't bring in undefined values, except for extendDeepAll\n\n target[key] = copy;\n }\n }\n }\n\n return target;\n}\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/lib/extend.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/lib/filter_unique.js": /*!*********************************************************!*\ !*** ./node_modules/plotly.js/src/lib/filter_unique.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\n\n\n/**\n * Return news array containing only the unique items\n * found in input array.\n *\n * IMPORTANT: Note that items are considered unique\n * if `String({})` is unique. For example;\n *\n * Lib.filterUnique([ { a: 1 }, { b: 2 } ])\n *\n * returns [{ a: 1 }]\n *\n * and\n *\n * Lib.filterUnique([ '1', 1 ])\n *\n * returns ['1']\n *\n *\n * @param {array} array base array\n * @return {array} new filtered array\n */\nmodule.exports = function filterUnique(array) {\n var seen = {};\n var out = [];\n var j = 0;\n\n for(var i = 0; i < array.length; i++) {\n var item = array[i];\n\n if(seen[item] !== 1) {\n seen[item] = 1;\n out[j++] = item;\n }\n }\n\n return out;\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/lib/filter_unique.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/lib/filter_visible.js": /*!**********************************************************!*\ !*** ./node_modules/plotly.js/src/lib/filter_visible.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\n/** Filter out object items with visible !== true\n * insider array container.\n *\n * @param {array of objects} container\n * @return {array of objects} of length <= container\n *\n */\nmodule.exports = function filterVisible(container) {\n var filterFn = isCalcData(container) ? calcDataFilter : baseFilter;\n var out = [];\n\n for(var i = 0; i < container.length; i++) {\n var item = container[i];\n if(filterFn(item)) out.push(item);\n }\n\n return out;\n};\n\nfunction baseFilter(item) {\n return item.visible === true;\n}\n\nfunction calcDataFilter(item) {\n var trace = item[0].trace;\n return trace.visible === true && trace._length !== 0;\n}\n\nfunction isCalcData(cont) {\n return (\n Array.isArray(cont) &&\n Array.isArray(cont[0]) &&\n cont[0][0] &&\n cont[0][0].trace\n );\n}\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/lib/filter_visible.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/lib/geometry2d.js": /*!******************************************************!*\ !*** ./node_modules/plotly.js/src/lib/geometry2d.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\nvar mod = __webpack_require__(/*! ./mod */ \"./node_modules/plotly.js/src/lib/mod.js\").mod;\n\n/*\n * look for intersection of two line segments\n * (1->2 and 3->4) - returns array [x,y] if they do, null if not\n */\nexports.segmentsIntersect = segmentsIntersect;\nfunction segmentsIntersect(x1, y1, x2, y2, x3, y3, x4, y4) {\n var a = x2 - x1;\n var b = x3 - x1;\n var c = x4 - x3;\n var d = y2 - y1;\n var e = y3 - y1;\n var f = y4 - y3;\n var det = a * f - c * d;\n // parallel lines? intersection is undefined\n // ignore the case where they are colinear\n if(det === 0) return null;\n var t = (b * f - c * e) / det;\n var u = (b * d - a * e) / det;\n // segments do not intersect?\n if(u < 0 || u > 1 || t < 0 || t > 1) return null;\n\n return {x: x1 + a * t, y: y1 + d * t};\n}\n\n/*\n * find the minimum distance between two line segments (1->2 and 3->4)\n */\nexports.segmentDistance = function segmentDistance(x1, y1, x2, y2, x3, y3, x4, y4) {\n if(segmentsIntersect(x1, y1, x2, y2, x3, y3, x4, y4)) return 0;\n\n // the two segments and their lengths squared\n var x12 = x2 - x1;\n var y12 = y2 - y1;\n var x34 = x4 - x3;\n var y34 = y4 - y3;\n var ll12 = x12 * x12 + y12 * y12;\n var ll34 = x34 * x34 + y34 * y34;\n\n // calculate distance squared, then take the sqrt at the very end\n var dist2 = Math.min(\n perpDistance2(x12, y12, ll12, x3 - x1, y3 - y1),\n perpDistance2(x12, y12, ll12, x4 - x1, y4 - y1),\n perpDistance2(x34, y34, ll34, x1 - x3, y1 - y3),\n perpDistance2(x34, y34, ll34, x2 - x3, y2 - y3)\n );\n\n return Math.sqrt(dist2);\n};\n\n/*\n * distance squared from segment ab to point c\n * [xab, yab] is the vector b-a\n * [xac, yac] is the vector c-a\n * llab is the length squared of (b-a), just to simplify calculation\n */\nfunction perpDistance2(xab, yab, llab, xac, yac) {\n var fcAB = (xac * xab + yac * yab);\n if(fcAB < 0) {\n // point c is closer to point a\n return xac * xac + yac * yac;\n } else if(fcAB > llab) {\n // point c is closer to point b\n var xbc = xac - xab;\n var ybc = yac - yab;\n return xbc * xbc + ybc * ybc;\n } else {\n // perpendicular distance is the shortest\n var crossProduct = xac * yab - yac * xab;\n return crossProduct * crossProduct / llab;\n }\n}\n\n// a very short-term cache for getTextLocation, just because\n// we're often looping over the same locations multiple times\n// invalidated as soon as we look at a different path\nvar locationCache, workingPath, workingTextWidth;\n\n// turn a path and position along it into x, y, and angle for the given text\nexports.getTextLocation = function getTextLocation(path, totalPathLen, positionOnPath, textWidth) {\n if(path !== workingPath || textWidth !== workingTextWidth) {\n locationCache = {};\n workingPath = path;\n workingTextWidth = textWidth;\n }\n if(locationCache[positionOnPath]) {\n return locationCache[positionOnPath];\n }\n\n // for the angle, use points on the path separated by the text width\n // even though due to curvature, the text will cover a bit more than that\n var p0 = path.getPointAtLength(mod(positionOnPath - textWidth / 2, totalPathLen));\n var p1 = path.getPointAtLength(mod(positionOnPath + textWidth / 2, totalPathLen));\n // note: atan handles 1/0 nicely\n var theta = Math.atan((p1.y - p0.y) / (p1.x - p0.x));\n // center the text at 2/3 of the center position plus 1/3 the p0/p1 midpoint\n // that's the average position of this segment, assuming it's roughly quadratic\n var pCenter = path.getPointAtLength(mod(positionOnPath, totalPathLen));\n var x = (pCenter.x * 4 + p0.x + p1.x) / 6;\n var y = (pCenter.y * 4 + p0.y + p1.y) / 6;\n\n var out = {x: x, y: y, theta: theta};\n locationCache[positionOnPath] = out;\n return out;\n};\n\nexports.clearLocationCache = function() {\n workingPath = null;\n};\n\n/*\n * Find the segment of `path` that's within the visible area\n * given by `bounds` {left, right, top, bottom}, to within a\n * precision of `buffer` px\n *\n * returns: undefined if nothing is visible, else object:\n * {\n * min: position where the path first enters bounds, or 0 if it\n * starts within bounds\n * max: position where the path last exits bounds, or the path length\n * if it finishes within bounds\n * len: max - min, ie the length of visible path\n * total: the total path length - just included so the caller doesn't\n * need to call path.getTotalLength() again\n * isClosed: true iff the start and end points of the path are both visible\n * and are at the same point\n * }\n *\n * Works by starting from either end and repeatedly finding the distance from\n * that point to the plot area, and if it's outside the plot, moving along the\n * path by that distance (because the plot must be at least that far away on\n * the path). Note that if a path enters, exits, and re-enters the plot, we\n * will not capture this behavior.\n */\nexports.getVisibleSegment = function getVisibleSegment(path, bounds, buffer) {\n var left = bounds.left;\n var right = bounds.right;\n var top = bounds.top;\n var bottom = bounds.bottom;\n\n var pMin = 0;\n var pTotal = path.getTotalLength();\n var pMax = pTotal;\n\n var pt0, ptTotal;\n\n function getDistToPlot(len) {\n var pt = path.getPointAtLength(len);\n\n // hold on to the start and end points for `closed`\n if(len === 0) pt0 = pt;\n else if(len === pTotal) ptTotal = pt;\n\n var dx = (pt.x < left) ? left - pt.x : (pt.x > right ? pt.x - right : 0);\n var dy = (pt.y < top) ? top - pt.y : (pt.y > bottom ? pt.y - bottom : 0);\n return Math.sqrt(dx * dx + dy * dy);\n }\n\n var distToPlot = getDistToPlot(pMin);\n while(distToPlot) {\n pMin += distToPlot + buffer;\n if(pMin > pMax) return;\n distToPlot = getDistToPlot(pMin);\n }\n\n distToPlot = getDistToPlot(pMax);\n while(distToPlot) {\n pMax -= distToPlot + buffer;\n if(pMin > pMax) return;\n distToPlot = getDistToPlot(pMax);\n }\n\n return {\n min: pMin,\n max: pMax,\n len: pMax - pMin,\n total: pTotal,\n isClosed: pMin === 0 && pMax === pTotal &&\n Math.abs(pt0.x - ptTotal.x) < 0.1 &&\n Math.abs(pt0.y - ptTotal.y) < 0.1\n };\n};\n\n/**\n * Find point on SVG path corresponding to a given constraint coordinate\n *\n * @param {SVGPathElement} path\n * @param {Number} val : constraint coordinate value\n * @param {String} coord : 'x' or 'y' the constraint coordinate\n * @param {Object} opts :\n * - {Number} pathLength : supply total path length before hand\n * - {Number} tolerance\n * - {Number} iterationLimit\n * @return {SVGPoint}\n */\nexports.findPointOnPath = function findPointOnPath(path, val, coord, opts) {\n opts = opts || {};\n\n var pathLength = opts.pathLength || path.getTotalLength();\n var tolerance = opts.tolerance || 1e-3;\n var iterationLimit = opts.iterationLimit || 30;\n\n // if path starts at a val greater than the path tail (like on vertical violins),\n // we must flip the sign of the computed diff.\n var mul = path.getPointAtLength(0)[coord] > path.getPointAtLength(pathLength)[coord] ? -1 : 1;\n\n var i = 0;\n var b0 = 0;\n var b1 = pathLength;\n var mid;\n var pt;\n var diff;\n\n while(i < iterationLimit) {\n mid = (b0 + b1) / 2;\n pt = path.getPointAtLength(mid);\n diff = pt[coord] - val;\n\n if(Math.abs(diff) < tolerance) {\n return pt;\n } else {\n if(mul * diff > 0) {\n b1 = mid;\n } else {\n b0 = mid;\n }\n i++;\n }\n }\n return pt;\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/lib/geometry2d.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/lib/identity.js": /*!****************************************************!*\ !*** ./node_modules/plotly.js/src/lib/identity.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\n// Simple helper functions\n// none of these need any external deps\n\nmodule.exports = function identity(d) { return d; };\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/lib/identity.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/lib/index.js": /*!*************************************************!*\ !*** ./node_modules/plotly.js/src/lib/index.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\nvar d3 = __webpack_require__(/*! d3 */ \"./node_modules/d3/d3.js\");\nvar isNumeric = __webpack_require__(/*! fast-isnumeric */ \"./node_modules/fast-isnumeric/index.js\");\n\nvar numConstants = __webpack_require__(/*! ../constants/numerical */ \"./node_modules/plotly.js/src/constants/numerical.js\");\nvar FP_SAFE = numConstants.FP_SAFE;\nvar BADNUM = numConstants.BADNUM;\n\nvar lib = module.exports = {};\n\nlib.nestedProperty = __webpack_require__(/*! ./nested_property */ \"./node_modules/plotly.js/src/lib/nested_property.js\");\nlib.keyedContainer = __webpack_require__(/*! ./keyed_container */ \"./node_modules/plotly.js/src/lib/keyed_container.js\");\nlib.relativeAttr = __webpack_require__(/*! ./relative_attr */ \"./node_modules/plotly.js/src/lib/relative_attr.js\");\nlib.isPlainObject = __webpack_require__(/*! ./is_plain_object */ \"./node_modules/plotly.js/src/lib/is_plain_object.js\");\nlib.toLogRange = __webpack_require__(/*! ./to_log_range */ \"./node_modules/plotly.js/src/lib/to_log_range.js\");\nlib.relinkPrivateKeys = __webpack_require__(/*! ./relink_private */ \"./node_modules/plotly.js/src/lib/relink_private.js\");\n\nvar arrayModule = __webpack_require__(/*! ./array */ \"./node_modules/plotly.js/src/lib/array.js\");\nlib.isTypedArray = arrayModule.isTypedArray;\nlib.isArrayOrTypedArray = arrayModule.isArrayOrTypedArray;\nlib.isArray1D = arrayModule.isArray1D;\nlib.ensureArray = arrayModule.ensureArray;\nlib.concat = arrayModule.concat;\nlib.maxRowLength = arrayModule.maxRowLength;\nlib.minRowLength = arrayModule.minRowLength;\n\nvar modModule = __webpack_require__(/*! ./mod */ \"./node_modules/plotly.js/src/lib/mod.js\");\nlib.mod = modModule.mod;\nlib.modHalf = modModule.modHalf;\n\nvar coerceModule = __webpack_require__(/*! ./coerce */ \"./node_modules/plotly.js/src/lib/coerce.js\");\nlib.valObjectMeta = coerceModule.valObjectMeta;\nlib.coerce = coerceModule.coerce;\nlib.coerce2 = coerceModule.coerce2;\nlib.coerceFont = coerceModule.coerceFont;\nlib.coerceHoverinfo = coerceModule.coerceHoverinfo;\nlib.coerceSelectionMarkerOpacity = coerceModule.coerceSelectionMarkerOpacity;\nlib.validate = coerceModule.validate;\n\nvar datesModule = __webpack_require__(/*! ./dates */ \"./node_modules/plotly.js/src/lib/dates.js\");\nlib.dateTime2ms = datesModule.dateTime2ms;\nlib.isDateTime = datesModule.isDateTime;\nlib.ms2DateTime = datesModule.ms2DateTime;\nlib.ms2DateTimeLocal = datesModule.ms2DateTimeLocal;\nlib.cleanDate = datesModule.cleanDate;\nlib.isJSDate = datesModule.isJSDate;\nlib.formatDate = datesModule.formatDate;\nlib.incrementMonth = datesModule.incrementMonth;\nlib.dateTick0 = datesModule.dateTick0;\nlib.dfltRange = datesModule.dfltRange;\nlib.findExactDates = datesModule.findExactDates;\nlib.MIN_MS = datesModule.MIN_MS;\nlib.MAX_MS = datesModule.MAX_MS;\n\nvar searchModule = __webpack_require__(/*! ./search */ \"./node_modules/plotly.js/src/lib/search.js\");\nlib.findBin = searchModule.findBin;\nlib.sorterAsc = searchModule.sorterAsc;\nlib.sorterDes = searchModule.sorterDes;\nlib.distinctVals = searchModule.distinctVals;\nlib.roundUp = searchModule.roundUp;\nlib.sort = searchModule.sort;\nlib.findIndexOfMin = searchModule.findIndexOfMin;\n\nvar statsModule = __webpack_require__(/*! ./stats */ \"./node_modules/plotly.js/src/lib/stats.js\");\nlib.aggNums = statsModule.aggNums;\nlib.len = statsModule.len;\nlib.mean = statsModule.mean;\nlib.median = statsModule.median;\nlib.midRange = statsModule.midRange;\nlib.variance = statsModule.variance;\nlib.stdev = statsModule.stdev;\nlib.interp = statsModule.interp;\n\nvar matrixModule = __webpack_require__(/*! ./matrix */ \"./node_modules/plotly.js/src/lib/matrix.js\");\nlib.init2dArray = matrixModule.init2dArray;\nlib.transposeRagged = matrixModule.transposeRagged;\nlib.dot = matrixModule.dot;\nlib.translationMatrix = matrixModule.translationMatrix;\nlib.rotationMatrix = matrixModule.rotationMatrix;\nlib.rotationXYMatrix = matrixModule.rotationXYMatrix;\nlib.apply2DTransform = matrixModule.apply2DTransform;\nlib.apply2DTransform2 = matrixModule.apply2DTransform2;\n\nvar anglesModule = __webpack_require__(/*! ./angles */ \"./node_modules/plotly.js/src/lib/angles.js\");\nlib.deg2rad = anglesModule.deg2rad;\nlib.rad2deg = anglesModule.rad2deg;\nlib.angleDelta = anglesModule.angleDelta;\nlib.angleDist = anglesModule.angleDist;\nlib.isFullCircle = anglesModule.isFullCircle;\nlib.isAngleInsideSector = anglesModule.isAngleInsideSector;\nlib.isPtInsideSector = anglesModule.isPtInsideSector;\nlib.pathArc = anglesModule.pathArc;\nlib.pathSector = anglesModule.pathSector;\nlib.pathAnnulus = anglesModule.pathAnnulus;\n\nvar anchorUtils = __webpack_require__(/*! ./anchor_utils */ \"./node_modules/plotly.js/src/lib/anchor_utils.js\");\nlib.isLeftAnchor = anchorUtils.isLeftAnchor;\nlib.isCenterAnchor = anchorUtils.isCenterAnchor;\nlib.isRightAnchor = anchorUtils.isRightAnchor;\nlib.isTopAnchor = anchorUtils.isTopAnchor;\nlib.isMiddleAnchor = anchorUtils.isMiddleAnchor;\nlib.isBottomAnchor = anchorUtils.isBottomAnchor;\n\nvar geom2dModule = __webpack_require__(/*! ./geometry2d */ \"./node_modules/plotly.js/src/lib/geometry2d.js\");\nlib.segmentsIntersect = geom2dModule.segmentsIntersect;\nlib.segmentDistance = geom2dModule.segmentDistance;\nlib.getTextLocation = geom2dModule.getTextLocation;\nlib.clearLocationCache = geom2dModule.clearLocationCache;\nlib.getVisibleSegment = geom2dModule.getVisibleSegment;\nlib.findPointOnPath = geom2dModule.findPointOnPath;\n\nvar extendModule = __webpack_require__(/*! ./extend */ \"./node_modules/plotly.js/src/lib/extend.js\");\nlib.extendFlat = extendModule.extendFlat;\nlib.extendDeep = extendModule.extendDeep;\nlib.extendDeepAll = extendModule.extendDeepAll;\nlib.extendDeepNoArrays = extendModule.extendDeepNoArrays;\n\nvar loggersModule = __webpack_require__(/*! ./loggers */ \"./node_modules/plotly.js/src/lib/loggers.js\");\nlib.log = loggersModule.log;\nlib.warn = loggersModule.warn;\nlib.error = loggersModule.error;\n\nvar regexModule = __webpack_require__(/*! ./regex */ \"./node_modules/plotly.js/src/lib/regex.js\");\nlib.counterRegex = regexModule.counter;\n\nvar throttleModule = __webpack_require__(/*! ./throttle */ \"./node_modules/plotly.js/src/lib/throttle.js\");\nlib.throttle = throttleModule.throttle;\nlib.throttleDone = throttleModule.done;\nlib.clearThrottle = throttleModule.clear;\n\nvar domModule = __webpack_require__(/*! ./dom */ \"./node_modules/plotly.js/src/lib/dom.js\");\nlib.getGraphDiv = domModule.getGraphDiv;\nlib.isPlotDiv = domModule.isPlotDiv;\nlib.removeElement = domModule.removeElement;\nlib.addStyleRule = domModule.addStyleRule;\nlib.addRelatedStyleRule = domModule.addRelatedStyleRule;\nlib.deleteRelatedStyleRule = domModule.deleteRelatedStyleRule;\n\nlib.clearResponsive = __webpack_require__(/*! ./clear_responsive */ \"./node_modules/plotly.js/src/lib/clear_responsive.js\");\n\nlib.makeTraceGroups = __webpack_require__(/*! ./make_trace_groups */ \"./node_modules/plotly.js/src/lib/make_trace_groups.js\");\n\nlib._ = __webpack_require__(/*! ./localize */ \"./node_modules/plotly.js/src/lib/localize.js\");\n\nlib.notifier = __webpack_require__(/*! ./notifier */ \"./node_modules/plotly.js/src/lib/notifier.js\");\n\nlib.filterUnique = __webpack_require__(/*! ./filter_unique */ \"./node_modules/plotly.js/src/lib/filter_unique.js\");\nlib.filterVisible = __webpack_require__(/*! ./filter_visible */ \"./node_modules/plotly.js/src/lib/filter_visible.js\");\nlib.pushUnique = __webpack_require__(/*! ./push_unique */ \"./node_modules/plotly.js/src/lib/push_unique.js\");\n\nlib.cleanNumber = __webpack_require__(/*! ./clean_number */ \"./node_modules/plotly.js/src/lib/clean_number.js\");\n\nlib.ensureNumber = function ensureNumber(v) {\n if(!isNumeric(v)) return BADNUM;\n v = Number(v);\n if(v < -FP_SAFE || v > FP_SAFE) return BADNUM;\n return isNumeric(v) ? Number(v) : BADNUM;\n};\n\n/**\n * Is v a valid array index? Accepts numeric strings as well as numbers.\n *\n * @param {any} v: the value to test\n * @param {Optional[integer]} len: the array length we are indexing\n *\n * @return {bool}: v is a valid array index\n */\nlib.isIndex = function(v, len) {\n if(len !== undefined && v >= len) return false;\n return isNumeric(v) && (v >= 0) && (v % 1 === 0);\n};\n\nlib.noop = __webpack_require__(/*! ./noop */ \"./node_modules/plotly.js/src/lib/noop.js\");\nlib.identity = __webpack_require__(/*! ./identity */ \"./node_modules/plotly.js/src/lib/identity.js\");\n\n/**\n * create an array of length 'cnt' filled with 'v' at all indices\n *\n * @param {any} v\n * @param {number} cnt\n * @return {array}\n */\nlib.repeat = function(v, cnt) {\n var out = new Array(cnt);\n for(var i = 0; i < cnt; i++) {\n out[i] = v;\n }\n return out;\n};\n\n/**\n * swap x and y of the same attribute in container cont\n * specify attr with a ? in place of x/y\n * you can also swap other things than x/y by providing part1 and part2\n */\nlib.swapAttrs = function(cont, attrList, part1, part2) {\n if(!part1) part1 = 'x';\n if(!part2) part2 = 'y';\n for(var i = 0; i < attrList.length; i++) {\n var attr = attrList[i];\n var xp = lib.nestedProperty(cont, attr.replace('?', part1));\n var yp = lib.nestedProperty(cont, attr.replace('?', part2));\n var temp = xp.get();\n xp.set(yp.get());\n yp.set(temp);\n }\n};\n\n/**\n * SVG painter's algo worked around with reinsertion\n */\nlib.raiseToTop = function raiseToTop(elem) {\n elem.parentNode.appendChild(elem);\n};\n\n/**\n * cancel a possibly pending transition; returned selection may be used by caller\n */\nlib.cancelTransition = function(selection) {\n return selection.transition().duration(0);\n};\n\n// constrain - restrict a number v to be between v0 and v1\nlib.constrain = function(v, v0, v1) {\n if(v0 > v1) return Math.max(v1, Math.min(v0, v));\n return Math.max(v0, Math.min(v1, v));\n};\n\n/**\n * do two bounding boxes from getBoundingClientRect,\n * ie {left,right,top,bottom,width,height}, overlap?\n * takes optional padding pixels\n */\nlib.bBoxIntersect = function(a, b, pad) {\n pad = pad || 0;\n return (a.left <= b.right + pad &&\n b.left <= a.right + pad &&\n a.top <= b.bottom + pad &&\n b.top <= a.bottom + pad);\n};\n\n/*\n * simpleMap: alternative to Array.map that only\n * passes on the element and up to 2 extra args you\n * provide (but not the array index or the whole array)\n *\n * array: the array to map it to\n * func: the function to apply\n * x1, x2: optional extra args\n */\nlib.simpleMap = function(array, func, x1, x2, opts) {\n var len = array.length;\n var out = new Array(len);\n for(var i = 0; i < len; i++) out[i] = func(array[i], x1, x2, opts);\n return out;\n};\n\n/**\n * Random string generator\n *\n * @param {object} existing\n * pass in strings to avoid as keys with truthy values\n * @param {int} bits\n * bits of information in the output string, default 24\n * @param {int} base\n * base of string representation, default 16. Should be a power of 2.\n */\nlib.randstr = function randstr(existing, bits, base, _recursion) {\n if(!base) base = 16;\n if(bits === undefined) bits = 24;\n if(bits <= 0) return '0';\n\n var digits = Math.log(Math.pow(2, bits)) / Math.log(base);\n var res = '';\n var i, b, x;\n\n for(i = 2; digits === Infinity; i *= 2) {\n digits = Math.log(Math.pow(2, bits / i)) / Math.log(base) * i;\n }\n\n var rem = digits - Math.floor(digits);\n\n for(i = 0; i < Math.floor(digits); i++) {\n x = Math.floor(Math.random() * base).toString(base);\n res = x + res;\n }\n\n if(rem) {\n b = Math.pow(base, rem);\n x = Math.floor(Math.random() * b).toString(base);\n res = x + res;\n }\n\n var parsed = parseInt(res, base);\n if((existing && existing[res]) ||\n (parsed !== Infinity && parsed >= Math.pow(2, bits))) {\n if(_recursion > 10) {\n lib.warn('randstr failed uniqueness');\n return res;\n }\n return randstr(existing, bits, base, (_recursion || 0) + 1);\n } else return res;\n};\n\nlib.OptionControl = function(opt, optname) {\n /*\n * An environment to contain all option setters and\n * getters that collectively modify opts.\n *\n * You can call up opts from any function in new object\n * as this.optname || this.opt\n *\n * See FitOpts for example of usage\n */\n if(!opt) opt = {};\n if(!optname) optname = 'opt';\n\n var self = {};\n self.optionList = [];\n\n self._newoption = function(optObj) {\n optObj[optname] = opt;\n self[optObj.name] = optObj;\n self.optionList.push(optObj);\n };\n\n self['_' + optname] = opt;\n return self;\n};\n\n/**\n * lib.smooth: smooth arrayIn by convolving with\n * a hann window with given full width at half max\n * bounce the ends in, so the output has the same length as the input\n */\nlib.smooth = function(arrayIn, FWHM) {\n FWHM = Math.round(FWHM) || 0; // only makes sense for integers\n if(FWHM < 2) return arrayIn;\n\n var alen = arrayIn.length;\n var alen2 = 2 * alen;\n var wlen = 2 * FWHM - 1;\n var w = new Array(wlen);\n var arrayOut = new Array(alen);\n var i;\n var j;\n var k;\n var v;\n\n // first make the window array\n for(i = 0; i < wlen; i++) {\n w[i] = (1 - Math.cos(Math.PI * (i + 1) / FWHM)) / (2 * FWHM);\n }\n\n // now do the convolution\n for(i = 0; i < alen; i++) {\n v = 0;\n for(j = 0; j < wlen; j++) {\n k = i + j + 1 - FWHM;\n\n // multibounce\n if(k < -alen) k -= alen2 * Math.round(k / alen2);\n else if(k >= alen2) k -= alen2 * Math.floor(k / alen2);\n\n // single bounce\n if(k < 0) k = - 1 - k;\n else if(k >= alen) k = alen2 - 1 - k;\n\n v += arrayIn[k] * w[j];\n }\n arrayOut[i] = v;\n }\n\n return arrayOut;\n};\n\n/**\n * syncOrAsync: run a sequence of functions synchronously\n * as long as its returns are not promises (ie have no .then)\n * includes one argument arg to send to all functions...\n * this is mainly just to prevent us having to make wrapper functions\n * when the only purpose of the wrapper is to reference gd\n * and a final step to be executed at the end\n * TODO: if there's an error and everything is sync,\n * this doesn't happen yet because we want to make sure\n * that it gets reported\n */\nlib.syncOrAsync = function(sequence, arg, finalStep) {\n var ret, fni;\n\n function continueAsync() {\n return lib.syncOrAsync(sequence, arg, finalStep);\n }\n\n while(sequence.length) {\n fni = sequence.splice(0, 1)[0];\n ret = fni(arg);\n\n if(ret && ret.then) {\n return ret.then(continueAsync)\n .then(undefined, lib.promiseError);\n }\n }\n\n return finalStep && finalStep(arg);\n};\n\n\n/**\n * Helper to strip trailing slash, from\n * http://stackoverflow.com/questions/6680825/return-string-without-trailing-slash\n */\nlib.stripTrailingSlash = function(str) {\n if(str.substr(-1) === '/') return str.substr(0, str.length - 1);\n return str;\n};\n\nlib.noneOrAll = function(containerIn, containerOut, attrList) {\n /**\n * some attributes come together, so if you have one of them\n * in the input, you should copy the default values of the others\n * to the input as well.\n */\n if(!containerIn) return;\n\n var hasAny = false;\n var hasAll = true;\n var i;\n var val;\n\n for(i = 0; i < attrList.length; i++) {\n val = containerIn[attrList[i]];\n if(val !== undefined && val !== null) hasAny = true;\n else hasAll = false;\n }\n\n if(hasAny && !hasAll) {\n for(i = 0; i < attrList.length; i++) {\n containerIn[attrList[i]] = containerOut[attrList[i]];\n }\n }\n};\n\n/** merges calcdata field (given by cdAttr) with traceAttr values\n *\n * N.B. Loop over minimum of cd.length and traceAttr.length\n * i.e. it does not try to fill in beyond traceAttr.length-1\n *\n * @param {array} traceAttr : trace attribute\n * @param {object} cd : calcdata trace\n * @param {string} cdAttr : calcdata key\n */\nlib.mergeArray = function(traceAttr, cd, cdAttr, fn) {\n var hasFn = typeof fn === 'function';\n if(lib.isArrayOrTypedArray(traceAttr)) {\n var imax = Math.min(traceAttr.length, cd.length);\n for(var i = 0; i < imax; i++) {\n var v = traceAttr[i];\n cd[i][cdAttr] = hasFn ? fn(v) : v;\n }\n }\n};\n\n// cast numbers to positive numbers, returns 0 if not greater than 0\nlib.mergeArrayCastPositive = function(traceAttr, cd, cdAttr) {\n return lib.mergeArray(traceAttr, cd, cdAttr, function(v) {\n var w = +v;\n return !isFinite(w) ? 0 : w > 0 ? w : 0;\n });\n};\n\n/** fills calcdata field (given by cdAttr) with traceAttr values\n * or function of traceAttr values (e.g. some fallback)\n *\n * N.B. Loops over all cd items.\n *\n * @param {array} traceAttr : trace attribute\n * @param {object} cd : calcdata trace\n * @param {string} cdAttr : calcdata key\n * @param {function} [fn] : optional function to apply to each array item\n */\nlib.fillArray = function(traceAttr, cd, cdAttr, fn) {\n fn = fn || lib.identity;\n\n if(lib.isArrayOrTypedArray(traceAttr)) {\n for(var i = 0; i < cd.length; i++) {\n cd[i][cdAttr] = fn(traceAttr[i]);\n }\n }\n};\n\n/** Handler for trace-wide vs per-point options\n *\n * @param {object} trace : (full) trace object\n * @param {number} ptNumber : index of the point in question\n * @param {string} astr : attribute string\n * @param {function} [fn] : optional function to apply to each array item\n *\n * @return {any}\n */\nlib.castOption = function(trace, ptNumber, astr, fn) {\n fn = fn || lib.identity;\n\n var val = lib.nestedProperty(trace, astr).get();\n\n if(lib.isArrayOrTypedArray(val)) {\n if(Array.isArray(ptNumber) && lib.isArrayOrTypedArray(val[ptNumber[0]])) {\n return fn(val[ptNumber[0]][ptNumber[1]]);\n } else {\n return fn(val[ptNumber]);\n }\n } else {\n return val;\n }\n};\n\n/** Extract option from calcdata item, correctly falling back to\n * trace value if not found.\n *\n * @param {object} calcPt : calcdata[i][j] item\n * @param {object} trace : (full) trace object\n * @param {string} calcKey : calcdata key\n * @param {string} traceKey : aka trace attribute string\n * @return {any}\n */\nlib.extractOption = function(calcPt, trace, calcKey, traceKey) {\n if(calcKey in calcPt) return calcPt[calcKey];\n\n // fallback to trace value,\n // must check if value isn't itself an array\n // which means the trace attribute has a corresponding\n // calcdata key, but its value is falsy\n var traceVal = lib.nestedProperty(trace, traceKey).get();\n if(!Array.isArray(traceVal)) return traceVal;\n};\n\nfunction makePtIndex2PtNumber(indexToPoints) {\n var ptIndex2ptNumber = {};\n for(var k in indexToPoints) {\n var pts = indexToPoints[k];\n for(var j = 0; j < pts.length; j++) {\n ptIndex2ptNumber[pts[j]] = +k;\n }\n }\n return ptIndex2ptNumber;\n}\n\n/** Tag selected calcdata items\n *\n * N.B. note that point 'index' corresponds to input data array index\n * whereas 'number' is its post-transform version.\n *\n * @param {array} calcTrace\n * @param {object} trace\n * - selectedpoints {array}\n * - _indexToPoints {object}\n * @param {ptNumber2cdIndex} ptNumber2cdIndex (optional)\n * optional map object for trace types that do not have 1-to-1 point number to\n * calcdata item index correspondence (e.g. histogram)\n */\nlib.tagSelected = function(calcTrace, trace, ptNumber2cdIndex) {\n var selectedpoints = trace.selectedpoints;\n var indexToPoints = trace._indexToPoints;\n var ptIndex2ptNumber;\n\n // make pt index-to-number map object, which takes care of transformed traces\n if(indexToPoints) {\n ptIndex2ptNumber = makePtIndex2PtNumber(indexToPoints);\n }\n\n function isCdIndexValid(v) {\n return v !== undefined && v < calcTrace.length;\n }\n\n for(var i = 0; i < selectedpoints.length; i++) {\n var ptIndex = selectedpoints[i];\n\n if(lib.isIndex(ptIndex) ||\n (lib.isArrayOrTypedArray(ptIndex) && lib.isIndex(ptIndex[0]) && lib.isIndex(ptIndex[1]))\n ) {\n var ptNumber = ptIndex2ptNumber ? ptIndex2ptNumber[ptIndex] : ptIndex;\n var cdIndex = ptNumber2cdIndex ? ptNumber2cdIndex[ptNumber] : ptNumber;\n\n if(isCdIndexValid(cdIndex)) {\n calcTrace[cdIndex].selected = 1;\n }\n }\n }\n};\n\nlib.selIndices2selPoints = function(trace) {\n var selectedpoints = trace.selectedpoints;\n var indexToPoints = trace._indexToPoints;\n\n if(indexToPoints) {\n var ptIndex2ptNumber = makePtIndex2PtNumber(indexToPoints);\n var out = [];\n\n for(var i = 0; i < selectedpoints.length; i++) {\n var ptIndex = selectedpoints[i];\n if(lib.isIndex(ptIndex)) {\n var ptNumber = ptIndex2ptNumber[ptIndex];\n if(lib.isIndex(ptNumber)) {\n out.push(ptNumber);\n }\n }\n }\n\n return out;\n } else {\n return selectedpoints;\n }\n};\n\n/** Returns target as set by 'target' transform attribute\n *\n * @param {object} trace : full trace object\n * @param {object} transformOpts : transform option object\n * - target (string} :\n * either an attribute string referencing an array in the trace object, or\n * a set array.\n *\n * @return {array or false} : the target array (NOT a copy!!) or false if invalid\n */\nlib.getTargetArray = function(trace, transformOpts) {\n var target = transformOpts.target;\n\n if(typeof target === 'string' && target) {\n var array = lib.nestedProperty(trace, target).get();\n return Array.isArray(array) ? array : false;\n } else if(Array.isArray(target)) {\n return target;\n }\n\n return false;\n};\n\n/**\n * modified version of jQuery's extend to strip out private objs and functions,\n * and cut arrays down to first or 1 elements\n * because extend-like algorithms are hella slow\n * obj2 is assumed to already be clean of these things (including no arrays)\n */\nlib.minExtend = function(obj1, obj2) {\n var objOut = {};\n if(typeof obj2 !== 'object') obj2 = {};\n var arrayLen = 3;\n var keys = Object.keys(obj1);\n var i, k, v;\n\n for(i = 0; i < keys.length; i++) {\n k = keys[i];\n v = obj1[k];\n if(k.charAt(0) === '_' || typeof v === 'function') continue;\n else if(k === 'module') objOut[k] = v;\n else if(Array.isArray(v)) {\n if(k === 'colorscale') {\n objOut[k] = v.slice();\n } else {\n objOut[k] = v.slice(0, arrayLen);\n }\n } else if(lib.isTypedArray(v)) {\n objOut[k] = v.subarray(0, arrayLen);\n } else if(v && (typeof v === 'object')) objOut[k] = lib.minExtend(obj1[k], obj2[k]);\n else objOut[k] = v;\n }\n\n keys = Object.keys(obj2);\n for(i = 0; i < keys.length; i++) {\n k = keys[i];\n v = obj2[k];\n if(typeof v !== 'object' || !(k in objOut) || typeof objOut[k] !== 'object') {\n objOut[k] = v;\n }\n }\n\n return objOut;\n};\n\nlib.titleCase = function(s) {\n return s.charAt(0).toUpperCase() + s.substr(1);\n};\n\nlib.containsAny = function(s, fragments) {\n for(var i = 0; i < fragments.length; i++) {\n if(s.indexOf(fragments[i]) !== -1) return true;\n }\n return false;\n};\n\nlib.isIE = function() {\n return typeof window.navigator.msSaveBlob !== 'undefined';\n};\n\nvar IS_IE9_OR_BELOW_REGEX = /MSIE [1-9]\\./;\nlib.isIE9orBelow = function() {\n return lib.isIE() && IS_IE9_OR_BELOW_REGEX.test(window.navigator.userAgent);\n};\n\nvar IS_SAFARI_REGEX = /Version\\/[\\d\\.]+.*Safari/;\nlib.isSafari = function() {\n return IS_SAFARI_REGEX.test(window.navigator.userAgent);\n};\n\n/**\n * Duck typing to recognize a d3 selection, mostly for IE9's benefit\n * because it doesn't handle instanceof like modern browsers\n */\nlib.isD3Selection = function(obj) {\n return obj && (typeof obj.classed === 'function');\n};\n\n/**\n * Append element to DOM only if not present.\n *\n * @param {d3 selection} parent : parent selection of the element in question\n * @param {string} nodeType : node type of element to append\n * @param {string} className (optional) : class name of element in question\n * @param {fn} enterFn (optional) : optional fn applied to entering elements only\n * @return {d3 selection} selection of new layer\n *\n * Previously, we were using the following pattern:\n *\n * ```\n * var sel = parent.selectAll('.' + className)\n * .data([0]);\n *\n * sel.enter().append(nodeType)\n * .classed(className, true);\n *\n * return sel;\n * ```\n *\n * in numerous places in our codebase to achieve the same behavior.\n *\n * The logic below performs much better, mostly as we are using\n * `.select` instead `.selectAll` that is `querySelector` instead of\n * `querySelectorAll`.\n *\n */\nlib.ensureSingle = function(parent, nodeType, className, enterFn) {\n var sel = parent.select(nodeType + (className ? '.' + className : ''));\n if(sel.size()) return sel;\n\n var layer = parent.append(nodeType);\n if(className) layer.classed(className, true);\n if(enterFn) layer.call(enterFn);\n\n return layer;\n};\n\n/**\n * Same as Lib.ensureSingle, but using id as selector.\n * This version is mostly used for clipPath nodes.\n *\n * @param {d3 selection} parent : parent selection of the element in question\n * @param {string} nodeType : node type of element to append\n * @param {string} id : id of element in question\n * @param {fn} enterFn (optional) : optional fn applied to entering elements only\n * @return {d3 selection} selection of new layer\n */\nlib.ensureSingleById = function(parent, nodeType, id, enterFn) {\n var sel = parent.select(nodeType + '#' + id);\n if(sel.size()) return sel;\n\n var layer = parent.append(nodeType).attr('id', id);\n if(enterFn) layer.call(enterFn);\n\n return layer;\n};\n\n/**\n * Converts a string path to an object.\n *\n * When given a string containing an array element, it will create a `null`\n * filled array of the given size.\n *\n * @example\n * lib.objectFromPath('nested.test[2].path', 'value');\n * // returns { nested: { test: [null, null, { path: 'value' }]}\n *\n * @param {string} path to nested value\n * @param {*} any value to be set\n *\n * @return {Object} the constructed object with a full nested path\n */\nlib.objectFromPath = function(path, value) {\n var keys = path.split('.');\n var tmpObj;\n var obj = tmpObj = {};\n\n for(var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var el = null;\n\n var parts = keys[i].match(/(.*)\\[([0-9]+)\\]/);\n\n if(parts) {\n key = parts[1];\n el = parts[2];\n\n tmpObj = tmpObj[key] = [];\n\n if(i === keys.length - 1) {\n tmpObj[el] = value;\n } else {\n tmpObj[el] = {};\n }\n\n tmpObj = tmpObj[el];\n } else {\n if(i === keys.length - 1) {\n tmpObj[key] = value;\n } else {\n tmpObj[key] = {};\n }\n\n tmpObj = tmpObj[key];\n }\n }\n\n return obj;\n};\n\n/**\n * Iterate through an object in-place, converting dotted properties to objects.\n *\n * Examples:\n *\n * lib.expandObjectPaths({'nested.test.path': 'value'});\n * => { nested: { test: {path: 'value'}}}\n *\n * It also handles array notation, e.g.:\n *\n * lib.expandObjectPaths({'foo[1].bar': 'value'});\n * => { foo: [null, {bar: value}] }\n *\n * It handles merges the results when two properties are specified in parallel:\n *\n * lib.expandObjectPaths({'foo[1].bar': 10, 'foo[0].bar': 20});\n * => { foo: [{bar: 10}, {bar: 20}] }\n *\n * It does NOT, however, merge mulitple mutliply-nested arrays::\n *\n * lib.expandObjectPaths({'marker[1].range[1]': 5, 'marker[1].range[0]': 4})\n * => { marker: [null, {range: 4}] }\n */\n\n// Store this to avoid recompiling regex on *every* prop since this may happen many\n// many times for animations. Could maybe be inside the function. Not sure about\n// scoping vs. recompilation tradeoff, but at least it's not just inlining it into\n// the inner loop.\nvar dottedPropertyRegex = /^([^\\[\\.]+)\\.(.+)?/;\nvar indexedPropertyRegex = /^([^\\.]+)\\[([0-9]+)\\](\\.)?(.+)?/;\n\nlib.expandObjectPaths = function(data) {\n var match, key, prop, datum, idx, dest, trailingPath;\n if(typeof data === 'object' && !Array.isArray(data)) {\n for(key in data) {\n if(data.hasOwnProperty(key)) {\n if((match = key.match(dottedPropertyRegex))) {\n datum = data[key];\n prop = match[1];\n\n delete data[key];\n\n data[prop] = lib.extendDeepNoArrays(data[prop] || {}, lib.objectFromPath(key, lib.expandObjectPaths(datum))[prop]);\n } else if((match = key.match(indexedPropertyRegex))) {\n datum = data[key];\n\n prop = match[1];\n idx = parseInt(match[2]);\n\n delete data[key];\n\n data[prop] = data[prop] || [];\n\n if(match[3] === '.') {\n // This is the case where theere are subsequent properties into which\n // we must recurse, e.g. transforms[0].value\n trailingPath = match[4];\n dest = data[prop][idx] = data[prop][idx] || {};\n\n // NB: Extend deep no arrays prevents this from working on multiple\n // nested properties in the same object, e.g.\n //\n // {\n // foo[0].bar[1].range\n // foo[0].bar[0].range\n // }\n //\n // In this case, the extendDeepNoArrays will overwrite one array with\n // the other, so that both properties *will not* be present in the\n // result. Fixing this would require a more intelligent tracking\n // of changes and merging than extendDeepNoArrays currently accomplishes.\n lib.extendDeepNoArrays(dest, lib.objectFromPath(trailingPath, lib.expandObjectPaths(datum)));\n } else {\n // This is the case where this property is the end of the line,\n // e.g. xaxis.range[0]\n data[prop][idx] = lib.expandObjectPaths(datum);\n }\n } else {\n data[key] = lib.expandObjectPaths(data[key]);\n }\n }\n }\n }\n\n return data;\n};\n\n/**\n * Converts value to string separated by the provided separators.\n *\n * @example\n * lib.numSeparate(2016, '.,');\n * // returns '2016'\n *\n * @example\n * lib.numSeparate(3000, '.,', true);\n * // returns '3,000'\n *\n * @example\n * lib.numSeparate(1234.56, '|,')\n * // returns '1,234|56'\n *\n * @param {string|number} value the value to be converted\n * @param {string} separators string of decimal, then thousands separators\n * @param {boolean} separatethousands boolean, 4-digit integers are separated if true\n *\n * @return {string} the value that has been separated\n */\nlib.numSeparate = function(value, separators, separatethousands) {\n if(!separatethousands) separatethousands = false;\n\n if(typeof separators !== 'string' || separators.length === 0) {\n throw new Error('Separator string required for formatting!');\n }\n\n if(typeof value === 'number') {\n value = String(value);\n }\n\n var thousandsRe = /(\\d+)(\\d{3})/;\n var decimalSep = separators.charAt(0);\n var thouSep = separators.charAt(1);\n\n var x = value.split('.');\n var x1 = x[0];\n var x2 = x.length > 1 ? decimalSep + x[1] : '';\n\n // Years are ignored for thousands separators\n if(thouSep && (x.length > 1 || x1.length > 4 || separatethousands)) {\n while(thousandsRe.test(x1)) {\n x1 = x1.replace(thousandsRe, '$1' + thouSep + '$2');\n }\n }\n\n return x1 + x2;\n};\n\nlib.TEMPLATE_STRING_REGEX = /%{([^\\s%{}:]*)([:|\\|][^}]*)?}/g;\nvar SIMPLE_PROPERTY_REGEX = /^\\w*$/;\n\n/**\n * Substitute values from an object into a string\n *\n * Examples:\n * Lib.templateString('name: %{trace}', {trace: 'asdf'}) --> 'name: asdf'\n * Lib.templateString('name: %{trace[0].name}', {trace: [{name: 'asdf'}]}) --> 'name: asdf'\n *\n * @param {string} input string containing %{...} template strings\n * @param {obj} data object containing substitution values\n *\n * @return {string} templated string\n */\nlib.templateString = function(string, obj) {\n // Not all that useful, but cache nestedProperty instantiation\n // just in case it speeds things up *slightly*:\n var getterCache = {};\n\n return string.replace(lib.TEMPLATE_STRING_REGEX, function(dummy, key) {\n var v;\n if(SIMPLE_PROPERTY_REGEX.test(key)) {\n v = obj[key];\n } else {\n getterCache[key] = getterCache[key] || lib.nestedProperty(obj, key).get;\n v = getterCache[key]();\n }\n return lib.isValidTextValue(v) ? v : '';\n });\n};\n\nvar hovertemplateWarnings = {\n max: 10,\n count: 0,\n name: 'hovertemplate'\n};\nlib.hovertemplateString = function() {\n return templateFormatString.apply(hovertemplateWarnings, arguments);\n};\n\nvar texttemplateWarnings = {\n max: 10,\n count: 0,\n name: 'texttemplate'\n};\nlib.texttemplateString = function() {\n return templateFormatString.apply(texttemplateWarnings, arguments);\n};\n\nvar TEMPLATE_STRING_FORMAT_SEPARATOR = /^[:|\\|]/;\n/**\n * Substitute values from an object into a string and optionally formats them using d3-format,\n * or fallback to associated labels.\n *\n * Examples:\n * Lib.hovertemplateString('name: %{trace}', {trace: 'asdf'}) --> 'name: asdf'\n * Lib.hovertemplateString('name: %{trace[0].name}', {trace: [{name: 'asdf'}]}) --> 'name: asdf'\n * Lib.hovertemplateString('price: %{y:$.2f}', {y: 1}) --> 'price: $1.00'\n *\n * @param {string} input string containing %{...:...} template strings\n * @param {obj} data object containing fallback text when no formatting is specified, ex.: {yLabel: 'formattedYValue'}\n * @param {obj} d3 locale\n * @param {obj} data objects containing substitution values\n *\n * @return {string} templated string\n */\nfunction templateFormatString(string, labels, d3locale) {\n var opts = this;\n var args = arguments;\n if(!labels) labels = {};\n // Not all that useful, but cache nestedProperty instantiation\n // just in case it speeds things up *slightly*:\n var getterCache = {};\n\n return string.replace(lib.TEMPLATE_STRING_REGEX, function(match, key, format) {\n var obj, value, i;\n for(i = 3; i < args.length; i++) {\n obj = args[i];\n if(!obj) continue;\n if(obj.hasOwnProperty(key)) {\n value = obj[key];\n break;\n }\n\n if(!SIMPLE_PROPERTY_REGEX.test(key)) {\n value = getterCache[key] || lib.nestedProperty(obj, key).get();\n if(value) getterCache[key] = value;\n }\n if(value !== undefined) break;\n }\n\n if(value === undefined && opts) {\n if(opts.count < opts.max) {\n lib.warn('Variable \\'' + key + '\\' in ' + opts.name + ' could not be found!');\n value = match;\n }\n\n if(opts.count === opts.max) {\n lib.warn('Too many ' + opts.name + ' warnings - additional warnings will be suppressed');\n }\n opts.count++;\n\n return match;\n }\n\n if(format) {\n var fmt;\n if(format[0] === ':') {\n fmt = d3locale ? d3locale.numberFormat : d3.format;\n value = fmt(format.replace(TEMPLATE_STRING_FORMAT_SEPARATOR, ''))(value);\n }\n\n if(format[0] === '|') {\n fmt = d3locale ? d3locale.timeFormat.utc : d3.time.format.utc;\n var ms = lib.dateTime2ms(value);\n value = lib.formatDate(ms, format.replace(TEMPLATE_STRING_FORMAT_SEPARATOR, ''), false, fmt);\n }\n } else {\n if(labels.hasOwnProperty(key + 'Label')) value = labels[key + 'Label'];\n }\n return value;\n });\n}\n\n/*\n * alphanumeric string sort, tailored for subplot IDs like scene2, scene10, x10y13 etc\n */\nvar char0 = 48;\nvar char9 = 57;\nlib.subplotSort = function(a, b) {\n var l = Math.min(a.length, b.length) + 1;\n var numA = 0;\n var numB = 0;\n for(var i = 0; i < l; i++) {\n var charA = a.charCodeAt(i) || 0;\n var charB = b.charCodeAt(i) || 0;\n var isNumA = charA >= char0 && charA <= char9;\n var isNumB = charB >= char0 && charB <= char9;\n\n if(isNumA) numA = 10 * numA + charA - char0;\n if(isNumB) numB = 10 * numB + charB - char0;\n\n if(!isNumA || !isNumB) {\n if(numA !== numB) return numA - numB;\n if(charA !== charB) return charA - charB;\n }\n }\n return numB - numA;\n};\n\n// repeatable pseudorandom generator\nvar randSeed = 2000000000;\n\nlib.seedPseudoRandom = function() {\n randSeed = 2000000000;\n};\n\nlib.pseudoRandom = function() {\n var lastVal = randSeed;\n randSeed = (69069 * randSeed + 1) % 4294967296;\n // don't let consecutive vals be too close together\n // gets away from really trying to be random, in favor of better local uniformity\n if(Math.abs(randSeed - lastVal) < 429496729) return lib.pseudoRandom();\n return randSeed / 4294967296;\n};\n\n\n/** Fill hover 'pointData' container with 'correct' hover text value\n *\n * - If trace hoverinfo contains a 'text' flag and hovertext is not set,\n * the text elements will be seen in the hover labels.\n *\n * - If trace hoverinfo contains a 'text' flag and hovertext is set,\n * hovertext takes precedence over text\n * i.e. the hoverinfo elements will be seen in the hover labels\n *\n * @param {object} calcPt\n * @param {object} trace\n * @param {object || array} contOut (mutated here)\n */\nlib.fillText = function(calcPt, trace, contOut) {\n var fill = Array.isArray(contOut) ?\n function(v) { contOut.push(v); } :\n function(v) { contOut.text = v; };\n\n var htx = lib.extractOption(calcPt, trace, 'htx', 'hovertext');\n if(lib.isValidTextValue(htx)) return fill(htx);\n\n var tx = lib.extractOption(calcPt, trace, 'tx', 'text');\n if(lib.isValidTextValue(tx)) return fill(tx);\n};\n\n// accept all truthy values and 0 (which gets cast to '0' in the hover labels)\nlib.isValidTextValue = function(v) {\n return v || v === 0;\n};\n\n/**\n * @param {number} ratio\n * @param {number} n (number of decimal places)\n */\nlib.formatPercent = function(ratio, n) {\n n = n || 0;\n var str = (Math.round(100 * ratio * Math.pow(10, n)) * Math.pow(0.1, n)).toFixed(n) + '%';\n for(var i = 0; i < n; i++) {\n if(str.indexOf('.') !== -1) {\n str = str.replace('0%', '%');\n str = str.replace('.%', '%');\n }\n }\n return str;\n};\n\nlib.isHidden = function(gd) {\n var display = window.getComputedStyle(gd).display;\n return !display || display === 'none';\n};\n\n/** Return transform text for bar bar-like rectangles and pie-like slices\n * @param {object} transform\n * - targetX: desired position on the x-axis\n * - targetY: desired position on the y-axis\n * - textX: text middle position on the x-axis\n * - textY: text middle position on the y-axis\n * - anchorX: (optional) text anchor position on the x-axis (computed from textX), zero for middle anchor\n * - anchorY: (optional) text anchor position on the y-axis (computed from textY), zero for middle anchor\n * - scale: (optional) scale applied after translate\n * - rotate: (optional) rotation applied after scale\n * - noCenter: when defined no extra arguments needed in rotation\n */\nlib.getTextTransform = function(transform) {\n var noCenter = transform.noCenter;\n var textX = transform.textX;\n var textY = transform.textY;\n var targetX = transform.targetX;\n var targetY = transform.targetY;\n var anchorX = transform.anchorX || 0;\n var anchorY = transform.anchorY || 0;\n var rotate = transform.rotate;\n var scale = transform.scale;\n if(!scale) scale = 0;\n else if(scale > 1) scale = 1;\n\n return (\n 'translate(' +\n (targetX - scale * (textX + anchorX)) + ',' +\n (targetY - scale * (textY + anchorY)) +\n ')' +\n (scale < 1 ?\n 'scale(' + scale + ')' : ''\n ) +\n (rotate ?\n 'rotate(' + rotate +\n (noCenter ? '' : ' ' + textX + ' ' + textY) +\n ')' : ''\n )\n );\n};\n\nlib.ensureUniformFontSize = function(gd, baseFont) {\n var out = lib.extendFlat({}, baseFont);\n out.size = Math.max(\n baseFont.size,\n gd._fullLayout.uniformtext.minsize || 0\n );\n return out;\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/lib/index.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/lib/is_plain_object.js": /*!***********************************************************!*\ !*** ./node_modules/plotly.js/src/lib/is_plain_object.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\n\n// more info: http://stackoverflow.com/questions/18531624/isplainobject-thing\nmodule.exports = function isPlainObject(obj) {\n // We need to be a little less strict in the `imagetest` container because\n // of how async image requests are handled.\n //\n // N.B. isPlainObject(new Constructor()) will return true in `imagetest`\n if(window && window.process && window.process.versions) {\n return Object.prototype.toString.call(obj) === '[object Object]';\n }\n\n return (\n Object.prototype.toString.call(obj) === '[object Object]' &&\n Object.getPrototypeOf(obj) === Object.prototype\n );\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/lib/is_plain_object.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/lib/keyed_container.js": /*!***********************************************************!*\ !*** ./node_modules/plotly.js/src/lib/keyed_container.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\nvar nestedProperty = __webpack_require__(/*! ./nested_property */ \"./node_modules/plotly.js/src/lib/nested_property.js\");\n\nvar SIMPLE_PROPERTY_REGEX = /^\\w*$/;\n\n// bitmask for deciding what's updated. Sometimes the name needs to be updated,\n// sometimes the value needs to be updated, and sometimes both do. This is just\n// a simple way to track what's updated such that it's a simple OR operation to\n// assimilate new updates.\n//\n// The only exception is the UNSET bit that tracks when we need to explicitly\n// unset and remove the property. This concrn arises because of the special\n// way in which nestedProperty handles null/undefined. When you specify `null`,\n// it prunes any unused items in the tree. I ran into some issues with it getting\n// null vs undefined confused, so UNSET is just a bit that forces the property\n// update to send `null`, removing the property explicitly rather than setting\n// it to undefined.\nvar NONE = 0;\nvar NAME = 1;\nvar VALUE = 2;\nvar BOTH = 3;\nvar UNSET = 4;\n\nmodule.exports = function keyedContainer(baseObj, path, keyName, valueName) {\n keyName = keyName || 'name';\n valueName = valueName || 'value';\n var i, arr, baseProp;\n var changeTypes = {};\n\n if(path && path.length) {\n baseProp = nestedProperty(baseObj, path);\n arr = baseProp.get();\n } else {\n arr = baseObj;\n }\n\n path = path || '';\n\n // Construct an index:\n var indexLookup = {};\n if(arr) {\n for(i = 0; i < arr.length; i++) {\n indexLookup[arr[i][keyName]] = i;\n }\n }\n\n var isSimpleValueProp = SIMPLE_PROPERTY_REGEX.test(valueName);\n\n var obj = {\n set: function(name, value) {\n var changeType = value === null ? UNSET : NONE;\n\n // create the base array if necessary\n if(!arr) {\n if(!baseProp || changeType === UNSET) return;\n\n arr = [];\n baseProp.set(arr);\n }\n\n var idx = indexLookup[name];\n if(idx === undefined) {\n if(changeType === UNSET) return;\n\n changeType = changeType | BOTH;\n idx = arr.length;\n indexLookup[name] = idx;\n } else if(value !== (isSimpleValueProp ? arr[idx][valueName] : nestedProperty(arr[idx], valueName).get())) {\n changeType = changeType | VALUE;\n }\n\n var newValue = arr[idx] = arr[idx] || {};\n newValue[keyName] = name;\n\n if(isSimpleValueProp) {\n newValue[valueName] = value;\n } else {\n nestedProperty(newValue, valueName).set(value);\n }\n\n // If it's not an unset, force that bit to be unset. This is all related to the fact\n // that undefined and null are a bit specially implemented in nestedProperties.\n if(value !== null) {\n changeType = changeType & ~UNSET;\n }\n\n changeTypes[idx] = changeTypes[idx] | changeType;\n\n return obj;\n },\n get: function(name) {\n if(!arr) return;\n\n var idx = indexLookup[name];\n\n if(idx === undefined) {\n return undefined;\n } else if(isSimpleValueProp) {\n return arr[idx][valueName];\n } else {\n return nestedProperty(arr[idx], valueName).get();\n }\n },\n rename: function(name, newName) {\n var idx = indexLookup[name];\n\n if(idx === undefined) return obj;\n changeTypes[idx] = changeTypes[idx] | NAME;\n\n indexLookup[newName] = idx;\n delete indexLookup[name];\n\n arr[idx][keyName] = newName;\n\n return obj;\n },\n remove: function(name) {\n var idx = indexLookup[name];\n\n if(idx === undefined) return obj;\n\n var object = arr[idx];\n if(Object.keys(object).length > 2) {\n // This object contains more than just the key/value, so unset\n // the value without modifying the entry otherwise:\n changeTypes[idx] = changeTypes[idx] | VALUE;\n return obj.set(name, null);\n }\n\n if(isSimpleValueProp) {\n for(i = idx; i < arr.length; i++) {\n changeTypes[i] = changeTypes[i] | BOTH;\n }\n for(i = idx; i < arr.length; i++) {\n indexLookup[arr[i][keyName]]--;\n }\n arr.splice(idx, 1);\n delete(indexLookup[name]);\n } else {\n // Perform this update *strictly* so we can check whether the result's\n // been pruned. If so, it's a removal. If not, it's a value unset only.\n nestedProperty(object, valueName).set(null);\n\n // Now check if the top level nested property has any keys left. If so,\n // the object still has values so we only want to unset the key. If not,\n // the entire object can be removed since there's no other data.\n // var topLevelKeys = Object.keys(object[valueName.split('.')[0]] || []);\n\n changeTypes[idx] = changeTypes[idx] | VALUE | UNSET;\n }\n\n return obj;\n },\n constructUpdate: function() {\n var astr, idx;\n var update = {};\n var changed = Object.keys(changeTypes);\n for(var i = 0; i < changed.length; i++) {\n idx = changed[i];\n astr = path + '[' + idx + ']';\n if(arr[idx]) {\n if(changeTypes[idx] & NAME) {\n update[astr + '.' + keyName] = arr[idx][keyName];\n }\n if(changeTypes[idx] & VALUE) {\n if(isSimpleValueProp) {\n update[astr + '.' + valueName] = (changeTypes[idx] & UNSET) ? null : arr[idx][valueName];\n } else {\n update[astr + '.' + valueName] = (changeTypes[idx] & UNSET) ? null : nestedProperty(arr[idx], valueName).get();\n }\n }\n } else {\n update[astr] = null;\n }\n }\n\n return update;\n }\n };\n\n return obj;\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/lib/keyed_container.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/lib/localize.js": /*!****************************************************!*\ !*** ./node_modules/plotly.js/src/lib/localize.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\n\nvar Registry = __webpack_require__(/*! ../registry */ \"./node_modules/plotly.js/src/registry.js\");\n\n/**\n * localize: translate a string for the current locale\n *\n * @param {object} gd: the graphDiv for context\n * gd._context.locale determines the language (& optional region/country)\n * the dictionary for each locale may either be supplied in\n * gd._context.locales or globally via Plotly.register\n * @param {string} s: the string to translate\n */\nmodule.exports = function localize(gd, s) {\n var locale = gd._context.locale;\n\n /*\n * Priority of lookup:\n * contextDicts[locale],\n * registeredDicts[locale],\n * contextDicts[baseLocale], (if baseLocale is distinct)\n * registeredDicts[baseLocale]\n * Return the first translation we find.\n * This way if you have a regionalization you are allowed to specify\n * only what's different from the base locale, everything else will\n * fall back on the base.\n */\n for(var i = 0; i < 2; i++) {\n var locales = gd._context.locales;\n for(var j = 0; j < 2; j++) {\n var dict = (locales[locale] || {}).dictionary;\n if(dict) {\n var out = dict[s];\n if(out) return out;\n }\n locales = Registry.localeRegistry;\n }\n\n var baseLocale = locale.split('-')[0];\n if(baseLocale === locale) break;\n locale = baseLocale;\n }\n\n return s;\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/lib/localize.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/lib/loggers.js": /*!***************************************************!*\ !*** ./node_modules/plotly.js/src/lib/loggers.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\n/* eslint-disable no-console */\n\nvar dfltConfig = __webpack_require__(/*! ../plot_api/plot_config */ \"./node_modules/plotly.js/src/plot_api/plot_config.js\").dfltConfig;\n\nvar notifier = __webpack_require__(/*! ./notifier */ \"./node_modules/plotly.js/src/lib/notifier.js\");\n\nvar loggers = module.exports = {};\n\n/**\n * ------------------------------------------\n * debugging tools\n * ------------------------------------------\n */\n\nloggers.log = function() {\n var i;\n\n if(dfltConfig.logging > 1) {\n var messages = ['LOG:'];\n for(i = 0; i < arguments.length; i++) {\n messages.push(arguments[i]);\n }\n apply(console.trace || console.log, messages);\n }\n\n if(dfltConfig.notifyOnLogging > 1) {\n var lines = [];\n for(i = 0; i < arguments.length; i++) {\n lines.push(arguments[i]);\n }\n notifier(lines.join('
'), 'long');\n }\n};\n\nloggers.warn = function() {\n var i;\n\n if(dfltConfig.logging > 0) {\n var messages = ['WARN:'];\n for(i = 0; i < arguments.length; i++) {\n messages.push(arguments[i]);\n }\n apply(console.trace || console.log, messages);\n }\n\n if(dfltConfig.notifyOnLogging > 0) {\n var lines = [];\n for(i = 0; i < arguments.length; i++) {\n lines.push(arguments[i]);\n }\n notifier(lines.join('
'), 'stick');\n }\n};\n\nloggers.error = function() {\n var i;\n\n if(dfltConfig.logging > 0) {\n var messages = ['ERROR:'];\n for(i = 0; i < arguments.length; i++) {\n messages.push(arguments[i]);\n }\n apply(console.error, messages);\n }\n\n if(dfltConfig.notifyOnLogging > 0) {\n var lines = [];\n for(i = 0; i < arguments.length; i++) {\n lines.push(arguments[i]);\n }\n notifier(lines.join('
'), 'stick');\n }\n};\n\n/*\n * Robust apply, for IE9 where console.log doesn't support\n * apply like other functions do\n */\nfunction apply(f, args) {\n if(f && f.apply) {\n try {\n // `this` should always be console, since here we're always\n // applying a method of the console object.\n f.apply(console, args);\n return;\n } catch(e) { /* in case apply failed, fall back on the code below */ }\n }\n\n // no apply - just try calling the function on each arg independently\n for(var i = 0; i < args.length; i++) {\n try {\n f(args[i]);\n } catch(e) {\n // still fails - last resort simple console.log\n console.log(args[i]);\n }\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/lib/loggers.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/lib/make_trace_groups.js": /*!*************************************************************!*\ !*** ./node_modules/plotly.js/src/lib/make_trace_groups.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\nvar d3 = __webpack_require__(/*! d3 */ \"./node_modules/d3/d3.js\");\n\n/**\n * General helper to manage trace groups based on calcdata\n *\n * @param {d3.selection} traceLayer: a selection containing a single group\n * to draw these traces into\n * @param {array} cdModule: array of calcdata items for this\n * module and subplot combination. Assumes the calcdata item for each\n * trace is an array with the fullData trace attached to the first item.\n * @param {string} cls: the class attribute to give each trace group\n * so you can give multiple classes separated by spaces\n */\nmodule.exports = function makeTraceGroups(traceLayer, cdModule, cls) {\n var traces = traceLayer.selectAll('g.' + cls.replace(/\\s/g, '.'))\n .data(cdModule, function(cd) { return cd[0].trace.uid; });\n\n traces.exit().remove();\n\n traces.enter().append('g')\n .attr('class', cls);\n\n traces.order();\n\n // stash ref node to trace group in calcdata,\n // useful for (fast) styleOnSelect\n var k = traceLayer.classed('rangeplot') ? 'nodeRangePlot3' : 'node3';\n traces.each(function(cd) { cd[0][k] = d3.select(this); });\n\n return traces;\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/lib/make_trace_groups.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/lib/matrix.js": /*!**************************************************!*\ !*** ./node_modules/plotly.js/src/lib/matrix.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\n\n\nexports.init2dArray = function(rowLength, colLength) {\n var array = new Array(rowLength);\n for(var i = 0; i < rowLength; i++) array[i] = new Array(colLength);\n return array;\n};\n\n/**\n * transpose a (possibly ragged) 2d array z. inspired by\n * http://stackoverflow.com/questions/17428587/\n * transposing-a-2d-array-in-javascript\n */\nexports.transposeRagged = function(z) {\n var maxlen = 0;\n var zlen = z.length;\n var i, j;\n // Maximum row length:\n for(i = 0; i < zlen; i++) maxlen = Math.max(maxlen, z[i].length);\n\n var t = new Array(maxlen);\n for(i = 0; i < maxlen; i++) {\n t[i] = new Array(zlen);\n for(j = 0; j < zlen; j++) t[i][j] = z[j][i];\n }\n\n return t;\n};\n\n// our own dot function so that we don't need to include numeric\nexports.dot = function(x, y) {\n if(!(x.length && y.length) || x.length !== y.length) return null;\n\n var len = x.length;\n var out;\n var i;\n\n if(x[0].length) {\n // mat-vec or mat-mat\n out = new Array(len);\n for(i = 0; i < len; i++) out[i] = exports.dot(x[i], y);\n } else if(y[0].length) {\n // vec-mat\n var yTranspose = exports.transposeRagged(y);\n out = new Array(yTranspose.length);\n for(i = 0; i < yTranspose.length; i++) out[i] = exports.dot(x, yTranspose[i]);\n } else {\n // vec-vec\n out = 0;\n for(i = 0; i < len; i++) out += x[i] * y[i];\n }\n\n return out;\n};\n\n// translate by (x,y)\nexports.translationMatrix = function(x, y) {\n return [[1, 0, x], [0, 1, y], [0, 0, 1]];\n};\n\n// rotate by alpha around (0,0)\nexports.rotationMatrix = function(alpha) {\n var a = alpha * Math.PI / 180;\n return [[Math.cos(a), -Math.sin(a), 0],\n [Math.sin(a), Math.cos(a), 0],\n [0, 0, 1]];\n};\n\n// rotate by alpha around (x,y)\nexports.rotationXYMatrix = function(a, x, y) {\n return exports.dot(\n exports.dot(exports.translationMatrix(x, y),\n exports.rotationMatrix(a)),\n exports.translationMatrix(-x, -y));\n};\n\n// applies a 2D transformation matrix to either x and y params or an [x,y] array\nexports.apply2DTransform = function(transform) {\n return function() {\n var args = arguments;\n if(args.length === 3) {\n args = args[0];\n }// from map\n var xy = arguments.length === 1 ? args[0] : [args[0], args[1]];\n return exports.dot(transform, [xy[0], xy[1], 1]).slice(0, 2);\n };\n};\n\n// applies a 2D transformation matrix to an [x1,y1,x2,y2] array (to transform a segment)\nexports.apply2DTransform2 = function(transform) {\n var at = exports.apply2DTransform(transform);\n return function(xys) {\n return at(xys.slice(0, 2)).concat(at(xys.slice(2, 4)));\n };\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/lib/matrix.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/lib/mod.js": /*!***********************************************!*\ !*** ./node_modules/plotly.js/src/lib/mod.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\n/**\n * sanitized modulus function that always returns in the range [0, d)\n * rather than (-d, 0] if v is negative\n */\nfunction mod(v, d) {\n var out = v % d;\n return out < 0 ? out + d : out;\n}\n\n/**\n * sanitized modulus function that always returns in the range [-d/2, d/2]\n * rather than (-d, 0] if v is negative\n */\nfunction modHalf(v, d) {\n return Math.abs(v) > (d / 2) ?\n v - Math.round(v / d) * d :\n v;\n}\n\nmodule.exports = {\n mod: mod,\n modHalf: modHalf\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/lib/mod.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/lib/nested_property.js": /*!***********************************************************!*\ !*** ./node_modules/plotly.js/src/lib/nested_property.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\n\nvar isNumeric = __webpack_require__(/*! fast-isnumeric */ \"./node_modules/fast-isnumeric/index.js\");\nvar isArrayOrTypedArray = __webpack_require__(/*! ./array */ \"./node_modules/plotly.js/src/lib/array.js\").isArrayOrTypedArray;\n\n/**\n * convert a string s (such as 'xaxis.range[0]')\n * representing a property of nested object into set and get methods\n * also return the string and object so we don't have to keep track of them\n * allows [-1] for an array index, to set a property inside all elements\n * of an array\n * eg if obj = {arr: [{a: 1}, {a: 2}]}\n * you can do p = nestedProperty(obj, 'arr[-1].a')\n * but you cannot set the array itself this way, to do that\n * just set the whole array.\n * eg if obj = {arr: [1, 2, 3]}\n * you can't do nestedProperty(obj, 'arr[-1]').set(5)\n * but you can do nestedProperty(obj, 'arr').set([5, 5, 5])\n */\nmodule.exports = function nestedProperty(container, propStr) {\n if(isNumeric(propStr)) propStr = String(propStr);\n else if(typeof propStr !== 'string' ||\n propStr.substr(propStr.length - 4) === '[-1]') {\n throw 'bad property string';\n }\n\n var j = 0;\n var propParts = propStr.split('.');\n var indexed;\n var indices;\n var i;\n\n // check for parts of the nesting hierarchy that are numbers (ie array elements)\n while(j < propParts.length) {\n // look for non-bracket chars, then any number of [##] blocks\n indexed = String(propParts[j]).match(/^([^\\[\\]]*)((\\[\\-?[0-9]*\\])+)$/);\n if(indexed) {\n if(indexed[1]) propParts[j] = indexed[1];\n // allow propStr to start with bracketed array indices\n else if(j === 0) propParts.splice(0, 1);\n else throw 'bad property string';\n\n indices = indexed[2]\n .substr(1, indexed[2].length - 2)\n .split('][');\n\n for(i = 0; i < indices.length; i++) {\n j++;\n propParts.splice(j, 0, Number(indices[i]));\n }\n }\n j++;\n }\n\n if(typeof container !== 'object') {\n return badContainer(container, propStr, propParts);\n }\n\n return {\n set: npSet(container, propParts, propStr),\n get: npGet(container, propParts),\n astr: propStr,\n parts: propParts,\n obj: container\n };\n};\n\nfunction npGet(cont, parts) {\n return function() {\n var curCont = cont;\n var curPart;\n var allSame;\n var out;\n var i;\n var j;\n\n for(i = 0; i < parts.length - 1; i++) {\n curPart = parts[i];\n if(curPart === -1) {\n allSame = true;\n out = [];\n for(j = 0; j < curCont.length; j++) {\n out[j] = npGet(curCont[j], parts.slice(i + 1))();\n if(out[j] !== out[0]) allSame = false;\n }\n return allSame ? out[0] : out;\n }\n if(typeof curPart === 'number' && !isArrayOrTypedArray(curCont)) {\n return undefined;\n }\n curCont = curCont[curPart];\n if(typeof curCont !== 'object' || curCont === null) {\n return undefined;\n }\n }\n\n // only hit this if parts.length === 1\n if(typeof curCont !== 'object' || curCont === null) return undefined;\n\n out = curCont[parts[i]];\n if(out === null) return undefined;\n return out;\n };\n}\n\n/*\n * Can this value be deleted? We can delete `undefined`, and `null` except INSIDE an\n * *args* array.\n *\n * Previously we also deleted some `{}` and `[]`, in order to try and make set/unset\n * a net noop; but this causes far more complication than it's worth, and still had\n * lots of exceptions. See https://github.com/plotly/plotly.js/issues/1410\n *\n * *args* arrays get passed directly to API methods and we should respect null if\n * the user put it there, but otherwise null is deleted as we use it as code\n * in restyle/relayout/update for \"delete this value\" whereas undefined means\n * \"ignore this edit\"\n */\nvar ARGS_PATTERN = /(^|\\.)args\\[/;\nfunction isDeletable(val, propStr) {\n return (val === undefined) || (val === null && !propStr.match(ARGS_PATTERN));\n}\n\nfunction npSet(cont, parts, propStr) {\n return function(val) {\n var curCont = cont;\n var propPart = '';\n var containerLevels = [[cont, propPart]];\n var toDelete = isDeletable(val, propStr);\n var curPart;\n var i;\n\n for(i = 0; i < parts.length - 1; i++) {\n curPart = parts[i];\n\n if(typeof curPart === 'number' && !isArrayOrTypedArray(curCont)) {\n throw 'array index but container is not an array';\n }\n\n // handle special -1 array index\n if(curPart === -1) {\n toDelete = !setArrayAll(curCont, parts.slice(i + 1), val, propStr);\n if(toDelete) break;\n else return;\n }\n\n if(!checkNewContainer(curCont, curPart, parts[i + 1], toDelete)) {\n break;\n }\n\n curCont = curCont[curPart];\n\n if(typeof curCont !== 'object' || curCont === null) {\n throw 'container is not an object';\n }\n\n propPart = joinPropStr(propPart, curPart);\n\n containerLevels.push([curCont, propPart]);\n }\n\n if(toDelete) {\n if(i === parts.length - 1) {\n delete curCont[parts[i]];\n\n // The one bit of pruning we still do: drop `undefined` from the end of arrays.\n // In case someone has already unset previous items, continue until we hit a\n // non-undefined value.\n if(Array.isArray(curCont) && +parts[i] === curCont.length - 1) {\n while(curCont.length && curCont[curCont.length - 1] === undefined) {\n curCont.pop();\n }\n }\n }\n } else curCont[parts[i]] = val;\n };\n}\n\nfunction joinPropStr(propStr, newPart) {\n var toAdd = newPart;\n if(isNumeric(newPart)) toAdd = '[' + newPart + ']';\n else if(propStr) toAdd = '.' + newPart;\n\n return propStr + toAdd;\n}\n\n// handle special -1 array index\nfunction setArrayAll(containerArray, innerParts, val, propStr) {\n var arrayVal = isArrayOrTypedArray(val);\n var allSet = true;\n var thisVal = val;\n var thisPropStr = propStr.replace('-1', 0);\n var deleteThis = arrayVal ? false : isDeletable(val, thisPropStr);\n var firstPart = innerParts[0];\n var i;\n\n for(i = 0; i < containerArray.length; i++) {\n thisPropStr = propStr.replace('-1', i);\n if(arrayVal) {\n thisVal = val[i % val.length];\n deleteThis = isDeletable(thisVal, thisPropStr);\n }\n if(deleteThis) allSet = false;\n if(!checkNewContainer(containerArray, i, firstPart, deleteThis)) {\n continue;\n }\n npSet(containerArray[i], innerParts, propStr.replace('-1', i))(thisVal);\n }\n return allSet;\n}\n\n/**\n * make new sub-container as needed.\n * returns false if there's no container and none is needed\n * because we're only deleting an attribute\n */\nfunction checkNewContainer(container, part, nextPart, toDelete) {\n if(container[part] === undefined) {\n if(toDelete) return false;\n\n if(typeof nextPart === 'number') container[part] = [];\n else container[part] = {};\n }\n return true;\n}\n\nfunction badContainer(container, propStr, propParts) {\n return {\n set: function() { throw 'bad container'; },\n get: function() {},\n astr: propStr,\n parts: propParts,\n obj: container\n };\n}\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/lib/nested_property.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/lib/noop.js": /*!************************************************!*\ !*** ./node_modules/plotly.js/src/lib/noop.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\n// Simple helper functions\n// none of these need any external deps\n\nmodule.exports = function noop() {};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/lib/noop.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/lib/notifier.js": /*!****************************************************!*\ !*** ./node_modules/plotly.js/src/lib/notifier.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\n\nvar d3 = __webpack_require__(/*! d3 */ \"./node_modules/d3/d3.js\");\nvar isNumeric = __webpack_require__(/*! fast-isnumeric */ \"./node_modules/fast-isnumeric/index.js\");\n\nvar NOTEDATA = [];\n\n/**\n * notifier\n * @param {String} text The person's user name\n * @param {Number} [delay=1000] The delay time in milliseconds\n * or 'long' which provides 2000 ms delay time.\n * @return {undefined} this function does not return a value\n */\nmodule.exports = function(text, displayLength) {\n if(NOTEDATA.indexOf(text) !== -1) return;\n\n NOTEDATA.push(text);\n\n var ts = 1000;\n if(isNumeric(displayLength)) ts = displayLength;\n else if(displayLength === 'long') ts = 3000;\n\n var notifierContainer = d3.select('body')\n .selectAll('.plotly-notifier')\n .data([0]);\n notifierContainer.enter()\n .append('div')\n .classed('plotly-notifier', true);\n\n var notes = notifierContainer.selectAll('.notifier-note').data(NOTEDATA);\n\n function killNote(transition) {\n transition\n .duration(700)\n .style('opacity', 0)\n .each('end', function(thisText) {\n var thisIndex = NOTEDATA.indexOf(thisText);\n if(thisIndex !== -1) NOTEDATA.splice(thisIndex, 1);\n d3.select(this).remove();\n });\n }\n\n notes.enter().append('div')\n .classed('notifier-note', true)\n .style('opacity', 0)\n .each(function(thisText) {\n var note = d3.select(this);\n\n note.append('button')\n .classed('notifier-close', true)\n .html('×')\n .on('click', function() {\n note.transition().call(killNote);\n });\n\n var p = note.append('p');\n var lines = thisText.split(//g);\n for(var i = 0; i < lines.length; i++) {\n if(i) p.append('br');\n p.append('span').text(lines[i]);\n }\n\n if(displayLength === 'stick') {\n note.transition()\n .duration(350)\n .style('opacity', 1);\n } else {\n note.transition()\n .duration(700)\n .style('opacity', 1)\n .transition()\n .delay(ts)\n .call(killNote);\n }\n });\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/lib/notifier.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/lib/push_unique.js": /*!*******************************************************!*\ !*** ./node_modules/plotly.js/src/lib/push_unique.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\n/**\n * Push array with unique items\n *\n * Ignores falsy items, except 0 so we can use it to construct arrays of indices.\n *\n * @param {array} array\n * array to be filled\n * @param {any} item\n * item to be or not to be inserted\n * @return {array}\n * ref to array (now possibly containing one more item)\n *\n */\nmodule.exports = function pushUnique(array, item) {\n if(item instanceof RegExp) {\n var itemStr = item.toString();\n for(var i = 0; i < array.length; i++) {\n if(array[i] instanceof RegExp && array[i].toString() === itemStr) {\n return array;\n }\n }\n array.push(item);\n } else if((item || item === 0) && array.indexOf(item) === -1) array.push(item);\n\n return array;\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/lib/push_unique.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/lib/regex.js": /*!*************************************************!*\ !*** ./node_modules/plotly.js/src/lib/regex.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\n/*\n * make a regex for matching counter ids/names ie xaxis, xaxis2, xaxis10...\n *\n * @param {string} head: the head of the pattern, eg 'x' matches 'x', 'x2', 'x10' etc.\n * 'xy' is a special case for cartesian subplots: it matches 'x2y3' etc\n * @param {Optional(string)} tail: a fixed piece after the id\n * eg counterRegex('scene', '.annotations') for scene2.annotations etc.\n * @param {boolean} openEnded: if true, the string may continue past the match.\n * @param {boolean} matchBeginning: if false, the string may start before the match.\n */\nexports.counter = function(head, tail, openEnded, matchBeginning) {\n var fullTail = (tail || '') + (openEnded ? '' : '$');\n var startWithPrefix = matchBeginning === false ? '' : '^';\n if(head === 'xy') {\n return new RegExp(startWithPrefix + 'x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?' + fullTail);\n }\n return new RegExp(startWithPrefix + head + '([2-9]|[1-9][0-9]+)?' + fullTail);\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/lib/regex.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/lib/relative_attr.js": /*!*********************************************************!*\ !*** ./node_modules/plotly.js/src/lib/relative_attr.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\n\n// ASCEND: chop off the last nesting level - either [] or . - to ascend\n// the attribute tree. the remaining attrString is in match[1]\nvar ASCEND = /^(.*)(\\.[^\\.\\[\\]]+|\\[\\d\\])$/;\n\n// SIMPLEATTR: is this an un-nested attribute? (no dots or brackets)\nvar SIMPLEATTR = /^[^\\.\\[\\]]+$/;\n\n/*\n * calculate a relative attribute string, similar to a relative path\n *\n * @param {string} baseAttr:\n * an attribute string, such as 'annotations[3].x'. The \"current location\"\n * is the attribute string minus the last component ('annotations[3]')\n * @param {string} relativeAttr:\n * a route to the desired attribute string, using '^' to ascend\n *\n * @return {string} attrString:\n * for example:\n * relativeAttr('annotations[3].x', 'y') = 'annotations[3].y'\n * relativeAttr('annotations[3].x', '^[2].z') = 'annotations[2].z'\n * relativeAttr('annotations[3].x', '^^margin') = 'margin'\n * relativeAttr('annotations[3].x', '^^margin.r') = 'margin.r'\n */\nmodule.exports = function(baseAttr, relativeAttr) {\n while(relativeAttr) {\n var match = baseAttr.match(ASCEND);\n\n if(match) baseAttr = match[1];\n else if(baseAttr.match(SIMPLEATTR)) baseAttr = '';\n else throw new Error('bad relativeAttr call:' + [baseAttr, relativeAttr]);\n\n if(relativeAttr.charAt(0) === '^') relativeAttr = relativeAttr.slice(1);\n else break;\n }\n\n if(baseAttr && relativeAttr.charAt(0) !== '[') {\n return baseAttr + '.' + relativeAttr;\n }\n return baseAttr + relativeAttr;\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/lib/relative_attr.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/lib/relink_private.js": /*!**********************************************************!*\ !*** ./node_modules/plotly.js/src/lib/relink_private.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\n\nvar isArrayOrTypedArray = __webpack_require__(/*! ./array */ \"./node_modules/plotly.js/src/lib/array.js\").isArrayOrTypedArray;\nvar isPlainObject = __webpack_require__(/*! ./is_plain_object */ \"./node_modules/plotly.js/src/lib/is_plain_object.js\");\n\n/**\n * Relink private _keys and keys with a function value from one container\n * to the new container.\n * Relink means copying if object is pass-by-value and adding a reference\n * if object is pass-by-ref.\n * This prevents deepCopying massive structures like a webgl context.\n */\nmodule.exports = function relinkPrivateKeys(toContainer, fromContainer) {\n for(var k in fromContainer) {\n var fromVal = fromContainer[k];\n var toVal = toContainer[k];\n\n if(toVal === fromVal) continue;\n\n if(k.charAt(0) === '_' || typeof fromVal === 'function') {\n // if it already exists at this point, it's something\n // that we recreate each time around, so ignore it\n if(k in toContainer) continue;\n\n toContainer[k] = fromVal;\n } else if(isArrayOrTypedArray(fromVal) && isArrayOrTypedArray(toVal) && isPlainObject(fromVal[0])) {\n // filter out data_array items that can contain user objects\n // most of the time the toVal === fromVal check will catch these early\n // but if the user makes new ones we also don't want to recurse in.\n if(k === 'customdata' || k === 'ids') continue;\n\n // recurse into arrays containers\n var minLen = Math.min(fromVal.length, toVal.length);\n for(var j = 0; j < minLen; j++) {\n if((toVal[j] !== fromVal[j]) && isPlainObject(fromVal[j]) && isPlainObject(toVal[j])) {\n relinkPrivateKeys(toVal[j], fromVal[j]);\n }\n }\n } else if(isPlainObject(fromVal) && isPlainObject(toVal)) {\n // recurse into objects, but only if they still exist\n relinkPrivateKeys(toVal, fromVal);\n\n if(!Object.keys(toVal).length) delete toContainer[k];\n }\n }\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/lib/relink_private.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/lib/search.js": /*!**************************************************!*\ !*** ./node_modules/plotly.js/src/lib/search.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\n\nvar isNumeric = __webpack_require__(/*! fast-isnumeric */ \"./node_modules/fast-isnumeric/index.js\");\nvar loggers = __webpack_require__(/*! ./loggers */ \"./node_modules/plotly.js/src/lib/loggers.js\");\nvar identity = __webpack_require__(/*! ./identity */ \"./node_modules/plotly.js/src/lib/identity.js\");\nvar BADNUM = __webpack_require__(/*! ../constants/numerical */ \"./node_modules/plotly.js/src/constants/numerical.js\").BADNUM;\n\n// don't trust floating point equality - fraction of bin size to call\n// \"on the line\" and ensure that they go the right way specified by\n// linelow\nvar roundingError = 1e-9;\n\n\n/**\n * findBin - find the bin for val - note that it can return outside the\n * bin range any pos. or neg. integer for linear bins, or -1 or\n * bins.length-1 for explicit.\n * bins is either an object {start,size,end} or an array length #bins+1\n * bins can be either increasing or decreasing but must be monotonic\n * for linear bins, we can just calculate. For listed bins, run a binary\n * search linelow (truthy) says the bin boundary should be attributed to\n * the lower bin rather than the default upper bin\n */\nexports.findBin = function(val, bins, linelow) {\n if(isNumeric(bins.start)) {\n return linelow ?\n Math.ceil((val - bins.start) / bins.size - roundingError) - 1 :\n Math.floor((val - bins.start) / bins.size + roundingError);\n } else {\n var n1 = 0;\n var n2 = bins.length;\n var c = 0;\n var binSize = (n2 > 1) ? (bins[n2 - 1] - bins[0]) / (n2 - 1) : 1;\n var n, test;\n if(binSize >= 0) {\n test = linelow ? lessThan : lessOrEqual;\n } else {\n test = linelow ? greaterOrEqual : greaterThan;\n }\n val += binSize * roundingError * (linelow ? -1 : 1) * (binSize >= 0 ? 1 : -1);\n // c is just to avoid infinite loops if there's an error\n while(n1 < n2 && c++ < 100) {\n n = Math.floor((n1 + n2) / 2);\n if(test(bins[n], val)) n1 = n + 1;\n else n2 = n;\n }\n if(c > 90) loggers.log('Long binary search...');\n return n1 - 1;\n }\n};\n\nfunction lessThan(a, b) { return a < b; }\nfunction lessOrEqual(a, b) { return a <= b; }\nfunction greaterThan(a, b) { return a > b; }\nfunction greaterOrEqual(a, b) { return a >= b; }\n\nexports.sorterAsc = function(a, b) { return a - b; };\nexports.sorterDes = function(a, b) { return b - a; };\n\n/**\n * find distinct values in an array, lumping together ones that appear to\n * just be off by a rounding error\n * return the distinct values and the minimum difference between any two\n */\nexports.distinctVals = function(valsIn) {\n var vals = valsIn.slice(); // otherwise we sort the original array...\n vals.sort(exports.sorterAsc); // undefined listed in the end - also works on IE11\n\n var last;\n for(last = vals.length - 1; last > -1; last--) {\n if(vals[last] !== BADNUM) break;\n }\n\n var minDiff = (vals[last] - vals[0]) || 1;\n var errDiff = minDiff / (last || 1) / 10000;\n var newVals = [];\n var preV;\n for(var i = 0; i <= last; i++) {\n var v = vals[i];\n\n // make sure values aren't just off by a rounding error\n var diff = v - preV;\n\n if(preV === undefined) {\n newVals.push(v);\n preV = v;\n } else if(diff > errDiff) {\n minDiff = Math.min(minDiff, diff);\n\n newVals.push(v);\n preV = v;\n }\n }\n\n return {vals: newVals, minDiff: minDiff};\n};\n\n/**\n * return the smallest element from (sorted) array arrayIn that's bigger than val,\n * or (reverse) the largest element smaller than val\n * used to find the best tick given the minimum (non-rounded) tick\n * particularly useful for date/time where things are not powers of 10\n * binary search is probably overkill here...\n */\nexports.roundUp = function(val, arrayIn, reverse) {\n var low = 0;\n var high = arrayIn.length - 1;\n var mid;\n var c = 0;\n var dlow = reverse ? 0 : 1;\n var dhigh = reverse ? 1 : 0;\n var rounded = reverse ? Math.ceil : Math.floor;\n // c is just to avoid infinite loops if there's an error\n while(low < high && c++ < 100) {\n mid = rounded((low + high) / 2);\n if(arrayIn[mid] <= val) low = mid + dlow;\n else high = mid - dhigh;\n }\n return arrayIn[low];\n};\n\n/**\n * Tweak to Array.sort(sortFn) that improves performance for pre-sorted arrays\n *\n * Note that newer browsers (such as Chrome v70+) are starting to pick up\n * on pre-sorted arrays which may render the following optimization unnecessary\n * in the future.\n *\n * Motivation: sometimes we need to sort arrays but the input is likely to\n * already be sorted. Browsers don't seem to pick up on pre-sorted arrays,\n * and in fact Chrome is actually *slower* sorting pre-sorted arrays than purely\n * random arrays. FF is at least faster if the array is pre-sorted, but still\n * not as fast as it could be.\n * Here's how this plays out sorting a length-1e6 array:\n *\n * Calls to Sort FN | Chrome bare | FF bare | Chrome tweak | FF tweak\n * | v68.0 Mac | v61.0 Mac| |\n * ------------------+---------------+-----------+----------------+------------\n * ordered | 30.4e6 | 10.1e6 | 1e6 | 1e6\n * reversed | 29.4e6 | 9.9e6 | 1e6 + reverse | 1e6 + reverse\n * random | ~21e6 | ~18.7e6 | ~21e6 | ~18.7e6\n *\n * So this is a substantial win for pre-sorted (ordered or exactly reversed)\n * arrays. Including this wrapper on an unsorted array adds a penalty that will\n * in general be only a few calls to the sort function. The only case this\n * penalty will be significant is if the array is mostly sorted but there are\n * a few unsorted items near the end, but the penalty is still at most N calls\n * out of (for N=1e6) ~20N total calls\n *\n * @param {Array} array: the array, to be sorted in place\n * @param {function} sortFn: As in Array.sort, function(a, b) that puts\n * item a before item b if the return is negative, a after b if positive,\n * and no change if zero.\n * @return {Array}: the original array, sorted in place.\n */\nexports.sort = function(array, sortFn) {\n var notOrdered = 0;\n var notReversed = 0;\n for(var i = 1; i < array.length; i++) {\n var pairOrder = sortFn(array[i], array[i - 1]);\n if(pairOrder < 0) notOrdered = 1;\n else if(pairOrder > 0) notReversed = 1;\n if(notOrdered && notReversed) return array.sort(sortFn);\n }\n return notReversed ? array : array.reverse();\n};\n\n/**\n * find index in array 'arr' that minimizes 'fn'\n *\n * @param {array} arr : array where to search\n * @param {fn (optional)} fn : function to minimize,\n * if not given, fn is the identity function\n * @return {integer}\n */\nexports.findIndexOfMin = function(arr, fn) {\n fn = fn || identity;\n\n var min = Infinity;\n var ind;\n\n for(var i = 0; i < arr.length; i++) {\n var v = fn(arr[i]);\n if(v < min) {\n min = v;\n ind = i;\n }\n }\n return ind;\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/lib/search.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/lib/stats.js": /*!*************************************************!*\ !*** ./node_modules/plotly.js/src/lib/stats.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\n\nvar isNumeric = __webpack_require__(/*! fast-isnumeric */ \"./node_modules/fast-isnumeric/index.js\");\nvar isArrayOrTypedArray = __webpack_require__(/*! ./array */ \"./node_modules/plotly.js/src/lib/array.js\").isArrayOrTypedArray;\n\n/**\n * aggNums() returns the result of an aggregate function applied to an array of\n * values, where non-numerical values have been tossed out.\n *\n * @param {function} f - aggregation function (e.g., Math.min)\n * @param {Number} v - initial value (continuing from previous calls)\n * if there's no continuing value, use null for selector-type\n * functions (max,min), or 0 for summations\n * @param {Array} a - array to aggregate (may be nested, we will recurse,\n * but all elements must have the same dimension)\n * @param {Number} len - maximum length of a to aggregate\n * @return {Number} - result of f applied to a starting from v\n */\nexports.aggNums = function(f, v, a, len) {\n var i,\n b;\n if(!len || len > a.length) len = a.length;\n if(!isNumeric(v)) v = false;\n if(isArrayOrTypedArray(a[0])) {\n b = new Array(len);\n for(i = 0; i < len; i++) b[i] = exports.aggNums(f, v, a[i]);\n a = b;\n }\n\n for(i = 0; i < len; i++) {\n if(!isNumeric(v)) v = a[i];\n else if(isNumeric(a[i])) v = f(+v, +a[i]);\n }\n return v;\n};\n\n/**\n * mean & std dev functions using aggNums, so it handles non-numerics nicely\n * even need to use aggNums instead of .length, to toss out non-numerics\n */\nexports.len = function(data) {\n return exports.aggNums(function(a) { return a + 1; }, 0, data);\n};\n\nexports.mean = function(data, len) {\n if(!len) len = exports.len(data);\n return exports.aggNums(function(a, b) { return a + b; }, 0, data) / len;\n};\n\nexports.midRange = function(numArr) {\n if(numArr === undefined || numArr.length === 0) return undefined;\n return (exports.aggNums(Math.max, null, numArr) + exports.aggNums(Math.min, null, numArr)) / 2;\n};\n\nexports.variance = function(data, len, mean) {\n if(!len) len = exports.len(data);\n if(!isNumeric(mean)) mean = exports.mean(data, len);\n\n return exports.aggNums(function(a, b) {\n return a + Math.pow(b - mean, 2);\n }, 0, data) / len;\n};\n\nexports.stdev = function(data, len, mean) {\n return Math.sqrt(exports.variance(data, len, mean));\n};\n\n/**\n * median of a finite set of numbers\n * reference page: https://en.wikipedia.org/wiki/Median#Finite_set_of_numbers\n**/\nexports.median = function(data) {\n var b = data.slice().sort();\n return exports.interp(b, 0.5);\n};\n\n/**\n * interp() computes a percentile (quantile) for a given distribution.\n * We interpolate the distribution (to compute quantiles, we follow method #10 here:\n * http://www.amstat.org/publications/jse/v14n3/langford.html).\n * Typically the index or rank (n * arr.length) may be non-integer.\n * For reference: ends are clipped to the extreme values in the array;\n * For box plots: index you get is half a point too high (see\n * http://en.wikipedia.org/wiki/Percentile#Nearest_rank) but note that this definition\n * indexes from 1 rather than 0, so we subtract 1/2 (instead of add).\n *\n * @param {Array} arr - This array contains the values that make up the distribution.\n * @param {Number} n - Between 0 and 1, n = p/100 is such that we compute the p^th percentile.\n * For example, the 50th percentile (or median) corresponds to n = 0.5\n * @return {Number} - percentile\n */\nexports.interp = function(arr, n) {\n if(!isNumeric(n)) throw 'n should be a finite number';\n n = n * arr.length - 0.5;\n if(n < 0) return arr[0];\n if(n > arr.length - 1) return arr[arr.length - 1];\n var frac = n % 1;\n return frac * arr[Math.ceil(n)] + (1 - frac) * arr[Math.floor(n)];\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/lib/stats.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/lib/throttle.js": /*!****************************************************!*\ !*** ./node_modules/plotly.js/src/lib/throttle.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\nvar timerCache = {};\n\n/**\n * Throttle a callback. `callback` executes synchronously only if\n * more than `minInterval` milliseconds have already elapsed since the latest\n * call (if any). Otherwise we wait until `minInterval` is over and execute the\n * last callback received while waiting.\n * So the first and last events in a train are always executed (eventually)\n * but some of the events in the middle can be dropped.\n *\n * @param {string} id: an identifier to mark events to throttle together\n * @param {number} minInterval: minimum time, in milliseconds, between\n * invocations of `callback`\n * @param {function} callback: the function to throttle. `callback` itself\n * should be a purely synchronous function.\n */\nexports.throttle = function throttle(id, minInterval, callback) {\n var cache = timerCache[id];\n var now = Date.now();\n\n if(!cache) {\n /*\n * Throw out old items before making a new one, to prevent the cache\n * getting overgrown, for example from old plots that have been replaced.\n * 1 minute age is arbitrary.\n */\n for(var idi in timerCache) {\n if(timerCache[idi].ts < now - 60000) {\n delete timerCache[idi];\n }\n }\n cache = timerCache[id] = {ts: 0, timer: null};\n }\n\n _clearTimeout(cache);\n\n function exec() {\n callback();\n cache.ts = Date.now();\n if(cache.onDone) {\n cache.onDone();\n cache.onDone = null;\n }\n }\n\n if(now > cache.ts + minInterval) {\n exec();\n return;\n }\n\n cache.timer = setTimeout(function() {\n exec();\n cache.timer = null;\n }, minInterval);\n};\n\nexports.done = function(id) {\n var cache = timerCache[id];\n if(!cache || !cache.timer) return Promise.resolve();\n\n return new Promise(function(resolve) {\n var previousOnDone = cache.onDone;\n cache.onDone = function onDone() {\n if(previousOnDone) previousOnDone();\n resolve();\n cache.onDone = null;\n };\n });\n};\n\n/**\n * Clear the throttle cache for one or all timers\n * @param {optional string} id:\n * if provided, clear just this timer\n * if omitted, clear all timers (mainly useful for testing)\n */\nexports.clear = function(id) {\n if(id) {\n _clearTimeout(timerCache[id]);\n delete timerCache[id];\n } else {\n for(var idi in timerCache) exports.clear(idi);\n }\n};\n\nfunction _clearTimeout(cache) {\n if(cache && cache.timer !== null) {\n clearTimeout(cache.timer);\n cache.timer = null;\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/lib/throttle.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/lib/to_log_range.js": /*!********************************************************!*\ !*** ./node_modules/plotly.js/src/lib/to_log_range.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\nvar isNumeric = __webpack_require__(/*! fast-isnumeric */ \"./node_modules/fast-isnumeric/index.js\");\n\n/**\n * convert a linear value into a logged value, folding negative numbers into\n * the given range\n */\nmodule.exports = function toLogRange(val, range) {\n if(val > 0) return Math.log(val) / Math.LN10;\n\n // move a negative value reference to a log axis - just put the\n // result at the lowest range value on the plot (or if the range also went negative,\n // one millionth of the top of the range)\n var newVal = Math.log(Math.min(range[0], range[1])) / Math.LN10;\n if(!isNumeric(newVal)) newVal = Math.log(Math.max(range[0], range[1])) / Math.LN10 - 6;\n return newVal;\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/lib/to_log_range.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/plot_api/plot_config.js": /*!************************************************************!*\ !*** ./node_modules/plotly.js/src/plot_api/plot_config.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\n/**\n * This will be transferred over to gd and overridden by\n * config args to Plotly.plot.\n *\n * The defaults are the appropriate settings for plotly.js,\n * so we get the right experience without any config argument.\n *\n * N.B. the config options are not coerced using Lib.coerce so keys\n * like `valType` and `values` are only set for documentation purposes\n * at the moment.\n */\n\nvar configAttributes = {\n staticPlot: {\n valType: 'boolean',\n dflt: false,\n description: [\n 'Determines whether the graphs are interactive or not.',\n 'If *false*, no interactivity, for export or image generation.'\n ].join(' ')\n },\n\n plotlyServerURL: {\n valType: 'string',\n dflt: '',\n description: [\n 'When set it determines base URL for',\n 'the \\'Edit in Chart Studio\\' `showEditInChartStudio`/`showSendToCloud` mode bar button',\n 'and the showLink/sendData on-graph link.',\n 'To enable sending your data to Chart Studio Cloud, you need to',\n 'set both `plotlyServerURL` to \\'https://chart-studio.plotly.com\\' and',\n 'also set `showSendToCloud` to true.'\n ].join(' ')\n },\n\n editable: {\n valType: 'boolean',\n dflt: false,\n description: [\n 'Determines whether the graph is editable or not.',\n 'Sets all pieces of `edits`',\n 'unless a separate `edits` config item overrides individual parts.'\n ].join(' ')\n },\n edits: {\n annotationPosition: {\n valType: 'boolean',\n dflt: false,\n description: [\n 'Determines if the main anchor of the annotation is editable.',\n 'The main anchor corresponds to the',\n 'text (if no arrow) or the arrow (which drags the whole thing leaving',\n 'the arrow length & direction unchanged).'\n ].join(' ')\n },\n annotationTail: {\n valType: 'boolean',\n dflt: false,\n description: [\n 'Has only an effect for annotations with arrows.',\n 'Enables changing the length and direction of the arrow.'\n ].join(' ')\n },\n annotationText: {\n valType: 'boolean',\n dflt: false,\n description: 'Enables editing annotation text.'\n },\n axisTitleText: {\n valType: 'boolean',\n dflt: false,\n description: 'Enables editing axis title text.'\n },\n colorbarPosition: {\n valType: 'boolean',\n dflt: false,\n description: 'Enables moving colorbars.'\n },\n colorbarTitleText: {\n valType: 'boolean',\n dflt: false,\n description: 'Enables editing colorbar title text.'\n },\n legendPosition: {\n valType: 'boolean',\n dflt: false,\n description: 'Enables moving the legend.'\n },\n legendText: {\n valType: 'boolean',\n dflt: false,\n description: 'Enables editing the trace name fields from the legend'\n },\n shapePosition: {\n valType: 'boolean',\n dflt: false,\n description: 'Enables moving shapes.'\n },\n titleText: {\n valType: 'boolean',\n dflt: false,\n description: 'Enables editing the global layout title.'\n }\n },\n\n autosizable: {\n valType: 'boolean',\n dflt: false,\n description: [\n 'Determines whether the graphs are plotted with respect to',\n 'layout.autosize:true and infer its container size.'\n ].join(' ')\n },\n responsive: {\n valType: 'boolean',\n dflt: false,\n description: [\n 'Determines whether to change the layout size when window is resized.',\n 'In v2, this option will be removed and will always be true.'\n ].join(' ')\n },\n fillFrame: {\n valType: 'boolean',\n dflt: false,\n description: [\n 'When `layout.autosize` is turned on, determines whether the graph',\n 'fills the container (the default) or the screen (if set to *true*).'\n ].join(' ')\n },\n frameMargins: {\n valType: 'number',\n dflt: 0,\n min: 0,\n max: 0.5,\n description: [\n 'When `layout.autosize` is turned on, set the frame margins',\n 'in fraction of the graph size.'\n ].join(' ')\n },\n\n scrollZoom: {\n valType: 'flaglist',\n flags: ['cartesian', 'gl3d', 'geo', 'mapbox'],\n extras: [true, false],\n dflt: 'gl3d+geo+mapbox',\n description: [\n 'Determines whether mouse wheel or two-finger scroll zooms is enable.',\n 'Turned on by default for gl3d, geo and mapbox subplots',\n '(as these subplot types do not have zoombox via pan),',\n 'but turned off by default for cartesian subplots.',\n 'Set `scrollZoom` to *false* to disable scrolling for all subplots.'\n ].join(' ')\n },\n doubleClick: {\n valType: 'enumerated',\n values: [false, 'reset', 'autosize', 'reset+autosize'],\n dflt: 'reset+autosize',\n description: [\n 'Sets the double click interaction mode.',\n 'Has an effect only in cartesian plots.',\n 'If *false*, double click is disable.',\n 'If *reset*, double click resets the axis ranges to their initial values.',\n 'If *autosize*, double click set the axis ranges to their autorange values.',\n 'If *reset+autosize*, the odd double clicks resets the axis ranges',\n 'to their initial values and even double clicks set the axis ranges',\n 'to their autorange values.'\n ].join(' ')\n },\n doubleClickDelay: {\n valType: 'number',\n dflt: 300,\n min: 0,\n description: [\n 'Sets the delay for registering a double-click in ms.',\n 'This is the time interval (in ms) between first mousedown and',\n '2nd mouseup to constitute a double-click.',\n 'This setting propagates to all on-subplot double clicks',\n '(except for geo and mapbox) and on-legend double clicks.'\n ].join(' ')\n },\n\n showAxisDragHandles: {\n valType: 'boolean',\n dflt: true,\n description: [\n 'Set to *false* to omit cartesian axis pan/zoom drag handles.'\n ].join(' ')\n },\n showAxisRangeEntryBoxes: {\n valType: 'boolean',\n dflt: true,\n description: [\n 'Set to *false* to omit direct range entry at the pan/zoom drag points,',\n 'note that `showAxisDragHandles` must be enabled to have an effect.'\n ].join(' ')\n },\n\n showTips: {\n valType: 'boolean',\n dflt: true,\n description: [\n 'Determines whether or not tips are shown while interacting',\n 'with the resulting graphs.'\n ].join(' ')\n },\n\n showLink: {\n valType: 'boolean',\n dflt: false,\n description: [\n 'Determines whether a link to Chart Studio Cloud is displayed',\n 'at the bottom right corner of resulting graphs.',\n 'Use with `sendData` and `linkText`.'\n ].join(' ')\n },\n linkText: {\n valType: 'string',\n dflt: 'Edit chart',\n noBlank: true,\n description: [\n 'Sets the text appearing in the `showLink` link.'\n ].join(' ')\n },\n sendData: {\n valType: 'boolean',\n dflt: true,\n description: [\n 'If *showLink* is true, does it contain data',\n 'just link to a Chart Studio Cloud file?'\n ].join(' ')\n },\n showSources: {\n valType: 'any',\n dflt: false,\n description: [\n 'Adds a source-displaying function to show sources on',\n 'the resulting graphs.'\n ].join(' ')\n },\n\n displayModeBar: {\n valType: 'enumerated',\n values: ['hover', true, false],\n dflt: 'hover',\n description: [\n 'Determines the mode bar display mode.',\n 'If *true*, the mode bar is always visible.',\n 'If *false*, the mode bar is always hidden.',\n 'If *hover*, the mode bar is visible while the mouse cursor',\n 'is on the graph container.'\n ].join(' ')\n },\n showSendToCloud: {\n valType: 'boolean',\n dflt: false,\n description: [\n 'Should we include a ModeBar button, labeled \"Edit in Chart Studio\",',\n 'that sends this chart to chart-studio.plotly.com (formerly plot.ly) or another plotly server',\n 'as specified by `plotlyServerURL` for editing, export, etc? Prior to version 1.43.0',\n 'this button was included by default, now it is opt-in using this flag.',\n 'Note that this button can (depending on `plotlyServerURL` being set) send your data',\n 'to an external server. However that server does not persist your data',\n 'until you arrive at the Chart Studio and explicitly click \"Save\".'\n ].join(' ')\n },\n showEditInChartStudio: {\n valType: 'boolean',\n dflt: false,\n description: [\n 'Same as `showSendToCloud`, but use a pencil icon instead of a floppy-disk.',\n 'Note that if both `showSendToCloud` and `showEditInChartStudio` are turned,',\n 'only `showEditInChartStudio` will be honored.'\n ].join(' ')\n },\n modeBarButtonsToRemove: {\n valType: 'any',\n dflt: [],\n description: [\n 'Remove mode bar buttons by name.',\n 'See ./components/modebar/buttons.js for the list of names.'\n ].join(' ')\n },\n modeBarButtonsToAdd: {\n valType: 'any',\n dflt: [],\n description: [\n 'Add mode bar button using config objects',\n 'See ./components/modebar/buttons.js for list of arguments.'\n ].join(' ')\n },\n modeBarButtons: {\n valType: 'any',\n dflt: false,\n description: [\n 'Define fully custom mode bar buttons as nested array,',\n 'where the outer arrays represents button groups, and',\n 'the inner arrays have buttons config objects or names of default buttons',\n 'See ./components/modebar/buttons.js for more info.'\n ].join(' ')\n },\n toImageButtonOptions: {\n valType: 'any',\n dflt: {},\n description: [\n 'Statically override options for toImage modebar button',\n 'allowed keys are format, filename, width, height, scale',\n 'see ../components/modebar/buttons.js'\n ].join(' ')\n },\n displaylogo: {\n valType: 'boolean',\n dflt: true,\n description: [\n 'Determines whether or not the plotly logo is displayed',\n 'on the end of the mode bar.'\n ].join(' ')\n },\n watermark: {\n valType: 'boolean',\n dflt: false,\n description: 'watermark the images with the company\\'s logo'\n },\n\n plotGlPixelRatio: {\n valType: 'number',\n dflt: 2,\n min: 1,\n max: 4,\n description: [\n 'Set the pixel ratio during WebGL image export.',\n 'This config option was formerly named `plot3dPixelRatio`',\n 'which is now deprecated.'\n ].join(' ')\n },\n\n setBackground: {\n valType: 'any',\n dflt: 'transparent',\n description: [\n 'Set function to add the background color (i.e. `layout.paper_color`)',\n 'to a different container.',\n 'This function take the graph div as first argument and the current background',\n 'color as second argument.',\n 'Alternatively, set to string *opaque* to ensure there is white behind it.'\n ].join(' ')\n },\n\n topojsonURL: {\n valType: 'string',\n noBlank: true,\n dflt: 'https://cdn.plot.ly/',\n description: [\n 'Set the URL to topojson used in geo charts.',\n 'By default, the topojson files are fetched from cdn.plot.ly.',\n 'For example, set this option to:',\n '/dist/topojson/',\n 'to render geographical feature using the topojson files',\n 'that ship with the plotly.js module.'\n ].join(' ')\n },\n\n mapboxAccessToken: {\n valType: 'string',\n dflt: null,\n description: [\n 'Mapbox access token (required to plot mapbox trace types)',\n 'If using an Mapbox Atlas server, set this option to \\'\\'',\n 'so that plotly.js won\\'t attempt to authenticate to the public Mapbox server.'\n ].join(' ')\n },\n\n logging: {\n valType: 'integer',\n min: 0,\n max: 2,\n dflt: 1,\n description: [\n 'Turn all console logging on or off (errors will be thrown)',\n 'This should ONLY be set via Plotly.setPlotConfig',\n 'Available levels:',\n '0: no logs',\n '1: warnings and errors, but not informational messages',\n '2: verbose logs'\n ].join(' ')\n },\n\n notifyOnLogging: {\n valType: 'integer',\n min: 0,\n max: 2,\n dflt: 0,\n description: [\n 'Set on-graph logging (notifier) level',\n 'This should ONLY be set via Plotly.setPlotConfig',\n 'Available levels:',\n '0: no on-graph logs',\n '1: warnings and errors, but not informational messages',\n '2: verbose logs'\n ].join(' ')\n },\n\n queueLength: {\n valType: 'integer',\n min: 0,\n dflt: 0,\n description: 'Sets the length of the undo/redo queue.'\n },\n\n globalTransforms: {\n valType: 'any',\n dflt: [],\n description: [\n 'Set global transform to be applied to all traces with no',\n 'specification needed'\n ].join(' ')\n },\n\n locale: {\n valType: 'string',\n dflt: 'en-US',\n description: [\n 'Which localization should we use?',\n 'Should be a string like \\'en\\' or \\'en-US\\'.'\n ].join(' ')\n },\n\n locales: {\n valType: 'any',\n dflt: {},\n description: [\n 'Localization definitions',\n 'Locales can be provided either here (specific to one chart) or globally',\n 'by registering them as modules.',\n 'Should be an object of objects {locale: {dictionary: {...}, format: {...}}}',\n '{',\n ' da: {',\n ' dictionary: {\\'Reset axes\\': \\'Nulstil aksler\\', ...},',\n ' format: {months: [...], shortMonths: [...]}',\n ' },',\n ' ...',\n '}',\n 'All parts are optional. When looking for translation or format fields, we',\n 'look first for an exact match in a config locale, then in a registered',\n 'module. If those fail, we strip off any regionalization (\\'en-US\\' -> \\'en\\')',\n 'and try each (config, registry) again. The final fallback for translation',\n 'is untranslated (which is US English) and for formats is the base English',\n '(the only consequence being the last fallback date format %x is DD/MM/YYYY',\n 'instead of MM/DD/YYYY). Currently `grouping` and `currency` are ignored',\n 'for our automatic number formatting, but can be used in custom formats.'\n ].join(' ')\n }\n};\n\nvar dfltConfig = {};\n\nfunction crawl(src, target) {\n for(var k in src) {\n var obj = src[k];\n if(obj.valType) {\n target[k] = obj.dflt;\n } else {\n if(!target[k]) {\n target[k] = {};\n }\n crawl(obj, target[k]);\n }\n }\n}\n\ncrawl(configAttributes, dfltConfig);\n\nmodule.exports = {\n configAttributes: configAttributes,\n dfltConfig: dfltConfig\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/plot_api/plot_config.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/plots/animation_attributes.js": /*!******************************************************************!*\ !*** ./node_modules/plotly.js/src/plots/animation_attributes.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\nmodule.exports = {\n mode: {\n valType: 'enumerated',\n dflt: 'afterall',\n role: 'info',\n values: ['immediate', 'next', 'afterall'],\n description: [\n 'Describes how a new animate call interacts with currently-running',\n 'animations. If `immediate`, current animations are interrupted and',\n 'the new animation is started. If `next`, the current frame is allowed',\n 'to complete, after which the new animation is started. If `afterall`',\n 'all existing frames are animated to completion before the new animation',\n 'is started.'\n ].join(' ')\n },\n direction: {\n valType: 'enumerated',\n role: 'info',\n values: ['forward', 'reverse'],\n dflt: 'forward',\n description: [\n 'The direction in which to play the frames triggered by the animation call'\n ].join(' ')\n },\n fromcurrent: {\n valType: 'boolean',\n dflt: false,\n role: 'info',\n description: [\n 'Play frames starting at the current frame instead of the beginning.'\n ].join(' ')\n },\n frame: {\n duration: {\n valType: 'number',\n role: 'info',\n min: 0,\n dflt: 500,\n description: [\n 'The duration in milliseconds of each frame. If greater than the frame',\n 'duration, it will be limited to the frame duration.'\n ].join(' ')\n },\n redraw: {\n valType: 'boolean',\n role: 'info',\n dflt: true,\n description: [\n 'Redraw the plot at completion of the transition. This is desirable',\n 'for transitions that include properties that cannot be transitioned,',\n 'but may significantly slow down updates that do not require a full',\n 'redraw of the plot'\n ].join(' ')\n },\n },\n transition: {\n duration: {\n valType: 'number',\n role: 'info',\n min: 0,\n dflt: 500,\n editType: 'none',\n description: [\n 'The duration of the transition, in milliseconds. If equal to zero,',\n 'updates are synchronous.'\n ].join(' ')\n },\n easing: {\n valType: 'enumerated',\n dflt: 'cubic-in-out',\n values: [\n 'linear',\n 'quad',\n 'cubic',\n 'sin',\n 'exp',\n 'circle',\n 'elastic',\n 'back',\n 'bounce',\n 'linear-in',\n 'quad-in',\n 'cubic-in',\n 'sin-in',\n 'exp-in',\n 'circle-in',\n 'elastic-in',\n 'back-in',\n 'bounce-in',\n 'linear-out',\n 'quad-out',\n 'cubic-out',\n 'sin-out',\n 'exp-out',\n 'circle-out',\n 'elastic-out',\n 'back-out',\n 'bounce-out',\n 'linear-in-out',\n 'quad-in-out',\n 'cubic-in-out',\n 'sin-in-out',\n 'exp-in-out',\n 'circle-in-out',\n 'elastic-in-out',\n 'back-in-out',\n 'bounce-in-out'\n ],\n role: 'info',\n editType: 'none',\n description: 'The easing function used for the transition'\n },\n ordering: {\n valType: 'enumerated',\n values: ['layout first', 'traces first'],\n dflt: 'layout first',\n role: 'info',\n editType: 'none',\n description: [\n 'Determines whether the figure\\'s layout or traces smoothly transitions',\n 'during updates that make both traces and layout change.'\n ].join(' ')\n }\n }\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/plots/animation_attributes.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/plots/attributes.js": /*!********************************************************!*\ !*** ./node_modules/plotly.js/src/plots/attributes.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\nvar fxAttrs = __webpack_require__(/*! ../components/fx/attributes */ \"./node_modules/plotly.js/src/components/fx/attributes.js\");\n\nmodule.exports = {\n type: {\n valType: 'enumerated',\n role: 'info',\n values: [], // listed dynamically\n dflt: 'scatter',\n editType: 'calc+clearAxisTypes',\n _noTemplating: true // we handle this at a higher level\n },\n visible: {\n valType: 'enumerated',\n values: [true, false, 'legendonly'],\n role: 'info',\n dflt: true,\n editType: 'calc',\n description: [\n 'Determines whether or not this trace is visible.',\n 'If *legendonly*, the trace is not drawn,',\n 'but can appear as a legend item',\n '(provided that the legend itself is visible).'\n ].join(' ')\n },\n showlegend: {\n valType: 'boolean',\n role: 'info',\n dflt: true,\n editType: 'style',\n description: [\n 'Determines whether or not an item corresponding to this',\n 'trace is shown in the legend.'\n ].join(' ')\n },\n legendgroup: {\n valType: 'string',\n role: 'info',\n dflt: '',\n editType: 'style',\n description: [\n 'Sets the legend group for this trace.',\n 'Traces part of the same legend group hide/show at the same time',\n 'when toggling legend items.'\n ].join(' ')\n },\n opacity: {\n valType: 'number',\n role: 'style',\n min: 0,\n max: 1,\n dflt: 1,\n editType: 'style',\n description: 'Sets the opacity of the trace.'\n },\n name: {\n valType: 'string',\n role: 'info',\n editType: 'style',\n description: [\n 'Sets the trace name.',\n 'The trace name appear as the legend item and on hover.'\n ].join(' ')\n },\n uid: {\n valType: 'string',\n role: 'info',\n editType: 'plot',\n anim: true,\n description: [\n 'Assign an id to this trace,',\n 'Use this to provide object constancy between traces during animations',\n 'and transitions.'\n ].join(' ')\n },\n ids: {\n valType: 'data_array',\n editType: 'calc',\n anim: true,\n description: [\n 'Assigns id labels to each datum.',\n 'These ids for object constancy of data points during animation.',\n 'Should be an array of strings, not numbers or any other type.'\n ].join(' ')\n },\n customdata: {\n valType: 'data_array',\n editType: 'calc',\n description: [\n 'Assigns extra data each datum.',\n 'This may be useful when listening to hover, click and selection events.',\n 'Note that, *scatter* traces also appends customdata items in the markers',\n 'DOM elements'\n ].join(' ')\n },\n meta: {\n valType: 'any',\n arrayOk: true,\n role: 'info',\n editType: 'plot',\n description: [\n 'Assigns extra meta information associated with this trace',\n 'that can be used in various text attributes.',\n 'Attributes such as trace `name`, graph, axis and colorbar `title.text`, annotation `text`',\n '`rangeselector`, `updatemenues` and `sliders` `label` text',\n 'all support `meta`.',\n 'To access the trace `meta` values in an attribute in the same trace, simply use',\n '`%{meta[i]}` where `i` is the index or key of the `meta`',\n 'item in question.',\n 'To access trace `meta` in layout attributes, use',\n '`%{data[n[.meta[i]}` where `i` is the index or key of the `meta`',\n 'and `n` is the trace index.'\n ].join(' ')\n },\n\n // N.B. these cannot be 'data_array' as they do not have the same length as\n // other data arrays and arrayOk attributes in general\n //\n // Maybe add another valType:\n // https://github.com/plotly/plotly.js/issues/1894\n selectedpoints: {\n valType: 'any',\n role: 'info',\n editType: 'calc',\n description: [\n 'Array containing integer indices of selected points.',\n 'Has an effect only for traces that support selections.',\n 'Note that an empty array means an empty selection where the `unselected`',\n 'are turned on for all points, whereas, any other non-array values means no',\n 'selection all where the `selected` and `unselected` styles have no effect.'\n ].join(' ')\n },\n\n hoverinfo: {\n valType: 'flaglist',\n role: 'info',\n flags: ['x', 'y', 'z', 'text', 'name'],\n extras: ['all', 'none', 'skip'],\n arrayOk: true,\n dflt: 'all',\n editType: 'none',\n description: [\n 'Determines which trace information appear on hover.',\n 'If `none` or `skip` are set, no information is displayed upon hovering.',\n 'But, if `none` is set, click and hover events are still fired.'\n ].join(' ')\n },\n hoverlabel: fxAttrs.hoverlabel,\n stream: {\n token: {\n valType: 'string',\n noBlank: true,\n strict: true,\n role: 'info',\n editType: 'calc',\n description: [\n 'The stream id number links a data trace on a plot with a stream.',\n 'See https://chart-studio.plotly.com/settings for more details.'\n ].join(' ')\n },\n maxpoints: {\n valType: 'number',\n min: 0,\n max: 10000,\n dflt: 500,\n role: 'info',\n editType: 'calc',\n description: [\n 'Sets the maximum number of points to keep on the plots from an',\n 'incoming stream.',\n 'If `maxpoints` is set to *50*, only the newest 50 points will',\n 'be displayed on the plot.'\n ].join(' ')\n },\n editType: 'calc'\n },\n transforms: {\n _isLinkedToArray: 'transform',\n editType: 'calc',\n description: [\n 'An array of operations that manipulate the trace data,',\n 'for example filtering or sorting the data arrays.'\n ].join(' ')\n },\n uirevision: {\n valType: 'any',\n role: 'info',\n editType: 'none',\n description: [\n 'Controls persistence of some user-driven changes to the trace:',\n '`constraintrange` in `parcoords` traces, as well as some',\n '`editable: true` modifications such as `name` and `colorbar.title`.',\n 'Defaults to `layout.uirevision`.',\n 'Note that other user-driven trace attribute changes are controlled',\n 'by `layout` attributes:',\n '`trace.visible` is controlled by `layout.legend.uirevision`,',\n '`selectedpoints` is controlled by `layout.selectionrevision`,',\n 'and `colorbar.(x|y)` (accessible with `config: {editable: true}`)',\n 'is controlled by `layout.editrevision`.',\n 'Trace changes are tracked by `uid`, which only falls back on trace',\n 'index if no `uid` is provided. So if your app can add/remove traces',\n 'before the end of the `data` array, such that the same trace has a',\n 'different index, you can still preserve user-driven changes if you',\n 'give each trace a `uid` that stays with it as it moves.'\n ].join(' ')\n }\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/plots/attributes.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/plots/cartesian/axis_ids.js": /*!****************************************************************!*\ !*** ./node_modules/plotly.js/src/plots/cartesian/axis_ids.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\nvar Registry = __webpack_require__(/*! ../../registry */ \"./node_modules/plotly.js/src/registry.js\");\n\nvar constants = __webpack_require__(/*! ./constants */ \"./node_modules/plotly.js/src/plots/cartesian/constants.js\");\n\n\n// convert between axis names (xaxis, xaxis2, etc, elements of gd.layout)\n// and axis id's (x, x2, etc). Would probably have ditched 'xaxis'\n// completely in favor of just 'x' if it weren't ingrained in the API etc.\nexports.id2name = function id2name(id) {\n if(typeof id !== 'string' || !id.match(constants.AX_ID_PATTERN)) return;\n var axNum = id.substr(1);\n if(axNum === '1') axNum = '';\n return id.charAt(0) + 'axis' + axNum;\n};\n\nexports.name2id = function name2id(name) {\n if(!name.match(constants.AX_NAME_PATTERN)) return;\n var axNum = name.substr(5);\n if(axNum === '1') axNum = '';\n return name.charAt(0) + axNum;\n};\n\nexports.cleanId = function cleanId(id, axLetter) {\n if(typeof id !== 'string' || !id.match(constants.AX_ID_PATTERN)) return;\n if(axLetter && id.charAt(0) !== axLetter) return;\n\n var axNum = id.substr(1).replace(/^0+/, '');\n if(axNum === '1') axNum = '';\n return id.charAt(0) + axNum;\n};\n\n// get all axis objects, as restricted in listNames\nexports.list = function(gd, axLetter, only2d) {\n var fullLayout = gd._fullLayout;\n if(!fullLayout) return [];\n\n var idList = exports.listIds(gd, axLetter);\n var out = new Array(idList.length);\n var i;\n\n for(i = 0; i < idList.length; i++) {\n var idi = idList[i];\n out[i] = fullLayout[idi.charAt(0) + 'axis' + idi.substr(1)];\n }\n\n if(!only2d) {\n var sceneIds3D = fullLayout._subplots.gl3d || [];\n\n for(i = 0; i < sceneIds3D.length; i++) {\n var scene = fullLayout[sceneIds3D[i]];\n\n if(axLetter) out.push(scene[axLetter + 'axis']);\n else out.push(scene.xaxis, scene.yaxis, scene.zaxis);\n }\n }\n\n return out;\n};\n\n// get all axis ids, optionally restricted by letter\n// this only makes sense for 2d axes\nexports.listIds = function(gd, axLetter) {\n var fullLayout = gd._fullLayout;\n if(!fullLayout) return [];\n\n var subplotLists = fullLayout._subplots;\n if(axLetter) return subplotLists[axLetter + 'axis'];\n return subplotLists.xaxis.concat(subplotLists.yaxis);\n};\n\n// get an axis object from its id 'x','x2' etc\n// optionally, id can be a subplot (ie 'x2y3') and type gets x or y from it\nexports.getFromId = function(gd, id, type) {\n var fullLayout = gd._fullLayout;\n\n if(type === 'x') id = id.replace(/y[0-9]*/, '');\n else if(type === 'y') id = id.replace(/x[0-9]*/, '');\n\n return fullLayout[exports.id2name(id)];\n};\n\n// get an axis object of specified type from the containing trace\nexports.getFromTrace = function(gd, fullTrace, type) {\n var fullLayout = gd._fullLayout;\n var ax = null;\n\n if(Registry.traceIs(fullTrace, 'gl3d')) {\n var scene = fullTrace.scene;\n if(scene.substr(0, 5) === 'scene') {\n ax = fullLayout[scene][type + 'axis'];\n }\n } else {\n ax = exports.getFromId(gd, fullTrace[type + 'axis'] || type);\n }\n\n return ax;\n};\n\n// sort x, x2, x10, y, y2, y10...\nexports.idSort = function(id1, id2) {\n var letter1 = id1.charAt(0);\n var letter2 = id2.charAt(0);\n if(letter1 !== letter2) return letter1 > letter2 ? 1 : -1;\n return +(id1.substr(1) || 1) - +(id2.substr(1) || 1);\n};\n\nexports.getAxisGroup = function getAxisGroup(fullLayout, axId) {\n var matchGroups = fullLayout._axisMatchGroups;\n\n for(var i = 0; i < matchGroups.length; i++) {\n var group = matchGroups[i];\n if(group[axId]) return 'g' + i;\n }\n return axId;\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/plots/cartesian/axis_ids.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/plots/cartesian/constants.js": /*!*****************************************************************!*\ !*** ./node_modules/plotly.js/src/plots/cartesian/constants.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\nvar counterRegex = __webpack_require__(/*! ../../lib/regex */ \"./node_modules/plotly.js/src/lib/regex.js\").counter;\n\nmodule.exports = {\n idRegex: {\n x: counterRegex('x'),\n y: counterRegex('y')\n },\n\n attrRegex: counterRegex('[xy]axis'),\n\n // axis match regular expression\n xAxisMatch: counterRegex('xaxis'),\n yAxisMatch: counterRegex('yaxis'),\n\n // pattern matching axis ids and names\n // note that this is more permissive than counterRegex, as\n // id2name, name2id, and cleanId accept \"x1\" etc\n AX_ID_PATTERN: /^[xyz][0-9]*$/,\n AX_NAME_PATTERN: /^[xyz]axis[0-9]*$/,\n\n // and for 2D subplots\n SUBPLOT_PATTERN: /^x([0-9]*)y([0-9]*)$/,\n\n HOUR_PATTERN: 'hour',\n WEEKDAY_PATTERN: 'day of week',\n\n // pixels to move mouse before you stop clamping to starting point\n MINDRAG: 8,\n\n // smallest dimension allowed for a select box\n MINSELECT: 12,\n\n // smallest dimension allowed for a zoombox\n MINZOOM: 20,\n\n // width of axis drag regions\n DRAGGERSIZE: 20,\n\n // max pixels off straight before a lasso select line counts as bent\n BENDPX: 1.5,\n\n // delay before a redraw (relayout) after smooth panning and zooming\n REDRAWDELAY: 50,\n\n // throttling limit (ms) for selectPoints calls\n SELECTDELAY: 100,\n\n // cache ID suffix for throttle\n SELECTID: '-select',\n\n // last resort axis ranges for x and y axes if we have no data\n DFLTRANGEX: [-1, 6],\n DFLTRANGEY: [-1, 4],\n\n // Layers to keep trace types in the right order\n // N.B. each 'unique' plot method must have its own layer\n traceLayerClasses: [\n 'imagelayer',\n 'heatmaplayer',\n 'contourcarpetlayer', 'contourlayer',\n 'funnellayer', 'waterfalllayer', 'barlayer',\n 'carpetlayer',\n 'violinlayer',\n 'boxlayer',\n 'ohlclayer',\n 'scattercarpetlayer', 'scatterlayer'\n ],\n\n clipOnAxisFalseQuery: [\n '.scatterlayer',\n '.barlayer',\n '.funnellayer',\n '.waterfalllayer'\n ],\n\n layerValue2layerClass: {\n 'above traces': 'above',\n 'below traces': 'below'\n }\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/plots/cartesian/constants.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/plots/font_attributes.js": /*!*************************************************************!*\ !*** ./node_modules/plotly.js/src/plots/font_attributes.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\n/*\n * make a font attribute group\n *\n * @param {object} opts\n * @param {string}\n * opts.description: where & how this font is used\n * @param {optional bool} arrayOk:\n * should each part (family, size, color) be arrayOk? default false.\n * @param {string} editType:\n * the editType for all pieces of this font\n * @param {optional string} colorEditType:\n * a separate editType just for color\n *\n * @return {object} attributes object containing {family, size, color} as specified\n */\nmodule.exports = function(opts) {\n var editType = opts.editType;\n var colorEditType = opts.colorEditType;\n if(colorEditType === undefined) colorEditType = editType;\n var attrs = {\n family: {\n valType: 'string',\n role: 'style',\n noBlank: true,\n strict: true,\n editType: editType,\n description: [\n 'HTML font family - the typeface that will be applied by the web browser.',\n 'The web browser will only be able to apply a font if it is available on the system',\n 'which it operates. Provide multiple font families, separated by commas, to indicate',\n 'the preference in which to apply fonts if they aren\\'t available on the system.',\n 'The Chart Studio Cloud (at https://chart-studio.plotly.com or on-premise) generates images on a server,',\n 'where only a select number of',\n 'fonts are installed and supported.',\n 'These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*,',\n '*Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*,',\n '*PT Sans Narrow*, *Raleway*, *Times New Roman*.'\n ].join(' ')\n },\n size: {\n valType: 'number',\n role: 'style',\n min: 1,\n editType: editType\n },\n color: {\n valType: 'color',\n role: 'style',\n editType: colorEditType\n },\n editType: editType,\n // blank strings so compress_attributes can remove\n // TODO - that's uber hacky... better solution?\n description: '' + (opts.description || '') + ''\n };\n\n if(opts.arrayOk) {\n attrs.family.arrayOk = true;\n attrs.size.arrayOk = true;\n attrs.color.arrayOk = true;\n }\n\n return attrs;\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/plots/font_attributes.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/plots/layout_attributes.js": /*!***************************************************************!*\ !*** ./node_modules/plotly.js/src/plots/layout_attributes.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\nvar fontAttrs = __webpack_require__(/*! ./font_attributes */ \"./node_modules/plotly.js/src/plots/font_attributes.js\");\nvar animationAttrs = __webpack_require__(/*! ./animation_attributes */ \"./node_modules/plotly.js/src/plots/animation_attributes.js\");\nvar colorAttrs = __webpack_require__(/*! ../components/color/attributes */ \"./node_modules/plotly.js/src/components/color/attributes.js\");\nvar drawNewShapeAttrs = __webpack_require__(/*! ../components/shapes/draw_newshape/attributes */ \"./node_modules/plotly.js/src/components/shapes/draw_newshape/attributes.js\");\nvar padAttrs = __webpack_require__(/*! ./pad_attributes */ \"./node_modules/plotly.js/src/plots/pad_attributes.js\");\nvar extendFlat = __webpack_require__(/*! ../lib/extend */ \"./node_modules/plotly.js/src/lib/extend.js\").extendFlat;\n\nvar globalFont = fontAttrs({\n editType: 'calc',\n description: [\n 'Sets the global font.',\n 'Note that fonts used in traces and other',\n 'layout components inherit from the global font.'\n ].join(' ')\n});\nglobalFont.family.dflt = '\"Open Sans\", verdana, arial, sans-serif';\nglobalFont.size.dflt = 12;\nglobalFont.color.dflt = colorAttrs.defaultLine;\n\nmodule.exports = {\n font: globalFont,\n title: {\n text: {\n valType: 'string',\n role: 'info',\n editType: 'layoutstyle',\n description: [\n 'Sets the plot\\'s title.',\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: fontAttrs({\n editType: 'layoutstyle',\n description: [\n 'Sets the title font.',\n 'Note that the title\\'s font used to be customized',\n 'by the now deprecated `titlefont` attribute.'\n ].join(' ')\n }),\n xref: {\n valType: 'enumerated',\n dflt: 'container',\n values: ['container', 'paper'],\n role: 'info',\n editType: 'layoutstyle',\n description: [\n 'Sets the container `x` refers to.',\n '*container* spans the entire `width` of the plot.',\n '*paper* refers to the width of the plotting area only.'\n ].join(' ')\n },\n yref: {\n valType: 'enumerated',\n dflt: 'container',\n values: ['container', 'paper'],\n role: 'info',\n editType: 'layoutstyle',\n description: [\n 'Sets the container `y` refers to.',\n '*container* spans the entire `height` of the plot.',\n '*paper* refers to the height of the plotting area only.'\n ].join(' ')\n },\n x: {\n valType: 'number',\n min: 0,\n max: 1,\n dflt: 0.5,\n role: 'style',\n editType: 'layoutstyle',\n description: [\n 'Sets the x position with respect to `xref` in normalized',\n 'coordinates from *0* (left) to *1* (right).'\n ].join(' ')\n },\n y: {\n valType: 'number',\n min: 0,\n max: 1,\n dflt: 'auto',\n role: 'style',\n editType: 'layoutstyle',\n description: [\n 'Sets the y position with respect to `yref` in normalized',\n 'coordinates from *0* (bottom) to *1* (top).',\n '*auto* places the baseline of the title onto the',\n 'vertical center of the top margin.'\n ].join(' ')\n },\n xanchor: {\n valType: 'enumerated',\n dflt: 'auto',\n values: ['auto', 'left', 'center', 'right'],\n role: 'info',\n editType: 'layoutstyle',\n description: [\n 'Sets the title\\'s horizontal alignment with respect to its x position.',\n '*left* means that the title starts at x,',\n '*right* means that the title ends at x',\n 'and *center* means that the title\\'s center is at x.',\n '*auto* divides `xref` by three and calculates the `xanchor`',\n 'value automatically based on the value of `x`.'\n ].join(' ')\n },\n yanchor: {\n valType: 'enumerated',\n dflt: 'auto',\n values: ['auto', 'top', 'middle', 'bottom'],\n role: 'info',\n editType: 'layoutstyle',\n description: [\n 'Sets the title\\'s vertical alignment with respect to its y position.',\n '*top* means that the title\\'s cap line is at y,',\n '*bottom* means that the title\\'s baseline is at y',\n 'and *middle* means that the title\\'s midline is at y.',\n '*auto* divides `yref` by three and calculates the `yanchor`',\n 'value automatically based on the value of `y`.'\n ].join(' ')\n },\n pad: extendFlat(padAttrs({editType: 'layoutstyle'}), {\n description: [\n 'Sets the padding of the title.',\n 'Each padding value only applies when the corresponding',\n '`xanchor`/`yanchor` value is set accordingly. E.g. for left',\n 'padding to take effect, `xanchor` must be set to *left*.',\n 'The same rule applies if `xanchor`/`yanchor` is determined automatically.',\n 'Padding is muted if the respective anchor value is *middle*/*center*.'\n ].join(' ')\n }),\n editType: 'layoutstyle'\n },\n uniformtext: {\n mode: {\n valType: 'enumerated',\n values: [false, 'hide', 'show'],\n dflt: false,\n role: 'info',\n editType: 'plot',\n description: [\n 'Determines how the font size for various text',\n 'elements are uniformed between each trace type.',\n 'If the computed text sizes were smaller than',\n 'the minimum size defined by `uniformtext.minsize`',\n 'using *hide* option hides the text; and',\n 'using *show* option shows the text without further downscaling.',\n 'Please note that if the size defined by `minsize` is greater than',\n 'the font size defined by trace, then the `minsize` is used.'\n ].join(' ')\n },\n minsize: {\n valType: 'number',\n min: 0,\n dflt: 0,\n role: 'info',\n editType: 'plot',\n description: [\n 'Sets the minimum text size between traces of the same type.'\n ].join(' ')\n },\n editType: 'plot'\n },\n autosize: {\n valType: 'boolean',\n role: 'info',\n dflt: false,\n // autosize, width, and height get special editType treatment in _relayout\n // so we can handle noop resizes more efficiently\n editType: 'none',\n description: [\n 'Determines whether or not a layout width or height',\n 'that has been left undefined by the user',\n 'is initialized on each relayout.',\n\n 'Note that, regardless of this attribute,',\n 'an undefined layout width or height',\n 'is always initialized on the first call to plot.'\n ].join(' ')\n },\n width: {\n valType: 'number',\n role: 'info',\n min: 10,\n dflt: 700,\n editType: 'plot',\n description: [\n 'Sets the plot\\'s width (in px).'\n ].join(' ')\n },\n height: {\n valType: 'number',\n role: 'info',\n min: 10,\n dflt: 450,\n editType: 'plot',\n description: [\n 'Sets the plot\\'s height (in px).'\n ].join(' ')\n },\n margin: {\n l: {\n valType: 'number',\n role: 'info',\n min: 0,\n dflt: 80,\n editType: 'plot',\n description: 'Sets the left margin (in px).'\n },\n r: {\n valType: 'number',\n role: 'info',\n min: 0,\n dflt: 80,\n editType: 'plot',\n description: 'Sets the right margin (in px).'\n },\n t: {\n valType: 'number',\n role: 'info',\n min: 0,\n dflt: 100,\n editType: 'plot',\n description: 'Sets the top margin (in px).'\n },\n b: {\n valType: 'number',\n role: 'info',\n min: 0,\n dflt: 80,\n editType: 'plot',\n description: 'Sets the bottom margin (in px).'\n },\n pad: {\n valType: 'number',\n role: 'info',\n min: 0,\n dflt: 0,\n editType: 'plot',\n description: [\n 'Sets the amount of padding (in px)',\n 'between the plotting area and the axis lines'\n ].join(' ')\n },\n autoexpand: {\n valType: 'boolean',\n role: 'info',\n dflt: true,\n editType: 'plot',\n description: [\n 'Turns on/off margin expansion computations.',\n 'Legends, colorbars, updatemenus, sliders, axis rangeselector and rangeslider',\n 'are allowed to push the margins by defaults.'\n ].join(' ')\n },\n editType: 'plot'\n },\n paper_bgcolor: {\n valType: 'color',\n role: 'style',\n dflt: colorAttrs.background,\n editType: 'plot',\n description: 'Sets the background color of the paper where the graph is drawn.'\n },\n plot_bgcolor: {\n // defined here, but set in cartesian.supplyLayoutDefaults\n // because it needs to know if there are (2D) axes or not\n valType: 'color',\n role: 'style',\n dflt: colorAttrs.background,\n editType: 'layoutstyle',\n description: [\n 'Sets the background color of the plotting area in-between x and y axes.'\n ].join(' ')\n },\n separators: {\n valType: 'string',\n role: 'style',\n editType: 'plot',\n description: [\n 'Sets the decimal and thousand separators.',\n 'For example, *. * puts a \\'.\\' before decimals and a space',\n 'between thousands. In English locales, dflt is *.,* but',\n 'other locales may alter this default.'\n ].join(' ')\n },\n hidesources: {\n valType: 'boolean',\n role: 'info',\n dflt: false,\n editType: 'plot',\n description: [\n 'Determines whether or not a text link citing the data source is',\n 'placed at the bottom-right cored of the figure.',\n 'Has only an effect only on graphs that have been generated via',\n 'forked graphs from the Chart Studio Cloud (at https://chart-studio.plotly.com or on-premise).'\n ].join(' ')\n },\n showlegend: {\n // handled in legend.supplyLayoutDefaults\n // but included here because it's not in the legend object\n valType: 'boolean',\n role: 'info',\n editType: 'legend',\n description: [\n 'Determines whether or not a legend is drawn.',\n 'Default is `true` if there is a trace to show and any of these:',\n 'a) Two or more traces would by default be shown in the legend.',\n 'b) One pie trace is shown in the legend.',\n 'c) One trace is explicitly given with `showlegend: true`.'\n ].join(' ')\n },\n colorway: {\n valType: 'colorlist',\n dflt: colorAttrs.defaults,\n role: 'style',\n editType: 'calc',\n description: 'Sets the default trace colors.'\n },\n datarevision: {\n valType: 'any',\n role: 'info',\n editType: 'calc',\n description: [\n 'If provided, a changed value tells `Plotly.react` that',\n 'one or more data arrays has changed. This way you can modify',\n 'arrays in-place rather than making a complete new copy for an',\n 'incremental change.',\n 'If NOT provided, `Plotly.react` assumes that data arrays are',\n 'being treated as immutable, thus any data array with a',\n 'different identity from its predecessor contains new data.'\n ].join(' ')\n },\n uirevision: {\n valType: 'any',\n role: 'info',\n editType: 'none',\n description: [\n 'Used to allow user interactions with the plot to persist after',\n '`Plotly.react` calls that are unaware of these interactions.',\n 'If `uirevision` is omitted, or if it is given and it changed from',\n 'the previous `Plotly.react` call, the exact new figure is used.',\n 'If `uirevision` is truthy and did NOT change, any attribute',\n 'that has been affected by user interactions and did not receive a',\n 'different value in the new figure will keep the interaction value.',\n '`layout.uirevision` attribute serves as the default for',\n '`uirevision` attributes in various sub-containers. For finer',\n 'control you can set these sub-attributes directly. For example,',\n 'if your app separately controls the data on the x and y axes you',\n 'might set `xaxis.uirevision=*time*` and `yaxis.uirevision=*cost*`.',\n 'Then if only the y data is changed, you can update',\n '`yaxis.uirevision=*quantity*` and the y axis range will reset but',\n 'the x axis range will retain any user-driven zoom.'\n ].join(' ')\n },\n editrevision: {\n valType: 'any',\n role: 'info',\n editType: 'none',\n description: [\n 'Controls persistence of user-driven changes in `editable: true`',\n 'configuration, other than trace names and axis titles.',\n 'Defaults to `layout.uirevision`.'\n ].join(' ')\n },\n selectionrevision: {\n valType: 'any',\n role: 'info',\n editType: 'none',\n description: [\n 'Controls persistence of user-driven changes in selected points',\n 'from all traces.'\n ].join(' ')\n },\n template: {\n valType: 'any',\n role: 'info',\n editType: 'calc',\n description: [\n 'Default attributes to be applied to the plot. Templates can be',\n 'created from existing plots using `Plotly.makeTemplate`, or',\n 'created manually. They should be objects with format:',\n '`{layout: layoutTemplate, data: {[type]: [traceTemplate, ...]}, ...}`',\n '`layoutTemplate` and `traceTemplate` are objects matching the',\n 'attribute structure of `layout` and a data trace. ',\n 'Trace templates are applied cyclically to traces of each type.',\n 'Container arrays (eg `annotations`) have special handling:',\n 'An object ending in `defaults` (eg `annotationdefaults`) is applied',\n 'to each array item. But if an item has a `templateitemname` key',\n 'we look in the template array for an item with matching `name` and',\n 'apply that instead. If no matching `name` is found we mark the item',\n 'invisible. Any named template item not referenced is appended to',\n 'the end of the array, so you can use this for a watermark annotation',\n 'or a logo image, for example. To omit one of these items on the plot,',\n 'make an item with matching `templateitemname` and `visible: false`.'\n ].join(' ')\n },\n modebar: {\n orientation: {\n valType: 'enumerated',\n values: ['v', 'h'],\n dflt: 'h',\n role: 'info',\n editType: 'modebar',\n description: 'Sets the orientation of the modebar.'\n },\n bgcolor: {\n valType: 'color',\n role: 'style',\n editType: 'modebar',\n description: 'Sets the background color of the modebar.'\n },\n color: {\n valType: 'color',\n role: 'style',\n editType: 'modebar',\n description: 'Sets the color of the icons in the modebar.'\n },\n activecolor: {\n valType: 'color',\n role: 'style',\n editType: 'modebar',\n description: 'Sets the color of the active or hovered on icons in the modebar.'\n },\n uirevision: {\n valType: 'any',\n role: 'info',\n editType: 'none',\n description: [\n 'Controls persistence of user-driven changes related to the modebar,',\n 'including `hovermode`, `dragmode`, and `showspikes` at both the',\n 'root level and inside subplots. Defaults to `layout.uirevision`.'\n ].join(' ')\n },\n editType: 'modebar'\n },\n\n newshape: drawNewShapeAttrs.newshape,\n activeshape: drawNewShapeAttrs.activeshape,\n\n meta: {\n valType: 'any',\n arrayOk: true,\n role: 'info',\n editType: 'plot',\n description: [\n 'Assigns extra meta information that can be used in various `text` attributes.',\n 'Attributes such as the graph, axis and colorbar `title.text`, annotation `text`',\n '`trace.name` in legend items, `rangeselector`, `updatemenus` and `sliders` `label` text',\n 'all support `meta`. One can access `meta` fields using template strings:',\n '`%{meta[i]}` where `i` is the index of the `meta`',\n 'item in question.',\n '`meta` can also be an object for example `{key: value}` which can be accessed',\n '%{meta[key]}.'\n ].join(' ')\n },\n\n transition: extendFlat({}, animationAttrs.transition, {\n description: [\n 'Sets transition options used during Plotly.react updates.'\n ].join(' '),\n editType: 'none'\n }),\n _deprecated: {\n title: {\n valType: 'string',\n role: 'info',\n editType: 'layoutstyle',\n description: [\n 'Value of `title` is no longer a simple *string* but a set of sub-attributes.',\n 'To set the contents of the title, please use `title.text` now.'\n ].join(' ')\n },\n titlefont: fontAttrs({\n editType: 'layoutstyle',\n description: [\n 'Former `titlefont` is now the sub-attribute `font` of `title`.',\n 'To customize title font properties, please use `title.font` now.'\n ].join(' ')\n })\n }\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/plots/layout_attributes.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/plots/pad_attributes.js": /*!************************************************************!*\ !*** ./node_modules/plotly.js/src/plots/pad_attributes.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\n/**\n * Creates a set of padding attributes.\n *\n * @param {object} opts\n * @param {string} editType:\n * the editType for all pieces of this padding definition\n *\n * @return {object} attributes object containing {t, r, b, l} as specified\n */\nmodule.exports = function(opts) {\n var editType = opts.editType;\n return {\n t: {\n valType: 'number',\n dflt: 0,\n role: 'style',\n editType: editType,\n description: 'The amount of padding (in px) along the top of the component.'\n },\n r: {\n valType: 'number',\n dflt: 0,\n role: 'style',\n editType: editType,\n description: 'The amount of padding (in px) on the right side of the component.'\n },\n b: {\n valType: 'number',\n dflt: 0,\n role: 'style',\n editType: editType,\n description: 'The amount of padding (in px) along the bottom of the component.'\n },\n l: {\n valType: 'number',\n dflt: 0,\n role: 'style',\n editType: editType,\n description: 'The amount of padding (in px) on the left side of the component.'\n },\n editType: editType\n };\n};\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/plots/pad_attributes.js?"); /***/ }), /***/ "./node_modules/plotly.js/src/registry.js": /*!************************************************!*\ !*** ./node_modules/plotly.js/src/registry.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n* Copyright 2012-2020, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\n\n\nvar Loggers = __webpack_require__(/*! ./lib/loggers */ \"./node_modules/plotly.js/src/lib/loggers.js\");\nvar noop = __webpack_require__(/*! ./lib/noop */ \"./node_modules/plotly.js/src/lib/noop.js\");\nvar pushUnique = __webpack_require__(/*! ./lib/push_unique */ \"./node_modules/plotly.js/src/lib/push_unique.js\");\nvar isPlainObject = __webpack_require__(/*! ./lib/is_plain_object */ \"./node_modules/plotly.js/src/lib/is_plain_object.js\");\nvar addStyleRule = __webpack_require__(/*! ./lib/dom */ \"./node_modules/plotly.js/src/lib/dom.js\").addStyleRule;\nvar ExtendModule = __webpack_require__(/*! ./lib/extend */ \"./node_modules/plotly.js/src/lib/extend.js\");\n\nvar basePlotAttributes = __webpack_require__(/*! ./plots/attributes */ \"./node_modules/plotly.js/src/plots/attributes.js\");\nvar baseLayoutAttributes = __webpack_require__(/*! ./plots/layout_attributes */ \"./node_modules/plotly.js/src/plots/layout_attributes.js\");\n\nvar extendFlat = ExtendModule.extendFlat;\nvar extendDeepAll = ExtendModule.extendDeepAll;\n\nexports.modules = {};\nexports.allCategories = {};\nexports.allTypes = [];\nexports.subplotsRegistry = {};\nexports.transformsRegistry = {};\nexports.componentsRegistry = {};\nexports.layoutArrayContainers = [];\nexports.layoutArrayRegexes = [];\nexports.traceLayoutAttributes = {};\nexports.localeRegistry = {};\nexports.apiMethodRegistry = {};\nexports.collectableSubplotTypes = null;\n\n/**\n * Top-level register routine, exported as Plotly.register\n *\n * @param {object array or array of objects} _modules :\n * module object or list of module object to register.\n *\n * A valid `moduleType: 'trace'` module has fields:\n * - name {string} : the trace type\n * - categories {array} : categories associated with this trace type,\n * tested with Register.traceIs()\n * - meta {object} : meta info (mostly for plot-schema)\n *\n * A valid `moduleType: 'locale'` module has fields:\n * - name {string} : the locale name. Should be a 2-digit language string ('en', 'de')\n * optionally with a country/region code ('en-GB', 'de-CH'). If a country\n * code is used but the base language locale has not yet been supplied,\n * we will use this locale for the base as well.\n * - dictionary {object} : the dictionary mapping input strings to localized strings\n * generally the keys should be the literal input strings, but\n * if default translations are provided you can use any string as a key.\n * - format {object} : a `d3.locale` format specifier for this locale\n * any omitted keys we'll fall back on en-US.\n *\n * A valid `moduleType: 'transform'` module has fields:\n * - name {string} : transform name\n * - transform {function} : default-level transform function\n * - calcTransform {function} : calc-level transform function\n * - attributes {object} : transform attributes declarations\n * - supplyDefaults {function} : attributes default-supply function\n *\n * A valid `moduleType: 'component'` module has fields:\n * - name {string} : the component name, used it with Register.getComponentMethod()\n * to employ component method.\n *\n * A valid `moduleType: 'apiMethod'` module has fields:\n * - name {string} : the api method name.\n * - fn {function} : the api method called with Register.call();\n *\n */\nexports.register = function register(_modules) {\n exports.collectableSubplotTypes = null;\n\n if(!_modules) {\n throw new Error('No argument passed to Plotly.register.');\n } else if(_modules && !Array.isArray(_modules)) {\n _modules = [_modules];\n }\n\n for(var i = 0; i < _modules.length; i++) {\n var newModule = _modules[i];\n\n if(!newModule) {\n throw new Error('Invalid module was attempted to be registered!');\n }\n\n switch(newModule.moduleType) {\n case 'trace':\n registerTraceModule(newModule);\n break;\n case 'transform':\n registerTransformModule(newModule);\n break;\n case 'component':\n registerComponentModule(newModule);\n break;\n case 'locale':\n registerLocale(newModule);\n break;\n case 'apiMethod':\n var name = newModule.name;\n exports.apiMethodRegistry[name] = newModule.fn;\n break;\n default:\n throw new Error('Invalid module was attempted to be registered!');\n }\n }\n};\n\n/**\n * Get registered module using trace object or trace type\n *\n * @param {object||string} trace\n * trace object with prop 'type' or trace type as a string\n * @return {object}\n * module object corresponding to trace type\n */\nexports.getModule = function(trace) {\n var _module = exports.modules[getTraceType(trace)];\n if(!_module) return false;\n return _module._module;\n};\n\n/**\n * Determine if this trace type is in a given category\n *\n * @param {object||string} traceType\n * a trace (object) or trace type (string)\n * @param {string} category\n * category in question\n * @return {boolean}\n */\nexports.traceIs = function(traceType, category) {\n traceType = getTraceType(traceType);\n\n // old Chart Studio Cloud workspace hack, nothing to see here\n if(traceType === 'various') return false;\n\n var _module = exports.modules[traceType];\n\n if(!_module) {\n if(traceType && traceType !== 'area') {\n Loggers.log('Unrecognized trace type ' + traceType + '.');\n }\n\n _module = exports.modules[basePlotAttributes.type.dflt];\n }\n\n return !!_module.categories[category];\n};\n\n/**\n * Determine if this trace has a transform of the given type and return\n * array of matching indices.\n *\n * @param {object} data\n * a trace object (member of data or fullData)\n * @param {string} type\n * type of trace to test\n * @return {array}\n * array of matching indices. If none found, returns []\n */\nexports.getTransformIndices = function(data, type) {\n var indices = [];\n var transforms = data.transforms || [];\n for(var i = 0; i < transforms.length; i++) {\n if(transforms[i].type === type) {\n indices.push(i);\n }\n }\n return indices;\n};\n\n/**\n * Determine if this trace has a transform of the given type\n *\n * @param {object} data\n * a trace object (member of data or fullData)\n * @param {string} type\n * type of trace to test\n * @return {boolean}\n */\nexports.hasTransform = function(data, type) {\n var transforms = data.transforms || [];\n for(var i = 0; i < transforms.length; i++) {\n if(transforms[i].type === type) {\n return true;\n }\n }\n return false;\n};\n\n/**\n * Retrieve component module method. Falls back on noop if either the\n * module or the method is missing, so the result can always be safely called\n *\n * @param {string} name\n * name of component (as declared in component module)\n * @param {string} method\n * name of component module method\n * @return {function}\n */\nexports.getComponentMethod = function(name, method) {\n var _module = exports.componentsRegistry[name];\n\n if(!_module) return noop;\n return _module[method] || noop;\n};\n\n/**\n * Call registered api method.\n *\n * @param {string} name : api method name\n * @param {...array} args : arguments passed to api method\n * @return {any} : returns api method output\n */\nexports.call = function() {\n var name = arguments[0];\n var args = [].slice.call(arguments, 1);\n return exports.apiMethodRegistry[name].apply(null, args);\n};\n\nfunction registerTraceModule(_module) {\n var thisType = _module.name;\n var categoriesIn = _module.categories;\n var meta = _module.meta;\n\n if(exports.modules[thisType]) {\n Loggers.log('Type ' + thisType + ' already registered');\n return;\n }\n\n if(!exports.subplotsRegistry[_module.basePlotModule.name]) {\n registerSubplot(_module.basePlotModule);\n }\n\n var categoryObj = {};\n for(var i = 0; i < categoriesIn.length; i++) {\n categoryObj[categoriesIn[i]] = true;\n exports.allCategories[categoriesIn[i]] = true;\n }\n\n exports.modules[thisType] = {\n _module: _module,\n categories: categoryObj\n };\n\n if(meta && Object.keys(meta).length) {\n exports.modules[thisType].meta = meta;\n }\n\n exports.allTypes.push(thisType);\n\n for(var componentName in exports.componentsRegistry) {\n mergeComponentAttrsToTrace(componentName, thisType);\n }\n\n /*\n * Collect all trace layout attributes in one place for easier lookup later\n * but don't merge them into the base schema as it would confuse the docs\n * (at least after https://github.com/plotly/documentation/issues/202 gets done!)\n */\n if(_module.layoutAttributes) {\n extendFlat(exports.traceLayoutAttributes, _module.layoutAttributes);\n }\n\n var basePlotModule = _module.basePlotModule;\n var bpmName = basePlotModule.name;\n\n // add mapbox-gl CSS here to avoid console warning on instantiation\n if(bpmName === 'mapbox') {\n var styleRules = basePlotModule.constants.styleRules;\n for(var k in styleRules) {\n addStyleRule('.js-plotly-plot .plotly .mapboxgl-' + k, styleRules[k]);\n }\n }\n\n // if `plotly-geo-assets.js` is not included,\n // add `PlotlyGeoAssets` global to stash references to all fetched\n // topojson / geojson data\n if((bpmName === 'geo' || bpmName === 'mapbox') &&\n (typeof window !== undefined && window.PlotlyGeoAssets === undefined)\n ) {\n window.PlotlyGeoAssets = {topojson: {}};\n }\n}\n\nfunction registerSubplot(_module) {\n var plotType = _module.name;\n\n if(exports.subplotsRegistry[plotType]) {\n Loggers.log('Plot type ' + plotType + ' already registered.');\n return;\n }\n\n // relayout array handling will look for component module methods with this\n // name and won't find them because this is a subplot module... but that\n // should be fine, it will just fall back on redrawing the plot.\n findArrayRegexps(_module);\n\n // not sure what's best for the 'cartesian' type at this point\n exports.subplotsRegistry[plotType] = _module;\n\n for(var componentName in exports.componentsRegistry) {\n mergeComponentAttrsToSubplot(componentName, _module.name);\n }\n}\n\nfunction registerComponentModule(_module) {\n if(typeof _module.name !== 'string') {\n throw new Error('Component module *name* must be a string.');\n }\n\n var name = _module.name;\n exports.componentsRegistry[name] = _module;\n\n if(_module.layoutAttributes) {\n if(_module.layoutAttributes._isLinkedToArray) {\n pushUnique(exports.layoutArrayContainers, name);\n }\n findArrayRegexps(_module);\n }\n\n for(var traceType in exports.modules) {\n mergeComponentAttrsToTrace(name, traceType);\n }\n\n for(var subplotName in exports.subplotsRegistry) {\n mergeComponentAttrsToSubplot(name, subplotName);\n }\n\n for(var transformType in exports.transformsRegistry) {\n mergeComponentAttrsToTransform(name, transformType);\n }\n\n if(_module.schema && _module.schema.layout) {\n extendDeepAll(baseLayoutAttributes, _module.schema.layout);\n }\n}\n\nfunction registerTransformModule(_module) {\n if(typeof _module.name !== 'string') {\n throw new Error('Transform module *name* must be a string.');\n }\n\n var prefix = 'Transform module ' + _module.name;\n var hasTransform = typeof _module.transform === 'function';\n var hasCalcTransform = typeof _module.calcTransform === 'function';\n\n if(!hasTransform && !hasCalcTransform) {\n throw new Error(prefix + ' is missing a *transform* or *calcTransform* method.');\n }\n if(hasTransform && hasCalcTransform) {\n Loggers.log([\n prefix + ' has both a *transform* and *calcTransform* methods.',\n 'Please note that all *transform* methods are executed',\n 'before all *calcTransform* methods.'\n ].join(' '));\n }\n if(!isPlainObject(_module.attributes)) {\n Loggers.log(prefix + ' registered without an *attributes* object.');\n }\n if(typeof _module.supplyDefaults !== 'function') {\n Loggers.log(prefix + ' registered without a *supplyDefaults* method.');\n }\n\n exports.transformsRegistry[_module.name] = _module;\n\n for(var componentName in exports.componentsRegistry) {\n mergeComponentAttrsToTransform(componentName, _module.name);\n }\n}\n\nfunction registerLocale(_module) {\n var locale = _module.name;\n var baseLocale = locale.split('-')[0];\n\n var newDict = _module.dictionary;\n var newFormat = _module.format;\n var hasDict = newDict && Object.keys(newDict).length;\n var hasFormat = newFormat && Object.keys(newFormat).length;\n\n var locales = exports.localeRegistry;\n\n var localeObj = locales[locale];\n if(!localeObj) locales[locale] = localeObj = {};\n\n // Should we use this dict for the base locale?\n // In case we're overwriting a previous dict for this locale, check\n // whether the base matches the full locale dict now. If we're not\n // overwriting, locales[locale] is undefined so this just checks if\n // baseLocale already had a dict or not.\n // Same logic for dateFormats\n if(baseLocale !== locale) {\n var baseLocaleObj = locales[baseLocale];\n if(!baseLocaleObj) locales[baseLocale] = baseLocaleObj = {};\n\n if(hasDict && baseLocaleObj.dictionary === localeObj.dictionary) {\n baseLocaleObj.dictionary = newDict;\n }\n if(hasFormat && baseLocaleObj.format === localeObj.format) {\n baseLocaleObj.format = newFormat;\n }\n }\n\n if(hasDict) localeObj.dictionary = newDict;\n if(hasFormat) localeObj.format = newFormat;\n}\n\nfunction findArrayRegexps(_module) {\n if(_module.layoutAttributes) {\n var arrayAttrRegexps = _module.layoutAttributes._arrayAttrRegexps;\n if(arrayAttrRegexps) {\n for(var i = 0; i < arrayAttrRegexps.length; i++) {\n pushUnique(exports.layoutArrayRegexes, arrayAttrRegexps[i]);\n }\n }\n }\n}\n\nfunction mergeComponentAttrsToTrace(componentName, traceType) {\n var componentSchema = exports.componentsRegistry[componentName].schema;\n if(!componentSchema || !componentSchema.traces) return;\n\n var traceAttrs = componentSchema.traces[traceType];\n if(traceAttrs) {\n extendDeepAll(exports.modules[traceType]._module.attributes, traceAttrs);\n }\n}\n\nfunction mergeComponentAttrsToTransform(componentName, transformType) {\n var componentSchema = exports.componentsRegistry[componentName].schema;\n if(!componentSchema || !componentSchema.transforms) return;\n\n var transformAttrs = componentSchema.transforms[transformType];\n if(transformAttrs) {\n extendDeepAll(exports.transformsRegistry[transformType].attributes, transformAttrs);\n }\n}\n\nfunction mergeComponentAttrsToSubplot(componentName, subplotName) {\n var componentSchema = exports.componentsRegistry[componentName].schema;\n if(!componentSchema || !componentSchema.subplots) return;\n\n var subplotModule = exports.subplotsRegistry[subplotName];\n var subplotAttrs = subplotModule.layoutAttributes;\n var subplotAttr = subplotModule.attr === 'subplot' ? subplotModule.name : subplotModule.attr;\n if(Array.isArray(subplotAttr)) subplotAttr = subplotAttr[0];\n\n var componentLayoutAttrs = componentSchema.subplots[subplotAttr];\n if(subplotAttrs && componentLayoutAttrs) {\n extendDeepAll(subplotAttrs, componentLayoutAttrs);\n }\n}\n\nfunction getTraceType(traceType) {\n if(typeof traceType === 'object') traceType = traceType.type;\n return traceType;\n}\n\n\n//# sourceURL=webpack:///./node_modules/plotly.js/src/registry.js?"); /***/ }), /***/ "./node_modules/prop-types/checkPropTypes.js": /*!***************************************************!*\ !*** ./node_modules/prop-types/checkPropTypes.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nvar printWarning = function() {};\n\nif (true) {\n var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ \"./node_modules/prop-types/lib/ReactPropTypesSecret.js\");\n var loggedTypeFailures = {};\n var has = Function.call.bind(Object.prototype.hasOwnProperty);\n\n printWarning = function(text) {\n var message = 'Warning: ' + text;\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n if (true) {\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error;\n // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n var err = Error(\n (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +\n 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'\n );\n err.name = 'Invariant Violation';\n throw err;\n }\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n if (error && !(error instanceof Error)) {\n printWarning(\n (componentName || 'React class') + ': type specification of ' +\n location + ' `' + typeSpecName + '` is invalid; the type checker ' +\n 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +\n 'You may have forgotten to pass an argument to the type checker ' +\n 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +\n 'shape all require an argument).'\n );\n }\n if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error.message] = true;\n\n var stack = getStack ? getStack() : '';\n\n printWarning(\n 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')\n );\n }\n }\n }\n }\n}\n\n/**\n * Resets warning cache when testing.\n *\n * @private\n */\ncheckPropTypes.resetWarningCache = function() {\n if (true) {\n loggedTypeFailures = {};\n }\n}\n\nmodule.exports = checkPropTypes;\n\n\n//# sourceURL=webpack:///./node_modules/prop-types/checkPropTypes.js?"); /***/ }), /***/ "./node_modules/prop-types/factoryWithTypeCheckers.js": /*!************************************************************!*\ !*** ./node_modules/prop-types/factoryWithTypeCheckers.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nvar ReactIs = __webpack_require__(/*! react-is */ \"./node_modules/react-is/index.js\");\nvar assign = __webpack_require__(/*! object-assign */ \"./node_modules/object-assign/index.js\");\n\nvar ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ \"./node_modules/prop-types/lib/ReactPropTypesSecret.js\");\nvar checkPropTypes = __webpack_require__(/*! ./checkPropTypes */ \"./node_modules/prop-types/checkPropTypes.js\");\n\nvar has = Function.call.bind(Object.prototype.hasOwnProperty);\nvar printWarning = function() {};\n\nif (true) {\n printWarning = function(text) {\n var message = 'Warning: ' + text;\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n}\n\nfunction emptyFunctionThatReturnsNull() {\n return null;\n}\n\nmodule.exports = function(isValidElement, throwOnDirectAccess) {\n /* global Symbol */\n var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.\n\n /**\n * Returns the iterator method function contained on the iterable object.\n *\n * Be sure to invoke the function with the iterable as context:\n *\n * var iteratorFn = getIteratorFn(myIterable);\n * if (iteratorFn) {\n * var iterator = iteratorFn.call(myIterable);\n * ...\n * }\n *\n * @param {?object} maybeIterable\n * @return {?function}\n */\n function getIteratorFn(maybeIterable) {\n var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);\n if (typeof iteratorFn === 'function') {\n return iteratorFn;\n }\n }\n\n /**\n * Collection of methods that allow declaration and validation of props that are\n * supplied to React components. Example usage:\n *\n * var Props = require('ReactPropTypes');\n * var MyArticle = React.createClass({\n * propTypes: {\n * // An optional string prop named \"description\".\n * description: Props.string,\n *\n * // A required enum prop named \"category\".\n * category: Props.oneOf(['News','Photos']).isRequired,\n *\n * // A prop named \"dialog\" that requires an instance of Dialog.\n * dialog: Props.instanceOf(Dialog).isRequired\n * },\n * render: function() { ... }\n * });\n *\n * A more formal specification of how these methods are used:\n *\n * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)\n * decl := ReactPropTypes.{type}(.isRequired)?\n *\n * Each and every declaration produces a function with the same signature. This\n * allows the creation of custom validation functions. For example:\n *\n * var MyLink = React.createClass({\n * propTypes: {\n * // An optional string or URI prop named \"href\".\n * href: function(props, propName, componentName) {\n * var propValue = props[propName];\n * if (propValue != null && typeof propValue !== 'string' &&\n * !(propValue instanceof URI)) {\n * return new Error(\n * 'Expected a string or an URI for ' + propName + ' in ' +\n * componentName\n * );\n * }\n * }\n * },\n * render: function() {...}\n * });\n *\n * @internal\n */\n\n var ANONYMOUS = '<>';\n\n // Important!\n // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.\n var ReactPropTypes = {\n array: createPrimitiveTypeChecker('array'),\n bool: createPrimitiveTypeChecker('boolean'),\n func: createPrimitiveTypeChecker('function'),\n number: createPrimitiveTypeChecker('number'),\n object: createPrimitiveTypeChecker('object'),\n string: createPrimitiveTypeChecker('string'),\n symbol: createPrimitiveTypeChecker('symbol'),\n\n any: createAnyTypeChecker(),\n arrayOf: createArrayOfTypeChecker,\n element: createElementTypeChecker(),\n elementType: createElementTypeTypeChecker(),\n instanceOf: createInstanceTypeChecker,\n node: createNodeChecker(),\n objectOf: createObjectOfTypeChecker,\n oneOf: createEnumTypeChecker,\n oneOfType: createUnionTypeChecker,\n shape: createShapeTypeChecker,\n exact: createStrictShapeTypeChecker,\n };\n\n /**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n /*eslint-disable no-self-compare*/\n function is(x, y) {\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return x !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n }\n /*eslint-enable no-self-compare*/\n\n /**\n * We use an Error-like object for backward compatibility as people may call\n * PropTypes directly and inspect their output. However, we don't use real\n * Errors anymore. We don't inspect their stack anyway, and creating them\n * is prohibitively expensive if they are created too often, such as what\n * happens in oneOfType() for any type before the one that matched.\n */\n function PropTypeError(message) {\n this.message = message;\n this.stack = '';\n }\n // Make `instanceof Error` still work for returned errors.\n PropTypeError.prototype = Error.prototype;\n\n function createChainableTypeChecker(validate) {\n if (true) {\n var manualPropTypeCallCache = {};\n var manualPropTypeWarningCount = 0;\n }\n function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {\n componentName = componentName || ANONYMOUS;\n propFullName = propFullName || propName;\n\n if (secret !== ReactPropTypesSecret) {\n if (throwOnDirectAccess) {\n // New behavior only for users of `prop-types` package\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use `PropTypes.checkPropTypes()` to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n } else if ( true && typeof console !== 'undefined') {\n // Old behavior for people using React.PropTypes\n var cacheKey = componentName + ':' + propName;\n if (\n !manualPropTypeCallCache[cacheKey] &&\n // Avoid spamming the console because they are often not actionable except for lib authors\n manualPropTypeWarningCount < 3\n ) {\n printWarning(\n 'You are manually calling a React.PropTypes validation ' +\n 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +\n 'and will throw in the standalone `prop-types` package. ' +\n 'You may be seeing this warning due to a third-party PropTypes ' +\n 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'\n );\n manualPropTypeCallCache[cacheKey] = true;\n manualPropTypeWarningCount++;\n }\n }\n }\n if (props[propName] == null) {\n if (isRequired) {\n if (props[propName] === null) {\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));\n }\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));\n }\n return null;\n } else {\n return validate(props, propName, componentName, location, propFullName);\n }\n }\n\n var chainedCheckType = checkType.bind(null, false);\n chainedCheckType.isRequired = checkType.bind(null, true);\n\n return chainedCheckType;\n }\n\n function createPrimitiveTypeChecker(expectedType) {\n function validate(props, propName, componentName, location, propFullName, secret) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== expectedType) {\n // `propValue` being instance of, say, date/regexp, pass the 'object'\n // check, but we can offer a more precise error message here rather than\n // 'of type `object`'.\n var preciseType = getPreciseType(propValue);\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createAnyTypeChecker() {\n return createChainableTypeChecker(emptyFunctionThatReturnsNull);\n }\n\n function createArrayOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');\n }\n var propValue = props[propName];\n if (!Array.isArray(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));\n }\n for (var i = 0; i < propValue.length; i++) {\n var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!isValidElement(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!ReactIs.isValidElementType(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createInstanceTypeChecker(expectedClass) {\n function validate(props, propName, componentName, location, propFullName) {\n if (!(props[propName] instanceof expectedClass)) {\n var expectedClassName = expectedClass.name || ANONYMOUS;\n var actualClassName = getClassName(props[propName]);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createEnumTypeChecker(expectedValues) {\n if (!Array.isArray(expectedValues)) {\n if (true) {\n if (arguments.length > 1) {\n printWarning(\n 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +\n 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'\n );\n } else {\n printWarning('Invalid argument supplied to oneOf, expected an array.');\n }\n }\n return emptyFunctionThatReturnsNull;\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n for (var i = 0; i < expectedValues.length; i++) {\n if (is(propValue, expectedValues[i])) {\n return null;\n }\n }\n\n var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {\n var type = getPreciseType(value);\n if (type === 'symbol') {\n return String(value);\n }\n return value;\n });\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createObjectOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');\n }\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));\n }\n for (var key in propValue) {\n if (has(propValue, key)) {\n var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createUnionTypeChecker(arrayOfTypeCheckers) {\n if (!Array.isArray(arrayOfTypeCheckers)) {\n true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : undefined;\n return emptyFunctionThatReturnsNull;\n }\n\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (typeof checker !== 'function') {\n printWarning(\n 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +\n 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'\n );\n return emptyFunctionThatReturnsNull;\n }\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {\n return null;\n }\n }\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createNodeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n if (!isNode(props[propName])) {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n for (var key in shapeTypes) {\n var checker = shapeTypes[key];\n if (!checker) {\n continue;\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createStrictShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n // We need to check all keys in case some are required but missing from\n // props.\n var allKeys = assign({}, props[propName], shapeTypes);\n for (var key in allKeys) {\n var checker = shapeTypes[key];\n if (!checker) {\n return new PropTypeError(\n 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +\n '\\nBad object: ' + JSON.stringify(props[propName], null, ' ') +\n '\\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')\n );\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function isNode(propValue) {\n switch (typeof propValue) {\n case 'number':\n case 'string':\n case 'undefined':\n return true;\n case 'boolean':\n return !propValue;\n case 'object':\n if (Array.isArray(propValue)) {\n return propValue.every(isNode);\n }\n if (propValue === null || isValidElement(propValue)) {\n return true;\n }\n\n var iteratorFn = getIteratorFn(propValue);\n if (iteratorFn) {\n var iterator = iteratorFn.call(propValue);\n var step;\n if (iteratorFn !== propValue.entries) {\n while (!(step = iterator.next()).done) {\n if (!isNode(step.value)) {\n return false;\n }\n }\n } else {\n // Iterator will provide entry [k,v] tuples rather than values.\n while (!(step = iterator.next()).done) {\n var entry = step.value;\n if (entry) {\n if (!isNode(entry[1])) {\n return false;\n }\n }\n }\n }\n } else {\n return false;\n }\n\n return true;\n default:\n return false;\n }\n }\n\n function isSymbol(propType, propValue) {\n // Native Symbol.\n if (propType === 'symbol') {\n return true;\n }\n\n // falsy value can't be a Symbol\n if (!propValue) {\n return false;\n }\n\n // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'\n if (propValue['@@toStringTag'] === 'Symbol') {\n return true;\n }\n\n // Fallback for non-spec compliant Symbols which are polyfilled.\n if (typeof Symbol === 'function' && propValue instanceof Symbol) {\n return true;\n }\n\n return false;\n }\n\n // Equivalent of `typeof` but with special handling for array and regexp.\n function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }\n\n // This handles more types than `getPropType`. Only used for error messages.\n // See `createPrimitiveTypeChecker`.\n function getPreciseType(propValue) {\n if (typeof propValue === 'undefined' || propValue === null) {\n return '' + propValue;\n }\n var propType = getPropType(propValue);\n if (propType === 'object') {\n if (propValue instanceof Date) {\n return 'date';\n } else if (propValue instanceof RegExp) {\n return 'regexp';\n }\n }\n return propType;\n }\n\n // Returns a string that is postfixed to a warning about an invalid type.\n // For example, \"undefined\" or \"of type array\"\n function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }\n\n // Returns class name of the object, if any.\n function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }\n\n ReactPropTypes.checkPropTypes = checkPropTypes;\n ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n\n\n//# sourceURL=webpack:///./node_modules/prop-types/factoryWithTypeCheckers.js?"); /***/ }), /***/ "./node_modules/prop-types/index.js": /*!******************************************!*\ !*** ./node_modules/prop-types/index.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (true) {\n var ReactIs = __webpack_require__(/*! react-is */ \"./node_modules/react-is/index.js\");\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = __webpack_require__(/*! ./factoryWithTypeCheckers */ \"./node_modules/prop-types/factoryWithTypeCheckers.js\")(ReactIs.isElement, throwOnDirectAccess);\n} else {}\n\n\n//# sourceURL=webpack:///./node_modules/prop-types/index.js?"); /***/ }), /***/ "./node_modules/prop-types/lib/ReactPropTypesSecret.js": /*!*************************************************************!*\ !*** ./node_modules/prop-types/lib/ReactPropTypesSecret.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n\n\n//# sourceURL=webpack:///./node_modules/prop-types/lib/ReactPropTypesSecret.js?"); /***/ }), /***/ "./node_modules/raf/index.js": /*!***********************************!*\ !*** ./node_modules/raf/index.js ***! \***********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(global) {var now = __webpack_require__(/*! performance-now */ \"./node_modules/performance-now/lib/performance-now.js\")\n , root = typeof window === 'undefined' ? global : window\n , vendors = ['moz', 'webkit']\n , suffix = 'AnimationFrame'\n , raf = root['request' + suffix]\n , caf = root['cancel' + suffix] || root['cancelRequest' + suffix]\n\nfor(var i = 0; !raf && i < vendors.length; i++) {\n raf = root[vendors[i] + 'Request' + suffix]\n caf = root[vendors[i] + 'Cancel' + suffix]\n || root[vendors[i] + 'CancelRequest' + suffix]\n}\n\n// Some versions of FF have rAF but not cAF\nif(!raf || !caf) {\n var last = 0\n , id = 0\n , queue = []\n , frameDuration = 1000 / 60\n\n raf = function(callback) {\n if(queue.length === 0) {\n var _now = now()\n , next = Math.max(0, frameDuration - (_now - last))\n last = next + _now\n setTimeout(function() {\n var cp = queue.slice(0)\n // Clear queue here to prevent\n // callbacks from appending listeners\n // to the current frame's queue\n queue.length = 0\n for(var i = 0; i < cp.length; i++) {\n if(!cp[i].cancelled) {\n try{\n cp[i].callback(last)\n } catch(e) {\n setTimeout(function() { throw e }, 0)\n }\n }\n }\n }, Math.round(next))\n }\n queue.push({\n handle: ++id,\n callback: callback,\n cancelled: false\n })\n return id\n }\n\n caf = function(handle) {\n for(var i = 0; i < queue.length; i++) {\n if(queue[i].handle === handle) {\n queue[i].cancelled = true\n }\n }\n }\n}\n\nmodule.exports = function(fn) {\n // Wrap in a new function to prevent\n // `cancel` potentially being assigned\n // to the native rAF function\n return raf.call(root, fn)\n}\nmodule.exports.cancel = function() {\n caf.apply(root, arguments)\n}\nmodule.exports.polyfill = function(object) {\n if (!object) {\n object = root;\n }\n object.requestAnimationFrame = raf\n object.cancelAnimationFrame = caf\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/raf/index.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/DefaultEditor.js": /*!**************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/DefaultEditor.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _components = __webpack_require__(/*! ./components */ \"./node_modules/react-chart-editor/lib/components/index.js\");\n\nvar _default_panels = __webpack_require__(/*! ./default_panels */ \"./node_modules/react-chart-editor/lib/default_panels/index.js\");\n\nvar _StyleColorbarsPanel = __webpack_require__(/*! ./default_panels/StyleColorbarsPanel */ \"./node_modules/react-chart-editor/lib/default_panels/StyleColorbarsPanel.js\");\n\nvar _Logo = _interopRequireDefault(__webpack_require__(/*! ./components/widgets/Logo */ \"./node_modules/react-chart-editor/lib/components/widgets/Logo.js\"));\n\nvar _constants = __webpack_require__(/*! ./lib/constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar DefaultEditor = /*#__PURE__*/function (_Component) {\n _inherits(DefaultEditor, _Component);\n\n var _super = _createSuper(DefaultEditor);\n\n function DefaultEditor(props, context) {\n var _this;\n\n _classCallCheck(this, DefaultEditor);\n\n _this = _super.call(this, props, context);\n _this.hasTransforms = _this.hasTransforms.bind(_assertThisInitialized(_this));\n _this.hasAxes = _this.hasAxes.bind(_assertThisInitialized(_this));\n _this.hasMenus = _this.hasMenus.bind(_assertThisInitialized(_this));\n _this.hasSliders = _this.hasSliders.bind(_assertThisInitialized(_this));\n _this.hasColorbars = _this.hasColorbars.bind(_assertThisInitialized(_this));\n _this.hasLegend = _this.hasLegend.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(DefaultEditor, [{\n key: \"hasTransforms\",\n value: function hasTransforms() {\n return this.context.fullData.some(function (d) {\n return _constants.TRANSFORMABLE_TRACES.includes(d.type);\n });\n }\n }, {\n key: \"hasAxes\",\n value: function hasAxes() {\n var _this2 = this;\n\n return Object.keys(this.context.fullLayout._subplots).filter(function (type) {\n return !['cartesian', 'mapbox'].includes(type) && _this2.context.fullLayout._subplots[type].length > 0;\n }).length > 0;\n }\n }, {\n key: \"hasMenus\",\n value: function hasMenus() {\n var _this$context$fullLay = this.context.fullLayout.updatemenus,\n updatemenus = _this$context$fullLay === void 0 ? [] : _this$context$fullLay;\n return updatemenus.length > 0;\n }\n }, {\n key: \"hasSliders\",\n value: function hasSliders() {\n var _this$context$layout$ = this.context.layout.sliders,\n sliders = _this$context$layout$ === void 0 ? [] : _this$context$layout$;\n return sliders.length > 0;\n }\n }, {\n key: \"hasColorbars\",\n value: function hasColorbars() {\n return this.context.fullData.some(function (d) {\n return (0, _StyleColorbarsPanel.traceHasColorbar)({}, d);\n });\n }\n }, {\n key: \"hasLegend\",\n value: function hasLegend() {\n return this.context.fullData.some(function (t) {\n return t.showlegend !== undefined;\n }); // eslint-disable-line no-undefined\n }\n }, {\n key: \"hasMaps\",\n value: function hasMaps() {\n return this.context.fullData.some(function (d) {\n return [].concat(_toConsumableArray(_constants.TRACE_TO_AXIS.geo), _toConsumableArray(_constants.TRACE_TO_AXIS.mapbox)).includes(d.type);\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _ = this.context.localize;\n\n var logo = this.props.logoSrc && /*#__PURE__*/_react.default.createElement(_Logo.default, {\n src: this.props.logoSrc\n });\n\n return /*#__PURE__*/_react.default.createElement(_components.PanelMenuWrapper, {\n menuPanelOrder: this.props.menuPanelOrder\n }, logo ? logo : null, /*#__PURE__*/_react.default.createElement(_default_panels.GraphCreatePanel, {\n group: _('Structure'),\n name: _('Traces')\n }), /*#__PURE__*/_react.default.createElement(_default_panels.GraphSubplotsPanel, {\n group: _('Structure'),\n name: _('Subplots')\n }), this.hasTransforms() && /*#__PURE__*/_react.default.createElement(_default_panels.GraphTransformsPanel, {\n group: _('Structure'),\n name: _('Transforms')\n }), /*#__PURE__*/_react.default.createElement(_default_panels.StyleLayoutPanel, {\n group: _('Style'),\n name: _('General')\n }), /*#__PURE__*/_react.default.createElement(_default_panels.StyleTracesPanel, {\n group: _('Style'),\n name: _('Traces')\n }), this.hasAxes() && /*#__PURE__*/_react.default.createElement(_default_panels.StyleAxesPanel, {\n group: _('Style'),\n name: _('Axes')\n }), this.hasMaps() && /*#__PURE__*/_react.default.createElement(_default_panels.StyleMapsPanel, {\n group: _('Style'),\n name: _('Maps')\n }), this.hasLegend() && /*#__PURE__*/_react.default.createElement(_default_panels.StyleLegendPanel, {\n group: _('Style'),\n name: _('Legend')\n }), this.hasColorbars() && /*#__PURE__*/_react.default.createElement(_default_panels.StyleColorbarsPanel, {\n group: _('Style'),\n name: _('Color Bars')\n }), /*#__PURE__*/_react.default.createElement(_default_panels.StyleNotesPanel, {\n group: _('Annotate'),\n name: _('Text')\n }), /*#__PURE__*/_react.default.createElement(_default_panels.StyleShapesPanel, {\n group: _('Annotate'),\n name: _('Shapes')\n }), /*#__PURE__*/_react.default.createElement(_default_panels.StyleImagesPanel, {\n group: _('Annotate'),\n name: _('Images')\n }), this.hasSliders() && /*#__PURE__*/_react.default.createElement(_default_panels.StyleSlidersPanel, {\n group: _('Control'),\n name: _('Sliders')\n }), this.hasMenus() && /*#__PURE__*/_react.default.createElement(_default_panels.StyleUpdateMenusPanel, {\n group: _('Control'),\n name: _('Menus')\n }), this.props.children ? this.props.children : null);\n }\n }]);\n\n return DefaultEditor;\n}(_react.Component);\n\nDefaultEditor.propTypes = {\n children: _propTypes.default.node,\n logoSrc: _propTypes.default.string,\n menuPanelOrder: _propTypes.default.array\n};\nDefaultEditor.contextTypes = {\n localize: _propTypes.default.func,\n fullData: _propTypes.default.array,\n fullLayout: _propTypes.default.object,\n layout: _propTypes.default.object\n};\nvar _default = DefaultEditor;\nexports.default = _default;\n//# sourceMappingURL=DefaultEditor.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/DefaultEditor.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/EditorControls.js": /*!***************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/EditorControls.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _DefaultEditor = _interopRequireDefault(__webpack_require__(/*! ./DefaultEditor */ \"./node_modules/react-chart-editor/lib/DefaultEditor.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ./lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _shame = __webpack_require__(/*! ./shame */ \"./node_modules/react-chart-editor/lib/shame.js\");\n\nvar _constants = __webpack_require__(/*! ./lib/constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nvar _fastIsnumeric = _interopRequireDefault(__webpack_require__(/*! fast-isnumeric */ \"./node_modules/fast-isnumeric/index.js\"));\n\nvar _nested_property = _interopRequireDefault(__webpack_require__(/*! plotly.js/src/lib/nested_property */ \"./node_modules/plotly.js/src/lib/nested_property.js\"));\n\nvar _traceTypes = __webpack_require__(/*! ./lib/traceTypes */ \"./node_modules/react-chart-editor/lib/lib/traceTypes.js\");\n\nvar _containers = __webpack_require__(/*! ./components/containers */ \"./node_modules/react-chart-editor/lib/components/containers/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar EditorControls = /*#__PURE__*/function (_Component) {\n _inherits(EditorControls, _Component);\n\n var _super = _createSuper(EditorControls);\n\n function EditorControls(props, context) {\n var _this;\n\n _classCallCheck(this, EditorControls);\n\n _this = _super.call(this, props, context);\n\n _this.localize = function (key) {\n return (0, _lib.localizeString)(_this.props.dictionaries || {}, _this.props.locale, key);\n }; // we only need to compute this once.\n\n\n if (_this.props.plotly) {\n _this.plotSchema = _this.props.plotly.PlotSchema.get();\n }\n\n return _this;\n }\n\n _createClass(EditorControls, [{\n key: \"getChildContext\",\n value: function getChildContext() {\n var gd = this.props.graphDiv || {};\n return {\n advancedTraceTypeSelector: this.props.advancedTraceTypeSelector,\n config: gd._context,\n srcConverters: this.props.srcConverters,\n data: gd.data,\n dataSourceComponents: this.props.dataSourceComponents,\n dataSourceOptions: this.props.dataSourceOptions,\n dataSources: this.props.dataSources,\n dictionaries: this.props.dictionaries || {},\n localize: this.localize,\n frames: gd._transitionData ? gd._transitionData._frames : [],\n fullData: gd._fullData,\n fullLayout: gd._fullLayout,\n graphDiv: gd,\n layout: gd.layout,\n locale: this.props.locale,\n onUpdate: this.handleUpdate.bind(this),\n plotSchema: this.plotSchema,\n plotly: this.props.plotly,\n traceTypesConfig: this.props.traceTypesConfig,\n showFieldTooltips: this.props.showFieldTooltips,\n glByDefault: this.props.glByDefault,\n mapBoxAccess: this.props.mapBoxAccess,\n fontOptions: this.props.fontOptions,\n chartHelp: this.props.chartHelp,\n customConfig: this.props.customConfig,\n hasValidCustomConfigVisibilityRules: (0, _lib.hasValidCustomConfigVisibilityRules)(this.props.customConfig)\n };\n }\n }, {\n key: \"handleUpdate\",\n value: function handleUpdate(_ref) {\n var type = _ref.type,\n payload = _ref.payload;\n var graphDiv = this.props.graphDiv;\n\n switch (type) {\n case _constants.EDITOR_ACTIONS.UPDATE_TRACES:\n if (this.props.beforeUpdateTraces) {\n this.props.beforeUpdateTraces(payload);\n }\n\n (0, _shame.shamefullyAdjustSizeref)(graphDiv, payload);\n (0, _shame.shamefullyAdjustAxisDirection)(graphDiv, payload);\n (0, _shame.shamefullyClearAxisTypes)(graphDiv, payload);\n (0, _shame.shamefullyAdjustAxisRef)(graphDiv, payload);\n (0, _shame.shamefullyAddTableColumns)(graphDiv, payload);\n (0, _shame.shamefullyAdjustSplitStyleTargetContainers)(graphDiv, payload);\n\n if (!this.props.mapBoxAccess) {\n (0, _shame.shamefullyAdjustMapbox)(graphDiv, payload);\n }\n\n for (var i = 0; i < payload.traceIndexes.length; i++) {\n var _loop = function _loop(attr) {\n var traceIndex = payload.traceIndexes[i];\n var splitTraceGroup = payload.splitTraceGroup ? payload.splitTraceGroup.toString() : null;\n var props = [(0, _nested_property.default)(graphDiv.data[traceIndex], attr)];\n var value = payload.update[attr];\n\n if (splitTraceGroup) {\n props = (0, _shame.shamefullyCreateSplitStyleProps)(graphDiv, attr, traceIndex, splitTraceGroup);\n }\n\n props.forEach(function (p) {\n if (value !== void 0) {\n p.set(value);\n }\n });\n };\n\n for (var attr in payload.update) {\n _loop(attr);\n }\n }\n\n if (this.props.afterUpdateTraces) {\n this.props.afterUpdateTraces(payload);\n }\n\n if (this.props.onUpdate) {\n this.props.onUpdate(graphDiv.data.slice(), graphDiv.layout, graphDiv._transitionData._frames);\n }\n\n break;\n\n case _constants.EDITOR_ACTIONS.UPDATE_LAYOUT:\n (0, _shame.shamefullyAdjustGeo)(graphDiv, payload);\n\n if (this.props.beforeUpdateLayout) {\n this.props.beforeUpdateLayout(payload);\n }\n\n for (var _attr in payload.update) {\n var prop = (0, _nested_property.default)(graphDiv.layout, _attr);\n var value = payload.update[_attr];\n\n if (value !== void 0) {\n prop.set(value);\n }\n }\n\n if (this.props.afterUpdateLayout) {\n this.props.afterUpdateLayout(payload);\n }\n\n if (this.props.onUpdate) {\n this.props.onUpdate(graphDiv.data, Object.assign({}, graphDiv.layout), graphDiv._transitionData._frames);\n }\n\n break;\n\n case _constants.EDITOR_ACTIONS.ADD_TRACE:\n if (this.props.beforeAddTrace) {\n this.props.beforeAddTrace(payload);\n } // can't use default prop because plotly.js mutates it:\n // https://github.com/plotly/react-chart-editor/issues/509\n\n\n if (graphDiv.data.length === 0) {\n graphDiv.data.push(this.props.makeDefaultTrace ? this.props.makeDefaultTrace() : {\n type: \"scatter\".concat(this.props.glByDefault ? 'gl' : ''),\n mode: 'markers'\n });\n } else {\n var prevTrace = graphDiv.data[graphDiv.data.length - 1];\n var prevTraceType = (0, _lib.plotlyTraceToCustomTrace)(prevTrace);\n graphDiv.data.push((0, _lib.traceTypeToPlotlyInitFigure)(prevTraceType, prevTrace.type && prevTrace.type.endsWith('gl') ? 'gl' : ''));\n }\n\n if (this.props.afterAddTrace) {\n this.props.afterAddTrace(payload);\n }\n\n if (this.props.onUpdate) {\n this.props.onUpdate(graphDiv.data.slice(), graphDiv.layout, graphDiv._transitionData._frames);\n }\n\n break;\n\n case _constants.EDITOR_ACTIONS.DELETE_TRACE:\n if (payload.traceIndexes && payload.traceIndexes.length) {\n if (this.props.beforeDeleteTrace) {\n this.props.beforeDeleteTrace(payload);\n }\n\n (0, _shame.shamefullyAdjustAxisRef)(graphDiv, payload);\n (0, _shame.shamefullyDeleteRelatedAnalysisTransforms)(graphDiv, payload);\n graphDiv.data.splice(payload.traceIndexes[0], 1);\n\n if (this.props.afterDeleteTrace) {\n this.props.afterDeleteTrace(payload);\n }\n\n if (this.props.onUpdate) {\n this.props.onUpdate(graphDiv.data.slice(), graphDiv.layout, graphDiv._transitionData._frames);\n }\n }\n\n break;\n\n case _constants.EDITOR_ACTIONS.DELETE_ANNOTATION:\n if ((0, _fastIsnumeric.default)(payload.annotationIndex)) {\n if (this.props.beforeDeleteAnnotation) {\n this.props.beforeDeleteAnnotation(payload);\n }\n\n graphDiv.layout.annotations.splice(payload.annotationIndex, 1);\n\n if (this.props.afterDeleteAnnotation) {\n this.props.afterDeleteAnnotation(payload);\n }\n\n if (this.props.onUpdate) {\n this.props.onUpdate(graphDiv.data, Object.assign({}, graphDiv.layout), graphDiv._transitionData._frames);\n }\n }\n\n break;\n\n case _constants.EDITOR_ACTIONS.DELETE_SHAPE:\n if ((0, _fastIsnumeric.default)(payload.shapeIndex)) {\n if (this.props.beforeDeleteShape) {\n this.props.beforeDeleteShape(payload);\n }\n\n graphDiv.layout.shapes.splice(payload.shapeIndex, 1);\n\n if (this.props.afterDeleteShape) {\n this.props.afterDeleteShape(payload);\n }\n\n if (this.props.onUpdate) {\n this.props.onUpdate(graphDiv.data, Object.assign({}, graphDiv.layout), graphDiv._transitionData._frames);\n }\n }\n\n break;\n\n case _constants.EDITOR_ACTIONS.DELETE_IMAGE:\n if ((0, _fastIsnumeric.default)(payload.imageIndex)) {\n if (this.props.beforeDeleteImage) {\n this.props.beforeDeleteImage(payload);\n }\n\n graphDiv.layout.images.splice(payload.imageIndex, 1);\n\n if (this.props.afterDeleteImage) {\n this.props.afterDeleteImage(payload);\n }\n\n if (this.props.onUpdate) {\n this.props.onUpdate(graphDiv.data, Object.assign({}, graphDiv.layout), graphDiv._transitionData._frames);\n }\n }\n\n break;\n\n case _constants.EDITOR_ACTIONS.DELETE_RANGESELECTOR:\n if ((0, _fastIsnumeric.default)(payload.rangeselectorIndex)) {\n graphDiv.layout[payload.axisId].rangeselector.buttons.splice(payload.rangeselectorIndex, 1);\n\n if (this.props.onUpdate) {\n this.props.onUpdate(graphDiv.data, Object.assign({}, graphDiv.layout), graphDiv._transitionData._frames);\n }\n }\n\n break;\n\n case _constants.EDITOR_ACTIONS.DELETE_MAPBOXLAYER:\n if ((0, _fastIsnumeric.default)(payload.mapboxLayerIndex)) {\n graphDiv.layout[payload.mapboxId].layers.splice(payload.mapboxLayerIndex, 1);\n\n if (this.props.onUpdate) {\n this.props.onUpdate(graphDiv.data, Object.assign({}, graphDiv.layout), graphDiv._transitionData._frames);\n }\n }\n\n break;\n\n case _constants.EDITOR_ACTIONS.DELETE_TRANSFORM:\n if ((0, _fastIsnumeric.default)(payload.transformIndex) && payload.traceIndex < graphDiv.data.length) {\n if (graphDiv.data[payload.traceIndex].transforms.length === 1) {\n delete graphDiv.data[payload.traceIndex].transforms;\n } else {\n graphDiv.data[payload.traceIndex].transforms.splice(payload.transformIndex, 1);\n }\n\n if (this.props.onUpdate) {\n this.props.onUpdate(graphDiv.data.slice(), graphDiv.layout, graphDiv._transitionData._frames);\n }\n }\n\n break;\n\n case _constants.EDITOR_ACTIONS.MOVE_TO:\n // checking if fromIndex and toIndex is a number because\n // gives errors if index is 0 (falsy value)\n if (payload.path && !isNaN(payload.fromIndex) && !isNaN(payload.toIndex)) {\n function move(container) {\n var movedEl = container[payload.fromIndex];\n var replacedEl = container[payload.toIndex];\n container[payload.toIndex] = movedEl;\n container[payload.fromIndex] = replacedEl;\n }\n\n if (payload.path === 'data') {\n move(graphDiv.data);\n }\n\n if (payload.path === 'layout.images') {\n move(graphDiv.layout.images);\n }\n\n if (payload.path === 'layout.shapes') {\n move(graphDiv.layout.shapes);\n }\n\n if (payload.path === 'layout.annotations') {\n move(graphDiv.layout.annotations);\n }\n\n if (payload.path === 'layout.mapbox.layers') {\n move(graphDiv.layout[payload.mapboxId].layers);\n }\n\n var updatedData = payload.path.startsWith('data') ? graphDiv.data.slice() : graphDiv.data;\n var updatedLayout = payload.path.startsWith('layout') ? Object.assign({}, graphDiv.layout) : graphDiv.layout;\n\n if (this.props.onUpdate) {\n this.props.onUpdate(updatedData, updatedLayout, graphDiv._transitionData._frames);\n }\n }\n\n break;\n\n default:\n throw new Error(this.localize('must specify an action type to handleEditorUpdate'));\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: (0, _lib.bem)('editor_controls') + ' plotly-editor--theme-provider' + \"\".concat(this.props.className ? \" \".concat(this.props.className) : '')\n }, /*#__PURE__*/_react.default.createElement(_containers.ModalProvider, null, this.props.graphDiv && this.props.graphDiv._fullLayout && (this.props.children ? this.props.children : /*#__PURE__*/_react.default.createElement(_DefaultEditor.default, null))));\n }\n }]);\n\n return EditorControls;\n}(_react.Component);\n\nEditorControls.propTypes = {\n advancedTraceTypeSelector: _propTypes.default.bool,\n afterAddTrace: _propTypes.default.func,\n afterDeleteAnnotation: _propTypes.default.func,\n afterDeleteShape: _propTypes.default.func,\n afterDeleteImage: _propTypes.default.func,\n afterDeleteTrace: _propTypes.default.func,\n afterUpdateLayout: _propTypes.default.func,\n afterUpdateTraces: _propTypes.default.func,\n beforeAddTrace: _propTypes.default.func,\n beforeDeleteAnnotation: _propTypes.default.func,\n beforeDeleteShape: _propTypes.default.func,\n beforeDeleteImage: _propTypes.default.func,\n beforeDeleteTrace: _propTypes.default.func,\n beforeUpdateLayout: _propTypes.default.func,\n beforeUpdateTraces: _propTypes.default.func,\n children: _propTypes.default.node,\n className: _propTypes.default.string,\n srcConverters: _propTypes.default.shape({\n toSrc: _propTypes.default.func.isRequired,\n fromSrc: _propTypes.default.func.isRequired\n }),\n dataSourceComponents: _propTypes.default.object,\n dataSourceOptions: _propTypes.default.array,\n dataSources: _propTypes.default.object,\n dictionaries: _propTypes.default.object,\n graphDiv: _propTypes.default.object,\n locale: _propTypes.default.string,\n onUpdate: _propTypes.default.func,\n plotly: _propTypes.default.object,\n showFieldTooltips: _propTypes.default.bool,\n traceTypesConfig: _propTypes.default.object,\n makeDefaultTrace: _propTypes.default.func,\n glByDefault: _propTypes.default.bool,\n mapBoxAccess: _propTypes.default.bool,\n fontOptions: _propTypes.default.array,\n chartHelp: _propTypes.default.object,\n customConfig: _propTypes.default.object\n};\nEditorControls.defaultProps = {\n showFieldTooltips: false,\n locale: 'en',\n traceTypesConfig: {\n categories: function categories(_) {\n return (0, _traceTypes.categoryLayout)(_);\n },\n traces: function traces(_) {\n return (0, _traceTypes.traceTypes)(_);\n },\n complex: true\n },\n fontOptions: _constants.DEFAULT_FONTS\n};\nEditorControls.childContextTypes = {\n advancedTraceTypeSelector: _propTypes.default.bool,\n config: _propTypes.default.object,\n srcConverters: _propTypes.default.shape({\n toSrc: _propTypes.default.func.isRequired,\n fromSrc: _propTypes.default.func.isRequired\n }),\n data: _propTypes.default.array,\n dataSourceComponents: _propTypes.default.object,\n dataSourceOptions: _propTypes.default.array,\n dataSources: _propTypes.default.object,\n dictionaries: _propTypes.default.object,\n frames: _propTypes.default.array,\n fullData: _propTypes.default.array,\n fullLayout: _propTypes.default.object,\n graphDiv: _propTypes.default.any,\n layout: _propTypes.default.object,\n locale: _propTypes.default.string,\n localize: _propTypes.default.func,\n onUpdate: _propTypes.default.func,\n plotly: _propTypes.default.object,\n plotSchema: _propTypes.default.object,\n traceTypesConfig: _propTypes.default.object,\n showFieldTooltips: _propTypes.default.bool,\n glByDefault: _propTypes.default.bool,\n mapBoxAccess: _propTypes.default.bool,\n fontOptions: _propTypes.default.array,\n chartHelp: _propTypes.default.object,\n customConfig: _propTypes.default.object,\n hasValidCustomConfigVisibilityRules: _propTypes.default.bool\n};\nvar _default = EditorControls;\nexports.default = _default;\n//# sourceMappingURL=EditorControls.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/EditorControls.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/PlotlyEditor.js": /*!*************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/PlotlyEditor.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _factory = _interopRequireDefault(__webpack_require__(/*! react-plotly.js/factory */ \"./node_modules/react-plotly.js/factory.js\"));\n\nvar _EditorControls = _interopRequireDefault(__webpack_require__(/*! ./EditorControls */ \"./node_modules/react-chart-editor/lib/EditorControls.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _constants = __webpack_require__(/*! ./lib/constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar PlotlyEditor = /*#__PURE__*/function (_Component) {\n _inherits(PlotlyEditor, _Component);\n\n var _super = _createSuper(PlotlyEditor);\n\n function PlotlyEditor(props) {\n var _this;\n\n _classCallCheck(this, PlotlyEditor);\n\n _this = _super.call(this);\n _this.state = {\n graphDiv: {}\n };\n _this.PlotComponent = (0, _factory.default)(props.plotly);\n _this.handleRender = _this.handleRender.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(PlotlyEditor, [{\n key: \"handleRender\",\n value: function handleRender(fig, graphDiv) {\n this.setState({\n graphDiv: graphDiv\n });\n\n if (this.props.onRender) {\n this.props.onRender(graphDiv.data, graphDiv.layout, graphDiv._transitionData._frames);\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"plotly_editor\"\n }, !this.props.hideControls && /*#__PURE__*/_react.default.createElement(_EditorControls.default, {\n graphDiv: this.state.graphDiv,\n dataSources: this.props.dataSources,\n dataSourceOptions: this.props.dataSourceOptions,\n plotly: this.props.plotly,\n onUpdate: this.props.onUpdate,\n advancedTraceTypeSelector: this.props.advancedTraceTypeSelector,\n locale: this.props.locale,\n traceTypesConfig: this.props.traceTypesConfig,\n dictionaries: this.props.dictionaries,\n showFieldTooltips: this.props.showFieldTooltips,\n srcConverters: this.props.srcConverters,\n makeDefaultTrace: this.props.makeDefaultTrace,\n glByDefault: this.props.glByDefault,\n mapBoxAccess: Boolean(this.props.config && this.props.config.mapboxAccessToken),\n fontOptions: this.props.fontOptions,\n chartHelp: this.props.chartHelp,\n customConfig: this.props.customConfig\n }, this.props.children), /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"plotly_editor_plot\",\n style: {\n width: '100%',\n height: '100%'\n }\n }, /*#__PURE__*/_react.default.createElement(this.PlotComponent, {\n data: this.props.data,\n layout: this.props.layout,\n frames: this.props.frames,\n config: this.props.config,\n useResizeHandler: this.props.useResizeHandler,\n debug: this.props.debug,\n onInitialized: this.handleRender,\n onUpdate: this.handleRender,\n style: {\n width: '100%',\n height: '100%'\n },\n divId: this.props.divId\n })));\n }\n }]);\n\n return PlotlyEditor;\n}(_react.Component);\n\nPlotlyEditor.propTypes = {\n children: _propTypes.default.any,\n layout: _propTypes.default.object,\n data: _propTypes.default.array,\n config: _propTypes.default.object,\n dataSourceOptions: _propTypes.default.array,\n dataSources: _propTypes.default.object,\n frames: _propTypes.default.array,\n onUpdate: _propTypes.default.func,\n onRender: _propTypes.default.func,\n plotly: _propTypes.default.object,\n useResizeHandler: _propTypes.default.bool,\n debug: _propTypes.default.bool,\n advancedTraceTypeSelector: _propTypes.default.bool,\n locale: _propTypes.default.string,\n traceTypesConfig: _propTypes.default.object,\n dictionaries: _propTypes.default.object,\n divId: _propTypes.default.string,\n hideControls: _propTypes.default.bool,\n showFieldTooltips: _propTypes.default.bool,\n srcConverters: _propTypes.default.shape({\n toSrc: _propTypes.default.func.isRequired,\n fromSrc: _propTypes.default.func.isRequired\n }),\n makeDefaultTrace: _propTypes.default.func,\n glByDefault: _propTypes.default.bool,\n fontOptions: _propTypes.default.array,\n chartHelp: _propTypes.default.object,\n customConfig: _propTypes.default.object\n};\nPlotlyEditor.defaultProps = {\n hideControls: false,\n showFieldTooltips: false,\n fontOptions: _constants.DEFAULT_FONTS\n};\nvar _default = PlotlyEditor;\nexports.default = _default;\n//# sourceMappingURL=PlotlyEditor.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/PlotlyEditor.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/PanelMenuWrapper.js": /*!****************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/PanelMenuWrapper.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _SidebarGroup = _interopRequireDefault(__webpack_require__(/*! ./sidebar/SidebarGroup */ \"./node_modules/react-chart-editor/lib/components/sidebar/SidebarGroup.js\"));\n\nvar _lib = __webpack_require__(/*! ../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _sortMenu = _interopRequireDefault(__webpack_require__(/*! ../lib/sortMenu */ \"./node_modules/react-chart-editor/lib/lib/sortMenu.js\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar PanelsWithSidebar = /*#__PURE__*/function (_Component) {\n _inherits(PanelsWithSidebar, _Component);\n\n var _super = _createSuper(PanelsWithSidebar);\n\n function PanelsWithSidebar(props) {\n var _this;\n\n _classCallCheck(this, PanelsWithSidebar);\n\n _this = _super.call(this, props);\n\n var opts = _this.computeMenuOptions(props);\n\n var firstSidebarGroup = opts.filter(function (o) {\n return o.panels;\n })[0];\n _this.state = {\n group: firstSidebarGroup.name,\n panel: firstSidebarGroup.panels[0]\n };\n _this.setPanel = _this.setPanel.bind(_assertThisInitialized(_this));\n _this.renderSection = _this.renderSection.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(PanelsWithSidebar, [{\n key: \"setPanel\",\n value: function setPanel(group, panel) {\n this.setState({\n group: group,\n panel: panel\n });\n }\n }, {\n key: \"getChildContext\",\n value: function getChildContext() {\n return {\n setPanel: this.setPanel\n };\n }\n }, {\n key: \"renderSection\",\n value: function renderSection(section, i) {\n if (section.type && (section.type.plotly_editor_traits || {}).sidebar_element) {\n return /*#__PURE__*/(0, _react.cloneElement)(section, {\n key: i\n });\n }\n\n return /*#__PURE__*/_react.default.createElement(_SidebarGroup.default, {\n key: i,\n selectedGroup: this.state.group,\n selectedPanel: this.state.panel,\n group: section.name,\n panels: section.panels,\n onChangeGroup: this.setPanel\n });\n }\n }, {\n key: \"computeMenuOptions\",\n value: function computeMenuOptions(props) {\n var children = props.children,\n menuPanelOrder = props.menuPanelOrder;\n var sections = [];\n var groupLookup = {};\n var groupIndex;\n var childrenArray = (0, _sortMenu.default)(_react.default.Children.toArray(children), menuPanelOrder);\n childrenArray.forEach(function (child) {\n if (!child) {\n return;\n }\n\n var group = child.props.group;\n var name = child.props.name;\n\n if (group && name) {\n var obj;\n\n if (groupLookup.hasOwnProperty(group)) {\n groupIndex = groupLookup[group];\n obj = sections[groupIndex];\n } else {\n groupLookup[group] = sections.length;\n obj = {\n name: group,\n panels: []\n };\n sections.push(obj);\n }\n\n obj.panels.push(name);\n }\n\n if ((child.type.plotly_editor_traits || {}).sidebar_element) {\n sections.push(child);\n }\n });\n return sections;\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var menuOpts = this.computeMenuOptions(this.props);\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: (0, _lib.bem)('editor_controls', 'wrapper')\n }, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: (0, _lib.bem)('sidebar')\n }, menuOpts.map(this.renderSection)), _react.default.Children.map(this.props.children, function (child, i) {\n return child === null || _this2.state.group !== child.props.group || _this2.state.panel !== child.props.name ? null : /*#__PURE__*/(0, _react.cloneElement)(child, {\n key: i\n });\n }));\n }\n }]);\n\n return PanelsWithSidebar;\n}(_react.Component);\n\nPanelsWithSidebar.propTypes = {\n children: _propTypes.default.node,\n menuPanelOrder: _propTypes.default.array\n};\nPanelsWithSidebar.childContextTypes = {\n setPanel: _propTypes.default.func\n};\nvar _default = PanelsWithSidebar;\nexports.default = _default;\n//# sourceMappingURL=PanelMenuWrapper.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/PanelMenuWrapper.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/containers/AnnotationAccordion.js": /*!******************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/containers/AnnotationAccordion.js ***! \******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _PlotlyFold = _interopRequireDefault(__webpack_require__(/*! ./PlotlyFold */ \"./node_modules/react-chart-editor/lib/components/containers/PlotlyFold.js\"));\n\nvar _derived = __webpack_require__(/*! ./derived */ \"./node_modules/react-chart-editor/lib/components/containers/derived.js\");\n\nvar _PanelEmpty = __webpack_require__(/*! ./PanelEmpty */ \"./node_modules/react-chart-editor/lib/components/containers/PanelEmpty.js\");\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar AnnotationFold = (0, _lib.connectAnnotationToLayout)(_PlotlyFold.default);\n\nvar AnnotationAccordion = /*#__PURE__*/function (_Component) {\n _inherits(AnnotationAccordion, _Component);\n\n var _super = _createSuper(AnnotationAccordion);\n\n function AnnotationAccordion() {\n _classCallCheck(this, AnnotationAccordion);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(AnnotationAccordion, [{\n key: \"render\",\n value: function render() {\n var _this$context = this.context,\n _this$context$layout = _this$context.layout,\n _this$context$layout$ = _this$context$layout.annotations,\n annotations = _this$context$layout$ === void 0 ? [] : _this$context$layout$,\n _this$context$layout$2 = _this$context$layout.meta,\n meta = _this$context$layout$2 === void 0 ? [] : _this$context$layout$2,\n _ = _this$context.localize;\n var _this$props = this.props,\n canAdd = _this$props.canAdd,\n children = _this$props.children,\n canReorder = _this$props.canReorder;\n var content = annotations.length && annotations.map(function (ann, i) {\n return /*#__PURE__*/_react.default.createElement(AnnotationFold, {\n key: i,\n annotationIndex: i,\n name: (0, _lib.getParsedTemplateString)(ann.text, {\n meta: meta\n }),\n canDelete: canAdd\n }, children);\n });\n var addAction = {\n label: _('Annotation'),\n handler: function handler(_ref) {\n var layout = _ref.layout,\n updateContainer = _ref.updateContainer;\n var annotationIndex;\n\n if (Array.isArray(layout.annotations)) {\n annotationIndex = layout.annotations.length;\n } else {\n annotationIndex = 0;\n }\n\n var key = \"annotations[\".concat(annotationIndex, \"]\");\n var value = {\n text: _('new text')\n };\n\n if (updateContainer) {\n updateContainer(_defineProperty({}, key, value));\n }\n }\n };\n return /*#__PURE__*/_react.default.createElement(_derived.LayoutPanel, {\n addAction: canAdd ? addAction : null,\n canReorder: canReorder\n }, content ? content : /*#__PURE__*/_react.default.createElement(_PanelEmpty.PanelMessage, {\n heading: _('Call out your data.')\n }, /*#__PURE__*/_react.default.createElement(\"p\", null, _('Annotations are text and arrows you can use to point out specific parts of your figure.')), /*#__PURE__*/_react.default.createElement(\"p\", null, _('Click on the + button above to add an annotation.'))));\n }\n }]);\n\n return AnnotationAccordion;\n}(_react.Component);\n\nAnnotationAccordion.contextTypes = {\n layout: _propTypes.default.object,\n localize: _propTypes.default.func\n};\nAnnotationAccordion.propTypes = {\n children: _propTypes.default.node,\n canAdd: _propTypes.default.bool,\n canReorder: _propTypes.default.bool\n};\nvar _default = AnnotationAccordion;\nexports.default = _default;\n//# sourceMappingURL=AnnotationAccordion.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/containers/AnnotationAccordion.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/containers/AxesFold.js": /*!*******************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/containers/AxesFold.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _AxesSelector = _interopRequireDefault(__webpack_require__(/*! ../fields/AxesSelector */ \"./node_modules/react-chart-editor/lib/components/fields/AxesSelector.js\"));\n\nvar _PlotlyFold = _interopRequireDefault(__webpack_require__(/*! ./PlotlyFold */ \"./node_modules/react-chart-editor/lib/components/containers/PlotlyFold.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar AxesFold = /*#__PURE__*/function (_Component) {\n _inherits(AxesFold, _Component);\n\n var _super = _createSuper(AxesFold);\n\n function AxesFold() {\n _classCallCheck(this, AxesFold);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(AxesFold, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n children = _this$props.children,\n options = _this$props.options;\n return options.length && children ? /*#__PURE__*/_react.default.createElement(_PlotlyFold.default, this.props, options.length === 1 ? null : /*#__PURE__*/_react.default.createElement(_AxesSelector.default, {\n axesOptions: options\n }), children) : null;\n }\n }]);\n\n return AxesFold;\n}(_react.Component);\n\nAxesFold.propTypes = {\n children: _propTypes.default.any,\n options: _propTypes.default.array\n};\nAxesFold.plotly_editor_traits = {\n foldable: true\n};\n\nvar _default = (0, _lib.connectAxesToLayout)(AxesFold);\n\nexports.default = _default;\n//# sourceMappingURL=AxesFold.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/containers/AxesFold.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/containers/FoldEmpty.js": /*!********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/containers/FoldEmpty.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar FoldEmpty = /*#__PURE__*/function (_Component) {\n _inherits(FoldEmpty, _Component);\n\n var _super = _createSuper(FoldEmpty);\n\n function FoldEmpty() {\n _classCallCheck(this, FoldEmpty);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(FoldEmpty, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n children = _this$props.children,\n Icon = _this$props.icon,\n messagePrimary = _this$props.messagePrimary,\n messageSecondary = _this$props.messageSecondary;\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"fold__content__empty\"\n }, Icon ? /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"fold__content__empty__icon\"\n }, /*#__PURE__*/_react.default.createElement(Icon, null)) : null, messagePrimary ? /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"fold__content__empty__message__primary\"\n }, messagePrimary) : null, messageSecondary ? /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"fold__content__empty__message__secondary\"\n }, messageSecondary) : null, children ? children : null);\n }\n }]);\n\n return FoldEmpty;\n}(_react.Component);\n\nexports.default = FoldEmpty;\nFoldEmpty.propTypes = {\n messagePrimary: _propTypes.default.string,\n messageSecondary: _propTypes.default.string,\n children: _propTypes.default.node,\n icon: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func])\n};\n//# sourceMappingURL=FoldEmpty.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/containers/FoldEmpty.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/containers/ImageAccordion.js": /*!*************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/containers/ImageAccordion.js ***! \*************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _PlotlyFold = _interopRequireDefault(__webpack_require__(/*! ./PlotlyFold */ \"./node_modules/react-chart-editor/lib/components/containers/PlotlyFold.js\"));\n\nvar _derived = __webpack_require__(/*! ./derived */ \"./node_modules/react-chart-editor/lib/components/containers/derived.js\");\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _PanelEmpty = __webpack_require__(/*! ./PanelEmpty */ \"./node_modules/react-chart-editor/lib/components/containers/PanelEmpty.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar ImageFold = (0, _lib.connectImageToLayout)(_PlotlyFold.default);\n\nvar ImageAccordion = /*#__PURE__*/function (_Component) {\n _inherits(ImageAccordion, _Component);\n\n var _super = _createSuper(ImageAccordion);\n\n function ImageAccordion() {\n _classCallCheck(this, ImageAccordion);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(ImageAccordion, [{\n key: \"render\",\n value: function render() {\n var _this$context = this.context,\n _this$context$layout$ = _this$context.layout.images,\n images = _this$context$layout$ === void 0 ? [] : _this$context$layout$,\n _ = _this$context.localize;\n var _this$props = this.props,\n canAdd = _this$props.canAdd,\n children = _this$props.children,\n canReorder = _this$props.canReorder;\n var content = images.length && images.map(function (img, i) {\n return /*#__PURE__*/_react.default.createElement(ImageFold, {\n key: i,\n imageIndex: i,\n name: \"\".concat(_('Image'), \" \").concat(i + 1),\n canDelete: canAdd\n }, children);\n });\n var addAction = {\n label: _('Image'),\n handler: function handler(_ref) {\n var layout = _ref.layout,\n updateContainer = _ref.updateContainer;\n var imageIndex;\n\n if (Array.isArray(layout.images)) {\n imageIndex = layout.images.length;\n } else {\n imageIndex = 0;\n }\n\n var key = \"images[\".concat(imageIndex, \"]\");\n var value = {\n sizex: 0.1,\n sizey: 0.1,\n x: 0.5,\n y: 0.5\n };\n\n if (updateContainer) {\n updateContainer(_defineProperty({}, key, value));\n }\n }\n };\n return /*#__PURE__*/_react.default.createElement(_derived.LayoutPanel, {\n addAction: canAdd ? addAction : null,\n canReorder: canReorder\n }, content ? content : /*#__PURE__*/_react.default.createElement(_PanelEmpty.PanelMessage, {\n heading: _('Logos, watermarks and more.')\n }, /*#__PURE__*/_react.default.createElement(\"p\", null, _('Embed images in your figure to make the data more readable or to brand your content.')), /*#__PURE__*/_react.default.createElement(\"p\", null, _('Click on the + button above to add an image.'))));\n }\n }]);\n\n return ImageAccordion;\n}(_react.Component);\n\nImageAccordion.contextTypes = {\n layout: _propTypes.default.object,\n localize: _propTypes.default.func\n};\nImageAccordion.propTypes = {\n children: _propTypes.default.node,\n canAdd: _propTypes.default.bool,\n canReorder: _propTypes.default.bool\n};\nvar _default = ImageAccordion;\nexports.default = _default;\n//# sourceMappingURL=ImageAccordion.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/containers/ImageAccordion.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/containers/MapboxLayersAccordion.js": /*!********************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/containers/MapboxLayersAccordion.js ***! \********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _PlotlyFold = _interopRequireDefault(__webpack_require__(/*! ./PlotlyFold */ \"./node_modules/react-chart-editor/lib/components/containers/PlotlyFold.js\"));\n\nvar _PlotlyPanel = _interopRequireDefault(__webpack_require__(/*! ./PlotlyPanel */ \"./node_modules/react-chart-editor/lib/components/containers/PlotlyPanel.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar MapboxLayersFold = (0, _lib.connectLayersToMapbox)(_PlotlyFold.default);\n\nvar MapboxLayersAccordion = /*#__PURE__*/function (_Component) {\n _inherits(MapboxLayersAccordion, _Component);\n\n var _super = _createSuper(MapboxLayersAccordion);\n\n function MapboxLayersAccordion() {\n _classCallCheck(this, MapboxLayersAccordion);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(MapboxLayersAccordion, [{\n key: \"render\",\n value: function render() {\n var _this$context = this.context,\n _this$context$fullCon = _this$context.fullContainer.layers,\n layers = _this$context$fullCon === void 0 ? [] : _this$context$fullCon,\n _ = _this$context.localize,\n meta = _this$context.layout;\n var children = this.props.children;\n var content = layers.length && layers.map(function (layer, i) {\n return /*#__PURE__*/_react.default.createElement(MapboxLayersFold, {\n key: i,\n mapboxLayerIndex: i,\n name: (0, _lib.getParsedTemplateString)(layer.name, {\n meta: meta\n }),\n canDelete: true\n }, children);\n });\n var addAction = {\n label: _('Layer'),\n handler: function handler(context) {\n var fullContainer = context.fullContainer,\n updateContainer = context.updateContainer;\n\n if (updateContainer) {\n var mapboxLayerIndex = Array.isArray(fullContainer.layers) ? fullContainer.layers.length : 0;\n updateContainer(_defineProperty({}, \"layers[\".concat(mapboxLayerIndex, \"]\"), {\n name: \"Layer \".concat(mapboxLayerIndex),\n sourcetype: 'raster',\n below: 'traces'\n }));\n }\n }\n };\n return /*#__PURE__*/_react.default.createElement(_PlotlyPanel.default, {\n addAction: addAction,\n canReorder: true\n }, content ? content : null);\n }\n }]);\n\n return MapboxLayersAccordion;\n}(_react.Component);\n\nMapboxLayersAccordion.contextTypes = {\n fullContainer: _propTypes.default.object,\n localize: _propTypes.default.func,\n layout: _propTypes.default.object\n};\nMapboxLayersAccordion.propTypes = {\n children: _propTypes.default.node\n};\nMapboxLayersAccordion.plotly_editor_traits = {\n no_visibility_forcing: true\n};\nvar _default = MapboxLayersAccordion;\nexports.default = _default;\n//# sourceMappingURL=MapboxLayersAccordion.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/containers/MapboxLayersAccordion.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/containers/MenuPanel.js": /*!********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/containers/MenuPanel.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _ModalBox = _interopRequireDefault(__webpack_require__(/*! ./ModalBox */ \"./node_modules/react-chart-editor/lib/components/containers/ModalBox.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ \"./node_modules/classnames/index.js\"));\n\nvar _plotlyIcons = __webpack_require__(/*! plotly-icons */ \"./node_modules/plotly-icons/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar MenuPanel = /*#__PURE__*/function (_Component) {\n _inherits(MenuPanel, _Component);\n\n var _super = _createSuper(MenuPanel);\n\n function MenuPanel() {\n var _this;\n\n _classCallCheck(this, MenuPanel);\n\n _this = _super.call(this);\n _this.state = {\n isOpen: false\n };\n _this.togglePanel = _this.togglePanel.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(MenuPanel, [{\n key: \"getIcon\",\n value: function getIcon() {\n var _this$props = this.props,\n question = _this$props.question,\n Icon = _this$props.icon;\n\n if (question) {\n return {\n icon: /*#__PURE__*/_react.default.createElement(_plotlyIcons.QuestionIcon, {\n className: \"menupanel__icon\"\n }),\n spanClass: \"menupanel__icon-span menupanel__icon-span--question\"\n };\n }\n\n if (Icon) {\n return {\n icon: /*#__PURE__*/_react.default.createElement(Icon, {\n className: \"menupanel__icon\"\n }),\n spanClass: \"menupanel__icon-span\"\n };\n }\n\n return {\n icon: /*#__PURE__*/_react.default.createElement(_plotlyIcons.CogIcon, {\n className: \"menupanel__icon\"\n }),\n spanClass: 'menupanel__icon-span menupanel__icon-span--cog'\n };\n }\n }, {\n key: \"togglePanel\",\n value: function togglePanel() {\n this.setState({\n isOpen: !this.state.isOpen\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props2 = this.props,\n show = _this$props2.show,\n ownline = _this$props2.ownline,\n label = _this$props2.label,\n children = _this$props2.children;\n var isOpen = show || this.state.isOpen;\n var containerClass = (0, _classnames.default)('menupanel', {\n 'menupanel--ownline': ownline\n });\n\n var _this$getIcon = this.getIcon(),\n icon = _this$getIcon.icon,\n spanClass = _this$getIcon.spanClass;\n\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: containerClass\n }, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: spanClass\n }, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"menupanel__label\"\n }, label), /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"menupanel__icon__wrapper\",\n onClick: this.togglePanel\n }, icon)), isOpen && /*#__PURE__*/_react.default.createElement(_ModalBox.default, {\n onClose: this.togglePanel\n }, children));\n }\n }]);\n\n return MenuPanel;\n}(_react.Component);\n\nexports.default = MenuPanel;\nMenuPanel.propTypes = {\n children: _propTypes.default.node,\n icon: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),\n label: _propTypes.default.string,\n ownline: _propTypes.default.bool,\n question: _propTypes.default.bool,\n show: _propTypes.default.bool\n};\n//# sourceMappingURL=MenuPanel.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/containers/MenuPanel.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/containers/Modal.js": /*!****************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/containers/Modal.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.ModalContent = exports.ModalHeader = exports.default = void 0;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _plotlyIcons = __webpack_require__(/*! plotly-icons */ \"./node_modules/plotly-icons/lib/index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar ModalHeader = function ModalHeader(_ref) {\n var title = _ref.title,\n handleClose = _ref.handleClose;\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"modal__header\"\n }, title ? /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"modal__header__title\"\n }, title) : null, handleClose ? /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"modal__header__close\",\n onClick: handleClose ? function () {\n return handleClose();\n } : null\n }, /*#__PURE__*/_react.default.createElement(_plotlyIcons.CloseIcon, null)) : null);\n};\n\nexports.ModalHeader = ModalHeader;\n\nvar ModalContent = function ModalContent(_ref2) {\n var children = _ref2.children;\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"modal__content\"\n }, children);\n};\n\nexports.ModalContent = ModalContent;\n\nvar Modal = /*#__PURE__*/function (_Component) {\n _inherits(Modal, _Component);\n\n var _super = _createSuper(Modal);\n\n function Modal(props) {\n var _this;\n\n _classCallCheck(this, Modal);\n\n _this = _super.call(this, props);\n _this.escFunction = _this.escFunction.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(Modal, [{\n key: \"escFunction\",\n value: function escFunction(event) {\n var escKeyCode = 27;\n\n if (event.keyCode === escKeyCode) {\n this.context.handleClose();\n }\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n document.addEventListener('keydown', this.escFunction, false);\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n document.removeEventListener('keydown', this.escFunction, false);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _this$props = this.props,\n children = _this$props.children,\n title = _this$props.title;\n var classes = 'modal';\n\n if (this.context.isAnimatingOut) {\n classes += ' modal--animate-out';\n }\n\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: classes\n }, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"modal__card\"\n }, /*#__PURE__*/_react.default.createElement(ModalHeader, {\n title: title,\n handleClose: function handleClose() {\n return _this2.context.handleClose();\n }\n }), /*#__PURE__*/_react.default.createElement(ModalContent, null, children)), /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"modal__backdrop\",\n onClick: function onClick() {\n return _this2.context.handleClose();\n }\n }));\n }\n }]);\n\n return Modal;\n}(_react.Component);\n\nModalHeader.propTypes = {\n title: _propTypes.default.node,\n handleClose: _propTypes.default.func.isRequired\n};\nModalContent.propTypes = {\n children: _propTypes.default.node.isRequired\n};\nModal.propTypes = {\n children: _propTypes.default.node.isRequired,\n title: _propTypes.default.node\n};\nModal.contextTypes = {\n handleClose: _propTypes.default.func,\n isAnimatingOut: _propTypes.default.bool\n};\nvar _default = Modal;\nexports.default = _default;\n//# sourceMappingURL=Modal.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/containers/Modal.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/containers/ModalBox.js": /*!*******************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/containers/ModalBox.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ \"./node_modules/classnames/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar ModalBox = /*#__PURE__*/function (_Component) {\n _inherits(ModalBox, _Component);\n\n var _super = _createSuper(ModalBox);\n\n function ModalBox() {\n _classCallCheck(this, ModalBox);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(ModalBox, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n backgroundDark = _this$props.backgroundDark,\n children = _this$props.children,\n onClose = _this$props.onClose,\n relative = _this$props.relative;\n var modalboxClass = (0, _classnames.default)('modalbox', {\n 'modalbox--dark': backgroundDark,\n 'modalbox--relative': relative\n });\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: modalboxClass\n }, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"modalbox__cover\",\n onClick: onClose\n }), /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"modalbox__content\"\n }, children));\n }\n }]);\n\n return ModalBox;\n}(_react.Component);\n\nexports.default = ModalBox;\nModalBox.propTypes = {\n backgroundDark: _propTypes.default.bool,\n relative: _propTypes.default.bool,\n children: _propTypes.default.node,\n onClose: _propTypes.default.func\n};\n//# sourceMappingURL=ModalBox.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/containers/ModalBox.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/containers/ModalProvider.js": /*!************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/containers/ModalProvider.js ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar ModalProvider = /*#__PURE__*/function (_React$Component) {\n _inherits(ModalProvider, _React$Component);\n\n var _super = _createSuper(ModalProvider);\n\n function ModalProvider(props) {\n var _this;\n\n _classCallCheck(this, ModalProvider);\n\n _this = _super.call(this, props);\n _this.state = {\n component: null,\n componentProps: {},\n open: false,\n isAnimatingOut: false\n };\n return _this;\n }\n\n _createClass(ModalProvider, [{\n key: \"componentDidUpdate\",\n value: function componentDidUpdate() {\n var body = document.body;\n var open = this.state.open; // Toggle scroll on document body if modal is open\n\n var hasClass = body.classList.contains('no-scroll');\n\n if (open && !hasClass) {\n body.classList.add('no-scroll');\n }\n\n if (!open && hasClass) {\n body.classList.remove('no-scroll');\n }\n }\n }, {\n key: \"openModal\",\n value: function openModal(component, componentProps) {\n var _ = this.context.localize;\n\n if (!component) {\n throw Error(_('You need to provide a component for the modal to open!'));\n }\n\n var open = this.state.open;\n\n if (!open) {\n this.setState({\n component: component,\n componentProps: componentProps,\n open: true\n });\n }\n }\n }, {\n key: \"closeModal\",\n value: function closeModal() {\n var open = this.state.open;\n\n if (open) {\n this.setState({\n open: false,\n component: null\n });\n }\n }\n }, {\n key: \"handleClose\",\n value: function handleClose() {\n var _this2 = this;\n\n this.setState({\n isAnimatingOut: true\n });\n var animationDuration = 600;\n setTimeout(function () {\n _this2.setState({\n isAnimatingOut: false\n });\n\n _this2.closeModal();\n }, animationDuration);\n }\n }, {\n key: \"getChildContext\",\n value: function getChildContext() {\n var _this3 = this;\n\n return {\n openModal: function openModal(c, p) {\n return _this3.openModal(c, p);\n },\n closeModal: function closeModal() {\n return _this3.closeModal();\n },\n handleClose: function handleClose() {\n return _this3.handleClose();\n },\n isAnimatingOut: this.state.isAnimatingOut\n };\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$state = this.state,\n Component = _this$state.component,\n componentProps = _this$state.componentProps,\n isAnimatingOut = _this$state.isAnimatingOut;\n return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, this.props.children, this.state.open ? /*#__PURE__*/_react.default.createElement(Component, _extends({\n isAnimatingOut: isAnimatingOut\n }, componentProps)) : null);\n }\n }]);\n\n return ModalProvider;\n}(_react.default.Component);\n\nModalProvider.propTypes = {\n children: _propTypes.default.node\n};\nModalProvider.contextTypes = {\n localize: _propTypes.default.func\n};\nModalProvider.childContextTypes = {\n openModal: _propTypes.default.func,\n closeModal: _propTypes.default.func,\n handleClose: _propTypes.default.func,\n isAnimatingOut: _propTypes.default.bool\n};\nvar _default = ModalProvider;\nexports.default = _default;\n//# sourceMappingURL=ModalProvider.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/containers/ModalProvider.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/containers/PanelEmpty.js": /*!*********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/containers/PanelEmpty.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.PanelMessage = void 0;\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _plotlyIcons = __webpack_require__(/*! plotly-icons */ \"./node_modules/plotly-icons/lib/index.js\");\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar PanelMessage = /*#__PURE__*/function (_Component) {\n _inherits(PanelMessage, _Component);\n\n var _super = _createSuper(PanelMessage);\n\n function PanelMessage() {\n _classCallCheck(this, PanelMessage);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(PanelMessage, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n children = _this$props.children,\n Icon = _this$props.icon;\n var heading = this.props.heading || '';\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"panel__empty__message\"\n }, Boolean(Icon) && /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"panel__empty__message__icon\"\n }, /*#__PURE__*/_react.default.createElement(Icon, null)), Boolean(heading) && /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"panel__empty__message__heading\"\n }, heading), /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"panel__empty__message__content\"\n }, children));\n }\n }]);\n\n return PanelMessage;\n}(_react.Component);\n\nexports.PanelMessage = PanelMessage;\nPanelMessage.defaultProps = {\n icon: _plotlyIcons.ChartLineIcon\n};\nPanelMessage.propTypes = {\n heading: _propTypes.default.string,\n children: _propTypes.default.node,\n icon: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func])\n};\n\nvar PanelEmpty = /*#__PURE__*/function (_Component2) {\n _inherits(PanelEmpty, _Component2);\n\n var _super2 = _createSuper(PanelEmpty);\n\n function PanelEmpty() {\n _classCallCheck(this, PanelEmpty);\n\n return _super2.apply(this, arguments);\n }\n\n _createClass(PanelEmpty, [{\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: (0, _lib.bem)('panel', 'empty')\n }, /*#__PURE__*/_react.default.createElement(PanelMessage, this.props));\n }\n }]);\n\n return PanelEmpty;\n}(_react.Component);\n\nPanelEmpty.propTypes = {\n heading: _propTypes.default.string,\n children: _propTypes.default.node,\n icon: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func])\n};\nvar _default = PanelEmpty;\nexports.default = _default;\n//# sourceMappingURL=PanelEmpty.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/containers/PanelEmpty.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/containers/PanelHeader.js": /*!**********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/containers/PanelHeader.js ***! \**********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _Button = _interopRequireDefault(__webpack_require__(/*! ../widgets/Button */ \"./node_modules/react-chart-editor/lib/components/widgets/Button.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _plotlyIcons = __webpack_require__(/*! plotly-icons */ \"./node_modules/plotly-icons/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar PanelHeader = /*#__PURE__*/function (_Component) {\n _inherits(PanelHeader, _Component);\n\n var _super = _createSuper(PanelHeader);\n\n function PanelHeader() {\n var _this;\n\n _classCallCheck(this, PanelHeader);\n\n _this = _super.call(this);\n _this.state = {\n addPanelOpen: false\n };\n _this.togglePanel = _this.togglePanel.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(PanelHeader, [{\n key: \"togglePanel\",\n value: function togglePanel() {\n this.setState({\n addPanelOpen: !this.state.addPanelOpen\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _ = this.context.localize;\n var _this$props = this.props,\n children = _this$props.children,\n addAction = _this$props.addAction,\n allowCollapse = _this$props.allowCollapse,\n toggleFolds = _this$props.toggleFolds,\n hasOpen = _this$props.hasOpen; // dropdown is styled with same styles as react-select component - see _dropdown.scss\n\n var icon = /*#__PURE__*/_react.default.createElement(_plotlyIcons.PlusIcon, null);\n\n return !children && !addAction && !allowCollapse ? null : /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"panel__header\"\n }, children && children.length ? /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"panel__header__content\"\n }, children) : null, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"panel__header__actions__container\"\n }, allowCollapse ? /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"panel__header__collapse\",\n onClick: toggleFolds\n }, hasOpen ? /*#__PURE__*/_react.default.createElement(\"span\", null, /*#__PURE__*/_react.default.createElement(_plotlyIcons.ResizeDownIcon, null), _('Collapse All')) : /*#__PURE__*/_react.default.createElement(\"span\", null, /*#__PURE__*/_react.default.createElement(_plotlyIcons.ResizeUpIcon, null), _('Expand All'))) : null, addAction ? /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"panel__header__action dropdown-container\"\n }, /*#__PURE__*/_react.default.createElement(_Button.default, {\n variant: \"primary\",\n className: \"js-add-button\",\n onClick: Array.isArray(addAction.handler) ? this.togglePanel : function () {\n return addAction.handler(_this2.context);\n },\n icon: icon,\n label: addAction.label\n }), this.state.addPanelOpen && /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"Select\"\n }, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"Select-menu-outer\"\n }, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"Select-menu\"\n }, addAction.handler.map(function (_ref) {\n var label = _ref.label,\n handler = _ref.handler;\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"Select-option\",\n key: label,\n onClick: function onClick() {\n handler(_this2.context);\n\n _this2.togglePanel();\n }\n }, label);\n }))))) : null));\n }\n }]);\n\n return PanelHeader;\n}(_react.Component);\n\nPanelHeader.contextTypes = {\n layout: _propTypes.default.object,\n fullContainer: _propTypes.default.object,\n onUpdate: _propTypes.default.func,\n updateContainer: _propTypes.default.func,\n localize: _propTypes.default.func\n};\nPanelHeader.propTypes = {\n addAction: _propTypes.default.object,\n allowCollapse: _propTypes.default.bool,\n children: _propTypes.default.node,\n hasOpen: _propTypes.default.bool,\n toggleFolds: _propTypes.default.func\n};\nvar _default = PanelHeader;\nexports.default = _default;\n//# sourceMappingURL=PanelHeader.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/containers/PanelHeader.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/containers/PlotlyFold.js": /*!*********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/containers/PlotlyFold.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.Fold = void 0;\n\nvar _FoldEmpty = _interopRequireDefault(__webpack_require__(/*! ./FoldEmpty */ \"./node_modules/react-chart-editor/lib/components/containers/FoldEmpty.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ \"./node_modules/classnames/index.js\"));\n\nvar _plotlyIcons = __webpack_require__(/*! plotly-icons */ \"./node_modules/plotly-icons/lib/index.js\");\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar Fold = /*#__PURE__*/function (_Component) {\n _inherits(Fold, _Component);\n\n var _super = _createSuper(Fold);\n\n function Fold() {\n var _this;\n\n _classCallCheck(this, Fold);\n\n _this = _super.call(this);\n _this.foldVisible = true;\n return _this;\n }\n\n _createClass(Fold, [{\n key: \"getChildContext\",\n value: function getChildContext() {\n return {\n foldInfo: this.props.foldInfo ? this.props.foldInfo : null\n };\n }\n }, {\n key: \"render\",\n value: function render() {\n if (!this.foldVisible && !this.props.messageIfEmpty) {\n return null;\n }\n\n var _this$context = this.context,\n deleteContainer = _this$context.deleteContainer,\n moveContainer = _this$context.moveContainer;\n var _this$props = this.props,\n canDelete = _this$props.canDelete,\n children = _this$props.children,\n className = _this$props.className,\n folded = _this$props.folded,\n foldInfo = _this$props.foldInfo,\n toggleFold = _this$props.toggleFold,\n hideHeader = _this$props.hideHeader,\n Icon = _this$props.icon,\n messageIfEmpty = _this$props.messageIfEmpty,\n name = _this$props.name,\n canMoveUp = _this$props.canMoveUp,\n canMoveDown = _this$props.canMoveDown;\n var contentClass = (0, _classnames.default)('fold__content', {\n 'fold__content--noheader': hideHeader\n });\n var headerClass = (0, _classnames.default)('fold__top', {\n 'fold__top--open': !folded\n });\n var arrowClass = (0, _classnames.default)('fold__top__arrow', {\n 'fold__top__arrow--open': !folded\n });\n\n var arrowDownIcon = /*#__PURE__*/_react.default.createElement(\"div\", {\n className: arrowClass\n }, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"fold__top__arrow__wrapper\"\n }, /*#__PURE__*/_react.default.createElement(_plotlyIcons.AngleDownIcon, null)));\n\n var icon = Icon ? /*#__PURE__*/_react.default.createElement(Icon, {\n className: \"fold__top__icon\"\n }) : null;\n var deleteButton = canDelete && typeof deleteContainer === 'function' ? /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"fold__top__delete js-fold__delete\",\n onClick: function onClick(e) {\n e.stopPropagation();\n deleteContainer(foldInfo);\n }\n }, /*#__PURE__*/_react.default.createElement(_plotlyIcons.CloseIcon, null)) : null;\n\n var movingControls = (canMoveDown || canMoveUp) && /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"fold__top__moving-controls\"\n }, /*#__PURE__*/_react.default.createElement(\"span\", {\n className: \"fold__top__moving-controls--up\".concat(canMoveUp ? '' : '--disabled'),\n onClick: function onClick(e) {\n // prevents fold toggle to happen when clicking on moving arrow controls\n e.stopPropagation();\n\n if (canMoveUp) {\n if (!moveContainer || typeof moveContainer !== 'function') {\n throw new Error('moveContainer must be a function');\n }\n\n moveContainer('up');\n }\n }\n }, /*#__PURE__*/_react.default.createElement(_plotlyIcons.AngleDownIcon, null)), /*#__PURE__*/_react.default.createElement(\"span\", {\n className: \"fold__top__moving-controls--down\".concat(canMoveDown ? '' : '--disabled'),\n onClick: function onClick(e) {\n // prevents fold toggle to happen when clicking on moving arrow controls\n e.stopPropagation();\n\n if (canMoveDown) {\n if (!moveContainer || typeof moveContainer !== 'function') {\n throw new Error('moveContainer must be a function');\n }\n\n moveContainer('down');\n }\n }\n }, /*#__PURE__*/_react.default.createElement(_plotlyIcons.AngleDownIcon, null)));\n\n var foldHeader = !hideHeader && /*#__PURE__*/_react.default.createElement(\"div\", {\n className: headerClass,\n onClick: toggleFold\n }, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"fold__top__arrow-title\"\n }, arrowDownIcon, icon, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"fold__top__title\"\n }, (0, _lib.striptags)(name))), movingControls, deleteButton);\n\n var foldContent = null;\n\n if (!folded) {\n if (this.foldVisible) {\n foldContent = /*#__PURE__*/_react.default.createElement(\"div\", {\n className: contentClass\n }, children);\n } else {\n foldContent = /*#__PURE__*/_react.default.createElement(\"div\", {\n className: contentClass\n }, /*#__PURE__*/_react.default.createElement(_FoldEmpty.default, {\n icon: Icon,\n messagePrimary: messageIfEmpty\n }));\n }\n }\n\n var classes = className ? ' ' + className : '';\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"fold\".concat(classes)\n }, foldHeader, foldContent);\n }\n }]);\n\n return Fold;\n}(_react.Component);\n\nexports.Fold = Fold;\nFold.plotly_editor_traits = {\n foldable: true\n};\nFold.propTypes = {\n canDelete: _propTypes.default.bool,\n children: _propTypes.default.node,\n className: _propTypes.default.string,\n folded: _propTypes.default.bool,\n foldInfo: _propTypes.default.object,\n toggleFold: _propTypes.default.func,\n hideHeader: _propTypes.default.bool,\n icon: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),\n messageIfEmpty: _propTypes.default.string,\n name: _propTypes.default.string,\n canMoveUp: _propTypes.default.bool,\n canMoveDown: _propTypes.default.bool\n};\nFold.contextTypes = {\n deleteContainer: _propTypes.default.func\n};\nFold.childContextTypes = {\n foldInfo: _propTypes.default.object\n};\n\nvar PlotlyFold = /*#__PURE__*/function (_Fold) {\n _inherits(PlotlyFold, _Fold);\n\n var _super2 = _createSuper(PlotlyFold);\n\n function PlotlyFold(props, context) {\n var _this2;\n\n _classCallCheck(this, PlotlyFold);\n\n _this2 = _super2.call(this, props, context);\n _this2.foldVisible = false;\n\n _this2.determineVisibility(props, context);\n\n return _this2;\n }\n\n _createClass(PlotlyFold, [{\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps, nextContext) {\n this.determineVisibility(nextProps, nextContext);\n }\n }, {\n key: \"determineVisibility\",\n value: function determineVisibility(nextProps, nextContext) {\n var _this3 = this;\n\n this.foldVisible = false;\n\n _react.default.Children.forEach(nextProps.children, function (child) {\n if (!child || _this3.foldVisible) {\n return;\n }\n\n if (child.props.attr) {\n // attr components force fold open if they are visible\n var plotProps = (0, _lib.unpackPlotProps)(child.props, nextContext);\n\n if (child.type.modifyPlotProps) {\n child.type.modifyPlotProps(child.props, nextContext, plotProps);\n }\n\n _this3.foldVisible = _this3.foldVisible || plotProps.isVisible;\n return;\n }\n\n if (!(child.type.plotly_editor_traits || {}).no_visibility_forcing) {\n // non-attr components force visibility (unless they don't via traits)\n _this3.foldVisible = true;\n return;\n }\n });\n }\n }]);\n\n return PlotlyFold;\n}(Fold);\n\nPlotlyFold.plotly_editor_traits = {\n foldable: true\n};\nPlotlyFold.contextTypes = Object.assign({\n deleteContainer: _propTypes.default.func,\n moveContainer: _propTypes.default.func\n}, _lib.containerConnectedContextTypes);\nvar _default = PlotlyFold;\nexports.default = _default;\n//# sourceMappingURL=PlotlyFold.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/containers/PlotlyFold.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/containers/PlotlyPanel.js": /*!**********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/containers/PlotlyPanel.js ***! \**********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.Panel = void 0;\n\nvar _PanelHeader = _interopRequireDefault(__webpack_require__(/*! ./PanelHeader */ \"./node_modules/react-chart-editor/lib/components/containers/PanelHeader.js\"));\n\nvar _PanelEmpty = _interopRequireDefault(__webpack_require__(/*! ./PanelEmpty */ \"./node_modules/react-chart-editor/lib/components/containers/PanelEmpty.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _immutabilityHelper = _interopRequireDefault(__webpack_require__(/*! immutability-helper */ \"./node_modules/immutability-helper/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _plotlyIcons = __webpack_require__(/*! plotly-icons */ \"./node_modules/plotly-icons/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar PanelErrorImpl = /*#__PURE__*/function (_Component) {\n _inherits(PanelErrorImpl, _Component);\n\n var _super = _createSuper(PanelErrorImpl);\n\n function PanelErrorImpl() {\n _classCallCheck(this, PanelErrorImpl);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(PanelErrorImpl, [{\n key: \"render\",\n value: function render() {\n var _ = this.context.localize;\n return /*#__PURE__*/_react.default.createElement(_PanelEmpty.default, {\n icon: _plotlyIcons.EmbedIconIcon,\n heading: _('Well this is embarrassing.')\n }, /*#__PURE__*/_react.default.createElement(\"p\", null, _('This panel could not be displayed due to an error.')));\n }\n }]);\n\n return PanelErrorImpl;\n}(_react.Component);\n\nPanelErrorImpl.contextTypes = {\n localize: _propTypes.default.func\n};\nvar PanelError = PanelErrorImpl;\n\nvar Panel = /*#__PURE__*/function (_Component2) {\n _inherits(Panel, _Component2);\n\n var _super2 = _createSuper(Panel);\n\n function Panel(props) {\n var _this;\n\n _classCallCheck(this, Panel);\n\n _this = _super2.call(this, props);\n _this.state = {\n individualFoldStates: [],\n hasError: false\n };\n _this.toggleFolds = _this.toggleFolds.bind(_assertThisInitialized(_this));\n _this.toggleFold = _this.toggleFold.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(Panel, [{\n key: \"getChildContext\",\n value: function getChildContext() {\n return {\n deleteContainer: this.props.deleteAction ? this.props.deleteAction : null\n };\n }\n }, {\n key: \"componentDidCatch\",\n value: function componentDidCatch() {\n this.setState({\n hasError: true\n });\n }\n }, {\n key: \"toggleFolds\",\n value: function toggleFolds() {\n var individualFoldStates = this.state.individualFoldStates;\n var hasOpen = individualFoldStates.length > 0 && individualFoldStates.some(function (s) {\n return s !== true;\n });\n this.setState({\n individualFoldStates: individualFoldStates.map(function () {\n return hasOpen;\n })\n });\n }\n }, {\n key: \"toggleFold\",\n value: function toggleFold(index) {\n this.setState((0, _immutabilityHelper.default)(this.state, {\n individualFoldStates: {\n $toggle: [index]\n }\n }));\n }\n }, {\n key: \"calculateFolds\",\n value: function calculateFolds() {\n // to get proper number of child folds and initialize component state\n var numFolds = 0;\n\n _react.default.Children.forEach(this.props.children, function (child) {\n if ((child && child.type && child.type.plotly_editor_traits || {}).foldable) {\n numFolds++;\n }\n });\n\n if (this.state.individualFoldStates.length !== numFolds) {\n var newFoldStates = new Array(numFolds).fill(false);\n this.setState({\n individualFoldStates: this.props.addAction ? newFoldStates.map(function (e, i) {\n return i !== numFolds - 1;\n }) : newFoldStates\n });\n }\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate() {\n this.calculateFolds();\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.calculateFolds();\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _this$state = this.state,\n individualFoldStates = _this$state.individualFoldStates,\n hasError = _this$state.hasError;\n var canReorder = this.props.canReorder;\n\n if (hasError) {\n return /*#__PURE__*/_react.default.createElement(PanelError, null);\n }\n\n var newChildren = _react.default.Children.map(this.props.children, function (child, index) {\n if ((child && child.type && child.type.plotly_editor_traits || {}).foldable) {\n return /*#__PURE__*/(0, _react.cloneElement)(child, {\n key: index,\n folded: individualFoldStates[index] || false,\n toggleFold: function toggleFold() {\n return _this2.toggleFold(index);\n },\n canMoveUp: canReorder && individualFoldStates.length > 1 && index > 0,\n canMoveDown: canReorder && individualFoldStates.length > 1 && index !== individualFoldStates.length - 1\n });\n }\n\n return child;\n });\n\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"panel\".concat(this.props.noPadding ? ' panel--no-padding' : '')\n }, /*#__PURE__*/_react.default.createElement(_PanelHeader.default, {\n addAction: this.props.addAction,\n allowCollapse: this.props.showExpandCollapse && individualFoldStates.length > 1,\n toggleFolds: this.toggleFolds,\n hasOpen: individualFoldStates.some(function (s) {\n return s === false;\n })\n }), /*#__PURE__*/_react.default.createElement(\"div\", {\n className: (0, _lib.bem)('panel', 'content')\n }, newChildren));\n }\n }]);\n\n return Panel;\n}(_react.Component);\n\nexports.Panel = Panel;\nPanel.propTypes = {\n addAction: _propTypes.default.object,\n children: _propTypes.default.node,\n deleteAction: _propTypes.default.func,\n noPadding: _propTypes.default.bool,\n showExpandCollapse: _propTypes.default.bool,\n canReorder: _propTypes.default.bool\n};\nPanel.defaultProps = {\n showExpandCollapse: true\n};\nPanel.contextTypes = {\n localize: _propTypes.default.func\n};\nPanel.childContextTypes = {\n deleteContainer: _propTypes.default.func\n};\n\nvar PlotlyPanel = /*#__PURE__*/function (_Panel) {\n _inherits(PlotlyPanel, _Panel);\n\n var _super3 = _createSuper(PlotlyPanel);\n\n function PlotlyPanel() {\n _classCallCheck(this, PlotlyPanel);\n\n return _super3.apply(this, arguments);\n }\n\n return PlotlyPanel;\n}(Panel);\n\nPlotlyPanel.plotly_editor_traits = {\n no_visibility_forcing: true\n};\nvar _default = PlotlyPanel;\nexports.default = _default;\n//# sourceMappingURL=PlotlyPanel.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/containers/PlotlyPanel.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/containers/PlotlySection.js": /*!************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/containers/PlotlySection.js ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.Section = void 0;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar Section = /*#__PURE__*/function (_Component) {\n _inherits(Section, _Component);\n\n var _super = _createSuper(Section);\n\n function Section() {\n var _this;\n\n _classCallCheck(this, Section);\n\n _this = _super.call(this);\n _this.sectionVisible = true;\n return _this;\n }\n\n _createClass(Section, [{\n key: \"render\",\n value: function render() {\n if (!this.sectionVisible) {\n return null;\n }\n\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"section\"\n }, this.props.name ? /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"section__heading\"\n }, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"section__heading__text\"\n }, this.props.name)) : null, this.props.children);\n }\n }]);\n\n return Section;\n}(_react.Component);\n\nexports.Section = Section;\nSection.plotly_editor_traits = {\n no_visibility_forcing: false\n};\nSection.propTypes = {\n children: _propTypes.default.node,\n name: _propTypes.default.string,\n attr: _propTypes.default.string\n};\n\nvar PlotlySection = /*#__PURE__*/function (_Section) {\n _inherits(PlotlySection, _Section);\n\n var _super2 = _createSuper(PlotlySection);\n\n function PlotlySection(props, context) {\n var _this2;\n\n _classCallCheck(this, PlotlySection);\n\n _this2 = _super2.call(this, props, context);\n\n _this2.determineVisibility(props, context);\n\n return _this2;\n }\n\n _createClass(PlotlySection, [{\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps, nextContext) {\n this.determineVisibility(nextProps, nextContext);\n }\n }, {\n key: \"determineVisibility\",\n value: function determineVisibility(nextProps, nextContext) {\n var _this3 = this;\n\n var _unpackPlotProps = (0, _lib.unpackPlotProps)(nextProps, nextContext),\n isVisible = _unpackPlotProps.isVisible;\n\n this.sectionVisible = (0, _lib.isVisibleGivenCustomConfig)(isVisible, nextProps, nextContext);\n\n _react.default.Children.forEach(nextProps.children, function (child) {\n if (!child || _this3.sectionVisible) {\n return;\n }\n\n if (child.props.attr) {\n var plotProps = (0, _lib.unpackPlotProps)(child.props, nextContext);\n\n if (child.type.modifyPlotProps) {\n child.type.modifyPlotProps(child.props, nextContext, plotProps);\n }\n\n _this3.sectionVisible = (0, _lib.isVisibleGivenCustomConfig)(_this3.sectionVisible || plotProps.isVisible, child.props, nextContext, child.type && child.type.displayName ? child.type.displayName : null);\n return;\n }\n\n if (!(child.type.plotly_editor_traits || {}).no_visibility_forcing) {\n // non-attr components force visibility (unless they don't via traits)\n _this3.sectionVisible = true;\n return;\n }\n });\n }\n }]);\n\n return PlotlySection;\n}(Section);\n\nexports.default = PlotlySection;\nPlotlySection.plotly_editor_traits = {\n no_visibility_forcing: true\n};\nPlotlySection.contextTypes = _lib.containerConnectedContextTypes;\n//# sourceMappingURL=PlotlySection.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/containers/PlotlySection.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/containers/RangeSelectorAccordion.js": /*!*********************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/containers/RangeSelectorAccordion.js ***! \*********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _PlotlyFold = _interopRequireDefault(__webpack_require__(/*! ./PlotlyFold */ \"./node_modules/react-chart-editor/lib/components/containers/PlotlyFold.js\"));\n\nvar _PlotlyPanel = _interopRequireDefault(__webpack_require__(/*! ./PlotlyPanel */ \"./node_modules/react-chart-editor/lib/components/containers/PlotlyPanel.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar RangeSelectorFold = (0, _lib.connectRangeSelectorToAxis)(_PlotlyFold.default);\n\nvar RangeSelectorAccordion = /*#__PURE__*/function (_Component) {\n _inherits(RangeSelectorAccordion, _Component);\n\n var _super = _createSuper(RangeSelectorAccordion);\n\n function RangeSelectorAccordion() {\n _classCallCheck(this, RangeSelectorAccordion);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(RangeSelectorAccordion, [{\n key: \"render\",\n value: function render() {\n if (!this.context.fullContainer || !this.context.fullContainer.rangeselector || !this.context.fullContainer.rangeselector.visible || // next line checks for \"all\" case\n this.context.fullContainer._axisGroup === 0) {\n return null;\n }\n\n var _this$context = this.context,\n _this$context$fullCon = _this$context.fullContainer.rangeselector.buttons,\n buttons = _this$context$fullCon === void 0 ? [] : _this$context$fullCon,\n _ = _this$context.localize,\n meta = _this$context.layout;\n var children = this.props.children;\n var content = buttons.length && buttons.map(function (btn, i) {\n return /*#__PURE__*/_react.default.createElement(RangeSelectorFold, {\n key: i,\n rangeselectorIndex: i,\n name: (0, _lib.getParsedTemplateString)(btn.label, {\n meta: meta\n }),\n canDelete: true\n }, children);\n });\n var addAction = {\n label: _('Button'),\n handler: function handler(context) {\n var fullContainer = context.fullContainer,\n updateContainer = context.updateContainer;\n\n if (updateContainer) {\n var rangeselectorIndex = Array.isArray(fullContainer.rangeselector.buttons) ? fullContainer.rangeselector.buttons.length : 0;\n updateContainer(_defineProperty({}, \"rangeselector.buttons[\".concat(rangeselectorIndex, \"]\"), {}));\n }\n }\n };\n return /*#__PURE__*/_react.default.createElement(_PlotlyPanel.default, {\n addAction: addAction\n }, content ? content : null);\n }\n }]);\n\n return RangeSelectorAccordion;\n}(_react.Component);\n\nRangeSelectorAccordion.contextTypes = {\n fullContainer: _propTypes.default.object,\n localize: _propTypes.default.func,\n layout: _propTypes.default.object\n};\nRangeSelectorAccordion.propTypes = {\n children: _propTypes.default.node\n};\nRangeSelectorAccordion.plotly_editor_traits = {\n no_visibility_forcing: true\n};\nvar _default = RangeSelectorAccordion;\nexports.default = _default;\n//# sourceMappingURL=RangeSelectorAccordion.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/containers/RangeSelectorAccordion.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/containers/ShapeAccordion.js": /*!*************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/containers/ShapeAccordion.js ***! \*************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _PlotlyFold = _interopRequireDefault(__webpack_require__(/*! ./PlotlyFold */ \"./node_modules/react-chart-editor/lib/components/containers/PlotlyFold.js\"));\n\nvar _derived = __webpack_require__(/*! ./derived */ \"./node_modules/react-chart-editor/lib/components/containers/derived.js\");\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _constants = __webpack_require__(/*! ../../lib/constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nvar _PanelEmpty = __webpack_require__(/*! ./PanelEmpty */ \"./node_modules/react-chart-editor/lib/components/containers/PanelEmpty.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar ShapeFold = (0, _lib.connectShapeToLayout)(_PlotlyFold.default);\n\nvar ShapeAccordion = /*#__PURE__*/function (_Component) {\n _inherits(ShapeAccordion, _Component);\n\n var _super = _createSuper(ShapeAccordion);\n\n function ShapeAccordion() {\n _classCallCheck(this, ShapeAccordion);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(ShapeAccordion, [{\n key: \"render\",\n value: function render() {\n var _this$context = this.context,\n _this$context$layout$ = _this$context.layout.shapes,\n shapes = _this$context$layout$ === void 0 ? [] : _this$context$layout$,\n _ = _this$context.localize;\n var _this$props = this.props,\n canAdd = _this$props.canAdd,\n children = _this$props.children,\n canReorder = _this$props.canReorder;\n var content = shapes.length && shapes.map(function (shp, i) {\n return /*#__PURE__*/_react.default.createElement(ShapeFold, {\n key: i,\n shapeIndex: i,\n name: \"\".concat(_('Shape'), \" \").concat(i + 1),\n canDelete: canAdd\n }, children);\n });\n var addAction = {\n label: _('Shape'),\n handler: function handler(_ref) {\n var layout = _ref.layout,\n updateContainer = _ref.updateContainer;\n var shapeIndex;\n\n if (Array.isArray(layout.shapes)) {\n shapeIndex = layout.shapes.length;\n } else {\n shapeIndex = 0;\n }\n\n var key = \"shapes[\".concat(shapeIndex, \"]\");\n var value = {\n line: {\n color: _constants.COLORS.charcoal\n },\n fillcolor: _constants.COLORS.middleGray,\n opacity: 0.3\n };\n\n if (updateContainer) {\n updateContainer(_defineProperty({}, key, value));\n }\n }\n };\n return /*#__PURE__*/_react.default.createElement(_derived.LayoutPanel, {\n addAction: canAdd ? addAction : null,\n canReorder: canReorder\n }, content ? content : /*#__PURE__*/_react.default.createElement(_PanelEmpty.PanelMessage, {\n heading: _('Lines, Rectangles and Ellipses.')\n }, /*#__PURE__*/_react.default.createElement(\"p\", null, _('Add shapes to a figure to highlight points or periods in time, thresholds, or areas of interest.')), /*#__PURE__*/_react.default.createElement(\"p\", null, _('Click on the + button above to add a shape.'))));\n }\n }]);\n\n return ShapeAccordion;\n}(_react.Component);\n\nShapeAccordion.contextTypes = {\n layout: _propTypes.default.object,\n localize: _propTypes.default.func\n};\nShapeAccordion.propTypes = {\n children: _propTypes.default.node,\n canAdd: _propTypes.default.bool,\n canReorder: _propTypes.default.bool\n};\nvar _default = ShapeAccordion;\nexports.default = _default;\n//# sourceMappingURL=ShapeAccordion.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/containers/ShapeAccordion.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/containers/SingleSidebarItem.js": /*!****************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/containers/SingleSidebarItem.js ***! \****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar SingleSidebarItem = /*#__PURE__*/function (_Component) {\n _inherits(SingleSidebarItem, _Component);\n\n var _super = _createSuper(SingleSidebarItem);\n\n function SingleSidebarItem() {\n _classCallCheck(this, SingleSidebarItem);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(SingleSidebarItem, [{\n key: \"render\",\n value: function render() {\n return this.props.children ? /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"sidebar__item--single\"\n }, this.props.children) : null;\n }\n }]);\n\n return SingleSidebarItem;\n}(_react.Component);\n\nexports.default = SingleSidebarItem;\nSingleSidebarItem.plotly_editor_traits = {\n sidebar_element: true\n};\nSingleSidebarItem.propTypes = {\n children: _propTypes.default.any\n};\n//# sourceMappingURL=SingleSidebarItem.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/containers/SingleSidebarItem.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/containers/SliderAccordion.js": /*!**************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/containers/SliderAccordion.js ***! \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _PlotlyFold = _interopRequireDefault(__webpack_require__(/*! ./PlotlyFold */ \"./node_modules/react-chart-editor/lib/components/containers/PlotlyFold.js\"));\n\nvar _TraceRequiredPanel = _interopRequireDefault(__webpack_require__(/*! ./TraceRequiredPanel */ \"./node_modules/react-chart-editor/lib/components/containers/TraceRequiredPanel.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar SliderFold = (0, _lib.connectSliderToLayout)(_PlotlyFold.default);\n\nvar SliderAccordion = /*#__PURE__*/function (_Component) {\n _inherits(SliderAccordion, _Component);\n\n var _super = _createSuper(SliderAccordion);\n\n function SliderAccordion() {\n _classCallCheck(this, SliderAccordion);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(SliderAccordion, [{\n key: \"render\",\n value: function render() {\n var _this$context = this.context,\n _this$context$layout$ = _this$context.layout.sliders,\n sliders = _this$context$layout$ === void 0 ? [] : _this$context$layout$,\n _ = _this$context.localize;\n var children = this.props.children;\n var content = sliders.length > 0 && sliders.map(function (sli, i) {\n return /*#__PURE__*/_react.default.createElement(SliderFold, {\n key: i,\n sliderIndex: i,\n name: _('Slider') + \" \".concat(i + 1)\n }, children);\n });\n return /*#__PURE__*/_react.default.createElement(_TraceRequiredPanel.default, null, content ? content : null);\n }\n }]);\n\n return SliderAccordion;\n}(_react.Component);\n\nSliderAccordion.contextTypes = {\n layout: _propTypes.default.object,\n localize: _propTypes.default.func\n};\nSliderAccordion.propTypes = {\n children: _propTypes.default.node\n};\nvar _default = SliderAccordion;\nexports.default = _default;\n//# sourceMappingURL=SliderAccordion.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/containers/SliderAccordion.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/containers/SubplotAccordion.js": /*!***************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/containers/SubplotAccordion.js ***! \***************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _PlotlyFold = _interopRequireDefault(__webpack_require__(/*! ./PlotlyFold */ \"./node_modules/react-chart-editor/lib/components/containers/PlotlyFold.js\"));\n\nvar _TraceRequiredPanel = _interopRequireDefault(__webpack_require__(/*! ./TraceRequiredPanel */ \"./node_modules/react-chart-editor/lib/components/containers/TraceRequiredPanel.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _constants = __webpack_require__(/*! ../../lib/constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar TraceFold = (0, _lib.connectTraceToPlot)(_PlotlyFold.default);\nvar NonCartesianSubplotFold = (0, _lib.connectNonCartesianSubplotToLayout)(_PlotlyFold.default);\nvar CartesianSubplotFold = (0, _lib.connectCartesianSubplotToLayout)(_PlotlyFold.default);\n\nvar SubplotAccordion = /*#__PURE__*/function (_Component) {\n _inherits(SubplotAccordion, _Component);\n\n var _super = _createSuper(SubplotAccordion);\n\n function SubplotAccordion() {\n _classCallCheck(this, SubplotAccordion);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(SubplotAccordion, [{\n key: \"render\",\n value: function render() {\n var _this$context = this.context,\n _this$context$data = _this$context.data,\n data = _this$context$data === void 0 ? [] : _this$context$data,\n _this$context$layout = _this$context.layout,\n layout = _this$context$layout === void 0 ? {} : _this$context$layout,\n _ = _this$context.localize;\n var children = this.props.children;\n var subplotFolds = [];\n var allCartesianAxisCombinations = data.reduce(function (acc, curVal, inx) {\n if (_constants.TRACE_TO_AXIS.cartesian.some(function (c) {\n return c === curVal.type;\n })) {\n var xaxis = 'xaxis' + (curVal.xaxis ? curVal.xaxis.substring(1) : '');\n var yaxis = 'yaxis' + (curVal.yaxis ? curVal.yaxis.substring(1) : '');\n var existingComboIndex = acc.findIndex(function (t) {\n return t.xaxis === xaxis && t.yaxis === yaxis;\n });\n\n if (existingComboIndex === -1) {\n acc.push({\n xaxis: xaxis,\n yaxis: yaxis,\n xaxisName: curVal.xaxis ? (0, _lib.getSubplotTitle)(curVal.xaxis, 'x', _) : 'X 1',\n yaxisName: curVal.yaxis ? (0, _lib.getSubplotTitle)(curVal.yaxis, 'y', _) : 'Y 1',\n index: [inx]\n });\n } else {\n acc[existingComboIndex].index.push(inx);\n }\n }\n\n return acc;\n }, []);\n allCartesianAxisCombinations.forEach(function (d) {\n return subplotFolds[d.index[0]] = /*#__PURE__*/_react.default.createElement(CartesianSubplotFold, {\n key: d.index[0],\n traceIndexes: d.index,\n canDelete: false,\n xaxis: d.xaxis,\n yaxis: d.yaxis,\n name: \"\".concat(d.xaxisName, \" | \").concat(d.yaxisName)\n }, children);\n }); // For each key in layout, find all traces that belong to this subplot.\n // E.g. if layout attr is 'ternary', find all traces that are of type\n // that has subplot ternary, if layout attr is 'ternary2', find traces\n // of right type that have attr 'subplot': 'ternary' in their data.\n\n /**\n Example:\n {\n \"data\": [\n {\n \"type\": \"scatterternary\",\n \"mode\": \"markers\",\n },\n {\n \"type\": \"scatterternary\",\n \"mode\": \"markers\",\n \"subplot\": \"ternary2\"\n }\n ],\n \"layout\": {\n \"ternary\": {},\n \"ternary2\": {},\n },\n }\n */\n\n Object.keys(layout).forEach(function (layoutKey) {\n var traceIndexes = [];\n var subplotName;\n\n if (['geo', 'mapbox', 'polar', 'gl3d', 'ternary'].some(function (subplotType) {\n subplotName = (0, _lib.getSubplotTitle)(layoutKey, subplotType, _);\n var trIndex = _constants.SUBPLOT_TO_ATTR[subplotType].layout === layoutKey ? data.findIndex(function (trace) {\n return _constants.TRACE_TO_AXIS[subplotType].some(function (tt) {\n return tt === trace.type;\n });\n }) : data.findIndex(function (trace) {\n return trace[_constants.SUBPLOT_TO_ATTR[subplotType].data] === layoutKey;\n });\n\n if (trIndex !== -1) {\n traceIndexes.push(trIndex);\n }\n\n return layoutKey.startsWith(_constants.SUBPLOT_TO_ATTR[subplotType].layout);\n })) {\n subplotFolds[traceIndexes[0]] = /*#__PURE__*/_react.default.createElement(NonCartesianSubplotFold, {\n key: layoutKey,\n traceIndexes: traceIndexes,\n canDelete: false,\n subplot: layoutKey,\n name: subplotName\n }, children);\n }\n });\n var counter = {\n pie: 0,\n table: 0,\n sunburst: 0,\n treemap: 0,\n sankey: 0,\n parcoords: 0,\n parcats: 0\n };\n data.forEach(function (d, i) {\n if (d.type === 'pie' && d.values || ['pie', 'table', 'sunburst', 'treemap', 'sankey', 'parcoords', 'parcats', 'funnelarea'].includes(d.type)) {\n counter[d.type]++;\n var currentCount = counter[d.type];\n subplotFolds[i] = /*#__PURE__*/_react.default.createElement(TraceFold, {\n key: i,\n traceIndexes: [i],\n canDelete: false,\n name: (0, _lib.capitalize)(d.type) + (currentCount > 1 ? ' ' + currentCount : '')\n }, children);\n }\n });\n return /*#__PURE__*/_react.default.createElement(_TraceRequiredPanel.default, null, subplotFolds);\n }\n }]);\n\n return SubplotAccordion;\n}(_react.Component);\n\nSubplotAccordion.contextTypes = {\n fullData: _propTypes.default.array,\n data: _propTypes.default.array,\n layout: _propTypes.default.object,\n localize: _propTypes.default.func\n};\nSubplotAccordion.propTypes = {\n children: _propTypes.default.node\n};\nvar _default = SubplotAccordion;\nexports.default = _default;\n//# sourceMappingURL=SubplotAccordion.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/containers/SubplotAccordion.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/containers/TraceAccordion.js": /*!*************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/containers/TraceAccordion.js ***! \*************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _PlotlyFold = _interopRequireDefault(__webpack_require__(/*! ./PlotlyFold */ \"./node_modules/react-chart-editor/lib/components/containers/PlotlyFold.js\"));\n\nvar _TraceRequiredPanel = _interopRequireDefault(__webpack_require__(/*! ./TraceRequiredPanel */ \"./node_modules/react-chart-editor/lib/components/containers/TraceRequiredPanel.js\"));\n\nvar _PlotlyPanel = _interopRequireDefault(__webpack_require__(/*! ./PlotlyPanel */ \"./node_modules/react-chart-editor/lib/components/containers/PlotlyPanel.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _constants = __webpack_require__(/*! ../../lib/constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _reactTabs = __webpack_require__(/*! react-tabs */ \"./node_modules/react-tabs/esm/index.js\");\n\nvar _traceTypes = __webpack_require__(/*! ../../lib/traceTypes */ \"./node_modules/react-chart-editor/lib/lib/traceTypes.js\");\n\nvar _PanelEmpty = __webpack_require__(/*! ./PanelEmpty */ \"./node_modules/react-chart-editor/lib/components/containers/PanelEmpty.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar TraceFold = (0, _lib.connectTraceToPlot)(_PlotlyFold.default);\n\nvar TraceAccordion = /*#__PURE__*/function (_Component) {\n _inherits(TraceAccordion, _Component);\n\n var _super = _createSuper(TraceAccordion);\n\n function TraceAccordion(props, context) {\n var _this;\n\n _classCallCheck(this, TraceAccordion);\n\n _this = _super.call(this, props, context);\n\n _this.setLocals(props, context);\n\n return _this;\n }\n\n _createClass(TraceAccordion, [{\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n }, {\n key: \"setLocals\",\n value: function setLocals(props, context) {\n var _this2 = this;\n\n var base = props.canGroup ? context.fullData : context.data;\n\n var traceFilterCondition = this.props.traceFilterCondition || function () {\n return true;\n };\n\n this.filteredTracesDataIndexes = [];\n this.filteredTraces = [];\n\n if (base && base.length && context.fullData.length) {\n this.filteredTraces = base.filter(function (t, i) {\n var fullTrace = props.canGroup ? t : context.fullData.filter(function (tr) {\n return tr.index === i;\n })[0];\n\n if (fullTrace) {\n var trace = context.data[fullTrace.index];\n\n if (traceFilterCondition(trace, fullTrace)) {\n _this2.filteredTracesDataIndexes.push(fullTrace.index);\n\n return true;\n }\n }\n\n return false;\n });\n }\n }\n }, {\n key: \"renderGroupedTraceFolds\",\n value: function renderGroupedTraceFolds() {\n var _this3 = this;\n\n if (!this.filteredTraces.length || this.filteredTraces.length <= 1) {\n return null;\n }\n\n var _ = this.context.localize;\n var dataArrayPositionsByTraceType = {};\n var fullDataArrayPositionsByTraceType = {};\n this.filteredTraces.forEach(function (trace) {\n var traceType = (0, _lib.plotlyTraceToCustomTrace)(trace);\n\n if (!dataArrayPositionsByTraceType[traceType]) {\n dataArrayPositionsByTraceType[traceType] = [];\n }\n\n if (!fullDataArrayPositionsByTraceType[traceType]) {\n fullDataArrayPositionsByTraceType[traceType] = [];\n }\n\n dataArrayPositionsByTraceType[traceType].push(trace.index); // _expandedIndex is the trace's index in the fullData array\n\n fullDataArrayPositionsByTraceType[traceType].push(trace._expandedIndex);\n });\n return Object.keys(fullDataArrayPositionsByTraceType).map(function (type, index) {\n return /*#__PURE__*/_react.default.createElement(TraceFold, {\n key: index,\n traceIndexes: dataArrayPositionsByTraceType[type],\n name: (0, _traceTypes.traceTypes)(_).find(function (t) {\n return t.value === type;\n }).label,\n fullDataArrayPosition: fullDataArrayPositionsByTraceType[type]\n }, _this3.props.children);\n });\n }\n }, {\n key: \"renderUngroupedTraceFolds\",\n value: function renderUngroupedTraceFolds() {\n var _this4 = this;\n\n if (this.filteredTraces.length) {\n return this.filteredTraces.map(function (d, i) {\n return /*#__PURE__*/_react.default.createElement(TraceFold, {\n key: i,\n traceIndexes: [d.index],\n canDelete: _this4.props.canAdd,\n fullDataArrayPosition: [d._expandedIndex]\n }, _this4.props.children);\n });\n }\n\n return null;\n }\n }, {\n key: \"renderTraceFolds\",\n value: function renderTraceFolds() {\n var _this5 = this;\n\n if (this.filteredTraces.length) {\n return this.filteredTraces.map(function (d, i) {\n return /*#__PURE__*/_react.default.createElement(TraceFold, {\n key: i,\n traceIndexes: [_this5.filteredTracesDataIndexes[i]],\n canDelete: _this5.props.canAdd\n }, _this5.props.children);\n });\n }\n\n return null;\n }\n }, {\n key: \"renderTracePanelHelp\",\n value: function renderTracePanelHelp() {\n var _ = this.context.localize;\n return /*#__PURE__*/_react.default.createElement(_PanelEmpty.PanelMessage, {\n heading: _('Trace your data.')\n }, /*#__PURE__*/_react.default.createElement(\"p\", null, _('Traces of various types like bar and line are the building blocks of your figure.')), /*#__PURE__*/_react.default.createElement(\"p\", null, _('You can add as many as you like, mixing and matching types and arranging them into subplots.')), /*#__PURE__*/_react.default.createElement(\"p\", null, _('Click on the + button above to add a trace.')));\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n canAdd = _this$props.canAdd,\n canGroup = _this$props.canGroup,\n canReorder = _this$props.canReorder;\n var _ = this.context.localize;\n\n if (canAdd) {\n var addAction = {\n label: _('Trace'),\n handler: function handler(_ref) {\n var onUpdate = _ref.onUpdate;\n\n if (onUpdate) {\n onUpdate({\n type: _constants.EDITOR_ACTIONS.ADD_TRACE\n });\n }\n }\n };\n var traceFolds = this.renderTraceFolds();\n return /*#__PURE__*/_react.default.createElement(_PlotlyPanel.default, {\n addAction: addAction,\n canReorder: canReorder\n }, traceFolds ? traceFolds : this.renderTracePanelHelp());\n }\n\n if (canGroup) {\n if (this.filteredTraces.length === 1) {\n return /*#__PURE__*/_react.default.createElement(_TraceRequiredPanel.default, null, this.renderUngroupedTraceFolds());\n }\n\n if (this.filteredTraces.length > 1) {\n return /*#__PURE__*/_react.default.createElement(_TraceRequiredPanel.default, {\n noPadding: true\n }, /*#__PURE__*/_react.default.createElement(_reactTabs.Tabs, null, /*#__PURE__*/_react.default.createElement(_reactTabs.TabList, null, /*#__PURE__*/_react.default.createElement(_reactTabs.Tab, null, _('Individually')), /*#__PURE__*/_react.default.createElement(_reactTabs.Tab, null, _('By Type'))), /*#__PURE__*/_react.default.createElement(_reactTabs.TabPanel, null, /*#__PURE__*/_react.default.createElement(_PlotlyPanel.default, null, this.renderUngroupedTraceFolds())), /*#__PURE__*/_react.default.createElement(_reactTabs.TabPanel, null, /*#__PURE__*/_react.default.createElement(_PlotlyPanel.default, null, this.renderGroupedTraceFolds()))));\n }\n }\n\n return /*#__PURE__*/_react.default.createElement(_TraceRequiredPanel.default, null, this.renderTraceFolds());\n }\n }]);\n\n return TraceAccordion;\n}(_react.Component);\n\nTraceAccordion.contextTypes = {\n fullData: _propTypes.default.array,\n data: _propTypes.default.array,\n localize: _propTypes.default.func\n};\nTraceAccordion.propTypes = {\n canAdd: _propTypes.default.bool,\n canGroup: _propTypes.default.bool,\n canReorder: _propTypes.default.bool,\n children: _propTypes.default.node,\n traceFilterCondition: _propTypes.default.func\n};\nvar _default = TraceAccordion;\nexports.default = _default;\n//# sourceMappingURL=TraceAccordion.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/containers/TraceAccordion.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/containers/TraceMarkerSection.js": /*!*****************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/containers/TraceMarkerSection.js ***! \*****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _PlotlySection = _interopRequireDefault(__webpack_require__(/*! ./PlotlySection */ \"./node_modules/react-chart-editor/lib/components/containers/PlotlySection.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar TraceMarkerSection = /*#__PURE__*/function (_Component) {\n _inherits(TraceMarkerSection, _Component);\n\n var _super = _createSuper(TraceMarkerSection);\n\n function TraceMarkerSection(props, context) {\n var _this;\n\n _classCallCheck(this, TraceMarkerSection);\n\n _this = _super.call(this, props, context);\n\n _this.setLocals(context);\n\n return _this;\n }\n\n _createClass(TraceMarkerSection, [{\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextContext);\n }\n }, {\n key: \"setLocals\",\n value: function setLocals(context) {\n var _ = this.context.localize;\n var traceType = context.fullContainer.type;\n\n if (['bar', 'histogram', 'funnel', 'waterfall'].includes(traceType)) {\n this.name = _('Bars');\n } else if (['funnelarea', 'pie', 'sunburst', 'treemap'].includes(traceType)) {\n this.name = _('Segments');\n } else {\n this.name = _('Points');\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react.default.createElement(_PlotlySection.default, {\n name: this.name\n }, this.props.children);\n }\n }]);\n\n return TraceMarkerSection;\n}(_react.Component);\n\nTraceMarkerSection.propTypes = {\n children: _propTypes.default.node,\n name: _propTypes.default.string\n};\nTraceMarkerSection.contextTypes = {\n fullContainer: _propTypes.default.object,\n localize: _propTypes.default.func\n};\nvar _default = TraceMarkerSection;\nexports.default = _default;\n//# sourceMappingURL=TraceMarkerSection.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/containers/TraceMarkerSection.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/containers/TraceRequiredPanel.js": /*!*****************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/containers/TraceRequiredPanel.js ***! \*****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _PanelEmpty = _interopRequireDefault(__webpack_require__(/*! ./PanelEmpty */ \"./node_modules/react-chart-editor/lib/components/containers/PanelEmpty.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _derived = __webpack_require__(/*! ./derived */ \"./node_modules/react-chart-editor/lib/components/containers/derived.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar TraceRequiredPanel = /*#__PURE__*/function (_Component) {\n _inherits(TraceRequiredPanel, _Component);\n\n var _super = _createSuper(TraceRequiredPanel);\n\n function TraceRequiredPanel() {\n _classCallCheck(this, TraceRequiredPanel);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(TraceRequiredPanel, [{\n key: \"hasTrace\",\n value: function hasTrace() {\n return this.context.fullData.filter(function (trace) {\n return trace.visible;\n }).length > 0;\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this = this;\n\n var _ = this.context.localize;\n\n var _this$props = this.props,\n children = _this$props.children,\n rest = _objectWithoutProperties(_this$props, [\"children\"]);\n\n if (!this.props.visible) {\n return null;\n }\n\n return this.hasTrace() ? /*#__PURE__*/_react.default.createElement(_derived.LayoutPanel, rest, children) : /*#__PURE__*/_react.default.createElement(_PanelEmpty.default, {\n heading: _(\"Looks like there aren't any traces defined yet.\")\n }, /*#__PURE__*/_react.default.createElement(\"p\", null, _('Go to the '), /*#__PURE__*/_react.default.createElement(\"a\", {\n onClick: function onClick() {\n return _this.context.setPanel('Structure', 'Traces');\n }\n }, _('Traces')), _(' panel under Structure to define traces.')));\n }\n }]);\n\n return TraceRequiredPanel;\n}(_react.Component);\n\nTraceRequiredPanel.propTypes = {\n children: _propTypes.default.node,\n visible: _propTypes.default.bool\n};\nTraceRequiredPanel.defaultProps = {\n visible: true\n};\nTraceRequiredPanel.contextTypes = {\n fullData: _propTypes.default.array,\n localize: _propTypes.default.func,\n setPanel: _propTypes.default.func\n};\nvar _default = TraceRequiredPanel;\nexports.default = _default;\n//# sourceMappingURL=TraceRequiredPanel.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/containers/TraceRequiredPanel.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/containers/TransformAccordion.js": /*!*****************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/containers/TransformAccordion.js ***! \*****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _PlotlyFold = _interopRequireDefault(__webpack_require__(/*! ./PlotlyFold */ \"./node_modules/react-chart-editor/lib/components/containers/PlotlyFold.js\"));\n\nvar _PlotlyPanel = _interopRequireDefault(__webpack_require__(/*! ./PlotlyPanel */ \"./node_modules/react-chart-editor/lib/components/containers/PlotlyPanel.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _PanelEmpty = __webpack_require__(/*! ./PanelEmpty */ \"./node_modules/react-chart-editor/lib/components/containers/PanelEmpty.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar TransformFold = (0, _lib.connectTransformToTrace)(_PlotlyFold.default);\n\nvar TransformAccordion = /*#__PURE__*/function (_Component) {\n _inherits(TransformAccordion, _Component);\n\n var _super = _createSuper(TransformAccordion);\n\n function TransformAccordion() {\n _classCallCheck(this, TransformAccordion);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(TransformAccordion, [{\n key: \"render\",\n value: function render() {\n var _this$context = this.context,\n _this$context$fullCon = _this$context.fullContainer.transforms,\n transforms = _this$context$fullCon === void 0 ? [] : _this$context$fullCon,\n _ = _this$context.localize,\n container = _this$context.container,\n dataSourceOptions = _this$context.dataSourceOptions;\n var children = this.props.children;\n var transformTypes = [{\n label: _('Filter'),\n type: 'filter'\n }, {\n label: _('Split'),\n type: 'groupby'\n }, {\n label: _('Aggregate'),\n type: 'aggregate'\n }, {\n label: _('Sort'),\n type: 'sort'\n }];\n var transformBy = container.transforms && container.transforms.map(function (tr) {\n var foldNameSuffix = '';\n\n if (tr.groupssrc) {\n var groupssrc = dataSourceOptions && dataSourceOptions.find(function (d) {\n return d.value === tr.groupssrc;\n });\n foldNameSuffix = \": \".concat(groupssrc && groupssrc.label ? groupssrc.label : tr.groupssrc);\n } else if (tr.targetsrc) {\n var targetsrc = dataSourceOptions && dataSourceOptions.find(function (d) {\n return d.value === tr.targetsrc;\n });\n foldNameSuffix = \": \".concat(targetsrc && targetsrc.label ? targetsrc.label : tr.targetsrc);\n }\n\n return foldNameSuffix;\n });\n var filteredTransforms = transforms.filter(function (_ref) {\n var type = _ref.type;\n return Boolean(type);\n });\n var content = filteredTransforms.length && filteredTransforms.map(function (tr, i) {\n return /*#__PURE__*/_react.default.createElement(TransformFold, {\n key: i,\n transformIndex: i,\n name: \"\".concat(transformTypes.filter(function (_ref2) {\n var type = _ref2.type;\n return type === tr.type;\n })[0].label).concat(transformBy && transformBy[i]),\n canDelete: true\n }, children);\n }); // cannot have 2 Split transforms on one trace:\n // https://github.com/plotly/plotly.js/issues/1742\n\n var addActionOptions = container.transforms && container.transforms.some(function (t) {\n return t.type === 'groupby';\n }) ? transformTypes.filter(function (t) {\n return t.type !== 'groupby';\n }) : transformTypes;\n var addAction = {\n label: _('Transform'),\n handler: addActionOptions.map(function (_ref3) {\n var label = _ref3.label,\n type = _ref3.type;\n return {\n label: label,\n handler: function handler(context) {\n var fullContainer = context.fullContainer,\n updateContainer = context.updateContainer;\n\n if (updateContainer) {\n var transformIndex = Array.isArray(fullContainer.transforms) ? fullContainer.transforms.length : 0;\n var key = \"transforms[\".concat(transformIndex, \"]\");\n var payload = {\n type: type\n };\n\n if (type === 'filter') {\n payload.target = [];\n payload.targetsrc = null;\n } else if (type !== 'sort') {\n payload.groupssrc = null;\n payload.groups = null;\n }\n\n if (type === 'groupby') {\n payload.styles = [];\n }\n\n updateContainer(_defineProperty({}, key, payload));\n }\n }\n };\n })\n };\n return /*#__PURE__*/_react.default.createElement(_PlotlyPanel.default, {\n addAction: addAction\n }, content ? content : /*#__PURE__*/_react.default.createElement(_PanelEmpty.PanelMessage, {\n icon: null\n }, /*#__PURE__*/_react.default.createElement(\"div\", {\n style: {\n textAlign: 'left'\n }\n }, /*#__PURE__*/_react.default.createElement(\"p\", null, /*#__PURE__*/_react.default.createElement(\"strong\", null, _('Filter')), ' ', _(' transforms allow you to filter data out from a trace.')), /*#__PURE__*/_react.default.createElement(\"p\", null, /*#__PURE__*/_react.default.createElement(\"strong\", null, _('Split')), ' ', _(' transforms allow you to create multiple traces from one source trace, so as to style them differently.')), /*#__PURE__*/_react.default.createElement(\"p\", null, /*#__PURE__*/_react.default.createElement(\"strong\", null, _('Aggregate')), ' ', _(' transforms allow you to summarize a trace using an aggregate function like \"average\" or \"minimum\".')), /*#__PURE__*/_react.default.createElement(\"p\", null, /*#__PURE__*/_react.default.createElement(\"strong\", null, _('Sort')), ' ', _(' transforms allow you to sort a trace, so as to control marker overlay or line connection order.'))), /*#__PURE__*/_react.default.createElement(\"p\", null, _('Click on the + button above to add a transform.'))));\n }\n }]);\n\n return TransformAccordion;\n}(_react.Component);\n\nTransformAccordion.contextTypes = {\n fullContainer: _propTypes.default.object,\n localize: _propTypes.default.func,\n container: _propTypes.default.object,\n dataSourceOptions: _propTypes.default.array\n};\nTransformAccordion.propTypes = {\n children: _propTypes.default.node\n};\nvar _default = TransformAccordion;\nexports.default = _default;\n//# sourceMappingURL=TransformAccordion.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/containers/TransformAccordion.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/containers/UpdateMenuAccordion.js": /*!******************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/containers/UpdateMenuAccordion.js ***! \******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _PlotlyFold = _interopRequireDefault(__webpack_require__(/*! ./PlotlyFold */ \"./node_modules/react-chart-editor/lib/components/containers/PlotlyFold.js\"));\n\nvar _TraceRequiredPanel = _interopRequireDefault(__webpack_require__(/*! ./TraceRequiredPanel */ \"./node_modules/react-chart-editor/lib/components/containers/TraceRequiredPanel.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar UpdateMenuFold = (0, _lib.connectUpdateMenuToLayout)(_PlotlyFold.default);\n\nvar UpdateMenuAccordion = /*#__PURE__*/function (_Component) {\n _inherits(UpdateMenuAccordion, _Component);\n\n var _super = _createSuper(UpdateMenuAccordion);\n\n function UpdateMenuAccordion() {\n _classCallCheck(this, UpdateMenuAccordion);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(UpdateMenuAccordion, [{\n key: \"render\",\n value: function render() {\n var _this$context = this.context,\n _this$context$fullLay = _this$context.fullLayout.updatemenus,\n updatemenus = _this$context$fullLay === void 0 ? [] : _this$context$fullLay,\n _ = _this$context.localize;\n var children = this.props.children;\n var content = updatemenus.length > 0 && updatemenus.map(function (upd, i) {\n var localizedType = {\n dropdown: _('Dropdown'),\n buttons: _('Buttons')\n };\n var menuType = localizedType[upd.type] || localizedType.dropdown;\n var activeBtn = upd.buttons.filter(function (b) {\n return b._index === upd.active;\n })[0];\n var foldName = menuType + (activeBtn ? ': ' + activeBtn.label : '');\n return /*#__PURE__*/_react.default.createElement(UpdateMenuFold, {\n key: i,\n updateMenuIndex: i,\n name: foldName\n }, children);\n });\n return /*#__PURE__*/_react.default.createElement(_TraceRequiredPanel.default, null, content ? content : null);\n }\n }]);\n\n return UpdateMenuAccordion;\n}(_react.Component);\n\nUpdateMenuAccordion.contextTypes = {\n fullLayout: _propTypes.default.object,\n localize: _propTypes.default.func\n};\nUpdateMenuAccordion.propTypes = {\n children: _propTypes.default.node\n};\nvar _default = UpdateMenuAccordion;\nexports.default = _default;\n//# sourceMappingURL=UpdateMenuAccordion.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/containers/UpdateMenuAccordion.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/containers/derived.js": /*!******************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/containers/derived.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.TraceTypeSection = exports.LayoutSection = exports.LayoutPanel = void 0;\n\nvar _react = _interopRequireDefault(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _PlotlyPanel = _interopRequireDefault(__webpack_require__(/*! ./PlotlyPanel */ \"./node_modules/react-chart-editor/lib/components/containers/PlotlyPanel.js\"));\n\nvar _PlotlySection = _interopRequireDefault(__webpack_require__(/*! ./PlotlySection */ \"./node_modules/react-chart-editor/lib/components/containers/PlotlySection.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar LayoutPanel = (0, _lib.connectLayoutToPlot)(_PlotlyPanel.default);\nexports.LayoutPanel = LayoutPanel;\nvar LayoutSection = (0, _lib.connectLayoutToPlot)(_PlotlySection.default);\nexports.LayoutSection = LayoutSection;\n\nvar TraceTypeSection = function TraceTypeSection(props, context) {\n var fullContainer = context.fullContainer,\n fullData = context.fullData;\n var mode = props.mode,\n traceTypes = props.traceTypes;\n var ifConnectedToTrace = mode === 'trace' && fullContainer && traceTypes.includes(fullContainer.type);\n var ifConnectedToLayout = mode === 'layout' && fullData && fullData.some(function (t) {\n return traceTypes.includes(t.type);\n });\n\n if (ifConnectedToTrace || ifConnectedToLayout) {\n return /*#__PURE__*/_react.default.createElement(_PlotlySection.default, props);\n }\n\n return null;\n};\n\nexports.TraceTypeSection = TraceTypeSection;\nTraceTypeSection.contextTypes = _lib.containerConnectedContextTypes;\nTraceTypeSection.propTypes = {\n children: _propTypes.default.node,\n name: _propTypes.default.string,\n traceTypes: _propTypes.default.array,\n mode: _propTypes.default.string\n};\nTraceTypeSection.defaultProps = {\n traceTypes: [],\n mode: 'layout'\n};\n//# sourceMappingURL=derived.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/containers/derived.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/containers/index.js": /*!****************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/containers/index.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar _exportNames = {\n AnnotationAccordion: true,\n ShapeAccordion: true,\n SliderAccordion: true,\n ImageAccordion: true,\n UpdateMenuAccordion: true,\n RangeSelectorAccordion: true,\n MapboxLayersAccordion: true,\n AxesFold: true,\n PlotlyFold: true,\n Fold: true,\n MenuPanel: true,\n PlotlyPanel: true,\n Panel: true,\n PlotlySection: true,\n Section: true,\n PanelEmpty: true,\n PanelMessage: true,\n SubplotAccordion: true,\n TraceAccordion: true,\n TransformAccordion: true,\n TraceMarkerSection: true,\n TraceRequiredPanel: true,\n SingleSidebarItem: true,\n ModalProvider: true,\n Modal: true\n};\nObject.defineProperty(exports, \"AnnotationAccordion\", {\n enumerable: true,\n get: function get() {\n return _AnnotationAccordion.default;\n }\n});\nObject.defineProperty(exports, \"ShapeAccordion\", {\n enumerable: true,\n get: function get() {\n return _ShapeAccordion.default;\n }\n});\nObject.defineProperty(exports, \"SliderAccordion\", {\n enumerable: true,\n get: function get() {\n return _SliderAccordion.default;\n }\n});\nObject.defineProperty(exports, \"ImageAccordion\", {\n enumerable: true,\n get: function get() {\n return _ImageAccordion.default;\n }\n});\nObject.defineProperty(exports, \"UpdateMenuAccordion\", {\n enumerable: true,\n get: function get() {\n return _UpdateMenuAccordion.default;\n }\n});\nObject.defineProperty(exports, \"RangeSelectorAccordion\", {\n enumerable: true,\n get: function get() {\n return _RangeSelectorAccordion.default;\n }\n});\nObject.defineProperty(exports, \"MapboxLayersAccordion\", {\n enumerable: true,\n get: function get() {\n return _MapboxLayersAccordion.default;\n }\n});\nObject.defineProperty(exports, \"AxesFold\", {\n enumerable: true,\n get: function get() {\n return _AxesFold.default;\n }\n});\nObject.defineProperty(exports, \"PlotlyFold\", {\n enumerable: true,\n get: function get() {\n return _PlotlyFold.default;\n }\n});\nObject.defineProperty(exports, \"Fold\", {\n enumerable: true,\n get: function get() {\n return _PlotlyFold.Fold;\n }\n});\nObject.defineProperty(exports, \"MenuPanel\", {\n enumerable: true,\n get: function get() {\n return _MenuPanel.default;\n }\n});\nObject.defineProperty(exports, \"PlotlyPanel\", {\n enumerable: true,\n get: function get() {\n return _PlotlyPanel.default;\n }\n});\nObject.defineProperty(exports, \"Panel\", {\n enumerable: true,\n get: function get() {\n return _PlotlyPanel.Panel;\n }\n});\nObject.defineProperty(exports, \"PlotlySection\", {\n enumerable: true,\n get: function get() {\n return _PlotlySection.default;\n }\n});\nObject.defineProperty(exports, \"Section\", {\n enumerable: true,\n get: function get() {\n return _PlotlySection.Section;\n }\n});\nObject.defineProperty(exports, \"PanelEmpty\", {\n enumerable: true,\n get: function get() {\n return _PanelEmpty.default;\n }\n});\nObject.defineProperty(exports, \"PanelMessage\", {\n enumerable: true,\n get: function get() {\n return _PanelEmpty.PanelMessage;\n }\n});\nObject.defineProperty(exports, \"SubplotAccordion\", {\n enumerable: true,\n get: function get() {\n return _SubplotAccordion.default;\n }\n});\nObject.defineProperty(exports, \"TraceAccordion\", {\n enumerable: true,\n get: function get() {\n return _TraceAccordion.default;\n }\n});\nObject.defineProperty(exports, \"TransformAccordion\", {\n enumerable: true,\n get: function get() {\n return _TransformAccordion.default;\n }\n});\nObject.defineProperty(exports, \"TraceMarkerSection\", {\n enumerable: true,\n get: function get() {\n return _TraceMarkerSection.default;\n }\n});\nObject.defineProperty(exports, \"TraceRequiredPanel\", {\n enumerable: true,\n get: function get() {\n return _TraceRequiredPanel.default;\n }\n});\nObject.defineProperty(exports, \"SingleSidebarItem\", {\n enumerable: true,\n get: function get() {\n return _SingleSidebarItem.default;\n }\n});\nObject.defineProperty(exports, \"ModalProvider\", {\n enumerable: true,\n get: function get() {\n return _ModalProvider.default;\n }\n});\nObject.defineProperty(exports, \"Modal\", {\n enumerable: true,\n get: function get() {\n return _Modal.default;\n }\n});\n\nvar _AnnotationAccordion = _interopRequireDefault(__webpack_require__(/*! ./AnnotationAccordion */ \"./node_modules/react-chart-editor/lib/components/containers/AnnotationAccordion.js\"));\n\nvar _ShapeAccordion = _interopRequireDefault(__webpack_require__(/*! ./ShapeAccordion */ \"./node_modules/react-chart-editor/lib/components/containers/ShapeAccordion.js\"));\n\nvar _SliderAccordion = _interopRequireDefault(__webpack_require__(/*! ./SliderAccordion */ \"./node_modules/react-chart-editor/lib/components/containers/SliderAccordion.js\"));\n\nvar _ImageAccordion = _interopRequireDefault(__webpack_require__(/*! ./ImageAccordion */ \"./node_modules/react-chart-editor/lib/components/containers/ImageAccordion.js\"));\n\nvar _UpdateMenuAccordion = _interopRequireDefault(__webpack_require__(/*! ./UpdateMenuAccordion */ \"./node_modules/react-chart-editor/lib/components/containers/UpdateMenuAccordion.js\"));\n\nvar _RangeSelectorAccordion = _interopRequireDefault(__webpack_require__(/*! ./RangeSelectorAccordion */ \"./node_modules/react-chart-editor/lib/components/containers/RangeSelectorAccordion.js\"));\n\nvar _MapboxLayersAccordion = _interopRequireDefault(__webpack_require__(/*! ./MapboxLayersAccordion */ \"./node_modules/react-chart-editor/lib/components/containers/MapboxLayersAccordion.js\"));\n\nvar _AxesFold = _interopRequireDefault(__webpack_require__(/*! ./AxesFold */ \"./node_modules/react-chart-editor/lib/components/containers/AxesFold.js\"));\n\nvar _PlotlyFold = _interopRequireWildcard(__webpack_require__(/*! ./PlotlyFold */ \"./node_modules/react-chart-editor/lib/components/containers/PlotlyFold.js\"));\n\nvar _MenuPanel = _interopRequireDefault(__webpack_require__(/*! ./MenuPanel */ \"./node_modules/react-chart-editor/lib/components/containers/MenuPanel.js\"));\n\nvar _PlotlyPanel = _interopRequireWildcard(__webpack_require__(/*! ./PlotlyPanel */ \"./node_modules/react-chart-editor/lib/components/containers/PlotlyPanel.js\"));\n\nvar _PlotlySection = _interopRequireWildcard(__webpack_require__(/*! ./PlotlySection */ \"./node_modules/react-chart-editor/lib/components/containers/PlotlySection.js\"));\n\nvar _PanelEmpty = _interopRequireWildcard(__webpack_require__(/*! ./PanelEmpty */ \"./node_modules/react-chart-editor/lib/components/containers/PanelEmpty.js\"));\n\nvar _SubplotAccordion = _interopRequireDefault(__webpack_require__(/*! ./SubplotAccordion */ \"./node_modules/react-chart-editor/lib/components/containers/SubplotAccordion.js\"));\n\nvar _TraceAccordion = _interopRequireDefault(__webpack_require__(/*! ./TraceAccordion */ \"./node_modules/react-chart-editor/lib/components/containers/TraceAccordion.js\"));\n\nvar _TransformAccordion = _interopRequireDefault(__webpack_require__(/*! ./TransformAccordion */ \"./node_modules/react-chart-editor/lib/components/containers/TransformAccordion.js\"));\n\nvar _TraceMarkerSection = _interopRequireDefault(__webpack_require__(/*! ./TraceMarkerSection */ \"./node_modules/react-chart-editor/lib/components/containers/TraceMarkerSection.js\"));\n\nvar _TraceRequiredPanel = _interopRequireDefault(__webpack_require__(/*! ./TraceRequiredPanel */ \"./node_modules/react-chart-editor/lib/components/containers/TraceRequiredPanel.js\"));\n\nvar _SingleSidebarItem = _interopRequireDefault(__webpack_require__(/*! ./SingleSidebarItem */ \"./node_modules/react-chart-editor/lib/components/containers/SingleSidebarItem.js\"));\n\nvar _ModalProvider = _interopRequireDefault(__webpack_require__(/*! ./ModalProvider */ \"./node_modules/react-chart-editor/lib/components/containers/ModalProvider.js\"));\n\nvar _Modal = _interopRequireDefault(__webpack_require__(/*! ./Modal */ \"./node_modules/react-chart-editor/lib/components/containers/Modal.js\"));\n\nvar _derived = __webpack_require__(/*! ./derived */ \"./node_modules/react-chart-editor/lib/components/containers/derived.js\");\n\nObject.keys(_derived).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function get() {\n return _derived[key];\n }\n });\n});\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/containers/index.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/ArrowSelector.js": /*!********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/ArrowSelector.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _Dropdown = _interopRequireDefault(__webpack_require__(/*! ./Dropdown */ \"./node_modules/react-chart-editor/lib/components/fields/Dropdown.js\"));\n\nvar _react = _interopRequireDefault(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _arrow_paths = _interopRequireDefault(__webpack_require__(/*! plotly.js/src/components/annotations/arrow_paths */ \"./node_modules/plotly.js/src/components/annotations/arrow_paths.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nvar ARROW_OPTIONS = _arrow_paths.default.map(function (_ref, index) {\n var path = _ref.path;\n\n var label = /*#__PURE__*/_react.default.createElement(\"svg\", {\n width: \"40\",\n height: \"20\",\n style: {\n position: 'relative'\n }\n }, /*#__PURE__*/_react.default.createElement(\"line\", {\n stroke: \"rgb(68, 68, 68)\",\n style: {\n fill: 'none'\n },\n x1: \"5\",\n y1: \"10\",\n x2: \"23.8\",\n y2: \"10\",\n strokeWidth: \"2\"\n }), /*#__PURE__*/_react.default.createElement(\"path\", {\n d: path,\n transform: \"translate(23.8,10)rotate(360)scale(2)\",\n style: {\n fill: 'rgb(68, 68, 68)',\n opacity: 1,\n strokeWidth: 0\n }\n }));\n\n return {\n label: label,\n value: index,\n key: 'arrow' + index\n };\n});\n\nvar ArrowSelector = function ArrowSelector(props) {\n return /*#__PURE__*/_react.default.createElement(_Dropdown.default, _extends({}, props, {\n options: ARROW_OPTIONS\n }));\n};\n\nArrowSelector.propTypes = _objectSpread({}, _Dropdown.default.propTypes);\nArrowSelector.defaultProps = {\n clearable: false\n};\nvar _default = ArrowSelector;\nexports.default = _default;\n//# sourceMappingURL=ArrowSelector.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/ArrowSelector.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/AxesCreator.js": /*!******************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/AxesCreator.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _Dropdown = _interopRequireDefault(__webpack_require__(/*! ./Dropdown */ \"./node_modules/react-chart-editor/lib/components/fields/Dropdown.js\"));\n\nvar _Info = _interopRequireDefault(__webpack_require__(/*! ./Info */ \"./node_modules/react-chart-editor/lib/components/fields/Info.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _constants = __webpack_require__(/*! ../../lib/constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nvar _Button = _interopRequireDefault(__webpack_require__(/*! ../widgets/Button */ \"./node_modules/react-chart-editor/lib/components/widgets/Button.js\"));\n\nvar _plotlyIcons = __webpack_require__(/*! plotly-icons */ \"./node_modules/plotly-icons/lib/index.js\");\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _2 = __webpack_require__(/*! ./.. */ \"./node_modules/react-chart-editor/lib/components/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar UnconnectedAxisCreator = /*#__PURE__*/function (_Component) {\n _inherits(UnconnectedAxisCreator, _Component);\n\n var _super = _createSuper(UnconnectedAxisCreator);\n\n function UnconnectedAxisCreator() {\n _classCallCheck(this, UnconnectedAxisCreator);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(UnconnectedAxisCreator, [{\n key: \"canAddAxis\",\n value: function canAddAxis() {\n var _this = this;\n\n var currentAxisId = this.props.fullContainer[this.props.attr];\n var currentTraceIndex = this.props.fullContainer.index;\n return this.context.fullData.some(function (d) {\n return d.index !== currentTraceIndex && d[_this.props.attr] === currentAxisId;\n });\n }\n }, {\n key: \"addAndUpdateAxis\",\n value: function addAndUpdateAxis() {\n var _update;\n\n var _this$props = this.props,\n attr = _this$props.attr,\n updateContainer = _this$props.updateContainer;\n var _this$context = this.context,\n onUpdate = _this$context.onUpdate,\n subplots = _this$context.fullLayout._subplots;\n var lastAxisNumber = Number(subplots[attr][subplots[attr].length - 1].charAt(1)) || 1;\n updateContainer(_defineProperty({}, attr, attr.charAt(0) + (lastAxisNumber + 1)));\n var side = null;\n\n if (attr === 'yaxis') {\n side = 'right';\n } else if (attr === 'xaxis') {\n side = 'top';\n }\n\n onUpdate({\n type: _constants.EDITOR_ACTIONS.UPDATE_LAYOUT,\n payload: {\n update: (_update = {}, _defineProperty(_update, \"\".concat(attr + (lastAxisNumber + 1), \".side\"), side), _defineProperty(_update, \"\".concat(attr + (lastAxisNumber + 1), \".overlaying\"), !(attr === 'yaxis' || attr === 'xaxis') ? null : subplots[attr][subplots[attr].length - 1]), _update)\n }\n });\n }\n }, {\n key: \"updateAxis\",\n value: function updateAxis(update) {\n var _this2 = this;\n\n var currentAxisId = this.props.fullContainer[this.props.attr];\n var axesToBeGarbageCollected = []; // When we select another axis, make sure no unused axes are left\n\n if (currentAxisId !== update && !this.context.fullData.some(function (trace) {\n return trace[_this2.props.attr] === currentAxisId && trace.index !== _this2.props.fullContainer.index;\n })) {\n axesToBeGarbageCollected.push(currentAxisId);\n }\n\n this.context.onUpdate({\n type: _constants.EDITOR_ACTIONS.UPDATE_TRACES,\n payload: {\n axesToBeGarbageCollected: axesToBeGarbageCollected,\n update: _defineProperty({}, this.props.attr, update),\n traceIndexes: [this.props.fullContainer.index]\n }\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this3 = this;\n\n var icon = /*#__PURE__*/_react.default.createElement(_plotlyIcons.PlusIcon, null);\n\n var extraComponent = this.canAddAxis() ? /*#__PURE__*/_react.default.createElement(_Button.default, {\n variant: \"no-text\",\n icon: icon,\n onClick: function onClick() {\n return _this3.addAndUpdateAxis();\n }\n }) : /*#__PURE__*/_react.default.createElement(_Button.default, {\n variant: \"no-text--disabled\",\n icon: icon,\n onClick: function onClick() {}\n });\n return /*#__PURE__*/_react.default.createElement(_Dropdown.default, {\n label: this.props.label,\n attr: this.props.attr,\n clearable: false,\n options: this.props.options,\n updatePlot: function updatePlot(u) {\n return _this3.updateAxis(u);\n },\n extraComponent: extraComponent\n });\n }\n }]);\n\n return UnconnectedAxisCreator;\n}(_react.Component);\n\nUnconnectedAxisCreator.propTypes = {\n attr: _propTypes.default.string,\n label: _propTypes.default.string,\n options: _propTypes.default.array,\n container: _propTypes.default.object,\n fullContainer: _propTypes.default.object,\n updateContainer: _propTypes.default.func\n};\nUnconnectedAxisCreator.contextTypes = {\n fullLayout: _propTypes.default.object,\n data: _propTypes.default.array,\n fullData: _propTypes.default.array,\n onUpdate: _propTypes.default.func\n};\nvar AxisCreator = (0, _lib.connectToContainer)(UnconnectedAxisCreator);\n\nvar UnconnectedAxesCreator = /*#__PURE__*/function (_Component2) {\n _inherits(UnconnectedAxesCreator, _Component2);\n\n var _super2 = _createSuper(UnconnectedAxesCreator);\n\n function UnconnectedAxesCreator() {\n _classCallCheck(this, UnconnectedAxesCreator);\n\n return _super2.apply(this, arguments);\n }\n\n _createClass(UnconnectedAxesCreator, [{\n key: \"render\",\n value: function render() {\n var _this4 = this;\n\n var axisType = (0, _lib.traceTypeToAxisType)(this.props.container.type);\n var isFirstTraceOfAxisType = this.context.data.filter(function (d) {\n return (0, _lib.traceTypeToAxisType)(d.type) === axisType;\n }).length === 1;\n\n if (isFirstTraceOfAxisType) {\n return null;\n }\n\n var _this$context2 = this.context,\n fullLayout = _this$context2.fullLayout,\n _ = _this$context2.localize;\n var controls = [];\n\n function getOptions(axisType) {\n return fullLayout._subplots[axisType].map(function (axisId) {\n return {\n label: (0, _lib.getParsedTemplateString)((0, _lib.getAxisTitle)(fullLayout[(0, _lib.axisIdToAxisName)(axisId)]), {\n meta: fullLayout.meta\n }),\n value: axisId\n };\n });\n }\n\n if (axisType === 'cartesian') {\n ['xaxis', 'yaxis'].forEach(function (type, index) {\n controls.push( /*#__PURE__*/_react.default.createElement(AxisCreator, {\n key: index,\n attr: type,\n label: type.charAt(0).toUpperCase() + _(' Axis'),\n options: getOptions(type)\n }));\n });\n }\n\n return /*#__PURE__*/_react.default.createElement(_2.PlotlySection, {\n name: _('Axes to Use')\n }, controls, /*#__PURE__*/_react.default.createElement(_Info.default, null, _('You can style and position your axes in the '), /*#__PURE__*/_react.default.createElement(\"a\", {\n onClick: function onClick() {\n return _this4.context.setPanel('Structure', 'Subplots');\n }\n }, _('Subplots')), _(' panel.')));\n }\n }]);\n\n return UnconnectedAxesCreator;\n}(_react.Component);\n\nUnconnectedAxesCreator.propTypes = {\n container: _propTypes.default.object,\n fullContainer: _propTypes.default.object\n};\nUnconnectedAxesCreator.contextTypes = {\n data: _propTypes.default.array,\n fullData: _propTypes.default.array,\n fullLayout: _propTypes.default.object,\n localize: _propTypes.default.func,\n setPanel: _propTypes.default.func\n};\n\nvar _default = (0, _lib.connectToContainer)(UnconnectedAxesCreator, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n var data = context.data;\n var fullContainer = plotProps.fullContainer;\n plotProps.isVisible = data.length > 1 && data[fullContainer.index] && (0, _lib.traceTypeToAxisType)(data[fullContainer.index].type) === 'cartesian';\n }\n});\n\nexports.default = _default;\n//# sourceMappingURL=AxesCreator.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/AxesCreator.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/AxesSelector.js": /*!*******************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/AxesSelector.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _Dropdown = _interopRequireDefault(__webpack_require__(/*! ../widgets/Dropdown */ \"./node_modules/react-chart-editor/lib/components/widgets/Dropdown.js\"));\n\nvar _RadioBlocks = _interopRequireDefault(__webpack_require__(/*! ../widgets/RadioBlocks */ \"./node_modules/react-chart-editor/lib/components/widgets/RadioBlocks.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar AxesSelector = /*#__PURE__*/function (_Component) {\n _inherits(AxesSelector, _Component);\n\n var _super = _createSuper(AxesSelector);\n\n function AxesSelector(props, context) {\n var _this;\n\n _classCallCheck(this, AxesSelector);\n\n _this = _super.call(this, props, context);\n var _ = context.localize;\n\n if (!context.axesTargetHandler) {\n throw new Error(_('AxesSelector must be nested within a connectAxesToPlot component'));\n }\n\n return _this;\n }\n\n _createClass(AxesSelector, [{\n key: \"render\",\n value: function render() {\n var _this$context = this.context,\n axesTargetHandler = _this$context.axesTargetHandler,\n axesTarget = _this$context.axesTarget,\n fullLayout = _this$context.fullLayout,\n _ = _this$context.localize;\n var axesOptions = this.props.axesOptions;\n var maxCharsThatFitInRadio = 27;\n var maxOptions = axesOptions.length > 4; // eslint-disable-line\n\n var multipleSublots = fullLayout && fullLayout._subplots && Object.values(fullLayout._subplots).some(function (s) {\n return s.length > 1;\n });\n var options = multipleSublots ? axesOptions.map(function (option) {\n return option.value === 'allaxes' ? option : {\n label: (0, _lib.getParsedTemplateString)(option.title, {\n meta: fullLayout.meta\n }),\n value: option.value\n };\n }) : axesOptions;\n var totalCharsInOptions = options && options.map(function (o) {\n return o.label;\n }).reduce(function (acc, o) {\n return acc + o.length;\n }, 0) || 0;\n return maxOptions || totalCharsInOptions >= maxCharsThatFitInRadio ? /*#__PURE__*/_react.default.createElement(_Field.default, _extends({}, this.props, {\n label: _('Axis to Style')\n }), /*#__PURE__*/_react.default.createElement(_Dropdown.default, {\n options: options,\n value: axesTarget,\n onChange: axesTargetHandler,\n clearable: false\n })) : /*#__PURE__*/_react.default.createElement(_Field.default, _extends({}, this.props, {\n center: true\n }), /*#__PURE__*/_react.default.createElement(_RadioBlocks.default, {\n options: options,\n activeOption: axesTarget,\n onOptionChange: axesTargetHandler\n }));\n }\n }]);\n\n return AxesSelector;\n}(_react.Component);\n\nAxesSelector.contextTypes = {\n axesTargetHandler: _propTypes.default.func,\n axesTarget: _propTypes.default.string,\n fullLayout: _propTypes.default.object,\n localize: _propTypes.default.func\n};\nAxesSelector.propTypes = {\n axesOptions: _propTypes.default.array\n};\nvar _default = AxesSelector;\nexports.default = _default;\n//# sourceMappingURL=AxesSelector.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/AxesSelector.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/AxisInterval.js": /*!*******************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/AxisInterval.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.UnconnectedAxisInterval = void 0;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _Dropdown = _interopRequireDefault(__webpack_require__(/*! ../widgets/Dropdown */ \"./node_modules/react-chart-editor/lib/components/widgets/Dropdown.js\"));\n\nvar _NumericInput = _interopRequireDefault(__webpack_require__(/*! ../widgets/NumericInput */ \"./node_modules/react-chart-editor/lib/components/widgets/NumericInput.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _lib2 = __webpack_require__(/*! plotly.js/src/lib */ \"./node_modules/plotly.js/src/lib/index.js\");\n\nvar _dates = __webpack_require__(/*! plotly.js/src/lib/dates */ \"./node_modules/plotly.js/src/lib/dates.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar MILLISECONDS_IN_SECOND = 1000;\nvar MILLISECONDS_IN_MINUTE = MILLISECONDS_IN_SECOND * 60; // eslint-disable-line\n\nvar MILLISECONDS_IN_DAY = MILLISECONDS_IN_MINUTE * 60 * 24; // eslint-disable-line\n\nvar DAYS_IN_MONTH = 30;\nvar MONTHS_IN_YEAR = 12; //eslint-disable-line\n\nfunction twoDecimalsRound(value) {\n return Math.round(value * 100) / 100;\n}\n\nfunction getSmallestUnit(milliseconds) {\n var units = {\n seconds: MILLISECONDS_IN_SECOND,\n minutes: MILLISECONDS_IN_MINUTE,\n days: MILLISECONDS_IN_DAY\n };\n var smallestUnit = 'milliseconds';\n ['seconds', 'minutes', 'days'].forEach(function (unit) {\n if (milliseconds % units[unit] === 0 && (smallestUnit === 'milliseconds' || smallestUnit !== 'milliseconds' && milliseconds / units[smallestUnit] > milliseconds / units[unit])) {\n smallestUnit = unit;\n }\n });\n return smallestUnit;\n}\n\nvar UnconnectedAxisInterval = /*#__PURE__*/function (_Component) {\n _inherits(UnconnectedAxisInterval, _Component);\n\n var _super = _createSuper(UnconnectedAxisInterval);\n\n function UnconnectedAxisInterval(props) {\n var _this;\n\n _classCallCheck(this, UnconnectedAxisInterval);\n\n _this = _super.call(this, props);\n var initialUnit = props.fullValue && typeof props.fullValue === 'string' && props.fullValue[0] === 'M' ? parseInt(props.fullValue.substring(1), 10) % MONTHS_IN_YEAR === 0 ? 'years' : 'months' : getSmallestUnit(props.fullValue);\n _this.state = {\n units: initialUnit\n };\n return _this;\n }\n\n _createClass(UnconnectedAxisInterval, [{\n key: \"update\",\n value: function update(value) {\n var adjustedValue = value < 0 ? 0 : value;\n var isValueInteger = adjustedValue % 1 === 0;\n\n if (this.state.units === 'years') {\n if (isValueInteger) {\n adjustedValue = 'M' + adjustedValue * MONTHS_IN_YEAR;\n } else {\n adjustedValue = adjustedValue * MONTHS_IN_YEAR * DAYS_IN_MONTH * MILLISECONDS_IN_DAY;\n }\n }\n\n if (this.state.units === 'months') {\n if (isValueInteger) {\n adjustedValue = 'M' + adjustedValue;\n } else {\n adjustedValue = adjustedValue * DAYS_IN_MONTH * MILLISECONDS_IN_DAY;\n }\n }\n\n if (this.state.units === 'days') {\n adjustedValue = adjustedValue * MILLISECONDS_IN_DAY;\n }\n\n if (this.state.units === 'minutes') {\n adjustedValue = adjustedValue * MILLISECONDS_IN_MINUTE;\n }\n\n if (this.state.units === 'seconds') {\n adjustedValue = adjustedValue * MILLISECONDS_IN_SECOND;\n }\n\n this.props.updatePlot(adjustedValue);\n }\n }, {\n key: \"onUnitChange\",\n value: function onUnitChange(value) {\n var isFullValueMonthFormat = typeof this.props.fullValue === 'string' && this.props.fullValue[0] === 'M';\n var milliseconds = isFullValueMonthFormat ? parseInt(this.props.fullValue.substring(1), 10) * DAYS_IN_MONTH * MILLISECONDS_IN_DAY : this.props.fullValue;\n this.setState({\n units: value\n });\n\n if (['years', 'months'].includes(value)) {\n var nbMonths = milliseconds / MILLISECONDS_IN_DAY / DAYS_IN_MONTH;\n\n if (nbMonths % 1 === 0) {\n this.props.updatePlot('M' + nbMonths);\n } else {\n this.props.updatePlot(milliseconds);\n }\n } else {\n this.props.updatePlot(milliseconds);\n }\n }\n }, {\n key: \"getDisplayValue\",\n value: function getDisplayValue(value) {\n var numericValue = typeof value === 'string' && value[0] === 'M' ? parseInt(value.substring(1), 10) : value;\n\n if (this.state.units === 'years') {\n if (typeof value === 'string') {\n return twoDecimalsRound(numericValue / MONTHS_IN_YEAR);\n }\n\n return twoDecimalsRound(numericValue / MILLISECONDS_IN_DAY / DAYS_IN_MONTH / MONTHS_IN_YEAR);\n }\n\n if (this.state.units === 'months') {\n if (typeof value === 'string') {\n return twoDecimalsRound(numericValue);\n }\n\n return twoDecimalsRound(numericValue / MILLISECONDS_IN_DAY / DAYS_IN_MONTH);\n }\n\n if (this.state.units === 'days') {\n return twoDecimalsRound(numericValue / MILLISECONDS_IN_DAY);\n }\n\n if (this.state.units === 'minutes') {\n return twoDecimalsRound(numericValue / MILLISECONDS_IN_MINUTE);\n }\n\n if (this.state.units === 'seconds') {\n return twoDecimalsRound(numericValue / MILLISECONDS_IN_SECOND);\n }\n\n if (this.state.units === 'milliseconds') {\n return numericValue;\n }\n\n return null;\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _ = this.context.localize;\n var attrHead = this.props.attr.split('.')[0];\n var binStartValue = this.props.fullContainer[attrHead].start;\n var BinStartIsDate = typeof binStartValue === 'string' && ((0, _lib2.isDateTime)(binStartValue) || (0, _dates.isJSDate)(binStartValue));\n var tick0 = this.props.fullContainer.tick0 && (this.props.fullContainer.tick0 || this.props.fullContainer.colorbar.tick0);\n var tick0IsDate = tick0 && ((0, _lib2.isDateTime)(tick0) || (0, _dates.isJSDate)(tick0));\n return BinStartIsDate || tick0IsDate ? /*#__PURE__*/_react.default.createElement(_Field.default, this.props, /*#__PURE__*/_react.default.createElement(_Dropdown.default, {\n options: [{\n value: 'years',\n label: _('Years')\n }, {\n value: 'months',\n label: _('Months')\n }, {\n value: 'days',\n label: _('Days')\n }, {\n value: 'minutes',\n label: _('Minutes')\n }, {\n value: 'seconds',\n label: _('Seconds')\n }, {\n value: 'milliseconds',\n label: _('Milliseconds')\n }],\n clearable: false,\n onChange: function onChange(value) {\n return _this2.onUnitChange(value);\n },\n value: this.state.units\n }), /*#__PURE__*/_react.default.createElement(\"div\", {\n style: {\n width: '100%',\n display: 'block'\n }\n }, \" \"), /*#__PURE__*/_react.default.createElement(_NumericInput.default, {\n value: this.getDisplayValue(this.props.fullValue),\n onUpdate: function onUpdate(value) {\n return _this2.update(value);\n },\n editableClassName: \"AxisInterval-milliseconds\"\n })) : /*#__PURE__*/_react.default.createElement(_Field.default, this.props, /*#__PURE__*/_react.default.createElement(_NumericInput.default, {\n value: this.props.fullValue,\n onUpdate: function onUpdate(value) {\n return _this2.props.updatePlot(value);\n }\n }));\n }\n }]);\n\n return UnconnectedAxisInterval;\n}(_react.Component);\n\nexports.UnconnectedAxisInterval = UnconnectedAxisInterval;\nUnconnectedAxisInterval.contextTypes = {\n localize: _propTypes.default.func\n};\nUnconnectedAxisInterval.propTypes = _objectSpread({\n fullValue: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),\n updatePlot: _propTypes.default.func,\n attr: _propTypes.default.string,\n fullContainer: _propTypes.default.object\n}, _Field.default.propTypes);\n\nvar _default = (0, _lib.connectToContainer)(UnconnectedAxisInterval);\n\nexports.default = _default;\n//# sourceMappingURL=AxisInterval.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/AxisInterval.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/AxisRangeValue.js": /*!*********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/AxisRangeValue.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.UnconnectedAxisRangeValue = void 0;\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _Numeric = __webpack_require__(/*! ./Numeric */ \"./node_modules/react-chart-editor/lib/components/fields/Numeric.js\");\n\nvar _DateTimePicker = __webpack_require__(/*! ./DateTimePicker */ \"./node_modules/react-chart-editor/lib/components/fields/DateTimePicker.js\");\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _Info = _interopRequireDefault(__webpack_require__(/*! ./Info */ \"./node_modules/react-chart-editor/lib/components/fields/Info.js\"));\n\nvar _constants = __webpack_require__(/*! ../../lib/constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar UnconnectedAxisRangeValue = /*#__PURE__*/function (_Component) {\n _inherits(UnconnectedAxisRangeValue, _Component);\n\n var _super = _createSuper(UnconnectedAxisRangeValue);\n\n function UnconnectedAxisRangeValue() {\n _classCallCheck(this, UnconnectedAxisRangeValue);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(UnconnectedAxisRangeValue, [{\n key: \"render\",\n value: function render() {\n // only when all axes have the type date, can we output an UnconnectedDateTimePicker\n if (this.props.fullContainer && this.props.fullContainer.type === 'date') {\n return /*#__PURE__*/_react.default.createElement(_DateTimePicker.UnconnectedDateTimePicker, this.props);\n } // If its multivalued, it can be multivalued for different reasons:\n // - the range is different, but same type\n // - the type is different (i.e. date + number axes)\n // If we're in the case of a mixed axis type (i.e. date + number) case,\n // There's going to be a this.props.fullContainer.type, but it's going to be MULTIVALUED\n\n\n if (this.props.multiValued && this.props.fullContainer.type === _constants.MULTI_VALUED) {\n return /*#__PURE__*/_react.default.createElement(_Info.default, this.props);\n } // For cases that the range is numeric, but does not have the same number\n // Or numeric and has the same number\n\n\n return /*#__PURE__*/_react.default.createElement(_Numeric.UnconnectedNumeric, this.props);\n }\n }]);\n\n return UnconnectedAxisRangeValue;\n}(_react.Component);\n\nexports.UnconnectedAxisRangeValue = UnconnectedAxisRangeValue;\nUnconnectedAxisRangeValue.propTypes = _objectSpread({\n defaultValue: _propTypes.default.any,\n fullValue: _propTypes.default.any,\n min: _propTypes.default.number,\n max: _propTypes.default.number,\n multiValued: _propTypes.default.bool,\n hideArrows: _propTypes.default.bool,\n showSlider: _propTypes.default.bool,\n step: _propTypes.default.number,\n fullContainer: _propTypes.default.object,\n updatePlot: _propTypes.default.func\n}, _Field.default.propTypes);\n\nvar _default = (0, _lib.connectToContainer)(UnconnectedAxisRangeValue);\n\nexports.default = _default;\n//# sourceMappingURL=AxisRangeValue.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/AxisRangeValue.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/ColorArrayPicker.js": /*!***********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/ColorArrayPicker.js ***! \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _RadioBlocks = _interopRequireDefault(__webpack_require__(/*! ../widgets/RadioBlocks */ \"./node_modules/react-chart-editor/lib/components/widgets/RadioBlocks.js\"));\n\nvar _DataSelector = _interopRequireDefault(__webpack_require__(/*! ./DataSelector */ \"./node_modules/react-chart-editor/lib/components/fields/DataSelector.js\"));\n\nvar _MultiColorPicker = _interopRequireDefault(__webpack_require__(/*! ./MultiColorPicker */ \"./node_modules/react-chart-editor/lib/components/fields/MultiColorPicker.js\"));\n\nvar _constants = __webpack_require__(/*! ../../lib/constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar UnconnectedColorArrayPicker = /*#__PURE__*/function (_Component) {\n _inherits(UnconnectedColorArrayPicker, _Component);\n\n var _super = _createSuper(UnconnectedColorArrayPicker);\n\n function UnconnectedColorArrayPicker(props, context) {\n var _this;\n\n _classCallCheck(this, UnconnectedColorArrayPicker);\n\n _this = _super.call(this, props, context);\n var fullContainer = props.fullContainer;\n _this.rootAttr = props.attr.split('.')[0];\n var type = null;\n\n if (!fullContainer[_this.rootAttr] || fullContainer[_this.rootAttr] && !Array.isArray(fullContainer[_this.rootAttr].color)) {\n type = 'constant';\n } else if (fullContainer[_this.rootAttr] && Array.isArray(fullContainer[_this.rootAttr].color)) {\n type = 'variable';\n }\n\n _this.state = {\n type: type,\n value: {\n constant: type === 'constant' ? props.fullValue : _constants.COLORS.mutedBlue,\n variable: type === 'variable' ? props.fullValue : null\n },\n selectedConstantColorOption: type === 'constant' && props.multiValued ? 'multiple' : 'single'\n };\n _this.setType = _this.setType.bind(_assertThisInitialized(_this));\n _this.setValue = _this.setValue.bind(_assertThisInitialized(_this));\n _this.setColor = _this.setColor.bind(_assertThisInitialized(_this));\n _this.setColorScale = _this.setColorScale.bind(_assertThisInitialized(_this));\n _this.onConstantColorOptionChange = _this.onConstantColorOptionChange.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(UnconnectedColorArrayPicker, [{\n key: \"setType\",\n value: function setType(type) {\n var _ref, _ref2;\n\n this.setState({\n type: type\n });\n this.context.updateContainer(type === 'constant' ? (_ref = {}, _defineProperty(_ref, this.rootAttr + '.color', this.state.value[type]), _defineProperty(_ref, this.rootAttr + '.colorsrc', null), _ref) : (_ref2 = {}, _defineProperty(_ref2, this.rootAttr + '.color', this.state.value[type]), _defineProperty(_ref2, this.rootAttr + '.colorsrc', null), _ref2));\n }\n }, {\n key: \"setValue\",\n value: function setValue(inputValue) {\n var type = this.state.type;\n this.setState(type === 'constant' ? {\n value: {\n constant: inputValue,\n variable: this.state.value[type]\n }\n } : {\n value: {\n variable: inputValue,\n constant: this.state.value[type]\n }\n });\n this.props.updatePlot(inputValue);\n }\n }, {\n key: \"setColor\",\n value: function setColor(inputValue) {\n var type = this.state.type;\n this.setState(type === 'constant' ? {\n value: {\n constant: inputValue,\n variable: this.state.value.variable\n }\n } : {\n value: {\n variable: inputValue,\n constant: this.state.value.constant\n }\n });\n this.props.updatePlot(inputValue);\n }\n }, {\n key: \"setColorScale\",\n value: function setColorScale(inputValue) {\n this.setState({\n colorscale: inputValue\n });\n this.context.updateContainer(_defineProperty({}, this.rootAttr + '.colorscale', inputValue));\n }\n }, {\n key: \"onConstantColorOptionChange\",\n value: function onConstantColorOptionChange(value) {\n this.setState({\n selectedConstantColorOption: value\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n attr = _this$props.attr,\n fullValue = _this$props.fullValue;\n var _ = this.context.localize;\n var type = this.state.type;\n var options = [{\n label: _('Constant'),\n value: 'constant'\n }, {\n label: _('Variable'),\n value: 'variable'\n }];\n var multiValued = this.props.multiValued || Array.isArray(fullValue) && fullValue.includes(_constants.MULTI_VALUED);\n return /*#__PURE__*/_react.default.createElement(_Field.default, _extends({}, this.props, {\n multiValued: multiValued,\n attr: attr\n }), /*#__PURE__*/_react.default.createElement(_RadioBlocks.default, {\n options: options,\n activeOption: type,\n onOptionChange: this.setType\n }), type === 'constant' ? /*#__PURE__*/_react.default.createElement(_MultiColorPicker.default, {\n attr: this.rootAttr + '.color',\n multiColorMessage: _('Each trace will be colored according to the selected colorscale.'),\n singleColorMessage: _('All traces will be colored in the the same color.'),\n setColor: this.setColor,\n setColorScale: this.setColorScale,\n onConstantColorOptionChange: this.onConstantColorOptionChange,\n parentSelectedConstantColorOption: this.state.selectedConstantColorOption\n }) : multiValued ? null : /*#__PURE__*/_react.default.createElement(_DataSelector.default, {\n suppressMultiValuedMessage: true,\n attr: this.rootAttr + '.color',\n updatePlot: this.setValue\n }));\n }\n }]);\n\n return UnconnectedColorArrayPicker;\n}(_react.Component);\n\nUnconnectedColorArrayPicker.propTypes = _objectSpread({\n fullValue: _propTypes.default.any,\n updatePlot: _propTypes.default.func\n}, _Field.default.propTypes);\nUnconnectedColorArrayPicker.contextTypes = {\n localize: _propTypes.default.func,\n updateContainer: _propTypes.default.func\n};\nUnconnectedColorArrayPicker.displayName = 'UnconnectedColorArrayPicker';\n\nvar _default = (0, _lib.connectToContainer)(UnconnectedColorArrayPicker);\n\nexports.default = _default;\n//# sourceMappingURL=ColorArrayPicker.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/ColorArrayPicker.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/ColorPicker.js": /*!******************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/ColorPicker.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.UnconnectedColorPicker = void 0;\n\nvar _ColorPicker = _interopRequireDefault(__webpack_require__(/*! ../widgets/ColorPicker */ \"./node_modules/react-chart-editor/lib/components/widgets/ColorPicker.js\"));\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar UnconnectedColorPicker = /*#__PURE__*/function (_Component) {\n _inherits(UnconnectedColorPicker, _Component);\n\n var _super = _createSuper(UnconnectedColorPicker);\n\n function UnconnectedColorPicker(props, context) {\n var _this;\n\n _classCallCheck(this, UnconnectedColorPicker);\n\n _this = _super.call(this, props, context);\n _this.state = {\n empty: !_this.props.fullValue && _this.props.handleEmpty\n };\n return _this;\n }\n\n _createClass(UnconnectedColorPicker, [{\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n if (this.state.empty) {\n return /*#__PURE__*/_react.default.createElement(_Field.default, this.props, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"js-test-info\"\n }, \"This color is computed from other parts of the figure but you can\", ' ', /*#__PURE__*/_react.default.createElement(\"a\", {\n onClick: function onClick() {\n _this2.setState({\n empty: false\n });\n\n _this2.props.updatePlot(_this2.props.defaultColor);\n }\n }, \"override it\"), \".\"));\n }\n\n return /*#__PURE__*/_react.default.createElement(_Field.default, this.props, /*#__PURE__*/_react.default.createElement(_ColorPicker.default, {\n selectedColor: this.props.fullValue,\n onColorChange: this.props.updatePlot\n }));\n }\n }]);\n\n return UnconnectedColorPicker;\n}(_react.Component);\n\nexports.UnconnectedColorPicker = UnconnectedColorPicker;\nUnconnectedColorPicker.propTypes = _objectSpread({\n fullValue: _propTypes.default.any,\n updatePlot: _propTypes.default.func,\n handleEmpty: _propTypes.default.bool,\n defaultColor: _propTypes.default.string\n}, _Field.default.propTypes);\nUnconnectedColorPicker.displayName = 'UnconnectedColorPicker';\n\nvar _default = (0, _lib.connectToContainer)(UnconnectedColorPicker);\n\nexports.default = _default;\n//# sourceMappingURL=ColorPicker.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/ColorPicker.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/ColorscalePicker.js": /*!***********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/ColorscalePicker.js ***! \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.UnconnectedColorscalePicker = void 0;\n\nvar _ColorscalePicker = _interopRequireDefault(__webpack_require__(/*! ../widgets/ColorscalePicker */ \"./node_modules/react-chart-editor/lib/components/widgets/ColorscalePicker.js\"));\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _constants = __webpack_require__(/*! ../../lib/constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar UnconnectedColorscalePicker = /*#__PURE__*/function (_Component) {\n _inherits(UnconnectedColorscalePicker, _Component);\n\n var _super = _createSuper(UnconnectedColorscalePicker);\n\n function UnconnectedColorscalePicker() {\n var _this;\n\n _classCallCheck(this, UnconnectedColorscalePicker);\n\n _this = _super.call(this);\n _this.onUpdate = _this.onUpdate.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(UnconnectedColorscalePicker, [{\n key: \"onUpdate\",\n value: function onUpdate(colorscale, colorscaleType) {\n if (Array.isArray(colorscale)) {\n this.props.updatePlot(colorscale.map(function (c, i) {\n var step = i / (colorscale.length - 1);\n\n if (i === 0) {\n step = 0;\n }\n\n return [step, c];\n }), colorscaleType);\n this.context.onUpdate({\n type: _constants.EDITOR_ACTIONS.UPDATE_TRACES,\n payload: {\n update: {\n autocolorscale: false\n },\n traceIndexes: [this.props.fullContainer.index]\n }\n });\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var fullValue = this.props.fullValue;\n var colorscale = Array.isArray(fullValue) ? fullValue.map(function (v) {\n return v[1];\n }) : null;\n return /*#__PURE__*/_react.default.createElement(_Field.default, _extends({}, this.props, {\n fieldContainerClassName: \"field__colorscale\"\n }), /*#__PURE__*/_react.default.createElement(_ColorscalePicker.default, {\n selected: colorscale,\n onColorscaleChange: this.onUpdate,\n initialCategory: this.props.initialCategory,\n disableCategorySwitch: this.props.disableCategorySwitch\n }));\n }\n }]);\n\n return UnconnectedColorscalePicker;\n}(_react.Component);\n\nexports.UnconnectedColorscalePicker = UnconnectedColorscalePicker;\nUnconnectedColorscalePicker.propTypes = _objectSpread({\n labelWidth: _propTypes.default.number,\n fullValue: _propTypes.default.any,\n fullContainer: _propTypes.default.object,\n updatePlot: _propTypes.default.func,\n initialCategory: _propTypes.default.string\n}, _Field.default.propTypes);\nUnconnectedColorscalePicker.contextTypes = {\n container: _propTypes.default.object,\n graphDiv: _propTypes.default.object,\n onUpdate: _propTypes.default.func\n};\nUnconnectedColorscalePicker.displayName = 'UnconnectedColorscalePicker';\n\nvar _default = (0, _lib.connectToContainer)(UnconnectedColorscalePicker);\n\nexports.default = _default;\n//# sourceMappingURL=ColorscalePicker.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/ColorscalePicker.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/ColorwayPicker.js": /*!*********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/ColorwayPicker.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _ColorscalePicker = _interopRequireDefault(__webpack_require__(/*! ../widgets/ColorscalePicker */ \"./node_modules/react-chart-editor/lib/components/widgets/ColorscalePicker.js\"));\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar UnconnectedColorwayPicker = /*#__PURE__*/function (_Component) {\n _inherits(UnconnectedColorwayPicker, _Component);\n\n var _super = _createSuper(UnconnectedColorwayPicker);\n\n function UnconnectedColorwayPicker() {\n _classCallCheck(this, UnconnectedColorwayPicker);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(UnconnectedColorwayPicker, [{\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react.default.createElement(_Field.default, this.props, /*#__PURE__*/_react.default.createElement(_ColorscalePicker.default, {\n selected: this.props.fullValue,\n onColorscaleChange: this.props.updatePlot,\n initialCategory: \"categorical\",\n disableCategorySwitch: this.props.disableCategorySwitch\n }));\n }\n }]);\n\n return UnconnectedColorwayPicker;\n}(_react.Component);\n\nUnconnectedColorwayPicker.propTypes = _objectSpread({\n fullValue: _propTypes.default.any,\n updatePlot: _propTypes.default.func\n}, _Field.default.propTypes);\nUnconnectedColorwayPicker.displayName = 'UnconnectedColorwayPicker';\n\nvar _default = (0, _lib.connectToContainer)(UnconnectedColorwayPicker);\n\nexports.default = _default;\n//# sourceMappingURL=ColorwayPicker.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/ColorwayPicker.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/DataSelector.js": /*!*******************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/DataSelector.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.attributeIsData = attributeIsData;\nexports.default = exports.UnconnectedDataSelector = void 0;\n\nvar _Dropdown = _interopRequireDefault(__webpack_require__(/*! ../widgets/Dropdown */ \"./node_modules/react-chart-editor/lib/components/widgets/Dropdown.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _nested_property = _interopRequireDefault(__webpack_require__(/*! plotly.js/src/lib/nested_property */ \"./node_modules/plotly.js/src/lib/nested_property.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _constants = __webpack_require__(/*! ../../lib/constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nvar _dereference = __webpack_require__(/*! ../../lib/dereference */ \"./node_modules/react-chart-editor/lib/lib/dereference.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction attributeIsData() {\n var meta = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return meta.valType === 'data_array' || meta.arrayOk;\n}\n\nvar UnconnectedDataSelector = /*#__PURE__*/function (_Component) {\n _inherits(UnconnectedDataSelector, _Component);\n\n var _super = _createSuper(UnconnectedDataSelector);\n\n function UnconnectedDataSelector(props, context) {\n var _this;\n\n _classCallCheck(this, UnconnectedDataSelector);\n\n _this = _super.call(this, props, context);\n _this.updatePlot = _this.updatePlot.bind(_assertThisInitialized(_this));\n\n _this.setLocals(props, context);\n\n return _this;\n }\n\n _createClass(UnconnectedDataSelector, [{\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n }, {\n key: \"setLocals\",\n value: function setLocals(props, context) {\n this.dataSources = context.dataSources || {};\n this.dataSourceOptions = context.dataSourceOptions || [];\n this.srcAttr = props.attr + 'src';\n this.srcProperty = (0, _nested_property.default)(props.container, this.srcAttr).get();\n this.fullValue = this.context.srcConverters ? this.context.srcConverters.toSrc(this.srcProperty, props.container.type) : this.srcProperty;\n this.is2D = false;\n\n if (props.container) {\n this.is2D = (props.attr === 'x' || props.attr === 'y') && ['scatter', 'scattergl', 'bar', 'funnel', 'heatmap', 'heatmapgl', 'violin', 'waterfall', 'box', 'contour', 'contourgl'].includes(props.container.type) || props.attr === 'z' && ['contour', 'contourgl', 'heatmap', 'heatmapgl', 'surface', 'carpet', 'contourcarpet'].includes(props.container.type) || props.container.type === 'table' && props.attr !== 'columnorder' || Array.isArray(this.fullValue);\n }\n\n this.hasData = props.container ? props.attr in props.container : false;\n }\n }, {\n key: \"updatePlot\",\n value: function updatePlot(value) {\n var _this2 = this;\n\n if (!this.props.updateContainer) {\n return;\n }\n\n var update = {};\n var data;\n var adjustedValue = Array.isArray(value) && value.length === 1 && (this.props.attr === 'x' || this.props.attr === 'y') ? value[0] : value;\n\n if (Array.isArray(adjustedValue)) {\n data = adjustedValue.filter(function (v) {\n return Array.isArray(_this2.dataSources[v]);\n }).map(function (v) {\n return _this2.dataSources[v];\n });\n } else {\n data = this.dataSources[adjustedValue] || null;\n }\n\n update[this.props.attr] = (0, _lib.maybeTransposeData)(data, this.srcAttr, this.props.container.type);\n update[this.srcAttr] = (0, _lib.maybeAdjustSrc)(adjustedValue, this.srcAttr, this.props.container.type, {\n fromSrc: this.context.srcConverters ? this.context.srcConverters.fromSrc : null\n });\n\n if (this.props.container.type) {\n // this means we're at the top level of the trace\n update['meta.columnNames.' + this.props.attr] = (0, _dereference.getColumnNames)(Array.isArray(adjustedValue) ? adjustedValue : [adjustedValue], this.dataSourceOptions);\n }\n\n this.props.updateContainer(update);\n }\n }, {\n key: \"render\",\n value: function render() {\n var label = this.props.label;\n var newLabel;\n\n if (_typeof(label) === 'object') {\n var traceType = this.props.container.type;\n\n if (label[traceType]) {\n newLabel = label[traceType];\n } else {\n newLabel = label['*'];\n }\n } else {\n newLabel = label;\n }\n\n return /*#__PURE__*/_react.default.createElement(_Field.default, _objectSpread(_objectSpread({}, this.props), {}, {\n label: newLabel\n }), /*#__PURE__*/_react.default.createElement(_Dropdown.default, {\n options: this.dataSourceOptions,\n value: this.fullValue,\n onChange: this.updatePlot,\n multi: this.is2D,\n searchable: true,\n clearable: true,\n placeholder: this.hasData ? 'Data inlined in figure' : 'Choose data...',\n disabled: this.dataSourceOptions.length === 0,\n components: this.props.dataSourceComponents\n }));\n }\n }]);\n\n return UnconnectedDataSelector;\n}(_react.Component);\n\nexports.UnconnectedDataSelector = UnconnectedDataSelector;\nUnconnectedDataSelector.propTypes = _objectSpread({\n fullValue: _propTypes.default.any,\n updatePlot: _propTypes.default.func,\n container: _propTypes.default.object\n}, _Field.default.propTypes);\nUnconnectedDataSelector.contextTypes = {\n dataSources: _propTypes.default.object,\n dataSourceComponents: _propTypes.default.object,\n dataSourceOptions: _propTypes.default.array,\n srcConverters: _propTypes.default.shape({\n toSrc: _propTypes.default.func.isRequired,\n fromSrc: _propTypes.default.func.isRequired\n }),\n container: _propTypes.default.object\n};\nUnconnectedDataSelector.displayName = 'UnconnectedDataSelector';\n\nfunction modifyPlotProps(props, context, plotProps) {\n if (attributeIsData(plotProps.attrMeta) && context.container && _constants.TRANSFORMS_LIST.indexOf(context.container.type) === -1) {\n plotProps.isVisible = true;\n }\n}\n\nvar _default = (0, _lib.connectToContainer)(UnconnectedDataSelector, {\n modifyPlotProps: modifyPlotProps\n});\n\nexports.default = _default;\n//# sourceMappingURL=DataSelector.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/DataSelector.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/DateTimePicker.js": /*!*********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/DateTimePicker.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.UnconnectedDateTimePicker = void 0;\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _DateTimePicker = _interopRequireDefault(__webpack_require__(/*! ../widgets/DateTimePicker */ \"./node_modules/react-chart-editor/lib/components/widgets/DateTimePicker.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar UnconnectedDateTimePicker = /*#__PURE__*/function (_Component) {\n _inherits(UnconnectedDateTimePicker, _Component);\n\n var _super = _createSuper(UnconnectedDateTimePicker);\n\n function UnconnectedDateTimePicker() {\n _classCallCheck(this, UnconnectedDateTimePicker);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(UnconnectedDateTimePicker, [{\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react.default.createElement(_Field.default, this.props, /*#__PURE__*/_react.default.createElement(_DateTimePicker.default, {\n value: this.props.fullValue,\n placeholder: this.props.placeholder,\n onChange: this.props.updatePlot\n }));\n }\n }]);\n\n return UnconnectedDateTimePicker;\n}(_react.Component);\n\nexports.UnconnectedDateTimePicker = UnconnectedDateTimePicker;\nUnconnectedDateTimePicker.propTypes = _objectSpread({\n fullValue: _propTypes.default.string,\n updatePlot: _propTypes.default.func,\n placeholder: _propTypes.default.string\n}, _Field.default.propTypes);\nUnconnectedDateTimePicker.displayName = 'UnconnectedDateTimePicker';\n\nvar _default = (0, _lib.connectToContainer)(UnconnectedDateTimePicker);\n\nexports.default = _default;\n//# sourceMappingURL=DateTimePicker.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/DateTimePicker.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/Dropdown.js": /*!***************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/Dropdown.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.UnconnectedDropdown = void 0;\n\nvar _Dropdown = _interopRequireDefault(__webpack_require__(/*! ../widgets/Dropdown */ \"./node_modules/react-chart-editor/lib/components/widgets/Dropdown.js\"));\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar UnconnectedDropdown = /*#__PURE__*/function (_Component) {\n _inherits(UnconnectedDropdown, _Component);\n\n var _super = _createSuper(UnconnectedDropdown);\n\n function UnconnectedDropdown() {\n _classCallCheck(this, UnconnectedDropdown);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(UnconnectedDropdown, [{\n key: \"render\",\n value: function render() {\n var placeholder;\n\n if (this.props.multiValued) {\n placeholder = this.props.fullValue;\n }\n\n return /*#__PURE__*/_react.default.createElement(_Field.default, this.props, /*#__PURE__*/_react.default.createElement(_Dropdown.default, {\n backgroundDark: this.props.backgroundDark,\n options: this.props.options,\n value: this.props.fullValue,\n onChange: this.props.updatePlot,\n clearable: this.props.clearable,\n placeholder: placeholder,\n disabled: this.props.disabled,\n components: this.props.components\n }));\n }\n }]);\n\n return UnconnectedDropdown;\n}(_react.Component);\n\nexports.UnconnectedDropdown = UnconnectedDropdown;\nUnconnectedDropdown.propTypes = _objectSpread({\n backgroundDark: _propTypes.default.bool,\n components: _propTypes.default.object,\n clearable: _propTypes.default.bool,\n fullValue: _propTypes.default.any,\n options: _propTypes.default.array.isRequired,\n updatePlot: _propTypes.default.func,\n disabled: _propTypes.default.bool\n}, _Field.default.propTypes);\nUnconnectedDropdown.displayName = 'UnconnectedDropdown';\n\nvar _default = (0, _lib.connectToContainer)(UnconnectedDropdown);\n\nexports.default = _default;\n//# sourceMappingURL=Dropdown.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/Dropdown.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/DropdownCustom.js": /*!*********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/DropdownCustom.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.UnconnectedDropdownCustom = void 0;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _constants = __webpack_require__(/*! ../../lib/constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _Dropdown = _interopRequireDefault(__webpack_require__(/*! ../widgets/Dropdown */ \"./node_modules/react-chart-editor/lib/components/widgets/Dropdown.js\"));\n\nvar _Text = _interopRequireDefault(__webpack_require__(/*! ./Text */ \"./node_modules/react-chart-editor/lib/components/fields/Text.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar UnconnectedDropdownCustom = /*#__PURE__*/function (_Component) {\n _inherits(UnconnectedDropdownCustom, _Component);\n\n var _super = _createSuper(UnconnectedDropdownCustom);\n\n function UnconnectedDropdownCustom(props, context) {\n var _this;\n\n _classCallCheck(this, UnconnectedDropdownCustom);\n\n _this = _super.call(this, props, context);\n _this.setValue = _this.setValue.bind(_assertThisInitialized(_this));\n _this.setLocals = _this.setLocals.bind(_assertThisInitialized(_this));\n\n _this.setLocals(props);\n\n _this.state = {\n custom: _this.value === props.customOpt || !_this.props.options.map(function (o) {\n return o.value;\n }).includes(_this.value)\n };\n return _this;\n }\n\n _createClass(UnconnectedDropdownCustom, [{\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(props) {\n this.setLocals(props);\n }\n }, {\n key: \"setLocals\",\n value: function setLocals(props) {\n this.value = props.fullValue === undefined || props.fullValue === _constants.MULTI_VALUED_PLACEHOLDER // eslint-disable-line no-undefined\n ? this.props.defaultOpt : props.fullValue;\n }\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var custom = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.value = value;\n var customOpt = this.props.customOpt;\n this.setState({\n custom: (custom || value === customOpt) && value !== ''\n });\n this.props.updateContainer(_defineProperty({}, this.props.attr, value === customOpt && !custom ? customOpt : value));\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _this$props = this.props,\n options = _this$props.options,\n attr = _this$props.attr,\n customOpt = _this$props.customOpt;\n var value = (this.value === '' || !options.map(function (o) {\n return o.value;\n }).includes(this.value)) && this.state.custom ? customOpt : this.value;\n return /*#__PURE__*/_react.default.createElement(_Field.default, this.props, /*#__PURE__*/_react.default.createElement(_Dropdown.default, {\n backgroundDark: this.props.backgroundDark,\n options: options,\n value: value,\n onChange: this.setValue,\n clearable: this.props.clearable,\n components: this.props.components,\n placeholder: this.props.placeholder\n }), this.state.custom && /*#__PURE__*/_react.default.createElement(_Text.default, {\n attr: attr,\n updatePlot: function updatePlot(value) {\n return _this2.setValue(value, true);\n },\n onChange: function onChange(value) {\n if (value) {\n _this2.setValue(value, true);\n }\n }\n }));\n }\n }]);\n\n return UnconnectedDropdownCustom;\n}(_react.Component);\n\nexports.UnconnectedDropdownCustom = UnconnectedDropdownCustom;\nUnconnectedDropdownCustom.propTypes = _objectSpread({\n backgroundDark: _propTypes.default.bool,\n fullValue: _propTypes.default.any,\n updatePlot: _propTypes.default.func,\n clearable: _propTypes.default.bool,\n components: _propTypes.default.object,\n placeholder: _propTypes.default.any,\n defaultOpt: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.bool, _propTypes.default.string]),\n customOpt: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.bool, _propTypes.default.string]),\n label: _propTypes.default.string,\n attr: _propTypes.default.string\n}, _Field.default.propTypes);\nUnconnectedDropdownCustom.contextTypes = {\n updateContainer: _propTypes.default.func\n};\nUnconnectedDropdownCustom.displayName = 'UnconnectedDropdownCustom';\n\nvar _default = (0, _lib.connectToContainer)(UnconnectedDropdownCustom);\n\nexports.default = _default;\n//# sourceMappingURL=DropdownCustom.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/DropdownCustom.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/Dropzone.js": /*!***************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/Dropzone.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.UnconnectedDropzone = void 0;\n\nvar _Dropzone = _interopRequireDefault(__webpack_require__(/*! ../widgets/Dropzone */ \"./node_modules/react-chart-editor/lib/components/widgets/Dropzone.js\"));\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar UnconnectedDropzone = /*#__PURE__*/function (_Component) {\n _inherits(UnconnectedDropzone, _Component);\n\n var _super = _createSuper(UnconnectedDropzone);\n\n function UnconnectedDropzone() {\n _classCallCheck(this, UnconnectedDropzone);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(UnconnectedDropzone, [{\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react.default.createElement(_Field.default, this.props, /*#__PURE__*/_react.default.createElement(_Dropzone.default, {\n value: this.props.fullValue,\n onUpdate: this.props.updatePlot,\n fileType: this.props.fileType\n }));\n }\n }]);\n\n return UnconnectedDropzone;\n}(_react.Component);\n\nexports.UnconnectedDropzone = UnconnectedDropzone;\nUnconnectedDropzone.propTypes = _objectSpread({\n value: _propTypes.default.any,\n onUpdate: _propTypes.default.func\n}, _Field.default.propTypes);\nUnconnectedDropzone.displayName = 'UnconnectedDropzone';\n\nfunction modifyPlotProps(props, context, plotProps) {\n if (context.container.type === 'choroplethmapbox' || context.container.type === 'choropleth') {\n plotProps.isVisible = true;\n }\n}\n\nvar _default = (0, _lib.connectToContainer)(UnconnectedDropzone, {\n modifyPlotProps: modifyPlotProps\n});\n\nexports.default = _default;\n//# sourceMappingURL=Dropzone.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/Dropzone.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/DualNumeric.js": /*!******************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/DualNumeric.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.UnconnectedDualNumericFraction = void 0;\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _NumericInput = _interopRequireDefault(__webpack_require__(/*! ../widgets/NumericInput */ \"./node_modules/react-chart-editor/lib/components/widgets/NumericInput.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _nested_property = _interopRequireDefault(__webpack_require__(/*! plotly.js/src/lib/nested_property */ \"./node_modules/plotly.js/src/lib/nested_property.js\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar UnconnectedDualNumericFraction = /*#__PURE__*/function (_Component) {\n _inherits(UnconnectedDualNumericFraction, _Component);\n\n var _super = _createSuper(UnconnectedDualNumericFraction);\n\n function UnconnectedDualNumericFraction(props, context) {\n var _this;\n\n _classCallCheck(this, UnconnectedDualNumericFraction);\n\n _this = _super.call(this, props, context);\n _this.updatePlot = _this.updatePlot.bind(_assertThisInitialized(_this));\n _this.updatePlot2 = _this.updatePlot2.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(UnconnectedDualNumericFraction, [{\n key: \"updatePlot\",\n value: function updatePlot(value) {\n this.props.updatePlot(this.props.percentage ? value / 100 : value);\n }\n }, {\n key: \"updatePlot2\",\n value: function updatePlot2(value) {\n this.props.updateContainer(_defineProperty({}, this.props.attr2, this.props.percentage ? value / 100 : value));\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n percentage = _this$props.percentage,\n multiValued = _this$props.multiValued,\n attr2 = _this$props.attr2,\n step = _this$props.step,\n min = _this$props.min,\n max = _this$props.max;\n var fullValue = percentage ? Math.round(100 * this.props.fullValue) : this.props.fullValue;\n var fullValue2 = (0, _nested_property.default)(this.context.fullContainer, attr2).get();\n\n if (percentage) {\n fullValue2 = Math.round(100 * fullValue2);\n }\n\n var placeholder;\n var placeholder2;\n\n if (multiValued) {\n placeholder = fullValue;\n placeholder2 = fullValue2;\n fullValue = '';\n fullValue2 = '';\n }\n\n return /*#__PURE__*/_react.default.createElement(_Field.default, this.props, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"numeric-input__wrapper\"\n }, /*#__PURE__*/_react.default.createElement(_NumericInput.default, {\n value: fullValue,\n defaultValue: this.props.defaultValue,\n placeholder: placeholder,\n step: step,\n min: min,\n max: max,\n onChange: this.updatePlot,\n onUpdate: this.updatePlot,\n showArrows: !this.props.hideArrows,\n showSlider: false\n }), /*#__PURE__*/_react.default.createElement(_NumericInput.default, {\n value: fullValue2,\n defaultValue: this.props.defaultValue,\n placeholder: placeholder2,\n step: step,\n min: min,\n max: max,\n onChange: this.updatePlot2,\n onUpdate: this.updatePlot2,\n showArrows: !this.props.hideArrows,\n showSlider: false\n })));\n }\n }]);\n\n return UnconnectedDualNumericFraction;\n}(_react.Component);\n\nexports.UnconnectedDualNumericFraction = UnconnectedDualNumericFraction;\nUnconnectedDualNumericFraction.propTypes = _objectSpread({\n defaultValue: _propTypes.default.any,\n fullValue: _propTypes.default.any,\n min: _propTypes.default.number,\n max: _propTypes.default.number,\n multiValued: _propTypes.default.bool,\n hideArrows: _propTypes.default.bool,\n showSlider: _propTypes.default.bool,\n step: _propTypes.default.number,\n updatePlot: _propTypes.default.func,\n attr2: _propTypes.default.any,\n percentage: _propTypes.default.bool\n}, _Field.default.propTypes);\nUnconnectedDualNumericFraction.contextTypes = {\n fullContainer: _propTypes.default.object\n};\nUnconnectedDualNumericFraction.displayName = 'UnconnectedDualNumericFraction';\n\nvar _default = (0, _lib.connectToContainer)(UnconnectedDualNumericFraction);\n\nexports.default = _default;\n//# sourceMappingURL=DualNumeric.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/DualNumeric.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/ErrorBars.js": /*!****************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/ErrorBars.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _index = __webpack_require__(/*! ../index */ \"./node_modules/react-chart-editor/lib/components/index.js\");\n\nvar _RadioBlocks = _interopRequireDefault(__webpack_require__(/*! ../widgets/RadioBlocks */ \"./node_modules/react-chart-editor/lib/components/widgets/RadioBlocks.js\"));\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar ErrorBars = /*#__PURE__*/function (_Component) {\n _inherits(ErrorBars, _Component);\n\n var _super = _createSuper(ErrorBars);\n\n function ErrorBars(props, context) {\n var _this;\n\n _classCallCheck(this, ErrorBars);\n\n _this = _super.call(this, props, context);\n _this.updatePlot = _this.updatePlot.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(ErrorBars, [{\n key: \"updatePlot\",\n value: function updatePlot(value) {\n if (value === 'symmetric') {\n this.props.updatePlot(_objectSpread(_objectSpread({}, this.props.fullValue), {}, {\n visible: true,\n symmetric: true\n }));\n }\n\n if (value === 'asymmetric') {\n this.props.updatePlot(_objectSpread(_objectSpread({}, this.props.fullValue), {}, {\n visible: true,\n symmetric: false\n }));\n }\n\n if (value === 'hidden') {\n this.props.updatePlot(_objectSpread(_objectSpread({}, this.props.fullValue), {}, {\n visible: false\n }));\n }\n }\n }, {\n key: \"getMode\",\n value: function getMode() {\n var mode;\n\n if (!this.props.fullValue.visible) {\n mode = 'hidden';\n }\n\n if (this.props.fullValue.visible && (this.props.fullValue.symmetric || typeof this.props.fullValue.symmetric === 'undefined')) {\n // when this.props.fullValue.type === 'sqrt',\n // then this.props.fullValue.symmetric is undefined, but 'sqrt' is only\n // applicable when we want symmetric error bars\n // https://github.com/plotly/plotly.js/issues/2359\n mode = 'symmetric';\n }\n\n if (this.props.fullValue.visible && this.props.fullValue.symmetric === false) {\n // it has to be explicitly set to false, because we don't want it to catch\n // cases when it's undefined\n mode = 'asymmetric';\n }\n\n return mode;\n }\n }, {\n key: \"renderModeSelector\",\n value: function renderModeSelector() {\n var _ = this.context.localize;\n return /*#__PURE__*/_react.default.createElement(_Field.default, null, /*#__PURE__*/_react.default.createElement(_RadioBlocks.default, {\n alignment: \"center\",\n onOptionChange: this.updatePlot,\n activeOption: this.getMode(),\n options: [{\n label: _('None'),\n value: 'hidden'\n }, {\n label: _('Symmetric'),\n value: 'symmetric'\n }, {\n label: _('Asymmetric'),\n value: 'asymmetric'\n }]\n }));\n }\n }, {\n key: \"renderErrorBarControls\",\n value: function renderErrorBarControls() {\n var _ = this.context.localize;\n var mode = this.getMode();\n var showCustomDataControl = this.props.fullValue.type === 'data';\n\n var styleAttrs = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_index.Radio, {\n label: _('Copy Y Style'),\n attr: \"\".concat(this.props.attr, \".copy_ystyle\"),\n options: [{\n label: _('Yes'),\n value: true\n }, {\n label: _('No'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_index.Radio, {\n label: _('Copy Z Style'),\n attr: \"\".concat(this.props.attr, \".copy_zstyle\"),\n options: [{\n label: _('Yes'),\n value: true\n }, {\n label: _('No'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_index.MultiColorPicker, {\n label: _('Color'),\n attr: \"\".concat(this.props.attr, \".color\")\n }), /*#__PURE__*/_react.default.createElement(_index.Numeric, {\n label: _('Thickness'),\n attr: \"\".concat(this.props.attr, \".thickness\")\n }), /*#__PURE__*/_react.default.createElement(_index.Numeric, {\n label: _('Crossbar Width'),\n attr: \"\".concat(this.props.attr, \".width\")\n }));\n\n if (mode === 'symmetric') {\n return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_index.Radio, {\n label: _('Error Type'),\n attr: \"\".concat(this.props.attr, \".type\"),\n options: [{\n label: _('%'),\n value: 'percent'\n }, {\n label: _('Constant'),\n value: 'constant'\n }, {\n label: _('√'),\n value: 'sqrt'\n }, {\n label: _('Data'),\n value: 'data'\n }]\n }), /*#__PURE__*/_react.default.createElement(_index.Numeric, {\n label: _('Value'),\n attr: \"\".concat(this.props.attr, \".value\")\n }), showCustomDataControl ? /*#__PURE__*/_react.default.createElement(_index.DataSelector, {\n label: _('Custom Data'),\n attr: \"\".concat(this.props.attr, \".array\")\n }) : null, styleAttrs);\n }\n\n if (mode === 'asymmetric') {\n return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_index.Radio, {\n label: _('Error Type'),\n attr: \"\".concat(this.props.attr, \".type\"),\n options: [{\n label: _('%'),\n value: 'percent'\n }, {\n label: _('Constant'),\n value: 'constant'\n }, {\n label: _('Data'),\n value: 'data'\n }]\n }), /*#__PURE__*/_react.default.createElement(_index.Numeric, {\n label: _('Value'),\n attr: \"\".concat(this.props.attr, \".value\")\n }), /*#__PURE__*/_react.default.createElement(_index.Numeric, {\n label: _('Value (-)'),\n attr: \"\".concat(this.props.attr, \".valueminus\")\n }), showCustomDataControl ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_index.DataSelector, {\n label: _('Error (+)'),\n attr: \"\".concat(this.props.attr, \".array\")\n }), /*#__PURE__*/_react.default.createElement(_index.DataSelector, {\n label: _('Error (-)'),\n attr: \"\".concat(this.props.attr, \".arrayminus\")\n })) : null, styleAttrs);\n }\n\n return null;\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, this.renderModeSelector(), this.renderErrorBarControls());\n }\n }]);\n\n return ErrorBars;\n}(_react.Component);\n\nErrorBars.propTypes = {\n attr: _propTypes.default.string,\n fullValue: _propTypes.default.object,\n updatePlot: _propTypes.default.func\n};\nErrorBars.contextTypes = {\n localize: _propTypes.default.func\n};\n\nvar _default = (0, _lib.connectToContainer)(ErrorBars);\n\nexports.default = _default;\n//# sourceMappingURL=ErrorBars.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/ErrorBars.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/Field.js": /*!************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/Field.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.FieldDelete = void 0;\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _MenuPanel = _interopRequireDefault(__webpack_require__(/*! ../containers/MenuPanel */ \"./node_modules/react-chart-editor/lib/components/containers/MenuPanel.js\"));\n\nvar _classnames2 = _interopRequireDefault(__webpack_require__(/*! classnames */ \"./node_modules/classnames/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _constants = __webpack_require__(/*! ../../lib/constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nvar _plotlyIcons = __webpack_require__(/*! plotly-icons */ \"./node_modules/plotly-icons/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar FieldDelete = /*#__PURE__*/function (_Component) {\n _inherits(FieldDelete, _Component);\n\n var _super = _createSuper(FieldDelete);\n\n function FieldDelete() {\n _classCallCheck(this, FieldDelete);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(FieldDelete, [{\n key: \"render\",\n value: function render() {\n var onClick = this.props.onClick;\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"field__delete\",\n onClick: onClick\n }, /*#__PURE__*/_react.default.createElement(_plotlyIcons.CloseIcon, null));\n }\n }]);\n\n return FieldDelete;\n}(_react.Component);\n\nexports.FieldDelete = FieldDelete;\n\nvar Field = /*#__PURE__*/function (_Component2) {\n _inherits(Field, _Component2);\n\n var _super2 = _createSuper(Field);\n\n function Field() {\n _classCallCheck(this, Field);\n\n return _super2.apply(this, arguments);\n }\n\n _createClass(Field, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n center = _this$props.center,\n children = _this$props.children,\n label = _this$props.label,\n multiValued = _this$props.multiValued,\n suppressMultiValuedMessage = _this$props.suppressMultiValuedMessage,\n units = _this$props.units,\n extraComponent = _this$props.extraComponent,\n fieldContainerClassName = _this$props.fieldContainerClassName,\n labelWidth = _this$props.labelWidth;\n var _ = this.context.localize;\n var fieldClass;\n\n if (!label) {\n fieldClass = (0, _classnames2.default)('field__no-title', {\n 'field__no-title--center': center\n });\n } else {\n fieldClass = (0, _classnames2.default)('field__widget', {\n 'field__widget--units': Boolean(units)\n });\n }\n\n var tooltip = this.context.attr;\n\n if (this.context.description) {\n tooltip += ' – ' + this.context.description.replace(/`/g, '\"').replace(/\\*/g, '\"');\n }\n\n var containerClassName = (0, _classnames2.default)((0, _lib.bem)('field'), _defineProperty({}, fieldContainerClassName, Boolean(fieldContainerClassName)));\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: containerClassName\n }, label ? /*#__PURE__*/_react.default.createElement(\"div\", {\n className: (0, _lib.bem)('field', 'title'),\n style: labelWidth ? {\n minWidth: labelWidth + 'px'\n } : {}\n }, this.context.showFieldTooltips ? /*#__PURE__*/_react.default.createElement(\"div\", {\n className: (0, _lib.bem)('field', 'title-text'),\n \"aria-label\": tooltip,\n \"data-microtip-position\": \"bottom-right\",\n \"data-microtip-size\": \"large\",\n role: \"tooltip\"\n }, label) : /*#__PURE__*/_react.default.createElement(\"div\", {\n className: (0, _lib.bem)('field', 'title-text')\n }, label)) : null, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: fieldClass\n }, children, extraComponent ? extraComponent : null, multiValued && !suppressMultiValuedMessage ? /*#__PURE__*/_react.default.createElement(_MenuPanel.default, {\n label: (0, _constants.getMultiValueText)('title', _),\n ownline: true,\n question: true\n }, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"info__title\"\n }, (0, _constants.getMultiValueText)('title', _)), /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"info__text\"\n }, (0, _constants.getMultiValueText)('text', _)), /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"info__sub-text\"\n }, (0, _constants.getMultiValueText)('subText', _))) : null), units ? /*#__PURE__*/_react.default.createElement(\"div\", {\n className: (0, _lib.bem)('field', 'units')\n }, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: (0, _lib.bem)('field', 'units-text')\n }, units)) : null);\n }\n }]);\n\n return Field;\n}(_react.Component);\n\nField.propTypes = {\n labelWidth: _propTypes.default.number,\n center: _propTypes.default.bool,\n label: _propTypes.default.any,\n units: _propTypes.default.string,\n multiValued: _propTypes.default.bool,\n suppressMultiValuedMessage: _propTypes.default.bool,\n children: _propTypes.default.node,\n extraComponent: _propTypes.default.any,\n fieldContainerClassName: _propTypes.default.string\n};\nField.contextTypes = {\n localize: _propTypes.default.func,\n description: _propTypes.default.string,\n attr: _propTypes.default.string,\n showFieldTooltips: _propTypes.default.bool\n};\nField.defaultProps = {\n center: false,\n multiValued: false\n};\nFieldDelete.propTypes = {\n onClick: _propTypes.default.func\n};\nvar _default = Field;\nexports.default = _default;\n//# sourceMappingURL=Field.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/Field.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/FilterOperation.js": /*!**********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/FilterOperation.js ***! \**********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.FilterValue = exports.FilterOperation = void 0;\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _Dropdown = _interopRequireDefault(__webpack_require__(/*! ../widgets/Dropdown */ \"./node_modules/react-chart-editor/lib/components/widgets/Dropdown.js\"));\n\nvar _TextInput = _interopRequireDefault(__webpack_require__(/*! ../widgets/TextInput */ \"./node_modules/react-chart-editor/lib/components/widgets/TextInput.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar operations = function operations(_) {\n return {\n inequality: [{\n value: '!=',\n label: _('Target ≠ Reference')\n }, {\n value: '<',\n label: _('Target < Reference')\n }, {\n value: '<=',\n label: _('Target ≤ Reference')\n }, {\n value: '=',\n label: _('Target = Reference')\n }, {\n value: '>',\n label: _('Target > Reference')\n }, {\n value: '>=',\n label: _('Target ≥ Reference')\n }],\n inrange: [{\n value: '[]',\n label: _('Lower ≤ Target ≤ Upper')\n }, {\n value: '()',\n label: _('Lower < Target < Upper')\n }, {\n value: '[)',\n label: _('Lower ≤ Target < Upper')\n }, {\n value: '(]',\n label: _('Lower < Target ≤ Upper')\n }],\n exrange: [{\n value: ')(',\n label: _('Lower ≤ Target ≤ Upper')\n }, {\n value: '][',\n label: _('Lower < Target < Upper')\n }, {\n value: ')[',\n label: _('Lower ≤ Target < Upper')\n }, {\n value: '](',\n label: _('Lower < Target ≤ Upper')\n }],\n inset: [{\n value: '{}',\n label: _('Include')\n }],\n exset: [{\n value: '}{',\n label: _('Exclude')\n }]\n };\n};\n\nvar findOperation = function findOperation(operator, _) {\n var op = 'inequality';\n var ops = operations(_);\n\n for (var key in ops) {\n if (ops.hasOwnProperty(key) && ops[key].map(function (o) {\n return o.value;\n }).indexOf(operator) !== -1) {\n op = key;\n break;\n }\n }\n\n return op;\n};\n\nvar UnconnectedFilterOperation = /*#__PURE__*/function (_Component) {\n _inherits(UnconnectedFilterOperation, _Component);\n\n var _super = _createSuper(UnconnectedFilterOperation);\n\n function UnconnectedFilterOperation(props, context) {\n var _this;\n\n _classCallCheck(this, UnconnectedFilterOperation);\n\n _this = _super.call(this, props, context);\n var _ = context.localize;\n _this.state = {\n operation: findOperation(_this.props.fullValue, _),\n operator: operations(_).inequality[0].value\n };\n _this.setOperation = _this.setOperation.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(UnconnectedFilterOperation, [{\n key: \"setOperation\",\n value: function setOperation(value) {\n var _ = this.context.localize;\n var operator = operations(_)[value][0].value;\n this.setState({\n operation: value,\n operator: operator\n });\n this.props.updatePlot(operator);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n fullValue = _this$props.fullValue,\n updatePlot = _this$props.updatePlot,\n backgroundDark = _this$props.backgroundDark,\n attr = _this$props.attr;\n var _ = this.context.localize;\n var operators = [{\n label: _('Inequality'),\n value: 'inequality'\n }, {\n label: _('Include Range'),\n value: 'inrange'\n }, {\n label: _('Exclude Range'),\n value: 'exrange'\n }, {\n label: _('Include Values'),\n value: 'inset'\n }, {\n label: _('Exclude Values'),\n value: 'exset'\n }];\n var opValue = fullValue && fullValue.length > 0 ? fullValue : this.state.operator;\n return /*#__PURE__*/_react.default.createElement(\"div\", null, /*#__PURE__*/_react.default.createElement(_Field.default, _extends({}, this.props, {\n attr: attr\n }), /*#__PURE__*/_react.default.createElement(_Dropdown.default, {\n backgroundDark: backgroundDark,\n options: operators,\n value: findOperation(opValue, _),\n onChange: this.setOperation,\n clearable: false\n }), this.state.operation === 'inset' || this.state.operation === 'exset' ? null : /*#__PURE__*/_react.default.createElement(_Dropdown.default, {\n backgroundDark: backgroundDark,\n options: operations(_)[this.state.operation],\n value: opValue,\n onChange: updatePlot,\n clearable: false\n })));\n }\n }]);\n\n return UnconnectedFilterOperation;\n}(_react.Component);\n\nUnconnectedFilterOperation.propTypes = _objectSpread({\n fullValue: _propTypes.default.any,\n updatePlot: _propTypes.default.func\n}, _Field.default.propTypes);\nUnconnectedFilterOperation.contextTypes = {\n localize: _propTypes.default.func\n};\n\nvar UnconnectedFilterValue = /*#__PURE__*/function (_Component2) {\n _inherits(UnconnectedFilterValue, _Component2);\n\n var _super2 = _createSuper(UnconnectedFilterValue);\n\n function UnconnectedFilterValue(props, context) {\n var _this2;\n\n _classCallCheck(this, UnconnectedFilterValue);\n\n _this2 = _super2.call(this, props, context);\n _this2.state = {\n value: '',\n valueMax: ''\n };\n _this2.setValue = _this2.setValue.bind(_assertThisInitialized(_this2));\n _this2.setValueMax = _this2.setValueMax.bind(_assertThisInitialized(_this2));\n return _this2;\n }\n\n _createClass(UnconnectedFilterValue, [{\n key: \"setValue\",\n value: function setValue(v) {\n var _this$context = this.context,\n _ = _this$context.localize,\n container = _this$context.container;\n var op = findOperation(container.operation, _);\n this.setState({\n value: v\n });\n var val;\n val = op === 'inrange' || op === 'exrange' ? [v, this.state.valueMax] : v;\n\n if (op === 'inset' || op === 'exset') {\n val = val.split(',');\n val = val.map(function (v) {\n return v.trim();\n });\n }\n\n this.props.updatePlot(val);\n }\n }, {\n key: \"setValueMax\",\n value: function setValueMax(v) {\n this.setState({\n valueMax: v\n });\n this.props.updatePlot([this.state.value, v]);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$context2 = this.context,\n _ = _this$context2.localize,\n container = _this$context2.container;\n var operation = container && container.operation ? container.operation : '=';\n var _this$props2 = this.props,\n fullValue = _this$props2.fullValue,\n attr = _this$props2.attr,\n defaultValue = _this$props2.defaultValue;\n var op = findOperation(operation, _);\n\n var label1 = _('Reference');\n\n if (op === 'inrange' || op === 'exrange') {\n label1 = _('Lower Bound');\n } else if (op === 'inset' || op === 'exset') {\n label1 = _('Values');\n }\n\n var val1 = fullValue;\n\n if ((op === 'inset' || op === 'exset') && Array.isArray(fullValue)) {\n val1 = fullValue.join(', ');\n } else if (Array.isArray(fullValue)) {\n val1 = fullValue[0];\n }\n\n return /*#__PURE__*/_react.default.createElement(\"div\", null, /*#__PURE__*/_react.default.createElement(_Field.default, _extends({}, this.props, {\n label: label1\n }), /*#__PURE__*/_react.default.createElement(_TextInput.default, {\n value: val1,\n defaultValue: val1,\n onUpdate: this.setValue\n })), !(op === 'inrange' || op === 'exrange') ? null : /*#__PURE__*/_react.default.createElement(_Field.default, _extends({}, this.props, {\n label: _('Upper Bound'),\n attr: attr\n }), /*#__PURE__*/_react.default.createElement(_TextInput.default, {\n value: Array.isArray(fullValue) ? fullValue[1] : fullValue,\n defaultValue: defaultValue,\n onUpdate: this.setValueMax\n })));\n }\n }]);\n\n return UnconnectedFilterValue;\n}(_react.Component);\n\nUnconnectedFilterValue.propTypes = _objectSpread({\n defaultValue: _propTypes.default.string,\n fullValue: _propTypes.default.any,\n updatePlot: _propTypes.default.func\n}, _Field.default.propTypes);\nUnconnectedFilterValue.contextTypes = {\n localize: _propTypes.default.func,\n container: _propTypes.default.object\n};\nvar FilterOperation = (0, _lib.connectToContainer)(UnconnectedFilterOperation);\nexports.FilterOperation = FilterOperation;\nvar FilterValue = (0, _lib.connectToContainer)(UnconnectedFilterValue);\nexports.FilterValue = FilterValue;\n//# sourceMappingURL=FilterOperation.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/FilterOperation.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/Flaglist.js": /*!***************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/Flaglist.js ***! \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.UnconnectedFlaglist = void 0;\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _FlaglistCheckboxGroup = _interopRequireDefault(__webpack_require__(/*! ../widgets/FlaglistCheckboxGroup */ \"./node_modules/react-chart-editor/lib/components/widgets/FlaglistCheckboxGroup.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar UnconnectedFlaglist = /*#__PURE__*/function (_Component) {\n _inherits(UnconnectedFlaglist, _Component);\n\n var _super = _createSuper(UnconnectedFlaglist);\n\n function UnconnectedFlaglist() {\n _classCallCheck(this, UnconnectedFlaglist);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(UnconnectedFlaglist, [{\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react.default.createElement(_Field.default, this.props, /*#__PURE__*/_react.default.createElement(_FlaglistCheckboxGroup.default, {\n options: this.props.options,\n activeOption: this.props.fullValue,\n onChange: this.props.updatePlot\n }));\n }\n }]);\n\n return UnconnectedFlaglist;\n}(_react.Component);\n\nexports.UnconnectedFlaglist = UnconnectedFlaglist;\nUnconnectedFlaglist.propTypes = _objectSpread({\n fullValue: _propTypes.default.any,\n options: _propTypes.default.array.isRequired,\n updatePlot: _propTypes.default.func\n}, _Field.default.propTypes);\nUnconnectedFlaglist.displayName = 'UnconnectedFlaglist';\n\nvar _default = (0, _lib.connectToContainer)(UnconnectedFlaglist);\n\nexports.default = _default;\n//# sourceMappingURL=Flaglist.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/Flaglist.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/FontSelector.js": /*!*******************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/FontSelector.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _Dropdown = _interopRequireDefault(__webpack_require__(/*! ./Dropdown */ \"./node_modules/react-chart-editor/lib/components/fields/Dropdown.js\"));\n\nvar _react = _interopRequireDefault(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nvar FontSelector = function FontSelector(props, context) {\n return /*#__PURE__*/_react.default.createElement(_Dropdown.default, _extends({}, props, {\n options: context.fontOptions.map(function (_ref) {\n var value = _ref.value,\n label = _ref.label;\n return {\n label: /*#__PURE__*/_react.default.createElement(\"span\", {\n style: {\n fontFamily: value\n }\n }, label),\n value: value\n };\n })\n }));\n};\n\nFontSelector.propTypes = _objectSpread({}, _Dropdown.default.propTypes);\nFontSelector.defaultProps = {\n clearable: false\n};\nFontSelector.contextTypes = {\n fontOptions: _propTypes.default.array\n};\nvar _default = FontSelector;\nexports.default = _default;\n//# sourceMappingURL=FontSelector.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/FontSelector.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/GroupCreator.js": /*!*******************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/GroupCreator.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _Dropdown = _interopRequireDefault(__webpack_require__(/*! ./Dropdown */ \"./node_modules/react-chart-editor/lib/components/fields/Dropdown.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _Button = _interopRequireDefault(__webpack_require__(/*! ../widgets/Button */ \"./node_modules/react-chart-editor/lib/components/widgets/Button.js\"));\n\nvar _plotlyIcons = __webpack_require__(/*! plotly-icons */ \"./node_modules/plotly-icons/lib/index.js\");\n\nvar _constants = __webpack_require__(/*! ../../lib/constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar UnconnectedGroupCreator = /*#__PURE__*/function (_Component) {\n _inherits(UnconnectedGroupCreator, _Component);\n\n var _super = _createSuper(UnconnectedGroupCreator);\n\n function UnconnectedGroupCreator() {\n _classCallCheck(this, UnconnectedGroupCreator);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(UnconnectedGroupCreator, [{\n key: \"getAllGroups\",\n value: function getAllGroups() {\n var _this = this;\n\n return _toConsumableArray(new Set(this.context.data.map(function (t) {\n return t[_this.props.attr];\n }))).filter(function (g) {\n return Boolean(g);\n });\n }\n }, {\n key: \"canAddGroup\",\n value: function canAddGroup() {\n var _this$props = this.props,\n fullContainer = _this$props.fullContainer,\n attr = _this$props.attr;\n var currentGroup = fullContainer[attr];\n var currentTraceIndex = fullContainer.index;\n\n if (fullContainer.index === _constants.MULTI_VALUED) {\n return this.getAllGroups().length === 0;\n }\n\n return !currentGroup || this.context.fullData.some(function (d) {\n return d.index !== currentTraceIndex && d[attr] === currentGroup;\n });\n }\n }, {\n key: \"addAndUpdateGroup\",\n value: function addAndUpdateGroup() {\n var _this2 = this;\n\n var allGroups = this.context.fullData.map(function (t) {\n return parseInt(t[_this2.props.attr], 10);\n }).filter(function (n) {\n return Number.isInteger(n);\n }); // don't want to pass empty array to max\n\n allGroups.push(0);\n var lastGroupNumber = Math.max.apply(Math, allGroups);\n this.props.updatePlot(lastGroupNumber + 1);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this3 = this;\n\n var _ = this.context.localize;\n var _this$props2 = this.props,\n attr = _this$props2.attr,\n label = _this$props2.label,\n prefix = _this$props2.prefix,\n updatePlot = _this$props2.updatePlot;\n var options = [{\n label: _('None'),\n value: ''\n }];\n var allGroups = this.getAllGroups();\n allGroups.forEach(function (g) {\n return options.push({\n label: \"\".concat(prefix, \" \").concat(g),\n value: g\n });\n });\n options.sort(function (a, b) {\n return a.value - b.value;\n });\n\n var icon = /*#__PURE__*/_react.default.createElement(_plotlyIcons.PlusIcon, null);\n\n var addButton = this.canAddGroup() ? /*#__PURE__*/_react.default.createElement(_Button.default, {\n variant: \"no-text\",\n icon: icon,\n onClick: function onClick() {\n return _this3.addAndUpdateGroup();\n }\n }) : /*#__PURE__*/_react.default.createElement(_Button.default, {\n variant: \"no-text--disabled\",\n icon: icon,\n onClick: function onClick() {}\n });\n return /*#__PURE__*/_react.default.createElement(_Dropdown.default, {\n label: label,\n attr: attr,\n clearable: false,\n options: options,\n updatePlot: updatePlot,\n extraComponent: addButton\n });\n }\n }]);\n\n return UnconnectedGroupCreator;\n}(_react.Component);\n\nUnconnectedGroupCreator.propTypes = _objectSpread({\n attr: _propTypes.default.string,\n fullContainer: _propTypes.default.object,\n prefix: _propTypes.default.string\n}, _Field.default.propTypes);\nUnconnectedGroupCreator.contextTypes = {\n localize: _propTypes.default.func,\n data: _propTypes.default.array,\n fullData: _propTypes.default.array\n};\nUnconnectedGroupCreator.displayName = 'UnconnectedGroupCreator';\n\nvar _default = (0, _lib.connectToContainer)(UnconnectedGroupCreator);\n\nexports.default = _default;\n//# sourceMappingURL=GroupCreator.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/GroupCreator.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/HoverLabelNameLength.js": /*!***************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/HoverLabelNameLength.js ***! \***************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.UnconnectedHoverLabelNameLength = void 0;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _RadioBlocks = _interopRequireDefault(__webpack_require__(/*! ../widgets/RadioBlocks */ \"./node_modules/react-chart-editor/lib/components/widgets/RadioBlocks.js\"));\n\nvar _NumericInput = _interopRequireDefault(__webpack_require__(/*! ../widgets/NumericInput */ \"./node_modules/react-chart-editor/lib/components/widgets/NumericInput.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar UnconnectedHoverLabelNameLength = /*#__PURE__*/function (_Component) {\n _inherits(UnconnectedHoverLabelNameLength, _Component);\n\n var _super = _createSuper(UnconnectedHoverLabelNameLength);\n\n function UnconnectedHoverLabelNameLength(props) {\n var _this;\n\n _classCallCheck(this, UnconnectedHoverLabelNameLength);\n\n _this = _super.call(this, props);\n _this.state = {\n currentOption: _this.getCurrentOption(props)\n };\n _this.onOptionChange = _this.onOptionChange.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(UnconnectedHoverLabelNameLength, [{\n key: \"getCurrentOption\",\n value: function getCurrentOption(props) {\n return props.fullValue > 0 ? 'clip' : props.fullValue === 0 ? 'hide' : 'no-clip';\n }\n }, {\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps) {\n if (nextProps.fullValue !== this.props.fullValue) {\n this.setState({\n currentOption: this.getCurrentOption(nextProps)\n });\n }\n }\n }, {\n key: \"onOptionChange\",\n value: function onOptionChange(option) {\n if (this.state.currentOption !== 'clip' && option === 'clip') {\n // this allows us to go back to plotly.js default if we've\n // clicked away from the 'clip' option.\n this.props.updatePlot(15); //eslint-disable-line\n\n return;\n }\n\n if (option === 'no-clip') {\n this.props.updatePlot(-1);\n return;\n }\n\n if (option === 'hide') {\n this.props.updatePlot(0);\n return;\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _ = this.context.localize;\n return /*#__PURE__*/_react.default.createElement(_Field.default, this.props, /*#__PURE__*/_react.default.createElement(_RadioBlocks.default, {\n activeOption: this.state.currentOption,\n options: [{\n label: _('Clip To'),\n value: 'clip'\n }, {\n label: _('No Clip'),\n value: 'no-clip'\n }, {\n label: _('Hide'),\n value: 'hide'\n }],\n onOptionChange: this.onOptionChange\n }), /*#__PURE__*/_react.default.createElement(\"div\", {\n style: {\n height: '10px',\n width: '100%'\n }\n }), this.state.currentOption === 'clip' ? /*#__PURE__*/_react.default.createElement(_NumericInput.default, {\n value: this.props.fullValue,\n onChange: this.props.updatePlot,\n onUpdate: this.props.updatePlot,\n units: \"px\"\n }) : null);\n }\n }]);\n\n return UnconnectedHoverLabelNameLength;\n}(_react.Component);\n\nexports.UnconnectedHoverLabelNameLength = UnconnectedHoverLabelNameLength;\nUnconnectedHoverLabelNameLength.propTypes = _objectSpread({\n fullValue: _propTypes.default.number,\n updatePlot: _propTypes.default.func\n}, _Field.default.propTypes);\nUnconnectedHoverLabelNameLength.contextTypes = {\n localize: _propTypes.default.func\n};\nUnconnectedHoverLabelNameLength.displayName = 'UnconnectedHoverLabelNameLength';\n\nvar _default = (0, _lib.connectToContainer)(UnconnectedHoverLabelNameLength, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n var container = plotProps.container;\n plotProps.isVisible = container.hoverinfo && container.hoverinfo.includes('name') || container.hovertemplate || container.hovertemplate === ' ';\n }\n});\n\nexports.default = _default;\n//# sourceMappingURL=HoverLabelNameLength.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/HoverLabelNameLength.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/Info.js": /*!***********************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/Info.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar Info = /*#__PURE__*/function (_Component) {\n _inherits(Info, _Component);\n\n var _super = _createSuper(Info);\n\n function Info() {\n _classCallCheck(this, Info);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(Info, [{\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react.default.createElement(_Field.default, this.props, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"js-test-info \".concat(this.props.className ? this.props.className : '')\n }, this.props.children));\n }\n }]);\n\n return Info;\n}(_react.Component);\n\nexports.default = Info;\nInfo.plotly_editor_traits = {\n no_visibility_forcing: true\n};\nInfo.propTypes = _objectSpread({}, _Field.default.propTypes);\n//# sourceMappingURL=Info.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/Info.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/LineSelectors.js": /*!********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/LineSelectors.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.LineDashSelector = exports.LineShapeSelector = void 0;\n\nvar _Dropdown = _interopRequireDefault(__webpack_require__(/*! ./Dropdown */ \"./node_modules/react-chart-editor/lib/components/fields/Dropdown.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _nested_property = _interopRequireDefault(__webpack_require__(/*! plotly.js/src/lib/nested_property */ \"./node_modules/plotly.js/src/lib/nested_property.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _constants = __webpack_require__(/*! ../../lib/constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nvar strokeDashes = [{\n value: 'solid',\n strokeDasharray: ''\n}, {\n value: 'dot',\n strokeDasharray: '3px, 3px'\n}, {\n value: 'dash',\n strokeDasharray: '9px, 9px'\n}, {\n value: 'longdash',\n strokeDasharray: '15px, 15px'\n}, {\n value: 'dashdot',\n strokeDasharray: '9px, 3px, 3px, 3px'\n}, {\n value: 'longdashdot',\n strokeDasharray: '15px, 6px, 3px, 6px'\n}];\nvar strokeShapes = [{\n d: 'M2,14L14,2',\n value: 'linear'\n}, {\n d: 'M2,14C4,4 16,16 18,2',\n value: 'spline'\n}, {\n d: 'M2,14H14V2',\n value: 'hv'\n}, {\n d: 'M2,14V2H14',\n value: 'vh'\n}, {\n d: 'M2,14H8V2H14',\n value: 'hvh'\n}, {\n d: 'M2,14V8H14V2',\n value: 'vhv'\n}];\n\nvar _computeOptions = function computeOptions(strokeData, stroke) {\n return strokeData.map(function (_ref) {\n var value = _ref.value,\n strokeDasharray = _ref.strokeDasharray,\n _ref$d = _ref.d,\n d = _ref$d === void 0 ? 'M0,8h100' : _ref$d;\n return {\n label: /*#__PURE__*/_react.default.createElement(\"svg\", {\n width: \"100\",\n height: \"16\"\n }, /*#__PURE__*/_react.default.createElement(\"g\", null, /*#__PURE__*/_react.default.createElement(\"path\", {\n d: d,\n style: {\n fill: 'none',\n strokeWidth: '4px',\n stroke: !stroke || stroke === _constants.MULTI_VALUED ? _constants.COLORS.mutedBlue : stroke,\n strokeDasharray: strokeDasharray\n }\n }))),\n value: value\n };\n });\n};\n\nvar LineShapeSelector = function LineShapeSelector(props) {\n return /*#__PURE__*/_react.default.createElement(LineSelector, _extends({}, props, {\n computeOptions: _computeOptions.bind(null, strokeShapes)\n }));\n};\n\nexports.LineShapeSelector = LineShapeSelector;\n\nvar LineDashSelector = function LineDashSelector(props) {\n return /*#__PURE__*/_react.default.createElement(LineSelector, _extends({}, props, {\n computeOptions: function computeOptions(lineColor) {\n return _computeOptions(strokeDashes, lineColor).concat([{\n label: '',\n value: null\n }]);\n }\n }));\n};\n\nexports.LineDashSelector = LineDashSelector;\n\nvar LineSelector = /*#__PURE__*/function (_Component) {\n _inherits(LineSelector, _Component);\n\n var _super = _createSuper(LineSelector);\n\n function LineSelector(props, context) {\n var _this;\n\n _classCallCheck(this, LineSelector);\n\n _this = _super.call(this, props, context);\n\n _this.setLocals(props, context);\n\n return _this;\n }\n\n _createClass(LineSelector, [{\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n }, {\n key: \"setLocals\",\n value: function setLocals(nextProps, nextContext) {\n var fullContainer = nextContext.fullContainer;\n var lineColor = (0, _nested_property.default)(fullContainer, 'line.color').get();\n\n if (!this.options || this.lineColor !== lineColor) {\n this.options = this.props.computeOptions(lineColor);\n this.lineColor = lineColor;\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react.default.createElement(_Dropdown.default, _extends({}, this.props, {\n options: this.options,\n backgroundDark: (0, _lib.tooLight)(this.lineColor)\n }));\n }\n }]);\n\n return LineSelector;\n}(_react.Component);\n\nLineSelector.propTypes = _objectSpread({\n computeOptions: _propTypes.default.func\n}, _Dropdown.default.propTypes);\nLineSelector.defaultProps = {\n clearable: false\n};\nLineSelector.contextTypes = {\n fullContainer: _propTypes.default.object\n};\n//# sourceMappingURL=LineSelectors.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/LineSelectors.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/LocationSelector.js": /*!***********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/LocationSelector.js ***! \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _Radio = _interopRequireDefault(__webpack_require__(/*! ./Radio */ \"./node_modules/react-chart-editor/lib/components/fields/Radio.js\"));\n\nvar _Dropdown = __webpack_require__(/*! ./Dropdown */ \"./node_modules/react-chart-editor/lib/components/fields/Dropdown.js\");\n\nvar _DataSelector = _interopRequireDefault(__webpack_require__(/*! ./DataSelector */ \"./node_modules/react-chart-editor/lib/components/fields/DataSelector.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar LocationmodeVisible = (0, _lib.connectToContainer)(_Dropdown.UnconnectedDropdown, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n if (!plotProps.fullValue) {\n plotProps.isVisible = true;\n plotProps.fullValue = plotProps.container.locationmode;\n return;\n }\n }\n});\n\nvar UnconnectedLocation = /*#__PURE__*/function (_Component) {\n _inherits(UnconnectedLocation, _Component);\n\n var _super = _createSuper(UnconnectedLocation);\n\n function UnconnectedLocation() {\n _classCallCheck(this, UnconnectedLocation);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(UnconnectedLocation, [{\n key: \"render\",\n value: function render() {\n var _ = this.context.localize;\n return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_DataSelector.default, {\n label: _('Locations'),\n attr: \"locations\"\n }), /*#__PURE__*/_react.default.createElement(LocationmodeVisible, {\n label: _('Location Format'),\n attr: \"locationmode\",\n clearable: false,\n options: [{\n label: _('GeoJSON feature'),\n value: 'geojson-id'\n }, {\n label: _('Country Names'),\n value: 'country names'\n }, {\n label: _('Country Abbreviations (ISO-3)'),\n value: 'ISO-3'\n }, {\n label: _('USA State Abbreviations (e.g. NY)'),\n value: 'USA-states'\n }]\n }));\n }\n }]);\n\n return UnconnectedLocation;\n}(_react.Component);\n\nUnconnectedLocation.propTypes = _objectSpread({\n attr: _propTypes.default.string\n}, _Field.default.propTypes);\nUnconnectedLocation.contextTypes = {\n localize: _propTypes.default.func,\n updateContainer: _propTypes.default.func\n};\nvar Location = (0, _lib.connectToContainer)(UnconnectedLocation);\n\nvar UnconnectedLocationSelector = /*#__PURE__*/function (_Component2) {\n _inherits(UnconnectedLocationSelector, _Component2);\n\n var _super2 = _createSuper(UnconnectedLocationSelector);\n\n function UnconnectedLocationSelector(props, context) {\n var _this;\n\n _classCallCheck(this, UnconnectedLocationSelector);\n\n _this = _super2.call(this, props, context);\n _this.state = {\n mode: props.container.locations ? 'location' : 'latlon'\n };\n _this.setMode = _this.setMode.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(UnconnectedLocationSelector, [{\n key: \"componentWillMount\",\n value: function componentWillMount() {\n this.setState({\n mode: this.props.container.locations ? 'location' : 'latlon'\n });\n }\n }, {\n key: \"setMode\",\n value: function setMode(mode) {\n this.setState({\n mode: mode\n });\n this.props.updateContainer(mode === 'latlon' ? {\n locations: null,\n locationmode: null,\n locationssrc: null,\n locationmodesrc: null\n } : {\n lat: null,\n lon: null,\n latsrc: null,\n lonsrc: null\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var mode = this.state.mode;\n var _this$context = this.context,\n _ = _this$context.localize,\n type = _this$context.container.type;\n\n if (type === 'scattergeo') {\n return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Field.default, _extends({}, this.props, {\n attr: this.props.attr\n }), /*#__PURE__*/_react.default.createElement(_Radio.default, {\n options: [{\n value: 'latlon',\n label: _('Lat/Lon')\n }, {\n value: 'location',\n label: _('Location')\n }],\n fullValue: mode,\n updatePlot: this.setMode,\n attr: this.props.attr\n })), mode === 'latlon' ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_DataSelector.default, {\n label: _('Latitude'),\n attr: \"lat\"\n }), /*#__PURE__*/_react.default.createElement(_DataSelector.default, {\n label: _('Longitude'),\n attr: \"lon\"\n })) : /*#__PURE__*/_react.default.createElement(Location, {\n attr: \"type\"\n }));\n } else if (type === 'choropleth') {\n return /*#__PURE__*/_react.default.createElement(Location, {\n attr: \"type\"\n });\n } else if (type === 'choroplethmapbox') {\n return /*#__PURE__*/_react.default.createElement(_DataSelector.default, {\n label: _('Locations'),\n attr: \"locations\"\n });\n }\n\n return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_DataSelector.default, {\n label: _('Latitude'),\n attr: \"lat\"\n }), /*#__PURE__*/_react.default.createElement(_DataSelector.default, {\n label: _('Longitude'),\n attr: \"lon\"\n }));\n }\n }]);\n\n return UnconnectedLocationSelector;\n}(_react.Component);\n\nUnconnectedLocationSelector.propTypes = _objectSpread({\n fullValue: _propTypes.default.any,\n updatePlot: _propTypes.default.func,\n attr: _propTypes.default.string\n}, _Field.default.propTypes);\nUnconnectedLocationSelector.contextTypes = {\n container: _propTypes.default.object,\n localize: _propTypes.default.func,\n updateContainer: _propTypes.default.func\n};\n\nvar _default = (0, _lib.connectToContainer)(UnconnectedLocationSelector);\n\nexports.default = _default;\n//# sourceMappingURL=LocationSelector.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/LocationSelector.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/MarkerColor.js": /*!******************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/MarkerColor.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _RadioBlocks = _interopRequireDefault(__webpack_require__(/*! ../widgets/RadioBlocks */ \"./node_modules/react-chart-editor/lib/components/widgets/RadioBlocks.js\"));\n\nvar _MultiColorPicker = _interopRequireDefault(__webpack_require__(/*! ./MultiColorPicker */ \"./node_modules/react-chart-editor/lib/components/fields/MultiColorPicker.js\"));\n\nvar _ColorscalePicker = _interopRequireDefault(__webpack_require__(/*! ./ColorscalePicker */ \"./node_modules/react-chart-editor/lib/components/fields/ColorscalePicker.js\"));\n\nvar _Numeric = _interopRequireDefault(__webpack_require__(/*! ./Numeric */ \"./node_modules/react-chart-editor/lib/components/fields/Numeric.js\"));\n\nvar _Radio = _interopRequireDefault(__webpack_require__(/*! ./Radio */ \"./node_modules/react-chart-editor/lib/components/fields/Radio.js\"));\n\nvar _Info = _interopRequireDefault(__webpack_require__(/*! ./Info */ \"./node_modules/react-chart-editor/lib/components/fields/Info.js\"));\n\nvar _DataSelector = _interopRequireDefault(__webpack_require__(/*! ./DataSelector */ \"./node_modules/react-chart-editor/lib/components/fields/DataSelector.js\"));\n\nvar _VisibilitySelect = _interopRequireDefault(__webpack_require__(/*! ./VisibilitySelect */ \"./node_modules/react-chart-editor/lib/components/fields/VisibilitySelect.js\"));\n\nvar _constants = __webpack_require__(/*! ../../lib/constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar UnconnectedMarkerColor = /*#__PURE__*/function (_Component) {\n _inherits(UnconnectedMarkerColor, _Component);\n\n var _super = _createSuper(UnconnectedMarkerColor);\n\n function UnconnectedMarkerColor(props, context) {\n var _this;\n\n _classCallCheck(this, UnconnectedMarkerColor);\n\n _this = _super.call(this, props, context);\n var type = null;\n\n if (!props.container.marker || props.container.marker && !props.container.marker.colorsrc) {\n type = 'constant';\n } else if (props.container.marker && Array.isArray(props.container.marker.color) && props.fullContainer.marker && Array.isArray(props.fullContainer.marker.color)) {\n type = 'variable';\n }\n\n _this.state = {\n type: type,\n value: {\n constant: type === 'constant' ? props.fullValue : _constants.COLORS.mutedBlue,\n variable: type === 'variable' ? props.fullValue : null\n },\n selectedConstantColorOption: type === 'constant' && props.multiValued ? 'multiple' : 'single'\n };\n _this.setType = _this.setType.bind(_assertThisInitialized(_this));\n _this.setColor = _this.setColor.bind(_assertThisInitialized(_this));\n _this.setColorScale = _this.setColorScale.bind(_assertThisInitialized(_this));\n _this.onConstantColorOptionChange = _this.onConstantColorOptionChange.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(UnconnectedMarkerColor, [{\n key: \"setType\",\n value: function setType(type) {\n if (this.state.type !== type) {\n this.setState({\n type: type\n });\n this.props.updatePlot(this.state.value[type]);\n\n if (type === 'constant') {\n var _this$context$updateC;\n\n this.context.updateContainer((_this$context$updateC = {}, _defineProperty(_this$context$updateC, 'marker.colorsrc', null), _defineProperty(_this$context$updateC, 'marker.colorscale', null), _defineProperty(_this$context$updateC, 'marker.showscale', null), _this$context$updateC));\n this.setState({\n colorscale: null\n });\n } else {\n var _this$context$updateC2;\n\n this.context.updateContainer((_this$context$updateC2 = {}, _defineProperty(_this$context$updateC2, 'marker.color', null), _defineProperty(_this$context$updateC2, 'marker.colorsrc', null), _defineProperty(_this$context$updateC2, 'marker.colorscale', null), _this$context$updateC2));\n }\n }\n }\n }, {\n key: \"setColor\",\n value: function setColor(inputValue) {\n var type = this.state.type;\n this.setState(type === 'constant' ? {\n value: {\n constant: inputValue\n }\n } : {\n value: {\n variable: inputValue\n }\n });\n this.props.updatePlot(inputValue);\n }\n }, {\n key: \"setColorScale\",\n value: function setColorScale(inputValue) {\n this.setState({\n colorscale: inputValue\n });\n this.context.updateContainer(_defineProperty({}, 'marker.colorscale', inputValue));\n }\n }, {\n key: \"isMultiValued\",\n value: function isMultiValued() {\n return this.props.multiValued || Array.isArray(this.props.fullValue) && this.props.fullValue.includes(_constants.MULTI_VALUED) || this.props.container.marker && this.props.container.marker.colorscale && this.props.container.marker.colorscale === _constants.MULTI_VALUED || this.props.container.marker && this.props.container.marker.colorsrc && this.props.container.marker.colorsrc === _constants.MULTI_VALUED || this.props.container.marker && this.props.container.marker.color && Array.isArray(this.props.container.marker.color) && this.props.container.marker.color.includes(_constants.MULTI_VALUED);\n }\n }, {\n key: \"onConstantColorOptionChange\",\n value: function onConstantColorOptionChange(value) {\n this.setState({\n selectedConstantColorOption: value\n });\n }\n }, {\n key: \"renderConstantControls\",\n value: function renderConstantControls() {\n var _ = this.context.localize;\n return /*#__PURE__*/_react.default.createElement(_MultiColorPicker.default, {\n attr: \"marker.color\",\n multiColorMessage: _('Each trace will be colored according to the selected colorscale.'),\n singleColorMessage: _('All traces will be colored in the the same color.'),\n setColor: this.setColor,\n setColorScale: this.setColorScale,\n onConstantColorOptionChange: this.onConstantColorOptionChange,\n parentSelectedConstantColorOption: this.state.selectedConstantColorOption\n });\n }\n }, {\n key: \"renderVariableControls\",\n value: function renderVariableControls() {\n var multiValued = this.props.container && this.props.container.marker && (this.props.container.marker.colorscale && this.props.container.marker.colorscale === _constants.MULTI_VALUED || this.props.container.marker.colorsrc && this.props.container.marker.colorsrc === _constants.MULTI_VALUED);\n return /*#__PURE__*/_react.default.createElement(_Field.default, {\n multiValued: multiValued\n }, /*#__PURE__*/_react.default.createElement(_DataSelector.default, {\n suppressMultiValuedMessage: true,\n attr: \"marker.color\"\n }), this.props.container.marker && this.props.container.marker.colorscale === _constants.MULTI_VALUED ? null : /*#__PURE__*/_react.default.createElement(_ColorscalePicker.default, {\n suppressMultiValuedMessage: true,\n attr: \"marker.colorscale\",\n updatePlot: this.setColorScale,\n colorscale: this.state.colorscale\n }));\n }\n }, {\n key: \"render\",\n value: function render() {\n var attr = this.props.attr;\n var _this$context = this.context,\n _ = _this$context.localize,\n container = _this$context.container; // TO DO: https://github.com/plotly/react-chart-editor/issues/654\n\n var noSplitsPresent = container && (!container.transforms || !container.transforms.filter(function (t) {\n return t.type === 'groupby';\n }).length);\n\n if (noSplitsPresent) {\n var type = this.state.type;\n var options = [{\n label: _('Constant'),\n value: 'constant'\n }, {\n label: _('Variable'),\n value: 'variable'\n }];\n return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Field.default, _extends({}, this.props, {\n attr: attr\n }), /*#__PURE__*/_react.default.createElement(_Field.default, {\n multiValued: this.isMultiValued() && !this.state.type\n }, /*#__PURE__*/_react.default.createElement(_RadioBlocks.default, {\n options: options,\n activeOption: type,\n onOptionChange: this.setType\n }), !type ? null : /*#__PURE__*/_react.default.createElement(_Info.default, null, type === 'constant' ? _('All points in a trace are colored in the same color.') : _('Each point in a trace is colored according to data.'))), !type ? null : type === 'constant' ? this.renderConstantControls() : this.renderVariableControls()), type === 'constant' ? null : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Radio.default, {\n label: _('Colorscale Direction'),\n attr: \"marker.reversescale\",\n options: [{\n label: _('Normal'),\n value: false\n }, {\n label: _('Reversed'),\n value: true\n }]\n }), /*#__PURE__*/_react.default.createElement(_Radio.default, {\n label: _('Color Bar'),\n attr: \"marker.showscale\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_VisibilitySelect.default, {\n label: _('Colorscale Range'),\n attr: \"marker.cauto\",\n options: [{\n label: _('Auto'),\n value: true\n }, {\n label: _('Custom'),\n value: false\n }],\n showOn: false,\n defaultOpt: true\n }, /*#__PURE__*/_react.default.createElement(_Numeric.default, {\n label: _('Min'),\n attr: \"marker.cmin\"\n }), /*#__PURE__*/_react.default.createElement(_Numeric.default, {\n label: _('Max'),\n attr: \"marker.cmax\"\n }))));\n }\n\n return /*#__PURE__*/_react.default.createElement(_Field.default, _extends({}, this.props, {\n attr: attr\n }), this.renderConstantControls());\n }\n }]);\n\n return UnconnectedMarkerColor;\n}(_react.Component);\n\nUnconnectedMarkerColor.propTypes = _objectSpread({\n fullValue: _propTypes.default.any,\n updatePlot: _propTypes.default.func\n}, _Field.default.propTypes);\nUnconnectedMarkerColor.contextTypes = {\n localize: _propTypes.default.func,\n updateContainer: _propTypes.default.func,\n traceIndexes: _propTypes.default.array,\n container: _propTypes.default.object\n};\nUnconnectedMarkerColor.displayName = 'UnconnectedMarkerColor';\n\nvar _default = (0, _lib.connectToContainer)(UnconnectedMarkerColor);\n\nexports.default = _default;\n//# sourceMappingURL=MarkerColor.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/MarkerColor.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/MarkerSize.js": /*!*****************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/MarkerSize.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _RadioBlocks = _interopRequireDefault(__webpack_require__(/*! ../widgets/RadioBlocks */ \"./node_modules/react-chart-editor/lib/components/widgets/RadioBlocks.js\"));\n\nvar _Numeric = _interopRequireDefault(__webpack_require__(/*! ./Numeric */ \"./node_modules/react-chart-editor/lib/components/fields/Numeric.js\"));\n\nvar _DataSelector = _interopRequireDefault(__webpack_require__(/*! ./DataSelector */ \"./node_modules/react-chart-editor/lib/components/fields/DataSelector.js\"));\n\nvar _constants = __webpack_require__(/*! ../../lib/constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar UnconnectedMarkerSize = /*#__PURE__*/function (_Component) {\n _inherits(UnconnectedMarkerSize, _Component);\n\n var _super = _createSuper(UnconnectedMarkerSize);\n\n function UnconnectedMarkerSize(props, context) {\n var _this;\n\n _classCallCheck(this, UnconnectedMarkerSize);\n\n _this = _super.call(this, props, context);\n var type = null;\n\n if (!props.container.marker || props.container.marker && !props.container.marker.sizesrc) {\n type = 'constant';\n } else if (props.container.marker && Array.isArray(props.container.marker.size) && props.fullContainer.marker && Array.isArray(props.fullContainer.marker.size)) {\n type = 'variable';\n }\n\n _this.state = {\n type: type,\n value: {\n constant: type === 'constant' ? props.fullValue : '6',\n variable: type === 'variable' ? props.fullValue : null\n }\n };\n _this.setType = _this.setType.bind(_assertThisInitialized(_this));\n _this.setValue = _this.setValue.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(UnconnectedMarkerSize, [{\n key: \"setType\",\n value: function setType(type) {\n this.setState({\n type: type\n });\n this.props.updatePlot(this.state.value[type]);\n\n if (type === 'constant') {\n this.context.updateContainer(_defineProperty({}, 'marker.sizesrc', null));\n } else {\n var _this$context$updateC2;\n\n this.context.updateContainer((_this$context$updateC2 = {}, _defineProperty(_this$context$updateC2, 'marker.size', null), _defineProperty(_this$context$updateC2, 'marker.sizesrc', null), _this$context$updateC2));\n }\n }\n }, {\n key: \"setValue\",\n value: function setValue(inputValue) {\n var type = this.state.type;\n this.setState(type === 'constant' ? {\n value: {\n constant: inputValue\n }\n } : {\n value: {\n variable: inputValue\n }\n });\n this.props.updatePlot(inputValue);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n attr = _this$props.attr,\n fullValue = _this$props.fullValue;\n var _ = this.context.localize;\n var _this$state = this.state,\n type = _this$state.type,\n value = _this$state.value;\n var options = [{\n label: _('Constant'),\n value: 'constant'\n }, {\n label: _('Variable'),\n value: 'variable'\n }];\n var multiValued = this.props.multiValued || Array.isArray(fullValue) && fullValue.includes(_constants.MULTI_VALUED);\n return /*#__PURE__*/_react.default.createElement(_Field.default, _extends({}, this.props, {\n multiValued: multiValued,\n attr: attr\n }), /*#__PURE__*/_react.default.createElement(_RadioBlocks.default, {\n options: options,\n activeOption: type,\n onOptionChange: this.setType\n }), type === 'constant' ? /*#__PURE__*/_react.default.createElement(_Numeric.default, {\n suppressMultiValuedMessage: true,\n attr: \"marker.size\",\n updatePlot: this.setValue,\n fullValue: value.constant\n }) : multiValued ? null : /*#__PURE__*/_react.default.createElement(_DataSelector.default, {\n suppressMultiValuedMessage: true,\n attr: \"marker.size\",\n updatePlot: this.setValue\n }));\n }\n }]);\n\n return UnconnectedMarkerSize;\n}(_react.Component);\n\nUnconnectedMarkerSize.propTypes = _objectSpread({\n fullValue: _propTypes.default.any,\n updatePlot: _propTypes.default.func\n}, _Field.default.propTypes);\nUnconnectedMarkerSize.contextTypes = {\n localize: _propTypes.default.func,\n updateContainer: _propTypes.default.func\n};\nUnconnectedMarkerSize.displayName = 'UnconnectedMarkerSize';\n\nvar _default = (0, _lib.connectToContainer)(UnconnectedMarkerSize);\n\nexports.default = _default;\n//# sourceMappingURL=MarkerSize.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/MarkerSize.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/MultiColorPicker.js": /*!***********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/MultiColorPicker.js ***! \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _ColorPicker = _interopRequireDefault(__webpack_require__(/*! ./ColorPicker */ \"./node_modules/react-chart-editor/lib/components/fields/ColorPicker.js\"));\n\nvar _ColorscalePicker = __webpack_require__(/*! ./ColorscalePicker */ \"./node_modules/react-chart-editor/lib/components/fields/ColorscalePicker.js\");\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _Info = _interopRequireDefault(__webpack_require__(/*! ./Info */ \"./node_modules/react-chart-editor/lib/components/fields/Info.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _RadioBlocks = _interopRequireDefault(__webpack_require__(/*! ../widgets/RadioBlocks */ \"./node_modules/react-chart-editor/lib/components/widgets/RadioBlocks.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _nested_property = _interopRequireDefault(__webpack_require__(/*! plotly.js/src/lib/nested_property */ \"./node_modules/plotly.js/src/lib/nested_property.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar CustomColorscalePicker = (0, _lib.connectToContainer)(_ColorscalePicker.UnconnectedColorscalePicker, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n if (props.attr === 'marker.color' && context.fullData.filter(function (t) {\n return context.traceIndexes.includes(t.index);\n }).every(function (t) {\n return t.marker && t.marker.color;\n }) && plotProps.fullValue && typeof plotProps.fullValue === 'string') {\n plotProps.fullValue = context.fullData && context.fullData.filter(function (t) {\n return context.traceIndexes.includes(t.index);\n }).map(function (t) {\n return [0, t.marker.color];\n });\n }\n }\n});\n\nvar UnconnectedMultiColorPicker = /*#__PURE__*/function (_Component) {\n _inherits(UnconnectedMultiColorPicker, _Component);\n\n var _super = _createSuper(UnconnectedMultiColorPicker);\n\n function UnconnectedMultiColorPicker(props, context) {\n var _this;\n\n _classCallCheck(this, UnconnectedMultiColorPicker);\n\n _this = _super.call(this, props, context);\n _this.state = {\n selectedConstantColorOption: context.traceIndexes.length > 1 && props.fullValue && props.fullValue.every(function (v) {\n return v[1] === props.fullValue[0][1];\n }) ? 'single' : 'multiple'\n };\n _this.setColor = _this.setColor.bind(_assertThisInitialized(_this));\n _this.setColors = _this.setColors.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(UnconnectedMultiColorPicker, [{\n key: \"setColor\",\n value: function setColor(color) {\n if (this.props.setColor) {\n this.props.setColor(color);\n } else {\n this.props.updatePlot(color);\n }\n }\n }, {\n key: \"setColors\",\n value: function setColors(colorscale, colorscaleType) {\n var _this2 = this;\n\n var numberOfTraces = this.props.tracesToColor.length;\n var colors = colorscale.map(function (c) {\n return c[1];\n });\n var adjustedColors = colors;\n\n if (colorscaleType !== 'categorical') {\n adjustedColors = (0, _lib.adjustColorscale)(colors, numberOfTraces, colorscaleType);\n }\n\n if (adjustedColors.every(function (c) {\n return c === adjustedColors[0];\n }) || colorscaleType === 'categorical') {\n adjustedColors = (0, _lib.adjustColorscale)(colors, numberOfTraces, colorscaleType, {\n repeat: true\n });\n }\n\n var updates = adjustedColors.map(function (color) {\n return _defineProperty({}, _this2.props.attr, color);\n });\n this.context.updateContainer(updates);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this3 = this;\n\n var _ = this.context.localize;\n var constantOptions = [{\n label: _('Single'),\n value: 'single'\n }, {\n label: _('Multiple'),\n value: 'multiple'\n }];\n var selectedConstantColorOption = this.props.parentSelectedConstantColorOption ? this.props.parentSelectedConstantColorOption : this.state.selectedConstantColorOption;\n var multiMessage = this.props.multiColorMessage ? this.props.multiColorMessage : _('Each will be colored according to the selected colors.');\n var singleMessage = this.props.singleColorMessage ? this.props.singleColorMessage : _('All will be colored in the same color.');\n\n if (this.context.traceIndexes.length > 1) {\n return /*#__PURE__*/_react.default.createElement(_Field.default, _extends({}, this.props, {\n suppressMultiValuedMessage: true\n }), /*#__PURE__*/_react.default.createElement(_RadioBlocks.default, {\n options: constantOptions,\n activeOption: selectedConstantColorOption,\n onOptionChange: this.props.onConstantColorOptionChange ? this.props.onConstantColorOptionChange : function (value) {\n return _this3.setState({\n selectedConstantColorOption: value\n });\n }\n }), /*#__PURE__*/_react.default.createElement(_Info.default, null, selectedConstantColorOption === 'single' ? singleMessage : multiMessage), selectedConstantColorOption === 'single' ? /*#__PURE__*/_react.default.createElement(_ColorPicker.default, {\n attr: this.props.attr,\n updatePlot: this.setColor\n }) : /*#__PURE__*/_react.default.createElement(CustomColorscalePicker, {\n suppressMultiValuedMessage: true,\n attr: this.props.attr,\n updatePlot: this.setColors,\n fullValue: this.props.fullValue,\n initialCategory: 'categorical'\n }));\n }\n\n return /*#__PURE__*/_react.default.createElement(_ColorPicker.default, {\n attr: this.props.attr,\n updatePlot: this.setColor,\n label: this.props.label\n });\n }\n }]);\n\n return UnconnectedMultiColorPicker;\n}(_react.Component);\n\nUnconnectedMultiColorPicker.propTypes = _objectSpread({\n multiColorMessage: _propTypes.default.string,\n singleColorMessage: _propTypes.default.string,\n updatePlot: _propTypes.default.func,\n attr: _propTypes.default.string,\n parentSelectedConstantColorOption: _propTypes.default.string,\n onConstantColorOptionChange: _propTypes.default.func,\n messageKeyWordSingle: _propTypes.default.string,\n messageKeyWordPlural: _propTypes.default.string,\n tracesToColor: _propTypes.default.array\n}, _Field.default.propTypes);\nUnconnectedMultiColorPicker.contextTypes = {\n localize: _propTypes.default.func,\n updateContainer: _propTypes.default.func,\n traceIndexes: _propTypes.default.array,\n fullData: _propTypes.default.array\n};\nUnconnectedMultiColorPicker.displayName = 'UnconnectedMultiColorPicker';\n\nvar _default = (0, _lib.connectToContainer)(UnconnectedMultiColorPicker, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n if (plotProps.isVisible) {\n var colors = [];\n var tracesToColor = [];\n var dedupedTraceIndexes = [];\n context.traceIndexes.forEach(function (i) {\n if (!dedupedTraceIndexes.includes(i)) {\n dedupedTraceIndexes.push(i);\n }\n });\n dedupedTraceIndexes.forEach(function (traceIndex) {\n var traces = context.fullData.filter(function (trace) {\n return trace.index === traceIndex;\n });\n tracesToColor = tracesToColor.concat(traces);\n traces.forEach(function (t) {\n var value = (0, _nested_property.default)(t, props.attr).get();\n\n if (value) {\n colors.push(value);\n }\n });\n });\n plotProps.tracesToColor = tracesToColor;\n plotProps.fullValue = colors.map(function (c) {\n return [0, c];\n });\n }\n }\n});\n\nexports.default = _default;\n//# sourceMappingURL=MultiColorPicker.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/MultiColorPicker.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/Numeric.js": /*!**************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/Numeric.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.UnconnectedNumeric = void 0;\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _NumericInput = _interopRequireDefault(__webpack_require__(/*! ../widgets/NumericInput */ \"./node_modules/react-chart-editor/lib/components/widgets/NumericInput.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar UnconnectedNumeric = /*#__PURE__*/function (_Component) {\n _inherits(UnconnectedNumeric, _Component);\n\n var _super = _createSuper(UnconnectedNumeric);\n\n function UnconnectedNumeric() {\n _classCallCheck(this, UnconnectedNumeric);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(UnconnectedNumeric, [{\n key: \"render\",\n value: function render() {\n var fullValue = this.props.fullValue;\n var placeholder;\n\n if (this.props.multiValued) {\n placeholder = fullValue;\n fullValue = '';\n }\n\n return /*#__PURE__*/_react.default.createElement(_Field.default, this.props, /*#__PURE__*/_react.default.createElement(_NumericInput.default, {\n value: fullValue,\n defaultValue: this.props.defaultValue,\n placeholder: placeholder,\n step: this.props.step,\n stepmode: this.props.stepmode,\n min: this.props.min,\n max: this.props.max,\n onChange: this.props.updatePlot,\n onUpdate: this.props.updatePlot,\n showArrows: !this.props.hideArrows,\n showSlider: this.props.showSlider\n }));\n }\n }]);\n\n return UnconnectedNumeric;\n}(_react.Component);\n\nexports.UnconnectedNumeric = UnconnectedNumeric;\nUnconnectedNumeric.propTypes = _objectSpread({\n defaultValue: _propTypes.default.any,\n fullValue: _propTypes.default.any,\n min: _propTypes.default.number,\n max: _propTypes.default.number,\n multiValued: _propTypes.default.bool,\n hideArrows: _propTypes.default.bool,\n showSlider: _propTypes.default.bool,\n step: _propTypes.default.number,\n stepmode: _propTypes.default.string,\n updatePlot: _propTypes.default.func\n}, _Field.default.propTypes);\nUnconnectedNumeric.displayName = 'UnconnectedNumeric';\n\nvar _default = (0, _lib.connectToContainer)(UnconnectedNumeric);\n\nexports.default = _default;\n//# sourceMappingURL=Numeric.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/Numeric.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/NumericOrDate.js": /*!********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/NumericOrDate.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.UnconnectedNumericOrDate = void 0;\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _Numeric = __webpack_require__(/*! ./Numeric */ \"./node_modules/react-chart-editor/lib/components/fields/Numeric.js\");\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _lib2 = __webpack_require__(/*! plotly.js/src/lib */ \"./node_modules/plotly.js/src/lib/index.js\");\n\nvar _dates = __webpack_require__(/*! plotly.js/src/lib/dates */ \"./node_modules/plotly.js/src/lib/dates.js\");\n\nvar _DateTimePicker = __webpack_require__(/*! ./DateTimePicker */ \"./node_modules/react-chart-editor/lib/components/fields/DateTimePicker.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar UnconnectedNumericOrDate = /*#__PURE__*/function (_Component) {\n _inherits(UnconnectedNumericOrDate, _Component);\n\n var _super = _createSuper(UnconnectedNumericOrDate);\n\n function UnconnectedNumericOrDate() {\n _classCallCheck(this, UnconnectedNumericOrDate);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(UnconnectedNumericOrDate, [{\n key: \"render\",\n value: function render() {\n var date = typeof this.props.fullValue === 'string' && this.props.fullValue.split(' ')[0];\n var fullValueIsDate = typeof this.props.fullValue === 'string' && date && ((0, _lib2.isDateTime)(date) || (0, _dates.isJSDate)(date));\n return fullValueIsDate ? /*#__PURE__*/_react.default.createElement(_DateTimePicker.UnconnectedDateTimePicker, _extends({}, this.props, {\n placeholder: 'yyyy-mm-dd hh:mm:ss.xxx'\n })) : /*#__PURE__*/_react.default.createElement(_Numeric.UnconnectedNumeric, this.props);\n }\n }]);\n\n return UnconnectedNumericOrDate;\n}(_react.Component);\n\nexports.UnconnectedNumericOrDate = UnconnectedNumericOrDate;\nUnconnectedNumericOrDate.propTypes = _objectSpread({\n defaultValue: _propTypes.default.any,\n fullValue: _propTypes.default.any,\n min: _propTypes.default.number,\n max: _propTypes.default.number,\n multiValued: _propTypes.default.bool,\n hideArrows: _propTypes.default.bool,\n showSlider: _propTypes.default.bool,\n step: _propTypes.default.number,\n fullContainer: _propTypes.default.object,\n updatePlot: _propTypes.default.func\n}, _Field.default.propTypes);\nUnconnectedNumericOrDate.displayName = 'UnconnectedNumericOrDate';\n\nvar _default = (0, _lib.connectToContainer)(UnconnectedNumericOrDate);\n\nexports.default = _default;\n//# sourceMappingURL=NumericOrDate.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/NumericOrDate.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/PieColorscalePicker.js": /*!**************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/PieColorscalePicker.js ***! \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _ColorscalePicker = _interopRequireDefault(__webpack_require__(/*! ../widgets/ColorscalePicker */ \"./node_modules/react-chart-editor/lib/components/widgets/ColorscalePicker.js\"));\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar UnconnectedPieColorscalePicker = /*#__PURE__*/function (_Component) {\n _inherits(UnconnectedPieColorscalePicker, _Component);\n\n var _super = _createSuper(UnconnectedPieColorscalePicker);\n\n function UnconnectedPieColorscalePicker(props) {\n var _this;\n\n _classCallCheck(this, UnconnectedPieColorscalePicker);\n\n _this = _super.call(this, props);\n _this.onUpdate = _this.onUpdate.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(UnconnectedPieColorscalePicker, [{\n key: \"onUpdate\",\n value: function onUpdate(colorscale, colorscaleType) {\n if (Array.isArray(colorscale)) {\n var numPieSlices = this.context.graphDiv.calcdata[0].length + 1;\n var adjustedColorscale = (0, _lib.adjustColorscale)(colorscale, numPieSlices, colorscaleType, {\n repeat: true\n });\n this.props.updatePlot(adjustedColorscale);\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var fullValue = this.props.fullValue;\n var colorscale = Array.isArray(fullValue) ? fullValue : null;\n return /*#__PURE__*/_react.default.createElement(_Field.default, this.props, /*#__PURE__*/_react.default.createElement(_ColorscalePicker.default, {\n selected: colorscale,\n onColorscaleChange: this.onUpdate,\n initialCategory: \"categorical\"\n }));\n }\n }]);\n\n return UnconnectedPieColorscalePicker;\n}(_react.Component);\n\nUnconnectedPieColorscalePicker.propTypes = _objectSpread({\n fullValue: _propTypes.default.any,\n updatePlot: _propTypes.default.func\n}, _Field.default.propTypes);\nUnconnectedPieColorscalePicker.contextTypes = {\n container: _propTypes.default.object,\n graphDiv: _propTypes.default.object\n};\nUnconnectedPieColorscalePicker.displayName = 'UnconnectedPieColorscalePicker';\n\nvar _default = (0, _lib.connectToContainer)(UnconnectedPieColorscalePicker, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n if (context && context.container && context.graphDiv && (!plotProps.fullValue || Array.isArray(plotProps.fullValue) && !plotProps.fullValue.length) && context.graphDiv.calcdata) {\n plotProps.fullValue = context.graphDiv.calcdata[0].map(function (d) {\n return d.color;\n });\n }\n\n if (context.traceIndexes.length > 1) {\n plotProps.isVisible = false;\n }\n }\n});\n\nexports.default = _default;\n//# sourceMappingURL=PieColorscalePicker.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/PieColorscalePicker.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/Radio.js": /*!************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/Radio.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.UnconnectedRadio = void 0;\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _RadioBlocks = _interopRequireDefault(__webpack_require__(/*! ../widgets/RadioBlocks */ \"./node_modules/react-chart-editor/lib/components/widgets/RadioBlocks.js\"));\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar UnconnectedRadio = /*#__PURE__*/function (_Component) {\n _inherits(UnconnectedRadio, _Component);\n\n var _super = _createSuper(UnconnectedRadio);\n\n function UnconnectedRadio() {\n _classCallCheck(this, UnconnectedRadio);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(UnconnectedRadio, [{\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react.default.createElement(_Field.default, this.props, /*#__PURE__*/_react.default.createElement(_RadioBlocks.default, {\n options: this.props.options,\n activeOption: this.props.fullValue,\n onOptionChange: this.props.updatePlot\n }));\n }\n }]);\n\n return UnconnectedRadio;\n}(_react.Component);\n\nexports.UnconnectedRadio = UnconnectedRadio;\nUnconnectedRadio.propTypes = _objectSpread({\n center: _propTypes.default.bool,\n fullValue: _propTypes.default.any,\n options: _propTypes.default.array.isRequired,\n updatePlot: _propTypes.default.func\n}, _Field.default.propTypes); // for better appearance overrides {center: false}\n// default prop. This can be overridden manually using props for .\n\nUnconnectedRadio.defaultProps = {\n center: true\n};\nUnconnectedRadio.displayName = 'UnconnectedRadio';\n\nvar _default = (0, _lib.connectToContainer)(UnconnectedRadio);\n\nexports.default = _default;\n//# sourceMappingURL=Radio.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/Radio.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/RectanglePositioner.js": /*!**************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/RectanglePositioner.js ***! \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _reactResizableRotatableDraggable = _interopRequireDefault(__webpack_require__(/*! react-resizable-rotatable-draggable */ \"./node_modules/react-resizable-rotatable-draggable/dist/index.es.js\"));\n\nvar _RadioBlocks = _interopRequireDefault(__webpack_require__(/*! ../widgets/RadioBlocks */ \"./node_modules/react-chart-editor/lib/components/widgets/RadioBlocks.js\"));\n\nvar _DualNumeric = _interopRequireDefault(__webpack_require__(/*! ./DualNumeric */ \"./node_modules/react-chart-editor/lib/components/fields/DualNumeric.js\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar maxWidth = 276;\nvar gridRes = 8;\n\nvar UnconnectedRectanglePositioner = /*#__PURE__*/function (_Component) {\n _inherits(UnconnectedRectanglePositioner, _Component);\n\n var _super = _createSuper(UnconnectedRectanglePositioner);\n\n function UnconnectedRectanglePositioner(props, context) {\n var _this;\n\n _classCallCheck(this, UnconnectedRectanglePositioner);\n\n _this = _super.call(this, props, context);\n _this.sendUpdate = _this.sendUpdate.bind(_assertThisInitialized(_this));\n _this.attr = _this.props.cartesian ? {\n x: ['xaxis.domain[0]', 'xaxis.domain[1]'],\n y: ['yaxis.domain[0]', 'yaxis.domain[1]']\n } : {\n x: ['domain.x[0]', 'domain.x[1]'],\n y: ['domain.y[0]', 'domain.y[1]']\n };\n _this.state = {\n snap: true\n };\n return _this;\n }\n\n _createClass(UnconnectedRectanglePositioner, [{\n key: \"sendUpdate\",\n value: function sendUpdate(_ref) {\n var x = _ref.x,\n y = _ref.y,\n width = _ref.width,\n height = _ref.height,\n fieldWidthPx = _ref.fieldWidthPx,\n fieldHeightPx = _ref.fieldHeightPx;\n var x0 = x / fieldWidthPx;\n var x1 = (width + x) / fieldWidthPx;\n var y0 = (fieldHeightPx - (height + y)) / fieldHeightPx;\n var y1 = (fieldHeightPx - y) / fieldHeightPx;\n var snap = this.state.snap ? function (v) {\n return Math.round(v * gridRes) / gridRes;\n } : function (v) {\n return v;\n };\n var payload = {};\n\n if (x0 >= 0 && x1 <= 1) {\n payload[this.attr.x[0]] = snap(x0);\n payload[this.attr.x[1]] = snap(x1);\n }\n\n if (y0 >= 0 && y1 <= 1) {\n payload[this.attr.y[0]] = snap(y0);\n payload[this.attr.y[1]] = snap(y1);\n }\n\n this.context.updateContainer(payload);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _this$props = this.props,\n attr = _this$props.attr,\n cartesian = _this$props.cartesian;\n var _this$context = this.context,\n _ = _this$context.localize,\n fullContainer = _this$context.fullContainer,\n _this$context$fullLay = _this$context.fullLayout,\n plotWidthPx = _this$context$fullLay.width,\n plotHeightPx = _this$context$fullLay.height;\n var x = cartesian ? fullContainer.xaxis.domain : fullContainer.domain.x;\n var y = cartesian ? fullContainer.yaxis.domain : fullContainer.domain.y;\n var aspectRatio = plotHeightPx / plotWidthPx;\n var fieldWidthPx = Math.min(maxWidth, maxWidth / aspectRatio);\n var fieldHeightPx = Math.min(maxWidth, maxWidth * aspectRatio);\n var width = fieldWidthPx * (x[1] - x[0]);\n var height = fieldHeightPx * (y[1] - y[0]);\n var left = fieldWidthPx * x[0];\n var top = fieldHeightPx * (1 - y[1]);\n var zoomable = '';\n\n if (!fullContainer.xaxis || !fullContainer.yaxis || !fullContainer.xaxis.overlaying && !fullContainer.yaxis.overlaying) {\n zoomable = 'n, w, s, e, nw, ne, se, sw';\n } else if (!fullContainer.xaxis.overlaying) {\n zoomable = 'e, w';\n } else if (!fullContainer.yaxis.overlaying) {\n zoomable = 'n, s';\n }\n\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n style: {\n marginRight: 25\n }\n }, /*#__PURE__*/_react.default.createElement(_Field.default, _extends({}, this.props, {\n attr: attr\n }), /*#__PURE__*/_react.default.createElement(_Field.default, {\n label: _('Snap to Grid')\n }, /*#__PURE__*/_react.default.createElement(_RadioBlocks.default, {\n alignment: \"center\",\n onOptionChange: function onOptionChange(snap) {\n return _this2.setState({\n snap: snap\n });\n },\n activeOption: this.state.snap,\n options: [{\n label: _('On'),\n value: true\n }, {\n label: _('Off'),\n value: false\n }]\n })), /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"rect-container\",\n style: {\n width: fieldWidthPx + 1,\n height: fieldHeightPx + 1\n }\n }, Array(gridRes * gridRes).fill(0).map(function (v, i) {\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n key: i,\n className: \"rect-grid\",\n style: {\n width: fieldWidthPx / gridRes - 1,\n height: fieldHeightPx / gridRes - 1,\n borderBottom: i < gridRes * (gridRes - 1) ? '0' : '1px solid ',\n borderRight: (i + 1) % gridRes ? '0' : '1px solid'\n }\n });\n }), /*#__PURE__*/_react.default.createElement(_reactResizableRotatableDraggable.default, {\n bounds: \"parent\",\n width: width,\n height: height,\n left: left,\n top: top,\n rotatable: false,\n draggable: !this.state.snap,\n zoomable: zoomable,\n onResize: function onResize(style) {\n _this2.sendUpdate({\n fieldWidthPx: fieldWidthPx,\n fieldHeightPx: fieldHeightPx,\n width: style.width,\n height: style.height,\n x: style.left,\n y: style.top\n });\n },\n onDrag: function onDrag(deltaX, deltaY) {\n _this2.sendUpdate({\n fieldWidthPx: fieldWidthPx,\n fieldHeightPx: fieldHeightPx,\n width: width,\n height: height,\n x: left + deltaX,\n y: top + deltaY\n });\n }\n })), fullContainer.xaxis && fullContainer.xaxis.overlaying ? '' : /*#__PURE__*/_react.default.createElement(_DualNumeric.default, {\n label: _('X'),\n attr: this.attr.x[0],\n attr2: this.attr.x[1],\n percentage: true,\n step: 1,\n min: 0,\n max: 100\n }), fullContainer.yaxis && fullContainer.yaxis.overlaying ? '' : /*#__PURE__*/_react.default.createElement(_DualNumeric.default, {\n label: _('Y'),\n attr: this.attr.y[0],\n attr2: this.attr.y[1],\n percentage: true,\n step: 1,\n min: 0,\n max: 100\n })));\n }\n }]);\n\n return UnconnectedRectanglePositioner;\n}(_react.Component);\n\nUnconnectedRectanglePositioner.propTypes = _objectSpread({\n fullValue: _propTypes.default.any,\n updatePlot: _propTypes.default.func,\n cartesian: _propTypes.default.bool\n}, _Field.default.propTypes);\nUnconnectedRectanglePositioner.contextTypes = {\n localize: _propTypes.default.func,\n updateContainer: _propTypes.default.func,\n fullContainer: _propTypes.default.object,\n fullLayout: _propTypes.default.object\n};\nUnconnectedRectanglePositioner.displayName = 'UnconnectedRectanglePositioner';\n\nvar _default = (0, _lib.connectToContainer)(UnconnectedRectanglePositioner);\n\nexports.default = _default;\n//# sourceMappingURL=RectanglePositioner.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/RectanglePositioner.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/SubplotCreator.js": /*!*********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/SubplotCreator.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _Dropdown = _interopRequireDefault(__webpack_require__(/*! ./Dropdown */ \"./node_modules/react-chart-editor/lib/components/fields/Dropdown.js\"));\n\nvar _Info = _interopRequireDefault(__webpack_require__(/*! ./Info */ \"./node_modules/react-chart-editor/lib/components/fields/Info.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _constants = __webpack_require__(/*! ../../lib/constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nvar _Button = _interopRequireDefault(__webpack_require__(/*! ../widgets/Button */ \"./node_modules/react-chart-editor/lib/components/widgets/Button.js\"));\n\nvar _plotlyIcons = __webpack_require__(/*! plotly-icons */ \"./node_modules/plotly-icons/lib/index.js\");\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _2 = __webpack_require__(/*! ./.. */ \"./node_modules/react-chart-editor/lib/components/index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar UnconnectedSingleSubplotCreator = /*#__PURE__*/function (_Component) {\n _inherits(UnconnectedSingleSubplotCreator, _Component);\n\n var _super = _createSuper(UnconnectedSingleSubplotCreator);\n\n function UnconnectedSingleSubplotCreator() {\n _classCallCheck(this, UnconnectedSingleSubplotCreator);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(UnconnectedSingleSubplotCreator, [{\n key: \"canAddSubplot\",\n value: function canAddSubplot() {\n var _this = this;\n\n var currentAxisId = this.props.fullContainer[this.props.attr];\n var currentTraceIndex = this.props.fullContainer.index;\n return this.context.fullData.some(function (d) {\n return d.index !== currentTraceIndex && d[_this.props.attr] === currentAxisId;\n });\n }\n }, {\n key: \"addAndUpdateSubplot\",\n value: function addAndUpdateSubplot() {\n var _this$props = this.props,\n attr = _this$props.attr,\n layoutAttr = _this$props.layoutAttr,\n updateContainer = _this$props.updateContainer;\n var subplots = this.context.fullLayout._subplots;\n var lastSubplotNumber = Number(subplots[layoutAttr][subplots[layoutAttr].length - 1].split(_constants.SUBPLOT_TO_ATTR[layoutAttr].layout)[1]) || 1;\n updateContainer(_defineProperty({}, attr, _constants.SUBPLOT_TO_ATTR[layoutAttr].layout + (lastSubplotNumber + 1)));\n }\n }, {\n key: \"updateSubplot\",\n value: function updateSubplot(update) {\n var _this2 = this;\n\n var currentSubplotId = this.props.fullContainer[_constants.SUBPLOT_TO_ATTR[this.props.layoutAttr].data];\n var subplotToBeGarbageCollected = null; // When we select another subplot, make sure no unused axes are left\n\n if (currentSubplotId !== update && !this.context.fullData.some(function (trace) {\n return trace[_constants.SUBPLOT_TO_ATTR[_this2.props.layoutAttr].data] === currentSubplotId && trace.index !== _this2.props.fullContainer.index;\n })) {\n subplotToBeGarbageCollected = currentSubplotId;\n }\n\n this.context.onUpdate({\n type: _constants.EDITOR_ACTIONS.UPDATE_TRACES,\n payload: {\n subplotToBeGarbageCollected: subplotToBeGarbageCollected,\n update: _defineProperty({}, this.props.attr, update),\n traceIndexes: [this.props.fullContainer.index]\n }\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this3 = this;\n\n var icon = /*#__PURE__*/_react.default.createElement(_plotlyIcons.PlusIcon, null);\n\n var extraComponent = this.canAddSubplot() ? /*#__PURE__*/_react.default.createElement(_Button.default, {\n variant: \"no-text\",\n icon: icon,\n onClick: function onClick() {\n return _this3.addAndUpdateSubplot();\n }\n }) : /*#__PURE__*/_react.default.createElement(_Button.default, {\n variant: \"no-text--disabled\",\n icon: icon,\n onClick: function onClick() {}\n });\n return /*#__PURE__*/_react.default.createElement(_Dropdown.default, {\n label: this.props.label,\n attr: this.props.attr,\n clearable: false,\n options: this.props.options,\n updatePlot: function updatePlot(u) {\n return _this3.updateSubplot(u);\n },\n extraComponent: extraComponent\n });\n }\n }]);\n\n return UnconnectedSingleSubplotCreator;\n}(_react.Component);\n\nUnconnectedSingleSubplotCreator.propTypes = {\n attr: _propTypes.default.string,\n layoutAttr: _propTypes.default.string,\n label: _propTypes.default.string,\n options: _propTypes.default.array,\n container: _propTypes.default.object,\n fullContainer: _propTypes.default.object,\n updateContainer: _propTypes.default.func\n};\nUnconnectedSingleSubplotCreator.contextTypes = {\n fullLayout: _propTypes.default.object,\n data: _propTypes.default.array,\n fullData: _propTypes.default.array,\n onUpdate: _propTypes.default.func\n};\nvar SingleSubplotCreator = (0, _lib.connectToContainer)(UnconnectedSingleSubplotCreator);\n\nvar UnconnectedSubplotCreator = /*#__PURE__*/function (_Component2) {\n _inherits(UnconnectedSubplotCreator, _Component2);\n\n var _super2 = _createSuper(UnconnectedSubplotCreator);\n\n function UnconnectedSubplotCreator() {\n _classCallCheck(this, UnconnectedSubplotCreator);\n\n return _super2.apply(this, arguments);\n }\n\n _createClass(UnconnectedSubplotCreator, [{\n key: \"render\",\n value: function render() {\n var _this4 = this;\n\n var subplotType = (0, _lib.traceTypeToAxisType)(this.props.container.type);\n\n if (!['geo', 'mapbox', 'polar', 'gl3d', 'ternary'].some(function (t) {\n return t === subplotType;\n })) {\n return null;\n }\n\n var isFirstTraceOfAxisType = this.context.data.filter(function (d) {\n return (0, _lib.traceTypeToAxisType)(d.type) === subplotType;\n }).length === 1;\n\n if (isFirstTraceOfAxisType) {\n return null;\n }\n\n var _this$context = this.context,\n fullLayout = _this$context.fullLayout,\n _ = _this$context.localize;\n\n function getOptions(subplotType) {\n return fullLayout._subplots[subplotType].map(function (subplotId) {\n return {\n label: (0, _lib.getSubplotTitle)(subplotId, subplotType, _),\n value: subplotId\n };\n });\n }\n\n return /*#__PURE__*/_react.default.createElement(_2.PlotlySection, {\n name: _('Subplots to Use')\n }, /*#__PURE__*/_react.default.createElement(SingleSubplotCreator, {\n attr: _constants.SUBPLOT_TO_ATTR[subplotType].data,\n layoutAttr: subplotType,\n label: (0, _constants.subplotName)(_constants.SUBPLOT_TO_ATTR[subplotType].layout, _),\n options: getOptions(subplotType)\n }), /*#__PURE__*/_react.default.createElement(_Info.default, null, _('You can style and position your subplots in the '), /*#__PURE__*/_react.default.createElement(\"a\", {\n onClick: function onClick() {\n return _this4.context.setPanel('Structure', 'Subplots');\n }\n }, _('Subplots')), _(' panel.')));\n }\n }]);\n\n return UnconnectedSubplotCreator;\n}(_react.Component);\n\nUnconnectedSubplotCreator.propTypes = {\n container: _propTypes.default.object,\n fullContainer: _propTypes.default.object\n};\nUnconnectedSubplotCreator.contextTypes = {\n data: _propTypes.default.array,\n fullData: _propTypes.default.array,\n fullLayout: _propTypes.default.object,\n localize: _propTypes.default.func,\n setPanel: _propTypes.default.func\n};\n\nvar _default = (0, _lib.connectToContainer)(UnconnectedSubplotCreator, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n var data = context.data;\n var fullContainer = plotProps.fullContainer;\n plotProps.isVisible = data.length > 1 && data[fullContainer.index] && ['geo', 'mapbox', 'polar', 'gl3d', 'ternary'].some(function (t) {\n return t === (0, _lib.traceTypeToAxisType)(data[fullContainer.index].type);\n });\n }\n});\n\nexports.default = _default;\n//# sourceMappingURL=SubplotCreator.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/SubplotCreator.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/SymbolSelector.js": /*!*********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/SymbolSelector.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _SymbolSelector = _interopRequireDefault(__webpack_require__(/*! ../widgets/SymbolSelector */ \"./node_modules/react-chart-editor/lib/components/widgets/SymbolSelector.js\"));\n\nvar _nested_property = _interopRequireDefault(__webpack_require__(/*! plotly.js/src/lib/nested_property */ \"./node_modules/plotly.js/src/lib/nested_property.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _constants = __webpack_require__(/*! ../../lib/constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n// TODO compute these from plotly.js\nvar SYMBOLS = [{\n value: 'circle',\n label: 'M5,0A5,5 0 1,1 0,-5A5,5 0 0,1 5,0Z',\n threeD: true,\n gl: true\n}, {\n value: 'circle-open',\n label: 'M5,0A5,5 0 1,1 0,-5A5,5 0 0,1 5,0Z',\n fill: 'none',\n threeD: true,\n gl: true\n}, {\n value: 'circle-open-dot',\n label: 'M5,0A5,5 0 1,1 0,-5A5,5 0 0,1 5,0ZM0,0.5L0.5,0L0,-0.5L-0.5,0Z',\n fill: 'none'\n}, {\n value: 'square',\n label: 'M5,5H-5V-5H5Z',\n threeD: true,\n gl: true\n}, {\n value: 'square-open',\n label: 'M5,5H-5V-5H5Z',\n fill: 'none',\n threeD: true,\n gl: true\n}, {\n value: 'square-open-dot',\n label: 'M5,5H-5V-5H5ZM0,0.5L0.5,0L0,-0.5L-0.5,0Z',\n fill: 'none'\n}, {\n value: 'diamond',\n label: 'M6.5,0L0,6.5L-6.5,0L0,-6.5Z',\n threeD: true,\n gl: true\n}, {\n value: 'diamond-open',\n label: 'M6.5,0L0,6.5L-6.5,0L0,-6.5Z',\n fill: 'none',\n threeD: true,\n gl: true\n}, {\n value: 'diamond-open-dot',\n label: 'M6.5,0L0,6.5L-6.5,0L0,-6.5ZM0,0.5L0.5,0L0,-0.5L-0.5,0Z',\n fill: 'none'\n}, {\n value: 'cross',\n label: 'M6,2H2V6H-2V2H-6V-2H-2V-6H2V-2H6Z',\n threeD: true,\n gl: true\n}, {\n value: 'cross-open',\n label: 'M6,2H2V6H-2V2H-6V-2H-2V-6H2V-2H6Z',\n fill: 'none',\n gl: true\n}, {\n value: 'x',\n label: 'M0,2.83l2.83,2.83l2.83,-2.83l-2.83,-2.83l2.83,-2.83l-2.83,-2.83l-2.83,2.83l-2.83,-2.83l-2.83,2.83l2.83,2.83l-2.83,2.83l2.83,2.83Z',\n threeD: true,\n gl: true\n}, {\n value: 'x-open',\n label: 'M0,2.83l2.83,2.83l2.83,-2.83l-2.83,-2.83l2.83,-2.83l-2.83,-2.83l-2.83,2.83l-2.83,-2.83l-2.83,2.83l2.83,2.83l-2.83,2.83l2.83,2.83Z',\n fill: 'none',\n gl: true\n}, {\n value: 'triangle-up',\n label: 'M-5.77,2.5H5.77L0,-5Z',\n gl: true\n}, {\n value: 'triangle-up-open',\n label: 'M-5.77,2.5H5.77L0,-5Z',\n fill: 'none',\n gl: true\n}, {\n value: 'triangle-down',\n label: 'M-5.77,-2.5H5.77L0,5Z',\n gl: true\n}, {\n value: 'triangle-down-open',\n label: 'M-5.77,-2.5H5.77L0,5Z',\n fill: 'none',\n gl: true\n}, {\n value: 'triangle-left',\n label: 'M2.5,-5.77V5.77L-5,0Z',\n gl: true\n}, {\n value: 'triangle-left-open',\n label: 'M2.5,-5.77V5.77L-5,0Z',\n fill: 'none',\n gl: true\n}, {\n value: 'triangle-right',\n label: 'M-2.5,-5.77V5.77L5,0Z',\n gl: true\n}, {\n value: 'triangle-right-open',\n label: 'M-2.5,-5.77V5.77L5,0Z',\n fill: 'none',\n gl: true\n}, {\n value: 'triangle-ne',\n label: 'M-6,-3H3V6Z',\n gl: true\n}, {\n value: 'triangle-ne-open',\n label: 'M-6,-3H3V6Z',\n fill: 'none',\n gl: true\n}, {\n value: 'triangle-se',\n label: 'M3,-6V3H-6Z',\n gl: true\n}, {\n value: 'triangle-se-open',\n label: 'M3,-6V3H-6Z',\n fill: 'none',\n gl: true\n}, {\n value: 'triangle-sw',\n label: 'M6,3H-3V-6Z',\n gl: true\n}, {\n value: 'triangle-sw-open',\n label: 'M6,3H-3V-6Z',\n fill: 'none',\n gl: true\n}, {\n value: 'triangle-nw',\n label: 'M-3,6V-3H6Z',\n gl: true\n}, {\n value: 'triangle-nw-open',\n label: 'M-3,6V-3H6Z',\n fill: 'none',\n gl: true\n}, {\n value: 'pentagon',\n label: 'M4.76,-1.54L2.94,4.05H-2.94L-4.76,-1.54L0,-5Z',\n gl: true\n}, {\n value: 'pentagon-open',\n label: 'M4.76,-1.54L2.94,4.05H-2.94L-4.76,-1.54L0,-5Z',\n fill: 'none',\n gl: true\n}, {\n value: 'hexagon',\n label: 'M4.33,-2.5V2.5L0,5L-4.33,2.5V-2.5L0,-5Z',\n gl: true\n}, {\n value: 'hexagon-open',\n label: 'M4.33,-2.5V2.5L0,5L-4.33,2.5V-2.5L0,-5Z',\n fill: 'none',\n gl: true\n}, {\n value: 'hexagon2',\n label: 'M-2.5,4.33H2.5L5,0L2.5,-4.33H-2.5L-5,0Z',\n gl: true\n}, {\n value: 'hexagon2-open',\n label: 'M-2.5,4.33H2.5L5,0L2.5,-4.33H-2.5L-5,0Z',\n fill: 'none',\n gl: true\n}, {\n value: 'octagon',\n label: 'M-1.92,-4.62H1.92L4.62,-1.92V1.92L1.92,4.62H-1.92L-4.62,1.92V-1.92Z'\n}, {\n value: 'octagon-open',\n label: 'M-1.92,-4.62H1.92L4.62,-1.92V1.92L1.92,4.62H-1.92L-4.62,1.92V-1.92Z',\n fill: 'none'\n}, {\n value: 'star',\n label: 'M1.58,-2.16H6.66L2.54,0.83L4.12,5.66L0,2.67L-4.12,5.66L-2.54,0.83L-6.66,-2.16H-1.58L0,-7Z',\n gl: true\n}, {\n value: 'star-open',\n alias: 17,\n label: 'M1.58,-2.16H6.66L2.54,0.83L4.12,5.66L0,2.67L-4.12,5.66L-2.54,0.83L-6.66,-2.16H-1.58L0,-7Z',\n fill: 'none',\n gl: true\n}, {\n value: 'hexagram',\n label: 'M-3.8,0l-1.9,-3.3h3.8l1.9,-3.3l1.9,3.3h3.8l-1.9,3.3l1.9,3.3h-3.8l-1.9,3.3l-1.9,-3.3h-3.8Z'\n}, {\n value: 'hexagram-open',\n label: 'M-3.8,0l-1.9,-3.3h3.8l1.9,-3.3l1.9,3.3h3.8l-1.9,3.3l1.9,3.3h-3.8l-1.9,3.3l-1.9,-3.3h-3.8Z',\n fill: 'none'\n}, {\n value: 'star-triangle-up',\n label: 'M-6.93,4A 20,20 0 0 1 6.93,4A 20,20 0 0 1 0,-8A 20,20 0 0 1 -6.93,4Z'\n}, {\n value: 'star-triangle-up-open',\n label: 'M-6.93,4A 20,20 0 0 1 6.93,4A 20,20 0 0 1 0,-8A 20,20 0 0 1 -6.93,4Z',\n fill: 'none'\n}, {\n value: 'star-triangle-down',\n label: 'M6.93,-4A 20,20 0 0 1 -6.93,-4A 20,20 0 0 1 0,8A 20,20 0 0 1 6.93,-4Z'\n}, {\n value: 'star-triangle-down-open',\n label: 'M6.93,-4A 20,20 0 0 1 -6.93,-4A 20,20 0 0 1 0,8A 20,20 0 0 1 6.93,-4Z',\n fill: 'none'\n}, {\n value: 'star-square',\n label: 'M-5.5,-5.5A 10,10 0 0 1 -5.5,5.5A 10,10 0 0 1 5.5,5.5A 10,10 0 0 1 5.5,-5.5A 10,10 0 0 1 -5.5,-5.5Z'\n}, {\n value: 'star-square-open',\n label: 'M-5.5,-5.5A 10,10 0 0 1 -5.5,5.5A 10,10 0 0 1 5.5,5.5A 10,10 0 0 1 5.5,-5.5A 10,10 0 0 1 -5.5,-5.5Z',\n fill: 'none'\n}, {\n value: 'star-diamond',\n label: 'M-7,0A 9.5,9.5 0 0 1 0,7A 9.5,9.5 0 0 1 7,0A 9.5,9.5 0 0 1 0,-7A 9.5,9.5 0 0 1 -7,0Z'\n}, {\n value: 'star-diamond-open',\n label: 'M-7,0A 9.5,9.5 0 0 1 0,7A 9.5,9.5 0 0 1 7,0A 9.5,9.5 0 0 1 0,-7A 9.5,9.5 0 0 1 -7,0Z',\n fill: 'none'\n}, {\n value: 'diamond-tall',\n label: 'M0,7L3.5,0L0,-7L-3.5,0Z',\n gl: true\n}, {\n value: 'diamond-tall-open',\n label: 'M0,7L3.5,0L0,-7L-3.5,0Z',\n fill: 'none',\n gl: true\n}, {\n value: 'diamond-wide',\n label: 'M0,3.5L7,0L0,-3.5L-7,0Z'\n}, {\n value: 'diamond-wide-open',\n label: 'M0,3.5L7,0L0,-3.5L-7,0Z',\n fill: 'none'\n}, {\n value: 'hourglass',\n label: 'M5,5H-5L5,-5H-5Z'\n}, {\n value: 'bowtie',\n label: 'M5,5V-5L-5,5V-5Z',\n gl: true\n}, {\n value: 'cross-thin-open',\n label: 'M0,7V-7M7,0H-7',\n fill: 'none',\n gl: true\n}, {\n value: 'x-thin-open',\n label: 'M5,5L-5,-5M5,-5L-5,5',\n fill: 'none'\n}, {\n value: 'asterisk-open',\n label: 'M0,6V-6M6,0H-6M4.25,4.25L-4.25,-4.25M4.25,-4.25L-4.25,4.25',\n fill: 'none',\n gl: true\n}, {\n value: 'hash-open',\n label: 'M2.5,5V-5m-5,0V5M5,2.5H-5m0,-5H5',\n fill: 'none'\n}, {\n value: 'hash-open-dot',\n label: 'M2.5,5V-5m-5,0V5M5,2.5H-5m0,-5H5M0,0.5L0.5,0L0,-0.5L-0.5,0Z',\n fill: 'none'\n}, {\n value: 'y-up-open',\n label: 'M-6,4L0,0M6,4L0,0M0,-8L0,0',\n fill: 'none',\n gl: true\n}, {\n value: 'y-down-open',\n label: 'M-6,-4L0,0M6,-4L0,0M0,8L0,0',\n fill: 'none',\n gl: true\n}, {\n value: 'y-left-open',\n label: 'M4,6L0,0M4,-6L0,0M-8,0L0,0',\n fill: 'none'\n}, {\n value: 'y-right-open',\n label: 'M-4,6L0,0M-4,-6L0,0M8,0L0,0',\n fill: 'none'\n}, {\n value: 'line-ew-open',\n label: 'M7,0H-7',\n fill: 'none',\n gl: true\n}, {\n value: 'line-ns-open',\n label: 'M0,7V-7',\n fill: 'none',\n gl: true\n}, {\n value: 'line-ne-open',\n label: 'M5,-5L-5,5',\n fill: 'none'\n}, {\n value: 'line-nw-open',\n label: 'M5,5L-5,-5',\n fill: 'none'\n}];\n\nvar SymbolSelector = /*#__PURE__*/function (_Component) {\n _inherits(SymbolSelector, _Component);\n\n var _super = _createSuper(SymbolSelector);\n\n function SymbolSelector(props, context) {\n var _this;\n\n _classCallCheck(this, SymbolSelector);\n\n _this = _super.call(this, props, context);\n\n _this.setLocals(props, context);\n\n return _this;\n }\n\n _createClass(SymbolSelector, [{\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n }, {\n key: \"setLocals\",\n value: function setLocals(props, context) {\n var fullContainer = props.fullContainer;\n var defaultContainer = context.defaultContainer;\n this.markerColor = (0, _nested_property.default)(fullContainer, 'marker.color').get();\n this.borderWidth = (0, _nested_property.default)(fullContainer, 'marker.line.width').get();\n\n if (this.markerColor === _constants.MULTI_VALUED) {\n this.markerColor = (0, _nested_property.default)(defaultContainer, 'marker.color').get();\n }\n\n this.markerColor = Array.isArray(this.markerColor) ? _constants.COLORS.mutedBlue : this.markerColor;\n this.borderColor = this.markerColor;\n\n if (this.borderWidth) {\n this.borderColor = (0, _nested_property.default)(fullContainer, 'marker.line.color').get();\n\n if (this.borderColor === _constants.MULTI_VALUED) {\n this.borderColor = (0, _nested_property.default)(defaultContainer, 'marker.line.color').get();\n }\n }\n\n this.borderColor = Array.isArray(this.borderColor) ? _constants.COLORS.charcoal : this.borderColor;\n this.symbolOptions = this.props.container.type === 'scatter3d' ? SYMBOLS.filter(function (option) {\n return option.threeD;\n }) : [].concat(SYMBOLS);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n fullValue = _this$props.fullValue,\n updatePlot = _this$props.updatePlot;\n return /*#__PURE__*/_react.default.createElement(_Field.default, this.props, /*#__PURE__*/_react.default.createElement(_SymbolSelector.default, {\n markerColor: this.markerColor,\n borderColor: this.borderColor,\n value: fullValue,\n onChange: updatePlot,\n symbolOptions: this.symbolOptions,\n backgroundDark: (0, _lib.tooLight)(this.markerColor)\n }));\n }\n }]);\n\n return SymbolSelector;\n}(_react.Component);\n\nSymbolSelector.propTypes = _objectSpread({\n defaultValue: _propTypes.default.string,\n fullValue: _propTypes.default.any,\n updatePlot: _propTypes.default.func\n}, _Field.default.propTypes);\nSymbolSelector.contextTypes = {\n defaultContainer: _propTypes.default.object\n};\nSymbolSelector.defaultProps = {\n showArrows: true\n};\n\nvar _default = (0, _lib.connectToContainer)(SymbolSelector);\n\nexports.default = _default;\n//# sourceMappingURL=SymbolSelector.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/SymbolSelector.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/Text.js": /*!***********************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/Text.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.UnconnectedText = void 0;\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _TextInput = _interopRequireDefault(__webpack_require__(/*! ../widgets/TextInput */ \"./node_modules/react-chart-editor/lib/components/widgets/TextInput.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar UnconnectedText = /*#__PURE__*/function (_Component) {\n _inherits(UnconnectedText, _Component);\n\n var _super = _createSuper(UnconnectedText);\n\n function UnconnectedText() {\n _classCallCheck(this, UnconnectedText);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(UnconnectedText, [{\n key: \"render\",\n value: function render() {\n var fullValue = this.props.fullValue;\n var placeholder;\n\n if (this.props.multiValued) {\n placeholder = fullValue;\n fullValue = '';\n }\n\n return /*#__PURE__*/_react.default.createElement(_Field.default, this.props, /*#__PURE__*/_react.default.createElement(_TextInput.default, {\n value: fullValue,\n defaultValue: this.props.defaultValue,\n placeholder: placeholder,\n onUpdate: this.props.updatePlot,\n onChange: this.props.onChange\n }));\n }\n }]);\n\n return UnconnectedText;\n}(_react.Component);\n\nexports.UnconnectedText = UnconnectedText;\nUnconnectedText.propTypes = _objectSpread({\n defaultValue: _propTypes.default.any,\n fullValue: _propTypes.default.any,\n multiValued: _propTypes.default.bool,\n updatePlot: _propTypes.default.func,\n onChange: _propTypes.default.func\n}, _Field.default.propTypes);\nUnconnectedText.displayName = 'UnconnectedText';\n\nvar _default = (0, _lib.connectToContainer)(UnconnectedText);\n\nexports.default = _default;\n//# sourceMappingURL=Text.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/Text.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/TextEditor.js": /*!*****************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/TextEditor.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.UnconnectedTextEditor = void 0;\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _nested_property = _interopRequireDefault(__webpack_require__(/*! plotly.js/src/lib/nested_property */ \"./node_modules/plotly.js/src/lib/nested_property.js\"));\n\nvar _LaTeX = _interopRequireDefault(__webpack_require__(/*! ../widgets/text_editors/LaTeX */ \"./node_modules/react-chart-editor/lib/components/widgets/text_editors/LaTeX.js\"));\n\nvar _RichText = _interopRequireDefault(__webpack_require__(/*! ../widgets/text_editors/RichText */ \"./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/index.js\"));\n\nvar _MultiFormat = _interopRequireDefault(__webpack_require__(/*! ../widgets/text_editors/MultiFormat */ \"./node_modules/react-chart-editor/lib/components/widgets/text_editors/MultiFormat.js\"));\n\nvar _HTML = _interopRequireDefault(__webpack_require__(/*! ../widgets/text_editors/HTML */ \"./node_modules/react-chart-editor/lib/components/widgets/text_editors/HTML.js\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n// TODO: import plotly.js regex directly: https://github.com/plotly/plotly.js/issues/3520\nvar TEMPLATE_STRING_REGEX = /%{([^\\s%{}:]*)(:[^}]*)?}/g;\nvar INDEX_IN_TEMPLATE_STRING_REGEX = /%{(meta(\\[(\\d+)]))}/;\n\nvar UnconnectedTextEditor = /*#__PURE__*/function (_Component) {\n _inherits(UnconnectedTextEditor, _Component);\n\n var _super = _createSuper(UnconnectedTextEditor);\n\n function UnconnectedTextEditor() {\n _classCallCheck(this, UnconnectedTextEditor);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(UnconnectedTextEditor, [{\n key: \"hasTemplateStrings\",\n value: function hasTemplateStrings(value) {\n if (!value) {\n return false;\n }\n\n return value.match(TEMPLATE_STRING_REGEX);\n }\n }, {\n key: \"updatePlot\",\n value: function updatePlot(value) {\n var updatePlot = this.props.updatePlot;\n var templateStrings = this.hasTemplateStrings(value);\n var adjustedValue = value;\n\n if (templateStrings) {\n adjustedValue = adjustedValue.replace(TEMPLATE_STRING_REGEX, function (match) {\n var index = INDEX_IN_TEMPLATE_STRING_REGEX.exec(match);\n\n if (index) {\n var adjustedIndex = parseInt(index[3], 10) - 1;\n\n if (!isNaN(adjustedIndex)) {\n return \"%{meta[\".concat(adjustedIndex < 0 ? 0 : adjustedIndex, \"]}\");\n }\n }\n\n return match;\n });\n }\n\n updatePlot(adjustedValue);\n }\n }, {\n key: \"getAdjustedFullValue\",\n value: function getAdjustedFullValue(fullValue) {\n var templateStrings = this.hasTemplateStrings(fullValue);\n\n if (templateStrings) {\n return fullValue.replace(TEMPLATE_STRING_REGEX, function (match) {\n var index = INDEX_IN_TEMPLATE_STRING_REGEX.exec(match);\n\n if (index) {\n var adjustedIndex = parseInt(index[3], 10) + 1;\n\n if (!isNaN(adjustedIndex)) {\n return \"%{meta[\".concat(adjustedIndex, \"]}\");\n }\n\n return match;\n }\n\n return match;\n });\n }\n\n return fullValue;\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n attr = _this$props.attr,\n container = _this$props.container,\n htmlOnly = _this$props.htmlOnly,\n latexOnly = _this$props.latexOnly,\n multiValued = _this$props.multiValued,\n richTextOnly = _this$props.richTextOnly;\n var _ = this.context.localize;\n var fullValue = this.getAdjustedFullValue(this.props.fullValue);\n var placeholder = this.props.placeholder;\n\n if (multiValued || fullValue && (!container || !(0, _nested_property.default)(container, attr))) {\n placeholder = fullValue;\n fullValue = '';\n }\n\n var editor;\n\n if (latexOnly) {\n placeholder = _('Enter LaTeX formatted text');\n editor = /*#__PURE__*/_react.default.createElement(_LaTeX.default, {\n value: fullValue,\n placeholder: placeholder,\n onChange: this.updatePlot.bind(this)\n });\n } else if (richTextOnly) {\n editor = /*#__PURE__*/_react.default.createElement(_RichText.default, {\n value: fullValue,\n placeholder: placeholder,\n onChange: this.updatePlot.bind(this)\n });\n } else if (htmlOnly) {\n placeholder = _('Enter html formatted text');\n editor = /*#__PURE__*/_react.default.createElement(_HTML.default, {\n value: fullValue,\n placeholder: placeholder,\n onChange: this.updatePlot.bind(this)\n });\n } else {\n editor = /*#__PURE__*/_react.default.createElement(_MultiFormat.default, {\n value: fullValue,\n placeholder: placeholder,\n onChange: this.updatePlot.bind(this)\n });\n }\n\n return /*#__PURE__*/_react.default.createElement(_Field.default, this.props, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"text-editor\"\n }, editor));\n }\n }]);\n\n return UnconnectedTextEditor;\n}(_react.Component);\n\nexports.UnconnectedTextEditor = UnconnectedTextEditor;\nUnconnectedTextEditor.propTypes = _objectSpread(_objectSpread({}, _Field.default.propTypes), {}, {\n fullValue: _propTypes.default.any,\n htmlOnly: _propTypes.default.bool,\n latexOnly: _propTypes.default.bool,\n richTextOnly: _propTypes.default.bool,\n updatePlot: _propTypes.default.func,\n placeholder: _propTypes.default.string\n});\nUnconnectedTextEditor.contextTypes = {\n localize: _propTypes.default.func,\n fullLayout: _propTypes.default.object\n};\nUnconnectedTextEditor.displayName = 'UnconnectedTextEditor';\n\nvar _default = (0, _lib.connectToContainer)(UnconnectedTextEditor, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n if (plotProps.isVisible && plotProps.multiValued) {\n plotProps.isVisible = false;\n }\n\n if (context.fullLayout && context.fullLayout._dfltTitle && Object.values(context.fullLayout._dfltTitle).includes(plotProps.fullValue)) {\n plotProps.placeholder = plotProps.fullValue;\n plotProps.fullValue = '';\n }\n }\n});\n\nexports.default = _default;\n//# sourceMappingURL=TextEditor.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/TextEditor.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/TextPosition.js": /*!*******************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/TextPosition.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.UnconnectedTextPosition = void 0;\n\nvar _Dropdown = _interopRequireDefault(__webpack_require__(/*! ./Dropdown */ \"./node_modules/react-chart-editor/lib/components/fields/Dropdown.js\"));\n\nvar _RadioBlocks = _interopRequireDefault(__webpack_require__(/*! ../widgets/RadioBlocks */ \"./node_modules/react-chart-editor/lib/components/widgets/RadioBlocks.js\"));\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _Info = _interopRequireDefault(__webpack_require__(/*! ./Info */ \"./node_modules/react-chart-editor/lib/components/fields/Info.js\"));\n\nvar _DataSelector = _interopRequireDefault(__webpack_require__(/*! ./DataSelector */ \"./node_modules/react-chart-editor/lib/components/fields/DataSelector.js\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar UnconnectedTextPosition = /*#__PURE__*/function (_Component) {\n _inherits(UnconnectedTextPosition, _Component);\n\n var _super = _createSuper(UnconnectedTextPosition);\n\n function UnconnectedTextPosition(props) {\n var _this;\n\n _classCallCheck(this, UnconnectedTextPosition);\n\n _this = _super.call(this, props);\n _this.state = {\n posType: typeof props.fullValue === 'string' ? 'simple' : 'custom'\n };\n return _this;\n }\n\n _createClass(UnconnectedTextPosition, [{\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _ = this.context.localize;\n var radioOptions = [{\n label: _('All'),\n value: 'simple'\n }, {\n label: _('Custom'),\n value: 'custom'\n }];\n var control = this.state.posType === 'simple' ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Info.default, null, _('This will position all text values on the plot according to the selected position.')), /*#__PURE__*/_react.default.createElement(_Dropdown.default, {\n options: this.props.options,\n attr: \"textposition\",\n clearable: false\n })) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Info.default, null, /*#__PURE__*/_react.default.createElement(\"div\", null, _('This will position text values individually, according to the provided data positions array. '))), /*#__PURE__*/_react.default.createElement(_DataSelector.default, {\n attr: \"textposition\"\n }), /*#__PURE__*/_react.default.createElement(_Info.default, null, /*#__PURE__*/_react.default.createElement(\"div\", null, _('(\"Top\", \"Middle\", \"Bottom\") + (\"Left\", \"Center\", \"Right\")'))));\n return /*#__PURE__*/_react.default.createElement(_Field.default, this.props, /*#__PURE__*/_react.default.createElement(_RadioBlocks.default, {\n options: radioOptions,\n activeOption: this.state.posType,\n onOptionChange: function onOptionChange(value) {\n _this2.setState({\n posType: value\n });\n\n if (value === 'simple') {\n _this2.props.updatePlot('middle center');\n } else {\n _this2.props.updateContainer({\n textpositionsrc: null\n });\n }\n }\n }), control);\n }\n }]);\n\n return UnconnectedTextPosition;\n}(_react.Component);\n\nexports.UnconnectedTextPosition = UnconnectedTextPosition;\nUnconnectedTextPosition.propTypes = _objectSpread(_objectSpread({}, _Field.default.propTypes), {}, {\n options: _propTypes.default.array,\n fullValue: _propTypes.default.oneOfType([_propTypes.default.array, _propTypes.default.string])\n});\nUnconnectedTextPosition.contextTypes = {\n localize: _propTypes.default.func\n};\nUnconnectedTextPosition.displayName = 'UnconnectedTextPosition';\n\nvar _default = (0, _lib.connectToContainer)(UnconnectedTextPosition, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n var _ = context.localize;\n var options = [{\n label: _('Top Left'),\n value: 'top left'\n }, {\n label: _('Top Center'),\n value: 'top center'\n }, {\n label: _('Top Right'),\n value: 'top right'\n }, {\n label: _('Middle Left'),\n value: 'middle left'\n }, {\n label: _('Middle Center'),\n value: 'middle center'\n }, {\n label: _('Middle Right'),\n value: 'middle right'\n }, {\n label: _('Bottom Left'),\n value: 'bottom left'\n }, {\n label: _('Bottom Center'),\n value: 'bottom center'\n }, {\n label: _('Bottom Right'),\n value: 'bottom right'\n }];\n\n if (['pie', 'bar', 'funnel', 'waterfall'].includes(context.container.type)) {\n options = [{\n label: _('Inside'),\n value: 'inside'\n }, {\n label: _('Outside'),\n value: 'outside'\n }, {\n label: _('Auto'),\n value: 'auto'\n }, {\n label: _('None'),\n value: 'none'\n }];\n }\n\n if (['funnelarea'].includes(context.container.type)) {\n options = [{\n label: _('Inside'),\n value: 'inside'\n }, {\n label: _('None'),\n value: 'none'\n }];\n }\n\n plotProps.options = options;\n plotProps.clearable = false;\n }\n});\n\nexports.default = _default;\n//# sourceMappingURL=TextPosition.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/TextPosition.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/TraceSelector.js": /*!********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/TraceSelector.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _Dropdown = __webpack_require__(/*! ./Dropdown */ \"./node_modules/react-chart-editor/lib/components/fields/Dropdown.js\");\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _constants = __webpack_require__(/*! ../../lib/constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nvar _widgets = __webpack_require__(/*! ../widgets */ \"./node_modules/react-chart-editor/lib/components/widgets/index.js\");\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _plotlyIcons = __webpack_require__(/*! plotly-icons */ \"./node_modules/plotly-icons/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar TraceSelector = /*#__PURE__*/function (_Component) {\n _inherits(TraceSelector, _Component);\n\n var _super = _createSuper(TraceSelector);\n\n function TraceSelector(props, context) {\n var _this;\n\n _classCallCheck(this, TraceSelector);\n\n _this = _super.call(this, props, context);\n _this.updatePlot = _this.updatePlot.bind(_assertThisInitialized(_this));\n _this.setGl = _this.setGl.bind(_assertThisInitialized(_this));\n _this.glEnabled = _this.glEnabled.bind(_assertThisInitialized(_this));\n _this.setTraceDefaults = _this.setTraceDefaults.bind(_assertThisInitialized(_this));\n _this.toggleGlControls = _this.toggleGlControls.bind(_assertThisInitialized(_this));\n\n _this.setTraceDefaults(props.container, props.fullContainer, props.updateContainer);\n\n _this.setLocals(props, context);\n\n _this.state = {\n showGlControls: false\n };\n return _this;\n }\n\n _createClass(TraceSelector, [{\n key: \"glEnabled\",\n value: function glEnabled() {\n return this.props.container.type && this.props.container.type.endsWith('gl') ? 'gl' : '';\n }\n }, {\n key: \"toggleGlControls\",\n value: function toggleGlControls() {\n this.setState({\n showGlControls: !this.state.showGlControls\n });\n }\n }, {\n key: \"setLocals\",\n value: function setLocals(props, context) {\n var _ = context.localize;\n\n if (props.traceOptions) {\n this.traceOptions = props.traceOptions;\n } else if (context.traceTypesConfig) {\n this.traceOptions = context.traceTypesConfig.traces(_);\n } else if (context.plotSchema) {\n this.traceOptions = (0, _lib.computeTraceOptionsFromSchema)(context.plotSchema, _, this.context);\n } else {\n this.traceOptions = [{\n label: _('Scatter'),\n value: 'scatter'\n }];\n }\n\n if (props.container) {\n this.fullValue = (0, _lib.plotlyTraceToCustomTrace)(props.container);\n }\n }\n }, {\n key: \"setTraceDefaults\",\n value: function setTraceDefaults(container, fullContainer, updateContainer, gl) {\n if (container && !container.mode && fullContainer.type === 'scatter') {\n updateContainer({\n type: 'scatter' + (gl || this.context.glByDefault ? gl : this.glEnabled()),\n mode: fullContainer.mode || 'markers'\n });\n }\n }\n }, {\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps, nextContext) {\n var container = nextProps.container,\n fullContainer = nextProps.fullContainer,\n updateContainer = nextProps.updateContainer;\n this.setTraceDefaults(container, fullContainer, updateContainer);\n this.setLocals(nextProps, nextContext);\n }\n }, {\n key: \"updatePlot\",\n value: function updatePlot(value) {\n var updateContainer = this.props.updateContainer;\n var glByDefault = this.context.glByDefault;\n\n if (updateContainer) {\n updateContainer((0, _lib.traceTypeToPlotlyInitFigure)(value, this.glEnabled() || glByDefault));\n }\n }\n }, {\n key: \"setGl\",\n value: function setGl(value) {\n var _this$props = this.props,\n container = _this$props.container,\n fullContainer = _this$props.fullContainer,\n updateContainer = _this$props.updateContainer;\n var gl = 'gl';\n this.setTraceDefaults(container, fullContainer, updateContainer, value);\n var traceType = this.fullValue.endsWith(gl) && value === '' ? this.fullValue.slice(0, -gl.length) : this.fullValue;\n updateContainer((0, _lib.traceTypeToPlotlyInitFigure)(traceType, value));\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var props = Object.assign({}, this.props, {\n fullValue: this.fullValue,\n updatePlot: this.updatePlot,\n options: this.traceOptions,\n clearable: false\n });\n var _this$context = this.context,\n _ = _this$context.localize,\n advancedTraceTypeSelector = _this$context.advancedTraceTypeSelector;\n var options = [{\n label: _('SVG'),\n value: ''\n }, {\n label: _('WebGL'),\n value: 'gl'\n }]; // Check and see if the advanced selector prop is true\n\n if (advancedTraceTypeSelector) {\n return /*#__PURE__*/_react.default.createElement(\"div\", null, /*#__PURE__*/_react.default.createElement(_Field.default, props, /*#__PURE__*/_react.default.createElement(\"div\", {\n style: {\n display: 'flex',\n width: '100%',\n alignItems: 'center'\n }\n }, /*#__PURE__*/_react.default.createElement(_widgets.TraceTypeSelectorButton, _extends({}, props, {\n traceTypesConfig: this.context.traceTypesConfig,\n handleClick: function handleClick() {\n return _this2.context.openModal(_widgets.TraceTypeSelector, _objectSpread(_objectSpread({}, props), {}, {\n traceTypesConfig: _this2.context.traceTypesConfig,\n glByDefault: _this2.context.glByDefault\n }));\n }\n })), !_constants.TRACES_WITH_GL.includes(this.props.container.type) ? '' : /*#__PURE__*/_react.default.createElement(_plotlyIcons.CogIcon, {\n className: \"menupanel__icon\",\n onClick: this.toggleGlControls\n }))), !(_constants.TRACES_WITH_GL.includes(this.props.container.type) && this.state.showGlControls) ? '' : /*#__PURE__*/_react.default.createElement(_Field.default, {\n label: _('Rendering')\n }, /*#__PURE__*/_react.default.createElement(_widgets.RadioBlocks, {\n options: options,\n activeOption: this.glEnabled(),\n onOptionChange: this.setGl\n })));\n }\n\n return /*#__PURE__*/_react.default.createElement(_Dropdown.UnconnectedDropdown, props);\n }\n }]);\n\n return TraceSelector;\n}(_react.Component);\n\nTraceSelector.contextTypes = {\n openModal: _propTypes.default.func,\n advancedTraceTypeSelector: _propTypes.default.bool,\n traceTypesConfig: _propTypes.default.object,\n plotSchema: _propTypes.default.object,\n config: _propTypes.default.object,\n localize: _propTypes.default.func,\n glByDefault: _propTypes.default.bool\n};\nTraceSelector.propTypes = {\n container: _propTypes.default.object.isRequired,\n fullContainer: _propTypes.default.object.isRequired,\n fullValue: _propTypes.default.any,\n updateContainer: _propTypes.default.func\n};\n\nvar _default = (0, _lib.connectToContainer)(TraceSelector);\n\nexports.default = _default;\n//# sourceMappingURL=TraceSelector.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/TraceSelector.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/UpdateMenuButtons.js": /*!************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/UpdateMenuButtons.js ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _index = __webpack_require__(/*! ../index */ \"./node_modules/react-chart-editor/lib/components/index.js\");\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar UpdateMenuButtons = /*#__PURE__*/function (_Component) {\n _inherits(UpdateMenuButtons, _Component);\n\n var _super = _createSuper(UpdateMenuButtons);\n\n function UpdateMenuButtons(props, context) {\n var _this;\n\n _classCallCheck(this, UpdateMenuButtons);\n\n _this = _super.call(this, props, context);\n _this.state = {\n currentButtonIndex: 0\n };\n return _this;\n }\n\n _createClass(UpdateMenuButtons, [{\n key: \"renderDropdown\",\n value: function renderDropdown() {\n var _this2 = this;\n\n var _ = this.context.localize;\n var options = this.props.fullValue.map(function (button, index) {\n return {\n label: _('Button') + \" \".concat(index + 1),\n value: index\n };\n });\n return /*#__PURE__*/_react.default.createElement(_index.Dropdown, {\n attr: \"buttons\",\n label: _('Button'),\n options: options,\n updatePlot: function updatePlot(index) {\n return _this2.setState({\n currentButtonIndex: index\n });\n },\n clearable: false,\n fullValue: this.state.currentButtonIndex\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react.default.createElement(_Field.default, null, this.renderDropdown(), /*#__PURE__*/_react.default.createElement(_index.TextEditor, {\n attr: \"buttons[\".concat(this.state.currentButtonIndex, \"].label\"),\n richTextOnly: true\n }));\n }\n }]);\n\n return UpdateMenuButtons;\n}(_react.Component);\n\nUpdateMenuButtons.propTypes = {\n attr: _propTypes.default.string,\n fullValue: _propTypes.default.array,\n updatePlot: _propTypes.default.func\n};\nUpdateMenuButtons.contextTypes = {\n localize: _propTypes.default.func\n};\n\nvar _default = (0, _lib.connectToContainer)(UpdateMenuButtons);\n\nexports.default = _default;\n//# sourceMappingURL=UpdateMenuButtons.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/UpdateMenuButtons.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/VisibilitySelect.js": /*!***********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/VisibilitySelect.js ***! \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.UnconnectedVisibilitySelect = void 0;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _constants = __webpack_require__(/*! ../../lib/constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ./Field */ \"./node_modules/react-chart-editor/lib/components/fields/Field.js\"));\n\nvar _Radio = _interopRequireDefault(__webpack_require__(/*! ./Radio */ \"./node_modules/react-chart-editor/lib/components/fields/Radio.js\"));\n\nvar _Dropdown = _interopRequireDefault(__webpack_require__(/*! ./Dropdown */ \"./node_modules/react-chart-editor/lib/components/fields/Dropdown.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar UnconnectedVisibilitySelect = /*#__PURE__*/function (_Component) {\n _inherits(UnconnectedVisibilitySelect, _Component);\n\n var _super = _createSuper(UnconnectedVisibilitySelect);\n\n function UnconnectedVisibilitySelect(props, context) {\n var _this;\n\n _classCallCheck(this, UnconnectedVisibilitySelect);\n\n _this = _super.call(this, props, context);\n _this.setMode = _this.setMode.bind(_assertThisInitialized(_this));\n _this.setLocals = _this.setLocals.bind(_assertThisInitialized(_this));\n\n _this.setLocals(props);\n\n return _this;\n }\n\n _createClass(UnconnectedVisibilitySelect, [{\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(props) {\n this.setLocals(props);\n }\n }, {\n key: \"setLocals\",\n value: function setLocals(props) {\n this.mode = props.fullValue === undefined || props.fullValue === _constants.MULTI_VALUED_PLACEHOLDER // eslint-disable-line no-undefined\n ? this.props.defaultOpt : props.fullValue;\n }\n }, {\n key: \"setMode\",\n value: function setMode(mode) {\n this.props.updateContainer(_defineProperty({}, this.props.attr, mode));\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n dropdown = _this$props.dropdown,\n clearable = _this$props.clearable,\n options = _this$props.options,\n showOn = _this$props.showOn,\n attr = _this$props.attr,\n label = _this$props.label;\n return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, dropdown ? /*#__PURE__*/_react.default.createElement(_Dropdown.default, {\n attr: attr,\n label: label,\n options: options,\n fullValue: this.mode,\n updatePlot: this.setMode,\n clearable: clearable\n }) : /*#__PURE__*/_react.default.createElement(_Radio.default, {\n attr: attr,\n label: label,\n options: options,\n fullValue: this.mode,\n updatePlot: this.setMode\n }), Array.isArray(showOn) && showOn.includes(this.mode) || this.mode === showOn ? this.props.children : null);\n }\n }]);\n\n return UnconnectedVisibilitySelect;\n}(_react.Component);\n\nexports.UnconnectedVisibilitySelect = UnconnectedVisibilitySelect;\nUnconnectedVisibilitySelect.propTypes = _objectSpread({\n fullValue: _propTypes.default.any,\n updatePlot: _propTypes.default.func,\n dropdown: _propTypes.default.bool,\n clearable: _propTypes.default.bool,\n showOn: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.bool, _propTypes.default.string, _propTypes.default.array]),\n defaultOpt: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.bool, _propTypes.default.string]),\n label: _propTypes.default.string,\n attr: _propTypes.default.string\n}, _Field.default.propTypes);\nUnconnectedVisibilitySelect.contextTypes = {\n updateContainer: _propTypes.default.func\n};\nUnconnectedVisibilitySelect.displayName = 'UnconnectedVisibilitySelect';\n\nvar _default = (0, _lib.connectToContainer)(UnconnectedVisibilitySelect);\n\nexports.default = _default;\n//# sourceMappingURL=VisibilitySelect.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/VisibilitySelect.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/derived.js": /*!**************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/derived.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.LevelRendered = exports.HoverColor = exports.HovermodeDropdown = exports.HoveronDropdown = exports.MapboxStyleDropdown = exports.MapboxSourceArray = exports.FillDropdown = exports.HoverInfo = exports.HoverTemplateText = exports.HoverTemplateSwitch = exports.TextInfo = exports.PositioningNumeric = exports.PositioningRef = exports.AnnotationRef = exports.AnnotationArrowRef = exports.NumericReciprocal = exports.NumericFractionInverse = exports.NumericFractionDomain = exports.NumericFraction = exports.DTicksInterval = exports.DTicks = exports.NTicks = exports.AxesRange = exports.Histogram2d = exports.HistogramInfoHorizontal = exports.HistogramInfoVertical = exports.ShowInLegend = exports.TickFormat = exports.BinningDropdown = exports.ContourNumeric = exports.AxisSide = exports.RangesliderVisible = exports.AxisOverlayDropdown = exports.AxisAnchorDropdown = void 0;\n\nvar _fastIsnumeric = _interopRequireDefault(__webpack_require__(/*! fast-isnumeric */ \"./node_modules/fast-isnumeric/index.js\"));\n\nvar _Dropdown = __webpack_require__(/*! ./Dropdown */ \"./node_modules/react-chart-editor/lib/components/fields/Dropdown.js\");\n\nvar _DropdownCustom = __webpack_require__(/*! ./DropdownCustom */ \"./node_modules/react-chart-editor/lib/components/fields/DropdownCustom.js\");\n\nvar _Flaglist = __webpack_require__(/*! ./Flaglist */ \"./node_modules/react-chart-editor/lib/components/fields/Flaglist.js\");\n\nvar _Numeric = __webpack_require__(/*! ./Numeric */ \"./node_modules/react-chart-editor/lib/components/fields/Numeric.js\");\n\nvar _NumericOrDate = __webpack_require__(/*! ./NumericOrDate */ \"./node_modules/react-chart-editor/lib/components/fields/NumericOrDate.js\");\n\nvar _AxisRangeValue = __webpack_require__(/*! ./AxisRangeValue */ \"./node_modules/react-chart-editor/lib/components/fields/AxisRangeValue.js\");\n\nvar _Radio = __webpack_require__(/*! ./Radio */ \"./node_modules/react-chart-editor/lib/components/fields/Radio.js\");\n\nvar _AxisInterval = __webpack_require__(/*! ./AxisInterval */ \"./node_modules/react-chart-editor/lib/components/fields/AxisInterval.js\");\n\nvar _Info = _interopRequireDefault(__webpack_require__(/*! ./Info */ \"./node_modules/react-chart-editor/lib/components/fields/Info.js\"));\n\nvar _ColorPicker = __webpack_require__(/*! ./ColorPicker */ \"./node_modules/react-chart-editor/lib/components/fields/ColorPicker.js\");\n\nvar _TextEditor = __webpack_require__(/*! ./TextEditor */ \"./node_modules/react-chart-editor/lib/components/fields/TextEditor.js\");\n\nvar _VisibilitySelect = __webpack_require__(/*! ./VisibilitySelect */ \"./node_modules/react-chart-editor/lib/components/fields/VisibilitySelect.js\");\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _Text = _interopRequireDefault(__webpack_require__(/*! ./Text */ \"./node_modules/react-chart-editor/lib/components/fields/Text.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar AxisAnchorDropdown = (0, _lib.connectToContainer)(_Dropdown.UnconnectedDropdown, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n var _ = context.localize;\n var options = [];\n\n if (props.attr.startsWith('xaxis')) {\n options = context.fullLayout._subplots.yaxis.map(function (axis) {\n return {\n label: (0, _lib.getAxisTitle)(context.fullLayout[(0, _lib.axisIdToAxisName)(axis)]),\n value: axis\n };\n });\n } else if (props.attr.startsWith('yaxis')) {\n options = context.fullLayout._subplots.xaxis.map(function (axis) {\n return {\n label: (0, _lib.getAxisTitle)(context.fullLayout[(0, _lib.axisIdToAxisName)(axis)]),\n value: axis\n };\n });\n }\n\n options.push({\n label: _('Free'),\n value: 'free'\n });\n plotProps.options = options;\n }\n});\nexports.AxisAnchorDropdown = AxisAnchorDropdown;\nvar AxisOverlayDropdown = (0, _lib.connectToContainer)(_Dropdown.UnconnectedDropdown, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n var _ = context.localize;\n var options = [];\n\n if (props.attr.startsWith('xaxis')) {\n options = context.fullLayout._subplots.xaxis.map(function (axis) {\n return {\n label: (0, _lib.getAxisTitle)(context.fullLayout[(0, _lib.axisIdToAxisName)(axis)]),\n value: axis\n };\n });\n } else if (props.attr.startsWith('yaxis')) {\n options = context.fullLayout._subplots.yaxis.map(function (axis) {\n return {\n label: (0, _lib.getAxisTitle)(context.fullLayout[(0, _lib.axisIdToAxisName)(axis)]),\n value: axis\n };\n });\n }\n\n options.unshift({\n label: _('None'),\n value: false\n }); // filter out the current axisID, can't overlay over itself\n\n plotProps.options = options.filter(function (option) {\n return context.fullContainer && context.fullContainer.xaxis && context.fullContainer.yaxis && context.fullContainer.xaxis._id !== option.value && context.fullContainer.yaxis._id !== option.value;\n });\n plotProps.clearable = false;\n }\n});\nexports.AxisOverlayDropdown = AxisOverlayDropdown;\nvar RangesliderVisible = (0, _lib.connectToContainer)(_Radio.UnconnectedRadio, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n if (!plotProps.fullValue) {\n plotProps.fullValue = false;\n plotProps.visible = false;\n plotProps.isVisible = true;\n return;\n }\n }\n});\nexports.RangesliderVisible = RangesliderVisible;\nvar AxisSide = (0, _lib.connectToContainer)(_Radio.UnconnectedRadio, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n var _ = context.localize;\n\n if (plotProps.fullValue === 'left' || plotProps.fullValue === 'right') {\n plotProps.options = [{\n label: _('Left'),\n value: 'left'\n }, {\n label: _('Right'),\n value: 'right'\n }];\n return;\n }\n\n if (plotProps.fullValue === 'top' || plotProps.fullValue === 'bottom') {\n plotProps.options = [{\n label: _('Top'),\n value: 'top'\n }, {\n label: _('Bottom'),\n value: 'bottom'\n }];\n return;\n }\n\n if (plotProps.fullValue === 'clockwise' || plotProps.fullValue === 'counterclockwise') {\n plotProps.options = [{\n label: _('Clockwise'),\n value: 'clockwise'\n }, {\n label: _('Counterclockwise'),\n value: 'counterclockwise'\n }];\n return;\n }\n\n plotProps.isVisible = false;\n }\n});\nexports.AxisSide = AxisSide;\nvar ContourNumeric = (0, _lib.connectToContainer)(_Numeric.UnconnectedNumeric, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n var fullContainer = plotProps.fullContainer;\n\n if (plotProps.isVisible && fullContainer && fullContainer.autocontour) {\n plotProps.isVisible = false;\n }\n }\n});\nexports.ContourNumeric = ContourNumeric;\nvar BinningDropdown = (0, _lib.connectToContainer)(_Dropdown.UnconnectedDropdown, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n var _ = context.localize;\n var axis = plotProps.fullContainer.type === 'histogram2d' ? 'Z' : plotProps.fullContainer.orientation === 'v' ? 'Y' : 'X';\n plotProps.options = [{\n label: _('Count ') + axis,\n value: 'count'\n }, {\n label: _('Sum ') + axis,\n value: 'sum'\n }, {\n label: _('Average ') + axis,\n value: 'avg'\n }, {\n label: _('Minimum ') + axis,\n value: 'min'\n }, {\n label: _('Maximum ') + axis,\n value: 'max'\n }];\n }\n});\nexports.BinningDropdown = BinningDropdown;\nvar TickFormat = (0, _lib.connectToContainer)(_DropdownCustom.UnconnectedDropdownCustom, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n var _ = context.localize;\n\n if (plotProps.fullContainer.type === 'date') {\n plotProps.options = [{\n label: _('Default'),\n value: ''\n }, {\n label: _('Advanced (d3-time-format)'),\n value: '%x'\n }];\n plotProps.customOpt = '%x';\n } else {\n plotProps.options = [{\n label: _('Simple'),\n value: ''\n }, {\n label: _('Advanced (d3-format)'),\n value: 's'\n }];\n plotProps.customOpt = 's';\n }\n }\n});\nexports.TickFormat = TickFormat;\nvar ShowInLegend = (0, _lib.connectToContainer)(_VisibilitySelect.UnconnectedVisibilitySelect, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n if (context.container.type && context.container.type !== 'sunburst' && context.container.type !== 'treemap') {\n plotProps.isVisible = context.fullLayout.showlegend;\n }\n\n return plotProps;\n }\n});\nexports.ShowInLegend = ShowInLegend;\nvar HistogramInfoVertical = (0, _lib.connectToContainer)(_Info.default, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n plotProps.isVisible = context.fullContainer.type === 'histogram' && context.fullContainer.orientation === 'v';\n return plotProps;\n }\n});\nexports.HistogramInfoVertical = HistogramInfoVertical;\nvar HistogramInfoHorizontal = (0, _lib.connectToContainer)(_Info.default, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n plotProps.isVisible = context.fullContainer.type === 'histogram' && context.fullContainer.orientation === 'h';\n return plotProps;\n }\n});\nexports.HistogramInfoHorizontal = HistogramInfoHorizontal;\nvar Histogram2d = (0, _lib.connectToContainer)(_Info.default, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n plotProps.isVisible = context.fullContainer.type === 'histogram2d';\n return plotProps;\n }\n});\nexports.Histogram2d = Histogram2d;\nvar AxesRange = (0, _lib.connectToContainer)(_AxisRangeValue.UnconnectedAxisRangeValue, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n var fullContainer = plotProps.fullContainer;\n\n if (plotProps.isVisible && fullContainer && fullContainer.autorange) {\n plotProps.isVisible = false;\n }\n\n return plotProps;\n }\n});\nexports.AxesRange = AxesRange;\nvar NTicks = (0, _lib.connectToContainer)(_Numeric.UnconnectedNumeric, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n var fullContainer = plotProps.fullContainer;\n\n if (plotProps.isVisible && fullContainer && fullContainer.tickmode !== 'auto') {\n plotProps.isVisible = false;\n }\n\n return plotProps;\n }\n});\nexports.NTicks = NTicks;\nvar DTicks = (0, _lib.connectToContainer)(_AxisRangeValue.UnconnectedAxisRangeValue, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n var fullContainer = plotProps.fullContainer;\n\n if (fullContainer && fullContainer._name && (fullContainer._name.startsWith('lat') || fullContainer._name.startsWith('lon'))) {\n // don't mess with visibility on geo axes\n return plotProps;\n }\n\n if (plotProps.isVisible && fullContainer && fullContainer.tickmode !== 'linear') {\n plotProps.isVisible = false;\n }\n\n return plotProps;\n }\n});\nexports.DTicks = DTicks;\nvar DTicksInterval = (0, _lib.connectToContainer)(_AxisInterval.UnconnectedAxisInterval, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n var fullContainer = plotProps.fullContainer;\n\n if (fullContainer && fullContainer._name && (fullContainer._name.startsWith('lat') || fullContainer._name.startsWith('lon'))) {\n // don't mess with visibility on geo axes\n return plotProps;\n }\n\n if (plotProps.isVisible && fullContainer && fullContainer.tickmode !== 'linear') {\n plotProps.isVisible = false;\n }\n\n return plotProps;\n }\n});\nexports.DTicksInterval = DTicksInterval;\n\nvar UnconnectedNumericFraction = /*#__PURE__*/function (_UnconnectedNumeric) {\n _inherits(UnconnectedNumericFraction, _UnconnectedNumeric);\n\n var _super = _createSuper(UnconnectedNumericFraction);\n\n function UnconnectedNumericFraction() {\n _classCallCheck(this, UnconnectedNumericFraction);\n\n return _super.apply(this, arguments);\n }\n\n return UnconnectedNumericFraction;\n}(_Numeric.UnconnectedNumeric);\n\nUnconnectedNumericFraction.propTypes = _Numeric.UnconnectedNumeric.propTypes;\nUnconnectedNumericFraction.defaultProps = {\n units: '%',\n showSlider: true\n};\nUnconnectedNumericFraction.displayName = 'UnconnectedNumericFraction';\n\nvar numericFractionModifyPlotProps = function numericFractionModifyPlotProps(props, context, plotProps) {\n var attrMeta = plotProps.attrMeta,\n fullValue = plotProps.fullValue,\n updatePlot = plotProps.updatePlot;\n var min = attrMeta && attrMeta.min || 0;\n var max = attrMeta && attrMeta.max || 1;\n\n if ((0, _fastIsnumeric.default)(fullValue)) {\n plotProps.fullValue = Math.round(100 * (fullValue - min) / (max - min));\n }\n\n plotProps.updatePlot = function (v) {\n if ((0, _fastIsnumeric.default)(v)) {\n updatePlot(v / 100 * (max - min) + min);\n } else {\n updatePlot(v);\n }\n };\n\n plotProps.max = 100;\n plotProps.min = 0;\n};\n\nvar NumericFraction = (0, _lib.connectToContainer)(UnconnectedNumericFraction, {\n modifyPlotProps: numericFractionModifyPlotProps\n});\nexports.NumericFraction = NumericFraction;\nvar NumericFractionDomain = (0, _lib.connectToContainer)(UnconnectedNumericFraction, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n numericFractionModifyPlotProps(props, context, plotProps);\n\n if (context.container && context.container.overlaying) {\n plotProps.isVisible = null;\n }\n }\n});\nexports.NumericFractionDomain = NumericFractionDomain;\nvar NumericFractionInverse = (0, _lib.connectToContainer)(UnconnectedNumericFraction, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n var attrMeta = plotProps.attrMeta,\n fullValue = plotProps.fullValue,\n updatePlot = plotProps.updatePlot;\n\n if ((0, _fastIsnumeric.default)(fullValue)) {\n plotProps.fullValue = Math.round((1 - fullValue) * 100);\n }\n\n plotProps.updatePlot = function (v) {\n if ((0, _fastIsnumeric.default)(v)) {\n updatePlot(1 - v / 100);\n } else {\n updatePlot(v);\n }\n }; // Also take the inverse of max and min.\n\n\n if (attrMeta) {\n if ((0, _fastIsnumeric.default)(attrMeta.min)) {\n plotProps.max = (1 - attrMeta.min) * 100;\n }\n\n if ((0, _fastIsnumeric.default)(attrMeta.max)) {\n plotProps.min = (1 - attrMeta.max) * 100;\n }\n }\n }\n});\nexports.NumericFractionInverse = NumericFractionInverse;\nvar NumericReciprocal = (0, _lib.connectToContainer)(_Numeric.UnconnectedNumeric, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n var fullValue = plotProps.fullValue,\n updatePlot = plotProps.updatePlot;\n\n if ((0, _fastIsnumeric.default)(fullValue)) {\n plotProps.fullValue = 1 / fullValue;\n }\n\n plotProps.updatePlot = function (v) {\n if ((0, _fastIsnumeric.default)(v)) {\n updatePlot(1 / v);\n } else {\n updatePlot(v);\n }\n };\n\n plotProps.min = 0;\n }\n});\nexports.NumericReciprocal = NumericReciprocal;\nvar AnnotationArrowRef = (0, _lib.connectToContainer)(_Dropdown.UnconnectedDropdown, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n var _ = context.localize;\n\n if (!context.fullContainer) {\n return;\n }\n\n var _context$fullContaine = context.fullContainer,\n xref = _context$fullContaine.xref,\n yref = _context$fullContaine.yref;\n var currentAxisRef;\n\n if (props.attr === 'axref') {\n currentAxisRef = xref;\n } else if (props.attr === 'ayref') {\n currentAxisRef = yref;\n } else {\n throw new Error(_('AnnotationArrowRef must be given either \"axref\" or \"ayref\" as attrs. Instead was given') + props.attr);\n }\n\n if (currentAxisRef === 'paper') {\n // If currentAxesRef is paper provide all axes options to user.\n var axes = (0, _lib.getAllAxes)(context.fullLayout).filter(function (a) {\n return a._id;\n });\n\n if (axes.length > 0) {\n plotProps.options = [{\n label: _('in pixels'),\n value: 'pixel'\n }].concat(_toConsumableArray(computeAxesRefOptions(axes, props.attr)));\n } else {\n plotProps.isVisible = false;\n }\n } else {\n // If currentAxesRef is an actual axes then offer that value as the only\n // axes option.\n plotProps.options = [{\n label: _('in pixels'),\n value: 'pixel'\n }, {\n label: _('according to axis'),\n value: currentAxisRef\n }];\n }\n\n plotProps.clearable = false;\n }\n});\nexports.AnnotationArrowRef = AnnotationArrowRef;\nvar AnnotationRef = (0, _lib.connectToContainer)(_Dropdown.UnconnectedDropdown, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n if (!context.fullContainer) {\n return;\n }\n\n var _context$fullContaine2 = context.fullContainer,\n axref = _context$fullContaine2.axref,\n ayref = _context$fullContaine2.ayref,\n _ = context.localize;\n var currentOffsetRef;\n\n if (props.attr === 'xref') {\n currentOffsetRef = axref;\n } else if (props.attr === 'yref') {\n currentOffsetRef = ayref;\n } else {\n throw new Error(_('AnnotationRef must be given either \"xref\" or \"yref\" as attrs. Instead was given') + props.attr + '.');\n }\n\n var axes = (0, _lib.getAllAxes)(context.fullLayout).filter(function (a) {\n return a._id;\n });\n\n if (axes.length > 0) {\n plotProps.options = [{\n label: _('Canvas'),\n value: 'paper'\n }].concat(_toConsumableArray(computeAxesRefOptions(axes, props.attr)));\n } else {\n plotProps.isVisible = false;\n }\n\n if (currentOffsetRef !== 'pixel') {\n plotProps.updatePlot = function (v) {\n if (!plotProps.updateContainer) {\n return;\n }\n /*\n * If user is changing axis also change their a[x|y]ref arrow axis\n * reference to match if the value is an axis value.\n * Behaviour copied from plot.ly/create\n */\n\n\n var update = _defineProperty({}, props.attr, v);\n\n if (v !== 'paper') {\n update[\"a\".concat(props.attr)] = v;\n }\n\n plotProps.updateContainer(update);\n };\n }\n\n plotProps.clearable = false;\n }\n});\nexports.AnnotationRef = AnnotationRef;\nvar PositioningRef = (0, _lib.connectToContainer)(_Dropdown.UnconnectedDropdown, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n var axes = (0, _lib.getAllAxes)(context.fullLayout).filter(function (a) {\n return a._id;\n });\n\n if (axes.length > 0) {\n plotProps.options = [{\n label: 'Canvas',\n value: 'paper'\n }].concat(_toConsumableArray(computeAxesRefOptions(axes, props.attr)));\n plotProps.clearable = false;\n } else {\n plotProps.isVisible = false;\n }\n }\n});\nexports.PositioningRef = PositioningRef;\nvar PositioningNumeric = (0, _lib.connectToContainer)(_NumericOrDate.UnconnectedNumericOrDate, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n var fullContainer = plotProps.fullContainer,\n fullValue = plotProps.fullValue,\n updatePlot = plotProps.updatePlot;\n\n if (fullContainer && (fullContainer[props.attr[0] + 'ref'] === 'paper' || fullContainer[props.attr[props.attr.length - 1] + 'ref'] === 'paper')) {\n plotProps.units = '%';\n plotProps.showSlider = true;\n plotProps.max = 100;\n plotProps.min = 0;\n plotProps.step = 1;\n\n if ((0, _fastIsnumeric.default)(fullValue)) {\n plotProps.fullValue = Math.round(100 * fullValue);\n }\n\n plotProps.updatePlot = function (v) {\n if ((0, _fastIsnumeric.default)(v)) {\n updatePlot(v / 100);\n } else {\n updatePlot(v);\n }\n };\n }\n }\n});\nexports.PositioningNumeric = PositioningNumeric;\n\nfunction computeAxesRefOptions(axes, propsAttr) {\n var options = [];\n\n for (var i = 0; i < axes.length; i++) {\n var ax = axes[i];\n\n if (ax._id.charAt(0) === propsAttr.charAt(0) || ax._id.charAt(0) === propsAttr.charAt(1)) {\n var label = (0, _lib.getAxisTitle)(ax);\n options.push({\n label: label,\n value: ax._id\n });\n }\n }\n\n return options;\n}\n\nvar TextInfo = (0, _lib.connectToContainer)(_Flaglist.UnconnectedFlaglist, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n var _ = context.localize,\n container = context.container;\n var options = [{\n label: _('Label'),\n value: 'label'\n }, {\n label: _('Value'),\n value: 'value'\n }, {\n label: _('%'),\n value: 'percent'\n }];\n\n if (container.type === 'funnel') {\n options = [{\n label: _('Label'),\n value: 'label'\n }, {\n label: _('Value'),\n value: 'value'\n }, {\n label: _('% initial'),\n value: 'percent initial'\n }, {\n label: _('% previous'),\n value: 'percent previous'\n }, {\n label: _('% total'),\n value: 'percent total'\n }];\n }\n\n if (container.text) {\n options.push({\n label: _('Text'),\n value: 'text'\n });\n }\n\n plotProps.options = options;\n }\n});\nexports.TextInfo = TextInfo;\nvar HoverTemplateSwitch = (0, _lib.connectToContainer)(_Radio.UnconnectedRadio, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n var _ = context.localize;\n plotProps.options = [{\n label: _('Values'),\n value: ''\n }, {\n label: _('Template'),\n value: plotProps.fullValue || ' '\n }];\n return plotProps;\n }\n});\nexports.HoverTemplateSwitch = HoverTemplateSwitch;\nvar HoverTemplateText = (0, _lib.connectToContainer)(_TextEditor.UnconnectedTextEditor, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n if (plotProps.isVisible && plotProps.fullValue === '') {\n plotProps.isVisible = false;\n }\n\n return plotProps;\n }\n});\nexports.HoverTemplateText = HoverTemplateText;\nvar HoverInfo = (0, _lib.connectToContainer)(_Flaglist.UnconnectedFlaglist, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n var _ = context.localize,\n container = context.container;\n var options = [{\n label: _('X'),\n value: 'x'\n }, {\n label: _('Y'),\n value: 'y'\n }];\n\n if (['heatmap', 'heatmapgl', 'histogram2d', 'histogram2dcontour', 'contour', 'contourcarpet', 'scatter3d', 'surface', 'mesh3d'].includes(container.type)) {\n options.push({\n label: _('Z'),\n value: 'z'\n });\n } else if (container.type === 'choropleth') {\n options = [{\n label: _('Location'),\n value: 'location'\n }, {\n label: _('Values'),\n value: 'z'\n }];\n } else if (container.type === 'scattergeo') {\n if (container.locations) {\n options = [{\n label: _('Location'),\n value: 'location'\n }];\n } else if (container.lat || container.lon) {\n options = [{\n label: _('Longitude'),\n value: 'lon'\n }, {\n label: _('Latitude'),\n value: 'lat'\n }];\n }\n } else if (container.type === 'scattermapbox') {\n options = [{\n label: _('Longitude'),\n value: 'lon'\n }, {\n label: _('Latitude'),\n value: 'lat'\n }];\n } else if (container.type === 'densitymapbox') {\n options = [{\n label: _('Longitude'),\n value: 'lon'\n }, {\n label: _('Latitude'),\n value: 'lat'\n }, {\n label: _('Z'),\n value: 'z'\n }];\n } else if (container.type === 'scatterternary') {\n options = [{\n label: _('A'),\n value: 'a'\n }, {\n label: _('B'),\n value: 'b'\n }, {\n label: _('C'),\n value: 'c'\n }];\n } else if (['scatterpolar', 'scatterpolargl', 'barpolar'].includes(container.type)) {\n options = [{\n label: _('R'),\n value: 'r'\n }, {\n label: _('Theta'),\n value: 'theta'\n }];\n } else if (container.type === 'pie') {\n options = [{\n label: _('Percent'),\n value: 'percent'\n }];\n } else if (container.type === 'table') {\n plotProps.isVisible = false;\n } else if (['cone', 'streamtube'].includes(container.type)) {\n options = [{\n label: _('X'),\n value: 'x'\n }, {\n label: _('Y'),\n value: 'y'\n }, {\n label: _('Z'),\n value: 'z'\n }, {\n label: _('U'),\n value: 'u'\n }, {\n label: _('V'),\n value: 'v'\n }, {\n label: _('W'),\n value: 'w'\n }, {\n label: _('Norm'),\n value: 'norm'\n }, {\n label: _('Divergence'),\n value: 'divergence'\n }];\n } else if (container.type === 'sunburst' || container.type === 'treemap') {\n options = [];\n }\n\n if (container.labels && ['pie', 'sunburst', 'treemap', 'funnelarea'].includes(container.type)) {\n options.push({\n label: _('Label'),\n value: 'label'\n });\n }\n\n if (container.values && ['pie', 'sunburst', 'treemap', 'funnelarea'].includes(container.type)) {\n options.push({\n label: _('Value'),\n value: 'value'\n });\n }\n\n if (container.text) {\n options.push({\n label: _('Text'),\n value: 'text'\n });\n }\n\n options.push({\n label: _('Trace name'),\n value: 'name'\n });\n plotProps.options = options;\n }\n});\nexports.HoverInfo = HoverInfo;\nvar FillDropdown = (0, _lib.connectToContainer)(_Dropdown.UnconnectedDropdown, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n var _ = context.localize;\n var options = [{\n label: _('None'),\n value: 'none'\n }, {\n label: _('Y = 0'),\n value: 'tozeroy'\n }, {\n label: _('X = 0'),\n value: 'tozerox'\n }, {\n label: _('Previous Y'),\n value: 'tonexty'\n }, {\n label: _('Previous X'),\n value: 'tonextx'\n }];\n\n if (context.container.type === 'scatterternary' || context.container.type === 'scattercarpet' || context.container.type === 'scatterpolar') {\n options = [{\n label: _('None'),\n value: 'none'\n }, {\n label: _('To Self'),\n value: 'toself'\n }, {\n label: _('To Next'),\n value: 'tonext'\n }];\n } else if (context.container.type === 'scattergeo' || context.container.type === 'scattermapbox') {\n options = [{\n label: _('None'),\n value: 'none'\n }, {\n label: _('To Self'),\n value: 'toself'\n }];\n }\n\n plotProps.options = options;\n plotProps.clearable = false;\n }\n});\nexports.FillDropdown = FillDropdown;\nvar MapboxSourceArray = (0, _lib.connectToContainer)(_Text.default, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n var fullValue = plotProps.fullValue,\n updatePlot = plotProps.updatePlot;\n\n if (plotProps.fullValue && plotProps.fullValue.length > 0) {\n plotProps.fullValue = fullValue[0];\n }\n\n plotProps.updatePlot = function (v) {\n if (v.length) {\n updatePlot([v]);\n } else {\n updatePlot([]);\n }\n };\n }\n});\nexports.MapboxSourceArray = MapboxSourceArray;\nvar MapboxStyleDropdown = (0, _lib.connectToContainer)(_Dropdown.UnconnectedDropdown, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n var mapBoxAccess = context.mapBoxAccess,\n _ = context.localize;\n plotProps.options = (!mapBoxAccess ? [] : [{\n label: _('Mapbox Basic'),\n value: 'basic'\n }, {\n label: _('Mapbox Outdoors'),\n value: 'outdoors'\n }, {\n label: _('Mapbox Light'),\n value: 'light'\n }, {\n label: _('Mapbox Dark'),\n value: 'dark'\n }, {\n label: _('Mapbox Satellite'),\n value: 'satellite'\n }, {\n label: _('Mapbox Satellite with Streets'),\n value: 'satellite-streets'\n }]).concat([{\n label: _('No tiles (white background)'),\n value: 'white-bg'\n }, {\n label: _('Open Street Map'),\n value: 'open-street-map'\n }, {\n label: _('Carto Positron'),\n value: 'carto-positron'\n }, {\n label: _('Carto Dark Matter'),\n value: 'carto-darkmatter'\n }, {\n label: _('Stamen Terrain'),\n value: 'stamen-terrain'\n }, {\n label: _('Stamen Toner'),\n value: 'stamen-toner'\n }, {\n label: _('Stamen Watercolor'),\n value: 'stamen-watercolor'\n }]);\n plotProps.clearable = false;\n }\n});\nexports.MapboxStyleDropdown = MapboxStyleDropdown;\nMapboxStyleDropdown.contextTypes = _objectSpread({\n mapBoxAccess: _propTypes.default.bool\n}, MapboxStyleDropdown.contextTypes);\nvar HoveronDropdown = (0, _lib.connectToContainer)(_Dropdown.UnconnectedDropdown, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n var _ = context.localize;\n var options;\n\n if (context.container.type === 'box') {\n options = [{\n label: _('Boxes'),\n value: 'boxes'\n }, {\n label: _('Points'),\n value: 'points'\n }, {\n label: _('Boxes and Points'),\n value: 'boxes+points'\n }];\n } else if (context.container.type === 'violin') {\n options = [{\n label: _('Violins'),\n value: 'violins'\n }, {\n label: _('Points'),\n value: 'points'\n }, {\n label: _('KDE'),\n value: 'kde'\n }, {\n label: _('Violins and Points'),\n value: 'violins+points'\n }, {\n label: _('Violins, Points and KDE'),\n value: 'violins+points+kde'\n }];\n } else {\n options = [{\n label: _('Points'),\n value: 'points'\n }, {\n label: _('Fills'),\n value: 'fills'\n }, {\n label: _('Points and Fills'),\n value: 'points+fills'\n }];\n }\n\n plotProps.options = options;\n plotProps.clearable = false;\n }\n});\nexports.HoveronDropdown = HoveronDropdown;\nvar HovermodeDropdown = (0, _lib.connectToContainer)(_VisibilitySelect.UnconnectedVisibilitySelect, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n var _ = context.localize;\n plotProps.options = context.container.xaxis && Object.keys(context.container.xaxis).length > 0 ? [{\n label: _('Closest'),\n value: 'closest'\n }, {\n label: _('X Axis'),\n value: 'x'\n }, {\n label: _('Y Axis'),\n value: 'y'\n }, {\n label: _('Disable'),\n value: false\n }] : [{\n label: _('Closest'),\n value: 'closest'\n }, {\n label: _('Disable'),\n value: false\n }];\n plotProps.clearable = false;\n plotProps.dropdown = true;\n plotProps.showOn = ['closest', 'x', 'y'];\n }\n});\nexports.HovermodeDropdown = HovermodeDropdown;\nvar HoverColor = (0, _lib.connectToContainer)(_ColorPicker.UnconnectedColorPicker, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n plotProps.isVisible = Boolean(context.fullLayout.hovermode);\n return plotProps;\n }\n});\nexports.HoverColor = HoverColor;\nvar LevelRendered = (0, _lib.connectToContainer)(_Dropdown.UnconnectedDropdown, {\n modifyPlotProps: function modifyPlotProps(props, context, plotProps) {\n var _ = context.localize;\n\n if (context.container.ids && context.container.ids.length) {\n plotProps.isVisible = true;\n plotProps.options = [{\n label: _('Root'),\n value: ''\n }].concat(context.container.ids.map(function (i) {\n return {\n label: i,\n value: i\n };\n }));\n }\n }\n});\nexports.LevelRendered = LevelRendered;\n//# sourceMappingURL=derived.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/derived.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/fields/index.js": /*!************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/fields/index.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar _exportNames = {\n ArrowSelector: true,\n AxesSelector: true,\n ColorPicker: true,\n ColorscalePicker: true,\n PieColorscalePicker: true,\n ColorwayPicker: true,\n ColorArrayPicker: true,\n Dropdown: true,\n Dropzone: true,\n FontSelector: true,\n Flaglist: true,\n Info: true,\n Radio: true,\n TextEditor: true,\n DataSelector: true,\n Numeric: true,\n NumericOrDate: true,\n DualNumeric: true,\n AxisRangeValue: true,\n Text: true,\n SymbolSelector: true,\n TraceSelector: true,\n ErrorBars: true,\n AxesCreator: true,\n SubplotCreator: true,\n GroupCreator: true,\n UpdateMenuButtons: true,\n FilterOperation: true,\n FilterValue: true,\n MarkerSize: true,\n MarkerColor: true,\n VisibilitySelect: true,\n DropdownCustom: true,\n MultiColorPicker: true,\n RectanglePositioner: true,\n LocationSelector: true,\n AxisInterval: true,\n DateTimePicker: true,\n TextPosition: true,\n HoverLabelNameLength: true\n};\nObject.defineProperty(exports, \"ArrowSelector\", {\n enumerable: true,\n get: function get() {\n return _ArrowSelector.default;\n }\n});\nObject.defineProperty(exports, \"AxesSelector\", {\n enumerable: true,\n get: function get() {\n return _AxesSelector.default;\n }\n});\nObject.defineProperty(exports, \"ColorPicker\", {\n enumerable: true,\n get: function get() {\n return _ColorPicker.default;\n }\n});\nObject.defineProperty(exports, \"ColorscalePicker\", {\n enumerable: true,\n get: function get() {\n return _ColorscalePicker.default;\n }\n});\nObject.defineProperty(exports, \"PieColorscalePicker\", {\n enumerable: true,\n get: function get() {\n return _PieColorscalePicker.default;\n }\n});\nObject.defineProperty(exports, \"ColorwayPicker\", {\n enumerable: true,\n get: function get() {\n return _ColorwayPicker.default;\n }\n});\nObject.defineProperty(exports, \"ColorArrayPicker\", {\n enumerable: true,\n get: function get() {\n return _ColorArrayPicker.default;\n }\n});\nObject.defineProperty(exports, \"Dropdown\", {\n enumerable: true,\n get: function get() {\n return _Dropdown.default;\n }\n});\nObject.defineProperty(exports, \"Dropzone\", {\n enumerable: true,\n get: function get() {\n return _Dropzone.default;\n }\n});\nObject.defineProperty(exports, \"FontSelector\", {\n enumerable: true,\n get: function get() {\n return _FontSelector.default;\n }\n});\nObject.defineProperty(exports, \"Flaglist\", {\n enumerable: true,\n get: function get() {\n return _Flaglist.default;\n }\n});\nObject.defineProperty(exports, \"Info\", {\n enumerable: true,\n get: function get() {\n return _Info.default;\n }\n});\nObject.defineProperty(exports, \"Radio\", {\n enumerable: true,\n get: function get() {\n return _Radio.default;\n }\n});\nObject.defineProperty(exports, \"TextEditor\", {\n enumerable: true,\n get: function get() {\n return _TextEditor.default;\n }\n});\nObject.defineProperty(exports, \"DataSelector\", {\n enumerable: true,\n get: function get() {\n return _DataSelector.default;\n }\n});\nObject.defineProperty(exports, \"Numeric\", {\n enumerable: true,\n get: function get() {\n return _Numeric.default;\n }\n});\nObject.defineProperty(exports, \"NumericOrDate\", {\n enumerable: true,\n get: function get() {\n return _NumericOrDate.default;\n }\n});\nObject.defineProperty(exports, \"DualNumeric\", {\n enumerable: true,\n get: function get() {\n return _DualNumeric.default;\n }\n});\nObject.defineProperty(exports, \"AxisRangeValue\", {\n enumerable: true,\n get: function get() {\n return _AxisRangeValue.default;\n }\n});\nObject.defineProperty(exports, \"Text\", {\n enumerable: true,\n get: function get() {\n return _Text.default;\n }\n});\nObject.defineProperty(exports, \"SymbolSelector\", {\n enumerable: true,\n get: function get() {\n return _SymbolSelector.default;\n }\n});\nObject.defineProperty(exports, \"TraceSelector\", {\n enumerable: true,\n get: function get() {\n return _TraceSelector.default;\n }\n});\nObject.defineProperty(exports, \"ErrorBars\", {\n enumerable: true,\n get: function get() {\n return _ErrorBars.default;\n }\n});\nObject.defineProperty(exports, \"AxesCreator\", {\n enumerable: true,\n get: function get() {\n return _AxesCreator.default;\n }\n});\nObject.defineProperty(exports, \"SubplotCreator\", {\n enumerable: true,\n get: function get() {\n return _SubplotCreator.default;\n }\n});\nObject.defineProperty(exports, \"GroupCreator\", {\n enumerable: true,\n get: function get() {\n return _GroupCreator.default;\n }\n});\nObject.defineProperty(exports, \"UpdateMenuButtons\", {\n enumerable: true,\n get: function get() {\n return _UpdateMenuButtons.default;\n }\n});\nObject.defineProperty(exports, \"FilterOperation\", {\n enumerable: true,\n get: function get() {\n return _FilterOperation.FilterOperation;\n }\n});\nObject.defineProperty(exports, \"FilterValue\", {\n enumerable: true,\n get: function get() {\n return _FilterOperation.FilterValue;\n }\n});\nObject.defineProperty(exports, \"MarkerSize\", {\n enumerable: true,\n get: function get() {\n return _MarkerSize.default;\n }\n});\nObject.defineProperty(exports, \"MarkerColor\", {\n enumerable: true,\n get: function get() {\n return _MarkerColor.default;\n }\n});\nObject.defineProperty(exports, \"VisibilitySelect\", {\n enumerable: true,\n get: function get() {\n return _VisibilitySelect.default;\n }\n});\nObject.defineProperty(exports, \"DropdownCustom\", {\n enumerable: true,\n get: function get() {\n return _DropdownCustom.default;\n }\n});\nObject.defineProperty(exports, \"MultiColorPicker\", {\n enumerable: true,\n get: function get() {\n return _MultiColorPicker.default;\n }\n});\nObject.defineProperty(exports, \"RectanglePositioner\", {\n enumerable: true,\n get: function get() {\n return _RectanglePositioner.default;\n }\n});\nObject.defineProperty(exports, \"LocationSelector\", {\n enumerable: true,\n get: function get() {\n return _LocationSelector.default;\n }\n});\nObject.defineProperty(exports, \"AxisInterval\", {\n enumerable: true,\n get: function get() {\n return _AxisInterval.default;\n }\n});\nObject.defineProperty(exports, \"DateTimePicker\", {\n enumerable: true,\n get: function get() {\n return _DateTimePicker.default;\n }\n});\nObject.defineProperty(exports, \"TextPosition\", {\n enumerable: true,\n get: function get() {\n return _TextPosition.default;\n }\n});\nObject.defineProperty(exports, \"HoverLabelNameLength\", {\n enumerable: true,\n get: function get() {\n return _HoverLabelNameLength.default;\n }\n});\n\nvar _ArrowSelector = _interopRequireDefault(__webpack_require__(/*! ./ArrowSelector */ \"./node_modules/react-chart-editor/lib/components/fields/ArrowSelector.js\"));\n\nvar _AxesSelector = _interopRequireDefault(__webpack_require__(/*! ./AxesSelector */ \"./node_modules/react-chart-editor/lib/components/fields/AxesSelector.js\"));\n\nvar _ColorPicker = _interopRequireDefault(__webpack_require__(/*! ./ColorPicker */ \"./node_modules/react-chart-editor/lib/components/fields/ColorPicker.js\"));\n\nvar _ColorscalePicker = _interopRequireDefault(__webpack_require__(/*! ./ColorscalePicker */ \"./node_modules/react-chart-editor/lib/components/fields/ColorscalePicker.js\"));\n\nvar _PieColorscalePicker = _interopRequireDefault(__webpack_require__(/*! ./PieColorscalePicker */ \"./node_modules/react-chart-editor/lib/components/fields/PieColorscalePicker.js\"));\n\nvar _ColorwayPicker = _interopRequireDefault(__webpack_require__(/*! ./ColorwayPicker */ \"./node_modules/react-chart-editor/lib/components/fields/ColorwayPicker.js\"));\n\nvar _ColorArrayPicker = _interopRequireDefault(__webpack_require__(/*! ./ColorArrayPicker */ \"./node_modules/react-chart-editor/lib/components/fields/ColorArrayPicker.js\"));\n\nvar _Dropdown = _interopRequireDefault(__webpack_require__(/*! ./Dropdown */ \"./node_modules/react-chart-editor/lib/components/fields/Dropdown.js\"));\n\nvar _Dropzone = _interopRequireDefault(__webpack_require__(/*! ./Dropzone */ \"./node_modules/react-chart-editor/lib/components/fields/Dropzone.js\"));\n\nvar _FontSelector = _interopRequireDefault(__webpack_require__(/*! ./FontSelector */ \"./node_modules/react-chart-editor/lib/components/fields/FontSelector.js\"));\n\nvar _Flaglist = _interopRequireDefault(__webpack_require__(/*! ./Flaglist */ \"./node_modules/react-chart-editor/lib/components/fields/Flaglist.js\"));\n\nvar _Info = _interopRequireDefault(__webpack_require__(/*! ./Info */ \"./node_modules/react-chart-editor/lib/components/fields/Info.js\"));\n\nvar _Radio = _interopRequireDefault(__webpack_require__(/*! ./Radio */ \"./node_modules/react-chart-editor/lib/components/fields/Radio.js\"));\n\nvar _TextEditor = _interopRequireDefault(__webpack_require__(/*! ./TextEditor */ \"./node_modules/react-chart-editor/lib/components/fields/TextEditor.js\"));\n\nvar _DataSelector = _interopRequireDefault(__webpack_require__(/*! ./DataSelector */ \"./node_modules/react-chart-editor/lib/components/fields/DataSelector.js\"));\n\nvar _Numeric = _interopRequireDefault(__webpack_require__(/*! ./Numeric */ \"./node_modules/react-chart-editor/lib/components/fields/Numeric.js\"));\n\nvar _NumericOrDate = _interopRequireDefault(__webpack_require__(/*! ./NumericOrDate */ \"./node_modules/react-chart-editor/lib/components/fields/NumericOrDate.js\"));\n\nvar _DualNumeric = _interopRequireDefault(__webpack_require__(/*! ./DualNumeric */ \"./node_modules/react-chart-editor/lib/components/fields/DualNumeric.js\"));\n\nvar _AxisRangeValue = _interopRequireDefault(__webpack_require__(/*! ./AxisRangeValue */ \"./node_modules/react-chart-editor/lib/components/fields/AxisRangeValue.js\"));\n\nvar _Text = _interopRequireDefault(__webpack_require__(/*! ./Text */ \"./node_modules/react-chart-editor/lib/components/fields/Text.js\"));\n\nvar _SymbolSelector = _interopRequireDefault(__webpack_require__(/*! ./SymbolSelector */ \"./node_modules/react-chart-editor/lib/components/fields/SymbolSelector.js\"));\n\nvar _TraceSelector = _interopRequireDefault(__webpack_require__(/*! ./TraceSelector */ \"./node_modules/react-chart-editor/lib/components/fields/TraceSelector.js\"));\n\nvar _ErrorBars = _interopRequireDefault(__webpack_require__(/*! ./ErrorBars */ \"./node_modules/react-chart-editor/lib/components/fields/ErrorBars.js\"));\n\nvar _AxesCreator = _interopRequireDefault(__webpack_require__(/*! ./AxesCreator */ \"./node_modules/react-chart-editor/lib/components/fields/AxesCreator.js\"));\n\nvar _SubplotCreator = _interopRequireDefault(__webpack_require__(/*! ./SubplotCreator */ \"./node_modules/react-chart-editor/lib/components/fields/SubplotCreator.js\"));\n\nvar _GroupCreator = _interopRequireDefault(__webpack_require__(/*! ./GroupCreator */ \"./node_modules/react-chart-editor/lib/components/fields/GroupCreator.js\"));\n\nvar _UpdateMenuButtons = _interopRequireDefault(__webpack_require__(/*! ./UpdateMenuButtons */ \"./node_modules/react-chart-editor/lib/components/fields/UpdateMenuButtons.js\"));\n\nvar _FilterOperation = __webpack_require__(/*! ./FilterOperation */ \"./node_modules/react-chart-editor/lib/components/fields/FilterOperation.js\");\n\nvar _MarkerSize = _interopRequireDefault(__webpack_require__(/*! ./MarkerSize */ \"./node_modules/react-chart-editor/lib/components/fields/MarkerSize.js\"));\n\nvar _MarkerColor = _interopRequireDefault(__webpack_require__(/*! ./MarkerColor */ \"./node_modules/react-chart-editor/lib/components/fields/MarkerColor.js\"));\n\nvar _VisibilitySelect = _interopRequireDefault(__webpack_require__(/*! ./VisibilitySelect */ \"./node_modules/react-chart-editor/lib/components/fields/VisibilitySelect.js\"));\n\nvar _DropdownCustom = _interopRequireDefault(__webpack_require__(/*! ./DropdownCustom */ \"./node_modules/react-chart-editor/lib/components/fields/DropdownCustom.js\"));\n\nvar _MultiColorPicker = _interopRequireDefault(__webpack_require__(/*! ./MultiColorPicker */ \"./node_modules/react-chart-editor/lib/components/fields/MultiColorPicker.js\"));\n\nvar _RectanglePositioner = _interopRequireDefault(__webpack_require__(/*! ./RectanglePositioner */ \"./node_modules/react-chart-editor/lib/components/fields/RectanglePositioner.js\"));\n\nvar _LocationSelector = _interopRequireDefault(__webpack_require__(/*! ./LocationSelector */ \"./node_modules/react-chart-editor/lib/components/fields/LocationSelector.js\"));\n\nvar _AxisInterval = _interopRequireDefault(__webpack_require__(/*! ./AxisInterval */ \"./node_modules/react-chart-editor/lib/components/fields/AxisInterval.js\"));\n\nvar _DateTimePicker = _interopRequireDefault(__webpack_require__(/*! ./DateTimePicker */ \"./node_modules/react-chart-editor/lib/components/fields/DateTimePicker.js\"));\n\nvar _TextPosition = _interopRequireDefault(__webpack_require__(/*! ./TextPosition */ \"./node_modules/react-chart-editor/lib/components/fields/TextPosition.js\"));\n\nvar _HoverLabelNameLength = _interopRequireDefault(__webpack_require__(/*! ./HoverLabelNameLength */ \"./node_modules/react-chart-editor/lib/components/fields/HoverLabelNameLength.js\"));\n\nvar _derived = __webpack_require__(/*! ./derived */ \"./node_modules/react-chart-editor/lib/components/fields/derived.js\");\n\nObject.keys(_derived).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function get() {\n return _derived[key];\n }\n });\n});\n\nvar _LineSelectors = __webpack_require__(/*! ./LineSelectors */ \"./node_modules/react-chart-editor/lib/components/fields/LineSelectors.js\");\n\nObject.keys(_LineSelectors).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function get() {\n return _LineSelectors[key];\n }\n });\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/fields/index.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/index.js": /*!*****************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/index.js ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar _exportNames = {\n Button: true,\n PanelMenuWrapper: true\n};\nObject.defineProperty(exports, \"Button\", {\n enumerable: true,\n get: function get() {\n return _widgets.Button;\n }\n});\nObject.defineProperty(exports, \"PanelMenuWrapper\", {\n enumerable: true,\n get: function get() {\n return _PanelMenuWrapper.default;\n }\n});\n\nvar _widgets = __webpack_require__(/*! ./widgets */ \"./node_modules/react-chart-editor/lib/components/widgets/index.js\");\n\nvar _PanelMenuWrapper = _interopRequireDefault(__webpack_require__(/*! ./PanelMenuWrapper */ \"./node_modules/react-chart-editor/lib/components/PanelMenuWrapper.js\"));\n\nvar _fields = __webpack_require__(/*! ./fields */ \"./node_modules/react-chart-editor/lib/components/fields/index.js\");\n\nObject.keys(_fields).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function get() {\n return _fields[key];\n }\n });\n});\n\nvar _containers = __webpack_require__(/*! ./containers */ \"./node_modules/react-chart-editor/lib/components/containers/index.js\");\n\nObject.keys(_containers).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function get() {\n return _containers[key];\n }\n });\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/index.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/sidebar/SidebarGroup.js": /*!********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/sidebar/SidebarGroup.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _plotlyIcons = __webpack_require__(/*! plotly-icons */ \"./node_modules/plotly-icons/lib/index.js\");\n\nvar _SidebarItem = _interopRequireDefault(__webpack_require__(/*! ./SidebarItem */ \"./node_modules/react-chart-editor/lib/components/sidebar/SidebarItem.js\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar SidebarGroup = /*#__PURE__*/function (_Component) {\n _inherits(SidebarGroup, _Component);\n\n var _super = _createSuper(SidebarGroup);\n\n function SidebarGroup(props) {\n var _this;\n\n _classCallCheck(this, SidebarGroup);\n\n _this = _super.call(this, props);\n _this.state = {\n expanded: _this.props.group === _this.props.selectedGroup\n };\n _this.toggleExpanded = _this.toggleExpanded.bind(_assertThisInitialized(_this));\n _this.onChangeGroup = _this.onChangeGroup.bind(_assertThisInitialized(_this));\n _this.renderSubItem = _this.renderSubItem.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(SidebarGroup, [{\n key: \"toggleExpanded\",\n value: function toggleExpanded() {\n this.setState({\n expanded: !this.state.expanded\n });\n }\n }, {\n key: \"onChangeGroup\",\n value: function onChangeGroup(panel) {\n this.props.onChangeGroup(this.props.group, panel);\n }\n }, {\n key: \"renderSubItem\",\n value: function renderSubItem(panel, i) {\n var _this2 = this;\n\n var isActive = this.props.selectedPanel === panel && this.props.group === this.props.selectedGroup;\n return /*#__PURE__*/_react.default.createElement(_SidebarItem.default, {\n key: 'subitem-' + i,\n active: isActive,\n onClick: function onClick() {\n return _this2.onChangeGroup(panel);\n },\n label: panel\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n group = _this$props.group,\n panels = _this$props.panels,\n selectedGroup = _this$props.selectedGroup;\n var expanded = this.state.expanded;\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: (0, _lib.bem)('sidebar__group', [expanded ? 'is-expanded' : '', selectedGroup === group ? 'is-active' : ''])\n }, /*#__PURE__*/_react.default.createElement(\"div\", {\n onClick: this.toggleExpanded,\n className: (0, _lib.bem)('sidebar__group', 'title')\n }, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: (0, _lib.bem)('sidebar__group', 'title__icon')\n }, /*#__PURE__*/_react.default.createElement(_plotlyIcons.AngleRightIcon, null)), /*#__PURE__*/_react.default.createElement(\"div\", {\n className: (0, _lib.bem)('sidebar__group', 'title__label')\n }, group)), expanded && panels.map(this.renderSubItem));\n }\n }]);\n\n return SidebarGroup;\n}(_react.Component);\n\nexports.default = SidebarGroup;\nSidebarGroup.propTypes = {\n group: _propTypes.default.string,\n onChangeGroup: _propTypes.default.func,\n panels: _propTypes.default.array,\n selectedGroup: _propTypes.default.string,\n selectedPanel: _propTypes.default.string\n};\n//# sourceMappingURL=SidebarGroup.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/sidebar/SidebarGroup.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/sidebar/SidebarItem.js": /*!*******************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/sidebar/SidebarItem.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar SidebarItem = /*#__PURE__*/function (_Component) {\n _inherits(SidebarItem, _Component);\n\n var _super = _createSuper(SidebarItem);\n\n function SidebarItem() {\n _classCallCheck(this, SidebarItem);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(SidebarItem, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n onClick = _this$props.onClick,\n label = _this$props.label,\n active = _this$props.active;\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n onClick: onClick,\n className: (0, _lib.bem)('sidebar__item', [active ? 'is-active' : ''])\n }, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: (0, _lib.bem)('sidebar__item', 'wrapper')\n }, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: (0, _lib.bem)('sidebar__item', 'label')\n }, label)));\n }\n }]);\n\n return SidebarItem;\n}(_react.Component);\n\nexports.default = SidebarItem;\nSidebarItem.propTypes = {\n active: _propTypes.default.bool,\n label: _propTypes.default.string,\n onClick: _propTypes.default.func\n};\n//# sourceMappingURL=SidebarItem.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/sidebar/SidebarItem.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/widgets/Button.js": /*!**************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/widgets/Button.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar Button = /*#__PURE__*/function (_Component) {\n _inherits(Button, _Component);\n\n var _super = _createSuper(Button);\n\n function Button(props) {\n _classCallCheck(this, Button);\n\n return _super.call(this, props);\n }\n\n _createClass(Button, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n children = _this$props.children,\n className = _this$props.className,\n icon = _this$props.icon,\n label = _this$props.label,\n variant = _this$props.variant,\n rest = _objectWithoutProperties(_this$props, [\"children\", \"className\", \"icon\", \"label\", \"variant\"]);\n\n var classes = \"button\";\n\n if (variant) {\n classes += \" button--\".concat(variant);\n } else {\n classes += \" button--default\";\n }\n\n if (className) {\n classes += \" \".concat(className);\n }\n\n var Icon = icon ? /*#__PURE__*/_react.default.createElement(\"div\", {\n className: (0, _lib.bem)('button', 'icon')\n }, icon) : null;\n return /*#__PURE__*/_react.default.createElement(\"button\", _extends({\n className: classes\n }, rest), /*#__PURE__*/_react.default.createElement(\"div\", {\n className: (0, _lib.bem)('button', 'wrapper')\n }, Icon, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"button__label\"\n }, label ? label : children)));\n }\n }]);\n\n return Button;\n}(_react.Component);\n\nButton.propTypes = {\n children: _propTypes.default.node,\n className: _propTypes.default.any,\n icon: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),\n label: _propTypes.default.any,\n variant: _propTypes.default.string\n};\nvar _default = Button;\nexports.default = _default;\n//# sourceMappingURL=Button.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/widgets/Button.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/widgets/CheckboxGroup.js": /*!*********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/widgets/CheckboxGroup.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ \"./node_modules/classnames/index.js\"));\n\nvar _plotlyIcons = __webpack_require__(/*! plotly-icons */ \"./node_modules/plotly-icons/lib/index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar CheckboxGroup = /*#__PURE__*/function (_Component) {\n _inherits(CheckboxGroup, _Component);\n\n var _super = _createSuper(CheckboxGroup);\n\n function CheckboxGroup(props) {\n var _this;\n\n _classCallCheck(this, CheckboxGroup);\n\n _this = _super.call(this, props);\n _this.state = {\n options: _this.props.options\n };\n _this.handleChange = _this.handleChange.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(CheckboxGroup, [{\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps) {\n this.setState({\n options: nextProps.options\n });\n }\n }, {\n key: \"handleChange\",\n value: function handleChange(i) {\n var newOptions = this.props.options.slice();\n newOptions[i] = Object.assign(newOptions[i], {\n checked: !newOptions[i].checked\n });\n this.props.onChange(newOptions);\n }\n }, {\n key: \"renderOptions\",\n value: function renderOptions() {\n var _this2 = this;\n\n return this.state.options.map(function (option, i) {\n var checkClass = (0, _classnames.default)(['checkbox__check', 'icon'], {\n 'checkbox__check--checked': option.checked\n });\n var itemClass = (0, _classnames.default)('checkbox__item', {\n 'checkbox__item--vertical': _this2.props.orientation === 'vertical',\n 'checkbox__item--horizontal': _this2.props.orientation === 'horizontal'\n });\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n key: i,\n className: itemClass\n }, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"checkbox__box\".concat(option.checked ? ' checkbox__box--checked' : ''),\n onClick: function onClick() {\n return _this2.handleChange(i);\n }\n }, option.checked && /*#__PURE__*/_react.default.createElement(\"div\", {\n className: checkClass\n }, /*#__PURE__*/_react.default.createElement(_plotlyIcons.CheckIcon, null))), /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"checkbox__label\",\n onClick: function onClick() {\n return _this2.handleChange(i);\n }\n }, option.label));\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var boxClass = (0, _classnames.default)('checkbox__group', this.props.className, {\n checkbox__group_horizontal: this.props.orientation === 'horizontal'\n });\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: boxClass\n }, this.renderOptions());\n }\n }]);\n\n return CheckboxGroup;\n}(_react.Component);\n\nCheckboxGroup.propTypes = {\n options: _propTypes.default.arrayOf(_propTypes.default.shape({\n label: _propTypes.default.string.isRequired,\n value: _propTypes.default.string.isRequired,\n checked: _propTypes.default.bool.isRequired\n })).isRequired,\n onChange: _propTypes.default.func,\n className: _propTypes.default.string,\n orientation: _propTypes.default.string\n};\nCheckboxGroup.defaultProps = {\n className: ''\n};\nvar _default = CheckboxGroup;\nexports.default = _default;\n//# sourceMappingURL=CheckboxGroup.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/widgets/CheckboxGroup.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/widgets/ColorPicker.js": /*!*******************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/widgets/ColorPicker.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _SketchFields = _interopRequireDefault(__webpack_require__(/*! react-color/lib/components/sketch/SketchFields */ \"./node_modules/react-color/lib/components/sketch/SketchFields.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _tinycolor = _interopRequireDefault(__webpack_require__(/*! tinycolor2 */ \"./node_modules/tinycolor2/tinycolor.js\"));\n\nvar _common = __webpack_require__(/*! react-color/lib/components/common */ \"./node_modules/react-color/lib/components/common/index.js\");\n\nvar _reactColor = __webpack_require__(/*! react-color */ \"./node_modules/react-color/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n// Utility functions for converting ColorPicker color objects or raw strings\n// into TinyColor objects.\nvar extractRGB = function extractRGB(c) {\n return c.rgb || c;\n};\n\nvar getColorSource = function getColorSource(c) {\n return c.source === 'hex' ? c.hex : extractRGB(c);\n};\n\nvar toTinyColor = function toTinyColor(c) {\n return (0, _tinycolor.default)(getColorSource(c));\n};\n\nvar Custom = /*#__PURE__*/function (_Component) {\n _inherits(Custom, _Component);\n\n var _super = _createSuper(Custom);\n\n function Custom() {\n _classCallCheck(this, Custom);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(Custom, [{\n key: \"render\",\n value: function render() {\n var onChangeComplete = this.props.onChangeComplete;\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"colorpicker__outer\"\n }, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"colorpicker__controls +flex\"\n }, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"colorpicker__sliders\"\n }, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"colorpicker__slider\"\n }, /*#__PURE__*/_react.default.createElement(_common.Hue, this.props)))), /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"colorpicker__saturation\"\n }, /*#__PURE__*/_react.default.createElement(_common.Saturation, this.props)), /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"colorpicker__custom-input\"\n }, /*#__PURE__*/_react.default.createElement(_SketchFields.default, _extends({}, this.props, {\n onChange: onChangeComplete\n }))));\n }\n }]);\n\n return Custom;\n}(_react.Component);\n\nCustom.propTypes = {\n rgb: _propTypes.default.object,\n onChangeComplete: _propTypes.default.func\n};\nvar CustomColorPicker = (0, _reactColor.CustomPicker)(Custom);\n\nvar ColorPicker = /*#__PURE__*/function (_Component2) {\n _inherits(ColorPicker, _Component2);\n\n var _super2 = _createSuper(ColorPicker);\n\n function ColorPicker(props) {\n var _this;\n\n _classCallCheck(this, ColorPicker);\n\n _this = _super2.call(this, props);\n _this.state = {\n isVisible: false\n };\n _this.onSelectedColorChange = _this.onSelectedColorChange.bind(_assertThisInitialized(_this));\n _this.toggleVisible = _this.toggleVisible.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(ColorPicker, [{\n key: \"onSelectedColorChange\",\n value: function onSelectedColorChange(newColor) {\n // We use our own toTinyColor because this value is a ColorPicker\n // color value which is an object that needs unpacking. We also handle\n // the case where a color string is passed in (just in case).\n var color = toTinyColor(newColor); // relayout call only wants a RGB String\n\n this.props.onColorChange(color.toRgbString());\n }\n }, {\n key: \"toggleVisible\",\n value: function toggleVisible() {\n this.setState({\n isVisible: !this.state.isVisible\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n // We use tinycolor here instead of our own toTinyColor as\n // tinycolor handles `null` values and other weirdness we may\n // expect from user data.\n var selectedColor = (0, _tinycolor.default)(this.props.selectedColor);\n var colorText = selectedColor.toHexString(); // Convert rgba to rgb if necessary\n\n var rgbString = selectedColor._a !== 0 ? selectedColor.toRgbString() : \"rgb(\".concat(selectedColor._r, \",\").concat(selectedColor._g, \",\").concat(selectedColor._b, \")\"); // We need inline style here to assign the background color\n // dynamically.\n\n var swatchStyle = {\n backgroundColor: rgbString\n };\n return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"colorpicker__container\"\n }, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"colorpicker\"\n }, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"colorpicker__swatch +cursor-clickable\",\n style: swatchStyle,\n onClick: this.toggleVisible\n })), /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"colorpicker__selected-color +hover-grey\",\n onClick: this.toggleVisible\n }, colorText)), this.state.isVisible && /*#__PURE__*/_react.default.createElement(CustomColorPicker, {\n color: rgbString,\n onChangeComplete: this.onSelectedColorChange\n }));\n }\n }]);\n\n return ColorPicker;\n}(_react.Component);\n\nColorPicker.propTypes = {\n onColorChange: _propTypes.default.func.isRequired,\n selectedColor: _propTypes.default.string\n};\nvar _default = ColorPicker;\nexports.default = _default;\n//# sourceMappingURL=ColorPicker.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/widgets/ColorPicker.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/widgets/ColorscalePicker.js": /*!************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/widgets/ColorscalePicker.js ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _reactColorscales = _interopRequireWildcard(__webpack_require__(/*! react-colorscales */ \"./node_modules/react-colorscales/build/index.js\"));\n\nvar _Dropdown = _interopRequireDefault(__webpack_require__(/*! ./Dropdown */ \"./node_modules/react-chart-editor/lib/components/widgets/Dropdown.js\"));\n\nvar _Info = _interopRequireDefault(__webpack_require__(/*! ../fields/Info */ \"./node_modules/react-chart-editor/lib/components/fields/Info.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n// CAREFUL: needs to be the same value as $colorscalepicker-width in _colorscalepicker.scss\nvar colorscalepickerContainerWidth = 240;\n\nvar Scale = /*#__PURE__*/function (_Component) {\n _inherits(Scale, _Component);\n\n var _super = _createSuper(Scale);\n\n function Scale(props) {\n var _this;\n\n _classCallCheck(this, Scale);\n\n _this = _super.call(this, props);\n _this.state = {\n selectedColorscaleType: props.initialCategory || 'sequential',\n showColorscalePicker: false\n };\n _this.onChange = _this.onChange.bind(_assertThisInitialized(_this));\n _this.onClick = _this.onClick.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(Scale, [{\n key: \"onClick\",\n value: function onClick() {\n this.setState({\n showColorscalePicker: !this.state.showColorscalePicker\n });\n }\n }, {\n key: \"onChange\",\n value: function onChange(selectedColorscaleType) {\n this.setState({\n selectedColorscaleType: selectedColorscaleType\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n onColorscaleChange = _this$props.onColorscaleChange,\n selected = _this$props.selected,\n disableCategorySwitch = _this$props.disableCategorySwitch;\n var _this$state = this.state,\n selectedColorscaleType = _this$state.selectedColorscaleType,\n showColorscalePicker = _this$state.showColorscalePicker;\n var description = _reactColorscales.COLOR_PICKER_CONSTANTS.COLORSCALE_DESCRIPTIONS[selectedColorscaleType];\n\n var colorscaleOptions = _reactColorscales.COLOR_PICKER_CONSTANTS.COLORSCALE_TYPES.filter(function (type) {\n return type !== 'custom';\n }).map(function (type) {\n return {\n label: type + ' scales',\n value: type\n };\n });\n\n var _ = this.context.localize;\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"customPickerContainer\"\n }, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"customPickerContainer__clickable\"\n }, /*#__PURE__*/_react.default.createElement(_reactColorscales.Colorscale, {\n colorscale: selected,\n onClick: this.onClick\n })), showColorscalePicker ? /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"customPickerContainer__expanded-content\"\n }, disableCategorySwitch ? null : /*#__PURE__*/_react.default.createElement(_Dropdown.default, {\n options: colorscaleOptions,\n value: selectedColorscaleType,\n onChange: this.onChange,\n clearable: false,\n searchable: false,\n placeholder: _('Select a Colorscale Type'),\n className: \"customPickerContainer__category-dropdown\"\n }), description ? /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"customPickerContainer__palettes\"\n }, /*#__PURE__*/_react.default.createElement(_reactColorscales.default, {\n onChange: onColorscaleChange,\n colorscale: selected,\n width: colorscalepickerContainerWidth,\n colorscaleType: this.state.selectedColorscaleType,\n onColorscaleTypeChange: this.onColorscaleTypeChange,\n disableSwatchControls: true,\n scaleLength: 7\n }), /*#__PURE__*/_react.default.createElement(_Info.default, {\n className: \"customPickerContainer__info\"\n }, description)) : null) : null);\n }\n }]);\n\n return Scale;\n}(_react.Component);\n\nScale.propTypes = {\n onColorscaleChange: _propTypes.default.func,\n selected: _propTypes.default.array,\n label: _propTypes.default.string,\n initialCategory: _propTypes.default.string,\n disableCategorySwitch: _propTypes.default.bool\n};\nScale.contextTypes = {\n localize: _propTypes.default.func\n};\nvar _default = Scale;\nexports.default = _default;\n//# sourceMappingURL=ColorscalePicker.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/widgets/ColorscalePicker.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/widgets/DateTimePicker.js": /*!**********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/widgets/DateTimePicker.js ***! \**********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\n__webpack_require__(/*! react-day-picker/lib/style.css */ \"./node_modules/react-day-picker/lib/style.css\");\n\nvar _plotlyIcons = __webpack_require__(/*! plotly-icons */ \"./node_modules/plotly-icons/lib/index.js\");\n\nvar _dates = __webpack_require__(/*! plotly.js/src/lib/dates */ \"./node_modules/plotly.js/src/lib/dates.js\");\n\nvar _reactDayPicker = _interopRequireDefault(__webpack_require__(/*! react-day-picker */ \"./node_modules/react-day-picker/build/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _TextInput = _interopRequireDefault(__webpack_require__(/*! ./TextInput */ \"./node_modules/react-chart-editor/lib/components/widgets/TextInput.js\"));\n\nvar _Dropdown = _interopRequireDefault(__webpack_require__(/*! ./Dropdown */ \"./node_modules/react-chart-editor/lib/components/widgets/Dropdown.js\"));\n\nvar _constants = __webpack_require__(/*! ../../lib/constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar testDate = '2000-01-01';\nvar testTime = '00:00';\nvar datePlaceholder = 'yyyy-mm-dd';\nvar timePlaceholder = 'hh:mm:ss.xxx';\n\nvar DateTimePicker = /*#__PURE__*/function (_Component) {\n _inherits(DateTimePicker, _Component);\n\n var _super = _createSuper(DateTimePicker);\n\n function DateTimePicker(props, context) {\n var _this;\n\n _classCallCheck(this, DateTimePicker);\n\n _this = _super.call(this, props, context);\n\n var _this$parsePlotlyJSDa = _this.parsePlotlyJSDateTime(props.value),\n time = _this$parsePlotlyJSDa.time,\n date = _this$parsePlotlyJSDa.date;\n\n var isValidTime = (0, _dates.isDateTime)(testDate + ' ' + time) || ['', timePlaceholder, _constants.MULTI_VALUED_PLACEHOLDER].includes(time);\n var isValidDate = (0, _dates.isDateTime)(date + ' ' + testTime) || ['', datePlaceholder, _constants.MULTI_VALUED_PLACEHOLDER].includes(date);\n _this.state = {\n calendarOpen: false,\n dateInputClassName: isValidDate ? 'datetimepicker-container-date-input' : 'datetimepicker-container-date-input +error',\n timeInputClassName: isValidTime ? 'datetimepicker-container-time-input' : 'datetimepicker-container-time-input +error',\n timeValue: time,\n dateValue: date,\n AMPM: _this.getAMPM(date, time, context.localize)\n };\n _this.toPlotlyJSDate = _this.toPlotlyJSDate.bind(_assertThisInitialized(_this));\n _this.onMonthChange = _this.onMonthChange.bind(_assertThisInitialized(_this));\n _this.onYearChange = _this.onYearChange.bind(_assertThisInitialized(_this));\n _this.onTimeChange = _this.onTimeChange.bind(_assertThisInitialized(_this));\n _this.onDateChange = _this.onDateChange.bind(_assertThisInitialized(_this));\n _this.onTimeUpdate = _this.onTimeUpdate.bind(_assertThisInitialized(_this));\n _this.onDateUpdate = _this.onDateUpdate.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(DateTimePicker, [{\n key: \"toPlotlyJSDate\",\n value: function toPlotlyJSDate(value) {\n var ms = (0, _dates.dateTime2ms)(value);\n return (0, _dates.ms2DateTime)(ms);\n }\n }, {\n key: \"getYearOptions\",\n value: function getYearOptions(current) {\n // eslint-disable-next-line\n var base = 5;\n var yearAsNumber = parseInt(current, 10);\n var lastFive = new Array(base).fill(0).map(function (year, index) {\n var newOption = yearAsNumber - (base - index);\n return {\n label: newOption,\n value: newOption\n };\n });\n var nextFive = new Array(base).fill(0).map(function (year, index) {\n var newOption = yearAsNumber + (index + 1);\n return {\n label: newOption,\n value: newOption\n };\n });\n return lastFive.concat([{\n label: current,\n value: current\n }]).concat(nextFive);\n }\n }, {\n key: \"getMonthOptions\",\n value: function getMonthOptions() {\n var _ = this.context.localize;\n return [{\n label: _('January'),\n value: 0\n }, {\n label: _('February'),\n value: 1\n }, {\n label: _('March'),\n value: 2\n }, {\n label: _('April'),\n value: 3\n }, {\n label: _('May'),\n value: 4\n }, {\n label: _('June'),\n value: 5\n }, {\n label: _('July'),\n value: 6\n }, {\n label: _('August'),\n value: 7\n }, {\n label: _('September'),\n value: 8\n }, {\n label: _('October'),\n value: 9\n }, {\n label: _('November'),\n value: 10\n }, {\n label: _('December'),\n value: 11\n }];\n }\n }, {\n key: \"onMonthChange\",\n value: function onMonthChange(value) {\n var currentDateInJS = new Date(this.getAdjustedPlotlyJSDateTime(this.props.value));\n currentDateInJS.setMonth(value);\n var plotlyJSDate = this.toPlotlyJSDate(currentDateInJS);\n\n if ((0, _dates.isDateTime)(plotlyJSDate)) {\n this.props.onChange(plotlyJSDate);\n }\n\n var _this$parsePlotlyJSDa2 = this.parsePlotlyJSDateTime(plotlyJSDate),\n time = _this$parsePlotlyJSDa2.time,\n date = _this$parsePlotlyJSDa2.date;\n\n this.setState({\n timeValue: time,\n dateValue: date\n });\n }\n }, {\n key: \"onYearChange\",\n value: function onYearChange(value) {\n var currentDateInJS = new Date(this.getAdjustedPlotlyJSDateTime(this.props.value));\n currentDateInJS.setFullYear(value);\n var plotlyJSDate = this.toPlotlyJSDate(currentDateInJS);\n\n if ((0, _dates.isDateTime)(plotlyJSDate)) {\n this.props.onChange(plotlyJSDate);\n }\n\n var _this$parsePlotlyJSDa3 = this.parsePlotlyJSDateTime(plotlyJSDate),\n time = _this$parsePlotlyJSDa3.time,\n date = _this$parsePlotlyJSDa3.date;\n\n this.setState({\n timeValue: time,\n dateValue: date\n });\n }\n }, {\n key: \"parsePlotlyJSDateTime\",\n value: function parsePlotlyJSDateTime(value) {\n var parsed = value.split(' ');\n return {\n date: parsed[0],\n time: parsed[1] ? parsed[1] : ''\n };\n }\n }, {\n key: \"getAMPM\",\n value: function getAMPM(date, time, _) {\n var plotlyJSDateTime = date + ' ' + time;\n var isValidDateTime = (0, _dates.isDateTime)(plotlyJSDateTime);\n var JSDate = new Date(this.getAdjustedPlotlyJSDateTime(plotlyJSDateTime));\n var localeTime = JSDate.toLocaleTimeString('en-US').split(' ');\n var parsedTime = time.split(':').reduce(function (timeArray, timePart) {\n var parsed = timePart.split('.');\n return timeArray.concat(parsed);\n }, []);\n var isNoon = parsedTime[0] === '12' && parsedTime.slice(1).every(function (part) {\n return parseInt(part, 10) === 0;\n });\n return !isValidDateTime || time === '' || JSDate.toDateString() === 'Invalid Date' ? '' : localeTime[1] === 'PM' ? isNoon ? _('noon') : 'PM' : 'AM';\n }\n }, {\n key: \"adjustedTime\",\n value: function adjustedTime(time) {\n if (time.toString().length <= 2) {\n return time + ':00';\n }\n\n return time;\n }\n }, {\n key: \"onTimeChange\",\n value: function onTimeChange(value) {\n var _this$parsePlotlyJSDa4 = this.parsePlotlyJSDateTime(this.props.value),\n currentDate = _this$parsePlotlyJSDa4.date;\n\n var isValidTime = (0, _dates.isDateTime)(testDate + ' ' + value);\n this.setState({\n timeInputClassName: isValidTime || value === '' ? 'datetimepicker-container-time-input' : 'datetimepicker-container-time-input +error',\n timeValue: value,\n AMPM: this.getAMPM(currentDate, value, this.context.localize)\n });\n }\n }, {\n key: \"onDateChange\",\n value: function onDateChange(value) {\n var isValidDate = (0, _dates.isDateTime)(value + ' ' + testTime);\n this.setState({\n dateInputClassName: isValidDate || value === '' ? 'datetimepicker-container-date-input' : 'datetimepicker-container-date-input +error',\n dateValue: value\n });\n }\n }, {\n key: \"onTimeUpdate\",\n value: function onTimeUpdate(value) {\n var _this$parsePlotlyJSDa5 = this.parsePlotlyJSDateTime(this.props.value),\n currentTime = _this$parsePlotlyJSDa5.time,\n currentDate = _this$parsePlotlyJSDa5.date;\n\n var isValidTime = (0, _dates.isDateTime)(testDate + ' ' + value);\n\n if (value === '') {\n this.setState({\n timeInputClassName: 'datetimepicker-container-time-input',\n timeValue: currentTime,\n AMPM: this.getAMPM(currentDate, currentTime, this.context.localize)\n });\n return;\n }\n\n if (isValidTime) {\n this.props.onChange(currentDate + ' ' + value);\n }\n }\n }, {\n key: \"onDateUpdate\",\n value: function onDateUpdate(value) {\n var _this$parsePlotlyJSDa6 = this.parsePlotlyJSDateTime(this.props.value),\n currentDate = _this$parsePlotlyJSDa6.date,\n currentTime = _this$parsePlotlyJSDa6.time;\n\n var isValidDate = (0, _dates.isDateTime)(value + ' ' + testTime);\n\n if (isValidDate) {\n this.props.onChange(value + ' ' + currentTime);\n return;\n }\n\n if (value === '') {\n this.setState({\n dateValue: currentDate,\n dateInputClassName: 'datetimepicker-container-date-input'\n });\n return;\n }\n }\n }, {\n key: \"getAdjustedPlotlyJSDateTime\",\n value: function getAdjustedPlotlyJSDateTime(dateTimeString) {\n var _this$parsePlotlyJSDa7 = this.parsePlotlyJSDateTime(dateTimeString),\n date = _this$parsePlotlyJSDa7.date,\n time = _this$parsePlotlyJSDa7.time;\n\n return date + ' ' + this.adjustedTime(time);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var JSDate = new Date(this.getAdjustedPlotlyJSDateTime(this.state.dateValue + ' ' + testTime));\n var isValidJSDate = JSDate.toDateString() !== 'Invalid Date';\n var currentYear = isValidJSDate ? JSDate.getFullYear() : new Date().getFullYear();\n var currentMonth = isValidJSDate ? JSDate.getMonth() : new Date().getMonth();\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"datetimepicker-container\"\n }, /*#__PURE__*/_react.default.createElement(_TextInput.default, {\n value: this.state.dateValue,\n editableClassName: this.state.dateInputClassName,\n onChange: this.onDateChange,\n onUpdate: this.onDateUpdate,\n placeholder: datePlaceholder\n }), /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"datetimepicker-container-icons\"\n }, /*#__PURE__*/_react.default.createElement(_plotlyIcons.CalendarMultiselectIcon, {\n onClick: function onClick() {\n return _this2.setState({\n calendarOpen: !_this2.state.calendarOpen\n });\n },\n className: this.state.calendarOpen ? 'datetimepicker-date-icon--selected' : 'datetimepicker-date-icon'\n })), this.state.calendarOpen ? /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"datetimepicker-container__content\"\n }, this.state.calendarOpen ? /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"datetimepicker-datepicker-container\"\n }, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"datetimepicker-datepicker-navbar\"\n }, /*#__PURE__*/_react.default.createElement(_Dropdown.default, {\n options: this.getMonthOptions(),\n value: currentMonth,\n className: \"datimepicker-monthpicker\",\n clearable: false,\n onChange: this.onMonthChange\n }), /*#__PURE__*/_react.default.createElement(_Dropdown.default, {\n options: this.getYearOptions(currentYear),\n value: currentYear,\n className: \"datimepicker-yearpicker\",\n clearable: false,\n onChange: this.onYearChange\n })), /*#__PURE__*/_react.default.createElement(_reactDayPicker.default, {\n className: \"datepicker-container-rce\",\n modifiers: {\n highlighted: isValidJSDate ? JSDate : ''\n },\n month: isValidJSDate ? JSDate : new Date(),\n onDayClick: function onDayClick(value) {\n var plotlyDate = _this2.toPlotlyJSDate(value).split(' ')[0];\n\n _this2.onDateChange(plotlyDate);\n\n _this2.onDateUpdate(plotlyDate);\n }\n })) : null) : null, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"datetimepicker-container-time\"\n }, /*#__PURE__*/_react.default.createElement(_TextInput.default, {\n value: this.state.timeValue,\n onChange: this.onTimeChange,\n onUpdate: this.onTimeUpdate,\n placeholder: timePlaceholder,\n editableClassName: this.state.timeInputClassName\n }), /*#__PURE__*/_react.default.createElement(\"span\", {\n className: \"datetimepicker-date-units\"\n }, this.state.AMPM)));\n }\n }]);\n\n return DateTimePicker;\n}(_react.Component);\n\nexports.default = DateTimePicker;\nDateTimePicker.propTypes = {\n value: _propTypes.default.string.isRequired,\n onChange: _propTypes.default.func.isRequired\n};\nDateTimePicker.contextTypes = {\n localize: _propTypes.default.func\n};\n//# sourceMappingURL=DateTimePicker.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/widgets/DateTimePicker.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/widgets/Dropdown.js": /*!****************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/widgets/Dropdown.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _reactSelect = _interopRequireDefault(__webpack_require__(/*! react-select */ \"./node_modules/react-select/dist/react-select.esm.js\"));\n\nvar _classnames2 = _interopRequireDefault(__webpack_require__(/*! classnames */ \"./node_modules/classnames/index.js\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar Dropdown = /*#__PURE__*/function (_Component) {\n _inherits(Dropdown, _Component);\n\n var _super = _createSuper(Dropdown);\n\n function Dropdown(props) {\n var _this;\n\n _classCallCheck(this, Dropdown);\n\n _this = _super.call(this, props);\n _this.onChange = _this.onChange.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(Dropdown, [{\n key: \"onChange\",\n value: function onChange(selection) {\n var _this$props = this.props,\n multi = _this$props.multi,\n onChange = _this$props.onChange,\n valueKey = _this$props.valueKey;\n\n if (!selection) {\n return onChange(null);\n }\n\n return multi ? onChange(selection.map(function (s) {\n return s[valueKey];\n })) : onChange(selection[valueKey]);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props2 = this.props,\n minWidth = _this$props2.minWidth,\n placeholder = _this$props2.placeholder,\n clearable = _this$props2.clearable,\n value = _this$props2.value,\n options = _this$props2.options,\n searchable = _this$props2.searchable,\n multi = _this$props2.multi,\n noResultsText = _this$props2.noResultsText,\n valueKey = _this$props2.valueKey,\n disabled = _this$props2.disabled,\n className = _this$props2.className,\n width = _this$props2.width;\n var _ = this.context.localize;\n var dropdownStyle = {\n minWidth: minWidth\n };\n\n if (width) {\n dropdownStyle.width = width;\n }\n\n var opts = options.map(function (opt) {\n return typeof opt === 'string' ? _defineProperty({\n label: opt\n }, valueKey, opt) : opt;\n });\n var dropdownContainerClass = (0, _classnames2.default)('dropdown-container', _defineProperty({\n 'dropdown--dark': this.props.backgroundDark\n }, className, className));\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: dropdownContainerClass,\n style: dropdownStyle\n }, /*#__PURE__*/_react.default.createElement(_reactSelect.default, {\n placeholder: placeholder || _('Select an Option'),\n isClearable: clearable,\n value: opts.filter(function (o) {\n return Array.isArray(value) ? value.includes(o[valueKey]) : value === o[valueKey];\n }),\n options: opts,\n isSearchable: searchable,\n onChange: this.onChange,\n isMulti: multi,\n noOptionsMessage: function noOptionsMessage() {\n return noResultsText || _('No Results');\n },\n getOptionValue: function getOptionValue(o) {\n return o[valueKey];\n },\n getOptionLabel: function getOptionLabel(o) {\n return o.label;\n },\n isDisabled: disabled,\n className: dropdownContainerClass,\n classNamePrefix: \"Select\",\n components: this.props.components\n }));\n }\n }]);\n\n return Dropdown;\n}(_react.Component);\n\nDropdown.defaultProps = {\n clearable: true,\n multi: false,\n searchable: false,\n minWidth: '120px',\n valueKey: 'value',\n disabled: false\n};\nDropdown.propTypes = {\n backgroundDark: _propTypes.default.bool,\n clearable: _propTypes.default.bool,\n onChange: _propTypes.default.func.isRequired,\n options: _propTypes.default.array.isRequired,\n placeholder: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]),\n searchable: _propTypes.default.bool,\n minWidth: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),\n valueKey: _propTypes.default.string,\n value: _propTypes.default.any,\n multi: _propTypes.default.bool,\n components: _propTypes.default.object,\n noResultsText: _propTypes.default.string,\n disabled: _propTypes.default.bool,\n className: _propTypes.default.string,\n width: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number])\n};\nDropdown.contextTypes = {\n localize: _propTypes.default.func\n};\nvar _default = Dropdown;\nexports.default = _default;\n//# sourceMappingURL=Dropdown.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/widgets/Dropdown.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/widgets/Dropzone.js": /*!****************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/widgets/Dropzone.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _reactDropzone = _interopRequireDefault(__webpack_require__(/*! react-dropzone */ \"./node_modules/react-dropzone/dist/es/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar Dropzone = /*#__PURE__*/function (_Component) {\n _inherits(Dropzone, _Component);\n\n var _super = _createSuper(Dropzone);\n\n function Dropzone(props, context) {\n var _this;\n\n _classCallCheck(this, Dropzone);\n\n _this = _super.call(this, props, context);\n _this.state = {\n content: ''\n };\n _this.validFiletypes = {\n image: 'image/jpeg, image/jpg, image/svg, image/png, image/gif, image/bmp, image/webp',\n geojson: 'application/json'\n };\n _this.onDrop = _this.onDrop.bind(_assertThisInitialized(_this));\n _this.parsingError = _this.parsingError.bind(_assertThisInitialized(_this));\n _this.renderSuccess = _this.renderSuccess.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(Dropzone, [{\n key: \"renderSuccess\",\n value: function renderSuccess(value) {\n var _ = this.context.localize;\n\n if (this.props.fileType === 'image') {\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"dropzone-container__image\",\n style: {\n backgroundImage: \"url(\".concat(value, \")\")\n }\n });\n }\n\n if (this.props.fileType === 'geojson') {\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"dropzone-container__message\"\n }, /*#__PURE__*/_react.default.createElement(\"p\", null, _('GeoJSON loaded!')), /*#__PURE__*/_react.default.createElement(\"p\", null, value.features.length + _(' features detected.')));\n }\n\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"dropzone-container__message\"\n }, _('File loaded!'));\n }\n }, {\n key: \"componentWillMount\",\n value: function componentWillMount() {\n var _ = this.context.localize;\n\n if (this.props.value && this.props.value !== '') {\n this.setState({\n content: this.renderSuccess(this.props.value)\n });\n return;\n }\n\n this.setState({\n content: /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"dropzone-container__message\"\n }, /*#__PURE__*/_react.default.createElement(\"p\", null, _('Drop the ') + this.props.fileType + _(' to upload here or click to choose a file from your computer.')), this.validFiletypes[this.props.fileType] ? /*#__PURE__*/_react.default.createElement(\"p\", null, _('Supported formats are: ') + this.validFiletypes[this.props.fileType].split('image/').join('') + '.') : null)\n });\n }\n }, {\n key: \"parsingError\",\n value: function parsingError() {\n var _ = this.context.localize;\n var supportedFileTypes = this.props.fileType === 'image' ? this.validFiletypes[this.props.fileType].split('image/').join('') : this.validFiletypes[this.props.fileType];\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"dropzone-container__message\"\n }, _(\"Yikes! This doesn't look like a valid \") + this.props.fileType, /*#__PURE__*/_react.default.createElement(\"p\", null, _('Try again with a supported file format: ') + supportedFileTypes + '.'));\n }\n }, {\n key: \"onLoad\",\n value: function onLoad(e) {\n try {\n var payload = e.target.result;\n var parsedValue = this.props.fileType === 'image' ? payload : JSON.parse(payload);\n this.props.onUpdate(parsedValue);\n this.setState({\n content: this.renderSuccess(parsedValue)\n });\n } catch (error) {\n console.warn(error); // eslint-disable-line\n\n this.setState({\n content: this.parsingError()\n });\n }\n }\n }, {\n key: \"onDrop\",\n value: function onDrop(accepted, rejected) {\n var _this2 = this;\n\n var _ = this.context.localize;\n var reader = new FileReader();\n\n if (accepted.length) {\n if (accepted.length > 1) {\n this.setState({\n content: /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"dropzone-container__message\"\n }, /*#__PURE__*/_react.default.createElement(\"p\", null, _('Yikes! You can only upload one file at a time.')))\n });\n return;\n }\n\n this.setState({\n content: _('Loading...')\n });\n\n reader.onload = function (e) {\n return _this2.onLoad(e);\n };\n\n if (this.props.fileType === 'image') {\n reader.readAsDataURL(accepted[0]);\n } else if (this.props.fileType === 'geojson') {\n reader.readAsText(accepted[0]);\n }\n }\n\n if (rejected.length) {\n this.setState({\n content: this.parsingError()\n });\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this3 = this;\n\n return /*#__PURE__*/_react.default.createElement(_reactDropzone.default, {\n accept: this.validFiletypes[this.props.fileType],\n onDrop: this.onDrop,\n activeClassName: \"dropzone-container--active\",\n rejectClassName: \"dropzone-container--rejected\"\n }, function (_ref) {\n var getRootProps = _ref.getRootProps,\n getInputProps = _ref.getInputProps;\n return /*#__PURE__*/_react.default.createElement(\"div\", _extends({}, getRootProps(), {\n className: \"dropzone-container\"\n }), /*#__PURE__*/_react.default.createElement(\"input\", getInputProps()), /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"dropzone-container__content\"\n }, _this3.state.content));\n });\n }\n }]);\n\n return Dropzone;\n}(_react.Component);\n\nDropzone.propTypes = {\n fileType: _propTypes.default.string.isRequired,\n onUpdate: _propTypes.default.func,\n value: _propTypes.default.any\n};\nDropzone.contextTypes = {\n localize: _propTypes.default.func\n};\nvar _default = Dropzone;\nexports.default = _default;\n//# sourceMappingURL=Dropzone.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/widgets/Dropzone.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/widgets/EditableText.js": /*!********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/widgets/EditableText.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar ENTER_KEYCODE = 13; // A generic component to handle text that can be edited when the user\n// clicks on it.\n\nvar EditableText = /*#__PURE__*/function (_Component) {\n _inherits(EditableText, _Component);\n\n var _super = _createSuper(EditableText);\n\n function EditableText(props) {\n var _this;\n\n _classCallCheck(this, EditableText);\n\n _this = _super.call(this, props);\n _this.handleFocus = _this.handleFocus.bind(_assertThisInitialized(_this));\n _this.handleChange = _this.handleChange.bind(_assertThisInitialized(_this));\n _this.handleUpdate = _this.handleUpdate.bind(_assertThisInitialized(_this));\n _this.handleKeyPress = _this.handleKeyPress.bind(_assertThisInitialized(_this));\n _this.handleWheel = _this.handleWheel.bind(_assertThisInitialized(_this));\n _this.getRef = _this.getRef.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(EditableText, [{\n key: \"getRef\",\n value: function getRef(c) {\n this._ref = c;\n } // Selects/highlights all of the text in the filename input\n\n }, {\n key: \"handleFocus\",\n value: function handleFocus(event) {\n event.target.select();\n }\n }, {\n key: \"handleChange\",\n value: function handleChange(event) {\n var onChange = this.props.onChange;\n\n if (onChange) {\n onChange(event.target.value);\n }\n }\n }, {\n key: \"handleUpdate\",\n value: function handleUpdate(event) {\n var onUpdate = this.props.onUpdate;\n\n if (onUpdate) {\n onUpdate(event.target.value);\n }\n }\n }, {\n key: \"handleKeyPress\",\n value: function handleKeyPress(event) {\n // This will force handleUpdate to be called via the input's onBlur\n if ((event.keyCode || event.which) === ENTER_KEYCODE) {\n this._ref.blur();\n }\n }\n }, {\n key: \"handleWheel\",\n value: function handleWheel(event) {\n if (this.props.onWheel && document.activeElement === this._ref) {\n this.props.onWheel(event);\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n type = _this$props.type,\n className = _this$props.className,\n text = _this$props.text,\n disable = _this$props.disable,\n autoFocus = _this$props.autoFocus,\n onKeyDown = _this$props.onKeyDown,\n placeholder = _this$props.placeholder,\n readOnly = _this$props.readOnly,\n size = _this$props.size;\n return /*#__PURE__*/_react.default.createElement(\"input\", {\n ref: this.getRef,\n type: type,\n className: className || '',\n value: text,\n onFocus: this.handleFocus,\n onChange: this.handleChange,\n onBlur: this.handleUpdate,\n disabled: disable,\n autoFocus: autoFocus,\n onKeyPress: this.handleKeyPress,\n onKeyDown: onKeyDown,\n onWheel: this.handleWheel,\n placeholder: placeholder,\n readOnly: readOnly,\n size: size\n });\n }\n }]);\n\n return EditableText;\n}(_react.Component);\n\nEditableText.propTypes = {\n // Called with input value on changes (as the user types)\n onChange: _propTypes.default.func,\n // Called with input value on blur (and enter if no onEnter is given)\n onUpdate: _propTypes.default.func,\n // Called on input keyDown events\n onKeyDown: _propTypes.default.func,\n onWheel: _propTypes.default.func,\n // Input value property ...\n text: _propTypes.default.any,\n // Input properties\n placeholder: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),\n className: _propTypes.default.string,\n disable: _propTypes.default.bool,\n autoFocus: _propTypes.default.bool,\n readOnly: _propTypes.default.bool,\n type: _propTypes.default.oneOf(['text', 'password']),\n size: _propTypes.default.number\n};\nEditableText.defaultProps = {\n readOnly: false,\n type: 'text'\n};\nvar _default = EditableText;\nexports.default = _default;\n//# sourceMappingURL=EditableText.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/widgets/EditableText.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/widgets/FlaglistCheckboxGroup.js": /*!*****************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/widgets/FlaglistCheckboxGroup.js ***! \*****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _CheckboxGroup = _interopRequireDefault(__webpack_require__(/*! ./CheckboxGroup */ \"./node_modules/react-chart-editor/lib/components/widgets/CheckboxGroup.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n// Component handles activeOption with shape \"x+y+z\"\n// and ties it to the CheckboxGroup Component\nvar FlaglistCheckboxGroup = /*#__PURE__*/function (_Component) {\n _inherits(FlaglistCheckboxGroup, _Component);\n\n var _super = _createSuper(FlaglistCheckboxGroup);\n\n function FlaglistCheckboxGroup(props) {\n var _this;\n\n _classCallCheck(this, FlaglistCheckboxGroup);\n\n _this = _super.call(this, props);\n var currentActiveOption;\n\n if (props.activeOption !== null) {\n currentActiveOption = props.activeOption;\n } else {\n currentActiveOption = '';\n }\n\n _this.state = {\n activeOption: _this.parseFlags(currentActiveOption)\n };\n _this.handleChange = _this.handleChange.bind(_assertThisInitialized(_this));\n return _this;\n } // convert plotly.js's \"all\" or \"none\" option in its `flaglist` type\n // to a series of options separated by `+` that our component can handle\n\n\n _createClass(FlaglistCheckboxGroup, [{\n key: \"parseFlags\",\n value: function parseFlags(option) {\n var activeOption;\n\n if (option === 'all') {\n activeOption = this.props.options.map(function (o) {\n return o.value;\n }).join('+');\n } else if (option === 'none') {\n activeOption = '';\n } else {\n activeOption = option;\n }\n\n return activeOption;\n } // Sync local state to parent props.\n\n }, {\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps) {\n this.setState({\n activeOption: this.parseFlags(nextProps.activeOption)\n });\n } // Called whenever a checkbox is changed, this updates the local\n // state to reflect the new activeOptions and then called props.onChange with\n // the new options.\n\n }, {\n key: \"handleChange\",\n value: function handleChange(newOptions) {\n var newActiveOptions = '';\n newOptions.map(function (option) {\n if (option.checked === true) {\n newActiveOptions += option.value + '+';\n }\n });\n newActiveOptions = newActiveOptions.slice(0, -1);\n\n if (newActiveOptions.length === 0) {\n newActiveOptions = 'none';\n }\n\n this.setState({\n activeOption: newActiveOptions\n });\n this.props.onChange(newActiveOptions);\n } // Turns the activeOptions \"e.g \"x+y+z\" into an array that\n // the CheckboxGroup component can handle\n\n }, {\n key: \"renderCheckedOption\",\n value: function renderCheckedOption() {\n var activeOptions = typeof this.state.activeOption === 'string' ? this.state.activeOption.split('+') : [this.state.activeOption];\n var allOptions = this.props.options;\n var newOptions = [];\n allOptions.map(function (option) {\n var currentChecked;\n\n if (activeOptions.indexOf(option.value) > -1) {\n currentChecked = true;\n } else {\n currentChecked = false;\n }\n\n newOptions.push({\n label: option.label,\n value: option.value,\n checked: currentChecked\n });\n });\n return newOptions;\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react.default.createElement(_CheckboxGroup.default, {\n options: this.renderCheckedOption(),\n onChange: this.handleChange,\n className: this.props.className,\n orientation: this.props.orientation\n });\n }\n }]);\n\n return FlaglistCheckboxGroup;\n}(_react.Component);\n\nFlaglistCheckboxGroup.propTypes = {\n options: _propTypes.default.arrayOf(_propTypes.default.shape({\n value: _propTypes.default.any.isRequired,\n label: _propTypes.default.string.isRequired\n })).isRequired,\n activeOption: _propTypes.default.any,\n onChange: _propTypes.default.func,\n className: _propTypes.default.string,\n orientation: _propTypes.default.string\n};\nvar _default = FlaglistCheckboxGroup;\nexports.default = _default;\n//# sourceMappingURL=FlaglistCheckboxGroup.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/widgets/FlaglistCheckboxGroup.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/widgets/Logo.js": /*!************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/widgets/Logo.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar Logo = /*#__PURE__*/function (_Component) {\n _inherits(Logo, _Component);\n\n var _super = _createSuper(Logo);\n\n function Logo() {\n _classCallCheck(this, Logo);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(Logo, [{\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react.default.createElement(\"img\", {\n className: \"sidebar__logo\",\n src: this.props.src\n });\n }\n }]);\n\n return Logo;\n}(_react.Component);\n\nexports.default = Logo;\nLogo.plotly_editor_traits = {\n sidebar_element: true\n};\nLogo.propTypes = {\n src: _propTypes.default.string\n};\n//# sourceMappingURL=Logo.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/widgets/Logo.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/widgets/NumericInput.js": /*!********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/widgets/NumericInput.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.DOWN_ARROW = exports.UP_ARROW = void 0;\n\nvar _EditableText = _interopRequireDefault(__webpack_require__(/*! ./EditableText */ \"./node_modules/react-chart-editor/lib/components/widgets/EditableText.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _fastIsnumeric = _interopRequireDefault(__webpack_require__(/*! fast-isnumeric */ \"./node_modules/fast-isnumeric/index.js\"));\n\nvar _reactRangeslider = _interopRequireDefault(__webpack_require__(/*! react-rangeslider */ \"./node_modules/react-rangeslider/lib/index.js\"));\n\nvar _plotlyIcons = __webpack_require__(/*! plotly-icons */ \"./node_modules/plotly-icons/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar UP_ARROW = 38;\nexports.UP_ARROW = UP_ARROW;\nvar DOWN_ARROW = 40;\nexports.DOWN_ARROW = DOWN_ARROW;\n\nvar NumericInput = /*#__PURE__*/function (_Component) {\n _inherits(NumericInput, _Component);\n\n var _super = _createSuper(NumericInput);\n\n function NumericInput(props) {\n var _this;\n\n _classCallCheck(this, NumericInput);\n\n _this = _super.call(this, props);\n _this.state = {\n value: props.value,\n numericInputClassName: _this.getNumericInputClassName(props.value)\n };\n _this.onChange = _this.onChange.bind(_assertThisInitialized(_this));\n _this.updateValue = _this.updateValue.bind(_assertThisInitialized(_this));\n _this.onKeyDown = _this.onKeyDown.bind(_assertThisInitialized(_this));\n _this.onWheel = _this.onWheel.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(NumericInput, [{\n key: \"getNumericInputClassName\",\n value: function getNumericInputClassName(value) {\n return (0, _fastIsnumeric.default)(value) || value === '' ? \"numeric-input__number \".concat(this.props.editableClassName ? this.props.editableClassName : '') : \"numeric-input__number +error \".concat(this.props.editableClassName ? this.props.editableClassName : '');\n }\n }, {\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps) {\n if (nextProps.value !== this.state.value) {\n this.setState({\n value: nextProps.value\n });\n }\n }\n }, {\n key: \"onKeyDown\",\n value: function onKeyDown(e) {\n switch (e.keyCode) {\n case UP_ARROW:\n this.incrementValue('increase');\n break;\n\n case DOWN_ARROW:\n this.incrementValue('decrease');\n break;\n\n default:\n break;\n }\n }\n }, {\n key: \"onWheel\",\n value: function onWheel(e) {\n e.stopPropagation();\n e.preventDefault();\n\n if (e.deltaY > 0) {\n this.incrementValue('increase');\n } else {\n this.incrementValue('decrease');\n }\n }\n }, {\n key: \"onChange\",\n value: function onChange(value) {\n this.setState({\n value: value,\n numericInputClassName: this.getNumericInputClassName(value)\n });\n }\n }, {\n key: \"updateValue\",\n value: function updateValue(newValue) {\n var _this$props = this.props,\n max = _this$props.max,\n min = _this$props.min,\n integerOnly = _this$props.integerOnly;\n var updatedValue = newValue;\n\n if (updatedValue === '') {\n this.setState({\n value: this.props.value,\n numericInputClassName: this.getNumericInputClassName(this.props.value)\n });\n return;\n } // When the user blurs on non-numeric data reset the component\n // to the last known good value (this.props.value).\n\n\n if (!(0, _fastIsnumeric.default)(updatedValue)) {\n this.setState({\n value: updatedValue,\n numericInputClassName: this.getNumericInputClassName(updatedValue)\n });\n return;\n }\n\n updatedValue = Number(updatedValue);\n\n if (integerOnly) {\n updatedValue = Math.floor(updatedValue);\n }\n\n if ((0, _fastIsnumeric.default)(min)) {\n updatedValue = Math.max(min, updatedValue);\n }\n\n if ((0, _fastIsnumeric.default)(max)) {\n updatedValue = Math.min(max, updatedValue);\n }\n\n this.props.onUpdate(updatedValue);\n }\n }, {\n key: \"incrementValue\",\n value: function incrementValue(direction) {\n var _this$props2 = this.props,\n defaultValue = _this$props2.defaultValue,\n min = _this$props2.min,\n _this$props2$step = _this$props2.step,\n step = _this$props2$step === void 0 ? 1 : _this$props2$step,\n _this$props2$stepmode = _this$props2.stepmode,\n stepmode = _this$props2$stepmode === void 0 ? 'absolute' : _this$props2$stepmode;\n var value = this.state.value;\n var valueUpdate;\n\n if ((0, _fastIsnumeric.default)(value)) {\n var x = parseFloat(value);\n var absMode = stepmode === 'absolute';\n\n if (direction === 'increase') {\n valueUpdate = absMode ? x + step : x * (1 + step);\n } else {\n valueUpdate = absMode ? x - step : x / (1 + step);\n }\n } else {\n // if we are multi-valued and the user is incrementing or decrementing\n // update with some sane value so we can \"break\" out of multi-valued mode.\n if ((0, _fastIsnumeric.default)(defaultValue)) {\n valueUpdate = defaultValue;\n } else {\n // TODO smarter handling depending if user decrements or increments?\n valueUpdate = min || 0;\n }\n } // incrementers blur the line between blur and onChange.\n\n\n this.updateValue(valueUpdate);\n }\n }, {\n key: \"renderArrows\",\n value: function renderArrows() {\n if (!this.props.showArrows || this.props.showSlider) {\n return null;\n }\n\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"numeric-input__caret-box\"\n }, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"numeric-input__caret js-numeric-increase\",\n onClick: this.incrementValue.bind(this, 'increase')\n }, /*#__PURE__*/_react.default.createElement(_plotlyIcons.CarretUpIcon, {\n className: \"numeric-top-caret-modifier\"\n })), /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"numeric-input__caret js-numeric-decrease\",\n onClick: this.incrementValue.bind(this, 'decrease')\n }, /*#__PURE__*/_react.default.createElement(_plotlyIcons.CarretDownIcon, {\n className: \"numeric-bottom-caret-modifier\"\n })));\n }\n }, {\n key: \"renderSlider\",\n value: function renderSlider() {\n if (!this.props.showSlider) {\n return null;\n }\n\n return /*#__PURE__*/_react.default.createElement(_reactRangeslider.default, {\n min: this.props.min,\n max: this.props.max,\n step: this.props.step,\n value: parseFloat(this.state.value),\n onChange: this.updateValue,\n tooltip: false\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"numeric-input__wrapper\"\n }, /*#__PURE__*/_react.default.createElement(_EditableText.default, {\n className: this.state.numericInputClassName,\n placeholder: this.props.placeholder,\n text: this.state.value,\n type: \"text\",\n onChange: this.onChange,\n onUpdate: this.updateValue,\n onKeyDown: this.onKeyDown,\n onWheel: this.onWheel\n }), this.renderArrows(), this.renderSlider(), this.props.units ? this.props.units : null);\n }\n }]);\n\n return NumericInput;\n}(_react.Component);\n\nexports.default = NumericInput;\nNumericInput.propTypes = {\n defaultValue: _propTypes.default.any,\n editableClassName: _propTypes.default.string,\n integerOnly: _propTypes.default.bool,\n max: _propTypes.default.number,\n min: _propTypes.default.number,\n onUpdate: _propTypes.default.func.isRequired,\n placeholder: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),\n showArrows: _propTypes.default.bool,\n showSlider: _propTypes.default.bool,\n step: _propTypes.default.number,\n stepmode: _propTypes.default.string,\n value: _propTypes.default.any,\n units: _propTypes.default.string\n};\nNumericInput.defaultProps = {\n showArrows: true\n};\n//# sourceMappingURL=NumericInput.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/widgets/NumericInput.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/widgets/RadioBlocks.js": /*!*******************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/widgets/RadioBlocks.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ \"./node_modules/classnames/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar RadioBlocks = /*#__PURE__*/function (_Component) {\n _inherits(RadioBlocks, _Component);\n\n var _super = _createSuper(RadioBlocks);\n\n function RadioBlocks(props) {\n var _this;\n\n _classCallCheck(this, RadioBlocks);\n\n _this = _super.call(this, props);\n _this.state = {\n activeOption: _this.props.activeOption\n };\n _this.handleChange = _this.handleChange.bind(_assertThisInitialized(_this));\n _this.renderOption = _this.renderOption.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(RadioBlocks, [{\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps) {\n // Reset the value to the graph's actual value\n if (nextProps.activeOption !== this.state.activeOption) {\n this.setState({\n activeOption: nextProps.activeOption\n });\n }\n }\n }, {\n key: \"handleChange\",\n value: function handleChange(newValue) {\n this.setState({\n activeOption: newValue\n });\n this.props.onOptionChange(newValue);\n }\n }, {\n key: \"renderOption\",\n value: function renderOption(optionName) {\n var _this2 = this;\n\n var label = optionName.label,\n value = optionName.value,\n Icon = optionName.icon;\n var defaultActive = this.state.activeOption === value;\n var optionClass = (0, _classnames.default)('radio-block__option', {\n 'radio-block__option--active': defaultActive\n });\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: optionClass,\n key: value,\n checked: defaultActive,\n onClick: function onClick() {\n return _this2.handleChange(value);\n }\n }, Icon ? /*#__PURE__*/_react.default.createElement(Icon, {\n className: \"radio-block__icon\"\n }) : null, label ? /*#__PURE__*/_react.default.createElement(\"span\", null, label) : null);\n }\n }, {\n key: \"render\",\n value: function render() {\n var optionList = this.props.options.map(this.renderOption);\n var groupClass = (0, _classnames.default)('radio-block', 'radio-block__group', {\n 'radio-block__group--center': this.props.alignment === 'center'\n });\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: groupClass\n }, optionList);\n }\n }]);\n\n return RadioBlocks;\n}(_react.Component);\n\nRadioBlocks.propTypes = {\n options: _propTypes.default.arrayOf(_propTypes.default.shape({\n value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.bool, _propTypes.default.number]).isRequired,\n label: _propTypes.default.string,\n icon: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),\n disabled: _propTypes.default.bool\n })),\n onOptionChange: _propTypes.default.func.isRequired,\n activeOption: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.bool, _propTypes.default.number]),\n radioClassName: _propTypes.default.string,\n // One of right, left, center\n alignment: _propTypes.default.string\n};\nvar _default = RadioBlocks;\nexports.default = _default;\n//# sourceMappingURL=RadioBlocks.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/widgets/RadioBlocks.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/widgets/SymbolSelector.js": /*!**********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/widgets/SymbolSelector.js ***! \**********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ \"./node_modules/classnames/index.js\"));\n\nvar _plotlyIcons = __webpack_require__(/*! plotly-icons */ \"./node_modules/plotly-icons/lib/index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar SymbolSelector = /*#__PURE__*/function (_Component) {\n _inherits(SymbolSelector, _Component);\n\n var _super = _createSuper(SymbolSelector);\n\n function SymbolSelector(props) {\n var _this;\n\n _classCallCheck(this, SymbolSelector);\n\n _this = _super.call(this, props);\n _this.state = {\n isOpen: false\n };\n _this.togglePanel = _this.togglePanel.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(SymbolSelector, [{\n key: \"shouldComponentUpdate\",\n value: function shouldComponentUpdate(nextProps, nextState) {\n var _this$props = this.props,\n markerColor = _this$props.markerColor,\n borderColor = _this$props.borderColor;\n var nextMarkerColor = nextProps.markerColor,\n nextBorderColor = nextProps.borderColor;\n return this.props.value !== nextProps.value || this.state.isOpen !== nextState.isOpen || markerColor !== nextMarkerColor || borderColor !== nextBorderColor;\n }\n }, {\n key: \"togglePanel\",\n value: function togglePanel() {\n this.setState({\n isOpen: !this.state.isOpen\n });\n }\n }, {\n key: \"renderActiveOption\",\n value: function renderActiveOption() {\n var _this$props2 = this.props,\n markerColor = _this$props2.markerColor,\n borderColor = _this$props2.borderColor,\n symbolOptions = _this$props2.symbolOptions,\n value = _this$props2.value;\n var currentSymbol = symbolOptions.find(function (symbol) {\n return symbol.value === value;\n });\n\n if (!currentSymbol) {\n return /*#__PURE__*/_react.default.createElement(\"span\", {\n style: {\n paddingTop: '5px',\n paddingLeft: '15px'\n }\n }, '-');\n }\n\n var symbolStyle = {\n stroke: currentSymbol.fill === 'none' ? markerColor : borderColor,\n strokeOpacity: '1',\n strokeWidth: '2px',\n fill: currentSymbol.fill === 'none' ? 'none' : markerColor\n };\n return /*#__PURE__*/_react.default.createElement(\"span\", null, /*#__PURE__*/_react.default.createElement(\"svg\", {\n width: \"18\",\n height: \"18\"\n }, /*#__PURE__*/_react.default.createElement(\"g\", {\n transform: \"translate(8,8)\"\n }, /*#__PURE__*/_react.default.createElement(\"path\", {\n d: currentSymbol.label,\n style: symbolStyle\n }))));\n }\n }, {\n key: \"renderOptions\",\n value: function renderOptions() {\n var _this2 = this;\n\n var _this$props3 = this.props,\n markerColor = _this$props3.markerColor,\n borderColor = _this$props3.borderColor,\n symbolOptions = _this$props3.symbolOptions;\n return symbolOptions.map(function (option) {\n var fill = option.fill,\n value = option.value,\n label = option.label;\n var symbolStyle = {\n stroke: fill === 'none' ? markerColor : borderColor,\n strokeOpacity: '1',\n strokeWidth: '2px',\n fill: fill === 'none' ? 'none' : markerColor\n };\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"symbol-selector__item\",\n key: value,\n onClick: function onClick() {\n return _this2.props.onChange(value);\n }\n }, /*#__PURE__*/_react.default.createElement(\"svg\", {\n width: \"28\",\n height: \"28\",\n className: \"symbol-selector__symbol\",\n \"data-value\": value\n }, /*#__PURE__*/_react.default.createElement(\"g\", {\n transform: \"translate(14,14)\"\n }, /*#__PURE__*/_react.default.createElement(\"path\", {\n d: label,\n style: symbolStyle\n }))));\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var isOpen = this.state.isOpen;\n var toggleClass = (0, _classnames.default)('symbol-selector__toggle', {\n 'symbol-selector__toggle--dark': this.props.backgroundDark\n });\n return /*#__PURE__*/_react.default.createElement(\"div\", null, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: toggleClass,\n onClick: this.togglePanel\n }, /*#__PURE__*/_react.default.createElement(\"span\", {\n className: \"symbol-selector__toggle_option\"\n }, this.renderActiveOption()), /*#__PURE__*/_react.default.createElement(\"span\", null, /*#__PURE__*/_react.default.createElement(_plotlyIcons.CarretDownIcon, {\n className: \"symbol-selector__toggle__caret\"\n }))), isOpen && this.renderOptions());\n }\n }]);\n\n return SymbolSelector;\n}(_react.Component);\n\nexports.default = SymbolSelector;\nSymbolSelector.propTypes = {\n backgroundDark: _propTypes.default.bool,\n markerColor: _propTypes.default.string,\n borderColor: _propTypes.default.string,\n value: _propTypes.default.string,\n onChange: _propTypes.default.func,\n symbolOptions: _propTypes.default.array\n};\n//# sourceMappingURL=SymbolSelector.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/widgets/SymbolSelector.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/widgets/TextArea.js": /*!****************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/widgets/TextArea.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar TextArea = /*#__PURE__*/function (_Component) {\n _inherits(TextArea, _Component);\n\n var _super = _createSuper(TextArea);\n\n function TextArea(props) {\n var _this;\n\n _classCallCheck(this, TextArea);\n\n _this = _super.call(this, props);\n _this.state = {\n value: _this.props.value\n };\n _this.onChange = _this.onChange.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(TextArea, [{\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps) {\n // Reset the value to the graph's actual value\n if (nextProps.value !== this.state.value) {\n this.setState({\n value: nextProps.value\n });\n }\n }\n }, {\n key: \"onChange\",\n value: function onChange(e) {\n var newValue = e.target.value;\n this.setState({\n value: newValue\n });\n this.props.onChange(newValue);\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react.default.createElement(\"span\", null, /*#__PURE__*/_react.default.createElement(\"textarea\", {\n value: this.state.value,\n rows: this.props.visibleRows,\n cols: this.props.areaWidth,\n placeholder: this.props.placeholder,\n onChange: this.onChange,\n className: this.props.textareaClass\n }));\n }\n }]);\n\n return TextArea;\n}(_react.Component);\n\nexports.default = TextArea;\nTextArea.propTypes = {\n value: _propTypes.default.string.isRequired,\n onChange: _propTypes.default.func.isRequired,\n placeholder: _propTypes.default.string.isRequired,\n visibleRows: _propTypes.default.number,\n areaWidth: _propTypes.default.number,\n textareaClass: _propTypes.default.string\n};\nTextArea.defaultProps = {\n visibleRows: 10,\n areaWidth: 30\n};\n//# sourceMappingURL=TextArea.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/widgets/TextArea.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/widgets/TextInput.js": /*!*****************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/widgets/TextInput.js ***! \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _EditableText = _interopRequireDefault(__webpack_require__(/*! ./EditableText */ \"./node_modules/react-chart-editor/lib/components/widgets/EditableText.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar TextInput = /*#__PURE__*/function (_Component) {\n _inherits(TextInput, _Component);\n\n var _super = _createSuper(TextInput);\n\n function TextInput(props) {\n var _this;\n\n _classCallCheck(this, TextInput);\n\n _this = _super.call(this, props);\n _this.state = {\n value: props.value\n };\n return _this;\n }\n\n _createClass(TextInput, [{\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps) {\n if (nextProps.value !== this.state.value) {\n this.setState({\n value: nextProps.value\n });\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n return /*#__PURE__*/_react.default.createElement(_EditableText.default, {\n className: \"text-input \".concat(this.props.editableClassName ? this.props.editableClassName : ''),\n placeholder: this.props.placeholder,\n text: this.state.value,\n type: \"text\",\n onChange: function onChange(value) {\n if (_this2.props.onChange) {\n _this2.props.onChange(value);\n }\n\n _this2.setState({\n value: value\n });\n },\n onUpdate: this.props.onUpdate\n });\n }\n }]);\n\n return TextInput;\n}(_react.Component);\n\nexports.default = TextInput;\nTextInput.propTypes = {\n defaultValue: _propTypes.default.any,\n editableClassName: _propTypes.default.string,\n onUpdate: _propTypes.default.func.isRequired,\n onChange: _propTypes.default.func,\n placeholder: _propTypes.default.string,\n value: _propTypes.default.any\n};\n//# sourceMappingURL=TextInput.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/widgets/TextInput.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/widgets/TraceTypeSelector.js": /*!*************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/widgets/TraceTypeSelector.js ***! \*************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.TraceTypeSelectorButton = void 0;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _plotlyIcons = __webpack_require__(/*! plotly-icons */ \"./node_modules/plotly-icons/lib/index.js\");\n\nvar _Modal = _interopRequireDefault(__webpack_require__(/*! ../containers/Modal */ \"./node_modules/react-chart-editor/lib/components/containers/Modal.js\"));\n\nvar _lib = __webpack_require__(/*! ../../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _constants = __webpack_require__(/*! ../../lib/constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar renderActionItems = function renderActionItems(actionItems, item) {\n return actionItems ? actionItems(item).map(function (action, i) {\n return !action.onClick ? null : /*#__PURE__*/_react.default.createElement(\"a\", {\n className: \"trace-item__actions__item\",\n key: i,\n \"aria-label\": action.label,\n \"data-microtip-position\": \"top-left\",\n role: \"tooltip\",\n onClick: action.onClick,\n target: \"_blank\"\n }, action.icon);\n }) : null;\n};\n\nvar Item = function Item(_ref) {\n var item = _ref.item,\n active = _ref.active,\n handleClick = _ref.handleClick,\n actions = _ref.actions,\n showActions = _ref.showActions,\n complex = _ref.complex;\n var label = item.label,\n value = item.value,\n icon = item.icon;\n var SimpleIcon = (0, _lib.renderTraceIcon)(icon ? icon : value);\n var ComplexIcon = (0, _lib.renderTraceIcon)(icon ? icon : value, 'TraceType');\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"trace-item\".concat(active ? ' trace-item--active' : ''),\n onClick: handleClick\n }, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"trace-item__actions\"\n }, actions && showActions ? renderActionItems(actions, item) : null), /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"trace-item__image\"\n }, !complex && /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"trace-item__image__svg\"\n }, /*#__PURE__*/_react.default.createElement(SimpleIcon, null)), complex && /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"trace-item__image__wrapper\"\n }, /*#__PURE__*/_react.default.createElement(ComplexIcon, null))), /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"trace-item__label\"\n }, label));\n};\n\nItem.propTypes = {\n item: _propTypes.default.object,\n active: _propTypes.default.bool,\n complex: _propTypes.default.bool,\n handleClick: _propTypes.default.func,\n actions: _propTypes.default.func,\n showActions: _propTypes.default.bool\n};\nItem.contextTypes = {\n localize: _propTypes.default.func\n};\n\nvar TraceTypeSelector = /*#__PURE__*/function (_Component) {\n _inherits(TraceTypeSelector, _Component);\n\n var _super = _createSuper(TraceTypeSelector);\n\n function TraceTypeSelector(props) {\n var _this;\n\n _classCallCheck(this, TraceTypeSelector);\n\n _this = _super.call(this, props);\n _this.selectAndClose = _this.selectAndClose.bind(_assertThisInitialized(_this));\n _this.actions = _this.actions.bind(_assertThisInitialized(_this));\n _this.renderCategories = _this.renderCategories.bind(_assertThisInitialized(_this));\n _this.renderGrid = _this.renderGrid.bind(_assertThisInitialized(_this));\n _this.renderSingleBlock = _this.renderSingleBlock.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(TraceTypeSelector, [{\n key: \"selectAndClose\",\n value: function selectAndClose(value) {\n var _this$props = this.props,\n updateContainer = _this$props.updateContainer,\n glByDefault = _this$props.glByDefault,\n type = _this$props.fullContainer.type;\n var computedValue = (0, _lib.traceTypeToPlotlyInitFigure)(value);\n\n if ((type && type.endsWith('gl') || !_constants.TRACES_WITH_GL.includes(type) && glByDefault) && _constants.TRACES_WITH_GL.includes(computedValue.type) && !computedValue.type.endsWith('gl')) {\n computedValue.type += 'gl';\n }\n\n updateContainer(computedValue);\n this.context.handleClose();\n }\n }, {\n key: \"actions\",\n value: function actions(_ref2) {\n var _this2 = this;\n\n var value = _ref2.value;\n var _this$context = this.context,\n _ = _this$context.localize,\n chartHelp = _this$context.chartHelp;\n\n var onClick = function onClick(e, func) {\n e.stopPropagation();\n func();\n\n _this2.context.handleClose();\n };\n\n return [{\n label: _('Charts like this by Plotly users.'),\n onClick: chartHelp[value] && chartHelp[value].feedQuery && function (e) {\n return onClick(e, function () {\n return window.open(\"https://plot.ly/feed/?q=\".concat(chartHelp[value] ? chartHelp[value].feedQuery : value), '_blank');\n });\n },\n icon: /*#__PURE__*/_react.default.createElement(_plotlyIcons.SearchIcon, null)\n }, {\n label: _('View tutorials on this chart type.'),\n onClick: chartHelp[value] && chartHelp[value].helpDoc && function (e) {\n return onClick(e, function () {\n return window.open(chartHelp[value].helpDoc, '_blank');\n });\n },\n icon: /*#__PURE__*/_react.default.createElement(_plotlyIcons.ThumnailViewIcon, null)\n }, {\n label: _('See a basic example.'),\n onClick: chartHelp[value] && chartHelp[value].examplePlot && function (e) {\n return onClick(e, chartHelp[value].examplePlot);\n },\n icon: /*#__PURE__*/_react.default.createElement(_plotlyIcons.GraphIcon, null)\n }];\n }\n }, {\n key: \"renderCategories\",\n value: function renderCategories() {\n var _this3 = this;\n\n var fullValue = this.props.fullValue;\n var _this$context2 = this.context,\n _ = _this$context2.localize,\n chartHelp = _this$context2.chartHelp;\n var _this$props$traceType = this.props.traceTypesConfig,\n traces = _this$props$traceType.traces,\n categories = _this$props$traceType.categories,\n complex = _this$props$traceType.complex;\n return categories(_).map(function (category, i) {\n var items = traces(_).filter(function (_ref3) {\n var value = _ref3.category.value;\n return value === category.value;\n }).filter(function (i) {\n return i.value !== 'scattergl' && i.value !== 'scatterpolargl';\n });\n var MAX_ITEMS = 4;\n var columnClasses = items.length > MAX_ITEMS && !category.maxColumns || category.maxColumns && category.maxColumns > 1 ? 'trace-grid__column trace-grid__column--double' : 'trace-grid__column';\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: columnClasses,\n key: i\n }, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"trace-grid__column__header\"\n }, category.label), /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"trace-grid__column__items\"\n }, items.map(function (item) {\n return /*#__PURE__*/_react.default.createElement(Item, {\n complex: complex,\n key: item.value,\n active: fullValue === item.value,\n item: item,\n actions: _this3.actions,\n handleClick: function handleClick() {\n return _this3.selectAndClose(item.value);\n },\n showActions: Boolean(chartHelp)\n });\n })));\n });\n }\n }, {\n key: \"renderGrid\",\n value: function renderGrid() {\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"trace-grid\"\n }, this.renderCategories());\n }\n }, {\n key: \"renderSingleBlock\",\n value: function renderSingleBlock() {\n var _this4 = this;\n\n var fullValue = this.props.fullValue;\n var _ = this.context.localize;\n var _this$props$traceType2 = this.props.traceTypesConfig,\n traces = _this$props$traceType2.traces,\n complex = _this$props$traceType2.complex;\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"trace-grid-single-block\"\n }, traces(_).map(function (item) {\n return /*#__PURE__*/_react.default.createElement(Item, {\n key: item.value,\n complex: complex,\n active: fullValue === item.value,\n item: item,\n actions: _this4.actions,\n showActions: false,\n handleClick: function handleClick() {\n return _this4.selectAndClose(item.value);\n },\n style: {\n display: 'inline-block'\n }\n });\n }));\n }\n }, {\n key: \"render\",\n value: function render() {\n var _ = this.context.localize;\n var categories = this.props.traceTypesConfig.categories;\n return /*#__PURE__*/_react.default.createElement(_Modal.default, {\n title: _('Select Trace Type')\n }, categories ? this.renderGrid() : this.renderSingleBlock());\n }\n }]);\n\n return TraceTypeSelector;\n}(_react.Component);\n\nTraceTypeSelector.propTypes = {\n updateContainer: _propTypes.default.func,\n fullValue: _propTypes.default.string,\n fullContainer: _propTypes.default.object,\n glByDefault: _propTypes.default.bool,\n traceTypesConfig: _propTypes.default.object\n};\nTraceTypeSelector.contextTypes = {\n handleClose: _propTypes.default.func,\n localize: _propTypes.default.func,\n mapBoxAccess: _propTypes.default.bool,\n chartHelp: _propTypes.default.object\n};\n\nvar TraceTypeSelectorButton = /*#__PURE__*/function (_Component2) {\n _inherits(TraceTypeSelectorButton, _Component2);\n\n var _super2 = _createSuper(TraceTypeSelectorButton);\n\n function TraceTypeSelectorButton() {\n _classCallCheck(this, TraceTypeSelectorButton);\n\n return _super2.apply(this, arguments);\n }\n\n _createClass(TraceTypeSelectorButton, [{\n key: \"render\",\n value: function render() {\n var _this$props2 = this.props,\n handleClick = _this$props2.handleClick,\n container = _this$props2.container,\n traces = _this$props2.traceTypesConfig.traces;\n var _ = this.context.localize;\n var inferredType = (0, _lib.plotlyTraceToCustomTrace)(container);\n\n var _traces$find = traces(_).find(function (type) {\n return type.value === inferredType;\n }),\n label = _traces$find.label,\n icon = _traces$find.icon,\n value = _traces$find.value;\n\n var Icon = (0, _lib.renderTraceIcon)(icon ? icon : value);\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"trace-type-select-button\",\n onClick: handleClick ? handleClick : null\n }, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"trace-type-select-button__icon\"\n }, /*#__PURE__*/_react.default.createElement(Icon, null)), label);\n }\n }]);\n\n return TraceTypeSelectorButton;\n}(_react.Component);\n\nexports.TraceTypeSelectorButton = TraceTypeSelectorButton;\nTraceTypeSelectorButton.propTypes = {\n handleClick: _propTypes.default.func.isRequired,\n container: _propTypes.default.object,\n traceTypesConfig: _propTypes.default.object.isRequired\n};\nTraceTypeSelectorButton.contextTypes = {\n localize: _propTypes.default.func\n};\nvar _default = TraceTypeSelector;\nexports.default = _default;\n//# sourceMappingURL=TraceTypeSelector.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/widgets/TraceTypeSelector.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/widgets/index.js": /*!*************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/widgets/index.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"Button\", {\n enumerable: true,\n get: function get() {\n return _Button.default;\n }\n});\nObject.defineProperty(exports, \"RadioBlocks\", {\n enumerable: true,\n get: function get() {\n return _RadioBlocks.default;\n }\n});\nObject.defineProperty(exports, \"DateTimePicker\", {\n enumerable: true,\n get: function get() {\n return _DateTimePicker.default;\n }\n});\nObject.defineProperty(exports, \"TraceTypeSelector\", {\n enumerable: true,\n get: function get() {\n return _TraceTypeSelector.default;\n }\n});\nObject.defineProperty(exports, \"TraceTypeSelectorButton\", {\n enumerable: true,\n get: function get() {\n return _TraceTypeSelector.TraceTypeSelectorButton;\n }\n});\n\nvar _Button = _interopRequireDefault(__webpack_require__(/*! ./Button */ \"./node_modules/react-chart-editor/lib/components/widgets/Button.js\"));\n\nvar _RadioBlocks = _interopRequireDefault(__webpack_require__(/*! ./RadioBlocks */ \"./node_modules/react-chart-editor/lib/components/widgets/RadioBlocks.js\"));\n\nvar _DateTimePicker = _interopRequireDefault(__webpack_require__(/*! ./DateTimePicker */ \"./node_modules/react-chart-editor/lib/components/widgets/DateTimePicker.js\"));\n\nvar _TraceTypeSelector = _interopRequireWildcard(__webpack_require__(/*! ./TraceTypeSelector */ \"./node_modules/react-chart-editor/lib/components/widgets/TraceTypeSelector.js\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/widgets/index.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/widgets/text_editors/HTML.js": /*!*************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/widgets/text_editors/HTML.js ***! \*************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _TextArea2 = _interopRequireDefault(__webpack_require__(/*! ../TextArea */ \"./node_modules/react-chart-editor/lib/components/widgets/TextArea.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar HTML = /*#__PURE__*/function (_TextArea) {\n _inherits(HTML, _TextArea);\n\n var _super = _createSuper(HTML);\n\n function HTML() {\n _classCallCheck(this, HTML);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(HTML, [{\n key: \"render\",\n value: function render() {\n var className = this.props.className;\n var editorClassNames = className ? className : 'text-editor__html';\n return /*#__PURE__*/_react.default.createElement(\"textarea\", {\n value: this.state.value,\n placeholder: this.props.placeholder,\n onChange: this.onChange,\n className: editorClassNames\n });\n }\n }]);\n\n return HTML;\n}(_TextArea2.default);\n\nHTML.propTypes = {\n className: _propTypes.default.string\n};\nHTML.defaultProps = {\n placeholder: ''\n};\nvar _default = HTML;\nexports.default = _default;\n//# sourceMappingURL=HTML.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/widgets/text_editors/HTML.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/widgets/text_editors/LaTeX.js": /*!**************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/widgets/text_editors/LaTeX.js ***! \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _TextArea2 = _interopRequireDefault(__webpack_require__(/*! ../TextArea */ \"./node_modules/react-chart-editor/lib/components/widgets/TextArea.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _convertFormats = __webpack_require__(/*! ./convertFormats */ \"./node_modules/react-chart-editor/lib/components/widgets/text_editors/convertFormats.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar LaTeX = /*#__PURE__*/function (_TextArea) {\n _inherits(LaTeX, _TextArea);\n\n var _super = _createSuper(LaTeX);\n\n function LaTeX(props) {\n var _this;\n\n _classCallCheck(this, LaTeX);\n\n _this = _super.call(this, props); // Internally, represesent the LaTeX document without the\n // wrapping `$...$` characters.\n\n var unwrappedValue = _this.unwrap(props.value);\n\n _this.state = {\n value: unwrappedValue\n };\n _this.onChange = _this.onChange.bind(_assertThisInitialized(_this));\n _this.onBlur = _this.onBlur.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(LaTeX, [{\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps) {\n var unwrappedNextValue = this.unwrap(nextProps.value);\n\n if (unwrappedNextValue !== this.state.value) {\n this.setState({\n value: unwrappedNextValue\n });\n }\n } // Return a new value with wrapping `$...$` removed.\n\n }, {\n key: \"unwrap\",\n value: function unwrap(value) {\n if ((0, _convertFormats.isLaTeXExpr)(value)) {\n return value.substr(1, value.length - 2);\n }\n\n return value;\n } // Wrap value in `$...$`.\n\n }, {\n key: \"wrap\",\n value: function wrap(value) {\n if (!(0, _convertFormats.isLaTeXExpr)(value)) {\n return \"$\".concat(value, \"$\");\n }\n\n return value;\n }\n }, {\n key: \"onChange\",\n value: function onChange(e) {\n this.setState({\n value: e.target.value\n });\n }\n }, {\n key: \"onBlur\",\n value: function onBlur(e) {\n var value = this.wrap(e.target.value);\n this.props.onChange(value);\n }\n }, {\n key: \"render\",\n value: function render() {\n var className = this.props.className;\n var editorClassNames = className ? className : 'text-editor__latex';\n return /*#__PURE__*/_react.default.createElement(\"textarea\", {\n value: this.state.value,\n placeholder: this.props.placeholder,\n onChange: this.onChange,\n onBlur: this.onBlur,\n className: editorClassNames\n });\n }\n }]);\n\n return LaTeX;\n}(_TextArea2.default);\n\nexports.default = LaTeX;\nLaTeX.propTypes = {\n className: _propTypes.default.string,\n onChange: _propTypes.default.func.isRequired,\n placeholder: _propTypes.default.string,\n value: _propTypes.default.string\n};\nLaTeX.defaultProps = {\n value: '',\n placeholder: ''\n};\n//# sourceMappingURL=LaTeX.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/widgets/text_editors/LaTeX.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/widgets/text_editors/MultiFormat.js": /*!********************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/widgets/text_editors/MultiFormat.js ***! \********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _HTML = _interopRequireDefault(__webpack_require__(/*! ./HTML */ \"./node_modules/react-chart-editor/lib/components/widgets/text_editors/HTML.js\"));\n\nvar _LaTeX = _interopRequireDefault(__webpack_require__(/*! ./LaTeX */ \"./node_modules/react-chart-editor/lib/components/widgets/text_editors/LaTeX.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _RichText = _interopRequireDefault(__webpack_require__(/*! ./RichText */ \"./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/index.js\"));\n\nvar _convertFormats = __webpack_require__(/*! ./convertFormats */ \"./node_modules/react-chart-editor/lib/components/widgets/text_editors/convertFormats.js\");\n\nvar _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ \"./node_modules/classnames/index.js\"));\n\nvar _Button = _interopRequireDefault(__webpack_require__(/*! ../Button */ \"./node_modules/react-chart-editor/lib/components/widgets/Button.js\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar MultiFormatTextEditor = /*#__PURE__*/function (_Component) {\n _inherits(MultiFormatTextEditor, _Component);\n\n var _super = _createSuper(MultiFormatTextEditor);\n\n function MultiFormatTextEditor(props, context) {\n var _this;\n\n _classCallCheck(this, MultiFormatTextEditor);\n\n _this = _super.call(this, props, context);\n var _ = context.localize;\n var editors = [{\n key: 'RICH_TEXT',\n label: _('Rich Text'),\n component: _RichText.default\n }, {\n key: 'LATEX',\n label: _('LaTeX'),\n component: _LaTeX.default\n }, {\n key: 'HTML',\n label: _('Edit in HTML'),\n component: _HTML.default\n }];\n var startTab = (0, _convertFormats.isLaTeXExpr)(props.value) ? 'LATEX' : 'RICH_TEXT';\n _this.state = {\n /*\n * When nextTab is set, we are waiting for confirmation from the\n * user before switching to the next tab.\n */\n nextTab: null,\n currentTab: startTab,\n messages: []\n };\n _this.onModeChange = _this.onModeChange.bind(_assertThisInitialized(_this));\n _this.editors = editors;\n return _this;\n }\n /**\n * Convert a value to the format expected by the provided editor.\n *\n * @param {String} value The current value\n * @param {String} editor The editor to convert for [RICH_TEXT|LATEX]\n * @returns {String} The converted value\n */\n\n\n _createClass(MultiFormatTextEditor, [{\n key: \"convertValue\",\n value: function convertValue(value, editor) {\n var currentTab = this.state.currentTab;\n\n if (currentTab === 'RICH_TEXT' && editor === 'LATEX') {\n return (0, _convertFormats.htmlToLaTeX)(value);\n }\n\n if (currentTab === 'LATEX' && editor === 'RICH_TEXT') {\n return (0, _convertFormats.laTeXToHTML)(value);\n }\n\n if (currentTab === 'HTML' && editor === 'LATEX') {\n return (0, _convertFormats.htmlToLaTeX)(value);\n }\n /*\n * Else we're switching from / to HTML / Rich Text Editor\n * no conversion is needed\n */\n\n\n return value;\n }\n }, {\n key: \"onModeChange\",\n value: function onModeChange(nextTab) {\n var _ = this.context.localize;\n var _this$props = this.props,\n defaultValuePattern = _this$props.defaultValuePattern,\n value = _this$props.value,\n onChange = _this$props.onChange;\n var currentTab = this.state.currentTab;\n var trimmedValue = value.trim();\n var trimmedValueLength = trimmedValue.length;\n var convertedValue = this.convertValue(trimmedValue, nextTab);\n /*\n * Check against default value - we have to compare the plain\n * value, not the LaTeX format value with `\\text{}` wrapping.\n */\n\n var isDefaultValue = (0, _convertFormats.isLaTeXExpr)(trimmedValue) ? defaultValuePattern.test(convertedValue) : defaultValuePattern.test(trimmedValue);\n var switchingBetweenRichAndHtml = currentTab === 'RICH_TEXT' && nextTab === 'HTML' || currentTab === 'HTML' && nextTab === 'RICH_TEXT';\n\n if (!isDefaultValue && trimmedValueLength > 0 && !switchingBetweenRichAndHtml) {\n // Show confirmation dialogue and defer tab change.\n var messages;\n\n if (!(0, _convertFormats.isLaTeXExpr)(value)) {\n messages = [_(\"LaTeX is a math typesetting language that doesn't work with rich text.\"), _('Continuing will convert your note to LaTeX-style text.')];\n } else if ((0, _convertFormats.hasTextExpression)(value)) {\n messages = [_('Rich text is incompatible with LaTeX.'), _('Continuing will convert your LaTeX expression into raw text.')];\n } else {\n messages = [_('Rich text is incompatible with LaTeX.'), _('Continuing will remove your expression.')];\n }\n\n this.setState({\n nextTab: nextTab,\n messages: messages\n });\n return;\n } // Show requested tab immediately.\n\n\n this.setState({\n currentTab: nextTab\n }); // Convert the annotation and dispatch onChange action\n\n onChange(convertedValue);\n }\n }, {\n key: \"renderConfirmationPanel\",\n value: function renderConfirmationPanel(render) {\n var _this2 = this;\n\n if (!render) {\n return null;\n }\n\n var _ = this.context.localize;\n var messages = this.state.messages;\n\n var onCancel = function onCancel() {\n _this2.setState({\n nextTab: null\n });\n };\n\n var onContinue = function onContinue() {\n var nextTab = _this2.state.nextTab;\n var _this2$props = _this2.props,\n onChange = _this2$props.onChange,\n value = _this2$props.value; // Set next tab as active\n\n _this2.setState({\n currentTab: nextTab,\n nextTab: null\n }); // Convert the annotation\n\n\n var convertedValue = _this2.convertValue(value, nextTab);\n\n onChange(convertedValue);\n };\n\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"multi-format-editor__confirmation-panel\"\n }, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"multi-format-editor__confirmation-panel__content\"\n }, /*#__PURE__*/_react.default.createElement(\"h3\", {\n className: \"multi-format-editor__confirmation-panel__header\"\n }, _('Heads up!')), /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"multi-format-editor__confirmation-panel__message\"\n }, /*#__PURE__*/_react.default.createElement(\"p\", {\n className: \"multi-format-editor__confirmation-panel__message-primary\"\n }, messages[0]), /*#__PURE__*/_react.default.createElement(\"p\", {\n className: \"multi-format-editor__confirmation-panel__message-secondary\"\n }, messages[1]))), /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"multi-format-editor__confirmation-panel__actions\"\n }, /*#__PURE__*/_react.default.createElement(_Button.default, {\n variant: \"default\",\n className: \"multi-format-editor__confirmation-panel__cancel-button\",\n onClick: onCancel\n }, _('Go back')), /*#__PURE__*/_react.default.createElement(_Button.default, {\n variant: \"primary\",\n className: \"multi-format-editor__confirmation-panel__continue-button\",\n onClick: onContinue\n }, _('Continue'))));\n }\n }, {\n key: \"renderEditor\",\n value: function renderEditor(render) {\n var _this3 = this;\n\n if (!render) {\n return null;\n }\n\n var _ = this.context.localize;\n var _this$props2 = this.props,\n onChange = _this$props2.onChange,\n placeholder = _this$props2.placeholder,\n value = _this$props2.value;\n var currentTab = this.state.currentTab;\n var richTextClassNames = (0, _classnames.default)('multi-format-editor__tab', 'top-tab', 'left', {\n selected: currentTab === 'RICH_TEXT'\n });\n var latexClassNames = (0, _classnames.default)('multi-format-editor__tab', 'top-tab', 'right', {\n selected: currentTab === 'LATEX'\n });\n var bottomTabClassNames = (0, _classnames.default)('multi-format-editor__tab', 'bottom-tab');\n var Editor = this.editors.filter(function (editor) {\n return editor.key === currentTab;\n })[0].component;\n var ModeTabsText = this.editors.map(function (editor) {\n return editor.label;\n });\n var showBottomTab = currentTab === 'HTML' || currentTab === 'RICH_TEXT';\n var BottomTab = currentTab === 'HTML' ? /*#__PURE__*/_react.default.createElement(\"div\", {\n className: bottomTabClassNames,\n onClick: function onClick() {\n return _this3.onModeChange('RICH_TEXT');\n }\n }, _('Edit in Rich Text')) : /*#__PURE__*/_react.default.createElement(\"div\", {\n className: bottomTabClassNames,\n onClick: function onClick() {\n return _this3.onModeChange('HTML');\n }\n }, _('Edit in HTML'));\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"multi-format-editor__root__wrapper\"\n }, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"multi-format-editor__tabs\"\n }, /*#__PURE__*/_react.default.createElement(\"div\", {\n className: richTextClassNames,\n onClick: function onClick() {\n return _this3.onModeChange('RICH_TEXT');\n }\n }, ModeTabsText[0]), /*#__PURE__*/_react.default.createElement(\"div\", {\n className: latexClassNames,\n onClick: function onClick() {\n return _this3.onModeChange('LATEX');\n }\n }, ModeTabsText[1])), /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"multi-format-editor__content__wrapper__\".concat(currentTab.toLowerCase())\n }, /*#__PURE__*/_react.default.createElement(Editor, {\n className: \"multi-format-editor__\".concat(currentTab.toLowerCase()),\n onChange: onChange,\n placeholder: placeholder,\n value: value\n })), showBottomTab ? BottomTab : null);\n }\n }, {\n key: \"render\",\n value: function render() {\n /*\n * `renderConfirmationPanel` and `renderEditor` are mutually\n * exclusive; only one will return a component.\n */\n var nextTab = this.state.nextTab;\n var content = this.renderConfirmationPanel(nextTab !== null) || this.renderEditor(nextTab === null);\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"multi-format-editor__root\"\n }, content);\n }\n }]);\n\n return MultiFormatTextEditor;\n}(_react.Component);\n\nMultiFormatTextEditor.propTypes = {\n defaultValuePattern: _propTypes.default.instanceOf(RegExp),\n onChange: _propTypes.default.func.isRequired,\n placeholder: _propTypes.default.string,\n value: _propTypes.default.string\n};\nMultiFormatTextEditor.defaultProps = {\n defaultValuePattern: /^$/,\n placeholder: '',\n value: ''\n};\nMultiFormatTextEditor.contextTypes = {\n localize: _propTypes.default.func\n};\nvar _default = MultiFormatTextEditor;\nexports.default = _default;\n//# sourceMappingURL=MultiFormat.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/widgets/text_editors/MultiFormat.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/DraftCommands.js": /*!*******************************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/DraftCommands.js ***! \*******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.cursorHasLink = cursorHasLink;\nexports.getEntityByKey = getEntityByKey;\nexports.getEntityKeyAt = getEntityKeyAt;\nexports.handleKeyCommand = handleKeyCommand;\nexports.insertSoftNewline = insertSoftNewline;\nexports.toggleInlineStyle = toggleInlineStyle;\nexports.toggleLink = toggleLink;\nexports.toggleMutuallyExclusiveStyles = toggleMutuallyExclusiveStyles;\n\nvar _draftJs = __webpack_require__(/*! draft-js */ \"./node_modules/draft-js/lib/Draft.js\");\n\nvar _DraftModifier = __webpack_require__(/*! draft-js/lib/DraftModifier */ \"./node_modules/draft-js/lib/DraftModifier.js\");\n\nvar _configuration = __webpack_require__(/*! ./configuration */ \"./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/configuration.js\");\n\n/*\n * This module exports functions that act on a DraftJS EditorState to\n * effect commands.\n */\n\n/**\n * Check whether the current selection is over a link\n *\n * @param {EditorState} editorState The DraftJS editor state\n * @param {SelectionState} selection A DraftJS selection state\n * @returns {Boolean} `true` if selection is over a link\n */\nfunction selectionHasLink(editorState, selection) {\n // If nothing is selected, bail early.\n if (selection.isCollapsed()) {\n return false;\n }\n\n return cursorHasLink(editorState, selection);\n}\n/**\n * Check whether the cursor position is over a link\n *\n * @param {EditorState} editorState The DraftJS editor state\n * @param {SelectionState} selection A DraftJS selection state\n * @returns {Boolean} `true` if cursor is over a link\n */\n\n\nfunction cursorHasLink(editorState, selection) {\n var entity = getEntityByKey(getEntityKeyAt(editorState, selection));\n return Boolean(entity && entity.get('type') === _configuration.LINK);\n}\n/**\n * Get an entity by its key\n * Links are represented as DraftJS entities.\n * https://facebook.github.io/draft-js/docs/api-reference-entity.html#content\n *\n * @param {String} entityKey The entity key\n * @returns {DraftEntityInstance} The entity for the key, or `null` if not found\n */\n\n\nfunction getEntityByKey(entityKey) {\n if (!entityKey) {\n return null;\n }\n\n return _draftJs.Entity.get(entityKey);\n}\n/**\n * For a given SelectionState, get the underlying entity key.\n *\n * @param {EditorState} editorState The DraftJS editor state\n * @param {SelectionState} selection The DraftJS selection state\n * @returns {String} The entity key, or `null` if not found\n */\n\n\nfunction getEntityKeyAt(editorState, selection) {\n if (!selection) {\n return null;\n }\n\n var blockStartKey = selection.getStartKey();\n var selectionOffset = selection.getStartOffset();\n var contentState = editorState.getCurrentContent();\n var block = contentState.getBlockForKey(blockStartKey);\n return block.getEntityAt(selectionOffset);\n}\n/**\n * Handle a keyboard command.\n * TODO: add custom CMD-k command for link button.\n * https://github.com/plotly/streambed/issues/6384\n *\n * @param {EditorState} editorState The DraftJS editor state\n * @param {String} command The command string representation\n * @returns {EditorState} The new editor state\n */\n\n\nfunction handleKeyCommand(editorState, command) {\n switch (command) {\n case 'split-block':\n // Never split editor content into `

` blocks.\n return insertSoftNewline(editorState);\n\n case 'bold':\n return toggleInlineStyle(editorState, _configuration.BOLD);\n\n case 'italic':\n return toggleInlineStyle(editorState, _configuration.ITALIC);\n\n default:\n return false;\n }\n}\n/**\n * Insert a soft newline `\\n` that converts to `
` in HTML.\n *\n * @param {EditorState} editorState The DraftJS editor state\n * @returns {EditorState} The new editor state\n */\n\n\nfunction insertSoftNewline(editorState) {\n var newEditorState = editorState; // Terminate all current inline styles\n\n var currentStyleSet = newEditorState.getCurrentInlineStyle();\n newEditorState = currentStyleSet.reduce(function (reducedEditorState, style) {\n return _draftJs.RichUtils.toggleInlineStyle(reducedEditorState, style);\n }, newEditorState); // If text is selected, delete text first.\n\n var selectionState = newEditorState.getSelection();\n var selectionStart = selectionState.getStartOffset();\n var selectionEnd = selectionState.getEndOffset();\n\n if (selectionEnd - selectionStart !== 0) {\n var contentState = (0, _DraftModifier.removeRange)(newEditorState.getCurrentContent(), selectionState, 'back');\n newEditorState = _draftJs.EditorState.push(newEditorState, contentState, 'backspace-character');\n } // Insert a newline\n\n\n return _draftJs.RichUtils.insertSoftNewline(newEditorState);\n}\n/**\n * Toggle an inline style on/off\n *\n * @param {EditorState} editorState The DraftJS editor state\n * @param {String} inlineStyle The inline style string representation\n * @returns {EditorState} The new editor state\n */\n\n\nfunction toggleInlineStyle(editorState, inlineStyle) {\n /*\n * TODO tech-debt. Link toggles should not go via toggleInlineStyle.\n * https://github.com/plotly/streambed/issues/6354\n */\n if (inlineStyle === _configuration.LINK) {\n return toggleLink(editorState);\n } // and should be mutually exclusive.\n\n\n var updatedEditorState = toggleMutuallyExclusiveStyles(editorState, inlineStyle); // Add the new style.\n\n return _draftJs.RichUtils.toggleInlineStyle(updatedEditorState, inlineStyle);\n}\n/**\n * Toggle a link on/off\n *\n * @param {EditorState} editorState The DraftJS editor state\n * @returns {EditorState} The new editor state\n */\n\n\nfunction toggleLink(editorState) {\n var selection = editorState.getSelection();\n\n if (selectionHasLink(editorState, selection)) {\n // Remove link\n return _draftJs.RichUtils.toggleLink(editorState, selection, null);\n } // Create a link with an empty URL\n\n\n var entityKey = _draftJs.Entity.create(_configuration.LINK, 'MUTABLE', {\n url: ''\n });\n\n return _draftJs.RichUtils.toggleLink(editorState, selection, entityKey);\n}\n/**\n * For the current selection, if a SUPERSCRIPT or SUBSCRIPT style is\n * to be applied, un-apply the other style.\n *\n * @param {EditorState} editorState The DraftJS editor state\n * @param {String} inlineStyle Style about to be applied\n * @returns {EditorState} The new editor state\n */\n\n\nfunction toggleMutuallyExclusiveStyles(editorState, inlineStyle) {\n var currentStyleSet = editorState.getCurrentInlineStyle();\n\n if (inlineStyle === _configuration.SUBSCRIPT && currentStyleSet.includes(_configuration.SUPERSCRIPT)) {\n return _draftJs.RichUtils.toggleInlineStyle(editorState, _configuration.SUPERSCRIPT);\n }\n\n if (inlineStyle === _configuration.SUPERSCRIPT && currentStyleSet.includes(_configuration.SUBSCRIPT)) {\n return _draftJs.RichUtils.toggleInlineStyle(editorState, _configuration.SUBSCRIPT);\n }\n\n return editorState;\n}\n//# sourceMappingURL=DraftCommands.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/DraftCommands.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/LinkDecorator.js": /*!*******************************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/LinkDecorator.js ***! \*******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/*\n * A DecoratorComponent is used by `draft-js` to render rich content\n * beyond inline styles. This Decorator renders LINK entities.\n *\n * See\n * https://facebook.github.io/draft-js/docs/advanced-topics-decorators.html#decorator-components\n */\nvar LinkDecorator = function LinkDecorator(props) {\n return /*#__PURE__*/_react.default.createElement(\"a\", {\n href: \"#\",\n style: props.style\n }, props.children);\n};\n\nLinkDecorator.propTypes = {\n style: _propTypes.default.object.isRequired,\n children: _propTypes.default.oneOfType([_propTypes.default.array, _propTypes.default.element]).isRequired\n};\nvar _default = LinkDecorator;\nexports.default = _default;\n//# sourceMappingURL=LinkDecorator.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/LinkDecorator.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/LinkEditor.js": /*!****************************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/LinkEditor.js ***! \****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _constants = __webpack_require__(/*! ../../../../lib/constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nvar _reactDom = __webpack_require__(/*! react-dom */ \"./node_modules/react-dom/index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar LinkEditor = /*#__PURE__*/function (_Component) {\n _inherits(LinkEditor, _Component);\n\n var _super = _createSuper(LinkEditor);\n\n function LinkEditor(props) {\n var _this;\n\n _classCallCheck(this, LinkEditor);\n\n _this = _super.call(this, props);\n _this.state = {\n // Use cached position to maintain position during times of focus.\n position: _this.getUpdatedPosition(props),\n originalLinkURL: props.linkURL\n };\n return _this;\n }\n\n _createClass(LinkEditor, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n // Focus the input field if the URL value is empty\n if (this.props.linkURL.trim() === '') {\n (0, _reactDom.findDOMNode)(this.input).focus();\n }\n }\n }, {\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps) {\n var props = this.props; // Update position if we are editing a new link\n\n if (nextProps.linkID !== props.linkID) {\n this.setState({\n position: this.getUpdatedPosition(props)\n });\n }\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate() {\n // Cursor dissappears when component rerenders, to make sure it's present\n // we're using setSelection range to make it appear at the end of text:\n // https://github.com/plotly/streambed/issues/9964\n (0, _reactDom.findDOMNode)(this.input).setSelectionRange(this.props.linkURL.length, this.props.linkURL.length);\n }\n }, {\n key: \"getUpdatedPosition\",\n value: function getUpdatedPosition(props) {\n var _props$coordinates = props.coordinates,\n x = _props$coordinates.x,\n y = _props$coordinates.y;\n return {\n x: x,\n y: y\n };\n }\n }, {\n key: \"onInputChange\",\n value: function onInputChange(urlValue) {\n var _this$props = this.props,\n linkID = _this$props.linkID,\n onURLChange = _this$props.onURLChange; // Call back to parent\n\n onURLChange(linkID, urlValue);\n }\n }, {\n key: \"onInputKeyDown\",\n value: function onInputKeyDown(ev) {\n /*\n * `KeyboardEvent.key` enjoys excellent cross-browser support.\n * https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key\n */\n var key = ev.key;\n\n if (key === _constants.RETURN_KEY) {\n // Save changes\n ev.preventDefault();\n this.props.onClose(this.props.linkID);\n }\n\n if (key === _constants.ESCAPE_KEY) {\n // Cancel changes\n ev.preventDefault(); // Restore original URL\n\n this.onInputChange(this.state.originalLinkURL);\n this.props.onClose(this.props.linkID);\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _ = this.context.localize;\n var position = this.state.position;\n var _this$props2 = this.props,\n onBlur = _this$props2.onBlur,\n onFocus = _this$props2.onFocus,\n linkURL = _this$props2.linkURL;\n\n var placeholderText = _('Enter Link URL');\n\n var urlText = _('URL'); // TODO: add close button\n\n\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"rich-text-editor__link-editor\",\n style: {\n left: position.x,\n top: position.y\n }\n }, /*#__PURE__*/_react.default.createElement(\"span\", {\n className: \"rich-text-editor__link-editor__label\"\n }, urlText), /*#__PURE__*/_react.default.createElement(\"input\", {\n className: \"rich-text-editor__link-editor__input\",\n onBlur: onBlur,\n onFocus: onFocus,\n onChange: function onChange(ev) {\n return _this2.onInputChange(ev.target.value);\n },\n onKeyDown: function onKeyDown(ev) {\n return _this2.onInputKeyDown(ev);\n },\n ref: function ref(input) {\n return _this2.input = input;\n },\n value: linkURL,\n placeholder: placeholderText\n }));\n }\n }]);\n\n return LinkEditor;\n}(_react.Component);\n\nLinkEditor.propTypes = {\n linkID: _propTypes.default.string.isRequired,\n linkURL: _propTypes.default.string.isRequired,\n onBlur: _propTypes.default.func.isRequired,\n onFocus: _propTypes.default.func.isRequired,\n onClose: _propTypes.default.func.isRequired,\n onURLChange: _propTypes.default.func.isRequired,\n coordinates: _propTypes.default.shape({\n x: _propTypes.default.number,\n y: _propTypes.default.number\n })\n};\nLinkEditor.defaultProps = {\n coordinates: {\n x: 0,\n y: 0\n }\n};\nLinkEditor.contextTypes = {\n localize: _propTypes.default.func.isRequired\n};\nvar _default = LinkEditor;\nexports.default = _default;\n//# sourceMappingURL=LinkEditor.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/LinkEditor.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/StyleButton.js": /*!*****************************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/StyleButton.js ***! \*****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ \"./node_modules/classnames/index.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar StyleButton = /*#__PURE__*/function (_Component) {\n _inherits(StyleButton, _Component);\n\n var _super = _createSuper(StyleButton);\n\n function StyleButton(props) {\n var _this;\n\n _classCallCheck(this, StyleButton);\n\n _this = _super.call(this, props);\n _this.onToggle = _this.onToggle.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(StyleButton, [{\n key: \"onToggle\",\n value: function onToggle(ev) {\n // Prevent focus moving from editor to button\n ev.preventDefault();\n this.props.onToggle(this.props.value);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n active = _this$props.active,\n label = _this$props.label,\n value = _this$props.value;\n var className = (0, _classnames.default)('rich-text-editor__styleButton', \"rich-text-editor__styleButton__\".concat(value), {\n 'rich-text-editor__styleButton--active': active\n });\n return /*#__PURE__*/_react.default.createElement(\"span\", {\n className: \"rich-text-editor__styleButton__wrapper\"\n }, /*#__PURE__*/_react.default.createElement(\"span\", {\n className: className,\n onMouseDown: this.onToggle,\n \"data-role\": \"button\",\n \"data-pressed\": active\n }, label));\n }\n }]);\n\n return StyleButton;\n}(_react.Component);\n\nStyleButton.propTypes = {\n active: _propTypes.default.bool,\n // A (styled) React element to display as label\n label: _propTypes.default.element.isRequired,\n // Callback for clicks\n onToggle: _propTypes.default.func.isRequired,\n // The value passed to `onToggle` when clicked\n value: _propTypes.default.string.isRequired\n};\nvar _default = StyleButton;\nexports.default = _default;\n//# sourceMappingURL=StyleButton.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/StyleButton.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/StyleButtonGroup.js": /*!**********************************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/StyleButtonGroup.js ***! \**********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _StyleButton = _interopRequireDefault(__webpack_require__(/*! ./StyleButton */ \"./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/StyleButton.js\"));\n\nvar _configuration = __webpack_require__(/*! ./configuration */ \"./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/configuration.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar StyleButtonGroup = /*#__PURE__*/function (_Component) {\n _inherits(StyleButtonGroup, _Component);\n\n var _super = _createSuper(StyleButtonGroup);\n\n function StyleButtonGroup() {\n _classCallCheck(this, StyleButtonGroup);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(StyleButtonGroup, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n currentStyle = _this$props.currentStyle,\n linkIsSelected = _this$props.linkIsSelected,\n styles = _this$props.styles,\n onToggle = _this$props.onToggle;\n\n var isActive = function isActive(currentStyle, value) {\n if (value === _configuration.LINK) {\n return linkIsSelected;\n }\n\n if (typeof currentStyle.has === 'function') {\n return currentStyle.has(value);\n }\n\n return Boolean(currentStyle.value);\n };\n\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"rich-text-editor__controls\"\n }, styles.map(function (_ref) {\n var label = _ref.label,\n value = _ref.value;\n return /*#__PURE__*/_react.default.createElement(_StyleButton.default, {\n key: value,\n active: isActive(currentStyle, value),\n label: label,\n onToggle: onToggle,\n value: value\n });\n }));\n }\n }]);\n\n return StyleButtonGroup;\n}(_react.Component);\n\nStyleButtonGroup.propTypes = {\n onToggle: _propTypes.default.func.isRequired,\n styles: _propTypes.default.arrayOf(_propTypes.default.shape({\n label: _propTypes.default.element.isRequired,\n value: _propTypes.default.string.isRequired\n })).isRequired,\n // A draft-js DraftInlineStyle instance\n // https://facebook.github.io/draft-js/docs/api-reference-editor-state.html#getcurrentinlinestyle\n currentStyle: _propTypes.default.object,\n linkIsSelected: _propTypes.default.bool\n};\nvar _default = StyleButtonGroup;\nexports.default = _default;\n//# sourceMappingURL=StyleButtonGroup.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/StyleButtonGroup.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/configuration.js": /*!*******************************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/configuration.js ***! \*******************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.INLINE_STYLES = exports.STYLE_MAP = exports.STYLES_TO_HTML_TAGS = exports.ITALIC = exports.BOLD = exports.LINK = exports.SUBSCRIPT = exports.SUPERSCRIPT = void 0;\n\nvar _react = _interopRequireDefault(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _draftJsUtils = __webpack_require__(/*! draft-js-utils */ \"./node_modules/draft-js-utils/esm/main.js\");\n\nvar _plotlyIcons = __webpack_require__(/*! plotly-icons */ \"./node_modules/plotly-icons/lib/index.js\");\n\nvar _constants = __webpack_require__(/*! ../../../../lib/constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nvar _STYLES_TO_HTML_TAGS, _STYLE_MAP;\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar SUPERSCRIPT = 'SUPERSCRIPT';\nexports.SUPERSCRIPT = SUPERSCRIPT;\nvar SUBSCRIPT = 'SUBSCRIPT';\nexports.SUBSCRIPT = SUBSCRIPT;\nvar LINK = 'LINK';\nexports.LINK = LINK;\nvar BOLD = _draftJsUtils.INLINE_STYLE.BOLD,\n ITALIC = _draftJsUtils.INLINE_STYLE.ITALIC;\nexports.ITALIC = ITALIC;\nexports.BOLD = BOLD;\nvar STYLES_TO_HTML_TAGS = (_STYLES_TO_HTML_TAGS = {}, _defineProperty(_STYLES_TO_HTML_TAGS, BOLD, {\n element: 'b'\n}), _defineProperty(_STYLES_TO_HTML_TAGS, ITALIC, {\n element: 'i'\n}), _defineProperty(_STYLES_TO_HTML_TAGS, SUPERSCRIPT, {\n element: 'sup'\n}), _defineProperty(_STYLES_TO_HTML_TAGS, SUBSCRIPT, {\n element: 'sub'\n}), _defineProperty(_STYLES_TO_HTML_TAGS, LINK, {\n element: 'a'\n}), _STYLES_TO_HTML_TAGS);\nexports.STYLES_TO_HTML_TAGS = STYLES_TO_HTML_TAGS;\nvar STYLE_MAP = (_STYLE_MAP = {}, _defineProperty(_STYLE_MAP, BOLD, {\n fontWeight: 'bolder'\n}), _defineProperty(_STYLE_MAP, ITALIC, {\n fontStyle: 'italic'\n}), _defineProperty(_STYLE_MAP, SUBSCRIPT, {\n /*\n * Can't use text-align; IE renders `text-bottom` properly, but\n * FF doesn't (same height as `bottom`). Chrome doesn't understand\n * `text-align: bottom`. Use relative positioning instead.\n */\n lineHeight: 0,\n fontSize: '65%',\n position: 'relative',\n bottom: '-3px'\n}), _defineProperty(_STYLE_MAP, SUPERSCRIPT, {\n /*\n * Can't use text-align; IE renders `text-top` properly, but\n * FF doesn't (same height as `top`). Chrome doesn't understand\n * `text-align: top`. Use relative positioning instead.\n */\n lineHeight: 0,\n fontSize: '65%',\n position: 'relative',\n top: '-5px'\n}), _defineProperty(_STYLE_MAP, LINK, {\n color: _constants.COLORS.editorLink,\n linkDecoration: 'none',\n cursor: 'pointer'\n}), _STYLE_MAP);\nexports.STYLE_MAP = STYLE_MAP;\nvar INLINE_STYLES = [{\n label: /*#__PURE__*/_react.default.createElement(\"span\", {\n style: STYLE_MAP[BOLD]\n }, \"B\"),\n value: BOLD\n}, {\n label: /*#__PURE__*/_react.default.createElement(\"span\", {\n style: STYLE_MAP[ITALIC]\n }, \"I\"),\n value: ITALIC\n}, {\n label: /*#__PURE__*/_react.default.createElement(\"span\", null, \"x\", /*#__PURE__*/_react.default.createElement(\"span\", {\n style: STYLE_MAP[SUBSCRIPT]\n }, \"2\")),\n value: SUBSCRIPT\n}, {\n label: /*#__PURE__*/_react.default.createElement(\"span\", null, \"x\", /*#__PURE__*/_react.default.createElement(\"span\", {\n style: STYLE_MAP[SUPERSCRIPT]\n }, \"2\")),\n value: SUPERSCRIPT\n}, {\n label: /*#__PURE__*/_react.default.createElement(\"span\", null, /*#__PURE__*/_react.default.createElement(_plotlyIcons.LinkIcon, {\n className: \"icon-link\"\n })),\n value: LINK\n}];\nexports.INLINE_STYLES = INLINE_STYLES;\n//# sourceMappingURL=configuration.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/configuration.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/debounce.js": /*!**************************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/debounce.js ***! \**************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = debounce;\nvar DEBOUNCE_DELAY = 250;\nvar timeout;\n\nfunction clearTimeout() {\n window.clearTimeout(timeout);\n timeout = null;\n}\n\nfunction debounce(fn, args) {\n if (timeout) {\n clearTimeout();\n }\n\n timeout = window.setTimeout(function () {\n fn.apply(null, args);\n timeout = null;\n }, DEBOUNCE_DELAY);\n}\n//# sourceMappingURL=debounce.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/debounce.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/decoratorStrategies.js": /*!*************************************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/decoratorStrategies.js ***! \*************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.findLinkEntities = void 0;\n\nvar _draftJs = __webpack_require__(/*! draft-js */ \"./node_modules/draft-js/lib/Draft.js\");\n\n/*\n * A decoratorStrategy is used by `draft-js` to determine how to render\n * content beyond inline styles. We use them to render LINK entities.\n *\n * See https://facebook.github.io/draft-js/docs/advanced-topics-decorators.html#content\n * and\n * https://facebook.github.io/draft-js/docs/advanced-topics-entities.html#content\n */\nvar characterIsLinkEntity = function characterIsLinkEntity(character) {\n var entityKey = character.getEntity();\n\n if (entityKey === null) {\n return false;\n }\n\n var entity = _draftJs.Entity.get(entityKey);\n\n return entity.getType() === 'LINK';\n};\n\nvar findLinkEntities = function findLinkEntities(contentBlock, callback) {\n contentBlock.findEntityRanges(characterIsLinkEntity, callback);\n};\n\nexports.findLinkEntities = findLinkEntities;\n//# sourceMappingURL=decoratorStrategies.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/decoratorStrategies.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/getSelectionCoordinates.js": /*!*****************************************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/getSelectionCoordinates.js ***! \*****************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar getCoordinates = function getCoordinates() {\n var coordinates = {\n x: 0,\n y: 0\n };\n var rect = document.getElementsByClassName('text-editor')[0].getBoundingClientRect();\n var LINK_POP_UP_WIDTH = 158.5;\n\n if (rect) {\n // Add to the offset\n coordinates.x += rect.width * 0.5 - LINK_POP_UP_WIDTH / 2;\n coordinates.y += rect.height * 0.5;\n }\n\n return coordinates;\n};\n\nvar _default = getCoordinates;\nexports.default = _default;\n//# sourceMappingURL=getSelectionCoordinates.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/getSelectionCoordinates.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/index.js": /*!***********************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/index.js ***! \***********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _draftJs = __webpack_require__(/*! draft-js */ \"./node_modules/draft-js/lib/Draft.js\");\n\nvar _draftJsExportHtml = __webpack_require__(/*! @plotly/draft-js-export-html */ \"./node_modules/@plotly/draft-js-export-html/lib/main.js\");\n\nvar _draftJsImportHtml = __webpack_require__(/*! draft-js-import-html */ \"./node_modules/draft-js-import-html/esm/main.js\");\n\nvar _configuration = __webpack_require__(/*! ./configuration */ \"./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/configuration.js\");\n\nvar _LinkDecorator = _interopRequireDefault(__webpack_require__(/*! ./LinkDecorator */ \"./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/LinkDecorator.js\"));\n\nvar _LinkEditor = _interopRequireDefault(__webpack_require__(/*! ./LinkEditor */ \"./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/LinkEditor.js\"));\n\nvar _StyleButtonGroup = _interopRequireDefault(__webpack_require__(/*! ./StyleButtonGroup */ \"./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/StyleButtonGroup.js\"));\n\nvar _debounce = _interopRequireDefault(__webpack_require__(/*! ./debounce */ \"./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/debounce.js\"));\n\nvar _DraftCommands = __webpack_require__(/*! ./DraftCommands */ \"./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/DraftCommands.js\");\n\nvar _decoratorStrategies = __webpack_require__(/*! ./decoratorStrategies */ \"./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/decoratorStrategies.js\");\n\nvar _getSelectionCoordinates = _interopRequireDefault(__webpack_require__(/*! ./getSelectionCoordinates */ \"./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/getSelectionCoordinates.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar RichText = /*#__PURE__*/function (_Component) {\n _inherits(RichText, _Component);\n\n var _super = _createSuper(RichText);\n\n function RichText(props, context) {\n var _this;\n\n _classCallCheck(this, RichText);\n\n _this = _super.call(this, props, context);\n /*\n * Initially set state based on the plotly.js annotation content.\n * After this, as long as this component is mounted, it owns the source\n * of truth for the annotation value via `this.state.editorState`.\n * This state may be updated externally via a prop update.\n * See `componentWillReceiveProps`.\n */\n\n _this.state = {\n editorState: props.value.toString().trim().length ? _this.createEditorStateFromHTML(props.value) : _draftJs.EditorState.createEmpty(_this.getDecorator())\n };\n _this.getDecorator = _this.getDecorator.bind(_assertThisInitialized(_this));\n _this.createEditorStateFromHTML = _this.createEditorStateFromHTML.bind(_assertThisInitialized(_this));\n _this.getEditorStateAsHTML = _this.getEditorStateAsHTML.bind(_assertThisInitialized(_this));\n _this.focus = _this.focus.bind(_assertThisInitialized(_this));\n _this.getParentContainerVerticalOffset = _this.getParentContainerVerticalOffset.bind(_assertThisInitialized(_this));\n _this.onChange = _this.onChange.bind(_assertThisInitialized(_this));\n _this.onBlur = _this.onBlur.bind(_assertThisInitialized(_this));\n _this.onFocus = _this.onFocus.bind(_assertThisInitialized(_this));\n _this.onLinkEditorBlur = _this.onLinkEditorBlur.bind(_assertThisInitialized(_this));\n _this.onLinkEditorFocus = _this.onLinkEditorFocus.bind(_assertThisInitialized(_this));\n _this.onLinkEditorChange = _this.onLinkEditorChange.bind(_assertThisInitialized(_this));\n _this.onLinkEditorClose = _this.onLinkEditorClose.bind(_assertThisInitialized(_this));\n _this.onKeyCommand = _this.onKeyCommand.bind(_assertThisInitialized(_this));\n _this.onReturnPressed = _this.onReturnPressed.bind(_assertThisInitialized(_this));\n _this.onStyleButtonToggle = _this.onStyleButtonToggle.bind(_assertThisInitialized(_this));\n _this.renderLinkEditor = _this.renderLinkEditor.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(RichText, [{\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps) {\n var _this$state = this.state,\n linkEditorFocus = _this$state.linkEditorFocus,\n editorFocus = _this$state.editorFocus;\n /*\n * Don't worry about what plotly.js thinks the annotation value\n * should be while we're using our editor, for these reasons:\n *\n * 1. The editor should be considered the source of truth, unless the\n * user is actually editing the annotation inline, in the chart.\n * 2. Sometimes we get updates with stale values.\n */\n\n if (linkEditorFocus || editorFocus) {\n return;\n } // Sync editor state with plotly annotation value.\n\n\n var editorState = this.createEditorStateFromHTML(nextProps.value);\n this.setState({\n editorState: editorState\n });\n }\n }, {\n key: \"shouldComponentUpdate\",\n value: function shouldComponentUpdate(nextProps, nextState) {\n var _this$props = this.props,\n placeholder = _this$props.placeholder,\n value = _this$props.value;\n var _this$state2 = this.state,\n editorState = _this$state2.editorState,\n linkEditorFocus = _this$state2.linkEditorFocus; // If relevant props or state changed, return true.\n\n if ( // Always update when user is editing link\n linkEditorFocus || placeholder !== nextProps.placeholder || value !== nextProps.value || editorState !== nextState.editorState) {\n return true;\n } // Compare incoming value with HTML representation of state.\n\n\n return nextProps.value !== this.getEditorStateAsHTML(editorState);\n }\n }, {\n key: \"getDecorator\",\n value: function getDecorator() {\n return new _draftJs.CompositeDecorator([{\n strategy: _decoratorStrategies.findLinkEntities,\n component: _LinkDecorator.default,\n // Props for the LinkDecorator component\n props: {\n style: _configuration.STYLE_MAP[_configuration.LINK]\n }\n }]);\n }\n }, {\n key: \"createEditorStateFromHTML\",\n value: function createEditorStateFromHTML(html) {\n var _inlineStyles;\n\n var contentState = (0, _draftJsImportHtml.stateFromHTML)(html, {\n inlineStyles: (_inlineStyles = {}, _defineProperty(_inlineStyles, _configuration.SUPERSCRIPT, {\n element: 'sup'\n }), _defineProperty(_inlineStyles, _configuration.SUBSCRIPT, {\n element: 'sub'\n }), _inlineStyles),\n defaultBlockTag: null\n });\n var decorator = this.getDecorator();\n /*\n * Work around issue described here:\n * https://github.com/facebook/draft-js/issues/185\n * #issuecomment-217207612\n */\n // Parse once to generate entity instances\n\n _draftJs.EditorState.createWithContent(contentState); // Now we can add our decorator\n\n\n return _draftJs.EditorState.createWithContent(contentState, decorator);\n }\n }, {\n key: \"getEditorStateAsHTML\",\n value: function getEditorStateAsHTML(editorState) {\n var contentState = editorState.getCurrentContent();\n return (0, _draftJsExportHtml.stateToHTML)(contentState, {\n defaultBlockTag: null,\n inlineStyles: _configuration.STYLES_TO_HTML_TAGS\n });\n }\n }, {\n key: \"focus\",\n value: function focus() {\n this.editorInput.focus();\n } // Used to properly calculate user selection coordinates.\n\n }, {\n key: \"getParentContainerVerticalOffset\",\n value: function getParentContainerVerticalOffset() {\n return document.querySelector('.panel').scrollTop;\n }\n }, {\n key: \"onChange\",\n value: function onChange(editorState) {\n var selectedLinkID = this.state.selectedLinkID;\n var selection = editorState.getSelection();\n var entityKey = (0, _DraftCommands.getEntityKeyAt)(editorState, selection);\n var newState = {\n editorState: editorState\n }; // Update selected link ID\n\n if (!(0, _DraftCommands.cursorHasLink)(editorState, selection)) {\n // If a link is no longer selected, clear selected link ID state\n Object.assign(newState, {\n selectedLinkID: null\n });\n } else if (selectedLinkID !== entityKey) {\n // If link selection is new / different link selected, update it\n Object.assign(newState, {\n selectedLinkID: entityKey\n });\n } // Update internal state\n\n\n this.setState(newState); // Dispatch changes to plotly.js\n // TODO consider moving to render (plotly.js is a render target)\n\n var htmlContent = this.getEditorStateAsHTML(editorState).replace(/
\\n*/, '
');\n\n if (this.props.value !== htmlContent) {\n (0, _debounce.default)(this.props.onChange, [htmlContent]);\n }\n }\n }, {\n key: \"onBlur\",\n value: function onBlur() {\n this.setState({\n editorFocus: false\n });\n }\n }, {\n key: \"onFocus\",\n value: function onFocus() {\n this.setState({\n editorFocus: true\n });\n }\n }, {\n key: \"onLinkEditorBlur\",\n value: function onLinkEditorBlur() {\n this.setState({\n linkEditorFocus: false\n });\n }\n }, {\n key: \"onLinkEditorFocus\",\n value: function onLinkEditorFocus() {\n this.setState({\n linkEditorFocus: true\n });\n }\n }, {\n key: \"onLinkEditorChange\",\n value: function onLinkEditorChange(linkID, urlValue) {\n var editorState = this.state.editorState;\n var selectionState = editorState.getSelection(); // Update link URL\n\n _draftJs.Entity.replaceData(linkID, {\n url: urlValue\n }); // Trigger an editor state update\n\n\n var updatedEditorState = _draftJs.RichUtils.toggleLink(editorState, selectionState, linkID);\n\n this.onChange(updatedEditorState);\n }\n /**\n * Will be called by LinkEditor when the user confirms or cancels new URL.\n * Will not be called if LinkEditor is closed by moving the cursor off of\n * the selected LINK entity.\n *\n * @param {String} linkID The link entity key related to this LinkEditor\n * @returns {undefined}\n */\n\n }, {\n key: \"onLinkEditorClose\",\n value: function onLinkEditorClose() {\n /*\n * Focus on editor immediately to avoid error that occurs when\n * `selection.extend` is called and another element has focus.\n * https://bugzilla.mozilla.org/show_bug.cgi?id=921444\n * https://github.com/facebook/draft-js/blob/342576bf7186d07c82a41d9ca8169130669747d6/src/component/selection/setDraftEditorSelection.js#L128-L134\n */\n this.focus(); // Hide the editor.\n\n this.setState({\n linkEditorFocus: false,\n selectedLinkID: null\n });\n }\n }, {\n key: \"onKeyCommand\",\n value: function onKeyCommand(command) {\n var newEditorState = (0, _DraftCommands.handleKeyCommand)(this.state.editorState, command);\n\n if (newEditorState) {\n this.onChange(newEditorState); // Let draft-js know that keyboard command is handled.\n\n return true;\n } // Default draft-js implementation\n\n\n return false;\n }\n }, {\n key: \"onReturnPressed\",\n value: function onReturnPressed() {\n var newEditorState = (0, _DraftCommands.insertSoftNewline)(this.state.editorState); // Update internal and external state\n\n this.onChange(newEditorState); // Cancel draft-js implementation\n\n return true;\n }\n }, {\n key: \"onStyleButtonToggle\",\n value: function onStyleButtonToggle(inlineStyle) {\n var newEditorState = (0, _DraftCommands.toggleInlineStyle)(this.state.editorState, inlineStyle);\n\n if (newEditorState) {\n this.onChange(newEditorState);\n }\n }\n }, {\n key: \"renderLinkEditor\",\n value: function renderLinkEditor(selectedLinkID) {\n if (!selectedLinkID) {\n return null;\n } // All entities are link entities.\n\n\n var linkEntity = (0, _DraftCommands.getEntityByKey)(selectedLinkID);\n var linkURL = linkEntity.getData().url;\n var coordinates = (0, _getSelectionCoordinates.default)();\n return /*#__PURE__*/_react.default.createElement(_LinkEditor.default, {\n onFocus: this.onLinkEditorFocus,\n onURLChange: this.onLinkEditorChange,\n onBlur: this.onLinkEditorBlur,\n onClose: this.onLinkEditorClose,\n coordinates: coordinates,\n linkID: selectedLinkID,\n linkURL: linkURL\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _this$state3 = this.state,\n editorState = _this$state3.editorState,\n selectedLinkID = _this$state3.selectedLinkID;\n var linkIsSelected = Boolean(selectedLinkID);\n return /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"rich-text-editor__root\"\n }, /*#__PURE__*/_react.default.createElement(_StyleButtonGroup.default, {\n styles: _configuration.INLINE_STYLES,\n currentStyle: editorState.getCurrentInlineStyle(),\n linkIsSelected: linkIsSelected,\n onToggle: this.onStyleButtonToggle\n }), /*#__PURE__*/_react.default.createElement(\"div\", {\n className: \"rich-text-editor__editor\",\n onClick: this.focus\n }, /*#__PURE__*/_react.default.createElement(_draftJs.Editor, {\n customStyleMap: _configuration.STYLE_MAP,\n editorState: editorState,\n handleReturn: this.onReturnPressed,\n handleKeyCommand: this.onKeyCommand,\n onChange: this.onChange,\n onBlur: this.onBlur,\n onFocus: this.onFocus,\n placeholder: this.props.placeholder,\n spellCheck: false,\n ref: function ref(input) {\n return _this2.editorInput = input;\n }\n })), this.renderLinkEditor(selectedLinkID));\n }\n }]);\n\n return RichText;\n}(_react.Component);\n\nRichText.propTypes = {\n onChange: _propTypes.default.func.isRequired,\n placeholder: _propTypes.default.string,\n value: _propTypes.default.any\n};\nRichText.defaultProps = {\n placeholder: '',\n value: ''\n};\nvar _default = RichText;\nexports.default = _default;\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/widgets/text_editors/RichText/index.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/components/widgets/text_editors/convertFormats.js": /*!***********************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/components/widgets/text_editors/convertFormats.js ***! \***********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.laTeXToHTML = exports.htmlToLaTeX = exports.hasTextExpression = exports.isLaTeXExpr = void 0;\n\nvar getTextBlockRegExp = function getTextBlockRegExp() {\n return /\\\\text\\{([^}]*)}/g;\n};\n/**\n * To match any character including newline whitespace, use `[\\s\\S]*`\n * instead of `.*`. http://stackoverflow.com/a/1068308\n *\n * @returns {RegExp} the regular expression\n */\n\n\nvar getLaTeXWrappedRegExp = function getLaTeXWrappedRegExp() {\n return /^\\$[\\s\\S]*\\$$/;\n};\n\nvar stripHTMLTags = function stripHTMLTags(html) {\n return html.replace(/<[^>]*>/g, '').trim();\n};\n\nvar extractTextBlocks = function extractTextBlocks(laTeX) {\n var matchObj;\n var matchStr;\n var matches = []; // Need to stringify to match literally on `\\t`.\n\n var stringifiedLaTeX = JSON.stringify(laTeX);\n var regExp = getTextBlockRegExp();\n /**\n * Find multiple matches with the ``//g` flag.\n * The `RegExp.prototype.exec` API mutates the RegExp object.\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec#Finding_successive_matches\n */\n\n while ((matchObj = regExp.exec(stringifiedLaTeX)) !== null) {\n matchStr = matchObj[1].trim().replace('\\\\n', '');\n matches.push(matchStr);\n }\n\n return matches.join('
');\n};\n\nvar wrapLaTeX = function wrapLaTeX(value) {\n return value ? \"$\".concat(value, \"$\") : '$$';\n};\n\nvar wrapText = function wrapText(value) {\n return value ? \"\\\\text{\".concat(value, \"}\") : '\\\\text{}';\n}; // Exports\n// -------\n\n\nvar isLaTeXExpr = function isLaTeXExpr(value) {\n return getLaTeXWrappedRegExp().test(value);\n};\n\nexports.isLaTeXExpr = isLaTeXExpr;\n\nvar hasTextExpression = function hasTextExpression(laTeX) {\n var regExp = getTextBlockRegExp();\n var stringifiedLaTeX = JSON.stringify(laTeX);\n return regExp.test(stringifiedLaTeX);\n};\n\nexports.hasTextExpression = hasTextExpression;\n\nvar htmlToLaTeX = function htmlToLaTeX(html) {\n var breakTag = '
';\n var trimmedHTML = html.trim(); // Handle empty input\n\n if (trimmedHTML === '') {\n return wrapLaTeX(wrapText());\n } // Handle input with only linebreaks\n\n\n if (trimmedHTML.replace(breakTag, '') === '') {\n return wrapLaTeX(wrapText());\n }\n\n return wrapLaTeX(trimmedHTML.split(breakTag) // Ignore empty linebreaks\n .map(function (para) {\n return para.length ? wrapText(stripHTMLTags(para)) : '';\n }).join('\\n'));\n};\n\nexports.htmlToLaTeX = htmlToLaTeX;\n\nvar laTeXToHTML = function laTeXToHTML(laTeX) {\n var trimmedLaTeX = laTeX.trim();\n return extractTextBlocks(trimmedLaTeX);\n};\n\nexports.laTeXToHTML = laTeXToHTML;\n//# sourceMappingURL=convertFormats.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/components/widgets/text_editors/convertFormats.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/default_panels/GraphCreatePanel.js": /*!********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/default_panels/GraphCreatePanel.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _components = __webpack_require__(/*! ../components */ \"./node_modules/react-chart-editor/lib/components/index.js\");\n\nvar _derived = __webpack_require__(/*! ../components/fields/derived */ \"./node_modules/react-chart-editor/lib/components/fields/derived.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar GraphCreatePanel = function GraphCreatePanel(props, _ref) {\n var _ = _ref.localize,\n setPanel = _ref.setPanel;\n return /*#__PURE__*/_react.default.createElement(_components.TraceAccordion, {\n canAdd: true,\n traceFilterCondition: function traceFilterCondition(t) {\n return !(t.transforms && t.transforms.some(function (tr) {\n return ['fit', 'moving-average'].includes(tr.type);\n }));\n },\n canReorder: true\n }, /*#__PURE__*/_react.default.createElement(_components.TraceSelector, {\n label: _('Type'),\n attr: \"type\",\n show: true\n }), /*#__PURE__*/_react.default.createElement(_components.Dropzone, {\n attr: \"geojson\",\n fileType: \"geojson\"\n }), /*#__PURE__*/_react.default.createElement(_components.LocationSelector, {\n attr: \"type\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Values'),\n attr: \"values\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Labels'),\n attr: \"labels\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Parents'),\n attr: \"parents\"\n }), /*#__PURE__*/_react.default.createElement(_components.TraceTypeSection, {\n traceTypes: ['sunburst', 'treemap'],\n mode: \"trace\"\n }, /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('IDs'),\n attr: \"ids\"\n })), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Parent Value Mode'),\n attr: \"branchvalues\",\n options: [{\n label: _('Total'),\n value: 'total'\n }, {\n label: _('Remainder'),\n value: 'remainder'\n }],\n clearable: false\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: {\n histogram2d: _('X Values'),\n histogram: _('X Values'),\n '*': _('X')\n },\n attr: \"x\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: {\n histogram2d: _('Y Values'),\n histogram: _('Y Values'),\n '*': _('Y')\n },\n attr: \"y\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: {\n choropleth: _('Values'),\n histogram2d: _('Z Values'),\n '*': _('Z')\n },\n attr: \"z\"\n }), /*#__PURE__*/_react.default.createElement(_components.DropdownCustom, {\n label: _('GeoJSON Location Field'),\n attr: \"featureidkey\",\n options: [{\n label: _('id'),\n value: 'id'\n }, {\n label: _('Custom'),\n value: 'custom'\n }],\n customOpt: \"custom\",\n dafaultOpt: \"\",\n clearable: false\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Radius'),\n attr: \"radius\",\n min: 0,\n max: 50,\n showSlider: true\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Measure'),\n attr: \"measure\"\n }), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Nodes')\n }, /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Labels'),\n attr: \"node.label\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Groups'),\n attr: \"node.groups\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('X'),\n attr: \"node.x\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Y'),\n attr: \"node.y\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Links')\n }, /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Sources'),\n attr: \"link.source\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Targets'),\n attr: \"link.target\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Values'),\n attr: \"link.value\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Labels'),\n attr: \"link.label\"\n })), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Orientation'),\n attr: \"orientation\",\n options: [{\n label: _('Vertical'),\n value: 'v'\n }, {\n label: _('Horizontal'),\n value: 'h'\n }]\n }), /*#__PURE__*/_react.default.createElement(_derived.HistogramInfoVertical, null, _('Note: in vertical orientation, X values are used for binning. If Y values are provided, they are used as inputs to the histogram function which you can configure in the '), /*#__PURE__*/_react.default.createElement(\"a\", {\n onClick: function onClick() {\n return setPanel('Style', 'Traces');\n }\n }, _('Traces')), _(' panel under Style. If Y values are omitted, the histogram function defaults to Count.')), /*#__PURE__*/_react.default.createElement(_derived.HistogramInfoHorizontal, null, _('Note: in horizontal orientation, Y values are used for binning. If X values are provided, they are used as inputs to the histogram function which you can configure in the '), /*#__PURE__*/_react.default.createElement(\"a\", {\n onClick: function onClick() {\n return setPanel('Style', 'Traces');\n }\n }, _('Traces')), _(' under Style panel. If X values are omitted, the histogram function defaults to Count.')), /*#__PURE__*/_react.default.createElement(_derived.Histogram2d, null, _('Note: X and Y Values are used for binning. If Z values are provided, they are used as inputs to the histogram function which you can configure in the '), /*#__PURE__*/_react.default.createElement(\"a\", {\n onClick: function onClick() {\n return setPanel('Style', 'Traces');\n }\n }, _('Traces')), _(' under Style panel. If Z values are omitted, the histogram function defaults to Count.')), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('I (Optional)'),\n attr: \"i\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('J (Optional)'),\n attr: \"j\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('K (Optional)'),\n attr: \"k\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Open'),\n attr: \"open\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('High'),\n attr: \"high\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Low'),\n attr: \"low\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Close'),\n attr: \"close\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('A'),\n attr: \"a\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('B'),\n attr: \"b\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('C'),\n attr: \"c\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('U'),\n attr: \"u\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('V'),\n attr: \"v\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('W'),\n attr: \"w\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('X start'),\n attr: \"starts.x\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Y start'),\n attr: \"starts.y\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Z start'),\n attr: \"starts.z\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Headers'),\n attr: \"header.values\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Columns'),\n attr: \"cells.values\"\n }), /*#__PURE__*/_react.default.createElement(_components.TraceTypeSection, {\n traceTypes: ['scatterpolar', 'scatterpolargl', 'barpolar'],\n mode: \"trace\"\n }, /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Radius'),\n attr: \"r\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Theta'),\n attr: \"theta\"\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Theta Unit'),\n options: [{\n label: _('Radians'),\n value: 'radians'\n }, {\n label: _('Degrees'),\n value: 'degrees'\n }, {\n label: _('Gradians'),\n value: 'gradians'\n }],\n attr: \"thetaunit\",\n clearable: false\n })), /*#__PURE__*/_react.default.createElement(_components.AxesCreator, {\n attr: \"fake_attr\"\n }), /*#__PURE__*/_react.default.createElement(_components.SubplotCreator, {\n attr: \"fake_attr\"\n }), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Header Options')\n }, /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Fill Color'),\n attr: \"header.fill.color\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Font Color'),\n attr: \"header.font.color\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Font Size'),\n attr: \"header.font.size\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Cell Options')\n }, /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Fill Color'),\n attr: \"cells.fill.color\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Font Color'),\n attr: \"cells.font.color\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Font Size'),\n attr: \"cells.font.size\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Column Options')\n }, /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Width'),\n attr: \"columnwidth\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Order'),\n attr: \"columnorder\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Options')\n }, /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Intensity'),\n attr: \"intensity\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Facecolor'),\n attr: \"facecolor\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Vertexcolor'),\n attr: \"vertexcolor\"\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Transpose'),\n attr: \"transpose\",\n options: [{\n label: _('No'),\n value: false\n }, {\n label: _('Yes'),\n value: true\n }]\n })));\n};\n\nvar _default = GraphCreatePanel;\nexports.default = _default;\nGraphCreatePanel.contextTypes = {\n localize: _propTypes.default.func,\n setPanel: _propTypes.default.func\n};\n//# sourceMappingURL=GraphCreatePanel.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/default_panels/GraphCreatePanel.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/default_panels/GraphSubplotsPanel.js": /*!**********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/default_panels/GraphSubplotsPanel.js ***! \**********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _components = __webpack_require__(/*! ../components */ \"./node_modules/react-chart-editor/lib/components/index.js\");\n\nvar _constants = __webpack_require__(/*! ../lib/constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar GraphSubplotsPanel = function GraphSubplotsPanel(props, _ref) {\n var _ = _ref.localize;\n return /*#__PURE__*/_react.default.createElement(_components.SubplotAccordion, null, /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Boundaries'),\n attr: \"xaxis.domain[0]\"\n }, /*#__PURE__*/_react.default.createElement(_components.AxisOverlayDropdown, {\n label: _('X Overlay'),\n attr: \"xaxis.overlaying\"\n }), /*#__PURE__*/_react.default.createElement(_components.AxisOverlayDropdown, {\n label: _('Y Overlay'),\n attr: \"yaxis.overlaying\"\n })), /*#__PURE__*/_react.default.createElement(_components.RectanglePositioner, {\n attr: \"domain.x[0]\"\n }), /*#__PURE__*/_react.default.createElement(_components.RectanglePositioner, {\n attr: \"xaxis.domain[0]\",\n cartesian: true\n }), /*#__PURE__*/_react.default.createElement(_components.TraceTypeSection, {\n name: _('X Anchor'),\n traceTypes: _constants.TRACE_TO_AXIS.cartesian\n }, /*#__PURE__*/_react.default.createElement(_components.AxisAnchorDropdown, {\n label: _('Anchor to'),\n attr: \"xaxis.anchor\",\n clearable: false\n }), /*#__PURE__*/_react.default.createElement(_components.AxisSide, {\n label: _('Side'),\n attr: \"xaxis.side\"\n })), /*#__PURE__*/_react.default.createElement(_components.TraceTypeSection, {\n name: _('Y Anchor'),\n traceTypes: _constants.TRACE_TO_AXIS.cartesian\n }, /*#__PURE__*/_react.default.createElement(_components.AxisAnchorDropdown, {\n label: _('Anchor to'),\n attr: \"yaxis.anchor\",\n clearable: false\n }), /*#__PURE__*/_react.default.createElement(_components.AxisSide, {\n label: _('Side'),\n attr: \"yaxis.side\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Aspect Ratio')\n }, /*#__PURE__*/_react.default.createElement(_components.VisibilitySelect, {\n attr: \"aspectmode\",\n options: [{\n label: _('Auto'),\n value: 'mode'\n }, {\n label: _('Cube'),\n value: 'cube'\n }, {\n label: _('Data'),\n value: 'data'\n }, {\n label: _('Manual'),\n value: 'manual'\n }],\n dropdown: true,\n clearable: false,\n showOn: \"manual\",\n defaultOpt: \"mode\"\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('X'),\n attr: \"aspectratio.x\",\n step: 0.1\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Y'),\n attr: \"aspectratio.y\",\n step: 0.1\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Z'),\n attr: \"aspectratio.z\",\n step: 0.1\n }))), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Projection')\n }, /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Type'),\n attr: \"camera.projection.type\",\n options: [{\n label: _('Perspective'),\n value: 'perspective'\n }, {\n label: _('Orthographic'),\n value: 'orthographic'\n }],\n clearable: false\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Canvas')\n }, /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Plot Background'),\n attr: \"bgcolor\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Bar Options')\n }, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Bar Mode'),\n attr: \"barmode\",\n options: [{\n label: _('Stack'),\n value: 'stack'\n }, {\n label: _('Overlay'),\n value: 'overlay'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.NumericFraction, {\n label: _('Bar Padding'),\n attr: \"bargap\",\n showSlider: true\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Ternary')\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Sum'),\n attr: \"sum\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Polar Sector')\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Min'),\n attr: \"sector[0]\",\n min: -360,\n max: 360,\n showSlider: true\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Max'),\n attr: \"sector[1]\",\n min: -360,\n max: 360,\n showSlider: true\n }), /*#__PURE__*/_react.default.createElement(_components.NumericFraction, {\n label: _('Hole'),\n attr: \"hole\",\n min: 0,\n max: 100,\n showSlider: true\n })));\n};\n\nGraphSubplotsPanel.contextTypes = {\n localize: _propTypes.default.func\n};\nvar _default = GraphSubplotsPanel;\nexports.default = _default;\n//# sourceMappingURL=GraphSubplotsPanel.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/default_panels/GraphSubplotsPanel.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/default_panels/GraphTransformsPanel.js": /*!************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/default_panels/GraphTransformsPanel.js ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.Aggregations = void 0;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _components = __webpack_require__(/*! ../components */ \"./node_modules/react-chart-editor/lib/components/index.js\");\n\nvar _lib = __webpack_require__(/*! ../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _constants = __webpack_require__(/*! ../lib/constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar AggregationSection = (0, _lib.connectAggregationToTransform)(_components.PlotlySection);\n\nvar Aggregations = /*#__PURE__*/function (_Component) {\n _inherits(Aggregations, _Component);\n\n var _super = _createSuper(Aggregations);\n\n function Aggregations() {\n _classCallCheck(this, Aggregations);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(Aggregations, [{\n key: \"render\",\n value: function render() {\n var _this$context$fullCon = this.context.fullContainer.aggregations,\n aggregations = _this$context$fullCon === void 0 ? [] : _this$context$fullCon;\n var _ = this.context.localize;\n\n if (aggregations.length === 0) {\n return null;\n }\n\n return /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Aggregations'),\n attr: \"aggregations\"\n }, aggregations.filter(function (aggr) {\n return aggr.target && aggr.target.match(/transforms\\[\\d*\\]\\./gi) === null;\n }).map(function (_ref, i) {\n var target = _ref.target;\n return /*#__PURE__*/_react.default.createElement(AggregationSection, {\n show: true,\n key: i,\n aggregationIndex: i\n }, /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n attr: \"func\",\n label: target,\n options: [{\n label: _('Count'),\n value: 'count'\n }, {\n label: _('Sum'),\n value: 'sum'\n }, {\n label: _('Average'),\n value: 'avg'\n }, {\n label: _('Median'),\n value: 'median'\n }, {\n label: _('Mode'),\n value: 'mode'\n }, {\n label: _('RMS'),\n value: 'rms'\n }, {\n label: _('Standard Deviation'),\n value: 'stddev'\n }, {\n label: _('Min'),\n value: 'min'\n }, {\n label: _('Max'),\n value: 'max'\n }, {\n label: _('First'),\n value: 'first'\n }, {\n label: _('Last'),\n value: 'last'\n }, {\n label: _('Change'),\n value: 'change'\n }, {\n label: _('Range'),\n value: 'range'\n }],\n clearable: false\n }));\n }));\n }\n }]);\n\n return Aggregations;\n}(_react.Component);\n\nexports.Aggregations = Aggregations;\nAggregations.plotly_editor_traits = {\n no_visibility_forcing: true\n};\nAggregations.contextTypes = {\n fullContainer: _propTypes.default.object,\n localize: _propTypes.default.func\n};\n\nvar GraphTransformsPanel = function GraphTransformsPanel(props, _ref2) {\n var _ = _ref2.localize;\n return /*#__PURE__*/_react.default.createElement(_components.TraceAccordion, {\n traceFilterCondition: function traceFilterCondition(t) {\n return _constants.TRANSFORMABLE_TRACES.includes(t.type);\n }\n }, /*#__PURE__*/_react.default.createElement(_components.TransformAccordion, null, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"enabled\",\n options: [{\n label: _('Enabled'),\n value: true\n }, {\n label: _('Disabled'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('By'),\n attr: \"groups\"\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Target'),\n attr: \"target\"\n }), /*#__PURE__*/_react.default.createElement(_components.FilterOperation, {\n label: _('Operator'),\n attr: \"operation\"\n }), /*#__PURE__*/_react.default.createElement(_components.FilterValue, {\n label: _('Value'),\n attr: \"value\"\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"order\",\n options: [{\n label: _('Ascending'),\n value: 'ascending'\n }, {\n label: _('Descending'),\n value: 'descending'\n }]\n }), /*#__PURE__*/_react.default.createElement(Aggregations, null)));\n};\n\nGraphTransformsPanel.contextTypes = {\n localize: _propTypes.default.func\n};\nvar _default = GraphTransformsPanel;\nexports.default = _default;\n//# sourceMappingURL=GraphTransformsPanel.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/default_panels/GraphTransformsPanel.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/default_panels/StyleAxesPanel.js": /*!******************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/default_panels/StyleAxesPanel.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _components = __webpack_require__(/*! ../components */ \"./node_modules/react-chart-editor/lib/components/index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar StyleAxesPanel = /*#__PURE__*/function (_Component) {\n _inherits(StyleAxesPanel, _Component);\n\n var _super = _createSuper(StyleAxesPanel);\n\n function StyleAxesPanel() {\n _classCallCheck(this, StyleAxesPanel);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(StyleAxesPanel, [{\n key: \"render\",\n value: function render() {\n var _ = this.context.localize;\n return /*#__PURE__*/_react.default.createElement(_components.LayoutPanel, null, /*#__PURE__*/_react.default.createElement(_components.AxesFold, {\n name: _('Titles'),\n axisFilter: function axisFilter(axis) {\n return !(axis._name.includes('angular') || axis._subplot.includes('geo'));\n }\n }, /*#__PURE__*/_react.default.createElement(_components.TextEditor, {\n attr: \"title.text\"\n }), /*#__PURE__*/_react.default.createElement(_components.FontSelector, {\n label: _('Typeface'),\n attr: \"title.font.family\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Font Size'),\n attr: \"title.font.size\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Font Color'),\n attr: \"title.font.color\"\n })), /*#__PURE__*/_react.default.createElement(_components.AxesFold, {\n name: _('Range')\n }, /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Range'),\n attr: \"autorange\"\n }, /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n attr: \"type\",\n label: _('Type'),\n clearable: false,\n options: [{\n label: _('Linear'),\n value: 'linear'\n }, {\n label: _('Log'),\n value: 'log'\n }, {\n label: _('Date'),\n value: 'date'\n }, {\n label: _('Categorical'),\n value: 'category'\n }, {\n label: _('Multicategorical'),\n value: 'multicategory'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"autorange\",\n label: _('Range'),\n options: [{\n label: _('Auto'),\n value: true\n }, {\n label: _('Custom'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.AxesRange, {\n label: _('Min'),\n attr: \"range[0]\"\n }), /*#__PURE__*/_react.default.createElement(_components.AxesRange, {\n label: _('Max'),\n attr: \"range[1]\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Min'),\n attr: \"min\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Zoom Interactivity'),\n attr: \"fixedrange\"\n }, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"fixedrange\",\n options: [{\n label: _('Enable'),\n value: false\n }, {\n label: _('Disable'),\n value: true\n }]\n })), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Direction'),\n attr: \"direction\",\n options: [{\n label: _('Clockwise'),\n value: 'clockwise'\n }, {\n label: _('Counter Clockwise'),\n value: 'counterclockwise'\n }],\n clearable: false\n })), /*#__PURE__*/_react.default.createElement(_components.AxesFold, {\n name: _('Lines')\n }, /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Axis Line'),\n attr: \"showline\"\n }, /*#__PURE__*/_react.default.createElement(_components.VisibilitySelect, {\n attr: \"showline\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }],\n showOn: true,\n defaultOpt: true\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Thickness'),\n attr: \"linewidth\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Color'),\n attr: \"linecolor\"\n }), /*#__PURE__*/_react.default.createElement(_components.AxisSide, {\n label: _('Position'),\n attr: \"side\"\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Mirror Axis'),\n attr: \"mirror\",\n options: [{\n label: _('On'),\n value: 'ticks'\n }, {\n label: _('Off'),\n value: false\n }]\n }))), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Grid Lines'),\n attr: \"showgrid\"\n }, /*#__PURE__*/_react.default.createElement(_components.VisibilitySelect, {\n attr: \"showgrid\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }],\n showOn: true,\n defaultOpt: true\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Thickness'),\n attr: \"gridwidth\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Color'),\n attr: \"gridcolor\"\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Position On'),\n attr: \"tickson\",\n options: [{\n label: _('Labels'),\n value: 'labels'\n }, {\n label: _('Boundaries'),\n value: 'boundaries'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Grid Spacing'),\n attr: \"tickmode\",\n options: [{\n label: _('Auto'),\n value: 'auto'\n }, {\n label: _('Custom'),\n value: 'linear'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.DTicks, {\n label: _('Step Offset'),\n attr: \"tick0\"\n }), /*#__PURE__*/_react.default.createElement(_components.DTicksInterval, {\n label: _('Step Size'),\n attr: \"dtick\"\n }), /*#__PURE__*/_react.default.createElement(_components.NTicks, {\n label: _('Max Number of Lines'),\n attr: \"nticks\"\n }))), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Zero Line'),\n attr: \"zeroline\"\n }, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"zeroline\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Thickness'),\n attr: \"zerolinewidth\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Color'),\n attr: \"zerolinecolor\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Axis Background'),\n attr: \"showbackground\"\n }, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"showbackground\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Color'),\n attr: \"backgroundcolor\"\n }))), /*#__PURE__*/_react.default.createElement(_components.AxesFold, {\n name: _('Tick Labels'),\n axisFilter: function axisFilter(axis) {\n return !axis._subplot.includes('geo');\n }\n }, /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Tick Labels'),\n attr: \"showticklabels\"\n }, /*#__PURE__*/_react.default.createElement(_components.VisibilitySelect, {\n attr: \"showticklabels\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }],\n showOn: true,\n defaultOpt: true\n }, /*#__PURE__*/_react.default.createElement(_components.AxisSide, {\n label: _('Position'),\n attr: \"side\"\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Auto margins'),\n attr: \"automargin\",\n options: [{\n label: _('True'),\n value: true\n }, {\n label: _('False'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Position on'),\n attr: \"tickson\",\n options: [{\n label: _('Labels'),\n value: 'labels'\n }, {\n label: _('Boundaries'),\n value: 'boundaries'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.FontSelector, {\n label: _('Typeface'),\n attr: \"tickfont.family\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Font Size'),\n attr: \"tickfont.size\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Font Color'),\n attr: \"tickfont.color\"\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Angle'),\n attr: \"tickangle\",\n clearable: false,\n options: [{\n label: _('Auto'),\n value: 'auto'\n }, {\n label: _('45'),\n value: 45\n }, {\n label: _('90'),\n value: 90\n }, {\n label: _('135'),\n value: 135\n }, {\n label: _('180'),\n value: 180\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.TickFormat, {\n label: _('Label Format'),\n attr: \"tickformat\",\n dafaultOpt: \"\",\n clearable: false\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Separate Thousands'),\n attr: \"separatethousands\",\n options: [{\n label: _('True'),\n value: true\n }, {\n label: _('False'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Exponents'),\n attr: \"exponentformat\",\n clearable: false,\n options: [{\n label: _('None'),\n value: 'none'\n }, {\n label: _('e+6'),\n value: 'e'\n }, {\n label: _('E+6'),\n value: 'E'\n }, {\n label: _('x10^6'),\n value: 'power'\n }, {\n label: _('k/M/G'),\n value: 'SI'\n }, {\n label: _('k/M/B'),\n value: 'B'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Show Exponents'),\n attr: \"showexponent\",\n clearable: false,\n options: [{\n label: _('All'),\n value: 'all'\n }, {\n label: _('First'),\n value: 'first'\n }, {\n label: _('Last'),\n value: 'last'\n }, {\n label: _('None'),\n value: 'none'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.DropdownCustom, {\n label: _('Prefix'),\n attr: \"tickprefix\",\n options: [{\n label: _('None'),\n value: ''\n }, {\n label: _('x'),\n value: 'x'\n }, {\n label: _('$'),\n value: '$'\n }, {\n label: _('#'),\n value: '#'\n }, {\n label: _('@'),\n value: '@'\n }, {\n label: _('Custom'),\n value: 'custom'\n }],\n customOpt: \"custom\",\n dafaultOpt: \"\",\n clearable: false\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Show Prefix'),\n attr: \"showtickprefix\",\n options: [{\n label: _('Every label'),\n value: 'all'\n }, {\n label: _('First label'),\n value: 'first'\n }, {\n label: _('Last label'),\n value: 'last'\n }, {\n label: _('None'),\n value: 'none'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.DropdownCustom, {\n label: _('Suffix'),\n attr: \"ticksuffix\",\n options: [{\n label: _('None'),\n value: ''\n }, {\n label: _('C'),\n value: 'C'\n }, {\n label: _('%'),\n value: '%'\n }, {\n label: _('^'),\n value: '^'\n }, {\n label: _('Custom'),\n value: 'custom'\n }],\n customOpt: \"custom\",\n dafaultOpt: \"\",\n clearable: false\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Show Suffix'),\n attr: \"showticksuffix\",\n options: [{\n label: _('Every label'),\n value: 'all'\n }, {\n label: _('First label'),\n value: 'first'\n }, {\n label: _('Last label'),\n value: 'last'\n }, {\n label: _('None'),\n value: 'none'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Tick Spacing'),\n attr: \"tickmode\",\n options: [{\n label: _('Auto'),\n value: 'auto'\n }, {\n label: _('Custom'),\n value: 'linear'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.DTicks, {\n label: _('Step Offset'),\n attr: \"tick0\"\n }), /*#__PURE__*/_react.default.createElement(_components.DTicksInterval, {\n label: _('Step Size'),\n attr: \"dtick\"\n }), /*#__PURE__*/_react.default.createElement(_components.NTicks, {\n label: _('Max Number of Labels'),\n attr: \"nticks\"\n })))), /*#__PURE__*/_react.default.createElement(_components.AxesFold, {\n name: _('Tick Markers'),\n axisFilter: function axisFilter(axis) {\n return !axis._subplot.includes('geo');\n }\n }, /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Tick Markers'),\n attr: \"ticks\"\n }, /*#__PURE__*/_react.default.createElement(_components.VisibilitySelect, {\n attr: \"ticks\",\n options: [{\n label: _('Inside'),\n value: 'inside'\n }, {\n label: _('Outside'),\n value: 'outside'\n }, {\n label: _('Hide'),\n value: ''\n }],\n showOn: ['inside', 'outside'],\n defaultOpt: 'Outside'\n }, /*#__PURE__*/_react.default.createElement(_components.AxisSide, {\n label: _('Position'),\n attr: \"side\"\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Position on'),\n attr: \"tickson\",\n options: [{\n label: _('Labels'),\n value: 'labels'\n }, {\n label: _('Boundaries'),\n value: 'boundaries'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Length'),\n attr: \"ticklen\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Width'),\n attr: \"tickwidth\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Color'),\n attr: \"tickcolor\"\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Tick Spacing'),\n attr: \"tickmode\",\n options: [{\n label: _('Auto'),\n value: 'auto'\n }, {\n label: _('Custom'),\n value: 'linear'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.DTicks, {\n label: _('Step Offset'),\n attr: \"tick0\"\n }), /*#__PURE__*/_react.default.createElement(_components.DTicksInterval, {\n label: _('Step Size'),\n attr: \"dtick\"\n }), /*#__PURE__*/_react.default.createElement(_components.NTicks, {\n label: _('Max Number of Markers'),\n attr: \"nticks\"\n }))), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Multicategory Dividers'),\n attr: \"showdividers\"\n }, /*#__PURE__*/_react.default.createElement(_components.VisibilitySelect, {\n attr: \"showdividers\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }],\n showOn: true\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Width'),\n attr: \"dividerwidth\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Color'),\n attr: \"dividercolor\"\n })))), /*#__PURE__*/_react.default.createElement(_components.AxesFold, {\n name: _('Range Slider'),\n axisFilter: function axisFilter(axis) {\n return axis._subplot.includes('xaxis');\n }\n }, /*#__PURE__*/_react.default.createElement(_components.RangesliderVisible, {\n attr: \"rangeslider.visible\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.NumericFraction, {\n label: _('Height'),\n attr: \"rangeslider.thickness\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Background Color'),\n attr: \"rangeslider.bgcolor\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Border Width'),\n attr: \"rangeslider.borderwidth\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Border Color'),\n attr: \"rangeslider.bordercolor\"\n })), /*#__PURE__*/_react.default.createElement(_components.AxesFold, {\n name: _('Timescale Buttons'),\n axisFilter: function axisFilter(axis) {\n return axis._subplot.includes('xaxis') && axis.type === 'date';\n }\n }, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"rangeselector.visible\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.RangeSelectorAccordion, null, /*#__PURE__*/_react.default.createElement(_components.TextEditor, {\n attr: \"label\",\n label: _('Label'),\n show: true\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Count'),\n attr: \"count\"\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Step'),\n attr: \"step\",\n clearable: false,\n options: [{\n label: _('Year'),\n value: 'year'\n }, {\n label: _('Month'),\n value: 'month'\n }, {\n label: _('Day'),\n value: 'day'\n }, {\n label: _('Hour'),\n value: 'hour'\n }, {\n label: _('Minute'),\n value: 'minute'\n }, {\n label: _('Second'),\n value: 'second'\n }, {\n label: _('All'),\n value: 'all'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Stepmode'),\n attr: \"stepmode\",\n clearable: false,\n options: [{\n label: _('To Date'),\n value: 'todate'\n }, {\n label: _('Backward'),\n value: 'backward'\n }]\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Text')\n }, /*#__PURE__*/_react.default.createElement(_components.FontSelector, {\n label: _('Typeface'),\n attr: \"rangeselector.font.family\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Font Size'),\n attr: \"rangeselector.font.size\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Font Color'),\n attr: \"rangeselector.font.color\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Style')\n }, /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Background Color'),\n attr: \"rangeselector.bgcolor\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Active Color'),\n attr: \"rangeselector.activecolor\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Border Width'),\n attr: \"rangeselector.borderwidth\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Border Color'),\n attr: \"rangeselector.bordercolor\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Horizontal Positioning')\n }, /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Anchor Point'),\n clearable: false,\n attr: \"rangeselector.xanchor\",\n options: [{\n label: _('Auto'),\n value: 'auto'\n }, {\n label: _('Left'),\n value: 'left'\n }, {\n label: _('Center'),\n value: 'center'\n }, {\n label: _('Right'),\n value: 'right'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Position'),\n step: 0.02,\n attr: \"rangeselector.x\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Vertical Positioning')\n }, /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Anchor Point'),\n clearable: false,\n attr: \"rangeselector.yanchor\",\n options: [{\n label: _('Auto'),\n value: 'auto'\n }, {\n label: _('Top'),\n value: 'top'\n }, {\n label: _('Middle'),\n value: 'middle'\n }, {\n label: _('Bottom'),\n value: 'bottom'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Position'),\n step: 0.02,\n attr: \"rangeselector.y\"\n }))), /*#__PURE__*/_react.default.createElement(_components.AxesFold, {\n name: _('Spike Lines'),\n axisFilter: function axisFilter(axis) {\n return !(axis._subplot.includes('ternary') || axis._subplot.includes('polar') || axis._subplot.includes('geo'));\n }\n }, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"showspikes\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"spikesides\",\n label: _('Show Sides'),\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Thickness'),\n attr: \"spikethickness\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Color'),\n attr: \"spikecolor\"\n })));\n }\n }]);\n\n return StyleAxesPanel;\n}(_react.Component);\n\nStyleAxesPanel.contextTypes = {\n fullLayout: _propTypes.default.object,\n localize: _propTypes.default.func\n};\nvar _default = StyleAxesPanel;\nexports.default = _default;\n//# sourceMappingURL=StyleAxesPanel.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/default_panels/StyleAxesPanel.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/default_panels/StyleColorbarsPanel.js": /*!***********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/default_panels/StyleColorbarsPanel.js ***! \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.traceHasColorbar = void 0;\n\nvar _react = _interopRequireDefault(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _components = __webpack_require__(/*! ../components */ \"./node_modules/react-chart-editor/lib/components/index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar traceHasColorbar = function traceHasColorbar(trace, fullTrace) {\n return fullTrace.marker && fullTrace.marker.showscale !== undefined || // eslint-disable-line no-undefined\n fullTrace.showscale !== undefined;\n}; // eslint-disable-line no-undefined\n\n\nexports.traceHasColorbar = traceHasColorbar;\n\nvar StyleColorBarsPanel = function StyleColorBarsPanel(props, _ref) {\n var _ = _ref.localize;\n return /*#__PURE__*/_react.default.createElement(_components.TraceAccordion, {\n traceFilterCondition: traceHasColorbar\n }, ['', 'marker.'].map(function (prefix) {\n return /*#__PURE__*/_react.default.createElement(_components.VisibilitySelect, {\n attr: prefix + 'showscale',\n key: 'x' + prefix,\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }],\n showOn: true\n }, /*#__PURE__*/_react.default.createElement(_components.PlotlyPanel, {\n key: prefix + ' panel'\n }, /*#__PURE__*/_react.default.createElement(_components.PlotlyFold, {\n name: _('Title')\n }, /*#__PURE__*/_react.default.createElement(_components.TextEditor, {\n attr: prefix + 'colorbar.title.text'\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Location'),\n attr: prefix + 'colorbar.title.side',\n options: [{\n label: _('Top'),\n value: 'top'\n }, {\n label: _('Right'),\n value: 'right'\n }, {\n label: _('Bottom'),\n value: 'bottom'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.FontSelector, {\n label: _('Typeface'),\n attr: prefix + 'colorbar.title.font.family'\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Font Size'),\n attr: prefix + 'colorbar.title.font.size',\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Font Color'),\n attr: prefix + 'colorbar.title.font.color'\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlyFold, {\n name: _('Size and Positioning')\n }, /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Size'),\n attr: prefix + 'colorbar.len'\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Height'),\n attr: prefix + 'colorbar.len'\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: prefix + 'colorbar.lenmode',\n options: [{\n label: _('Fraction of Plot'),\n value: 'fraction'\n }, {\n label: _('Pixels'),\n value: 'pixels'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Width'),\n attr: prefix + 'colorbar.thickness'\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: prefix + 'colorbar.thicknessmode',\n options: [{\n label: _('Fraction of Plot'),\n value: 'fraction'\n }, {\n label: _('Pixels'),\n value: 'pixels'\n }]\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Horizontal Positioning'),\n attr: prefix + 'colorbar.x'\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Position'),\n attr: prefix + 'colorbar.x',\n showSlider: true,\n step: 0.02\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Anchor'),\n attr: prefix + 'colorbar.xanchor',\n options: [{\n label: _('Left'),\n value: 'left'\n }, {\n label: _('Center'),\n value: 'center'\n }, {\n label: _('Right'),\n value: 'right'\n }]\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Vertical Positioning'),\n attr: prefix + 'colorbar.y'\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Position'),\n attr: prefix + 'colorbar.y',\n showSlider: true,\n step: 0.02\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Anchor'),\n attr: prefix + 'colorbar.yanchor',\n options: [{\n label: _('Top'),\n value: 'top'\n }, {\n label: _('Middle'),\n value: 'middle'\n }, {\n label: _('Bottom'),\n value: 'bottom'\n }]\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Padding'),\n attr: prefix + 'colorbar.xpad'\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Vertical'),\n attr: prefix + 'colorbar.ypad',\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Horizontal'),\n attr: prefix + 'colorbar.xpad',\n units: \"px\"\n }))), /*#__PURE__*/_react.default.createElement(_components.PlotlyFold, {\n name: _('Labels')\n }, /*#__PURE__*/_react.default.createElement(_components.VisibilitySelect, {\n attr: prefix + 'colorbar.showticklabels',\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }],\n showOn: true,\n defaultOpt: true\n }, /*#__PURE__*/_react.default.createElement(_components.FontSelector, {\n label: _('Typeface'),\n attr: prefix + 'colorbar.tickfont.family'\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Font Size'),\n attr: prefix + 'colorbar.tickfont.size',\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Font Color'),\n attr: prefix + 'colorbar.tickfont.color'\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Angle'),\n attr: prefix + 'colorbar.tickangle',\n clearable: false,\n options: [{\n label: _('Auto'),\n value: 'auto'\n }, {\n label: _('45'),\n value: 45\n }, {\n label: _('90'),\n value: 90\n }, {\n label: _('135'),\n value: 135\n }, {\n label: _('180'),\n value: 180\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Exponents'),\n attr: prefix + 'colorbar.exponentformat',\n clearable: false,\n options: [{\n label: _('None'),\n value: '000'\n }, {\n label: _('e+6'),\n value: 'e'\n }, {\n label: _('E+6'),\n value: 'E'\n }, {\n label: _('x10^6'),\n value: 'power'\n }, {\n label: _('k/M/G'),\n value: 'SI'\n }, {\n label: _('k/M/B'),\n value: 'B'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.DropdownCustom, {\n label: _('Label Prefix'),\n attr: prefix + 'colorbar.tickprefix',\n options: [{\n label: _('None'),\n value: ''\n }, {\n label: _('x'),\n value: 'x'\n }, {\n label: _('$'),\n value: '$'\n }, {\n label: _('#'),\n value: '#'\n }, {\n label: _('@'),\n value: '@'\n }, {\n label: _('Custom'),\n value: 'custom'\n }],\n customOpt: \"custom\",\n dafaultOpt: \"\",\n clearable: false\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Show Prefix'),\n attr: prefix + 'colorbar.showtickprefix',\n options: [{\n label: _('Every label'),\n value: 'all'\n }, {\n label: _('First label'),\n value: 'first'\n }, {\n label: _('Last label'),\n value: 'last'\n }, {\n label: _('None label'),\n value: 'none'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.DropdownCustom, {\n label: _('Label Suffix'),\n attr: prefix + 'colorbar.ticksuffix',\n options: [{\n label: _('None'),\n value: ''\n }, {\n label: _('C'),\n value: 'C'\n }, {\n label: _('%'),\n value: '%'\n }, {\n label: _('^'),\n value: '^'\n }, {\n label: _('Custom'),\n value: 'custom'\n }],\n customOpt: \"custom\",\n dafaultOpt: \"\",\n clearable: false\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Show Suffix'),\n attr: prefix + 'colorbar.showticksuffix',\n options: [{\n label: _('Every label'),\n value: 'all'\n }, {\n label: _('First label'),\n value: 'first'\n }, {\n label: _('Last label'),\n value: 'last'\n }, {\n label: _('None label'),\n value: 'none'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: prefix + 'colorbar.tickmode',\n options: [{\n label: _('Auto'),\n value: 'auto'\n }, {\n label: _('Custom'),\n value: 'linear'\n }],\n label: _('Tick spacing')\n }), /*#__PURE__*/_react.default.createElement(_components.NumericOrDate, {\n label: _('Step Offset'),\n attr: prefix + 'colorbar.tick0'\n }), /*#__PURE__*/_react.default.createElement(_components.AxisInterval, {\n label: _('Step Size'),\n attr: prefix + 'colorbar.dtick'\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Max Number of Labels'),\n attr: prefix + 'colorbar.nticks'\n }))), /*#__PURE__*/_react.default.createElement(_components.PlotlyFold, {\n name: _('Ticks')\n }, /*#__PURE__*/_react.default.createElement(_components.VisibilitySelect, {\n attr: prefix + 'colorbar.ticks',\n options: [{\n label: _('Inside'),\n value: 'inside'\n }, {\n label: _('Outside'),\n value: 'outside'\n }, {\n label: _('Hide'),\n value: ''\n }],\n showOn: ['inside', 'outside'],\n defaultOpt: ''\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Length'),\n attr: prefix + 'colorbar.ticklen',\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Width'),\n attr: prefix + 'colorbar.tickwidth',\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Color'),\n attr: prefix + 'colorbar.tickcolor'\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: prefix + 'colorbar.tickmode',\n options: [{\n label: _('Auto'),\n value: 'auto'\n }, {\n label: _('Custom'),\n value: 'linear'\n }],\n label: _('Tick spacing')\n }), /*#__PURE__*/_react.default.createElement(_components.NumericOrDate, {\n label: _('Step Offset'),\n attr: prefix + 'colorbar.tick0'\n }), /*#__PURE__*/_react.default.createElement(_components.AxisInterval, {\n label: _('Step Size'),\n attr: prefix + 'colorbar.dtick'\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Max Number of Labels'),\n attr: prefix + 'colorbar.nticks'\n }))), /*#__PURE__*/_react.default.createElement(_components.PlotlyFold, {\n name: _('Borders and Background')\n }, /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Color Bar'),\n attr: prefix + 'colorbar.outlinewidth'\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Border Width'),\n attr: prefix + 'colorbar.outlinewidth'\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Border Color'),\n attr: prefix + 'colorbar.outlinecolor'\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Color Bar Container'),\n attr: prefix + 'colorbar.bgcolor'\n }, /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Background Color'),\n attr: prefix + 'colorbar.bgcolor'\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Border Width'),\n attr: prefix + 'colorbar.borderwidth'\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Border Color'),\n attr: prefix + 'colorbar.bordercolor'\n })))));\n }));\n};\n\nStyleColorBarsPanel.contextTypes = {\n localize: _propTypes.default.func\n};\nvar _default = StyleColorBarsPanel;\nexports.default = _default;\n//# sourceMappingURL=StyleColorbarsPanel.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/default_panels/StyleColorbarsPanel.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/default_panels/StyleImagesPanel.js": /*!********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/default_panels/StyleImagesPanel.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _components = __webpack_require__(/*! ../components */ \"./node_modules/react-chart-editor/lib/components/index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar StyleImagesPanel = function StyleImagesPanel(props, _ref) {\n var _ = _ref.localize;\n return /*#__PURE__*/_react.default.createElement(_components.ImageAccordion, {\n canAdd: true,\n canReorder: true\n }, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"visible\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Dropzone, {\n attr: \"source\",\n fileType: \"image\",\n show: true\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Aspect Ratio'),\n attr: \"sizing\",\n options: [{\n label: _('Contain'),\n value: 'contain'\n }, {\n label: _('Fill'),\n value: 'fill'\n }, {\n label: _('Stretch'),\n value: 'stretch'\n }],\n clearable: false\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Relative to Grid'),\n attr: \"layer\",\n options: [{\n label: _('Below'),\n value: 'below'\n }, {\n label: _('Above'),\n value: 'above'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.PositioningNumeric, {\n attr: \"sizex\",\n label: _('Width')\n }), /*#__PURE__*/_react.default.createElement(_components.PositioningNumeric, {\n attr: \"sizey\",\n label: _('Height')\n }), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Horizontal Positioning')\n }, /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Anchor Point'),\n clearable: false,\n attr: \"xanchor\",\n options: [{\n label: _('Left'),\n value: 'left'\n }, {\n label: _('Center'),\n value: 'center'\n }, {\n label: _('Right'),\n value: 'right'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.PositioningNumeric, {\n label: _('Position'),\n attr: \"x\"\n }), /*#__PURE__*/_react.default.createElement(_components.PositioningRef, {\n label: _('Relative To'),\n attr: \"xref\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Vertical Positioning')\n }, /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Anchor Point'),\n clearable: false,\n attr: \"yanchor\",\n options: [{\n label: _('Top'),\n value: 'top'\n }, {\n label: _('Middle'),\n value: 'middle'\n }, {\n label: _('Bottom'),\n value: 'bottom'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.PositioningNumeric, {\n label: _('Position'),\n attr: \"y\"\n }), /*#__PURE__*/_react.default.createElement(_components.PositioningRef, {\n label: _('Relative To'),\n attr: \"yref\"\n })));\n};\n\nStyleImagesPanel.contextTypes = {\n localize: _propTypes.default.func\n};\nvar _default = StyleImagesPanel;\nexports.default = _default;\n//# sourceMappingURL=StyleImagesPanel.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/default_panels/StyleImagesPanel.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/default_panels/StyleLayoutPanel.js": /*!********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/default_panels/StyleLayoutPanel.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _components = __webpack_require__(/*! ../components */ \"./node_modules/react-chart-editor/lib/components/index.js\");\n\nvar _derived = __webpack_require__(/*! ../components/fields/derived */ \"./node_modules/react-chart-editor/lib/components/fields/derived.js\");\n\nvar _DataSelector = _interopRequireDefault(__webpack_require__(/*! ../components/fields/DataSelector */ \"./node_modules/react-chart-editor/lib/components/fields/DataSelector.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar StyleLayoutPanel = function StyleLayoutPanel(props, _ref) {\n var _ = _ref.localize;\n return /*#__PURE__*/_react.default.createElement(_components.LayoutPanel, null, /*#__PURE__*/_react.default.createElement(_components.PlotlyFold, {\n name: _('Defaults')\n }, /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Plot Background'),\n attr: \"plot_bgcolor\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Margin Color'),\n attr: \"paper_bgcolor\"\n }), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Colorscales'),\n attr: \"colorway\"\n }, /*#__PURE__*/_react.default.createElement(_components.ColorwayPicker, {\n label: _('Categorical'),\n attr: \"colorway\",\n disableCategorySwitch: true,\n labelWidth: 80\n }), /*#__PURE__*/_react.default.createElement(_components.ColorscalePicker, {\n label: _('Sequential'),\n attr: \"colorscale.sequential\",\n disableCategorySwitch: true,\n labelWidth: 80\n }), /*#__PURE__*/_react.default.createElement(_components.ColorscalePicker, {\n label: _('Diverging'),\n attr: \"colorscale.diverging\",\n initialCategory: \"divergent\",\n disableCategorySwitch: true,\n labelWidth: 80\n }), /*#__PURE__*/_react.default.createElement(_components.ColorscalePicker, {\n label: _('Negative Sequential'),\n attr: \"colorscale.sequentialminus\",\n disableCategorySwitch: true,\n labelWidth: 80\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Text'),\n attr: \"font.family\"\n }, /*#__PURE__*/_react.default.createElement(_components.FontSelector, {\n label: _('Typeface'),\n attr: \"font.family\",\n clearable: false\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Base Font Size'),\n attr: \"font.size\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Font Color'),\n attr: \"font.color\"\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Number format'),\n attr: \"separators\",\n options: [{\n label: _('1,234.56'),\n value: '.,'\n }, {\n label: _('1 234.56'),\n value: ', '\n }, {\n label: _('1 234,56'),\n value: ', '\n }, {\n label: _('1.234,56'),\n value: ',.'\n }],\n clearable: false\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Uniform Text Mode'),\n attr: \"uniformtext.mode\",\n options: [{\n label: _('Off'),\n value: false\n }, {\n label: _('Show'),\n value: 'show'\n }, {\n label: _('Hide'),\n value: 'hide'\n }],\n clearable: false\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Uniform Text Size Minimum'),\n attr: \"uniformtext.minsize\",\n units: \"px\"\n }))), /*#__PURE__*/_react.default.createElement(_components.PlotlyFold, {\n name: _('Title')\n }, /*#__PURE__*/_react.default.createElement(_components.TextEditor, {\n attr: \"title.text\"\n }), /*#__PURE__*/_react.default.createElement(_components.FontSelector, {\n label: _('Typeface'),\n attr: \"title.font.family\",\n clearable: false\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Font Size'),\n attr: \"title.font.size\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Font Color'),\n attr: \"title.font.color\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Horizontal Position'),\n showSlider: true,\n step: 0.02,\n attr: \"title.x\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlyFold, {\n name: _('Modebar')\n }, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Orientation'),\n attr: \"modebar.orientation\",\n options: [{\n label: _('Horizontal'),\n value: 'h'\n }, {\n label: _('Vertical'),\n value: 'v'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Icon Color'),\n attr: \"modebar.color\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Active Icon Color'),\n attr: \"modebar.activecolor\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Background Color'),\n attr: \"modebar.bgcolor\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlyFold, {\n name: _('Size and Margins')\n }, /*#__PURE__*/_react.default.createElement(_components.VisibilitySelect, {\n attr: \"autosize\",\n label: _('Size'),\n options: [{\n label: _('Auto'),\n value: true\n }, {\n label: _('Custom'),\n value: false\n }],\n showOn: false,\n defaultOpt: true\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Fixed Width'),\n attr: \"width\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Fixed height'),\n attr: \"height\",\n units: \"px\"\n })), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Top'),\n attr: \"margin.t\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Bottom'),\n attr: \"margin.b\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Left'),\n attr: \"margin.l\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Right'),\n attr: \"margin.r\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Padding'),\n attr: \"margin.pad\",\n units: \"px\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlyFold, {\n name: _('Interactions')\n }, /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Drag'),\n attr: \"dragmode\"\n }, /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Mode'),\n attr: \"dragmode\",\n options: [{\n label: _('Zoom'),\n value: 'zoom'\n }, {\n label: _('Select'),\n value: 'select'\n }, {\n label: _('Pan'),\n value: 'pan'\n }, {\n label: _('Lasso'),\n value: 'lasso'\n }, {\n label: _('Orbit'),\n value: 'orbit'\n }, {\n label: _('Turntable'),\n value: 'turntable'\n }],\n clearable: false\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Select Direction'),\n attr: \"selectdirection\",\n options: [{\n label: _('Any'),\n value: 'any'\n }, {\n label: _('Horizontal'),\n value: 'h'\n }, {\n label: _('Vertical'),\n value: 'v'\n }, {\n label: _('Diagonal'),\n value: 'd'\n }],\n clearable: false\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Click'),\n attr: \"clickmode\"\n }, /*#__PURE__*/_react.default.createElement(_components.Flaglist, {\n label: _('Mode'),\n attr: \"clickmode\",\n options: [{\n label: _('Click Event'),\n value: 'event'\n }, {\n label: _('Select Data Point'),\n value: 'select'\n }]\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Hover')\n }, /*#__PURE__*/_react.default.createElement(_components.HovermodeDropdown, {\n label: _('Mode'),\n attr: \"hovermode\"\n }, /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Text Alignment'),\n attr: \"hoverlabel.align\",\n options: [{\n label: _('Auto'),\n value: 'auto'\n }, {\n label: _('Left'),\n value: 'left'\n }, {\n label: _('Right'),\n value: 'right'\n }],\n clearable: false\n }), /*#__PURE__*/_react.default.createElement(_derived.HoverColor, {\n label: _('Background Color'),\n attr: \"hoverlabel.bgcolor\",\n defaultColor: \"#FFF\",\n handleEmpty: true\n }), /*#__PURE__*/_react.default.createElement(_derived.HoverColor, {\n label: _('Border Color'),\n attr: \"hoverlabel.bordercolor\",\n defaultColor: \"#000\",\n handleEmpty: true\n }), /*#__PURE__*/_react.default.createElement(_components.FontSelector, {\n label: _('Typeface'),\n attr: \"hoverlabel.font.family\",\n clearable: true\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Font Size'),\n attr: \"hoverlabel.font.size\"\n }), /*#__PURE__*/_react.default.createElement(_derived.HoverColor, {\n label: _('Font Color'),\n attr: \"hoverlabel.font.color\",\n defaultColor: \"#000\",\n handleEmpty: true\n })))), /*#__PURE__*/_react.default.createElement(_components.PlotlyFold, {\n name: _('Meta Text')\n }, /*#__PURE__*/_react.default.createElement(_DataSelector.default, {\n label: _('Custom Data'),\n attr: \"meta\"\n }), /*#__PURE__*/_react.default.createElement(_components.Info, null, /*#__PURE__*/_react.default.createElement(\"p\", null, _('You can refer to the items in this column in any text fields of the editor like so: ')), /*#__PURE__*/_react.default.createElement(\"p\", null, _('Ex: '), /*#__PURE__*/_react.default.createElement(\"span\", {\n style: {\n letterSpacing: '1px',\n fontStyle: 'italic',\n userSelect: 'text'\n }\n }, _('My custom title %{meta[1]}'))))));\n};\n\nStyleLayoutPanel.contextTypes = {\n localize: _propTypes.default.func\n};\nvar _default = StyleLayoutPanel;\nexports.default = _default;\n//# sourceMappingURL=StyleLayoutPanel.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/default_panels/StyleLayoutPanel.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/default_panels/StyleLegendPanel.js": /*!********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/default_panels/StyleLegendPanel.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _components = __webpack_require__(/*! ../components */ \"./node_modules/react-chart-editor/lib/components/index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar StyleLegendPanel = function StyleLegendPanel(props, _ref) {\n var _ = _ref.localize;\n return /*#__PURE__*/_react.default.createElement(_components.TraceRequiredPanel, null, /*#__PURE__*/_react.default.createElement(_components.PlotlyFold, {\n name: _('Legend')\n }, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"showlegend\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Legend Title')\n }, /*#__PURE__*/_react.default.createElement(_components.TextEditor, {\n label: _('Text'),\n attr: \"legend.title.text\",\n richTextOnly: true\n }), /*#__PURE__*/_react.default.createElement(_components.FontSelector, {\n label: _('Typeface'),\n attr: \"legend.title.font.family\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Size'),\n attr: \"legend.title.font.size\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Color'),\n attr: \"legend.title.font.color\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Text')\n }, /*#__PURE__*/_react.default.createElement(_components.FontSelector, {\n label: _('Typeface'),\n attr: \"legend.font.family\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Size'),\n attr: \"legend.font.size\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Color'),\n attr: \"legend.font.color\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Legend Box')\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Border Width'),\n attr: \"legend.borderwidth\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Border Color'),\n attr: \"legend.bordercolor\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Background Color'),\n attr: \"legend.bgcolor\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Horizontal Positioning')\n }, /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Anchor Point'),\n clearable: false,\n attr: \"legend.xanchor\",\n options: [{\n label: _('Auto'),\n value: 'auto'\n }, {\n label: _('Left'),\n value: 'left'\n }, {\n label: _('Center'),\n value: 'center'\n }, {\n label: _('Right'),\n value: 'right'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Position'),\n showSlider: true,\n step: 0.02,\n attr: \"legend.x\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Vertical Positioning')\n }, /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Anchor Point'),\n clearable: false,\n attr: \"legend.yanchor\",\n options: [{\n label: _('Auto'),\n value: 'auto'\n }, {\n label: _('Top'),\n value: 'top'\n }, {\n label: _('Middle'),\n value: 'middle'\n }, {\n label: _('Bottom'),\n value: 'bottom'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Position'),\n showSlider: true,\n step: 0.02,\n attr: \"legend.y\"\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Text Alignment'),\n clearable: false,\n attr: \"legend.valign\",\n options: [{\n label: _('Top'),\n value: 'top'\n }, {\n label: _('Middle'),\n value: 'middle'\n }, {\n label: _('Bottom'),\n value: 'bottom'\n }]\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Orientation')\n }, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"legend.orientation\",\n options: [{\n label: _('Vertical'),\n value: 'v'\n }, {\n label: _('Horizontal'),\n value: 'h'\n }]\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Traces')\n }, /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Trace Order'),\n attr: \"legend.traceorder\",\n options: [{\n label: _('Normal'),\n value: 'normal'\n }, {\n label: _('Reversed'),\n value: 'reversed'\n }, {\n label: _('Grouped'),\n value: 'grouped'\n }, {\n label: _('Reversed and Grouped'),\n value: 'reversed+grouped'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Item Sizing'),\n attr: \"legend.itemsizing\",\n options: [{\n label: _('Trace'),\n value: 'trace'\n }, {\n label: _('Constant'),\n value: 'constant'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Gap Between Groups'),\n attr: \"legend.tracegroupgap\",\n units: \"px\"\n }))));\n};\n\nStyleLegendPanel.contextTypes = {\n localize: _propTypes.default.func\n};\nvar _default = StyleLegendPanel;\nexports.default = _default;\n//# sourceMappingURL=StyleLegendPanel.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/default_panels/StyleLegendPanel.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/default_panels/StyleMapsPanel.js": /*!******************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/default_panels/StyleMapsPanel.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _components = __webpack_require__(/*! ../components */ \"./node_modules/react-chart-editor/lib/components/index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar StyleMapsPanel = function StyleMapsPanel(props, _ref) {\n var _ = _ref.localize;\n return /*#__PURE__*/_react.default.createElement(_components.SubplotAccordion, null, /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Base Map'),\n attr: \"style\"\n }, /*#__PURE__*/_react.default.createElement(_components.MapboxStyleDropdown, {\n label: _('Tile Source'),\n attr: \"style\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Layers'),\n attr: \"style\"\n }, /*#__PURE__*/_react.default.createElement(_components.MapboxLayersAccordion, null, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"below\",\n options: [{\n label: _('Below Data'),\n value: 'traces'\n }, {\n label: _('Above Data'),\n value: ''\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.MapboxSourceArray, {\n label: _('Tile Source URL'),\n attr: \"source\",\n show: true\n }))), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Map Positioning')\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Center Latitude'),\n attr: \"center.lat\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Center Longitude'),\n attr: \"center.lon\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Zoom Level'),\n attr: \"zoom\",\n min: 0\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Bearing'),\n attr: \"bearing\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Pitch'),\n attr: \"pitch\",\n min: 0\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Bounds Fitting'),\n attr: \"fitbounds\",\n options: [{\n label: _('Off'),\n value: false\n }, {\n label: _('Locations'),\n value: 'locations'\n }, {\n label: _('GeoJSON'),\n value: 'geojson'\n }],\n clearable: false\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Map Projection')\n }, /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Region'),\n attr: \"scope\",\n options: [{\n label: _('World'),\n value: 'world'\n }, {\n label: _('USA'),\n value: 'usa'\n }, {\n label: _('Europe'),\n value: 'europe'\n }, {\n label: _('Asia'),\n value: 'asia'\n }, {\n label: _('Africa'),\n value: 'africa'\n }, {\n label: _('North America'),\n value: 'north america'\n }, {\n label: _('South America'),\n value: 'south america'\n }],\n clearable: false\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Projection'),\n attr: \"projection.type\",\n clearable: false,\n options: [{\n label: _('Equirectangular'),\n value: 'equirectangular'\n }, {\n label: _('Mercator'),\n value: 'mercator'\n }, {\n label: _('Orthographic'),\n value: 'orthographic'\n }, {\n label: _('Natural Earth'),\n value: 'natural earth'\n }, {\n label: _('Albers USA'),\n value: 'albers usa'\n }, {\n label: _('Winkel Tripel'),\n value: 'winkel tripel'\n }, {\n label: _('Robinson'),\n value: 'robinson'\n }, {\n label: _('Miller'),\n value: 'miller'\n }, {\n label: _('Kavrayskiy 7'),\n value: 'kavrayskiy7'\n }, {\n label: _('Eckert 4'),\n value: 'eckert4'\n }, {\n label: _('Azimuthal Equal Area'),\n value: 'azimuthal equal area'\n }, {\n label: _('Azimuthal Equidistant'),\n value: 'azimuthal equidistant'\n }, {\n label: _('Conic Equal Area'),\n value: 'conic equal area'\n }, {\n label: _('Conic Conformal'),\n value: 'conic conformal'\n }, {\n label: _('Conic Equidistant'),\n value: 'conic equidistant'\n }, {\n label: _('Gnomonic'),\n value: 'gnomonic'\n }, {\n label: _('Stereographic'),\n value: 'stereographic'\n }, {\n label: _('Mollweide'),\n value: 'mollweide'\n }, {\n label: _('Hammer'),\n value: 'hammer'\n }, {\n label: _('Transverse Mercator'),\n value: 'transverse mercator'\n }, {\n label: _('Aitoff'),\n value: 'aitoff'\n }, {\n label: _('Sinusoidal'),\n value: 'sinusoidal'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Scale'),\n attr: \"projection.scale\",\n min: 0\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Center Latitude'),\n attr: \"projection.rotation.lon\",\n min: 0\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Center Longitude'),\n attr: \"projection.rotation.lat\",\n min: 0\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Roll'),\n attr: \"projection.rotation.roll\",\n min: 0\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Base Map'),\n attr: \"visible\"\n }, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"visible\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Resolution'),\n attr: \"resolution\",\n options: [{\n label: _('1:110,000,000'),\n value: 110\n }, {\n label: _('1:50,000,000'),\n value: 50\n }]\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Country Borders'),\n attr: \"showcountries\"\n }, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"showcountries\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Border Width'),\n attr: \"countrywidth\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Border Color'),\n attr: \"countrycolor\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Sub-Country Unit Borders'),\n attr: \"showsubunits\"\n }, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"showsubunits\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Border Width'),\n attr: \"subunitwidth\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Border Color'),\n attr: \"subunitcolor\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Coastlines'),\n attr: \"showcoastlines\"\n }, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"showcoastlines\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Width'),\n attr: \"coastlinewidth\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Color'),\n attr: \"coastlinecolor\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Oceans'),\n attr: \"showocean\"\n }, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"showocean\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Color'),\n attr: \"oceancolor\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Land'),\n attr: \"showland\"\n }, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"showland\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Color'),\n attr: \"landcolor\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Lakes'),\n attr: \"showlakes\"\n }, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"showlakes\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Color'),\n attr: \"lakecolor\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Rivers'),\n attr: \"showrivers\"\n }, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"showrivers\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Width'),\n attr: \"riverwidth\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Color'),\n attr: \"rivercolor\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Map Frame'),\n attr: \"showframe\"\n }, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"showframe\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Width'),\n attr: \"framewidth\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Color'),\n attr: \"framecolor\"\n })));\n};\n\nStyleMapsPanel.contextTypes = {\n localize: _propTypes.default.func\n};\nvar _default = StyleMapsPanel;\nexports.default = _default;\n//# sourceMappingURL=StyleMapsPanel.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/default_panels/StyleMapsPanel.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/default_panels/StyleNotesPanel.js": /*!*******************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/default_panels/StyleNotesPanel.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _components = __webpack_require__(/*! ../components */ \"./node_modules/react-chart-editor/lib/components/index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar StyleNotesPanel = function StyleNotesPanel(props, _ref) {\n var _ = _ref.localize;\n return /*#__PURE__*/_react.default.createElement(_components.AnnotationAccordion, {\n canAdd: true,\n canReorder: true\n }, /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Note Text'),\n attr: \"text\"\n }, /*#__PURE__*/_react.default.createElement(_components.TextEditor, {\n attr: \"text\"\n }), /*#__PURE__*/_react.default.createElement(_components.FontSelector, {\n label: _('Typeface'),\n attr: \"font.family\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Font Size'),\n attr: \"font.size\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Font Color'),\n attr: \"font.color\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Angle'),\n attr: \"textangle\",\n units: \"\\xB0\"\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Horizontal Alignment'),\n clearable: false,\n attr: \"align\",\n options: [{\n label: _('Left'),\n value: 'left'\n }, {\n label: _('Center'),\n value: 'center'\n }, {\n label: _('Right'),\n value: 'right'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Vertical Alignment'),\n clearable: false,\n attr: \"valign\",\n options: [{\n label: _('Left'),\n value: 'left'\n }, {\n label: _('Center'),\n value: 'center'\n }, {\n label: _('Right'),\n value: 'right'\n }]\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Arrow')\n }, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"showarrow\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Line Width'),\n attr: \"arrowwidth\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Color'),\n attr: \"arrowcolor\"\n }), /*#__PURE__*/_react.default.createElement(_components.ArrowSelector, {\n label: _('Arrowhead'),\n attr: \"arrowhead\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Scale'),\n step: 0.1,\n attr: \"arrowsize\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.AnnotationArrowRef, {\n label: _('X Offset'),\n attr: \"axref\"\n }), /*#__PURE__*/_react.default.createElement(_components.AnnotationArrowRef, {\n label: _('Y Offset'),\n attr: \"ayref\"\n }), /*#__PURE__*/_react.default.createElement(_components.NumericOrDate, {\n label: _('X Vector'),\n attr: \"ax\"\n }), /*#__PURE__*/_react.default.createElement(_components.NumericOrDate, {\n label: _('Y Vector'),\n attr: \"ay\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Horizontal Positioning')\n }, /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Anchor Point'),\n clearable: false,\n attr: \"xanchor\",\n options: [{\n label: _('Auto'),\n value: 'auto'\n }, {\n label: _('Left'),\n value: 'left'\n }, {\n label: _('Center'),\n value: 'center'\n }, {\n label: _('Right'),\n value: 'right'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.PositioningNumeric, {\n label: _('Position'),\n attr: \"x\"\n }), /*#__PURE__*/_react.default.createElement(_components.AnnotationRef, {\n label: _('Relative To'),\n attr: \"xref\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Vertical Positioning')\n }, /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Anchor Point'),\n clearable: false,\n attr: \"yanchor\",\n options: [{\n label: _('Auto'),\n value: 'auto'\n }, {\n label: _('Top'),\n value: 'top'\n }, {\n label: _('Middle'),\n value: 'middle'\n }, {\n label: _('Bottom'),\n value: 'bottom'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.PositioningNumeric, {\n label: _('Position'),\n attr: \"y\"\n }), /*#__PURE__*/_react.default.createElement(_components.AnnotationRef, {\n label: _('Relative To'),\n attr: \"yref\"\n })));\n};\n\nStyleNotesPanel.contextTypes = {\n localize: _propTypes.default.func\n};\nvar _default = StyleNotesPanel;\nexports.default = _default;\n//# sourceMappingURL=StyleNotesPanel.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/default_panels/StyleNotesPanel.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/default_panels/StyleShapesPanel.js": /*!********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/default_panels/StyleShapesPanel.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _components = __webpack_require__(/*! ../components */ \"./node_modules/react-chart-editor/lib/components/index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar StyleShapesPanel = function StyleShapesPanel(props, _ref) {\n var _ = _ref.localize;\n return /*#__PURE__*/_react.default.createElement(_components.ShapeAccordion, {\n canAdd: true,\n canReorder: true\n }, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"visible\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"type\",\n options: [{\n label: _('Line'),\n value: 'line'\n }, {\n label: _('Rectangle'),\n value: 'rect'\n }, {\n label: _('Ellipse'),\n value: 'circle'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Horizontal Boundaries')\n }, /*#__PURE__*/_react.default.createElement(_components.PositioningRef, {\n label: _('Relative to'),\n attr: \"xref\"\n }), /*#__PURE__*/_react.default.createElement(_components.PositioningNumeric, {\n label: _('Start Point'),\n attr: \"x0\"\n }), /*#__PURE__*/_react.default.createElement(_components.PositioningNumeric, {\n label: _('End Point'),\n attr: \"x1\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Vertical Boundaries')\n }, /*#__PURE__*/_react.default.createElement(_components.PositioningRef, {\n label: _('Relative to'),\n attr: \"yref\"\n }), /*#__PURE__*/_react.default.createElement(_components.PositioningNumeric, {\n label: _('Start Point'),\n attr: \"y0\"\n }), /*#__PURE__*/_react.default.createElement(_components.PositioningNumeric, {\n label: _('End Point'),\n attr: \"y1\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Lines')\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Width'),\n attr: \"line.width\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Color'),\n attr: \"line.color\"\n }), /*#__PURE__*/_react.default.createElement(_components.LineDashSelector, {\n label: _('Type'),\n attr: \"line.dash\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Fill')\n }, /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Color'),\n attr: \"fillcolor\"\n }), /*#__PURE__*/_react.default.createElement(_components.NumericFraction, {\n label: _('Opacity'),\n attr: \"opacity\"\n })));\n};\n\nStyleShapesPanel.contextTypes = {\n localize: _propTypes.default.func\n};\nvar _default = StyleShapesPanel;\nexports.default = _default;\n//# sourceMappingURL=StyleShapesPanel.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/default_panels/StyleShapesPanel.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/default_panels/StyleSlidersPanel.js": /*!*********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/default_panels/StyleSlidersPanel.js ***! \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _components = __webpack_require__(/*! ../components */ \"./node_modules/react-chart-editor/lib/components/index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar StyleSlidersPanel = function StyleSlidersPanel(props, _ref) {\n var _ = _ref.localize;\n return /*#__PURE__*/_react.default.createElement(_components.SliderAccordion, null, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"visible\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Background')\n }, /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Color'),\n attr: \"bgcolor\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Active Color'),\n attr: \"activebgcolor\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Border')\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Width'),\n attr: \"borderwidth\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Color'),\n attr: \"bordercolor\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Font')\n }, /*#__PURE__*/_react.default.createElement(_components.FontSelector, {\n label: _('Typeface'),\n attr: \"font.family\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Size'),\n attr: \"font.size\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Color'),\n attr: \"font.color\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Length'),\n attr: 'len'\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Length'),\n attr: 'len',\n step: 0.02\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Length Mode'),\n attr: 'lenmode',\n options: [{\n label: _('Fraction of canvas'),\n value: 'fraction'\n }, {\n label: _('Pixels'),\n value: 'pixels'\n }]\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Horizontal Positioning'),\n attr: 'x'\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Position'),\n attr: 'x',\n showSlider: true,\n step: 0.02\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Anchor'),\n attr: 'xanchor',\n options: [{\n label: _('Left'),\n value: 'left'\n }, {\n label: _('Center'),\n value: 'center'\n }, {\n label: _('Right'),\n value: 'right'\n }]\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Vertical Positioning'),\n attr: 'y'\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Position'),\n attr: 'y',\n showSlider: true,\n step: 0.02\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Anchor'),\n attr: 'yanchor',\n options: [{\n label: _('Top'),\n value: 'top'\n }, {\n label: _('Middle'),\n value: 'middle'\n }, {\n label: _('Bottom'),\n value: 'bottom'\n }]\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Padding')\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Top'),\n attr: \"pad.t\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Bottom'),\n attr: \"pad.b\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Left'),\n attr: \"pad.l\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Right'),\n attr: \"pad.r\",\n units: \"px\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Ticks')\n }, /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Color'),\n attr: \"tickcolor\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Length'),\n attr: \"ticklen\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Width'),\n attr: \"tickwidth\"\n })));\n};\n\nStyleSlidersPanel.contextTypes = {\n localize: _propTypes.default.func\n};\nvar _default = StyleSlidersPanel;\nexports.default = _default;\n//# sourceMappingURL=StyleSlidersPanel.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/default_panels/StyleSlidersPanel.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/default_panels/StyleTracesPanel.js": /*!********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/default_panels/StyleTracesPanel.js ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _components = __webpack_require__(/*! ../components */ \"./node_modules/react-chart-editor/lib/components/index.js\");\n\nvar _derived = __webpack_require__(/*! ../components/fields/derived */ \"./node_modules/react-chart-editor/lib/components/fields/derived.js\");\n\nvar _traceTypes = __webpack_require__(/*! ../lib/traceTypes */ \"./node_modules/react-chart-editor/lib/lib/traceTypes.js\");\n\nvar _localize = _interopRequireDefault(__webpack_require__(/*! ../lib/localize */ \"./node_modules/react-chart-editor/lib/lib/localize.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar allTraceTypes = (0, _traceTypes.traceTypes)(_localize.default).map(function (_ref) {\n var value = _ref.value;\n return value;\n});\n\nvar StyleTracesPanel = function StyleTracesPanel(props, _ref2) {\n var _ = _ref2.localize;\n return /*#__PURE__*/_react.default.createElement(_components.TraceAccordion, {\n canGroup: true\n }, /*#__PURE__*/_react.default.createElement(_components.TextEditor, {\n label: _('Name'),\n attr: \"name\",\n richTextOnly: true\n }), /*#__PURE__*/_react.default.createElement(_components.NumericFraction, {\n label: _('Trace Opacity'),\n attr: \"opacity\"\n }), /*#__PURE__*/_react.default.createElement(_components.TraceTypeSection, {\n name: _('Leaves'),\n traceTypes: ['sunburst', 'treemap'],\n mode: \"trace\"\n }, /*#__PURE__*/_react.default.createElement(_derived.LevelRendered, {\n label: _('Start at Level'),\n attr: \"level\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Max Depth'),\n attr: \"maxdepth\",\n min: -1,\n step: 1\n }), /*#__PURE__*/_react.default.createElement(_components.NumericFraction, {\n label: _('Opacity'),\n attr: \"leaf.opacity\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Legend')\n }, /*#__PURE__*/_react.default.createElement(_derived.ShowInLegend, {\n label: _('Show in Legend'),\n attr: \"showlegend\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }],\n showOn: true\n }, /*#__PURE__*/_react.default.createElement(_components.GroupCreator, {\n label: _('Legend Group'),\n prefix: _('Group'),\n attr: \"legendgroup\"\n }))), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Cones & Streamtubes')\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Size'),\n attr: \"sizeref\",\n stepmode: \"relative\"\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Size Mode'),\n options: [{\n label: _('scaled'),\n value: 'scaled'\n }, {\n label: _('absolute'),\n value: 'absolute'\n }],\n attr: \"sizemode\"\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Cone Anchor'),\n options: [{\n label: _('Tip'),\n value: 'tip'\n }, {\n label: _('Tail'),\n value: 'tail'\n }, {\n label: _('Center'),\n value: 'center'\n }, {\n label: _('Center of Mass'),\n value: 'cm'\n }],\n attr: \"anchor\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Max Tube segments'),\n attr: \"maxdisplayed\"\n })), /*#__PURE__*/_react.default.createElement(_components.MultiColorPicker, {\n label: _('Color'),\n attr: \"color\"\n }), /*#__PURE__*/_react.default.createElement(_components.TraceTypeSection, {\n name: _('Segment Colors'),\n traceTypes: ['pie', 'sunburst', 'treemap', 'funnelarea'],\n mode: \"trace\"\n }, /*#__PURE__*/_react.default.createElement(_components.LayoutSection, {\n attr: \"name\"\n }, /*#__PURE__*/_react.default.createElement(_components.ColorwayPicker, {\n label: _('Colors'),\n attr: \"piecolorway\"\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Extended Colors'),\n attr: \"extendpiecolors\",\n options: [{\n label: _('On'),\n value: true\n }, {\n label: _('Off'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.ColorwayPicker, {\n label: _('Colors'),\n attr: \"sunburstcolorway\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorwayPicker, {\n label: _('Colors'),\n attr: \"treemapcolorway\"\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Extended Colors'),\n attr: \"extendsunburstcolors\",\n options: [{\n label: _('On'),\n value: true\n }, {\n label: _('Off'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Extended Colors'),\n attr: \"extendtreemapcolors\",\n options: [{\n label: _('On'),\n value: true\n }, {\n label: _('Off'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.ColorwayPicker, {\n label: _('Colors'),\n attr: \"funnelareacolorway\"\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Extended Colors'),\n attr: \"extendfunnelareacolors\",\n options: [{\n label: _('On'),\n value: true\n }, {\n label: _('Off'),\n value: false\n }]\n }))), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Funnel Dimensions'),\n traceTypes: ['funnelarea'],\n attr: \"aspectratio\"\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Aspect Ratio'),\n attr: \"aspectratio\",\n step: 0.01,\n min: 0,\n max: 2,\n showSlider: true\n }), /*#__PURE__*/_react.default.createElement(_components.NumericFraction, {\n label: _('Base Ratio'),\n attr: \"baseratio\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Subplot Title'),\n attr: \"title.text\"\n }, /*#__PURE__*/_react.default.createElement(_components.TextEditor, {\n label: _('Name'),\n attr: \"title.text\"\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: 'Title Position',\n attr: \"titleposition\",\n options: [{\n label: _('Top Left'),\n value: 'top left'\n }, {\n label: _('Top Center'),\n value: 'top center'\n }, {\n label: _('Top Right'),\n value: 'top right'\n }, {\n label: _('Middle Center'),\n value: 'middle center'\n }, {\n label: _('Bottom Left'),\n value: 'bottom left'\n }, {\n label: _('Bottom Center'),\n value: 'bottom center'\n }, {\n label: _('Bottom Right'),\n value: 'bottom right'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.FontSelector, {\n label: _('Typeface'),\n attr: \"title.font.family\",\n clearable: false\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Font Size'),\n attr: \"title.font.size\",\n units: \"px\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Values')\n }, /*#__PURE__*/_react.default.createElement(_derived.BinningDropdown, {\n label: _('Histogram Function'),\n attr: \"histfunc\"\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Histogram Normalization'),\n options: [{\n label: _('Number of Occurences'),\n value: ''\n }, {\n label: _('Percent'),\n value: 'percent'\n }, {\n label: _('Probability'),\n value: 'probability'\n }, {\n label: _('Density'),\n value: 'density'\n }, {\n label: _('Probability Density'),\n value: 'probability density'\n }],\n attr: \"histnorm\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Cumulative')\n }, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Cumulative'),\n attr: \"cumulative.enabled\",\n options: [{\n label: _('Enabled'),\n value: true\n }, {\n label: _('Disabled'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Direction'),\n attr: \"cumulative.direction\",\n options: [{\n label: _('Increasing'),\n value: 'increasing'\n }, {\n label: _('Decreasing'),\n value: 'decreasing'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Current Bin'),\n attr: \"cumulative.currentbin\",\n options: [{\n label: _('Include'),\n value: 'include'\n }, {\n label: _('Exclude'),\n value: 'exclude'\n }, {\n label: _('Half'),\n value: 'half'\n }]\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Header')\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Height'),\n attr: \"header.height\"\n }), /*#__PURE__*/_react.default.createElement(_components.MultiColorPicker, {\n label: _('Fill Color'),\n attr: \"header.fill.color\"\n }), /*#__PURE__*/_react.default.createElement(_components.FontSelector, {\n label: _('Typeface'),\n attr: \"header.font.family\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Font Size'),\n attr: \"header.font.size\"\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Text Alignment'),\n options: [{\n label: _('Left'),\n value: 'left'\n }, {\n label: _('Center'),\n value: 'center'\n }, {\n label: _('Right'),\n value: 'right'\n }],\n attr: \"header.align\"\n }), /*#__PURE__*/_react.default.createElement(_components.MultiColorPicker, {\n label: _('Font Color'),\n attr: \"header.font.color\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Border Width'),\n attr: \"header.line.width\"\n }), /*#__PURE__*/_react.default.createElement(_components.MultiColorPicker, {\n label: _('Border Color'),\n attr: \"header.line.color\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Cells')\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Height'),\n attr: \"cells.height\"\n }), /*#__PURE__*/_react.default.createElement(_components.MultiColorPicker, {\n label: _('Fill Color'),\n attr: \"cells.fill.color\"\n }), /*#__PURE__*/_react.default.createElement(_components.FontSelector, {\n label: _('Typeface'),\n attr: \"cells.font.family\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Font Size'),\n attr: \"cells.font.size\"\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Text Alignment'),\n options: [{\n label: _('Left'),\n value: 'left'\n }, {\n label: _('Center'),\n value: 'center'\n }, {\n label: _('Right'),\n value: 'right'\n }],\n attr: \"cells.align\"\n }), /*#__PURE__*/_react.default.createElement(_components.MultiColorPicker, {\n label: _('Font Color'),\n attr: \"cells.font.color\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Border Width'),\n attr: \"cells.line.width\"\n }), /*#__PURE__*/_react.default.createElement(_components.MultiColorPicker, {\n label: _('Border Color'),\n attr: \"cells.line.color\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Display')\n }, /*#__PURE__*/_react.default.createElement(_components.Flaglist, {\n attr: \"mode\",\n options: [{\n label: _('Points'),\n value: 'markers'\n }, {\n label: _('Lines'),\n value: 'lines'\n }, {\n label: _('Text'),\n value: 'text'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"flatshading\",\n label: _('Flatshading'),\n options: [{\n label: _('Enable'),\n value: true\n }, {\n label: _('Disable'),\n value: false\n }]\n })), /*#__PURE__*/_react.default.createElement(_components.TraceTypeSection, {\n name: _('Bar Grouping, Sizing and Spacing'),\n traceTypes: ['bar', 'histogram', 'funnel', 'waterfall'],\n mode: \"trace\"\n }, /*#__PURE__*/_react.default.createElement(_components.LayoutSection, {\n attr: \"name\"\n }, /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Bar Mode'),\n attr: \"barmode\",\n options: [{\n label: _('Grouped'),\n value: 'group'\n }, {\n label: _('Positive/Negative Stacked'),\n value: 'relative'\n }, {\n label: _('Strict Sum Stacked'),\n value: 'stack'\n }, {\n label: _('Overlaid'),\n value: 'overlay'\n }],\n clearable: false\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Normalization'),\n attr: \"barnorm\",\n options: [{\n label: _('None'),\n value: ''\n }, {\n label: _('Fraction'),\n value: 'fraction'\n }, {\n label: _('Percent'),\n value: 'percent'\n }],\n clearable: false\n }), /*#__PURE__*/_react.default.createElement(_components.NumericFractionInverse, {\n label: _('Bar Width'),\n attr: \"bargap\"\n }), /*#__PURE__*/_react.default.createElement(_components.NumericFraction, {\n label: _('Bar Padding'),\n attr: \"bargroupgap\"\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Bar Mode'),\n attr: \"funnelmode\",\n options: [{\n label: _('Grouped'),\n value: 'group'\n }, {\n label: _('Stacked'),\n value: 'stack'\n }, {\n label: _('Overlaid'),\n value: 'overlay'\n }],\n clearable: false\n }), /*#__PURE__*/_react.default.createElement(_components.NumericFractionInverse, {\n label: _('Bar Width'),\n attr: \"funnelgap\"\n }), /*#__PURE__*/_react.default.createElement(_components.NumericFraction, {\n label: _('Bar Padding'),\n attr: \"funnelgroupgap\"\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Bar Mode'),\n attr: \"waterfallmode\",\n options: [{\n label: _('Grouped'),\n value: 'group'\n }, {\n label: _('Stacked'),\n value: 'stack'\n }, {\n label: _('Overlaid'),\n value: 'overlay'\n }],\n clearable: false\n }), /*#__PURE__*/_react.default.createElement(_components.NumericFractionInverse, {\n label: _('Bar Width'),\n attr: \"waterfallgap\"\n }), /*#__PURE__*/_react.default.createElement(_components.NumericFraction, {\n label: _('Bar Padding'),\n attr: \"waterfallgroupgap\"\n }))), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Binning')\n }, /*#__PURE__*/_react.default.createElement(_components.NumericOrDate, {\n label: _('X Bin Start'),\n attr: \"xbins.start\",\n axis: \"x\"\n }), /*#__PURE__*/_react.default.createElement(_components.NumericOrDate, {\n label: _('X Bin End'),\n attr: \"xbins.end\",\n axis: \"x\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Max X Bins'),\n attr: \"nbinsx\"\n }), /*#__PURE__*/_react.default.createElement(_components.AxisInterval, {\n label: _('X Bin Size'),\n attr: \"xbins.size\",\n axis: \"x\"\n }), /*#__PURE__*/_react.default.createElement(_components.NumericOrDate, {\n label: _('Y Bin Start'),\n attr: \"ybins.start\",\n axis: \"y\"\n }), /*#__PURE__*/_react.default.createElement(_components.NumericOrDate, {\n label: _('Y Bin End'),\n attr: \"ybins.end\",\n axis: \"y\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Max Y Bins'),\n attr: \"nbinsy\"\n }), /*#__PURE__*/_react.default.createElement(_components.AxisInterval, {\n label: _('Y Bin Size'),\n attr: \"ybins.size\",\n axis: \"y\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n label: _('Bar Position')\n }, /*#__PURE__*/_react.default.createElement(_components.NumericOrDate, {\n label: _('Base'),\n attr: \"base\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Offset'),\n attr: \"offset\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Width'),\n attr: \"width\"\n })), /*#__PURE__*/_react.default.createElement(_components.TraceTypeSection, {\n name: _('Box Size and Spacing'),\n traceTypes: ['box'],\n mode: \"trace\"\n }, /*#__PURE__*/_react.default.createElement(_components.LayoutSection, {\n attr: \"name\"\n }, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Box Mode'),\n attr: \"boxmode\",\n options: [{\n label: _('Overlay'),\n value: 'overlay'\n }, {\n label: _('Group'),\n value: 'group'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.NumericFractionInverse, {\n label: _('Box Width'),\n attr: \"boxgap\"\n }), /*#__PURE__*/_react.default.createElement(_components.NumericFraction, {\n label: _('Box Padding'),\n attr: \"boxgroupgap\"\n }))), /*#__PURE__*/_react.default.createElement(_components.TraceTypeSection, {\n name: _('Violin Size and Spacing'),\n traceTypes: ['violin'],\n mode: \"trace\"\n }, /*#__PURE__*/_react.default.createElement(_components.LayoutSection, {\n attr: \"name\"\n }, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Violin Mode'),\n attr: \"violinmode\",\n options: [{\n label: _('Overlay'),\n value: 'overlay'\n }, {\n label: _('Group'),\n value: 'group'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.NumericFractionInverse, {\n label: _('Violin Width'),\n attr: \"violingap\"\n }), /*#__PURE__*/_react.default.createElement(_components.NumericFraction, {\n label: _('Violin Padding'),\n attr: \"violingroupgap\"\n }))), /*#__PURE__*/_react.default.createElement(_components.NumericFraction, {\n label: _('Whisker Width'),\n attr: \"whiskerwidth\"\n }), /*#__PURE__*/_react.default.createElement(_components.TraceMarkerSection, null, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Order'),\n attr: \"sort\",\n options: [{\n label: _('Sorted'),\n value: true\n }, {\n label: _('Unsorted'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Direction'),\n attr: \"direction\",\n options: [{\n label: _('Clockwise'),\n value: 'clockwise'\n }, {\n label: _('Counterclockwise'),\n value: 'counterclockwise'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Rotation'),\n attr: \"rotation\"\n }), /*#__PURE__*/_react.default.createElement(_components.NumericFraction, {\n label: _('Hole Size'),\n attr: \"hole\"\n }), /*#__PURE__*/_react.default.createElement(_components.NumericFraction, {\n label: _('Pull'),\n attr: \"pull\"\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n options: [{\n label: _('Show All'),\n value: 'all'\n }, {\n label: _('Outliers'),\n value: 'outliers'\n }, {\n label: _('Suspected Outliers'),\n value: 'suspectedoutliers'\n }, {\n label: _('Hide'),\n value: false\n }],\n attr: \"boxpoints\",\n clearable: false\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n options: [{\n label: _('Show All'),\n value: 'all'\n }, {\n label: _('Outliers'),\n value: 'outliers'\n }, {\n label: _('Suspected Outliers'),\n value: 'suspectedoutliers'\n }, {\n label: _('Hide'),\n value: false\n }],\n attr: \"points\",\n clearable: false\n }), /*#__PURE__*/_react.default.createElement(_components.NumericFraction, {\n label: _('Jitter'),\n attr: \"jitter\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Position'),\n attr: \"pointpos\",\n step: 0.1,\n showSlider: true\n }), /*#__PURE__*/_react.default.createElement(_components.MarkerColor, {\n suppressMultiValuedMessage: true,\n label: _('Color'),\n attr: \"marker.color\",\n labelWidth: 80\n }), /*#__PURE__*/_react.default.createElement(_components.NumericFraction, {\n label: _('Point Opacity'),\n attr: \"marker.opacity\"\n }), /*#__PURE__*/_react.default.createElement(_components.MarkerSize, {\n label: _('Size'),\n attr: \"marker.size\"\n }), /*#__PURE__*/_react.default.createElement(_derived.NumericReciprocal, {\n label: _('Size Scale'),\n attr: \"marker.sizeref\",\n step: 0.2,\n stepmode: \"relative\"\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Size Mode'),\n attr: \"marker.sizemode\",\n options: [{\n label: _('Area'),\n value: 'area'\n }, {\n label: _('Diameter'),\n value: 'diameter'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Minimum Size'),\n attr: \"marker.sizemin\"\n }), /*#__PURE__*/_react.default.createElement(_components.SymbolSelector, {\n label: _('Symbol'),\n attr: \"marker.symbol\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Border Width'),\n attr: \"marker.line.width\"\n }), /*#__PURE__*/_react.default.createElement(_components.MultiColorPicker, {\n label: _('Border Color'),\n attr: \"marker.line.color\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Max Number of Points'),\n attr: \"marker.maxdisplayed\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Connector Styles')\n }, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"connector.visible\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.MultiColorPicker, {\n label: _('Fill Color'),\n attr: \"connector.fillcolor\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Line Width'),\n attr: \"connector.line.width\"\n }), /*#__PURE__*/_react.default.createElement(_components.MultiColorPicker, {\n label: _('Line Color'),\n attr: \"connector.line.color\"\n }), /*#__PURE__*/_react.default.createElement(_components.LineDashSelector, {\n label: _('Line Type'),\n attr: \"connector.line.dash\"\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Line Shape'),\n options: [{\n label: _('Spanning'),\n value: 'spanning'\n }, {\n label: _('Between'),\n value: 'between'\n }],\n attr: \"connector.mode\",\n clearable: false\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Increasing Marker Styles')\n }, /*#__PURE__*/_react.default.createElement(_components.TextEditor, {\n label: _('Name'),\n attr: \"increasing.name\",\n richTextOnly: true\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Width'),\n attr: \"increasing.line.width\"\n }), /*#__PURE__*/_react.default.createElement(_components.MultiColorPicker, {\n label: _('Line Color'),\n attr: \"increasing.line.color\"\n }), /*#__PURE__*/_react.default.createElement(_components.MultiColorPicker, {\n label: _('Marker Color'),\n attr: \"increasing.marker.color\"\n }), /*#__PURE__*/_react.default.createElement(_components.MultiColorPicker, {\n label: _('Line Color'),\n attr: \"increasing.marker.line.color\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Line Width'),\n attr: \"increasing.marker.line.width\"\n }), /*#__PURE__*/_react.default.createElement(_components.MultiColorPicker, {\n label: _('Fill Color'),\n attr: \"increasing.fillcolor\"\n }), /*#__PURE__*/_react.default.createElement(_components.LineDashSelector, {\n label: _('Type'),\n attr: \"increasing.line.dash\"\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Show in Legend'),\n attr: \"increasing.showlegend\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }]\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Decreasing Marker Styles')\n }, /*#__PURE__*/_react.default.createElement(_components.TextEditor, {\n label: _('Name'),\n attr: \"decreasing.name\",\n richTextOnly: true\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Width'),\n attr: \"decreasing.line.width\"\n }), /*#__PURE__*/_react.default.createElement(_components.MultiColorPicker, {\n label: _('Line Color'),\n attr: \"decreasing.line.color\"\n }), /*#__PURE__*/_react.default.createElement(_components.MultiColorPicker, {\n label: _('Marker Color'),\n attr: \"decreasing.marker.color\"\n }), /*#__PURE__*/_react.default.createElement(_components.MultiColorPicker, {\n label: _('Line Color'),\n attr: \"decreasing.marker.line.color\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Line Width'),\n attr: \"decreasing.marker.line.width\"\n }), /*#__PURE__*/_react.default.createElement(_components.MultiColorPicker, {\n label: _('Fill Color'),\n attr: \"decreasing.fillcolor\"\n }), /*#__PURE__*/_react.default.createElement(_components.LineDashSelector, {\n label: _('Type'),\n attr: \"decreasing.line.dash\"\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Show in Legend'),\n attr: \"decreasing.showlegend\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }]\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Total Marker Styles')\n }, /*#__PURE__*/_react.default.createElement(_components.MultiColorPicker, {\n label: _('Marker Color'),\n attr: \"totals.marker.color\"\n }), /*#__PURE__*/_react.default.createElement(_components.MultiColorPicker, {\n label: _('Line Color'),\n attr: \"totals.marker.line.color\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Line Width'),\n attr: \"totals.marker.line.width\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Ticks')\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Width'),\n attr: \"tickwidth\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Contours')\n }, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Type'),\n attr: \"contours.type\",\n options: [{\n label: _('Levels'),\n value: 'levels'\n }, {\n label: _('Constraint'),\n value: 'constraint'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Coloring'),\n attr: \"contours.coloring\",\n options: [{\n label: _('Fill'),\n value: 'fill'\n }, {\n label: _('Heatmap'),\n value: 'heatmap'\n }, {\n label: _('Lines'),\n value: 'lines'\n }, {\n label: _('None'),\n value: 'none'\n }],\n clearable: false\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Contour Lines'),\n attr: \"contours.showlines\",\n options: [{\n label: _('On'),\n value: true\n }, {\n label: _('Off'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Contour Labels'),\n attr: \"contours.showlabels\",\n options: [{\n label: _('On'),\n value: true\n }, {\n label: _('Off'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Number of Contours'),\n attr: \"autocontour\",\n options: [{\n label: _('Auto'),\n value: true\n }, {\n label: _('Custom'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Max Contours'),\n attr: \"ncontours\"\n }), /*#__PURE__*/_react.default.createElement(_components.ContourNumeric, {\n label: _('Step Size'),\n attr: \"contours.size\"\n }), /*#__PURE__*/_react.default.createElement(_components.ContourNumeric, {\n label: _('Min Contour'),\n attr: \"contours.start\"\n }), /*#__PURE__*/_react.default.createElement(_components.ContourNumeric, {\n label: _('Max Contour'),\n attr: \"contours.end\"\n })), /*#__PURE__*/_react.default.createElement(_components.TraceTypeSection, {\n name: _('Stacking'),\n traceTypes: ['scatter'],\n mode: \"trace\"\n }, /*#__PURE__*/_react.default.createElement(_components.GroupCreator, {\n label: _('Group'),\n prefix: _('Stack'),\n attr: \"stackgroup\"\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Gaps'),\n attr: \"stackgaps\",\n options: [{\n label: _('Infer Zero'),\n value: 'infer zero'\n }, {\n label: _('Interpolate'),\n value: 'interpolate'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Orientation'),\n attr: \"orientation\",\n options: [{\n label: _('Horizontal'),\n value: 'h'\n }, {\n label: _('Vertical'),\n value: 'v'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Normalization'),\n attr: \"groupnorm\",\n options: [{\n label: _('None'),\n value: ''\n }, {\n label: _('Fraction'),\n value: 'fraction'\n }, {\n label: _('Percent'),\n value: 'percent'\n }]\n })), /*#__PURE__*/_react.default.createElement(_components.TraceTypeSection, {\n name: _('Lines'),\n traceTypes: ['scatter', 'contour', 'scatterternary', 'scatterpolar', 'scatterpolargl', 'box', 'violin', 'scatter3d', 'scattergl', 'scattergeo', 'parcoords', 'parcats', 'scattermapbox', 'scattercarpet', 'contourcarpet', 'ohlc', 'candlestick', 'histogram2dcontour'],\n mode: \"trace\"\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Width'),\n attr: \"line.width\"\n }), /*#__PURE__*/_react.default.createElement(_components.MultiColorPicker, {\n label: _('Color'),\n attr: \"line.color\"\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Color Bar'),\n attr: \"line.showscale\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.ColorscalePicker, {\n label: _('Colorscale'),\n attr: \"line.colorscale\"\n }), /*#__PURE__*/_react.default.createElement(_components.LineDashSelector, {\n label: _('Type'),\n attr: \"line.dash\"\n }), /*#__PURE__*/_react.default.createElement(_components.LineShapeSelector, {\n label: _('Shape'),\n attr: \"line.shape\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Smoothing'),\n attr: \"line.smoothing\",\n showSlider: true,\n step: 0.1\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Connect Gaps'),\n attr: \"connectgaps\",\n options: [{\n label: _('Connect'),\n value: true\n }, {\n label: _('Blank'),\n value: false\n }]\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Filled Area')\n }, /*#__PURE__*/_react.default.createElement(_components.FillDropdown, {\n attr: \"fill\",\n label: _('Fill to')\n }), /*#__PURE__*/_react.default.createElement(_components.MultiColorPicker, {\n label: _('Color'),\n attr: \"fillcolor\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Notches')\n }, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"notched\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Width'),\n attr: \"notchwidth\",\n min: 0,\n max: 0.5,\n step: 0.1\n })), /*#__PURE__*/_react.default.createElement(_components.TraceTypeSection, {\n name: _('Text'),\n traceTypes: allTraceTypes.filter(function (t) {\n return !['histogram2d', 'histogram2dcontour', 'parcoords', 'parcats', 'sankey', 'table', 'scattercarpet', 'carpet'].includes(t);\n }),\n mode: \"trace\"\n }, /*#__PURE__*/_react.default.createElement(_components.TextPosition, {\n label: _('Text Position'),\n attr: \"textposition\"\n }), /*#__PURE__*/_react.default.createElement(_components.HoverTemplateSwitch, {\n attr: \"texttemplate\",\n label: _('Mode')\n }), /*#__PURE__*/_react.default.createElement(_derived.TextInfo, {\n attr: \"textinfo\",\n label: _('Show')\n }), /*#__PURE__*/_react.default.createElement(_components.HoverTemplateText, {\n attr: \"texttemplate\",\n label: _('Template')\n }), /*#__PURE__*/_react.default.createElement(_components.DataSelector, {\n label: _('Text'),\n attr: \"text\"\n }), /*#__PURE__*/_react.default.createElement(_components.FontSelector, {\n label: _('Typeface'),\n attr: \"textfont.family\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Font Size'),\n attr: \"textfont.size\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.MultiColorPicker, {\n label: _('Font Color'),\n attr: \"textfont.color\"\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Inside Text Orientation'),\n options: [{\n label: _('Auto'),\n value: 'auto'\n }, {\n label: _('Radial'),\n value: 'radial'\n }, {\n label: _('Tangential'),\n value: 'tangential'\n }, {\n label: _('Horizontal'),\n value: 'horizontal'\n }],\n attr: \"insidetextorientation\",\n clearable: false\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Text Angle'),\n options: [{\n label: _('Auto'),\n value: 'auto'\n }, {\n label: _('Horizontal'),\n value: 0\n }, {\n label: _('Vertical Up'),\n value: -90\n }, {\n label: _('Vertical Down'),\n value: 90\n }, {\n label: _('Angled Down'),\n value: 45\n }, {\n label: _('Angled Up'),\n value: -45\n }],\n attr: \"textangle\",\n clearable: false\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Constrain Text'),\n options: [{\n label: _('Inside'),\n value: 'inside'\n }, {\n label: _('Outside'),\n value: 'outside'\n }, {\n label: _('Both'),\n value: 'both'\n }, {\n label: _('None'),\n value: 'none'\n }],\n attr: \"constraintext\",\n clearable: false\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Clip on Axes'),\n attr: \"cliponaxis\",\n options: [{\n label: _('Yes'),\n value: true\n }, {\n label: _('No'),\n value: false\n }]\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Colorscale')\n }, /*#__PURE__*/_react.default.createElement(_components.ColorscalePicker, {\n label: _('Colorscale'),\n attr: \"colorscale\"\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Color Bar'),\n attr: \"showscale\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Orientation'),\n attr: \"reversescale\",\n options: [{\n label: _('Normal'),\n value: false\n }, {\n label: _('Reversed'),\n value: true\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.VisibilitySelect, {\n label: _('Range'),\n attr: \"zauto\",\n options: [{\n label: _('Auto'),\n value: true\n }, {\n label: _('Custom'),\n value: false\n }],\n showOn: false,\n defaultOpt: true\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Min'),\n attr: \"zmin\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Max'),\n attr: \"zmax\"\n })), /*#__PURE__*/_react.default.createElement(_components.VisibilitySelect, {\n label: _('Range'),\n attr: \"cauto\",\n options: [{\n label: _('Auto'),\n value: true\n }, {\n label: _('Custom'),\n value: false\n }],\n showOn: false,\n defaultOpt: true\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Min'),\n attr: \"cmin\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Max'),\n attr: \"cmax\"\n })), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Smoothing'),\n attr: \"zsmooth\",\n options: [{\n label: _('On'),\n value: 'best'\n }, {\n label: _('Off'),\n value: false\n }]\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Gaps Between Cells')\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Horizontal Gap'),\n attr: \"xgap\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Vertical Gap'),\n attr: \"ygap\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Heatmap')\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Horizontal Gaps'),\n attr: \"xgap\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Vertical Gaps'),\n attr: \"ygap\"\n })), /*#__PURE__*/_react.default.createElement(_components.TraceTypeSection, {\n name: _('Gaps in Data'),\n traceTypes: ['heatmap', 'contour', 'heatmapgl'],\n mode: \"trace\"\n }, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Interpolate Gaps'),\n attr: \"connectgaps\",\n options: [{\n label: _('On'),\n value: true\n }, {\n label: _('Off'),\n value: false\n }]\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Lighting')\n }, /*#__PURE__*/_react.default.createElement(_components.NumericFraction, {\n label: _('Ambient'),\n attr: \"lighting.ambient\"\n }), /*#__PURE__*/_react.default.createElement(_components.NumericFraction, {\n label: _('Diffuse'),\n attr: \"lighting.diffuse\"\n }), /*#__PURE__*/_react.default.createElement(_components.NumericFraction, {\n label: _('Specular'),\n attr: \"lighting.specular\"\n }), /*#__PURE__*/_react.default.createElement(_components.NumericFraction, {\n label: _('Roughness'),\n attr: \"lighting.roughness\"\n }), /*#__PURE__*/_react.default.createElement(_components.NumericFraction, {\n label: _('Fresnel'),\n attr: \"lighting.fresnel\"\n }), /*#__PURE__*/_react.default.createElement(_components.NumericFraction, {\n label: _('Vertex Normal'),\n attr: \"lighting.vertexnormalsepsilon\"\n }), /*#__PURE__*/_react.default.createElement(_components.NumericFraction, {\n label: _('Face Normal'),\n attr: \"lighting.facenormalsepsilon\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Light Position')\n }, /*#__PURE__*/_react.default.createElement(_components.NumericFraction, {\n label: _('X'),\n attr: \"lightposition.x\"\n }), /*#__PURE__*/_react.default.createElement(_components.NumericFraction, {\n label: _('Y'),\n attr: \"lightposition.y\"\n }), /*#__PURE__*/_react.default.createElement(_components.NumericFraction, {\n label: _('Z'),\n attr: \"lightposition.z\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Scaling')\n }, /*#__PURE__*/_react.default.createElement(_components.GroupCreator, {\n label: _('Scale Group'),\n prefix: _('Group'),\n attr: \"scalegroup\"\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Scale Mode'),\n attr: \"scalemode\",\n options: [{\n label: _('Width'),\n value: 'width'\n }, {\n label: _('Count'),\n value: 'count'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Span Mode'),\n attr: \"spanmode\",\n options: [{\n label: _('Soft'),\n value: 'soft'\n }, {\n label: _('Hard'),\n value: 'hard'\n }, {\n label: _('Manual'),\n value: 'manual'\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Bandwidth'),\n attr: \"bandwidth\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Span'),\n attr: \"span\"\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"side\",\n label: _('Visible Sides'),\n options: [{\n label: _('Both'),\n value: 'both'\n }, {\n label: _('Positive'),\n value: 'positive'\n }, {\n label: _('Negative'),\n value: 'negative'\n }]\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Box Mean')\n }, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"boxmean\",\n options: [{\n label: _('Mean'),\n value: true\n }, {\n label: _('Mean & SD'),\n value: 'sd'\n }, {\n label: _('None'),\n value: false\n }]\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Box')\n }, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"box.visible\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.NumericFraction, {\n label: _('Box Width'),\n attr: \"box.width\"\n }), /*#__PURE__*/_react.default.createElement(_components.MultiColorPicker, {\n label: _('Box Fill Color'),\n attr: \"box.color\"\n }), /*#__PURE__*/_react.default.createElement(_components.NumericFraction, {\n label: _('Box Line Width'),\n attr: \"box.line.width\"\n }), /*#__PURE__*/_react.default.createElement(_components.MultiColorPicker, {\n label: _('Box Line Color'),\n attr: \"box.line.color\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Meanline')\n }, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"meanline.visible\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.NumericFraction, {\n label: _('Meanline Width'),\n attr: \"meanline.width\"\n }), /*#__PURE__*/_react.default.createElement(_components.MultiColorPicker, {\n label: _('Meanline Color'),\n attr: \"meanline.color\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Nodes')\n }, /*#__PURE__*/_react.default.createElement(_components.ColorArrayPicker, {\n label: _('Color'),\n attr: \"node.color\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Padding'),\n attr: \"node.pad\",\n min: 0\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Thickness'),\n attr: \"node.thickness\",\n min: 0\n }), /*#__PURE__*/_react.default.createElement(_components.MultiColorPicker, {\n label: _('Line Color'),\n attr: \"node.line.color\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Line Width'),\n attr: \"node.line.width\",\n min: 0\n }), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Arrangement'),\n attr: \"arrangement\",\n options: [{\n label: _('Snap'),\n value: 'snap'\n }, {\n label: _('Perpendicular'),\n value: 'perpendicular'\n }, {\n label: _('Freeform'),\n value: 'freeform'\n }, {\n label: _('Fixed'),\n value: 'fixed'\n }],\n clearable: false\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Links')\n }, /*#__PURE__*/_react.default.createElement(_components.ColorArrayPicker, {\n label: _('Color'),\n attr: \"link.color\"\n }), /*#__PURE__*/_react.default.createElement(_components.MultiColorPicker, {\n label: _('Line Color'),\n attr: \"link.line.color\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Line Width'),\n attr: \"link.line.width\",\n min: 0\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Path Bar'),\n attr: \"pathbar.visible\"\n }, /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"pathbar.visible\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n attr: \"pathbar.side\",\n options: [{\n label: _('Top'),\n value: 'top'\n }, {\n label: _('Bottom'),\n value: 'bottom'\n }],\n label: _('Side')\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Hover/Tooltip')\n }, /*#__PURE__*/_react.default.createElement(_derived.HoveronDropdown, {\n attr: \"hoveron\",\n label: _('Hover on')\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Hover on Gaps'),\n attr: \"hoverongaps\",\n options: [{\n label: _('Yes'),\n value: true\n }, {\n label: _('No'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.HoverTemplateSwitch, {\n attr: \"hovertemplate\",\n label: _('Mode')\n }), /*#__PURE__*/_react.default.createElement(_components.HoverInfo, {\n attr: \"hoverinfo\",\n label: _('Show')\n }), /*#__PURE__*/_react.default.createElement(_components.HoverTemplateText, {\n attr: \"hovertemplate\",\n label: _('Template')\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Split labels'),\n attr: \"hoverlabel.split\",\n options: [{\n label: _('Yes'),\n value: true\n }, {\n label: _('No'),\n value: false\n }]\n }), /*#__PURE__*/_react.default.createElement(_components.HoverLabelNameLength, {\n label: _('Trace Name'),\n attr: \"hoverlabel.namelength\"\n }), /*#__PURE__*/_react.default.createElement(_components.VisibilitySelect, {\n attr: \"contour.show\",\n label: _('Show Contour'),\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }],\n showOn: true,\n defaultOpt: false\n }, /*#__PURE__*/_react.default.createElement(_components.MultiColorPicker, {\n label: _('Contour Color'),\n attr: \"contour.color\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Contour Width'),\n attr: \"contour.width\"\n })), /*#__PURE__*/_react.default.createElement(_components.Dropdown, {\n label: _('Text Alignment'),\n attr: \"hoverlabel.align\",\n options: [{\n label: _('Auto'),\n value: 'auto'\n }, {\n label: _('Left'),\n value: 'left'\n }, {\n label: _('Right'),\n value: 'right'\n }],\n clearable: false\n }), /*#__PURE__*/_react.default.createElement(_components.Text, {\n label: _('Value Format'),\n attr: \"valueformat\"\n }), /*#__PURE__*/_react.default.createElement(_components.Text, {\n label: _('Value Suffix'),\n attr: \"valuesuffix\"\n })), /*#__PURE__*/_react.default.createElement(_components.TraceTypeSection, {\n name: _('Error Bars X'),\n traceTypes: ['scatter', 'scattergl', 'scatter3d', 'bar'],\n mode: \"trace\"\n }, /*#__PURE__*/_react.default.createElement(_components.ErrorBars, {\n attr: \"error_x\"\n })), /*#__PURE__*/_react.default.createElement(_components.TraceTypeSection, {\n name: _('Error Bars Y'),\n traceTypes: ['scatter', 'scattergl', 'scatter3d', 'bar'],\n mode: \"trace\"\n }, /*#__PURE__*/_react.default.createElement(_components.ErrorBars, {\n attr: \"error_y\"\n })), /*#__PURE__*/_react.default.createElement(_components.TraceTypeSection, {\n name: _('Error Bars Z'),\n traceTypes: ['scatter3d'],\n mode: \"trace\"\n }, /*#__PURE__*/_react.default.createElement(_components.ErrorBars, {\n attr: \"error_z\"\n })));\n};\n\nStyleTracesPanel.contextTypes = {\n localize: _propTypes.default.func\n};\nvar _default = StyleTracesPanel;\nexports.default = _default;\n//# sourceMappingURL=StyleTracesPanel.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/default_panels/StyleTracesPanel.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/default_panels/StyleUpdateMenusPanel.js": /*!*************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/default_panels/StyleUpdateMenusPanel.js ***! \*************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _components = __webpack_require__(/*! ../components */ \"./node_modules/react-chart-editor/lib/components/index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar StyleUpdateMenusPanel = function StyleUpdateMenusPanel(props, _ref) {\n var _ = _ref.localize;\n return /*#__PURE__*/_react.default.createElement(_components.UpdateMenuAccordion, null, /*#__PURE__*/_react.default.createElement(_components.VisibilitySelect, {\n attr: \"visible\",\n options: [{\n label: _('Show'),\n value: true\n }, {\n label: _('Hide'),\n value: false\n }],\n showOn: true\n }, /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Button Labels')\n }, /*#__PURE__*/_react.default.createElement(_components.UpdateMenuButtons, {\n attr: \"buttons\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Background')\n }, /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Color'),\n attr: \"bgcolor\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Font')\n }, /*#__PURE__*/_react.default.createElement(_components.FontSelector, {\n label: _('Typeface'),\n attr: \"font.family\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Size'),\n attr: \"font.size\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Color'),\n attr: \"font.color\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Border')\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Width'),\n attr: \"borderwidth\"\n }), /*#__PURE__*/_react.default.createElement(_components.ColorPicker, {\n label: _('Color'),\n attr: \"bordercolor\"\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Horizontal Positioning'),\n attr: 'x'\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Position'),\n attr: 'x',\n showSlider: true,\n step: 0.02\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Anchor'),\n attr: 'xanchor',\n options: [{\n label: _('Left'),\n value: 'left'\n }, {\n label: _('Center'),\n value: 'center'\n }, {\n label: _('Right'),\n value: 'right'\n }]\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Vertical Positioning'),\n attr: 'y'\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Position'),\n attr: 'y',\n showSlider: true,\n step: 0.02\n }), /*#__PURE__*/_react.default.createElement(_components.Radio, {\n label: _('Anchor'),\n attr: 'yanchor',\n options: [{\n label: _('Top'),\n value: 'top'\n }, {\n label: _('Middle'),\n value: 'middle'\n }, {\n label: _('Bottom'),\n value: 'bottom'\n }]\n })), /*#__PURE__*/_react.default.createElement(_components.PlotlySection, {\n name: _('Padding')\n }, /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Top'),\n attr: \"pad.t\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Bottom'),\n attr: \"pad.b\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Left'),\n attr: \"pad.l\",\n units: \"px\"\n }), /*#__PURE__*/_react.default.createElement(_components.Numeric, {\n label: _('Right'),\n attr: \"pad.r\",\n units: \"px\"\n }))));\n};\n\nStyleUpdateMenusPanel.contextTypes = {\n localize: _propTypes.default.func\n};\nvar _default = StyleUpdateMenusPanel;\nexports.default = _default;\n//# sourceMappingURL=StyleUpdateMenusPanel.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/default_panels/StyleUpdateMenusPanel.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/default_panels/index.js": /*!*********************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/default_panels/index.js ***! \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"GraphCreatePanel\", {\n enumerable: true,\n get: function get() {\n return _GraphCreatePanel.default;\n }\n});\nObject.defineProperty(exports, \"GraphTransformsPanel\", {\n enumerable: true,\n get: function get() {\n return _GraphTransformsPanel.default;\n }\n});\nObject.defineProperty(exports, \"StyleLayoutPanel\", {\n enumerable: true,\n get: function get() {\n return _StyleLayoutPanel.default;\n }\n});\nObject.defineProperty(exports, \"StyleAxesPanel\", {\n enumerable: true,\n get: function get() {\n return _StyleAxesPanel.default;\n }\n});\nObject.defineProperty(exports, \"StyleMapsPanel\", {\n enumerable: true,\n get: function get() {\n return _StyleMapsPanel.default;\n }\n});\nObject.defineProperty(exports, \"StyleLegendPanel\", {\n enumerable: true,\n get: function get() {\n return _StyleLegendPanel.default;\n }\n});\nObject.defineProperty(exports, \"StyleNotesPanel\", {\n enumerable: true,\n get: function get() {\n return _StyleNotesPanel.default;\n }\n});\nObject.defineProperty(exports, \"StyleShapesPanel\", {\n enumerable: true,\n get: function get() {\n return _StyleShapesPanel.default;\n }\n});\nObject.defineProperty(exports, \"StyleSlidersPanel\", {\n enumerable: true,\n get: function get() {\n return _StyleSlidersPanel.default;\n }\n});\nObject.defineProperty(exports, \"StyleImagesPanel\", {\n enumerable: true,\n get: function get() {\n return _StyleImagesPanel.default;\n }\n});\nObject.defineProperty(exports, \"StyleTracesPanel\", {\n enumerable: true,\n get: function get() {\n return _StyleTracesPanel.default;\n }\n});\nObject.defineProperty(exports, \"StyleColorbarsPanel\", {\n enumerable: true,\n get: function get() {\n return _StyleColorbarsPanel.default;\n }\n});\nObject.defineProperty(exports, \"StyleUpdateMenusPanel\", {\n enumerable: true,\n get: function get() {\n return _StyleUpdateMenusPanel.default;\n }\n});\nObject.defineProperty(exports, \"GraphSubplotsPanel\", {\n enumerable: true,\n get: function get() {\n return _GraphSubplotsPanel.default;\n }\n});\n\nvar _GraphCreatePanel = _interopRequireDefault(__webpack_require__(/*! ./GraphCreatePanel */ \"./node_modules/react-chart-editor/lib/default_panels/GraphCreatePanel.js\"));\n\nvar _GraphTransformsPanel = _interopRequireDefault(__webpack_require__(/*! ./GraphTransformsPanel */ \"./node_modules/react-chart-editor/lib/default_panels/GraphTransformsPanel.js\"));\n\nvar _StyleLayoutPanel = _interopRequireDefault(__webpack_require__(/*! ./StyleLayoutPanel */ \"./node_modules/react-chart-editor/lib/default_panels/StyleLayoutPanel.js\"));\n\nvar _StyleAxesPanel = _interopRequireDefault(__webpack_require__(/*! ./StyleAxesPanel */ \"./node_modules/react-chart-editor/lib/default_panels/StyleAxesPanel.js\"));\n\nvar _StyleMapsPanel = _interopRequireDefault(__webpack_require__(/*! ./StyleMapsPanel */ \"./node_modules/react-chart-editor/lib/default_panels/StyleMapsPanel.js\"));\n\nvar _StyleLegendPanel = _interopRequireDefault(__webpack_require__(/*! ./StyleLegendPanel */ \"./node_modules/react-chart-editor/lib/default_panels/StyleLegendPanel.js\"));\n\nvar _StyleNotesPanel = _interopRequireDefault(__webpack_require__(/*! ./StyleNotesPanel */ \"./node_modules/react-chart-editor/lib/default_panels/StyleNotesPanel.js\"));\n\nvar _StyleShapesPanel = _interopRequireDefault(__webpack_require__(/*! ./StyleShapesPanel */ \"./node_modules/react-chart-editor/lib/default_panels/StyleShapesPanel.js\"));\n\nvar _StyleSlidersPanel = _interopRequireDefault(__webpack_require__(/*! ./StyleSlidersPanel */ \"./node_modules/react-chart-editor/lib/default_panels/StyleSlidersPanel.js\"));\n\nvar _StyleImagesPanel = _interopRequireDefault(__webpack_require__(/*! ./StyleImagesPanel */ \"./node_modules/react-chart-editor/lib/default_panels/StyleImagesPanel.js\"));\n\nvar _StyleTracesPanel = _interopRequireDefault(__webpack_require__(/*! ./StyleTracesPanel */ \"./node_modules/react-chart-editor/lib/default_panels/StyleTracesPanel.js\"));\n\nvar _StyleColorbarsPanel = _interopRequireDefault(__webpack_require__(/*! ./StyleColorbarsPanel */ \"./node_modules/react-chart-editor/lib/default_panels/StyleColorbarsPanel.js\"));\n\nvar _StyleUpdateMenusPanel = _interopRequireDefault(__webpack_require__(/*! ./StyleUpdateMenusPanel */ \"./node_modules/react-chart-editor/lib/default_panels/StyleUpdateMenusPanel.js\"));\n\nvar _GraphSubplotsPanel = _interopRequireDefault(__webpack_require__(/*! ./GraphSubplotsPanel */ \"./node_modules/react-chart-editor/lib/default_panels/GraphSubplotsPanel.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/default_panels/index.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/index.js": /*!******************************************************!*\ !*** ./node_modules/react-chart-editor/lib/index.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar _exportNames = {\n DefaultEditor: true,\n EditorControls: true,\n EDITOR_ACTIONS: true\n};\nObject.defineProperty(exports, \"DefaultEditor\", {\n enumerable: true,\n get: function get() {\n return _DefaultEditor.default;\n }\n});\nObject.defineProperty(exports, \"EditorControls\", {\n enumerable: true,\n get: function get() {\n return _EditorControls.default;\n }\n});\nObject.defineProperty(exports, \"EDITOR_ACTIONS\", {\n enumerable: true,\n get: function get() {\n return _constants.EDITOR_ACTIONS;\n }\n});\nexports.default = void 0;\n\nvar _PlotlyEditor = _interopRequireDefault(__webpack_require__(/*! ./PlotlyEditor */ \"./node_modules/react-chart-editor/lib/PlotlyEditor.js\"));\n\nvar _DefaultEditor = _interopRequireDefault(__webpack_require__(/*! ./DefaultEditor */ \"./node_modules/react-chart-editor/lib/DefaultEditor.js\"));\n\nvar _EditorControls = _interopRequireDefault(__webpack_require__(/*! ./EditorControls */ \"./node_modules/react-chart-editor/lib/EditorControls.js\"));\n\nvar _constants = __webpack_require__(/*! ./lib/constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nvar _lib = __webpack_require__(/*! ./lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nObject.keys(_lib).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function get() {\n return _lib[key];\n }\n });\n});\n\nvar _components = __webpack_require__(/*! ./components */ \"./node_modules/react-chart-editor/lib/components/index.js\");\n\nObject.keys(_components).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function get() {\n return _components[key];\n }\n });\n});\n\nvar _default_panels = __webpack_require__(/*! ./default_panels */ \"./node_modules/react-chart-editor/lib/default_panels/index.js\");\n\nObject.keys(_default_panels).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n Object.defineProperty(exports, key, {\n enumerable: true,\n get: function get() {\n return _default_panels[key];\n }\n });\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar _default = _PlotlyEditor.default;\nexports.default = _default;\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/index.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/lib/bem.js": /*!********************************************************!*\ !*** ./node_modules/react-chart-editor/lib/lib/bem.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = bem;\n\nvar _constants = __webpack_require__(/*! ./constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\n//\n// BEM helper\n//\n// bem() => 'plotly-editor'\n// bem('foo') => 'foo'\n// bem('foo', 'bar') => 'foo__bar'\n// bem('foo', ['mod']) => 'foo foo--mod'\n// bem('foo', 'bar', ['mod']) => 'foo__bar foo__bar--mod'\n// bem('foo', ['mod1', mod2']) => 'foo foo--mod1 foo--mod2'\n\n/* eslint-disable no-param-reassign */\nfunction bem(block, element, modifiers) {\n var i, modifier;\n var out = [];\n\n if (!block) {\n return _constants.baseClass;\n }\n\n if (Array.isArray(block)) {\n throw new Error('bem error: Argument `block` cannot be an array');\n } else if (Array.isArray(element)) {\n modifiers = element;\n element = null;\n }\n\n var className = block;\n\n if (element && element.length) {\n className += '__' + element;\n }\n\n out.push(className);\n\n if (modifiers) {\n for (i = 0; i < modifiers.length; i++) {\n modifier = modifiers[i];\n\n if (modifier && modifier.length) {\n out.push(className + '--' + modifier);\n }\n }\n }\n\n return out.join(' ');\n}\n//# sourceMappingURL=bem.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/lib/bem.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/lib/computeTraceOptionsFromSchema.js": /*!**********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/lib/computeTraceOptionsFromSchema.js ***! \**********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.computeTraceOptionsFromSchema = computeTraceOptionsFromSchema;\n\nfunction computeTraceOptionsFromSchema(schema, _, context) {\n // Filter out Polar \"area\" type as it is fairly broken and we want to present\n // scatter with fill as an \"area\" chart type for convenience.\n var traceTypes = Object.keys(schema.traces).filter(function (t) {\n return !['area', 'scattermapbox'].includes(t);\n });\n var traceOptions = [{\n value: 'scatter',\n label: _('Scatter')\n }, {\n value: 'box',\n label: _('Box')\n }, {\n value: 'bar',\n label: _('Bar')\n }, {\n value: 'heatmap',\n label: _('Heatmap')\n }, {\n value: 'histogram',\n label: _('Histogram')\n }, {\n value: 'histogram2d',\n label: _('2D Histogram')\n }, {\n value: 'histogram2dcontour',\n label: _('2D Contour Histogram')\n }, {\n value: 'pie',\n label: _('Pie')\n }, {\n value: 'contour',\n label: _('Contour')\n }, {\n value: 'scatterternary',\n label: _('Ternary Scatter')\n }, {\n value: 'violin',\n label: _('Violin')\n }, {\n value: 'scatter3d',\n label: _('3D Scatter')\n }, {\n value: 'surface',\n label: _('Surface')\n }, {\n value: 'mesh3d',\n label: _('3D Mesh')\n }, {\n value: 'cone',\n label: _('Cone')\n }, {\n value: 'streamtube',\n label: _('Streamtube')\n }, {\n value: 'scattergeo',\n label: _('Atlas Map')\n }, {\n value: 'choropleth',\n label: _('Choropleth')\n }, {\n value: 'scattergl',\n label: _('Scatter GL')\n }, {\n value: 'pointcloud',\n label: _('Point Cloud')\n }, {\n value: 'heatmapgl',\n label: _('Heatmap GL')\n }, {\n value: 'parcoords',\n label: _('Parallel Coordinates')\n }, {\n value: 'sankey',\n label: _('Sankey')\n }, {\n value: 'table',\n label: _('Table')\n }, {\n value: 'carpet',\n label: _('Carpet')\n }, {\n value: 'scattercarpet',\n label: _('Carpet Scatter')\n }, {\n value: 'contourcarpet',\n label: _('Carpet Contour')\n }, {\n value: 'ohlc',\n label: _('OHLC')\n }, {\n value: 'candlestick',\n label: _('Candlestick')\n }, {\n value: 'scatterpolar',\n label: _('Polar Scatter')\n }, {\n value: 'scatterpolargl',\n label: _('Polar Scatter GL')\n }, {\n value: 'barpolar',\n label: _('Polar Bar')\n }, {\n value: 'isosurface',\n label: _('Isosurface')\n }].filter(function (obj) {\n return traceTypes.indexOf(obj.value) !== -1;\n });\n\n var traceIndex = function traceIndex(traceType) {\n return traceOptions.findIndex(function (opt) {\n return opt.value === traceType;\n });\n };\n\n traceOptions.splice(traceIndex('scatter') + 1, 0, {\n label: _('Line'),\n value: 'line'\n }, {\n label: _('Area'),\n value: 'area'\n }, {\n label: _('Timeseries'),\n value: 'timeseries'\n });\n traceOptions.splice(traceIndex('scatter3d') + 1, 0, {\n label: _('3D Line'),\n value: 'line3d'\n });\n\n if (context.config && context.config.mapboxAccessToken) {\n traceOptions.push({\n value: 'scattermapbox',\n label: _('Satellite Map')\n });\n }\n\n return traceOptions;\n}\n//# sourceMappingURL=computeTraceOptionsFromSchema.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/lib/computeTraceOptionsFromSchema.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/lib/connectAggregationToTransform.js": /*!**********************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/lib/connectAggregationToTransform.js ***! \**********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = connectAggregationToTransform;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction connectAggregationToTransform(WrappedComponent) {\n var AggregationConnectedComponent = /*#__PURE__*/function (_Component) {\n _inherits(AggregationConnectedComponent, _Component);\n\n var _super = _createSuper(AggregationConnectedComponent);\n\n function AggregationConnectedComponent(props, context) {\n var _this;\n\n _classCallCheck(this, AggregationConnectedComponent);\n\n _this = _super.call(this, props, context);\n _this.updateAggregation = _this.updateAggregation.bind(_assertThisInitialized(_this));\n\n _this.setLocals(props, context);\n\n return _this;\n }\n\n _createClass(AggregationConnectedComponent, [{\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n }, {\n key: \"setLocals\",\n value: function setLocals(props, context) {\n var aggregationIndex = props.aggregationIndex;\n var container = context.container,\n fullContainer = context.fullContainer;\n var aggregations = container && container.aggregations || [];\n var fullAggregations = fullContainer.aggregations || [];\n this.container = aggregations[aggregationIndex];\n this.fullContainer = fullAggregations[aggregationIndex];\n }\n }, {\n key: \"getChildContext\",\n value: function getChildContext() {\n var _this2 = this;\n\n return {\n getValObject: function getValObject(attr) {\n return !_this2.context.getValObject ? null : _this2.context.getValObject(\"aggregations[].\".concat(attr));\n },\n updateContainer: this.updateAggregation,\n container: this.container,\n fullContainer: this.fullContainer\n };\n }\n }, {\n key: \"updateAggregation\",\n value: function updateAggregation(update) {\n var newUpdate = {};\n var path = \"aggregations[\".concat(this.props.aggregationIndex, \"]\");\n\n for (var key in update) {\n newUpdate[\"\".concat(path, \".\").concat(key)] = update[key];\n }\n\n newUpdate[\"\".concat(path, \".target\")] = this.fullContainer.target;\n newUpdate[\"\".concat(path, \".enabled\")] = true;\n this.context.updateContainer(newUpdate);\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react.default.createElement(WrappedComponent, this.props);\n }\n }]);\n\n return AggregationConnectedComponent;\n }(_react.Component);\n\n AggregationConnectedComponent.displayName = \"AggregationConnected\".concat((0, _lib.getDisplayName)(WrappedComponent));\n AggregationConnectedComponent.propTypes = {\n aggregationIndex: _propTypes.default.number.isRequired\n };\n AggregationConnectedComponent.contextTypes = {\n container: _propTypes.default.object,\n fullContainer: _propTypes.default.object,\n data: _propTypes.default.array,\n onUpdate: _propTypes.default.func,\n updateContainer: _propTypes.default.func,\n getValObject: _propTypes.default.func\n };\n AggregationConnectedComponent.childContextTypes = {\n updateContainer: _propTypes.default.func,\n deleteContainer: _propTypes.default.func,\n container: _propTypes.default.object,\n fullContainer: _propTypes.default.object,\n getValObject: _propTypes.default.func\n };\n var plotly_editor_traits = WrappedComponent.plotly_editor_traits;\n AggregationConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n return AggregationConnectedComponent;\n}\n//# sourceMappingURL=connectAggregationToTransform.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/lib/connectAggregationToTransform.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/lib/connectAnnotationToLayout.js": /*!******************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/lib/connectAnnotationToLayout.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = connectAnnotationToLayout;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _constants = __webpack_require__(/*! ./constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction connectAnnotationToLayout(WrappedComponent) {\n var AnnotationConnectedComponent = /*#__PURE__*/function (_Component) {\n _inherits(AnnotationConnectedComponent, _Component);\n\n var _super = _createSuper(AnnotationConnectedComponent);\n\n function AnnotationConnectedComponent(props, context) {\n var _this;\n\n _classCallCheck(this, AnnotationConnectedComponent);\n\n _this = _super.call(this, props, context);\n _this.deleteAnnotation = _this.deleteAnnotation.bind(_assertThisInitialized(_this));\n _this.updateAnnotation = _this.updateAnnotation.bind(_assertThisInitialized(_this));\n _this.moveAnnotation = _this.moveAnnotation.bind(_assertThisInitialized(_this));\n\n _this.setLocals(props, context);\n\n return _this;\n }\n\n _createClass(AnnotationConnectedComponent, [{\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n }, {\n key: \"setLocals\",\n value: function setLocals(props, context) {\n var annotationIndex = props.annotationIndex;\n var container = context.container,\n fullContainer = context.fullContainer;\n var annotations = container.annotations || [];\n var fullAnnotations = fullContainer.annotations || [];\n this.container = annotations[annotationIndex];\n this.fullContainer = fullAnnotations[annotationIndex];\n }\n }, {\n key: \"getChildContext\",\n value: function getChildContext() {\n var _this2 = this;\n\n return {\n getValObject: function getValObject(attr) {\n return !_this2.context.getValObject ? null : _this2.context.getValObject(\"annotations[].\".concat(attr));\n },\n updateContainer: this.updateAnnotation,\n deleteContainer: this.deleteAnnotation,\n container: this.container,\n fullContainer: this.fullContainer,\n moveContainer: this.moveAnnotation\n };\n }\n }, {\n key: \"updateAnnotation\",\n value: function updateAnnotation(update) {\n var newUpdate = {};\n var annotationIndex = this.props.annotationIndex;\n\n for (var key in update) {\n var newkey = \"annotations[\".concat(annotationIndex, \"].\").concat(key);\n newUpdate[newkey] = update[key];\n }\n\n this.context.updateContainer(newUpdate);\n }\n }, {\n key: \"deleteAnnotation\",\n value: function deleteAnnotation() {\n if (this.context.onUpdate) {\n this.context.onUpdate({\n type: _constants.EDITOR_ACTIONS.DELETE_ANNOTATION,\n payload: {\n annotationIndex: this.props.annotationIndex\n }\n });\n }\n }\n }, {\n key: \"moveAnnotation\",\n value: function moveAnnotation(direction) {\n if (this.context.onUpdate) {\n var annotationIndex = this.props.annotationIndex;\n var desiredIndex = direction === 'up' ? annotationIndex - 1 : annotationIndex + 1;\n this.context.onUpdate({\n type: _constants.EDITOR_ACTIONS.MOVE_TO,\n payload: {\n fromIndex: annotationIndex,\n toIndex: desiredIndex,\n path: 'layout.annotations'\n }\n });\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react.default.createElement(WrappedComponent, this.props);\n }\n }]);\n\n return AnnotationConnectedComponent;\n }(_react.Component);\n\n AnnotationConnectedComponent.displayName = \"AnnotationConnected\".concat((0, _lib.getDisplayName)(WrappedComponent));\n AnnotationConnectedComponent.propTypes = {\n annotationIndex: _propTypes.default.number.isRequired\n };\n AnnotationConnectedComponent.contextTypes = {\n container: _propTypes.default.object,\n fullContainer: _propTypes.default.object,\n data: _propTypes.default.array,\n onUpdate: _propTypes.default.func,\n updateContainer: _propTypes.default.func,\n getValObject: _propTypes.default.func\n };\n AnnotationConnectedComponent.childContextTypes = {\n updateContainer: _propTypes.default.func,\n deleteContainer: _propTypes.default.func,\n container: _propTypes.default.object,\n fullContainer: _propTypes.default.object,\n getValObject: _propTypes.default.func,\n moveContainer: _propTypes.default.func\n };\n var plotly_editor_traits = WrappedComponent.plotly_editor_traits;\n AnnotationConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n return AnnotationConnectedComponent;\n}\n//# sourceMappingURL=connectAnnotationToLayout.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/lib/connectAnnotationToLayout.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/lib/connectAxesToLayout.js": /*!************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/lib/connectAxesToLayout.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = connectAxesToLayout;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _nested_property = _interopRequireDefault(__webpack_require__(/*! plotly.js/src/lib/nested_property */ \"./node_modules/plotly.js/src/lib/nested_property.js\"));\n\nvar _multiValues = __webpack_require__(/*! ./multiValues */ \"./node_modules/react-chart-editor/lib/lib/multiValues.js\");\n\nvar _lib = __webpack_require__(/*! ../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction computeAxesOptions(axes, props, context) {\n var _ = context.localize;\n var filteredAxes = axes;\n\n if (props.axisFilter) {\n filteredAxes = axes.filter(props.axisFilter);\n }\n\n var options = [];\n\n for (var i = 0; i < filteredAxes.length; i++) {\n var ax = filteredAxes[i];\n var label = (0, _lib.capitalize)(ax._name.split('axis')[0]);\n var value = (ax._subplot && !ax._subplot.includes('xaxis') && !ax._subplot.includes('yaxis') ? ax._subplot + '.' + ax._name : ax._subplot).trim();\n options[i] = {\n label: label,\n value: value,\n axisGroup: ax._axisGroup,\n title: (0, _lib.getAxisTitle)(ax)\n };\n }\n\n return options.length > 1 ? [{\n label: _('All'),\n value: 'allaxes'\n }].concat(options) : options;\n}\n\nfunction connectAxesToLayout(WrappedComponent) {\n var AxesConnectedComponent = /*#__PURE__*/function (_Component) {\n _inherits(AxesConnectedComponent, _Component);\n\n var _super = _createSuper(AxesConnectedComponent);\n\n function AxesConnectedComponent(props, context) {\n var _this;\n\n _classCallCheck(this, AxesConnectedComponent);\n\n _this = _super.call(this, props, context);\n _this.axes = (0, _lib.getAllAxes)(context.fullContainer);\n _this.axesOptions = computeAxesOptions(_this.axes, props, context); // this.axesOptions can be an empty array when we have a filter on an AxesFold\n // and no axes correspond to the condition\n\n var defaultAxesTarget = null;\n\n if (_this.axesOptions.length === 1) {\n defaultAxesTarget = _this.axesOptions[0].value;\n }\n\n if (_this.axesOptions.length > 1) {\n defaultAxesTarget = _this.axesOptions[1].value;\n }\n\n _this.state = {\n axesTarget: defaultAxesTarget\n };\n _this.axesTargetHandler = _this.axesTargetHandler.bind(_assertThisInitialized(_this));\n _this.updateContainer = _this.updateContainer.bind(_assertThisInitialized(_this));\n\n _this.setLocals(props, _this.state, context);\n\n return _this;\n }\n\n _createClass(AxesConnectedComponent, [{\n key: \"componentWillUpdate\",\n value: function componentWillUpdate(nextProps, nextState, nextContext) {\n this.axes = (0, _lib.getAllAxes)(nextContext.fullContainer);\n this.axesOptions = computeAxesOptions(this.axes, nextProps, nextContext); // This is not enough, what if plotly.js adds new axes...\n\n this.setLocals(nextProps, nextState, nextContext);\n }\n }, {\n key: \"setLocals\",\n value: function setLocals(nextProps, nextState, nextContext) {\n var container = nextContext.container,\n fullContainer = nextContext.fullContainer;\n var axesTarget = nextState.axesTarget;\n\n if (axesTarget === 'allaxes') {\n var multiValuedContainer = (0, _multiValues.deepCopyPublic)(this.axes[0]);\n this.axes.slice(1).forEach(function (ax) {\n return Object.keys(ax).forEach(function (key) {\n return (0, _multiValues.setMultiValuedContainer)(multiValuedContainer, (0, _multiValues.deepCopyPublic)(ax), key, {\n searchArrays: true\n });\n });\n });\n this.fullContainer = multiValuedContainer;\n this.defaultContainer = this.axes[0];\n this.container = {};\n } else if (axesTarget) {\n this.fullContainer = (0, _nested_property.default)(fullContainer, axesTarget).get();\n this.container = this.container = (0, _nested_property.default)(container, axesTarget).get() || {};\n }\n }\n }, {\n key: \"getChildContext\",\n value: function getChildContext() {\n var _this2 = this;\n\n return {\n getValObject: function getValObject(attr) {\n return !_this2.context.getValObject ? null : _this2.context.getValObject(\"\".concat(_this2.state.axesTarget, \".\").concat(attr));\n },\n axesOptions: this.axesOptions,\n axesTarget: this.state.axesTarget,\n axesTargetHandler: this.axesTargetHandler,\n container: this.container,\n defaultContainer: this.defaultContainer,\n fullContainer: this.fullContainer,\n updateContainer: this.updateContainer\n };\n }\n }, {\n key: \"axesTargetHandler\",\n value: function axesTargetHandler(axesTarget) {\n this.setState({\n axesTarget: axesTarget\n });\n }\n }, {\n key: \"updateContainer\",\n value: function updateContainer(update) {\n var newUpdate = {};\n var axesTarget = this.state.axesTarget;\n var axes = this.axes;\n\n if (axesTarget !== 'allaxes') {\n // only the selected container\n axes = [this.fullContainer];\n }\n\n var keys = Object.keys(update);\n\n for (var i = 0; i < keys.length; i++) {\n for (var j = 0; j < axes.length; j++) {\n var subplot = axes[j]._subplot;\n var axesKey = axes[j]._name;\n\n if (subplot && !subplot.includes('xaxis') && !subplot.includes('yaxis')) {\n axesKey = \"\".concat(subplot, \".\").concat(axesKey);\n }\n\n var newkey = \"\".concat(axesKey, \".\").concat(keys[i]);\n newUpdate[newkey] = update[keys[i]];\n }\n }\n\n this.context.updateContainer(newUpdate);\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react.default.createElement(WrappedComponent, _extends({}, this.props, {\n options: this.axesOptions\n }));\n }\n }]);\n\n return AxesConnectedComponent;\n }(_react.Component);\n\n AxesConnectedComponent.displayName = \"AxesConnected\".concat((0, _lib.getDisplayName)(WrappedComponent));\n AxesConnectedComponent.contextTypes = {\n container: _propTypes.default.object.isRequired,\n fullContainer: _propTypes.default.object.isRequired,\n updateContainer: _propTypes.default.func,\n localize: _propTypes.default.func,\n getValObject: _propTypes.default.func\n };\n AxesConnectedComponent.childContextTypes = {\n axesOptions: _propTypes.default.array,\n axesTarget: _propTypes.default.string,\n axesTargetHandler: _propTypes.default.func,\n container: _propTypes.default.object,\n defaultContainer: _propTypes.default.object,\n fullContainer: _propTypes.default.object,\n updateContainer: _propTypes.default.func,\n getValObject: _propTypes.default.func\n };\n var plotly_editor_traits = WrappedComponent.plotly_editor_traits;\n AxesConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n return AxesConnectedComponent;\n}\n//# sourceMappingURL=connectAxesToLayout.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/lib/connectAxesToLayout.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/lib/connectCartesianSubplotToLayout.js": /*!************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/lib/connectCartesianSubplotToLayout.js ***! \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = connectCartesianSubplotToLayout;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction connectCartesianSubplotToLayout(WrappedComponent) {\n var SubplotConnectedComponent = /*#__PURE__*/function (_Component) {\n _inherits(SubplotConnectedComponent, _Component);\n\n var _super = _createSuper(SubplotConnectedComponent);\n\n function SubplotConnectedComponent(props, context) {\n var _this;\n\n _classCallCheck(this, SubplotConnectedComponent);\n\n _this = _super.call(this, props, context);\n _this.updateSubplot = _this.updateSubplot.bind(_assertThisInitialized(_this));\n\n _this.setLocals(props, context);\n\n return _this;\n }\n\n _createClass(SubplotConnectedComponent, [{\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n }, {\n key: \"setLocals\",\n value: function setLocals(props, context) {\n var xaxis = props.xaxis,\n yaxis = props.yaxis,\n traceIndexes = props.traceIndexes;\n var container = context.container,\n fullContainer = context.fullContainer,\n data = context.data;\n this.container = {\n xaxis: container[xaxis],\n yaxis: container[yaxis]\n };\n this.fullContainer = {\n xaxis: fullContainer[xaxis],\n yaxis: fullContainer[yaxis]\n };\n var trace = traceIndexes.length > 0 ? data[traceIndexes[0]] : {};\n var fullTrace = (0, _lib.getFullTrace)(props, context);\n\n if (trace && fullTrace) {\n this.icon = (0, _lib.renderTraceIcon)((0, _lib.plotlyTraceToCustomTrace)(trace));\n this.name = fullTrace.name;\n }\n }\n }, {\n key: \"getChildContext\",\n value: function getChildContext() {\n var _this2 = this;\n\n return {\n getValObject: function getValObject(attr) {\n return !_this2.context.getValObject ? null : _this2.context.getValObject(attr.replace('xaxis', _this2.props.xaxis).replace('yaxis', _this2.props.yaxis));\n },\n updateContainer: this.updateSubplot,\n deleteContainer: this.deleteSubplot,\n container: this.container,\n fullContainer: this.fullContainer\n };\n }\n }, {\n key: \"updateSubplot\",\n value: function updateSubplot(update) {\n var newUpdate = {};\n\n for (var key in update) {\n var newKey = key.replace('xaxis', this.props.xaxis).replace('yaxis', this.props.yaxis);\n newUpdate[newKey] = update[key];\n }\n\n this.context.updateContainer(newUpdate);\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react.default.createElement(WrappedComponent, _extends({\n name: this.name,\n icon: this.icon\n }, this.props));\n }\n }]);\n\n return SubplotConnectedComponent;\n }(_react.Component);\n\n SubplotConnectedComponent.displayName = \"SubplotConnected\".concat((0, _lib.getDisplayName)(WrappedComponent));\n SubplotConnectedComponent.propTypes = {\n xaxis: _propTypes.default.string.isRequired,\n yaxis: _propTypes.default.string.isRequired\n };\n SubplotConnectedComponent.contextTypes = {\n container: _propTypes.default.object,\n fullContainer: _propTypes.default.object,\n data: _propTypes.default.array,\n fullData: _propTypes.default.array,\n onUpdate: _propTypes.default.func,\n updateContainer: _propTypes.default.func,\n getValObject: _propTypes.default.func\n };\n SubplotConnectedComponent.childContextTypes = {\n updateContainer: _propTypes.default.func,\n deleteContainer: _propTypes.default.func,\n container: _propTypes.default.object,\n fullContainer: _propTypes.default.object,\n getValObject: _propTypes.default.func\n };\n var plotly_editor_traits = WrappedComponent.plotly_editor_traits;\n SubplotConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n return SubplotConnectedComponent;\n}\n//# sourceMappingURL=connectCartesianSubplotToLayout.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/lib/connectCartesianSubplotToLayout.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/lib/connectImageToLayout.js": /*!*************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/lib/connectImageToLayout.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = connectImageToLayout;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _constants = __webpack_require__(/*! ./constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction connectImageToLayout(WrappedComponent) {\n var ImageConnectedComponent = /*#__PURE__*/function (_Component) {\n _inherits(ImageConnectedComponent, _Component);\n\n var _super = _createSuper(ImageConnectedComponent);\n\n function ImageConnectedComponent(props, context) {\n var _this;\n\n _classCallCheck(this, ImageConnectedComponent);\n\n _this = _super.call(this, props, context);\n _this.deleteImage = _this.deleteImage.bind(_assertThisInitialized(_this));\n _this.updateImage = _this.updateImage.bind(_assertThisInitialized(_this));\n _this.moveImage = _this.moveImage.bind(_assertThisInitialized(_this));\n\n _this.setLocals(props, context);\n\n return _this;\n }\n\n _createClass(ImageConnectedComponent, [{\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n }, {\n key: \"setLocals\",\n value: function setLocals(props, context) {\n var imageIndex = props.imageIndex;\n var container = context.container,\n fullContainer = context.fullContainer;\n var images = container.images || [];\n var fullImages = fullContainer.images || [];\n this.container = images[imageIndex];\n this.fullContainer = fullImages[imageIndex];\n }\n }, {\n key: \"getChildContext\",\n value: function getChildContext() {\n var _this2 = this;\n\n return {\n getValObject: function getValObject(attr) {\n return !_this2.context.getValObject ? null : _this2.context.getValObject(\"images[].\".concat(attr));\n },\n updateContainer: this.updateImage,\n deleteContainer: this.deleteImage,\n container: this.container,\n fullContainer: this.fullContainer,\n moveContainer: this.moveImage\n };\n }\n }, {\n key: \"updateImage\",\n value: function updateImage(update) {\n var newUpdate = {};\n var imageIndex = this.props.imageIndex;\n\n for (var key in update) {\n var newkey = \"images[\".concat(imageIndex, \"].\").concat(key);\n newUpdate[newkey] = update[key];\n }\n\n this.context.updateContainer(newUpdate);\n }\n }, {\n key: \"deleteImage\",\n value: function deleteImage() {\n if (this.context.onUpdate) {\n this.context.onUpdate({\n type: _constants.EDITOR_ACTIONS.DELETE_IMAGE,\n payload: {\n imageIndex: this.props.imageIndex\n }\n });\n }\n }\n }, {\n key: \"moveImage\",\n value: function moveImage(direction) {\n if (this.context.onUpdate) {\n var imageIndex = this.props.imageIndex;\n var desiredIndex = direction === 'up' ? imageIndex - 1 : imageIndex + 1;\n this.context.onUpdate({\n type: _constants.EDITOR_ACTIONS.MOVE_TO,\n payload: {\n fromIndex: imageIndex,\n toIndex: desiredIndex,\n path: 'layout.images'\n }\n });\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react.default.createElement(WrappedComponent, this.props);\n }\n }]);\n\n return ImageConnectedComponent;\n }(_react.Component);\n\n ImageConnectedComponent.displayName = \"ImageConnected\".concat((0, _lib.getDisplayName)(WrappedComponent));\n ImageConnectedComponent.propTypes = {\n imageIndex: _propTypes.default.number.isRequired\n };\n ImageConnectedComponent.contextTypes = {\n container: _propTypes.default.object,\n fullContainer: _propTypes.default.object,\n data: _propTypes.default.array,\n onUpdate: _propTypes.default.func,\n updateContainer: _propTypes.default.func,\n getValObject: _propTypes.default.func\n };\n ImageConnectedComponent.childContextTypes = {\n updateContainer: _propTypes.default.func,\n deleteContainer: _propTypes.default.func,\n container: _propTypes.default.object,\n fullContainer: _propTypes.default.object,\n getValObject: _propTypes.default.func,\n moveContainer: _propTypes.default.func\n };\n var plotly_editor_traits = WrappedComponent.plotly_editor_traits;\n ImageConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n return ImageConnectedComponent;\n}\n//# sourceMappingURL=connectImageToLayout.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/lib/connectImageToLayout.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/lib/connectLayersToMapbox.js": /*!**************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/lib/connectLayersToMapbox.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = connectLayersToMapbox;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _constants = __webpack_require__(/*! ./constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction connectLayersToMapbox(WrappedComponent) {\n var MapboxLayerConnectedComponent = /*#__PURE__*/function (_Component) {\n _inherits(MapboxLayerConnectedComponent, _Component);\n\n var _super = _createSuper(MapboxLayerConnectedComponent);\n\n function MapboxLayerConnectedComponent(props, context) {\n var _this;\n\n _classCallCheck(this, MapboxLayerConnectedComponent);\n\n _this = _super.call(this, props, context);\n _this.deleteMapboxLayer = _this.deleteMapboxLayer.bind(_assertThisInitialized(_this));\n _this.updateMapboxLayer = _this.updateMapboxLayer.bind(_assertThisInitialized(_this));\n _this.moveMapboxLayer = _this.moveMapboxLayer.bind(_assertThisInitialized(_this));\n\n _this.setLocals(props, context);\n\n return _this;\n }\n\n _createClass(MapboxLayerConnectedComponent, [{\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n }, {\n key: \"setLocals\",\n value: function setLocals(props, context) {\n var mapboxLayerIndex = props.mapboxLayerIndex;\n var container = context.container,\n fullContainer = context.fullContainer;\n var mapboxLayers = container.layers || [];\n var fullmapboxLayers = fullContainer.layers || [];\n this.container = mapboxLayers[mapboxLayerIndex];\n this.fullContainer = fullmapboxLayers[mapboxLayerIndex];\n }\n }, {\n key: \"getChildContext\",\n value: function getChildContext() {\n var _this2 = this;\n\n return {\n getValObject: function getValObject(attr) {\n return !_this2.context.getValObject ? null : _this2.context.getValObject(\"layers[].\".concat(attr));\n },\n updateContainer: this.updateMapboxLayer,\n deleteContainer: this.deleteMapboxLayer,\n moveContainer: this.moveMapboxLayer,\n container: this.container,\n fullContainer: this.fullContainer\n };\n }\n }, {\n key: \"updateMapboxLayer\",\n value: function updateMapboxLayer(update) {\n var newUpdate = {};\n var mapboxLayerIndex = this.props.mapboxLayerIndex;\n\n for (var key in update) {\n var newkey = \"layers[\".concat(mapboxLayerIndex, \"].\").concat(key);\n newUpdate[newkey] = update[key];\n }\n\n this.context.updateContainer(newUpdate);\n }\n }, {\n key: \"deleteMapboxLayer\",\n value: function deleteMapboxLayer() {\n if (this.context.onUpdate) {\n this.context.onUpdate({\n type: _constants.EDITOR_ACTIONS.DELETE_MAPBOXLAYER,\n payload: {\n mapboxId: this.context.fullContainer._subplot.id,\n mapboxLayerIndex: this.props.mapboxLayerIndex\n }\n });\n }\n }\n }, {\n key: \"moveMapboxLayer\",\n value: function moveMapboxLayer(direction) {\n if (this.context.onUpdate) {\n var mapboxLayerIndex = this.props.mapboxLayerIndex;\n var desiredIndex = direction === 'up' ? mapboxLayerIndex - 1 : mapboxLayerIndex + 1;\n this.context.onUpdate({\n type: _constants.EDITOR_ACTIONS.MOVE_TO,\n payload: {\n fromIndex: mapboxLayerIndex,\n toIndex: desiredIndex,\n mapboxId: this.context.fullContainer._subplot.id,\n path: 'layout.mapbox.layers'\n }\n });\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react.default.createElement(WrappedComponent, this.props);\n }\n }]);\n\n return MapboxLayerConnectedComponent;\n }(_react.Component);\n\n MapboxLayerConnectedComponent.displayName = \"MapboxLayerConnected\".concat((0, _lib.getDisplayName)(WrappedComponent));\n MapboxLayerConnectedComponent.propTypes = {\n mapboxLayerIndex: _propTypes.default.number.isRequired\n };\n MapboxLayerConnectedComponent.contextTypes = {\n container: _propTypes.default.object,\n fullContainer: _propTypes.default.object,\n data: _propTypes.default.array,\n onUpdate: _propTypes.default.func,\n updateContainer: _propTypes.default.func,\n getValObject: _propTypes.default.func\n };\n MapboxLayerConnectedComponent.childContextTypes = {\n updateContainer: _propTypes.default.func,\n deleteContainer: _propTypes.default.func,\n moveContainer: _propTypes.default.func,\n container: _propTypes.default.object,\n fullContainer: _propTypes.default.object,\n getValObject: _propTypes.default.func\n };\n var plotly_editor_traits = WrappedComponent.plotly_editor_traits;\n MapboxLayerConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n return MapboxLayerConnectedComponent;\n}\n//# sourceMappingURL=connectLayersToMapbox.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/lib/connectLayersToMapbox.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/lib/connectLayoutToPlot.js": /*!************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/lib/connectLayoutToPlot.js ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = connectLayoutToPlot;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _nested_property = _interopRequireDefault(__webpack_require__(/*! plotly.js/src/lib/nested_property */ \"./node_modules/plotly.js/src/lib/nested_property.js\"));\n\nvar _lib = __webpack_require__(/*! ../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _constants = __webpack_require__(/*! ./constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction connectLayoutToPlot(WrappedComponent) {\n var LayoutConnectedComponent = /*#__PURE__*/function (_Component) {\n _inherits(LayoutConnectedComponent, _Component);\n\n var _super = _createSuper(LayoutConnectedComponent);\n\n function LayoutConnectedComponent() {\n _classCallCheck(this, LayoutConnectedComponent);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(LayoutConnectedComponent, [{\n key: \"getChildContext\",\n value: function getChildContext() {\n var _this$context = this.context,\n layout = _this$context.layout,\n fullLayout = _this$context.fullLayout,\n plotly = _this$context.plotly,\n onUpdate = _this$context.onUpdate;\n\n var updateContainer = function updateContainer(update) {\n if (!onUpdate) {\n return;\n }\n\n onUpdate({\n type: _constants.EDITOR_ACTIONS.UPDATE_LAYOUT,\n payload: {\n update: update\n }\n });\n };\n\n return {\n getValObject: function getValObject(attr) {\n return !plotly ? null : plotly.PlotSchema.getLayoutValObject(fullLayout, (0, _nested_property.default)({}, attr).parts);\n },\n updateContainer: updateContainer,\n container: layout,\n fullContainer: fullLayout\n };\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react.default.createElement(WrappedComponent, this.props);\n }\n }]);\n\n return LayoutConnectedComponent;\n }(_react.Component);\n\n LayoutConnectedComponent.displayName = \"LayoutConnected\".concat((0, _lib.getDisplayName)(WrappedComponent));\n LayoutConnectedComponent.contextTypes = {\n layout: _propTypes.default.object,\n fullLayout: _propTypes.default.object,\n plotly: _propTypes.default.object,\n onUpdate: _propTypes.default.func\n };\n LayoutConnectedComponent.childContextTypes = {\n getValObject: _propTypes.default.func,\n updateContainer: _propTypes.default.func,\n container: _propTypes.default.object,\n fullContainer: _propTypes.default.object\n };\n var plotly_editor_traits = WrappedComponent.plotly_editor_traits;\n LayoutConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n return LayoutConnectedComponent;\n}\n//# sourceMappingURL=connectLayoutToPlot.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/lib/connectLayoutToPlot.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/lib/connectNonCartesianSubplotToLayout.js": /*!***************************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/lib/connectNonCartesianSubplotToLayout.js ***! \***************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = connectNonCartesianSubplotToLayout;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction connectNonCartesianSubplotToLayout(WrappedComponent) {\n var SubplotConnectedComponent = /*#__PURE__*/function (_Component) {\n _inherits(SubplotConnectedComponent, _Component);\n\n var _super = _createSuper(SubplotConnectedComponent);\n\n function SubplotConnectedComponent(props, context) {\n var _this;\n\n _classCallCheck(this, SubplotConnectedComponent);\n\n _this = _super.call(this, props, context);\n _this.updateSubplot = _this.updateSubplot.bind(_assertThisInitialized(_this));\n\n _this.setLocals(props, context);\n\n return _this;\n }\n\n _createClass(SubplotConnectedComponent, [{\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n }, {\n key: \"setLocals\",\n value: function setLocals(props, context) {\n var subplot = props.subplot,\n traceIndexes = props.traceIndexes;\n var container = context.container,\n fullContainer = context.fullContainer,\n data = context.data;\n this.container = container[subplot] || {};\n this.fullContainer = fullContainer[subplot] || {};\n var trace = traceIndexes.length > 0 ? data[traceIndexes[0]] : {};\n var fullTrace = (0, _lib.getFullTrace)(props, context);\n\n if (trace && fullTrace) {\n this.icon = (0, _lib.renderTraceIcon)((0, _lib.plotlyTraceToCustomTrace)(trace));\n this.name = fullTrace.name;\n }\n }\n }, {\n key: \"getChildContext\",\n value: function getChildContext() {\n var _this2 = this;\n\n return {\n getValObject: function getValObject(attr) {\n return !_this2.context.getValObject ? null : _this2.context.getValObject(\"\".concat(_this2.props.subplot, \".\").concat(attr));\n },\n updateContainer: this.updateSubplot,\n container: this.container,\n fullContainer: this.fullContainer\n };\n }\n }, {\n key: \"updateSubplot\",\n value: function updateSubplot(update) {\n var newUpdate = {};\n\n for (var key in update) {\n newUpdate[\"\".concat(this.props.subplot, \".\").concat(key)] = update[key];\n }\n\n this.context.updateContainer(newUpdate);\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react.default.createElement(WrappedComponent, _extends({\n name: this.name,\n icon: this.icon\n }, this.props));\n }\n }]);\n\n return SubplotConnectedComponent;\n }(_react.Component);\n\n SubplotConnectedComponent.displayName = \"SubplotConnected\".concat((0, _lib.getDisplayName)(WrappedComponent));\n SubplotConnectedComponent.propTypes = {\n subplot: _propTypes.default.string.isRequired\n };\n SubplotConnectedComponent.contextTypes = {\n container: _propTypes.default.object,\n fullContainer: _propTypes.default.object,\n data: _propTypes.default.array,\n fullData: _propTypes.default.array,\n onUpdate: _propTypes.default.func,\n updateContainer: _propTypes.default.func,\n getValObject: _propTypes.default.func\n };\n SubplotConnectedComponent.childContextTypes = {\n updateContainer: _propTypes.default.func,\n deleteContainer: _propTypes.default.func,\n container: _propTypes.default.object,\n fullContainer: _propTypes.default.object,\n getValObject: _propTypes.default.func\n };\n var plotly_editor_traits = WrappedComponent.plotly_editor_traits;\n SubplotConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n return SubplotConnectedComponent;\n}\n//# sourceMappingURL=connectNonCartesianSubplotToLayout.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/lib/connectNonCartesianSubplotToLayout.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/lib/connectRangeSelectorToAxis.js": /*!*******************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/lib/connectRangeSelectorToAxis.js ***! \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = connectRangeSelectorToAxis;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _constants = __webpack_require__(/*! ./constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction connectRangeSelectorToAxis(WrappedComponent) {\n var RangeSelectorConnectedComponent = /*#__PURE__*/function (_Component) {\n _inherits(RangeSelectorConnectedComponent, _Component);\n\n var _super = _createSuper(RangeSelectorConnectedComponent);\n\n function RangeSelectorConnectedComponent(props, context) {\n var _this;\n\n _classCallCheck(this, RangeSelectorConnectedComponent);\n\n _this = _super.call(this, props, context);\n _this.deleteRangeselector = _this.deleteRangeselector.bind(_assertThisInitialized(_this));\n _this.updateRangeselector = _this.updateRangeselector.bind(_assertThisInitialized(_this));\n\n _this.setLocals(props, context);\n\n return _this;\n }\n\n _createClass(RangeSelectorConnectedComponent, [{\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n }, {\n key: \"setLocals\",\n value: function setLocals(props, context) {\n var rangeselectorIndex = props.rangeselectorIndex;\n var container = context.container,\n fullContainer = context.fullContainer;\n var rangeselectors = container.rangeselector ? container.rangeselector.buttons || [] : [];\n var fullRangeselectors = fullContainer.rangeselector ? fullContainer.rangeselector.buttons || [] : [];\n this.container = rangeselectors[rangeselectorIndex];\n this.fullContainer = fullRangeselectors[rangeselectorIndex];\n }\n }, {\n key: \"getChildContext\",\n value: function getChildContext() {\n var _this2 = this;\n\n return {\n getValObject: function getValObject(attr) {\n return !_this2.context.getValObject ? null : _this2.context.getValObject(\"rangeselector.buttons[].\".concat(attr));\n },\n updateContainer: this.updateRangeselector,\n deleteContainer: this.deleteRangeselector,\n container: this.container,\n fullContainer: this.fullContainer\n };\n }\n }, {\n key: \"updateRangeselector\",\n value: function updateRangeselector(update) {\n var newUpdate = {};\n var rangeselectorIndex = this.props.rangeselectorIndex;\n\n for (var key in update) {\n var newkey = \"rangeselector.buttons[\".concat(rangeselectorIndex, \"].\").concat(key);\n newUpdate[newkey] = update[key];\n }\n\n this.context.updateContainer(newUpdate);\n }\n }, {\n key: \"deleteRangeselector\",\n value: function deleteRangeselector() {\n if (this.context.onUpdate) {\n this.context.onUpdate({\n type: _constants.EDITOR_ACTIONS.DELETE_RANGESELECTOR,\n payload: {\n axisId: this.context.fullContainer._name,\n rangeselectorIndex: this.props.rangeselectorIndex\n }\n });\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react.default.createElement(WrappedComponent, this.props);\n }\n }]);\n\n return RangeSelectorConnectedComponent;\n }(_react.Component);\n\n RangeSelectorConnectedComponent.displayName = \"RangeSelectorConnected\".concat((0, _lib.getDisplayName)(WrappedComponent));\n RangeSelectorConnectedComponent.propTypes = {\n rangeselectorIndex: _propTypes.default.number.isRequired\n };\n RangeSelectorConnectedComponent.contextTypes = {\n container: _propTypes.default.object,\n fullContainer: _propTypes.default.object,\n data: _propTypes.default.array,\n onUpdate: _propTypes.default.func,\n updateContainer: _propTypes.default.func,\n getValObject: _propTypes.default.func\n };\n RangeSelectorConnectedComponent.childContextTypes = {\n updateContainer: _propTypes.default.func,\n deleteContainer: _propTypes.default.func,\n container: _propTypes.default.object,\n fullContainer: _propTypes.default.object,\n getValObject: _propTypes.default.func\n };\n var plotly_editor_traits = WrappedComponent.plotly_editor_traits;\n RangeSelectorConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n return RangeSelectorConnectedComponent;\n}\n//# sourceMappingURL=connectRangeSelectorToAxis.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/lib/connectRangeSelectorToAxis.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/lib/connectShapeToLayout.js": /*!*************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/lib/connectShapeToLayout.js ***! \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = connectShapeToLayout;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _constants = __webpack_require__(/*! ./constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction connectShapeToLayout(WrappedComponent) {\n var ShapeConnectedComponent = /*#__PURE__*/function (_Component) {\n _inherits(ShapeConnectedComponent, _Component);\n\n var _super = _createSuper(ShapeConnectedComponent);\n\n function ShapeConnectedComponent(props, context) {\n var _this;\n\n _classCallCheck(this, ShapeConnectedComponent);\n\n _this = _super.call(this, props, context);\n _this.deleteShape = _this.deleteShape.bind(_assertThisInitialized(_this));\n _this.updateShape = _this.updateShape.bind(_assertThisInitialized(_this));\n _this.moveShape = _this.moveShape.bind(_assertThisInitialized(_this));\n\n _this.setLocals(props, context);\n\n return _this;\n }\n\n _createClass(ShapeConnectedComponent, [{\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n }, {\n key: \"setLocals\",\n value: function setLocals(props, context) {\n var shapeIndex = props.shapeIndex;\n var container = context.container,\n fullContainer = context.fullContainer;\n var shapes = container.shapes || [];\n var fullShapes = fullContainer.shapes || [];\n this.container = shapes[shapeIndex];\n this.fullContainer = fullShapes[shapeIndex];\n }\n }, {\n key: \"getChildContext\",\n value: function getChildContext() {\n var _this2 = this;\n\n return {\n getValObject: function getValObject(attr) {\n return !_this2.context.getValObject ? null : _this2.context.getValObject(\"shapes[].\".concat(attr));\n },\n updateContainer: this.updateShape,\n deleteContainer: this.deleteShape,\n container: this.container,\n fullContainer: this.fullContainer,\n moveContainer: this.moveShape\n };\n }\n }, {\n key: \"updateShape\",\n value: function updateShape(update) {\n var newUpdate = {};\n var shapeIndex = this.props.shapeIndex;\n\n for (var key in update) {\n var newkey = \"shapes[\".concat(shapeIndex, \"].\").concat(key);\n newUpdate[newkey] = update[key];\n }\n\n this.context.updateContainer(newUpdate);\n }\n }, {\n key: \"deleteShape\",\n value: function deleteShape() {\n if (this.context.onUpdate) {\n this.context.onUpdate({\n type: _constants.EDITOR_ACTIONS.DELETE_SHAPE,\n payload: {\n shapeIndex: this.props.shapeIndex\n }\n });\n }\n }\n }, {\n key: \"moveShape\",\n value: function moveShape(direction) {\n if (this.context.onUpdate) {\n var shapeIndex = this.props.shapeIndex;\n var desiredIndex = direction === 'up' ? shapeIndex - 1 : shapeIndex + 1;\n this.context.onUpdate({\n type: _constants.EDITOR_ACTIONS.MOVE_TO,\n payload: {\n fromIndex: shapeIndex,\n toIndex: desiredIndex,\n path: 'layout.shapes'\n }\n });\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react.default.createElement(WrappedComponent, this.props);\n }\n }]);\n\n return ShapeConnectedComponent;\n }(_react.Component);\n\n ShapeConnectedComponent.displayName = \"ShapeConnected\".concat((0, _lib.getDisplayName)(WrappedComponent));\n ShapeConnectedComponent.propTypes = {\n shapeIndex: _propTypes.default.number.isRequired\n };\n ShapeConnectedComponent.contextTypes = {\n container: _propTypes.default.object,\n fullContainer: _propTypes.default.object,\n data: _propTypes.default.array,\n onUpdate: _propTypes.default.func,\n updateContainer: _propTypes.default.func,\n getValObject: _propTypes.default.func\n };\n ShapeConnectedComponent.childContextTypes = {\n updateContainer: _propTypes.default.func,\n deleteContainer: _propTypes.default.func,\n container: _propTypes.default.object,\n fullContainer: _propTypes.default.object,\n getValObject: _propTypes.default.func,\n moveContainer: _propTypes.default.func\n };\n var plotly_editor_traits = WrappedComponent.plotly_editor_traits;\n ShapeConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n return ShapeConnectedComponent;\n}\n//# sourceMappingURL=connectShapeToLayout.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/lib/connectShapeToLayout.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/lib/connectSliderToLayout.js": /*!**************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/lib/connectSliderToLayout.js ***! \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = connectSliderToLayout;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction connectSliderToLayout(WrappedComponent) {\n var SliderConnectedComponent = /*#__PURE__*/function (_Component) {\n _inherits(SliderConnectedComponent, _Component);\n\n var _super = _createSuper(SliderConnectedComponent);\n\n function SliderConnectedComponent(props, context) {\n var _this;\n\n _classCallCheck(this, SliderConnectedComponent);\n\n _this = _super.call(this, props, context);\n _this.updateSlider = _this.updateSlider.bind(_assertThisInitialized(_this));\n\n _this.setLocals(props, context);\n\n return _this;\n }\n\n _createClass(SliderConnectedComponent, [{\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n }, {\n key: \"setLocals\",\n value: function setLocals(props, context) {\n var sliderIndex = props.sliderIndex;\n var container = context.container,\n fullContainer = context.fullContainer;\n var sliders = container.sliders || [];\n var fullSliders = fullContainer.sliders || [];\n this.container = sliders[sliderIndex];\n this.fullContainer = fullSliders[sliderIndex];\n }\n }, {\n key: \"getChildContext\",\n value: function getChildContext() {\n var _this2 = this;\n\n return {\n getValObject: function getValObject(attr) {\n return !_this2.context.getValObject ? null : _this2.context.getValObject(\"sliders[].\".concat(attr));\n },\n updateContainer: this.updateSlider,\n container: this.container,\n fullContainer: this.fullContainer\n };\n }\n }, {\n key: \"updateSlider\",\n value: function updateSlider(update) {\n var newUpdate = {};\n var sliderIndex = this.props.sliderIndex;\n\n for (var key in update) {\n var newkey = \"sliders[\".concat(sliderIndex, \"].\").concat(key);\n newUpdate[newkey] = update[key];\n }\n\n this.context.updateContainer(newUpdate);\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react.default.createElement(WrappedComponent, this.props);\n }\n }]);\n\n return SliderConnectedComponent;\n }(_react.Component);\n\n SliderConnectedComponent.displayName = \"SliderConnected\".concat((0, _lib.getDisplayName)(WrappedComponent));\n SliderConnectedComponent.propTypes = {\n sliderIndex: _propTypes.default.number.isRequired\n };\n SliderConnectedComponent.contextTypes = {\n container: _propTypes.default.object,\n fullContainer: _propTypes.default.object,\n onUpdate: _propTypes.default.func,\n updateContainer: _propTypes.default.func,\n getValObject: _propTypes.default.func\n };\n SliderConnectedComponent.childContextTypes = {\n updateContainer: _propTypes.default.func,\n container: _propTypes.default.object,\n fullContainer: _propTypes.default.object,\n getValObject: _propTypes.default.func\n };\n var plotly_editor_traits = WrappedComponent.plotly_editor_traits;\n SliderConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n return SliderConnectedComponent;\n}\n//# sourceMappingURL=connectSliderToLayout.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/lib/connectSliderToLayout.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/lib/connectToContainer.js": /*!***********************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/lib/connectToContainer.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = connectToContainer;\nexports.containerConnectedContextTypes = void 0;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _unpackPlotProps = _interopRequireWildcard(__webpack_require__(/*! ./unpackPlotProps */ \"./node_modules/react-chart-editor/lib/lib/unpackPlotProps.js\"));\n\nvar _lib = __webpack_require__(/*! ../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar containerConnectedContextTypes = {\n localize: _propTypes.default.func,\n container: _propTypes.default.object,\n data: _propTypes.default.array,\n defaultContainer: _propTypes.default.object,\n fullContainer: _propTypes.default.object,\n fullData: _propTypes.default.array,\n fullLayout: _propTypes.default.object,\n getValObject: _propTypes.default.func,\n graphDiv: _propTypes.default.object,\n layout: _propTypes.default.object,\n onUpdate: _propTypes.default.func,\n plotly: _propTypes.default.object,\n updateContainer: _propTypes.default.func,\n traceIndexes: _propTypes.default.array,\n customConfig: _propTypes.default.object,\n hasValidCustomConfigVisibilityRules: _propTypes.default.bool\n};\nexports.containerConnectedContextTypes = containerConnectedContextTypes;\n\nfunction connectToContainer(WrappedComponent) {\n var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var ContainerConnectedComponent = /*#__PURE__*/function (_Component) {\n _inherits(ContainerConnectedComponent, _Component);\n\n var _super = _createSuper(ContainerConnectedComponent);\n\n _createClass(ContainerConnectedComponent, null, [{\n key: \"modifyPlotProps\",\n // Run the inner modifications first and allow more recent modifyPlotProp\n // config function to modify last.\n value: function modifyPlotProps(props, context, plotProps) {\n if (WrappedComponent.modifyPlotProps) {\n WrappedComponent.modifyPlotProps(props, context, plotProps);\n }\n\n if (config.modifyPlotProps) {\n config.modifyPlotProps(props, context, plotProps);\n }\n }\n }]);\n\n function ContainerConnectedComponent(props, context) {\n var _this;\n\n _classCallCheck(this, ContainerConnectedComponent);\n\n _this = _super.call(this, props, context);\n\n _this.setLocals(props, context);\n\n return _this;\n }\n\n _createClass(ContainerConnectedComponent, [{\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n }, {\n key: \"setLocals\",\n value: function setLocals(props, context) {\n this.plotProps = (0, _unpackPlotProps.default)(props, context, WrappedComponent);\n this.attr = props.attr;\n ContainerConnectedComponent.modifyPlotProps(props, context, this.plotProps);\n }\n }, {\n key: \"getChildContext\",\n value: function getChildContext() {\n return {\n description: this.plotProps.description,\n attr: this.attr\n };\n }\n }, {\n key: \"render\",\n value: function render() {\n // Merge plotprops onto props so leaf components only need worry about\n // props. However pass plotProps as a specific prop in case inner component\n // is also wrapped by a component that `unpackPlotProps`. That way inner\n // component can skip computation as it can see plotProps is already defined.\n var _Object$assign = Object.assign({}, this.plotProps, this.props),\n _Object$assign$plotPr = _Object$assign.plotProps,\n plotProps = _Object$assign$plotPr === void 0 ? this.plotProps : _Object$assign$plotPr,\n props = _objectWithoutProperties(_Object$assign, [\"plotProps\"]);\n\n var wrappedComponentDisplayName = WrappedComponent && WrappedComponent.displayName ? WrappedComponent.displayName : null;\n\n if ((0, _unpackPlotProps.isVisibleGivenCustomConfig)(props.isVisible, props, this.context, wrappedComponentDisplayName)) {\n return /*#__PURE__*/_react.default.createElement(WrappedComponent, _extends({}, props, {\n plotProps: plotProps\n }));\n }\n\n return null;\n }\n }]);\n\n return ContainerConnectedComponent;\n }(_react.Component);\n\n ContainerConnectedComponent.displayName = \"ContainerConnected\".concat((0, _lib.getDisplayName)(WrappedComponent));\n ContainerConnectedComponent.contextTypes = containerConnectedContextTypes;\n ContainerConnectedComponent.childContextTypes = {\n description: _propTypes.default.string,\n attr: _propTypes.default.string\n };\n var plotly_editor_traits = WrappedComponent.plotly_editor_traits;\n ContainerConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n return ContainerConnectedComponent;\n}\n//# sourceMappingURL=connectToContainer.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/lib/connectToContainer.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/lib/connectTraceToPlot.js": /*!***********************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/lib/connectTraceToPlot.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = connectTraceToPlot;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _nested_property = _interopRequireDefault(__webpack_require__(/*! plotly.js/src/lib/nested_property */ \"./node_modules/plotly.js/src/lib/nested_property.js\"));\n\nvar _lib = __webpack_require__(/*! ../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _multiValues = __webpack_require__(/*! ./multiValues */ \"./node_modules/react-chart-editor/lib/lib/multiValues.js\");\n\nvar _constants = __webpack_require__(/*! ./constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction connectTraceToPlot(WrappedComponent) {\n var TraceConnectedComponent = /*#__PURE__*/function (_Component) {\n _inherits(TraceConnectedComponent, _Component);\n\n var _super = _createSuper(TraceConnectedComponent);\n\n function TraceConnectedComponent(props, context) {\n var _this;\n\n _classCallCheck(this, TraceConnectedComponent);\n\n _this = _super.call(this, props, context);\n _this.deleteTrace = _this.deleteTrace.bind(_assertThisInitialized(_this));\n _this.updateTrace = _this.updateTrace.bind(_assertThisInitialized(_this));\n _this.moveTrace = _this.moveTrace.bind(_assertThisInitialized(_this));\n\n _this.setLocals(props, context);\n\n return _this;\n }\n\n _createClass(TraceConnectedComponent, [{\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n }, {\n key: \"setLocals\",\n value: function setLocals(props, context) {\n var traceIndexes = props.traceIndexes;\n var data = context.data,\n fullData = context.fullData,\n plotly = context.plotly;\n var trace = data[traceIndexes[0]];\n var fullTrace = (0, _lib.getFullTrace)(props, context);\n this.childContext = {\n getValObject: function getValObject(attr) {\n return !plotly ? null : plotly.PlotSchema.getTraceValObject(fullTrace, (0, _nested_property.default)({}, attr).parts);\n },\n updateContainer: this.updateTrace,\n deleteContainer: this.deleteTrace,\n moveContainer: this.moveTrace,\n container: trace,\n fullContainer: fullTrace,\n traceIndexes: this.props.traceIndexes\n };\n\n if (traceIndexes.length > 1) {\n var multiValuedFullContainer = (0, _multiValues.deepCopyPublic)(fullTrace);\n fullData.forEach(function (t) {\n return Object.keys(t).forEach(function (key) {\n return (0, _multiValues.setMultiValuedContainer)(multiValuedFullContainer, (0, _multiValues.deepCopyPublic)(t), key, {\n searchArrays: true\n });\n });\n });\n var multiValuedContainer = (0, _multiValues.deepCopyPublic)(trace);\n data.forEach(function (t) {\n return Object.keys(t).forEach(function (key) {\n return (0, _multiValues.setMultiValuedContainer)(multiValuedContainer, (0, _multiValues.deepCopyPublic)(t), key, {\n searchArrays: true\n });\n });\n });\n this.childContext.fullContainer = multiValuedFullContainer;\n this.childContext.defaultContainer = fullTrace;\n this.childContext.container = multiValuedContainer;\n }\n\n if (trace && fullTrace) {\n this.icon = (0, _lib.renderTraceIcon)((0, _lib.plotlyTraceToCustomTrace)(trace));\n this.name = (0, _lib.getParsedTemplateString)(fullTrace.name, {\n meta: fullTrace.meta\n });\n }\n }\n }, {\n key: \"getChildContext\",\n value: function getChildContext() {\n return this.childContext;\n }\n }, {\n key: \"updateTrace\",\n value: function updateTrace(update) {\n var _this2 = this;\n\n if (this.context.onUpdate) {\n var splitTraceGroup = this.props.fullDataArrayPosition ? this.props.fullDataArrayPosition.map(function (p) {\n return _this2.context.fullData[p]._group;\n }) : null;\n var containsAnSrc = Object.keys(update).filter(function (a) {\n return a.endsWith('src');\n }).length > 0;\n\n if (Array.isArray(update)) {\n update.forEach(function (u, i) {\n _this2.context.onUpdate({\n type: _constants.EDITOR_ACTIONS.UPDATE_TRACES,\n payload: {\n update: u,\n traceIndexes: [_this2.props.traceIndexes[i]],\n splitTraceGroup: splitTraceGroup ? splitTraceGroup[i] : null\n }\n });\n });\n } else if (splitTraceGroup && !containsAnSrc) {\n this.props.traceIndexes.forEach(function (t, i) {\n _this2.context.onUpdate({\n type: _constants.EDITOR_ACTIONS.UPDATE_TRACES,\n payload: {\n update: update,\n traceIndexes: [_this2.props.traceIndexes[i]],\n splitTraceGroup: splitTraceGroup ? splitTraceGroup[i] : null\n }\n });\n });\n } else {\n this.context.onUpdate({\n type: _constants.EDITOR_ACTIONS.UPDATE_TRACES,\n payload: {\n update: update,\n traceIndexes: this.props.traceIndexes\n }\n });\n }\n }\n }\n }, {\n key: \"deleteTrace\",\n value: function deleteTrace() {\n var _this3 = this;\n\n var currentTrace = this.context.fullData[this.props.traceIndexes[0]];\n\n if (!currentTrace && this.context.onUpdate) {\n this.context.onUpdate({\n type: _constants.EDITOR_ACTIONS.DELETE_TRACE,\n payload: {\n traceIndexes: this.props.traceIndexes\n }\n });\n return;\n }\n\n var axesToBeGarbageCollected = [];\n var subplotToBeGarbageCollected = null;\n var subplotType = (0, _lib.traceTypeToAxisType)(currentTrace.type);\n\n if (subplotType) {\n var subplotNames = subplotType === 'cartesian' ? [currentTrace.xaxis || 'xaxis', currentTrace.yaxis || 'yaxis'] : currentTrace[_constants.SUBPLOT_TO_ATTR[subplotType].data] || _constants.SUBPLOT_TO_ATTR[subplotType].data;\n\n var isSubplotUsedAnywhereElse = function isSubplotUsedAnywhereElse(subplotType, subplotName) {\n return _this3.context.fullData.some(function (trace) {\n return (trace[_constants.SUBPLOT_TO_ATTR[subplotType].data] === subplotName || ((subplotType === 'xaxis' || subplotType === 'yaxis') && subplotName.charAt(1)) === '' || subplotName.split(subplotType)[1] === '' && trace[_constants.SUBPLOT_TO_ATTR[subplotType].data] === null) && trace.index !== _this3.props.traceIndexes[0];\n });\n }; // When we delete a subplot, make sure no unused axes/subplots are left\n\n\n if (subplotType === 'cartesian') {\n if (!isSubplotUsedAnywhereElse('xaxis', subplotNames[0])) {\n axesToBeGarbageCollected.push(subplotNames[0]);\n }\n\n if (!isSubplotUsedAnywhereElse('yaxis', subplotNames[1])) {\n axesToBeGarbageCollected.push(subplotNames[1]);\n }\n } else {\n if (!isSubplotUsedAnywhereElse(subplotType, subplotNames)) {\n subplotToBeGarbageCollected = subplotNames;\n }\n }\n }\n\n if (this.context.onUpdate) {\n this.context.onUpdate({\n type: _constants.EDITOR_ACTIONS.DELETE_TRACE,\n payload: {\n axesToBeGarbageCollected: axesToBeGarbageCollected,\n subplotToBeGarbageCollected: subplotToBeGarbageCollected,\n traceIndexes: this.props.traceIndexes\n }\n });\n }\n }\n }, {\n key: \"moveTrace\",\n value: function moveTrace(direction) {\n var traceIndex = this.props.traceIndexes[0];\n var desiredIndex = direction === 'up' ? traceIndex - 1 : traceIndex + 1;\n this.context.onUpdate({\n type: _constants.EDITOR_ACTIONS.MOVE_TO,\n payload: {\n fromIndex: traceIndex,\n toIndex: desiredIndex,\n path: 'data'\n }\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react.default.createElement(WrappedComponent, _extends({\n name: this.name,\n icon: this.icon\n }, this.props));\n }\n }]);\n\n return TraceConnectedComponent;\n }(_react.Component);\n\n TraceConnectedComponent.displayName = \"TraceConnected\".concat((0, _lib.getDisplayName)(WrappedComponent));\n TraceConnectedComponent.propTypes = {\n traceIndexes: _propTypes.default.arrayOf(_propTypes.default.number).isRequired,\n fullDataArrayPosition: _propTypes.default.arrayOf(_propTypes.default.number)\n };\n TraceConnectedComponent.contextTypes = {\n fullData: _propTypes.default.array,\n data: _propTypes.default.array,\n plotly: _propTypes.default.object,\n onUpdate: _propTypes.default.func,\n layout: _propTypes.default.object\n };\n TraceConnectedComponent.childContextTypes = {\n getValObject: _propTypes.default.func,\n updateContainer: _propTypes.default.func,\n deleteContainer: _propTypes.default.func,\n defaultContainer: _propTypes.default.object,\n container: _propTypes.default.object,\n fullContainer: _propTypes.default.object,\n traceIndexes: _propTypes.default.array,\n moveContainer: _propTypes.default.func\n };\n var plotly_editor_traits = WrappedComponent.plotly_editor_traits;\n TraceConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n return TraceConnectedComponent;\n}\n//# sourceMappingURL=connectTraceToPlot.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/lib/connectTraceToPlot.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/lib/connectTransformToTrace.js": /*!****************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/lib/connectTransformToTrace.js ***! \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = connectTransformToTrace;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nvar _constants = __webpack_require__(/*! ./constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction connectTransformToTrace(WrappedComponent) {\n var TransformConnectedComponent = /*#__PURE__*/function (_Component) {\n _inherits(TransformConnectedComponent, _Component);\n\n var _super = _createSuper(TransformConnectedComponent);\n\n function TransformConnectedComponent(props, context) {\n var _this;\n\n _classCallCheck(this, TransformConnectedComponent);\n\n _this = _super.call(this, props, context);\n _this.deleteTransform = _this.deleteTransform.bind(_assertThisInitialized(_this));\n _this.updateTransform = _this.updateTransform.bind(_assertThisInitialized(_this));\n\n _this.setLocals(props, context);\n\n return _this;\n }\n\n _createClass(TransformConnectedComponent, [{\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n }, {\n key: \"setLocals\",\n value: function setLocals(props, context) {\n var transformIndex = props.transformIndex;\n var container = context.container,\n fullContainer = context.fullContainer;\n var transforms = container.transforms || [];\n var fullTransforms = fullContainer.transforms || [];\n this.container = transforms[transformIndex];\n this.fullContainer = fullTransforms[transformIndex];\n }\n }, {\n key: \"getChildContext\",\n value: function getChildContext() {\n var _this2 = this;\n\n return {\n getValObject: function getValObject(attr) {\n return !_this2.context.getValObject ? null : _this2.context.getValObject(\"transforms[].\".concat(attr));\n },\n updateContainer: this.updateTransform,\n deleteContainer: this.deleteTransform,\n container: this.container,\n fullContainer: this.fullContainer\n };\n }\n }, {\n key: \"updateTransform\",\n value: function updateTransform(update) {\n var newUpdate = {};\n var transformIndex = this.props.transformIndex;\n\n for (var key in update) {\n var newkey = \"transforms[\".concat(transformIndex, \"].\").concat(key);\n newUpdate[newkey] = update[key];\n }\n\n this.context.updateContainer(newUpdate);\n }\n }, {\n key: \"deleteTransform\",\n value: function deleteTransform() {\n if (this.context.onUpdate) {\n this.context.onUpdate({\n type: _constants.EDITOR_ACTIONS.DELETE_TRANSFORM,\n payload: {\n traceIndex: this.context.fullContainer.index,\n transformIndex: this.props.transformIndex\n }\n });\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react.default.createElement(WrappedComponent, this.props);\n }\n }]);\n\n return TransformConnectedComponent;\n }(_react.Component);\n\n TransformConnectedComponent.displayName = \"TransformConnected\".concat((0, _lib.getDisplayName)(WrappedComponent));\n TransformConnectedComponent.propTypes = {\n transformIndex: _propTypes.default.number.isRequired\n };\n TransformConnectedComponent.contextTypes = {\n container: _propTypes.default.object,\n fullContainer: _propTypes.default.object,\n data: _propTypes.default.array,\n onUpdate: _propTypes.default.func,\n updateContainer: _propTypes.default.func,\n getValObject: _propTypes.default.func\n };\n TransformConnectedComponent.childContextTypes = {\n updateContainer: _propTypes.default.func,\n deleteContainer: _propTypes.default.func,\n container: _propTypes.default.object,\n fullContainer: _propTypes.default.object,\n getValObject: _propTypes.default.func\n };\n var plotly_editor_traits = WrappedComponent.plotly_editor_traits;\n TransformConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n return TransformConnectedComponent;\n}\n//# sourceMappingURL=connectTransformToTrace.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/lib/connectTransformToTrace.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/lib/connectUpdateMenuToLayout.js": /*!******************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/lib/connectUpdateMenuToLayout.js ***! \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = connectUpdateMenuToLayout;\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _lib = __webpack_require__(/*! ../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction connectUpdateMenuToLayout(WrappedComponent) {\n var UpdateMenuConnectedComponent = /*#__PURE__*/function (_Component) {\n _inherits(UpdateMenuConnectedComponent, _Component);\n\n var _super = _createSuper(UpdateMenuConnectedComponent);\n\n function UpdateMenuConnectedComponent(props, context) {\n var _this;\n\n _classCallCheck(this, UpdateMenuConnectedComponent);\n\n _this = _super.call(this, props, context);\n _this.updateUpdateMenu = _this.updateUpdateMenu.bind(_assertThisInitialized(_this));\n\n _this.setLocals(props, context);\n\n return _this;\n }\n\n _createClass(UpdateMenuConnectedComponent, [{\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps, nextContext) {\n this.setLocals(nextProps, nextContext);\n }\n }, {\n key: \"setLocals\",\n value: function setLocals(props, context) {\n var updateMenuIndex = props.updateMenuIndex;\n var container = context.container,\n fullContainer = context.fullContainer;\n var updatemenus = container.updatemenus || [];\n var fullUpdateMenus = fullContainer.updatemenus || [];\n this.container = updatemenus[updateMenuIndex];\n this.fullContainer = fullUpdateMenus[updateMenuIndex];\n }\n }, {\n key: \"getChildContext\",\n value: function getChildContext() {\n var _this2 = this;\n\n return {\n getValObject: function getValObject(attr) {\n return !_this2.context.getValObject ? null : _this2.context.getValObject(\"updatemenus[].\".concat(attr));\n },\n updateContainer: this.updateUpdateMenu,\n container: this.container,\n fullContainer: this.fullContainer\n };\n }\n }, {\n key: \"updateUpdateMenu\",\n value: function updateUpdateMenu(update) {\n var newUpdate = {};\n var updateMenuIndex = this.props.updateMenuIndex;\n\n for (var key in update) {\n var newkey = \"updatemenus[\".concat(updateMenuIndex, \"].\").concat(key);\n newUpdate[newkey] = update[key];\n }\n\n this.context.updateContainer(newUpdate);\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react.default.createElement(WrappedComponent, this.props);\n }\n }]);\n\n return UpdateMenuConnectedComponent;\n }(_react.Component);\n\n UpdateMenuConnectedComponent.displayName = \"UpdateMenuConnected\".concat((0, _lib.getDisplayName)(WrappedComponent));\n UpdateMenuConnectedComponent.propTypes = {\n updateMenuIndex: _propTypes.default.number.isRequired\n };\n UpdateMenuConnectedComponent.contextTypes = {\n container: _propTypes.default.object,\n fullContainer: _propTypes.default.object,\n onUpdate: _propTypes.default.func,\n updateContainer: _propTypes.default.func,\n getValObject: _propTypes.default.func\n };\n UpdateMenuConnectedComponent.childContextTypes = {\n updateContainer: _propTypes.default.func,\n container: _propTypes.default.object,\n fullContainer: _propTypes.default.object,\n getValObject: _propTypes.default.func\n };\n var plotly_editor_traits = WrappedComponent.plotly_editor_traits;\n UpdateMenuConnectedComponent.plotly_editor_traits = plotly_editor_traits;\n return UpdateMenuConnectedComponent;\n}\n//# sourceMappingURL=connectUpdateMenuToLayout.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/lib/connectUpdateMenuToLayout.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/lib/constants.js": /*!**************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/lib/constants.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.DEFAULT_COLORS = exports.COLORS = exports.TRACES_WITH_GL = exports.TRANSFORMABLE_TRACES = exports.TRANSFORMS_LIST = exports.subplotName = exports.SUBPLOT_TO_ATTR = exports.TRACE_TO_AXIS = exports.CONTROL_KEY = exports.COMMAND_KEY = exports.ESCAPE_KEY = exports.RETURN_KEY = exports.DEFAULT_FONTS = exports.EDITOR_ACTIONS = exports.getMultiValueText = exports.MULTI_VALUED_PLACEHOLDER = exports.MULTI_VALUED = exports.baseClass = void 0;\nvar baseClass = 'plotly-editor';\n/*\n * Control represents multiple settings (like for several axes)\n * and the values are different.\n *\n * Because this is sometimes used in contexts where users can enter freeform\n * strings, we include a non-printable character (ESC) so it's not something\n * people could type.\n */\n\nexports.baseClass = baseClass;\nvar MULTI_VALUED = '\\x1bMIXED_VALUES'; // how mixed values are represented in text inputs\n\nexports.MULTI_VALUED = MULTI_VALUED;\nvar MULTI_VALUED_PLACEHOLDER = '---';\nexports.MULTI_VALUED_PLACEHOLDER = MULTI_VALUED_PLACEHOLDER;\n\nvar getMultiValueText = function getMultiValueText(key, _) {\n var multiValueText = {\n title: _('Multiple Values'),\n text: _('This input has multiple values associated with it. ' + 'Changing this setting will override these custom inputs.'),\n subText: _(\"Common Case: An 'All' tab might display this message \" + 'because the X and Y tabs contain different settings.')\n };\n return multiValueText[key];\n};\n\nexports.getMultiValueText = getMultiValueText;\nvar EDITOR_ACTIONS = {\n UPDATE_TRACES: 'plotly-editor-update-traces',\n ADD_TRACE: 'plotly-editor-add-trace',\n DELETE_TRACE: 'plotly-editor-delete-trace',\n UPDATE_LAYOUT: 'plotly-editor-update-layout',\n DELETE_ANNOTATION: 'plotly-editor-delete-annotation',\n DELETE_SHAPE: 'plotly-editor-delete-shape',\n DELETE_IMAGE: 'plotly-editor-delete-image',\n DELETE_RANGESELECTOR: 'plotly-editor-delete-rangeselector',\n DELETE_TRANSFORM: 'plotly-editor-delete-transform',\n MOVE_TO: 'plotly-editor-move-to'\n};\nexports.EDITOR_ACTIONS = EDITOR_ACTIONS;\nvar DEFAULT_FONTS = [{\n label: 'Sans Serif',\n value: 'sans-serif'\n}, {\n label: 'Serif',\n value: 'serif'\n}, {\n label: 'Monospaced',\n value: 'monospace'\n}];\nexports.DEFAULT_FONTS = DEFAULT_FONTS;\nvar RETURN_KEY = 'Enter';\nexports.RETURN_KEY = RETURN_KEY;\nvar ESCAPE_KEY = 'Escape';\nexports.ESCAPE_KEY = ESCAPE_KEY;\nvar COMMAND_KEY = 'Meta';\nexports.COMMAND_KEY = COMMAND_KEY;\nvar CONTROL_KEY = 'Control'; // matches gd._fullLayout._subplots categories except for xaxis & yaxis which\n// are in fact cartesian types\n\nexports.CONTROL_KEY = CONTROL_KEY;\nvar TRACE_TO_AXIS = {\n cartesian: ['scatter', 'scattergl', 'box', 'violin', 'bar', 'heatmap', 'heatmapgl', 'contour', 'ohlc', 'candlestick', 'histogram', 'histogram2d', 'histogram2dcontour', 'carpet', 'scattercarpet', 'contourcarpet', 'waterfall', 'funnel'],\n ternary: ['scatterternary'],\n gl3d: ['scatter3d', 'surface', 'mesh3d', 'cone', 'streamtube'],\n geo: ['scattergeo', 'choropleth'],\n mapbox: ['scattermapbox', 'choroplethmapbox', 'densitymapbox'],\n polar: ['scatterpolar', 'scatterpolargl', 'barpolar']\n}; // Note: scene, and xaxis/yaxis were added for convenience sake even though they're not subplot types\n\nexports.TRACE_TO_AXIS = TRACE_TO_AXIS;\nvar SUBPLOT_TO_ATTR = {\n cartesian: {\n data: ['xaxis', 'yaxis'],\n layout: ['x', 'y']\n },\n xaxis: {\n data: 'xaxis',\n layout: 'x'\n },\n yaxis: {\n data: 'yaxis',\n layout: 'y'\n },\n x: {\n data: 'xaxis',\n layout: 'x'\n },\n y: {\n data: 'yaxis',\n layout: 'y'\n },\n ternary: {\n data: 'subplot',\n layout: 'ternary'\n },\n gl3d: {\n data: 'scene',\n layout: 'scene'\n },\n scene: {\n data: 'scene',\n layout: 'scene'\n },\n geo: {\n data: 'geo',\n layout: 'geo'\n },\n mapbox: {\n data: 'subplot',\n layout: 'mapbox'\n },\n polar: {\n data: 'subplot',\n layout: 'polar'\n }\n};\nexports.SUBPLOT_TO_ATTR = SUBPLOT_TO_ATTR;\n\nvar subplotName = function subplotName(type, _) {\n return {\n x: _('X'),\n y: _('Y'),\n ternary: _('Ternary'),\n gl3d: _('Scene'),\n scene: _('Scene'),\n geo: _('Map'),\n mapbox: _('Tile Map'),\n polar: _('Polar')\n }[type];\n};\n\nexports.subplotName = subplotName;\nvar TRANSFORMS_LIST = ['filter', 'groupby', 'aggregate', 'sort'];\nexports.TRANSFORMS_LIST = TRANSFORMS_LIST;\nvar TRANSFORMABLE_TRACES = ['scatter', 'scattergl', 'box', 'violin', 'bar', 'ohlc', 'candlestick', 'histogram', 'histogram2d', 'waterfall'];\nexports.TRANSFORMABLE_TRACES = TRANSFORMABLE_TRACES;\nvar TRACES_WITH_GL = ['scatter', 'scatterpolar', 'scattergl', 'scatterpolargl'];\nexports.TRACES_WITH_GL = TRACES_WITH_GL;\nvar COLORS = {\n charcoal: '#444444',\n white: '#ffffff',\n mutedBlue: '#1f77b4',\n safetyOrange: '#ff7f0e',\n cookedAsparagusGreen: '#2ca02c',\n brickRed: '#d62728',\n mutedPurple: '#9467bd',\n chestnutBrown: '#8c564b',\n raspberryYogurtPink: '#e377c2',\n middleGray: '#7f7f7f',\n curryYellowGreen: '#bcbd22',\n blueTeal: '#17becf',\n editorLink: '#447bdc',\n black: '#000000'\n};\nexports.COLORS = COLORS;\nvar DEFAULT_COLORS = Object.values(COLORS);\nexports.DEFAULT_COLORS = DEFAULT_COLORS;\n//# sourceMappingURL=constants.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/lib/constants.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/lib/customTraceType.js": /*!********************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/lib/customTraceType.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.plotlyTraceToCustomTrace = plotlyTraceToCustomTrace;\nexports.traceTypeToPlotlyInitFigure = traceTypeToPlotlyInitFigure;\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction plotlyTraceToCustomTrace(trace) {\n if (_typeof(trace) !== 'object') {\n throw new Error(\"trace provided to plotlyTraceToCustomTrace function should be an object, received \".concat(_typeof(trace)));\n }\n\n var gl = 'gl';\n var type = trace.type ? trace.type.endsWith(gl) ? trace.type.slice(0, -gl.length) : trace.type : 'scatter';\n\n if ((type === 'scatter' || type === 'scattergl') && (![null, undefined, ''].includes(trace.stackgroup) || // eslint-disable-line no-undefined\n ['tozeroy', 'tozerox', 'tonexty', 'tonextx', 'toself', 'tonext'].includes(trace.fill))) {\n return 'area';\n } else if ((type === 'scatter' || type === 'scattergl') && (trace.mode === 'lines' || trace.mode === 'lines+markers')) {\n return 'line';\n } else if (type === 'scatter3d' && trace.mode === 'lines') {\n return 'line3d';\n }\n\n return type;\n}\n\nfunction traceTypeToPlotlyInitFigure(traceType) {\n var gl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var scatterTrace = {\n type: 'scatter' + gl,\n mode: 'markers',\n stackgroup: null\n };\n\n switch (traceType) {\n case 'line':\n return {\n type: 'scatter' + gl,\n mode: 'lines',\n stackgroup: null\n };\n\n case 'scatter':\n return scatterTrace;\n\n case undefined:\n // eslint-disable-line\n return scatterTrace;\n\n case 'area':\n return {\n type: 'scatter' + gl,\n mode: 'lines',\n stackgroup: 1\n };\n\n case 'scatterpolar':\n return {\n type: 'scatterpolar' + gl\n };\n\n case 'waterfall':\n return {\n type: 'waterfall',\n orientation: 'v'\n };\n\n case 'box':\n return {\n type: 'box',\n boxpoints: false\n };\n\n case 'violin':\n return {\n type: 'violin',\n bandwidth: 0\n };\n\n case 'line3d':\n return {\n type: 'scatter3d',\n mode: 'lines'\n };\n\n case 'scatter3d':\n return {\n type: 'scatter3d',\n mode: 'markers'\n };\n\n case 'bar':\n return {\n orientation: 'v',\n type: 'bar'\n };\n\n case 'cone':\n return {\n sizeref: 1,\n type: 'cone'\n };\n\n case 'histogram2dcontour':\n return {\n type: 'histogram2dcontour',\n autocolorscale: true\n };\n\n case 'histogram2d':\n return {\n type: 'histogram2d',\n autocolorscale: true\n };\n\n case 'heatmap':\n return {\n type: 'heatmap',\n autocolorscale: true\n };\n\n case 'contour':\n return {\n type: 'contour',\n autocolorscale: true\n };\n\n default:\n return {\n type: traceType\n };\n }\n}\n//# sourceMappingURL=customTraceType.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/lib/customTraceType.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/lib/dereference.js": /*!****************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/lib/dereference.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getColumnNames = getColumnNames;\nexports.default = dereference;\n\nvar _walkObject = _interopRequireDefault(__webpack_require__(/*! ./walkObject */ \"./node_modules/react-chart-editor/lib/lib/walkObject.js\"));\n\nvar _index = __webpack_require__(/*! ./index */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar SRC_ATTR_PATTERN = /src$/;\n\nfunction getColumnNames(srcArray, dataSourceOptions) {\n return srcArray.map(function (src) {\n var columns = dataSourceOptions.filter(function (dso) {\n return dso.value === src;\n });\n\n if (columns.length === 1) {\n return columns[0].columnName || columns[0].label;\n }\n\n return '';\n }).join(' - ');\n}\n\nfunction dereference(container, dataSources) {\n var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {\n deleteKeys: false\n };\n var dataSourceOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n var containerIsData = Array.isArray(container);\n\n var replacer = function replacer(key, parent, srcPath) {\n if (!SRC_ATTR_PATTERN.test(key)) {\n return;\n }\n\n var dataKey = key.replace(SRC_ATTR_PATTERN, '');\n var srcRef = config.toSrc ? config.toSrc(parent[key]) : parent[key]; // making this into an array to more easily lookup 1d and 2d srcs in dataSourceOptions\n\n if (!Array.isArray(srcRef)) {\n srcRef = [srcRef];\n }\n\n var dereferencedData = srcRef.map(function (ref) {\n if (config.deleteKeys && !(ref in dataSources)) {\n delete parent[dataKey];\n }\n\n return dataSources[ref];\n }); // remove extra data wrapping\n\n if (srcRef.length === 1) {\n dereferencedData = dereferencedData[0];\n }\n\n if (!Array.isArray(dereferencedData)) {\n return;\n }\n\n if (containerIsData) {\n if (parent.type !== null) {\n // we're at the top level of the trace\n if (dataSourceOptions !== null) {\n parent.meta = parent.meta || {};\n parent.meta.columnNames = parent.meta.columnNames || {};\n parent.meta.columnNames[dataKey] = getColumnNames(srcRef, dataSourceOptions);\n }\n\n parent[dataKey] = (0, _index.maybeTransposeData)(dereferencedData, srcPath, parent.type);\n } else {\n parent[dataKey] = dereferencedData;\n }\n } else {\n // container is layout\n parent[dataKey] = dereferencedData;\n }\n };\n\n if (containerIsData) {\n (0, _walkObject.default)(container, replacer, {\n walkArraysMatchingKeys: ['data', 'transforms'],\n pathType: 'nestedProperty'\n });\n } else {\n // container is layout\n (0, _walkObject.default)(container, replacer, {\n pathType: 'nestedProperty'\n });\n }\n}\n//# sourceMappingURL=dereference.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/lib/dereference.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/lib/getAllAxes.js": /*!***************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/lib/getAllAxes.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = getAllAxes;\nexports.traceTypeToAxisType = traceTypeToAxisType;\nexports.axisIdToAxisName = axisIdToAxisName;\nexports.getAxisTitle = getAxisTitle;\nexports.getSubplotTitle = getSubplotTitle;\n\nvar _constants = __webpack_require__(/*! ./constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nvar _2 = __webpack_require__(/*! ./ */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction getAllAxes(fullLayout) {\n var axes = []; // Plotly.js should really have a helper function for this, but until it does..\n\n if (fullLayout && fullLayout._subplots) {\n Object.keys(fullLayout._subplots).filter( // xaxis and yaxis already included separately in _fullLayout._subplots\n function (type) {\n return type !== 'cartesian' && fullLayout._subplots[type].length !== 0;\n }).forEach(function (type) {\n fullLayout._subplots[type].forEach(function (subplot) {\n if (['xaxis', 'yaxis'].includes(type)) {\n // subplot will look like x2, x45, convert it to xaxis2, xaxis45\n subplot = // eslint-disable-line no-param-reassign\n subplot.length > 1 ? subplot.slice(0, 1) + 'axis' + subplot.slice(1) : subplot + 'axis';\n fullLayout[subplot]._subplot = subplot;\n fullLayout[subplot]._axisGroup = type;\n axes.push(fullLayout[subplot]);\n } else {\n Object.keys(fullLayout[subplot]).filter(function (key) {\n return key.includes('axis');\n }).forEach(function (axis) {\n fullLayout[subplot][axis]._subplot = subplot;\n fullLayout[subplot][axis]._axisGroup = type; // it should be in plotly.js, but it's not there for geo axes..\n\n if (!fullLayout[subplot][axis]._name) {\n fullLayout[subplot][axis]._name = axis;\n }\n\n axes.push(fullLayout[subplot][axis]);\n });\n }\n });\n });\n }\n\n return axes;\n}\n\nfunction traceTypeToAxisType(traceType) {\n var subplot = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n // plotly.js actually allows traces with no type and just\n // defaults them to scatter, so do this here as well.\n if (!traceType) {\n traceType = 'scatter'; // eslint-disable-line\n }\n\n var category = null;\n var traceToAxis = _constants.TRACE_TO_AXIS;\n\n if (subplot) {\n Object.assign(traceToAxis, _constants.TRACE_TO_AXIS, {\n scene: _constants.TRACE_TO_AXIS.gl3d\n });\n delete traceToAxis.gl3d;\n }\n\n Object.keys(traceToAxis).forEach(function (c) {\n if (traceToAxis[c].includes(traceType)) {\n category = c;\n }\n });\n\n if (category) {\n return category;\n }\n\n return null;\n}\n\nfunction axisIdToAxisName(id) {\n return id.charAt(0) + 'axis' + id.slice(1);\n}\n\nfunction getAxisNumber(axis) {\n var splitSubplot = axis._subplot ? axis._subplot.split(axis._axisGroup) : [];\n return splitSubplot[1] ? Number(splitSubplot[1]) : axis._name.split('axis')[1];\n}\n\nfunction getAxisTitle(axis) {\n var axisType = (0, _2.capitalize)(axis._name.split('axis')[0]);\n var subplotNumber = getAxisNumber(axis) || 1;\n return axis._input && axis._input.title ? (0, _2.striptags)(\"\".concat(axisType, \": \").concat(axis._input.title.text)) : (0, _2.striptags)(\"\".concat(axisType, \" \").concat(subplotNumber));\n}\n\nfunction getSubplotNumber(subplot, type) {\n return Number(subplot.split(type)[1]);\n}\n\nfunction getSubplotTitle(subplot, type, _) {\n var axisName = (0, _constants.subplotName)(type, _);\n var subplotNumber = getSubplotNumber(subplot, _constants.SUBPLOT_TO_ATTR[type].layout) || '';\n return \"\".concat(axisName, \" \").concat(subplotNumber);\n}\n//# sourceMappingURL=getAllAxes.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/lib/getAllAxes.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/lib/index.js": /*!**********************************************************!*\ !*** ./node_modules/react-chart-editor/lib/lib/index.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.adjustColorscale = adjustColorscale;\nexports.clamp = clamp;\nexports.getDisplayName = getDisplayName;\nexports.getFullTrace = getFullTrace;\nexports.maybeAdjustSrc = maybeAdjustSrc;\nexports.maybeTransposeData = maybeTransposeData;\nexports.getParsedTemplateString = getParsedTemplateString;\nexports.renderTraceIcon = renderTraceIcon;\nexports.tooLight = tooLight;\nexports.transpose = transpose;\nObject.defineProperty(exports, \"bem\", {\n enumerable: true,\n get: function get() {\n return _bem.default;\n }\n});\nObject.defineProperty(exports, \"connectCartesianSubplotToLayout\", {\n enumerable: true,\n get: function get() {\n return _connectCartesianSubplotToLayout.default;\n }\n});\nObject.defineProperty(exports, \"connectNonCartesianSubplotToLayout\", {\n enumerable: true,\n get: function get() {\n return _connectNonCartesianSubplotToLayout.default;\n }\n});\nObject.defineProperty(exports, \"connectAnnotationToLayout\", {\n enumerable: true,\n get: function get() {\n return _connectAnnotationToLayout.default;\n }\n});\nObject.defineProperty(exports, \"connectShapeToLayout\", {\n enumerable: true,\n get: function get() {\n return _connectShapeToLayout.default;\n }\n});\nObject.defineProperty(exports, \"connectSliderToLayout\", {\n enumerable: true,\n get: function get() {\n return _connectSliderToLayout.default;\n }\n});\nObject.defineProperty(exports, \"connectImageToLayout\", {\n enumerable: true,\n get: function get() {\n return _connectImageToLayout.default;\n }\n});\nObject.defineProperty(exports, \"connectUpdateMenuToLayout\", {\n enumerable: true,\n get: function get() {\n return _connectUpdateMenuToLayout.default;\n }\n});\nObject.defineProperty(exports, \"connectRangeSelectorToAxis\", {\n enumerable: true,\n get: function get() {\n return _connectRangeSelectorToAxis.default;\n }\n});\nObject.defineProperty(exports, \"connectLayersToMapbox\", {\n enumerable: true,\n get: function get() {\n return _connectLayersToMapbox.default;\n }\n});\nObject.defineProperty(exports, \"connectTransformToTrace\", {\n enumerable: true,\n get: function get() {\n return _connectTransformToTrace.default;\n }\n});\nObject.defineProperty(exports, \"connectAggregationToTransform\", {\n enumerable: true,\n get: function get() {\n return _connectAggregationToTransform.default;\n }\n});\nObject.defineProperty(exports, \"connectAxesToLayout\", {\n enumerable: true,\n get: function get() {\n return _connectAxesToLayout.default;\n }\n});\nObject.defineProperty(exports, \"connectLayoutToPlot\", {\n enumerable: true,\n get: function get() {\n return _connectLayoutToPlot.default;\n }\n});\nObject.defineProperty(exports, \"connectToContainer\", {\n enumerable: true,\n get: function get() {\n return _connectToContainer.default;\n }\n});\nObject.defineProperty(exports, \"containerConnectedContextTypes\", {\n enumerable: true,\n get: function get() {\n return _connectToContainer.containerConnectedContextTypes;\n }\n});\nObject.defineProperty(exports, \"computeTraceOptionsFromSchema\", {\n enumerable: true,\n get: function get() {\n return _computeTraceOptionsFromSchema.computeTraceOptionsFromSchema;\n }\n});\nObject.defineProperty(exports, \"connectTraceToPlot\", {\n enumerable: true,\n get: function get() {\n return _connectTraceToPlot.default;\n }\n});\nObject.defineProperty(exports, \"dereference\", {\n enumerable: true,\n get: function get() {\n return _dereference.default;\n }\n});\nObject.defineProperty(exports, \"getAllAxes\", {\n enumerable: true,\n get: function get() {\n return _getAllAxes.default;\n }\n});\nObject.defineProperty(exports, \"axisIdToAxisName\", {\n enumerable: true,\n get: function get() {\n return _getAllAxes.axisIdToAxisName;\n }\n});\nObject.defineProperty(exports, \"traceTypeToAxisType\", {\n enumerable: true,\n get: function get() {\n return _getAllAxes.traceTypeToAxisType;\n }\n});\nObject.defineProperty(exports, \"getAxisTitle\", {\n enumerable: true,\n get: function get() {\n return _getAllAxes.getAxisTitle;\n }\n});\nObject.defineProperty(exports, \"getSubplotTitle\", {\n enumerable: true,\n get: function get() {\n return _getAllAxes.getSubplotTitle;\n }\n});\nObject.defineProperty(exports, \"localize\", {\n enumerable: true,\n get: function get() {\n return _localize.default;\n }\n});\nObject.defineProperty(exports, \"localizeString\", {\n enumerable: true,\n get: function get() {\n return _localize.localizeString;\n }\n});\nObject.defineProperty(exports, \"unpackPlotProps\", {\n enumerable: true,\n get: function get() {\n return _unpackPlotProps.default;\n }\n});\nObject.defineProperty(exports, \"computeCustomConfigVisibility\", {\n enumerable: true,\n get: function get() {\n return _unpackPlotProps.computeCustomConfigVisibility;\n }\n});\nObject.defineProperty(exports, \"hasValidCustomConfigVisibilityRules\", {\n enumerable: true,\n get: function get() {\n return _unpackPlotProps.hasValidCustomConfigVisibilityRules;\n }\n});\nObject.defineProperty(exports, \"isVisibleGivenCustomConfig\", {\n enumerable: true,\n get: function get() {\n return _unpackPlotProps.isVisibleGivenCustomConfig;\n }\n});\nObject.defineProperty(exports, \"walkObject\", {\n enumerable: true,\n get: function get() {\n return _walkObject.default;\n }\n});\nObject.defineProperty(exports, \"isPlainObject\", {\n enumerable: true,\n get: function get() {\n return _walkObject.isPlainObject;\n }\n});\nObject.defineProperty(exports, \"traceTypeToPlotlyInitFigure\", {\n enumerable: true,\n get: function get() {\n return _customTraceType.traceTypeToPlotlyInitFigure;\n }\n});\nObject.defineProperty(exports, \"plotlyTraceToCustomTrace\", {\n enumerable: true,\n get: function get() {\n return _customTraceType.plotlyTraceToCustomTrace;\n }\n});\nObject.defineProperty(exports, \"striptags\", {\n enumerable: true,\n get: function get() {\n return _striptags.default;\n }\n});\nObject.defineProperty(exports, \"capitalize\", {\n enumerable: true,\n get: function get() {\n return _strings.capitalize;\n }\n});\nObject.defineProperty(exports, \"lowerCase\", {\n enumerable: true,\n get: function get() {\n return _strings.lowerCase;\n }\n});\nObject.defineProperty(exports, \"upperCase\", {\n enumerable: true,\n get: function get() {\n return _strings.upperCase;\n }\n});\nObject.defineProperty(exports, \"removeNonWord\", {\n enumerable: true,\n get: function get() {\n return _strings.removeNonWord;\n }\n});\nObject.defineProperty(exports, \"camelCase\", {\n enumerable: true,\n get: function get() {\n return _strings.camelCase;\n }\n});\nObject.defineProperty(exports, \"pascalCase\", {\n enumerable: true,\n get: function get() {\n return _strings.pascalCase;\n }\n});\n\nvar _bem = _interopRequireDefault(__webpack_require__(/*! ./bem */ \"./node_modules/react-chart-editor/lib/lib/bem.js\"));\n\nvar _connectCartesianSubplotToLayout = _interopRequireDefault(__webpack_require__(/*! ./connectCartesianSubplotToLayout */ \"./node_modules/react-chart-editor/lib/lib/connectCartesianSubplotToLayout.js\"));\n\nvar _connectNonCartesianSubplotToLayout = _interopRequireDefault(__webpack_require__(/*! ./connectNonCartesianSubplotToLayout */ \"./node_modules/react-chart-editor/lib/lib/connectNonCartesianSubplotToLayout.js\"));\n\nvar _connectAnnotationToLayout = _interopRequireDefault(__webpack_require__(/*! ./connectAnnotationToLayout */ \"./node_modules/react-chart-editor/lib/lib/connectAnnotationToLayout.js\"));\n\nvar _connectShapeToLayout = _interopRequireDefault(__webpack_require__(/*! ./connectShapeToLayout */ \"./node_modules/react-chart-editor/lib/lib/connectShapeToLayout.js\"));\n\nvar _connectSliderToLayout = _interopRequireDefault(__webpack_require__(/*! ./connectSliderToLayout */ \"./node_modules/react-chart-editor/lib/lib/connectSliderToLayout.js\"));\n\nvar _connectImageToLayout = _interopRequireDefault(__webpack_require__(/*! ./connectImageToLayout */ \"./node_modules/react-chart-editor/lib/lib/connectImageToLayout.js\"));\n\nvar _connectUpdateMenuToLayout = _interopRequireDefault(__webpack_require__(/*! ./connectUpdateMenuToLayout */ \"./node_modules/react-chart-editor/lib/lib/connectUpdateMenuToLayout.js\"));\n\nvar _connectRangeSelectorToAxis = _interopRequireDefault(__webpack_require__(/*! ./connectRangeSelectorToAxis */ \"./node_modules/react-chart-editor/lib/lib/connectRangeSelectorToAxis.js\"));\n\nvar _connectLayersToMapbox = _interopRequireDefault(__webpack_require__(/*! ./connectLayersToMapbox */ \"./node_modules/react-chart-editor/lib/lib/connectLayersToMapbox.js\"));\n\nvar _connectTransformToTrace = _interopRequireDefault(__webpack_require__(/*! ./connectTransformToTrace */ \"./node_modules/react-chart-editor/lib/lib/connectTransformToTrace.js\"));\n\nvar _connectAggregationToTransform = _interopRequireDefault(__webpack_require__(/*! ./connectAggregationToTransform */ \"./node_modules/react-chart-editor/lib/lib/connectAggregationToTransform.js\"));\n\nvar _connectAxesToLayout = _interopRequireDefault(__webpack_require__(/*! ./connectAxesToLayout */ \"./node_modules/react-chart-editor/lib/lib/connectAxesToLayout.js\"));\n\nvar _connectLayoutToPlot = _interopRequireDefault(__webpack_require__(/*! ./connectLayoutToPlot */ \"./node_modules/react-chart-editor/lib/lib/connectLayoutToPlot.js\"));\n\nvar _connectToContainer = _interopRequireWildcard(__webpack_require__(/*! ./connectToContainer */ \"./node_modules/react-chart-editor/lib/lib/connectToContainer.js\"));\n\nvar _computeTraceOptionsFromSchema = __webpack_require__(/*! ./computeTraceOptionsFromSchema */ \"./node_modules/react-chart-editor/lib/lib/computeTraceOptionsFromSchema.js\");\n\nvar _connectTraceToPlot = _interopRequireDefault(__webpack_require__(/*! ./connectTraceToPlot */ \"./node_modules/react-chart-editor/lib/lib/connectTraceToPlot.js\"));\n\nvar _dereference = _interopRequireDefault(__webpack_require__(/*! ./dereference */ \"./node_modules/react-chart-editor/lib/lib/dereference.js\"));\n\nvar _getAllAxes = _interopRequireWildcard(__webpack_require__(/*! ./getAllAxes */ \"./node_modules/react-chart-editor/lib/lib/getAllAxes.js\"));\n\nvar _localize = _interopRequireWildcard(__webpack_require__(/*! ./localize */ \"./node_modules/react-chart-editor/lib/lib/localize.js\"));\n\nvar _tinycolor = _interopRequireDefault(__webpack_require__(/*! tinycolor2 */ \"./node_modules/tinycolor2/tinycolor.js\"));\n\nvar _unpackPlotProps = _interopRequireWildcard(__webpack_require__(/*! ./unpackPlotProps */ \"./node_modules/react-chart-editor/lib/lib/unpackPlotProps.js\"));\n\nvar _walkObject = _interopRequireWildcard(__webpack_require__(/*! ./walkObject */ \"./node_modules/react-chart-editor/lib/lib/walkObject.js\"));\n\nvar _customTraceType = __webpack_require__(/*! ./customTraceType */ \"./node_modules/react-chart-editor/lib/lib/customTraceType.js\");\n\nvar PlotlyIcons = _interopRequireWildcard(__webpack_require__(/*! plotly-icons */ \"./node_modules/plotly-icons/lib/index.js\"));\n\nvar _striptags = _interopRequireDefault(__webpack_require__(/*! ./striptags */ \"./node_modules/react-chart-editor/lib/lib/striptags.js\"));\n\nvar _strings = __webpack_require__(/*! ./strings */ \"./node_modules/react-chart-editor/lib/lib/strings.js\");\n\nvar _reactColorscales = __webpack_require__(/*! react-colorscales */ \"./node_modules/react-colorscales/build/index.js\");\n\nvar _lib = __webpack_require__(/*! plotly.js/src/lib */ \"./node_modules/plotly.js/src/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar TOO_LIGHT_FACTOR = 0.8;\n\nfunction clamp(value, min, max) {\n return Math.max(min, Math.min(max, value));\n}\n\nfunction getDisplayName(WrappedComponent) {\n return WrappedComponent.displayName || WrappedComponent.name || 'Component';\n}\n\nfunction tooLight(color) {\n var hslColor = (0, _tinycolor.default)(color).toHsl();\n return hslColor.l > TOO_LIGHT_FACTOR;\n}\n\nfunction renderTraceIcon(trace) {\n var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'Plot';\n\n if (!trace) {\n return null;\n }\n\n var gl = 'gl';\n var componentName = \"\".concat(prefix).concat((0, _strings.pascalCase)(trace.endsWith(gl) ? trace.slice(0, -gl.length) : trace), \"Icon\");\n return PlotlyIcons[componentName] ? PlotlyIcons[componentName] : PlotlyIcons.PlotLineIcon;\n}\n\nfunction transpose(originalArray) {\n // if we want to transpose a uni dimensional array\n if (originalArray.every(function (a) {\n return !Array.isArray(a);\n })) {\n return originalArray.map(function (a) {\n return [a];\n });\n }\n\n var longestArrayItem = Array.isArray(originalArray[0]) ? originalArray[0].length : 1;\n originalArray.forEach(function (a) {\n // if it's not an array, it's a string\n var length = Array.isArray(a) ? a.length : 1;\n\n if (length > longestArrayItem) {\n longestArrayItem = length;\n }\n });\n var newArray = new Array(longestArrayItem);\n\n for (var outerIndex = 0; outerIndex < originalArray.length; outerIndex++) {\n if (!Array.isArray(originalArray[outerIndex])) {\n originalArray[outerIndex] = [originalArray[outerIndex]];\n }\n\n for (var innerIndex = 0; innerIndex < longestArrayItem; innerIndex++) {\n // ensure we have an array to push to\n if (!Array.isArray(newArray[innerIndex])) {\n newArray[innerIndex] = [];\n }\n\n var value = typeof originalArray[outerIndex][innerIndex] !== 'undefined' ? originalArray[outerIndex][innerIndex] : null;\n newArray[innerIndex].push(value);\n }\n }\n\n return newArray;\n}\n\nvar specialTableCase = function specialTableCase(traceType, srcAttributePath) {\n /* Just more user friendly\n * Table traces have many configuration options,\n * The below attributes can be 2d or 1d and will affect the plot differently\n * EX:\n * header.values = ['Jan', 'Feb', 'Mar'] => will put data in a row\n * header.values = [['Jan', 1], ['Feb', 2], ['Mar', 3]] => will create 3 columns\n * 1d arrays affect columns\n * 2d arrays affect rows within each column\n */\n return traceType === 'table' && ['header.valuessrc', 'header.font.colorsrc', 'header.font.sizesrc', 'header.fill.colorsrc', 'columnwidthsrc'].some(function (a) {\n return srcAttributePath.endsWith(a);\n });\n};\n\nfunction maybeTransposeData(data, srcAttributePath, traceType) {\n if (!data || Array.isArray(data) && data.length === 0) {\n return null;\n }\n\n var isTransposable2DArray = srcAttributePath.endsWith('zsrc') && ['contour', 'contourgl', 'heatmap', 'heatmapgl', 'surface', 'carpet', 'contourcarpet'].includes(traceType);\n\n if (isTransposable2DArray) {\n return transpose(data);\n }\n\n if (specialTableCase(traceType, srcAttributePath) && Array.isArray(data[0]) && data.length === 1) {\n return data[0];\n }\n\n return data;\n}\n\nfunction maybeAdjustSrc(src, srcAttributePath, traceType, config) {\n if (!src || Array.isArray(src) && src.length === 0) {\n return null;\n }\n\n if (specialTableCase(traceType, srcAttributePath) && src.length === 1) {\n return src[0];\n }\n\n return config && config.fromSrc ? config.fromSrc(src, traceType, srcAttributePath) : src;\n}\n\nfunction adjustColorscale(colorscale, numberOfNeededColors, colorscaleType, config) {\n if (config && config.repeat) {\n if (numberOfNeededColors < colorscale.length) {\n return colorscale.slice(0, numberOfNeededColors);\n }\n\n var repetitions = Math.ceil(numberOfNeededColors / colorscale.length);\n var newArray = new Array(repetitions).fill(colorscale);\n return newArray.reduce(function (a, b) {\n return a.concat(b);\n }, []).slice(0, numberOfNeededColors);\n }\n\n return (0, _reactColorscales.getColorscale)(colorscale, numberOfNeededColors, null, null, colorscaleType);\n}\n\nfunction getFullTrace(props, context) {\n var fullTrace = {};\n\n if (context.fullData && context.data) {\n if (props.fullDataArrayPosition) {\n // fullDataArrayPosition will be supplied in panels that have the canGroup prop\n fullTrace = context.fullData[props.fullDataArrayPosition[0]];\n } else {\n // for all other panels, we'll find fullTrace with the data index\n fullTrace = context.fullData.filter(function (t) {\n return t && props.traceIndexes[0] === t.index;\n })[0];\n } // For transformed traces, we actually want to read in _fullInput because\n // there's original parent information that's more useful to the user there\n // This is true except for fit transforms, where reading in fullData is\n // what we want\n\n\n if (fullTrace && fullTrace.transforms && !fullTrace.transforms.some(function (t) {\n return ['moving-average', 'fits'].includes(t.type);\n }) && !props.fullDataArrayPosition) {\n fullTrace = fullTrace._fullInput;\n }\n }\n\n return fullTrace;\n}\n\nfunction getParsedTemplateString(originalString, context) {\n var text = originalString;\n\n if (originalString && context) {\n text = (0, _lib.templateString)(originalString, context);\n }\n\n return text === '' && originalString ? originalString : text;\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/lib/index.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/lib/localize.js": /*!*************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/lib/localize.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = localize;\nexports.localizeString = localizeString;\n\nvar _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ \"./node_modules/prop-types/index.js\"));\n\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\n\nvar _ = __webpack_require__(/*! ./ */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction localize(Comp) {\n var LocalizedComponent = /*#__PURE__*/function (_Component) {\n _inherits(LocalizedComponent, _Component);\n\n var _super = _createSuper(LocalizedComponent);\n\n function LocalizedComponent(props, context) {\n var _this;\n\n _classCallCheck(this, LocalizedComponent);\n\n _this = _super.call(this, props, context);\n var dictionaries = context.dictionaries;\n var locale = context.locale;\n\n _this.localize = function localize(str) {\n return localizeString(dictionaries, locale, str);\n };\n\n return _this;\n }\n\n _createClass(LocalizedComponent, [{\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/_react.default.createElement(Comp, _extends({\n localize: this.localize\n }, this.props));\n }\n }]);\n\n return LocalizedComponent;\n }(_react.Component);\n\n LocalizedComponent.displayName = \"Localized\".concat((0, _.getDisplayName)(Comp));\n LocalizedComponent.contextTypes = LocalizedComponent.contextTypes || {};\n LocalizedComponent.contextTypes.dictionaries = _propTypes.default.object;\n LocalizedComponent.contextTypes.locale = _propTypes.default.string;\n LocalizedComponent.plotly_editor_traits = Comp.plotly_editor_traits;\n return LocalizedComponent;\n}\n\nfunction localizeString(dictionaries, locale, key) {\n var dict = dictionaries[locale];\n\n if (dict && dict.hasOwnProperty(key)) {\n return dict[key];\n }\n\n return key;\n}\n//# sourceMappingURL=localize.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/lib/localize.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/lib/multiValues.js": /*!****************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/lib/multiValues.js ***! \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.deepCopyPublic = deepCopyPublic;\nexports.setMultiValuedContainer = setMultiValuedContainer;\n\nvar _constants = __webpack_require__(/*! ./constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nvar _lib = __webpack_require__(/*! ../lib */ \"./node_modules/react-chart-editor/lib/lib/index.js\");\n\n/**\n * Deep-copies the value using JSON. Underscored (private) keys are removed.\n * @param {*} value Some nested value from the plotDiv object.\n * @returns {*} A deepcopy of the value.\n */\nfunction deepCopyPublic(value) {\n if (typeof value === 'undefined') {\n return value;\n }\n\n var skipPrivateKeys = function skipPrivateKeys(key, value) {\n return key.startsWith('_') ? 0 : value;\n };\n\n return window.JSON.parse(window.JSON.stringify(value, skipPrivateKeys));\n}\n/*\n * WARNING: When using this function, make intoObj and fromObject are copies of\n * your objects, so that no mutations occur\n */\n\n\nfunction setMultiValuedContainer(intoObj, fromObj, key) {\n var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n var intoVal = intoObj[key];\n var fromVal = fromObj[key]; // don't merge private attrs\n\n if (typeof key === 'string' && key.charAt(0) === '_' && key !== '_group' || typeof intoVal === 'function' || key === 'module') {\n return;\n } // already a mixture of values, can't get any worse\n\n\n if (intoVal === _constants.MULTI_VALUED) {\n return;\n } else if (intoVal === void 0) {\n // if the original doesn't have the key it's because that key\n // doesn't do anything there - so use the new value\n // note that if fromObj doesn't have a key in intoObj we will not\n // attempt to merge them at all, so this behavior makes the merge\n // independent of order.\n // WARNING: Careful that data copies were passed in as args here, as mutation can occur\n intoObj[key] = fromVal;\n } else if (key === 'colorscale') {\n // colorscales are arrays... need to stringify before comparing\n // (other vals we don't want to stringify, as differences could\n // potentially be real, like 'false' and false)\n if (String(intoVal) !== String(fromVal)) {\n intoObj[key] = _constants.MULTI_VALUED;\n }\n } else if (Array.isArray(intoVal)) {\n // in data, other arrays are data, which we don't care about\n // for styling purposes\n if (!config.searchArrays) {\n return;\n }\n\n if (!Array.isArray(fromVal)) {\n intoObj[key] = _constants.MULTI_VALUED;\n } else {\n // in layout though, we need to recurse into arrays\n for (var i = 0; i < fromVal.length; i++) {\n setMultiValuedContainer(intoVal, fromVal, i, config);\n }\n }\n } else if ((0, _lib.isPlainObject)(fromVal)) {\n // recurse into objects\n if (!(0, _lib.isPlainObject)(intoVal)) {\n throw new Error('tried to merge object into non-object: ' + key);\n }\n\n Object.keys(fromVal).forEach(function (key2) {\n setMultiValuedContainer(intoVal, fromVal, key2, config);\n });\n } else if ((0, _lib.isPlainObject)(intoVal)) {\n throw new Error('tried to merge non-object into object: ' + key);\n } else if (intoVal !== fromVal) {\n // different non-empty values -\n intoObj[key] = _constants.MULTI_VALUED;\n }\n}\n//# sourceMappingURL=multiValues.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/lib/multiValues.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/lib/sortMenu.js": /*!*************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/lib/sortMenu.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = sortMenu;\n\nfunction getUniqueValues(value, index, self) {\n return self.indexOf(value) === index;\n}\n\nfunction sortAlphabetically(a, b) {\n var sortByGroup = a.props.group === b.props.group ? 0 : a.props.group < b.props.group ? -1 : 1;\n var sortByName = a.props.name === b.props.name ? 0 : a.props.name < b.props.name ? -1 : 1;\n return sortByGroup || sortByName;\n}\n\nfunction sortMenu(children, order) {\n // Break out early if no order is provided\n if (!order) {\n return children;\n } // PART 1: only sorting panels (i.e. child with a group and name prop)\n // and not other elements (like Buttons, or Logo)\n\n\n var panelsStartIndex = null;\n var panelsEndIndex = null;\n\n for (var i = 0; i < children.length; i++) {\n if (children[i].props.group && children[i].props.name && !panelsStartIndex) {\n panelsStartIndex = i;\n break;\n }\n }\n\n for (var _i = panelsStartIndex; _i < children.length; _i++) {\n if (!children[_i].props.group && !children[_i].props.name && !panelsEndIndex) {\n panelsEndIndex = _i - 1;\n break;\n } else if (_i === children.length - 1) {\n panelsEndIndex = _i;\n }\n }\n\n var prePanelsChildren = panelsStartIndex === 0 ? [] : children.slice(0, panelsStartIndex);\n var panels = panelsStartIndex !== panelsEndIndex ? children.slice(panelsStartIndex, panelsEndIndex + 1) : [];\n var postPanelsChildren = panelsEndIndex === children.length ? [] : children.slice(panelsEndIndex + 1); // PART 2: validate order prop, if a desired panel specified in order, matches no actual panel rendered\n // in the panels array, it is excluded from ordering considerations\n // eslint-disable-next-line\n\n order = order.filter(function (desiredPanel) {\n return panels.some(function (actualPanel) {\n return actualPanel.props.name === desiredPanel.name && actualPanel.props.group === desiredPanel.group;\n });\n });\n var desiredGroupOrder = order.map(function (panel) {\n return panel.group;\n }).filter(getUniqueValues); // PART 3: Sort panels\n\n panels.sort(function (a, b) {\n var panelAHasGroupCustomOrder = desiredGroupOrder.includes(a.props.group);\n var panelBHasGroupCustomOrder = desiredGroupOrder.includes(b.props.group); // if one of the elements is not in the desiredGroupOrder array, then it goes to the end of the list\n\n if (panelAHasGroupCustomOrder && !panelBHasGroupCustomOrder) {\n return -1;\n }\n\n if (!panelAHasGroupCustomOrder && panelBHasGroupCustomOrder) {\n return 1;\n } // if both elements are not in the desiredGroupOrder array, they get sorted alphabetically,\n // by group, then by name\n\n\n if (!panelAHasGroupCustomOrder && !panelBHasGroupCustomOrder) {\n return sortAlphabetically(a, b);\n } // if both elements are in the desiredGroupOrder array, they get sorted according to their order in\n // the desiredGroupOrder, then desiredNameOrder arrays.\n\n\n if (panelAHasGroupCustomOrder && panelBHasGroupCustomOrder) {\n var indexOfGroupA = desiredGroupOrder.indexOf(a.props.group);\n var indexOfGroupB = desiredGroupOrder.indexOf(b.props.group);\n\n if (indexOfGroupA < indexOfGroupB) {\n return -1;\n }\n\n if (indexOfGroupA > indexOfGroupB) {\n return 1;\n }\n\n if (indexOfGroupA === indexOfGroupB) {\n // Since Subpanels names can be reused in different groups\n // we compute desired order here to get the desired index right.\n // We are filtering on unique values, just in case, even if we don't\n // have to because within a given group we'd assume that there will be\n // no 2 subpanels named the same.\n var desiredNameOrder = order.filter(function (panel) {\n return panel.group === a.props.group;\n }).map(function (panel) {\n return panel.name;\n }).filter(getUniqueValues);\n var panelAHasNameCustomOrder = desiredNameOrder.includes(a.props.name);\n var panelBHasNameCustomOrder = desiredNameOrder.includes(b.props.name);\n\n if (!panelAHasNameCustomOrder || !panelBHasNameCustomOrder) {\n if (panelAHasNameCustomOrder && !panelBHasNameCustomOrder) {\n return -1;\n }\n\n if (!panelAHasNameCustomOrder && panelBHasNameCustomOrder) {\n return 1;\n }\n\n if (!panelAHasNameCustomOrder && !panelBHasNameCustomOrder) {\n return sortAlphabetically(a, b);\n }\n }\n\n if (panelAHasNameCustomOrder && panelBHasNameCustomOrder) {\n return desiredNameOrder.indexOf(a.props.name) - desiredNameOrder.indexOf(b.props.name);\n }\n }\n }\n\n return 0;\n }); // PART 4: Return all children\n\n return prePanelsChildren.concat(panels).concat(postPanelsChildren);\n}\n//# sourceMappingURL=sortMenu.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/lib/sortMenu.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/lib/strings.js": /*!************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/lib/strings.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.capitalize = capitalize;\nexports.lowerCase = lowerCase;\nexports.upperCase = upperCase;\nexports.removeNonWord = removeNonWord;\nexports.camelCase = camelCase;\nexports.pascalCase = pascalCase;\n\n/*eslint-disable */\n\n/**\n * Capitalize string\n */\nfunction capitalize(s) {\n return !s ? '' : s.charAt(0).toUpperCase() + s.substring(1);\n}\n/**\n * \"Safer\" String.toLowerCase()\n */\n\n\nfunction lowerCase(str) {\n return str.toLowerCase();\n}\n/**\n * \"Safer\" String.toUpperCase()\n */\n\n\nfunction upperCase(str) {\n return str.toUpperCase();\n}\n/**\n * Remove non-word chars.\n */\n\n\nfunction removeNonWord(str) {\n return str.replace(/[^0-9a-zA-Z\\xC0-\\xFF \\-]/g, '');\n}\n/**\n * Convert string to camelCase text.\n */\n\n\nfunction camelCase(string) {\n return string.replace(/\\-/g, ' ').replace(/(\\d)(?=(\\d{1})+$)/g, '$1 ').replace(/\\s[a-z]/g, upperCase).replace(/\\s+/g, '').replace(/^[A-Z]/g, lowerCase);\n}\n\nfunction pascalCase(str) {\n return camelCase(str).replace(/^[a-z]/, upperCase);\n}\n/* eslint-enable */\n//# sourceMappingURL=strings.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/lib/strings.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/lib/striptags.js": /*!**************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/lib/striptags.js ***! \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/* eslint-disable */\n// The MIT License (MIT)\n//\n// Copyright (c) [2017] [Eric Norris]\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n // minimal symbol polyfill for IE11 and others\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nif (typeof _Symbol !== 'function') {\n var _Symbol = function _Symbol(name) {\n return name;\n };\n\n _Symbol.nonNative = true;\n}\n\nvar STATE_PLAINTEXT = _Symbol('plaintext');\n\nvar STATE_HTML = _Symbol('html');\n\nvar STATE_COMMENT = _Symbol('comment');\n\nvar ALLOWED_TAGS_REGEX = /<(\\w*)>/g;\nvar NORMALIZE_TAG_REGEX = /<\\/?([^\\s\\/>]+)/;\n\nfunction striptags(html, allowable_tags, tag_replacement) {\n html = html || '';\n allowable_tags = allowable_tags || [];\n tag_replacement = tag_replacement || '';\n var context = init_context(allowable_tags, tag_replacement);\n return striptags_internal(html, context);\n}\n\nfunction init_striptags_stream(allowable_tags, tag_replacement) {\n allowable_tags = allowable_tags || [];\n tag_replacement = tag_replacement || '';\n var context = init_context(allowable_tags, tag_replacement);\n return function striptags_stream(html) {\n return striptags_internal(html || '', context);\n };\n}\n\nstriptags.init_streaming_mode = init_striptags_stream;\n\nfunction init_context(allowable_tags, tag_replacement) {\n allowable_tags = parse_allowable_tags(allowable_tags);\n return {\n allowable_tags: allowable_tags,\n tag_replacement: tag_replacement,\n state: STATE_PLAINTEXT,\n tag_buffer: '',\n depth: 0,\n in_quote_char: ''\n };\n}\n\nfunction striptags_internal(html, context) {\n var allowable_tags = context.allowable_tags;\n var tag_replacement = context.tag_replacement;\n var state = context.state;\n var tag_buffer = context.tag_buffer;\n var depth = context.depth;\n var in_quote_char = context.in_quote_char;\n var output = '';\n\n for (var idx = 0, length = html.length; idx < length; idx++) {\n var char = html[idx];\n\n if (state === STATE_PLAINTEXT) {\n switch (char) {\n case '<':\n state = STATE_HTML;\n tag_buffer += char;\n break;\n\n default:\n output += char;\n break;\n }\n } else if (state === STATE_HTML) {\n switch (char) {\n case '<':\n // ignore '<' if inside a quote\n if (in_quote_char) {\n break;\n } // we're seeing a nested '<'\n\n\n depth++;\n break;\n\n case '>':\n // ignore '>' if inside a quote\n if (in_quote_char) {\n break;\n } // something like this is happening: '<<>>'\n\n\n if (depth) {\n depth--;\n break;\n } // this is closing the tag in tag_buffer\n\n\n in_quote_char = '';\n state = STATE_PLAINTEXT;\n tag_buffer += '>';\n\n if (allowable_tags.has(normalize_tag(tag_buffer))) {\n output += tag_buffer;\n } else {\n output += tag_replacement;\n }\n\n tag_buffer = '';\n break;\n\n case '\"':\n case \"'\":\n // catch both single and double quotes\n if (char === in_quote_char) {\n in_quote_char = '';\n } else {\n in_quote_char = in_quote_char || char;\n }\n\n tag_buffer += char;\n break;\n\n case '-':\n if (tag_buffer === '':\n if (tag_buffer.slice(-2) == '--') {\n // close the comment\n state = STATE_PLAINTEXT;\n }\n\n tag_buffer = '';\n break;\n\n default:\n tag_buffer += char;\n break;\n }\n }\n } // save the context for future iterations\n\n\n context.state = state;\n context.tag_buffer = tag_buffer;\n context.depth = depth;\n context.in_quote_char = in_quote_char;\n return output;\n}\n\nfunction parse_allowable_tags(allowable_tags) {\n var tag_set = new Set();\n\n if (typeof allowable_tags === 'string') {\n var match;\n\n while (match = ALLOWED_TAGS_REGEX.exec(allowable_tags)) {\n tag_set.add(match[1]);\n }\n } else if (!_Symbol.nonNative && typeof allowable_tags[_Symbol.iterator] === 'function') {\n tag_set = new Set(allowable_tags);\n } else if (typeof allowable_tags.forEach === 'function') {\n // IE11 compatible\n allowable_tags.forEach(tag_set.add, tag_set);\n }\n\n return tag_set;\n}\n\nfunction normalize_tag(tag_buffer) {\n var match = NORMALIZE_TAG_REGEX.exec(tag_buffer);\n return match ? match[1].toLowerCase() : null;\n}\n\nvar _default = striptags;\nexports.default = _default;\n//# sourceMappingURL=striptags.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/lib/striptags.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/lib/traceTypes.js": /*!***************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/lib/traceTypes.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.traceTypes = exports.categoryLayout = exports.chartCategory = void 0;\n\n/**\n * Trace type constants\n */\nvar chartCategory = function chartCategory(_) {\n return {\n SIMPLE: {\n value: 'SIMPLE',\n label: _('Simple')\n },\n FINANCIAL: {\n value: 'FINANCIAL',\n label: _('Finance'),\n maxColumns: 1\n },\n DISTRIBUTIONS: {\n value: 'DISTRIBUTIONS',\n label: _('Distributions')\n },\n MAPS: {\n value: 'MAPS',\n label: _('Maps'),\n maxColumns: 1\n },\n SPECIALIZED: {\n value: 'SPECIALIZED',\n label: _('Specialized'),\n maxColumns: 1\n },\n THREE_D: {\n value: '3D',\n label: _('3D'),\n maxColumns: 1\n },\n HIDDEN: {\n value: 'HIDDEN',\n label: ''\n }\n };\n}; // Layout specification for TraceTypeSelector.js\n\n\nexports.chartCategory = chartCategory;\n\nvar categoryLayout = function categoryLayout(_) {\n return [chartCategory(_).SIMPLE, chartCategory(_).DISTRIBUTIONS, chartCategory(_).THREE_D, chartCategory(_).MAPS, chartCategory(_).FINANCIAL, chartCategory(_).SPECIALIZED];\n};\n\nexports.categoryLayout = categoryLayout;\n\nvar traceTypes = function traceTypes(_) {\n return [{\n value: 'scatter',\n label: _('Scatter'),\n category: chartCategory(_).SIMPLE\n }, {\n value: 'bar',\n label: _('Bar'),\n category: chartCategory(_).SIMPLE\n }, {\n value: 'line',\n label: _('Line'),\n category: chartCategory(_).SIMPLE\n }, {\n value: 'area',\n label: _('Area'),\n category: chartCategory(_).SIMPLE\n }, {\n value: 'heatmap',\n label: _('Heatmap'),\n category: chartCategory(_).SIMPLE\n }, {\n value: 'table',\n label: _('Table'),\n category: chartCategory(_).SIMPLE\n }, {\n value: 'contour',\n label: _('Contour'),\n category: chartCategory(_).SIMPLE\n }, {\n value: 'pie',\n label: _('Pie'),\n category: chartCategory(_).SIMPLE\n }, {\n value: 'scatter3d',\n label: _('3D Scatter'),\n category: chartCategory(_).THREE_D\n }, {\n value: 'line3d',\n label: _('3D Line'),\n category: chartCategory(_).THREE_D\n }, {\n value: 'surface',\n label: _('3D Surface'),\n category: chartCategory(_).THREE_D\n }, {\n value: 'mesh3d',\n label: _('3D Mesh'),\n category: chartCategory(_).THREE_D\n }, {\n value: 'cone',\n label: _('Cone'),\n category: chartCategory(_).THREE_D\n }, {\n value: 'streamtube',\n label: _('Streamtube'),\n category: chartCategory(_).THREE_D\n }, {\n value: 'box',\n label: _('Box'),\n category: chartCategory(_).DISTRIBUTIONS\n }, {\n value: 'violin',\n label: _('Violin'),\n category: chartCategory(_).DISTRIBUTIONS\n }, {\n value: 'histogram',\n label: _('Histogram'),\n category: chartCategory(_).DISTRIBUTIONS\n }, {\n value: 'histogram2d',\n label: _('2D Histogram'),\n category: chartCategory(_).DISTRIBUTIONS\n }, {\n value: 'histogram2dcontour',\n label: _('2D Contour Histogram'),\n category: chartCategory(_).DISTRIBUTIONS\n }, {\n value: 'scattermapbox',\n label: _('Tile Map'),\n category: chartCategory(_).MAPS\n }, {\n value: 'scattergeo',\n label: _('Atlas Map'),\n category: chartCategory(_).MAPS\n }, {\n value: 'choroplethmapbox',\n label: _('Choropleth Tile Map'),\n category: chartCategory(_).MAPS\n }, {\n value: 'choropleth',\n label: _('Choropleth Atlas Map'),\n category: chartCategory(_).MAPS\n }, {\n value: 'densitymapbox',\n label: _('Density Tile Map'),\n category: chartCategory(_).MAPS\n }, {\n value: 'scatterpolar',\n label: _('Polar Scatter'),\n category: chartCategory(_).SPECIALIZED\n }, {\n value: 'barpolar',\n label: _('Polar Bar'),\n category: chartCategory(_).SPECIALIZED\n }, {\n value: 'scatterternary',\n label: _('Ternary Scatter'),\n category: chartCategory(_).SPECIALIZED\n }, {\n value: 'sunburst',\n label: _('Sunburst'),\n category: chartCategory(_).SPECIALIZED\n }, {\n value: 'treemap',\n label: _('Treemap'),\n category: chartCategory(_).SPECIALIZED\n }, {\n value: 'sankey',\n label: _('Sankey'),\n category: chartCategory(_).SPECIALIZED\n }, {\n value: 'candlestick',\n label: _('Candlestick'),\n category: chartCategory(_).FINANCIAL\n }, {\n value: 'ohlc',\n label: _('OHLC'),\n category: chartCategory(_).FINANCIAL\n }, {\n value: 'waterfall',\n label: _('Waterfall'),\n category: chartCategory(_).FINANCIAL\n }, {\n value: 'funnel',\n label: _('Funnel'),\n category: chartCategory(_).FINANCIAL\n }, {\n value: 'funnelarea',\n label: _('Funnel Area'),\n category: chartCategory(_).FINANCIAL\n }, {\n value: 'scattergl',\n icon: 'scatter',\n label: _('Scatter'),\n category: chartCategory(_).THREE_D\n }, {\n value: 'scatterpolargl',\n icon: 'scatterpolar',\n label: _('Polar Scatter'),\n category: chartCategory(_).THREE_D\n }, {\n value: 'heatmapgl',\n icon: 'heatmap',\n label: _('Heatmap GL'),\n category: chartCategory(_).HIDDEN\n }, {\n value: 'pointcloud',\n label: _('Point Cloud'),\n category: chartCategory(_).HIDDEN\n }, {\n value: 'parcoords',\n label: _('Parallel Coordinates'),\n category: chartCategory(_).HIDDEN\n }, {\n value: 'parcats',\n label: _('Parallel Categories'),\n category: chartCategory(_).HIDDEN\n }, {\n value: 'splom',\n label: _('Scatterplot Matrix'),\n category: chartCategory(_).HIDDEN\n }, {\n value: 'scattercarpet',\n label: _('Scatter Carpet'),\n category: chartCategory(_).HIDDEN\n }, {\n value: 'contourcarpet',\n label: _('Contour Carpet'),\n category: chartCategory(_).HIDDEN\n }, {\n value: 'carpet',\n label: _('Carpet'),\n category: chartCategory(_).HIDDEN\n }, {\n value: 'isosurface',\n label: _('Isosurface'),\n category: chartCategory(_).HIDDEN\n }];\n};\n\nexports.traceTypes = traceTypes;\n//# sourceMappingURL=traceTypes.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/lib/traceTypes.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/lib/unpackPlotProps.js": /*!********************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/lib/unpackPlotProps.js ***! \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.hasValidCustomConfigVisibilityRules = hasValidCustomConfigVisibilityRules;\nexports.computeCustomConfigVisibility = computeCustomConfigVisibility;\nexports.isVisibleGivenCustomConfig = isVisibleGivenCustomConfig;\nexports.default = unpackPlotProps;\n\nvar _nested_property = _interopRequireDefault(__webpack_require__(/*! plotly.js/src/lib/nested_property */ \"./node_modules/plotly.js/src/lib/nested_property.js\"));\n\nvar _fastIsnumeric = _interopRequireDefault(__webpack_require__(/*! fast-isnumeric */ \"./node_modules/fast-isnumeric/index.js\"));\n\nvar _constants = __webpack_require__(/*! ./constants */ \"./node_modules/react-chart-editor/lib/lib/constants.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar hasFullValue = function hasFullValue(fullValue) {\n return fullValue !== void 0 && fullValue !== null;\n};\n\nfunction hasValidCustomConfigVisibilityRules(customConfig) {\n if (customConfig && customConfig === Object(customConfig) && Object.keys(customConfig).length && customConfig.visibility_rules) {\n if (customConfig.visibility_rules.blacklist && customConfig.visibility_rules.whitelist) {\n console.error('customConfig.visibility_rules can have a blacklist OR whitelist key, both are present in your config.');\n return false;\n }\n\n if (!Object.keys(customConfig.visibility_rules).some(function (key) {\n return ['blacklist', 'whitelist'].includes(key);\n })) {\n console.error('customConfig.visibility_rules must have at least a blacklist or whitelist key.');\n return false;\n }\n\n var isValidRule = function isValidRule(rule) {\n if (rule.exceptions) {\n return rule.exceptions.every(isValidRule);\n }\n\n return rule.type && ['attrName', 'controlType'].includes(rule.type) && rule.regex_match;\n };\n\n var errorMessage = \"All rules and exceptions must have a type (one of: 'attrName' or 'controlType') and regex_match key.\";\n\n if (customConfig.visibility_rules.blacklist && !customConfig.visibility_rules.blacklist.every(isValidRule)) {\n console.error(errorMessage);\n return false;\n }\n\n if (customConfig.visibility_rules.whitelist && !customConfig.visibility_rules.whitelist.every(isValidRule)) {\n console.error(errorMessage);\n return false;\n }\n\n return true;\n }\n\n return false;\n}\n\nfunction computeCustomConfigVisibility(props, customConfig, wrappedComponentDisplayName) {\n var isVisible;\n\n var isRegexMatch = function isRegexMatch(rule) {\n var stringToTest = rule.type === 'attrName' ? props.attr : wrappedComponentDisplayName;\n return RegExp(rule.regex_match).test(stringToTest);\n };\n\n var passesTest = function passesTest(rule) {\n var hasException = function hasException(rule) {\n if (rule.exceptions) {\n return rule.exceptions.some(function (exception) {\n return passesTest(exception);\n });\n }\n\n return false;\n };\n\n return isRegexMatch(rule) && !hasException(rule);\n };\n\n if (customConfig.visibility_rules.blacklist) {\n isVisible = !customConfig.visibility_rules.blacklist.some(passesTest);\n }\n\n if (customConfig.visibility_rules.whitelist) {\n isVisible = customConfig.visibility_rules.whitelist.some(passesTest);\n }\n\n return isVisible;\n}\n\nfunction isVisibleGivenCustomConfig(initial, nextProps, nextContext, componentDisplayName) {\n var show = initial;\n\n if (show && nextContext.hasValidCustomConfigVisibilityRules) {\n show = computeCustomConfigVisibility(nextProps, nextContext.customConfig, componentDisplayName);\n }\n\n return show;\n}\n\nfunction unpackPlotProps(props, context) {\n var container = context.container,\n getValObject = context.getValObject,\n defaultContainer = context.defaultContainer,\n updateContainer = context.updateContainer;\n\n if (!props.attr) {\n return {};\n }\n\n var attrMeta;\n\n if (getValObject) {\n attrMeta = context.getValObject(props.attr) || {};\n }\n\n var fullContainer = context.fullContainer;\n var fullProperty = (0, _nested_property.default)(fullContainer, props.attr);\n var fullValue = fullProperty.get();\n var multiValued = false; // MULTI_VALUED consists of a control sequence that cannot be confused with\n // user data. We must transform it into something that can be displayed as\n // the screen.\n\n if (fullValue === _constants.MULTI_VALUED) {\n fullValue = _constants.MULTI_VALUED_PLACEHOLDER;\n multiValued = true;\n }\n\n var isVisible = Boolean(hasFullValue(fullValue) || props.show);\n var defaultValue = props.defaultValue;\n\n if (defaultValue === void 0 && defaultContainer) {\n defaultValue = (0, _nested_property.default)(defaultContainer, props.attr).get();\n }\n\n var min, max, description;\n\n if (attrMeta) {\n if ((0, _fastIsnumeric.default)(attrMeta.max)) {\n max = attrMeta.max;\n }\n\n if ((0, _fastIsnumeric.default)(attrMeta.min)) {\n min = attrMeta.min;\n }\n\n description = attrMeta.description;\n }\n\n var updatePlot = function updatePlot(v) {\n if (updateContainer) {\n updateContainer(_defineProperty({}, props.attr, v));\n }\n };\n\n return {\n attrMeta: attrMeta,\n container: container,\n defaultValue: defaultValue,\n fullContainer: fullContainer,\n fullValue: fullValue,\n getValObject: getValObject,\n isVisible: isVisible,\n max: max,\n min: min,\n description: description,\n multiValued: multiValued,\n updateContainer: updateContainer,\n updatePlot: updatePlot\n };\n}\n//# sourceMappingURL=unpackPlotProps.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/lib/unpackPlotProps.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/lib/walkObject.js": /*!***************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/lib/walkObject.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isPlainObject = isPlainObject;\nexports.makeAttrSetterPath = makeAttrSetterPath;\nexports.default = walkObject;\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction isPlainObject(input) {\n return input && !Array.isArray(input) && _typeof(input) === 'object';\n}\n/*\n * Helper function for _walkObject\n */\n\n\nfunction doArrayWalk(key, value, walkArrays, walkArraysMatchingKeys) {\n if (!Array.isArray(value)) {\n return false;\n }\n\n if (walkArrays || walkArraysMatchingKeys && walkArraysMatchingKeys.includes(key)) {\n return true;\n }\n\n return false;\n}\n/*\n * Helper utility for path accumulation in _walkObject. Supports array\n * path accumulation and also Plotly.js nestedProperty style.\n */\n\n\nfunction getPath() {\n var pathType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'array';\n\n var _path = arguments.length > 1 ? arguments[1] : undefined;\n\n return {\n _path: _path || (pathType === 'array' ? [] : ''),\n set: function set(parent, key) {\n var nextPath;\n\n switch (pathType) {\n case 'array':\n nextPath = this._path.concat([key]);\n break;\n\n case 'nestedProperty':\n if (this._path.length === 0) {\n nextPath = key;\n } else if (Array.isArray(parent)) {\n nextPath = this._path + \"[\".concat(key, \"]\");\n } else {\n nextPath = this._path + '.' + key;\n }\n\n break;\n\n default:\n throw new Error('unrecognized pathType ' + pathType);\n }\n\n return getPath(pathType, nextPath);\n },\n get: function get(parent, key) {\n // in array mode we do not return the leaf node key.\n if (pathType === 'array') {\n return this._path;\n } // in nestedProperty mode we return full path including final key\n\n\n return this.set(parent, key)._path;\n }\n };\n}\n/*\n * Helper function that transforms an array of path parts into a single path.\n * For example:\n *\n * ['_fullData', 0, 'transforms', 3, 'type'] => 'transforms[3].type'\n *\n * Note that it strips out the _fullData part (and also _fullInput) since that's\n * usually present in the attribute path but isn't necessary in the attribute\n * string since it's usually implicitly applied through the userDataIndex.\n */\n\n\nfunction makeAttrSetterPath(parts) {\n var path = ''; // Truncate the leading parts that aren't intersting when applying changes:\n\n var i0 = 0;\n\n if (parts[i0] === '_fullData') {\n i0 += 2;\n }\n\n if (parts[i0] === '_fullInput') {\n i0++;\n }\n\n if (parts[i0] === '_fullLayout') {\n i0++;\n }\n\n for (var i = i0; i < parts.length; i++) {\n if (typeof parts[i] === 'number' || Array.isArray(parts[i])) {\n path += '[' + (Array.isArray(parts[i]) ? parts[i][0] : parts[i]) + ']';\n } else {\n path += (i > i0 ? '.' : '') + parts[i];\n }\n }\n\n return path;\n}\n/**\n * The function that walkObject calls at each node.\n *\n * @callback walkObjectCallback\n * @param {string|number} key The current key, which may be nested.\n * @param {object} parent The object which owns the 'key' as a prop.\n * @param {Array} path The keys that lead to the 'parent' object.\n * @returns {boolean} True if the value at 'key' should *not* be traversed into\n * if it happens to be an object. I.e., you don't need to\n * return anything if you want the default traversal of the\n * whole object.\n */\n\n/**\n * Walks through object and recurses if necessary.\n *\n * @param {object} object The top-level or nested object we're walking through.\n * @param {walkObjectCallback} callback Called at each object node.\n * @param {Array} path The keys that lead from to top-level object to this one.\n * @param {object} config configuration object\n * @param {string} config.walkArrays flag allowing array walking\n * @param {Array} config.walkArraysMatchingKeys An array of keys permitting\n * array walking\n * @param {string} config.pathType Either 'array' or 'nestedProperty'. Array\n * based paths return string keys in an array up\n * until the current key position.\n * NestedProperty style returns a single\n * concatenated \"nestedProperty\" style string.\n * @returns {void}\n * @private\n */\n\n\nfunction _walkObject(object, callback, path, config) {\n var walkArrays = config.walkArrays,\n walkArraysMatchingKeys = config.walkArraysMatchingKeys;\n Object.keys(object).forEach(function (key) {\n // Callback can force traversal to stop by returning `true`.\n if (callback(key, object, path.get(object, key))) {\n return;\n }\n\n var value = object[key];\n\n if (isPlainObject(value) || doArrayWalk(key, value, walkArrays, walkArraysMatchingKeys)) {\n _walkObject(value, callback, path.set(object, key), config);\n }\n });\n}\n/**\n * General function to walk object and call the given callback for each node.\n *\n * @param {Object|Array} input The object or array we want to walk.\n * @param {walkObjectCallback} callback Called at each object node.\n * @param {Object} [config] configuration object\n * @param {Boolean} [config.walkArrays] flag allowing array walking\n * @param {Array} [config.walkArraysMatchingKeys] An array of keys permitting\n * array walking\n * @param {String} [config.pathType] Either 'array' or 'nestedProperty'. Array\n * based paths return string keys in an array\n * up until the current key position.\n * NestedProperty style returns a single\n * concatenated \"nestedProperty\" style string\n * with the current key included in the path.\n * Defaults to \"array\"\n * @returns {void}\n */\n\n\nfunction walkObject(input, callback) {\n var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n if (!isPlainObject(input) && !Array.isArray(input)) {\n throw new Error('The input must be an object.');\n }\n\n var path = getPath(config.pathType);\n\n _walkObject(input, callback, path, config);\n}\n//# sourceMappingURL=walkObject.js.map\n\n//# sourceURL=webpack:///./node_modules/react-chart-editor/lib/lib/walkObject.js?"); /***/ }), /***/ "./node_modules/react-chart-editor/lib/react-chart-editor.min.css": /*!************************************************************************!*\ !*** ./node_modules/react-chart-editor/lib/react-chart-editor.min.css ***! \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("// style-loader: Adds some css to the DOM by adding a \";\n };\n\n this.getStyleTags = function () {\n if (_this.sealed) {\n return throwStyledComponentsError(2);\n }\n\n return _this._emitSheetCSS();\n };\n\n this.getStyleElement = function () {\n var _props;\n\n if (_this.sealed) {\n return throwStyledComponentsError(2);\n }\n\n var props = (_props = {}, _props[SC_ATTR] = '', _props[SC_ATTR_VERSION] = SC_VERSION, _props.dangerouslySetInnerHTML = {\n __html: _this.instance.toString()\n }, _props);\n var nonce = getNonce();\n\n if (nonce) {\n props.nonce = nonce;\n } // v4 returned an array for this fn, so we'll do the same for v5 for backward compat\n\n\n return [/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"style\", _extends({}, props, {\n key: \"sc-0-0\"\n }))];\n };\n\n this.seal = function () {\n _this.sealed = true;\n };\n\n this.instance = new StyleSheet({\n isServer: true\n });\n this.sealed = false;\n }\n\n var _proto = ServerStyleSheet.prototype;\n\n _proto.collectStyles = function collectStyles(children) {\n if (this.sealed) {\n return throwStyledComponentsError(2);\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(StyleSheetManager, {\n sheet: this.instance\n }, children);\n };\n\n // eslint-disable-next-line consistent-return\n _proto.interleaveWithNodeStream = function interleaveWithNodeStream(input) {\n {\n return throwStyledComponentsError(3);\n }\n };\n\n return ServerStyleSheet;\n}();\n\n// export default (\n// Component: AbstractComponent\n// ): AbstractComponent<$Diff & { theme?: any }, Instance>\n//\n// but the old build system tooling doesn't support the syntax\n\nvar withTheme = (function (Component) {\n // $FlowFixMe This should be React.forwardRef\n var WithTheme = react__WEBPACK_IMPORTED_MODULE_1___default.a.forwardRef(function (props, ref) {\n var theme = Object(react__WEBPACK_IMPORTED_MODULE_1__[\"useContext\"])(ThemeContext); // $FlowFixMe defaultProps isn't declared so it can be inferrable\n\n var defaultProps = Component.defaultProps;\n var themeProp = determineTheme(props, theme, defaultProps);\n\n if ( true && themeProp === undefined) {\n // eslint-disable-next-line no-console\n console.warn(\"[withTheme] You are not using a ThemeProvider nor passing a theme prop or a theme in defaultProps in component class \\\"\" + getComponentName(Component) + \"\\\"\");\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(Component, _extends({}, props, {\n theme: themeProp,\n ref: ref\n }));\n });\n hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_6___default()(WithTheme, Component);\n WithTheme.displayName = \"WithTheme(\" + getComponentName(Component) + \")\";\n return WithTheme;\n});\n\n// \n\nvar useTheme = function useTheme() {\n return Object(react__WEBPACK_IMPORTED_MODULE_1__[\"useContext\"])(ThemeContext);\n};\n\n// \nvar __PRIVATE__ = {\n StyleSheet: StyleSheet,\n masterSheet: masterSheet\n};\n\n// \n/* Define bundle version for export */\n\nvar version = \"5.1.1\";\n/* Warning if you've imported this file on React Native */\n\nif ( true && typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {\n // eslint-disable-next-line no-console\n console.warn(\"It looks like you've imported 'styled-components' on React Native.\\n\" + \"Perhaps you're looking to import 'styled-components/native'?\\n\" + 'Read more about this at https://www.styled-components.com/docs/basics#react-native');\n}\n/* Warning if there are several instances of styled-components */\n\n\nif ( true && typeof window !== 'undefined') {\n window['__styled-components-init__'] = window['__styled-components-init__'] || 0;\n\n if (window['__styled-components-init__'] === 1) {\n // eslint-disable-next-line no-console\n console.warn(\"It looks like there are several instances of 'styled-components' initialized in this application. \" + 'This may cause dynamic styles not rendering properly, errors happening during rehydration process, ' + 'missing theme prop, and makes your application bigger without a good reason.\\n\\n' + 'See https://s-c.sh/2BAXzed for more info.');\n }\n\n window['__styled-components-init__'] += 1;\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (styled);\n\n//# sourceMappingURL=styled-components.browser.esm.js.map\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/mock/process.js */ \"./node_modules/node-libs-browser/mock/process.js\")))\n\n//# sourceURL=webpack:///./node_modules/styled-components/dist/styled-components.browser.esm.js?"); /***/ }), /***/ "./node_modules/styled-components/node_modules/@emotion/stylis/dist/stylis.browser.esm.js": /*!************************************************************************************************!*\ !*** ./node_modules/styled-components/node_modules/@emotion/stylis/dist/stylis.browser.esm.js ***! \************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\nfunction stylis_min (W) {\n function M(d, c, e, h, a) {\n for (var m = 0, b = 0, v = 0, n = 0, q, g, x = 0, K = 0, k, u = k = q = 0, l = 0, r = 0, I = 0, t = 0, B = e.length, J = B - 1, y, f = '', p = '', F = '', G = '', C; l < B;) {\n g = e.charCodeAt(l);\n l === J && 0 !== b + n + v + m && (0 !== b && (g = 47 === b ? 10 : 47), n = v = m = 0, B++, J++);\n\n if (0 === b + n + v + m) {\n if (l === J && (0 < r && (f = f.replace(N, '')), 0 < f.trim().length)) {\n switch (g) {\n case 32:\n case 9:\n case 59:\n case 13:\n case 10:\n break;\n\n default:\n f += e.charAt(l);\n }\n\n g = 59;\n }\n\n switch (g) {\n case 123:\n f = f.trim();\n q = f.charCodeAt(0);\n k = 1;\n\n for (t = ++l; l < B;) {\n switch (g = e.charCodeAt(l)) {\n case 123:\n k++;\n break;\n\n case 125:\n k--;\n break;\n\n case 47:\n switch (g = e.charCodeAt(l + 1)) {\n case 42:\n case 47:\n a: {\n for (u = l + 1; u < J; ++u) {\n switch (e.charCodeAt(u)) {\n case 47:\n if (42 === g && 42 === e.charCodeAt(u - 1) && l + 2 !== u) {\n l = u + 1;\n break a;\n }\n\n break;\n\n case 10:\n if (47 === g) {\n l = u + 1;\n break a;\n }\n\n }\n }\n\n l = u;\n }\n\n }\n\n break;\n\n case 91:\n g++;\n\n case 40:\n g++;\n\n case 34:\n case 39:\n for (; l++ < J && e.charCodeAt(l) !== g;) {\n }\n\n }\n\n if (0 === k) break;\n l++;\n }\n\n k = e.substring(t, l);\n 0 === q && (q = (f = f.replace(ca, '').trim()).charCodeAt(0));\n\n switch (q) {\n case 64:\n 0 < r && (f = f.replace(N, ''));\n g = f.charCodeAt(1);\n\n switch (g) {\n case 100:\n case 109:\n case 115:\n case 45:\n r = c;\n break;\n\n default:\n r = O;\n }\n\n k = M(c, r, k, g, a + 1);\n t = k.length;\n 0 < A && (r = X(O, f, I), C = H(3, k, r, c, D, z, t, g, a, h), f = r.join(''), void 0 !== C && 0 === (t = (k = C.trim()).length) && (g = 0, k = ''));\n if (0 < t) switch (g) {\n case 115:\n f = f.replace(da, ea);\n\n case 100:\n case 109:\n case 45:\n k = f + '{' + k + '}';\n break;\n\n case 107:\n f = f.replace(fa, '$1 $2');\n k = f + '{' + k + '}';\n k = 1 === w || 2 === w && L('@' + k, 3) ? '@-webkit-' + k + '@' + k : '@' + k;\n break;\n\n default:\n k = f + k, 112 === h && (k = (p += k, ''));\n } else k = '';\n break;\n\n default:\n k = M(c, X(c, f, I), k, h, a + 1);\n }\n\n F += k;\n k = I = r = u = q = 0;\n f = '';\n g = e.charCodeAt(++l);\n break;\n\n case 125:\n case 59:\n f = (0 < r ? f.replace(N, '') : f).trim();\n if (1 < (t = f.length)) switch (0 === u && (q = f.charCodeAt(0), 45 === q || 96 < q && 123 > q) && (t = (f = f.replace(' ', ':')).length), 0 < A && void 0 !== (C = H(1, f, c, d, D, z, p.length, h, a, h)) && 0 === (t = (f = C.trim()).length) && (f = '\\x00\\x00'), q = f.charCodeAt(0), g = f.charCodeAt(1), q) {\n case 0:\n break;\n\n case 64:\n if (105 === g || 99 === g) {\n G += f + e.charAt(l);\n break;\n }\n\n default:\n 58 !== f.charCodeAt(t - 1) && (p += P(f, q, g, f.charCodeAt(2)));\n }\n I = r = u = q = 0;\n f = '';\n g = e.charCodeAt(++l);\n }\n }\n\n switch (g) {\n case 13:\n case 10:\n 47 === b ? b = 0 : 0 === 1 + q && 107 !== h && 0 < f.length && (r = 1, f += '\\x00');\n 0 < A * Y && H(0, f, c, d, D, z, p.length, h, a, h);\n z = 1;\n D++;\n break;\n\n case 59:\n case 125:\n if (0 === b + n + v + m) {\n z++;\n break;\n }\n\n default:\n z++;\n y = e.charAt(l);\n\n switch (g) {\n case 9:\n case 32:\n if (0 === n + m + b) switch (x) {\n case 44:\n case 58:\n case 9:\n case 32:\n y = '';\n break;\n\n default:\n 32 !== g && (y = ' ');\n }\n break;\n\n case 0:\n y = '\\\\0';\n break;\n\n case 12:\n y = '\\\\f';\n break;\n\n case 11:\n y = '\\\\v';\n break;\n\n case 38:\n 0 === n + b + m && (r = I = 1, y = '\\f' + y);\n break;\n\n case 108:\n if (0 === n + b + m + E && 0 < u) switch (l - u) {\n case 2:\n 112 === x && 58 === e.charCodeAt(l - 3) && (E = x);\n\n case 8:\n 111 === K && (E = K);\n }\n break;\n\n case 58:\n 0 === n + b + m && (u = l);\n break;\n\n case 44:\n 0 === b + v + n + m && (r = 1, y += '\\r');\n break;\n\n case 34:\n case 39:\n 0 === b && (n = n === g ? 0 : 0 === n ? g : n);\n break;\n\n case 91:\n 0 === n + b + v && m++;\n break;\n\n case 93:\n 0 === n + b + v && m--;\n break;\n\n case 41:\n 0 === n + b + m && v--;\n break;\n\n case 40:\n if (0 === n + b + m) {\n if (0 === q) switch (2 * x + 3 * K) {\n case 533:\n break;\n\n default:\n q = 1;\n }\n v++;\n }\n\n break;\n\n case 64:\n 0 === b + v + n + m + u + k && (k = 1);\n break;\n\n case 42:\n case 47:\n if (!(0 < n + m + v)) switch (b) {\n case 0:\n switch (2 * g + 3 * e.charCodeAt(l + 1)) {\n case 235:\n b = 47;\n break;\n\n case 220:\n t = l, b = 42;\n }\n\n break;\n\n case 42:\n 47 === g && 42 === x && t + 2 !== l && (33 === e.charCodeAt(t + 2) && (p += e.substring(t, l + 1)), y = '', b = 0);\n }\n }\n\n 0 === b && (f += y);\n }\n\n K = x;\n x = g;\n l++;\n }\n\n t = p.length;\n\n if (0 < t) {\n r = c;\n if (0 < A && (C = H(2, p, r, d, D, z, t, h, a, h), void 0 !== C && 0 === (p = C).length)) return G + p + F;\n p = r.join(',') + '{' + p + '}';\n\n if (0 !== w * E) {\n 2 !== w || L(p, 2) || (E = 0);\n\n switch (E) {\n case 111:\n p = p.replace(ha, ':-moz-$1') + p;\n break;\n\n case 112:\n p = p.replace(Q, '::-webkit-input-$1') + p.replace(Q, '::-moz-$1') + p.replace(Q, ':-ms-input-$1') + p;\n }\n\n E = 0;\n }\n }\n\n return G + p + F;\n }\n\n function X(d, c, e) {\n var h = c.trim().split(ia);\n c = h;\n var a = h.length,\n m = d.length;\n\n switch (m) {\n case 0:\n case 1:\n var b = 0;\n\n for (d = 0 === m ? '' : d[0] + ' '; b < a; ++b) {\n c[b] = Z(d, c[b], e).trim();\n }\n\n break;\n\n default:\n var v = b = 0;\n\n for (c = []; b < a; ++b) {\n for (var n = 0; n < m; ++n) {\n c[v++] = Z(d[n] + ' ', h[b], e).trim();\n }\n }\n\n }\n\n return c;\n }\n\n function Z(d, c, e) {\n var h = c.charCodeAt(0);\n 33 > h && (h = (c = c.trim()).charCodeAt(0));\n\n switch (h) {\n case 38:\n return c.replace(F, '$1' + d.trim());\n\n case 58:\n return d.trim() + c.replace(F, '$1' + d.trim());\n\n default:\n if (0 < 1 * e && 0 < c.indexOf('\\f')) return c.replace(F, (58 === d.charCodeAt(0) ? '' : '$1') + d.trim());\n }\n\n return d + c;\n }\n\n function P(d, c, e, h) {\n var a = d + ';',\n m = 2 * c + 3 * e + 4 * h;\n\n if (944 === m) {\n d = a.indexOf(':', 9) + 1;\n var b = a.substring(d, a.length - 1).trim();\n b = a.substring(0, d).trim() + b + ';';\n return 1 === w || 2 === w && L(b, 1) ? '-webkit-' + b + b : b;\n }\n\n if (0 === w || 2 === w && !L(a, 1)) return a;\n\n switch (m) {\n case 1015:\n return 97 === a.charCodeAt(10) ? '-webkit-' + a + a : a;\n\n case 951:\n return 116 === a.charCodeAt(3) ? '-webkit-' + a + a : a;\n\n case 963:\n return 110 === a.charCodeAt(5) ? '-webkit-' + a + a : a;\n\n case 1009:\n if (100 !== a.charCodeAt(4)) break;\n\n case 969:\n case 942:\n return '-webkit-' + a + a;\n\n case 978:\n return '-webkit-' + a + '-moz-' + a + a;\n\n case 1019:\n case 983:\n return '-webkit-' + a + '-moz-' + a + '-ms-' + a + a;\n\n case 883:\n if (45 === a.charCodeAt(8)) return '-webkit-' + a + a;\n if (0 < a.indexOf('image-set(', 11)) return a.replace(ja, '$1-webkit-$2') + a;\n break;\n\n case 932:\n if (45 === a.charCodeAt(4)) switch (a.charCodeAt(5)) {\n case 103:\n return '-webkit-box-' + a.replace('-grow', '') + '-webkit-' + a + '-ms-' + a.replace('grow', 'positive') + a;\n\n case 115:\n return '-webkit-' + a + '-ms-' + a.replace('shrink', 'negative') + a;\n\n case 98:\n return '-webkit-' + a + '-ms-' + a.replace('basis', 'preferred-size') + a;\n }\n return '-webkit-' + a + '-ms-' + a + a;\n\n case 964:\n return '-webkit-' + a + '-ms-flex-' + a + a;\n\n case 1023:\n if (99 !== a.charCodeAt(8)) break;\n b = a.substring(a.indexOf(':', 15)).replace('flex-', '').replace('space-between', 'justify');\n return '-webkit-box-pack' + b + '-webkit-' + a + '-ms-flex-pack' + b + a;\n\n case 1005:\n return ka.test(a) ? a.replace(aa, ':-webkit-') + a.replace(aa, ':-moz-') + a : a;\n\n case 1e3:\n b = a.substring(13).trim();\n c = b.indexOf('-') + 1;\n\n switch (b.charCodeAt(0) + b.charCodeAt(c)) {\n case 226:\n b = a.replace(G, 'tb');\n break;\n\n case 232:\n b = a.replace(G, 'tb-rl');\n break;\n\n case 220:\n b = a.replace(G, 'lr');\n break;\n\n default:\n return a;\n }\n\n return '-webkit-' + a + '-ms-' + b + a;\n\n case 1017:\n if (-1 === a.indexOf('sticky', 9)) break;\n\n case 975:\n c = (a = d).length - 10;\n b = (33 === a.charCodeAt(c) ? a.substring(0, c) : a).substring(d.indexOf(':', 7) + 1).trim();\n\n switch (m = b.charCodeAt(0) + (b.charCodeAt(7) | 0)) {\n case 203:\n if (111 > b.charCodeAt(8)) break;\n\n case 115:\n a = a.replace(b, '-webkit-' + b) + ';' + a;\n break;\n\n case 207:\n case 102:\n a = a.replace(b, '-webkit-' + (102 < m ? 'inline-' : '') + 'box') + ';' + a.replace(b, '-webkit-' + b) + ';' + a.replace(b, '-ms-' + b + 'box') + ';' + a;\n }\n\n return a + ';';\n\n case 938:\n if (45 === a.charCodeAt(5)) switch (a.charCodeAt(6)) {\n case 105:\n return b = a.replace('-items', ''), '-webkit-' + a + '-webkit-box-' + b + '-ms-flex-' + b + a;\n\n case 115:\n return '-webkit-' + a + '-ms-flex-item-' + a.replace(ba, '') + a;\n\n default:\n return '-webkit-' + a + '-ms-flex-line-pack' + a.replace('align-content', '').replace(ba, '') + a;\n }\n break;\n\n case 973:\n case 989:\n if (45 !== a.charCodeAt(3) || 122 === a.charCodeAt(4)) break;\n\n case 931:\n case 953:\n if (!0 === la.test(d)) return 115 === (b = d.substring(d.indexOf(':') + 1)).charCodeAt(0) ? P(d.replace('stretch', 'fill-available'), c, e, h).replace(':fill-available', ':stretch') : a.replace(b, '-webkit-' + b) + a.replace(b, '-moz-' + b.replace('fill-', '')) + a;\n break;\n\n case 962:\n if (a = '-webkit-' + a + (102 === a.charCodeAt(5) ? '-ms-' + a : '') + a, 211 === e + h && 105 === a.charCodeAt(13) && 0 < a.indexOf('transform', 10)) return a.substring(0, a.indexOf(';', 27) + 1).replace(ma, '$1-webkit-$2') + a;\n }\n\n return a;\n }\n\n function L(d, c) {\n var e = d.indexOf(1 === c ? ':' : '{'),\n h = d.substring(0, 3 !== c ? e : 10);\n e = d.substring(e + 1, d.length - 1);\n return R(2 !== c ? h : h.replace(na, '$1'), e, c);\n }\n\n function ea(d, c) {\n var e = P(c, c.charCodeAt(0), c.charCodeAt(1), c.charCodeAt(2));\n return e !== c + ';' ? e.replace(oa, ' or ($1)').substring(4) : '(' + c + ')';\n }\n\n function H(d, c, e, h, a, m, b, v, n, q) {\n for (var g = 0, x = c, w; g < A; ++g) {\n switch (w = S[g].call(B, d, x, e, h, a, m, b, v, n, q)) {\n case void 0:\n case !1:\n case !0:\n case null:\n break;\n\n default:\n x = w;\n }\n }\n\n if (x !== c) return x;\n }\n\n function T(d) {\n switch (d) {\n case void 0:\n case null:\n A = S.length = 0;\n break;\n\n default:\n if ('function' === typeof d) S[A++] = d;else if ('object' === typeof d) for (var c = 0, e = d.length; c < e; ++c) {\n T(d[c]);\n } else Y = !!d | 0;\n }\n\n return T;\n }\n\n function U(d) {\n d = d.prefix;\n void 0 !== d && (R = null, d ? 'function' !== typeof d ? w = 1 : (w = 2, R = d) : w = 0);\n return U;\n }\n\n function B(d, c) {\n var e = d;\n 33 > e.charCodeAt(0) && (e = e.trim());\n V = e;\n e = [V];\n\n if (0 < A) {\n var h = H(-1, c, e, e, D, z, 0, 0, 0, 0);\n void 0 !== h && 'string' === typeof h && (c = h);\n }\n\n var a = M(O, e, c, 0, 0);\n 0 < A && (h = H(-2, a, e, e, D, z, a.length, 0, 0, 0), void 0 !== h && (a = h));\n V = '';\n E = 0;\n z = D = 1;\n return a;\n }\n\n var ca = /^\\0+/g,\n N = /[\\0\\r\\f]/g,\n aa = /: */g,\n ka = /zoo|gra/,\n ma = /([,: ])(transform)/g,\n ia = /,\\r+?/g,\n F = /([\\t\\r\\n ])*\\f?&/g,\n fa = /@(k\\w+)\\s*(\\S*)\\s*/,\n Q = /::(place)/g,\n ha = /:(read-only)/g,\n G = /[svh]\\w+-[tblr]{2}/,\n da = /\\(\\s*(.*)\\s*\\)/g,\n oa = /([\\s\\S]*?);/g,\n ba = /-self|flex-/g,\n na = /[^]*?(:[rp][el]a[\\w-]+)[^]*/,\n la = /stretch|:\\s*\\w+\\-(?:conte|avail)/,\n ja = /([^-])(image-set\\()/,\n z = 1,\n D = 1,\n E = 0,\n w = 1,\n O = [],\n S = [],\n A = 0,\n R = null,\n Y = 0,\n V = '';\n B.use = T;\n B.set = U;\n void 0 !== W && U(W);\n return B;\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (stylis_min);\n\n\n//# sourceURL=webpack:///./node_modules/styled-components/node_modules/@emotion/stylis/dist/stylis.browser.esm.js?"); /***/ }), /***/ "./node_modules/styled-components/node_modules/@emotion/unitless/dist/unitless.browser.esm.js": /*!****************************************************************************************************!*\ !*** ./node_modules/styled-components/node_modules/@emotion/unitless/dist/unitless.browser.esm.js ***! \****************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\nvar unitlessKeys = {\n animationIterationCount: 1,\n borderImageOutset: 1,\n borderImageSlice: 1,\n borderImageWidth: 1,\n boxFlex: 1,\n boxFlexGroup: 1,\n boxOrdinalGroup: 1,\n columnCount: 1,\n columns: 1,\n flex: 1,\n flexGrow: 1,\n flexPositive: 1,\n flexShrink: 1,\n flexNegative: 1,\n flexOrder: 1,\n gridRow: 1,\n gridRowEnd: 1,\n gridRowSpan: 1,\n gridRowStart: 1,\n gridColumn: 1,\n gridColumnEnd: 1,\n gridColumnSpan: 1,\n gridColumnStart: 1,\n msGridRow: 1,\n msGridRowSpan: 1,\n msGridColumn: 1,\n msGridColumnSpan: 1,\n fontWeight: 1,\n lineHeight: 1,\n opacity: 1,\n order: 1,\n orphans: 1,\n tabSize: 1,\n widows: 1,\n zIndex: 1,\n zoom: 1,\n WebkitLineClamp: 1,\n // SVG-related properties\n fillOpacity: 1,\n floodOpacity: 1,\n stopOpacity: 1,\n strokeDasharray: 1,\n strokeDashoffset: 1,\n strokeMiterlimit: 1,\n strokeOpacity: 1,\n strokeWidth: 1\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (unitlessKeys);\n\n\n//# sourceURL=webpack:///./node_modules/styled-components/node_modules/@emotion/unitless/dist/unitless.browser.esm.js?"); /***/ }), /***/ "./node_modules/stylis-rule-sheet/index.js": /*!*************************************************!*\ !*** ./node_modules/stylis-rule-sheet/index.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("(function (factory) {\n\t true ? (module['exports'] = factory()) :\n\t\tundefined\n}(function () {\n\n\t'use strict'\n\n\treturn function (insertRule) {\n\t\tvar delimiter = '/*|*/'\n\t\tvar needle = delimiter+'}'\n\n\t\tfunction toSheet (block) {\n\t\t\tif (block)\n\t\t\t\ttry {\n\t\t\t\t\tinsertRule(block + '}')\n\t\t\t\t} catch (e) {}\n\t\t}\n\n\t\treturn function ruleSheet (context, content, selectors, parents, line, column, length, ns, depth, at) {\n\t\t\tswitch (context) {\n\t\t\t\t// property\n\t\t\t\tcase 1:\n\t\t\t\t\t// @import\n\t\t\t\t\tif (depth === 0 && content.charCodeAt(0) === 64)\n\t\t\t\t\t\treturn insertRule(content+';'), ''\n\t\t\t\t\tbreak\n\t\t\t\t// selector\n\t\t\t\tcase 2:\n\t\t\t\t\tif (ns === 0)\n\t\t\t\t\t\treturn content + delimiter\n\t\t\t\t\tbreak\n\t\t\t\t// at-rule\n\t\t\t\tcase 3:\n\t\t\t\t\tswitch (ns) {\n\t\t\t\t\t\t// @font-face, @page\n\t\t\t\t\t\tcase 102:\n\t\t\t\t\t\tcase 112:\n\t\t\t\t\t\t\treturn insertRule(selectors[0]+content), ''\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn content + (at === 0 ? delimiter : '')\n\t\t\t\t\t}\n\t\t\t\tcase -2:\n\t\t\t\t\tcontent.split(needle).forEach(toSheet)\n\t\t\t}\n\t\t}\n\t}\n}))\n\n\n//# sourceURL=webpack:///./node_modules/stylis-rule-sheet/index.js?"); /***/ }), /***/ "./node_modules/synthetic-dom/esm/SyntheticDOM.js": /*!********************************************************!*\ !*** ./node_modules/synthetic-dom/esm/SyntheticDOM.js ***! \********************************************************/ /*! exports provided: NODE_TYPE_ELEMENT, NODE_TYPE_TEXT, NODE_TYPE_FRAGMENT, SELF_CLOSING, Node, TextNode, ElementNode, FragmentNode */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NODE_TYPE_ELEMENT\", function() { return NODE_TYPE_ELEMENT; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NODE_TYPE_TEXT\", function() { return NODE_TYPE_TEXT; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NODE_TYPE_FRAGMENT\", function() { return NODE_TYPE_FRAGMENT; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SELF_CLOSING\", function() { return SELF_CLOSING; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Node\", function() { return Node; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TextNode\", function() { return TextNode; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ElementNode\", function() { return ElementNode; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FragmentNode\", function() { return FragmentNode; });\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance\"); }\n\nfunction _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar EMPTY_ATTR_LIST = [];\nvar NODE_TYPE_ELEMENT = 1;\nvar NODE_TYPE_TEXT = 3;\nvar NODE_TYPE_FRAGMENT = 11;\nvar SELF_CLOSING = {\n area: true,\n base: true,\n br: true,\n col: true,\n embed: true,\n hr: true,\n img: true,\n input: true,\n keygen: true,\n link: true,\n meta: true,\n param: true,\n source: true,\n track: true,\n wbr: true\n};\nvar Node =\n/*#__PURE__*/\nfunction () {\n function Node() {\n _classCallCheck(this, Node);\n\n _defineProperty(this, \"nodeType\", void 0);\n\n _defineProperty(this, \"nodeName\", void 0);\n\n _defineProperty(this, \"nodeValue\", void 0);\n\n _defineProperty(this, \"childNodes\", void 0);\n }\n\n _createClass(Node, [{\n key: \"toString\",\n value: function toString(isXHTML) {\n return isXHTML ? '' : '';\n }\n }]);\n\n return Node;\n}();\nvar TextNode =\n/*#__PURE__*/\nfunction (_Node) {\n _inherits(TextNode, _Node);\n\n function TextNode(value) {\n var _this;\n\n _classCallCheck(this, TextNode);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(TextNode).apply(this, arguments));\n _this.nodeType = NODE_TYPE_TEXT;\n _this.nodeName = '#text';\n _this.nodeValue = value;\n return _this;\n } // eslint-disable-next-line no-unused-vars\n\n\n _createClass(TextNode, [{\n key: \"toString\",\n value: function toString(isXHTML) {\n return escape(this.nodeValue);\n }\n }]);\n\n return TextNode;\n}(Node);\nvar ElementNode =\n/*#__PURE__*/\nfunction (_Node2) {\n _inherits(ElementNode, _Node2);\n\n function ElementNode(name, attributes, childNodes) {\n var _this2;\n\n _classCallCheck(this, ElementNode);\n\n _this2 = _possibleConstructorReturn(this, _getPrototypeOf(ElementNode).apply(this, arguments));\n\n _defineProperty(_assertThisInitialized(_this2), \"_name\", void 0);\n\n _defineProperty(_assertThisInitialized(_this2), \"_attrMap\", void 0);\n\n _defineProperty(_assertThisInitialized(_this2), \"_isSelfClosing\", void 0);\n\n _defineProperty(_assertThisInitialized(_this2), \"childNodes\", void 0);\n\n _defineProperty(_assertThisInitialized(_this2), \"attributes\", void 0);\n\n if (attributes == null) {\n attributes = EMPTY_ATTR_LIST;\n }\n\n var isSelfClosing = SELF_CLOSING[name] === true;\n _this2.nodeType = NODE_TYPE_ELEMENT;\n _this2._name = name.toLowerCase();\n _this2.attributes = attributes;\n _this2._attrMap = new Map(attributes.map(function (attr) {\n return [attr.name, attr];\n }));\n _this2.nodeName = name.toUpperCase();\n _this2.childNodes = [];\n _this2._isSelfClosing = isSelfClosing;\n\n if (!isSelfClosing && childNodes) {\n childNodes.forEach(_this2.appendChild, _assertThisInitialized(_this2));\n }\n\n return _this2;\n }\n\n _createClass(ElementNode, [{\n key: \"appendChild\",\n value: function appendChild(node) {\n if (node.nodeType === NODE_TYPE_FRAGMENT && node.childNodes) {\n var _this$childNodes;\n\n this.childNodes && (_this$childNodes = this.childNodes).push.apply(_this$childNodes, _toConsumableArray(node.childNodes));\n } else {\n this.childNodes && this.childNodes.push(node);\n }\n }\n }, {\n key: \"getAttribute\",\n value: function getAttribute(name) {\n var attr = this._attrMap.get(name);\n\n if (attr) {\n return attr.value;\n }\n }\n }, {\n key: \"toString\",\n value: function toString(isXHTML) {\n var attributes = [];\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = this.attributes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _step$value = _step.value,\n name = _step$value.name,\n value = _step$value.value;\n attributes.push(name + (value ? '=\"' + escapeAttr(value) + '\"' : ''));\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator[\"return\"] != null) {\n _iterator[\"return\"]();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n var attrString = attributes.length ? ' ' + attributes.join(' ') : '';\n\n if (this._isSelfClosing) {\n return '<' + this._name + attrString + (isXHTML ? '/>' : '>');\n }\n\n var childNodes = this.childNodes ? this.childNodes.map(function (node) {\n return node.toString(isXHTML);\n }).join('') : '';\n return '<' + this._name + attrString + '>' + childNodes + '';\n }\n }, {\n key: \"tagName\",\n get: function get() {\n return this.nodeName;\n }\n }, {\n key: \"className\",\n get: function get() {\n return this.getAttribute('class') || '';\n }\n }]);\n\n return ElementNode;\n}(Node);\nvar FragmentNode =\n/*#__PURE__*/\nfunction (_Node3) {\n _inherits(FragmentNode, _Node3);\n\n function FragmentNode(childNodes) {\n var _this3;\n\n _classCallCheck(this, FragmentNode);\n\n _this3 = _possibleConstructorReturn(this, _getPrototypeOf(FragmentNode).apply(this, arguments));\n\n _defineProperty(_assertThisInitialized(_this3), \"childNodes\", void 0);\n\n _this3.nodeType = NODE_TYPE_FRAGMENT;\n _this3.childNodes = [];\n\n if (childNodes) {\n childNodes.forEach(_this3.appendChild, _assertThisInitialized(_this3));\n }\n\n return _this3;\n }\n\n _createClass(FragmentNode, [{\n key: \"appendChild\",\n value: function appendChild(node) {\n if (node.nodeType === NODE_TYPE_FRAGMENT && node.childNodes) {\n var _this$childNodes2;\n\n this.childNodes && (_this$childNodes2 = this.childNodes).push.apply(_this$childNodes2, _toConsumableArray(node.childNodes));\n } else {\n this.childNodes && this.childNodes.push(node);\n }\n }\n }, {\n key: \"toString\",\n value: function toString(isXHTML) {\n var childNodes = this.childNodes;\n return childNodes ? childNodes.map(function (node) {\n return node.toString(isXHTML);\n }).join('') : '';\n }\n }]);\n\n return FragmentNode;\n}(Node);\n\nfunction escape(html) {\n return html.replace(/&/g, '&').replace(//g, '>');\n}\n\nfunction escapeAttr(html) {\n return html.replace(/&/g, '&').replace(//g, '>').replace(/\"/g, '"').replace(/'/g, ''');\n}\n\n//# sourceURL=webpack:///./node_modules/synthetic-dom/esm/SyntheticDOM.js?"); /***/ }), /***/ "./node_modules/synthetic-dom/esm/main.js": /*!************************************************!*\ !*** ./node_modules/synthetic-dom/esm/main.js ***! \************************************************/ /*! exports provided: NODE_TYPE_ELEMENT, NODE_TYPE_TEXT, NODE_TYPE_FRAGMENT, SELF_CLOSING, Node, TextNode, ElementNode, FragmentNode */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _SyntheticDOM__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SyntheticDOM */ \"./node_modules/synthetic-dom/esm/SyntheticDOM.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"NODE_TYPE_ELEMENT\", function() { return _SyntheticDOM__WEBPACK_IMPORTED_MODULE_0__[\"NODE_TYPE_ELEMENT\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"NODE_TYPE_TEXT\", function() { return _SyntheticDOM__WEBPACK_IMPORTED_MODULE_0__[\"NODE_TYPE_TEXT\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"NODE_TYPE_FRAGMENT\", function() { return _SyntheticDOM__WEBPACK_IMPORTED_MODULE_0__[\"NODE_TYPE_FRAGMENT\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"SELF_CLOSING\", function() { return _SyntheticDOM__WEBPACK_IMPORTED_MODULE_0__[\"SELF_CLOSING\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Node\", function() { return _SyntheticDOM__WEBPACK_IMPORTED_MODULE_0__[\"Node\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TextNode\", function() { return _SyntheticDOM__WEBPACK_IMPORTED_MODULE_0__[\"TextNode\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ElementNode\", function() { return _SyntheticDOM__WEBPACK_IMPORTED_MODULE_0__[\"ElementNode\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"FragmentNode\", function() { return _SyntheticDOM__WEBPACK_IMPORTED_MODULE_0__[\"FragmentNode\"]; });\n\n\n\n//# sourceURL=webpack:///./node_modules/synthetic-dom/esm/main.js?"); /***/ }), /***/ "./node_modules/tinycolor2/tinycolor.js": /*!**********************************************!*\ !*** ./node_modules/tinycolor2/tinycolor.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var __WEBPACK_AMD_DEFINE_RESULT__;// TinyColor v1.4.1\n// https://github.com/bgrins/TinyColor\n// Brian Grinstead, MIT License\n\n(function(Math) {\n\nvar trimLeft = /^\\s+/,\n trimRight = /\\s+$/,\n tinyCounter = 0,\n mathRound = Math.round,\n mathMin = Math.min,\n mathMax = Math.max,\n mathRandom = Math.random;\n\nfunction tinycolor (color, opts) {\n\n color = (color) ? color : '';\n opts = opts || { };\n\n // If input is already a tinycolor, return itself\n if (color instanceof tinycolor) {\n return color;\n }\n // If we are called as a function, call using new instead\n if (!(this instanceof tinycolor)) {\n return new tinycolor(color, opts);\n }\n\n var rgb = inputToRGB(color);\n this._originalInput = color,\n this._r = rgb.r,\n this._g = rgb.g,\n this._b = rgb.b,\n this._a = rgb.a,\n this._roundA = mathRound(100*this._a) / 100,\n this._format = opts.format || rgb.format;\n this._gradientType = opts.gradientType;\n\n // Don't let the range of [0,255] come back in [0,1].\n // Potentially lose a little bit of precision here, but will fix issues where\n // .5 gets interpreted as half of the total, instead of half of 1\n // If it was supposed to be 128, this was already taken care of by `inputToRgb`\n if (this._r < 1) { this._r = mathRound(this._r); }\n if (this._g < 1) { this._g = mathRound(this._g); }\n if (this._b < 1) { this._b = mathRound(this._b); }\n\n this._ok = rgb.ok;\n this._tc_id = tinyCounter++;\n}\n\ntinycolor.prototype = {\n isDark: function() {\n return this.getBrightness() < 128;\n },\n isLight: function() {\n return !this.isDark();\n },\n isValid: function() {\n return this._ok;\n },\n getOriginalInput: function() {\n return this._originalInput;\n },\n getFormat: function() {\n return this._format;\n },\n getAlpha: function() {\n return this._a;\n },\n getBrightness: function() {\n //http://www.w3.org/TR/AERT#color-contrast\n var rgb = this.toRgb();\n return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;\n },\n getLuminance: function() {\n //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n var rgb = this.toRgb();\n var RsRGB, GsRGB, BsRGB, R, G, B;\n RsRGB = rgb.r/255;\n GsRGB = rgb.g/255;\n BsRGB = rgb.b/255;\n\n if (RsRGB <= 0.03928) {R = RsRGB / 12.92;} else {R = Math.pow(((RsRGB + 0.055) / 1.055), 2.4);}\n if (GsRGB <= 0.03928) {G = GsRGB / 12.92;} else {G = Math.pow(((GsRGB + 0.055) / 1.055), 2.4);}\n if (BsRGB <= 0.03928) {B = BsRGB / 12.92;} else {B = Math.pow(((BsRGB + 0.055) / 1.055), 2.4);}\n return (0.2126 * R) + (0.7152 * G) + (0.0722 * B);\n },\n setAlpha: function(value) {\n this._a = boundAlpha(value);\n this._roundA = mathRound(100*this._a) / 100;\n return this;\n },\n toHsv: function() {\n var hsv = rgbToHsv(this._r, this._g, this._b);\n return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a };\n },\n toHsvString: function() {\n var hsv = rgbToHsv(this._r, this._g, this._b);\n var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100);\n return (this._a == 1) ?\n \"hsv(\" + h + \", \" + s + \"%, \" + v + \"%)\" :\n \"hsva(\" + h + \", \" + s + \"%, \" + v + \"%, \"+ this._roundA + \")\";\n },\n toHsl: function() {\n var hsl = rgbToHsl(this._r, this._g, this._b);\n return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a };\n },\n toHslString: function() {\n var hsl = rgbToHsl(this._r, this._g, this._b);\n var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100);\n return (this._a == 1) ?\n \"hsl(\" + h + \", \" + s + \"%, \" + l + \"%)\" :\n \"hsla(\" + h + \", \" + s + \"%, \" + l + \"%, \"+ this._roundA + \")\";\n },\n toHex: function(allow3Char) {\n return rgbToHex(this._r, this._g, this._b, allow3Char);\n },\n toHexString: function(allow3Char) {\n return '#' + this.toHex(allow3Char);\n },\n toHex8: function(allow4Char) {\n return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);\n },\n toHex8String: function(allow4Char) {\n return '#' + this.toHex8(allow4Char);\n },\n toRgb: function() {\n return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a };\n },\n toRgbString: function() {\n return (this._a == 1) ?\n \"rgb(\" + mathRound(this._r) + \", \" + mathRound(this._g) + \", \" + mathRound(this._b) + \")\" :\n \"rgba(\" + mathRound(this._r) + \", \" + mathRound(this._g) + \", \" + mathRound(this._b) + \", \" + this._roundA + \")\";\n },\n toPercentageRgb: function() {\n return { r: mathRound(bound01(this._r, 255) * 100) + \"%\", g: mathRound(bound01(this._g, 255) * 100) + \"%\", b: mathRound(bound01(this._b, 255) * 100) + \"%\", a: this._a };\n },\n toPercentageRgbString: function() {\n return (this._a == 1) ?\n \"rgb(\" + mathRound(bound01(this._r, 255) * 100) + \"%, \" + mathRound(bound01(this._g, 255) * 100) + \"%, \" + mathRound(bound01(this._b, 255) * 100) + \"%)\" :\n \"rgba(\" + mathRound(bound01(this._r, 255) * 100) + \"%, \" + mathRound(bound01(this._g, 255) * 100) + \"%, \" + mathRound(bound01(this._b, 255) * 100) + \"%, \" + this._roundA + \")\";\n },\n toName: function() {\n if (this._a === 0) {\n return \"transparent\";\n }\n\n if (this._a < 1) {\n return false;\n }\n\n return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;\n },\n toFilter: function(secondColor) {\n var hex8String = '#' + rgbaToArgbHex(this._r, this._g, this._b, this._a);\n var secondHex8String = hex8String;\n var gradientType = this._gradientType ? \"GradientType = 1, \" : \"\";\n\n if (secondColor) {\n var s = tinycolor(secondColor);\n secondHex8String = '#' + rgbaToArgbHex(s._r, s._g, s._b, s._a);\n }\n\n return \"progid:DXImageTransform.Microsoft.gradient(\"+gradientType+\"startColorstr=\"+hex8String+\",endColorstr=\"+secondHex8String+\")\";\n },\n toString: function(format) {\n var formatSet = !!format;\n format = format || this._format;\n\n var formattedString = false;\n var hasAlpha = this._a < 1 && this._a >= 0;\n var needsAlphaFormat = !formatSet && hasAlpha && (format === \"hex\" || format === \"hex6\" || format === \"hex3\" || format === \"hex4\" || format === \"hex8\" || format === \"name\");\n\n if (needsAlphaFormat) {\n // Special case for \"transparent\", all other non-alpha formats\n // will return rgba when there is transparency.\n if (format === \"name\" && this._a === 0) {\n return this.toName();\n }\n return this.toRgbString();\n }\n if (format === \"rgb\") {\n formattedString = this.toRgbString();\n }\n if (format === \"prgb\") {\n formattedString = this.toPercentageRgbString();\n }\n if (format === \"hex\" || format === \"hex6\") {\n formattedString = this.toHexString();\n }\n if (format === \"hex3\") {\n formattedString = this.toHexString(true);\n }\n if (format === \"hex4\") {\n formattedString = this.toHex8String(true);\n }\n if (format === \"hex8\") {\n formattedString = this.toHex8String();\n }\n if (format === \"name\") {\n formattedString = this.toName();\n }\n if (format === \"hsl\") {\n formattedString = this.toHslString();\n }\n if (format === \"hsv\") {\n formattedString = this.toHsvString();\n }\n\n return formattedString || this.toHexString();\n },\n clone: function() {\n return tinycolor(this.toString());\n },\n\n _applyModification: function(fn, args) {\n var color = fn.apply(null, [this].concat([].slice.call(args)));\n this._r = color._r;\n this._g = color._g;\n this._b = color._b;\n this.setAlpha(color._a);\n return this;\n },\n lighten: function() {\n return this._applyModification(lighten, arguments);\n },\n brighten: function() {\n return this._applyModification(brighten, arguments);\n },\n darken: function() {\n return this._applyModification(darken, arguments);\n },\n desaturate: function() {\n return this._applyModification(desaturate, arguments);\n },\n saturate: function() {\n return this._applyModification(saturate, arguments);\n },\n greyscale: function() {\n return this._applyModification(greyscale, arguments);\n },\n spin: function() {\n return this._applyModification(spin, arguments);\n },\n\n _applyCombination: function(fn, args) {\n return fn.apply(null, [this].concat([].slice.call(args)));\n },\n analogous: function() {\n return this._applyCombination(analogous, arguments);\n },\n complement: function() {\n return this._applyCombination(complement, arguments);\n },\n monochromatic: function() {\n return this._applyCombination(monochromatic, arguments);\n },\n splitcomplement: function() {\n return this._applyCombination(splitcomplement, arguments);\n },\n triad: function() {\n return this._applyCombination(triad, arguments);\n },\n tetrad: function() {\n return this._applyCombination(tetrad, arguments);\n }\n};\n\n// If input is an object, force 1 into \"1.0\" to handle ratios properly\n// String input requires \"1.0\" as input, so 1 will be treated as 1\ntinycolor.fromRatio = function(color, opts) {\n if (typeof color == \"object\") {\n var newColor = {};\n for (var i in color) {\n if (color.hasOwnProperty(i)) {\n if (i === \"a\") {\n newColor[i] = color[i];\n }\n else {\n newColor[i] = convertToPercentage(color[i]);\n }\n }\n }\n color = newColor;\n }\n\n return tinycolor(color, opts);\n};\n\n// Given a string or object, convert that input to RGB\n// Possible string inputs:\n//\n// \"red\"\n// \"#f00\" or \"f00\"\n// \"#ff0000\" or \"ff0000\"\n// \"#ff000000\" or \"ff000000\"\n// \"rgb 255 0 0\" or \"rgb (255, 0, 0)\"\n// \"rgb 1.0 0 0\" or \"rgb (1, 0, 0)\"\n// \"rgba (255, 0, 0, 1)\" or \"rgba 255, 0, 0, 1\"\n// \"rgba (1.0, 0, 0, 1)\" or \"rgba 1.0, 0, 0, 1\"\n// \"hsl(0, 100%, 50%)\" or \"hsl 0 100% 50%\"\n// \"hsla(0, 100%, 50%, 1)\" or \"hsla 0 100% 50%, 1\"\n// \"hsv(0, 100%, 100%)\" or \"hsv 0 100% 100%\"\n//\nfunction inputToRGB(color) {\n\n var rgb = { r: 0, g: 0, b: 0 };\n var a = 1;\n var s = null;\n var v = null;\n var l = null;\n var ok = false;\n var format = false;\n\n if (typeof color == \"string\") {\n color = stringInputToObject(color);\n }\n\n if (typeof color == \"object\") {\n if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {\n rgb = rgbToRgb(color.r, color.g, color.b);\n ok = true;\n format = String(color.r).substr(-1) === \"%\" ? \"prgb\" : \"rgb\";\n }\n else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {\n s = convertToPercentage(color.s);\n v = convertToPercentage(color.v);\n rgb = hsvToRgb(color.h, s, v);\n ok = true;\n format = \"hsv\";\n }\n else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {\n s = convertToPercentage(color.s);\n l = convertToPercentage(color.l);\n rgb = hslToRgb(color.h, s, l);\n ok = true;\n format = \"hsl\";\n }\n\n if (color.hasOwnProperty(\"a\")) {\n a = color.a;\n }\n }\n\n a = boundAlpha(a);\n\n return {\n ok: ok,\n format: color.format || format,\n r: mathMin(255, mathMax(rgb.r, 0)),\n g: mathMin(255, mathMax(rgb.g, 0)),\n b: mathMin(255, mathMax(rgb.b, 0)),\n a: a\n };\n}\n\n\n// Conversion Functions\n// --------------------\n\n// `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:\n// \n\n// `rgbToRgb`\n// Handle bounds / percentage checking to conform to CSS color spec\n// \n// *Assumes:* r, g, b in [0, 255] or [0, 1]\n// *Returns:* { r, g, b } in [0, 255]\nfunction rgbToRgb(r, g, b){\n return {\n r: bound01(r, 255) * 255,\n g: bound01(g, 255) * 255,\n b: bound01(b, 255) * 255\n };\n}\n\n// `rgbToHsl`\n// Converts an RGB color value to HSL.\n// *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]\n// *Returns:* { h, s, l } in [0,1]\nfunction rgbToHsl(r, g, b) {\n\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n\n var max = mathMax(r, g, b), min = mathMin(r, g, b);\n var h, s, l = (max + min) / 2;\n\n if(max == min) {\n h = s = 0; // achromatic\n }\n else {\n var d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch(max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n\n h /= 6;\n }\n\n return { h: h, s: s, l: l };\n}\n\n// `hslToRgb`\n// Converts an HSL color value to RGB.\n// *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]\n// *Returns:* { r, g, b } in the set [0, 255]\nfunction hslToRgb(h, s, l) {\n var r, g, b;\n\n h = bound01(h, 360);\n s = bound01(s, 100);\n l = bound01(l, 100);\n\n function hue2rgb(p, q, t) {\n if(t < 0) t += 1;\n if(t > 1) t -= 1;\n if(t < 1/6) return p + (q - p) * 6 * t;\n if(t < 1/2) return q;\n if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;\n return p;\n }\n\n if(s === 0) {\n r = g = b = l; // achromatic\n }\n else {\n var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n var p = 2 * l - q;\n r = hue2rgb(p, q, h + 1/3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1/3);\n }\n\n return { r: r * 255, g: g * 255, b: b * 255 };\n}\n\n// `rgbToHsv`\n// Converts an RGB color value to HSV\n// *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]\n// *Returns:* { h, s, v } in [0,1]\nfunction rgbToHsv(r, g, b) {\n\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n\n var max = mathMax(r, g, b), min = mathMin(r, g, b);\n var h, s, v = max;\n\n var d = max - min;\n s = max === 0 ? 0 : d / max;\n\n if(max == min) {\n h = 0; // achromatic\n }\n else {\n switch(max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n h /= 6;\n }\n return { h: h, s: s, v: v };\n}\n\n// `hsvToRgb`\n// Converts an HSV color value to RGB.\n// *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]\n// *Returns:* { r, g, b } in the set [0, 255]\n function hsvToRgb(h, s, v) {\n\n h = bound01(h, 360) * 6;\n s = bound01(s, 100);\n v = bound01(v, 100);\n\n var i = Math.floor(h),\n f = h - i,\n p = v * (1 - s),\n q = v * (1 - f * s),\n t = v * (1 - (1 - f) * s),\n mod = i % 6,\n r = [v, q, p, p, t, v][mod],\n g = [t, v, v, q, p, p][mod],\n b = [p, p, t, v, v, q][mod];\n\n return { r: r * 255, g: g * 255, b: b * 255 };\n}\n\n// `rgbToHex`\n// Converts an RGB color to hex\n// Assumes r, g, and b are contained in the set [0, 255]\n// Returns a 3 or 6 character hex\nfunction rgbToHex(r, g, b, allow3Char) {\n\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16))\n ];\n\n // Return a 3 character hex if possible\n if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);\n }\n\n return hex.join(\"\");\n}\n\n// `rgbaToHex`\n// Converts an RGBA color plus alpha transparency to hex\n// Assumes r, g, b are contained in the set [0, 255] and\n// a in [0, 1]. Returns a 4 or 8 character rgba hex\nfunction rgbaToHex(r, g, b, a, allow4Char) {\n\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16)),\n pad2(convertDecimalToHex(a))\n ];\n\n // Return a 4 character hex if possible\n if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n\n return hex.join(\"\");\n}\n\n// `rgbaToArgbHex`\n// Converts an RGBA color to an ARGB Hex8 string\n// Rarely used, but required for \"toFilter()\"\nfunction rgbaToArgbHex(r, g, b, a) {\n\n var hex = [\n pad2(convertDecimalToHex(a)),\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16))\n ];\n\n return hex.join(\"\");\n}\n\n// `equals`\n// Can be called with any tinycolor input\ntinycolor.equals = function (color1, color2) {\n if (!color1 || !color2) { return false; }\n return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();\n};\n\ntinycolor.random = function() {\n return tinycolor.fromRatio({\n r: mathRandom(),\n g: mathRandom(),\n b: mathRandom()\n });\n};\n\n\n// Modification Functions\n// ----------------------\n// Thanks to less.js for some of the basics here\n// \n\nfunction desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}\n\nfunction saturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s += amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}\n\nfunction greyscale(color) {\n return tinycolor(color).desaturate(100);\n}\n\nfunction lighten (color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.l += amount / 100;\n hsl.l = clamp01(hsl.l);\n return tinycolor(hsl);\n}\n\nfunction brighten(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var rgb = tinycolor(color).toRgb();\n rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * - (amount / 100))));\n rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * - (amount / 100))));\n rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * - (amount / 100))));\n return tinycolor(rgb);\n}\n\nfunction darken (color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.l -= amount / 100;\n hsl.l = clamp01(hsl.l);\n return tinycolor(hsl);\n}\n\n// Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.\n// Values outside of this range will be wrapped into this range.\nfunction spin(color, amount) {\n var hsl = tinycolor(color).toHsl();\n var hue = (hsl.h + amount) % 360;\n hsl.h = hue < 0 ? 360 + hue : hue;\n return tinycolor(hsl);\n}\n\n// Combination Functions\n// ---------------------\n// Thanks to jQuery xColor for some of the ideas behind these\n// \n\nfunction complement(color) {\n var hsl = tinycolor(color).toHsl();\n hsl.h = (hsl.h + 180) % 360;\n return tinycolor(hsl);\n}\n\nfunction triad(color) {\n var hsl = tinycolor(color).toHsl();\n var h = hsl.h;\n return [\n tinycolor(color),\n tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }),\n tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l })\n ];\n}\n\nfunction tetrad(color) {\n var hsl = tinycolor(color).toHsl();\n var h = hsl.h;\n return [\n tinycolor(color),\n tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }),\n tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }),\n tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l })\n ];\n}\n\nfunction splitcomplement(color) {\n var hsl = tinycolor(color).toHsl();\n var h = hsl.h;\n return [\n tinycolor(color),\n tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l}),\n tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l})\n ];\n}\n\nfunction analogous(color, results, slices) {\n results = results || 6;\n slices = slices || 30;\n\n var hsl = tinycolor(color).toHsl();\n var part = 360 / slices;\n var ret = [tinycolor(color)];\n\n for (hsl.h = ((hsl.h - (part * results >> 1)) + 720) % 360; --results; ) {\n hsl.h = (hsl.h + part) % 360;\n ret.push(tinycolor(hsl));\n }\n return ret;\n}\n\nfunction monochromatic(color, results) {\n results = results || 6;\n var hsv = tinycolor(color).toHsv();\n var h = hsv.h, s = hsv.s, v = hsv.v;\n var ret = [];\n var modification = 1 / results;\n\n while (results--) {\n ret.push(tinycolor({ h: h, s: s, v: v}));\n v = (v + modification) % 1;\n }\n\n return ret;\n}\n\n// Utility Functions\n// ---------------------\n\ntinycolor.mix = function(color1, color2, amount) {\n amount = (amount === 0) ? 0 : (amount || 50);\n\n var rgb1 = tinycolor(color1).toRgb();\n var rgb2 = tinycolor(color2).toRgb();\n\n var p = amount / 100;\n\n var rgba = {\n r: ((rgb2.r - rgb1.r) * p) + rgb1.r,\n g: ((rgb2.g - rgb1.g) * p) + rgb1.g,\n b: ((rgb2.b - rgb1.b) * p) + rgb1.b,\n a: ((rgb2.a - rgb1.a) * p) + rgb1.a\n };\n\n return tinycolor(rgba);\n};\n\n\n// Readability Functions\n// ---------------------\n// false\n// tinycolor.isReadable(\"#000\", \"#111\",{level:\"AA\",size:\"large\"}) => false\ntinycolor.isReadable = function(color1, color2, wcag2) {\n var readability = tinycolor.readability(color1, color2);\n var wcag2Parms, out;\n\n out = false;\n\n wcag2Parms = validateWCAG2Parms(wcag2);\n switch (wcag2Parms.level + wcag2Parms.size) {\n case \"AAsmall\":\n case \"AAAlarge\":\n out = readability >= 4.5;\n break;\n case \"AAlarge\":\n out = readability >= 3;\n break;\n case \"AAAsmall\":\n out = readability >= 7;\n break;\n }\n return out;\n\n};\n\n// `mostReadable`\n// Given a base color and a list of possible foreground or background\n// colors for that base, returns the most readable color.\n// Optionally returns Black or White if the most readable color is unreadable.\n// *Example*\n// tinycolor.mostReadable(tinycolor.mostReadable(\"#123\", [\"#124\", \"#125\"],{includeFallbackColors:false}).toHexString(); // \"#112255\"\n// tinycolor.mostReadable(tinycolor.mostReadable(\"#123\", [\"#124\", \"#125\"],{includeFallbackColors:true}).toHexString(); // \"#ffffff\"\n// tinycolor.mostReadable(\"#a8015a\", [\"#faf3f3\"],{includeFallbackColors:true,level:\"AAA\",size:\"large\"}).toHexString(); // \"#faf3f3\"\n// tinycolor.mostReadable(\"#a8015a\", [\"#faf3f3\"],{includeFallbackColors:true,level:\"AAA\",size:\"small\"}).toHexString(); // \"#ffffff\"\ntinycolor.mostReadable = function(baseColor, colorList, args) {\n var bestColor = null;\n var bestScore = 0;\n var readability;\n var includeFallbackColors, level, size ;\n args = args || {};\n includeFallbackColors = args.includeFallbackColors ;\n level = args.level;\n size = args.size;\n\n for (var i= 0; i < colorList.length ; i++) {\n readability = tinycolor.readability(baseColor, colorList[i]);\n if (readability > bestScore) {\n bestScore = readability;\n bestColor = tinycolor(colorList[i]);\n }\n }\n\n if (tinycolor.isReadable(baseColor, bestColor, {\"level\":level,\"size\":size}) || !includeFallbackColors) {\n return bestColor;\n }\n else {\n args.includeFallbackColors=false;\n return tinycolor.mostReadable(baseColor,[\"#fff\", \"#000\"],args);\n }\n};\n\n\n// Big List of Colors\n// ------------------\n// \nvar names = tinycolor.names = {\n aliceblue: \"f0f8ff\",\n antiquewhite: \"faebd7\",\n aqua: \"0ff\",\n aquamarine: \"7fffd4\",\n azure: \"f0ffff\",\n beige: \"f5f5dc\",\n bisque: \"ffe4c4\",\n black: \"000\",\n blanchedalmond: \"ffebcd\",\n blue: \"00f\",\n blueviolet: \"8a2be2\",\n brown: \"a52a2a\",\n burlywood: \"deb887\",\n burntsienna: \"ea7e5d\",\n cadetblue: \"5f9ea0\",\n chartreuse: \"7fff00\",\n chocolate: \"d2691e\",\n coral: \"ff7f50\",\n cornflowerblue: \"6495ed\",\n cornsilk: \"fff8dc\",\n crimson: \"dc143c\",\n cyan: \"0ff\",\n darkblue: \"00008b\",\n darkcyan: \"008b8b\",\n darkgoldenrod: \"b8860b\",\n darkgray: \"a9a9a9\",\n darkgreen: \"006400\",\n darkgrey: \"a9a9a9\",\n darkkhaki: \"bdb76b\",\n darkmagenta: \"8b008b\",\n darkolivegreen: \"556b2f\",\n darkorange: \"ff8c00\",\n darkorchid: \"9932cc\",\n darkred: \"8b0000\",\n darksalmon: \"e9967a\",\n darkseagreen: \"8fbc8f\",\n darkslateblue: \"483d8b\",\n darkslategray: \"2f4f4f\",\n darkslategrey: \"2f4f4f\",\n darkturquoise: \"00ced1\",\n darkviolet: \"9400d3\",\n deeppink: \"ff1493\",\n deepskyblue: \"00bfff\",\n dimgray: \"696969\",\n dimgrey: \"696969\",\n dodgerblue: \"1e90ff\",\n firebrick: \"b22222\",\n floralwhite: \"fffaf0\",\n forestgreen: \"228b22\",\n fuchsia: \"f0f\",\n gainsboro: \"dcdcdc\",\n ghostwhite: \"f8f8ff\",\n gold: \"ffd700\",\n goldenrod: \"daa520\",\n gray: \"808080\",\n green: \"008000\",\n greenyellow: \"adff2f\",\n grey: \"808080\",\n honeydew: \"f0fff0\",\n hotpink: \"ff69b4\",\n indianred: \"cd5c5c\",\n indigo: \"4b0082\",\n ivory: \"fffff0\",\n khaki: \"f0e68c\",\n lavender: \"e6e6fa\",\n lavenderblush: \"fff0f5\",\n lawngreen: \"7cfc00\",\n lemonchiffon: \"fffacd\",\n lightblue: \"add8e6\",\n lightcoral: \"f08080\",\n lightcyan: \"e0ffff\",\n lightgoldenrodyellow: \"fafad2\",\n lightgray: \"d3d3d3\",\n lightgreen: \"90ee90\",\n lightgrey: \"d3d3d3\",\n lightpink: \"ffb6c1\",\n lightsalmon: \"ffa07a\",\n lightseagreen: \"20b2aa\",\n lightskyblue: \"87cefa\",\n lightslategray: \"789\",\n lightslategrey: \"789\",\n lightsteelblue: \"b0c4de\",\n lightyellow: \"ffffe0\",\n lime: \"0f0\",\n limegreen: \"32cd32\",\n linen: \"faf0e6\",\n magenta: \"f0f\",\n maroon: \"800000\",\n mediumaquamarine: \"66cdaa\",\n mediumblue: \"0000cd\",\n mediumorchid: \"ba55d3\",\n mediumpurple: \"9370db\",\n mediumseagreen: \"3cb371\",\n mediumslateblue: \"7b68ee\",\n mediumspringgreen: \"00fa9a\",\n mediumturquoise: \"48d1cc\",\n mediumvioletred: \"c71585\",\n midnightblue: \"191970\",\n mintcream: \"f5fffa\",\n mistyrose: \"ffe4e1\",\n moccasin: \"ffe4b5\",\n navajowhite: \"ffdead\",\n navy: \"000080\",\n oldlace: \"fdf5e6\",\n olive: \"808000\",\n olivedrab: \"6b8e23\",\n orange: \"ffa500\",\n orangered: \"ff4500\",\n orchid: \"da70d6\",\n palegoldenrod: \"eee8aa\",\n palegreen: \"98fb98\",\n paleturquoise: \"afeeee\",\n palevioletred: \"db7093\",\n papayawhip: \"ffefd5\",\n peachpuff: \"ffdab9\",\n peru: \"cd853f\",\n pink: \"ffc0cb\",\n plum: \"dda0dd\",\n powderblue: \"b0e0e6\",\n purple: \"800080\",\n rebeccapurple: \"663399\",\n red: \"f00\",\n rosybrown: \"bc8f8f\",\n royalblue: \"4169e1\",\n saddlebrown: \"8b4513\",\n salmon: \"fa8072\",\n sandybrown: \"f4a460\",\n seagreen: \"2e8b57\",\n seashell: \"fff5ee\",\n sienna: \"a0522d\",\n silver: \"c0c0c0\",\n skyblue: \"87ceeb\",\n slateblue: \"6a5acd\",\n slategray: \"708090\",\n slategrey: \"708090\",\n snow: \"fffafa\",\n springgreen: \"00ff7f\",\n steelblue: \"4682b4\",\n tan: \"d2b48c\",\n teal: \"008080\",\n thistle: \"d8bfd8\",\n tomato: \"ff6347\",\n turquoise: \"40e0d0\",\n violet: \"ee82ee\",\n wheat: \"f5deb3\",\n white: \"fff\",\n whitesmoke: \"f5f5f5\",\n yellow: \"ff0\",\n yellowgreen: \"9acd32\"\n};\n\n// Make it easy to access colors via `hexNames[hex]`\nvar hexNames = tinycolor.hexNames = flip(names);\n\n\n// Utilities\n// ---------\n\n// `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`\nfunction flip(o) {\n var flipped = { };\n for (var i in o) {\n if (o.hasOwnProperty(i)) {\n flipped[o[i]] = i;\n }\n }\n return flipped;\n}\n\n// Return a valid alpha value [0,1] with all invalid values being set to 1\nfunction boundAlpha(a) {\n a = parseFloat(a);\n\n if (isNaN(a) || a < 0 || a > 1) {\n a = 1;\n }\n\n return a;\n}\n\n// Take input from [0, n] and return it as [0, 1]\nfunction bound01(n, max) {\n if (isOnePointZero(n)) { n = \"100%\"; }\n\n var processPercent = isPercentage(n);\n n = mathMin(max, mathMax(0, parseFloat(n)));\n\n // Automatically convert percentage into number\n if (processPercent) {\n n = parseInt(n * max, 10) / 100;\n }\n\n // Handle floating point rounding errors\n if ((Math.abs(n - max) < 0.000001)) {\n return 1;\n }\n\n // Convert into [0, 1] range if it isn't already\n return (n % max) / parseFloat(max);\n}\n\n// Force a number between 0 and 1\nfunction clamp01(val) {\n return mathMin(1, mathMax(0, val));\n}\n\n// Parse a base-16 hex value into a base-10 integer\nfunction parseIntFromHex(val) {\n return parseInt(val, 16);\n}\n\n// Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1\n// \nfunction isOnePointZero(n) {\n return typeof n == \"string\" && n.indexOf('.') != -1 && parseFloat(n) === 1;\n}\n\n// Check to see if string passed in is a percentage\nfunction isPercentage(n) {\n return typeof n === \"string\" && n.indexOf('%') != -1;\n}\n\n// Force a hex value to have 2 characters\nfunction pad2(c) {\n return c.length == 1 ? '0' + c : '' + c;\n}\n\n// Replace a decimal with it's percentage value\nfunction convertToPercentage(n) {\n if (n <= 1) {\n n = (n * 100) + \"%\";\n }\n\n return n;\n}\n\n// Converts a decimal to a hex value\nfunction convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}\n// Converts a hex value to a decimal\nfunction convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}\n\nvar matchers = (function() {\n\n // \n var CSS_INTEGER = \"[-\\\\+]?\\\\d+%?\";\n\n // \n var CSS_NUMBER = \"[-\\\\+]?\\\\d*\\\\.\\\\d+%?\";\n\n // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.\n var CSS_UNIT = \"(?:\" + CSS_NUMBER + \")|(?:\" + CSS_INTEGER + \")\";\n\n // Actual matching.\n // Parentheses and commas are optional, but not required.\n // Whitespace can take the place of commas or opening paren\n var PERMISSIVE_MATCH3 = \"[\\\\s|\\\\(]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")\\\\s*\\\\)?\";\n var PERMISSIVE_MATCH4 = \"[\\\\s|\\\\(]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")\\\\s*\\\\)?\";\n\n return {\n CSS_UNIT: new RegExp(CSS_UNIT),\n rgb: new RegExp(\"rgb\" + PERMISSIVE_MATCH3),\n rgba: new RegExp(\"rgba\" + PERMISSIVE_MATCH4),\n hsl: new RegExp(\"hsl\" + PERMISSIVE_MATCH3),\n hsla: new RegExp(\"hsla\" + PERMISSIVE_MATCH4),\n hsv: new RegExp(\"hsv\" + PERMISSIVE_MATCH3),\n hsva: new RegExp(\"hsva\" + PERMISSIVE_MATCH4),\n hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/\n };\n})();\n\n// `isValidCSSUnit`\n// Take in a single string / number and check to see if it looks like a CSS unit\n// (see `matchers` above for definition).\nfunction isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}\n\n// `stringInputToObject`\n// Permissive string parsing. Take in a number of formats, and output an object\n// based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`\nfunction stringInputToObject(color) {\n\n color = color.replace(trimLeft,'').replace(trimRight, '').toLowerCase();\n var named = false;\n if (names[color]) {\n color = names[color];\n named = true;\n }\n else if (color == 'transparent') {\n return { r: 0, g: 0, b: 0, a: 0, format: \"name\" };\n }\n\n // Try to match string input using regular expressions.\n // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]\n // Just return an object and let the conversion functions handle that.\n // This way the result will be the same whether the tinycolor is initialized with string or object.\n var match;\n if ((match = matchers.rgb.exec(color))) {\n return { r: match[1], g: match[2], b: match[3] };\n }\n if ((match = matchers.rgba.exec(color))) {\n return { r: match[1], g: match[2], b: match[3], a: match[4] };\n }\n if ((match = matchers.hsl.exec(color))) {\n return { h: match[1], s: match[2], l: match[3] };\n }\n if ((match = matchers.hsla.exec(color))) {\n return { h: match[1], s: match[2], l: match[3], a: match[4] };\n }\n if ((match = matchers.hsv.exec(color))) {\n return { h: match[1], s: match[2], v: match[3] };\n }\n if ((match = matchers.hsva.exec(color))) {\n return { h: match[1], s: match[2], v: match[3], a: match[4] };\n }\n if ((match = matchers.hex8.exec(color))) {\n return {\n r: parseIntFromHex(match[1]),\n g: parseIntFromHex(match[2]),\n b: parseIntFromHex(match[3]),\n a: convertHexToDecimal(match[4]),\n format: named ? \"name\" : \"hex8\"\n };\n }\n if ((match = matchers.hex6.exec(color))) {\n return {\n r: parseIntFromHex(match[1]),\n g: parseIntFromHex(match[2]),\n b: parseIntFromHex(match[3]),\n format: named ? \"name\" : \"hex\"\n };\n }\n if ((match = matchers.hex4.exec(color))) {\n return {\n r: parseIntFromHex(match[1] + '' + match[1]),\n g: parseIntFromHex(match[2] + '' + match[2]),\n b: parseIntFromHex(match[3] + '' + match[3]),\n a: convertHexToDecimal(match[4] + '' + match[4]),\n format: named ? \"name\" : \"hex8\"\n };\n }\n if ((match = matchers.hex3.exec(color))) {\n return {\n r: parseIntFromHex(match[1] + '' + match[1]),\n g: parseIntFromHex(match[2] + '' + match[2]),\n b: parseIntFromHex(match[3] + '' + match[3]),\n format: named ? \"name\" : \"hex\"\n };\n }\n\n return false;\n}\n\nfunction validateWCAG2Parms(parms) {\n // return valid WCAG2 parms for isReadable.\n // If input parms are invalid, return {\"level\":\"AA\", \"size\":\"small\"}\n var level, size;\n parms = parms || {\"level\":\"AA\", \"size\":\"small\"};\n level = (parms.level || \"AA\").toUpperCase();\n size = (parms.size || \"small\").toLowerCase();\n if (level !== \"AA\" && level !== \"AAA\") {\n level = \"AA\";\n }\n if (size !== \"small\" && size !== \"large\") {\n size = \"small\";\n }\n return {\"level\":level, \"size\":size};\n}\n\n// Node: Export function\nif ( true && module.exports) {\n module.exports = tinycolor;\n}\n// AMD/requirejs: Define the module\nelse if (true) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {return tinycolor;}).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n}\n// Browser: Expose to window\nelse {}\n\n})(Math);\n\n\n//# sourceURL=webpack:///./node_modules/tinycolor2/tinycolor.js?"); /***/ }), /***/ "./node_modules/tslib/tslib.es6.js": /*!*****************************************!*\ !*** ./node_modules/tslib/tslib.es6.js ***! \*****************************************/ /*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__extends\", function() { return __extends; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__assign\", function() { return __assign; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__rest\", function() { return __rest; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__decorate\", function() { return __decorate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__param\", function() { return __param; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__metadata\", function() { return __metadata; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__awaiter\", function() { return __awaiter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__generator\", function() { return __generator; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__createBinding\", function() { return __createBinding; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__exportStar\", function() { return __exportStar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__values\", function() { return __values; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__read\", function() { return __read; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__spread\", function() { return __spread; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__spreadArrays\", function() { return __spreadArrays; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__await\", function() { return __await; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__asyncGenerator\", function() { return __asyncGenerator; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__asyncDelegator\", function() { return __asyncDelegator; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__asyncValues\", function() { return __asyncValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__makeTemplateObject\", function() { return __makeTemplateObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__importStar\", function() { return __importStar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__importDefault\", function() { return __importDefault; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__classPrivateFieldGet\", function() { return __classPrivateFieldGet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__classPrivateFieldSet\", function() { return __classPrivateFieldSet; });\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nfunction __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nfunction __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nfunction __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nfunction __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nfunction __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nfunction __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nfunction __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nfunction __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nfunction __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nfunction __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nfunction __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nfunction __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nfunction __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nfunction __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nfunction __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nfunction __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nfunction __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nfunction __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nfunction __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nfunction __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n\n\n//# sourceURL=webpack:///./node_modules/tslib/tslib.es6.js?"); /***/ }), /***/ "./node_modules/ua-parser-js/src/ua-parser.js": /*!****************************************************!*\ !*** ./node_modules/ua-parser-js/src/ua-parser.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var __WEBPACK_AMD_DEFINE_RESULT__;/*!\n * UAParser.js v0.7.21\n * Lightweight JavaScript-based User-Agent string parser\n * https://github.com/faisalman/ua-parser-js\n *\n * Copyright © 2012-2019 Faisal Salman \n * Licensed under MIT License\n */\n\n(function (window, undefined) {\n\n 'use strict';\n\n //////////////\n // Constants\n /////////////\n\n\n var LIBVERSION = '0.7.21',\n EMPTY = '',\n UNKNOWN = '?',\n FUNC_TYPE = 'function',\n UNDEF_TYPE = 'undefined',\n OBJ_TYPE = 'object',\n STR_TYPE = 'string',\n MAJOR = 'major', // deprecated\n MODEL = 'model',\n NAME = 'name',\n TYPE = 'type',\n VENDOR = 'vendor',\n VERSION = 'version',\n ARCHITECTURE= 'architecture',\n CONSOLE = 'console',\n MOBILE = 'mobile',\n TABLET = 'tablet',\n SMARTTV = 'smarttv',\n WEARABLE = 'wearable',\n EMBEDDED = 'embedded';\n\n\n ///////////\n // Helper\n //////////\n\n\n var util = {\n extend : function (regexes, extensions) {\n var mergedRegexes = {};\n for (var i in regexes) {\n if (extensions[i] && extensions[i].length % 2 === 0) {\n mergedRegexes[i] = extensions[i].concat(regexes[i]);\n } else {\n mergedRegexes[i] = regexes[i];\n }\n }\n return mergedRegexes;\n },\n has : function (str1, str2) {\n if (typeof str1 === \"string\") {\n return str2.toLowerCase().indexOf(str1.toLowerCase()) !== -1;\n } else {\n return false;\n }\n },\n lowerize : function (str) {\n return str.toLowerCase();\n },\n major : function (version) {\n return typeof(version) === STR_TYPE ? version.replace(/[^\\d\\.]/g,'').split(\".\")[0] : undefined;\n },\n trim : function (str) {\n return str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n }\n };\n\n\n ///////////////\n // Map helper\n //////////////\n\n\n var mapper = {\n\n rgx : function (ua, arrays) {\n\n var i = 0, j, k, p, q, matches, match;\n\n // loop through all regexes maps\n while (i < arrays.length && !matches) {\n\n var regex = arrays[i], // even sequence (0,2,4,..)\n props = arrays[i + 1]; // odd sequence (1,3,5,..)\n j = k = 0;\n\n // try matching uastring with regexes\n while (j < regex.length && !matches) {\n\n matches = regex[j++].exec(ua);\n\n if (!!matches) {\n for (p = 0; p < props.length; p++) {\n match = matches[++k];\n q = props[p];\n // check if given property is actually array\n if (typeof q === OBJ_TYPE && q.length > 0) {\n if (q.length == 2) {\n if (typeof q[1] == FUNC_TYPE) {\n // assign modified match\n this[q[0]] = q[1].call(this, match);\n } else {\n // assign given value, ignore regex match\n this[q[0]] = q[1];\n }\n } else if (q.length == 3) {\n // check whether function or regex\n if (typeof q[1] === FUNC_TYPE && !(q[1].exec && q[1].test)) {\n // call function (usually string mapper)\n this[q[0]] = match ? q[1].call(this, match, q[2]) : undefined;\n } else {\n // sanitize match using given regex\n this[q[0]] = match ? match.replace(q[1], q[2]) : undefined;\n }\n } else if (q.length == 4) {\n this[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined;\n }\n } else {\n this[q] = match ? match : undefined;\n }\n }\n }\n }\n i += 2;\n }\n },\n\n str : function (str, map) {\n\n for (var i in map) {\n // check if array\n if (typeof map[i] === OBJ_TYPE && map[i].length > 0) {\n for (var j = 0; j < map[i].length; j++) {\n if (util.has(map[i][j], str)) {\n return (i === UNKNOWN) ? undefined : i;\n }\n }\n } else if (util.has(map[i], str)) {\n return (i === UNKNOWN) ? undefined : i;\n }\n }\n return str;\n }\n };\n\n\n ///////////////\n // String map\n //////////////\n\n\n var maps = {\n\n browser : {\n oldsafari : {\n version : {\n '1.0' : '/8',\n '1.2' : '/1',\n '1.3' : '/3',\n '2.0' : '/412',\n '2.0.2' : '/416',\n '2.0.3' : '/417',\n '2.0.4' : '/419',\n '?' : '/'\n }\n }\n },\n\n device : {\n amazon : {\n model : {\n 'Fire Phone' : ['SD', 'KF']\n }\n },\n sprint : {\n model : {\n 'Evo Shift 4G' : '7373KT'\n },\n vendor : {\n 'HTC' : 'APA',\n 'Sprint' : 'Sprint'\n }\n }\n },\n\n os : {\n windows : {\n version : {\n 'ME' : '4.90',\n 'NT 3.11' : 'NT3.51',\n 'NT 4.0' : 'NT4.0',\n '2000' : 'NT 5.0',\n 'XP' : ['NT 5.1', 'NT 5.2'],\n 'Vista' : 'NT 6.0',\n '7' : 'NT 6.1',\n '8' : 'NT 6.2',\n '8.1' : 'NT 6.3',\n '10' : ['NT 6.4', 'NT 10.0'],\n 'RT' : 'ARM'\n }\n }\n }\n };\n\n\n //////////////\n // Regex map\n /////////////\n\n\n var regexes = {\n\n browser : [[\n\n // Presto based\n /(opera\\smini)\\/([\\w\\.-]+)/i, // Opera Mini\n /(opera\\s[mobiletab]+).+version\\/([\\w\\.-]+)/i, // Opera Mobi/Tablet\n /(opera).+version\\/([\\w\\.]+)/i, // Opera > 9.80\n /(opera)[\\/\\s]+([\\w\\.]+)/i // Opera < 9.80\n ], [NAME, VERSION], [\n\n /(opios)[\\/\\s]+([\\w\\.]+)/i // Opera mini on iphone >= 8.0\n ], [[NAME, 'Opera Mini'], VERSION], [\n\n /\\s(opr)\\/([\\w\\.]+)/i // Opera Webkit\n ], [[NAME, 'Opera'], VERSION], [\n\n // Mixed\n /(kindle)\\/([\\w\\.]+)/i, // Kindle\n /(lunascape|maxthon|netfront|jasmine|blazer)[\\/\\s]?([\\w\\.]*)/i,\n // Lunascape/Maxthon/Netfront/Jasmine/Blazer\n // Trident based\n /(avant\\s|iemobile|slim)(?:browser)?[\\/\\s]?([\\w\\.]*)/i,\n // Avant/IEMobile/SlimBrowser\n /(bidubrowser|baidubrowser)[\\/\\s]?([\\w\\.]+)/i, // Baidu Browser\n /(?:ms|\\()(ie)\\s([\\w\\.]+)/i, // Internet Explorer\n\n // Webkit/KHTML based\n /(rekonq)\\/([\\w\\.]*)/i, // Rekonq\n /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\\/([\\w\\.-]+)/i\n // Chromium/Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon\n ], [NAME, VERSION], [\n\n /(konqueror)\\/([\\w\\.]+)/i // Konqueror\n ], [[NAME, 'Konqueror'], VERSION], [\n\n /(trident).+rv[:\\s]([\\w\\.]+).+like\\sgecko/i // IE11\n ], [[NAME, 'IE'], VERSION], [\n\n /(edge|edgios|edga|edg)\\/((\\d+)?[\\w\\.]+)/i // Microsoft Edge\n ], [[NAME, 'Edge'], VERSION], [\n\n /(yabrowser)\\/([\\w\\.]+)/i // Yandex\n ], [[NAME, 'Yandex'], VERSION], [\n\n /(Avast)\\/([\\w\\.]+)/i // Avast Secure Browser\n ], [[NAME, 'Avast Secure Browser'], VERSION], [\n\n /(AVG)\\/([\\w\\.]+)/i // AVG Secure Browser\n ], [[NAME, 'AVG Secure Browser'], VERSION], [\n\n /(puffin)\\/([\\w\\.]+)/i // Puffin\n ], [[NAME, 'Puffin'], VERSION], [\n\n /(focus)\\/([\\w\\.]+)/i // Firefox Focus\n ], [[NAME, 'Firefox Focus'], VERSION], [\n\n /(opt)\\/([\\w\\.]+)/i // Opera Touch\n ], [[NAME, 'Opera Touch'], VERSION], [\n\n /((?:[\\s\\/])uc?\\s?browser|(?:juc.+)ucweb)[\\/\\s]?([\\w\\.]+)/i // UCBrowser\n ], [[NAME, 'UCBrowser'], VERSION], [\n\n /(comodo_dragon)\\/([\\w\\.]+)/i // Comodo Dragon\n ], [[NAME, /_/g, ' '], VERSION], [\n\n /(windowswechat qbcore)\\/([\\w\\.]+)/i // WeChat Desktop for Windows Built-in Browser\n ], [[NAME, 'WeChat(Win) Desktop'], VERSION], [\n\n /(micromessenger)\\/([\\w\\.]+)/i // WeChat\n ], [[NAME, 'WeChat'], VERSION], [\n\n /(brave)\\/([\\w\\.]+)/i // Brave browser\n ], [[NAME, 'Brave'], VERSION], [\n\n /(qqbrowserlite)\\/([\\w\\.]+)/i // QQBrowserLite\n ], [NAME, VERSION], [\n\n /(QQ)\\/([\\d\\.]+)/i // QQ, aka ShouQ\n ], [NAME, VERSION], [\n\n /m?(qqbrowser)[\\/\\s]?([\\w\\.]+)/i // QQBrowser\n ], [NAME, VERSION], [\n\n /(baiduboxapp)[\\/\\s]?([\\w\\.]+)/i // Baidu App\n ], [NAME, VERSION], [\n\n /(2345Explorer)[\\/\\s]?([\\w\\.]+)/i // 2345 Browser\n ], [NAME, VERSION], [\n\n /(MetaSr)[\\/\\s]?([\\w\\.]+)/i // SouGouBrowser\n ], [NAME], [\n\n /(LBBROWSER)/i // LieBao Browser\n ], [NAME], [\n\n /xiaomi\\/miuibrowser\\/([\\w\\.]+)/i // MIUI Browser\n ], [VERSION, [NAME, 'MIUI Browser']], [\n\n /;fbav\\/([\\w\\.]+);/i // Facebook App for iOS & Android\n ], [VERSION, [NAME, 'Facebook']], [\n\n /safari\\s(line)\\/([\\w\\.]+)/i, // Line App for iOS\n /android.+(line)\\/([\\w\\.]+)\\/iab/i // Line App for Android\n ], [NAME, VERSION], [\n\n /headlesschrome(?:\\/([\\w\\.]+)|\\s)/i // Chrome Headless\n ], [VERSION, [NAME, 'Chrome Headless']], [\n\n /\\swv\\).+(chrome)\\/([\\w\\.]+)/i // Chrome WebView\n ], [[NAME, /(.+)/, '$1 WebView'], VERSION], [\n\n /((?:oculus|samsung)browser)\\/([\\w\\.]+)/i\n ], [[NAME, /(.+(?:g|us))(.+)/, '$1 $2'], VERSION], [ // Oculus / Samsung Browser\n\n /android.+version\\/([\\w\\.]+)\\s+(?:mobile\\s?safari|safari)*/i // Android Browser\n ], [VERSION, [NAME, 'Android Browser']], [\n\n /(sailfishbrowser)\\/([\\w\\.]+)/i // Sailfish Browser\n ], [[NAME, 'Sailfish Browser'], VERSION], [\n\n /(chrome|omniweb|arora|[tizenoka]{5}\\s?browser)\\/v?([\\w\\.]+)/i\n // Chrome/OmniWeb/Arora/Tizen/Nokia\n ], [NAME, VERSION], [\n\n /(dolfin)\\/([\\w\\.]+)/i // Dolphin\n ], [[NAME, 'Dolphin'], VERSION], [\n\n /(qihu|qhbrowser|qihoobrowser|360browser)/i // 360\n ], [[NAME, '360 Browser']], [\n\n /((?:android.+)crmo|crios)\\/([\\w\\.]+)/i // Chrome for Android/iOS\n ], [[NAME, 'Chrome'], VERSION], [\n\n /(coast)\\/([\\w\\.]+)/i // Opera Coast\n ], [[NAME, 'Opera Coast'], VERSION], [\n\n /fxios\\/([\\w\\.-]+)/i // Firefox for iOS\n ], [VERSION, [NAME, 'Firefox']], [\n\n /version\\/([\\w\\.]+).+?mobile\\/\\w+\\s(safari)/i // Mobile Safari\n ], [VERSION, [NAME, 'Mobile Safari']], [\n\n /version\\/([\\w\\.]+).+?(mobile\\s?safari|safari)/i // Safari & Safari Mobile\n ], [VERSION, NAME], [\n\n /webkit.+?(gsa)\\/([\\w\\.]+).+?(mobile\\s?safari|safari)(\\/[\\w\\.]+)/i // Google Search Appliance on iOS\n ], [[NAME, 'GSA'], VERSION], [\n\n /webkit.+?(mobile\\s?safari|safari)(\\/[\\w\\.]+)/i // Safari < 3.0\n ], [NAME, [VERSION, mapper.str, maps.browser.oldsafari.version]], [\n\n /(webkit|khtml)\\/([\\w\\.]+)/i\n ], [NAME, VERSION], [\n\n // Gecko based\n /(navigator|netscape)\\/([\\w\\.-]+)/i // Netscape\n ], [[NAME, 'Netscape'], VERSION], [\n /(swiftfox)/i, // Swiftfox\n /(icedragon|iceweasel|camino|chimera|fennec|maemo\\sbrowser|minimo|conkeror)[\\/\\s]?([\\w\\.\\+]+)/i,\n // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror\n /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\\/([\\w\\.-]+)$/i,\n\n // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix\n /(mozilla)\\/([\\w\\.]+).+rv\\:.+gecko\\/\\d+/i, // Mozilla\n\n // Other\n /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\\/\\s]?([\\w\\.]+)/i,\n // Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir\n /(links)\\s\\(([\\w\\.]+)/i, // Links\n /(gobrowser)\\/?([\\w\\.]*)/i, // GoBrowser\n /(ice\\s?browser)\\/v?([\\w\\._]+)/i, // ICE Browser\n /(mosaic)[\\/\\s]([\\w\\.]+)/i // Mosaic\n ], [NAME, VERSION]\n ],\n\n cpu : [[\n\n /(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\\)]/i // AMD64\n ], [[ARCHITECTURE, 'amd64']], [\n\n /(ia32(?=;))/i // IA32 (quicktime)\n ], [[ARCHITECTURE, util.lowerize]], [\n\n /((?:i[346]|x)86)[;\\)]/i // IA32\n ], [[ARCHITECTURE, 'ia32']], [\n\n // PocketPC mistakenly identified as PowerPC\n /windows\\s(ce|mobile);\\sppc;/i\n ], [[ARCHITECTURE, 'arm']], [\n\n /((?:ppc|powerpc)(?:64)?)(?:\\smac|;|\\))/i // PowerPC\n ], [[ARCHITECTURE, /ower/, '', util.lowerize]], [\n\n /(sun4\\w)[;\\)]/i // SPARC\n ], [[ARCHITECTURE, 'sparc']], [\n\n /((?:avr32|ia64(?=;))|68k(?=\\))|arm(?:64|(?=v\\d+[;l]))|(?=atmel\\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i\n // IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC\n ], [[ARCHITECTURE, util.lowerize]]\n ],\n\n device : [[\n\n /\\((ipad|playbook);[\\w\\s\\),;-]+(rim|apple)/i // iPad/PlayBook\n ], [MODEL, VENDOR, [TYPE, TABLET]], [\n\n /applecoremedia\\/[\\w\\.]+ \\((ipad)/ // iPad\n ], [MODEL, [VENDOR, 'Apple'], [TYPE, TABLET]], [\n\n /(apple\\s{0,1}tv)/i // Apple TV\n ], [[MODEL, 'Apple TV'], [VENDOR, 'Apple'], [TYPE, SMARTTV]], [\n\n /(archos)\\s(gamepad2?)/i, // Archos\n /(hp).+(touchpad)/i, // HP TouchPad\n /(hp).+(tablet)/i, // HP Tablet\n /(kindle)\\/([\\w\\.]+)/i, // Kindle\n /\\s(nook)[\\w\\s]+build\\/(\\w+)/i, // Nook\n /(dell)\\s(strea[kpr\\s\\d]*[\\dko])/i // Dell Streak\n ], [VENDOR, MODEL, [TYPE, TABLET]], [\n\n /(kf[A-z]+)\\sbuild\\/.+silk\\//i // Kindle Fire HD\n ], [MODEL, [VENDOR, 'Amazon'], [TYPE, TABLET]], [\n /(sd|kf)[0349hijorstuw]+\\sbuild\\/.+silk\\//i // Fire Phone\n ], [[MODEL, mapper.str, maps.device.amazon.model], [VENDOR, 'Amazon'], [TYPE, MOBILE]], [\n /android.+aft([bms])\\sbuild/i // Fire TV\n ], [MODEL, [VENDOR, 'Amazon'], [TYPE, SMARTTV]], [\n\n /\\((ip[honed|\\s\\w*]+);.+(apple)/i // iPod/iPhone\n ], [MODEL, VENDOR, [TYPE, MOBILE]], [\n /\\((ip[honed|\\s\\w*]+);/i // iPod/iPhone\n ], [MODEL, [VENDOR, 'Apple'], [TYPE, MOBILE]], [\n\n /(blackberry)[\\s-]?(\\w+)/i, // BlackBerry\n /(blackberry|benq|palm(?=\\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\\s_-]?([\\w-]*)/i,\n // BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron\n /(hp)\\s([\\w\\s]+\\w)/i, // HP iPAQ\n /(asus)-?(\\w+)/i // Asus\n ], [VENDOR, MODEL, [TYPE, MOBILE]], [\n /\\(bb10;\\s(\\w+)/i // BlackBerry 10\n ], [MODEL, [VENDOR, 'BlackBerry'], [TYPE, MOBILE]], [\n // Asus Tablets\n /android.+(transfo[prime\\s]{4,10}\\s\\w+|eeepc|slider\\s\\w+|nexus 7|padfone|p00c)/i\n ], [MODEL, [VENDOR, 'Asus'], [TYPE, TABLET]], [\n\n /(sony)\\s(tablet\\s[ps])\\sbuild\\//i, // Sony\n /(sony)?(?:sgp.+)\\sbuild\\//i\n ], [[VENDOR, 'Sony'], [MODEL, 'Xperia Tablet'], [TYPE, TABLET]], [\n /android.+\\s([c-g]\\d{4}|so[-l]\\w+)(?=\\sbuild\\/|\\).+chrome\\/(?![1-6]{0,1}\\d\\.))/i\n ], [MODEL, [VENDOR, 'Sony'], [TYPE, MOBILE]], [\n\n /\\s(ouya)\\s/i, // Ouya\n /(nintendo)\\s([wids3u]+)/i // Nintendo\n ], [VENDOR, MODEL, [TYPE, CONSOLE]], [\n\n /android.+;\\s(shield)\\sbuild/i // Nvidia\n ], [MODEL, [VENDOR, 'Nvidia'], [TYPE, CONSOLE]], [\n\n /(playstation\\s[34portablevi]+)/i // Playstation\n ], [MODEL, [VENDOR, 'Sony'], [TYPE, CONSOLE]], [\n\n /(sprint\\s(\\w+))/i // Sprint Phones\n ], [[VENDOR, mapper.str, maps.device.sprint.vendor], [MODEL, mapper.str, maps.device.sprint.model], [TYPE, MOBILE]], [\n\n /(htc)[;_\\s-]+([\\w\\s]+(?=\\)|\\sbuild)|\\w+)/i, // HTC\n /(zte)-(\\w*)/i, // ZTE\n /(alcatel|geeksphone|nexian|panasonic|(?=;\\s)sony)[_\\s-]?([\\w-]*)/i\n // Alcatel/GeeksPhone/Nexian/Panasonic/Sony\n ], [VENDOR, [MODEL, /_/g, ' '], [TYPE, MOBILE]], [\n\n /(nexus\\s9)/i // HTC Nexus 9\n ], [MODEL, [VENDOR, 'HTC'], [TYPE, TABLET]], [\n\n /d\\/huawei([\\w\\s-]+)[;\\)]/i,\n /(nexus\\s6p|vog-l29|ane-lx1|eml-l29)/i // Huawei\n ], [MODEL, [VENDOR, 'Huawei'], [TYPE, MOBILE]], [\n\n /android.+(bah2?-a?[lw]\\d{2})/i // Huawei MediaPad\n ], [MODEL, [VENDOR, 'Huawei'], [TYPE, TABLET]], [\n\n /(microsoft);\\s(lumia[\\s\\w]+)/i // Microsoft Lumia\n ], [VENDOR, MODEL, [TYPE, MOBILE]], [\n\n /[\\s\\(;](xbox(?:\\sone)?)[\\s\\);]/i // Microsoft Xbox\n ], [MODEL, [VENDOR, 'Microsoft'], [TYPE, CONSOLE]], [\n /(kin\\.[onetw]{3})/i // Microsoft Kin\n ], [[MODEL, /\\./g, ' '], [VENDOR, 'Microsoft'], [TYPE, MOBILE]], [\n\n // Motorola\n /\\s(milestone|droid(?:[2-4x]|\\s(?:bionic|x2|pro|razr))?:?(\\s4g)?)[\\w\\s]+build\\//i,\n /mot[\\s-]?(\\w*)/i,\n /(XT\\d{3,4}) build\\//i,\n /(nexus\\s6)/i\n ], [MODEL, [VENDOR, 'Motorola'], [TYPE, MOBILE]], [\n /android.+\\s(mz60\\d|xoom[\\s2]{0,2})\\sbuild\\//i\n ], [MODEL, [VENDOR, 'Motorola'], [TYPE, TABLET]], [\n\n /hbbtv\\/\\d+\\.\\d+\\.\\d+\\s+\\([\\w\\s]*;\\s*(\\w[^;]*);([^;]*)/i // HbbTV devices\n ], [[VENDOR, util.trim], [MODEL, util.trim], [TYPE, SMARTTV]], [\n\n /hbbtv.+maple;(\\d+)/i\n ], [[MODEL, /^/, 'SmartTV'], [VENDOR, 'Samsung'], [TYPE, SMARTTV]], [\n\n /\\(dtv[\\);].+(aquos)/i // Sharp\n ], [MODEL, [VENDOR, 'Sharp'], [TYPE, SMARTTV]], [\n\n /android.+((sch-i[89]0\\d|shw-m380s|gt-p\\d{4}|gt-n\\d+|sgh-t8[56]9|nexus 10))/i,\n /((SM-T\\w+))/i\n ], [[VENDOR, 'Samsung'], MODEL, [TYPE, TABLET]], [ // Samsung\n /smart-tv.+(samsung)/i\n ], [VENDOR, [TYPE, SMARTTV], MODEL], [\n /((s[cgp]h-\\w+|gt-\\w+|galaxy\\snexus|sm-\\w[\\w\\d]+))/i,\n /(sam[sung]*)[\\s-]*(\\w+-?[\\w-]*)/i,\n /sec-((sgh\\w+))/i\n ], [[VENDOR, 'Samsung'], MODEL, [TYPE, MOBILE]], [\n\n /sie-(\\w*)/i // Siemens\n ], [MODEL, [VENDOR, 'Siemens'], [TYPE, MOBILE]], [\n\n /(maemo|nokia).*(n900|lumia\\s\\d+)/i, // Nokia\n /(nokia)[\\s_-]?([\\w-]*)/i\n ], [[VENDOR, 'Nokia'], MODEL, [TYPE, MOBILE]], [\n\n /android[x\\d\\.\\s;]+\\s([ab][1-7]\\-?[0178a]\\d\\d?)/i // Acer\n ], [MODEL, [VENDOR, 'Acer'], [TYPE, TABLET]], [\n\n /android.+([vl]k\\-?\\d{3})\\s+build/i // LG Tablet\n ], [MODEL, [VENDOR, 'LG'], [TYPE, TABLET]], [\n /android\\s3\\.[\\s\\w;-]{10}(lg?)-([06cv9]{3,4})/i // LG Tablet\n ], [[VENDOR, 'LG'], MODEL, [TYPE, TABLET]], [\n /(lg) netcast\\.tv/i // LG SmartTV\n ], [VENDOR, MODEL, [TYPE, SMARTTV]], [\n /(nexus\\s[45])/i, // LG\n /lg[e;\\s\\/-]+(\\w*)/i,\n /android.+lg(\\-?[\\d\\w]+)\\s+build/i\n ], [MODEL, [VENDOR, 'LG'], [TYPE, MOBILE]], [\n\n /(lenovo)\\s?(s(?:5000|6000)(?:[\\w-]+)|tab(?:[\\s\\w]+))/i // Lenovo tablets\n ], [VENDOR, MODEL, [TYPE, TABLET]], [\n /android.+(ideatab[a-z0-9\\-\\s]+)/i // Lenovo\n ], [MODEL, [VENDOR, 'Lenovo'], [TYPE, TABLET]], [\n /(lenovo)[_\\s-]?([\\w-]+)/i\n ], [VENDOR, MODEL, [TYPE, MOBILE]], [\n\n /linux;.+((jolla));/i // Jolla\n ], [VENDOR, MODEL, [TYPE, MOBILE]], [\n\n /((pebble))app\\/[\\d\\.]+\\s/i // Pebble\n ], [VENDOR, MODEL, [TYPE, WEARABLE]], [\n\n /android.+;\\s(oppo)\\s?([\\w\\s]+)\\sbuild/i // OPPO\n ], [VENDOR, MODEL, [TYPE, MOBILE]], [\n\n /crkey/i // Google Chromecast\n ], [[MODEL, 'Chromecast'], [VENDOR, 'Google'], [TYPE, SMARTTV]], [\n\n /android.+;\\s(glass)\\s\\d/i // Google Glass\n ], [MODEL, [VENDOR, 'Google'], [TYPE, WEARABLE]], [\n\n /android.+;\\s(pixel c)[\\s)]/i // Google Pixel C\n ], [MODEL, [VENDOR, 'Google'], [TYPE, TABLET]], [\n\n /android.+;\\s(pixel( [23])?( xl)?)[\\s)]/i // Google Pixel\n ], [MODEL, [VENDOR, 'Google'], [TYPE, MOBILE]], [\n\n /android.+;\\s(\\w+)\\s+build\\/hm\\1/i, // Xiaomi Hongmi 'numeric' models\n /android.+(hm[\\s\\-_]*note?[\\s_]*(?:\\d\\w)?)\\s+build/i, // Xiaomi Hongmi\n /android.+(mi[\\s\\-_]*(?:a\\d|one|one[\\s_]plus|note lte)?[\\s_]*(?:\\d?\\w?)[\\s_]*(?:plus)?)\\s+build/i, \n // Xiaomi Mi\n /android.+(redmi[\\s\\-_]*(?:note)?(?:[\\s_]*[\\w\\s]+))\\s+build/i // Redmi Phones\n ], [[MODEL, /_/g, ' '], [VENDOR, 'Xiaomi'], [TYPE, MOBILE]], [\n /android.+(mi[\\s\\-_]*(?:pad)(?:[\\s_]*[\\w\\s]+))\\s+build/i // Mi Pad tablets\n ],[[MODEL, /_/g, ' '], [VENDOR, 'Xiaomi'], [TYPE, TABLET]], [\n /android.+;\\s(m[1-5]\\snote)\\sbuild/i // Meizu\n ], [MODEL, [VENDOR, 'Meizu'], [TYPE, MOBILE]], [\n /(mz)-([\\w-]{2,})/i\n ], [[VENDOR, 'Meizu'], MODEL, [TYPE, MOBILE]], [\n\n /android.+a000(1)\\s+build/i, // OnePlus\n /android.+oneplus\\s(a\\d{4})[\\s)]/i\n ], [MODEL, [VENDOR, 'OnePlus'], [TYPE, MOBILE]], [\n\n /android.+[;\\/]\\s*(RCT[\\d\\w]+)\\s+build/i // RCA Tablets\n ], [MODEL, [VENDOR, 'RCA'], [TYPE, TABLET]], [\n\n /android.+[;\\/\\s]+(Venue[\\d\\s]{2,7})\\s+build/i // Dell Venue Tablets\n ], [MODEL, [VENDOR, 'Dell'], [TYPE, TABLET]], [\n\n /android.+[;\\/]\\s*(Q[T|M][\\d\\w]+)\\s+build/i // Verizon Tablet\n ], [MODEL, [VENDOR, 'Verizon'], [TYPE, TABLET]], [\n\n /android.+[;\\/]\\s+(Barnes[&\\s]+Noble\\s+|BN[RT])(V?.*)\\s+build/i // Barnes & Noble Tablet\n ], [[VENDOR, 'Barnes & Noble'], MODEL, [TYPE, TABLET]], [\n\n /android.+[;\\/]\\s+(TM\\d{3}.*\\b)\\s+build/i // Barnes & Noble Tablet\n ], [MODEL, [VENDOR, 'NuVision'], [TYPE, TABLET]], [\n\n /android.+;\\s(k88)\\sbuild/i // ZTE K Series Tablet\n ], [MODEL, [VENDOR, 'ZTE'], [TYPE, TABLET]], [\n\n /android.+[;\\/]\\s*(gen\\d{3})\\s+build.*49h/i // Swiss GEN Mobile\n ], [MODEL, [VENDOR, 'Swiss'], [TYPE, MOBILE]], [\n\n /android.+[;\\/]\\s*(zur\\d{3})\\s+build/i // Swiss ZUR Tablet\n ], [MODEL, [VENDOR, 'Swiss'], [TYPE, TABLET]], [\n\n /android.+[;\\/]\\s*((Zeki)?TB.*\\b)\\s+build/i // Zeki Tablets\n ], [MODEL, [VENDOR, 'Zeki'], [TYPE, TABLET]], [\n\n /(android).+[;\\/]\\s+([YR]\\d{2})\\s+build/i,\n /android.+[;\\/]\\s+(Dragon[\\-\\s]+Touch\\s+|DT)(\\w{5})\\sbuild/i // Dragon Touch Tablet\n ], [[VENDOR, 'Dragon Touch'], MODEL, [TYPE, TABLET]], [\n\n /android.+[;\\/]\\s*(NS-?\\w{0,9})\\sbuild/i // Insignia Tablets\n ], [MODEL, [VENDOR, 'Insignia'], [TYPE, TABLET]], [\n\n /android.+[;\\/]\\s*((NX|Next)-?\\w{0,9})\\s+build/i // NextBook Tablets\n ], [MODEL, [VENDOR, 'NextBook'], [TYPE, TABLET]], [\n\n /android.+[;\\/]\\s*(Xtreme\\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\\s+build/i\n ], [[VENDOR, 'Voice'], MODEL, [TYPE, MOBILE]], [ // Voice Xtreme Phones\n\n /android.+[;\\/]\\s*(LVTEL\\-)?(V1[12])\\s+build/i // LvTel Phones\n ], [[VENDOR, 'LvTel'], MODEL, [TYPE, MOBILE]], [\n\n /android.+;\\s(PH-1)\\s/i\n ], [MODEL, [VENDOR, 'Essential'], [TYPE, MOBILE]], [ // Essential PH-1\n\n /android.+[;\\/]\\s*(V(100MD|700NA|7011|917G).*\\b)\\s+build/i // Envizen Tablets\n ], [MODEL, [VENDOR, 'Envizen'], [TYPE, TABLET]], [\n\n /android.+[;\\/]\\s*(Le[\\s\\-]+Pan)[\\s\\-]+(\\w{1,9})\\s+build/i // Le Pan Tablets\n ], [VENDOR, MODEL, [TYPE, TABLET]], [\n\n /android.+[;\\/]\\s*(Trio[\\s\\-]*.*)\\s+build/i // MachSpeed Tablets\n ], [MODEL, [VENDOR, 'MachSpeed'], [TYPE, TABLET]], [\n\n /android.+[;\\/]\\s*(Trinity)[\\-\\s]*(T\\d{3})\\s+build/i // Trinity Tablets\n ], [VENDOR, MODEL, [TYPE, TABLET]], [\n\n /android.+[;\\/]\\s*TU_(1491)\\s+build/i // Rotor Tablets\n ], [MODEL, [VENDOR, 'Rotor'], [TYPE, TABLET]], [\n\n /android.+(KS(.+))\\s+build/i // Amazon Kindle Tablets\n ], [MODEL, [VENDOR, 'Amazon'], [TYPE, TABLET]], [\n\n /android.+(Gigaset)[\\s\\-]+(Q\\w{1,9})\\s+build/i // Gigaset Tablets\n ], [VENDOR, MODEL, [TYPE, TABLET]], [\n\n /\\s(tablet|tab)[;\\/]/i, // Unidentifiable Tablet\n /\\s(mobile)(?:[;\\/]|\\ssafari)/i // Unidentifiable Mobile\n ], [[TYPE, util.lowerize], VENDOR, MODEL], [\n\n /[\\s\\/\\(](smart-?tv)[;\\)]/i // SmartTV\n ], [[TYPE, SMARTTV]], [\n\n /(android[\\w\\.\\s\\-]{0,9});.+build/i // Generic Android Device\n ], [MODEL, [VENDOR, 'Generic']]\n ],\n\n engine : [[\n\n /windows.+\\sedge\\/([\\w\\.]+)/i // EdgeHTML\n ], [VERSION, [NAME, 'EdgeHTML']], [\n\n /webkit\\/537\\.36.+chrome\\/(?!27)([\\w\\.]+)/i // Blink\n ], [VERSION, [NAME, 'Blink']], [\n\n /(presto)\\/([\\w\\.]+)/i, // Presto\n /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\\/([\\w\\.]+)/i, \n // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna\n /(khtml|tasman|links)[\\/\\s]\\(?([\\w\\.]+)/i, // KHTML/Tasman/Links\n /(icab)[\\/\\s]([23]\\.[\\d\\.]+)/i // iCab\n ], [NAME, VERSION], [\n\n /rv\\:([\\w\\.]{1,9}).+(gecko)/i // Gecko\n ], [VERSION, NAME]\n ],\n\n os : [[\n\n // Windows based\n /microsoft\\s(windows)\\s(vista|xp)/i // Windows (iTunes)\n ], [NAME, VERSION], [\n /(windows)\\snt\\s6\\.2;\\s(arm)/i, // Windows RT\n /(windows\\sphone(?:\\sos)*)[\\s\\/]?([\\d\\.\\s\\w]*)/i, // Windows Phone\n /(windows\\smobile|windows)[\\s\\/]?([ntce\\d\\.\\s]+\\w)/i\n ], [NAME, [VERSION, mapper.str, maps.os.windows.version]], [\n /(win(?=3|9|n)|win\\s9x\\s)([nt\\d\\.]+)/i\n ], [[NAME, 'Windows'], [VERSION, mapper.str, maps.os.windows.version]], [\n\n // Mobile/Embedded OS\n /\\((bb)(10);/i // BlackBerry 10\n ], [[NAME, 'BlackBerry'], VERSION], [\n /(blackberry)\\w*\\/?([\\w\\.]*)/i, // Blackberry\n /(tizen|kaios)[\\/\\s]([\\w\\.]+)/i, // Tizen/KaiOS\n /(android|webos|palm\\sos|qnx|bada|rim\\stablet\\sos|meego|sailfish|contiki)[\\/\\s-]?([\\w\\.]*)/i\n // Android/WebOS/Palm/QNX/Bada/RIM/MeeGo/Contiki/Sailfish OS\n ], [NAME, VERSION], [\n /(symbian\\s?os|symbos|s60(?=;))[\\/\\s-]?([\\w\\.]*)/i // Symbian\n ], [[NAME, 'Symbian'], VERSION], [\n /\\((series40);/i // Series 40\n ], [NAME], [\n /mozilla.+\\(mobile;.+gecko.+firefox/i // Firefox OS\n ], [[NAME, 'Firefox OS'], VERSION], [\n\n // Console\n /(nintendo|playstation)\\s([wids34portablevu]+)/i, // Nintendo/Playstation\n\n // GNU/Linux based\n /(mint)[\\/\\s\\(]?(\\w*)/i, // Mint\n /(mageia|vectorlinux)[;\\s]/i, // Mageia/VectorLinux\n /(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|(?=\\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\\/\\s-]?(?!chrom)([\\w\\.-]*)/i,\n // Joli/Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware\n // Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus\n /(hurd|linux)\\s?([\\w\\.]*)/i, // Hurd/Linux\n /(gnu)\\s?([\\w\\.]*)/i // GNU\n ], [NAME, VERSION], [\n\n /(cros)\\s[\\w]+\\s([\\w\\.]+\\w)/i // Chromium OS\n ], [[NAME, 'Chromium OS'], VERSION],[\n\n // Solaris\n /(sunos)\\s?([\\w\\.\\d]*)/i // Solaris\n ], [[NAME, 'Solaris'], VERSION], [\n\n // BSD based\n /\\s([frentopc-]{0,4}bsd|dragonfly)\\s?([\\w\\.]*)/i // FreeBSD/NetBSD/OpenBSD/PC-BSD/DragonFly\n ], [NAME, VERSION],[\n\n /(haiku)\\s(\\w+)/i // Haiku\n ], [NAME, VERSION],[\n\n /cfnetwork\\/.+darwin/i,\n /ip[honead]{2,4}(?:.*os\\s([\\w]+)\\slike\\smac|;\\sopera)/i // iOS\n ], [[VERSION, /_/g, '.'], [NAME, 'iOS']], [\n\n /(mac\\sos\\sx)\\s?([\\w\\s\\.]*)/i,\n /(macintosh|mac(?=_powerpc)\\s)/i // Mac OS\n ], [[NAME, 'Mac OS'], [VERSION, /_/g, '.']], [\n\n // Other\n /((?:open)?solaris)[\\/\\s-]?([\\w\\.]*)/i, // Solaris\n /(aix)\\s((\\d)(?=\\.|\\)|\\s)[\\w\\.])*/i, // AIX\n /(plan\\s9|minix|beos|os\\/2|amigaos|morphos|risc\\sos|openvms|fuchsia)/i,\n // Plan9/Minix/BeOS/OS2/AmigaOS/MorphOS/RISCOS/OpenVMS/Fuchsia\n /(unix)\\s?([\\w\\.]*)/i // UNIX\n ], [NAME, VERSION]\n ]\n };\n\n\n /////////////////\n // Constructor\n ////////////////\n var UAParser = function (uastring, extensions) {\n\n if (typeof uastring === 'object') {\n extensions = uastring;\n uastring = undefined;\n }\n\n if (!(this instanceof UAParser)) {\n return new UAParser(uastring, extensions).getResult();\n }\n\n var ua = uastring || ((window && window.navigator && window.navigator.userAgent) ? window.navigator.userAgent : EMPTY);\n var rgxmap = extensions ? util.extend(regexes, extensions) : regexes;\n\n this.getBrowser = function () {\n var browser = { name: undefined, version: undefined };\n mapper.rgx.call(browser, ua, rgxmap.browser);\n browser.major = util.major(browser.version); // deprecated\n return browser;\n };\n this.getCPU = function () {\n var cpu = { architecture: undefined };\n mapper.rgx.call(cpu, ua, rgxmap.cpu);\n return cpu;\n };\n this.getDevice = function () {\n var device = { vendor: undefined, model: undefined, type: undefined };\n mapper.rgx.call(device, ua, rgxmap.device);\n return device;\n };\n this.getEngine = function () {\n var engine = { name: undefined, version: undefined };\n mapper.rgx.call(engine, ua, rgxmap.engine);\n return engine;\n };\n this.getOS = function () {\n var os = { name: undefined, version: undefined };\n mapper.rgx.call(os, ua, rgxmap.os);\n return os;\n };\n this.getResult = function () {\n return {\n ua : this.getUA(),\n browser : this.getBrowser(),\n engine : this.getEngine(),\n os : this.getOS(),\n device : this.getDevice(),\n cpu : this.getCPU()\n };\n };\n this.getUA = function () {\n return ua;\n };\n this.setUA = function (uastring) {\n ua = uastring;\n return this;\n };\n return this;\n };\n\n UAParser.VERSION = LIBVERSION;\n UAParser.BROWSER = {\n NAME : NAME,\n MAJOR : MAJOR, // deprecated\n VERSION : VERSION\n };\n UAParser.CPU = {\n ARCHITECTURE : ARCHITECTURE\n };\n UAParser.DEVICE = {\n MODEL : MODEL,\n VENDOR : VENDOR,\n TYPE : TYPE,\n CONSOLE : CONSOLE,\n MOBILE : MOBILE,\n SMARTTV : SMARTTV,\n TABLET : TABLET,\n WEARABLE: WEARABLE,\n EMBEDDED: EMBEDDED\n };\n UAParser.ENGINE = {\n NAME : NAME,\n VERSION : VERSION\n };\n UAParser.OS = {\n NAME : NAME,\n VERSION : VERSION\n };\n\n ///////////\n // Export\n //////////\n\n\n // check js environment\n if (typeof(exports) !== UNDEF_TYPE) {\n // nodejs env\n if (typeof module !== UNDEF_TYPE && module.exports) {\n exports = module.exports = UAParser;\n }\n exports.UAParser = UAParser;\n } else {\n // requirejs env (optional)\n if (true) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n return UAParser;\n }).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n }\n\n // jQuery/Zepto specific (optional)\n // Note:\n // In AMD env the global scope should be kept clean, but jQuery is an exception.\n // jQuery always exports to global scope, unless jQuery.noConflict(true) is used,\n // and we should catch that.\n var $ = window && (window.jQuery || window.Zepto);\n if ($ && !$.ua) {\n var parser = new UAParser();\n $.ua = parser.getResult();\n $.ua.get = function () {\n return parser.getUA();\n };\n $.ua.set = function (uastring) {\n parser.setUA(uastring);\n var result = parser.getResult();\n for (var prop in result) {\n $.ua[prop] = result[prop];\n }\n };\n }\n\n})(typeof window === 'object' ? window : this);\n\n\n//# sourceURL=webpack:///./node_modules/ua-parser-js/src/ua-parser.js?"); /***/ }), /***/ "./node_modules/vue-codemirror/dist/vue-codemirror.js": /*!************************************************************!*\ !*** ./node_modules/vue-codemirror/dist/vue-codemirror.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("!function(e,t){ true?module.exports=t(__webpack_require__(/*! codemirror */ \"./node_modules/codemirror/lib/codemirror.js\")):undefined}(this,function(e){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,\"a\",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p=\"/\",t(t.s=3)}([function(t,n){t.exports=e},function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var r=n(0),o=function(e){return e&&e.__esModule?e:{default:e}}(r),i=window.CodeMirror||o.default;\"function\"!=typeof Object.assign&&Object.defineProperty(Object,\"assign\",{value:function(e,t){if(null==e)throw new TypeError(\"Cannot convert undefined or null to object\");for(var n=Object(e),r=1;r -1\n}\n\nfunction isRouterError (err, errorType) {\n return isError(err) && err._isRouter && (errorType == null || err.type === errorType)\n}\n\nfunction extend (a, b) {\n for (var key in b) {\n a[key] = b[key];\n }\n return a\n}\n\nvar View = {\n name: 'RouterView',\n functional: true,\n props: {\n name: {\n type: String,\n default: 'default'\n }\n },\n render: function render (_, ref) {\n var props = ref.props;\n var children = ref.children;\n var parent = ref.parent;\n var data = ref.data;\n\n // used by devtools to display a router-view badge\n data.routerView = true;\n\n // directly use parent context's createElement() function\n // so that components rendered by router-view can resolve named slots\n var h = parent.$createElement;\n var name = props.name;\n var route = parent.$route;\n var cache = parent._routerViewCache || (parent._routerViewCache = {});\n\n // determine current view depth, also check to see if the tree\n // has been toggled inactive but kept-alive.\n var depth = 0;\n var inactive = false;\n while (parent && parent._routerRoot !== parent) {\n var vnodeData = parent.$vnode ? parent.$vnode.data : {};\n if (vnodeData.routerView) {\n depth++;\n }\n if (vnodeData.keepAlive && parent._directInactive && parent._inactive) {\n inactive = true;\n }\n parent = parent.$parent;\n }\n data.routerViewDepth = depth;\n\n // render previous view if the tree is inactive and kept-alive\n if (inactive) {\n var cachedData = cache[name];\n var cachedComponent = cachedData && cachedData.component;\n if (cachedComponent) {\n // #2301\n // pass props\n if (cachedData.configProps) {\n fillPropsinData(cachedComponent, data, cachedData.route, cachedData.configProps);\n }\n return h(cachedComponent, data, children)\n } else {\n // render previous empty view\n return h()\n }\n }\n\n var matched = route.matched[depth];\n var component = matched && matched.components[name];\n\n // render empty node if no matched route or no config component\n if (!matched || !component) {\n cache[name] = null;\n return h()\n }\n\n // cache component\n cache[name] = { component: component };\n\n // attach instance registration hook\n // this will be called in the instance's injected lifecycle hooks\n data.registerRouteInstance = function (vm, val) {\n // val could be undefined for unregistration\n var current = matched.instances[name];\n if (\n (val && current !== vm) ||\n (!val && current === vm)\n ) {\n matched.instances[name] = val;\n }\n }\n\n // also register instance in prepatch hook\n // in case the same component instance is reused across different routes\n ;(data.hook || (data.hook = {})).prepatch = function (_, vnode) {\n matched.instances[name] = vnode.componentInstance;\n };\n\n // register instance in init hook\n // in case kept-alive component be actived when routes changed\n data.hook.init = function (vnode) {\n if (vnode.data.keepAlive &&\n vnode.componentInstance &&\n vnode.componentInstance !== matched.instances[name]\n ) {\n matched.instances[name] = vnode.componentInstance;\n }\n };\n\n var configProps = matched.props && matched.props[name];\n // save route and configProps in cachce\n if (configProps) {\n extend(cache[name], {\n route: route,\n configProps: configProps\n });\n fillPropsinData(component, data, route, configProps);\n }\n\n return h(component, data, children)\n }\n};\n\nfunction fillPropsinData (component, data, route, configProps) {\n // resolve props\n var propsToPass = data.props = resolveProps(route, configProps);\n if (propsToPass) {\n // clone to prevent mutation\n propsToPass = data.props = extend({}, propsToPass);\n // pass non-declared props as attrs\n var attrs = data.attrs = data.attrs || {};\n for (var key in propsToPass) {\n if (!component.props || !(key in component.props)) {\n attrs[key] = propsToPass[key];\n delete propsToPass[key];\n }\n }\n }\n}\n\nfunction resolveProps (route, config) {\n switch (typeof config) {\n case 'undefined':\n return\n case 'object':\n return config\n case 'function':\n return config(route)\n case 'boolean':\n return config ? route.params : undefined\n default:\n if (true) {\n warn(\n false,\n \"props in \\\"\" + (route.path) + \"\\\" is a \" + (typeof config) + \", \" +\n \"expecting an object, function or boolean.\"\n );\n }\n }\n}\n\n/* */\n\nvar encodeReserveRE = /[!'()*]/g;\nvar encodeReserveReplacer = function (c) { return '%' + c.charCodeAt(0).toString(16); };\nvar commaRE = /%2C/g;\n\n// fixed encodeURIComponent which is more conformant to RFC3986:\n// - escapes [!'()*]\n// - preserve commas\nvar encode = function (str) { return encodeURIComponent(str)\n .replace(encodeReserveRE, encodeReserveReplacer)\n .replace(commaRE, ','); };\n\nvar decode = decodeURIComponent;\n\nfunction resolveQuery (\n query,\n extraQuery,\n _parseQuery\n) {\n if ( extraQuery === void 0 ) extraQuery = {};\n\n var parse = _parseQuery || parseQuery;\n var parsedQuery;\n try {\n parsedQuery = parse(query || '');\n } catch (e) {\n true && warn(false, e.message);\n parsedQuery = {};\n }\n for (var key in extraQuery) {\n parsedQuery[key] = extraQuery[key];\n }\n return parsedQuery\n}\n\nfunction parseQuery (query) {\n var res = {};\n\n query = query.trim().replace(/^(\\?|#|&)/, '');\n\n if (!query) {\n return res\n }\n\n query.split('&').forEach(function (param) {\n var parts = param.replace(/\\+/g, ' ').split('=');\n var key = decode(parts.shift());\n var val = parts.length > 0\n ? decode(parts.join('='))\n : null;\n\n if (res[key] === undefined) {\n res[key] = val;\n } else if (Array.isArray(res[key])) {\n res[key].push(val);\n } else {\n res[key] = [res[key], val];\n }\n });\n\n return res\n}\n\nfunction stringifyQuery (obj) {\n var res = obj ? Object.keys(obj).map(function (key) {\n var val = obj[key];\n\n if (val === undefined) {\n return ''\n }\n\n if (val === null) {\n return encode(key)\n }\n\n if (Array.isArray(val)) {\n var result = [];\n val.forEach(function (val2) {\n if (val2 === undefined) {\n return\n }\n if (val2 === null) {\n result.push(encode(key));\n } else {\n result.push(encode(key) + '=' + encode(val2));\n }\n });\n return result.join('&')\n }\n\n return encode(key) + '=' + encode(val)\n }).filter(function (x) { return x.length > 0; }).join('&') : null;\n return res ? (\"?\" + res) : ''\n}\n\n/* */\n\nvar trailingSlashRE = /\\/?$/;\n\nfunction createRoute (\n record,\n location,\n redirectedFrom,\n router\n) {\n var stringifyQuery = router && router.options.stringifyQuery;\n\n var query = location.query || {};\n try {\n query = clone(query);\n } catch (e) {}\n\n var route = {\n name: location.name || (record && record.name),\n meta: (record && record.meta) || {},\n path: location.path || '/',\n hash: location.hash || '',\n query: query,\n params: location.params || {},\n fullPath: getFullPath(location, stringifyQuery),\n matched: record ? formatMatch(record) : []\n };\n if (redirectedFrom) {\n route.redirectedFrom = getFullPath(redirectedFrom, stringifyQuery);\n }\n return Object.freeze(route)\n}\n\nfunction clone (value) {\n if (Array.isArray(value)) {\n return value.map(clone)\n } else if (value && typeof value === 'object') {\n var res = {};\n for (var key in value) {\n res[key] = clone(value[key]);\n }\n return res\n } else {\n return value\n }\n}\n\n// the starting route that represents the initial state\nvar START = createRoute(null, {\n path: '/'\n});\n\nfunction formatMatch (record) {\n var res = [];\n while (record) {\n res.unshift(record);\n record = record.parent;\n }\n return res\n}\n\nfunction getFullPath (\n ref,\n _stringifyQuery\n) {\n var path = ref.path;\n var query = ref.query; if ( query === void 0 ) query = {};\n var hash = ref.hash; if ( hash === void 0 ) hash = '';\n\n var stringify = _stringifyQuery || stringifyQuery;\n return (path || '/') + stringify(query) + hash\n}\n\nfunction isSameRoute (a, b) {\n if (b === START) {\n return a === b\n } else if (!b) {\n return false\n } else if (a.path && b.path) {\n return (\n a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '') &&\n a.hash === b.hash &&\n isObjectEqual(a.query, b.query)\n )\n } else if (a.name && b.name) {\n return (\n a.name === b.name &&\n a.hash === b.hash &&\n isObjectEqual(a.query, b.query) &&\n isObjectEqual(a.params, b.params)\n )\n } else {\n return false\n }\n}\n\nfunction isObjectEqual (a, b) {\n if ( a === void 0 ) a = {};\n if ( b === void 0 ) b = {};\n\n // handle null value #1566\n if (!a || !b) { return a === b }\n var aKeys = Object.keys(a);\n var bKeys = Object.keys(b);\n if (aKeys.length !== bKeys.length) {\n return false\n }\n return aKeys.every(function (key) {\n var aVal = a[key];\n var bVal = b[key];\n // check nested equality\n if (typeof aVal === 'object' && typeof bVal === 'object') {\n return isObjectEqual(aVal, bVal)\n }\n return String(aVal) === String(bVal)\n })\n}\n\nfunction isIncludedRoute (current, target) {\n return (\n current.path.replace(trailingSlashRE, '/').indexOf(\n target.path.replace(trailingSlashRE, '/')\n ) === 0 &&\n (!target.hash || current.hash === target.hash) &&\n queryIncludes(current.query, target.query)\n )\n}\n\nfunction queryIncludes (current, target) {\n for (var key in target) {\n if (!(key in current)) {\n return false\n }\n }\n return true\n}\n\n/* */\n\nfunction resolvePath (\n relative,\n base,\n append\n) {\n var firstChar = relative.charAt(0);\n if (firstChar === '/') {\n return relative\n }\n\n if (firstChar === '?' || firstChar === '#') {\n return base + relative\n }\n\n var stack = base.split('/');\n\n // remove trailing segment if:\n // - not appending\n // - appending to trailing slash (last segment is empty)\n if (!append || !stack[stack.length - 1]) {\n stack.pop();\n }\n\n // resolve relative path\n var segments = relative.replace(/^\\//, '').split('/');\n for (var i = 0; i < segments.length; i++) {\n var segment = segments[i];\n if (segment === '..') {\n stack.pop();\n } else if (segment !== '.') {\n stack.push(segment);\n }\n }\n\n // ensure leading slash\n if (stack[0] !== '') {\n stack.unshift('');\n }\n\n return stack.join('/')\n}\n\nfunction parsePath (path) {\n var hash = '';\n var query = '';\n\n var hashIndex = path.indexOf('#');\n if (hashIndex >= 0) {\n hash = path.slice(hashIndex);\n path = path.slice(0, hashIndex);\n }\n\n var queryIndex = path.indexOf('?');\n if (queryIndex >= 0) {\n query = path.slice(queryIndex + 1);\n path = path.slice(0, queryIndex);\n }\n\n return {\n path: path,\n query: query,\n hash: hash\n }\n}\n\nfunction cleanPath (path) {\n return path.replace(/\\/\\//g, '/')\n}\n\nvar isarray = Array.isArray || function (arr) {\n return Object.prototype.toString.call(arr) == '[object Array]';\n};\n\n/**\n * Expose `pathToRegexp`.\n */\nvar pathToRegexp_1 = pathToRegexp;\nvar parse_1 = parse;\nvar compile_1 = compile;\nvar tokensToFunction_1 = tokensToFunction;\nvar tokensToRegExp_1 = tokensToRegExp;\n\n/**\n * The main path matching regexp utility.\n *\n * @type {RegExp}\n */\nvar PATH_REGEXP = new RegExp([\n // Match escaped characters that would otherwise appear in future matches.\n // This allows the user to escape special characters that won't transform.\n '(\\\\\\\\.)',\n // Match Express-style parameters and un-named parameters with a prefix\n // and optional suffixes. Matches appear as:\n //\n // \"/:test(\\\\d+)?\" => [\"/\", \"test\", \"\\d+\", undefined, \"?\", undefined]\n // \"/route(\\\\d+)\" => [undefined, undefined, undefined, \"\\d+\", undefined, undefined]\n // \"/*\" => [\"/\", undefined, undefined, undefined, undefined, \"*\"]\n '([\\\\/.])?(?:(?:\\\\:(\\\\w+)(?:\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))?|\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))([+*?])?|(\\\\*))'\n].join('|'), 'g');\n\n/**\n * Parse a string for the raw tokens.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!Array}\n */\nfunction parse (str, options) {\n var tokens = [];\n var key = 0;\n var index = 0;\n var path = '';\n var defaultDelimiter = options && options.delimiter || '/';\n var res;\n\n while ((res = PATH_REGEXP.exec(str)) != null) {\n var m = res[0];\n var escaped = res[1];\n var offset = res.index;\n path += str.slice(index, offset);\n index = offset + m.length;\n\n // Ignore already escaped sequences.\n if (escaped) {\n path += escaped[1];\n continue\n }\n\n var next = str[index];\n var prefix = res[2];\n var name = res[3];\n var capture = res[4];\n var group = res[5];\n var modifier = res[6];\n var asterisk = res[7];\n\n // Push the current path onto the tokens.\n if (path) {\n tokens.push(path);\n path = '';\n }\n\n var partial = prefix != null && next != null && next !== prefix;\n var repeat = modifier === '+' || modifier === '*';\n var optional = modifier === '?' || modifier === '*';\n var delimiter = res[2] || defaultDelimiter;\n var pattern = capture || group;\n\n tokens.push({\n name: name || key++,\n prefix: prefix || '',\n delimiter: delimiter,\n optional: optional,\n repeat: repeat,\n partial: partial,\n asterisk: !!asterisk,\n pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')\n });\n }\n\n // Match any characters still remaining.\n if (index < str.length) {\n path += str.substr(index);\n }\n\n // If the path exists, push it onto the end.\n if (path) {\n tokens.push(path);\n }\n\n return tokens\n}\n\n/**\n * Compile a string to a template function for the path.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!function(Object=, Object=)}\n */\nfunction compile (str, options) {\n return tokensToFunction(parse(str, options), options)\n}\n\n/**\n * Prettier encoding of URI path segments.\n *\n * @param {string}\n * @return {string}\n */\nfunction encodeURIComponentPretty (str) {\n return encodeURI(str).replace(/[\\/?#]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\n/**\n * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.\n *\n * @param {string}\n * @return {string}\n */\nfunction encodeAsterisk (str) {\n return encodeURI(str).replace(/[?#]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\n/**\n * Expose a method for transforming tokens into the path function.\n */\nfunction tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length);\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options));\n }\n }\n\n return function (obj, opts) {\n var path = '';\n var data = obj || {};\n var options = opts || {};\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (typeof token === 'string') {\n path += token;\n\n continue\n }\n\n var value = data[token.name];\n var segment;\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix;\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j]);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment;\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment;\n }\n\n return path\n }\n}\n\n/**\n * Escape a regular expression string.\n *\n * @param {string} str\n * @return {string}\n */\nfunction escapeString (str) {\n return str.replace(/([.+*?=^!:${}()[\\]|\\/\\\\])/g, '\\\\$1')\n}\n\n/**\n * Escape the capturing group by escaping special characters and meaning.\n *\n * @param {string} group\n * @return {string}\n */\nfunction escapeGroup (group) {\n return group.replace(/([=!:$\\/()])/g, '\\\\$1')\n}\n\n/**\n * Attach the keys as a property of the regexp.\n *\n * @param {!RegExp} re\n * @param {Array} keys\n * @return {!RegExp}\n */\nfunction attachKeys (re, keys) {\n re.keys = keys;\n return re\n}\n\n/**\n * Get the flags for a regexp from the options.\n *\n * @param {Object} options\n * @return {string}\n */\nfunction flags (options) {\n return options && options.sensitive ? '' : 'i'\n}\n\n/**\n * Pull out keys from a regexp.\n *\n * @param {!RegExp} path\n * @param {!Array} keys\n * @return {!RegExp}\n */\nfunction regexpToRegexp (path, keys) {\n // Use a negative lookahead to match only capturing groups.\n var groups = path.source.match(/\\((?!\\?)/g);\n\n if (groups) {\n for (var i = 0; i < groups.length; i++) {\n keys.push({\n name: i,\n prefix: null,\n delimiter: null,\n optional: false,\n repeat: false,\n partial: false,\n asterisk: false,\n pattern: null\n });\n }\n }\n\n return attachKeys(path, keys)\n}\n\n/**\n * Transform an array into a regexp.\n *\n * @param {!Array} path\n * @param {Array} keys\n * @param {!Object} options\n * @return {!RegExp}\n */\nfunction arrayToRegexp (path, keys, options) {\n var parts = [];\n\n for (var i = 0; i < path.length; i++) {\n parts.push(pathToRegexp(path[i], keys, options).source);\n }\n\n var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options));\n\n return attachKeys(regexp, keys)\n}\n\n/**\n * Create a path regexp from string input.\n *\n * @param {string} path\n * @param {!Array} keys\n * @param {!Object} options\n * @return {!RegExp}\n */\nfunction stringToRegexp (path, keys, options) {\n return tokensToRegExp(parse(path, options), keys, options)\n}\n\n/**\n * Expose a function for taking tokens and returning a RegExp.\n *\n * @param {!Array} tokens\n * @param {(Array|Object)=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction tokensToRegExp (tokens, keys, options) {\n if (!isarray(keys)) {\n options = /** @type {!Object} */ (keys || options);\n keys = [];\n }\n\n options = options || {};\n\n var strict = options.strict;\n var end = options.end !== false;\n var route = '';\n\n // Iterate over the tokens and create our regexp string.\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (typeof token === 'string') {\n route += escapeString(token);\n } else {\n var prefix = escapeString(token.prefix);\n var capture = '(?:' + token.pattern + ')';\n\n keys.push(token);\n\n if (token.repeat) {\n capture += '(?:' + prefix + capture + ')*';\n }\n\n if (token.optional) {\n if (!token.partial) {\n capture = '(?:' + prefix + '(' + capture + '))?';\n } else {\n capture = prefix + '(' + capture + ')?';\n }\n } else {\n capture = prefix + '(' + capture + ')';\n }\n\n route += capture;\n }\n }\n\n var delimiter = escapeString(options.delimiter || '/');\n var endsWithDelimiter = route.slice(-delimiter.length) === delimiter;\n\n // In non-strict mode we allow a slash at the end of match. If the path to\n // match already ends with a slash, we remove it for consistency. The slash\n // is valid at the end of a path match, not in the middle. This is important\n // in non-ending mode, where \"/test/\" shouldn't match \"/test//route\".\n if (!strict) {\n route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?';\n }\n\n if (end) {\n route += '$';\n } else {\n // In non-ending mode, we need the capturing groups to match as much as\n // possible by using a positive lookahead to the end or next path segment.\n route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)';\n }\n\n return attachKeys(new RegExp('^' + route, flags(options)), keys)\n}\n\n/**\n * Normalize the given path string, returning a regular expression.\n *\n * An empty array can be passed in for the keys, which will hold the\n * placeholder key descriptions. For example, using `/user/:id`, `keys` will\n * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.\n *\n * @param {(string|RegExp|Array)} path\n * @param {(Array|Object)=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction pathToRegexp (path, keys, options) {\n if (!isarray(keys)) {\n options = /** @type {!Object} */ (keys || options);\n keys = [];\n }\n\n options = options || {};\n\n if (path instanceof RegExp) {\n return regexpToRegexp(path, /** @type {!Array} */ (keys))\n }\n\n if (isarray(path)) {\n return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)\n }\n\n return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)\n}\npathToRegexp_1.parse = parse_1;\npathToRegexp_1.compile = compile_1;\npathToRegexp_1.tokensToFunction = tokensToFunction_1;\npathToRegexp_1.tokensToRegExp = tokensToRegExp_1;\n\n/* */\n\n// $flow-disable-line\nvar regexpCompileCache = Object.create(null);\n\nfunction fillParams (\n path,\n params,\n routeMsg\n) {\n params = params || {};\n try {\n var filler =\n regexpCompileCache[path] ||\n (regexpCompileCache[path] = pathToRegexp_1.compile(path));\n\n // Fix #2505 resolving asterisk routes { name: 'not-found', params: { pathMatch: '/not-found' }}\n // and fix #3106 so that you can work with location descriptor object having params.pathMatch equal to empty string\n if (typeof params.pathMatch === 'string') { params[0] = params.pathMatch; }\n\n return filler(params, { pretty: true })\n } catch (e) {\n if (true) {\n // Fix #3072 no warn if `pathMatch` is string\n warn(typeof params.pathMatch === 'string', (\"missing param for \" + routeMsg + \": \" + (e.message)));\n }\n return ''\n } finally {\n // delete the 0 if it was added\n delete params[0];\n }\n}\n\n/* */\n\nfunction normalizeLocation (\n raw,\n current,\n append,\n router\n) {\n var next = typeof raw === 'string' ? { path: raw } : raw;\n // named target\n if (next._normalized) {\n return next\n } else if (next.name) {\n next = extend({}, raw);\n var params = next.params;\n if (params && typeof params === 'object') {\n next.params = extend({}, params);\n }\n return next\n }\n\n // relative params\n if (!next.path && next.params && current) {\n next = extend({}, next);\n next._normalized = true;\n var params$1 = extend(extend({}, current.params), next.params);\n if (current.name) {\n next.name = current.name;\n next.params = params$1;\n } else if (current.matched.length) {\n var rawPath = current.matched[current.matched.length - 1].path;\n next.path = fillParams(rawPath, params$1, (\"path \" + (current.path)));\n } else if (true) {\n warn(false, \"relative params navigation requires a current route.\");\n }\n return next\n }\n\n var parsedPath = parsePath(next.path || '');\n var basePath = (current && current.path) || '/';\n var path = parsedPath.path\n ? resolvePath(parsedPath.path, basePath, append || next.append)\n : basePath;\n\n var query = resolveQuery(\n parsedPath.query,\n next.query,\n router && router.options.parseQuery\n );\n\n var hash = next.hash || parsedPath.hash;\n if (hash && hash.charAt(0) !== '#') {\n hash = \"#\" + hash;\n }\n\n return {\n _normalized: true,\n path: path,\n query: query,\n hash: hash\n }\n}\n\n/* */\n\n// work around weird flow bug\nvar toTypes = [String, Object];\nvar eventTypes = [String, Array];\n\nvar noop = function () {};\n\nvar Link = {\n name: 'RouterLink',\n props: {\n to: {\n type: toTypes,\n required: true\n },\n tag: {\n type: String,\n default: 'a'\n },\n exact: Boolean,\n append: Boolean,\n replace: Boolean,\n activeClass: String,\n exactActiveClass: String,\n ariaCurrentValue: {\n type: String,\n default: 'page'\n },\n event: {\n type: eventTypes,\n default: 'click'\n }\n },\n render: function render (h) {\n var this$1 = this;\n\n var router = this.$router;\n var current = this.$route;\n var ref = router.resolve(\n this.to,\n current,\n this.append\n );\n var location = ref.location;\n var route = ref.route;\n var href = ref.href;\n\n var classes = {};\n var globalActiveClass = router.options.linkActiveClass;\n var globalExactActiveClass = router.options.linkExactActiveClass;\n // Support global empty active class\n var activeClassFallback =\n globalActiveClass == null ? 'router-link-active' : globalActiveClass;\n var exactActiveClassFallback =\n globalExactActiveClass == null\n ? 'router-link-exact-active'\n : globalExactActiveClass;\n var activeClass =\n this.activeClass == null ? activeClassFallback : this.activeClass;\n var exactActiveClass =\n this.exactActiveClass == null\n ? exactActiveClassFallback\n : this.exactActiveClass;\n\n var compareTarget = route.redirectedFrom\n ? createRoute(null, normalizeLocation(route.redirectedFrom), null, router)\n : route;\n\n classes[exactActiveClass] = isSameRoute(current, compareTarget);\n classes[activeClass] = this.exact\n ? classes[exactActiveClass]\n : isIncludedRoute(current, compareTarget);\n\n var ariaCurrentValue = classes[exactActiveClass] ? this.ariaCurrentValue : null;\n\n var handler = function (e) {\n if (guardEvent(e)) {\n if (this$1.replace) {\n router.replace(location, noop);\n } else {\n router.push(location, noop);\n }\n }\n };\n\n var on = { click: guardEvent };\n if (Array.isArray(this.event)) {\n this.event.forEach(function (e) {\n on[e] = handler;\n });\n } else {\n on[this.event] = handler;\n }\n\n var data = { class: classes };\n\n var scopedSlot =\n !this.$scopedSlots.$hasNormal &&\n this.$scopedSlots.default &&\n this.$scopedSlots.default({\n href: href,\n route: route,\n navigate: handler,\n isActive: classes[activeClass],\n isExactActive: classes[exactActiveClass]\n });\n\n if (scopedSlot) {\n if (scopedSlot.length === 1) {\n return scopedSlot[0]\n } else if (scopedSlot.length > 1 || !scopedSlot.length) {\n if (true) {\n warn(\n false,\n (\"RouterLink with to=\\\"\" + (this.to) + \"\\\" is trying to use a scoped slot but it didn't provide exactly one child. Wrapping the content with a span element.\")\n );\n }\n return scopedSlot.length === 0 ? h() : h('span', {}, scopedSlot)\n }\n }\n\n if (this.tag === 'a') {\n data.on = on;\n data.attrs = { href: href, 'aria-current': ariaCurrentValue };\n } else {\n // find the first
child and apply listener and href\n var a = findAnchor(this.$slots.default);\n if (a) {\n // in case the is a static node\n a.isStatic = false;\n var aData = (a.data = extend({}, a.data));\n aData.on = aData.on || {};\n // transform existing events in both objects into arrays so we can push later\n for (var event in aData.on) {\n var handler$1 = aData.on[event];\n if (event in on) {\n aData.on[event] = Array.isArray(handler$1) ? handler$1 : [handler$1];\n }\n }\n // append new listeners for router-link\n for (var event$1 in on) {\n if (event$1 in aData.on) {\n // on[event] is always a function\n aData.on[event$1].push(on[event$1]);\n } else {\n aData.on[event$1] = handler;\n }\n }\n\n var aAttrs = (a.data.attrs = extend({}, a.data.attrs));\n aAttrs.href = href;\n aAttrs['aria-current'] = ariaCurrentValue;\n } else {\n // doesn't have child, apply listener to self\n data.on = on;\n }\n }\n\n return h(this.tag, data, this.$slots.default)\n }\n};\n\nfunction guardEvent (e) {\n // don't redirect with control keys\n if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) { return }\n // don't redirect when preventDefault called\n if (e.defaultPrevented) { return }\n // don't redirect on right click\n if (e.button !== undefined && e.button !== 0) { return }\n // don't redirect if `target=\"_blank\"`\n if (e.currentTarget && e.currentTarget.getAttribute) {\n var target = e.currentTarget.getAttribute('target');\n if (/\\b_blank\\b/i.test(target)) { return }\n }\n // this may be a Weex event which doesn't have this method\n if (e.preventDefault) {\n e.preventDefault();\n }\n return true\n}\n\nfunction findAnchor (children) {\n if (children) {\n var child;\n for (var i = 0; i < children.length; i++) {\n child = children[i];\n if (child.tag === 'a') {\n return child\n }\n if (child.children && (child = findAnchor(child.children))) {\n return child\n }\n }\n }\n}\n\nvar _Vue;\n\nfunction install (Vue) {\n if (install.installed && _Vue === Vue) { return }\n install.installed = true;\n\n _Vue = Vue;\n\n var isDef = function (v) { return v !== undefined; };\n\n var registerInstance = function (vm, callVal) {\n var i = vm.$options._parentVnode;\n if (isDef(i) && isDef(i = i.data) && isDef(i = i.registerRouteInstance)) {\n i(vm, callVal);\n }\n };\n\n Vue.mixin({\n beforeCreate: function beforeCreate () {\n if (isDef(this.$options.router)) {\n this._routerRoot = this;\n this._router = this.$options.router;\n this._router.init(this);\n Vue.util.defineReactive(this, '_route', this._router.history.current);\n } else {\n this._routerRoot = (this.$parent && this.$parent._routerRoot) || this;\n }\n registerInstance(this, this);\n },\n destroyed: function destroyed () {\n registerInstance(this);\n }\n });\n\n Object.defineProperty(Vue.prototype, '$router', {\n get: function get () { return this._routerRoot._router }\n });\n\n Object.defineProperty(Vue.prototype, '$route', {\n get: function get () { return this._routerRoot._route }\n });\n\n Vue.component('RouterView', View);\n Vue.component('RouterLink', Link);\n\n var strats = Vue.config.optionMergeStrategies;\n // use the same hook merging strategy for route hooks\n strats.beforeRouteEnter = strats.beforeRouteLeave = strats.beforeRouteUpdate = strats.created;\n}\n\n/* */\n\nvar inBrowser = typeof window !== 'undefined';\n\n/* */\n\nfunction createRouteMap (\n routes,\n oldPathList,\n oldPathMap,\n oldNameMap\n) {\n // the path list is used to control path matching priority\n var pathList = oldPathList || [];\n // $flow-disable-line\n var pathMap = oldPathMap || Object.create(null);\n // $flow-disable-line\n var nameMap = oldNameMap || Object.create(null);\n\n routes.forEach(function (route) {\n addRouteRecord(pathList, pathMap, nameMap, route);\n });\n\n // ensure wildcard routes are always at the end\n for (var i = 0, l = pathList.length; i < l; i++) {\n if (pathList[i] === '*') {\n pathList.push(pathList.splice(i, 1)[0]);\n l--;\n i--;\n }\n }\n\n if (true) {\n // warn if routes do not include leading slashes\n var found = pathList\n // check for missing leading slash\n .filter(function (path) { return path && path.charAt(0) !== '*' && path.charAt(0) !== '/'; });\n\n if (found.length > 0) {\n var pathNames = found.map(function (path) { return (\"- \" + path); }).join('\\n');\n warn(false, (\"Non-nested routes must include a leading slash character. Fix the following routes: \\n\" + pathNames));\n }\n }\n\n return {\n pathList: pathList,\n pathMap: pathMap,\n nameMap: nameMap\n }\n}\n\nfunction addRouteRecord (\n pathList,\n pathMap,\n nameMap,\n route,\n parent,\n matchAs\n) {\n var path = route.path;\n var name = route.name;\n if (true) {\n assert(path != null, \"\\\"path\\\" is required in a route configuration.\");\n assert(\n typeof route.component !== 'string',\n \"route config \\\"component\\\" for path: \" + (String(\n path || name\n )) + \" cannot be a \" + \"string id. Use an actual component instead.\"\n );\n }\n\n var pathToRegexpOptions =\n route.pathToRegexpOptions || {};\n var normalizedPath = normalizePath(path, parent, pathToRegexpOptions.strict);\n\n if (typeof route.caseSensitive === 'boolean') {\n pathToRegexpOptions.sensitive = route.caseSensitive;\n }\n\n var record = {\n path: normalizedPath,\n regex: compileRouteRegex(normalizedPath, pathToRegexpOptions),\n components: route.components || { default: route.component },\n instances: {},\n name: name,\n parent: parent,\n matchAs: matchAs,\n redirect: route.redirect,\n beforeEnter: route.beforeEnter,\n meta: route.meta || {},\n props:\n route.props == null\n ? {}\n : route.components\n ? route.props\n : { default: route.props }\n };\n\n if (route.children) {\n // Warn if route is named, does not redirect and has a default child route.\n // If users navigate to this route by name, the default child will\n // not be rendered (GH Issue #629)\n if (true) {\n if (\n route.name &&\n !route.redirect &&\n route.children.some(function (child) { return /^\\/?$/.test(child.path); })\n ) {\n warn(\n false,\n \"Named Route '\" + (route.name) + \"' has a default child route. \" +\n \"When navigating to this named route (:to=\\\"{name: '\" + (route.name) + \"'\\\"), \" +\n \"the default child route will not be rendered. Remove the name from \" +\n \"this route and use the name of the default child route for named \" +\n \"links instead.\"\n );\n }\n }\n route.children.forEach(function (child) {\n var childMatchAs = matchAs\n ? cleanPath((matchAs + \"/\" + (child.path)))\n : undefined;\n addRouteRecord(pathList, pathMap, nameMap, child, record, childMatchAs);\n });\n }\n\n if (!pathMap[record.path]) {\n pathList.push(record.path);\n pathMap[record.path] = record;\n }\n\n if (route.alias !== undefined) {\n var aliases = Array.isArray(route.alias) ? route.alias : [route.alias];\n for (var i = 0; i < aliases.length; ++i) {\n var alias = aliases[i];\n if ( true && alias === path) {\n warn(\n false,\n (\"Found an alias with the same value as the path: \\\"\" + path + \"\\\". You have to remove that alias. It will be ignored in development.\")\n );\n // skip in dev to make it work\n continue\n }\n\n var aliasRoute = {\n path: alias,\n children: route.children\n };\n addRouteRecord(\n pathList,\n pathMap,\n nameMap,\n aliasRoute,\n parent,\n record.path || '/' // matchAs\n );\n }\n }\n\n if (name) {\n if (!nameMap[name]) {\n nameMap[name] = record;\n } else if ( true && !matchAs) {\n warn(\n false,\n \"Duplicate named routes definition: \" +\n \"{ name: \\\"\" + name + \"\\\", path: \\\"\" + (record.path) + \"\\\" }\"\n );\n }\n }\n}\n\nfunction compileRouteRegex (\n path,\n pathToRegexpOptions\n) {\n var regex = pathToRegexp_1(path, [], pathToRegexpOptions);\n if (true) {\n var keys = Object.create(null);\n regex.keys.forEach(function (key) {\n warn(\n !keys[key.name],\n (\"Duplicate param keys in route with path: \\\"\" + path + \"\\\"\")\n );\n keys[key.name] = true;\n });\n }\n return regex\n}\n\nfunction normalizePath (\n path,\n parent,\n strict\n) {\n if (!strict) { path = path.replace(/\\/$/, ''); }\n if (path[0] === '/') { return path }\n if (parent == null) { return path }\n return cleanPath(((parent.path) + \"/\" + path))\n}\n\n/* */\n\n\n\nfunction createMatcher (\n routes,\n router\n) {\n var ref = createRouteMap(routes);\n var pathList = ref.pathList;\n var pathMap = ref.pathMap;\n var nameMap = ref.nameMap;\n\n function addRoutes (routes) {\n createRouteMap(routes, pathList, pathMap, nameMap);\n }\n\n function match (\n raw,\n currentRoute,\n redirectedFrom\n ) {\n var location = normalizeLocation(raw, currentRoute, false, router);\n var name = location.name;\n\n if (name) {\n var record = nameMap[name];\n if (true) {\n warn(record, (\"Route with name '\" + name + \"' does not exist\"));\n }\n if (!record) { return _createRoute(null, location) }\n var paramNames = record.regex.keys\n .filter(function (key) { return !key.optional; })\n .map(function (key) { return key.name; });\n\n if (typeof location.params !== 'object') {\n location.params = {};\n }\n\n if (currentRoute && typeof currentRoute.params === 'object') {\n for (var key in currentRoute.params) {\n if (!(key in location.params) && paramNames.indexOf(key) > -1) {\n location.params[key] = currentRoute.params[key];\n }\n }\n }\n\n location.path = fillParams(record.path, location.params, (\"named route \\\"\" + name + \"\\\"\"));\n return _createRoute(record, location, redirectedFrom)\n } else if (location.path) {\n location.params = {};\n for (var i = 0; i < pathList.length; i++) {\n var path = pathList[i];\n var record$1 = pathMap[path];\n if (matchRoute(record$1.regex, location.path, location.params)) {\n return _createRoute(record$1, location, redirectedFrom)\n }\n }\n }\n // no match\n return _createRoute(null, location)\n }\n\n function redirect (\n record,\n location\n ) {\n var originalRedirect = record.redirect;\n var redirect = typeof originalRedirect === 'function'\n ? originalRedirect(createRoute(record, location, null, router))\n : originalRedirect;\n\n if (typeof redirect === 'string') {\n redirect = { path: redirect };\n }\n\n if (!redirect || typeof redirect !== 'object') {\n if (true) {\n warn(\n false, (\"invalid redirect option: \" + (JSON.stringify(redirect)))\n );\n }\n return _createRoute(null, location)\n }\n\n var re = redirect;\n var name = re.name;\n var path = re.path;\n var query = location.query;\n var hash = location.hash;\n var params = location.params;\n query = re.hasOwnProperty('query') ? re.query : query;\n hash = re.hasOwnProperty('hash') ? re.hash : hash;\n params = re.hasOwnProperty('params') ? re.params : params;\n\n if (name) {\n // resolved named direct\n var targetRecord = nameMap[name];\n if (true) {\n assert(targetRecord, (\"redirect failed: named route \\\"\" + name + \"\\\" not found.\"));\n }\n return match({\n _normalized: true,\n name: name,\n query: query,\n hash: hash,\n params: params\n }, undefined, location)\n } else if (path) {\n // 1. resolve relative redirect\n var rawPath = resolveRecordPath(path, record);\n // 2. resolve params\n var resolvedPath = fillParams(rawPath, params, (\"redirect route with path \\\"\" + rawPath + \"\\\"\"));\n // 3. rematch with existing query and hash\n return match({\n _normalized: true,\n path: resolvedPath,\n query: query,\n hash: hash\n }, undefined, location)\n } else {\n if (true) {\n warn(false, (\"invalid redirect option: \" + (JSON.stringify(redirect))));\n }\n return _createRoute(null, location)\n }\n }\n\n function alias (\n record,\n location,\n matchAs\n ) {\n var aliasedPath = fillParams(matchAs, location.params, (\"aliased route with path \\\"\" + matchAs + \"\\\"\"));\n var aliasedMatch = match({\n _normalized: true,\n path: aliasedPath\n });\n if (aliasedMatch) {\n var matched = aliasedMatch.matched;\n var aliasedRecord = matched[matched.length - 1];\n location.params = aliasedMatch.params;\n return _createRoute(aliasedRecord, location)\n }\n return _createRoute(null, location)\n }\n\n function _createRoute (\n record,\n location,\n redirectedFrom\n ) {\n if (record && record.redirect) {\n return redirect(record, redirectedFrom || location)\n }\n if (record && record.matchAs) {\n return alias(record, location, record.matchAs)\n }\n return createRoute(record, location, redirectedFrom, router)\n }\n\n return {\n match: match,\n addRoutes: addRoutes\n }\n}\n\nfunction matchRoute (\n regex,\n path,\n params\n) {\n var m = path.match(regex);\n\n if (!m) {\n return false\n } else if (!params) {\n return true\n }\n\n for (var i = 1, len = m.length; i < len; ++i) {\n var key = regex.keys[i - 1];\n var val = typeof m[i] === 'string' ? decodeURIComponent(m[i]) : m[i];\n if (key) {\n // Fix #1994: using * with props: true generates a param named 0\n params[key.name || 'pathMatch'] = val;\n }\n }\n\n return true\n}\n\nfunction resolveRecordPath (path, record) {\n return resolvePath(path, record.parent ? record.parent.path : '/', true)\n}\n\n/* */\n\n// use User Timing api (if present) for more accurate key precision\nvar Time =\n inBrowser && window.performance && window.performance.now\n ? window.performance\n : Date;\n\nfunction genStateKey () {\n return Time.now().toFixed(3)\n}\n\nvar _key = genStateKey();\n\nfunction getStateKey () {\n return _key\n}\n\nfunction setStateKey (key) {\n return (_key = key)\n}\n\n/* */\n\nvar positionStore = Object.create(null);\n\nfunction setupScroll () {\n // Prevent browser scroll behavior on History popstate\n if ('scrollRestoration' in window.history) {\n window.history.scrollRestoration = 'manual';\n }\n // Fix for #1585 for Firefox\n // Fix for #2195 Add optional third attribute to workaround a bug in safari https://bugs.webkit.org/show_bug.cgi?id=182678\n // Fix for #2774 Support for apps loaded from Windows file shares not mapped to network drives: replaced location.origin with\n // window.location.protocol + '//' + window.location.host\n // location.host contains the port and location.hostname doesn't\n var protocolAndPath = window.location.protocol + '//' + window.location.host;\n var absolutePath = window.location.href.replace(protocolAndPath, '');\n // preserve existing history state as it could be overriden by the user\n var stateCopy = extend({}, window.history.state);\n stateCopy.key = getStateKey();\n window.history.replaceState(stateCopy, '', absolutePath);\n window.addEventListener('popstate', handlePopState);\n return function () {\n window.removeEventListener('popstate', handlePopState);\n }\n}\n\nfunction handleScroll (\n router,\n to,\n from,\n isPop\n) {\n if (!router.app) {\n return\n }\n\n var behavior = router.options.scrollBehavior;\n if (!behavior) {\n return\n }\n\n if (true) {\n assert(typeof behavior === 'function', \"scrollBehavior must be a function\");\n }\n\n // wait until re-render finishes before scrolling\n router.app.$nextTick(function () {\n var position = getScrollPosition();\n var shouldScroll = behavior.call(\n router,\n to,\n from,\n isPop ? position : null\n );\n\n if (!shouldScroll) {\n return\n }\n\n if (typeof shouldScroll.then === 'function') {\n shouldScroll\n .then(function (shouldScroll) {\n scrollToPosition((shouldScroll), position);\n })\n .catch(function (err) {\n if (true) {\n assert(false, err.toString());\n }\n });\n } else {\n scrollToPosition(shouldScroll, position);\n }\n });\n}\n\nfunction saveScrollPosition () {\n var key = getStateKey();\n if (key) {\n positionStore[key] = {\n x: window.pageXOffset,\n y: window.pageYOffset\n };\n }\n}\n\nfunction handlePopState (e) {\n saveScrollPosition();\n if (e.state && e.state.key) {\n setStateKey(e.state.key);\n }\n}\n\nfunction getScrollPosition () {\n var key = getStateKey();\n if (key) {\n return positionStore[key]\n }\n}\n\nfunction getElementPosition (el, offset) {\n var docEl = document.documentElement;\n var docRect = docEl.getBoundingClientRect();\n var elRect = el.getBoundingClientRect();\n return {\n x: elRect.left - docRect.left - offset.x,\n y: elRect.top - docRect.top - offset.y\n }\n}\n\nfunction isValidPosition (obj) {\n return isNumber(obj.x) || isNumber(obj.y)\n}\n\nfunction normalizePosition (obj) {\n return {\n x: isNumber(obj.x) ? obj.x : window.pageXOffset,\n y: isNumber(obj.y) ? obj.y : window.pageYOffset\n }\n}\n\nfunction normalizeOffset (obj) {\n return {\n x: isNumber(obj.x) ? obj.x : 0,\n y: isNumber(obj.y) ? obj.y : 0\n }\n}\n\nfunction isNumber (v) {\n return typeof v === 'number'\n}\n\nvar hashStartsWithNumberRE = /^#\\d/;\n\nfunction scrollToPosition (shouldScroll, position) {\n var isObject = typeof shouldScroll === 'object';\n if (isObject && typeof shouldScroll.selector === 'string') {\n // getElementById would still fail if the selector contains a more complicated query like #main[data-attr]\n // but at the same time, it doesn't make much sense to select an element with an id and an extra selector\n var el = hashStartsWithNumberRE.test(shouldScroll.selector) // $flow-disable-line\n ? document.getElementById(shouldScroll.selector.slice(1)) // $flow-disable-line\n : document.querySelector(shouldScroll.selector);\n\n if (el) {\n var offset =\n shouldScroll.offset && typeof shouldScroll.offset === 'object'\n ? shouldScroll.offset\n : {};\n offset = normalizeOffset(offset);\n position = getElementPosition(el, offset);\n } else if (isValidPosition(shouldScroll)) {\n position = normalizePosition(shouldScroll);\n }\n } else if (isObject && isValidPosition(shouldScroll)) {\n position = normalizePosition(shouldScroll);\n }\n\n if (position) {\n window.scrollTo(position.x, position.y);\n }\n}\n\n/* */\n\nvar supportsPushState =\n inBrowser &&\n (function () {\n var ua = window.navigator.userAgent;\n\n if (\n (ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) &&\n ua.indexOf('Mobile Safari') !== -1 &&\n ua.indexOf('Chrome') === -1 &&\n ua.indexOf('Windows Phone') === -1\n ) {\n return false\n }\n\n return window.history && typeof window.history.pushState === 'function'\n })();\n\nfunction pushState (url, replace) {\n saveScrollPosition();\n // try...catch the pushState call to get around Safari\n // DOM Exception 18 where it limits to 100 pushState calls\n var history = window.history;\n try {\n if (replace) {\n // preserve existing history state as it could be overriden by the user\n var stateCopy = extend({}, history.state);\n stateCopy.key = getStateKey();\n history.replaceState(stateCopy, '', url);\n } else {\n history.pushState({ key: setStateKey(genStateKey()) }, '', url);\n }\n } catch (e) {\n window.location[replace ? 'replace' : 'assign'](url);\n }\n}\n\nfunction replaceState (url) {\n pushState(url, true);\n}\n\n/* */\n\nfunction runQueue (queue, fn, cb) {\n var step = function (index) {\n if (index >= queue.length) {\n cb();\n } else {\n if (queue[index]) {\n fn(queue[index], function () {\n step(index + 1);\n });\n } else {\n step(index + 1);\n }\n }\n };\n step(0);\n}\n\n/* */\n\nfunction resolveAsyncComponents (matched) {\n return function (to, from, next) {\n var hasAsync = false;\n var pending = 0;\n var error = null;\n\n flatMapComponents(matched, function (def, _, match, key) {\n // if it's a function and doesn't have cid attached,\n // assume it's an async component resolve function.\n // we are not using Vue's default async resolving mechanism because\n // we want to halt the navigation until the incoming component has been\n // resolved.\n if (typeof def === 'function' && def.cid === undefined) {\n hasAsync = true;\n pending++;\n\n var resolve = once(function (resolvedDef) {\n if (isESModule(resolvedDef)) {\n resolvedDef = resolvedDef.default;\n }\n // save resolved on async factory in case it's used elsewhere\n def.resolved = typeof resolvedDef === 'function'\n ? resolvedDef\n : _Vue.extend(resolvedDef);\n match.components[key] = resolvedDef;\n pending--;\n if (pending <= 0) {\n next();\n }\n });\n\n var reject = once(function (reason) {\n var msg = \"Failed to resolve async component \" + key + \": \" + reason;\n true && warn(false, msg);\n if (!error) {\n error = isError(reason)\n ? reason\n : new Error(msg);\n next(error);\n }\n });\n\n var res;\n try {\n res = def(resolve, reject);\n } catch (e) {\n reject(e);\n }\n if (res) {\n if (typeof res.then === 'function') {\n res.then(resolve, reject);\n } else {\n // new syntax in Vue 2.3\n var comp = res.component;\n if (comp && typeof comp.then === 'function') {\n comp.then(resolve, reject);\n }\n }\n }\n }\n });\n\n if (!hasAsync) { next(); }\n }\n}\n\nfunction flatMapComponents (\n matched,\n fn\n) {\n return flatten(matched.map(function (m) {\n return Object.keys(m.components).map(function (key) { return fn(\n m.components[key],\n m.instances[key],\n m, key\n ); })\n }))\n}\n\nfunction flatten (arr) {\n return Array.prototype.concat.apply([], arr)\n}\n\nvar hasSymbol =\n typeof Symbol === 'function' &&\n typeof Symbol.toStringTag === 'symbol';\n\nfunction isESModule (obj) {\n return obj.__esModule || (hasSymbol && obj[Symbol.toStringTag] === 'Module')\n}\n\n// in Webpack 2, require.ensure now also returns a Promise\n// so the resolve/reject functions may get called an extra time\n// if the user uses an arrow function shorthand that happens to\n// return that Promise.\nfunction once (fn) {\n var called = false;\n return function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n if (called) { return }\n called = true;\n return fn.apply(this, args)\n }\n}\n\nvar NavigationFailureType = {\n redirected: 1,\n aborted: 2,\n cancelled: 3,\n duplicated: 4\n};\n\nfunction createNavigationRedirectedError (from, to) {\n return createRouterError(\n from,\n to,\n NavigationFailureType.redirected,\n (\"Redirected when going from \\\"\" + (from.fullPath) + \"\\\" to \\\"\" + (stringifyRoute(\n to\n )) + \"\\\" via a navigation guard.\")\n )\n}\n\nfunction createNavigationDuplicatedError (from, to) {\n return createRouterError(\n from,\n to,\n NavigationFailureType.duplicated,\n (\"Avoided redundant navigation to current location: \\\"\" + (from.fullPath) + \"\\\".\")\n )\n}\n\nfunction createNavigationCancelledError (from, to) {\n return createRouterError(\n from,\n to,\n NavigationFailureType.cancelled,\n (\"Navigation cancelled from \\\"\" + (from.fullPath) + \"\\\" to \\\"\" + (to.fullPath) + \"\\\" with a new navigation.\")\n )\n}\n\nfunction createNavigationAbortedError (from, to) {\n return createRouterError(\n from,\n to,\n NavigationFailureType.aborted,\n (\"Navigation aborted from \\\"\" + (from.fullPath) + \"\\\" to \\\"\" + (to.fullPath) + \"\\\" via a navigation guard.\")\n )\n}\n\nfunction createRouterError (from, to, type, message) {\n var error = new Error(message);\n error._isRouter = true;\n error.from = from;\n error.to = to;\n error.type = type;\n\n return error\n}\n\nvar propertiesToLog = ['params', 'query', 'hash'];\n\nfunction stringifyRoute (to) {\n if (typeof to === 'string') { return to }\n if ('path' in to) { return to.path }\n var location = {};\n propertiesToLog.forEach(function (key) {\n if (key in to) { location[key] = to[key]; }\n });\n return JSON.stringify(location, null, 2)\n}\n\n/* */\n\nvar History = function History (router, base) {\n this.router = router;\n this.base = normalizeBase(base);\n // start with a route object that stands for \"nowhere\"\n this.current = START;\n this.pending = null;\n this.ready = false;\n this.readyCbs = [];\n this.readyErrorCbs = [];\n this.errorCbs = [];\n this.listeners = [];\n};\n\nHistory.prototype.listen = function listen (cb) {\n this.cb = cb;\n};\n\nHistory.prototype.onReady = function onReady (cb, errorCb) {\n if (this.ready) {\n cb();\n } else {\n this.readyCbs.push(cb);\n if (errorCb) {\n this.readyErrorCbs.push(errorCb);\n }\n }\n};\n\nHistory.prototype.onError = function onError (errorCb) {\n this.errorCbs.push(errorCb);\n};\n\nHistory.prototype.transitionTo = function transitionTo (\n location,\n onComplete,\n onAbort\n) {\n var this$1 = this;\n\n var route = this.router.match(location, this.current);\n this.confirmTransition(\n route,\n function () {\n var prev = this$1.current;\n this$1.updateRoute(route);\n onComplete && onComplete(route);\n this$1.ensureURL();\n this$1.router.afterHooks.forEach(function (hook) {\n hook && hook(route, prev);\n });\n\n // fire ready cbs once\n if (!this$1.ready) {\n this$1.ready = true;\n this$1.readyCbs.forEach(function (cb) {\n cb(route);\n });\n }\n },\n function (err) {\n if (onAbort) {\n onAbort(err);\n }\n if (err && !this$1.ready) {\n this$1.ready = true;\n // Initial redirection should still trigger the onReady onSuccess\n // https://github.com/vuejs/vue-router/issues/3225\n if (!isRouterError(err, NavigationFailureType.redirected)) {\n this$1.readyErrorCbs.forEach(function (cb) {\n cb(err);\n });\n } else {\n this$1.readyCbs.forEach(function (cb) {\n cb(route);\n });\n }\n }\n }\n );\n};\n\nHistory.prototype.confirmTransition = function confirmTransition (route, onComplete, onAbort) {\n var this$1 = this;\n\n var current = this.current;\n var abort = function (err) {\n // changed after adding errors with\n // https://github.com/vuejs/vue-router/pull/3047 before that change,\n // redirect and aborted navigation would produce an err == null\n if (!isRouterError(err) && isError(err)) {\n if (this$1.errorCbs.length) {\n this$1.errorCbs.forEach(function (cb) {\n cb(err);\n });\n } else {\n warn(false, 'uncaught error during route navigation:');\n console.error(err);\n }\n }\n onAbort && onAbort(err);\n };\n var lastRouteIndex = route.matched.length - 1;\n var lastCurrentIndex = current.matched.length - 1;\n if (\n isSameRoute(route, current) &&\n // in the case the route map has been dynamically appended to\n lastRouteIndex === lastCurrentIndex &&\n route.matched[lastRouteIndex] === current.matched[lastCurrentIndex]\n ) {\n this.ensureURL();\n return abort(createNavigationDuplicatedError(current, route))\n }\n\n var ref = resolveQueue(\n this.current.matched,\n route.matched\n );\n var updated = ref.updated;\n var deactivated = ref.deactivated;\n var activated = ref.activated;\n\n var queue = [].concat(\n // in-component leave guards\n extractLeaveGuards(deactivated),\n // global before hooks\n this.router.beforeHooks,\n // in-component update hooks\n extractUpdateHooks(updated),\n // in-config enter guards\n activated.map(function (m) { return m.beforeEnter; }),\n // async components\n resolveAsyncComponents(activated)\n );\n\n this.pending = route;\n var iterator = function (hook, next) {\n if (this$1.pending !== route) {\n return abort(createNavigationCancelledError(current, route))\n }\n try {\n hook(route, current, function (to) {\n if (to === false) {\n // next(false) -> abort navigation, ensure current URL\n this$1.ensureURL(true);\n abort(createNavigationAbortedError(current, route));\n } else if (isError(to)) {\n this$1.ensureURL(true);\n abort(to);\n } else if (\n typeof to === 'string' ||\n (typeof to === 'object' &&\n (typeof to.path === 'string' || typeof to.name === 'string'))\n ) {\n // next('/') or next({ path: '/' }) -> redirect\n abort(createNavigationRedirectedError(current, route));\n if (typeof to === 'object' && to.replace) {\n this$1.replace(to);\n } else {\n this$1.push(to);\n }\n } else {\n // confirm transition and pass on the value\n next(to);\n }\n });\n } catch (e) {\n abort(e);\n }\n };\n\n runQueue(queue, iterator, function () {\n var postEnterCbs = [];\n var isValid = function () { return this$1.current === route; };\n // wait until async components are resolved before\n // extracting in-component enter guards\n var enterGuards = extractEnterGuards(activated, postEnterCbs, isValid);\n var queue = enterGuards.concat(this$1.router.resolveHooks);\n runQueue(queue, iterator, function () {\n if (this$1.pending !== route) {\n return abort(createNavigationCancelledError(current, route))\n }\n this$1.pending = null;\n onComplete(route);\n if (this$1.router.app) {\n this$1.router.app.$nextTick(function () {\n postEnterCbs.forEach(function (cb) {\n cb();\n });\n });\n }\n });\n });\n};\n\nHistory.prototype.updateRoute = function updateRoute (route) {\n this.current = route;\n this.cb && this.cb(route);\n};\n\nHistory.prototype.setupListeners = function setupListeners () {\n // Default implementation is empty\n};\n\nHistory.prototype.teardownListeners = function teardownListeners () {\n this.listeners.forEach(function (cleanupListener) {\n cleanupListener();\n });\n this.listeners = [];\n};\n\nfunction normalizeBase (base) {\n if (!base) {\n if (inBrowser) {\n // respect tag\n var baseEl = document.querySelector('base');\n base = (baseEl && baseEl.getAttribute('href')) || '/';\n // strip full URL origin\n base = base.replace(/^https?:\\/\\/[^\\/]+/, '');\n } else {\n base = '/';\n }\n }\n // make sure there's the starting slash\n if (base.charAt(0) !== '/') {\n base = '/' + base;\n }\n // remove trailing slash\n return base.replace(/\\/$/, '')\n}\n\nfunction resolveQueue (\n current,\n next\n) {\n var i;\n var max = Math.max(current.length, next.length);\n for (i = 0; i < max; i++) {\n if (current[i] !== next[i]) {\n break\n }\n }\n return {\n updated: next.slice(0, i),\n activated: next.slice(i),\n deactivated: current.slice(i)\n }\n}\n\nfunction extractGuards (\n records,\n name,\n bind,\n reverse\n) {\n var guards = flatMapComponents(records, function (def, instance, match, key) {\n var guard = extractGuard(def, name);\n if (guard) {\n return Array.isArray(guard)\n ? guard.map(function (guard) { return bind(guard, instance, match, key); })\n : bind(guard, instance, match, key)\n }\n });\n return flatten(reverse ? guards.reverse() : guards)\n}\n\nfunction extractGuard (\n def,\n key\n) {\n if (typeof def !== 'function') {\n // extend now so that global mixins are applied.\n def = _Vue.extend(def);\n }\n return def.options[key]\n}\n\nfunction extractLeaveGuards (deactivated) {\n return extractGuards(deactivated, 'beforeRouteLeave', bindGuard, true)\n}\n\nfunction extractUpdateHooks (updated) {\n return extractGuards(updated, 'beforeRouteUpdate', bindGuard)\n}\n\nfunction bindGuard (guard, instance) {\n if (instance) {\n return function boundRouteGuard () {\n return guard.apply(instance, arguments)\n }\n }\n}\n\nfunction extractEnterGuards (\n activated,\n cbs,\n isValid\n) {\n return extractGuards(\n activated,\n 'beforeRouteEnter',\n function (guard, _, match, key) {\n return bindEnterGuard(guard, match, key, cbs, isValid)\n }\n )\n}\n\nfunction bindEnterGuard (\n guard,\n match,\n key,\n cbs,\n isValid\n) {\n return function routeEnterGuard (to, from, next) {\n return guard(to, from, function (cb) {\n if (typeof cb === 'function') {\n cbs.push(function () {\n // #750\n // if a router-view is wrapped with an out-in transition,\n // the instance may not have been registered at this time.\n // we will need to poll for registration until current route\n // is no longer valid.\n poll(cb, match.instances, key, isValid);\n });\n }\n next(cb);\n })\n }\n}\n\nfunction poll (\n cb, // somehow flow cannot infer this is a function\n instances,\n key,\n isValid\n) {\n if (\n instances[key] &&\n !instances[key]._isBeingDestroyed // do not reuse being destroyed instance\n ) {\n cb(instances[key]);\n } else if (isValid()) {\n setTimeout(function () {\n poll(cb, instances, key, isValid);\n }, 16);\n }\n}\n\n/* */\n\nvar HTML5History = /*@__PURE__*/(function (History) {\n function HTML5History (router, base) {\n History.call(this, router, base);\n\n this._startLocation = getLocation(this.base);\n }\n\n if ( History ) HTML5History.__proto__ = History;\n HTML5History.prototype = Object.create( History && History.prototype );\n HTML5History.prototype.constructor = HTML5History;\n\n HTML5History.prototype.setupListeners = function setupListeners () {\n var this$1 = this;\n\n if (this.listeners.length > 0) {\n return\n }\n\n var router = this.router;\n var expectScroll = router.options.scrollBehavior;\n var supportsScroll = supportsPushState && expectScroll;\n\n if (supportsScroll) {\n this.listeners.push(setupScroll());\n }\n\n var handleRoutingEvent = function () {\n var current = this$1.current;\n\n // Avoiding first `popstate` event dispatched in some browsers but first\n // history route not updated since async guard at the same time.\n var location = getLocation(this$1.base);\n if (this$1.current === START && location === this$1._startLocation) {\n return\n }\n\n this$1.transitionTo(location, function (route) {\n if (supportsScroll) {\n handleScroll(router, route, current, true);\n }\n });\n };\n window.addEventListener('popstate', handleRoutingEvent);\n this.listeners.push(function () {\n window.removeEventListener('popstate', handleRoutingEvent);\n });\n };\n\n HTML5History.prototype.go = function go (n) {\n window.history.go(n);\n };\n\n HTML5History.prototype.push = function push (location, onComplete, onAbort) {\n var this$1 = this;\n\n var ref = this;\n var fromRoute = ref.current;\n this.transitionTo(location, function (route) {\n pushState(cleanPath(this$1.base + route.fullPath));\n handleScroll(this$1.router, route, fromRoute, false);\n onComplete && onComplete(route);\n }, onAbort);\n };\n\n HTML5History.prototype.replace = function replace (location, onComplete, onAbort) {\n var this$1 = this;\n\n var ref = this;\n var fromRoute = ref.current;\n this.transitionTo(location, function (route) {\n replaceState(cleanPath(this$1.base + route.fullPath));\n handleScroll(this$1.router, route, fromRoute, false);\n onComplete && onComplete(route);\n }, onAbort);\n };\n\n HTML5History.prototype.ensureURL = function ensureURL (push) {\n if (getLocation(this.base) !== this.current.fullPath) {\n var current = cleanPath(this.base + this.current.fullPath);\n push ? pushState(current) : replaceState(current);\n }\n };\n\n HTML5History.prototype.getCurrentLocation = function getCurrentLocation () {\n return getLocation(this.base)\n };\n\n return HTML5History;\n}(History));\n\nfunction getLocation (base) {\n var path = decodeURI(window.location.pathname);\n if (base && path.toLowerCase().indexOf(base.toLowerCase()) === 0) {\n path = path.slice(base.length);\n }\n return (path || '/') + window.location.search + window.location.hash\n}\n\n/* */\n\nvar HashHistory = /*@__PURE__*/(function (History) {\n function HashHistory (router, base, fallback) {\n History.call(this, router, base);\n // check history fallback deeplinking\n if (fallback && checkFallback(this.base)) {\n return\n }\n ensureSlash();\n }\n\n if ( History ) HashHistory.__proto__ = History;\n HashHistory.prototype = Object.create( History && History.prototype );\n HashHistory.prototype.constructor = HashHistory;\n\n // this is delayed until the app mounts\n // to avoid the hashchange listener being fired too early\n HashHistory.prototype.setupListeners = function setupListeners () {\n var this$1 = this;\n\n if (this.listeners.length > 0) {\n return\n }\n\n var router = this.router;\n var expectScroll = router.options.scrollBehavior;\n var supportsScroll = supportsPushState && expectScroll;\n\n if (supportsScroll) {\n this.listeners.push(setupScroll());\n }\n\n var handleRoutingEvent = function () {\n var current = this$1.current;\n if (!ensureSlash()) {\n return\n }\n this$1.transitionTo(getHash(), function (route) {\n if (supportsScroll) {\n handleScroll(this$1.router, route, current, true);\n }\n if (!supportsPushState) {\n replaceHash(route.fullPath);\n }\n });\n };\n var eventType = supportsPushState ? 'popstate' : 'hashchange';\n window.addEventListener(\n eventType,\n handleRoutingEvent\n );\n this.listeners.push(function () {\n window.removeEventListener(eventType, handleRoutingEvent);\n });\n };\n\n HashHistory.prototype.push = function push (location, onComplete, onAbort) {\n var this$1 = this;\n\n var ref = this;\n var fromRoute = ref.current;\n this.transitionTo(\n location,\n function (route) {\n pushHash(route.fullPath);\n handleScroll(this$1.router, route, fromRoute, false);\n onComplete && onComplete(route);\n },\n onAbort\n );\n };\n\n HashHistory.prototype.replace = function replace (location, onComplete, onAbort) {\n var this$1 = this;\n\n var ref = this;\n var fromRoute = ref.current;\n this.transitionTo(\n location,\n function (route) {\n replaceHash(route.fullPath);\n handleScroll(this$1.router, route, fromRoute, false);\n onComplete && onComplete(route);\n },\n onAbort\n );\n };\n\n HashHistory.prototype.go = function go (n) {\n window.history.go(n);\n };\n\n HashHistory.prototype.ensureURL = function ensureURL (push) {\n var current = this.current.fullPath;\n if (getHash() !== current) {\n push ? pushHash(current) : replaceHash(current);\n }\n };\n\n HashHistory.prototype.getCurrentLocation = function getCurrentLocation () {\n return getHash()\n };\n\n return HashHistory;\n}(History));\n\nfunction checkFallback (base) {\n var location = getLocation(base);\n if (!/^\\/#/.test(location)) {\n window.location.replace(cleanPath(base + '/#' + location));\n return true\n }\n}\n\nfunction ensureSlash () {\n var path = getHash();\n if (path.charAt(0) === '/') {\n return true\n }\n replaceHash('/' + path);\n return false\n}\n\nfunction getHash () {\n // We can't use window.location.hash here because it's not\n // consistent across browsers - Firefox will pre-decode it!\n var href = window.location.href;\n var index = href.indexOf('#');\n // empty path\n if (index < 0) { return '' }\n\n href = href.slice(index + 1);\n // decode the hash but not the search or hash\n // as search(query) is already decoded\n // https://github.com/vuejs/vue-router/issues/2708\n var searchIndex = href.indexOf('?');\n if (searchIndex < 0) {\n var hashIndex = href.indexOf('#');\n if (hashIndex > -1) {\n href = decodeURI(href.slice(0, hashIndex)) + href.slice(hashIndex);\n } else { href = decodeURI(href); }\n } else {\n href = decodeURI(href.slice(0, searchIndex)) + href.slice(searchIndex);\n }\n\n return href\n}\n\nfunction getUrl (path) {\n var href = window.location.href;\n var i = href.indexOf('#');\n var base = i >= 0 ? href.slice(0, i) : href;\n return (base + \"#\" + path)\n}\n\nfunction pushHash (path) {\n if (supportsPushState) {\n pushState(getUrl(path));\n } else {\n window.location.hash = path;\n }\n}\n\nfunction replaceHash (path) {\n if (supportsPushState) {\n replaceState(getUrl(path));\n } else {\n window.location.replace(getUrl(path));\n }\n}\n\n/* */\n\nvar AbstractHistory = /*@__PURE__*/(function (History) {\n function AbstractHistory (router, base) {\n History.call(this, router, base);\n this.stack = [];\n this.index = -1;\n }\n\n if ( History ) AbstractHistory.__proto__ = History;\n AbstractHistory.prototype = Object.create( History && History.prototype );\n AbstractHistory.prototype.constructor = AbstractHistory;\n\n AbstractHistory.prototype.push = function push (location, onComplete, onAbort) {\n var this$1 = this;\n\n this.transitionTo(\n location,\n function (route) {\n this$1.stack = this$1.stack.slice(0, this$1.index + 1).concat(route);\n this$1.index++;\n onComplete && onComplete(route);\n },\n onAbort\n );\n };\n\n AbstractHistory.prototype.replace = function replace (location, onComplete, onAbort) {\n var this$1 = this;\n\n this.transitionTo(\n location,\n function (route) {\n this$1.stack = this$1.stack.slice(0, this$1.index).concat(route);\n onComplete && onComplete(route);\n },\n onAbort\n );\n };\n\n AbstractHistory.prototype.go = function go (n) {\n var this$1 = this;\n\n var targetIndex = this.index + n;\n if (targetIndex < 0 || targetIndex >= this.stack.length) {\n return\n }\n var route = this.stack[targetIndex];\n this.confirmTransition(\n route,\n function () {\n this$1.index = targetIndex;\n this$1.updateRoute(route);\n },\n function (err) {\n if (isRouterError(err, NavigationFailureType.duplicated)) {\n this$1.index = targetIndex;\n }\n }\n );\n };\n\n AbstractHistory.prototype.getCurrentLocation = function getCurrentLocation () {\n var current = this.stack[this.stack.length - 1];\n return current ? current.fullPath : '/'\n };\n\n AbstractHistory.prototype.ensureURL = function ensureURL () {\n // noop\n };\n\n return AbstractHistory;\n}(History));\n\n/* */\n\n\n\nvar VueRouter = function VueRouter (options) {\n if ( options === void 0 ) options = {};\n\n this.app = null;\n this.apps = [];\n this.options = options;\n this.beforeHooks = [];\n this.resolveHooks = [];\n this.afterHooks = [];\n this.matcher = createMatcher(options.routes || [], this);\n\n var mode = options.mode || 'hash';\n this.fallback = mode === 'history' && !supportsPushState && options.fallback !== false;\n if (this.fallback) {\n mode = 'hash';\n }\n if (!inBrowser) {\n mode = 'abstract';\n }\n this.mode = mode;\n\n switch (mode) {\n case 'history':\n this.history = new HTML5History(this, options.base);\n break\n case 'hash':\n this.history = new HashHistory(this, options.base, this.fallback);\n break\n case 'abstract':\n this.history = new AbstractHistory(this, options.base);\n break\n default:\n if (true) {\n assert(false, (\"invalid mode: \" + mode));\n }\n }\n};\n\nvar prototypeAccessors = { currentRoute: { configurable: true } };\n\nVueRouter.prototype.match = function match (\n raw,\n current,\n redirectedFrom\n) {\n return this.matcher.match(raw, current, redirectedFrom)\n};\n\nprototypeAccessors.currentRoute.get = function () {\n return this.history && this.history.current\n};\n\nVueRouter.prototype.init = function init (app /* Vue component instance */) {\n var this$1 = this;\n\n true && assert(\n install.installed,\n \"not installed. Make sure to call `Vue.use(VueRouter)` \" +\n \"before creating root instance.\"\n );\n\n this.apps.push(app);\n\n // set up app destroyed handler\n // https://github.com/vuejs/vue-router/issues/2639\n app.$once('hook:destroyed', function () {\n // clean out app from this.apps array once destroyed\n var index = this$1.apps.indexOf(app);\n if (index > -1) { this$1.apps.splice(index, 1); }\n // ensure we still have a main app or null if no apps\n // we do not release the router so it can be reused\n if (this$1.app === app) { this$1.app = this$1.apps[0] || null; }\n\n if (!this$1.app) {\n // clean up event listeners\n // https://github.com/vuejs/vue-router/issues/2341\n this$1.history.teardownListeners();\n }\n });\n\n // main app previously initialized\n // return as we don't need to set up new history listener\n if (this.app) {\n return\n }\n\n this.app = app;\n\n var history = this.history;\n\n if (history instanceof HTML5History || history instanceof HashHistory) {\n var setupListeners = function () {\n history.setupListeners();\n };\n history.transitionTo(history.getCurrentLocation(), setupListeners, setupListeners);\n }\n\n history.listen(function (route) {\n this$1.apps.forEach(function (app) {\n app._route = route;\n });\n });\n};\n\nVueRouter.prototype.beforeEach = function beforeEach (fn) {\n return registerHook(this.beforeHooks, fn)\n};\n\nVueRouter.prototype.beforeResolve = function beforeResolve (fn) {\n return registerHook(this.resolveHooks, fn)\n};\n\nVueRouter.prototype.afterEach = function afterEach (fn) {\n return registerHook(this.afterHooks, fn)\n};\n\nVueRouter.prototype.onReady = function onReady (cb, errorCb) {\n this.history.onReady(cb, errorCb);\n};\n\nVueRouter.prototype.onError = function onError (errorCb) {\n this.history.onError(errorCb);\n};\n\nVueRouter.prototype.push = function push (location, onComplete, onAbort) {\n var this$1 = this;\n\n // $flow-disable-line\n if (!onComplete && !onAbort && typeof Promise !== 'undefined') {\n return new Promise(function (resolve, reject) {\n this$1.history.push(location, resolve, reject);\n })\n } else {\n this.history.push(location, onComplete, onAbort);\n }\n};\n\nVueRouter.prototype.replace = function replace (location, onComplete, onAbort) {\n var this$1 = this;\n\n // $flow-disable-line\n if (!onComplete && !onAbort && typeof Promise !== 'undefined') {\n return new Promise(function (resolve, reject) {\n this$1.history.replace(location, resolve, reject);\n })\n } else {\n this.history.replace(location, onComplete, onAbort);\n }\n};\n\nVueRouter.prototype.go = function go (n) {\n this.history.go(n);\n};\n\nVueRouter.prototype.back = function back () {\n this.go(-1);\n};\n\nVueRouter.prototype.forward = function forward () {\n this.go(1);\n};\n\nVueRouter.prototype.getMatchedComponents = function getMatchedComponents (to) {\n var route = to\n ? to.matched\n ? to\n : this.resolve(to).route\n : this.currentRoute;\n if (!route) {\n return []\n }\n return [].concat.apply([], route.matched.map(function (m) {\n return Object.keys(m.components).map(function (key) {\n return m.components[key]\n })\n }))\n};\n\nVueRouter.prototype.resolve = function resolve (\n to,\n current,\n append\n) {\n current = current || this.history.current;\n var location = normalizeLocation(\n to,\n current,\n append,\n this\n );\n var route = this.match(location, current);\n var fullPath = route.redirectedFrom || route.fullPath;\n var base = this.history.base;\n var href = createHref(base, fullPath, this.mode);\n return {\n location: location,\n route: route,\n href: href,\n // for backwards compat\n normalizedTo: location,\n resolved: route\n }\n};\n\nVueRouter.prototype.addRoutes = function addRoutes (routes) {\n this.matcher.addRoutes(routes);\n if (this.history.current !== START) {\n this.history.transitionTo(this.history.getCurrentLocation());\n }\n};\n\nObject.defineProperties( VueRouter.prototype, prototypeAccessors );\n\nfunction registerHook (list, fn) {\n list.push(fn);\n return function () {\n var i = list.indexOf(fn);\n if (i > -1) { list.splice(i, 1); }\n }\n}\n\nfunction createHref (base, fullPath, mode) {\n var path = mode === 'hash' ? '#' + fullPath : fullPath;\n return base ? cleanPath(base + '/' + path) : path\n}\n\nVueRouter.install = install;\nVueRouter.version = '3.3.4';\n\nif (inBrowser && window.Vue) {\n window.Vue.use(VueRouter);\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (VueRouter);\n\n\n//# sourceURL=webpack:///./node_modules/vue-router/dist/vue-router.esm.js?"); /***/ }), /***/ "./node_modules/vue-style-loader/lib/addStylesClient.js": /*!**************************************************************!*\ !*** ./node_modules/vue-style-loader/lib/addStylesClient.js ***! \**************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return addStylesClient; });\n/* harmony import */ var _listToStyles__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./listToStyles */ \"./node_modules/vue-style-loader/lib/listToStyles.js\");\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n Modified by Evan You @yyx990803\n*/\n\n\n\nvar hasDocument = typeof document !== 'undefined'\n\nif (typeof DEBUG !== 'undefined' && DEBUG) {\n if (!hasDocument) {\n throw new Error(\n 'vue-style-loader cannot be used in a non-browser environment. ' +\n \"Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.\"\n ) }\n}\n\n/*\ntype StyleObject = {\n id: number;\n parts: Array\n}\n\ntype StyleObjectPart = {\n css: string;\n media: string;\n sourceMap: ?string\n}\n*/\n\nvar stylesInDom = {/*\n [id: number]: {\n id: number,\n refs: number,\n parts: Array<(obj?: StyleObjectPart) => void>\n }\n*/}\n\nvar head = hasDocument && (document.head || document.getElementsByTagName('head')[0])\nvar singletonElement = null\nvar singletonCounter = 0\nvar isProduction = false\nvar noop = function () {}\nvar options = null\nvar ssrIdKey = 'data-vue-ssr-id'\n\n// Force single-tag solution on IE6-9, which has a hard limit on the # of