@windborne/grapher 1.0.53 → 1.0.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/744.bundle.cjs +2 -0
- package/dist/744.bundle.cjs.map +1 -0
- package/dist/744.bundle.esm.js +2 -0
- package/dist/744.bundle.esm.js.map +1 -0
- package/dist/97448149e3e6fbc66aad.wasm +0 -0
- package/dist/bundle.cjs +1 -1
- package/dist/bundle.cjs.map +1 -1
- package/dist/bundle.esm.js +1 -1
- package/dist/bundle.esm.js.map +1 -1
- package/package.json +4 -4
- package/src/components/tooltip.jsx +1 -6
- package/src/renderer/graph_body_renderer.js +11 -3
- package/src/rust/pkg/index.js +398 -0
- package/src/rust/pkg/index_bg.wasm +0 -0
- package/src/rust/pkg/package.json +16 -0
- package/src/state/calculate_tooltip_state.js +12 -3
- package/dist/599.bundle.cjs +0 -1
- package/dist/599.bundle.esm.js +0 -1
package/dist/bundle.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.cjs","mappings":"UACIA,EADAC,ECAAC,EACAC,E,wKCDG,MAAMC,EAAc,CACzB,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,WAGa,SAASC,EAASC,EAAaC,EAAGC,GAC/C,MAA2B,iBAAhBF,EACFA,EAGkB,iBAAhBA,EACFF,EAAYE,EAAcF,EAAYK,aAGfC,IAA5BF,EACKJ,EAAYI,EAA0BJ,EAAYK,QAGpDL,EAAYG,EAAIH,EAAYK,OACrC,CAQO,SAASE,EAAoBC,EAAOC,GACzC,IAAKD,EAAO,OAAOA,EAEnB,GAAIA,EAAME,WAAW,SAAU,CAC7B,MAAMC,EAAUH,EAAMI,MAAM,+CAC5B,GAAID,EAAS,CACX,MAAO,CAAEE,EAAGC,EAAGC,EAAGC,GAAKL,EAEvB,MAAQ,QAAOE,MAAMC,MAAMC,MADVE,WAAWD,GAAKP,IAEnC,CACF,CAEA,GAAID,EAAME,WAA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KACHF,EAA0B/8C,IAAI,uBAAwB1R,EAAM2uD,oBAAoB,GALzE,QAOZ,CAACF,EAA2BzuD,EAAM2uD,sBAErC,MAAMrc,EAAYsG,GAAa6V,GAE/B,OACI15B,IAAAA,cAAA,OAAK+B,UAAU,gBAEPwb,GAAatyC,EAAM4uD,iBACf75B,IAAAA,cAAA,OAAK+B,UAAY,uBAAsB92B,EAAMkzC,QAAS,kBAAkB,gBAAe4a,SAAsB,eAMjHJ,EAAYzwD,KAAI,CAAC8Q,EAAQhS,IACrBg5B,IAAAA,cAAC22B,GAAO10B,GAAA,CACJ5vB,IAAKrL,GACDiE,EAAK,CACT+hC,SAAUA,EACVgqB,8BAA+B0C,EAA0B1C,8BACzDh+C,OAAQA,EACR/P,GAAK,gBAAe8vD,KAAkB/xD,IACtC6mD,oBAAqB5iD,EAAM4uD,gBAAkB,GAAK,EAClD5C,sBAAuB2B,OAM/Brb,GACAvd,IAAAA,cAAA,OAAK+B,UAAY,uBAAsB92B,EAAMkzC,QAAS,kBAAkB,gBAAe4a,YAAyB,eAMhI,CAEAU,GAAav3B,aAAe,CACxBic,MAAO,SAGXsb,GAAax5B,UAAYzuB,OAAOu1B,OAAO,CAAC,EAAG4vB,GAAQ12B,UAAW,CAC1D81B,WAAY9oD,IAAAA,KACZ+oD,aAAc/oD,IAAAA,KACd4sD,gBAAiB5sD,IAAAA,KACjB2sD,oBAAqB3sD,IAAAA,M","sources":["webpack://Grapher/webpack/runtime/create fake namespace object","webpack://Grapher/webpack/runtime/load script","webpack://Grapher/./src/helpers/colors.js","webpack://Grapher/./src/grapher.scss","webpack://Grapher/./node_modules/css-loader/dist/runtime/api.js","webpack://Grapher/./node_modules/css-loader/dist/runtime/sourceMaps.js","webpack://Grapher/./node_modules/prop-types/factoryWithThrowingShims.js","webpack://Grapher/./node_modules/prop-types/index.js","webpack://Grapher/./node_modules/prop-types/lib/ReactPropTypesSecret.js","webpack://Grapher/./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js","webpack://Grapher/./node_modules/style-loader/dist/runtime/insertBySelector.js","webpack://Grapher/./node_modules/style-loader/dist/runtime/insertStyleElement.js","webpack://Grapher/./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js","webpack://Grapher/./node_modules/style-loader/dist/runtime/styleDomAPI.js","webpack://Grapher/./node_modules/style-loader/dist/runtime/styleTagTransform.js","webpack://Grapher/./src/renderer/background.frag","webpack://Grapher/./src/renderer/background.vert","webpack://Grapher/./src/renderer/circle.frag","webpack://Grapher/./src/renderer/circle.vert","webpack://Grapher/./src/renderer/line.frag","webpack://Grapher/./src/renderer/line.vert","webpack://Grapher/./src/renderer/shadow.frag","webpack://Grapher/./src/renderer/shadow.vert","webpack://Grapher/webpack/bootstrap","webpack://Grapher/webpack/runtime/compat get default export","webpack://Grapher/webpack/runtime/define property getters","webpack://Grapher/webpack/runtime/ensure chunk","webpack://Grapher/webpack/runtime/get javascript chunk filename","webpack://Grapher/webpack/runtime/hasOwnProperty shorthand","webpack://Grapher/webpack/runtime/make namespace object","webpack://Grapher/webpack/runtime/publicPath","webpack://Grapher/webpack/runtime/jsonp chunk loading","webpack://Grapher/webpack/runtime/nonce","webpack://Grapher/external commonjs2 \"react\"","webpack://Grapher/./src/state/data_types.js","webpack://Grapher/./src/helpers/custom_prop_types.js","webpack://Grapher/./src/eventable.js","webpack://Grapher/./src/state/infer_type.js","webpack://Grapher/./src/helpers/color_to_vector.js","webpack://Grapher/./src/renderer/create_gl_program.js","webpack://Grapher/./src/renderer/background_program.js","webpack://Grapher/./src/renderer/size_canvas.js","webpack://Grapher/./src/renderer/paths_from.js","webpack://Grapher/./src/renderer/draw_zero_line.js","webpack://Grapher/./src/renderer/draw_area.js","webpack://Grapher/./src/renderer/draw_bars.js","webpack://Grapher/./src/renderer/draw_line.js","webpack://Grapher/./src/state/rust_api.js","webpack://Grapher/./src/renderer/extract_vertices.js","webpack://Grapher/./src/renderer/line_program.js","webpack://Grapher/./src/renderer/shadow_program.js","webpack://Grapher/./src/renderer/graph_body_renderer.js","webpack://Grapher/./src/renderer/draw_background.js","webpack://Grapher/./src/helpers/format.js","webpack://Grapher/./src/helpers/axis_sizes.js","webpack://Grapher/./src/components/tooltip.jsx","webpack://Grapher/./src/components/context_menu.jsx","webpack://Grapher/./src/state/space_conversions/simple_series_to_data_space.js","webpack://Grapher/./src/state/calculate_data_bounds.js","webpack://Grapher/./src/state/merge_bounds.js","webpack://Grapher/./src/state/expand_bounds.js","webpack://Grapher/./src/helpers/binary_search.js","webpack://Grapher/./src/state/space_conversions/data_space_to_selected_space.js","webpack://Grapher/./src/renderer/scale_bounds.js","webpack://Grapher/./src/state/space_conversions/selected_space_to_render_space.js","webpack://Grapher/./src/helpers/flatten_simple_data.js","webpack://Grapher/./src/state/calculate_tooltip_state.js","webpack://Grapher/./src/state/bound_calculators.js","webpack://Grapher/./src/state/space_conversions/condense_data_space.js","webpack://Grapher/./src/helpers/name_for_series.js","webpack://Grapher/./src/state/space_conversions/selected_space_to_background_space.js","webpack://Grapher/./src/state/state_controller.js","webpack://Grapher/./src/state/get_default_bounds_calculator.js","webpack://Grapher/./src/helpers/generator_params_equal.js","webpack://Grapher/./src/state/calculate_annotations_state.js","webpack://Grapher/./src/state/selection_from_global_bounds.js","webpack://Grapher/./src/state/find_matching_axis.js","webpack://Grapher/./src/state/average_loop_times.js","webpack://Grapher/./src/state/bound_calculator_from_selection.js","webpack://Grapher/./src/state/hooks.js","webpack://Grapher/./src/components/annotations.jsx","webpack://Grapher/./src/components/draggable_points.jsx","webpack://Grapher/./src/components/vertical_lines.jsx","webpack://Grapher/./src/components/graph_body.jsx","webpack://Grapher/./src/grapher.scss?e17f","webpack://Grapher/./src/helpers/place_grid.js","webpack://Grapher/./src/components/x_axis.jsx","webpack://Grapher/./src/components/y_axis.jsx","webpack://Grapher/./src/components/wind_arrows.jsx","webpack://Grapher/./src/components/range_selection_button_base.jsx","webpack://Grapher/./src/components/range_selection_button.jsx","webpack://Grapher/./src/components/percentile_button.jsx","webpack://Grapher/./src/components/options.jsx","webpack://Grapher/./src/components/range_selection.jsx","webpack://Grapher/./src/components/range_graph.jsx","webpack://Grapher/./src/components/series_key_item.jsx","webpack://Grapher/./src/components/series_key_axis_container.jsx","webpack://Grapher/./src/components/series_key.jsx","webpack://Grapher/./src/components/graph_title.jsx","webpack://Grapher/./src/components/sidebar.jsx","webpack://Grapher/./src/state/sync_pool.js","webpack://Grapher/./src/grapher.jsx","webpack://Grapher/./src/state/multigraph_state_controller.js","webpack://Grapher/./src/multigrapher.jsx"],"sourcesContent":["var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","var inProgress = {};\nvar dataWebpackPrefix = \"Grapher:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","export const LINE_COLORS = [\n \"#F1C232\",\n \"#1259f8\",\n \"#cb4b4b\",\n \"#4da74d\",\n \"#9440ed\",\n \"#61e0ed\",\n \"#ed6d2c\",\n \"#ed13c6\",\n \"#bbed59\",\n];\n\nexport default function getColor(seriesColor, i, multigrapherSeriesIndex) {\n if (typeof seriesColor === \"string\") {\n return seriesColor;\n }\n\n if (typeof seriesColor === \"number\") {\n return LINE_COLORS[seriesColor % LINE_COLORS.length];\n }\n\n if (multigrapherSeriesIndex !== undefined) {\n return LINE_COLORS[multigrapherSeriesIndex % LINE_COLORS.length];\n }\n\n return LINE_COLORS[i % LINE_COLORS.length];\n}\n\n/**\n * Applies reduced opacity to a color\n * @param {string} color \n * @param {number} opacityFactor \n * @returns {string}\n */\nexport function applyReducedOpacity(color, opacityFactor) {\n if (!color) return color;\n\n if (color.startsWith(\"rgba(\")) {\n const matches = color.match(/rgba\\((\\d+),\\s*(\\d+),\\s*(\\d+),\\s*([\\d.]+)\\)/);\n if (matches) {\n const [, r, g, b, a] = matches;\n const newAlpha = parseFloat(a) * opacityFactor;\n return `rgba(${r}, ${g}, ${b}, ${newAlpha})`;\n }\n }\n\n if (color.startsWith(\"rgb(\")) {\n const matches = color.match(/rgb\\((\\d+),\\s*(\\d+),\\s*(\\d+)\\)/);\n if (matches) {\n const [, r, g, b] = matches;\n return `rgba(${r}, ${g}, ${b}, ${opacityFactor})`;\n }\n }\n\n if (color.startsWith(\"#\")) {\n let hex = color.slice(1);\n if (hex.length === 3) {\n hex = hex\n .split(\"\")\n .map((char) => char + char)\n .join(\"\");\n }\n const r = parseInt(hex.slice(0, 2), 16);\n const g = parseInt(hex.slice(2, 4), 16);\n const b = parseInt(hex.slice(4, 6), 16);\n return `rgba(${r}, ${g}, ${b}, ${opacityFactor})`;\n }\n\n return color;\n}\n\n/**\n * Applies reduced opacity to a gradient\n * @param {Array<[number, string]>} gradient \n * @param {number} opacityFactor \n * @returns {Array<[number, string]>}\n */\nexport function applyReducedOpacityToGradient(gradient, opacityFactor) {\n if (!gradient || !Array.isArray(gradient)) {\n return gradient;\n }\n\n return gradient.map((stop) => {\n if (Array.isArray(stop) && stop.length === 2) {\n const [position, color] = stop;\n const translucentColor = applyReducedOpacity(color, opacityFactor);\n return [position, translucentColor];\n } else if (typeof stop === \"string\") {\n return applyReducedOpacity(stop, opacityFactor);\n }\n return stop;\n });\n}\n\n/**\n * Creates a default gradient from a color at half opacity\n * @param {string} color \n * @returns {Array<[number, string]>}\n */\nexport function createDefaultGradient(color) {\n if (!color) return [[0, 'transparent'], [1, 'transparent']];\n \n const halfOpacityColor = applyReducedOpacity(color, 0.5);\n return [[0, halfOpacityColor], [1, halfOpacityColor]];\n}\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.grapher-night{position:relative;background:linear-gradient(to bottom right, #131313, #1e1e1e);padding:10px;font-family:sans-serif;font-size:12px;line-height:normal}.grapher-night *,.grapher-night :after,.grapher-night :before{box-sizing:content-box}.grapher-night .grapher-title{text-align:center;color:#fff;font-size:18px;margin-bottom:8px}.grapher-night .grapher-primary-container-outer{display:flex}.grapher-night .grapher-primary-container-outer .grapher-sidebar{background:linear-gradient(#111, transparent 75%, transparent 100%);color:#eee;padding:50px 6px 5px 10px;margin-left:-10px;margin-top:-10px;margin-bottom:-10px;overflow-y:auto;flex-shrink:0}.grapher-night .grapher-primary-container-outer .grapher-sidebar .series-toggle{white-space:nowrap}.grapher-night .grapher-primary-container-outer .grapher-sidebar .series-toggle+.series-toggle{margin-top:3px}.grapher-night .grapher-primary-container-outer .grapher-sidebar .series-toggle label{display:inline-block;position:relative;user-select:none}.grapher-night .grapher-primary-container-outer .grapher-sidebar .series-toggle input[type=checkbox]{opacity:0;cursor:pointer;height:0;width:0;margin-right:11px}.grapher-night .grapher-primary-container-outer .grapher-sidebar .series-toggle input:not(:checked)~.checkmark{background-color:rgba(0,0,0,0) !important}.grapher-night .grapher-primary-container-outer .grapher-sidebar .series-toggle input:checked~.checkmark:after{display:block}.grapher-night .grapher-primary-container-outer .grapher-sidebar .series-toggle .checkmark{position:absolute;top:1px;left:0;height:7px;width:7px;background-color:#eee;border:2px solid;border-radius:1px}.grapher-night .grapher-primary-container-outer .grapher-sidebar .series-toggle .checkmark:after{content:\"\";position:absolute;display:none;left:.5px;top:-1.5px;width:3px;height:6px;border:solid #fff;border-width:0 2px 2px 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.grapher-night .grapher-primary-container-outer .grapher-primary-container-body{width:100%;padding-left:2px}.grapher-night .series-key{text-align:center;margin-bottom:-14px;position:relative}.grapher-night .series-key .scale-label{display:inline-block;background:#111;color:silver;transform:rotate(-90deg);width:24px;margin-left:-5px;vertical-align:top;margin-top:4px;padding-bottom:2px;cursor:pointer;user-select:none}.grapher-night .series-key .series-key-axis-container{display:inline-block;border:1px solid #111;min-width:18px;min-height:24px;vertical-align:top;white-space:nowrap}.grapher-night .series-key .series-key-axis-container+.series-key-axis-container{margin-left:4px}.grapher-night .series-key .series-key-axis-container.series-key-axis-container-showing-label .scale-label{width:46px;margin-top:15px;margin-left:-15px;margin-right:-12px}.grapher-night .series-key .series-key-axis-container.series-key-axis-container-showing-label .series-key-axis-label-container{display:block}.grapher-night .series-key .series-key-axis-container.series-key-axis-container-showing-label .label-input-toggler path{fill:#e0e0e3}.grapher-night .series-key .series-key-axis-container .series-key-axis-container-body{display:inline-block}.grapher-night .series-key .series-key-axis-container .series-key-axis-container-body>div{white-space:initial}.grapher-night .series-key .series-key-axis-container .series-key-axis-label-container{display:none}.grapher-night .series-key .series-key-axis-container .label-input-toggler{width:16px;cursor:pointer;display:inline-block;vertical-align:top;margin:4px 2px}.grapher-night .series-key .series-key-axis-container .label-input-toggler path{fill:#111}.grapher-night .series-key .series-key-axis-container .label-input-toggler:hover path{fill:#e0e0e3}.grapher-night .series-key .series-key-item{border:1px solid currentColor;padding:2px;margin:2px;display:inline-block;cursor:pointer;user-select:none;background:rgba(0,0,0,0)}.grapher-night .series-key .series-key-item+.series-key-item{margin-left:4px}.grapher-night .series-key .series-key-item.series-key-item-highlighted{box-shadow:0 0 4px silver}.grapher-night .range-selection{color:silver;user-select:none}.grapher-night .range-selection.range-not-dates{color:#aaa}.grapher-night .range-selection .range-buttons{text-align:right}.grapher-night .range-selection .range-buttons .options-bar{display:inline-block}.grapher-night .range-selection .range-buttons .option-tooltip{position:relative;display:inline-block;border-bottom:1px dotted #000}.grapher-night .range-selection .range-buttons .option-tooltip .option-tooltip-text{visibility:hidden;color:silver;background:#000;text-align:center;padding:5px 5px;border-radius:6px;position:absolute;z-index:1;border:1px solid #000;width:120px;margin-left:-65px;top:calc(100% + 7px);left:50%}.grapher-night .range-selection .range-buttons .option-tooltip:hover .option-tooltip-text{visibility:visible}.grapher-night .range-selection .range-buttons .option-tooltip .option-tooltip-text::after{content:\" \";position:absolute;bottom:100%;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:rgba(0,0,0,0) rgba(0,0,0,0) #000 rgba(0,0,0,0)}.grapher-night .range-selection .range-buttons .range-button{display:inline-block;cursor:pointer;padding:4px 8px;margin-left:6px;border-radius:2px;background:#505053}.grapher-night .range-selection .range-buttons .range-button.range-button-selected{color:silver;background:#000}.grapher-night .range-selection .range-buttons .range-button.range-button-disabled,.grapher-night .range-selection .range-buttons .range-button.range-button-selected.range-button-disabled{cursor:not-allowed;color:#aaa;background:#7a7a7a}.grapher-night .range-selection .range-buttons .range-button .icon-container{position:relative;width:0}.grapher-night .range-selection .range-buttons .range-button .icon-container.icon-container-narrow svg{left:-3px}.grapher-night .range-selection .range-buttons .range-button .icon-container.icon-container-square{width:5px}.grapher-night .range-selection .range-buttons .range-button .icon-container.icon-container-square svg{left:-5px}.grapher-night .range-selection .range-buttons .range-button .icon-container.icon-container-448{width:3px}.grapher-night .range-selection .range-buttons .range-button .icon-container.icon-container-448 svg{left:-5px}.grapher-night .range-selection .range-buttons .range-button .icon-container:before{content:\"A\";opacity:0}.grapher-night .range-selection .range-buttons .range-button .icon-container svg{height:15px;position:absolute;top:-1px;left:-4px}.grapher-night .range-selection .range-buttons .range-selection-history+.range-selection-history{margin-right:8px;margin-left:4px}.grapher-night .range-selection .range-buttons .percentile-button>div{display:inline-block}.grapher-night .range-selection .range-buttons .percentile-button input{background:rgba(0,0,0,0);border:1px solid #505053;margin:2px 8px 2px 0;color:#e0e0e3;padding:1px 2px;width:20px;font-size:11px;-moz-appearance:textfield}.grapher-night .range-selection .range-buttons .percentile-button input:focus{outline:none;border-color:#e0e0e3}.grapher-night .range-selection .range-buttons .percentile-button input::-webkit-outer-spin-button,.grapher-night .range-selection .range-buttons .percentile-button input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.grapher-night .range-selection .range-buttons .percentile-button .icon-container.icon-container-narrow svg{height:12px;top:1px;left:-5px}.grapher-night .range-selection .range-buttons .showing-options-button{margin-right:8px}.grapher-night .grapher-main-row{display:flex}.grapher-night .grapher-main-row .central-container{width:100%}.grapher-night .range-graph-container{display:flex;margin-top:10px}.grapher-night .graph-body{width:100%;height:400px;position:relative}.grapher-night .graph-body canvas{width:100%;height:100%}.grapher-night .graph-body .grapher-tooltip,.grapher-night .graph-body .grapher-draggable-points,.grapher-night .graph-body .grapher-vertical-lines{position:absolute;top:0;left:0;right:0;z-index:20}.grapher-night .graph-body .grapher-tooltip>svg,.grapher-night .graph-body .grapher-draggable-points>svg,.grapher-night .graph-body .grapher-vertical-lines>svg{position:absolute;overflow:visible;left:0}.grapher-night .graph-body .grapher-vertical-lines{pointer-events:none;user-select:none}.grapher-night .graph-body .grapher-tooltip .tooltip-item path{fill:rgba(0,0,0,.6)}.grapher-night .graph-body .grapher-tooltip .tooltip-item text{fill:#f0f0f0;dominant-baseline:hanging;text-anchor:start}.grapher-night .graph-body .grapher-tooltip .tooltip-item.tooltip-item-fixed path{fill:#000}.grapher-night .graph-body .grapher-tooltip .line{position:absolute;height:400px;border-left:1px solid #ccc}.grapher-night .graph-body .grapher-tooltip .custom-tooltip-container{position:absolute}.grapher-night .graph-body .grapher-context-menu{position:absolute;top:0;left:0}.grapher-night .graph-body .grapher-context-menu .menu-item .menu-text{user-select:all;position:absolute;top:0;background:rgba(0,0,0,.6);border:1px solid rgba(255,255,255,.3);color:#f0f0f0;padding:2px 4px;max-width:max-content;width:200px}.grapher-night .graph-body .grapher-draggable-points circle{cursor:pointer}.grapher-night .graph-body .grapher-vertical-lines line{stroke:#ccc}.grapher-night .graph-body .grapher-vertical-lines polygon{fill:#ccc}.grapher-night .graph-body .grapher-annotations{position:absolute;top:0;pointer-events:none;user-select:none;z-index:10}.grapher-night .graph-body .grapher-annotations .grapher-annotation{position:absolute}.grapher-night .graph-body .grapher-annotations .grapher-annotation .annotation-marker{display:inline-block;background:rgba(255,255,255,.3)}.grapher-night .graph-body .grapher-annotations .grapher-annotation.grapher-annotation-range .annotation-range-marker{display:inline-block;background-color:rgba(128,128,128,.2);background-image:repeating-linear-gradient(53deg, #626266, #626266 1px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.1) 4px);background-size:40px 40px;border-right:1px solid #fff;border-left:1px solid #fff}.grapher-night .graph-body .grapher-annotations .grapher-annotation .annotation-text{position:absolute;background:rgba(0,0,0,.6);border:1px solid rgba(255,255,255,.3);color:#f0f0f0;padding:2px 4px;white-space:nowrap;font-size:10px;z-index:10}.grapher-night .graph-body .bounds-selection{position:absolute;background:rgba(255,255,255,.1)}.grapher-night .axis{overflow:visible;user-select:none}.grapher-night .axis.x-axis{width:1px;height:20px;display:block}.grapher-night .axis.x-axis.x-axis-dual{height:30px}.grapher-night .axis.y-axis{height:400px}.grapher-night .axis.y-axis .axis-item text{text-anchor:end}.grapher-night .axis.y-axis .y-axis-label{text-anchor:middle;fill:#e0e0e3}.grapher-night .axis.y-axis .y-axis-label.y-axis-big-label{font-size:18px}.grapher-night .axis.y-axis .series-color-box{cursor:pointer}.grapher-night .axis.y-axis.y-axis-right .axis-item text{text-anchor:start}.grapher-night .axis .axis-line{stroke:rgba(192,192,192,.3);stroke-width:1px}.grapher-night .axis .axis-item path{stroke:rgba(192,192,192,.3);stroke-width:1px}.grapher-night .axis .axis-item text{fill:#e0e0e3;font-size:8px}.grapher-night .axis .axis-item.axis-item-major .axis-tick{stroke-width:1px}.grapher-night .axis .axis-item.axis-item-big-labels text{font-size:16px}.grapher-night .wind-arrows{color:#e0e0e3;opacity:.7}.grapher-night .range-selection-graph{width:100%;background-color:rgba(0,0,0,.3);height:calc(50px + 14px)}.grapher-night .range-selection-graph .graph-body-secondary{height:50px}.grapher-night .range-selection-graph .graph-body-secondary canvas{height:100%}.grapher-night .range-selection-graph .graph-body-secondary svg{position:absolute;left:0;width:100%;overflow:visible}.grapher-night .range-selection-graph .graph-body-secondary svg .target-selection{fill:rgba(255,255,255,.1);cursor:ew-resize}.grapher-night .range-selection-graph .graph-body-secondary svg .target-selection-outline{stroke:#aaa;cursor:ew-resize;fill:rgba(0,0,0,0)}.grapher-night .range-selection-graph .graph-body-secondary svg .selection-bar-track{fill:#303033}.grapher-night .range-selection-graph .graph-body-secondary svg .selection-bar{fill:#808083;cursor:ew-resize}.grapher-night .range-selection-graph .graph-body-secondary svg .selection-bar-rifles{stroke:#fff;stroke-width:1px;cursor:ew-resize}.grapher-night .range-selection-graph .graph-body-secondary svg .selection-bar-handle-hit{cursor:ew-resize}.grapher-night .range-selection-graph .graph-body-secondary svg .selection-bar-handle{stroke:#aaa;fill:#666;stroke-width:1px;cursor:ew-resize;transition:stroke-width .15s ease,fill .15s ease}.grapher-night .range-selection-graph .graph-body-secondary svg .selection-handle .selection-handle-hit{cursor:ew-resize}.grapher-night .range-selection-graph .graph-body-secondary svg .selection-handle .selection-handle-line{stroke:#aaa;stroke-width:1;transition:stroke-width .15s ease}.grapher-night .range-selection-graph .graph-body-secondary svg .selection-handle:hover .selection-handle-line{stroke-width:3}.grapher-night .range-selection-graph .graph-body-secondary svg .selection-handle.selection-handle-dragging .selection-handle-line{stroke-width:3}.grapher-night .range-selection-graph .graph-body-secondary svg .selection-handle:hover .selection-bar-handle{stroke-width:2px}.grapher-night .range-selection-graph .graph-body-secondary svg .selection-handle.selection-handle-dragging .selection-bar-handle{stroke-width:2px}.grapher-night .range-selection-graph .graph-body-secondary svg .axis-item text{fill:#9f9f9f;text-anchor:start;font-size:8px;user-select:none;dominant-baseline:text-after-edge}.grapher-night .range-selection-graph .graph-body-secondary svg .axis-item path{stroke:#9f9f9f;stroke-width:1px}.grapher-night .range-selection-graph .graph-body-secondary svg .axis-item.axis-item-highlighted path{stroke:#fff}.grapher-night .range-selection-graph .graph-body-secondary svg .axis-item.axis-item-highlighted text{fill:#fff}.grapher-night input,.grapher-night textarea{background:rgba(0,0,0,0);border:1px solid #505053;margin:2px 0;color:#e0e0e3;padding:1px 2px;text-align:center}.grapher-night input:focus,.grapher-night textarea:focus{outline:none;border-color:#e0e0e3}.grapher-night.grapher-dragging-y .y-axis{border:2px dashed silver;margin:-2px;flex-shrink:0}.grapher-night.grapher-dragging-y .y-axis+.y-axis{border-left:none}.grapher-night.grapher-fullscreen{height:calc(100vh - 2*10px)}.grapher-night.grapher-fixed-height .grapher-primary-container-outer{height:100%}.grapher-night.grapher-fixed-height .grapher-primary-container-outer .grapher-primary-container-body{height:100%;display:flex;flex-direction:column}.grapher-night.grapher-fixed-height .grapher-primary-container-outer .grapher-primary-container-body .grapher-main-row{flex-grow:1}.grapher-night.grapher-fixed-height .grapher-primary-container-outer .grapher-primary-container-body .grapher-main-row .central-container{display:flex;flex-direction:column;height:100%}.grapher-night.grapher-fixed-height .grapher-primary-container-outer .grapher-primary-container-body .grapher-main-row .central-container>.graph-body{flex-grow:1;height:unset}.grapher-night.grapher-fixed-height .grapher-primary-container-outer .grapher-primary-container-body .grapher-main-row .axis.y-axis{height:calc(100% - 40px)}.grapher-night.new-grapher{height:auto;border:2px dashed silver;text-align:center;color:#ddd}.grapher-day{position:relative;background:linear-gradient(to bottom right, #FFF, #FFF);padding:10px;font-family:sans-serif;font-size:12px;line-height:normal}.grapher-day *,.grapher-day :after,.grapher-day :before{box-sizing:content-box}.grapher-day .grapher-title{text-align:center;color:#000;font-size:18px;margin-bottom:8px}.grapher-day .grapher-primary-container-outer{display:flex}.grapher-day .grapher-primary-container-outer .grapher-sidebar{background:linear-gradient(#EEE, transparent 75%, transparent 100%);color:#111;padding:50px 6px 5px 10px;margin-left:-10px;margin-top:-10px;margin-bottom:-10px;overflow-y:auto;flex-shrink:0}.grapher-day .grapher-primary-container-outer .grapher-sidebar .series-toggle{white-space:nowrap}.grapher-day .grapher-primary-container-outer .grapher-sidebar .series-toggle+.series-toggle{margin-top:3px}.grapher-day .grapher-primary-container-outer .grapher-sidebar .series-toggle label{display:inline-block;position:relative;user-select:none}.grapher-day .grapher-primary-container-outer .grapher-sidebar .series-toggle input[type=checkbox]{opacity:0;cursor:pointer;height:0;width:0;margin-right:11px}.grapher-day .grapher-primary-container-outer .grapher-sidebar .series-toggle input:not(:checked)~.checkmark{background-color:rgba(0,0,0,0) !important}.grapher-day .grapher-primary-container-outer .grapher-sidebar .series-toggle input:checked~.checkmark:after{display:block}.grapher-day .grapher-primary-container-outer .grapher-sidebar .series-toggle .checkmark{position:absolute;top:1px;left:0;height:7px;width:7px;background-color:#eee;border:2px solid;border-radius:1px}.grapher-day .grapher-primary-container-outer .grapher-sidebar .series-toggle .checkmark:after{content:\"\";position:absolute;display:none;left:.5px;top:-1.5px;width:3px;height:6px;border:solid #fff;border-width:0 2px 2px 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.grapher-day .grapher-primary-container-outer .grapher-primary-container-body{width:100%;padding-left:2px}.grapher-day .series-key{text-align:center;margin-bottom:-14px;position:relative}.grapher-day .series-key .scale-label{display:inline-block;background:#b0b0b7;color:#000;transform:rotate(-90deg);width:24px;margin-left:-5px;vertical-align:top;margin-top:4px;padding-bottom:2px;cursor:pointer;user-select:none}.grapher-day .series-key .series-key-axis-container{display:inline-block;border:1px solid #b0b0b7;min-width:18px;min-height:24px;vertical-align:top;white-space:nowrap}.grapher-day .series-key .series-key-axis-container+.series-key-axis-container{margin-left:4px}.grapher-day .series-key .series-key-axis-container.series-key-axis-container-showing-label .scale-label{width:46px;margin-top:15px;margin-left:-15px;margin-right:-12px}.grapher-day .series-key .series-key-axis-container.series-key-axis-container-showing-label .series-key-axis-label-container{display:block}.grapher-day .series-key .series-key-axis-container.series-key-axis-container-showing-label .label-input-toggler path{fill:#505053}.grapher-day .series-key .series-key-axis-container .series-key-axis-container-body{display:inline-block}.grapher-day .series-key .series-key-axis-container .series-key-axis-container-body>div{white-space:initial}.grapher-day .series-key .series-key-axis-container .series-key-axis-label-container{display:none}.grapher-day .series-key .series-key-axis-container .label-input-toggler{width:16px;cursor:pointer;display:inline-block;vertical-align:top;margin:4px 2px}.grapher-day .series-key .series-key-axis-container .label-input-toggler path{fill:#b0b0b7}.grapher-day .series-key .series-key-axis-container .label-input-toggler:hover path{fill:#505053}.grapher-day .series-key .series-key-item{border:1px solid currentColor;padding:2px;margin:2px;display:inline-block;cursor:pointer;user-select:none}.grapher-day .series-key .series-key-item+.series-key-item{margin-left:4px}.grapher-day .series-key .series-key-item.series-key-item-highlighted{box-shadow:0 0 4px #000}.grapher-day .range-selection{color:#444;user-select:none}.grapher-day .range-selection.range-not-dates{color:#888}.grapher-day .range-selection .range-buttons{text-align:right}.grapher-day .range-selection .range-buttons .options-bar{display:inline-block}.grapher-day .range-selection .range-buttons .option-tooltip{position:relative;display:inline-block;border-bottom:1px dotted #000}.grapher-day .range-selection .range-buttons .option-tooltip .option-tooltip-text{visibility:hidden;color:#000;background:#fff;text-align:center;padding:5px 5px;border-radius:6px;position:absolute;z-index:1;border:1px solid #000;width:120px;margin-left:-65px;top:calc(100% + 7px);left:50%}.grapher-day .range-selection .range-buttons .option-tooltip:hover .option-tooltip-text{visibility:visible}.grapher-day .range-selection .range-buttons .option-tooltip .option-tooltip-text::after{content:\" \";position:absolute;bottom:100%;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:rgba(0,0,0,0) rgba(0,0,0,0) #000 rgba(0,0,0,0)}.grapher-day .range-selection .range-buttons .range-button{display:inline-block;cursor:pointer;padding:4px 8px;margin-left:4px;border-radius:2px;background:#fff;border:1px dotted silver}.grapher-day .range-selection .range-buttons .range-button.range-button-selected{color:#000;background:#fff;border:1px solid #000}.grapher-day .range-selection .range-buttons .range-button.range-button-disabled,.grapher-day .range-selection .range-buttons .range-button.range-button-selected.range-button-disabled{cursor:not-allowed;color:#888;background:#eee}.grapher-day .range-selection .range-buttons .range-button .icon-container{position:relative;width:0}.grapher-day .range-selection .range-buttons .range-button .icon-container.icon-container-narrow svg{left:-3px}.grapher-day .range-selection .range-buttons .range-button .icon-container.icon-container-square{width:5px}.grapher-day .range-selection .range-buttons .range-button .icon-container.icon-container-square svg{left:-5px}.grapher-day .range-selection .range-buttons .range-button .icon-container.icon-container-448{width:3px}.grapher-day .range-selection .range-buttons .range-button .icon-container.icon-container-448 svg{left:-5px}.grapher-day .range-selection .range-buttons .range-button .icon-container:before{content:\"A\";opacity:0}.grapher-day .range-selection .range-buttons .range-button .icon-container svg{height:15px;position:absolute;top:-1px;left:-4px}.grapher-day .range-selection .range-buttons .range-selection-history+.range-selection-history{margin-right:8px;margin-left:4px}.grapher-day .range-selection .range-buttons .percentile-button>div{display:inline-block}.grapher-day .range-selection .range-buttons .percentile-button input{background:rgba(0,0,0,0);border:1px solid #e0e0e3;margin:2px 8px 2px 0;color:#222;padding:1px 2px;width:20px;font-size:11px;-moz-appearance:textfield}.grapher-day .range-selection .range-buttons .percentile-button input:focus{outline:none;border-color:#505053}.grapher-day .range-selection .range-buttons .percentile-button input::-webkit-outer-spin-button,.grapher-day .range-selection .range-buttons .percentile-button input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.grapher-day .range-selection .range-buttons .percentile-button .icon-container.icon-container-narrow svg{height:12px;top:1px;left:-5px}.grapher-day .range-selection .range-buttons .showing-options-button{margin-right:8px}.grapher-day .grapher-main-row{display:flex}.grapher-day .grapher-main-row .central-container{width:100%}.grapher-day .range-graph-container{display:flex;margin-top:10px}.grapher-day .graph-body{width:100%;height:400px;position:relative}.grapher-day .graph-body canvas{width:100%;height:100%}.grapher-day .graph-body .grapher-tooltip,.grapher-day .graph-body .grapher-draggable-points,.grapher-day .graph-body .grapher-vertical-lines{position:absolute;top:0;left:0;right:0;z-index:20}.grapher-day .graph-body .grapher-tooltip>svg,.grapher-day .graph-body .grapher-draggable-points>svg,.grapher-day .graph-body .grapher-vertical-lines>svg{position:absolute;overflow:visible;left:0}.grapher-day .graph-body .grapher-vertical-lines{pointer-events:none;user-select:none}.grapher-day .graph-body .grapher-tooltip .tooltip-item path{fill:rgba(255,255,255,.6)}.grapher-day .graph-body .grapher-tooltip .tooltip-item text{fill:#0f0f0f;dominant-baseline:hanging;text-anchor:start}.grapher-day .graph-body .grapher-tooltip .tooltip-item.tooltip-item-fixed path{fill:#fff}.grapher-day .graph-body .grapher-tooltip .line{position:absolute;height:400px;border-left:1px solid #333}.grapher-day .graph-body .grapher-tooltip .custom-tooltip-container{position:absolute}.grapher-day .graph-body .grapher-context-menu{position:absolute;top:0;left:0}.grapher-day .graph-body .grapher-context-menu .menu-item .menu-text{user-select:all;position:absolute;top:0;background:rgba(255,255,255,.6);border:1px solid rgba(0,0,0,.3);color:#0f0f0f;padding:2px 4px;max-width:max-content;width:200px}.grapher-day .graph-body .grapher-draggable-points circle{cursor:pointer}.grapher-day .graph-body .grapher-vertical-lines line{stroke:#333}.grapher-day .graph-body .grapher-vertical-lines polygon{fill:#333}.grapher-day .graph-body .grapher-annotations{position:absolute;top:0;pointer-events:none;user-select:none;z-index:10}.grapher-day .graph-body .grapher-annotations .grapher-annotation{position:absolute}.grapher-day .graph-body .grapher-annotations .grapher-annotation .annotation-marker{display:inline-block;background:rgba(0,0,0,.3)}.grapher-day .graph-body .grapher-annotations .grapher-annotation.grapher-annotation-range .annotation-range-marker{display:inline-block;background-color:rgba(128,128,128,.2);background-image:repeating-linear-gradient(53deg, #626266, #626266 1px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.1) 4px);background-size:40px 40px;border-right:1px solid #fff;border-left:1px solid #fff}.grapher-day .graph-body .grapher-annotations .grapher-annotation .annotation-text{position:absolute;background:rgba(255,255,255,.6);border:1px solid rgba(0,0,0,.3);color:#0f0f0f;padding:2px 4px;white-space:nowrap;font-size:10px;z-index:10}.grapher-day .graph-body .bounds-selection{position:absolute;background:rgba(0,0,0,.02)}.grapher-day .axis{overflow:visible;user-select:none}.grapher-day .axis.x-axis{width:1px;height:20px;display:block}.grapher-day .axis.x-axis.x-axis-dual{height:30px}.grapher-day .axis.y-axis{height:400px}.grapher-day .axis.y-axis .axis-item text{text-anchor:end}.grapher-day .axis.y-axis .y-axis-label{text-anchor:middle;fill:#1f1f1c}.grapher-day .axis.y-axis .y-axis-label.y-axis-big-label{font-size:18px}.grapher-day .axis.y-axis .series-color-box{cursor:pointer}.grapher-day .axis.y-axis.y-axis-right .axis-item text{text-anchor:start}.grapher-day .axis .axis-line{stroke:#656565;stroke-width:1px}.grapher-day .axis .axis-item path{stroke:#bfbfbf;stroke-width:1px}.grapher-day .axis .axis-item text{fill:#1f1f1c;font-size:8px}.grapher-day .axis .axis-item.axis-item-major .axis-tick{stroke-width:1px}.grapher-day .axis .axis-item.axis-item-big-labels text{font-size:16px}.grapher-day .wind-arrows{color:#1f1f1c;opacity:.7}.grapher-day .range-selection-graph{width:100%;background-color:rgba(255,255,255,.3);height:calc(50px + 14px)}.grapher-day .range-selection-graph .graph-body-secondary{height:50px}.grapher-day .range-selection-graph .graph-body-secondary canvas{height:100%}.grapher-day .range-selection-graph .graph-body-secondary svg{position:absolute;left:0;width:100%;overflow:visible}.grapher-day .range-selection-graph .graph-body-secondary svg .target-selection{fill:rgba(0,0,0,.02);cursor:ew-resize}.grapher-day .range-selection-graph .graph-body-secondary svg .target-selection-outline{stroke:#333;cursor:ew-resize;fill:rgba(0,0,0,0)}.grapher-day .range-selection-graph .graph-body-secondary svg .selection-bar-track{fill:#eee}.grapher-day .range-selection-graph .graph-body-secondary svg .selection-bar{fill:#b0b0b7;cursor:ew-resize}.grapher-day .range-selection-graph .graph-body-secondary svg .selection-bar-rifles{stroke:#333;stroke-width:1px;cursor:ew-resize}.grapher-day .range-selection-graph .graph-body-secondary svg .selection-bar-handle-hit{cursor:ew-resize}.grapher-day .range-selection-graph .graph-body-secondary svg .selection-bar-handle{stroke:#333;fill:#b0b0b7;stroke-width:1px;cursor:ew-resize;transition:stroke-width .15s ease,fill .15s ease}.grapher-day .range-selection-graph .graph-body-secondary svg .selection-handle .selection-handle-hit{cursor:ew-resize}.grapher-day .range-selection-graph .graph-body-secondary svg .selection-handle .selection-handle-line{stroke:#333;stroke-width:1;transition:stroke-width .15s ease}.grapher-day .range-selection-graph .graph-body-secondary svg .selection-handle:hover .selection-handle-line{stroke-width:3}.grapher-day .range-selection-graph .graph-body-secondary svg .selection-handle.selection-handle-dragging .selection-handle-line{stroke-width:3}.grapher-day .range-selection-graph .graph-body-secondary svg .selection-handle:hover .selection-bar-handle{stroke-width:2px}.grapher-day .range-selection-graph .graph-body-secondary svg .selection-handle.selection-handle-dragging .selection-bar-handle{stroke-width:2px}.grapher-day .range-selection-graph .graph-body-secondary svg .axis-item text{fill:#555;text-anchor:start;font-size:8px;user-select:none;dominant-baseline:text-after-edge}.grapher-day .range-selection-graph .graph-body-secondary svg .axis-item path{stroke:#555;stroke-width:1px}.grapher-day .range-selection-graph .graph-body-secondary svg .axis-item.axis-item-highlighted path{stroke:#000}.grapher-day .range-selection-graph .graph-body-secondary svg .axis-item.axis-item-highlighted text{fill:#000}.grapher-day input,.grapher-day textarea{background:rgba(0,0,0,0);border:1px solid #e0e0e3;margin:2px 0;color:#222;padding:1px 2px;text-align:center}.grapher-day input:focus,.grapher-day textarea:focus{outline:none;border-color:#505053}.grapher-day.grapher-dragging-y .y-axis{border:2px dashed silver;margin:-2px;flex-shrink:0}.grapher-day.grapher-dragging-y .y-axis+.y-axis{border-left:none}.grapher-day.grapher-fullscreen{height:calc(100vh - 2*10px)}.grapher-day.grapher-fixed-height .grapher-primary-container-outer{height:100%}.grapher-day.grapher-fixed-height .grapher-primary-container-outer .grapher-primary-container-body{height:100%;display:flex;flex-direction:column}.grapher-day.grapher-fixed-height .grapher-primary-container-outer .grapher-primary-container-body .grapher-main-row{flex-grow:1}.grapher-day.grapher-fixed-height .grapher-primary-container-outer .grapher-primary-container-body .grapher-main-row .central-container{display:flex;flex-direction:column;height:100%}.grapher-day.grapher-fixed-height .grapher-primary-container-outer .grapher-primary-container-body .grapher-main-row .central-container>.graph-body{flex-grow:1;height:unset}.grapher-day.grapher-fixed-height .grapher-primary-container-outer .grapher-primary-container-body .grapher-main-row .axis.y-axis{height:calc(100% - 40px)}.grapher-day.new-grapher{height:auto;border:2px dashed silver;text-align:center;color:#222}.grapher-export{position:relative;background:linear-gradient(to bottom right, #FFF, #FFF);padding:10px;font-family:sans-serif;font-size:12px;line-height:normal}.grapher-export *,.grapher-export :after,.grapher-export :before{box-sizing:content-box}.grapher-export .grapher-title{text-align:center;color:#000;font-size:18px;margin-bottom:8px}.grapher-export .grapher-primary-container-outer{display:flex}.grapher-export .grapher-primary-container-outer .grapher-sidebar{background:linear-gradient(#EEE, transparent 75%, transparent 100%);color:#111;padding:50px 6px 5px 10px;margin-left:-10px;margin-top:-10px;margin-bottom:-10px;overflow-y:auto;flex-shrink:0}.grapher-export .grapher-primary-container-outer .grapher-sidebar .series-toggle{white-space:nowrap}.grapher-export .grapher-primary-container-outer .grapher-sidebar .series-toggle+.series-toggle{margin-top:3px}.grapher-export .grapher-primary-container-outer .grapher-sidebar .series-toggle label{display:inline-block;position:relative;user-select:none}.grapher-export .grapher-primary-container-outer .grapher-sidebar .series-toggle input[type=checkbox]{opacity:0;cursor:pointer;height:0;width:0;margin-right:11px}.grapher-export .grapher-primary-container-outer .grapher-sidebar .series-toggle input:not(:checked)~.checkmark{background-color:rgba(0,0,0,0) !important}.grapher-export .grapher-primary-container-outer .grapher-sidebar .series-toggle input:checked~.checkmark:after{display:block}.grapher-export .grapher-primary-container-outer .grapher-sidebar .series-toggle .checkmark{position:absolute;top:1px;left:0;height:7px;width:7px;background-color:#eee;border:2px solid;border-radius:1px}.grapher-export .grapher-primary-container-outer .grapher-sidebar .series-toggle .checkmark:after{content:\"\";position:absolute;display:none;left:.5px;top:-1.5px;width:3px;height:6px;border:solid #fff;border-width:0 2px 2px 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.grapher-export .grapher-primary-container-outer .grapher-primary-container-body{width:100%;padding-left:2px}.grapher-export .series-key{text-align:center;margin-bottom:-14px;position:relative}.grapher-export .series-key .scale-label{display:inline-block;background:#b0b0b7;color:#000;transform:rotate(-90deg);width:24px;margin-left:-5px;vertical-align:top;margin-top:4px;padding-bottom:2px;cursor:pointer;user-select:none}.grapher-export .series-key .series-key-axis-container{display:inline-block;border:1px solid #b0b0b7;min-width:18px;min-height:24px;vertical-align:top;white-space:nowrap}.grapher-export .series-key .series-key-axis-container+.series-key-axis-container{margin-left:4px}.grapher-export .series-key .series-key-axis-container.series-key-axis-container-showing-label .scale-label{width:46px;margin-top:15px;margin-left:-15px;margin-right:-12px}.grapher-export .series-key .series-key-axis-container.series-key-axis-container-showing-label .series-key-axis-label-container{display:block}.grapher-export .series-key .series-key-axis-container.series-key-axis-container-showing-label .label-input-toggler path{fill:#505053}.grapher-export .series-key .series-key-axis-container .series-key-axis-container-body{display:inline-block}.grapher-export .series-key .series-key-axis-container .series-key-axis-container-body>div{white-space:initial}.grapher-export .series-key .series-key-axis-container .series-key-axis-label-container{display:none}.grapher-export .series-key .series-key-axis-container .label-input-toggler{width:16px;cursor:pointer;display:inline-block;vertical-align:top;margin:4px 2px}.grapher-export .series-key .series-key-axis-container .label-input-toggler path{fill:#b0b0b7}.grapher-export .series-key .series-key-axis-container .label-input-toggler:hover path{fill:#505053}.grapher-export .series-key .series-key-item{border:1px solid currentColor;padding:2px;margin:2px;display:inline-block;cursor:pointer;user-select:none}.grapher-export .series-key .series-key-item+.series-key-item{margin-left:4px}.grapher-export .series-key .series-key-item.series-key-item-highlighted{box-shadow:0 0 4px #000}.grapher-export .range-selection{color:#444;user-select:none}.grapher-export .range-selection.range-not-dates{color:#888}.grapher-export .range-selection .range-buttons{text-align:right}.grapher-export .range-selection .range-buttons .options-bar{display:inline-block}.grapher-export .range-selection .range-buttons .option-tooltip{position:relative;display:inline-block;border-bottom:1px dotted #000}.grapher-export .range-selection .range-buttons .option-tooltip .option-tooltip-text{visibility:hidden;color:#000;background:#fff;text-align:center;padding:5px 5px;border-radius:6px;position:absolute;z-index:1;border:1px solid #000;width:120px;margin-left:-65px;top:calc(100% + 7px);left:50%}.grapher-export .range-selection .range-buttons .option-tooltip:hover .option-tooltip-text{visibility:visible}.grapher-export .range-selection .range-buttons .option-tooltip .option-tooltip-text::after{content:\" \";position:absolute;bottom:100%;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:rgba(0,0,0,0) rgba(0,0,0,0) #000 rgba(0,0,0,0)}.grapher-export .range-selection .range-buttons .range-button{display:inline-block;cursor:pointer;padding:4px 8px;margin-left:4px;border-radius:2px;background:#fff;border:1px dotted silver}.grapher-export .range-selection .range-buttons .range-button.range-button-selected{color:#000;background:#fff;border:1px solid #000}.grapher-export .range-selection .range-buttons .range-button.range-button-disabled,.grapher-export .range-selection .range-buttons .range-button.range-button-selected.range-button-disabled{cursor:not-allowed;color:#888;background:#eee}.grapher-export .range-selection .range-buttons .range-button .icon-container{position:relative;width:0}.grapher-export .range-selection .range-buttons .range-button .icon-container.icon-container-narrow svg{left:-3px}.grapher-export .range-selection .range-buttons .range-button .icon-container.icon-container-square{width:5px}.grapher-export .range-selection .range-buttons .range-button .icon-container.icon-container-square svg{left:-5px}.grapher-export .range-selection .range-buttons .range-button .icon-container.icon-container-448{width:3px}.grapher-export .range-selection .range-buttons .range-button .icon-container.icon-container-448 svg{left:-5px}.grapher-export .range-selection .range-buttons .range-button .icon-container:before{content:\"A\";opacity:0}.grapher-export .range-selection .range-buttons .range-button .icon-container svg{height:15px;position:absolute;top:-1px;left:-4px}.grapher-export .range-selection .range-buttons .range-selection-history+.range-selection-history{margin-right:8px;margin-left:4px}.grapher-export .range-selection .range-buttons .percentile-button>div{display:inline-block}.grapher-export .range-selection .range-buttons .percentile-button input{background:rgba(0,0,0,0);border:1px solid #e0e0e3;margin:2px 8px 2px 0;color:#222;padding:1px 2px;width:20px;font-size:11px;-moz-appearance:textfield}.grapher-export .range-selection .range-buttons .percentile-button input:focus{outline:none;border-color:#505053}.grapher-export .range-selection .range-buttons .percentile-button input::-webkit-outer-spin-button,.grapher-export .range-selection .range-buttons .percentile-button input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.grapher-export .range-selection .range-buttons .percentile-button .icon-container.icon-container-narrow svg{height:12px;top:1px;left:-5px}.grapher-export .range-selection .range-buttons .showing-options-button{margin-right:8px}.grapher-export .grapher-main-row{display:flex}.grapher-export .grapher-main-row .central-container{width:100%}.grapher-export .range-graph-container{display:flex;margin-top:10px}.grapher-export .graph-body{width:100%;height:400px;position:relative}.grapher-export .graph-body canvas{width:100%;height:100%}.grapher-export .graph-body .grapher-tooltip,.grapher-export .graph-body .grapher-draggable-points,.grapher-export .graph-body .grapher-vertical-lines{position:absolute;top:0;left:0;right:0;z-index:20}.grapher-export .graph-body .grapher-tooltip>svg,.grapher-export .graph-body .grapher-draggable-points>svg,.grapher-export .graph-body .grapher-vertical-lines>svg{position:absolute;overflow:visible;left:0}.grapher-export .graph-body .grapher-vertical-lines{pointer-events:none;user-select:none}.grapher-export .graph-body .grapher-tooltip .tooltip-item path{fill:rgba(255,255,255,.6)}.grapher-export .graph-body .grapher-tooltip .tooltip-item text{fill:#0f0f0f;dominant-baseline:hanging;text-anchor:start}.grapher-export .graph-body .grapher-tooltip .tooltip-item.tooltip-item-fixed path{fill:#fff}.grapher-export .graph-body .grapher-tooltip .line{position:absolute;height:400px;border-left:1px solid #333}.grapher-export .graph-body .grapher-tooltip .custom-tooltip-container{position:absolute}.grapher-export .graph-body .grapher-context-menu{position:absolute;top:0;left:0}.grapher-export .graph-body .grapher-context-menu .menu-item .menu-text{user-select:all;position:absolute;top:0;background:rgba(255,255,255,.6);border:1px solid rgba(0,0,0,.3);color:#0f0f0f;padding:2px 4px;max-width:max-content;width:200px}.grapher-export .graph-body .grapher-draggable-points circle{cursor:pointer}.grapher-export .graph-body .grapher-vertical-lines line{stroke:#333}.grapher-export .graph-body .grapher-vertical-lines polygon{fill:#333}.grapher-export .graph-body .grapher-annotations{position:absolute;top:0;pointer-events:none;user-select:none;z-index:10}.grapher-export .graph-body .grapher-annotations .grapher-annotation{position:absolute}.grapher-export .graph-body .grapher-annotations .grapher-annotation .annotation-marker{display:inline-block;background:rgba(0,0,0,.3)}.grapher-export .graph-body .grapher-annotations .grapher-annotation.grapher-annotation-range .annotation-range-marker{display:inline-block;background-color:rgba(128,128,128,.2);background-image:repeating-linear-gradient(53deg, #626266, #626266 1px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.1) 4px);background-size:40px 40px;border-right:1px solid #fff;border-left:1px solid #fff}.grapher-export .graph-body .grapher-annotations .grapher-annotation .annotation-text{position:absolute;background:rgba(255,255,255,.6);border:1px solid rgba(0,0,0,.3);color:#0f0f0f;padding:2px 4px;white-space:nowrap;font-size:10px;z-index:10}.grapher-export .graph-body .bounds-selection{position:absolute;background:rgba(0,0,0,.02)}.grapher-export .axis{overflow:visible;user-select:none}.grapher-export .axis.x-axis{width:1px;height:20px;display:block}.grapher-export .axis.x-axis.x-axis-dual{height:30px}.grapher-export .axis.y-axis{height:400px}.grapher-export .axis.y-axis .axis-item text{text-anchor:end}.grapher-export .axis.y-axis .y-axis-label{text-anchor:middle;fill:#000}.grapher-export .axis.y-axis .y-axis-label.y-axis-big-label{font-size:18px}.grapher-export .axis.y-axis .series-color-box{cursor:pointer}.grapher-export .axis.y-axis.y-axis-right .axis-item text{text-anchor:start}.grapher-export .axis .axis-line{stroke:#000;stroke-width:1px}.grapher-export .axis .axis-item path{stroke:#bfbfbf;stroke-width:1px}.grapher-export .axis .axis-item text{fill:#000;font-size:8px}.grapher-export .axis .axis-item.axis-item-major .axis-tick{stroke-width:1px}.grapher-export .axis .axis-item.axis-item-big-labels text{font-size:16px}.grapher-export .wind-arrows{color:#000;opacity:.7}.grapher-export .range-selection-graph{width:100%;background-color:rgba(255,255,255,.3);height:calc(50px + 14px)}.grapher-export .range-selection-graph .graph-body-secondary{height:50px}.grapher-export .range-selection-graph .graph-body-secondary canvas{height:100%}.grapher-export .range-selection-graph .graph-body-secondary svg{position:absolute;left:0;width:100%;overflow:visible}.grapher-export .range-selection-graph .graph-body-secondary svg .target-selection{fill:rgba(0,0,0,.02);cursor:ew-resize}.grapher-export .range-selection-graph .graph-body-secondary svg .target-selection-outline{stroke:#333;cursor:ew-resize;fill:rgba(0,0,0,0)}.grapher-export .range-selection-graph .graph-body-secondary svg .selection-bar-track{fill:#eee}.grapher-export .range-selection-graph .graph-body-secondary svg .selection-bar{fill:#b0b0b7;cursor:ew-resize}.grapher-export .range-selection-graph .graph-body-secondary svg .selection-bar-rifles{stroke:#333;stroke-width:1px;cursor:ew-resize}.grapher-export .range-selection-graph .graph-body-secondary svg .selection-bar-handle-hit{cursor:ew-resize}.grapher-export .range-selection-graph .graph-body-secondary svg .selection-bar-handle{stroke:#333;fill:#b0b0b7;stroke-width:1px;cursor:ew-resize;transition:stroke-width .15s ease,fill .15s ease}.grapher-export .range-selection-graph .graph-body-secondary svg .selection-handle .selection-handle-hit{cursor:ew-resize}.grapher-export .range-selection-graph .graph-body-secondary svg .selection-handle .selection-handle-line{stroke:#333;stroke-width:1;transition:stroke-width .15s ease}.grapher-export .range-selection-graph .graph-body-secondary svg .selection-handle:hover .selection-handle-line{stroke-width:3}.grapher-export .range-selection-graph .graph-body-secondary svg .selection-handle.selection-handle-dragging .selection-handle-line{stroke-width:3}.grapher-export .range-selection-graph .graph-body-secondary svg .selection-handle:hover .selection-bar-handle{stroke-width:2px}.grapher-export .range-selection-graph .graph-body-secondary svg .selection-handle.selection-handle-dragging .selection-bar-handle{stroke-width:2px}.grapher-export .range-selection-graph .graph-body-secondary svg .axis-item text{fill:#333;text-anchor:start;font-size:8px;user-select:none;dominant-baseline:text-after-edge}.grapher-export .range-selection-graph .graph-body-secondary svg .axis-item path{stroke:#333;stroke-width:1px}.grapher-export .range-selection-graph .graph-body-secondary svg .axis-item.axis-item-highlighted path{stroke:#000}.grapher-export .range-selection-graph .graph-body-secondary svg .axis-item.axis-item-highlighted text{fill:#000}.grapher-export input,.grapher-export textarea{background:rgba(0,0,0,0);border:1px solid #e0e0e3;margin:2px 0;color:#222;padding:1px 2px;text-align:center}.grapher-export input:focus,.grapher-export textarea:focus{outline:none;border-color:#505053}.grapher-export.grapher-dragging-y .y-axis{border:2px dashed silver;margin:-2px;flex-shrink:0}.grapher-export.grapher-dragging-y .y-axis+.y-axis{border-left:none}.grapher-export.grapher-fullscreen{height:calc(100vh - 2*10px)}.grapher-export.grapher-fixed-height .grapher-primary-container-outer{height:100%}.grapher-export.grapher-fixed-height .grapher-primary-container-outer .grapher-primary-container-body{height:100%;display:flex;flex-direction:column}.grapher-export.grapher-fixed-height .grapher-primary-container-outer .grapher-primary-container-body .grapher-main-row{flex-grow:1}.grapher-export.grapher-fixed-height .grapher-primary-container-outer .grapher-primary-container-body .grapher-main-row .central-container{display:flex;flex-direction:column;height:100%}.grapher-export.grapher-fixed-height .grapher-primary-container-outer .grapher-primary-container-body .grapher-main-row .central-container>.graph-body{flex-grow:1;height:unset}.grapher-export.grapher-fixed-height .grapher-primary-container-outer .grapher-primary-container-body .grapher-main-row .axis.y-axis{height:calc(100% - 40px)}.grapher-export.new-grapher{height:auto;border:2px dashed silver;text-align:center;color:#222}`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/grapher.scss\"],\"names\":[],\"mappings\":\"AA28BA,eA54BE,iBAAA,CACA,6DAAA,CACA,YAPU,CASV,sBAAA,CACA,cAAA,CACA,kBAAA,CAEA,8DACE,sBAAA,CAGF,8BACE,iBAAA,CACA,UA5BY,CA6BZ,cAAA,CACA,iBAAA,CAGF,gDACE,YAAA,CAEA,iEACE,mEAAA,CACA,UAnCiB,CAoCjB,yBAAA,CACA,iBAAA,CACA,gBAAA,CACA,mBAAA,CACA,eAAA,CACA,aAAA,CAEA,gFACE,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WAAA,CACA,aAAA,CAEA,mDACE,gBAAA,CAKN,mCACE,2BAAA,CAIA,sEACE,WAAA,CAEA,sGACE,WAAA,CACA,YAAA,CACA,qBAAA,CAEA,wHACE,WAAA,CAEA,2IACE,YAAA,CACA,qBAAA,CACA,WAAA,CAEA,uJACE,WAAA,CACA,YAAA,CAIJ,qIACE,wBAAA,CAOV,4BACE,WAAA,CACA,wBAAA,CACA,iBAAA,CACA,UAqI0B\",\"sourcesContent\":[\"@mixin grapher(\\n $primary-graph-body-height: 400px,\\n $secondary-graph-body-height: 50px,\\n\\n $background-color-1: #131313,\\n $background-color-2: #1e1e1e,\\n\\n $tooltip-line-color: #CCC,\\n $tooltip-background-color: rgba(0, 0, 0, 0.6),\\n $tooltip-text-color: #F0F0F0,\\n $vertical-line-color: #CCC,\\n\\n $axis-line-color: rgb(192, 192, 192, 0.3),\\n $axis-line-width: 1px,\\n $axis-tick-color: rgb(192, 192, 192, 0.3),\\n $axis-text-color: #E0E0E3,\\n\\n $range-selection-text-color: silver,\\n $range-selection-button-color: #505053,\\n $range-selection-button-selected-color: black,\\n $range-selection-text-selected-color: silver,\\n $range-selection-text-color-faded: #AAA,\\n $range-selection-button-color-faded: #7A7A7A,\\n $range-selection-button-border: null,\\n $range-selection-selected-button-border: null,\\n\\n $range-graph-selection-background-color: rgba(0, 0, 0, 0.3),\\n $range-graph-selection-range-color: rgba(255, 255, 255, 0.1),\\n $range-graph-selection-outline-color: #AAA,\\n $range-graph-selection-bar-color: #808083,\\n $range-graph-selection-bar-track-color: #303033,\\n $range-graph-selection-bar-rifles-color: #FFF,\\n $range-graph-selection-bar-height: 14px,\\n $range-graph-handle-color: #AAA,\\n $range-graph-handle-fill-color: #666,\\n $range-graph-axis-text-color: #9f9f9f,\\n $range-graph-tick-highlighted-color: #FFF,\\n $range-graph-text-highlighted-color: #FFF,\\n\\n $annotation-background-color: rgba(255, 255, 255, 0.3),\\n\\n $series-key-axis-container-color: #111,\\n $series-key-input-border-color: #505053,\\n $series-key-input-selected-border-color: #E0E0E3,\\n $series-key-input-text-color: #E0E0E3,\\n $series-key-background: transparent,\\n $scale-label-color: silver,\\n $series-key-shadow-color: silver,\\n\\n $title-color: white,\\n\\n $sidebar-background-color: #111,\\n $sidebar-text-color: #EEE,\\n\\n $new-grapher-color: #DDD\\n) {\\n $x-axis-height: 20px;\\n $x-axis-dual-height: 30px;\\n $padding: 10px;\\n\\n $axis-z-index: 0;\\n $graph-body-z-index: 1;\\n\\n position: relative;\\n background: linear-gradient(to bottom right, $background-color-1, $background-color-2);\\n padding: $padding;\\n\\n font-family: sans-serif;\\n font-size: 12px;\\n line-height: normal;\\n\\n *, :after, :before {\\n box-sizing: content-box;\\n }\\n\\n .grapher-title {\\n text-align: center;\\n color: $title-color;\\n font-size: 18px;\\n margin-bottom: 8px;\\n }\\n\\n .grapher-primary-container-outer {\\n display: flex;\\n\\n .grapher-sidebar {\\n background: linear-gradient($sidebar-background-color, transparent 75%, transparent 100%);\\n color: $sidebar-text-color;\\n padding: 50px 6px 5px 10px;\\n margin-left: -$padding;\\n margin-top: -$padding;\\n margin-bottom: -$padding;\\n overflow-y: auto;\\n flex-shrink: 0;\\n\\n .series-toggle {\\n white-space: nowrap;\\n\\n & + .series-toggle {\\n margin-top: 3px;\\n }\\n\\n label {\\n display: inline-block;\\n position: relative;\\n user-select: none;\\n }\\n\\n input[type='checkbox'] {\\n opacity: 0;\\n cursor: pointer;\\n height: 0;\\n width: 0;\\n margin-right: 11px;\\n }\\n\\n input:not(:checked) ~ .checkmark {\\n background-color: transparent !important;\\n }\\n\\n input:checked ~ .checkmark:after {\\n display: block;\\n }\\n\\n .checkmark {\\n position: absolute;\\n top: 1px;\\n left: 0;\\n height: 7px;\\n width: 7px;\\n background-color: #eee;\\n border: 2px solid;\\n border-radius: 1px;\\n }\\n\\n .checkmark:after {\\n content: \\\"\\\";\\n position: absolute;\\n display: none;\\n\\n left: 0.5px;\\n top: -1.5px;\\n width: 3px;\\n height: 6px;\\n border: solid white;\\n border-width: 0 2px 2px 0;\\n -webkit-transform: rotate(45deg);\\n -ms-transform: rotate(45deg);\\n transform: rotate(45deg);\\n }\\n }\\n }\\n\\n .grapher-primary-container-body {\\n width: 100%;\\n padding-left: 2px;\\n }\\n }\\n\\n .series-key {\\n text-align: center;\\n margin-bottom: -14px;\\n position: relative;\\n\\n .scale-label {\\n display: inline-block;\\n background: $series-key-axis-container-color;\\n color: $scale-label-color;\\n transform: rotate(-90deg);\\n width: 24px;\\n margin-left: -5px;\\n vertical-align: top;\\n margin-top: 4px;\\n padding-bottom: 2px;\\n cursor: pointer;\\n user-select: none;\\n }\\n\\n .series-key-axis-container {\\n display: inline-block;\\n border: 1px solid $series-key-axis-container-color;\\n\\n min-width: 18px;\\n min-height: 24px;\\n vertical-align: top;\\n\\n white-space: nowrap;\\n\\n & + .series-key-axis-container {\\n margin-left: 4px;\\n }\\n\\n &.series-key-axis-container-showing-label {\\n .scale-label {\\n width: 46px;\\n margin-top: 15px;\\n margin-left: -15px;\\n margin-right: -12px;\\n }\\n\\n .series-key-axis-label-container {\\n display: block;\\n }\\n\\n .label-input-toggler {\\n path {\\n fill: $series-key-input-selected-border-color;\\n }\\n }\\n }\\n\\n .series-key-axis-container-body {\\n display: inline-block;\\n\\n & > div {\\n white-space: initial;\\n }\\n }\\n\\n .series-key-axis-label-container {\\n display: none;\\n }\\n\\n .label-input-toggler {\\n width: 16px;\\n cursor: pointer;\\n display: inline-block;\\n vertical-align: top;\\n margin: 4px 2px;\\n\\n path {\\n fill: $series-key-axis-container-color;\\n }\\n\\n &:hover {\\n path {\\n fill: $series-key-input-selected-border-color;\\n }\\n }\\n }\\n }\\n\\n .series-key-item {\\n border: 1px solid currentColor;\\n padding: 2px;\\n margin: 2px;\\n display: inline-block;\\n cursor: pointer;\\n user-select: none;\\n background: $series-key-background;\\n\\n & + .series-key-item {\\n margin-left: 4px;\\n }\\n\\n &.series-key-item-highlighted {\\n box-shadow: 0 0 4px $series-key-shadow-color;\\n }\\n }\\n }\\n\\n .range-selection {\\n color: $range-selection-text-color;\\n user-select: none;\\n\\n &.range-not-dates {\\n color: $range-selection-text-color-faded;\\n }\\n\\n .range-buttons {\\n text-align: right;\\n\\n .options-bar {\\n display: inline-block;\\n }\\n\\n .option-tooltip {\\n position: relative;\\n display: inline-block;\\n border-bottom: 1px dotted black;\\n\\n .option-tooltip-text {\\n visibility: hidden;\\n color: $range-selection-text-selected-color;\\n background: $range-selection-button-selected-color;\\n text-align: center;\\n padding: 5px 5px;\\n border-radius: 6px;\\n position: absolute;\\n z-index: 1;\\n border: 1px solid black;\\n\\n width: 120px;\\n margin-left: -65px;\\n top: calc(100% + 7px);\\n left: 50%;\\n }\\n\\n &:hover .option-tooltip-text {\\n visibility: visible;\\n }\\n\\n .option-tooltip-text::after {\\n content: \\\" \\\";\\n position: absolute;\\n bottom: 100%;\\n left: 50%;\\n margin-left: -5px;\\n border-width: 5px;\\n border-style: solid;\\n border-color: transparent transparent black transparent;\\n }\\n }\\n\\n .range-button {\\n display: inline-block;\\n cursor: pointer;\\n padding: 4px 8px;\\n @if ($range-selection-button-border == null) {\\n margin-left: 6px;\\n } @else {\\n margin-left: 4px;\\n }\\n\\n border-radius: 2px;\\n background: $range-selection-button-color;\\n border: $range-selection-button-border;\\n\\n &.range-button-selected {\\n color: $range-selection-text-selected-color;\\n background: $range-selection-button-selected-color;\\n border: $range-selection-selected-button-border;\\n }\\n\\n &.range-button-disabled, &.range-button-selected.range-button-disabled {\\n cursor: not-allowed;\\n color: $range-selection-text-color-faded;\\n background: $range-selection-button-color-faded;\\n }\\n\\n .icon-container {\\n position: relative;\\n width: 0;\\n\\n &.icon-container-narrow {\\n svg {\\n left: -3px;\\n }\\n }\\n\\n &.icon-container-square {\\n width: 5px;\\n\\n svg {\\n left: -5px;\\n }\\n }\\n\\n &.icon-container-448 {\\n width: 3px;\\n\\n svg {\\n left: -5px;\\n }\\n }\\n\\n &:before {\\n content: 'A';\\n opacity: 0;\\n }\\n\\n svg {\\n height: 15px;\\n position: absolute;\\n top: -1px;\\n left: -4px;\\n }\\n }\\n }\\n\\n .range-selection-history + .range-selection-history {\\n margin-right: 8px;\\n margin-left: 4px;\\n }\\n\\n .percentile-button {\\n & > div {\\n display: inline-block;\\n }\\n\\n input {\\n background: transparent;\\n border: 1px solid $series-key-input-border-color;\\n margin: 2px 8px 2px 0;\\n color: $series-key-input-text-color;\\n padding: 1px 2px;\\n width: 20px;\\n font-size: 11px;\\n -moz-appearance: textfield;\\n\\n &:focus {\\n outline: none;\\n border-color: $series-key-input-selected-border-color;\\n }\\n\\n &::-webkit-outer-spin-button,\\n &::-webkit-inner-spin-button {\\n -webkit-appearance: none;\\n margin: 0;\\n }\\n }\\n\\n .icon-container.icon-container-narrow {\\n svg {\\n height: 12px;\\n top: 1px;\\n left: -5px;\\n }\\n }\\n }\\n\\n .showing-options-button {\\n margin-right: 8px;\\n }\\n }\\n }\\n\\n .grapher-main-row {\\n display: flex;\\n\\n .central-container {\\n width: 100%;\\n }\\n }\\n\\n .range-graph-container {\\n display: flex;\\n margin-top: 10px;\\n }\\n\\n .graph-body {\\n width: 100%;\\n height: $primary-graph-body-height;\\n position: relative;\\n\\n canvas {\\n width: 100%;\\n height: 100%;\\n }\\n\\n .grapher-tooltip, .grapher-draggable-points, .grapher-vertical-lines {\\n position: absolute;\\n top: 0;\\n left: 0;\\n right: 0;\\n z-index: 20;\\n\\n > svg {\\n position: absolute;\\n overflow: visible;\\n left: 0;\\n }\\n }\\n\\n .grapher-vertical-lines {\\n pointer-events: none;\\n user-select: none;\\n }\\n\\n .grapher-tooltip {\\n .tooltip-item {\\n path {\\n fill: $tooltip-background-color;\\n }\\n\\n text {\\n fill: $tooltip-text-color;\\n dominant-baseline: hanging;\\n text-anchor: start;\\n }\\n\\n &.tooltip-item-fixed {\\n path {\\n fill: rgba($tooltip-background-color, 1);\\n }\\n }\\n }\\n\\n .line {\\n position: absolute;\\n height: 400px;\\n border-left: 1px solid $tooltip-line-color;\\n }\\n\\n .custom-tooltip-container {\\n position: absolute;\\n }\\n }\\n\\n .grapher-context-menu {\\n position: absolute;\\n top: 0;\\n left: 0;\\n .menu-item {\\n\\n .menu-text {\\n user-select: all;\\n position: absolute;\\n top: 0;\\n background: $tooltip-background-color;\\n border: 1px solid $annotation-background-color;\\n color: $tooltip-text-color;\\n padding: 2px 4px;\\n max-width: max-content;\\n width: 200px;\\n }\\n }\\n }\\n\\n .grapher-draggable-points {\\n circle {\\n cursor: pointer;\\n }\\n }\\n\\n .grapher-vertical-lines {\\n line {\\n stroke: $vertical-line-color;\\n }\\n\\n polygon {\\n fill: $vertical-line-color;\\n }\\n }\\n\\n .grapher-annotations {\\n position: absolute;\\n top: 0;\\n pointer-events: none;\\n user-select: none;\\n z-index: 10;\\n\\n .grapher-annotation {\\n position: absolute;\\n\\n .annotation-marker {\\n display: inline-block;\\n background: $annotation-background-color;\\n }\\n\\n &.grapher-annotation-range {\\n .annotation-range-marker {\\n display: inline-block;\\n background-color: rgba(128, 128, 128, 0.2);\\n background-image: repeating-linear-gradient(53deg, #626266, #626266 1px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.1) 4px);\\n background-size: 40px 40px;\\n border-right: 1px solid white;\\n border-left: 1px solid white;\\n }\\n }\\n\\n .annotation-text {\\n position: absolute;\\n background: $tooltip-background-color;\\n border: 1px solid $annotation-background-color;\\n color: $tooltip-text-color;\\n padding: 2px 4px;\\n white-space: nowrap;\\n font-size: 10px;\\n z-index: 10;\\n }\\n }\\n }\\n\\n .bounds-selection {\\n position: absolute;\\n background: $range-graph-selection-range-color;\\n }\\n }\\n\\n .axis {\\n overflow: visible;\\n user-select: none;\\n\\n &.x-axis {\\n width: 1px;\\n height: $x-axis-height;\\n \\n &.x-axis-dual {\\n height: $x-axis-dual-height;\\n }\\n display: block;\\n }\\n\\n &.y-axis {\\n height: $primary-graph-body-height;\\n\\n .axis-item text {\\n text-anchor: end;\\n }\\n\\n .y-axis-label {\\n text-anchor: middle;\\n fill: $axis-text-color;\\n\\n &.y-axis-big-label {\\n font-size: 18px;\\n }\\n }\\n\\n .series-color-box {\\n cursor: pointer;\\n }\\n\\n &.y-axis-right {\\n .axis-item text {\\n text-anchor: start;\\n }\\n }\\n }\\n\\n .axis-line {\\n stroke: $axis-line-color;\\n stroke-width: $axis-line-width;\\n }\\n\\n .axis-item {\\n path {\\n stroke: $axis-tick-color;\\n stroke-width: 1px;\\n }\\n\\n text {\\n fill: $axis-text-color;\\n font-size: 8px;\\n }\\n\\n &.axis-item-major {\\n .axis-tick {\\n stroke-width: 1px;\\n }\\n }\\n\\n &.axis-item-big-labels {\\n text {\\n font-size: 16px;\\n }\\n }\\n }\\n }\\n\\n .wind-arrows {\\n color: $axis-text-color;\\n opacity: 0.7;\\n }\\n\\n .range-selection-graph {\\n width: 100%;\\n background-color: $range-graph-selection-background-color;\\n height: calc(#{$secondary-graph-body-height} + #{$range-graph-selection-bar-height}); \\n\\n .graph-body-secondary {\\n height: $secondary-graph-body-height;\\n\\n canvas {\\n height: 100%;\\n }\\n\\n svg {\\n position: absolute;\\n left: 0;\\n width: 100%;\\n overflow: visible;\\n\\n .target-selection {\\n fill: $range-graph-selection-range-color;\\n cursor: ew-resize;\\n }\\n\\n\\n .target-selection-outline {\\n stroke: $range-graph-selection-outline-color;\\n cursor: ew-resize;\\n fill: transparent;\\n }\\n\\n .selection-bar-track {\\n fill: $range-graph-selection-bar-track-color;\\n }\\n\\n .selection-bar {\\n fill: $range-graph-selection-bar-color;\\n cursor: ew-resize;\\n }\\n\\n .selection-bar-rifles {\\n stroke: $range-graph-selection-bar-rifles-color;\\n stroke-width: 1px;\\n cursor: ew-resize;\\n }\\n\\n .selection-bar-handle-hit {\\n cursor: ew-resize;\\n }\\n\\n .selection-bar-handle {\\n stroke: $range-graph-handle-color;\\n fill: $range-graph-handle-fill-color;\\n stroke-width: 1px;\\n cursor: ew-resize;\\n transition: stroke-width 0.15s ease, fill 0.15s ease;\\n }\\n\\n .selection-handle {\\n .selection-handle-hit {\\n cursor: ew-resize;\\n }\\n\\n .selection-handle-line {\\n stroke: $range-graph-handle-color;\\n stroke-width: 1;\\n transition: stroke-width 0.15s ease;\\n }\\n\\n &:hover .selection-handle-line {\\n stroke-width: 3;\\n }\\n\\n &.selection-handle-dragging .selection-handle-line {\\n stroke-width: 3;\\n }\\n\\n &:hover .selection-bar-handle {\\n stroke-width: 2px;\\n }\\n\\n &.selection-handle-dragging .selection-bar-handle {\\n stroke-width: 2px;\\n }\\n }\\n\\n .axis-item {\\n text {\\n fill: $range-graph-axis-text-color;\\n text-anchor: start;\\n font-size: 8px;\\n user-select: none;\\n dominant-baseline: text-after-edge;\\n }\\n\\n path {\\n stroke: $range-graph-axis-text-color;\\n stroke-width: 1px;\\n }\\n \\n &.axis-item-highlighted {\\n path {\\n stroke: $range-graph-tick-highlighted-color;\\n }\\n \\n text {\\n fill: $range-graph-text-highlighted-color;\\n }\\n }\\n }\\n }\\n }\\n }\\n\\n input, textarea {\\n background: transparent;\\n border: 1px solid $series-key-input-border-color;\\n margin: 2px 0;\\n color: $series-key-input-text-color;\\n padding: 1px 2px;\\n text-align: center;\\n\\n &:focus {\\n outline: none;\\n border-color: $series-key-input-selected-border-color;\\n }\\n }\\n\\n &.grapher-dragging-y {\\n .y-axis {\\n border: 2px dashed silver;\\n margin: -2px;\\n flex-shrink: 0;\\n\\n & + .y-axis {\\n border-left: none;\\n }\\n }\\n }\\n\\n &.grapher-fullscreen {\\n height: calc(100vh - 2*#{$padding});\\n }\\n\\n &.grapher-fixed-height {\\n .grapher-primary-container-outer {\\n height: 100%;\\n\\n .grapher-primary-container-body {\\n height: 100%;\\n display: flex;\\n flex-direction: column;\\n\\n .grapher-main-row {\\n flex-grow: 1;\\n\\n .central-container {\\n display: flex;\\n flex-direction: column;\\n height: 100%;\\n\\n > .graph-body {\\n flex-grow: 1;\\n height: unset;\\n }\\n }\\n\\n .axis.y-axis {\\n height: calc(100% - #{2*$x-axis-height});\\n }\\n }\\n }\\n }\\n }\\n\\n &.new-grapher {\\n height: auto;\\n border: 2px dashed silver;\\n text-align: center;\\n color: $new-grapher-color;\\n }\\n}\\n\\n@mixin grapher-theme-night (\\n $primary-graph-body-height: 400px,\\n $secondary-graph-body-height: 50px,\\n) {\\n @include grapher(\\n $primary-graph-body-height,\\n $secondary-graph-body-height\\n );\\n}\\n\\n@mixin grapher-theme-day (\\n $primary-graph-body-height: 400px,\\n $secondary-graph-body-height: 50px,\\n) {\\n @include grapher(\\n $primary-graph-body-height,\\n $secondary-graph-body-height,\\n\\n $background-color-1: #FFF,\\n $background-color-2: #FFF,\\n\\n $tooltip-line-color: invert(#CCC),\\n $tooltip-background-color: invert(rgba(0, 0, 0, 0.6)),\\n $tooltip-text-color: invert(#F0F0F0),\\n $vertical-line-color: invert(#CCC),\\n\\n $axis-line-color: #656565,\\n $axis-tick-color: #BFBFBF,\\n $axis-text-color: invert(#E0E0E3),\\n\\n $range-selection-text-color: #444,\\n $range-selection-button-color: white,\\n $range-selection-button-selected-color: white,\\n $range-selection-text-selected-color: black,\\n $range-selection-text-color-faded: #888,\\n $range-selection-button-color-faded: #EEE,\\n $range-selection-button-border: 1px dotted silver,\\n $range-selection-selected-button-border: 1px solid black,\\n\\n $range-graph-selection-background-color: rgba(255, 255, 255, 0.3),\\n $range-graph-selection-range-color: rgba(0, 0, 0, 0.02),\\n $range-graph-selection-outline-color: #333,\\n $range-graph-selection-bar-color: #B0B0B7,\\n $range-graph-selection-bar-track-color: #EEE,\\n $range-graph-selection-bar-rifles-color: #333,\\n $range-graph-selection-bar-height: 14px,\\n $range-graph-handle-color: #333,\\n $range-graph-handle-fill-color: #B0B0B7,\\n $range-graph-axis-text-color: #555,\\n $range-graph-tick-highlighted-color: #000,\\n $range-graph-text-highlighted-color: #000,\\n\\n $annotation-background-color: rgba(0, 0, 0, 0.3),\\n\\n $series-key-axis-container-color: #B0B0B7,\\n $series-key-input-border-color: #E0E0E3,\\n $series-key-input-selected-border-color: #505053,\\n $series-key-input-text-color: #222,\\n $series-key-background: null,\\n $series-key-shadow-color: black,\\n $scale-label-color: black,\\n\\n $title-color: black,\\n\\n $sidebar-background-color: #EEE,\\n $sidebar-text-color: #111,\\n\\n $new-grapher-color: #222\\n );\\n}\\n\\n@mixin grapher-theme-export (\\n $primary-graph-body-height: 400px,\\n $secondary-graph-body-height: 50px,\\n) {\\n @include grapher(\\n $primary-graph-body-height,\\n $secondary-graph-body-height,\\n\\n $background-color-1: #FFF,\\n $background-color-2: #FFF,\\n\\n $tooltip-line-color: invert(#CCC),\\n $tooltip-background-color: invert(rgba(0, 0, 0, 0.6)),\\n $tooltip-text-color: invert(#F0F0F0),\\n $vertical-line-color: invert(#CCC),\\n\\n $axis-line-color: black,\\n $axis-line-width: 1px,\\n $axis-tick-color: #BFBFBF,\\n $axis-text-color: black,\\n\\n $range-selection-text-color: #444,\\n $range-selection-button-color: white,\\n $range-selection-button-selected-color: white,\\n $range-selection-text-selected-color: black,\\n $range-selection-text-color-faded: #888,\\n $range-selection-button-color-faded: #EEE,\\n $range-selection-button-border: 1px dotted silver,\\n $range-selection-selected-button-border: 1px solid black,\\n\\n $range-graph-selection-background-color: rgba(255, 255, 255, 0.3),\\n $range-graph-selection-range-color: rgba(0, 0, 0, 0.02),\\n $range-graph-selection-outline-color: #333,\\n $range-graph-selection-bar-color: #B0B0B7,\\n $range-graph-selection-bar-track-color: #EEE,\\n $range-graph-selection-bar-rifles-color: #333,\\n $range-graph-selection-bar-height: 14px,\\n $range-graph-handle-color: #333,\\n $range-graph-handle-fill-color: #B0B0B7,\\n $range-graph-axis-text-color: #333,\\n $range-graph-tick-highlighted-color: #000,\\n $range-graph-text-highlighted-color: #000,\\n\\n $annotation-background-color: rgba(0, 0, 0, 0.3),\\n\\n $series-key-axis-container-color: #B0B0B7,\\n $series-key-input-border-color: #E0E0E3,\\n $series-key-input-selected-border-color: #505053,\\n $series-key-input-text-color: #222,\\n $series-key-background: null,\\n $series-key-shadow-color: black,\\n $scale-label-color: black,\\n\\n $title-color: black,\\n\\n $sidebar-background-color: #EEE,\\n $sidebar-text-color: #111,\\n\\n $new-grapher-color: #222\\n );\\n}\\n\\n.grapher-night {\\n @include grapher-theme-night();\\n}\\n\\n.grapher-day {\\n @include grapher-theme-day();\\n}\\n\\n.grapher-export {\\n @include grapher-theme-export();\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\nmodule.exports = function (cssWithMappingToString) {\n var list = [];\n\n // return the list of modules as css string\n list.toString = function toString() {\n return this.map(function (item) {\n var content = \"\";\n var needLayer = typeof item[5] !== \"undefined\";\n if (item[4]) {\n content += \"@supports (\".concat(item[4], \") {\");\n }\n if (item[2]) {\n content += \"@media \".concat(item[2], \" {\");\n }\n if (needLayer) {\n content += \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\");\n }\n content += cssWithMappingToString(item);\n if (needLayer) {\n content += \"}\";\n }\n if (item[2]) {\n content += \"}\";\n }\n if (item[4]) {\n content += \"}\";\n }\n return content;\n }).join(\"\");\n };\n\n // import a list of modules into the list\n list.i = function i(modules, media, dedupe, supports, layer) {\n if (typeof modules === \"string\") {\n modules = [[null, modules, undefined]];\n }\n var alreadyImportedModules = {};\n if (dedupe) {\n for (var k = 0; k < this.length; k++) {\n var id = this[k][0];\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n for (var _k = 0; _k < modules.length; _k++) {\n var item = [].concat(modules[_k]);\n if (dedupe && alreadyImportedModules[item[0]]) {\n continue;\n }\n if (typeof layer !== \"undefined\") {\n if (typeof item[5] === \"undefined\") {\n item[5] = layer;\n } else {\n item[1] = \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\").concat(item[1], \"}\");\n item[5] = layer;\n }\n }\n if (media) {\n if (!item[2]) {\n item[2] = media;\n } else {\n item[1] = \"@media \".concat(item[2], \" {\").concat(item[1], \"}\");\n item[2] = media;\n }\n }\n if (supports) {\n if (!item[4]) {\n item[4] = \"\".concat(supports);\n } else {\n item[1] = \"@supports (\".concat(item[4], \") {\").concat(item[1], \"}\");\n item[4] = supports;\n }\n }\n list.push(item);\n }\n };\n return list;\n};","\"use strict\";\n\nmodule.exports = function (item) {\n var content = item[1];\n var cssMapping = item[3];\n if (!cssMapping) {\n return content;\n }\n if (typeof btoa === \"function\") {\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n var sourceMapping = \"/*# \".concat(data, \" */\");\n return [content].concat([sourceMapping]).join(\"\\n\");\n }\n return [content].join(\"\\n\");\n};","/**\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'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\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 };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bigint: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\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 (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\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 = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","/**\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'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","\"use strict\";\n\nvar stylesInDOM = [];\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n for (var i = 0; i < stylesInDOM.length; i++) {\n if (stylesInDOM[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n return result;\n}\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var indexByIdentifier = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3],\n supports: item[4],\n layer: item[5]\n };\n if (indexByIdentifier !== -1) {\n stylesInDOM[indexByIdentifier].references++;\n stylesInDOM[indexByIdentifier].updater(obj);\n } else {\n var updater = addElementStyle(obj, options);\n options.byIndex = i;\n stylesInDOM.splice(i, 0, {\n identifier: identifier,\n updater: updater,\n references: 1\n });\n }\n identifiers.push(identifier);\n }\n return identifiers;\n}\nfunction addElementStyle(obj, options) {\n var api = options.domAPI(options);\n api.update(obj);\n var updater = function updater(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {\n return;\n }\n api.update(obj = newObj);\n } else {\n api.remove();\n }\n };\n return updater;\n}\nmodule.exports = function (list, options) {\n options = options || {};\n list = list || [];\n var lastIdentifiers = modulesToDom(list, options);\n return function update(newList) {\n newList = newList || [];\n for (var i = 0; i < lastIdentifiers.length; i++) {\n var identifier = lastIdentifiers[i];\n var index = getIndexByIdentifier(identifier);\n stylesInDOM[index].references--;\n }\n var newLastIdentifiers = modulesToDom(newList, options);\n for (var _i = 0; _i < lastIdentifiers.length; _i++) {\n var _identifier = lastIdentifiers[_i];\n var _index = getIndexByIdentifier(_identifier);\n if (stylesInDOM[_index].references === 0) {\n stylesInDOM[_index].updater();\n stylesInDOM.splice(_index, 1);\n }\n }\n lastIdentifiers = newLastIdentifiers;\n };\n};","\"use strict\";\n\nvar memo = {};\n\n/* istanbul ignore next */\nfunction getTarget(target) {\n if (typeof memo[target] === \"undefined\") {\n var styleTarget = document.querySelector(target);\n\n // Special case to return head of iframe instead of iframe itself\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n memo[target] = styleTarget;\n }\n return memo[target];\n}\n\n/* istanbul ignore next */\nfunction insertBySelector(insert, style) {\n var target = getTarget(insert);\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n target.appendChild(style);\n}\nmodule.exports = insertBySelector;","\"use strict\";\n\n/* istanbul ignore next */\nfunction insertStyleElement(options) {\n var element = document.createElement(\"style\");\n options.setAttributes(element, options.attributes);\n options.insert(element, options.options);\n return element;\n}\nmodule.exports = insertStyleElement;","\"use strict\";\n\n/* istanbul ignore next */\nfunction setAttributesWithoutAttributes(styleElement) {\n var nonce = typeof __webpack_nonce__ !== \"undefined\" ? __webpack_nonce__ : null;\n if (nonce) {\n styleElement.setAttribute(\"nonce\", nonce);\n }\n}\nmodule.exports = setAttributesWithoutAttributes;","\"use strict\";\n\n/* istanbul ignore next */\nfunction apply(styleElement, options, obj) {\n var css = \"\";\n if (obj.supports) {\n css += \"@supports (\".concat(obj.supports, \") {\");\n }\n if (obj.media) {\n css += \"@media \".concat(obj.media, \" {\");\n }\n var needLayer = typeof obj.layer !== \"undefined\";\n if (needLayer) {\n css += \"@layer\".concat(obj.layer.length > 0 ? \" \".concat(obj.layer) : \"\", \" {\");\n }\n css += obj.css;\n if (needLayer) {\n css += \"}\";\n }\n if (obj.media) {\n css += \"}\";\n }\n if (obj.supports) {\n css += \"}\";\n }\n var sourceMap = obj.sourceMap;\n if (sourceMap && typeof btoa !== \"undefined\") {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n }\n\n // For old IE\n /* istanbul ignore if */\n options.styleTagTransform(css, styleElement, options.options);\n}\nfunction removeStyleElement(styleElement) {\n // istanbul ignore if\n if (styleElement.parentNode === null) {\n return false;\n }\n styleElement.parentNode.removeChild(styleElement);\n}\n\n/* istanbul ignore next */\nfunction domAPI(options) {\n if (typeof document === \"undefined\") {\n return {\n update: function update() {},\n remove: function remove() {}\n };\n }\n var styleElement = options.insertStyleElement(options);\n return {\n update: function update(obj) {\n apply(styleElement, options, obj);\n },\n remove: function remove() {\n removeStyleElement(styleElement);\n }\n };\n}\nmodule.exports = domAPI;","\"use strict\";\n\n/* istanbul ignore next */\nfunction styleTagTransform(css, styleElement) {\n if (styleElement.styleSheet) {\n styleElement.styleSheet.cssText = css;\n } else {\n while (styleElement.firstChild) {\n styleElement.removeChild(styleElement.firstChild);\n }\n styleElement.appendChild(document.createTextNode(css));\n }\n}\nmodule.exports = styleTagTransform;","module.exports = \"precision highp float;\\n\\nuniform vec4 color;\\n\\nvoid main() {\\n gl_FragColor = vec4(color);\\n}\\n\"","module.exports = \"precision highp float;\\n\\nattribute vec2 position;\\n\\nvoid main() {\\n gl_Position = vec4((position - 0.5)*2.0, 0.0, 1.0);\\n}\\n\"","module.exports = \"#ifdef GL_OES_standard_derivatives\\n#extension GL_OES_standard_derivatives : enable\\n#endif\\n\\nprecision mediump float;\\n\\nuniform vec4 color;\\n\\n// Adapted and modified from https://www.desultoryquest.com/blog/drawing-anti-aliased-circular-points-using-opengl-slash-webgl/\\nvoid main() {\\n float delta = 0.0;\\n float alpha = 1.0;\\n vec2 center = 2.0 * gl_PointCoord - 1.0;\\n float r = dot(center, center);\\n\\n if (r > 1.0) {\\n discard;\\n }\\n\\n #ifdef GL_OES_standard_derivatives\\n delta = fwidth(r);\\n alpha = 1.0 - smoothstep(1.0 - delta, 1.0 + delta, r);\\n #endif\\n\\n gl_FragColor = color * alpha;\\n}\\n\"","module.exports = \"precision mediump float;\\n\\nattribute vec2 position;\\n\\nuniform float width;\\nuniform float height;\\nuniform float pointSize;\\n\\nvoid main() {\\n gl_Position = vec4(2.0*position.x/width - 1.0, 1.0 - 2.0*position.y/height, 0.0, 1.0);\\n gl_PointSize = pointSize;\\n}\"","module.exports = \"precision highp float;\\n\\nuniform vec4 color;\\nuniform float thickness;\\nuniform float shadowBlur;\\nuniform vec4 shadowColor;\\nuniform float width; // Canvas width for normalization\\nuniform float cutoffX; // Cutoff X position as ratio (0.0-1.0)\\nuniform float cutoffOpacity; // Opacity for pre-cutoff area\\n\\nvarying vec2 position_vec;\\nvarying vec2 prev_position_vec;\\n\\n/**\\n * Calculate distance between point and line in screen space (ie, inputs in pixels, returns distance in pixels)\\n */\\nfloat distance_from_line() {\\n float x0 = gl_FragCoord.x;\\n float y0 = gl_FragCoord.y;\\n\\n // let line be defined by ax + by + c = 0;\\n float a, b, c;\\n\\n if (position_vec.x == prev_position_vec.x) {\\n a = 1.0;\\n b = 0.0;\\n c = -position_vec.x;\\n } else {\\n float slope = (position_vec.y - prev_position_vec.y)/(position_vec.x - prev_position_vec.x);\\n float y_intercept = position_vec.y - slope*position_vec.x;\\n\\n // y = slope*x + y_intercept\\n // (-slope)(x) + (1)(y) - y_intercept = 0;\\n a = -slope;\\n b = 1.0;\\n c = -y_intercept;\\n }\\n\\n return abs(a*x0 + b*y0 + c)/length(vec2(a, b));\\n}\\n\\nvoid main() {\\n vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);\\n\\n // Apply cutoff opacity if active\\n vec4 finalColor = vec4(color);\\n if (cutoffX >= 0.0) {\\n // Convert pixel position to normalized coordinate (0.0 to 1.0)\\n float normalizedX = gl_FragCoord.x / width;\\n \\n // Apply reduced opacity to pixels left of cutoff\\n if (normalizedX < cutoffX) {\\n finalColor.a *= cutoffOpacity;\\n }\\n }\\n\\n float dist = distance_from_line();\\n\\n if (dist + shadowBlur >= thickness) {\\n float percent_shadowed = ((thickness - dist) / shadowBlur);\\n gl_FragColor = mix(transparent, shadowColor, percent_shadowed*percent_shadowed);\\n } else {\\n gl_FragColor = finalColor;\\n gl_FragColor.rgb *= gl_FragColor.a;\\n }\\n}\\n\"","module.exports = \"precision highp float;\\n\\nattribute vec2 position;\\nattribute vec2 prevPosition;\\nattribute float vertex;\\n\\nuniform float width;\\nuniform float height;\\nuniform float thickness;\\n\\nvarying vec2 position_vec;\\nvarying vec2 prev_position_vec;\\n\\nvoid main() {\\n vec2 delta = position - prevPosition;\\n vec2 alpha = prevPosition;\\n vec2 beta = position;\\n\\n vec2 normalized_delta = normalize(delta);\\n vec2 normal = vec2(-thickness/2.0 * normalized_delta.y, thickness/2.0 * normalized_delta.x);\\n\\n vec2 vertex_position =\\n step(0.5, mod(vertex, 2.0))*alpha + // alpha if vertex is odd, 0 otherwise\\n step(0.5, mod(vertex + 1.0, 2.0))*beta + // beta if vertex is even, 0 otherwise\\n 2.0*(step(1.5, vertex)-0.5)*normal // -normal if vertex < 2, +normal otherwise\\n ;\\n\\n position_vec = vec2(position.x, height - position.y);\\n prev_position_vec = vec2(prevPosition.x, height - prevPosition.y);\\n\\n gl_Position = vec4(2.0*vertex_position.x/width - 1.0, 1.0 - 2.0*vertex_position.y/height, 0.0, 1.0);\\n}\\n\"","module.exports = \"precision highp float;\\n\\nvarying vec4 trapBounds; // [x1, lineY1, x2, lineY2]\\nvarying vec4 trapBottom; // [x1, bottomY1, x2, bottomY2] \\nvarying vec2 worldPos; // World position\\n\\nuniform int gradientCount;\\nuniform sampler2D gradientTexture; // Texture containing gradient data\\nuniform vec4 fallbackColor;\\n\\nvec4 interpolateGradient(float position) {\\n if (gradientCount <= 0) {\\n return fallbackColor;\\n }\\n if (gradientCount == 1) {\\n return texture2D(gradientTexture, vec2(0.5 / float(gradientCount * 2), 0.5));\\n }\\n\\n float textureWidth = float(gradientCount * 2);\\n float firstStop = texture2D(gradientTexture, vec2(0.5 / textureWidth, 0.5)).r;\\n float lastStop = texture2D(gradientTexture, vec2((float((gradientCount - 1) * 2) + 0.5) / textureWidth, 0.5)).r;\\n \\n // Scale position to fit the gradient range\\n if (lastStop > firstStop) {\\n position = firstStop + position * (lastStop - firstStop);\\n }\\n \\n position = clamp(position, 0.0, 1.0);\\n\\n // Handle boundary cases first\\n vec4 firstColor = texture2D(gradientTexture, vec2(1.5 / textureWidth, 0.5));\\n vec4 lastColor = texture2D(gradientTexture, vec2((float((gradientCount - 1) * 2 + 1) + 0.5) / textureWidth, 0.5));\\n \\n if (position <= firstStop) return firstColor;\\n if (position >= lastStop) return lastColor;\\n \\n // Calculate normalized position within the gradient range\\n float normalizedPos = (position - firstStop) / max(lastStop - firstStop, 0.001);\\n normalizedPos = clamp(normalizedPos, 0.0, 1.0);\\n \\n // Map to segment index using only float operations\\n float segmentFloat = normalizedPos * float(gradientCount - 1);\\n float segmentIndex = floor(segmentFloat);\\n \\n // Ensure segment index is within valid bounds using float operations\\n segmentIndex = min(segmentIndex, float(gradientCount - 2));\\n segmentIndex = max(segmentIndex, 0.0);\\n \\n // Calculate texture coordinates for the two colors to interpolate\\n float texCoordA = (segmentIndex * 2.0 + 1.0 + 0.5) / textureWidth;\\n float texCoordB = ((segmentIndex + 1.0) * 2.0 + 1.0 + 0.5) / textureWidth;\\n \\n // Sample the two colors\\n vec4 colorA = texture2D(gradientTexture, vec2(texCoordA, 0.5));\\n vec4 colorB = texture2D(gradientTexture, vec2(texCoordB, 0.5));\\n \\n // Get the actual gradient stops for proper interpolation\\n float stopA = texture2D(gradientTexture, vec2((segmentIndex * 2.0 + 0.5) / textureWidth, 0.5)).r;\\n float stopB = texture2D(gradientTexture, vec2(((segmentIndex + 1.0) * 2.0 + 0.5) / textureWidth, 0.5)).r;\\n \\n // Calculate interpolation factor based on actual stop positions\\n float stopRange = stopB - stopA;\\n float t = stopRange > 0.001 ? (position - stopA) / stopRange : 0.0;\\n t = clamp(t, 0.0, 1.0);\\n \\n return mix(colorA, colorB, t);\\n}\\n\\nvoid main() {\\n float pixelX = worldPos.x;\\n float pixelY = worldPos.y;\\n \\n // Extract trapezoid corners\\n float x1 = trapBounds.x;\\n float lineY1 = trapBounds.y;\\n float x2 = trapBounds.z;\\n float lineY2 = trapBounds.w;\\n \\n float bottomX1 = trapBottom.x;\\n float bottomY1 = trapBottom.y;\\n float bottomX2 = trapBottom.z;\\n float bottomY2 = trapBottom.w;\\n \\n // Interpolate line Y at current pixel X\\n float t = (pixelX - x1) / (x2 - x1 + 0.001); // Avoid division by zero\\n t = clamp(t, 0.0, 1.0);\\n \\n float lineYAtPixel = mix(lineY1, lineY2, t);\\n float bottomYAtPixel = mix(bottomY1, bottomY2, t);\\n \\n // Calculate gradient position: 0.0 at line, 1.0 at bottom\\n float totalDistance = abs(bottomYAtPixel - lineYAtPixel);\\n float gradientPos = totalDistance > 0.001 ? \\n abs(pixelY - lineYAtPixel) / totalDistance : 0.0;\\n \\n vec4 color = interpolateGradient(gradientPos);\\n gl_FragColor = color;\\n}\\n\"","module.exports = \"precision highp float;\\n\\nattribute vec2 position;\\nattribute vec4 trapezoidBounds; // [x1, y1_line, x2, y2_line] - the line segment \\nattribute vec4 trapezoidBottom; // [x1, y1_bottom, x2, y2_bottom] - the bottom segment\\n\\nuniform float width;\\nuniform float height;\\n\\nvarying vec4 trapBounds; // Pass trapezoid line bounds to fragment\\nvarying vec4 trapBottom; // Pass trapezoid bottom bounds to fragment \\nvarying vec2 worldPos; // Pass world position\\n\\nvoid main() {\\n trapBounds = trapezoidBounds;\\n trapBottom = trapezoidBottom;\\n worldPos = position;\\n \\n gl_Position = vec4(2.0*position.x/width - 1.0, 1.0 - 2.0*position.y/height, 0.0, 1.0);\\n}\\n\"","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".bundle.cjs\";\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.p = \"/assets/\";","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t792: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunkGrapher\"] = globalThis[\"webpackChunkGrapher\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","__webpack_require__.nc = undefined;","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react\");","export const SIMPLE_DATA_TYPES = [\n 'values',\n 'tuples',\n 'objects'\n];\n\nexport const COMPLEX_DATA_TYPES = [\n 'tuple_observable',\n 'object_observable',\n 'generator'\n];\n\nexport const DATA_TYPES = [...SIMPLE_DATA_TYPES, ...COMPLEX_DATA_TYPES];\n","import PropTypes from 'prop-types';\nimport {DATA_TYPES} from '../state/data_types';\n\n// checking the shape of data is slow if there's a lot of it\n// it can be convenient in development, but should not be done when testing high cardinality data\nconst ENABLE_DATA_CHECK = false;\n\nconst PointY = function (props, propName) {\n if (typeof props[propName] !== 'number' && props[propName] !== null) {\n return new Error(`${propName} needs to be a number or null`);\n }\n\n return null;\n};\n\nconst PointTuple = function (props, propName) {\n if (!Array.isArray(props) || props.length !== 2) { // eslint-disable-line react/prop-types\n return new Error(`${propName} needs to be an array of length two`);\n }\n\n const [x, y] = props;\n if (typeof x !== 'number' && !(x instanceof Date)) {\n return new Error(`${propName}.x needs to be a number or date`);\n }\n\n if (typeof y !== 'number' && y !== null) {\n return new Error(`${propName}.y needs to be a number or null`);\n }\n\n return null;\n};\n\nconst Data = ENABLE_DATA_CHECK ? PropTypes.oneOfType([\n PropTypes.arrayOf(PointY), // values\n PropTypes.arrayOf(PropTypes.arrayOf(PointTuple)), // tuples\n PropTypes.arrayOf(PropTypes.object), // objects\n PropTypes.shape({ observe: PropTypes.func.isRequired }), // observable\n PropTypes.func // generator function\n]) : PropTypes.any;\n\nconst SingleSeries = PropTypes.shape({\n data: Data.isRequired,\n type: PropTypes.oneOf([\n ...DATA_TYPES,\n 'infer'\n ]),\n xKey: PropTypes.string,\n yKey: PropTypes.string,\n windXKey: PropTypes.string,\n windYKey: PropTypes.string,\n windComp: PropTypes.elementType,\n xUnixDates: PropTypes.bool,\n color: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n name: PropTypes.string,\n xLabel: PropTypes.string,\n yLabel: PropTypes.string,\n ignoreDiscontinuities: PropTypes.bool,\n dashed: PropTypes.bool,\n dashPattern: PropTypes.arrayOf(PropTypes.number),\n width: PropTypes.number,\n rangeSelectorWidth: PropTypes.number,\n axis: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),\n expandYWith: PropTypes.arrayOf(PropTypes.number),\n defaultAlwaysTooltipped: PropTypes.bool,\n followingMouseTooltip: PropTypes.bool,\n square: PropTypes.bool,\n shiftXBy: PropTypes.number,\n graph: PropTypes.number, // affects multigrapher only\n background: PropTypes.object,\n hideFromKey: PropTypes.bool,\n showIndividualPoints: PropTypes.bool,\n minPointSpacing: PropTypes.number,\n rendering: PropTypes.oneOf(['line', 'bar', 'area', 'shadow']), // defaults to line\n negativeColor: PropTypes.string, // colors lines and points below zero for all renderings\n gradient: PropTypes.array, // only applies to area and shadow\n negativeGradient: PropTypes.array, // gradient for values below zero (area and shadow)\n zeroLineWidth: PropTypes.number, // only applies to bar and area\n zeroLineColor: PropTypes.string, // only applies to bar and area\n zeroLineY: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), // only applies to bar and area\n pointRadius: PropTypes.number, // only applies to area\n tooltipWidth: PropTypes.number,\n hasAreaBottom: PropTypes.bool,\n shadowColor: PropTypes.string,\n gradient: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.array])), // gradient colors or [position, color] pairs\n rangeKey: PropTypes.string\n});\n\nconst Series = PropTypes.arrayOf(SingleSeries);\n\nconst Axis = PropTypes.shape({\n axisIndex: PropTypes.number.isRequired,\n series: PropTypes.array.isRequired,\n side: PropTypes.oneOf(['left', 'right']).isRequired,\n scale: PropTypes.oneOf(['linear', 'log']).isRequired,\n label: PropTypes.string\n});\n\nconst Axes = PropTypes.arrayOf(Axis);\n\nconst CustomBoundsSelector = PropTypes.shape({\n label: PropTypes.string.isRequired,\n calculator: PropTypes.func.isRequired,\n datesOnly: PropTypes.bool\n});\n\nconst CustomBoundsSelectors = PropTypes.arrayOf(CustomBoundsSelector);\n\nconst TooltipOptionsRaw = {\n includeSeriesLabel: PropTypes.bool,\n includeXLabel: PropTypes.bool,\n includeYLabel: PropTypes.bool,\n includeXValue: PropTypes.bool,\n includeYValue: PropTypes.bool,\n floating: PropTypes.bool,\n alwaysFixedPosition: PropTypes.bool,\n floatPosition: PropTypes.oneOf(['top', 'bottom']),\n floatDelta: PropTypes.number,\n savingDisabled: PropTypes.bool,\n customTooltip: PropTypes.func,\n combineTooltips: PropTypes.oneOfType([PropTypes.bool, PropTypes.number])\n};\n\nconst TooltipOptions = PropTypes.shape(TooltipOptionsRaw);\n\nconst Annotation = PropTypes.shape({\n x: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.instanceOf(Date)]),\n startX: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.instanceOf(Date)]),\n endX: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.instanceOf(Date)]),\n series: PropTypes.arrayOf(PropTypes.string),\n content: PropTypes.string,\n lineOnly: PropTypes.bool\n});\nconst Annotations = PropTypes.arrayOf(Annotation);\n\nconst DraggablePoint = PropTypes.shape({\n x: PropTypes.number.isRequired,\n y: PropTypes.number.isRequired,\n radius: PropTypes.number,\n fillColor: PropTypes.string,\n strokeColor: PropTypes.string,\n strokeWidth: PropTypes.number,\n onClick: PropTypes.func,\n onDoubleClick: PropTypes.func\n});\nconst DraggablePoints = PropTypes.arrayOf(DraggablePoint);\n\nconst VerticalLine = PropTypes.shape({\n x: PropTypes.oneOfType([PropTypes.number, PropTypes.instanceOf(Date)]).isRequired,\n color: PropTypes.string,\n lineTop: PropTypes.number,\n width: PropTypes.number,\n markTop: PropTypes.bool,\n style: PropTypes.object,\n markerStyle: PropTypes.object,\n text: PropTypes.string,\n textTop: PropTypes.number,\n textStyle: PropTypes.object,\n minPixelX: PropTypes.number,\n maxPixelX: PropTypes.number,\n onRangeGraph: PropTypes.oneOfType([\n PropTypes.bool,\n PropTypes.object // anything that can be passed into the overall vertical line\n ]),\n onRangeGraphOnly: PropTypes.bool\n});\nconst VerticalLines = PropTypes.arrayOf(VerticalLine);\n\nconst CustomPropTypes = {\n Data,\n SingleSeries,\n Series,\n Axis,\n Axes,\n CustomBoundsSelector,\n CustomBoundsSelectors,\n TooltipOptions,\n TooltipOptionsRaw,\n Annotations,\n DraggablePoint,\n DraggablePoints,\n VerticalLine,\n VerticalLines\n};\n\n\nexport default CustomPropTypes;\n","export default class Eventable {\n\n constructor() {\n this._listeners = {};\n }\n\n /**\n * Clears all listeners\n * @protected\n */\n clearListeners() {\n this._listeners = {};\n }\n\n /**\n * Create a new listener for the event\n * When the event is emitted, it will call the provided function\n *\n * @param {String|symbol} eventName - the name of the event to start listening to\n * @param {Function} fn - the listener to add\n */\n on(eventName, fn) {\n this._listeners[eventName] = this._listeners[eventName] || new Set();\n this._listeners[eventName].add(fn);\n }\n\n /**\n * Removes an existing listener for the event\n *\n * @param {String|symbol} eventName - the name of the event to stop listening to\n * @param {Function} fn - the listener to remove\n */\n off(eventName, fn) {\n if (!this._listeners[eventName]) {\n return;\n }\n\n this._listeners[eventName].delete(fn);\n\n if (this._listeners[eventName].size === 0) {\n delete this._listeners[eventName];\n }\n }\n\n /**\n * Emits an event that will go out to all _listeners on eventName\n *\n * @param {String|symbol} eventName - the name of the event to emit\n */\n emit(eventName) {\n if (!this._listeners[eventName]) {\n return;\n }\n\n const args = [];\n for (let i = 1; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n\n this._listeners[eventName].forEach((fn) => {\n fn.apply(this, args);\n });\n }\n\n}\n","import {extractYValue} from '../helpers/flatten_simple_data.js';\n\n/**\n * Given a series object, figures out the form of the data\n * Note that this is not a validator, nor is it guaranteed to get it right 100% of the time!\n * If it is giving the wrong type, it is recommended to specify the type manually\n *\n * @param {*} series\n * @param {Boolean} options.useSimpleData\n * @param {Array} options.data\n * @return {String}\n */\nexport default function inferType(series, options={ useSimpleData: false }) {\n if (series.type && series.type !== 'infer') {\n return series.type;\n }\n\n const data = options.data || (options.useSimpleData ? (series.simpleData || series.data) : series.data);\n\n if (!data) {\n throw new Error('Data must be provided');\n }\n\n if (Array.isArray(data)) {\n if (data.length === 0) {\n return 'tuples';\n }\n\n if (Array.isArray(data[0])) {\n return 'tuples';\n }\n\n if (typeof data[0] === 'number' || !data[0]) {\n return 'values';\n }\n\n return 'objects';\n }\n\n if (data.observe) {\n if (series.xKey) {\n return 'object_observable';\n } else {\n return 'tuple_observable';\n }\n }\n\n if (typeof data === 'function') {\n return 'generator';\n }\n\n throw new Error('Could not infer type');\n}\n\n/**\n *\n * @param simpleData\n * @param singleSeries\n * @return {boolean}\n */\nexport function isEnumLike(simpleData, singleSeries) {\n for (let i = 0; i < simpleData.length; i++) {\n const y = extractYValue(simpleData[simpleData.length - 1], singleSeries);\n if (y === null || y === undefined) {\n continue;\n }\n\n if (typeof y === 'string') {\n return true;\n }\n }\n\n return false;\n}\n","/**\n * Returns the color as a [r, g, b, a] array with domain 0 to 1 for use in webgl\n *\n * @param color\n * @return {[number, number, number, number]|[number, number, number, number]}\n */\nexport default function colorToVector(color) {\n if (color === 'black') {\n color = '#000000';\n } else if (color === 'white') {\n color = '#FFFFFF';\n } else if (color === 'transparent') {\n return [0, 0, 0, 0];\n }\n\n if (color.startsWith('rgb')) {\n const parts = color.split(',').map((part) => parseFloat(part.match(/\\d+(\\.\\d+)?/)[0]));\n return [\n parts[0]/255,\n parts[1]/255,\n parts[2]/255,\n parts.length >= 4 ? parts[3] : 1\n ];\n }\n\n if (typeof color !== 'string' || !/^#[\\dA-F]{3}$|^#[\\dA-F]{6}$/i.test(color)) {\n throw new Error(`Color must be a hex string: ${color}`);\n }\n\n // support for short hex codes, expanding 3-digit hex to 6-digit\n if (color.length === 4) {\n color = '#' + color[1] + color[1] + color[2] + color[2] + color[3] + color[3];\n }\n\n const r = parseInt(color.substr(1, 2), 16)/255;\n const g = parseInt(color.substr(3, 2), 16)/255;\n const b = parseInt(color.substr(5, 2), 16)/255;\n const a = 1.0;\n return [r, g, b, a];\n}\n","/**\n * Creates a webgl program, linking the shaders and checking for errors\n *\n * @param gl\n * @param vertShaderSource\n * @param fragShaderSource\n * @return {WebGLProgram}\n */\nexport default function createGLProgram(gl, vertShaderSource, fragShaderSource) {\n const vertexShader = gl.createShader(gl.VERTEX_SHADER);\n gl.shaderSource(vertexShader, vertShaderSource);\n gl.compileShader(vertexShader);\n if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) {\n console.error(gl.getShaderInfoLog(vertexShader)); // eslint-disable-line no-console\n return null;\n }\n\n const fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n gl.shaderSource(fragmentShader, fragShaderSource);\n gl.compileShader(fragmentShader);\n if (!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)) {\n console.error(gl.getShaderInfoLog(fragmentShader)); // eslint-disable-line no-console\n return null;\n }\n\n const program = gl.createProgram();\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n\n gl.linkProgram(program);\n \n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n console.error('Shader program linking failed:', gl.getProgramInfoLog(program));\n return null;\n }\n\n gl.validateProgram(program);\n if (!gl.getProgramParameter(program, gl.VALIDATE_STATUS)) {\n console.error('Shader program validation failed:', gl.getProgramInfoLog(program));\n return null;\n }\n\n return program;\n}\n","import backgroundFrag from './background.frag';\nimport backgroundVert from './background.vert';\nimport colorToVector from '../helpers/color_to_vector';\nimport createGLProgram from './create_gl_program';\n\nexport default class BackgroundProgram {\n\n constructor(gl) {\n this._gl = gl;\n\n this._program = createGLProgram(gl, backgroundVert, backgroundFrag);\n\n this._vertexBuffer = gl.createBuffer();\n this._indexBuffer = gl.createBuffer();\n\n if (!gl.getExtension('OES_element_index_uint')) {\n console.error('Your browser does not support OES_element_index_uint'); // eslint-disable-line no-console\n }\n }\n\n draw({ data }) {\n const gl = this._gl;\n gl.useProgram(this._program);\n\n // gl.disable(gl.DEPTH_TEST);\n\n for (let { minXt, maxXt, color } of data) {\n gl.uniform4f(gl.getUniformLocation(this._program, 'color'), ...colorToVector(color));\n\n const vertices = new Float32Array([\n minXt, 1, maxXt, 1, maxXt, -1,\n minXt, 1, maxXt, -1, minXt, -1\n ]);\n\n gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n\n const positionLocation = gl.getAttribLocation(this._program, 'position');\n gl.enableVertexAttribArray(positionLocation);\n gl.vertexAttribPointer(positionLocation, 2, gl.FLOAT, false, 0, 0);\n\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n }\n }\n\n}\n","export const DPI_INCREASE = 2;\n\n/**\n * Sizes the canvas such that rendering is pixel perfect\n * Returns the sizing information\n *\n * @param {HTMLCanvasElement} canvas\n * @param {CanvasRenderingContext2D} context\n * @param {Boolean} reset - if true, will reset the canvas size before checking sizing\n * @return {Promise<{boundingRect: DOMRect, pixelRatio: number, elementHeight: number, renderWidth: number, renderHeight: number, elementWidth: number}>}\n */\nexport default async function sizeCanvas(canvas, context, {reset=true}={}) {\n if (reset) {\n canvas.width = '';\n canvas.height = '';\n canvas.style.width = '0';\n canvas.style.height = '';\n\n await new Promise((resolve) => requestAnimationFrame(resolve));\n }\n\n let boundingRect = canvas.parentNode.getBoundingClientRect();\n\n while (boundingRect.width === 0) {\n await new Promise((resolve) => requestAnimationFrame(resolve));\n boundingRect = canvas.getBoundingClientRect();\n }\n\n const dpr = window.devicePixelRatio || 1;\n const bsr = context.webkitBackingStorePixelRatio ||\n context.mozBackingStorePixelRatio ||\n context.msBackingStorePixelRatio ||\n context.oBackingStorePixelRatio ||\n context.backingStorePixelRatio || 1;\n\n const pixelRatio = DPI_INCREASE*dpr / bsr;\n\n const elementWidth = boundingRect.width;\n const elementHeight = boundingRect.height;\n const renderWidth = elementWidth * pixelRatio;\n const renderHeight = elementHeight * pixelRatio;\n\n canvas.width = renderWidth;\n canvas.height = renderHeight;\n canvas.style.width = `${elementWidth}px`;\n canvas.style.height = `${elementHeight}px`;\n\n // We could us this to make coordinates behave as if they weren't transformed if we wanted\n // context.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0)\n\n return {\n pixelRatio,\n elementWidth,\n elementHeight,\n renderWidth,\n renderHeight,\n boundingRect\n };\n}\n","import {DPI_INCREASE} from './size_canvas';\n\n/**\n * Returns an array of contiguous paths from data in render space\n *\n * @param {{nullMask: Uint8Array, maxYValues: Float64Array, minYValues: Float64Array, yValues: Float64Array}} dataInRenderSpace\n * @param {Object} options\n * @param {Number} options.splitAtY - split the path whenever it's suddenly less or greater than this value\n * @return {[[Number]]}\n */\nexport default function pathsFrom(dataInRenderSpace, {splitAtY}={}) {\n const paths = [];\n let currentPath = [];\n let previouslyDiscontinuous = true;\n\n const { nullMask, maxYValues, minYValues, yValues } = dataInRenderSpace;\n\n for (let i = 0; i < yValues.length; i++) {\n const x = i*DPI_INCREASE;\n const y = yValues[i];\n\n if (nullMask[i] & 0b001) { // y null\n if (!previouslyDiscontinuous) {\n paths.push(currentPath);\n currentPath = [];\n }\n\n previouslyDiscontinuous = true;\n continue;\n }\n\n currentPath.push([x, y]);\n\n const minY = minYValues[i];\n const maxY = maxYValues[i];\n\n if (minY !== maxY) {\n if (!(nullMask[i] & 0b010)) {\n currentPath.push([x, minY]);\n }\n\n if (!(nullMask[i] & 0b100)) {\n currentPath.push([x, maxY]);\n }\n currentPath.push([x, y]);\n }\n\n previouslyDiscontinuous = false;\n\n if (typeof splitAtY === 'number' && i > 0) {\n const prevY = yValues[i-1];\n const signFlipped = !(nullMask[i-1] & 0b001) && (prevY < splitAtY && y >= splitAtY) || (prevY > splitAtY && y <= splitAtY) || (prevY === splitAtY && y !== splitAtY);\n\n if (signFlipped) {\n if (!previouslyDiscontinuous) {\n paths.push(currentPath);\n currentPath = [\n [x, y]\n ];\n }\n\n previouslyDiscontinuous = true;\n }\n }\n }\n\n if (!previouslyDiscontinuous) {\n paths.push(currentPath);\n }\n\n return paths;\n}\n","/**\n * Draws a horizontal line at the specified y-coordinate.\n *\n * @param {Number} y\n * @param {Object} options\n * @param {CanvasRenderingContext2D} options.context\n * @param {{renderWidth: Number, renderHeight: Number}} options.sizing\n * @param {String} options.color\n * @param {String} options.zeroColor\n * @param {Number} options.zeroWidth\n */\nexport function drawZeroLine(y, { context, sizing, color, zeroColor, zeroWidth}) {\n if (!zeroWidth) {\n return;\n }\n\n if (!context) {\n console.error('Canvas context is null in drawZeroLine');\n return;\n }\n\n context.strokeStyle = zeroColor || color;\n context.lineWidth = zeroWidth;\n\n context.beginPath();\n context.moveTo(0, y);\n context.lineTo(sizing.renderWidth, y);\n context.stroke();\n}\n","import pathsFrom from \"./paths_from\";\nimport { drawZeroLine } from \"./draw_zero_line\";\nimport { DPI_INCREASE } from \"./size_canvas\";\nimport { applyReducedOpacity, applyReducedOpacityToGradient } from \"../helpers/colors\";\n\n/**\n * Draws the data on the canvas\n * Assumes the data is in individual point render space, ie x and y in pixels\n *\n * @param {Array<[number, number]>} individualPoints - data to draw\n * @param {Object} dataInRenderSpace\n * @param {Object} options - set of options\n * @param {Object} options.context - the context to draw on\n * @param {String} options.color - color of the bar to draw\n * @param {{renderWidth: Number, renderHeight: Number}} options.sizing - size of the canvas, in pixels\n * @param {Number} options.zero - y coordinate that represents \"zero\"\n * @param {Boolean} options.hasNegatives - if any values are negative (in which case should render from zero)\n * @param {Array<String>} [options.gradient] - an array of stops, from top to bottom of canvas, to draw with\n * @param {String} [options.zeroColor] - color of the zero line\n * @param {Number} [options.zeroWidth] - width of the zero line\n * @param {Boolean} [options.showIndividualPoints] - draw circles at each point\n * @param {String} [options.negativeColor] - color of the area below zero\n * @param {Number} [options.width] - line width\n * @param {Object} [options.inRenderSpaceAreaBottom] - if provided, will use this as the area bottom instead of zero/sizing.renderHeight\n * @private\n */\nexport default function drawArea(\n individualPoints,\n dataInRenderSpace,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n negativeGradient,\n zeroColor,\n zeroWidth,\n showIndividualPoints,\n negativeColor,\n pointRadius,\n minPointSpacing,\n width,\n highlighted,\n shadowColor = \"black\",\n shadowBlur = 5,\n inRenderSpaceAreaBottom,\n cutoffIndex,\n cutoffOpacity,\n originalData,\n renderCutoffGradient,\n selectionBounds,\n isPreview,\n }\n) {\n if (!context) {\n console.error(\"Canvas context is null in drawArea\");\n return;\n }\n\n context.fillStyle = color;\n context.shadowColor = shadowColor;\n context.shadowBlur = shadowBlur;\n\n if (gradient && gradient.length >= 2) {\n const globalGradient = context.createLinearGradient(\n 0,\n 0,\n 0,\n sizing.renderHeight\n );\n\n for (let i = 0; i < gradient.length; i++) {\n const value = gradient[i];\n if (Array.isArray(value)) {\n globalGradient.addColorStop(value[0], value[1]);\n } else {\n globalGradient.addColorStop(i / (gradient.length - 1), value);\n }\n }\n\n context.fillStyle = globalGradient;\n\n if (color === \"gradient\") {\n context.strokeStyle = globalGradient;\n }\n } else {\n context.fillStyle = color;\n }\n\n if (!individualPoints.length) {\n return;\n }\n\n // we want to draw a polygon with a flat line at areaBottom, and then follows the shape of the data\n const areaBottom = hasNegatives ? zero : sizing.renderHeight;\n\n const shouldSplitAreaPaths = hasNegatives && negativeGradient;\n const areaPaths = pathsFrom(dataInRenderSpace, shouldSplitAreaPaths ? { splitAtY: zero } : undefined);\n const areaBottomPaths =\n inRenderSpaceAreaBottom && pathsFrom(inRenderSpaceAreaBottom, shouldSplitAreaPaths ? { splitAtY: zero } : undefined);\n\n const linePaths = pathsFrom(dataInRenderSpace, {\n splitAtY: zero,\n });\n\n if (renderCutoffGradient && cutoffIndex !== undefined && originalData) {\n drawAreaWithCutoff(\n individualPoints,\n areaPaths,\n areaBottomPaths,\n linePaths,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n showIndividualPoints,\n negativeColor,\n pointRadius,\n width,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n cutoffIndex,\n cutoffOpacity,\n originalData,\n selectionBounds,\n isPreview,\n }\n );\n return;\n }\n\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n context.beginPath();\n\n const [firstX, _startY] = path[0];\n const [lastX, _lastY] = path[path.length - 1];\n\n if (!areaBottomPaths) {\n context.moveTo(firstX, areaBottom);\n }\n\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n context.lineTo(x, y);\n }\n\n if (areaBottomPath && areaBottomPath.length) {\n for (let i = areaBottomPath.length - 1; i >= 0; i--) {\n const [x, y] = areaBottomPath[i];\n context.lineTo(x, y);\n }\n\n context.lineTo(...path[0]);\n } else {\n context.lineTo(lastX, areaBottom);\n }\n\n context.fill();\n }\n\n if (highlighted) {\n width += 2;\n }\n\n width *= DPI_INCREASE;\n context.strokeStyle = color;\n context.lineWidth = width;\n\n for (let path of linePaths) {\n if (!path.length) {\n continue;\n }\n\n if (hasNegatives && negativeColor) {\n let positive = true;\n if (path.length >= 2) {\n positive = path[1][1] <= zero;\n } else {\n positive = path[0][1] <= zero;\n }\n\n if (positive) {\n context.strokeStyle = color;\n } else {\n context.strokeStyle = negativeColor;\n }\n } else {\n context.strokeStyle = color;\n }\n\n context.beginPath();\n\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n\n context.stroke();\n }\n\n if (zeroWidth) {\n drawZeroLine(areaBottom, {\n context,\n sizing,\n color,\n zero,\n zeroColor,\n zeroWidth,\n });\n }\n\n if (showIndividualPoints && !renderCutoffGradient) {\n // Apply point spacing for individual point circles only\n function applyPointSpacing(points, minSpacing) {\n if (!minSpacing || points.length <= 1) {\n return points;\n }\n \n const spacedPoints = [];\n let lastX = -Infinity;\n \n for (const point of points) {\n const [x] = point;\n if (x - lastX >= minSpacing) {\n spacedPoints.push(point);\n lastX = x;\n }\n }\n \n return spacedPoints;\n }\n\n const pointsToRender = applyPointSpacing(individualPoints, minPointSpacing);\n for (let [x, y] of pointsToRender) {\n // Determine the color for this point\n let pointColor = color;\n if (negativeColor && hasNegatives) {\n if (y === zero && zeroColor) {\n pointColor = zeroColor;\n } else if (y < zero) {\n pointColor = color;\n } else {\n pointColor = negativeColor;\n }\n }\n \n context.fillStyle = pointColor;\n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n }\n}\n\n/**\n * Draws the data on the canvas with cutoff\n * Assumes the data is in individual point render space, ie x and y in pixels\n *\n * @param {Array<[number, number]>} individualPoints - data to draw\n * @param {Object} options - set of options\n * @param {Object} options.context - the context to draw on\n * @param {String} options.color - color of the area to draw\n * @param {{renderWidth: Number, renderHeight: Number}} options.sizing - size of the canvas, in pixels\n * @param {Number} options.zero - y coordinate that represents \"zero\"\n * @param {Boolean} options.hasNegatives - if any values are negative (in which case should render from zero)\n * @param {Array<String>} [options.gradient] - an array of stops, from top to bottom of canvas, to draw with\n * @param {String} [options.zeroColor] - color of the zero line\n * @param {Number} [options.zeroWidth] - width of the zero line\n * @param {Boolean} [options.showIndividualPoints] - draw circles at each point\n * @param {String} [options.negativeColor] - color of the area below zero\n * @param {Number} [options.width] - line width\n * @param {Object} [options.inRenderSpaceAreaBottom] - if provided, will use this as the area bottom instead of zero/sizing.renderHeight\n * @private\n */\nfunction drawAreaWithCutoff(\n individualPoints,\n areaPaths,\n areaBottomPaths,\n linePaths,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n showIndividualPoints,\n negativeColor,\n pointRadius,\n width,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n cutoffIndex,\n cutoffOpacity,\n originalData,\n selectionBounds,\n isPreview,\n }\n) {\n let cutoffTime;\n if (typeof originalData[0] === \"object\" && originalData[0].length === 2) {\n const baseIndex = Math.floor(cutoffIndex);\n const fraction = cutoffIndex - baseIndex;\n\n if (fraction === 0 || baseIndex >= originalData.length - 1) {\n const cutoffDate =\n originalData[Math.min(baseIndex, originalData.length - 1)][0];\n cutoffTime =\n cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n } else {\n const currentDate = originalData[baseIndex][0];\n const nextDate = originalData[baseIndex + 1][0];\n const currentTime =\n currentDate instanceof Date ? currentDate.getTime() : currentDate;\n const nextTime = nextDate instanceof Date ? nextDate.getTime() : nextDate;\n cutoffTime = currentTime + fraction * (nextTime - currentTime);\n }\n } else {\n cutoffTime = cutoffIndex;\n }\n\n let firstTime, lastTime;\n if (isPreview && selectionBounds) {\n firstTime = selectionBounds.minX instanceof Date ? selectionBounds.minX.getTime() : selectionBounds.minX;\n lastTime = selectionBounds.maxX instanceof Date ? selectionBounds.maxX.getTime() : selectionBounds.maxX;\n } else {\n firstTime = originalData[0][0] instanceof Date ? originalData[0][0].getTime() : originalData[0][0];\n lastTime = originalData[originalData.length - 1][0] instanceof Date ? \n originalData[originalData.length - 1][0].getTime() : originalData[originalData.length - 1][0];\n }\n\n const timeRatio = (cutoffTime - firstTime) / (lastTime - firstTime);\n\n if (timeRatio < 0) {\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n renderEntireArea(path, areaBottomPath, {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n } else if (timeRatio > 1) {\n const reducedOpacityGradient = gradient\n ? applyReducedOpacityToGradient(gradient, cutoffOpacity)\n : null;\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n renderEntireArea(path, areaBottomPath, {\n color: applyReducedOpacity(color, cutoffOpacity),\n context,\n sizing,\n zero,\n hasNegatives,\n gradient: reducedOpacityGradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n } else {\n if (isPreview) {\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n if (!path.length) {\n continue;\n }\n\n const renderCutoffIndex = timeRatio * path.length;\n const splitIndex = Math.floor(renderCutoffIndex);\n const fraction = renderCutoffIndex - splitIndex;\n\n let ghostPoint = null;\n if (splitIndex < path.length - 1 && fraction > 0) {\n const [x1, y1] = path[splitIndex];\n const [x2, y2] = path[splitIndex + 1];\n ghostPoint = [x1 + fraction * (x2 - x1), y1 + fraction * (y2 - y1)];\n }\n\n const shouldRenderPre =\n splitIndex > 0 || (splitIndex === 0 && fraction > 0);\n\n if (shouldRenderPre) {\n const preCutoffPath = path.slice(0, splitIndex + 1);\n if (ghostPoint && splitIndex < path.length - 1) {\n preCutoffPath.push(ghostPoint);\n }\n\n const preCutoffAreaBottomPath = areaBottomPath\n ? areaBottomPath.slice(0, splitIndex + 1)\n : null;\n if (\n ghostPoint &&\n preCutoffAreaBottomPath &&\n splitIndex < areaBottomPath.length - 1\n ) {\n const bottomGhostPoint = [ghostPoint[0], zero];\n preCutoffAreaBottomPath.push(bottomGhostPoint);\n }\n\n const reducedOpacityGradient = gradient\n ? applyReducedOpacityToGradient(gradient, cutoffOpacity)\n : null;\n renderEntireArea(preCutoffPath, preCutoffAreaBottomPath, {\n color: applyReducedOpacity(color, cutoffOpacity),\n context,\n sizing,\n zero,\n hasNegatives,\n gradient: reducedOpacityGradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n\n const shouldRenderPost =\n splitIndex < path.length - 1 ||\n (splitIndex === path.length - 1 && fraction === 0);\n\n if (shouldRenderPost) {\n const postCutoffPath = [];\n if (ghostPoint && splitIndex < path.length - 1) {\n postCutoffPath.push(ghostPoint);\n }\n postCutoffPath.push(...path.slice(splitIndex + 1));\n\n const postCutoffAreaBottomPath = [];\n if (\n ghostPoint &&\n areaBottomPath &&\n splitIndex < areaBottomPath.length - 1\n ) {\n const bottomGhostPoint = [ghostPoint[0], zero];\n postCutoffAreaBottomPath.push(bottomGhostPoint);\n }\n if (areaBottomPath) {\n postCutoffAreaBottomPath.push(\n ...areaBottomPath.slice(splitIndex + 1)\n );\n }\n\n renderEntireArea(\n postCutoffPath,\n postCutoffAreaBottomPath.length ? postCutoffAreaBottomPath : null,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n }\n );\n }\n }\n\n if (linePaths && linePaths.length > 0) {\n drawLinesWithCutoff(linePaths, timeRatio, {\n color,\n context,\n hasNegatives,\n negativeColor,\n zero,\n width,\n highlighted,\n cutoffOpacity,\n });\n }\n\n if (\n showIndividualPoints &&\n individualPoints &&\n individualPoints.length > 0\n ) {\n drawPointsWithCutoffByRatio(individualPoints, timeRatio, {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n cutoffOpacity,\n });\n }\n } else {\n if (!selectionBounds) {\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n renderEntireArea(path, areaBottomPath, {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n } else {\n const visibleMinTime =\n selectionBounds.minX instanceof Date\n ? selectionBounds.minX.getTime()\n : selectionBounds.minX;\n const visibleMaxTime =\n selectionBounds.maxX instanceof Date\n ? selectionBounds.maxX.getTime()\n : selectionBounds.maxX;\n\n if (cutoffTime < visibleMinTime) {\n // cutoff before visible range - render entire area normally\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n renderEntireArea(path, areaBottomPath, {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n } else if (cutoffTime > visibleMaxTime) {\n // cutoff after visible range - render entire area with reduced opacity\n const reducedOpacityGradient = gradient\n ? applyReducedOpacityToGradient(gradient, cutoffOpacity)\n : null;\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n renderEntireArea(path, areaBottomPath, {\n color: applyReducedOpacity(color, cutoffOpacity),\n context,\n sizing,\n zero,\n hasNegatives,\n gradient: reducedOpacityGradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n } else {\n // cutoff within visible range - calculate position relative to visible bounds\n const visibleTimeRatio =\n (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n if (!path.length) {\n continue;\n }\n\n const renderCutoffIndex = visibleTimeRatio * path.length;\n const splitIndex = Math.floor(renderCutoffIndex);\n const fraction = renderCutoffIndex - splitIndex;\n\n // create ghost point for continuity if needed\n let ghostPoint = null;\n if (splitIndex < path.length - 1 && fraction > 0) {\n const [x1, y1] = path[splitIndex];\n const [x2, y2] = path[splitIndex + 1];\n ghostPoint = [\n x1 + fraction * (x2 - x1),\n y1 + fraction * (y2 - y1),\n ];\n }\n\n // render pre-cutoff area with reduced opacity\n const shouldRenderPre =\n splitIndex > 0 || (splitIndex === 0 && fraction > 0);\n\n if (shouldRenderPre) {\n renderAreaSegment(\n path,\n areaBottomPath,\n splitIndex,\n ghostPoint,\n true,\n {\n color: applyReducedOpacity(color, cutoffOpacity),\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n areaBottomPaths,\n }\n );\n }\n\n // render post-cutoff area with normal opacity\n const shouldRenderPost = splitIndex < path.length - 1;\n\n if (shouldRenderPost) {\n renderAreaSegment(\n path,\n areaBottomPath,\n splitIndex,\n ghostPoint,\n false,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n areaBottomPaths,\n }\n );\n }\n }\n }\n }\n }\n\n // draw outline lines with cutoff\n if (timeRatio >= 0 && timeRatio <= 1 && !isPreview) {\n if (selectionBounds) {\n const visibleMinTime =\n selectionBounds.minX instanceof Date\n ? selectionBounds.minX.getTime()\n : selectionBounds.minX;\n const visibleMaxTime =\n selectionBounds.maxX instanceof Date\n ? selectionBounds.maxX.getTime()\n : selectionBounds.maxX;\n\n // test case time\n if (cutoffTime < visibleMinTime) {\n // cutoff before visible range - draw lines normally\n drawLinesNormally(linePaths, {\n color,\n context,\n hasNegatives,\n negativeColor,\n width,\n highlighted,\n });\n } else if (cutoffTime > visibleMaxTime) {\n // cutoff after visible range - draw lines with reduced opacity (to match area)\n const reducedColor = applyReducedOpacity(color, cutoffOpacity);\n const reducedNegativeColor = negativeColor\n ? applyReducedOpacity(negativeColor, cutoffOpacity)\n : negativeColor;\n drawLinesNormally(linePaths, {\n color: reducedColor,\n context,\n hasNegatives,\n negativeColor: reducedNegativeColor,\n width,\n highlighted,\n });\n } else {\n // cutoff within visible range - split lines at cutoff\n const visibleTimeRatio =\n (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n drawLinesWithCutoff(linePaths, visibleTimeRatio, {\n color,\n context,\n hasNegatives,\n negativeColor,\n zero,\n width,\n highlighted,\n cutoffOpacity,\n });\n }\n } else {\n // no bounds available - draw lines normally\n drawLinesNormally(linePaths, {\n color,\n context,\n hasNegatives,\n negativeColor,\n width,\n highlighted,\n });\n }\n } else if (!isPreview) {\n // draw lines normally without cutoff\n drawLinesNormally(linePaths, {\n color,\n context,\n hasNegatives,\n negativeColor,\n width,\n highlighted,\n });\n }\n\n // draw other elements (zero line, points) normally\n if (zeroWidth) {\n const areaBottom = hasNegatives ? zero : sizing.renderHeight;\n drawZeroLine(areaBottom, {\n context,\n sizing,\n color,\n zero,\n zeroColor,\n zeroWidth,\n });\n }\n\n if (showIndividualPoints && !isPreview) {\n if (timeRatio >= 0 && timeRatio <= 1) {\n if (selectionBounds) {\n const visibleMinTime =\n selectionBounds.minX instanceof Date\n ? selectionBounds.minX.getTime()\n : selectionBounds.minX;\n const visibleMaxTime =\n selectionBounds.maxX instanceof Date\n ? selectionBounds.maxX.getTime()\n : selectionBounds.maxX;\n\n //test case time\n if (cutoffTime < visibleMinTime) {\n // cutoff before visible range - draw points normally\n drawPointsNormally(individualPoints, {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n });\n } else if (cutoffTime > visibleMaxTime) {\n // cutoff after visible range - draw points with reduced opacity\n const reducedColor = applyReducedOpacity(color, cutoffOpacity);\n const reducedNegativeColor = negativeColor\n ? applyReducedOpacity(negativeColor, cutoffOpacity)\n : negativeColor;\n const reducedZeroColor = zeroColor\n ? applyReducedOpacity(zeroColor, cutoffOpacity)\n : zeroColor;\n drawPointsNormally(individualPoints, {\n color: reducedColor,\n context,\n negativeColor: reducedNegativeColor,\n hasNegatives,\n zero,\n zeroColor: reducedZeroColor,\n pointRadius,\n });\n } else {\n // cutoff within visible range - split points at cutoff\n const visibleTimeRatio =\n (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n drawPointsWithCutoffByRatio(individualPoints, visibleTimeRatio, {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n cutoffOpacity,\n });\n }\n } else {\n // no bounds available - draw points normally\n drawPointsNormally(individualPoints, {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n });\n }\n } else {\n // cutoff outside data range - draw points normally\n drawPointsNormally(individualPoints, {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n });\n }\n } \n }\n}\n\nfunction renderEntireArea(\n path,\n areaBottomPath,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n }\n) {\n context.fillStyle = color;\n\n if (gradient && gradient.length >= 2) {\n const globalGradient = context.createLinearGradient(\n 0,\n 0,\n 0,\n sizing.renderHeight\n );\n for (let i = 0; i < gradient.length; i++) {\n const value = gradient[i];\n if (Array.isArray(value)) {\n globalGradient.addColorStop(value[0], value[1]);\n } else {\n globalGradient.addColorStop(i / (gradient.length - 1), value);\n }\n }\n context.fillStyle = globalGradient;\n } else {\n }\n\n const areaBottom = hasNegatives ? zero : sizing.renderHeight;\n\n context.beginPath();\n\n const [firstX, _startY] = path[0];\n const [lastX, _lastY] = path[path.length - 1];\n\n if (!areaBottomPath) {\n context.moveTo(firstX, areaBottom);\n }\n\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n context.lineTo(x, y);\n }\n\n if (areaBottomPath && areaBottomPath.length) {\n for (let i = areaBottomPath.length - 1; i >= 0; i--) {\n const [x, y] = areaBottomPath[i];\n context.lineTo(x, y);\n }\n context.lineTo(...path[0]);\n } else {\n context.lineTo(lastX, areaBottom);\n }\n\n context.fill();\n}\n\nfunction renderAreaSegment(\n path,\n areaBottomPath,\n splitIndex,\n ghostPoint,\n isPreCutoff,\n { color, context, sizing, zero, hasNegatives, gradient, areaBottomPaths }\n) {\n context.fillStyle = color;\n\n if (gradient && gradient.length >= 2) {\n const globalGradient = context.createLinearGradient(\n 0,\n 0,\n 0,\n sizing.renderHeight\n );\n for (let i = 0; i < gradient.length; i++) {\n const value = gradient[i];\n if (Array.isArray(value)) {\n const gradientColor = isPreCutoff\n ? applyReducedOpacity(value[1], 0.35)\n : value[1];\n globalGradient.addColorStop(value[0], gradientColor);\n } else {\n const gradientColor = isPreCutoff\n ? applyReducedOpacity(value, 0.35)\n : value;\n globalGradient.addColorStop(i / (gradient.length - 1), gradientColor);\n }\n }\n context.fillStyle = globalGradient;\n } else {\n }\n\n const areaBottom = hasNegatives ? zero : sizing.renderHeight;\n\n context.beginPath();\n\n if (isPreCutoff) {\n const endIndex = ghostPoint ? splitIndex + 1 : splitIndex;\n const [firstX] = path[0];\n\n if (!areaBottomPaths) {\n context.moveTo(firstX, areaBottom);\n }\n\n for (let i = 0; i <= endIndex && i < path.length; i++) {\n const [x, y] = i === endIndex && ghostPoint ? ghostPoint : path[i];\n context.lineTo(x, y);\n }\n\n if (areaBottomPath && areaBottomPath.length) {\n for (let i = Math.min(endIndex, areaBottomPath.length - 1); i >= 0; i--) {\n const [x, y] = areaBottomPath[i];\n context.lineTo(x, y);\n }\n context.lineTo(...path[0]);\n } else {\n const lastPoint = ghostPoint || path[endIndex] || path[path.length - 1];\n context.lineTo(lastPoint[0], areaBottom);\n }\n } else {\n const startIndex = ghostPoint ? splitIndex : splitIndex + 1;\n const startPoint = ghostPoint || path[startIndex];\n\n if (startPoint) {\n context.moveTo(startPoint[0], areaBottom);\n\n if (ghostPoint) {\n context.lineTo(...ghostPoint);\n }\n for (let i = startIndex; i < path.length; i++) {\n context.lineTo(...path[i]);\n }\n\n if (areaBottomPath && areaBottomPath.length) {\n for (\n let i = areaBottomPath.length - 1;\n i >= Math.max(startIndex, 0);\n i--\n ) {\n const [x, y] = areaBottomPath[i];\n context.lineTo(x, y);\n }\n if (ghostPoint) {\n context.lineTo(ghostPoint[0], areaBottom);\n }\n } else {\n const [lastX] = path[path.length - 1];\n context.lineTo(lastX, areaBottom);\n }\n }\n }\n\n context.fill();\n}\n\nfunction drawPointsNormally(\n individualPoints,\n { color, context, negativeColor, hasNegatives, zero, zeroColor, pointRadius }\n) {\n if (!individualPoints || !Array.isArray(individualPoints)) {\n return;\n }\n\n for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[i];\n\n let pointColor = color;\n if (negativeColor && hasNegatives) {\n if (y === zero && zeroColor) {\n pointColor = zeroColor;\n } else if (y < zero) {\n pointColor = color;\n } else {\n pointColor = negativeColor;\n }\n }\n\n context.fillStyle = pointColor;\n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n}\n\nfunction drawLinesNormally(\n linePaths,\n { color, context, hasNegatives, negativeColor, width, highlighted }\n) {\n if (!linePaths || !Array.isArray(linePaths)) {\n return;\n }\n\n if (highlighted) {\n width += 2;\n }\n width *= DPI_INCREASE;\n\n for (let path of linePaths) {\n if (!path.length) continue;\n\n context.strokeStyle = hasNegatives && negativeColor ? negativeColor : color;\n context.lineWidth = width;\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n }\n}\n\nfunction drawLinesWithCutoff(\n linePaths,\n timeRatio,\n {\n color,\n context,\n hasNegatives,\n negativeColor,\n zero,\n width,\n highlighted,\n cutoffOpacity,\n }\n) {\n if (!linePaths || !Array.isArray(linePaths)) {\n return;\n }\n\n if (highlighted) {\n width += 2;\n }\n width *= DPI_INCREASE;\n\n const cutoffPixelX = timeRatio * context.canvas.width;\n const preCutoffPaths = [];\n const postCutoffPaths = [];\n\n for (let path of linePaths) {\n if (!path.length) continue;\n\n const prePath = [];\n const postPath = [];\n let ghostPoint = null;\n let splitIndex = -1;\n\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n \n if (x < cutoffPixelX) {\n prePath.push([x, y]);\n splitIndex = i;\n } else {\n postPath.push([x, y]);\n }\n }\n\n if (prePath.length > 0 && postPath.length > 0) {\n const lastPrePoint = prePath[prePath.length - 1];\n const firstPostPoint = postPath[0];\n const [x1, y1] = lastPrePoint;\n const [x2, y2] = firstPostPoint;\n \n if (x2 !== x1) {\n const fraction = (cutoffPixelX - x1) / (x2 - x1);\n ghostPoint = [cutoffPixelX, y1 + fraction * (y2 - y1)];\n prePath.push(ghostPoint);\n postPath.unshift(ghostPoint);\n }\n }\n\n if (prePath.length > 0) {\n preCutoffPaths.push(prePath);\n }\n if (postPath.length > 0) {\n postCutoffPaths.push(postPath);\n }\n }\n\n if (preCutoffPaths.length > 0) {\n const reducedColor = applyReducedOpacity(color, cutoffOpacity);\n context.strokeStyle = reducedColor;\n context.lineWidth = width;\n\n for (let path of preCutoffPaths) {\n if (path.length > 1) {\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n }\n }\n }\n\n if (postCutoffPaths.length > 0) {\n context.strokeStyle = hasNegatives && negativeColor ? negativeColor : color;\n context.lineWidth = width;\n\n for (let path of postCutoffPaths) {\n if (path.length > 1) {\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n }\n }\n }\n}\n\nfunction drawPointsWithCutoffByRatio(\n individualPoints,\n timeRatio,\n {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n cutoffOpacity,\n }\n) {\n if (!individualPoints || !Array.isArray(individualPoints)) {\n return;\n }\n\n const canvasWidth = context.canvas.width;\n const cutoffPixelX = timeRatio * canvasWidth;\n\n for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[i];\n\n const isBeforeCutoff = x < cutoffPixelX;\n\n let pointColor = color;\n if (isBeforeCutoff) {\n pointColor = applyReducedOpacity(color, cutoffOpacity);\n }\n\n if (negativeColor && hasNegatives) {\n if (y === zero && zeroColor) {\n pointColor = zeroColor;\n } else if (y < zero) {\n pointColor = isBeforeCutoff\n ? applyReducedOpacity(color, cutoffOpacity)\n : color;\n } else {\n pointColor = isBeforeCutoff\n ? applyReducedOpacity(negativeColor, cutoffOpacity)\n : negativeColor;\n }\n }\n\n context.fillStyle = pointColor;\n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n}\n","import {drawZeroLine} from './draw_zero_line';\nimport { applyReducedOpacity } from \"../helpers/colors\";\n\n/**\n * Draws the data on the canvas\n * Assumes the data is in individual point render space, ie x and y in pixels\n *\n * @param {Array<[number, number]>} individualPoints - data to draw\n * @param {Object} options - set of options\n * @param {Object} options.context - the context to draw on\n * @param {String} options.color - color of the bar to draw\n * @param {{renderWidth: Number, renderHeight: Number}} options.sizing - size of the canvas, in pixels\n * @param {Number} options.indexInAxis - index of the series in the axis\n * @param {Number} options.axisSeriesCount - number of series in the axis\n * @param {Number} options.zero - y coordinate that represents \"zero\"\n * @param {Boolean} options.hasNegatives - if any values are negative (in which case should render from zero)\n * @param {String} options.negativeColor - color of the bar to draw if negative\n * @param {String} options.zeroColor - color of the zero line\n * @param {Number} options.zeroWidth - width of the zero line\n * @param {Number} options.closestSpacing - closest x spacing between points, in data space\n * @param {{minX: Number, maxX: Number}} options.bounds - bounds of the data as rendered\n * @private\n */\nexport default function drawBars(individualPoints, {\n color, context, sizing, indexInAxis, axisSeriesCount, zero, hasNegatives, negativeColor, zeroColor, zeroWidth, closestSpacing, bounds, cutoffIndex, cutoffOpacity, originalData, renderCutoffGradient, selectionBounds\n}) {\n if (!context) {\n console.error('Canvas context is null in drawBars');\n return;\n }\n \n context.strokeStyle = color;\n context.fillStyle = color;\n\n const {barWidth, totalBarWidth} = getBarWidths({ closestSpacing, bounds, sizing, axisSeriesCount });\n const barBottom = hasNegatives ? zero : sizing.renderHeight;\n\n if (renderCutoffGradient && cutoffIndex !== undefined && originalData) {\n drawBarsWithCutoff(individualPoints, {\n color, context, sizing, indexInAxis, axisSeriesCount, zero, hasNegatives, negativeColor, zeroColor, zeroWidth, closestSpacing, bounds, cutoffIndex, cutoffOpacity, originalData, selectionBounds, barWidth, totalBarWidth, barBottom\n });\n return;\n }\n\n for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[i];\n\n if (hasNegatives) {\n if (y <= zero) {\n context.fillStyle = color;\n } else {\n context.fillStyle = negativeColor;\n }\n }\n\n context.fillRect(x - totalBarWidth / 2 + barWidth*indexInAxis, y, barWidth, barBottom-y);\n }\n\n if (zeroWidth) {\n drawZeroLine(barBottom, {\n context,\n sizing,\n color,\n zero,\n zeroColor,\n zeroWidth\n });\n }\n}\n\nexport function getBarWidths({closestSpacing, bounds, sizing, axisSeriesCount}) {\n const fullBarWidth = closestSpacing / (bounds.maxX - bounds.minX) * sizing.renderWidth;\n\n const totalBarWidth = fullBarWidth * 0.8;\n const barSpacing = fullBarWidth * 0.2;\n const barWidth = totalBarWidth / axisSeriesCount;\n\n return {\n barWidth,\n totalBarWidth,\n barSpacing\n };\n}\n\n/**\n * Draws the data on the canvas with cutoff\n * Assumes the data is in individual point render space, ie x and y in pixels\n *\n * @param {Array<[number, number]>} individualPoints - data to draw\n * @param {Object} options - set of options\n * @param {Object} options.context - the context to draw on\n * @param {String} options.color - color of the bar to draw\n * @param {{renderWidth: Number, renderHeight: Number}} options.sizing - size of the canvas, in pixels\n * @param {Number} options.indexInAxis - index of the series in the axis\n * @param {Number} options.axisSeriesCount - number of series in the axis\n * @param {Number} options.zero - y coordinate that represents \"zero\"\n * @param {Boolean} options.hasNegatives - if any values are negative (in which case should render from zero)\n * @param {String} options.negativeColor - color of the bar to draw if negative\n * @param {String} options.zeroColor - color of the zero line\n * @param {Number} options.zeroWidth - width of the zero line\n * @param {Number} options.closestSpacing - closest x spacing between points, in data space\n * @param {{minX: Number, maxX: Number}} options.bounds - bounds of the data as rendered\n * @param {Number} options.cutoffIndex - index of the cutoff\n * @param {Number} options.cutoffOpacity - opacity of the cutoff\n * @param {Array<[number, number]>} options.originalData - original data\n * @param {Boolean} options.selectionBounds - if selection bounds are available\n * @param {Number} options.barWidth - width of the bar\n * @param {Number} options.totalBarWidth - total width of the bar\n * @param {Number} options.barBottom - y coordinate that represents the bottom of the bar\n * @private\n */\nfunction drawBarsWithCutoff(individualPoints, {\n color, context, sizing, indexInAxis, axisSeriesCount, zero, hasNegatives, negativeColor, zeroColor, zeroWidth, closestSpacing, bounds, cutoffIndex, cutoffOpacity, originalData, selectionBounds, barWidth, totalBarWidth, barBottom\n}) {\n let cutoffTime;\n if (typeof originalData[0] === 'object' && originalData[0].length === 2) {\n const baseIndex = Math.floor(cutoffIndex);\n const fraction = cutoffIndex - baseIndex;\n \n if (fraction === 0 || baseIndex >= originalData.length - 1) {\n const cutoffDate = originalData[Math.min(baseIndex, originalData.length - 1)][0];\n cutoffTime = cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n } else {\n const currentDate = originalData[baseIndex][0];\n const nextDate = originalData[baseIndex + 1][0];\n const currentTime = currentDate instanceof Date ? currentDate.getTime() : currentDate;\n const nextTime = nextDate instanceof Date ? nextDate.getTime() : nextDate;\n cutoffTime = currentTime + fraction * (nextTime - currentTime);\n }\n } else {\n cutoffTime = cutoffIndex; \n }\n\n for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[i];\n \n let barColor = color;\n let isBeforeCutoff = false;\n\n if (i < originalData.length) {\n const dataPoint = originalData[i];\n const pointTime = dataPoint[0] instanceof Date ? dataPoint[0].getTime() : dataPoint[0];\n isBeforeCutoff = pointTime < cutoffTime;\n \n if (isBeforeCutoff) {\n barColor = applyReducedOpacity(color, cutoffOpacity);\n }\n }\n\n if (hasNegatives) {\n if (y <= zero) {\n context.fillStyle = barColor;\n } else {\n const negColor = isBeforeCutoff ? applyReducedOpacity(negativeColor, cutoffOpacity) : negativeColor;\n context.fillStyle = negColor;\n }\n } else {\n context.fillStyle = barColor;\n }\n\n context.fillRect(x - totalBarWidth / 2 + barWidth*indexInAxis, y, barWidth, barBottom-y);\n }\n\n if (zeroWidth) {\n drawZeroLine(barBottom, {\n context, sizing, color, zero, zeroColor, zeroWidth\n });\n }\n}\n","import {DPI_INCREASE} from './size_canvas';\nimport pathsFrom from './paths_from';\nimport { applyReducedOpacity } from \"../helpers/colors\";\n\nfunction applyPointSpacing(points, minSpacing) {\n if (!minSpacing || points.length <= 1) {\n return points;\n }\n \n const spacedPoints = [];\n let lastX = -Infinity;\n \n for (const point of points) {\n const [x] = point;\n if (x - lastX >= minSpacing) {\n spacedPoints.push(point);\n lastX = x;\n }\n }\n \n return spacedPoints;\n}\n\nexport default function drawLine(dataInRenderSpace, {\n color, width=1, context, shadowColor='black', shadowBlur=5, dashed=false, dashPattern=null, highlighted=false, showIndividualPoints=false, pointRadius, minPointSpacing, getIndividualPoints, getRanges, cutoffIndex, cutoffTimeValue, cutoffOpacity, originalData, renderCutoffGradient, currentBounds, selectionBounds, rendering, isPreview, negativeColor, hasNegatives, zero, zeroColor\n}) {\n if (!context) {\n console.error(\"Canvas context is null in drawLine\");\n return;\n }\n \n if (!context.setLineDash) {\n console.error('drawLine called with WebGL context instead of 2D context');\n return;\n }\n \n if (highlighted) {\n width += 2;\n }\n width *= DPI_INCREASE;\n\n context.strokeStyle = color;\n context.lineWidth = width;\n context.shadowColor = shadowColor;\n context.shadowBlur = shadowBlur;\n\n if (dashed) {\n context.setLineDash(dashPattern || [5, 5]);\n } else {\n context.setLineDash([]);\n }\n\n // Split paths at zero line if negativeColor is specified\n const paths = pathsFrom(dataInRenderSpace, hasNegatives && negativeColor ? { splitAtY: zero } : undefined);\n\n for (let path of paths) {\n if (renderCutoffGradient && cutoffIndex !== undefined && originalData) {\n let cutoffTime;\n if (cutoffTimeValue !== undefined && cutoffTimeValue !== null) {\n cutoffTime = cutoffTimeValue;\n } else if (typeof originalData[0] === 'object' && originalData[0].length === 2) {\n const baseIndex = Math.floor(cutoffIndex);\n const fraction = cutoffIndex - baseIndex;\n \n if (fraction === 0 || baseIndex >= originalData.length - 1) {\n const cutoffDate = originalData[Math.min(baseIndex, originalData.length - 1)][0];\n cutoffTime = cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n } else {\n const currentDate = originalData[baseIndex][0];\n const nextDate = originalData[baseIndex + 1][0];\n const currentTime = currentDate instanceof Date ? currentDate.getTime() : currentDate;\n const nextTime = nextDate instanceof Date ? nextDate.getTime() : nextDate;\n cutoffTime = currentTime + fraction * (nextTime - currentTime);\n }\n } else {\n cutoffTime = cutoffIndex; \n }\n \n if (isPreview) {\n const firstTime = originalData[0][0] instanceof Date ? originalData[0][0].getTime() : originalData[0][0];\n const lastTime = originalData[originalData.length - 1][0] instanceof Date ? \n originalData[originalData.length - 1][0].getTime() : originalData[originalData.length - 1][0];\n const timeRatio = (cutoffTime - firstTime) / (lastTime - firstTime);\n \n if (timeRatio < 0) {\n context.lineWidth = width;\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n } else if (timeRatio > 1) {\n const reducedColor = applyReducedOpacity(color, cutoffOpacity);\n context.strokeStyle = reducedColor;\n context.lineWidth = width;\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n } else {\n const renderCutoffIndex = timeRatio * (path.length - 1);\n const splitIndex = Math.floor(renderCutoffIndex);\n const fraction = renderCutoffIndex - splitIndex;\n \n let ghostPoint = null;\n if (splitIndex < path.length - 1 && fraction > 0) {\n const [x1, y1] = path[splitIndex];\n const [x2, y2] = path[splitIndex + 1];\n ghostPoint = [\n x1 + fraction * (x2 - x1),\n y1 + fraction * (y2 - y1)\n ];\n }\n \n if (splitIndex > 0 || (splitIndex === 0 && fraction > 0)) {\n const reducedColor = applyReducedOpacity(color, cutoffOpacity);\n context.strokeStyle = reducedColor;\n context.lineWidth = width;\n context.beginPath();\n \n for (let i = 0; i <= splitIndex; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n \n if (ghostPoint) {\n context.lineTo(ghostPoint[0], ghostPoint[1]);\n }\n \n context.stroke();\n }\n \n if (splitIndex < path.length - 1) {\n context.strokeStyle = color;\n context.lineWidth = width;\n context.beginPath();\n \n if (ghostPoint) {\n context.moveTo(ghostPoint[0], ghostPoint[1]);\n } else {\n context.moveTo(path[splitIndex + 1][0], path[splitIndex + 1][1]);\n }\n \n for (let i = splitIndex + 1; i < path.length; i++) {\n const [x, y] = path[i];\n context.lineTo(x, y);\n }\n \n context.stroke();\n }\n }\n } else {\n if (!selectionBounds) {\n context.lineWidth = width;\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n continue;\n }\n \n const visibleMinTime = selectionBounds.minX instanceof Date ? selectionBounds.minX.getTime() : selectionBounds.minX;\n const visibleMaxTime = selectionBounds.maxX instanceof Date ? selectionBounds.maxX.getTime() : selectionBounds.maxX;\n \n if (cutoffTime < visibleMinTime) {\n context.lineWidth = width;\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n } else if (cutoffTime > visibleMaxTime) {\n const reducedColor = applyReducedOpacity(color, cutoffOpacity);\n context.strokeStyle = reducedColor;\n context.lineWidth = width;\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n context.strokeStyle = color;\n } else {\n const timeRatio = (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n const canvasWidth = context.canvas.width;\n const cutoffPixelX = timeRatio * canvasWidth;\n \n // Find the path segment that contains this x position\n let renderCutoffIndex = -1;\n let ghostPoint = null;\n \n for (let i = 0; i < path.length - 1; i++) {\n const [x1] = path[i];\n const [x2] = path[i + 1];\n \n if (x1 <= cutoffPixelX && cutoffPixelX <= x2) {\n const xFraction = (cutoffPixelX - x1) / (x2 - x1);\n renderCutoffIndex = i + xFraction;\n \n // Create ghost point at exact cutoff x position\n const [, y1] = path[i];\n const [, y2] = path[i + 1];\n ghostPoint = [\n cutoffPixelX,\n y1 + xFraction * (y2 - y1)\n ];\n break;\n }\n }\n \n // If cutoff is beyond the data range, check if we should still draw the full line\n if (renderCutoffIndex === -1) {\n const lastDataTime = originalData[originalData.length - 1][0];\n const lastDataTimeMs = lastDataTime instanceof Date ? lastDataTime.getTime() : lastDataTime;\n \n if (cutoffPixelX >= path[path.length - 1][0]) {\n // Cutoff is after the last point - draw all as pre-cutoff (reduced opacity)\n renderCutoffIndex = path.length - 1;\n } else if (cutoffPixelX < path[0][0]) {\n // Cutoff is before the first point - draw all as post-cutoff (full opacity)\n renderCutoffIndex = 0;\n }\n }\n \n const preCutoffPath = [];\n const postCutoffPath = [];\n \n for (let i = 0; i < path.length; i++) {\n if (i < renderCutoffIndex) {\n preCutoffPath.push(path[i]);\n } else {\n postCutoffPath.push(path[i]);\n }\n }\n \n if (ghostPoint) {\n if (preCutoffPath.length > 0) {\n preCutoffPath.push(ghostPoint);\n }\n if (postCutoffPath.length > 0) {\n postCutoffPath.unshift(ghostPoint);\n }\n }\n \n if (preCutoffPath.length > 1) {\n const reducedColor = applyReducedOpacity(color, cutoffOpacity);\n context.strokeStyle = reducedColor;\n context.lineWidth = width;\n context.beginPath();\n for (let i = 0; i < preCutoffPath.length; i++) {\n const [x, y] = preCutoffPath[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n }\n \n if (postCutoffPath.length > 1) {\n context.strokeStyle = color;\n context.lineWidth = width;\n context.beginPath();\n for (let i = 0; i < postCutoffPath.length; i++) {\n const [x, y] = postCutoffPath[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n }\n }\n }\n } else {\n if (hasNegatives && negativeColor) {\n let positive = true;\n if (path.length >= 2) {\n positive = path[1][1] <= zero;\n } else if (path.length > 0) {\n positive = path[0][1] <= zero;\n }\n context.strokeStyle = positive ? color : negativeColor;\n } else {\n context.strokeStyle = color;\n }\n\n context.beginPath();\n\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n\n context.stroke();\n }\n }\n\n if (getRanges) {\n const ranges = getRanges();\n\n context.lineWidth = width;\n context.strokeStyle = color;\n context.setLineDash([]);\n const horizontalBarWidth = 8 * DPI_INCREASE;\n\n for (let range of ranges) {\n if (!range) {\n continue;\n }\n\n const { pixelX, pixelMinY, pixelMaxY } = range;\n\n if (pixelMinY !== null) {\n context.beginPath();\n context.moveTo(pixelX - (horizontalBarWidth / 2), pixelMinY);\n context.lineTo(pixelX + (horizontalBarWidth / 2), pixelMinY);\n context.stroke();\n }\n\n if (pixelMaxY !== null) {\n context.beginPath();\n context.moveTo(pixelX - (horizontalBarWidth / 2), pixelMaxY);\n context.lineTo(pixelX + (horizontalBarWidth / 2), pixelMaxY);\n context.stroke();\n }\n\n if (pixelMinY === null || pixelMaxY === null) {\n continue;\n }\n\n context.beginPath();\n context.moveTo(pixelX, pixelMinY);\n context.lineTo(pixelX, pixelMaxY);\n context.stroke();\n }\n }\n\n if (showIndividualPoints) {\n const individualPoints = getIndividualPoints();\n\n if (renderCutoffGradient && cutoffIndex !== undefined && originalData && selectionBounds) {\n const visibleBounds = selectionBounds;\n let firstTime, lastTime;\n \n if (visibleBounds && visibleBounds.minX !== undefined && visibleBounds.maxX !== undefined) {\n firstTime = visibleBounds.minX instanceof Date ? visibleBounds.minX.getTime() : visibleBounds.minX;\n lastTime = visibleBounds.maxX instanceof Date ? visibleBounds.maxX.getTime() : visibleBounds.maxX;\n } else {\n const firstItem = originalData[0];\n const lastItem = originalData[originalData.length - 1];\n const firstX = firstItem[0];\n const lastX = lastItem[0];\n \n firstTime = firstX instanceof Date ? firstX.getTime() : firstX;\n lastTime = lastX instanceof Date ? lastX.getTime() : lastX;\n }\n \n let cutoffTime;\n if (typeof cutoffIndex === 'string' && cutoffIndex === 'now') {\n cutoffTime = Date.now();\n } else if (typeof originalData[0] === 'object' && originalData[0].length === 2) {\n const baseIndex = Math.floor(cutoffIndex);\n const fraction = cutoffIndex - baseIndex;\n \n if (fraction === 0 || baseIndex >= originalData.length - 1) {\n const cutoffDate = originalData[Math.min(baseIndex, originalData.length - 1)][0];\n cutoffTime = cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n } else {\n const currentDate = originalData[baseIndex][0];\n const nextDate = originalData[baseIndex + 1][0];\n const currentTime = currentDate instanceof Date ? currentDate.getTime() : currentDate;\n const nextTime = nextDate instanceof Date ? nextDate.getTime() : nextDate;\n cutoffTime = currentTime + fraction * (nextTime - currentTime);\n }\n } else {\n cutoffTime = cutoffIndex; \n }\n \n if (cutoffTime !== null) {\n const timeDiff = cutoffTime - firstTime;\n const totalTime = lastTime - firstTime;\n const timeRatio = timeDiff / totalTime;\n \n if (timeRatio > 1) {\n const spacedPoints = applyPointSpacing(individualPoints, minPointSpacing);\n for (let i = 0; i < spacedPoints.length; i++) {\n const [x, y] = spacedPoints[i];\n \n let pointColor = color;\n if (negativeColor && hasNegatives) {\n if (y === zero && zeroColor) {\n pointColor = zeroColor;\n } else if (y < zero) {\n pointColor = color;\n } else {\n pointColor = negativeColor;\n }\n }\n \n const { applyReducedOpacity } = require(\"../helpers/colors\");\n const reducedOpacityColor = applyReducedOpacity(pointColor, cutoffOpacity);\n context.fillStyle = reducedOpacityColor;\n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n return;\n }\n }\n \n if (isPreview) {\n const visibleMinTime = selectionBounds.minX instanceof Date ? selectionBounds.minX.getTime() : selectionBounds.minX;\n const visibleMaxTime = selectionBounds.maxX instanceof Date ? selectionBounds.maxX.getTime() : selectionBounds.maxX;\n \n const spacedPoints = applyPointSpacing(individualPoints, minPointSpacing);\n for (let i = 0; i < spacedPoints.length; i++) {\n const [x, y] = spacedPoints[i];\n \n let isBeforeCutoff = false;\n if (cutoffTime < visibleMinTime) {\n isBeforeCutoff = false;\n } else if (cutoffTime > visibleMaxTime) {\n isBeforeCutoff = (rendering !== 'shadow');\n } else {\n const visibleCutoffRatio = (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n const cutoffPixelX = visibleCutoffRatio * context.canvas.width;\n isBeforeCutoff = x < cutoffPixelX;\n }\n \n let pointColor = color;\n if (negativeColor && hasNegatives) {\n if (y === zero && zeroColor) {\n pointColor = zeroColor;\n } else if (y < zero) {\n pointColor = color;\n } else {\n pointColor = negativeColor;\n }\n }\n \n if (isBeforeCutoff) {\n const reducedOpacityColor = applyReducedOpacity(pointColor, cutoffOpacity);\n context.fillStyle = reducedOpacityColor;\n } else {\n context.fillStyle = pointColor;\n }\n \n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n } else if (!selectionBounds) {\n const spacedPoints = applyPointSpacing(individualPoints, minPointSpacing);\n for (let i = 0; i < spacedPoints.length; i++) {\n const [x, y] = spacedPoints[i];\n \n let pointColor = color;\n if (negativeColor && hasNegatives) {\n if (y === zero && zeroColor) {\n pointColor = zeroColor;\n } else if (y < zero) {\n pointColor = color;\n } else {\n pointColor = negativeColor;\n }\n }\n \n context.fillStyle = pointColor;\n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n } else {\n const visibleMinTime = selectionBounds.minX instanceof Date ? selectionBounds.minX.getTime() : selectionBounds.minX;\n const visibleMaxTime = selectionBounds.maxX instanceof Date ? selectionBounds.maxX.getTime() : selectionBounds.maxX;\n \n const spacedPoints = applyPointSpacing(individualPoints, minPointSpacing);\n for (let i = 0; i < spacedPoints.length; i++) {\n const [x, y] = spacedPoints[i];\n \n let isBeforeCutoff = false;\n if (cutoffTime < visibleMinTime) {\n isBeforeCutoff = false;\n } else if (cutoffTime > visibleMaxTime) {\n isBeforeCutoff = (rendering !== 'shadow');\n } else {\n const visibleCutoffRatio = (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n const cutoffPixelX = visibleCutoffRatio * context.canvas.width;\n isBeforeCutoff = x < cutoffPixelX;\n }\n \n let pointColor = color;\n if (negativeColor && hasNegatives) {\n if (y === zero && zeroColor) {\n pointColor = zeroColor;\n } else if (y < zero) {\n pointColor = color;\n } else {\n pointColor = negativeColor;\n }\n }\n \n if (isBeforeCutoff) {\n const reducedOpacityColor = applyReducedOpacity(pointColor, cutoffOpacity);\n context.fillStyle = reducedOpacityColor;\n } else {\n context.fillStyle = pointColor;\n }\n \n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n }\n } else {\n const spacedPoints = applyPointSpacing(individualPoints, minPointSpacing);\n for (let i = 0; i < spacedPoints.length; i++) {\n const [x, y] = spacedPoints[i];\n \n // Determine point color based on position relative to zero\n let pointColor = color;\n if (negativeColor && hasNegatives) {\n if (y === zero && zeroColor) {\n pointColor = zeroColor;\n } else if (y < zero) {\n pointColor = color;\n } else {\n pointColor = negativeColor;\n }\n }\n \n context.fillStyle = pointColor;\n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n }\n }\n}\n","let rustApiModule;\nexport const RustAPIPromise = import('../rust/pkg/index.js').then((module) => {\n return module.default().then(() => {\n rustApiModule = module;\n });\n});\n\nexport default function RustAPI() {\n return rustApiModule;\n}\n","import pathsFrom from './paths_from';\nimport {DPI_INCREASE} from './size_canvas';\nimport RustAPI from '../state/rust_api';\n\n/**\n *\n * @param {[[Number]]} paths\n * @param {Boolean} dashed\n * @param {Array} dashPattern\n * @return {{prevPositions: Float32Array, indices: Uint32Array, vertices: Float32Array, positions: Float32Array}}\n */\nexport function extractVerticesFromPaths(paths, { dashed, dashPattern }) {\n let pointNumber = 0;\n for (let path of paths) {\n if (dashed) {\n for (let i = 0; i < path.length; i++) {\n if (dashed && i % (dashPattern[0] + dashPattern[1]) >= dashPattern[0]) {\n continue;\n }\n pointNumber++;\n }\n } else {\n pointNumber += path.length;\n }\n }\n\n const positions = new Float32Array(pointNumber*8);\n const prevPositions = new Float32Array(pointNumber*8);\n const vertices = new Float32Array(pointNumber*4);\n const indices = new Uint32Array(pointNumber*6);\n\n if (pointNumber > 0) {\n const verticesPattern = new Float32Array([0, 1, 2, 3]);\n vertices.set(verticesPattern);\n let vertexPointer = verticesPattern.length;\n let sourceLength = verticesPattern.length;\n while (vertexPointer < vertices.length) {\n if (vertexPointer + sourceLength > vertices.length) {\n sourceLength = vertices.length - vertexPointer;\n }\n\n vertices.copyWithin(vertexPointer, 0, sourceLength);\n vertexPointer += sourceLength;\n sourceLength <<= 1;\n }\n }\n\n let pointI = 0;\n for (let path of paths) {\n for (let i = 0; i < path.length; i++) {\n if (dashed && i % (dashPattern[0] + dashPattern[1]) >= dashPattern[0]) {\n continue;\n }\n\n const [x, y] = path[i];\n\n let prevX, prevY;\n\n if (i === 0) {\n prevX = x - 1;\n prevY = y;\n } else {\n [prevX, prevY] = path[i - 1];\n }\n\n for (let j = 0; j < 4; j++) {\n positions[pointI * 8 + 2 * j] = x;\n positions[pointI * 8 + 2 * j + 1] = y;\n prevPositions[pointI * 8 + 2 * j] = prevX;\n prevPositions[pointI * 8 + 2 * j + 1] = prevY;\n }\n\n indices[pointI * 6] = pointI * 4;\n indices[pointI * 6 + 1] = pointI * 4 + 1;\n indices[pointI * 6 + 2] = pointI * 4 + 3;\n\n indices[pointI * 6 + 3] = pointI * 4;\n indices[pointI * 6 + 4] = pointI * 4 + 2;\n indices[pointI * 6 + 5] = pointI * 4 + 3;\n\n pointI++;\n }\n }\n\n return {\n positions,\n prevPositions,\n vertices,\n indices\n };\n}\n\n/**\n * Takes the paths and turns them into what's needed for the line webgl program\n *\n * @param {{nullMask: Uint8Array, maxYValues: Float64Array, minYValues: Float64Array, yValues: Float64Array, paths?: [[Number]]}} dataInRenderSpace\n * @param {Boolean} dashed\n * @param {Array} dashPattern\n * @return {{prevPositions: Float32Array, indices: Uint32Array, vertices: Float32Array, positions: Float32Array}}\n */\nexport default function extractVertices(dataInRenderSpace, { dashed, dashPattern }) {\n if (dataInRenderSpace && dataInRenderSpace.paths) {\n return extractVerticesFromPaths(dataInRenderSpace.paths, { dashed, dashPattern});\n }\n\n if (!RustAPI()) {\n const paths = pathsFrom(dataInRenderSpace);\n return extractVerticesFromPaths(paths, { dashed, dashPattern});\n }\n\n const pointNumber = RustAPI().get_point_number(\n dataInRenderSpace.nullMask, dataInRenderSpace.yValues, dataInRenderSpace.minYValues, dataInRenderSpace.maxYValues,\n dashed, dashPattern[0], dashPattern[1]\n );\n\n let positions = new Float32Array(pointNumber*8);\n let prevPositions = new Float32Array(pointNumber*8);\n let vertices = new Float32Array(pointNumber*4);\n let indices = new Uint32Array(pointNumber*6);\n\n RustAPI().extract_vertices(\n DPI_INCREASE,\n dataInRenderSpace.nullMask, dataInRenderSpace.yValues, dataInRenderSpace.minYValues, dataInRenderSpace.maxYValues,\n positions, prevPositions, vertices, indices,\n dashed, dashPattern[0], dashPattern[1]\n );\n\n return {\n positions,\n prevPositions,\n vertices,\n indices\n };\n}\n","import lineFrag from './line.frag';\nimport lineVert from './line.vert';\nimport circleFrag from './circle.frag';\nimport circleVert from './circle.vert';\nimport colorToVector from '../helpers/color_to_vector';\nimport extractVertices from './extract_vertices';\nimport createGLProgram from './create_gl_program';\nimport {DPI_INCREASE} from './size_canvas';\nimport { applyReducedOpacity } from \"../helpers/colors\";\n\nexport default class LineProgram {\n\n constructor(gl) {\n this._gl = gl;\n\n this._program = createGLProgram(gl, lineVert, lineFrag);\n this._circleProgram = createGLProgram(gl, circleVert, circleFrag);\n\n this._positionBuffer = gl.createBuffer();\n this._prevPositionBuffer = gl.createBuffer();\n this._vertexBuffer = gl.createBuffer();\n this._indexBuffer = gl.createBuffer();\n this._individualPointBuffer = gl.createBuffer();\n\n if (!gl.getExtension('OES_element_index_uint')) {\n console.error('Your browser does not support OES_element_index_uint'); // eslint-disable-line no-console\n }\n }\n\n dispose() {\n\n }\n\n clear() {\n const gl = this._gl;\n const width = gl.drawingBufferWidth;\n const height = gl.drawingBufferHeight;\n\n gl.clearColor(0, 0, 0, 0);\n gl.viewport(0, 0, width, height);\n }\n\n /**\n * Draws the data on the canvas\n * Assumes the data is in render space\n *\n * @param {{nullMask: Uint8Array, maxYValues: Float64Array, minYValues: Float64Array, yValues: Float64Array}} dataInRenderSpace - the data to render\n * @param {Object} parameters - set of options\n * @param {String} parameters.color - color of the line to draw\n * @param {Number} [parameters.width] - line width\n * @param {Number} [parameters.shadowBlur] - level to blur shadow to\n * @param {String} [parameters.shadowColor] - color of the shadow\n * @param {String} [parameters.dashed] - whether or not to make the line dashed\n * @param {Array<Number>} [parameters.dashPattern] - dash array for the canvas\n * @param {Boolean} [parameters.highlighted] - whether the line is highlighted or not\n * @param {Boolean} [parameters.showIndividualPoints] - draw circles at each point\n * @param {Function} [parameters.getIndividualPoints] - points to draw circles at. Only called when needed.\n * @private\n */\n draw(dataInRenderSpace, parameters) {\n const gl = this._gl;\n const width = gl.drawingBufferWidth;\n const height = gl.drawingBufferHeight;\n gl.useProgram(this._program);\n\n const thickness = DPI_INCREASE*((parameters.width || 1) + (parameters.highlighted ? 2 : 0));\n const shadowBlur = parameters.shadowBlur === undefined ? 2 : parameters.shadowBlur;\n const shadowColor = parameters.shadowColor || 'black';\n const dashed = parameters.dashed || false;\n const dashPattern = parameters.dashPattern || [5, 5];\n if (parameters.renderCutoffGradient && parameters.cutoffIndex !== undefined && parameters.originalData) {\n this.drawLineWithCutoff(dataInRenderSpace, parameters);\n return;\n }\n\n const {positions, prevPositions, vertices, indices} = extractVertices(dataInRenderSpace, { dashed, dashPattern });\n\n if (!this._program) {\n console.error('WebGL line program is null - shader compilation failed!');\n return;\n }\n\n const positionIndex = gl.getAttribLocation(this._program, 'position');\n const prevPositionIndex = gl.getAttribLocation(this._program, 'prevPosition');\n const vertexIndex = gl.getAttribLocation(this._program, 'vertex');\n\n gl.enableVertexAttribArray(positionIndex);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._positionBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, positions, gl.STATIC_DRAW);\n gl.vertexAttribPointer(positionIndex, 2, gl.FLOAT, false, 0, 0);\n\n gl.enableVertexAttribArray(prevPositionIndex);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._prevPositionBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, prevPositions, gl.STATIC_DRAW);\n gl.vertexAttribPointer(prevPositionIndex, 2, gl.FLOAT, false, 0, 0);\n\n gl.enableVertexAttribArray(vertexIndex);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n gl.vertexAttribPointer(vertexIndex, 1, gl.FLOAT, false, 0, 0);\n\n gl.uniform1f(gl.getUniformLocation(this._program, 'width'), width);\n gl.uniform1f(gl.getUniformLocation(this._program, 'height'), height);\n gl.uniform1f(gl.getUniformLocation(this._program, 'thickness'), Math.max(thickness, 1)+shadowBlur);\n gl.uniform1f(gl.getUniformLocation(this._program, 'shadowBlur'), shadowBlur);\n const colorVector = colorToVector(parameters.color);\n gl.uniform4f(gl.getUniformLocation(this._program, 'color'), ...colorVector);\n gl.uniform4f(gl.getUniformLocation(this._program, 'shadowColor'), ...colorToVector(shadowColor));\n \n const cutoffX = parameters.cutoffX !== undefined ? parameters.cutoffX : -1.0; // Use parameter or disable\n const cutoffOpacity = parameters.cutoffOpacity !== undefined ? parameters.cutoffOpacity : 0.35;\n \n gl.uniform1f(gl.getUniformLocation(this._program, 'cutoffX'), cutoffX);\n gl.uniform1f(gl.getUniformLocation(this._program, 'cutoffOpacity'), cutoffOpacity);\n\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW);\n gl.drawElements(gl.TRIANGLES, indices.length, gl.UNSIGNED_INT, 0);\n\n if (parameters.showIndividualPoints) {\n gl.useProgram(this._circleProgram);\n\n gl.uniform1f(gl.getUniformLocation(this._circleProgram, 'width'), width);\n gl.uniform1f(gl.getUniformLocation(this._circleProgram, 'height'), height);\n const pointSize = parameters.pointRadius ? parameters.pointRadius * 2 * DPI_INCREASE : 2*(thickness+6);\n gl.uniform1f(gl.getUniformLocation(this._circleProgram, 'pointSize'), pointSize);\n\n let individualPoints = parameters.getIndividualPoints();\n \n if (parameters.minPointSpacing && individualPoints.length > 1) {\n const spacedPoints = [];\n let lastX = -Infinity;\n \n for (const point of individualPoints) {\n const [x] = point;\n if (x - lastX >= parameters.minPointSpacing) {\n spacedPoints.push(point);\n lastX = x;\n }\n }\n \n individualPoints = spacedPoints;\n }\n\n if (parameters.cutoffIndex !== undefined && parameters.cutoffIndex > 0 && parameters.originalData) {\n const { originalData } = parameters;\n let cutoffTime;\n \n if (typeof originalData[0] === 'object' && originalData[0].length === 2) {\n const baseIndex = Math.floor(parameters.cutoffIndex);\n const fraction = parameters.cutoffIndex - baseIndex;\n \n if (fraction === 0 || baseIndex >= originalData.length - 1) {\n const cutoffDate = originalData[Math.min(baseIndex, originalData.length - 1)][0];\n cutoffTime = cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n } else {\n const currentDate = originalData[baseIndex][0];\n const nextDate = originalData[baseIndex + 1][0];\n const currentTime = currentDate instanceof Date ? currentDate.getTime() : currentDate;\n const nextTime = nextDate instanceof Date ? nextDate.getTime() : nextDate;\n cutoffTime = currentTime + fraction * (nextTime - currentTime);\n }\n }\n \n const preCutoffPoints = [];\n const postCutoffPoints = [];\n\n if (parameters.isPreview) {\n const visibleMinTime = parameters.selectionBounds.minX instanceof Date ? parameters.selectionBounds.minX.getTime() : parameters.selectionBounds.minX;\n const visibleMaxTime = parameters.selectionBounds.maxX instanceof Date ? parameters.selectionBounds.maxX.getTime() : parameters.selectionBounds.maxX;\n const timeRatio = (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n const cutoffPixelX = timeRatio * width;\n \n for (let i = 0; i < individualPoints.length; i++) {\n const [pixelX, pixelY] = individualPoints[i];\n if (pixelX < cutoffPixelX) {\n preCutoffPoints.push(individualPoints[i]);\n } else {\n postCutoffPoints.push(individualPoints[i]);\n }\n }\n } else if (!parameters.selectionBounds) {\n postCutoffPoints.push(...individualPoints);\n } else {\n const visibleMinTime = parameters.selectionBounds.minX instanceof Date ? \n parameters.selectionBounds.minX.getTime() : parameters.selectionBounds.minX;\n const visibleMaxTime = parameters.selectionBounds.maxX instanceof Date ? \n parameters.selectionBounds.maxX.getTime() : parameters.selectionBounds.maxX;\n \n if (cutoffTime < visibleMinTime) {\n postCutoffPoints.push(...individualPoints);\n } else if (cutoffTime > visibleMaxTime) {\n if (parameters.rendering === 'shadow') {\n postCutoffPoints.push(...individualPoints);\n } else {\n preCutoffPoints.push(...individualPoints);\n }\n } else {\n const visibleCutoffRatio = (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n const renderWidth = this._gl.canvas.width;\n const cutoffPixelX = visibleCutoffRatio * renderWidth;\n \n individualPoints.forEach((point, index) => {\n const [pixelX, pixelY] = point;\n \n if (pixelX < cutoffPixelX) {\n preCutoffPoints.push(point);\n } else {\n postCutoffPoints.push(point);\n }\n });\n }\n }\n \n if (preCutoffPoints.length > 0) {\n const reducedOpacityColor = applyReducedOpacity(parameters.color, parameters.cutoffOpacity || 0.35);\n gl.uniform4f(gl.getUniformLocation(this._circleProgram, 'color'), ...colorToVector(reducedOpacityColor));\n \n gl.enableVertexAttribArray(0);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._individualPointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(preCutoffPoints.flat()), gl.STATIC_DRAW);\n gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);\n gl.drawArrays(gl.POINTS, 0, preCutoffPoints.length);\n }\n \n if (postCutoffPoints.length > 0) {\n gl.uniform4f(gl.getUniformLocation(this._circleProgram, 'color'), ...colorToVector(parameters.color));\n \n gl.enableVertexAttribArray(0);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._individualPointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(postCutoffPoints.flat()), gl.STATIC_DRAW);\n gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);\n gl.drawArrays(gl.POINTS, 0, postCutoffPoints.length);\n }\n } else {\n gl.uniform4f(gl.getUniformLocation(this._circleProgram, 'color'), ...colorToVector(parameters.color));\n\n gl.enableVertexAttribArray(0);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._individualPointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(individualPoints.flat()), gl.STATIC_DRAW);\n gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);\n\n gl.drawArrays(gl.POINTS, 0, individualPoints.length);\n }\n }\n }\n\n drawLineWithCutoff(dataInRenderSpace, parameters) {\n const { cutoffIndex, cutoffTimeValue, cutoffOpacity, originalData, selectionBounds } = parameters;\n \n let cutoffTime;\n if (cutoffTimeValue !== undefined && cutoffTimeValue !== null) {\n cutoffTime = cutoffTimeValue;\n } else if (typeof originalData[0] === 'object' && originalData[0].length === 2) {\n const baseIndex = Math.floor(cutoffIndex);\n const fraction = cutoffIndex - baseIndex;\n \n if (fraction === 0 || baseIndex >= originalData.length - 1) {\n const cutoffDate = originalData[Math.min(baseIndex, originalData.length - 1)][0];\n cutoffTime = cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n } else {\n const currentDate = originalData[baseIndex][0];\n const nextDate = originalData[baseIndex + 1][0];\n const currentTime = currentDate instanceof Date ? currentDate.getTime() : currentDate;\n const nextTime = nextDate instanceof Date ? nextDate.getTime() : nextDate;\n cutoffTime = currentTime + fraction * (nextTime - currentTime);\n }\n } else {\n cutoffTime = cutoffIndex; \n }\n\n if (parameters.isPreview) {\n const gl = this._gl;\n const visibleMinTime = selectionBounds.minX instanceof Date ? selectionBounds.minX.getTime() : selectionBounds.minX;\n const visibleMaxTime = selectionBounds.maxX instanceof Date ? selectionBounds.maxX.getTime() : selectionBounds.maxX;\n const timeRatio = (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n \n if (timeRatio < 0) {\n this.draw(dataInRenderSpace, { ...parameters, renderCutoffGradient: false });\n } else if (timeRatio > 1) {\n const reducedOpacityColor = applyReducedOpacity(parameters.color, cutoffOpacity);\n this.draw(dataInRenderSpace, { \n ...parameters, \n color: reducedOpacityColor,\n renderCutoffGradient: false \n });\n } else {\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n \n this.draw(dataInRenderSpace, {\n ...parameters,\n renderCutoffGradient: false,\n cutoffX: timeRatio,\n cutoffOpacity: cutoffOpacity || 0.35\n });\n }\n } else {\n if (!selectionBounds) {\n this.draw(dataInRenderSpace, { ...parameters, renderCutoffGradient: false });\n return;\n }\n \n const visibleMinTime = selectionBounds.minX instanceof Date ? selectionBounds.minX.getTime() : selectionBounds.minX;\n const visibleMaxTime = selectionBounds.maxX instanceof Date ? selectionBounds.maxX.getTime() : selectionBounds.maxX;\n\n if (cutoffTime < visibleMinTime) {\n this.draw(dataInRenderSpace, { ...parameters, renderCutoffGradient: false });\n } else if (cutoffTime > visibleMaxTime) {\n const reducedOpacityColor = applyReducedOpacity(parameters.color, cutoffOpacity);\n this.draw(dataInRenderSpace, { \n ...parameters, \n color: reducedOpacityColor,\n renderCutoffGradient: false \n });\n } else {\n const visibleCutoffRatio = (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n \n const gl = this._gl;\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n \n this.draw(dataInRenderSpace, {\n ...parameters,\n renderCutoffGradient: false,\n cutoffX: visibleCutoffRatio,\n cutoffOpacity: cutoffOpacity || 0.35\n });\n }\n }\n }\n}\n","import shadowFrag from \"./shadow.frag\";\nimport shadowVert from \"./shadow.vert\";\nimport colorToVector from \"../helpers/color_to_vector\";\nimport createGLProgram from \"./create_gl_program\";\nimport { applyReducedOpacity, applyReducedOpacityToGradient } from \"../helpers/colors\";\n\nexport default class ShadowProgram {\n constructor(gl) {\n this._gl = gl;\n\n this._program = createGLProgram(gl, shadowVert, shadowFrag);\n\n if (!this._program) {\n console.error(\"Failed to create shadow shader program\");\n this._program = null;\n return;\n }\n\n gl.validateProgram(this._program);\n if (!gl.getProgramParameter(this._program, gl.VALIDATE_STATUS)) {\n console.error(\n \"Shadow program validation failed:\",\n gl.getProgramInfoLog(this._program)\n );\n }\n\n const positionLoc = gl.getAttribLocation(this._program, \"position\");\n const trapezoidBoundsLoc = gl.getAttribLocation(\n this._program,\n \"trapezoidBounds\"\n );\n const trapezoidBottomLoc = gl.getAttribLocation(\n this._program,\n \"trapezoidBottom\"\n );\n\n if (\n positionLoc === -1 ||\n trapezoidBoundsLoc === -1 ||\n trapezoidBottomLoc === -1\n ) {\n console.error(\"Missing required shader attributes\");\n }\n\n this._positionBuffer = gl.createBuffer();\n this._trapezoidBoundsBuffer = gl.createBuffer();\n this._trapezoidBottomBuffer = gl.createBuffer();\n this._indexBuffer = gl.createBuffer();\n\n this._gradientTexture = gl.createTexture();\n\n if (!gl.getExtension(\"OES_element_index_uint\")) {\n console.error(\"Your browser does not support OES_element_index_uint\");\n }\n }\n\n dispose() {\n const gl = this._gl;\n if (this._gradientTexture) {\n gl.deleteTexture(this._gradientTexture);\n this._gradientTexture = null;\n }\n }\n\n /**\n * Convert trapezoids into WebGL geometry\n * @param {Array} trapezoids - Array of trapezoid definitions\n * @returns {Object} - Geometry data for WebGL\n */\n generateTrapezoidGeometry(trapezoids) {\n const positions = [];\n const trapezoidBounds = [];\n const trapezoidBottom = [];\n const indices = [];\n\n let vertexIndex = 0;\n\n for (const trap of trapezoids) {\n const { x1, y1, x2, y2, bottomY1, bottomY2 } = trap;\n\n const vertices = [\n [x1, y1],\n [x2, y2],\n [x2, bottomY2],\n [x1, bottomY1],\n ];\n\n const bounds = [x1, y1, x2, y2];\n const bottom = [x1, bottomY1, x2, bottomY2];\n\n for (let i = 0; i < 4; i++) {\n const [x, y] = vertices[i];\n\n positions.push(x, y);\n trapezoidBounds.push(...bounds);\n trapezoidBottom.push(...bottom);\n }\n\n indices.push(\n vertexIndex,\n vertexIndex + 1,\n vertexIndex + 2,\n vertexIndex,\n vertexIndex + 2,\n vertexIndex + 3\n );\n\n vertexIndex += 4;\n }\n\n return {\n positions: new Float32Array(positions),\n trapezoidBounds: new Float32Array(trapezoidBounds),\n trapezoidBottom: new Float32Array(trapezoidBottom),\n indices: new Uint32Array(indices),\n };\n }\n\n /**\n * Parse gradient definition to shader uniforms (supports up to 16 stops)\n * @param {Array} gradient - Gradient definition\n * @param {String} fallbackColor - Fallback color\n * @returns {Object} - Shader uniform data\n */\n parseGradient(gradient, fallbackColor) {\n if (!gradient || !Array.isArray(gradient) || gradient.length < 2) {\n const fallbackColorVec = colorToVector(fallbackColor);\n return {\n textureData: new Uint8Array([\n 0,\n 0,\n 0,\n 255,\n Math.floor(fallbackColorVec[0] * 255),\n Math.floor(fallbackColorVec[1] * 255),\n Math.floor(fallbackColorVec[2] * 255),\n Math.floor(fallbackColorVec[3] * 255),\n ]),\n textureWidth: 2,\n gradientCount: 1,\n fallbackColor: fallbackColorVec,\n };\n }\n\n const colors = [];\n const stops = [];\n\n for (let i = 0; i < gradient.length; i++) {\n const item = gradient[i];\n\n if (Array.isArray(item)) {\n stops.push(item[0]);\n colors.push(colorToVector(item[1]));\n } else {\n stops.push(i / (gradient.length - 1));\n colors.push(colorToVector(item));\n }\n }\n\n const textureWidth = colors.length * 2;\n const textureData = new Uint8Array(textureWidth * 4);\n\n for (let i = 0; i < colors.length; i++) {\n const stopIndex = i * 8;\n const colorIndex = stopIndex + 4;\n\n textureData[stopIndex] = Math.floor(stops[i] * 255);\n textureData[stopIndex + 1] = 0;\n textureData[stopIndex + 2] = 0;\n textureData[stopIndex + 3] = 255;\n\n textureData[colorIndex] = Math.floor(colors[i][0] * 255);\n textureData[colorIndex + 1] = Math.floor(colors[i][1] * 255);\n textureData[colorIndex + 2] = Math.floor(colors[i][2] * 255);\n textureData[colorIndex + 3] = Math.floor(colors[i][3] * 255);\n }\n\n return {\n textureData,\n textureWidth,\n gradientCount: colors.length,\n fallbackColor: colorToVector(fallbackColor),\n };\n }\n\n /**\n * Draw shadow/trapezoid geometry\n * @param {Array} individualPoints - Points defining the line\n * @param {Object} params - Rendering parameters\n */\n draw(individualPoints, params) {\n\n if (!individualPoints || individualPoints.length < 2) {\n return;\n }\n\n const gl = this._gl;\n const width = gl.drawingBufferWidth;\n const height = gl.drawingBufferHeight;\n\n gl.useProgram(this._program);\n\n if (\n params.renderCutoffGradient &&\n params.cutoffIndex !== undefined &&\n params.originalData\n ) {\n this.drawShadowWithCutoff(individualPoints, params);\n return;\n }\n\n const trapezoids = [];\n const positiveTrapezoids = [];\n const negativeTrapezoids = [];\n const { zero, inRenderSpaceAreaBottom, negativeGradient, hasNegatives } = params;\n\n\n for (let i = 0; i < individualPoints.length - 1; i++) {\n const [x1, y1] = individualPoints[i];\n const [x2, y2] = individualPoints[i + 1];\n\n let bottomY1 = zero;\n let bottomY2 = zero;\n\n const y1RelativeToZero = y1 - zero;\n const y2RelativeToZero = y2 - zero;\n const crossesZero = y1RelativeToZero * y2RelativeToZero < 0;\n\n if (crossesZero) {\n const t =\n Math.abs(y1RelativeToZero) /\n (Math.abs(y1RelativeToZero) + Math.abs(y2RelativeToZero));\n const xCross = x1 + (x2 - x1) * t;\n const yCross = zero;\n\n if (Math.abs(y1 - yCross) > 0.1) {\n const trap = {\n x1,\n y1,\n x2: xCross,\n y2: yCross,\n bottomY1,\n bottomY2: zero,\n };\n trapezoids.push(trap);\n \n // Determine if positive or negative (in screen coords, smaller Y is higher/positive)\n if (hasNegatives && negativeGradient) {\n if (y1 <= zero) {\n positiveTrapezoids.push(trap);\n } else {\n negativeTrapezoids.push(trap);\n }\n }\n }\n\n if (Math.abs(y2 - yCross) > 0.1) {\n const trap = {\n x1: xCross,\n y1: yCross,\n x2,\n y2,\n bottomY1: zero,\n bottomY2,\n };\n trapezoids.push(trap);\n \n // Determine if positive or negative\n if (hasNegatives && negativeGradient) {\n if (y2 <= zero) {\n positiveTrapezoids.push(trap);\n } else {\n negativeTrapezoids.push(trap);\n }\n }\n }\n } else {\n // Skip trapezoids completely outside canvas\n if (x1 > width || x2 < 0) {\n continue;\n }\n \n // Clip trapezoid to canvas bounds if it extends beyond\n let finalX2 = x2;\n let finalY2 = y2;\n let finalBottomY2 = bottomY2;\n \n if (x2 > width) {\n const ratio = (width - x1) / (x2 - x1);\n finalX2 = width;\n finalY2 = y1 + (y2 - y1) * ratio;\n finalBottomY2 = bottomY1 + (bottomY2 - bottomY1) * ratio;\n }\n \n const trapezoid = { x1, y1, x2: finalX2, y2: finalY2, bottomY1, bottomY2: finalBottomY2 };\n trapezoids.push(trapezoid);\n \n // Determine if positive or negative\n if (hasNegatives && negativeGradient) {\n // Check average Y position\n const avgY = (y1 + finalY2) / 2;\n if (avgY <= zero) {\n positiveTrapezoids.push(trapezoid);\n } else {\n negativeTrapezoids.push(trapezoid);\n }\n }\n }\n }\n\n if (trapezoids.length === 0) {\n return;\n }\n\n const positionLoc = gl.getAttribLocation(this._program, \"position\");\n const trapezoidBoundsLoc = gl.getAttribLocation(\n this._program,\n \"trapezoidBounds\"\n );\n const trapezoidBottomLoc = gl.getAttribLocation(\n this._program,\n \"trapezoidBottom\"\n );\n\n gl.uniform1f(gl.getUniformLocation(this._program, \"width\"), width);\n gl.uniform1f(gl.getUniformLocation(this._program, \"height\"), height);\n\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n\n // Helper function to render a set of trapezoids with a given gradient\n const renderTrapezoidSet = (trapSet, gradient, color) => {\n if (trapSet.length === 0) return;\n\n const geometry = this.generateTrapezoidGeometry(trapSet);\n\n gl.enableVertexAttribArray(positionLoc);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._positionBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, geometry.positions, gl.STATIC_DRAW);\n gl.vertexAttribPointer(positionLoc, 2, gl.FLOAT, false, 0, 0);\n\n gl.enableVertexAttribArray(trapezoidBoundsLoc);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._trapezoidBoundsBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, geometry.trapezoidBounds, gl.STATIC_DRAW);\n gl.vertexAttribPointer(trapezoidBoundsLoc, 4, gl.FLOAT, false, 0, 0);\n\n gl.enableVertexAttribArray(trapezoidBottomLoc);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._trapezoidBottomBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, geometry.trapezoidBottom, gl.STATIC_DRAW);\n gl.vertexAttribPointer(trapezoidBottomLoc, 4, gl.FLOAT, false, 0, 0);\n\n const gradientData = this.parseGradient(gradient, color);\n\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, this._gradientTexture);\n\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gradientData.textureWidth,\n 1,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n gradientData.textureData\n );\n\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\n gl.uniform1i(gl.getUniformLocation(this._program, \"gradientTexture\"), 0);\n gl.uniform1i(\n gl.getUniformLocation(this._program, \"gradientCount\"),\n gradientData.gradientCount\n );\n gl.uniform4fv(\n gl.getUniformLocation(this._program, \"fallbackColor\"),\n gradientData.fallbackColor\n );\n\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, geometry.indices, gl.STATIC_DRAW);\n\n gl.drawElements(gl.TRIANGLES, geometry.indices.length, gl.UNSIGNED_INT, 0);\n };\n\n // If we have negativeGradient and separate trapezoid sets, render them separately\n if (hasNegatives && negativeGradient && (positiveTrapezoids.length > 0 || negativeTrapezoids.length > 0)) {\n // Render positive trapezoids with the normal gradient\n renderTrapezoidSet(positiveTrapezoids, params.gradient, params.color);\n \n // Render negative trapezoids with negativeGradient\n renderTrapezoidSet(negativeTrapezoids, negativeGradient, params.color);\n } else {\n // Fallback to rendering all trapezoids with the same gradient (original behavior)\n renderTrapezoidSet(trapezoids, params.gradient, params.color);\n }\n \n const error = gl.getError();\n if (error !== gl.NO_ERROR) {\n console.error('WebGL error in shadow rendering:', error);\n } else {\n //he he he haw\n }\n }\n\n /**\n * Draw shadow chart with cutoff gradient\n * @param {Array} individualPoints - Points defining the line\n * @param {Object} params - Rendering parameters with cutoff info\n */\n drawShadowWithCutoff(individualPoints, params) {\n\n const { cutoffIndex, cutoffTimeValue, cutoffOpacity, originalData, selectionBounds, zero } =\n params;\n\n this._lastIndividualPoints = null;\n this._lastParams = null;\n\n let cutoffTime;\n if (cutoffTimeValue !== undefined && cutoffTimeValue !== null) {\n cutoffTime = cutoffTimeValue;\n } else if (Array.isArray(originalData[0]) && originalData[0].length === 2) {\n const baseIndex = Math.floor(cutoffIndex);\n const fraction = cutoffIndex - baseIndex;\n\n if (fraction === 0 || baseIndex >= originalData.length - 1) {\n const cutoffItem = originalData[Math.min(baseIndex, originalData.length - 1)];\n const cutoffDate = cutoffItem[0];\n cutoffTime = cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n } else {\n const currentItem = originalData[baseIndex];\n const nextItem = originalData[baseIndex + 1];\n const currentDate = currentItem[0];\n const nextDate = nextItem[0];\n const currentTime = currentDate instanceof Date ? currentDate.getTime() : currentDate;\n const nextTime = nextDate instanceof Date ? nextDate.getTime() : nextDate;\n cutoffTime = currentTime + fraction * (nextTime - currentTime);\n }\n } else {\n cutoffTime = cutoffIndex;\n }\n\n const visibleBounds = params.selectionBounds;\n let firstTime, lastTime;\n \n if (visibleBounds && visibleBounds.minX !== undefined && visibleBounds.maxX !== undefined) {\n firstTime = visibleBounds.minX instanceof Date ? visibleBounds.minX.getTime() : visibleBounds.minX;\n lastTime = visibleBounds.maxX instanceof Date ? visibleBounds.maxX.getTime() : visibleBounds.maxX;\n } else {\n const firstItem = originalData[0];\n const lastItem = originalData[originalData.length - 1];\n const firstX = firstItem[0];\n const lastX = lastItem[0];\n \n firstTime = firstX instanceof Date ? firstX.getTime() : firstX;\n lastTime = lastX instanceof Date ? lastX.getTime() : lastX;\n }\n \n const timeDiff = cutoffTime - firstTime;\n const totalTime = lastTime - firstTime;\n const timeRatio = timeDiff / totalTime;\n\n if (timeRatio < 0) {\n this.draw(individualPoints, { ...params, renderCutoffGradient: false });\n } else if (timeRatio > 1) {\n const reducedOpacityColor = applyReducedOpacity(\n params.color,\n cutoffOpacity\n );\n const translucentGradient = applyReducedOpacityToGradient(\n params.gradient,\n cutoffOpacity\n );\n this.draw(individualPoints, {\n ...params,\n color: reducedOpacityColor,\n gradient: translucentGradient,\n renderCutoffGradient: false,\n });\n } else {\n this.drawSplitShadowTrapezoids(\n individualPoints,\n { ...params, selectionBounds: params.selectionBounds },\n timeRatio,\n cutoffTime\n );\n }\n }\n\n /**\n * Draw split shadow trapezoids with cutoff\n * @param {Array} individualPoints - Points defining the line\n * @param {Object} params - Rendering parameters\n * @param {number} timeRatio - Position of cutoff in visible range (0-1)\n * @param {number} cutoffTime - Cutoff timestamp\n */\n drawSplitShadowTrapezoids(individualPoints, params, timeRatio, cutoffTime) {\n const { zero, cutoffOpacity, selectionBounds } = params;\n const gl = this._gl;\n\n const renderWidth = gl.canvas.width;\n const cutoffPixelX = timeRatio * renderWidth;\n\n const preCutoffPoints = [];\n const postCutoffPoints = [];\n \n for (let i = 0; i < individualPoints.length; i++) {\n const [pixelX, pixelY] = individualPoints[i];\n \n if (pixelX < cutoffPixelX) {\n preCutoffPoints.push(individualPoints[i]);\n } else {\n postCutoffPoints.push(individualPoints[i]);\n }\n }\n \n let ghostPoint = null;\n if (preCutoffPoints.length > 0 && postCutoffPoints.length > 0) {\n const lastPrePoint = preCutoffPoints[preCutoffPoints.length - 1];\n const firstPostPoint = postCutoffPoints[0];\n \n const [x1, y1] = lastPrePoint;\n const [x2, y2] = firstPostPoint;\n \n if (x2 !== x1) {\n const interpolationRatio = (cutoffPixelX - x1) / (x2 - x1);\n const ghostY = y1 + interpolationRatio * (y2 - y1);\n ghostPoint = [cutoffPixelX, ghostY];\n \n preCutoffPoints.push(ghostPoint);\n postCutoffPoints.unshift(ghostPoint);\n }\n }\n\n if (preCutoffPoints.length >= 2) {\n const reducedOpacityColor = applyReducedOpacity(\n params.color,\n cutoffOpacity\n );\n const gl = this._gl;\n\n gl.disable(gl.DEPTH_TEST);\n\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n\n const translucentGradient = applyReducedOpacityToGradient(\n params.gradient,\n cutoffOpacity\n );\n\n this.draw(preCutoffPoints, {\n ...params,\n color: reducedOpacityColor,\n gradient: translucentGradient,\n renderCutoffGradient: false,\n });\n } else {\n }\n\n if (postCutoffPoints.length >= 2) {\n this.draw(postCutoffPoints, {\n ...params,\n renderCutoffGradient: false,\n });\n } else {\n }\n }\n}\n","import Eventable from '../eventable';\nimport getColor, { createDefaultGradient } from '../helpers/colors';\nimport inferType from '../state/infer_type';\nimport BackgroundProgram from './background_program.js';\nimport drawArea from './draw_area';\nimport drawBackground from './draw_background.js';\nimport drawBars from './draw_bars';\nimport drawLine from './draw_line';\nimport LineProgram from './line_program';\nimport ShadowProgram from './shadow_program';\nimport sizeCanvas, { DPI_INCREASE } from './size_canvas';\n\nexport default class GraphBodyRenderer extends Eventable {\n\n constructor({stateController, canvasElement, webgl=false, checkIntersection=true }) {\n super();\n\n this._stateController = stateController;\n\n this._checkIntersection = checkIntersection;\n this._canvas = canvasElement;\n this._webgl = webgl;\n \n if (!this._canvas) {\n console.error('Canvas element is null in GraphBodyRenderer constructor');\n this._initialized = false;\n return;\n }\n \n if (webgl) {\n this._context = this._canvas.getContext('webgl');\n if (this._context) {\n this._lineProgram = new LineProgram(this._context);\n this._shadowProgram = new ShadowProgram(this._context);\n } else {\n console.error('❌ WebGL context creation failed');\n alert('WebGL failed! Attempting fallback to CPU rendering');\n this._webgl = false;\n }\n }\n\n if (!this._webgl) {\n this._context = this._canvas.getContext('2d');\n this._context2d = this._context;\n }\n\n if (!this._context) {\n console.error('Failed to get canvas context in GraphBodyRenderer');\n this._initialized = false;\n return;\n }\n\n this._initialized = this._initializeCanvas();\n\n this._boundResize = this.resize.bind(this);\n this._cachedAxisCount = null;\n this._onAxisChange = (axes) => {\n const count = axes.filter(({ series }) => series.length > 0).length;\n if (this._cachedAxisCount !== count) {\n this._cachedAxisCount = count;\n this.resize();\n }\n };\n\n stateController.on('axes_changed', this._onAxisChange);\n stateController.on('dragging_y_changed', this._boundResize);\n stateController.on('showing_sidebar_changed', this._boundResize);\n }\n\n /**\n * Cleans up after this renderer\n */\n dispose() {\n this.clearListeners();\n this._lineProgram && this._lineProgram.dispose();\n this._shadowProgram && this._shadowProgram.dispose();\n this._cachedAxisCount = null;\n this._stateController.off('axes_changed', this._onAxisChange);\n this._stateController.off('dragging_y_changed', this._boundResize);\n\n if (this._resizeObserver) {\n this._resizeObserver.disconnect();\n }\n\n if (this._intersectionObserver) {\n this._intersectionObserver.disconnect();\n }\n\n if (this._zeroLineCanvas && this._zeroLineCanvas.parentNode) {\n this._zeroLineCanvas.parentNode.removeChild(this._zeroLineCanvas);\n this._zeroLineCanvas = null;\n this._zeroLineContext = null;\n }\n }\n\n clear() {\n if (this._webgl) {\n this._lineProgram.clear();\n // Also clear the overlay canvas if it exists (for multi shadow charts)\n if (this._overlayContext) {\n this._overlayContext.clearRect(0, 0, this._overlayCanvas.width, this._overlayCanvas.height);\n }\n // Reset the initialization flag so canvas can be resized if needed\n this._overlayCanvasInitialized = false;\n } else {\n this._context.clearRect(0, 0, this._context.canvas.width, this._context.canvas.height);\n }\n }\n\n render(singleSeries, inRenderSpace, { highlighted, showIndividualPoints, shadowColor, shadowBlur, width, defaultLineWidth, bounds, globalBounds, inRenderSpaceAreaBottom }) {\n if (!this._initialized || !this._context || !this._canvas) {\n console.warn('GraphBodyRenderer: Cannot render - not initialized, missing context, or missing canvas');\n return;\n }\n \n let cutoffIndex = -1;\n let cutoffTime = null; \n let cutoffData = singleSeries.data; \n\n const isObjectFormat = singleSeries.data && singleSeries.data.length > 0 && \n typeof singleSeries.data[0] === 'object' && \n !Array.isArray(singleSeries.data[0]);\n \n if (isObjectFormat && singleSeries.cutoffTime) {\n cutoffData = singleSeries.data.map(point => {\n const xValue = point[singleSeries.xKey || 'x'];\n const yValue = point[singleSeries.yKey || 'y'];\n \n const convertedX = typeof xValue === 'string' ? new Date(xValue) : xValue;\n \n return [convertedX, yValue];\n });\n }\n \n if (singleSeries.cutoffTime && singleSeries.data && singleSeries.data.length > 0) {\n let cutoffDate;\n if (singleSeries.cutoffTime === 'now') {\n cutoffDate = new Date();\n } else if (typeof singleSeries.cutoffTime === 'number') {\n cutoffDate = new Date(singleSeries.cutoffTime);\n } else {\n cutoffDate = singleSeries.cutoffTime;\n }\n \n cutoffTime = cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n \n for (let i = 0; i < cutoffData.length - 1; i++) {\n const currentPoint = cutoffData[i];\n const nextPoint = cutoffData[i + 1];\n \n const currentTime = currentPoint[0] instanceof Date ? currentPoint[0].getTime() : currentPoint[0];\n const nextTime = nextPoint[0] instanceof Date ? nextPoint[0].getTime() : nextPoint[0];\n \n if (currentTime <= cutoffTime && cutoffTime <= nextTime) {\n const timeRatio = (cutoffTime - currentTime) / (nextTime - currentTime);\n cutoffIndex = i + timeRatio;\n break;\n } else if (currentTime > cutoffTime) {\n cutoffIndex = i;\n break;\n }\n }\n \n if (cutoffIndex === -1) {\n cutoffIndex = cutoffData.length - 1;\n }\n }\n \n const getIndividualPoints = (useDataSpace, includeBeyondBounds = false) => {\n if (!useDataSpace && inRenderSpace && inRenderSpace.yValues && !showIndividualPoints) {\n if (!bounds) {\n bounds = singleSeries.axis.currentBounds;\n }\n \n const individualPoints = [];\n const { yValues, nullMask } = inRenderSpace;\n const threshold = yValues.length / 2;\n let pastThreshold = 0;\n const samples = [];\n \n for (let pixelX = 0; pixelX < yValues.length; pixelX++) {\n if (nullMask[pixelX] === 0) {\n const xCoord = pixelX * DPI_INCREASE;\n individualPoints.push([xCoord, yValues[pixelX]]);\n \n if (pixelX > threshold) {\n pastThreshold++;\n if (samples.length < 3) samples.push({pixelX, xCoord, nullMask: nullMask[pixelX]});\n }\n }\n }\n \n if (individualPoints.length < 50) {\n return getIndividualPoints(true, includeBeyondBounds);\n }\n\n return individualPoints;\n }\n\n if (!bounds) {\n bounds = singleSeries.axis.currentBounds;\n }\n\n const individualPoints = [];\n let data = singleSeries.inSelectedSpace.data;\n if (useDataSpace) {\n data = singleSeries.inDataSpace;\n }\n\n let boundsMinX = bounds.minX instanceof Date ? bounds.minX.getTime() : bounds.minX;\n let boundsMaxX = bounds.maxX instanceof Date ? bounds.maxX.getTime() : bounds.maxX;\n \n let foundBeyondBounds = false;\n let lastPointBeforeBounds = null;\n \n for (let i = 0; i < data.length; i++) {\n let x, y;\n \n if (Array.isArray(data[i])) {\n [x, y] = data[i];\n } else if (typeof data[i] === 'object' && data[i] !== null) {\n x = data[i][singleSeries.xKey];\n y = data[i][singleSeries.yKey];\n } else {\n continue;\n }\n \n if (y === null || y === undefined) {\n continue;\n }\n\n let xValue = x instanceof Date ? x.getTime() : x;\n \n if (xValue < boundsMinX) {\n if (includeBeyondBounds) {\n lastPointBeforeBounds = [xValue, y];\n }\n continue;\n }\n \n if (xValue > boundsMaxX) {\n if (includeBeyondBounds && !foundBeyondBounds) {\n foundBeyondBounds = true;\n } else {\n break;\n }\n }\n\n const renderWidth = this._sizing.renderWidth / DPI_INCREASE;\n const xCoord = (xValue - boundsMinX) / (boundsMaxX - boundsMinX) * (renderWidth - 1) * DPI_INCREASE;\n const yCoord = (1.0 - (y - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight;\n \n individualPoints.push([xCoord, yCoord]);\n }\n\n if (lastPointBeforeBounds && includeBeyondBounds) {\n const [beforeXValue, beforeY] = lastPointBeforeBounds;\n const renderWidth = this._sizing.renderWidth / DPI_INCREASE;\n const beforeXCoord = (beforeXValue - boundsMinX) / (boundsMaxX - boundsMinX) * (renderWidth - 1) * DPI_INCREASE;\n const beforeYCoord = (1.0 - (beforeY - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight;\n individualPoints.unshift([beforeXCoord, beforeYCoord]);\n }\n\n return individualPoints;\n };\n\n const getRanges = () => {\n if (!bounds) {\n bounds = singleSeries.axis.currentBounds;\n }\n\n if (!singleSeries.rangeKey) {\n return [];\n }\n\n const inferredType = inferType(singleSeries, { useSimpleData: true });\n if (inferredType !== 'objects') {\n return [];\n }\n\n return (singleSeries.simpleData || singleSeries.data).map((object) => {\n const range = object[singleSeries.rangeKey];\n\n if (!range) {\n return null;\n }\n\n const min = range.min;\n const max = range.max;\n const x = object[singleSeries.xKey];\n\n return {\n x,\n range,\n\n pixelX: (x - bounds.minX) / (bounds.maxX - bounds.minX) * this._sizing.renderWidth,\n pixelMinY: typeof min === 'number' ? (1.0 - (min - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight : null,\n pixelMaxY: typeof max === 'number' ? (1.0 - (max - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight : null\n };\n });\n };\n\n const cpuRendering = singleSeries.rendering === 'bar' || singleSeries.rendering === 'area';\n let commonCPUParams;\n\n if (cpuRendering) {\n if (this._webgl) {\n console.warn(`CPU rendering (${singleSeries.rendering}) is not supported with webgl={true}. Use webgl={false} or switch to 'line' rendering.`);\n return;\n }\n \n if (!this._context2d) {\n this._context2d = this._canvas.getContext('2d', { willReadFrequently: false });\n }\n \n if (!this._context2d) {\n console.error('Failed to get 2D context for CPU rendering');\n return;\n }\n\n if (this._webgl) {\n this._context.flush();\n }\n\n if (!bounds) {\n bounds = singleSeries.axis?.currentBounds;\n }\n\n if (!bounds) {\n console.error('No bounds available for rendering');\n return;\n }\n\n const zero = singleSeries.zeroLineY === 'bottom' ?\n this._sizing.renderHeight :\n (1.0 - ((singleSeries.zeroLineY || 0) - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight;\n\n commonCPUParams = {\n context: this._context2d,\n color: getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex),\n sizing: this._sizing,\n zero,\n hasNegatives: !!singleSeries.inDataSpace.find((tuple) => tuple[1] < 0),\n negativeColor: singleSeries.negativeColor,\n zeroWidth: singleSeries.zeroLineWidth,\n zeroColor: singleSeries.zeroLineColor\n };\n\n if (!commonCPUParams.hasNegatives && singleSeries.expandYWith) {\n commonCPUParams.hasNegatives = singleSeries.expandYWith.some((y) => y < 0);\n }\n }\n\n if (singleSeries.rendering === 'bar') {\n let barParams = {\n ...commonCPUParams,\n indexInAxis: singleSeries.axis.series.indexOf(singleSeries),\n axisSeriesCount: singleSeries.axis.series.length,\n closestSpacing: globalBounds.closestSpacing,\n bounds\n };\n\n if (singleSeries.cutoffTime) {\n barParams.cutoffIndex = cutoffIndex;\n barParams.cutoffOpacity = singleSeries.cutoffOpacity !== undefined ? singleSeries.cutoffOpacity : 0.35;\n barParams.originalData = cutoffData;\n barParams.renderCutoffGradient = cutoffIndex >= 0; \n \n const selection = this === this._stateController.rangeGraphRenderer \n ? this._stateController._bounds \n : (this._stateController._selection || this._stateController._bounds);\n barParams.selectionBounds = selection;\n }\n\n drawBars(getIndividualPoints(true), barParams);\n return;\n }\n\n if (singleSeries.rendering === 'area') {\n let areaParams = {\n ...commonCPUParams,\n showIndividualPoints: typeof singleSeries.showIndividualPoints === 'boolean' ? singleSeries.showIndividualPoints : showIndividualPoints,\n gradient: singleSeries.gradient,\n negativeGradient: singleSeries.negativeGradient,\n pointRadius: singleSeries.pointRadius,\n minPointSpacing: singleSeries.minPointSpacing,\n highlighted,\n width: width || singleSeries.width || defaultLineWidth,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom\n };\n\n if (singleSeries.cutoffTime) {\n areaParams.cutoffIndex = cutoffIndex;\n areaParams.cutoffTimeValue = cutoffTime;\n areaParams.cutoffOpacity = singleSeries.cutoffOpacity !== undefined ? singleSeries.cutoffOpacity : 0.35;\n areaParams.originalData = cutoffData;\n areaParams.renderCutoffGradient = cutoffIndex >= 0; \n areaParams.isPreview = this === this._stateController.rangeGraphRenderer; \n \n const selection = this === this._stateController.rangeGraphRenderer \n ? this._stateController._bounds \n : (this._stateController._selection || this._stateController._bounds);\n areaParams.selectionBounds = selection;\n }\n\n drawArea(getIndividualPoints(true), inRenderSpace, areaParams);\n }\n\n if (singleSeries.rendering === 'shadow') {\n if (!this._webgl || !this._shadowProgram) {\n console.warn('Shadow rendering requires WebGL. Enable webgl={true} on your Grapher component.', {\n webgl: !!this._webgl,\n shadowProgram: !!this._shadowProgram,\n program: !!this._shadowProgram?._program\n });\n return;\n }\n \n if (!this._shadowProgram._program) {\n console.error('ShadowProgram has no valid WebGL program');\n return;\n }\n \n if (!inRenderSpace) {\n console.error('inRenderSpace is null for shadow rendering');\n return;\n }\n \n if (!bounds) {\n bounds = singleSeries.axis?.currentBounds;\n }\n \n if (!bounds) {\n console.error('No bounds available for shadow rendering');\n return;\n }\n \n let zero;\n if (singleSeries.zeroLineY === 'bottom') {\n zero = this._sizing.renderHeight;\n } else if (singleSeries.zeroLineY !== undefined) {\n zero = (1.0 - ((singleSeries.zeroLineY) - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight;\n } else {\n if (bounds.minY <= 0 && bounds.maxY >= 0) {\n zero = (1.0 - (0 - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight;\n } else {\n zero = this._sizing.renderHeight;\n }\n }\n \n const boundsChanged = !this._lastBounds || \n bounds.minY !== this._lastBounds.minY || \n bounds.maxY !== this._lastBounds.maxY || \n this._sizing.renderHeight !== this._lastRenderHeight;\n \n this._lastBounds = {...bounds};\n this._lastRenderHeight = this._sizing.renderHeight;\n \n if (boundsChanged && this._lastShadowCache) {\n this._lastShadowCache = null;\n }\n \n if (zero > this._sizing.renderHeight * 1.5) {\n zero = this._sizing.renderHeight;\n } else if (zero < -this._sizing.renderHeight * 0.5) {\n zero = 0;\n }\n \n const shadowColor = getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex);\n const hasNegatives = !!singleSeries.inDataSpace.find((tuple) => tuple[1] < 0);\n let shadowParams = {\n color: shadowColor,\n gradient: singleSeries.gradient || createDefaultGradient(shadowColor),\n negativeGradient: singleSeries.negativeGradient,\n hasNegatives,\n zero,\n sizing: this._sizing,\n inRenderSpaceAreaBottom\n };\n\n if (singleSeries.cutoffTime) {\n shadowParams.cutoffIndex = cutoffIndex;\n shadowParams.cutoffTimeValue = cutoffTime;\n shadowParams.cutoffOpacity = singleSeries.cutoffOpacity !== undefined ? singleSeries.cutoffOpacity : 0.35;\n shadowParams.originalData = cutoffData;\n shadowParams.renderCutoffGradient = cutoffIndex >= 0; \n shadowParams.isPreview = this === this._stateController.rangeGraphRenderer; \n\n const selection = this === this._stateController.rangeGraphRenderer \n ? this._stateController._bounds \n : (this._stateController._selection || this._stateController._bounds);\n shadowParams.selectionBounds = selection || bounds;\n }\n\n this._shadowProgram.draw(getIndividualPoints(false, true), shadowParams);\n \n if (this._webgl) {\n const gl = this._context;\n gl.disable(gl.BLEND);\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n }\n \n if (singleSeries.zeroLineWidth && singleSeries.zeroLineWidth > 0) {\n if (this._context2d) {\n this._context2d.save();\n this._context2d.strokeStyle = singleSeries.zeroLineColor || getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex);\n this._context2d.lineWidth = singleSeries.zeroLineWidth;\n this._context2d.globalCompositeOperation = 'source-over';\n \n this._context2d.beginPath();\n this._context2d.moveTo(0, zero);\n this._context2d.lineTo(this._sizing.renderWidth, zero);\n this._context2d.stroke();\n this._context2d.restore();\n } else {\n if (!this._zeroLineCanvas) {\n this._zeroLineCanvas = document.createElement('canvas');\n this._zeroLineCanvas.style.position = 'absolute';\n this._zeroLineCanvas.style.top = '0';\n this._zeroLineCanvas.style.left = '0';\n this._zeroLineCanvas.style.pointerEvents = 'none';\n this._zeroLineContext = this._zeroLineCanvas.getContext('2d');\n this._canvas.parentNode.insertBefore(this._zeroLineCanvas, this._canvas.nextSibling);\n }\n \n this._zeroLineCanvas.width = this._canvas.width;\n this._zeroLineCanvas.height = this._canvas.height;\n this._zeroLineCanvas.style.width = this._canvas.style.width;\n this._zeroLineCanvas.style.height = this._canvas.style.height;\n \n this._zeroLineContext.clearRect(0, 0, this._zeroLineCanvas.width, this._zeroLineCanvas.height);\n this._zeroLineContext.strokeStyle = singleSeries.zeroLineColor || getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex);\n this._zeroLineContext.lineWidth = singleSeries.zeroLineWidth;\n \n this._zeroLineContext.beginPath();\n this._zeroLineContext.moveTo(0, zero);\n this._zeroLineContext.lineTo(this._sizing.renderWidth, zero);\n this._zeroLineContext.stroke();\n }\n }\n }\n\n const isRangeGraph = this === this._stateController.rangeGraphRenderer;\n const shouldShowIndividualPoints = isRangeGraph \n ? false \n : (typeof singleSeries.showIndividualPoints === 'boolean' ? singleSeries.showIndividualPoints : showIndividualPoints);\n\n if (!bounds) {\n bounds = singleSeries.axis?.currentBounds || globalBounds;\n }\n\n let zero;\n if (singleSeries.zeroLineY === 'bottom') {\n zero = this._sizing.renderHeight;\n } else if (singleSeries.zeroLineY !== undefined && bounds) {\n zero = (1.0 - ((singleSeries.zeroLineY) - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight;\n } else if (bounds) {\n if (bounds.minY <= 0 && bounds.maxY >= 0) {\n zero = (1.0 - (0 - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight;\n } else {\n zero = this._sizing.renderHeight;\n }\n } else {\n zero = this._sizing.renderHeight;\n }\n const hasNegatives = !!singleSeries.inDataSpace.find((tuple) => tuple[1] < 0);\n\n // For WebGL shadow rendering, we need a separate 2D canvas overlay for lines/points\n // since WebGL and 2D contexts can't coexist on the same canvas\n let drawContext = this._context;\n \n if (this._webgl && singleSeries.rendering === 'shadow') {\n // Always create overlay for shadow charts since they need 2D context for drawLine\n if (!this._overlayCanvas) {\n this._overlayCanvas = document.createElement('canvas');\n this._overlayCanvas.style.position = 'absolute';\n this._overlayCanvas.style.top = '0';\n this._overlayCanvas.style.left = '0';\n this._overlayCanvas.style.pointerEvents = 'none';\n this._overlayContext = this._overlayCanvas.getContext('2d');\n this._canvas.parentNode.insertBefore(this._overlayCanvas, this._canvas.nextSibling);\n }\n \n // Size the overlay canvas to match the main canvas (only once when creating)\n if (!this._overlayCanvasInitialized) {\n this._overlayCanvas.width = this._canvas.width;\n this._overlayCanvas.height = this._canvas.height;\n this._overlayCanvas.style.width = this._canvas.style.width;\n this._overlayCanvas.style.height = this._canvas.style.height;\n this._overlayCanvasInitialized = true;\n }\n drawContext = this._overlayContext;\n } else if (this._context2d) {\n // For non-WebGL or non-shadow charts with 2D context\n drawContext = this._context2d;\n } else if (this._webgl) {\n // Fallback for WebGL: create a temporary context for drawing lines\n console.warn('Creating fallback 2D context for WebGL shadow chart');\n if (!this._fallbackContext) {\n const fallbackCanvas = document.createElement('canvas');\n fallbackCanvas.width = this._canvas.width;\n fallbackCanvas.height = this._canvas.height;\n this._fallbackContext = fallbackCanvas.getContext('2d');\n }\n drawContext = this._fallbackContext;\n }\n\n const drawParams = {\n color: getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex),\n context: drawContext,\n width: width || singleSeries.width || defaultLineWidth,\n shadowColor,\n shadowBlur,\n dashed: singleSeries.dashed,\n dashPattern: singleSeries.dashPattern,\n highlighted,\n showIndividualPoints: shouldShowIndividualPoints,\n pointRadius: singleSeries.pointRadius,\n minPointSpacing: singleSeries.minPointSpacing,\n getIndividualPoints,\n getRanges: singleSeries.rangeKey ? getRanges : null,\n rendering: singleSeries.rendering, // Pass rendering type for all charts\n negativeColor: singleSeries.negativeColor,\n hasNegatives,\n zero,\n zeroColor: singleSeries.zeroLineColor\n };\n \n if (this._webgl && singleSeries.rendering === 'shadow' && singleSeries.cutoffTime && (width > 0 || shouldShowIndividualPoints)) {\n drawParams.cutoffIndex = cutoffIndex;\n drawParams.cutoffTimeValue = cutoffTime;\n drawParams.cutoffOpacity = singleSeries.cutoffOpacity !== undefined ? singleSeries.cutoffOpacity : 0.35;\n drawParams.originalData = cutoffData;\n drawParams.renderCutoffGradient = cutoffIndex >= 0;\n \n const selection = this === this._stateController.rangeGraphRenderer \n ? this._stateController._bounds \n : (this._stateController._selection || this._stateController._bounds);\n drawParams.selectionBounds = selection || bounds;\n drawParams.currentBounds = bounds;\n }\n \n\n if (!inRenderSpace) {\n console.error('inRenderSpace is null for line rendering');\n return;\n }\n \n if (singleSeries.cutoffTime) {\n drawParams.cutoffIndex = cutoffIndex;\n drawParams.cutoffTimeValue = cutoffTime; \n drawParams.cutoffOpacity = singleSeries.cutoffOpacity !== undefined ? singleSeries.cutoffOpacity : 0.35;\n drawParams.originalData = cutoffData;\n drawParams.renderCutoffGradient = cutoffIndex >= 0;\n drawParams.currentBounds = bounds;\n drawParams.isPreview = this === this._stateController.rangeGraphRenderer;\n \n const selection = this === this._stateController.rangeGraphRenderer \n ? this._stateController._bounds \n : (this._stateController._selection || this._stateController._bounds);\n drawParams.selectionBounds = selection || bounds;\n }\n \n // For shadow rendering, always use 2D canvas for lines/points even with WebGL\n // This is because shadow uses WebGL for the fill but needs 2D canvas for lines/points\n // to support negativeColor and other features\n if (this._webgl && singleSeries.rendering !== 'shadow') {\n this._lineProgram.draw(inRenderSpace, drawParams);\n } else {\n drawLine(inRenderSpace, drawParams);\n }\n \n }\n\n renderBackground(inBackgroundSpace) {\n if (!inBackgroundSpace) {\n return;\n }\n\n if (this._webgl) {\n if (!this._backgroundProgram) {\n this._backgroundProgram = new BackgroundProgram(this._context);\n }\n \n this._backgroundProgram.draw(inBackgroundSpace);\n } else {\n drawBackground(inBackgroundSpace, {\n context: this._context\n });\n }\n }\n\n /**\n * Initializes canvas\n * Currently, just sets sizing\n */\n async _initializeCanvas() {\n this._sizing = await sizeCanvas(this._canvas, this._context);\n\n this.emit('size_changed', this._sizing);\n this._stateController.markSizeChanged();\n\n if (window.ResizeObserver) {\n let first = true;\n let disabled = false;\n\n this._resizeObserver = new window.ResizeObserver( () => {\n if (first) { // always fires once at the beginning\n first = false;\n return;\n }\n\n if (disabled) {\n return;\n }\n\n disabled = true;\n this.resize().then(() => {\n disabled = false;\n });\n });\n\n this._resizeObserver.observe(this._canvas.parentNode);\n }\n\n if (this._checkIntersection && window.IntersectionObserver) {\n this._intersectionObserver = new window.IntersectionObserver((entries) => {\n clearTimeout(this._intersectionTimeout);\n\n if (!entries[0].isIntersecting) {\n return;\n }\n\n this._intersectionTimeout = setTimeout(() => {\n this.resize();\n }, 50);\n }, {\n threshold: 0.1\n });\n\n this._intersectionObserver.observe(this._canvas.parentNode);\n }\n }\n\n async resize() {\n const sizingPromise = sizeCanvas(this._canvas, this._context, { reset: true });\n this._initialized = sizingPromise;\n\n this._sizing = await this._initialized;\n if (this._initialized !== sizingPromise) {\n return;\n }\n\n this.emit('size_changed', this._sizing);\n this._stateController.markSizeChanged(this);\n }\n\n resizeDebounced() {\n if (this._resizeTimeout) {\n clearTimeout(this._resizeTimeout);\n }\n\n this._resizeTimeout = setTimeout(() => {\n this.resize();\n this._resizeTimeout = null;\n }, 50);\n }\n\n recalculatePosition() {\n if (!this._sizing) {\n return;\n }\n\n this._sizing.boundingRect = this._canvas.getBoundingClientRect();\n }\n\n /**\n * Returns the bounding rect of the element\n *\n * @return {DOMRect}\n */\n get boundingRect() {\n return this._sizing?.boundingRect;\n }\n\n get sizing() {\n return this._sizing;\n }\n\n}\n","/**\n * Draws the background on a 2d canvas\n *\n * @param {Array<{ minXt: number, maxXt: number, color: string }>} data\n * @param {CanvasRenderingContext2D} context\n */\nexport default function drawBackground({ data }, { context }) {\n if (!context) {\n console.error('Canvas context is null in drawBackground');\n return;\n }\n \n const width = context.canvas.width;\n const height = context.canvas.height;\n\n for (let { minXt, maxXt, color } of data) {\n context.fillStyle = color;\n context.fillRect(minXt*width, 0, (maxXt - minXt)*width, height);\n }\n}\n","export function calculatePrecision(value) {\n return Math.max(-Math.log10(Math.abs(value)) + 2, 0);\n}\n\nexport function calculateTimePrecision(minDate, maxDate) {\n minDate = new Date(minDate);\n maxDate = new Date(maxDate);\n\n const range = maxDate.valueOf() - minDate.valueOf();\n if (range < 3*1000) {\n return 'ms';\n } else if (range < 10*60*1000) {\n return 's';\n } else {\n return 'm';\n }\n}\n\nexport function roundToPrecision(value, precision=null) {\n if (precision === null) {\n precision = calculatePrecision(value);\n }\n\n if (isNaN(precision) || precision > 100) {\n return value.toString();\n }\n\n const rounded = value.toFixed(Math.ceil(precision));\n let stripped = rounded;\n if (rounded.includes('.')) {\n stripped = stripped.replace(/\\.?0+$/g, '');\n }\n\n if (stripped === '') {\n return '0';\n }\n\n return stripped;\n}\n\nconst DATE_TIME_FORMATTERS = {};\n\n/**\n * Given a timezone string, gets the offset relative to utc in milliseconds\n * For example, America/New_York in winter is GMT-05:00, so it evaluates to -5*60*60*1000\n *\n * @param {String} timeZone - the time zone string\n * @param {Date} sampleDate - a date to use in the conversions, since it can be time-of-year dependent with Daylight Savings Time\n * @return {number|null}\n */\nexport function timezoneToOffsetMS(timeZone, sampleDate) {\n try { // formats are finicky, so give up rather than abort rendering\n let datetimeFormatter = DATE_TIME_FORMATTERS[timeZone];\n if (!datetimeFormatter) {\n let properTimeZone = timeZone;\n if (!timeZone || timeZone === 'local') {\n properTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n datetimeFormatter = new Intl.DateTimeFormat('en-US', {\n timeZone: properTimeZone,\n timeZoneName: 'longOffset'\n });\n DATE_TIME_FORMATTERS[timeZone] = datetimeFormatter;\n }\n\n const parts = datetimeFormatter.formatToParts(sampleDate);\n const offsetPart = parts.find(part => part.type === 'timeZoneName');\n\n if (!offsetPart) {\n return null;\n }\n\n if (offsetPart.value === 'GMT') {\n return 0;\n }\n\n if (!/^GMT[+-]\\d{2}:\\d{2}$/.test(offsetPart.value)) {\n return null;\n }\n\n const [hours, minutes] = offsetPart.value.slice(3).split(':');\n\n return parseInt(hours)*60*60*1000 + parseInt(minutes)*60*1000;\n } catch (e) {\n console.error(new Error(`Could not parse timezone offset for ${sampleDate} in ${timeZone}`)); // eslint-disable-line no-console\n console.error(e); // eslint-disable-line no-console\n return null;\n }\n}\n\n/**\n * Gets the Date object that represents the start of day in a given timezone\n * Note that this is still a native date object, so it will be in the local timezone\n * Its timestamp, however, will correspond to the start of the day in the given timezone\n *\n * @param date\n * @param timezone\n * @return {Date}\n */\nexport function startOfDayInTimezone(date, timezone) {\n if (!timezone) {\n const startOfDay = new Date(date);\n startOfDay.setHours(0, 0, 0, 0);\n return startOfDay;\n }\n\n const offset = timezoneToOffsetMS(timezone, date); // ms between timezone and utc\n let startOfDay = new Date(date);\n startOfDay.setUTCHours(0, 0, 0, 0);\n\n const difference = startOfDay.valueOf() - date.valueOf();\n\n // if we would have gone forward a day when offset is taken into account, we need to go back a day again\n if (difference > offset) {\n startOfDay = new Date(startOfDay.valueOf() - 24*60*60*1000);\n }\n\n return new Date(startOfDay.valueOf() - offset);\n}\n\nfunction formatTime(time, {precision, justTime, justDate, justMonthAndDay, unitOverride, clockStyle='24h', timeZone}) {\n const utc = timeZone && timeZone.toLowerCase() === 'utc';\n if (timeZone && !utc && timeZone !== 'local' && window.Intl && window.Intl.DateTimeFormat) {\n const offset = timezoneToOffsetMS(timeZone, time);\n const localOffset = timezoneToOffsetMS('local', time);\n\n if (typeof offset === 'number' && typeof localOffset === 'number') {\n time = new Date(time.valueOf() + offset - localOffset);\n }\n }\n\n const year = utc ? time.getUTCFullYear() : time.getFullYear();\n const month = (utc ? time.getUTCMonth() : time.getMonth()) + 1;\n const day = utc ? time.getUTCDate() : time.getDate();\n\n if (unitOverride === 'year') {\n return year.toString();\n }\n\n if (justDate) {\n return utc ? `${month}/${day}/${year}` : time.toLocaleDateString();\n }\n\n if (justMonthAndDay) {\n // eg Jan 19\n const monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n return `${monthNames[month - 1]} ${day}`;\n }\n\n const hours = utc ? time.getUTCHours() : time.getHours();\n const minutes = utc ? time.getUTCMinutes() : time.getMinutes();\n const seconds = utc ? time.getUTCSeconds() : time.getSeconds();\n const milliseconds = utc ? time.getUTCMilliseconds() : time.getMilliseconds();\n\n let timeString;\n\n if (clockStyle === '12h') {\n timeString = `${((hours + 11) % 12 + 1).toString()}:${minutes.toString().padStart(2, '0')}`;\n } else {\n timeString = `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}`;\n }\n\n if (precision === 's' || precision === 'ms') {\n timeString += `:${seconds.toString().padStart(2, '0')}`;\n }\n\n if (precision === 'ms') {\n timeString += `.${milliseconds.toString().padStart(3, '0')}`;\n }\n\n if (clockStyle === '12h') {\n timeString += hours >= 12 ? 'pm' : 'am';\n }\n\n if (justTime) {\n return timeString;\n }\n\n if (utc) {\n timeString += ' UTC';\n }\n\n return (utc ? `${month}/${day}/${year}` : time.toLocaleDateString()) + ' ' + timeString;\n}\n\nexport function formatX(x, {dates=false, precision=null, justTime=false, justDate=false, justMonthAndDay=false, clockStyle='24h', unitOverride, timeZone, integersOnly=false, inverseEnumMap}={}) {\n if (dates && !(x instanceof Date)) {\n x = new Date(x);\n\n if (isNaN(x)) {\n return 'Invalid Date';\n }\n }\n\n if (x instanceof Date) {\n return formatTime(x, {precision, justTime, justDate, justMonthAndDay, unitOverride, clockStyle, timeZone});\n }\n\n if (isNaN(x)) {\n return 'NaN';\n }\n\n if (inverseEnumMap) {\n if (Math.abs(x - Math.round(x)) > 1e-10) {\n return '';\n }\n\n return inverseEnumMap[Math.round(x)];\n }\n\n if (integersOnly && Math.abs(x - Math.round(x)) > 1e-10) {\n return '';\n }\n\n return roundToPrecision(x, precision);\n}\n\nexport function formatY(y, {precision=null, log=false}={}) {\n if (y === null) {\n return 'null';\n }\n\n if (isNaN(y)) {\n return 'NaN';\n }\n\n if (log) {\n return `10^${roundToPrecision(Math.log10(y), precision)}`;\n }\n\n return roundToPrecision(y, precision);\n}\n","export const Y_AXIS_WIDTH = 32;\nexport const BIG_Y_AXIS_LABEL_OFFSET = 20;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport {formatX, formatY} from '../helpers/format';\nimport {Y_AXIS_WIDTH} from '../helpers/axis_sizes';\nimport CustomPropTypes from '../helpers/custom_prop_types';\n\nfunction getYLabelContent({ yLabel, y, fullYPrecision}) {\n if (fullYPrecision && !yLabel) {\n if (y === undefined) {\n return 'undefined';\n }\n\n if (y === null) {\n return 'null';\n }\n\n return y.toString();\n }\n\n if (typeof yLabel === 'number') {\n if (fullYPrecision) {\n return yLabel.toString();\n } else {\n return formatY(yLabel);\n }\n }\n\n if (typeof yLabel === 'object') {\n return formatY(y);\n }\n\n return yLabel || formatY(y);\n}\n\nfunction TooltipLabel({ axisLabel, x, y, xLabel, yLabel, textLeft, textTop, includeSeriesLabel, includeXValue, includeYValue, includeXLabel, includeYLabel, fullYPrecision, formatXOptions }) {\n let i = 0;\n\n return (\n <g>\n {\n includeSeriesLabel &&\n <text x={textLeft} y={textTop + (i++)*12}>\n {axisLabel}\n </text>\n }\n\n {\n includeXValue &&\n <text x={textLeft} y={textTop + (i++) * 12}>\n {includeXLabel && 'x: '}{xLabel || formatX(x, formatXOptions)}\n </text>\n }\n\n {\n includeYValue &&\n <text x={textLeft} y={textTop + (i++) * 12}>\n {includeYLabel && 'y: '}{getYLabelContent({ yLabel, y, fullYPrecision})}\n </text>\n }\n </g>\n );\n}\n\nTooltipLabel.propTypes = {\n axisLabel: PropTypes.string,\n x: PropTypes.oneOfType([PropTypes.number, PropTypes.instanceOf(Date)]),\n y: PropTypes.number,\n xLabel: PropTypes.string,\n yLabel: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n textLeft: PropTypes.number.isRequired,\n textTop: PropTypes.number.isRequired,\n fullYPrecision: PropTypes.bool,\n formatXOptions: PropTypes.object,\n ...CustomPropTypes.TooltipOptionsRaw\n};\n\nexport default class Tooltip extends React.PureComponent {\n\n render() {\n const textPadding = 3;\n let height = 12*3 + 2*textPadding;\n\n if (!this.props.includeSeriesLabel) {\n height -= 12;\n }\n\n if (!this.props.includeXValue) {\n height -= 12;\n }\n\n if (!this.props.includeYValue) {\n height -= 12;\n }\n\n const caretSize = 7;\n const halfHeight = height/2;\n const caretPadding = 4;\n\n const textTop = -halfHeight + textPadding;\n\n const formatXOptions = {\n clockStyle: this.props.clockStyle,\n timeZone: this.props.timeZone\n };\n\n const passThroughProps = {\n includeSeriesLabel: this.props.includeSeriesLabel,\n includeXLabel: this.props.includeXLabel,\n includeYLabel: this.props.includeYLabel,\n includeXValue: this.props.includeXValue,\n includeYValue: this.props.includeYValue,\n formatXOptions\n };\n\n const preparedTooltips = this.props.tooltips.map((tooltip) => {\n const { x, y, pixelY, tooltipPixelY, pixelX, series, index, xLabel, yLabel, fullYPrecision } = tooltip;\n\n if (typeof pixelX !== 'number') {\n return null;\n }\n\n const axisLabel = (series.name || series.yKey || index).toString();\n let width = Math.max(axisLabel.length, (xLabel || formatX(x, formatXOptions)).length + 4, getYLabelContent({ yLabel, y, fullYPrecision}).length + 4) * 7.5;\n if (series.tooltipWidth) {\n width = series.tooltipWidth;\n }\n\n let fixedPosition = this.props.elementWidth < (width + 2*caretSize + 2*caretPadding);\n\n let multiplier = 1;\n if (pixelX >= this.props.elementWidth - (width + 2*caretSize + caretPadding)) {\n multiplier = -1;\n }\n\n if (pixelX < width + 2*caretSize + caretPadding && multiplier === -1) {\n fixedPosition = true;\n }\n\n if (y === null) {\n fixedPosition = true;\n }\n\n if (this.props.alwaysFixedPosition) {\n fixedPosition = true;\n }\n\n let textLeft = caretSize + caretPadding;\n if (multiplier < 0) {\n textLeft = -width - textLeft;\n } else {\n textLeft += 6;\n }\n\n if (!isFinite(pixelX)) {\n return null;\n }\n\n const markerTransform = `translate(${pixelX},${pixelY})`;\n const tooltipTransform = `translate(${pixelX},${tooltipPixelY ?? pixelY})`;\n\n const commonLabelProps = {\n fullYPrecision: fullYPrecision || this.props.maxPrecision,\n x,\n y,\n axisLabel,\n xLabel,\n yLabel,\n ...passThroughProps\n };\n\n let yTranslation = 0;\n let baseLeft;\n\n if (fixedPosition) {\n textLeft = 6;\n\n baseLeft = this.props.elementWidth / 2 - width / 2;\n\n if (width > this.props.elementWidth && !this.props.floating) {\n baseLeft -= Y_AXIS_WIDTH * this.props.axisCount / 2;\n }\n\n yTranslation = 18;\n\n if (this.props.floating) {\n if (this.props.floatPosition === 'bottom') {\n yTranslation = this.props.elementHeight + halfHeight + 4;\n } else {\n yTranslation = -height;\n }\n\n if (this.props.floatDelta) {\n yTranslation += this.props.floatDelta;\n }\n }\n }\n\n return {\n ...tooltip,\n label: axisLabel,\n indexInAxis: series?.axis?.series?.indexOf(series),\n axisLabel,\n width,\n fixedPosition,\n multiplier,\n textLeft,\n markerTransform,\n tooltipTransform,\n commonLabelProps,\n textTop,\n height,\n caretSize,\n halfHeight,\n caretPadding,\n yTranslation,\n baseLeft\n };\n }).filter(Boolean);\n\n const CustomTooltipComponent = this.props.customTooltip;\n\n let groupedTooltips;\n if (this.props.combineTooltips) {\n let combinationThreshold = 50; // in px how close tooltips should be to combine\n if (typeof this.props.combineTooltips === 'number') {\n combinationThreshold = this.props.combineTooltips;\n }\n\n groupedTooltips = [];\n\n for (let tooltip of preparedTooltips) {\n let added = false;\n for (let group of groupedTooltips) {\n if (Math.abs(group.pixelX - tooltip.pixelX) <= combinationThreshold) {\n group.tooltips.push(tooltip);\n if (tooltip.pixelX > group.pixelX) {\n group.pixelX = tooltip.pixelX;\n group.multiplier = tooltip.multiplier;\n }\n\n if (tooltip.pixelY < group.pixelY) {\n group.pixelY = tooltip.pixelY;\n }\n\n if (tooltip.tooltipPixelY !== undefined && (group.tooltipPixelY === undefined || tooltip.tooltipPixelY < group.tooltipPixelY)) {\n group.tooltipPixelY = tooltip.tooltipPixelY;\n }\n\n added = true;\n break;\n }\n }\n\n if (!added) {\n groupedTooltips.push({\n pixelX: tooltip.pixelX,\n pixelY: tooltip.pixelY,\n tooltipPixelY: tooltip.tooltipPixelY,\n multiplier: tooltip.multiplier,\n tooltips: [tooltip]\n });\n }\n }\n\n for (let group of groupedTooltips) {\n let totalHeight = 0;\n let maxWidth = 0;\n\n // sort by indexInAxis\n group.tooltips.sort((a, b) => a.indexInAxis - b.indexInAxis);\n\n for (let i = 0; i < group.tooltips.length; i++) {\n group.tooltips[i].textTop = totalHeight;\n totalHeight += group.tooltips[i].height;\n maxWidth = Math.max(maxWidth, group.tooltips[i].width);\n }\n\n for (let i = 0; i < group.tooltips.length; i++) {\n group.tooltips[i].textTop -= totalHeight/2;\n group.tooltips[i].textTop += textPadding;\n }\n\n group.height = totalHeight;\n group.halfHeight = totalHeight / 2;\n group.caretSize = caretSize;\n group.width = maxWidth;\n }\n }\n\n return (\n <div className=\"grapher-tooltip\">\n <svg>\n {\n preparedTooltips.map((tooltip, i) => {\n const { color, fixedPosition, width, markerTransform, tooltipTransform, baseLeft, commonLabelProps, yTranslation, multiplier, textLeft, textTop } = tooltip;\n\n if (this.props.customTooltip || groupedTooltips) {\n return (\n <g key={i} transform={markerTransform} className=\"tooltip-item\">\n <circle r={4} fill={color}/>\n </g>\n );\n }\n\n // display in a fixed position if not wide enough\n if (fixedPosition) {\n return (\n <g key={i} className=\"tooltip-item tooltip-item-fixed\">\n <circle r={4} fill={color} transform={markerTransform} />\n\n <g transform={`translate(${baseLeft}, ${yTranslation})`}>\n <path stroke={color} d={`M0,0 V-${halfHeight} h${width} V${halfHeight} h${-width} V0`} />\n\n <TooltipLabel\n textLeft={textLeft} textTop={textTop}\n {...commonLabelProps}\n />\n </g>\n </g>\n );\n }\n\n return (\n <g key={i} className=\"tooltip-item\">\n <circle r={4} fill={color} transform={markerTransform} />\n\n <g transform={tooltipTransform}>\n <path stroke={color} d={`M${multiplier*caretPadding},0 L${multiplier*caretSize*2},-${caretSize} V-${halfHeight} h${multiplier*width} V${halfHeight} h${multiplier*-width} V${caretSize} L${multiplier*caretPadding},0`} />\n\n <TooltipLabel\n textLeft={textLeft} textTop={textTop}\n {...commonLabelProps}\n />\n </g>\n </g>\n );\n })\n }\n\n {\n !this.props.customTooltip && groupedTooltips &&\n groupedTooltips.map(({ tooltips, pixelX, pixelY, halfHeight, multiplier, color, width }, i) =>\n <g key={i} transform={`translate(${pixelX},${pixelY})`} className=\"tooltip-item\">\n <path stroke={color} d={`M${multiplier*caretPadding},0 L${multiplier*caretSize*2},-${caretSize} V-${halfHeight} h${multiplier*width} V${halfHeight} h${multiplier*-width} V${caretSize} L${multiplier*caretPadding},0`} />\n\n {\n tooltips.map((tooltip, j) =>\n <TooltipLabel\n key={j}\n textTop={tooltip.textTop}\n textLeft={tooltip.textLeft}\n {...tooltip.commonLabelProps}\n />\n )\n }\n </g>\n )\n }\n </svg>\n\n {\n this.props.customTooltip &&\n (groupedTooltips || preparedTooltips).map((tooltip, i) =>\n <div\n key={i}\n className=\"custom-tooltip-container\"\n style={{top: tooltip.tooltipPixelY ?? tooltip.pixelY, left: tooltip.pixelX}}\n >\n <CustomTooltipComponent {...tooltip} />\n </div>\n )\n }\n </div>\n );\n }\n\n}\n\nTooltip.defaultProps = {\n includeSeriesLabel: true,\n includeXLabel: true,\n includeYLabel: true,\n includeXValue: true,\n includeYValue: true\n};\n\nTooltip.propTypes = {\n mouseX: PropTypes.number.isRequired,\n mouseY: PropTypes.number.isRequired,\n elementHeight: PropTypes.number.isRequired,\n elementWidth: PropTypes.number.isRequired,\n tooltips: PropTypes.arrayOf(PropTypes.shape({\n x: PropTypes.oneOfType([PropTypes.number, PropTypes.instanceOf(Date)]),\n y: PropTypes.number,\n pixelY: PropTypes.number,\n color: PropTypes.string,\n xLabel: PropTypes.string,\n yLabel: PropTypes.any,\n fullYPrecision: PropTypes.bool\n })),\n axisCount: PropTypes.number.isRequired,\n maxPrecision: PropTypes.bool.isRequired,\n clockStyle: PropTypes.oneOf(['12h', '24h']),\n timeZone: PropTypes.string,\n ...CustomPropTypes.TooltipOptionsRaw\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nexport default class ContextMenu extends React.PureComponent {\n constructor(props) {\n super(props);\n this.setTextRef = this.setTextRef.bind(this);\n }\n \n setTextRef(ref) {\n this.textRef = ref;\n\n if (this.props.contextMenu.showing && this.textRef) {\n const range = document.createRange();\n const selection = window.getSelection();\n\n selection.removeAllRanges();\n\n range.selectNodeContents(this.textRef);\n selection.addRange(range);\n this.textRef.focus();\n }\n }\n \n formatDateTime(dateTimeStr) {\n const [datePart, timePart] = dateTimeStr.split(', ');\n\n const [month, day, year] = datePart.split('/');\n const formattedDate = `${month.padStart(2, '0')}/${day.padStart(2, '0')}/${year}`;\n\n const [time, period] = timePart.split(' ');\n const [hours, minutes] = time.split(':');\n const formattedHours = hours.padStart(2, '0');\n const formattedTime = `${formattedHours}:${minutes} ${period}`;\n\n return `${formattedDate} ${formattedTime}`;\n }\n \n render() {\n const { x, y, showing, value } = this.props.contextMenu;\n\n const style = { left: x, top: y, width: '150px'};\n \n if (!showing || !value || value.toLocaleString() === 'Invalid Date' || isNaN(x) || isNaN(y)) {\n return null;\n }\n\n const displayValue = value instanceof Date ? this.formatDateTime(value.toLocaleString()) : value;\n return (\n <div className=\"grapher-context-menu\" style={style}>\n <div className=\"menu-item\">\n <div className=\"menu-text\" autoFocus={true} ref={this.setTextRef}>\n {displayValue}\n </div>\n </div>\n </div>\n );\n }\n\n}\n\nContextMenu.propTypes = {\n contextMenu: PropTypes.shape({\n x: PropTypes.number,\n y: PropTypes.number,\n showing: PropTypes.bool,\n value: PropTypes.oneOfType([\n PropTypes.instanceOf(Date),\n PropTypes.number,\n PropTypes.object\n ])\n }).isRequired\n};\n","import inferType from '../infer_type';\nimport { SIMPLE_DATA_TYPES } from '../data_types';\n\n/**\n * Given a series of a simple type (ie, not a function or an observable), converts it into data space\n *\n * @param {*} singleSeries\n * @param {Object} options\n * @return {*}\n */\nexport default function simpleSeriesToDataSpace(singleSeries, options={}) {\n const type = inferType(singleSeries, { useSimpleData: true, data: options.data });\n if (!SIMPLE_DATA_TYPES.includes(type)) {\n throw new Error(`Cannot normalize ${type} (expected a simple type)`);\n }\n\n const result = {\n tuples: tuplesToDataSpace,\n values: valuesToDataSpace,\n objects: objectsToDataSpace\n }[type](options.data || singleSeries.simpleData || singleSeries.data, singleSeries, options);\n\n let inDataSpace;\n let rangeValues = [];\n let windDirections = null;\n let windData = null;\n\n if (Array.isArray(result)) {\n inDataSpace = result;\n } else {\n inDataSpace = result.data;\n rangeValues = result.rangeValues || [];\n windDirections = result.windDirections || null;\n windData = result.windData || null;\n }\n\n if (singleSeries.square) {\n const square = [];\n let prevY = options.prevY;\n for (let tuple of inDataSpace) {\n if (prevY !== undefined) {\n square.push([tuple[0], prevY]);\n }\n square.push(tuple);\n prevY = tuple[1];\n }\n\n return square;\n }\n\n if (singleSeries.shiftXBy) {\n for (let tuple of inDataSpace) {\n if (typeof tuple[0] === 'string') {\n const originalXValue = tuple[0];\n tuple[0] = new Date(new Date(tuple[0]).valueOf() + singleSeries.shiftXBy);\n if (isNaN(tuple[0])) {\n tuple[0] = options.stateController.enumToNumber(originalXValue, singleSeries);\n }\n } else if (tuple[0] instanceof Date) {\n tuple[0] = new Date(tuple[0].valueOf() + singleSeries.shiftXBy);\n } else if (typeof tuple[0] === 'number') {\n tuple[0] += singleSeries.shiftXBy;\n }\n }\n }\n\n if (singleSeries.xUnixDates) {\n for (let tuple of inDataSpace) {\n if (typeof tuple[0] === 'number') {\n tuple[0] = new Date(tuple[0]*1000);\n }\n }\n }\n\n if (rangeValues.length > 0 || windDirections) {\n return {\n data: inDataSpace,\n rangeValues: rangeValues,\n windDirections: windDirections,\n windData: windData\n };\n }\n\n return inDataSpace;\n}\n\n/**\n * Converts a values array to data space\n *\n * @param {Array<Number|String>} data\n * @param {Object} singleSeries\n * @param {Object} options\n * @param {Number} [options.valueXStart]\n * @param {StateController} options.stateController\n * @return {Array<Array<Number|Date|null>>}\n */\nfunction valuesToDataSpace(data, singleSeries, options) {\n const inDataSpace = [];\n\n for (let i = 0; i < data.length; i++) {\n let yValue = data[i];\n\n if (typeof yValue === 'string') {\n yValue = options.stateController.enumToNumber(yValue, singleSeries);\n }\n\n if (typeof yValue === 'boolean') {\n yValue = +yValue;\n }\n\n inDataSpace.push([i + (options.valueXStart || 0), yValue]);\n }\n\n return inDataSpace;\n}\n\n/**\n * Converts a tuples array to data space\n *\n * @param {Array<Array<Number|Date|null>>} data\n * @param {Object} singleSeries\n * @param {Object} options\n * @param {StateController} options.stateController\n * @return {Array<Array<Number|Date|null>>}\n */\nfunction tuplesToDataSpace(data, singleSeries, options) {\n return [...data.map(([ xValue, yValue]) => {\n if (yValue === undefined) {\n yValue = null;\n }\n\n if (typeof xValue === 'string') {\n const originalXValue = xValue;\n xValue = new Date(xValue);\n\n if (isNaN(xValue)) {\n xValue = options.stateController.enumToNumber(originalXValue, singleSeries, true);\n }\n }\n\n if (typeof yValue === 'string') {\n yValue = options.stateController.enumToNumber(yValue, singleSeries);\n }\n\n if (typeof yValue === 'boolean') {\n yValue = +yValue;\n }\n\n return [xValue, yValue];\n })];\n}\n\nfunction readBinaryFormatValue(view, offset, index) {\n const localOffset = view.getUint32(offset + 2 + Uint32Array.BYTES_PER_ELEMENT*index, true);\n\n if (localOffset === 0) {\n return null;\n }\n\n const type = view.getUint8(localOffset);\n\n if (type === 0) {\n return view.getFloat64(offset + localOffset + 1, true);\n } else if (type === 1 || type === 6) {\n return null;\n } else if (type === 3) {\n return new Date(view.getFloat64(offset + localOffset + 1, true));\n } else {\n throw new Error(`Binary format type ${type} not supported`);\n }\n}\n\n/**\n * Converts an objects array to data space\n *\n * @param {Array<Object>} data\n * @param {Object} series\n * @param {Object} options\n * @param {StateController} options.stateController\n * @return {Array<Array<Number|Date|null>>}\n */\nfunction objectsToDataSpace(data, series, options) {\n const hasWindKeys = series.windXKey && series.windYKey;\n\n if (!series.xKey || typeof series.xKey !== 'string') {\n throw new Error('xKey must be provided in the series');\n }\n\n if (!hasWindKeys && (!series.yKey || typeof series.yKey !== 'string')) {\n throw new Error('yKey must be provided in the series (or both windXKey and windYKey)');\n }\n\n const inDataSpace = [];\n const rangeValues = [];\n const windDirections = hasWindKeys ? [] : null;\n const windData = hasWindKeys ? [] : null;\n\n for (let point of data) {\n if (point.buffer instanceof ArrayBuffer) {\n const view = new DataView(point.buffer);\n const xIndex = point.channels[series.xKey];\n const yIndex = point.channels[series.yKey];\n\n for (let offset of point.offsets) {\n inDataSpace.push([readBinaryFormatValue(view, offset, xIndex), readBinaryFormatValue(view, offset, yIndex)]);\n }\n } else if (!hasWindKeys && Array.isArray(point[series.yKey])) {\n if (point[series.yKey].length && !Array.isArray(point[series.yKey][0]) && typeof point[series.yKey][0] === 'object') {\n for (let subpoint of point[series.yKey]) {\n let yValue = subpoint[series.yKey];\n if (yValue === undefined) {\n yValue = null;\n }\n\n if (typeof yValue === 'string') {\n yValue = options.stateController.enumToNumber(yValue, series);\n }\n\n if (typeof yValue === 'boolean') {\n yValue = +yValue;\n }\n\n let xValue = subpoint[series.xKey];\n if (typeof xValue === 'string') {\n xValue = new Date(xValue);\n }\n\n inDataSpace.push([xValue, yValue]);\n }\n } else {\n inDataSpace.push(...point[series.yKey]);\n }\n } else {\n let yValue;\n if (hasWindKeys) {\n const windX = point[series.windXKey];\n const windY = point[series.windYKey];\n if (windX != null && windY != null) {\n yValue = Math.sqrt(windX * windX + windY * windY);\n windDirections.push(Math.atan2(windY, windX));\n windData.push({ x: windX, y: windY });\n } else {\n yValue = null;\n windDirections.push(null);\n windData.push(null);\n }\n } else {\n yValue = point[series.yKey];\n if (yValue === undefined) {\n yValue = null;\n }\n\n if (typeof yValue === 'string') {\n yValue = options.stateController.enumToNumber(yValue, series);\n }\n\n if (typeof yValue === 'boolean') {\n yValue = +yValue;\n }\n }\n\n let xValue = point[series.xKey];\n if (typeof xValue === 'string') {\n xValue = new Date(xValue);\n }\n\n inDataSpace.push([xValue, yValue]);\n\n if (series.rangeKey && point[series.rangeKey]) {\n const range = point[series.rangeKey];\n if (typeof range === 'object' && range.min !== undefined && range.max !== undefined) {\n if (typeof range.min === 'number') {\n rangeValues.push(range.min);\n }\n if (typeof range.max === 'number') {\n rangeValues.push(range.max);\n }\n }\n }\n }\n }\n\n if (rangeValues.length > 0 || windDirections) {\n return {\n data: inDataSpace,\n rangeValues: rangeValues,\n windDirections: windDirections,\n windData: windData\n };\n }\n\n return inDataSpace;\n}\n","function finalizeBounds(bounds, { dates }) {\n const initial = (bounds.minX === null && bounds.maxX === null) || bounds.minY === null || bounds.maxY === null;\n\n for (let key of Object.keys(bounds)) {\n if (typeof bounds[key] !== 'number' && bounds[key] !== null) {\n bounds[key] = null;\n }\n }\n\n bounds.initial = initial;\n bounds.dates = dates;\n\n return bounds;\n}\n\nfunction percentileBounds(inDataSpace, bounds, {percentile=100, percentileAsymmetry=0, rangeValues=[]}={}) {\n let dates = false;\n\n bounds.minX = inDataSpace[0][0];\n if (bounds.minX instanceof Date) {\n bounds.minX = bounds.minX.valueOf();\n dates = true;\n }\n\n bounds.maxX = inDataSpace[inDataSpace.length - 1][0];\n if (bounds.maxX instanceof Date) {\n bounds.maxX = bounds.maxX.valueOf();\n dates = true;\n }\n\n const sortedByY = inDataSpace\n .filter(([_x, y]) => typeof y === 'number')\n .sort(([_x1, y1], [_x2, y2]) => y1 - y2);\n\n for (let rangeValue of rangeValues) {\n if (typeof rangeValue === 'number') {\n sortedByY.push([null, rangeValue]);\n }\n }\n sortedByY.sort(([_x1, y1], [_x2, y2]) => y1 - y2);\n\n if (!sortedByY.length) {\n return finalizeBounds(bounds, {dates});\n }\n\n const asymmetry = Math.min(Math.abs(percentileAsymmetry), (100-percentile)/2) * (percentileAsymmetry < 0 ? -1 : 1);\n const inBottomPercentile = (100-percentile)/2 + asymmetry;\n const inTopPercentile = (100-percentile)/2 - asymmetry;\n\n const startIndex = Math.floor((sortedByY.length-1)*inBottomPercentile/100);\n const endIndex = Math.floor((sortedByY.length-1)*(100-inTopPercentile)/100);\n\n bounds.minY = sortedByY[startIndex][1];\n bounds.maxY = sortedByY[endIndex][1];\n\n return finalizeBounds(bounds, {dates});\n}\n\nexport default function calculateDataBounds(inDataSpace, {percentile=100, percentileAsymmetry=0, rangeValues=[]}={}) {\n let bounds = {\n minX: null,\n maxX: null,\n minY: null,\n maxY: null,\n closestSpacing: null\n };\n\n if (percentile !== 100 && inDataSpace.length) {\n return percentileBounds(inDataSpace, bounds, {percentile, percentileAsymmetry, rangeValues});\n }\n\n let dates = false;\n let prevX = null;\n\n for (let [x, y] of inDataSpace) {\n if (x === null) {\n continue;\n }\n \n if (x instanceof Date) {\n x = x.valueOf();\n dates = true;\n }\n\n if (typeof bounds.minX !== 'number' || x < bounds.minX) {\n bounds.minX = x;\n }\n\n if (typeof bounds.maxX !== 'number' || x > bounds.maxX) {\n bounds.maxX = x;\n }\n\n if (typeof prevX === 'number' && typeof x === 'number') {\n const spacing = x - prevX;\n if (typeof bounds.closestSpacing !== 'number' || spacing < bounds.closestSpacing) {\n bounds.closestSpacing = spacing;\n }\n }\n prevX = x;\n\n if (typeof y !== 'number') {\n continue;\n }\n\n if (typeof bounds.minY !== 'number' || y < bounds.minY) {\n bounds.minY = y;\n }\n\n if (typeof bounds.maxY !== 'number' || y > bounds.maxY) {\n bounds.maxY = y;\n }\n }\n\n for (let rangeValue of rangeValues) {\n if (typeof rangeValue === 'number') {\n if (typeof bounds.minY !== 'number' || rangeValue < bounds.minY) {\n bounds.minY = rangeValue;\n }\n if (typeof bounds.maxY !== 'number' || rangeValue > bounds.maxY) {\n bounds.maxY = rangeValue;\n }\n }\n }\n \n return finalizeBounds(bounds, {dates});\n}\n","export default function mergeBounds(boundsList) {\n const mergedBounds = {\n minX: null,\n maxX: null,\n minY: null,\n maxY: null,\n closestSpacing: null,\n dates: false,\n initial: true\n };\n\n for (let { minX, maxX, minY, maxY, dates, initial, closestSpacing } of boundsList) {\n if (dates) {\n mergedBounds.dates = true;\n }\n\n if (initial) {\n continue;\n }\n mergedBounds.initial = false;\n\n if (minX !== null && (mergedBounds.minX === null || minX < mergedBounds.minX)) {\n mergedBounds.minX = minX;\n }\n\n if (maxX !== null && (mergedBounds.maxX === null || maxX > mergedBounds.maxX)) {\n mergedBounds.maxX = maxX;\n }\n\n if (closestSpacing !== null && (mergedBounds.closestSpacing === null || closestSpacing < mergedBounds.closestSpacing)) {\n mergedBounds.closestSpacing = closestSpacing;\n }\n\n if (minY !== null && (mergedBounds.minY === null || minY < mergedBounds.minY)) {\n mergedBounds.minY = minY;\n }\n\n if (maxY !== null && (mergedBounds.maxY === null || maxY > mergedBounds.maxY)) {\n mergedBounds.maxY = maxY;\n }\n }\n\n if (mergedBounds.minX === null) {\n mergedBounds.minX = 0;\n }\n\n if (mergedBounds.maxX === null) {\n mergedBounds.maxX = 0;\n }\n\n if (mergedBounds.closestSpacing === null) {\n mergedBounds.closestSpacing = 1;\n }\n\n if (mergedBounds.minY === null) {\n mergedBounds.minY = 0;\n }\n\n if (mergedBounds.maxY === null) {\n mergedBounds.maxY = 0;\n }\n\n return mergedBounds;\n}\n","/**\n * Expands bounds to give a little y padding\n *\n * @param {Object} bounds\n * @param {?Number} bounds.minY\n * @param {?Number} bounds.maxY\n * @param {?Number} bounds.minX\n * @param {?Number} bounds.maxX\n * @param {Array<Number>} [expandYWith]\n * @param {Number} [extendXForNBars=0]\n * @return {Object}\n */\nexport default function expandBounds(bounds, {expandYWith = [], extendXForNBars=0}) {\n const expandedBounds = Object.assign({}, bounds);\n for (let y of expandYWith) {\n if (y === null || y === undefined) {\n continue;\n }\n\n if (typeof expandedBounds.minY !== 'number' || y < expandedBounds.minY) {\n expandedBounds.minY = y;\n }\n\n if (typeof expandedBounds.maxY !== 'number' || y > expandedBounds.maxY) {\n expandedBounds.maxY = y;\n }\n }\n\n expandedBounds.unscaledMinY = expandedBounds.minY;\n expandedBounds.unscaledMaxY = expandedBounds.maxY;\n\n const range = expandedBounds.maxY - expandedBounds.minY;\n const midpoint = expandedBounds.minY + range/2;\n expandedBounds.minY = Math.min(expandedBounds.minY, midpoint - 1.05*range/2);\n expandedBounds.maxY = Math.max(expandedBounds.maxY, midpoint + 1.05*range/2);\n \n\n if (expandedBounds.minY === expandedBounds.maxY && expandedBounds.minY !== null) {\n if (expandedBounds.minY > 0) {\n expandedBounds.minY *= 0.95;\n expandedBounds.maxY *= 1.05;\n } else if (expandedBounds.minY < 0) {\n expandedBounds.minY *= 1.05;\n expandedBounds.maxY *= 0.95;\n } else {\n expandedBounds.minY -= 1;\n expandedBounds.maxY += 1;\n }\n }\n\n if (extendXForNBars && expandedBounds.minX !== expandedBounds.maxX && expandedBounds.minX !== null && expandedBounds.maxX !== null) {\n // Base expansion factor on expected bar count\n const barWidth = (expandedBounds.maxX - expandedBounds.minX) / extendXForNBars;\n expandedBounds.minX -= barWidth/2;\n expandedBounds.maxX += barWidth/2;\n }\n\n return expandedBounds;\n}\n","/**\n * Finds the closest point to the target\n *\n * @param {Array} data - the data, in data space\n * @param {Number} targetX - the x coordinate to get closest to\n * @param {Object} [searchParams]\n * @param {String} [searchParams.searchType] - whether to search for the closest, one before, or one after\n * @param {Boolean} [searchParams.returnIndex] - whether to return the index or the object itself\n * @param {Number} [startIndex] - where to start the search from\n * @param {Number} [endIndex] - where to end the search\n * @return {Array|Number}\n */\nexport default function binarySearch(data, targetX, searchParams={}, startIndex=0, endIndex=undefined) {\n if (endIndex === undefined) {\n endIndex = data.length - 1;\n }\n\n if (data.length === 0) {\n return searchParams.returnIndex ? -1 : [null, null];\n }\n\n const middleIndex = Math.floor((startIndex + endIndex)/2);\n\n if (targetX === data[middleIndex][0] || (data[middleIndex][0] instanceof Date && data[middleIndex][0].valueOf() === targetX)) {\n if (searchParams.returnIndex) {\n return middleIndex;\n } else {\n return data[middleIndex];\n }\n }\n\n if (startIndex === endIndex) {\n if (data[startIndex][0] < targetX && searchParams.searchType === 'before') {\n return searchParams.returnIndex ? startIndex : data[startIndex];\n } else if (data[startIndex][0] > targetX && searchParams.searchType === 'after') {\n return searchParams.returnIndex ? startIndex : data[startIndex];\n } else {\n return searchParams.returnIndex ? -1 : [null, null];\n }\n }\n\n if (endIndex - 1 === startIndex) {\n let index;\n\n if (searchParams.searchType === 'before') {\n index = startIndex;\n // index = (targetX <= data[startIndex][0]) ? startIndex : endIndex;\n } else if (searchParams.searchType === 'after') {\n index = endIndex;\n // index = (targetX >= data[endIndex][0]) ? endIndex : startIndex;\n } else {\n index = Math.abs(data[startIndex][0] - targetX) > Math.abs(data[endIndex][0] - targetX) ?\n endIndex :\n startIndex;\n }\n\n return searchParams.returnIndex ? index : data[index];\n }\n\n if (targetX > data[middleIndex][0]) {\n return binarySearch(data, targetX, searchParams, middleIndex, endIndex);\n }\n\n if (targetX < data[middleIndex][0]) {\n return binarySearch(data, targetX, searchParams, startIndex, middleIndex);\n }\n}\n","import binarySearch from '../../helpers/binary_search';\n\nfunction validateSelectedSpaceConversion({ data, inSelectedSpace, firstIndex, lastIndex, ignoreDiscontinuities }) { // eslint-disable-line no-unused-vars\n let correct = data.slice(firstIndex + 1, lastIndex);\n if (ignoreDiscontinuities) {\n correct = correct.filter(([_x, y]) => (y !== null && y !== undefined));\n }\n\n if (correct.length !== inSelectedSpace.length) {\n console.log({ // eslint-disable-line no-console\n data,\n attempt: inSelectedSpace.map(([x, y]) => [undateify(x), y]),\n correct: correct.map(([x, y]) => [undateify(x), y]),\n sdl: window.sdl\n });\n window.tacomaDataPaused = true;\n throw new Error('Failed to select via swap');\n }\n\n for (let i = 0; i < correct.length; i++) {\n if (undateify(correct[i][0]) !== undateify(inSelectedSpace[i][0]) || correct[i][1] !== inSelectedSpace[i][1]) {\n console.log({ // eslint-disable-line no-console\n i,\n attempt: inSelectedSpace.map(([x, y]) => [undateify(x), y]),\n correct: correct.map(([x, y]) => [undateify(x), y]),\n correctX: undateify(correct[i][0]),\n correctY: correct[i][1],\n attemptX: undateify(inSelectedSpace[i][0]),\n attemptY: inSelectedSpace[i][1]\n });\n window.tacomaDataPaused = true;\n throw new Error('Failed to select via swap');\n }\n }\n}\n\n/**\n * Converts from data space to selected space\n *\n * @param {Array<Array<Number>>} data\n * @param {{data: Array<Array<Number>>}|*} [swap]\n * @param {Number} minX\n * @param {Number} maxX\n * @param {Boolean} ignoreDiscontinuities\n * @param {Boolean} square\n * @return {{data: Array<Array<Number>>, lastAdded: boolean, firstAdded: boolean, afterIndex: Number, ignoreDiscontinuities: boolean, minX: Number, maxX: Number, beforeIndex: Number}}\n */\nexport default function dataSpaceToSelectedSpace({ data, swap, minX, maxX, ignoreDiscontinuities, square }) {\n if (!data.length || data.length && minX > data[data.length - 1][0] || data.length && maxX < data[0][0]) {\n //let previouslyEmpty = !data.length;\n return {\n data: [\n [minX, null],\n [maxX, null]\n ],\n firstAdded: true,\n lastAdded: true\n //previouslyEmpty\n };\n }\n\n let beforeIndex = binarySearch(data, minX, { searchType: 'before', returnIndex: true }) || 0;\n let afterIndex = binarySearch(data, maxX, { searchType: 'after', returnIndex: true }) || 0;\n if (afterIndex === -1) {\n afterIndex = 0;\n }\n\n while (beforeIndex >= 0 && data[beforeIndex][0] >= minX) {\n beforeIndex --;\n }\n\n while (afterIndex < data.length && data[afterIndex][0] <= maxX) {\n afterIndex ++;\n }\n\n let inSelectedSpace;\n let addToEndOnly = false;\n\n let firstAdded = false;\n let lastAdded = false;\n\n let beginningInterpolationIndex = beforeIndex;\n let endInterpolationIndex = afterIndex;\n if (ignoreDiscontinuities) {\n while (beginningInterpolationIndex >= 0 && data[beginningInterpolationIndex][1] === null) {\n beginningInterpolationIndex --;\n }\n while (endInterpolationIndex < data.length && data[endInterpolationIndex][1] === null) {\n endInterpolationIndex++;\n }\n }\n\n if (swap) {\n inSelectedSpace = swap.data;\n if (swap.lastAdded) {\n inSelectedSpace.pop();\n }\n if (minX === swap.minX) {\n addToEndOnly = true;\n }\n if (beforeIndex !== swap.beforeIndex) {\n addToEndOnly = false;\n if (swap.firstAdded) {\n inSelectedSpace.shift();\n }\n let index = swap.beforeIndex;\n while (index >= 0 && inSelectedSpace.length && inSelectedSpace[0][0] >= minX) {\n if (!ignoreDiscontinuities || data[index][1] || data[index][1] === 0) {\n inSelectedSpace.unshift(data[index]);\n }\n index --;\n }\n while (index < data.length && inSelectedSpace.length && inSelectedSpace[0][0] < minX) {\n inSelectedSpace.shift();\n index ++;\n }\n }\n\n if (ignoreDiscontinuities && !swap.ignoreDiscontinuities) {\n inSelectedSpace = inSelectedSpace.filter(([_x, y]) => (y !== null && y !== undefined));\n }\n\n if (beforeIndex === swap.beforeIndex && swap.firstAdded) {\n firstAdded = true;\n\n let interpolationIndex = beforeIndex + 1;\n if (ignoreDiscontinuities) {\n while (interpolationIndex < data.length && data[interpolationIndex][1] === null) {\n interpolationIndex ++;\n }\n }\n\n if (beginningInterpolationIndex === -1 && inSelectedSpace.length) {\n inSelectedSpace[0] = [minX, null];\n } else {\n if (square && inSelectedSpace.length) {\n inSelectedSpace[0] = [minX, data[beginningInterpolationIndex][1]];\n } else {\n if (inSelectedSpace.length) {\n inSelectedSpace[0] = [minX, interpolate(data, beginningInterpolationIndex, interpolationIndex, minX)];\n }\n }\n }\n if (data[beforeIndex + 1][0] === inSelectedSpace[0][0] && data[beforeIndex + 1][1] === inSelectedSpace[0][1]) {\n firstAdded = false;\n }\n }\n let lastIncluded = swap.afterIndex;\n if (swap.ignoreDiscontinuities && !ignoreDiscontinuities) {\n let nullIndex = beforeIndex + 1;\n let selectedIndex = 0;\n if (firstAdded) {\n selectedIndex ++;\n }\n while (selectedIndex <= inSelectedSpace.length && nullIndex < data.length && nullIndex < afterIndex) {\n if (data[nullIndex][0] <= maxX && data[nullIndex][1] === null && (!inSelectedSpace[selectedIndex] || inSelectedSpace[selectedIndex][0] !== data[nullIndex][0] || inSelectedSpace[selectedIndex][1] !== data[nullIndex][1])) {\n inSelectedSpace.splice(selectedIndex, 0, data[nullIndex]);\n if (nullIndex >= lastIncluded) {\n lastIncluded = nullIndex + 1;\n }\n }\n nullIndex ++;\n selectedIndex ++;\n }\n }\n\n let dataIndex = lastIncluded || 0;\n while (dataIndex < data.length && data[dataIndex][0] <= maxX) {\n if (data[dataIndex][0] >= minX) {\n if (!ignoreDiscontinuities || data[dataIndex][1] || data[dataIndex][1] === 0) {\n inSelectedSpace.push(data[dataIndex]);\n }\n }\n dataIndex ++;\n }\n while (inSelectedSpace.length && inSelectedSpace[inSelectedSpace.length - 1][0] > maxX) {\n inSelectedSpace.pop();\n }\n\n } else {\n inSelectedSpace = data.slice(beforeIndex + 1, afterIndex);\n if (ignoreDiscontinuities) {\n inSelectedSpace = inSelectedSpace.filter(([_x, y]) => (y !== null && y !== undefined));\n }\n }\n\n if (!inSelectedSpace.length) {\n if (square) {\n if (beginningInterpolationIndex < 0) {\n inSelectedSpace = [[minX, null], [maxX, null]];\n } else {\n inSelectedSpace = [[minX, data[beginningInterpolationIndex][1]], [maxX, data[beginningInterpolationIndex][1]]];\n }\n } else {\n inSelectedSpace = [[minX, interpolate(data, beginningInterpolationIndex, endInterpolationIndex, minX)], [maxX, interpolate(data, beginningInterpolationIndex, endInterpolationIndex, maxX)]];\n }\n firstAdded = true;\n lastAdded = true;\n }\n\n if (!addToEndOnly) {\n let interpolationIndex = beforeIndex + 1;\n if (ignoreDiscontinuities) {\n while (interpolationIndex < data.length && data[interpolationIndex][1] === null) {\n interpolationIndex ++;\n }\n }\n\n if (inSelectedSpace.length && inSelectedSpace[0][0] > minX) {\n firstAdded = true;\n if (beginningInterpolationIndex === -1) {\n inSelectedSpace.unshift([minX, null]);\n } else {\n if (square) {\n inSelectedSpace.unshift([minX, data[beginningInterpolationIndex][1]]);\n } else {\n inSelectedSpace.unshift([minX, interpolate(data, beginningInterpolationIndex, interpolationIndex, minX)]);\n }\n }\n }\n }\n\n if (inSelectedSpace.length && inSelectedSpace[inSelectedSpace.length - 1][0] < maxX) {\n lastAdded = true;\n\n let interpolationIndex = afterIndex - 1;\n if (ignoreDiscontinuities) {\n while (interpolationIndex >= 0 && data[interpolationIndex][1] === null) {\n interpolationIndex --;\n }\n }\n\n if (endInterpolationIndex === data.length) {\n inSelectedSpace.push([maxX, null]);\n } else {\n if (square) {\n inSelectedSpace.push([maxX, inSelectedSpace[inSelectedSpace.length - 1][1]]);\n } else {\n inSelectedSpace.push([maxX, interpolate(data, interpolationIndex, endInterpolationIndex, maxX)]);\n }\n }\n }\n\n if (inSelectedSpace.length === 1) {\n let begPoint;\n let endPoint;\n if (square) {\n if (beginningInterpolationIndex < 0) {\n begPoint = [minX, null];\n } else {\n begPoint = [minX, data[beginningInterpolationIndex][1]];\n }\n endPoint = [maxX, inSelectedSpace[0][1]];\n } else {\n begPoint = [minX, interpolate(data, beginningInterpolationIndex, beforeIndex + 1, minX)];\n endPoint = [maxX, interpolate(data, afterIndex - 1, endInterpolationIndex, maxX)];\n }\n inSelectedSpace.unshift(begPoint);\n inSelectedSpace.push(endPoint);\n firstAdded = true;\n lastAdded = true;\n }\n\n return {\n data: inSelectedSpace,\n minX,\n maxX,\n beforeIndex,\n afterIndex,\n firstAdded,\n lastAdded,\n ignoreDiscontinuities\n //previouslyEmpty: false\n };\n}\n\nfunction undateify(potentialDate) {\n if (potentialDate instanceof Date) {\n return potentialDate.valueOf();\n }\n\n return potentialDate;\n}\n\n/**\n * Finds the point at the boundary via interpolation\n *\n * @param {Array<Array<Number>>} data\n * @param {Number} firstIndex\n * @param {Number} secondIndex\n * @param {Number} boundary\n * @return {null|*}\n */\nfunction interpolate(data, firstIndex, secondIndex, boundary) {\n if (firstIndex < 0 || secondIndex < 0) {\n return null;\n }\n\n if (firstIndex >= data.length || secondIndex >= data.length) {\n return null;\n }\n\n if (firstIndex === secondIndex) {\n return data[firstIndex][1];\n }\n\n const [xBefore, yBefore] = data[firstIndex];\n const [xAfter, yAfter] = data[secondIndex];\n\n if (boundary === xBefore && yBefore !== null) {\n return yBefore;\n }\n\n if (boundary === xAfter && yAfter !== null) {\n return yAfter;\n }\n\n if (yBefore === null || yAfter === null) {\n return null;\n }\n\n const percent = (boundary - xBefore)/(xAfter - xBefore);\n if (percent < 0 || percent > 1) {\n return null;\n }\n\n return percent*(yAfter - yBefore) + yBefore;\n}\n","/**\n * Scales y min and max bounds according to linear or log\n *\n * @param {Number} minY\n * @param {Number} maxY\n * @param {'linear'|'log'} scale\n * @return {{minY: Number, maxY: Number}}\n */\nexport default function scaleBounds({ minY, maxY, scale }) {\n if (scale === 'log') {\n maxY = Math.log10(maxY);\n\n if (minY <= 0) {\n if (maxY > 0) {\n minY = -maxY;\n } else {\n minY = 2*maxY;\n }\n } else {\n minY = Math.log10(minY);\n }\n }\n\n return {\n minY,\n maxY\n };\n}\n","import scaleBounds from '../../renderer/scale_bounds';\nimport RustAPI from '../rust_api';\n\n\nfunction selectedSpaceToRenderSpaceInPlace({ data, renderWidth, renderHeight, minX, maxX, minY, maxY, scale }, { nullMask, yValues, minYValues, maxYValues }) {\n let i = 0;\n let prevI = i - 1;\n\n for (let pixelX = 0; pixelX < renderWidth; pixelX++) {\n // find the x value that corresponds to the x pixel\n const x = (pixelX/(renderWidth - 1))*(maxX - minX) + minX;\n\n // set i such that data[i][0] < x <= data[i+1][0]\n let minSeenY = null;\n let maxSeenY = null;\n\n if (i > 0 && i <= data.length && data[i - 1][1] === null) {\n i--;\n }\n\n if (i < data.length - 2 && data[i + 1][0] < x) {\n i++;\n }\n\n for (i; i < data.length - 2 && data[i + 1][0] < x; i++) {\n const curY = data[i][1];\n\n if (curY === null) {\n continue;\n }\n\n if (minSeenY === null || curY < minSeenY) {\n minSeenY = curY;\n }\n\n if (maxSeenY === null || curY > maxSeenY) {\n maxSeenY = curY;\n }\n }\n\n minYValues[pixelX] = minSeenY === null ? 0 : renderHeight*(1 - ((scale === 'log' ? Math.log10(minSeenY) : minSeenY) - minY)/(maxY - minY));\n maxYValues[pixelX] = maxSeenY === null ? 0 : renderHeight*(1 - ((scale === 'log' ? Math.log10(maxSeenY) : maxSeenY) - minY)/(maxY - minY));\n\n // pass any discontinuities along\n if (i >= data.length - 1 || data[i][1] === null || data[i + 1][1] === null) {\n const y = i >= data.length - 1 ? null : data[i][1];\n\n nullMask[pixelX] = ((y === null) << 0) | ((minSeenY === null) << 1) | ((maxSeenY === null) << 2);\n yValues[pixelX] = y === null ? 0 : renderHeight*(1 - ((scale === 'log' ? Math.log10(y) : y) - minY)/(maxY - minY));\n\n i++;\n\n continue;\n }\n\n // interpolate\n const [xBefore, yBefore] = data[i];\n const [xAfter, yAfter] = data[i + 1];\n\n const percent = (x - xBefore) / (xAfter - xBefore);\n let y = percent * (yAfter - yBefore) + yBefore;\n\n // we're at the first point after the direction changed. Don't interpolate\n if (prevI !== i) {\n y = yBefore;\n }\n\n // // two x's with the same value; common in area charts\n // // to avoid this from having gotten skipped over, save in either min or max as appropriate\n // if (i > 0 && data[i - 1][0] === data[i][0]) {\n // // 0: minY a\n // // 1: original a\n // // 2: minY b\n // // 3: original b\n //\n // const [xBeforeOffset, yBeforeOffset] = data[i - 1];\n // const [xAfter, yAfter] = data[i + 1];\n // }\n\n yValues[pixelX] = y === null ? 0 : renderHeight*(1 - ((scale === 'log' ? Math.log10(y) : y) - minY)/(maxY - minY));\n nullMask[pixelX] = ((y === null) << 0) | ((minSeenY === null) << 1) | ((maxSeenY === null) << 2);\n\n prevI = i;\n }\n}\n\n/**\n * Convert from selected space to value space\n *\n * @param data\n * @param {Object} [swap]\n * @param {Number} renderWidth - width, in pixels, of the area in which the graph is rendered\n * @param {Number} renderHeight - height, in pixels, of the area in which the graph is rendered\n * @param {Number} minX - the minimum x value that is rendered\n * @param {Number} maxX - the maximum x value that is rendered\n * @param {Number} minY - the minimum y value that is rendered\n * @param {Number} maxY - the maximum y value that is rendered\n * @param {'log'|'linear'} scale\n * @param {Boolean} [dataChanged] - if true, will not rely on the prior data state from swap being accurate\n * @return {{nullMask: Uint8Array, maxYValues: Float64Array, minYValues: Float64Array, yValues: Float64Array, dataF64: Float64Array, dataNullMask: Uint8Array}}\n */\nexport default function selectedSpaceToRenderSpace({ data, swap, renderWidth, renderHeight, minX, maxX, minY, maxY, scale, dataChanged }) {\n if (swap && swap.yValues.length !== renderWidth) {\n swap = null;\n }\n\n const nullMask = (swap && swap.nullMask) || new Uint8Array(renderWidth);\n nullMask.fill(0);\n const yValues = new Float64Array(renderWidth);\n const minYValues = new Float64Array(renderWidth);\n const maxYValues = new Float64Array(renderWidth);\n\n const scaledBounds = scaleBounds({ minY, maxY, scale});\n minY = scaledBounds.minY;\n maxY = scaledBounds.maxY;\n\n const inParams = { data, renderWidth, renderHeight, minX, maxX, minY, maxY, scale };\n\n let dataF64, dataNullMask;\n\n if (RustAPI()) {\n let copyIndexStart = 0;\n\n const hasSwap = swap && swap.dataNullMask && swap.dataF64;\n const useSwap = !dataChanged && hasSwap && swap.minX === minX && swap.maxX <= maxX && swap.length <= data.length;\n\n if (!useSwap || swap.dataNullMask.length < data.length) {\n const extraSpaceFactor = 1.25;\n dataF64 = new Float64Array(Math.floor(data.length*2*extraSpaceFactor));\n dataNullMask = new Uint8Array(Math.floor(data.length*extraSpaceFactor));\n\n if (useSwap) {\n dataNullMask.set(swap.dataNullMask);\n dataF64.set(swap.dataF64);\n }\n } else {\n dataF64 = swap.dataF64;\n dataNullMask = swap.dataNullMask;\n }\n\n if (useSwap) {\n copyIndexStart = Math.max(swap.length - 1, 0);\n }\n\n for (let i = copyIndexStart; i < data.length; i++) {\n dataF64[2*i] = data[i][0];\n dataF64[2*i + 1] = data[i][1];\n\n if (data[i][1] === null) {\n dataNullMask[i] = 1;\n } else {\n dataNullMask[i] = 0;\n }\n }\n RustAPI().selected_space_to_render_space(data.length, dataF64, dataNullMask, inParams, nullMask, yValues, minYValues, maxYValues);\n } else {\n selectedSpaceToRenderSpaceInPlace(inParams, { nullMask, yValues, minYValues, maxYValues });\n }\n\n return {\n nullMask,\n yValues,\n minYValues,\n maxYValues,\n dataF64,\n dataNullMask,\n minX,\n maxX,\n length: data.length\n };\n}\n","/**\n * Flattens simple data\n * Returns an array of tuples (x value, simple point)\n *\n * @param simpleData\n * @param series\n * @param inDataSpace\n * @return {[]}\n */\nexport default function flattenSimpleData(simpleData, {series, inDataSpace }) {\n const flattened = [];\n let fI = 0;\n\n for (let point of simpleData) {\n const yValue = extractYValue(point, series);\n\n if (series.yKey && Array.isArray(yValue)) {\n for (let subpoint of point[series.yKey]) {\n if (series.ignoreDiscontinuities && typeof subpoint[series.yKey] !== 'number' && !Array.isArray(subpoint)) {\n continue;\n }\n\n const x = inDataSpace[fI++][0];\n\n if (series.square && flattened.length > 0) {\n flattened.push([x, flattened[flattened.length - 1][1]]);\n }\n\n flattened.push([x, subpoint]);\n }\n\n continue;\n }\n\n if (series.ignoreDiscontinuities && (yValue === undefined || yValue === null)) {\n continue;\n }\n\n const x = inDataSpace[fI++][0];\n\n if (series.square && flattened.length > 0) {\n flattened.push([x, flattened[flattened.length - 1][1]]);\n }\n\n flattened.push([x, point]);\n }\n\n if (flattened.length !== inDataSpace.length) {\n console.warn('Flattening didn\\'t give the same length as it has in data space'); // eslint-disable-line no-console\n }\n\n return flattened;\n}\n\nexport function extractYValue(point, series) {\n if (series.yKey) {\n return point[series.yKey];\n }\n\n if (Array.isArray(point)) {\n if (point.length === 1) {\n return point[0];\n } else {\n return point[1];\n }\n }\n\n return point;\n}\n\nexport function extractXValue(point, series) {\n if (series.xKey) {\n return point[series.xKey];\n }\n\n if (Array.isArray(point)) {\n return point[0];\n }\n\n return point;\n}\n","import binarySearch from '../helpers/binary_search';\nimport scaleBounds from '../renderer/scale_bounds';\nimport getColor from '../helpers/colors';\nimport flattenSimpleData, {extractXValue, extractYValue} from '../helpers/flatten_simple_data';\nimport {getBarWidths} from '../renderer/draw_bars';\n\nconst DISTANCE_THRESHOLD = 20;\n\n/**\n * Figures out the tooltip state\n *\n * @param {Boolean} mousePresent\n * @param {Number} mouseX\n * @param {Number} mouseY\n * @param {Object} sizing\n * @param {Array<Object>} series\n * @param {Set} alwaysTooltipped\n * @param {Array<Object>} savedTooltips\n * @param {Boolean} [allTooltipped]\n * @param {Number} closestSpacing\n * @return {{mouseX: *, mouseY: *, elementWidth: number, elementHeight: number, tooltips: any[]}}\n */\nexport default function calculateTooltipState({mousePresent, mouseX, mouseY, sizing, series, alwaysTooltipped, savedTooltips, allTooltipped, closestSpacing }) {\n // filter out saved tooltips for nonexistent series\n savedTooltips = savedTooltips.filter((tooltip) => tooltip.series.axis);\n\n for (let savedTooltip of savedTooltips) {\n moveTooltip({ mouseX, mouseY, sizing}, savedTooltip);\n }\n\n if (!mousePresent) {\n return {\n mouseX,\n mouseY,\n elementWidth: sizing.elementWidth,\n elementHeight: sizing.elementHeight,\n tooltips: [...savedTooltips]\n };\n }\n\n const tooltips = [];\n\n let minDistance = Infinity;\n\n for (let i = 0; i < series.length; i++) {\n const singleSeries = series[i];\n\n if (singleSeries.hidden) {\n continue;\n }\n\n const axis = singleSeries.axis;\n\n const scale = axis.scale;\n const bounds = axis.currentBounds;\n const { minY, maxY } = scaleBounds({...bounds, scale });\n\n const trueX = mouseX/sizing.elementWidth * (bounds.maxX - bounds.minX) + bounds.minX;\n\n let data = singleSeries.inDataSpace;\n if (singleSeries.ignoreDiscontinuities) {\n data = data.filter((tuple) => typeof tuple[1] === 'number');\n }\n\n if (data.length === 0) {\n continue;\n }\n\n let dataMinX = data[0][0];\n let dataMaxX = data[data.length - 1][0];\n \n if (dataMinX instanceof Date) {\n dataMinX = dataMinX.getTime();\n }\n if (dataMaxX instanceof Date) {\n dataMaxX = dataMaxX.getTime();\n }\n \n const dataRange = dataMaxX - dataMinX;\n const padding = 0; \n\n if (trueX < dataMinX - padding || trueX > dataMaxX + padding) {\n continue;\n }\n\n const closestIndex = binarySearch(data, trueX, { returnIndex: true });\n const closestPoint = data[closestIndex];\n\n if (!closestPoint) {\n continue;\n }\n\n const [x, y] = closestPoint;\n\n if (x === null) {\n continue;\n }\n\n let pixelX = (x - bounds.minX)/(bounds.maxX - bounds.minX) * sizing.elementWidth;\n const pixelY = (1 - ((scale === 'log' ? Math.log10(y) : y) - minY)/(maxY - minY)) * sizing.elementHeight;\n\n if (pixelY > sizing.elementHeight || pixelY < 0) {\n continue;\n }\n\n const ignoreYDistanceCheck = alwaysTooltipped.has(singleSeries) || allTooltipped;\n let xDistanceThreshold = DISTANCE_THRESHOLD;\n let yDistanceThreshold = DISTANCE_THRESHOLD;\n let distanceThreshold = DISTANCE_THRESHOLD;\n\n if (singleSeries.rendering === 'bar') {\n const indexInAxis = singleSeries.axis.series.indexOf(singleSeries);\n const axisSeriesCount = singleSeries.axis.series.length;\n\n const { totalBarWidth, barWidth } = getBarWidths({\n closestSpacing,\n bounds,\n sizing,\n axisSeriesCount\n });\n\n // currently, pixelX is the center of all the bars\n // shift it to start at the far left, then shift it to the center of the individual bar\n pixelX -= totalBarWidth/2/sizing.pixelRatio;\n pixelX += (barWidth*(indexInAxis + 0.5))/sizing.pixelRatio;\n\n xDistanceThreshold = barWidth/2/sizing.pixelRatio;\n yDistanceThreshold = 100;\n distanceThreshold = xDistanceThreshold + yDistanceThreshold;\n }\n\n const xDistance = Math.abs(pixelX - mouseX);\n const yDistance = Math.abs(pixelY - mouseY);\n const distance = Math.sqrt((xDistance)**2 + (pixelY - mouseY)**2);\n\n if (!ignoreYDistanceCheck && (xDistance > xDistanceThreshold || yDistance > yDistanceThreshold || distance > distanceThreshold)) {\n continue;\n }\n\n let xLabel, yLabel;\n\n const simpleData = singleSeries.simpleData || singleSeries.data;\n\n const enumLike = simpleData.length && !!singleSeries.hasEnum;\n if (singleSeries.xLabel || singleSeries.yLabel || enumLike) {\n let simplePoint;\n\n if (simpleData.length === data.length) {\n simplePoint = simpleData[closestIndex];\n } else {\n const flattenedData = flattenSimpleData(simpleData, { series: singleSeries, inDataSpace: data });\n\n simplePoint = flattenedData[closestIndex][1];\n }\n\n if (singleSeries.xLabel) {\n xLabel = simplePoint[singleSeries.xLabel];\n } else if (singleSeries.hasXEnum) {\n xLabel = extractXValue(simplePoint, singleSeries);\n }\n\n if (singleSeries.yLabel) {\n yLabel = simplePoint[singleSeries.yLabel];\n } else if (enumLike) {\n yLabel = extractYValue(simplePoint, singleSeries);\n }\n }\n\n if (distance < minDistance) {\n minDistance = distance;\n }\n\n let color = getColor(singleSeries.color, i, singleSeries.multigrapherSeriesIndex);\n if (y < 0 && singleSeries.negativeColor) {\n color = singleSeries.negativeColor;\n } else if (y === 0 && singleSeries.zeroLineColor) {\n color = singleSeries.zeroLineColor;\n }\n\n const followMouse = singleSeries.followingMouseTooltip && alwaysTooltipped.has(singleSeries);\n const finalPixelY = isNaN(pixelY) ? sizing.elementHeight/2 : pixelY;\n \n tooltips.push({\n pixelWidth: sizing.elementWidth,\n pixelX: pixelX,\n pixelY: finalPixelY,\n tooltipPixelY: followMouse ? mouseY : finalPixelY,\n x,\n y,\n color,\n distance,\n xDistance,\n index: i,\n series: singleSeries,\n xLabel,\n yLabel,\n fullYPrecision: singleSeries.fullYPrecision,\n ignoreYDistanceCheck\n });\n }\n\n const unsavedTooltips = tooltips.filter(({ distance, ignoreYDistanceCheck }) => {\n return distance === minDistance || ignoreYDistanceCheck;\n }).sort((a, b) => b.distance - a.distance);\n\n return {\n mousePresent,\n mouseX,\n mouseY,\n elementWidth: sizing.elementWidth,\n elementHeight: sizing.elementHeight,\n unsavedTooltipsCount: unsavedTooltips.length,\n tooltips: [...savedTooltips, ...unsavedTooltips]\n };\n}\n\n/**\n * Recalculates the tooltip position, given the new sizing, bounds, etc.\n *\n * @param {Number} mouseX\n * @param {Number} mouseY\n * @param {Object} sizing\n * @param {Object} tooltip - The tooltip object to move\n */\nexport function moveTooltip({ mouseX, mouseY, sizing }, tooltip) {\n const { x, y } = tooltip;\n\n const scale = tooltip.series.axis.scale;\n const bounds = tooltip.series.axis.currentBounds;\n const { minY, maxY } = scaleBounds({...bounds, scale });\n\n const pixelX = (x - bounds.minX)/(bounds.maxX - bounds.minX) * sizing.elementWidth;\n const pixelY = (1 - ((scale === 'log' ? Math.log10(y) : y) - minY)/(maxY - minY)) * sizing.elementHeight;\n\n const distance = Math.sqrt((pixelX - mouseX)**2 + (pixelY - mouseY)**2);\n const xDistance = Math.abs(pixelX - mouseX);\n\n Object.assign(tooltip, {\n pixelWidth: sizing.elementWidth,\n pixelX: pixelX,\n pixelY: isNaN(pixelY) ? sizing.elementHeight/2 : pixelY,\n xDistance,\n distance\n });\n}\n\nexport function toggleTooltipSaved({ currentTooltips, savedTooltips }) {\n if (!currentTooltips.length) {\n return savedTooltips;\n }\n\n const lastTooltip = currentTooltips[currentTooltips.length - 1];\n if (lastTooltip.xDistance > DISTANCE_THRESHOLD || (!lastTooltip.ignoreYDistanceCheck && lastTooltip.distance > DISTANCE_THRESHOLD)) {\n return savedTooltips;\n }\n\n const currentTooltipIndex = savedTooltips.findIndex((tooltip) => {\n return tooltip.x === lastTooltip.x && tooltip.y === lastTooltip.y;\n });\n\n if (currentTooltipIndex === -1) {\n return [...savedTooltips, lastTooltip];\n } else {\n return savedTooltips.filter((_, index) => index !== currentTooltipIndex);\n }\n}\n","const BOUND_CALCULATORS = {\n all: () => {},\n lastMinute: (globalBounds) => {\n if (!globalBounds.dates) {\n return;\n }\n\n return {\n minX: Math.max(new Date(globalBounds.maxX).valueOf() - 60*1000, globalBounds.minX)\n };\n },\n last10Minutes: (globalBounds) => {\n if (!globalBounds.dates) {\n return;\n }\n\n return {\n minX: Math.max(new Date(globalBounds.maxX).valueOf() - 10*60*1000, globalBounds.minX)\n };\n },\n lastHour: (globalBounds) => {\n if (!globalBounds.dates) {\n return;\n }\n\n return {\n minX: Math.max(new Date(globalBounds.maxX).valueOf() - 60*60*1000, globalBounds.minX)\n };\n },\n lastDay: (globalBounds) => {\n if (!globalBounds.dates) {\n return;\n }\n\n return {\n minX: Math.max(new Date(globalBounds.maxX).valueOf() - 24*60*60*1000, globalBounds.minX)\n };\n }\n};\n\nexport default BOUND_CALCULATORS;\n","const BUCKETS_PER_PIXEL = 2;\nconst CONDENSE_THRESHOLD = 2;\n\n/**\n * Condenses the dataset down to a lower number of points to make subsequent operations more efficient\n * Will only condense when data length passes a given threshold\n * Note that this works best on datasets that are relatively evenly distributed across the x axis\n *\n * @param {Array<Array>} data\n * @param {{data: [], minX: Number, maxX: Number, length: Number}} swap\n * @param {Number} minX\n * @param maxX\n * @param renderWidth\n * @param dataChanged\n * @return {{data: [], minX: Number, maxX: Number, length: Number}}\n */\nexport default function condenseDataSpace({ data, swap, minX, maxX, renderWidth, dataChanged }) {\n const targetBucketCount = renderWidth*BUCKETS_PER_PIXEL;\n\n const useSwap = !dataChanged && swap && swap.minX === minX && swap.maxX <= maxX && swap.length <= data.length;\n\n let partiallyCondensedData;\n if (useSwap) {\n partiallyCondensedData = swap.data;\n\n if (data.length > swap.length) {\n // always overwrite the last in case it was mangled by the selected space interpolation\n if (data.length > 0 && partiallyCondensedData.length > 0) {\n partiallyCondensedData[partiallyCondensedData.length - 1] = data[swap.length - 1];\n }\n\n partiallyCondensedData = partiallyCondensedData.concat(data.slice(swap.length));\n }\n } else {\n partiallyCondensedData = [...data];\n }\n\n if (partiallyCondensedData.length / targetBucketCount < CONDENSE_THRESHOLD*2) { // * 2 because min and max\n return {\n data: partiallyCondensedData,\n minX,\n maxX,\n length: data.length\n };\n }\n\n const condensedData = [];\n const bucketSize = (maxX - minX)/targetBucketCount;\n let minInBucket = null;\n let maxInBucket = null;\n let currentBucketIndex = 0;\n\n // always add the first point so that x ranges are preserved\n if (data.length) {\n condensedData.push(data[0]);\n }\n\n for (let tuple of partiallyCondensedData) {\n const [x, y] = tuple;\n\n if (y === null) {\n continue;\n }\n\n const bucketIndex = Math.floor((x - minX)/bucketSize);\n\n if (bucketIndex !== currentBucketIndex) {\n if (minInBucket && maxInBucket) {\n if (minInBucket === maxInBucket) {\n if (condensedData[condensedData.length - 1] !== minInBucket) {\n condensedData.push(minInBucket);\n }\n } else if (minInBucket[0] < maxInBucket[0]) {\n condensedData.push(maxInBucket, minInBucket);\n } else {\n condensedData.push(minInBucket, maxInBucket);\n }\n }\n\n minInBucket = null;\n maxInBucket = null;\n currentBucketIndex = bucketIndex;\n }\n\n if (!minInBucket || y < minInBucket[1]) {\n minInBucket = tuple;\n }\n\n if (!maxInBucket || y > maxInBucket[1]) {\n maxInBucket = tuple;\n }\n }\n\n if (minInBucket && maxInBucket) {\n if (minInBucket === maxInBucket) {\n condensedData.push(minInBucket);\n } else if (minInBucket[0] < maxInBucket[0]) {\n condensedData.push(maxInBucket, minInBucket);\n } else {\n condensedData.push(minInBucket, maxInBucket);\n }\n }\n\n // always add the last point so that x ranges are preserved\n if (data.length >= 2 && data[data.length - 1] !== minInBucket && data[data.length - 1] !== maxInBucket) {\n condensedData.push(data[data.length - 1]);\n }\n\n return {\n data: condensedData,\n minX,\n maxX,\n length: data.length\n };\n}\n","/**\n * Gets the proper name for a series\n *\n * @param {Object} singleSeries\n * @param {Number} index\n * @return {string}\n */\nexport default function nameForSeries(singleSeries, index) {\n let name = singleSeries.name || singleSeries.yKey;\n\n if (!name) {\n name = index.toString();\n }\n\n return name;\n}\n","export function selectedSpaceToBackgroundSpace({ data, background, minX, maxX }) {\n if (!background) {\n return null;\n }\n\n const conditions = [];\n for (let [key, color] of Object.entries(background)) {\n if (typeof color === 'object') {\n if (typeof color.evaluator !== 'function') {\n throw new Error('Invalid background declaration: ' + key + ' (evaluator must be a function)');\n }\n\n conditions.push(Object.assign({\n key,\n comparator: 'custom',\n comparedAgainst: null\n }, color));\n continue;\n }\n\n if (key === 'null') {\n conditions.push({\n evaluator: (y) => y === null && color,\n color,\n key,\n comparator: '=',\n comparedAgainst: null\n });\n continue;\n }\n\n const [comparator, value] = key.split(' ');\n if (!comparator || !value || isNaN(parseFloat(value))) {\n throw new Error('Invalid background declaration: ' + key);\n }\n\n const parsedValue = parseFloat(value);\n\n let evaluator;\n if (comparator === '=') {\n evaluator = (y) => typeof y === 'number' && y === parsedValue && color;\n } else if (comparator === '<') {\n evaluator = (y) => typeof y === 'number' && y < parsedValue && color;\n } else if (comparator === '>') {\n evaluator = (y) => typeof y === 'number' && y > parsedValue && color;\n } else if (comparator === '<=') {\n evaluator = (y) => typeof y === 'number' && y <= parsedValue && color;\n } else if (comparator === '>=') {\n evaluator = (y) => typeof y === 'number' && y >= parsedValue && color;\n } else {\n throw new Error('Invalid background declaration: ' + key);\n }\n\n conditions.push({\n evaluator,\n color,\n key,\n comparator,\n comparedAgainst: parsedValue\n });\n }\n\n const inBackgroundSpace = [];\n let currentSection = null;\n\n for (let i = 0; i < data.length; i++) {\n let [x, y] = data[i];\n if (x instanceof Date) {\n x = x.valueOf();\n }\n\n for (let condition of currentSection ? [currentSection.condition, ...conditions] : conditions) {\n const color = condition.evaluator(y);\n\n if (currentSection) {\n if (currentSection.color === color) {\n break;\n }\n\n let interpolatedMaxX = x;\n if (i > 0) {\n let [prevX, prevY] = data[i - 1];\n if (prevX instanceof Date) {\n prevX = prevX.valueOf();\n }\n\n if (currentSection.condition.comparedAgainst === null) {\n interpolatedMaxX = x;\n } else if (y === null) {\n interpolatedMaxX = prevX;\n } else {\n interpolatedMaxX = prevX + (condition.comparedAgainst - prevY)/(y - prevY)*(x - prevX);\n }\n }\n\n inBackgroundSpace.push({\n ...currentSection,\n maxX: interpolatedMaxX,\n maxXt: (interpolatedMaxX - minX)/(maxX - minX)\n });\n currentSection = null;\n }\n\n if (color) {\n let interpolatedMinX = x;\n if (i > 0) {\n let [prevX, prevY] = data[i - 1];\n if (prevX instanceof Date) {\n prevX = prevX.valueOf();\n }\n\n if (condition.comparedAgainst === null) {\n interpolatedMinX = prevX;\n } else if (prevY === null) {\n interpolatedMinX = x;\n } else {\n interpolatedMinX = prevX + (condition.comparedAgainst - prevY)/(y - prevY)*(x - prevX);\n }\n }\n\n currentSection = {\n minX: interpolatedMinX,\n minXt: (interpolatedMinX - minX)/(maxX - minX),\n color,\n condition\n };\n\n break;\n }\n }\n }\n\n if (currentSection) {\n inBackgroundSpace.push({\n ...currentSection,\n maxX: data[data.length - 1][0],\n maxXt: (data[data.length - 1][0] - minX)/(maxX - minX)\n });\n }\n\n return {\n data: inBackgroundSpace\n };\n}\n","import simpleSeriesToDataSpace from './space_conversions/simple_series_to_data_space';\nimport calculateDataBounds from './calculate_data_bounds';\nimport mergeBounds from './merge_bounds';\nimport expandBounds from './expand_bounds';\nimport selectionFromGlobalBounds from './selection_from_global_bounds';\nimport dataSpaceToSelectedSpace from './space_conversions/data_space_to_selected_space';\nimport selectedSpaceToRenderSpace from './space_conversions/selected_space_to_render_space';\nimport Eventable from '../eventable';\nimport boundCalculatorFromSelection from './bound_calculator_from_selection';\nimport calculateTooltipState, {toggleTooltipSaved} from './calculate_tooltip_state';\nimport getDefaultBoundsCalculator from './get_default_bounds_calculator';\nimport inferType from './infer_type';\nimport {SIMPLE_DATA_TYPES} from './data_types';\nimport generatorParamsEqual from '../helpers/generator_params_equal';\nimport findMatchingAxis from './find_matching_axis';\nimport {DPI_INCREASE} from '../renderer/size_canvas';\nimport {averageLoopTimes} from './average_loop_times';\nimport condenseDataSpace from './space_conversions/condense_data_space.js';\nimport calculateAnnotationsState from './calculate_annotations_state.js';\nimport {selectedSpaceToBackgroundSpace} from './space_conversions/selected_space_to_background_space.js';\nimport RustAPI, {RustAPIPromise} from './rust_api';\n\nexport default class StateController extends Eventable {\n\n constructor({ defaultBoundsCalculator, customBoundsSelectors, requireWASM, defaultShowIndividualPoints, defaultShowSidebar, defaultShowAnnotations, defaultShowOptions, syncPool, grapherID, sharedDataCache, sharedSubscriptions, fullscreen }) {\n super();\n\n this._requireWASM = requireWASM;\n if (requireWASM) {\n RustAPIPromise.then(() => {\n this._markDirty();\n });\n }\n\n this._series = [];\n this._seriesFromOriginalSeries = new Map();\n\n this._axes = [\n {\n series: [],\n scale: 'linear',\n side: 'left',\n axisIndex: 0\n }\n ];\n this._highlightedSeries = null;\n\n this._showIndividualPoints = defaultShowIndividualPoints || false;\n this._autoscaleY = true;\n this._percentile = 100;\n this._percentileAsymmetry = 0;\n this._showingOptions = defaultShowOptions;\n this._maxPrecision = false;\n this._showingSidebar = defaultShowSidebar || false;\n this._showingAnnotations = defaultShowAnnotations || false;\n this._grapherID = grapherID;\n this._fullscreen = fullscreen || false;\n\n this._alwaysTooltipped = new Set();\n this._tooltipState = {\n mousePresent: false,\n mouseX: 0,\n mouseY: 0,\n elementWidth: 0,\n elementHeight: 0,\n tooltips: []\n };\n this._contextMenuPosition = {\n x: 0,\n y: 0,\n showing: false,\n value: null\n };\n this._savedTooltips = [];\n this._draggingY = false;\n this._annotations = [];\n this._annotationsState = {\n elementWidth: 0,\n annotations: []\n };\n this._enumMap = {};\n this._hasXEnum = false;\n\n this._timingBuffer = [];\n this._timingIndex = 0;\n this._timingFrameCount = 0;\n\n this._modifiedSeries = new Set();\n this._deferredEmissions = {};\n this._deferredPriorityEmissions = {};\n this.primaryRenderer = null;\n this.rangeGraphRenderer = null;\n\n this._boundsCalculator = getDefaultBoundsCalculator(defaultBoundsCalculator, customBoundsSelectors);\n this._boundsHistory = [this._boundsCalculator];\n this._boundsIndex = 0;\n\n this._dataCache = sharedDataCache || new Map();\n this._subscriptions = sharedSubscriptions || new Map();\n this._subscriptionsShared = !!sharedSubscriptions;\n this._observablesToSeries = new Map();\n this._generators = new Set();\n this._generatorsToSeries = new Map();\n this._generatorCallArgs = new Map();\n this._seriesChangedFromPromises = new Set();\n\n this._syncPool = syncPool;\n if (this._syncPool) {\n this._syncPool.add(this);\n }\n\n this._onDataChange();\n }\n\n dispose() {\n this.emit('dispose', this);\n\n this.clearListeners();\n\n if (!this._subscriptionsShared) {\n for (let listener of this._subscriptions.values()) {\n listener.unsubscribe();\n }\n this._subscriptions.clear();\n }\n\n for (let singleSeries of this._series) {\n this._removeSeries(singleSeries);\n }\n\n if (this._syncPool) {\n this._syncPool.remove(this);\n }\n\n this.disposed = true;\n }\n\n setSeries(series) {\n const userSeries = this._series.filter((singleSeries) => singleSeries.userCreated);\n const propsSeries = this._series.filter((singleSeries) => !singleSeries.userCreated);\n\n if (series.length === propsSeries.length) {\n let anyDifferent = false;\n for (let i = 0; i < series.length; i++) {\n if (series[i] !== this._series[i].originalSeries) {\n anyDifferent = true;\n break;\n }\n }\n\n if (!anyDifferent) {\n return;\n }\n } else {\n this._mustResize = this._mustResize || this._fullscreen;\n }\n\n const newSeriesSet = new Set(series);\n for (let singleSeries of propsSeries) {\n if (!newSeriesSet.has(singleSeries.originalSeries)) {\n this._removeSeries(singleSeries);\n }\n }\n\n this._series.splice(0);\n for (let i = 0; i < series.length; i++) {\n const originalSeries = series[i];\n\n let singleSeries = this._seriesFromOriginalSeries.get(originalSeries);\n if (!singleSeries) {\n singleSeries = {\n ...originalSeries,\n originalSeries\n };\n this._seriesFromOriginalSeries.set(originalSeries, singleSeries);\n\n if (singleSeries.defaultAlwaysTooltipped) {\n this._alwaysTooltipped.add(singleSeries);\n this._tooltipsChanged = true;\n this.deferredEmit('always_tooltipped_changed', this._alwaysTooltipped);\n }\n }\n\n singleSeries.index = i;\n this._series.push(singleSeries);\n this._assignAxisTo(singleSeries);\n\n if (singleSeries.hidden) {\n this._hideSeries(singleSeries);\n }\n }\n\n for (let i = 0; i < userSeries.length; i++) {\n const singleSeries = userSeries[i];\n singleSeries.index = i + series.length;\n this._series.push(singleSeries);\n }\n\n this.deferredEmit('series_changed', this._series);\n\n this._dataChanged = true;\n this._markDirty();\n }\n\n _markDirty() {\n if (this._frameRequested) {\n return;\n }\n\n if (this._requireWASM && !RustAPI) {\n return;\n }\n\n const frameRequestStart = performance.now();\n this._frameRequested = true;\n requestAnimationFrame(() => {\n if (this.disposed) {\n return;\n }\n\n const frameExecutionStart = performance.now();\n\n const dataProcessingStart = performance.now();\n if (this._dataChanged) {\n this._onDataChange();\n this._mustRerender = true;\n this._tooltipsChanged = true;\n this._annotationsChanged = true;\n } else if (this._modifiedSeries.size) {\n this._onDataAdd(this._modifiedSeries);\n this._mustRerender = true;\n this._tooltipsChanged = true;\n this._annotationsChanged = true;\n } else {\n if (this._primarySizeChanged) {\n this._calculatePrimarySizeDependents();\n this._mustRerender = true;\n }\n if (this._rangeGraphSizeChanged) {\n this._calculateRangeGraphSizeDependents();\n this._mustRerender = true;\n }\n }\n const dataProcessingEnd = performance.now();\n\n const renderPipelineStart = performance.now();\n if (this._mustRerender) {\n this._render();\n }\n const renderPipelineEnd = performance.now();\n\n const generatorsStart = performance.now();\n if (this._mustCallGenerators) {\n this._callGenerators();\n }\n const generatorsEnd = performance.now();\n\n const tooltipStart = performance.now();\n if (this._tooltipsChanged) {\n this._recalculateTooltips();\n }\n const tooltipEnd = performance.now();\n\n const contextMenuStart = performance.now();\n if (this._contextMenuChanged) {\n this._recalculateContextMenu();\n }\n const contextMenuEnd = performance.now();\n\n const annotationStart = performance.now();\n if (this._annotationsChanged) {\n this._recalculateAnnotations();\n }\n const annotationEnd = performance.now();\n\n if (this._mustResize) {\n this.primaryRenderer.resizeDebounced();\n this.rangeGraphRenderer && this.rangeGraphRenderer.resizeDebounced();\n }\n\n this._frameRequested = false;\n this._mustRerender = false;\n this._dataChanged = false;\n this._primarySizeChanged = false;\n this._rangeGraphSizeChanged = false;\n this._modifiedSeries.clear();\n this._seriesChangedFromPromises.clear();\n this._tooltipsChanged = false;\n this._contextMenuChanged = false;\n this._annotationsChanged = false;\n this._mustCallGenerators = false;\n this._mustResize = false;\n\n const callbacksStart = performance.now();\n for (let emission of [...Object.values(this._deferredPriorityEmissions), ...Object.values(this._deferredEmissions)]) {\n this.emit(...emission);\n }\n const callbacksEnd = performance.now();\n this._deferredEmissions = {};\n this._deferredPriorityEmissions = {};\n\n const completionTime = performance.now();\n const loopTime = {\n frameExecution: completionTime - frameExecutionStart,\n frameRequestAndExecution: completionTime - frameRequestStart,\n generators: generatorsEnd - generatorsStart,\n dataProcessing: dataProcessingEnd - dataProcessingStart,\n renderPipeline: renderPipelineEnd - renderPipelineStart,\n tooltips: tooltipEnd - tooltipStart,\n contextMenu: contextMenuEnd - contextMenuStart,\n annotations: annotationEnd - annotationStart,\n callbacks: callbacksEnd - callbacksStart\n };\n this.lastLoopTime = loopTime;\n if (this._timingFrameCount) {\n if (this._timingBuffer.length < this._timingFrameCount) {\n this._timingBuffer.push(loopTime);\n } else {\n this._timingBuffer[this._timingIndex % this._timingFrameCount] = loopTime;\n }\n this._timingIndex++;\n }\n this.emit('render_time', completionTime - frameExecutionStart, loopTime);\n });\n }\n\n deferredEmit(...args) {\n this._deferredEmissions[args[0]] = args;\n }\n\n deferredPriorityEmit(...args) {\n this._deferredPriorityEmissions[args[0]] = args;\n }\n\n _seriesToSimpleData(singleSeries) {\n const type = inferType(singleSeries);\n if (SIMPLE_DATA_TYPES.includes(type)) {\n return singleSeries.data;\n }\n\n // get a reference to whatever you already have\n let currentData = this._dataCache.get(singleSeries.data);\n\n if (currentData && this._seriesChangedFromPromises.has(singleSeries.data)) {\n return currentData;\n }\n\n if (!currentData) {\n currentData = [];\n this._dataCache.set(singleSeries.data, currentData);\n singleSeries.simpleData = currentData;\n }\n\n if (type === 'object_observable' || type === 'tuple_observable') {\n let sameDataSet = this._observablesToSeries.get(singleSeries.data);\n if (sameDataSet) {\n const firstSameDataSeries = sameDataSet.values().next().value;\n currentData = firstSameDataSeries.simpleData;\n if (!currentData) {\n throw new Error(`Cannot find simpleData in ${firstSameDataSeries.name || firstSameDataSeries.yKey || firstSameDataSeries.data}`);\n }\n this._dataCache.set(singleSeries.data, currentData);\n singleSeries.simpleData = currentData;\n } else {\n sameDataSet = new Set();\n singleSeries.simpleData = currentData;\n this._observablesToSeries.set(singleSeries.data, sameDataSet);\n }\n\n sameDataSet.add(singleSeries);\n\n this._listenToObservableData({\n observable: singleSeries.data,\n currentData\n });\n }\n\n if (type === 'generator') {\n if (!this._generatorsToSeries.has(singleSeries.data)) {\n this._generatorsToSeries.set(singleSeries.data, new Set());\n }\n\n this._generatorsToSeries.get(singleSeries.data).add(singleSeries);\n\n if (!this._generators.has(singleSeries.data)) {\n this._generators.add(singleSeries.data);\n this._callGenerator(singleSeries.data);\n }\n }\n\n // return whatever you have; it'll fetch more in the background\n return currentData;\n }\n\n _listenToPromise(singleSeries, dataPromise) {\n dataPromise.then((resolved) => {\n this._dataCache.set(singleSeries.data, resolved);\n singleSeries.simpleData = resolved;\n this._seriesChangedFromPromises.add(singleSeries.data);\n this._dataChanged = true;\n this._markDirty();\n });\n }\n\n _listenToObservableData({ observable, currentData }) {\n if (this._subscriptions.has(observable)) { // someone else already listened to it\n return;\n }\n this._subscriptions.set(observable, true);\n\n // listen to the new data\n const listener = observable.observe((point) => {\n if (Array.isArray(point)) {\n for (let datum of point) {\n currentData.push(datum);\n }\n } else {\n currentData.push(point);\n }\n\n this.emit('observable_modified', observable);\n\n this.markObservableModified(observable);\n });\n this._subscriptions.set(observable, listener);\n }\n\n markObservableModified(observable) {\n if (!this._observablesToSeries.has(observable)) {\n return;\n }\n\n for (let singleSeries of this._observablesToSeries.get(observable)) {\n this._modifiedSeries.add(singleSeries);\n }\n this._markDirty();\n }\n\n _unsubscribeFromStaleSeries() {\n const currentSeries = new Set(this._series);\n for (let [observable, seriesSet] of this._observablesToSeries) {\n let stillHasListener = false;\n\n for (let singleSeries of seriesSet) {\n if (currentSeries.has(singleSeries)) {\n stillHasListener = true;\n break;\n }\n }\n\n if (!stillHasListener) {\n this._subscriptions.get(observable).unsubscribe();\n this._subscriptions.delete(observable);\n this._observablesToSeries.delete(observable);\n }\n }\n\n for (let [generator, seriesSet ] of this._generatorsToSeries) {\n let stillHasSeries = false;\n\n for (let singleSeries of seriesSet) {\n if (currentSeries.has(singleSeries)) {\n stillHasSeries = true;\n break;\n }\n }\n\n if (!stillHasSeries) {\n this._generatorsToSeries.delete(generator);\n this._generators.delete(generator);\n this._generatorCallArgs.delete(generator);\n }\n }\n }\n\n async _callGenerator(generator) {\n const parameters = {\n minX: this._selection.minX,\n maxX: this._selection.maxX,\n sizing: this.primaryRenderer.sizing\n };\n\n if (generatorParamsEqual(this._generatorCallArgs.get(generator), parameters)) {\n return;\n }\n this._generatorCallArgs.set(generator, parameters);\n\n // Note: potential race condition if generator is stupid. For now, we'll rely on generator being smart\n // Race condition: a new, faster one runs before completed\n const data = await Promise.resolve(generator(parameters));\n\n // do nothing if the generator returned nothing\n if (!data) {\n return;\n }\n\n // because calling the generator may have taken some time, check that there are still listeners for it\n if (!this._generatorsToSeries.has(generator)) {\n return;\n }\n\n this._dataChanged = true;\n this._markDirty();\n\n if (typeof data.observe === 'function') {\n const currentData = [];\n this._dataCache.set(generator, currentData);\n for (let singleSeries of this._generatorsToSeries.get(generator)) {\n singleSeries.simpleData = currentData;\n }\n\n for (let singleSeries of this._generatorsToSeries.get(generator)) {\n if (!this._observablesToSeries.has(data)) {\n this._observablesToSeries.set(data, new Set());\n }\n\n this._observablesToSeries.get(data).add(singleSeries);\n }\n\n this._listenToObservableData({\n observable: data,\n currentData\n });\n } else {\n this._dataCache.set(generator, data);\n for (let singleSeries of this._generatorsToSeries.get(generator)) {\n singleSeries.simpleData = data;\n }\n }\n }\n\n _callGenerators() {\n for (let generator of this._generators) {\n this._callGenerator(generator);\n }\n }\n\n _recalculateTooltips() {\n if (!this.primaryRenderer || !this.primaryRenderer.sizing) {\n return;\n }\n\n this._tooltipState = calculateTooltipState({\n mousePresent: this._tooltipState.mousePresent,\n mouseX: this._tooltipState.mouseX,\n mouseY: this._tooltipState.mouseY,\n sizing: this.primaryRenderer.sizing,\n series: this._series,\n alwaysTooltipped: this._alwaysTooltipped,\n savedTooltips: this._savedTooltips,\n allTooltipped: this._tooltipAllNext,\n closestSpacing: this._globalBounds.closestSpacing\n });\n this._tooltipAllNext = false;\n this.deferredEmit('tooltip_state_changed', this._tooltipState, this._tooltipStateArg);\n this._tooltipStateArg = null;\n }\n \n _recalculateContextMenu() {\n if (!this.primaryRenderer || !this.primaryRenderer.sizing) {\n return;\n }\n\n const boundingRect = this.primaryRenderer.boundingRect;\n const sizing = this.primaryRenderer.sizing;\n let value = null;\n let newX = null;\n \n for (let series of this._series) {\n const bounds = series.axis.currentBounds;\n \n newX = this._contextMenuPosition.x - boundingRect.left;\n \n // if it's on the right side, move it to the left one width\n if (this._contextMenuPosition.x > (boundingRect.right - sizing.elementWidth) * 2) newX -= 130;\n\n if (series.xKey === 'timestamp' || series.xKey === 'time' || series.xKey === 'date') {\n value = new Date((this._contextMenuPosition.x - boundingRect.left) / sizing.elementWidth * (bounds.maxX - bounds.minX) + bounds.minX);\n } else {\n value = (this._contextMenuPosition.x - boundingRect.left) / sizing.elementWidth * (bounds.maxX - bounds.minX) + bounds.minX;\n }\n }\n this._contextMenuPosition = {\n x: newX,\n y: this._contextMenuPosition.y - boundingRect.top,\n showing: this._contextMenuPosition.showing,\n value: value\n };\n this.deferredEmit('context_menu_position_changed', this._contextMenuPosition);\n }\n\n _recalculateAnnotations() {\n if (!this.primaryRenderer || !this.primaryRenderer.sizing) {\n return;\n }\n\n this._annotationsState = calculateAnnotationsState({\n annotations: this._annotations,\n series: this._series,\n sizing: this.primaryRenderer.sizing,\n selection: this._selection\n });\n this.deferredEmit('annotations_changed', this._annotationsState);\n }\n\n _onDataChange() {\n this._expandYWith = [];\n const dataBoundsList = [];\n\n for (let singleSeries of this._series) {\n if (singleSeries.hidden) {\n continue;\n }\n\n const simpleData = this._seriesToSimpleData(singleSeries);\n const dataSpaceResult = simpleSeriesToDataSpace({\n ...singleSeries,\n data: simpleData\n }, {\n stateController: this\n });\n \n let inDataSpace, rangeValues, windDirections, windData;\n if (Array.isArray(dataSpaceResult)) {\n inDataSpace = dataSpaceResult;\n rangeValues = [];\n windDirections = null;\n windData = null;\n } else {\n inDataSpace = dataSpaceResult.data;\n rangeValues = dataSpaceResult.rangeValues || [];\n windDirections = dataSpaceResult.windDirections || null;\n windData = dataSpaceResult.windData || null;\n }\n \n singleSeries.inDataSpace = inDataSpace;\n singleSeries.windDirections = windDirections;\n singleSeries.windData = windData;\n singleSeries.simpleDataSliceStart = simpleData.length;\n singleSeries._rangeValues = rangeValues;\n const allYValues = [...inDataSpace.map(([x, y]) => y).filter(y => typeof y === 'number'), ...rangeValues];\n const extendedDataSpace = inDataSpace.map(([x, y]) => [x, y]);\n for (let rangeValue of rangeValues) {\n extendedDataSpace.push([null, rangeValue]);\n }\n \n singleSeries.dataBounds = calculateDataBounds(extendedDataSpace, { \n rangeValues: rangeValues \n });\n \n if (singleSeries.rendering === 'bar') {\n singleSeries.dataBounds = expandBounds(singleSeries.dataBounds, { extendXForNBars: singleSeries.inDataSpace.length, expandYWith: singleSeries.expandYWith });\n }\n\n dataBoundsList.push(singleSeries.dataBounds);\n\n if (singleSeries.expandYWith) {\n this._expandYWith.push(singleSeries.expandYWith);\n }\n }\n\n this._unsubscribeFromStaleSeries();\n\n this._dataBounds = mergeBounds(dataBoundsList);\n\n this._recalculateSelection({ disableSwap: true});\n\n for (let singleSeries of this._series) {\n if (singleSeries.hidden) {\n continue;\n }\n\n singleSeries.selectedBounds = calculateDataBounds(singleSeries.inSelectedSpace.data, { percentile: this._percentile, percentileAsymmetry: this._percentileAsymmetry });\n if (singleSeries.hasAreaBottom) {\n singleSeries.selectedBoundsAreaTop = singleSeries.selectedBounds;\n singleSeries.selectedBoundsAreaBottom = calculateDataBounds(singleSeries.inSelectedSpaceAreaBottom.data, { percentile: this._percentile, percentileAsymmetry: this._percentileAsymmetry });\n\n singleSeries.selectedBounds = mergeBounds([\n singleSeries.selectedBoundsAreaTop,\n singleSeries.selectedBoundsAreaBottom\n ]);\n }\n }\n\n this._recalculateAxisBounds();\n\n for (let singleSeries of this._series) {\n if (singleSeries.hidden) {\n continue;\n }\n\n this._calculatePrimarySizeDependents(singleSeries, { dataChanged: true });\n this._calculateRangeGraphSizeDependents(singleSeries, { dataChanged: true });\n }\n }\n\n _onDataAdd(modifiedSeries) {\n const newData = new Map();\n const modifiedAxes = new Set();\n\n const modifiedSeriesAndDependents = new Set();\n for (let singleSeries of modifiedSeries) {\n modifiedSeriesAndDependents.add(singleSeries);\n }\n\n for (let singleSeries of modifiedSeries) {\n modifiedAxes.add(singleSeries.axis);\n\n if (!singleSeries.inDataSpace) {\n throw new Error('inDataSpace must be present for onDataAdd to be called');\n }\n\n const simpleData = this._seriesToSimpleData(singleSeries);\n\n let prevY;\n if (singleSeries.inDataSpace.length) {\n prevY = singleSeries.inDataSpace[singleSeries.inDataSpace.length - 1][1];\n }\n\n const newDataInDataSpace = simpleSeriesToDataSpace(singleSeries, {\n data: simpleData.slice(singleSeries.simpleDataSliceStart || 0),\n valueXStart: singleSeries.inDataSpace.length,\n prevY,\n stateController: this\n });\n newData.set(singleSeries, newDataInDataSpace);\n singleSeries.simpleDataSliceStart = simpleData.length;\n\n if (newDataInDataSpace.length < 32) {\n singleSeries.inDataSpace.push(...newDataInDataSpace);\n } else {\n for (let point of newDataInDataSpace) {\n singleSeries.inDataSpace.push(point);\n }\n }\n\n let newDataBounds = calculateDataBounds(newDataInDataSpace);\n if (singleSeries.rendering === 'bar') {\n newDataBounds = expandBounds(newDataBounds, { extendXForNBars: singleSeries.inDataSpace.length, expandYWith: singleSeries.expandYWith });\n }\n\n singleSeries.dataBounds = mergeBounds([singleSeries.dataBounds, newDataBounds]);\n this._dataBounds = mergeBounds([this._dataBounds, newDataBounds]);\n\n // save these off for debugging only\n singleSeries.newPointCount = newDataInDataSpace.length;\n singleSeries.newDataBounds = newDataBounds;\n }\n\n const previousSelection = this._selection;\n this._recalculateSelection();\n\n for (let singleSeries of modifiedSeries) {\n if (!singleSeries.inSelectedSpace.data.length) { // empty, trivially fast\n singleSeries.selectedBounds = calculateDataBounds(singleSeries.inSelectedSpace.data);\n continue;\n }\n\n const firstX = singleSeries.inSelectedSpace.data[0][0];\n const lastX = singleSeries.inSelectedSpace.data[singleSeries.inSelectedSpace.data.length - 1][0];\n\n const oldBoundSubsetOfNewBounds = previousSelection.minX >= firstX && previousSelection.maxX <= lastX;\n\n if (!oldBoundSubsetOfNewBounds || this._percentile !== 100) {\n // this is significantly slower, but it's too complex to diff the old bounds and new bounds or diff percentiles\n // besides, it not being a subset hopefully means its a lower volume of data\n singleSeries.selectedBounds = calculateDataBounds(singleSeries.inSelectedSpace.data, { percentile: this._percentile, percentileAsymmetry: this._percentileAsymmetry});\n if (singleSeries.hasAreaBottom) {\n singleSeries.selectedBoundsAreaTop = singleSeries.selectedBounds;\n singleSeries.selectedBoundsAreaBottom = calculateDataBounds(singleSeries.inSelectedSpaceAreaBottom.data, { percentile: this._percentile, percentileAsymmetry: this._percentileAsymmetry });\n\n singleSeries.selectedBounds = mergeBounds([\n singleSeries.selectedBoundsAreaTop,\n singleSeries.selectedBoundsAreaBottom\n ]);\n }\n continue;\n }\n\n // note: we could do a binary search here, but there are typically only a few points added each frame, so it isn't worth it\n const newSelectedData = newData.get(singleSeries)\n .filter((tuple) => tuple[0] >= this._selection.minX && tuple[0] <= this._selection.maxX);\n\n singleSeries.newSelectedData = newSelectedData;\n singleSeries.selectedBounds = mergeBounds([singleSeries.selectedBounds, calculateDataBounds(newSelectedData)]);\n }\n\n this._recalculateAxisBounds();\n\n this.deferredPriorityEmit('axis_bounds_changed', this._axes.map(({ currentBounds }) => currentBounds));\n\n for (let axis of modifiedAxes) {\n for (let singleSeries of axis.series) {\n this._calculatePrimarySizeDependents(singleSeries);\n this._calculateRangeGraphSizeDependents(singleSeries);\n }\n }\n }\n\n _recalculateAxisBounds() {\n for (let axis of this._axes) {\n if (this._selection.fixedY || !this._autoscaleY) {\n axis.targetBounds = this._selection;\n if (axis.targetBounds.byAxis) {\n axis.targetBounds = axis.targetBounds.byAxis[axis.axisIndex];\n }\n\n const expandYWith = [];\n for (let singleSeries of axis.series) {\n if (singleSeries._rangeValues && singleSeries._rangeValues.length > 0) {\n const visibleRangeValues = [];\n \n for (let i = 0; i < singleSeries.inDataSpace.length; i++) {\n const [x, y] = singleSeries.inDataSpace[i];\n let xValue = x;\n let minXValue = axis.targetBounds.minX;\n let maxXValue = axis.targetBounds.maxX;\n \n if (x instanceof Date) {\n xValue = x.valueOf();\n }\n if (minXValue instanceof Date) {\n minXValue = minXValue.valueOf();\n }\n if (maxXValue instanceof Date) {\n maxXValue = maxXValue.valueOf();\n }\n \n if (minXValue !== null && maxXValue !== null && \n xValue >= minXValue && xValue <= maxXValue) {\n const rangeIndex = i * 2;\n if (rangeIndex < singleSeries._rangeValues.length) {\n visibleRangeValues.push(singleSeries._rangeValues[rangeIndex]);\n if (rangeIndex + 1 < singleSeries._rangeValues.length) {\n visibleRangeValues.push(singleSeries._rangeValues[rangeIndex + 1]);\n }\n }\n }\n }\n \n if (visibleRangeValues.length > 0) {\n expandYWith.push(...visibleRangeValues);\n }\n }\n }\n\n if (expandYWith.length > 0) {\n const validRangeValues = expandYWith.filter(y => typeof y === 'number');\n axis.currentBounds = {\n ...axis.targetBounds,\n minY: axis.targetBounds.minY === null ? Math.min(...validRangeValues) : axis.targetBounds.minY,\n maxY: axis.targetBounds.maxY === null ? Math.max(...validRangeValues) : axis.targetBounds.maxY\n };\n } else {\n axis.currentBounds = axis.targetBounds;\n }\n continue;\n }\n\n const selectedBoundsList = [];\n const expandYWith = [];\n\n for (let singleSeries of axis.series) {\n selectedBoundsList.push(singleSeries.selectedBounds);\n\n if (singleSeries.expandYWith) {\n expandYWith.push(...singleSeries.expandYWith);\n }\n\n if (singleSeries.rendering === 'bar') {\n expandYWith.push(singleSeries.selectedBounds.minY, singleSeries.selectedBounds.maxY);\n }\n\n if (singleSeries._rangeValues && singleSeries._rangeValues.length > 0) {\n const visibleRangeValues = [];\n \n for (let i = 0; i < singleSeries.inDataSpace.length; i++) {\n const [x, y] = singleSeries.inDataSpace[i];\n let xValue = x;\n let minXValue = singleSeries.selectedBounds.minX;\n let maxXValue = singleSeries.selectedBounds.maxX;\n \n if (x instanceof Date) {\n xValue = x.valueOf();\n }\n if (minXValue instanceof Date) {\n minXValue = minXValue.valueOf();\n }\n if (maxXValue instanceof Date) {\n maxXValue = maxXValue.valueOf();\n }\n \n if (minXValue !== null && maxXValue !== null && \n xValue >= minXValue && xValue <= maxXValue) {\n const rangeIndex = i * 2;\n if (rangeIndex < singleSeries._rangeValues.length) {\n visibleRangeValues.push(singleSeries._rangeValues[rangeIndex]);\n if (rangeIndex + 1 < singleSeries._rangeValues.length) {\n visibleRangeValues.push(singleSeries._rangeValues[rangeIndex + 1]);\n }\n }\n }\n }\n \n if (visibleRangeValues.length > 0) {\n expandYWith.push(...visibleRangeValues);\n }\n }\n }\n\n axis.selectedDataBounds = mergeBounds(selectedBoundsList);\n axis.targetBounds = axis.currentBounds = expandBounds(axis.selectedDataBounds, {expandYWith});\n }\n this.deferredPriorityEmit('axis_bounds_changed', this._axes.map(({ currentBounds }) => currentBounds));\n }\n\n /**\n * Recalculates global bounds, selection, and data in selected space (for each series)\n * REQUIRES that this._dataBounds and this._expandYWith are set & up-to-date\n *\n * @private\n */\n _recalculateSelection({disableSwap = false}={}) {\n this._globalBounds = expandBounds(this._dataBounds, {expandYWith: this._expandYWith.flat()});\n this.deferredPriorityEmit('global_bounds_changed', this._globalBounds);\n this._selection = selectionFromGlobalBounds(this._globalBounds, this._boundsCalculator);\n this.deferredPriorityEmit('selection_changed', this._selection);\n\n for (let singleSeries of this._series) {\n if (singleSeries.hidden) {\n continue;\n }\n\n singleSeries.inSelectedSpace = dataSpaceToSelectedSpace({\n data: singleSeries.hasAreaBottom ? singleSeries.inDataSpace.filter((_, i) => i % 2 === 1) : singleSeries.inDataSpace,\n swap: disableSwap ? null : singleSeries.inSelectedSpace,\n minX: this._selection.minX,\n maxX: this._selection.maxX,\n ignoreDiscontinuities: singleSeries.ignoreDiscontinuities,\n square: singleSeries.square\n });\n\n if (singleSeries.hasAreaBottom) {\n singleSeries.inSelectedSpaceAreaBottom = dataSpaceToSelectedSpace({\n data:singleSeries.inDataSpace.filter((_, i) => i % 2 === 0),\n swap: disableSwap ? null : singleSeries.inSelectedSpaceAreaBottom,\n minX: this._selection.minX,\n maxX: this._selection.maxX,\n ignoreDiscontinuities: singleSeries.ignoreDiscontinuities,\n square: singleSeries.square\n });\n }\n }\n }\n\n _render() {\n if (!this.primaryRenderer || !this.primaryRenderer.sizing) {\n return;\n }\n\n this.primaryRenderer.clear();\n if (this.rangeGraphRenderer) {\n this.rangeGraphRenderer.clear();\n }\n\n for (let singleSeries of this._series) {\n if (singleSeries.hidden) {\n continue;\n }\n\n const shadowColor = singleSeries.shadowColor || {\n day: 'white',\n export: 'transparent',\n night: 'black'\n }[this._theme] || 'black';\n\n const shadowBlur = undefined;\n\n this.primaryRenderer.renderBackground(singleSeries.inBackgroundSpacePrimary);\n\n this.primaryRenderer.render(singleSeries, singleSeries.inRenderSpacePrimary, {\n highlighted: this._highlightedSeries === singleSeries.index,\n showIndividualPoints: this._showIndividualPoints,\n shadowColor,\n shadowBlur,\n defaultLineWidth: this._defaultLineWidth,\n globalBounds: this._globalBounds,\n inRenderSpaceAreaBottom: singleSeries.inRenderSpacePrimaryAreaBottom\n });\n\n if (this.rangeGraphRenderer && this.rangeGraphRenderer.sizing) {\n // Use tighter bounds for range graph to prevent clipping\n const rangeGraphBounds = {\n ...this._globalBounds,\n minY: this._globalBounds.unscaledMinY !== undefined ? this._globalBounds.unscaledMinY : this._globalBounds.minY,\n maxY: this._globalBounds.unscaledMaxY !== undefined ? this._globalBounds.unscaledMaxY : this._globalBounds.maxY\n };\n \n this.rangeGraphRenderer.render(singleSeries, singleSeries.inRenderSpaceRangeGraph, {\n shadowColor: 'transparent',\n shadowBlur: 0,\n width: 1,\n showIndividualPoints: false,\n bounds: rangeGraphBounds,\n globalBounds: rangeGraphBounds,\n inRenderSpaceAreaBottom: singleSeries.inRenderSpaceRangeGraphAreaBottom\n });\n }\n }\n }\n\n _calculatePrimarySizeDependents(singleSeries, { dataChanged=false } = {}) {\n if (!this.primaryRenderer || !this.primaryRenderer.sizing) {\n return;\n }\n\n if (!singleSeries) {\n for (let s of this._series) {\n this._calculatePrimarySizeDependents(s);\n }\n return;\n }\n\n if (!this._series.includes(singleSeries)) {\n throw new Error('Series no longer exists');\n }\n\n if (singleSeries.hidden) {\n return;\n }\n\n const { currentBounds, scale } = singleSeries.axis;\n const renderWidth = Math.ceil(this.primaryRenderer.sizing.renderWidth/DPI_INCREASE);\n const renderHeight = Math.ceil(this.primaryRenderer.sizing.renderHeight);\n\n const toCondensedSelectedSpaceParams = {\n minX: currentBounds.minX,\n maxX: currentBounds.maxX,\n renderWidth,\n dataChanged\n };\n\n singleSeries.inCondensedSelectedSpacePrimary = condenseDataSpace({\n data: singleSeries.inSelectedSpace.data,\n swap: singleSeries.inCondensedSelectedSpacePrimary,\n ...toCondensedSelectedSpaceParams\n });\n\n const toRenderSpaceParams = {\n minX: currentBounds.minX,\n maxX: currentBounds.maxX,\n minY: currentBounds.minY,\n maxY: currentBounds.maxY,\n renderWidth,\n renderHeight,\n scale,\n dataChanged\n };\n\n singleSeries.inRenderSpacePrimary = selectedSpaceToRenderSpace({\n data: singleSeries.inCondensedSelectedSpacePrimary.data,\n swap: singleSeries.inRenderSpacePrimary,\n ...toRenderSpaceParams\n });\n\n singleSeries.inBackgroundSpacePrimary = selectedSpaceToBackgroundSpace({\n data: singleSeries.inCondensedSelectedSpacePrimary.data,\n background: singleSeries.background,\n swap: singleSeries.inBackgroundSpacePrimary,\n minX: currentBounds.minX,\n maxX: currentBounds.maxX\n });\n\n if (singleSeries.hasAreaBottom) {\n singleSeries.inCondensedSelectedSpacePrimaryAreaBottom = condenseDataSpace({\n data: singleSeries.inSelectedSpaceAreaBottom.data,\n swap: singleSeries.inCondensedSelectedSpacePrimaryAreaBottom,\n ...toCondensedSelectedSpaceParams\n });\n\n singleSeries.inRenderSpacePrimaryAreaBottom = selectedSpaceToRenderSpace({\n data: singleSeries.inCondensedSelectedSpacePrimaryAreaBottom.data,\n swap: singleSeries.inRenderSpacePrimaryAreaBottom,\n ...toRenderSpaceParams\n });\n\n singleSeries.inBackgroundSpacePrimaryAreaBottom = selectedSpaceToBackgroundSpace({\n data: singleSeries.inCondensedSelectedSpacePrimaryAreaBottom.data,\n background: singleSeries.background,\n swap: singleSeries.inBackgroundSpacePrimaryAreaBottom,\n minX: currentBounds.minX,\n maxX: currentBounds.maxX\n });\n }\n }\n\n _calculateRangeGraphSizeDependents(singleSeries, { dataChanged=false } = {}) {\n if (!this.rangeGraphRenderer || !this.rangeGraphRenderer.sizing) {\n return;\n }\n\n if (!singleSeries) {\n for (let s of this._series) {\n this._calculateRangeGraphSizeDependents(s);\n }\n return;\n }\n\n if (!this._series.includes(singleSeries)) {\n throw new Error('Series no longer exists');\n }\n\n if (singleSeries.hidden) {\n return;\n }\n\n const { scale } = singleSeries.axis;\n const globalBounds = this._globalBounds;\n \n const rangeGraphBounds = {\n ...globalBounds,\n minY: globalBounds.unscaledMinY !== undefined ? globalBounds.unscaledMinY : globalBounds.minY,\n maxY: globalBounds.unscaledMaxY !== undefined ? globalBounds.unscaledMaxY : globalBounds.maxY\n };\n \n const renderWidth = Math.ceil(this.rangeGraphRenderer.sizing.renderWidth/DPI_INCREASE);\n const renderHeight = Math.ceil(this.rangeGraphRenderer.sizing.renderHeight);\n\n const toSelectedSpaceParams = {\n minX: globalBounds.minX,\n maxX: globalBounds.maxX,\n ignoreDiscontinuities: singleSeries.ignoreDiscontinuities,\n square: singleSeries.square\n };\n\n singleSeries.inSelectedSpaceRangeGraph = dataSpaceToSelectedSpace({\n data: singleSeries.hasAreaBottom ? singleSeries.inDataSpace.filter((_, i) => i % 2 === 1) : singleSeries.inDataSpace,\n swap: singleSeries.inSelectedSpaceRangeGraph,\n ...toSelectedSpaceParams\n });\n\n const toCondensedSelectedSpaceParams = {\n minX: globalBounds.minX,\n maxX: globalBounds.maxX,\n renderWidth,\n dataChanged\n };\n\n singleSeries.inCondensedSelectedSpaceRangeGraph = condenseDataSpace({\n data: singleSeries.inSelectedSpaceRangeGraph.data,\n swap: singleSeries.inCondensedSelectedSpaceRangeGraph\n });\n\n const toRenderSpaceParams = {\n minX: rangeGraphBounds.minX,\n maxX: rangeGraphBounds.maxX,\n minY: rangeGraphBounds.minY,\n maxY: rangeGraphBounds.maxY,\n renderWidth,\n renderHeight,\n scale,\n dataChanged\n };\n\n singleSeries.inRenderSpaceRangeGraph = selectedSpaceToRenderSpace({\n data: singleSeries.inCondensedSelectedSpaceRangeGraph.data,\n swap: singleSeries.inRenderSpaceRangeGraph,\n ...toRenderSpaceParams\n });\n\n if (singleSeries.hasAreaBottom) {\n singleSeries.inSelectedSpaceRangeGraphAreaBottom = dataSpaceToSelectedSpace({\n data: singleSeries.inDataSpace.filter((_, i) => i % 2 === 0), // take the odd points for area bottom\n swap: singleSeries.inSelectedSpaceRangeGraphAreaBottom,\n ...toSelectedSpaceParams\n });\n\n singleSeries.inCondensedSelectedSpaceRangeGraphAreaBottom = condenseDataSpace({\n data: singleSeries.inSelectedSpaceRangeGraphAreaBottom.data,\n swap: singleSeries.inCondensedSelectedSpaceRangeGraphAreaBottom,\n ...toCondensedSelectedSpaceParams\n });\n\n singleSeries.inRenderSpaceRangeGraphAreaBottom = selectedSpaceToRenderSpace({\n data: singleSeries.inCondensedSelectedSpaceRangeGraphAreaBottom.data,\n swap: singleSeries.inRenderSpaceRangeGraphAreaBottom,\n ...toRenderSpaceParams\n });\n }\n }\n\n _createAxis({ side }) {\n const axis = {\n series: [],\n scale: 'linear',\n side,\n axisIndex: this._axes.length\n };\n this._axes.push(axis);\n return axis;\n }\n\n _moveAxis(singleSeries, axisIndex) {\n if (!this._series.includes(singleSeries)) {\n throw new Error('Series no longer exists');\n }\n\n let newAxis;\n if (axisIndex === 'new-left' || axisIndex === 'new-right') {\n newAxis = this._createAxis({ side: axisIndex.split('-')[1] });\n } else {\n newAxis = this._axes[parseInt(axisIndex)];\n }\n\n if (singleSeries.axis === newAxis) {\n return;\n }\n\n const oldAxis = singleSeries.axis;\n const oldIndex = oldAxis.series.indexOf(singleSeries);\n if (oldIndex === -1) {\n throw new Error('Series not present in axis');\n }\n oldAxis.series.splice(oldIndex, 1);\n\n newAxis.series.push(singleSeries);\n singleSeries.axis = newAxis;\n\n this._dataChanged = true;\n this.deferredEmit('axes_changed', this._axes);\n this.deferredEmit('left_axes_changed', this.leftAxes);\n this.deferredEmit('right_axes_changed', this.rightAxes);\n this.deferredEmit('exported_axes_changed', this.exportedAxes);\n this._markDirty();\n }\n\n _assignAxisTo(singleSeries) {\n if (singleSeries.axis && typeof singleSeries.axis === 'object') {\n return;\n }\n\n let axis;\n\n if (singleSeries.axisIndex) {\n const { axisIndex } = singleSeries;\n\n if (axisIndex === 'new-left' || axisIndex === 'new-right') {\n axis = this._createAxis({ side: axisIndex.split('-')[1] });\n } else {\n axis = this._axes[parseInt(axisIndex)];\n }\n } else if (singleSeries.axis) {\n singleSeries.originalAxis = singleSeries.axis;\n let [side, number] = singleSeries.axis.split('-');\n axis = findMatchingAxis({ axes: this._axes, side, number });\n\n if (!axis) {\n axis = this._createAxis({\n side\n });\n }\n } else {\n axis = this._axes[0];\n }\n\n axis.series.push(singleSeries);\n singleSeries.axis = axis;\n\n this.deferredEmit('axes_changed', this._axes);\n this.deferredEmit('exported_axes_changed', this.exportedAxes);\n\n if (singleSeries.axis.side === 'left') {\n this.deferredEmit('left_axes_changed', this.leftAxes);\n } else {\n this.deferredEmit('right_axes_changed', this.rightAxes);\n }\n }\n\n _removeSeries(singleSeries) {\n this._seriesFromOriginalSeries.delete(singleSeries.originalSeries);\n\n const { axis, data } = singleSeries;\n axis.series.splice(axis.series.indexOf(singleSeries), 1);\n const sameDataSet = this._observablesToSeries.get(data);\n if (sameDataSet) {\n sameDataSet.delete(singleSeries);\n if (sameDataSet.size === 0) {\n this._observablesToSeries.delete(data);\n }\n }\n\n if (this._generatorsToSeries.has(data)) {\n this._generatorsToSeries.get(data).delete(singleSeries);\n if (this._generatorsToSeries.get(data).size === 0) {\n this._generatorsToSeries.delete(data);\n this._generators.delete(data);\n }\n }\n\n this._alwaysTooltipped.delete(singleSeries);\n\n singleSeries.axis = singleSeries.originalAxis;\n delete singleSeries.originalAxis;\n delete singleSeries.inDataSpace;\n delete singleSeries.inSelectedSpace;\n delete singleSeries.inValueSpacePrimary;\n delete singleSeries.inValueSpaceRangeGraph;\n delete singleSeries.inRenderSpacePrimary;\n delete singleSeries.inRenderSpaceRangeGraph;\n delete singleSeries.newPointCount;\n delete singleSeries.newDataBounds;\n delete singleSeries.simpleDataSliceStart;\n\n this.deferredEmit('axes_changed', this._axes);\n this.deferredEmit('exported_axes_changed', this.exportedAxes);\n\n if (axis.side === 'left') {\n this.deferredEmit('left_axes_changed', this.leftAxes);\n } else {\n this.deferredEmit('right_axes_changed', this.rightAxes);\n }\n }\n\n _hideSeries(singleSeries) {\n const { axis } = singleSeries;\n const indexInAxis = axis.series.indexOf(singleSeries);\n singleSeries.indexInAxis = indexInAxis;\n axis.series.splice(indexInAxis, 1);\n\n this.deferredEmit('axes_changed', this._axes);\n\n if (axis.side === 'left') {\n this.deferredEmit('left_axes_changed', this.leftAxes);\n } else {\n this.deferredEmit('right_axes_changed', this.rightAxes);\n }\n }\n\n _showSeries(singleSeries) {\n const { axis } = singleSeries;\n axis.series.splice(singleSeries.indexInAxis, 0, singleSeries);\n\n this.deferredEmit('axes_changed', this._axes);\n\n if (axis.side === 'left') {\n this.deferredEmit('left_axes_changed', this.leftAxes);\n } else {\n this.deferredEmit('right_axes_changed', this.rightAxes);\n }\n }\n\n /*\n * Getters\n *******************\n */\n\n get boundCalculator() {\n return this._boundsCalculator;\n }\n\n get axes() {\n return this._axes;\n }\n\n get leftAxes() {\n const leftAxes = this._axes.filter(({ side, series }) => side === 'left' && series.length > 0).reverse();\n\n if (leftAxes.length === 0 && this.rightAxes.length === 0) {\n leftAxes.push(this._axes[0]);\n }\n\n return leftAxes;\n }\n\n get rightAxes() {\n return this._axes.filter(({ side, series }) => side === 'right' && series.length > 0 );\n }\n\n get bounds() {\n return this._axes.map(({ targetBounds }) => targetBounds);\n }\n\n get selection() {\n return this._selection;\n }\n\n get globalBounds() {\n return this._globalBounds;\n }\n\n get series() {\n return this._series;\n }\n\n get highlightedSeries() {\n return this._highlightedSeries;\n }\n\n get showIndividualPoints() {\n return this._showIndividualPoints;\n }\n\n get autoscaleY() {\n return this._autoscaleY;\n }\n\n get boundHistory() {\n return {\n hasNextBounds: this._boundsIndex < this._boundsHistory.length - 1,\n hasPreviousBounds: this._boundsIndex > 0\n };\n }\n\n get tooltipState() {\n return this._tooltipState;\n }\n \n get contextMenuState() {\n return this._contextMenuPosition;\n }\n\n get alwaysTooltipped() {\n return this._alwaysTooltipped;\n }\n\n get draggingY() {\n return this._draggingY;\n }\n\n get averageLoopTime() {\n return averageLoopTimes(this._timingBuffer);\n }\n\n get exportedAxes() {\n const axisToName = new Map();\n let leftCount = 0;\n let rightCount = 0;\n\n for (let axis of this._axes) {\n let name;\n if (axis.side === 'left') {\n name = `left-${leftCount}`;\n leftCount++;\n } else {\n name = `right-${rightCount}`;\n rightCount++;\n }\n\n for (let singleSeries of axis.series) {\n axisToName.set(singleSeries, name);\n }\n }\n\n return this.series.map((singleSeries) => {\n return {\n ...singleSeries.originalSeries,\n axis: axisToName.get(singleSeries)\n };\n });\n }\n\n get percentile() {\n return this._percentile;\n }\n\n get percentileAsymmetry() {\n return this._percentileAsymmetry;\n }\n\n get showingOptions() {\n return this._showingOptions;\n }\n\n get maxPrecision() {\n return this._maxPrecision;\n }\n\n get showingSidebar() {\n return this._showingSidebar;\n }\n\n get showingAnnotations() {\n return this._showingAnnotations;\n }\n\n get userCreatedSeries() {\n return this._series.filter((singleSeries) => singleSeries.userCreated);\n }\n\n get grapherID() {\n return this._grapherID;\n }\n\n get annotationState() {\n return this._annotationsState;\n }\n\n get sizing() {\n return this.primaryRenderer && this.primaryRenderer.sizing;\n }\n\n get theme() {\n return this._theme;\n }\n\n get exportMode() {\n return this._exportMode;\n }\n\n get enumMap() {\n return this._enumMap;\n }\n\n get hasXEnum() {\n return this._hasXEnum;\n }\n\n /*\n * Setters / ways to mutate the state that aren't the underlying data changing\n ***********************************************************************************\n */\n\n markSizeChanged(renderer) {\n if (renderer === this.primaryRenderer) {\n this.deferredEmit('primary_size_change', this.primaryRenderer.sizing);\n this.deferredEmit('primary_bounding_rect_change', this.primaryRenderer.boundingRect);\n this._primarySizeChanged = true;\n } else if (renderer === this.rangeGraphRenderer) {\n this.deferredEmit('range_graph_size_change', this.rangeGraphRenderer.sizing);\n this.deferredEmit('range_graph_bounding_rect_change', this.rangeGraphRenderer.boundingRect);\n this._rangeGraphSizeChanged = true;\n }\n\n this._mustRerender = true;\n this._tooltipsChanged = true;\n this._annotationsChanged = true;\n this._mustCallGenerators = true;\n this._markDirty();\n }\n\n set theme(value) {\n this._theme = value;\n this._mustRerender = true;\n this.deferredEmit('theme_change', this._theme);\n this._markDirty();\n }\n\n set exportMode(value) {\n this._exportMode = value;\n\n if (value) {\n this._nonExportTheme = this.theme;\n this.theme = 'export';\n } else {\n this.theme = this._nonExportTheme;\n }\n\n this.deferredEmit('export_mode_change', this._exportMode);\n this._markDirty();\n }\n\n set defaultLineWidth(value) {\n this._defaultLineWidth = value;\n this._mustRerender = true;\n this._markDirty();\n }\n\n set boundCalculator(boundingFunction) {\n if (!boundingFunction) {\n return;\n }\n\n if (boundingFunction === this._boundsCalculator) {\n return;\n }\n\n if (boundingFunction.debounceHistory) {\n clearTimeout(this._boundingCalculatorDebouncer);\n this._boundingCalculatorDebouncer = setTimeout(() => {\n this._addBoundCalculatorToHistory(boundingFunction);\n }, 250);\n } else {\n this._addBoundCalculatorToHistory(boundingFunction);\n }\n\n this._boundsCalculator = boundingFunction;\n this.deferredEmit('bound_calculator_changed', this._boundsCalculator);\n this._dataChanged = true;\n this._mustCallGenerators = true;\n this._markDirty();\n }\n\n set customBoundsSelectors(boundsSelectors) {\n this._customBoundsSelectors = this._customBoundsSelectors || {};\n\n const indexedCustomBoundSelectors = {};\n\n for (let { label, calculator } of boundsSelectors) {\n indexedCustomBoundSelectors[label] = calculator;\n\n if (this._boundsCalculator === this._customBoundsSelectors[label] && this._boundsCalculator !== calculator) {\n this.boundCalculator = calculator;\n }\n }\n\n this._customBoundsSelectors = indexedCustomBoundSelectors;\n }\n\n _addBoundCalculatorToHistory(boundingFunction) {\n this._boundsIndex++;\n this._boundsHistory = this._boundsHistory.slice(0, this._boundsIndex);\n this._boundsHistory.push(boundingFunction);\n this.emit('bound_history_changed', this.boundHistory);\n }\n\n registerSeriesClick(selectedSeriesIndex) {\n this.emit('series_click', this._series[selectedSeriesIndex], selectedSeriesIndex);\n }\n\n setHighlightedSeries(highlightedSeries) {\n this._highlightedSeries = highlightedSeries;\n this.deferredEmit('highlighted_series_changed', highlightedSeries);\n this._mustRerender = true;\n this._markDirty();\n }\n\n toggleIndividualPoints() {\n this._showIndividualPoints = !this._showIndividualPoints;\n this.deferredEmit('show_individual_points_changed', this._showIndividualPoints);\n this._mustRerender = true;\n this._markDirty();\n }\n\n toggleYAutoscaling() {\n this._autoscaleY = !this._autoscaleY;\n this.deferredEmit('autoscale_y_changed', this._autoscaleY);\n this._markDirty();\n }\n\n toggleExportMode() {\n this.exportMode = !this._exportMode;\n }\n\n setBoundsFromSelection(pixelSelection) {\n this.boundCalculator = boundCalculatorFromSelection(pixelSelection, {\n elementWidth: this.primaryRenderer.sizing.elementWidth,\n elementHeight: this.primaryRenderer.sizing.elementHeight,\n selection: this._selection,\n axes: this._axes\n });\n }\n\n nextBounds() {\n this._boundsIndex++;\n this._boundsCalculator = this._boundsHistory[this._boundsIndex];\n this.deferredEmit('bound_calculator_changed', this._boundsCalculator);\n this.deferredEmit('bound_history_changed', this.boundHistory);\n this._dataChanged = true;\n this._markDirty();\n }\n\n previousBounds() {\n this._boundsIndex--;\n this._boundsCalculator = this._boundsHistory[this._boundsIndex];\n this.deferredEmit('bound_calculator_changed', this._boundsCalculator);\n this.deferredEmit('bound_history_changed', this.boundHistory);\n this._dataChanged = true;\n this._markDirty();\n }\n\n setLabel({ axisIndex, label }) {\n this._axes[axisIndex].label = label;\n this.deferredEmit('axes_changed', [...this._axes]);\n this._markDirty();\n }\n\n toggleScale({ axisIndex }) {\n const oldScale = this._axes[axisIndex].scale;\n this._axes[axisIndex].scale = oldScale === 'log' ? 'linear' : 'log';\n\n this._dataChanged = true;\n this.deferredEmit('axes_changed', [...this._axes]);\n this._markDirty();\n }\n\n recalculateTooltips() {\n this.primaryRenderer.recalculatePosition();\n this.setTooltipMousePosition({\n clientX: this._tooltipClientX,\n clientY: this._tooltipClientY,\n shiftKey: this.shiftKeyPressedOnMove,\n tooltipAllNext: this._tooltipAllNext,\n tooltipStateArg: this._tooltipStateArg\n });\n }\n\n setTooltipMousePosition({ clientX, clientY, shiftKey, mouseX, mouseY, tooltipAllNext, tooltipStateArg }) {\n const sizing = this.primaryRenderer.sizing;\n if (!sizing) {\n return;\n }\n\n if (typeof clientX === 'number') {\n this._tooltipClientX = clientX;\n\n if (clientX < sizing.boundingRect.left || clientX > sizing.boundingRect.right) {\n this.showOnlySavedTooltips();\n return;\n }\n } else if (typeof mouseY !== 'number') {\n return;\n }\n\n if (typeof clientY === 'number') {\n this._tooltipClientY = clientY;\n\n if (clientY < sizing.boundingRect.top || clientY > sizing.boundingRect.bottom) {\n this.showOnlySavedTooltips();\n return;\n }\n } else if (typeof mouseY !== 'number') {\n return;\n }\n\n const newMouseX = mouseX || (clientX - sizing.boundingRect.left);\n const newMouseY = mouseY || (clientY - sizing.boundingRect.top);\n if (this._tooltipState.mousePresent && newMouseX === this._tooltipState.mouseX && newMouseY === this._tooltipState.mouseY) {\n return;\n }\n\n this._tooltipsChanged = true;\n this._tooltipState.mousePresent = true;\n this._tooltipState.mouseX = newMouseX;\n this._tooltipState.mouseY = newMouseY;\n this.shiftKeyPressedOnMove = shiftKey;\n this._tooltipAllNext = tooltipAllNext;\n this._tooltipStateArg = tooltipStateArg;\n this._markDirty();\n }\n \n setContextMenuMousePosition({ clientX, clientY }) {\n this._contextMenuPosition = { x: clientX, y: clientY, showing: !this._contextMenuPosition.showing };\n this._contextMenuChanged = true;\n this._markDirty();\n }\n\n toggleAlwaysTooltipped(singleSeries, shiftKey) {\n if (this._alwaysTooltipped.has(singleSeries)) {\n if (shiftKey) {\n this._alwaysTooltipped.clear();\n } else {\n this._alwaysTooltipped.delete(singleSeries);\n }\n } else {\n if (shiftKey) {\n for (let series of this._series) {\n this._alwaysTooltipped.add(series);\n }\n } else {\n this._alwaysTooltipped.add(singleSeries);\n }\n }\n\n this._tooltipsChanged = true;\n this.deferredEmit('always_tooltipped_changed', this._alwaysTooltipped);\n this._markDirty();\n }\n\n showOnlySavedTooltips(tooltipStateArg) {\n if (!this._tooltipState.mousePresent) {\n return;\n }\n\n this._tooltipsChanged = true;\n this._tooltipState.mousePresent = false;\n this._tooltipStateArg = tooltipStateArg;\n this._markDirty();\n }\n\n registerClick({ clientX }) {\n if (!this._listeners['series_click']) {\n return;\n }\n\n const boundingRect = this.primaryRenderer.boundingRect;\n const sizing = this.primaryRenderer.sizing;\n\n for (let series of this._series) {\n const bounds = series.axis.currentBounds;\n\n const x = (clientX - boundingRect.left) / sizing.elementWidth * (bounds.maxX - bounds.minX) + bounds.minX;\n this.emit('series_click', { x, series });\n }\n }\n\n toggleTooltipSaved() {\n const oldSavedTooltips = this._savedTooltips;\n this._savedTooltips = toggleTooltipSaved({\n currentTooltips: this._tooltipState.tooltips,\n savedTooltips: this._savedTooltips\n });\n this._tooltipsChanged = this._savedTooltips !== oldSavedTooltips;\n this._markDirty();\n }\n\n clearSavedTooltips() {\n if (this._savedTooltips.length === 0) {\n return;\n }\n\n this._savedTooltips = [];\n this._tooltipsChanged = true;\n this._markDirty();\n }\n\n markDragStart() {\n if (this._draggingY) {\n return;\n }\n\n this._draggingY = true;\n this.deferredEmit('dragging_y_changed', this._draggingY);\n this._markDirty();\n }\n\n finalizeDrag(draggedSeries, axisIndex, grapherID) {\n if (!this._draggingY) {\n return;\n }\n\n this._draggingY = false;\n this.deferredEmit('dragging_y_changed', this._draggingY);\n\n const hasAxis = axisIndex && axisIndex !== 0;\n const sameGrapherID = grapherID === this._grapherID;\n\n if (hasAxis && sameGrapherID) {\n this._moveAxis(draggedSeries, axisIndex);\n this.deferredEmit('dragging_y_finalized', { draggedSeries, axisIndex, grapherID });\n } else if (grapherID) {\n this.deferredEmit('dragging_y_finalized', { draggedSeries, axisIndex, grapherID });\n }\n\n this._markDirty();\n }\n\n set timingFrameCount(value) {\n if (typeof value !== 'number') {\n return;\n }\n\n this._timingBuffer = [];\n this._timingIndex = 0;\n this._timingFrameCount = value;\n }\n\n set percentile(value) {\n if (value === undefined) {\n return;\n }\n\n this.deferredEmit('percentile_changed', value);\n\n if (value === '') {\n value = 100;\n }\n\n value = parseFloat(value);\n if (!isNaN(value) && value <= 100 && value >= 0) {\n this._percentile = value;\n this._dataChanged = true;\n }\n\n this._markDirty();\n }\n\n set percentileAsymmetry(value) {\n if (value === undefined) {\n return;\n }\n\n this.deferredEmit('percentile_asymmetry_changed', value);\n\n if (value === '') {\n value = 0;\n }\n\n value = parseFloat(value);\n if (!isNaN(value) && value <= 50 && value >= -50) {\n this._percentileAsymmetry = value;\n this._dataChanged = true;\n }\n\n this._markDirty();\n }\n\n set showingOptions(value) {\n if (value === undefined) {\n return;\n }\n\n this._showingOptions = value;\n this.deferredEmit('showing_options_changed', value);\n this._markDirty();\n }\n\n toggleShowingOptions() {\n this.showingOptions = !this.showingOptions;\n }\n\n toggleMaxPrecision() {\n this._maxPrecision = !this._maxPrecision;\n this.deferredEmit('max_precision_changed', this._maxPrecision);\n this._markDirty();\n }\n\n toggleShowingAnnotations() {\n this._showingAnnotations = !this._showingAnnotations;\n this.deferredEmit('showing_annotations_changed', this._showingAnnotations);\n this._markDirty();\n }\n\n toggleShowingSidebar() {\n this._showingSidebar = !this._showingSidebar;\n this.deferredEmit('showing_sidebar_changed', this._showingSidebar);\n this._markDirty();\n }\n\n setShowing(singleSeries, showing) {\n singleSeries.hidden = !showing;\n this._series = [...this._series];\n\n if (singleSeries.hidden) {\n this._hideSeries(singleSeries);\n } else {\n this._showSeries(singleSeries);\n }\n\n this.deferredEmit('series_changed', this._series, { skipResize: true });\n this._dataChanged = true;\n this._markDirty();\n }\n\n set annotations(value) {\n this._annotations = value || [];\n this._annotationsChanged = true;\n this._markDirty();\n }\n\n /**\n * Converts an enum to a number, mutating saved state if necessary to track that\n *\n * @param {String} value\n * @param {Object} singleSeries\n * @param {Boolean} [isX]\n * @return {Number}\n */\n enumToNumber(value, singleSeries, isX) {\n const existingIndex = this._enumMap[value];\n if (typeof existingIndex === 'number') {\n return existingIndex;\n }\n\n const indexToSet = Object.keys(this._enumMap).length;\n this._enumMap[value] = indexToSet;\n\n // safely handle reference changes\n this._series[singleSeries.index].hasEnum = true;\n if (isX) {\n this._series[singleSeries.index].hasXEnum = true;\n this._hasXEnum = true;\n this.deferredEmit('has_x_enum_change', this._hasXEnum);\n this.deferredEmit('x_enum_map_change', this._enumMap);\n }\n\n this.deferredEmit('enum_map_change', this._enumMap);\n\n return indexToSet;\n }\n\n triggerResize() {\n this._mustResize = true;\n this._markDirty();\n }\n}\n","import BOUND_CALCULATORS from './bound_calculators';\n\nexport default function getDefaultBoundsCalculator(givenLabel, customCalculators) {\n if (BOUND_CALCULATORS[givenLabel]) {\n return BOUND_CALCULATORS[givenLabel];\n }\n\n for (let { label, calculator } of customCalculators) {\n if (givenLabel === label) {\n return calculator;\n }\n }\n\n return BOUND_CALCULATORS.all;\n}\n","export default function generatorParamsEqual(a, b) {\n if (a === undefined || b === undefined) {\n return a === b;\n }\n\n return (a.minX === b.minX) &&\n (a.maxX === b.maxX) &&\n (a.sizing.elementWidth === b.sizing.elementWidth) &&\n (a.sizing.renderWidth === b.sizing.renderWidth);\n}\n","import nameForSeries from '../helpers/name_for_series.js';\n\nexport default function calculateAnnotationsState({ annotations, series, sizing, selection }) {\n const shownSeries = new Set(series.map((singleSeries, i) => {\n return {\n name: nameForSeries(singleSeries, i),\n hidden: singleSeries.hidden\n };\n }).filter(({ hidden }) => !hidden).map(({ name }) => name));\n\n const { elementWidth } = sizing;\n const { minX, maxX } = selection;\n const xRange = maxX - minX;\n\n // Avoid division by zero if minX === maxX\n if (xRange === 0) {\n return {\n annotations: [],\n elementWidth\n };\n }\n\n const renderableAnnotations = annotations.filter((annotation) => {\n if (!annotation.series) {\n return true;\n }\n\n for (let seriesName of annotation.series) {\n if (shownSeries.has(seriesName)) {\n return true;\n }\n }\n\n return false;\n }).map((annotation) => {\n const isRange = annotation.startX !== undefined && annotation.endX !== undefined;\n const isPoint = annotation.x !== undefined;\n\n let xStartValue = annotation.startX;\n let xEndValue = annotation.endX;\n\n if (!isRange && isPoint) {\n xStartValue = annotation.x;\n xEndValue = annotation.x;\n } else if (!isRange && !isPoint) {\n return null;\n }\n\n const convertToNumber = (val) => {\n if (typeof val === 'string') return new Date(val).valueOf();\n if (val instanceof Date) return val.valueOf();\n return val;\n };\n\n let startX = convertToNumber(xStartValue);\n let endX = convertToNumber(xEndValue);\n\n if (startX > endX) {\n [startX, endX] = [endX, startX];\n }\n\n let pixelStartX = (startX - minX) / xRange * elementWidth;\n let pixelEndX = (endX - minX) / xRange * elementWidth;\n\n // Clamp values to be within the element width\n pixelStartX = Math.max(0, Math.min(elementWidth, pixelStartX));\n pixelEndX = Math.max(0, Math.min(elementWidth, pixelEndX));\n\n let pixelWidth = pixelEndX - pixelStartX;\n if (pixelWidth < 1 && pixelEndX > 0 && pixelStartX < elementWidth) {\n if (!isRange && isPoint) {\n pixelWidth = 1;\n pixelStartX -= 0.5;\n } else if (isRange) {\n pixelWidth = 1;\n } else {\n pixelWidth = 0;\n }\n }\n \n pixelStartX = Math.max(0, Math.min(elementWidth - pixelWidth, pixelStartX));\n\n\n if (pixelWidth <= 0) {\n return null;\n }\n\n\n return {\n ...annotation,\n isRange,\n pixelStartX,\n pixelWidth\n };\n }).filter(annotation => annotation !== null);\n\n return {\n annotations: renderableAnnotations,\n elementWidth\n };\n}\n","export default function selectionFromGlobalBounds(globalBounds, boundsCalculator) {\n const targetBounds = Object.assign({}, globalBounds, boundsCalculator(globalBounds));\n\n if (targetBounds.maxX instanceof Date) {\n targetBounds.maxX = targetBounds.maxX.valueOf();\n }\n\n if (targetBounds.minX instanceof Date) {\n targetBounds.minX = targetBounds.minX.valueOf();\n }\n\n if (targetBounds.maxX < targetBounds.minX) {\n targetBounds.maxX = targetBounds.minX;\n }\n\n if (targetBounds.minX < globalBounds.minX) {\n targetBounds.minX = globalBounds.minX;\n }\n\n if (targetBounds.maxX > globalBounds.maxX) {\n targetBounds.maxX = globalBounds.maxX;\n }\n\n return targetBounds;\n}\n","/**\n *\n * @param {Array<Object>} axes\n * @param {'left'|'right'} [side]\n * @param {String|Number} [number]\n * @return {Object|undefined}\n */\nexport default function findMatchingAxis({ axes, side, number }) {\n if (number) {\n number = parseInt(number) || 0;\n } else {\n number = 0;\n }\n\n let axis;\n let seen = 0;\n for (let candidateAxis of axes) {\n if (candidateAxis.side !== side) {\n continue;\n }\n\n if (seen === number) {\n axis = candidateAxis;\n break;\n }\n\n seen++;\n }\n\n return axis;\n}\n","export function averageLoopTimes(loopTimes) {\n const result = {};\n\n for (let loopTime of loopTimes) {\n for (let [key, value] of Object.entries(loopTime)) {\n result[key] = (result[key] || 0) + value;\n }\n }\n\n for (let [key, value] of Object.entries(result)) {\n result[key] = value/loopTimes.length;\n }\n\n return result;\n}\n","import scaleBounds from '../renderer/scale_bounds';\n\nexport default function boundCalculatorFromSelection({ minPixelX, maxPixelX, minPixelY, maxPixelY}, { elementWidth, elementHeight, selection, axes }) {\n if (Math.abs(maxPixelX - minPixelX) < 1 || Math.abs(maxPixelY - minPixelY) < 1) {\n return;\n }\n\n const minX = (minPixelX/elementWidth)*(selection.maxX - selection.minX) + selection.minX;\n const maxX = (maxPixelX/elementWidth)*(selection.maxX - selection.minX) + selection.minX;\n\n const byAxis = [];\n for (let { currentBounds, scale } of axes) {\n const scaledBounds = scaleBounds({ ...currentBounds, scale });\n let maxY = (1 - minPixelY/elementHeight)*(scaledBounds.maxY - scaledBounds.minY) + scaledBounds.minY;\n let minY = (1 - maxPixelY/elementHeight)*(scaledBounds.maxY - scaledBounds.minY) + scaledBounds.minY;\n\n if (scale === 'log') {\n minY = Math.pow(10, minY);\n maxY = Math.pow(10, maxY);\n }\n byAxis.push({\n minX,\n maxX,\n minY,\n maxY\n });\n }\n\n return () => {\n return {\n minX,\n maxX,\n byAxis\n };\n };\n}\n","import { useState, useEffect } from 'react';\n\nexport function useEvent(eventSource, eventName, initialState=null, watch=[]) {\n if (typeof initialState === 'function') {\n const originalInitialState = initialState;\n initialState = () => originalInitialState;\n }\n\n const [value, setValue] = useState(initialState);\n\n useEffect(() => {\n const listener = (updatedValue) => {\n if (typeof updatedValue === 'function') {\n const originalUpdatedValue = updatedValue;\n updatedValue = () => originalUpdatedValue;\n }\n setValue(updatedValue);\n };\n\n eventSource.on(eventName, listener);\n return () => {\n eventSource.off(eventName, listener);\n };\n }, [...watch, setValue, eventSource]);\n\n return value;\n}\n\nexport function usePrimarySize(stateController) {\n return useEvent(stateController, 'primary_size_change', stateController.primaryRenderer ? stateController.primaryRenderer.sizing : {\n elementWidth: 0,\n elementHeight: 0,\n renderWidth: 0,\n renderHeight: 0\n });\n}\n\nexport function useAxes(stateController) {\n return useEvent(stateController, 'axes_changed', stateController.axes);\n}\n\nexport function useSeries(stateController) {\n return useEvent(stateController, 'series_changed', stateController.series);\n}\n\nexport function useHighlightedSeries(stateController) {\n return useEvent(stateController, 'highlighted_series_changed', stateController.highlightedSeries);\n}\n\nexport function useRightAxisCount(stateController) {\n return useRightAxes(stateController).length;\n}\n\nexport function useLeftAxisCount(stateController) {\n return useLeftAxes(stateController).length;\n}\n\nexport function useRightAxes(stateController) {\n return useEvent(stateController, 'right_axes_changed', stateController.rightAxes);\n}\n\nexport function useLeftAxes(stateController) {\n return useEvent(stateController, 'left_axes_changed', stateController.leftAxes);\n}\n\nexport function useSelection(stateController) {\n return useEvent(stateController, 'selection_changed', stateController.selection);\n}\n\nexport function useGlobalBounds(stateController) {\n return useEvent(stateController, 'global_bounds_changed', stateController.globalBounds);\n}\n\nexport function useAxisBounds(stateController) {\n return useEvent(stateController, 'axis_bounds_changed', stateController.axes.map(({ currentBounds }) => currentBounds));\n}\n\nexport function useBoundCalculator(stateController) {\n return useEvent(stateController, 'bound_calculator_changed', stateController.boundCalculator);\n}\n\nexport function useShowIndividualPoints(stateController) {\n return useEvent(stateController, 'show_individual_points_changed', stateController.showIndividualPoints);\n}\n\nexport function useAutoscaleY(stateController) {\n return useEvent(stateController, 'autoscale_y_changed', stateController.autoscaleY);\n}\n\nexport function useBoundHistory(stateController) {\n return useEvent(stateController, 'bound_history_changed', stateController.boundHistory);\n}\n\nexport function useAlwaysTooltipped(stateController) {\n return useEvent(stateController, 'always_tooltipped_changed', stateController.alwaysTooltipped);\n}\n\nexport function useTooltipState(stateController) {\n return useEvent(stateController, 'tooltip_state_changed', stateController.tooltipState);\n}\n\nexport function useContextMenu(stateController) {\n return useEvent(stateController, 'context_menu_position_changed', stateController.contextMenuState);\n}\n\nexport function useDraggingY(stateController) {\n return useEvent(stateController, 'dragging_y_changed', stateController.draggingY);\n}\n\nexport function usePercentile(stateController) {\n return useEvent(stateController, 'percentile_changed', stateController.percentile);\n}\n\nexport function useShowingOptions(stateController) {\n return useEvent(stateController, 'showing_options_changed', stateController.showingOptions);\n}\n\nexport function useMaxPrecision(stateController) {\n return useEvent(stateController, 'max_precision_changed', stateController.maxPrecision);\n}\n\nexport function usePercentileAsymmetry(stateController) {\n return useEvent(stateController, 'percentile_asymmetry_changed', stateController.percentileAsymmetry);\n}\n\nexport function useShowingSidebar(stateController) {\n return useEvent(stateController, 'showing_sidebar_changed', stateController.showingSidebar);\n}\n\nexport function useShowingAnnotations(stateController) {\n return useEvent(stateController, 'showing_annotations_changed', stateController.showingAnnotations);\n}\n\nexport function useMultiSeries(multigraphStateController) {\n return useEvent(multigraphStateController, 'multi_series_changed', multigraphStateController.multiSeries);\n}\n\nexport function useAnnotationState(stateController) {\n return useEvent(stateController, 'annotations_changed', stateController.annotationState);\n}\n\nexport function useSizing(stateController) {\n return useEvent(stateController, 'primary_size_change', stateController.sizing);\n}\n\nexport function useTheme(stateController) {\n return useEvent(stateController, 'theme_change', stateController.theme);\n}\n\nexport function useExportMode(stateController) {\n return useEvent(stateController, 'export_mode_change', stateController.exportMode);\n}\n\nexport function useHasXEnum(stateController) {\n return useEvent(stateController, 'has_x_enum_change', stateController.hasXEnum);\n}\n\nexport function useEnumMap(stateController) {\n return useEvent(stateController, 'enum_map_change', stateController.enumMap);\n}\n\nexport function useXEnumMap(stateController) {\n return useEvent(stateController, 'x_enum_map_change', stateController.enumMap);\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nexport default class Annotations extends React.PureComponent {\n\n render() {\n const { bodyHeight, annotationState } = this.props;\n const { annotations, elementWidth } = annotationState;\n\n const validAnnotations = annotations.filter(a => a.pixelStartX !== undefined && a.pixelWidth !== undefined);\n\n return (\n <div className=\"grapher-annotations\">\n {\n validAnnotations.map(({ pixelStartX, pixelWidth, content, isRange, lineOnly }, i) => {\n const annotationStyle = {\n left: pixelStartX\n };\n\n if (isRange) {\n return (\n <div key={`range-${i}`} className=\"grapher-annotation grapher-annotation-range\" style={annotationStyle}>\n <div\n className=\"annotation-range-marker\"\n style={{ width: pixelWidth, height: bodyHeight }}\n />\n </div>\n );\n } else {\n const pointMarkerWidth = lineOnly ? pixelWidth : Math.max(pixelWidth, 1);\n\n const textStyle = {};\n if (content) {\n textStyle.top = 21 * i;\n textStyle.position = 'absolute';\n const approxTextWidth = (content || '').length * 5.5;\n if (elementWidth > 0 && elementWidth - pixelStartX < approxTextWidth + 10) {\n textStyle.left = -approxTextWidth - 5;\n textStyle.textAlign = 'right';\n } else {\n textStyle.left = pointMarkerWidth + 5;\n }\n }\n\n return (\n <div key={`point-${i}`} className=\"grapher-annotation grapher-annotation-point\" style={annotationStyle}>\n <div\n className=\"annotation-marker\"\n style={{ width: pointMarkerWidth, height: bodyHeight }}\n />\n {content && !lineOnly &&\n <div className=\"annotation-text\" style={textStyle}>\n {content}\n </div>\n }\n </div>\n );\n }\n })\n }\n </div>\n );\n }\n}\n\nAnnotations.propTypes = {\n annotationState: PropTypes.shape({\n annotations: PropTypes.arrayOf(PropTypes.shape({\n pixelStartX: PropTypes.number,\n pixelWidth: PropTypes.number,\n content: PropTypes.string,\n isRange: PropTypes.bool,\n lineOnly: PropTypes.bool\n })).isRequired,\n elementWidth: PropTypes.number.isRequired\n }),\n bodyHeight: PropTypes.number\n};\n","import React from 'react';\nimport CustomPropTypes from '../helpers/custom_prop_types.js';\nimport PropTypes from 'prop-types';\nimport StateController from '../state/state_controller.js';\nimport {LINE_COLORS} from '../helpers/colors.js';\nimport {useAxisBounds, useSizing} from '../state/hooks.js';\n\nexport default React.memo(DraggablePoints);\n\nfunction DraggablePoints({ stateController, draggablePoints, onPointDrag, onDraggablePointsDoubleClick }) {\n const bounds = useAxisBounds(stateController)[0];\n const sizing = useSizing(stateController);\n\n if (!sizing) {\n return null;\n }\n\n const onPointlessDoubleClick = onDraggablePointsDoubleClick && ((event) => {\n const newXT = (event.clientX - sizing.boundingRect.left)/sizing.elementWidth;\n const newYT = 1 - (event.clientY - sizing.boundingRect.top)/sizing.elementHeight;\n\n onDraggablePointsDoubleClick(event, {\n x: newXT*(bounds.maxX - bounds.minX) + bounds.minX,\n y: newYT*(bounds.maxY - bounds.minY) + bounds.minY\n });\n });\n\n return (\n <div className=\"grapher-draggable-points\" onDoubleClick={onPointlessDoubleClick}>\n <svg width={sizing.elementWidth} height={sizing.elementHeight}>\n {\n draggablePoints.map((point, index) => {\n const xT = (point.x - bounds.minX)/(bounds.maxX - bounds.minX);\n const yT = (1 - (point.y - bounds.minY)/(bounds.maxY - bounds.minY));\n\n if (xT < 0 || xT > 1 || yT < 0 || yT > 1) {\n return null;\n }\n\n const pixelX = xT * sizing.elementWidth;\n const pixelY = yT * sizing.elementHeight;\n\n const radius = point.radius || 5;\n const fillColor = point.fillColor || LINE_COLORS[0];\n const strokeColor = point.strokeColor || 'white';\n const strokeWidth = point.strokeWidth || 1;\n\n const onMouseDown = (event) => {\n event.stopPropagation();\n\n if (!onPointDrag) {\n return;\n }\n\n const xOffset = pixelX - event.clientX;\n const yOffset = pixelY - event.clientY;\n\n const onMouseMove = (moveEvent) => {\n const newXT = (moveEvent.clientX + xOffset)/sizing.elementWidth;\n const newYT = 1 - (moveEvent.clientY + yOffset)/sizing.elementHeight;\n\n onPointDrag({\n index,\n point,\n x: newXT*(bounds.maxX - bounds.minX) + bounds.minX,\n y: newYT*(bounds.maxY - bounds.minY) + bounds.minY\n }, moveEvent);\n };\n\n const onMouseUp = () => {\n window.removeEventListener('mousemove', onMouseMove);\n window.removeEventListener('mouseup', onMouseUp);\n };\n\n window.addEventListener('mousemove', onMouseMove);\n window.addEventListener('mouseup', onMouseUp);\n };\n\n const onClick = point.onClick && ((event) => {\n point.onClick(event, point);\n });\n\n const onDoubleClick = point.onDoubleClick && ((event) => {\n event.stopPropagation();\n point.onDoubleClick(event, point);\n });\n\n return (\n <circle\n key={index}\n cx={pixelX}\n cy={pixelY}\n r={radius}\n fill={fillColor}\n stroke={strokeColor}\n strokeWidth={strokeWidth}\n onMouseDown={onMouseDown}\n onClick={onClick}\n onDoubleClick={onDoubleClick}\n />\n );\n })\n }\n </svg>\n </div>\n );\n}\n\nDraggablePoints.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n draggablePoints: CustomPropTypes.DraggablePoints.isRequired,\n onPointDrag: PropTypes.func,\n onDraggablePointsDoubleClick: PropTypes.func\n};\n","import React from 'react';\nimport CustomPropTypes from '../helpers/custom_prop_types.js';\nimport PropTypes from 'prop-types';\nimport StateController from '../state/state_controller.js';\nimport {useAxisBounds, useSizing} from '../state/hooks.js';\n\nexport default React.memo(VerticalLines);\n\nfunction VerticalLines({ stateController, verticalLines, isRangeGraph, bounds, elementWidth, elementHeight }) {\n bounds = bounds || useAxisBounds(stateController)[0];\n const sizing = useSizing(stateController);\n\n if (!sizing) {\n return null;\n }\n\n const relevantVerticalLines = verticalLines.filter(line => {\n if (isRangeGraph && !line.onRangeGraph) {\n return false;\n }\n\n if (line.onRangeGraphOnly && !isRangeGraph) {\n return false;\n }\n\n return true;\n });\n\n if (relevantVerticalLines.length === 0) {\n return null;\n }\n\n return (\n <div className=\"grapher-vertical-lines\">\n <svg width={elementWidth || sizing.elementWidth} height={elementHeight || sizing.elementHeight}>\n {\n relevantVerticalLines.map((line, index) => {\n if (isRangeGraph && typeof line.onRangeGraph === 'object') {\n line = {\n ...line,\n ...line.onRangeGraph\n };\n }\n\n const xT = (line.x - bounds.minX)/(bounds.maxX - bounds.minX);\n\n if (xT < 0 || xT > 1) {\n return null;\n }\n\n const pixelX = xT * (elementWidth || sizing.elementWidth);\n if (typeof line.minPixelX === 'number' && pixelX < line.minPixelX) {\n return null;\n }\n\n if (typeof line.maxPixelX === 'number' && pixelX > line.maxPixelX) {\n return null;\n }\n\n const lineStyle = {\n stroke: line.color,\n strokeWidth: line.width,\n ...(line.style || {})\n };\n\n const markerStyle = {\n fill: line.color,\n ...(line.markerStyle || {})\n };\n\n const textStyle = {\n ...{\n fontSize: '12px',\n fill: line.color,\n stroke: 'none',\n textAnchor: 'middle',\n dominantBaseline: 'hanging'\n },\n ...(line.textStyle || {})\n };\n\n let lineTop = 0;\n if (typeof line.lineTop === 'number') {\n lineTop = line.lineTop;\n } else if (line.text) {\n lineTop = 18;\n }\n\n let textTop = 5;\n if (typeof line.textTop === 'number') {\n textTop = line.textTop;\n }\n\n return (\n <React.Fragment key={index}>\n <line\n x1={pixelX}\n y1={lineTop}\n x2={pixelX}\n y2={(elementHeight || sizing.elementHeight)}\n style={lineStyle}\n />\n\n {\n line.markTop &&\n <polygon\n points={`${pixelX - 3},0 ${pixelX + 3},0 ${pixelX},3`}\n style={markerStyle}\n />\n }\n\n {\n line.text &&\n <text\n x={pixelX}\n y={textTop}\n style={textStyle}\n >\n {line.text}\n </text>\n }\n </React.Fragment>\n );\n })\n }\n </svg>\n </div>\n );\n}\n\nVerticalLines.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n verticalLines: CustomPropTypes.VerticalLines.isRequired,\n isRangeGraph: PropTypes.bool,\n bounds: PropTypes.object,\n elementWidth: PropTypes.number,\n elementHeight: PropTypes.number\n};\n","import React, { useCallback, useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport CustomPropTypes from '../helpers/custom_prop_types';\nimport GraphBodyRenderer from '../renderer/graph_body_renderer';\nimport Tooltip from './tooltip.jsx';\nimport ContextMenu from './context_menu.jsx';\nimport StateController from '../state/state_controller';\nimport {\n useAnnotationState,\n useAutoscaleY,\n useAxes,\n useMaxPrecision,\n useShowingAnnotations,\n useTooltipState,\n useContextMenu\n} from '../state/hooks';\nimport Annotations from './annotations.jsx';\nimport DraggablePoints from './draggable_points.jsx';\nimport VerticalLines from './vertical_lines.jsx';\nimport binarySearch from '../helpers/binary_search';\n\nexport default React.memo(GraphBody);\n\nfunction GraphBody({ stateController, webgl, bodyHeight, boundsSelectionEnabled, showTooltips, showContextMenu=true, tooltipOptions, checkIntersection, draggablePoints, onPointDrag, onDraggablePointsDoubleClick, verticalLines, clockStyle, timeZone, onPointClick }) {\n const canvasEl = useCallback((el) => {\n if (stateController.primaryRenderer) {\n stateController.primaryRenderer.dispose();\n }\n\n if (!el) {\n return;\n }\n\n const renderer = new GraphBodyRenderer({\n stateController: stateController,\n canvasElement: el,\n webgl,\n checkIntersection\n });\n\n stateController.primaryRenderer = renderer;\n renderer.resize();\n }, [webgl, stateController]);\n\n\n const [boundsSelection, setBoundsSelection] = useState({\n showing: false,\n start: {},\n style: {}\n });\n\n const autoscaleY = useAutoscaleY(stateController);\n\n const axisCount = useAxes(stateController).length;\n\n const tooltip = useTooltipState(stateController);\n const maxPrecision = useMaxPrecision(stateController);\n const showAnnotations = useShowingAnnotations(stateController);\n const annotationState = useAnnotationState(stateController);\n const contextMenu = useContextMenu(stateController);\n\n const onMouseDown = (event) => {\n if (!boundsSelectionEnabled) {\n return;\n }\n\n let currentNode = event.target;\n for (let i = 0; i < 10 && currentNode; i++) {\n if (currentNode.classList.contains('grapher-tooltip')) {\n return;\n }\n currentNode = currentNode.parentNode;\n }\n\n const boundingRect = stateController.primaryRenderer.boundingRect;\n\n const start = {\n x: event.clientX - boundingRect.left,\n y: event.clientY - boundingRect.top\n };\n\n\n setBoundsSelection({\n showing: true,\n start,\n style: {\n left: start.x,\n top: start.y,\n width: 0,\n height: 0\n }\n });\n\n const onMouseUp = (event) => {\n window.removeEventListener('mouseup', onMouseUp);\n\n if (!boundsSelectionEnabled) {\n return;\n }\n\n const x = event.clientX - boundingRect.left;\n const y = event.clientY - boundingRect.top;\n\n stateController.setBoundsFromSelection({\n minPixelX: Math.min(x, start.x),\n maxPixelX: Math.max(x, start.x),\n minPixelY: Math.min(y, start.y),\n maxPixelY: Math.max(y, start.y)\n });\n\n setBoundsSelection({\n showing: false,\n style: {}\n });\n };\n\n window.addEventListener('mouseup', onMouseUp);\n };\n\n const onMouseMove = (event) => {\n if (boundsSelection.showing) {\n const boundingRect = stateController.primaryRenderer.boundingRect;\n const x = event.clientX - boundingRect.left;\n const y = event.clientY - boundingRect.top;\n\n setBoundsSelection(({ start }) => {\n return {\n showing: true,\n start,\n style: {\n left: Math.min(x, start.x),\n top: autoscaleY ? 0 : Math.min(y, start.y),\n width: Math.abs(x - start.x),\n height: autoscaleY ? boundingRect.height : Math.abs(y - start.y)\n }\n };\n });\n }\n };\n\n useEffect(() => {\n const onScroll = () => {\n if (!showTooltips) {\n return;\n }\n\n stateController.recalculateTooltips();\n };\n\n const onGlobalMouseMove = (event) => {\n if (!showTooltips) {\n return;\n }\n\n stateController.setTooltipMousePosition({\n clientX: event.clientX,\n clientY: event.clientY,\n shiftKey: event.shiftKey\n });\n };\n\n const getTouch = (event) => event.touches?.[0] || event.changedTouches?.[0];\n\n const onGlobalTouchStart = (event) => {\n if (!showTooltips) {\n return;\n }\n const touch = getTouch(event);\n if (!touch) return;\n stateController.setTooltipMousePosition({\n clientX: touch.clientX,\n clientY: touch.clientY\n });\n \n // Only prevent default if touch is within grapher bounds\n if (event.cancelable && event.target.closest('.graph-body')) {\n event.preventDefault();\n }\n };\n\n const onGlobalTouchMove = (event) => {\n if (!showTooltips) {\n return;\n }\n const touch = getTouch(event);\n if (!touch) return;\n stateController.setTooltipMousePosition({\n clientX: touch.clientX,\n clientY: touch.clientY\n });\n \n // Only prevent default if touch is within grapher bounds\n if (event.cancelable && event.target.closest('.graph-body')) {\n event.preventDefault();\n }\n };\n\n const onGlobalTouchEnd = () => {\n stateController.showOnlySavedTooltips();\n };\n\n window.addEventListener('scroll', onScroll, { passive: true });\n window.addEventListener('mousemove', onGlobalMouseMove, { passive: true });\n window.addEventListener('touchstart', onGlobalTouchStart, { passive: false });\n window.addEventListener('touchmove', onGlobalTouchMove, { passive: false });\n window.addEventListener('touchend', onGlobalTouchEnd, { passive: true });\n window.addEventListener('touchcancel', onGlobalTouchEnd, { passive: true });\n\n return () => {\n window.removeEventListener('scroll', onScroll);\n window.removeEventListener('mousemove', onGlobalMouseMove);\n window.removeEventListener('touchstart', onGlobalTouchStart);\n window.removeEventListener('touchmove', onGlobalTouchMove);\n window.removeEventListener('touchend', onGlobalTouchEnd);\n window.removeEventListener('touchcancel', onGlobalTouchEnd);\n };\n }, []);\n\n const onMouseLeave = () => {\n stateController.setContextMenuMousePosition({\n showing: false\n });\n };\n\n const onClick = (event) => {\n stateController.registerClick({\n clientX: event.clientX,\n clientY: event.clientY\n });\n\n if (tooltipOptions && tooltipOptions.savingDisabled) {\n stateController.clearSavedTooltips();\n return;\n }\n\n // if it's NOT a child of 'grapher-context-menu', close the context menu\n if (!event.target.closest('.grapher-context-menu')) {\n stateController.setContextMenuMousePosition({\n showing: false\n });\n }\n\n if (!window.getSelection || window.getSelection().type !== 'Range') {\n stateController.toggleTooltipSaved();\n }\n\n if (onPointClick) {\n const seriesToNearestPoint = {};\n\n const series = stateController.series;\n for (let i = 0; i < series.length; i++) {\n const singleSeries = series[i];\n\n const sizing = stateController.sizing;\n const bounds = singleSeries.axis.currentBounds;\n // const trueX = event.clientX/sizing.elementWidth * (bounds.maxX - bounds.minX) + bounds.minX;\n const trueX = stateController.tooltipState.mouseX/sizing.elementWidth * (bounds.maxX - bounds.minX) + bounds.minX;\n\n let data = singleSeries.inDataSpace;\n if (singleSeries.ignoreDiscontinuities) {\n data = data.filter((tuple) => typeof tuple[1] === 'number');\n }\n \n const closestIndex = binarySearch(data, trueX, { returnIndex: true });\n const closestPoint = data[closestIndex];\n\n seriesToNearestPoint[singleSeries.name] = closestPoint[0];\n }\n\n\n\n onPointClick(event, seriesToNearestPoint);\n }\n };\n const onDoubleClick = () => {\n stateController.clearSavedTooltips();\n };\n \n const onContextMenu = (event) => {\n event.preventDefault();\n if (showContextMenu !== false) {\n stateController.setContextMenuMousePosition({\n clientX: event.clientX,\n clientY: event.clientY,\n showing: true\n });\n }\n };\n\n return (\n <div className=\"graph-body graph-body-primary\"\n onMouseMove={onMouseMove}\n onMouseLeave={onMouseLeave}\n onMouseDown={onMouseDown}\n onClick={onClick}\n onDoubleClick={onDoubleClick}\n onContextMenu={onContextMenu}\n style={typeof bodyHeight === 'number' ? { height: bodyHeight } : undefined}\n >\n <canvas ref={canvasEl} />\n\n {\n showTooltips &&\n <Tooltip\n axisCount={axisCount}\n maxPrecision={maxPrecision}\n clockStyle={clockStyle}\n timeZone={timeZone}\n {...(tooltipOptions || {})}\n {...tooltip}\n />\n }\n\n {\n contextMenu.showing &&\n <ContextMenu\n contextMenu={contextMenu}\n />\n }\n\n {\n showAnnotations &&\n <Annotations\n bodyHeight={bodyHeight || stateController?.primaryRenderer?.boundingRect?.height}\n annotationState={annotationState}\n />\n }\n\n {\n verticalLines &&\n <VerticalLines\n stateController={stateController}\n verticalLines={verticalLines}\n />\n }\n\n {\n draggablePoints &&\n <DraggablePoints\n stateController={stateController}\n draggablePoints={draggablePoints}\n onPointDrag={onPointDrag}\n onDraggablePointsDoubleClick={onDraggablePointsDoubleClick}\n />\n }\n\n {\n boundsSelectionEnabled && boundsSelection.showing &&\n <div className=\"bounds-selection\"\n style={boundsSelection.style}\n />\n }\n </div>\n );\n}\n\nGraphBody.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n webgl: PropTypes.bool,\n checkIntersection: PropTypes.bool,\n bodyHeight: PropTypes.number,\n boundsSelectionEnabled: PropTypes.bool.isRequired,\n showTooltips: PropTypes.bool.isRequired,\n tooltipOptions: CustomPropTypes.TooltipOptions,\n verticalLines: CustomPropTypes.VerticalLines,\n draggablePoints: CustomPropTypes.DraggablePoints,\n onPointDrag: PropTypes.func,\n onDraggablePointsDoubleClick: PropTypes.func,\n onPointClick: PropTypes.func,\n clockStyle: PropTypes.oneOf(['12h', '24h']),\n timeZone: PropTypes.string\n};","\n import API from \"!../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../node_modules/css-loader/dist/cjs.js!../node_modules/sass-loader/dist/cjs.js!./grapher.scss\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../node_modules/css-loader/dist/cjs.js!../node_modules/sass-loader/dist/cjs.js!./grapher.scss\";\n export default content && content.locals ? content.locals : undefined;\n","import {startOfDayInTimezone, timezoneToOffsetMS} from './format';\n\nfunction placeTick(trueValue, {scale, min, max, inverted, totalSize, precision, formatter, dates, justTime, justDate, formatOptions={} }, opts={}) {\n let scaledValue = trueValue;\n\n if (scale === 'log') {\n scaledValue = 10**trueValue;\n }\n\n let percent = (trueValue - min)/(max - min);\n if (inverted) {\n percent = 1.0 - percent;\n }\n\n let pixelValue = percent * totalSize;\n if (isNaN(pixelValue)) {\n pixelValue = 0;\n }\n\n return {\n pixelValue,\n trueValue: scaledValue,\n label: formatter(scaledValue, { ...formatOptions, precision, log: scale === 'log', dates, justTime, justDate }),\n size: 'major',\n ...opts\n };\n}\n\nfunction placeTickByPixel(pixelValue, {scale, min, max, inverted, totalSize, precision, formatter, dates, justTime, justDate, formatOptions={} }, opts={}) {\n let percent = pixelValue/totalSize;\n if (inverted) {\n percent = 1.0 - percent;\n }\n\n let trueValue = percent * (max - min) + min;\n\n if (scale === 'log') {\n trueValue = Math.pow(10, trueValue);\n }\n\n return {\n pixelValue,\n trueValue,\n label: formatter(trueValue, { ...formatOptions, precision, log: scale === 'log', dates, justTime, justDate }),\n size: 'major',\n ...opts\n };\n}\n\nfunction roundToEvenNumber(value, tickSpacing) {\n return Math.round(value/tickSpacing)*tickSpacing;\n}\n\nfunction getEvenTickSpacing(span, desiredCount) {\n const subspan = span/desiredCount;\n\n const precision = -Math.log10(Math.abs(subspan)) + 1;\n const multiplier = (precision - Math.floor(precision)) > 0.5 ? 2 : 1;\n\n const roundTo = 10**Math.floor(precision) * multiplier;\n\n return Math.round(subspan * roundTo)/roundTo;\n}\n\nfunction roundToDivisor(value, divisor) {\n if (value <= 1) {\n return 1;\n }\n\n if (divisor === 1) {\n return Math.round(value);\n }\n\n if (value >= divisor) {\n return Math.round(value/divisor)*divisor;\n }\n\n let divisors;\n if (divisor === 24) {\n divisors = [1, 2, 6, 12, 24];\n } else if (divisor === 60) {\n divisors = [1, 2, 5, 10, 15, 30, 60];\n } else {\n throw new Error('Invalid divisor');\n }\n\n let bestDelta = Infinity;\n let bestDivisor = 1;\n for (let i = 0; i < divisors.length; i++) {\n const delta = Math.abs(divisors[i] - value);\n if (delta < bestDelta) {\n bestDivisor = divisors[i];\n bestDelta = delta;\n }\n }\n\n return bestDivisor;\n}\n\nfunction getEvenDateTickSpacing(span, desiredCount, unitOverride) {\n const subspan = span / desiredCount;\n\n if (subspan < 60*1000 && (!unitOverride || unitOverride === 'second')) {\n return {\n amount: roundToDivisor(subspan/1000, 60),\n unit: 's'\n };\n }\n\n if (subspan < 60*60*1000 && (!unitOverride || unitOverride === 'minute')) {\n return {\n amount: roundToDivisor(subspan/(60*1000), 60),\n unit: 'm'\n };\n }\n\n if (subspan < 24*60*60*1000 && (!unitOverride || unitOverride === 'hour')) {\n return {\n amount: roundToDivisor(subspan/(60*60*1000), 24),\n unit: 'h'\n };\n }\n\n if (unitOverride === 'day' || (subspan < 30*24*60*60*1000 && !unitOverride)) {\n return {\n amount: roundToDivisor(subspan/(24*60*60*1000), 1),\n unit: 'd'\n };\n }\n\n if (subspan > 30*24*60*60*1000 && (!unitOverride || unitOverride === 'month')) {\n return {\n amount: roundToDivisor(subspan/30*24*60*60*1000, 1),\n unit: 'month'\n };\n }\n\n if (unitOverride === 'year') {\n return {\n amount: roundToDivisor(subspan/365*24*60*60*1000, 1),\n unit: 'year'\n };\n }\n\n return {\n unit: 'm',\n amount: 60\n };\n}\n\nfunction placeNumbersGrid({ min, max, precision, expectedLabelSize, labelPadding, totalSize, scale='linear', formatter, inverted=false, formatOptions }) {\n const paddedLabelSize = expectedLabelSize + 2*labelPadding;\n\n const ticks = [];\n const placementParams = {scale, min, max, inverted, totalSize, precision, formatter, formatOptions, dates: false };\n\n const labelCount = Math.floor((totalSize - expectedLabelSize*2)/paddedLabelSize);\n const tickSpacing = getEvenTickSpacing(max - min, labelCount);\n if (tickSpacing > 0) {\n for (let value = roundToEvenNumber(min, tickSpacing); value < max; value += tickSpacing) {\n ticks.push(placeTick(value, placementParams));\n }\n }\n\n if (ticks.length) {\n if (inverted && ticks[ticks.length - 1].pixelValue > labelPadding) {\n ticks.push(placeTickByPixel(expectedLabelSize / 2, placementParams));\n }\n }\n\n return ticks.filter(({ pixelValue }) => pixelValue <= totalSize && pixelValue >= 0);\n}\n\nfunction placeDatesGrid({ min, max, precision, expectedLabelSize, labelPadding, totalSize, skipFirst=false, skipLast=false, scale='linear', formatter, inverted=false, formatOptions }) {\n const paddedLabelSize = expectedLabelSize + 2*labelPadding;\n\n const ticks = [];\n const placementParams = {scale, min, max, inverted, totalSize, precision, formatter, formatOptions, dates: true };\n\n const { amount, unit } = getEvenDateTickSpacing(max - min, totalSize/paddedLabelSize, formatOptions.unitOverride);\n\n const justDate = unit === 'month';\n\n if (!skipFirst) {\n ticks.push(placeTickByPixel(0, {...placementParams, justDate}, {position: 'first'}));\n }\n\n let currentDate = new Date(min);\n\n if (unit === 'h') {\n currentDate.setMinutes(0, 0, 0);\n } else if (unit === 'm') {\n currentDate.setSeconds(0, 0);\n } else if (unit === 's') {\n currentDate.setMilliseconds(0);\n } else if (unit === 'month') {\n currentDate = startOfDayInTimezone(currentDate, formatOptions.timeZone);\n currentDate.setDate(1);\n } else if (unit === 'd') {\n currentDate = startOfDayInTimezone(currentDate, formatOptions.timeZone);\n }\n\n let lastDateString = formatter(currentDate, {...formatOptions, ...placementParams, justDate: true });\n while (currentDate < max) {\n let delta = 24*60*60*1000;\n\n if (unit === 'h') {\n delta = (amount - currentDate.getHours() % amount)*60*60*1000;\n } else if (unit === 'm') {\n delta = (amount - currentDate.getMinutes() % amount)*60*1000;\n } else if (unit === 's') {\n delta = (amount - currentDate.getSeconds() % amount)*1000;\n } else if (unit === 'month') {\n delta = 0;\n if (currentDate.getMonth() === 11) {\n currentDate = new Date(currentDate.getFullYear() + 1, 0, 1);\n } else {\n currentDate = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 1);\n }\n } else if (unit === 'year') {\n currentDate = new Date(currentDate.getFullYear() + 1, 0, 0);\n }\n\n currentDate = new Date(currentDate.valueOf() + delta);\n\n const justTime = formatter(currentDate, {...formatOptions, ...placementParams, justDate: true }) === lastDateString;\n\n const tick = placeTick(currentDate, {...placementParams, justTime, justDate});\n\n if (ticks.length && (tick.pixelValue - ticks[ticks.length - 1].pixelValue) < (expectedLabelSize + (labelPadding || 0))) {\n continue;\n }\n\n if (tick.pixelValue + expectedLabelSize/2 >= totalSize) {\n continue;\n }\n\n ticks.push(tick);\n lastDateString = formatter(currentDate, {...formatOptions, ...placementParams, justDate: true });\n }\n\n const justTime = lastDateString === formatter(max, {...formatOptions, ...placementParams, justDate: true });\n\n if (!skipLast && ticks[ticks.length - 1].pixelValue + expectedLabelSize < totalSize) {\n ticks.push(placeTickByPixel(totalSize, {...placementParams, justTime, justDate}, {position: 'last'}));\n }\n\n return ticks.filter(({ pixelValue }) => pixelValue <= totalSize && pixelValue >= 0);\n}\n\nfunction placeTimeOnlyGrid({ min, max, precision, expectedLabelSize, labelPadding, totalSize, skipFirst=false, skipLast=false, scale='linear', formatter, inverted=false, formatOptions={} }) {\n const paddedLabelSize = expectedLabelSize + 2*labelPadding;\n const ticks = [];\n const placementParams = { scale, min, max, inverted, totalSize, precision, formatter, formatOptions, dates: true };\n\n const desiredCount = Math.floor(totalSize/paddedLabelSize);\n const span = max - min;\n \n let unit, amount;\n \n const hourSpan = span / (60 * 60 * 1000);\n const minuteSpan = span / (60 * 1000);\n \n if (hourSpan <= desiredCount * 8) {\n unit = 'h';\n amount = Math.max(1, Math.ceil(hourSpan / desiredCount));\n if (amount <= 6) {\n } else if (amount <= 12) {\n amount = 12;\n } else if (amount <= 24) {\n amount = 24;\n } else {\n amount = Math.ceil(amount / 24) * 24;\n }\n } else {\n unit = 'h';\n amount = 24;\n }\n \n if (!skipFirst) {\n ticks.push(placeTickByPixel(0, {...placementParams, justTime: true}, {position: 'first'}));\n }\n \n let currentDate = new Date(min);\n \n if (unit === 'h') {\n if (amount === 24) {\n currentDate = startOfDayInTimezone(currentDate, formatOptions.timeZone);\n } else {\n const offset = formatOptions.timeZone ? timezoneToOffsetMS(formatOptions.timeZone, currentDate) : 0;\n const localOffset = timezoneToOffsetMS('local', currentDate);\n \n if (offset !== null && localOffset !== null) {\n const adjustedDate = new Date(currentDate.valueOf() + offset - localOffset);\n adjustedDate.setMinutes(0, 0, 0);\n \n if (amount === 12) {\n const currentHour = adjustedDate.getHours();\n const alignedHour = currentHour < 12 ? 0 : 12;\n adjustedDate.setHours(alignedHour);\n } else {\n const currentHour = adjustedDate.getHours();\n const alignedHour = Math.floor(currentHour / amount) * amount;\n adjustedDate.setHours(alignedHour);\n }\n \n currentDate = new Date(adjustedDate.valueOf() - offset + localOffset);\n } else {\n currentDate.setMinutes(0, 0, 0);\n if (amount === 12) {\n const currentHour = currentDate.getHours();\n const alignedHour = currentHour < 12 ? 0 : 12;\n currentDate.setHours(alignedHour);\n } else {\n const currentHour = currentDate.getHours();\n const alignedHour = Math.floor(currentHour / amount) * amount;\n currentDate.setHours(alignedHour);\n }\n }\n }\n } else if (unit === 'm') {\n currentDate.setSeconds(0, 0);\n const currentMinute = currentDate.getMinutes();\n const alignedMinute = Math.floor(currentMinute / amount) * amount;\n currentDate.setMinutes(alignedMinute);\n } else if (unit === 's') {\n currentDate.setMilliseconds(0);\n const currentSecond = currentDate.getSeconds();\n const alignedSecond = Math.floor(currentSecond / amount) * amount;\n currentDate.setSeconds(alignedSecond);\n }\n \n while (currentDate < min) {\n if (unit === 'h') {\n currentDate = new Date(currentDate.valueOf() + amount * 60 * 60 * 1000);\n } else if (unit === 'm') {\n currentDate = new Date(currentDate.valueOf() + amount * 60 * 1000);\n } else if (unit === 's') {\n currentDate = new Date(currentDate.valueOf() + amount * 1000);\n }\n }\n \n while (currentDate < max) {\n const tick = placeTick(currentDate, {...placementParams, justTime: true});\n \n const reservedSpaceForLast = expectedLabelSize + labelPadding;\n const maxPixelForMiddleTicks = totalSize - reservedSpaceForLast;\n \n if (ticks.length && (tick.pixelValue - ticks[ticks.length - 1].pixelValue) < (expectedLabelSize + labelPadding)) {\n } else if (tick.pixelValue + expectedLabelSize < maxPixelForMiddleTicks) {\n ticks.push(tick);\n } else {\n break;\n }\n \n if (unit === 'h') {\n currentDate = new Date(currentDate.valueOf() + amount * 60 * 60 * 1000);\n } else if (unit === 'm') {\n currentDate = new Date(currentDate.valueOf() + amount * 60 * 1000);\n } else if (unit === 's') {\n currentDate = new Date(currentDate.valueOf() + amount * 1000);\n } else {\n break;\n }\n }\n \n if (!skipLast) {\n const lastTick = placeTick(max, {...placementParams, justTime: true}, {position: 'last'});\n if (ticks.length === 0 || (lastTick.pixelValue - ticks[ticks.length - 1].pixelValue) >= (expectedLabelSize + labelPadding/2)) {\n ticks.push(lastTick);\n } else {\n ticks[ticks.length - 1] = lastTick;\n }\n }\n \n return ticks.filter(({ pixelValue }) => pixelValue <= totalSize && pixelValue >= 0);\n}\n\nfunction placeDateOnlyGrid({ min, max, precision, expectedLabelSize, labelPadding, totalSize, skipFirst=false, skipLast=false, scale='linear', formatter, inverted=false, formatOptions={} }) {\n const paddedLabelSize = expectedLabelSize + 2*labelPadding;\n const ticks = [];\n \n const minYear = new Date(min).getFullYear();\n const maxYear = new Date(max).getFullYear();\n const spanMultipleYears = minYear !== maxYear;\n\n const customDateFormatter = (date, options) => {\n const timeZone = formatOptions.timeZone;\n const result = formatter(date, { ...options, dates: true, justMonthAndDay: !spanMultipleYears, justDate: spanMultipleYears, timeZone });\n return result;\n };\n \n const placementParams = { scale, min, max, inverted, totalSize, precision, formatter: customDateFormatter, formatOptions, dates: true };\n \n const span = max - min;\n const hourSpan = span / (60 * 60 * 1000);\n \n let { amount, unit } = getEvenDateTickSpacing(span, totalSize/paddedLabelSize, formatOptions.unitOverride);\n \n if ((unit === 'h' || unit === 'm' || unit === 's') && hourSpan >= 48) {\n unit = 'd';\n amount = Math.max(1, Math.ceil(hourSpan / 24 / Math.floor(totalSize/paddedLabelSize)));\n } else if ((unit === 'h' || unit === 'm' || unit === 's') && hourSpan < 48) {\n const startTick = placeTick(min, {...placementParams, justDate: true}, {position: 'first'});\n const endTick = placeTick(max, {...placementParams, justDate: true}, {position: 'last'});\n \n const ticks = [startTick];\n if ((endTick.pixelValue - startTick.pixelValue) >= (expectedLabelSize + labelPadding)) {\n ticks.push(endTick);\n }\n \n return ticks.filter(({ pixelValue }) => pixelValue <= totalSize && pixelValue >= 0);\n }\n \n if (!skipFirst) {\n ticks.push(placeTickByPixel(0, {...placementParams, justDate: true}, {position: 'first'}));\n }\n \n let currentDate = new Date(min);\n \n if (unit === 'month') {\n currentDate = startOfDayInTimezone(currentDate, formatOptions.timeZone);\n currentDate.setDate(1);\n } else if (unit === 'd') {\n currentDate = startOfDayInTimezone(currentDate, formatOptions.timeZone);\n }\n \n while (currentDate < max) {\n let delta = 24*60*60*1000;\n \n if (unit === 'month') {\n delta = 0;\n if (currentDate.getMonth() === 11) {\n currentDate = new Date(currentDate.getFullYear() + 1, 0, 1);\n } else {\n currentDate = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 1);\n }\n } else if (unit === 'year') {\n currentDate = new Date(currentDate.getFullYear() + 1, 0, 1);\n delta = 0;\n } else if (unit === 'd') {\n delta = amount * 24 * 60 * 60 * 1000;\n }\n \n if (delta > 0) {\n currentDate = new Date(currentDate.valueOf() + delta);\n }\n \n const tick = placeTick(currentDate, {...placementParams, justDate: true});\n \n const reservedSpaceForLast = expectedLabelSize + labelPadding;\n const maxPixelForMiddleTicks = totalSize - reservedSpaceForLast;\n \n if (ticks.length && (tick.pixelValue - ticks[ticks.length - 1].pixelValue) < (expectedLabelSize + (labelPadding || 0))) {\n continue;\n }\n \n if (tick.pixelValue + expectedLabelSize < maxPixelForMiddleTicks) {\n ticks.push(tick);\n } else {\n break;\n }\n }\n \n if (!skipLast) {\n const lastTick = placeTick(max, {...placementParams, justDate: true}, {position: 'last'});\n if (ticks.length === 0 || (lastTick.pixelValue - ticks[ticks.length - 1].pixelValue) >= (expectedLabelSize + labelPadding/2)) {\n ticks.push(lastTick);\n } else {\n ticks[ticks.length - 1] = lastTick;\n }\n }\n\n if (ticks.length === 0 && hourSpan >= 48) {\n ticks.push(placeTickByPixel(0, {...placementParams, justDate: true}, {position: 'first'}));\n }\n \n return ticks.filter(({ pixelValue }) => pixelValue <= totalSize && pixelValue >= 0);\n}\n\nexport { placeTimeOnlyGrid, placeDateOnlyGrid };\n\nexport default function placeGrid(opts) {\n if (opts.dates) {\n return placeDatesGrid(opts);\n } else {\n return placeNumbersGrid(opts);\n }\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport {calculatePrecision, calculateTimePrecision, formatX} from '../helpers/format';\nimport placeGrid, { placeTimeOnlyGrid, placeDateOnlyGrid } from '../helpers/place_grid';\nimport {useEnumMap, useHasXEnum, usePrimarySize, useSelection} from '../state/hooks';\nimport StateController from '../state/state_controller';\n\nexport default React.memo(XAxis);\n\nfunction XAxis({ showAxes, showGrid, stateController, bigLabels, xTickUnit, clockStyle, timeZone, integersOnly, formatXAxisLabel }) {\n if (!showAxes && !showGrid) {\n return null;\n }\n\n const { elementWidth, elementHeight } = usePrimarySize(stateController);\n const {minX, maxX, dates} = useSelection(stateController);\n const hasXEnum = useHasXEnum(stateController);\n const enumMap = useEnumMap(stateController);\n\n let precision;\n if (dates) {\n precision = calculateTimePrecision(minX, maxX);\n } else {\n precision = calculatePrecision(maxX - minX);\n }\n\n let inverseEnumMap = null;\n if (hasXEnum) {\n inverseEnumMap = {};\n for (const [key, value] of Object.entries(enumMap)) {\n inverseEnumMap[value] = key;\n }\n }\n\n const formatOptions = {\n unitOverride: xTickUnit,\n clockStyle,\n timeZone,\n integersOnly,\n inverseEnumMap,\n formatter: formatXAxisLabel\n };\n\n const minLabel = formatX(minX, {...formatOptions, dates, precision }).toString();\n const maxLabel = formatX(maxX, {...formatOptions, dates, precision }).toString();\n\n let expectedLabelWidth = Math.max(minLabel.length, maxLabel.length);\n if (bigLabels) {\n expectedLabelWidth *= 2;\n }\n\n const labelPadding = 30;\n\n let timeTicks = null;\n let dateTicks = null;\n let regularTicks = null;\n \n if (dates) {\n timeTicks = placeTimeOnlyGrid({\n min: minX,\n max: maxX,\n totalSize: elementWidth,\n precision,\n expectedLabelSize: expectedLabelWidth,\n labelPadding: labelPadding * 0.8,\n formatter: formatXAxisLabel || formatX,\n formatOptions\n });\n \n dateTicks = placeDateOnlyGrid({\n min: minX,\n max: maxX,\n totalSize: elementWidth,\n precision,\n expectedLabelSize: expectedLabelWidth * 2,\n labelPadding: labelPadding * 1.5,\n formatter: formatXAxisLabel || formatX,\n formatOptions\n });\n } else {\n regularTicks = placeGrid({\n min: minX,\n max: maxX,\n totalSize: elementWidth,\n precision,\n dates,\n formatter: formatXAxisLabel || formatX,\n expectedLabelSize: expectedLabelWidth,\n labelPadding,\n formatOptions\n });\n }\n\n const xAxisHeight = dates ? 30 : 20;\n\n return (\n <svg className={`axis x-axis${dates ? ' x-axis-dual' : ''}`} style={showAxes ? undefined : {marginBottom: -20}}>\n {\n showAxes &&\n <path d={`M-1,0 H${elementWidth}`} className=\"axis-line\" />\n }\n\n {/* Render time ticks in first row */}\n {\n dates && timeTicks && timeTicks.map(({ pixelValue, label, size, position, skipGrid }, i) => {\n\n const singleTick = timeTicks.length === 1;\n \n if (isNaN(pixelValue)) {\n return null;\n }\n\n const classes = ['axis-item', `axis-item-${size}`, `axis-item-${position}`];\n if (bigLabels) {\n classes.push('axis-item-big-labels');\n }\n \n return (\n <g key={`time-${i}`} className={classes.join(' ')}>\n {\n showAxes &&\n <path d={`M${pixelValue},1 v12`} className=\"axis-tick\" />\n }\n\n {\n showGrid && !skipGrid &&\n <path d={`M${pixelValue},0 v-${elementHeight}`} />\n }\n\n {\n showAxes &&\n <text \n x={(position === 'last' && !singleTick) ? pixelValue - 3 : pixelValue + 3} \n y={12} \n textAnchor={(position === 'last' && !singleTick) ? 'end' : 'start'}\n className='x-axis-text x-axis-time-text'\n >\n {label}\n </text>\n }\n </g>\n );\n })\n }\n \n {/* Render date ticks in second row */}\n {\n dates && dateTicks && dateTicks.map(({ pixelValue, label, size, position, trueValue }, i) => {\n \n if (isNaN(pixelValue)) {\n return null;\n }\n\n const classes = ['axis-item', `axis-item-${size}`, `axis-item-${position}`];\n if (bigLabels) {\n classes.push('axis-item-big-labels');\n }\n\n let timezoneLabel = undefined;\n if (timeZone) {\n if (i === 0) {\n timezoneLabel = timeZone.toLowerCase() === 'utc' ? 'UTC' : timeZone;\n }\n }\n\n return (\n <g key={`date-${i}`} className={classes.join(' ')}>\n {\n showAxes &&\n <text \n x={position === 'last' ? pixelValue - 3 : pixelValue + 3} \n y={25} \n textAnchor={position === 'last' ? 'end' : 'start'}\n className='x-axis-text x-axis-date-text'\n >\n <tspan className='x-axis-date-label'>\n {label}\n </tspan>\n {timezoneLabel && (\n <tspan className='x-axis-timezone-label'>\n {' '}({timezoneLabel})\n </tspan>\n )}\n </text>\n }\n </g>\n );\n })\n }\n \n {/* Render regular ticks for non-date data */}\n {\n !dates && regularTicks && regularTicks.map(({ pixelValue, label, size, position, skipGrid }, i) => {\n if (isNaN(pixelValue)) {\n return null;\n }\n\n const classes = ['axis-item', `axis-item-${size}`, `axis-item-${position}`];\n if (bigLabels) {\n classes.push('axis-item-big-labels');\n }\n\n return (\n <g key={i} className={classes.join(' ')}>\n {\n showAxes &&\n <path d={`M${pixelValue},1 v12`} className=\"axis-tick\" />\n }\n\n {\n showGrid && !skipGrid &&\n <path d={`M${pixelValue},0 v-${elementHeight}`} />\n }\n\n {\n showAxes &&\n <text \n x={position === 'last' ? pixelValue - 3 : pixelValue + 3} \n y={xAxisHeight - 5} \n textAnchor={position === 'last' ? 'end' : 'start'}\n className='x-axis-text'\n >\n {label}\n </text>\n }\n </g>\n );\n })\n }\n </svg>\n );\n}\n\nXAxis.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n showAxes: PropTypes.bool.isRequired,\n showGrid: PropTypes.bool.isRequired,\n bigLabels: PropTypes.bool,\n xTickUnit: PropTypes.oneOf(['year']),\n clockStyle: PropTypes.oneOf(['12h', '24h']),\n timeZone: PropTypes.string,\n integersOnly: PropTypes.bool,\n formatXAxisLabel: PropTypes.func\n};\n","import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport {calculatePrecision, formatY} from '../helpers/format';\nimport {Y_AXIS_WIDTH, BIG_Y_AXIS_LABEL_OFFSET} from '../helpers/axis_sizes';\nimport scaleBounds from '../renderer/scale_bounds';\nimport getColor from '../helpers/colors';\nimport placeGrid from '../helpers/place_grid';\nimport {useAxes, useAxisBounds, useHighlightedSeries, usePrimarySize} from '../state/hooks';\nimport StateController from '../state/state_controller';\nimport CustomPropTypes from '../helpers/custom_prop_types';\n\nexport default React.memo(YAxis);\n\nfunction YAxis({ stateController, showAxes, showGrid, showSeriesKey, axis, sideIndex, bodyHeight, theme, grapherID, dragPositionYOffset=0, bigLabels, showAxisColors }) {\n if (!showAxes && !showGrid) {\n return null;\n }\n\n const { side, scale, axisIndex, label } = useAxes(stateController)[axis.axisIndex];\n\n const { elementWidth, elementHeight } = usePrimarySize(stateController);\n let { minY, maxY } = useAxisBounds(stateController)[axisIndex];\n\n const scaledBounds = scaleBounds({ minY, maxY, scale});\n minY = scaledBounds.minY;\n maxY = scaledBounds.maxY;\n\n const ticks = placeGrid({\n min: minY,\n max: maxY,\n totalSize: elementHeight,\n scale,\n precision: calculatePrecision(maxY - minY),\n formatter: formatY,\n inverted: true,\n expectedLabelSize: bigLabels ? 20 : 10,\n labelPadding: 30\n });\n\n const colorBoxSize = 10;\n const colorBoxPadding = 4;\n\n let sidePadding = 5;\n\n if (scale === 'log') {\n sidePadding = 2;\n }\n\n const highlightedSeries = useHighlightedSeries(stateController);\n\n const [draggedSeries, setDraggedSeries] = useState(null);\n const [dragDelta, setDragDelta] = useState({ dx: 0, dy: 0 });\n\n const startDrag = (event, singleSeries) => {\n let startX = event.clientX;\n let startY = event.clientY;\n\n if (side === 'left') {\n startX += Y_AXIS_WIDTH;\n }\n\n if (side === 'right') {\n startX -= Y_AXIS_WIDTH;\n }\n\n setDragDelta({\n dx: 0,\n dy: 0\n });\n\n const onMouseMove = (moveEvent) => {\n setDragDelta({\n dx: moveEvent.clientX - startX,\n dy: moveEvent.clientY - startY\n });\n };\n\n const onMouseUp = (mouseUpEvent) => {\n window.removeEventListener('mousemove', onMouseMove);\n window.removeEventListener('mouseup', onMouseUp);\n\n let target = mouseUpEvent.target;\n while (target && !(target.dataset || {}).axisIndex) {\n target = target.parentNode;\n }\n\n setDraggedSeries(null);\n stateController.finalizeDrag(singleSeries, target && (target.dataset || {}).axisIndex, target && (target.dataset || {}).grapherId);\n };\n\n window.addEventListener('mousemove', onMouseMove);\n window.addEventListener('mouseup', onMouseUp);\n\n setDraggedSeries(singleSeries);\n stateController.markDragStart();\n };\n\n const highlightedOpacity = theme === 'day' ? 1.0 : 0.5;\n const unhighlightedOpacity = theme === 'day' ? 0.8 : 0.3;\n\n return (\n <svg className={`axis y-axis y-axis-${side}`}\n data-axis-index={axisIndex}\n data-grapher-id={grapherID}\n style={{\n width: Y_AXIS_WIDTH,\n marginLeft: showAxes ? undefined : -Y_AXIS_WIDTH,\n height: typeof bodyHeight === 'number' ? bodyHeight : undefined\n }}\n >\n {\n showAxes &&\n showAxisColors &&\n axis.series.map((singleSeries, i) => {\n const height = elementHeight/axis.series.length;\n\n return (\n <rect\n x={side === 'left' ? 0 : 2}\n y={i*height}\n width={Y_AXIS_WIDTH - 2}\n height={height}\n key={singleSeries.index}\n fill={getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex)}\n opacity={singleSeries.index === highlightedSeries ? highlightedOpacity : unhighlightedOpacity}\n data-element-height={elementHeight}\n data-series-length={axis.series.length}\n />\n );\n })\n }\n\n {\n showAxes &&\n <path d={`M${side === 'left' ? Y_AXIS_WIDTH-1 : 1},3 V${elementHeight}`} className=\"axis-line\" />\n }\n\n {\n ticks.map(({ pixelValue, label, size, skipGrid }, i) => {\n const edge = side === 'left' ? (sideIndex + 1) * Y_AXIS_WIDTH : -sideIndex*Y_AXIS_WIDTH;\n const length = (side === 'left' ? 1 : - 1) * (elementWidth+1);\n\n const classes = ['axis-item', `axis-item-${size}`];\n if (bigLabels) {\n classes.push('axis-item-big-labels');\n }\n\n return (\n <g key={i} className={classes.join(' ')}>\n {\n showGrid &&\n !skipGrid &&\n <path d={`M${edge},${pixelValue} h${length}`} />\n }\n\n {\n showGrid &&\n !skipGrid &&\n sideIndex > 0 &&\n <path\n d={`M${side === 'left' ? Y_AXIS_WIDTH : 0},${pixelValue} h${(side === 'left' ? 1 : -1) * sideIndex * Y_AXIS_WIDTH}`}\n strokeDasharray={'2,2'}\n />\n }\n\n {\n showAxes &&\n <text x={side === 'left' ? Y_AXIS_WIDTH-sidePadding : sidePadding} y={pixelValue}>\n {label}\n </text>\n }\n </g>\n );\n })\n }\n\n {\n showSeriesKey && showAxes &&\n axis.series.map((singleSeries, i) => {\n\n let x = (Y_AXIS_WIDTH - colorBoxSize - colorBoxPadding) + (i % 2 - 1)*(colorBoxSize + colorBoxPadding);\n let y = -(colorBoxPadding + colorBoxSize) * Math.ceil(axis.series.length / 2) + (colorBoxSize + colorBoxPadding) * Math.floor(i / 2);\n\n if (singleSeries === draggedSeries) {\n x += dragDelta.dx;\n y += dragDelta.dy - dragPositionYOffset;\n }\n\n return (\n <rect\n className=\"series-color-box\"\n onMouseDown={(event) => startDrag(event, singleSeries)}\n x={x}\n y={y}\n width={colorBoxSize}\n height={colorBoxSize}\n key={singleSeries.index}\n fill={getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex)}\n onMouseOver={() => stateController.setHighlightedSeries(singleSeries.index)}\n onMouseOut={() => stateController.setHighlightedSeries(null)}\n />\n );\n })\n }\n\n {\n showAxes && !!label &&\n <text\n className={`y-axis-label${bigLabels ? ' y-axis-big-label' : ''}`}\n x={side === 'left' ? 10 : Y_AXIS_WIDTH - 10}\n y={elementHeight/2 + (side === 'left' ? -1 : 1)*(axisIndex + 1)*(bigLabels ? BIG_Y_AXIS_LABEL_OFFSET : 0)}\n transform={`rotate(${side === 'left' ? -90 : 90}, ${side === 'left' ? 10 : Y_AXIS_WIDTH - 10}, ${elementHeight/2})`}\n >\n {label}\n </text>\n }\n </svg>\n );\n}\n\nYAxis.propTypes = {\n stateController: PropTypes.instanceOf(StateController),\n showAxes: PropTypes.bool.isRequired,\n showGrid: PropTypes.bool.isRequired,\n showAxisColors: PropTypes.bool.isRequired,\n showSeriesKey: PropTypes.bool.isRequired,\n axis: CustomPropTypes.Axis.isRequired,\n sideIndex: PropTypes.number.isRequired,\n bodyHeight: PropTypes.number,\n theme: PropTypes.string,\n grapherID: PropTypes.string,\n dragPositionYOffset: PropTypes.number,\n bigLabels: PropTypes.bool\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { usePrimarySize, useSelection, useSeries } from '../state/hooks';\nimport StateController from '../state/state_controller';\n\nexport default React.memo(WindArrows);\n\nfunction DefaultWindArrow({ windX, windY }) {\n const arrowSize = 8;\n const angle = (-Math.atan2(windY, windX) + Math.PI / 2) * 180 / Math.PI;\n\n return (\n <g transform={`rotate(${angle})`}>\n <line\n x1={0}\n y1={-arrowSize / 2}\n x2={0}\n y2={arrowSize / 2}\n stroke=\"currentColor\"\n strokeWidth={1.5}\n />\n <path\n d={`M${-arrowSize / 3},${arrowSize / 4} L0,${arrowSize / 2} L${arrowSize / 3},${arrowSize / 4}`}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={1.5}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </g>\n );\n}\n\nfunction WindArrows({ stateController }) {\n const { elementWidth } = usePrimarySize(stateController);\n const { minX, maxX } = useSelection(stateController);\n const series = useSeries(stateController);\n\n const windSeries = series.filter(s => s.windDirections && s.windDirections.length > 0 && !s.hidden);\n\n if (windSeries.length === 0) {\n return null;\n }\n\n let minSpeed = Infinity;\n let maxSpeed = -Infinity;\n for (const singleSeries of windSeries) {\n const { windData } = singleSeries;\n if (!windData) continue;\n for (const wind of windData) {\n if (!wind) continue;\n const speed = Math.sqrt(wind.x * wind.x + wind.y * wind.y);\n if (speed < minSpeed) minSpeed = speed;\n if (speed > maxSpeed) maxSpeed = speed;\n }\n }\n const speedRange = maxSpeed - minSpeed || 1;\n\n const arrows = [];\n const arrowSpacing = 30;\n let lastArrowX = -arrowSpacing;\n\n for (const singleSeries of windSeries) {\n const { inDataSpace, windDirections, windData, windComp: CustomArrow } = singleSeries;\n if (!inDataSpace || !windDirections) continue;\n\n const Comp = CustomArrow || DefaultWindArrow;\n\n for (let i = 0; i < inDataSpace.length; i++) {\n const [x] = inDataSpace[i];\n const direction = windDirections[i];\n\n if (direction === null) continue;\n\n let xValue = x instanceof Date ? x.valueOf() : x;\n let minXValue = minX instanceof Date ? minX.valueOf() : minX;\n let maxXValue = maxX instanceof Date ? maxX.valueOf() : maxX;\n\n if (xValue < minXValue || xValue > maxXValue) continue;\n\n const pixelX = ((xValue - minXValue) / (maxXValue - minXValue)) * elementWidth;\n\n if (pixelX - lastArrowX < arrowSpacing) continue;\n lastArrowX = pixelX;\n\n const wind = windData ? windData[i] : null;\n const windX = wind ? wind.x : Math.cos(direction);\n const windY = wind ? wind.y : Math.sin(direction);\n const speed = Math.sqrt(windX * windX + windY * windY);\n const speedPercentile = (speed - minSpeed) / speedRange;\n\n arrows.push(\n <g key={`${singleSeries.name || i}-${i}`} transform={`translate(${pixelX}, 10)`}>\n <Comp windX={windX} windY={windY} speed={speed} speedPercentile={speedPercentile} />\n </g>\n );\n }\n }\n\n if (arrows.length === 0) {\n return null;\n }\n\n return (\n <svg className=\"wind-arrows\" style={{ height: 20, width: elementWidth, display: 'block' }}>\n {arrows}\n </svg>\n );\n}\n\nWindArrows.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired\n};\n\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nexport default React.memo(RangeSelectionButtonBase);\n\nfunction RangeSelectionButtonBase({ selected, disabled, className, onClick, children, description }) {\n const classes = [\n 'range-button'\n ];\n\n if (selected) {\n classes.push('range-button-selected');\n }\n\n if (disabled) {\n classes.push('range-button-disabled');\n }\n\n if (className) {\n classes.push(className);\n }\n\n if (description) {\n classes.push('option-tooltip');\n }\n\n return (\n <div\n className={classes.join(' ')}\n onClick={onClick && ((event) => disabled || onClick(event))}\n >\n {children}\n\n {\n description &&\n <div className=\"option-tooltip-text\">\n {description}\n </div>\n }\n </div>\n );\n}\n\nRangeSelectionButtonBase.propTypes = {\n selected: PropTypes.bool.isRequired,\n onClick: PropTypes.func,\n children: PropTypes.node.isRequired,\n disabled: PropTypes.bool,\n className: PropTypes.string,\n description: PropTypes.string\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport RangeSelectionButtonBase from './range_selection_button_base.jsx';\nimport StateController from '../state/state_controller';\n\nexport default React.memo(RangeSelectionButton);\n\nfunction RangeSelectionButton({ stateController, currentBoundCalculator, boundCalculator, children, disabled }) {\n return (\n <RangeSelectionButtonBase\n selected={currentBoundCalculator === boundCalculator}\n onClick={() => stateController.boundCalculator = boundCalculator}\n disabled={disabled}\n >\n {children}\n </RangeSelectionButtonBase>\n );\n}\n\nRangeSelectionButton.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n boundCalculator: PropTypes.func.isRequired,\n currentBoundCalculator: PropTypes.func.isRequired,\n children: PropTypes.node.isRequired,\n disabled: PropTypes.bool\n};\n","import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport RangeSelectionButtonBase from './range_selection_button_base.jsx';\nimport StateController from '../state/state_controller';\nimport {usePercentile, usePercentileAsymmetry} from '../state/hooks';\n\nexport default React.memo(PercentileButton);\n\nfunction PercentileButton({ stateController }) {\n const percentile = usePercentile(stateController);\n const percentileAsymmetry = usePercentileAsymmetry(stateController);\n const [showing, setShowing] = useState(false);\n\n return ([\n showing ? <RangeSelectionButtonBase\n key=\"asymmetry button\"\n className=\"percentile-button\"\n selected={true}\n description=\"Percentile asymmetry\"\n >\n <input\n onClick={(e) => e.stopPropagation()}\n value={percentileAsymmetry}\n onChange={(e) => stateController.percentileAsymmetry = e.target.value}\n onKeyUp={(e) => e.keyCode === 13 && setShowing(false)}\n type=\"number\"\n min={-50}\n max={50}\n />\n\n <div className=\"icon-container icon-container-square\">\n <svg focusable=\"false\" viewBox=\"0 0 512 512\">\n <path fill=\"currentColor\" d=\"M240 96h64a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16h-64a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16zm0 128h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16H240a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16zm256 192H240a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h256a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm-256-64h192a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16H240a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16zM16 160h48v304a16 16 0 0 0 16 16h32a16 16 0 0 0 16-16V160h48c14.21 0 21.39-17.24 11.31-27.31l-80-96a16 16 0 0 0-22.62 0l-80 96C-5.35 142.74 1.78 160 16 160z\" />\n </svg>\n </div>\n </RangeSelectionButtonBase>: null,\n\n <RangeSelectionButtonBase\n key=\"main-button\"\n className=\"percentile-button\"\n selected={showing || parseFloat(percentile) !== 100}\n onClick={() => setShowing(!showing)}\n description=\"Edit percentile\"\n >\n {\n showing &&\n <div>\n <input\n onClick={(e) => e.stopPropagation()}\n autoFocus={true}\n value={percentile}\n onChange={(e) => stateController.percentile = e.target.value}\n onKeyUp={(e) => e.keyCode === 13 && setShowing(false)}\n type=\"number\"\n min={0}\n max={100}\n />\n </div>\n }\n\n <div className=\"icon-container icon-container-narrow\">\n <svg focusable=\"false\" viewBox=\"0 0 448 512\">\n <path fill=\"currentColor\" d=\"M112 224c61.9 0 112-50.1 112-112S173.9 0 112 0 0 50.1 0 112s50.1 112 112 112zm0-160c26.5 0 48 21.5 48 48s-21.5 48-48 48-48-21.5-48-48 21.5-48 48-48zm224 224c-61.9 0-112 50.1-112 112s50.1 112 112 112 112-50.1 112-112-50.1-112-112-112zm0 160c-26.5 0-48-21.5-48-48s21.5-48 48-48 48 21.5 48 48-21.5 48-48 48zM392.3.2l31.6-.1c19.4-.1 30.9 21.8 19.7 37.8L77.4 501.6a23.95 23.95 0 0 1-19.6 10.2l-33.4.1c-19.5 0-30.9-21.9-19.7-37.8l368-463.7C377.2 4 384.5.2 392.3.2z\" />\n </svg>\n </div>\n </RangeSelectionButtonBase>\n ]);\n}\n\nPercentileButton.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired\n};\n","import React from 'react';\nimport PercentileButton from './percentile_button.jsx';\nimport RangeSelectionButtonBase from './range_selection_button_base.jsx';\nimport {\n useAutoscaleY,\n useMaxPrecision,\n useShowIndividualPoints, useShowingAnnotations,\n useShowingSidebar, useTheme\n} from '../state/hooks';\nimport PropTypes from 'prop-types';\nimport StateController from '../state/state_controller';\n\nexport default React.memo(Options);\n\nfunction Options({stateController, sidebarEnabled}) {\n\n const showIndividualPoints = useShowIndividualPoints(stateController);\n const autoscaleY = useAutoscaleY(stateController);\n const maxPrecision = useMaxPrecision(stateController);\n const showingSidebar = useShowingSidebar(stateController);\n const showingAnnotations = useShowingAnnotations(stateController);\n const theme = useTheme(stateController);\n\n return (\n <div className=\"options-bar\">\n {\n sidebarEnabled &&\n <RangeSelectionButtonBase\n selected={showingSidebar}\n onClick={() => stateController.toggleShowingSidebar()}\n description=\"Show sidebar\"\n >\n <div className=\"icon-container icon-container-square\">\n <svg focusable=\"false\" viewBox=\"0 0 512 512\">\n <path fill=\"currentColor\"\n d=\"M464 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V80c0-26.51-21.49-48-48-48zM224 416H64V160h160v256zm224 0H288V160h160v256z\"/>\n </svg>\n </div>\n </RangeSelectionButtonBase>\n }\n\n <RangeSelectionButtonBase\n selected={theme === 'export'}\n onClick={() => stateController.toggleExportMode()}\n description=\"Export mode\"\n >\n <div className=\"icon-container icon-container-square\">\n <svg focusable=\"false\" viewBox=\"0 0 512 512\">\n <path fill=\"currentColor\"\n d=\"M167.02 309.34c-40.12 2.58-76.53 17.86-97.19 72.3-2.35 6.21-8 9.98-14.59 9.98-11.11 0-45.46-27.67-55.25-34.35C0 439.62 37.93 512 128 512c75.86 0 128-43.77 128-120.19 0-3.11-.65-6.08-.97-9.13l-88.01-73.34zM457.89 0c-15.16 0-29.37 6.71-40.21 16.45C213.27 199.05 192 203.34 192 257.09c0 13.7 3.25 26.76 8.73 38.7l63.82 53.18c7.21 1.8 14.64 3.03 22.39 3.03 62.11 0 98.11-45.47 211.16-256.46 7.38-14.35 13.9-29.85 13.9-45.99C512 20.64 486 0 457.89 0z\" />\n </svg>\n </div>\n </RangeSelectionButtonBase>\n\n <RangeSelectionButtonBase\n selected={showingAnnotations}\n onClick={() => stateController.toggleShowingAnnotations()}\n description=\"Show annotations\"\n >\n <div className=\"icon-container icon-container-448\">\n <svg focusable=\"false\" viewBox=\"0 0 448 512\">\n <path fill=\"currentColor\" d=\"M432 416h-23.41L277.88 53.69A32 32 0 0 0 247.58 32h-47.16a32 32 0 0 0-30.3 21.69L39.41 416H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16h-19.58l23.3-64h152.56l23.3 64H304a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM176.85 272L224 142.51 271.15 272z\" />\n </svg>\n </div>\n </RangeSelectionButtonBase>\n\n <PercentileButton stateController={stateController} />\n\n <RangeSelectionButtonBase\n selected={maxPrecision}\n onClick={() => stateController.toggleMaxPrecision()}\n description=\"Max precision\"\n >\n <div className=\"icon-container icon-container-square\">\n <svg focusable=\"false\" viewBox=\"0 0 512 512\">\n <path fill=\"currentColor\" d=\"M478.21 334.093L336 256l142.21-78.093c11.795-6.477 15.961-21.384 9.232-33.037l-19.48-33.741c-6.728-11.653-21.72-15.499-33.227-8.523L296 186.718l3.475-162.204C299.763 11.061 288.937 0 275.48 0h-38.96c-13.456 0-24.283 11.061-23.994 24.514L216 186.718 77.265 102.607c-11.506-6.976-26.499-3.13-33.227 8.523l-19.48 33.741c-6.728 11.653-2.562 26.56 9.233 33.037L176 256 33.79 334.093c-11.795 6.477-15.961 21.384-9.232 33.037l19.48 33.741c6.728 11.653 21.721 15.499 33.227 8.523L216 325.282l-3.475 162.204C212.237 500.939 223.064 512 236.52 512h38.961c13.456 0 24.283-11.061 23.995-24.514L296 325.282l138.735 84.111c11.506 6.976 26.499 3.13 33.227-8.523l19.48-33.741c6.728-11.653 2.563-26.559-9.232-33.036z\" />\n </svg>\n </div>\n </RangeSelectionButtonBase>\n\n <RangeSelectionButtonBase\n selected={autoscaleY}\n onClick={() => stateController.toggleYAutoscaling()}\n description=\"Autoscale y axis\"\n >\n <div className=\"icon-container\">\n <svg focusable=\"false\" viewBox=\"0 0 256 512\">\n <path fill=\"currentColor\" d=\"M168 416c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88v-64h-88c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88v-64h-88c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88v-64h-88c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88V32c0-17.67-14.33-32-32-32H32C14.33 0 0 14.33 0 32v448c0 17.67 14.33 32 32 32h192c17.67 0 32-14.33 32-32v-64h-88z\"/>\n </svg>\n </div>\n </RangeSelectionButtonBase>\n\n <RangeSelectionButtonBase\n selected={showIndividualPoints}\n onClick={() => stateController.toggleIndividualPoints()}\n description=\"Show individual points\"\n >\n <div className=\"icon-container icon-container-narrow\">\n <svg focusable=\"false\" viewBox=\"0 0 192 512\">\n <path fill=\"currentColor\" d=\"M96 184c39.8 0 72 32.2 72 72s-32.2 72-72 72-72-32.2-72-72 32.2-72 72-72zM24 80c0 39.8 32.2 72 72 72s72-32.2 72-72S135.8 8 96 8 24 40.2 24 80zm0 352c0 39.8 32.2 72 72 72s72-32.2 72-72-32.2-72-72-72-72 32.2-72 72z\" />\n </svg>\n </div>\n </RangeSelectionButtonBase>\n </div>\n );\n}\n\nOptions.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n sidebarEnabled: PropTypes.bool\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport RangeSelectionButton from './range_selection_button.jsx';\nimport RangeSelectionButtonBase from './range_selection_button_base.jsx';\nimport {Y_AXIS_WIDTH} from '../helpers/axis_sizes';\nimport CustomPropTypes from '../helpers/custom_prop_types';\nimport StateController from '../state/state_controller';\nimport {\n useBoundCalculator, useBoundHistory,\n useGlobalBounds,\n useLeftAxisCount,\n useRightAxisCount,\n useShowingOptions\n} from '../state/hooks';\nimport BOUND_CALCULATORS from '../state/bound_calculators';\nimport Options from './options.jsx';\n\nexport default React.memo(RangeSelection);\n\nfunction RangeSelection({stateController, customBoundsSelectors, customBoundsSelectorsOnly, sidebarEnabled}) {\n const rightAxisCount = useRightAxisCount(stateController);\n const leftAxisCount = useLeftAxisCount(stateController);\n const showingOptions = useShowingOptions(stateController);\n\n let marginRight = Y_AXIS_WIDTH*rightAxisCount;\n if (rightAxisCount > 0) {\n marginRight += 5;\n }\n\n let marginLeft = Y_AXIS_WIDTH*leftAxisCount;\n if (leftAxisCount > 0) {\n marginLeft += 5;\n }\n\n const { dates } = useGlobalBounds(stateController);\n\n const currentBoundCalculator = useBoundCalculator(stateController);\n const { hasPreviousBounds, hasNextBounds } = useBoundHistory(stateController);\n\n const customBoundSelectorNames = new Set(customBoundsSelectors.map(({ label }) => label));\n\n return (\n <div className={`range-selection${dates ? '' : ' range-not-dates'}`} style={{ marginRight, marginLeft }}>\n <div className=\"range-buttons\">\n {\n showingOptions &&\n <Options\n stateController={stateController}\n sidebarEnabled={sidebarEnabled}\n />\n }\n\n <RangeSelectionButtonBase\n className=\"showing-options-button\"\n selected={showingOptions}\n onClick={() => stateController.toggleShowingOptions()}\n description=\"Show additional options\"\n >\n <div className=\"icon-container icon-container-square\">\n <svg focusable=\"false\" viewBox=\"0 0 512 512\">\n <path fill=\"currentColor\" d=\"M487.4 315.7l-42.6-24.6c4.3-23.2 4.3-47 0-70.2l42.6-24.6c4.9-2.8 7.1-8.6 5.5-14-11.1-35.6-30-67.8-54.7-94.6-3.8-4.1-10-5.1-14.8-2.3L380.8 110c-17.9-15.4-38.5-27.3-60.8-35.1V25.8c0-5.6-3.9-10.5-9.4-11.7-36.7-8.2-74.3-7.8-109.2 0-5.5 1.2-9.4 6.1-9.4 11.7V75c-22.2 7.9-42.8 19.8-60.8 35.1L88.7 85.5c-4.9-2.8-11-1.9-14.8 2.3-24.7 26.7-43.6 58.9-54.7 94.6-1.7 5.4.6 11.2 5.5 14L67.3 221c-4.3 23.2-4.3 47 0 70.2l-42.6 24.6c-4.9 2.8-7.1 8.6-5.5 14 11.1 35.6 30 67.8 54.7 94.6 3.8 4.1 10 5.1 14.8 2.3l42.6-24.6c17.9 15.4 38.5 27.3 60.8 35.1v49.2c0 5.6 3.9 10.5 9.4 11.7 36.7 8.2 74.3 7.8 109.2 0 5.5-1.2 9.4-6.1 9.4-11.7v-49.2c22.2-7.9 42.8-19.8 60.8-35.1l42.6 24.6c4.9 2.8 11 1.9 14.8-2.3 24.7-26.7 43.6-58.9 54.7-94.6 1.5-5.5-.7-11.3-5.6-14.1zM256 336c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80z\" />\n </svg>\n </div>\n </RangeSelectionButtonBase>\n \n <RangeSelectionButtonBase\n className=\"range-selection-history\"\n selected={false}\n onClick={() => stateController.previousBounds()}\n disabled={!hasPreviousBounds}\n >\n <div className=\"icon-container\">\n <svg focusable=\"false\" viewBox=\"0 0 256 512\">\n <path fill=\"currentColor\" d=\"M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z\" />\n </svg>\n </div>\n </RangeSelectionButtonBase>\n \n <RangeSelectionButtonBase\n className=\"range-selection-history\"\n selected={false}\n onClick={() => stateController.nextBounds()}\n disabled={!hasNextBounds}\n >\n <div className=\"icon-container\">\n <svg focusable=\"false\" viewBox=\"0 0 256 512\">\n <path fill=\"currentColor\" d=\"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z\"/>\n </svg>\n </div>\n </RangeSelectionButtonBase>\n\n {\n customBoundsSelectors.map(({label, calculator, datesOnly}, i) => {\n return (\n <RangeSelectionButton\n key={i}\n stateController={stateController}\n currentBoundCalculator={currentBoundCalculator}\n boundCalculator={calculator}\n disabled={datesOnly && !dates}\n >\n {label}\n </RangeSelectionButton>\n );\n })\n }\n\n {\n !customBoundSelectorNames.has('1m') && !customBoundsSelectorsOnly &&\n <RangeSelectionButton\n stateController={stateController}\n currentBoundCalculator={currentBoundCalculator}\n boundCalculator={BOUND_CALCULATORS.lastMinute}\n disabled={!dates}\n >\n 1m\n </RangeSelectionButton>\n }\n\n {\n !customBoundSelectorNames.has('10m') && !customBoundsSelectorsOnly &&\n <RangeSelectionButton\n stateController={stateController}\n currentBoundCalculator={currentBoundCalculator}\n boundCalculator={BOUND_CALCULATORS.last10Minutes}\n disabled={!dates}\n >\n 10m\n </RangeSelectionButton>\n }\n\n {\n !customBoundSelectorNames.has('1h') && !customBoundsSelectorsOnly &&\n <RangeSelectionButton\n stateController={stateController}\n currentBoundCalculator={currentBoundCalculator}\n boundCalculator={BOUND_CALCULATORS.lastHour}\n disabled={!dates}\n >\n 1h\n </RangeSelectionButton>\n }\n\n {\n !customBoundSelectorNames.has('1d') && !customBoundsSelectorsOnly &&\n <RangeSelectionButton\n stateController={stateController}\n currentBoundCalculator={currentBoundCalculator}\n boundCalculator={BOUND_CALCULATORS.lastDay}\n disabled={!dates}\n >\n 1d\n </RangeSelectionButton>\n }\n\n <RangeSelectionButton\n stateController={stateController}\n currentBoundCalculator={currentBoundCalculator}\n boundCalculator={BOUND_CALCULATORS.all}\n disabled={false}\n >\n All\n </RangeSelectionButton>\n </div>\n </div>\n );\n\n}\n\nRangeSelection.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n customBoundsSelectors: CustomPropTypes.CustomBoundsSelectors.isRequired,\n customBoundsSelectorsOnly: PropTypes.bool,\n sidebarEnabled: PropTypes.bool\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport GraphBodyRenderer from '../renderer/graph_body_renderer';\nimport StateController from '../state/state_controller';\nimport placeGrid from '../helpers/place_grid';\nimport {formatX} from '../helpers/format';\nimport VerticalLines from './vertical_lines.jsx';\nimport CustomPropTypes from '../helpers/custom_prop_types';\n\nexport default class RangeGraph extends React.PureComponent {\n\n constructor(props) {\n super(props);\n\n this.state = {\n elementWidth: 0,\n elementHeight: 0,\n selectionBounds: {\n minX: 0,\n maxX: 0\n },\n globalBounds: {\n minX: 0,\n maxX: 0\n }\n };\n\n this.onMouseMove = this.onMouseMove.bind(this);\n this.stopDragging = this.stopDragging.bind(this);\n this.startScroll = this.startScroll.bind(this);\n this.startLeftDrag = this.startLeftDrag.bind(this);\n this.startRightDrag = this.startRightDrag.bind(this);\n }\n\n getClientX(event) {\n if (event && event.touches && event.touches[0]) {\n return event.touches[0].clientX;\n }\n if (event && event.changedTouches && event.changedTouches[0]) {\n return event.changedTouches[0].clientX;\n }\n return event.clientX;\n }\n\n componentDidMount() {\n this._renderer = new GraphBodyRenderer({\n stateController: this.props.stateController,\n canvasElement: this.el,\n webgl: this.props.webgl,\n checkIntersection: this.props.checkIntersection\n });\n this.props.stateController.rangeGraphRenderer = this._renderer;\n\n this._renderer.on('size_changed', (sizing) => {\n this.setState(sizing);\n });\n\n this.setState({\n selectionBounds: this.props.stateController._selection,\n globalBounds: this.props.stateController._globalBounds\n });\n\n this.props.stateController.on('selection_changed', (selectionBounds) =>{\n this.setState({ selectionBounds });\n });\n\n this.props.stateController.on('global_bounds_changed', (globalBounds) =>{\n this.setState({ globalBounds: globalBounds });\n });\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.draggingY !== this.props.draggingY && this._renderer) {\n this._renderer.resize();\n }\n }\n\n componentWillUnmount() {\n if (this._renderer) {\n this._renderer.dispose();\n this._renderer = null;\n }\n }\n\n onMouseMove(event) {\n if (!this._dragType) {\n return;\n }\n\n // Prevent scrolling during touch-drag\n if (event && event.touches && event.preventDefault) {\n event.preventDefault();\n }\n\n let boundCalculator;\n const leftX = this.el.getBoundingClientRect().left;\n\n this.setState(({selectionBounds, globalBounds, elementWidth}) => {\n const pixelX = this.getClientX(event) - leftX;\n let percentage = pixelX/elementWidth;\n\n percentage = Math.max(percentage, 0);\n percentage = Math.min(percentage, 1);\n\n let trueX = percentage * (globalBounds.maxX - globalBounds.minX) + globalBounds.minX;\n\n if (this._dragType === 'scroll') {\n const range = selectionBounds.maxX - selectionBounds.minX;\n let minX = trueX - range*this._scrollAnchorPercentage;\n let maxX = trueX + range*(1-this._scrollAnchorPercentage);\n\n if (minX < globalBounds.minX) {\n minX = globalBounds.minX;\n maxX = minX + range;\n }\n\n if (maxX > globalBounds.maxX) {\n maxX = globalBounds.maxX;\n minX = maxX - range;\n }\n\n boundCalculator = () => {\n return {minX, maxX};\n };\n\n return {\n selectionBounds: Object.assign({}, selectionBounds, {\n minX, maxX\n })\n };\n } else if (this._dragType === 'left') {\n if (trueX > selectionBounds.maxX) {\n trueX = selectionBounds.maxX;\n }\n\n const boundToRight = globalBounds.maxX === selectionBounds.maxX;\n\n boundCalculator = () => {\n if (boundToRight) {\n return {\n minX: trueX\n };\n } else {\n return {\n minX: trueX,\n maxX: selectionBounds.maxX\n };\n }\n };\n\n return {\n selectionBounds: Object.assign({}, selectionBounds, {\n minX: trueX\n })\n };\n } else if (this._dragType === 'right') {\n if (trueX < selectionBounds.minX) {\n trueX = selectionBounds.minX;\n }\n\n const boundToLeft = globalBounds.minX === selectionBounds.minX;\n\n boundCalculator = () => {\n if (boundToLeft) {\n return {\n maxX: trueX\n };\n } else {\n return {\n minX: selectionBounds.minX,\n maxX: trueX\n };\n }\n };\n\n return {\n selectionBounds: Object.assign({}, selectionBounds, {\n maxX: trueX\n })\n };\n }\n }, () => {\n if (!boundCalculator) {\n return;\n }\n\n boundCalculator.debounceHistory = true;\n this.props.stateController.boundCalculator = boundCalculator;\n });\n }\n\n addListeners() {\n window.addEventListener('mousemove', this.onMouseMove);\n window.addEventListener('mouseup', this.stopDragging);\n window.addEventListener('touchmove', this.onMouseMove, { passive: false });\n window.addEventListener('touchend', this.stopDragging);\n window.addEventListener('touchcancel', this.stopDragging);\n }\n\n stopDragging() {\n this._dragType = null;\n this.forceUpdate();\n window.removeEventListener('mousemove', this.onMouseMove);\n window.removeEventListener('mouseup', this.stopDragging);\n window.removeEventListener('touchmove', this.onMouseMove);\n window.removeEventListener('touchend', this.stopDragging);\n window.removeEventListener('touchcancel', this.stopDragging);\n }\n\n startScroll(event) {\n this._dragType = 'scroll';\n\n const {selectionBounds, globalBounds, elementWidth} = this.state;\n const leftX = this.el.getBoundingClientRect().left;\n\n const pixelStartX = this.getClientX(event) - leftX;\n const pixelMinX = (selectionBounds.minX - globalBounds.minX)/(globalBounds.maxX - globalBounds.minX) * elementWidth || 0;\n const pixelMaxX = (selectionBounds.maxX - globalBounds.minX)/(globalBounds.maxX - globalBounds.minX) * elementWidth || 0;\n\n this._scrollAnchorPercentage = (pixelStartX-pixelMinX)/(pixelMaxX - pixelMinX);\n this.addListeners();\n }\n\n startLeftDrag(event) {\n this._dragType = 'left';\n this.addListeners();\n }\n\n startRightDrag(event) {\n this._dragType = 'right';\n this.addListeners();\n }\n\n render() {\n const { globalBounds, selectionBounds, elementWidth, elementHeight } = this.state;\n\n let pixelMinX = Math.min(Math.max((selectionBounds.minX - globalBounds.minX)/(globalBounds.maxX - globalBounds.minX), 0), 1) * elementWidth || 0;\n let pixelMaxX = Math.min(Math.max((selectionBounds.maxX - globalBounds.minX)/(globalBounds.maxX - globalBounds.minX), 0), 1) * elementWidth || 0;\n\n if (isNaN(pixelMinX) || !isFinite(pixelMinX) || selectionBounds.maxX < selectionBounds.minX) {\n pixelMinX = 0;\n }\n\n if (isNaN(pixelMaxX) || !isFinite(pixelMaxX) || selectionBounds.maxX < selectionBounds.minX) {\n pixelMaxX = 0;\n }\n\n const barSize = 14;\n const totalHeight = elementHeight + barSize; \n let ticks;\n\n if (selectionBounds.dates && this.props.markDates) {\n ticks = placeGrid({\n min: globalBounds.minX,\n max: globalBounds.maxX,\n totalSize: elementWidth,\n precision: 'day',\n dates: selectionBounds.dates,\n formatter: formatX,\n expectedLabelSize: 30,\n labelPadding: 5,\n formatOptions: {\n justMonthAndDay: true,\n unitOverride: 'day',\n timeZone: this.props.timeZone\n },\n skipFirst: true,\n skipLast: true\n });\n }\n\n return (\n <div className=\"range-selection-graph\">\n <div className=\"graph-body graph-body-secondary\" style={{ touchAction: 'none' }}>\n <canvas ref={(el) => this.el = el} />\n\n <svg style={{ height: totalHeight }}>\n <g>\n <rect\n x={0}\n y={elementHeight}\n width={elementWidth}\n height={barSize}\n className=\"selection-bar-track\"\n />\n\n {\n ticks && ticks.map(({ pixelValue, label, size, position }, i) => {\n if (isNaN(pixelValue)) {\n return null;\n }\n\n const classes = ['axis-item', `axis-item-${size}`, `axis-item-${position}`];\n \n const isHighlighted = pixelValue >= pixelMinX && pixelValue <= pixelMaxX;\n if (isHighlighted) {\n classes.push('axis-item-highlighted');\n }\n\n return (\n <g key={i} className={classes.join(' ')}>\n <path d={`M${pixelValue},0 v${elementHeight}`} />\n\n <text x={pixelValue + 3} y={elementHeight}>\n {label}\n </text>\n </g>\n );\n })\n }\n\n <rect\n x={pixelMinX}\n y={elementHeight}\n width={pixelMaxX - pixelMinX}\n height={barSize}\n className=\"selection-bar\"\n onMouseDown={this.startScroll}\n onTouchStart={this.startScroll}\n />\n\n <path\n d=\"M -3 3.5 L -3 9.333333333333334 M 0 3.5 L 0 9.333333333333334 M 3 3.5 L 3 9.333333333333334\"\n className=\"selection-bar-rifles\"\n transform={`translate(${pixelMinX + (pixelMaxX - pixelMinX)/2},${elementHeight})`}\n onMouseDown={this.startScroll}\n onTouchStart={this.startScroll}\n />\n </g>\n\n <g>\n <rect\n x={pixelMinX}\n y={0}\n width={pixelMaxX - pixelMinX}\n height={totalHeight}\n className=\"target-selection-outline\"\n onMouseDown={this.startScroll}\n onTouchStart={this.startScroll}\n />\n </g>\n\n {/* Left handle */}\n <g className={`selection-handle${(this._dragType === 'left' || this._dragType === 'scroll') ? ' selection-handle-dragging' : ''}`}>\n <rect\n x={pixelMinX - 15}\n y={(elementHeight - 30)/2}\n width={30}\n height={30}\n fill=\"transparent\"\n className=\"selection-bar-handle-hit\"\n onMouseDown={this.startLeftDrag}\n onTouchStart={this.startLeftDrag}\n />\n <path\n d=\"M -4.5 0.5 L 3.5 0.5 L 3.5 15.5 L -4.5 15.5 L -4.5 0.5 M -1.5 4 L -1.5 12 M 0.5 4 L 0.5 12\"\n className=\"selection-bar-handle\"\n transform={`translate(${pixelMinX},${(elementHeight - 15)/2})`}\n onMouseDown={this.startLeftDrag}\n onTouchStart={this.startLeftDrag}\n />\n </g>\n\n {/* Right handle */}\n <g className={`selection-handle${(this._dragType === 'right' || this._dragType === 'scroll') ? ' selection-handle-dragging' : ''}`}>\n <rect\n x={pixelMaxX - 15}\n y={(elementHeight - 30)/2}\n width={30}\n height={30}\n fill=\"transparent\"\n className=\"selection-bar-handle-hit\"\n onMouseDown={this.startRightDrag}\n onTouchStart={this.startRightDrag}\n />\n <path\n d=\"M -4.5 0.5 L 3.5 0.5 L 3.5 15.5 L -4.5 15.5 L -4.5 0.5 M -1.5 4 L -1.5 12 M 0.5 4 L 0.5 12\"\n className=\"selection-bar-handle\"\n transform={`translate(${pixelMaxX},${(elementHeight - 15)/2})`}\n onMouseDown={this.startRightDrag}\n onTouchStart={this.startRightDrag}\n />\n </g>\n\n </svg>\n\n {\n this.props.verticalLines &&\n <VerticalLines\n stateController={this.props.stateController}\n verticalLines={this.props.verticalLines}\n isRangeGraph={true}\n bounds={globalBounds}\n elementHeight={elementHeight}\n elementWidth={elementWidth}\n />\n }\n </div>\n </div>\n );\n }\n\n}\n\nRangeGraph.defaultProps = {\n width: 3,\n shadowColor: 'transparent'\n};\n\nRangeGraph.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n webgl: PropTypes.bool,\n draggingY: PropTypes.bool,\n checkIntersection: PropTypes.bool,\n markDates: PropTypes.bool,\n timeZone: PropTypes.string,\n verticalLines: CustomPropTypes.VerticalLines\n};","import React from 'react';\nimport getColor from '../helpers/colors';\nimport CustomPropTypes from '../helpers/custom_prop_types';\nimport PropTypes from 'prop-types';\nimport StateController from '../state/state_controller';\nimport nameForSeries from '../helpers/name_for_series';\n\nexport default React.memo(SeriesKeyItem);\n\nfunction SeriesKeyItem({ series, i, style, onMouseDown, theme, stateController, highlighted }) {\n const color = getColor(series.color, i, series.multigrapherSeriesIndex);\n\n if (theme === 'day') {\n style = Object.assign({}, style, {\n backgroundColor: color\n });\n } else {\n style = Object.assign({}, style, {\n color\n });\n }\n\n const classes = ['series-key-item'];\n if (highlighted) {\n classes.push('series-key-item-highlighted');\n }\n\n const name = nameForSeries(series, i);\n\n return (\n <div\n className={classes.join(' ')}\n style={style}\n onMouseDown={onMouseDown}\n onMouseOver={() => stateController.setHighlightedSeries(i)}\n onMouseOut={() => stateController.setHighlightedSeries(null)}\n onClick={() => stateController.registerSeriesClick(i)}\n >\n {name}\n </div>\n );\n}\n\nSeriesKeyItem.propTypes = {\n series: CustomPropTypes.SingleSeries.isRequired,\n stateController: PropTypes.instanceOf(StateController),\n i: PropTypes.number.isRequired,\n style: PropTypes.object,\n onMouseDown: PropTypes.func,\n theme: PropTypes.string.isRequired,\n highlighted: PropTypes.bool\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport StateController from '../state/state_controller';\n\nexport default class SeriesKeyAxisContainer extends React.PureComponent {\n\n constructor(props) {\n super(props);\n\n this.state = {\n showingLabelInput: false\n };\n\n this.toggleLabelInputShowing = this.toggleLabelInputShowing.bind(this);\n }\n\n toggleLabelInputShowing() {\n this.setState(({ showingLabelInput }) => {\n return {\n showingLabelInput: !showingLabelInput\n };\n });\n }\n\n render() {\n const {children, stateController, axisIndex, scale, label, grapherID} = this.props;\n\n const { showingLabelInput } = this.state;\n\n return (\n <div\n className={`series-key-axis-container${showingLabelInput ? ' series-key-axis-container-showing-label' : ''}`}\n data-axis-index={axisIndex}\n data-grapher-id={grapherID}\n >\n <div className=\"scale-label\" onClick={() => stateController.toggleScale({axisIndex})}>\n {scale.slice(0, showingLabelInput ? 6 : 3)}\n </div>\n\n <div className=\"series-key-axis-container-body\">\n <div>\n {children}\n\n <svg className=\"label-input-toggler\" viewBox=\"0 0 512 512\" onClick={this.toggleLabelInputShowing}>\n <path\n d=\"M0 252.118V48C0 21.49 21.49 0 48 0h204.118a48 48 0 0 1 33.941 14.059l211.882 211.882c18.745 18.745 18.745 49.137 0 67.882L293.823 497.941c-18.745 18.745-49.137 18.745-67.882 0L14.059 286.059A48 48 0 0 1 0 252.118zM112 64c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48z\"/>\n </svg>\n </div>\n\n <div className=\"series-key-axis-label-container\">\n <input\n onChange={(event) => stateController.setLabel({axisIndex, label: event.target.value})}\n placeholder=\"Enter label\"\n value={label || ''}\n />\n </div>\n </div>\n </div>\n );\n }\n}\n\nSeriesKeyAxisContainer.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n children: PropTypes.node.isRequired,\n axisIndex: PropTypes.number.isRequired,\n scale: PropTypes.string.isRequired,\n label: PropTypes.string,\n grapherID: PropTypes.string\n};\n","import React, { useState, useEffect, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport {Y_AXIS_WIDTH} from '../helpers/axis_sizes';\nimport StateController from '../state/state_controller';\nimport {\n useAlwaysTooltipped,\n useAxes,\n useHighlightedSeries,\n useLeftAxisCount,\n usePrimarySize,\n useRightAxisCount,\n useSeries, useShowingOptions\n} from '../state/hooks';\nimport SeriesKeyItem from './series_key_item.jsx';\nimport SeriesKeyAxisContainer from './series_key_axis_container.jsx';\n\nfunction calculateStyles({stateController, keyWidth}) {\n const rightAxisCount = useRightAxisCount(stateController);\n const leftAxisCount = useLeftAxisCount(stateController);\n const showingOptions = useShowingOptions(stateController);\n\n let marginRight = Y_AXIS_WIDTH*rightAxisCount;\n if (rightAxisCount > 0) {\n marginRight += 5;\n }\n\n marginRight += 250;\n\n if (showingOptions) {\n marginRight += 70;\n }\n\n let marginLeft = Y_AXIS_WIDTH*leftAxisCount;\n\n if (leftAxisCount > 0) {\n marginLeft += 5;\n }\n\n marginLeft = Math.max(marginRight, marginLeft);\n marginRight = Math.max(marginRight, marginLeft);\n\n let marginBottom;\n\n const { elementWidth } = usePrimarySize(stateController);\n\n const shouldBreak = elementWidth - marginLeft - marginRight < keyWidth;\n\n if (shouldBreak) {\n marginLeft = 0;\n marginRight = 0;\n marginBottom = 10;\n }\n\n return { marginRight, marginLeft, marginBottom };\n}\n\nexport default React.memo(SeriesKey);\n\nfunction SeriesKey({ stateController, theme, draggingY, grapherID, dragPositionYOffset=0 }) {\n const series = useSeries(stateController);\n const [draggedSeries, setDraggedSeries] = useState(null);\n const [dragPosition, setDragPosition] = useState({\n x: 0,\n y: 0\n });\n\n const highlightedSeries = useHighlightedSeries(stateController);\n\n const keyRef = useRef(null);\n const [keyWidth, setKeyWidth] = useState(series.map(({ name, yKey }, i) => (name || yKey || i).toString().length).reduce((a, b) => a + b, 0) * 5);\n\n let sizeCalculationHandle;\n useEffect(() => {\n if (keyRef.current) {\n cancelAnimationFrame(sizeCalculationHandle);\n\n sizeCalculationHandle = requestAnimationFrame(() => {\n if (!keyRef.current) { // has become invalid in the last frame\n return;\n }\n\n const width = [...keyRef.current.querySelectorAll('.series-key-axis-container')]\n .map((el) => el.clientWidth)\n .reduce((a, b) => a + b, 0);\n setKeyWidth(width);\n });\n }\n }, [series, keyRef.current]);\n\n const style = calculateStyles({ stateController, keyWidth });\n\n const axes = useAxes(stateController);\n const alwaysTooltipped = useAlwaysTooltipped(stateController);\n\n const startDragging = (event, singleSeries) => {\n let seriesKeyEl = event.target;\n while (seriesKeyEl && seriesKeyEl.className !== 'series-key') {\n seriesKeyEl = seriesKeyEl.parentNode;\n }\n const targetLeft = event.target.getBoundingClientRect().left;\n let seriesKeyLeft = seriesKeyEl.getBoundingClientRect().left;\n let seriesKeyMarginLeft = seriesKeyEl.style.marginLeft;\n\n const startX = event.clientX;\n const startY = event.clientY;\n const clientStartX = event.clientX;\n const clientStartY = event.clientY;\n\n setDraggedSeries(singleSeries);\n setDragPosition({\n x: event.clientX - startX + (targetLeft - seriesKeyLeft) - 2,\n y: event.clientY - startY + 1\n });\n\n const onMouseMove = (moveEvent) => {\n if (seriesKeyEl.style.marginLeft !== seriesKeyMarginLeft) {\n seriesKeyLeft = seriesKeyEl.getBoundingClientRect().left;\n seriesKeyMarginLeft = seriesKeyEl.style.marginLeft;\n }\n\n setDragPosition({\n x: moveEvent.clientX - startX + (targetLeft - seriesKeyLeft) - 2,\n y: moveEvent.clientY - startY + 1\n });\n };\n\n const onMouseUp = (mouseUpEvent) => {\n window.removeEventListener('mousemove', onMouseMove);\n window.removeEventListener('mouseup', onMouseUp);\n\n let target = mouseUpEvent.target;\n while (target && !(target.dataset || {}).axisIndex && !(target.dataset || {}).grapherId) {\n target = target.parentNode;\n }\n\n setDraggedSeries(null);\n stateController.finalizeDrag(singleSeries, target && (target.dataset || {}).axisIndex, target && (target.dataset || {}).grapherId);\n\n if (mouseUpEvent.clientX === clientStartX && mouseUpEvent.clientY === clientStartY) {\n stateController.toggleAlwaysTooltipped(singleSeries, mouseUpEvent.shiftKey);\n }\n };\n\n window.addEventListener('mousemove', onMouseMove);\n window.addEventListener('mouseup', onMouseUp);\n\n stateController.markDragStart();\n };\n\n return (\n <div className=\"series-key\" style={style} ref={keyRef}>\n {\n draggingY &&\n <div\n className=\"series-key-axis-container\"\n data-axis-index=\"new-left\"\n data-grapher-id={grapherID}\n />\n }\n\n {\n axes.map((axis, i) => {\n if (!axis.series.length && axes.length > 1) {\n return null;\n }\n\n return (\n <SeriesKeyAxisContainer\n key={i}\n label={axis.label}\n axisIndex={axis.axisIndex}\n scale={axis.scale}\n stateController={stateController}\n grapherID={grapherID}\n >\n {\n axis.series.map((singleSeries) => {\n if (singleSeries.hideFromKey) {\n return null;\n }\n\n return (\n <SeriesKeyItem\n key={singleSeries.index}\n series={singleSeries}\n i={singleSeries.index}\n onMouseDown={(event, toggleTooltipped) => startDragging(event, singleSeries, toggleTooltipped)}\n theme={theme}\n stateController={stateController}\n highlighted={highlightedSeries === singleSeries.index || alwaysTooltipped.has(singleSeries)}\n />\n );\n })\n }\n </SeriesKeyAxisContainer>\n );\n })\n }\n\n {\n draggingY &&\n <div\n className=\"series-key-axis-container\"\n data-axis-index=\"new-right\"\n data-grapher-id={grapherID}\n />\n }\n\n {\n draggedSeries &&\n <SeriesKeyItem\n style={{\n left: dragPosition.x,\n top: dragPosition.y - dragPositionYOffset,\n position: 'absolute',\n pointerEvents: 'none',\n zIndex: 1\n }}\n series={draggedSeries}\n i={draggedSeries.index}\n theme={theme}\n stateController={stateController}\n />\n }\n </div>\n );\n}\n\nSeriesKey.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n theme: PropTypes.string.isRequired,\n draggingY: PropTypes.bool.isRequired,\n grapherID: PropTypes.string,\n dragPositionYOffset: PropTypes.number\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nexport default React.memo(GraphTitle);\n\nfunction GraphTitle({ title }) {\n return (\n <div className=\"grapher-title\">\n {title}\n </div>\n );\n}\n\nGraphTitle.propTypes = {\n title: PropTypes.string.isRequired\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport StateController from '../state/state_controller';\nimport {useSeries} from '../state/hooks';\nimport CustomPropTypes from '../helpers/custom_prop_types';\nimport getColor from '../helpers/colors';\n\nclass SeriesToggle extends React.PureComponent {\n\n constructor(props) {\n super(props);\n\n this.onChange = this.onChange.bind(this);\n }\n\n // NOTE: event listeners here do not follow React best practices, because when handled through React\n // there were ~500ms of latency when toggling the checkbox. It's unclear why\n onChange(event) {\n setTimeout(() => {\n this.props.stateController.setShowing(this.props.singleSeries, event.target.checked);\n });\n }\n\n render() {\n const { singleSeries } = this.props;\n const color = getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex);\n\n let name = singleSeries.name || singleSeries.yKey;\n\n if (!name) {\n name = singleSeries.index;\n }\n\n return (\n <div className=\"series-toggle\">\n <label>\n <input\n type=\"checkbox\"\n defaultChecked={!singleSeries.hidden}\n ref={(el) => el && el.addEventListener('change', this.onChange)}\n />\n <span className=\"checkmark\" style={{ background: color, borderColor: color }} />\n\n {name}\n </label>\n </div>\n );\n }\n}\n\nSeriesToggle.propTypes = {\n singleSeries: CustomPropTypes.SingleSeries.isRequired,\n stateController: PropTypes.instanceOf(StateController).isRequired\n};\n\nexport default function Sidebar({ stateController }) {\n const series = useSeries(stateController);\n\n return (\n <div className=\"grapher-sidebar\">\n {\n series.map((singleSeries, i) =>\n <SeriesToggle\n key={i}\n singleSeries={singleSeries}\n stateController={stateController}\n />\n )\n }\n </div>\n );\n}\n\nSidebar.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired\n};\n","export default class SyncPool {\n\n /**\n *\n * @param {Boolean} syncBounds\n * @param {Boolean|'onShift'} syncTooltips\n * @param {Boolean} syncDragState\n */\n constructor({ syncBounds=true, syncTooltips=true, syncDragState=false } = {}) {\n this._stateControllers = new Set();\n this._syncBounds = syncBounds;\n this._syncTooltips = syncTooltips;\n this._syncDragState = syncDragState;\n }\n\n add(stateController) {\n this._stateControllers.add(stateController);\n\n if (this._syncBounds) {\n this.syncBounds(stateController);\n }\n\n if (this._syncTooltips) {\n this.syncTooltips(stateController);\n }\n\n if (this._syncDragState) {\n this.syncDragState(stateController);\n }\n }\n\n remove(stateController) {\n this._stateControllers.delete(stateController);\n\n // TODO: remove listeners\n // (though since this is currently only called by stateController dispose, it probably doesn't matter)\n }\n\n syncDragState(stateController) {\n stateController.on('dragging_y_changed', (draggingY) => {\n for (let otherStateController of this._stateControllers) {\n if (stateController === otherStateController) {\n continue;\n }\n\n if (draggingY) {\n otherStateController.markDragStart();\n } else {\n otherStateController.finalizeDrag(null, null);\n }\n }\n });\n }\n\n syncBounds(stateController) {\n stateController.on('bound_calculator_changed', (boundCalculator) => {\n for (let otherStateController of this._stateControllers) {\n if (stateController === otherStateController) {\n continue;\n }\n\n otherStateController.boundCalculator = boundCalculator;\n }\n });\n }\n\n syncTooltips(stateController) {\n stateController.on('tooltip_state_changed', (tooltipState, stateArg) => {\n if (this._tooltipIgnoreState === stateArg) { // avoid cascading changes\n return;\n }\n\n const shouldHideTooltips = tooltipState.unsavedTooltipsCount === 0 ||\n !tooltipState.mousePresent ||\n (this._syncTooltips === 'onShift' && !stateController.shiftKeyPressedOnMove);\n\n if (shouldHideTooltips) {\n this._tooltipIgnoreState = Math.random();\n }\n\n for (let otherStateController of this._stateControllers) {\n if (stateController === otherStateController) {\n continue;\n }\n\n if (shouldHideTooltips) {\n otherStateController.showOnlySavedTooltips(this._tooltipIgnoreState);\n continue;\n }\n\n otherStateController.setTooltipMousePosition({\n mouseX: tooltipState.mouseX,\n mouseY: tooltipState.mouseY,\n tooltipAllNext: true,\n tooltipStateArg: this._tooltipIgnoreState\n });\n }\n });\n }\n\n}\n","import React, { useEffect, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport CustomPropTypes from './helpers/custom_prop_types';\nimport GraphBody from './components/graph_body.jsx';\nimport './grapher.scss';\nimport XAxis from './components/x_axis.jsx';\nimport YAxis from './components/y_axis.jsx';\nimport WindArrows from './components/wind_arrows.jsx';\nimport RangeSelection from './components/range_selection.jsx';\nimport RangeGraph from './components/range_graph.jsx';\nimport SeriesKey from './components/series_key.jsx';\nimport {Y_AXIS_WIDTH} from './helpers/axis_sizes';\nimport GraphTitle from './components/graph_title.jsx';\nimport {LINE_COLORS} from './helpers/colors';\nimport StateController from './state/state_controller';\nimport {useDraggingY, useLeftAxes, useRightAxes, useShowingSidebar, useTheme} from './state/hooks';\nimport Sidebar from './components/sidebar.jsx';\nimport SyncPool from './state/sync_pool.js';\nimport BOUND_CALCULATORS from './state/bound_calculators.js';\n\nfunction calculateClassNamesAndStyles(props, { draggingY, theme }) {\n const { fullscreen, height, width } = props;\n\n const classNames = [\n 'grapher',\n `grapher-${theme}`\n ];\n\n const styles = {};\n\n if (draggingY) {\n classNames.push('grapher-dragging-y');\n }\n\n if (fullscreen) {\n classNames.push('grapher-fullscreen');\n classNames.push('grapher-fixed-height');\n } else if (height) {\n classNames.push('grapher-fixed-height');\n if (typeof height === 'number') {\n styles.height = height - 20;\n } else {\n styles.height = `calc(${height} - 20px)`;\n }\n }\n\n if (width) {\n styles.width = width;\n }\n\n return {\n styles,\n classNames\n };\n}\n\nexport default React.memo(Grapher);\n\nconst grapherDefaultProps = {\n theme: 'night',\n showAxes: true,\n showRangeGraph: true,\n showRangeSelectors: true,\n showSeriesKey: true,\n showTooltips: true,\n boundsSelectionEnabled: true,\n customBoundsSelectors: [],\n sidebarEnabled: false,\n defaultShowAnnotations: true,\n defaultShowOptions: true\n};\n\nfunction Grapher(props) {\n props = {...grapherDefaultProps, ...props};\n\n const stateController = useMemo(() => new StateController({\n grapherID: props.id,\n ...props,\n ...props.stateControllerInitialization\n }), []);\n\n useEffect(() => {\n if (process.env.NODE_ENV === 'development') {\n window.stateController = stateController;\n }\n\n return () => {\n stateController.dispose();\n };\n }, [stateController]);\n\n useEffect(() => {\n props.exportStateController && props.exportStateController(stateController);\n }, [stateController, props.exportStateController]);\n\n useEffect(() => {\n stateController.timingFrameCount = props.timingFrameCount;\n }, [stateController, props.timingFrameCount]);\n\n useEffect(() => {\n props.onRenderTime && stateController.on('render_time', props.onRenderTime);\n\n return () => {\n props.onRenderTime && stateController.off('render_time', props.onRenderTime);\n };\n }, [stateController, props.onRenderTime]);\n\n useEffect(() => {\n stateController.setSeries(props.series);\n }, [stateController, props.series]);\n\n useEffect(() => {\n stateController.theme = props.theme;\n }, [stateController, props.theme]);\n\n const theme = useTheme(stateController);\n const bigLabels = props.bigLabels || theme === 'export';\n\n const defaultLineWidth = props.defaultLineWidth || (theme === 'export' ? 3 : undefined);\n useEffect(() => {\n stateController.defaultLineWidth = defaultLineWidth;\n }, [stateController, defaultLineWidth]);\n\n useEffect(() => {\n stateController.percentile = props.percentile;\n }, [stateController, props.percentile]);\n\n useEffect(() => {\n stateController.customBoundsSelectors = props.customBoundsSelectors;\n }, [stateController, props.customBoundsSelectors]);\n\n useEffect(() => {\n stateController.annotations = props.annotations;\n }, [stateController, props.annotations]);\n\n useEffect(() => {\n if (!props.onAxisChange) {\n return () => {};\n }\n\n stateController.on('exported_axes_changed', props.onAxisChange);\n return () => {\n stateController.off('exported_axes_changed', props.onAxisChange);\n };\n }, [stateController, props.onAxisChange]);\n\n useEffect(() => {\n stateController.primaryRenderer.resize();\n }, [props.height]);\n\n const draggingY = useDraggingY(stateController);\n\n const {styles, classNames} = calculateClassNamesAndStyles(props, { draggingY, theme });\n\n const rightAxes = useRightAxes(stateController);\n const leftAxes = useLeftAxes(stateController);\n const showingSidebar = useShowingSidebar(stateController);\n\n const showAxisColors = typeof props.showAxisColors === 'boolean' ? props.showAxisColors : (theme !== 'export');\n const showGrid = typeof props.showGrid === 'boolean' ? props.showGrid : true;\n const showAxes = typeof props.showAxes === 'boolean' ? props.showAxes : false;\n\n const commonYAxisProps = {\n stateController,\n showAxes,\n showGrid,\n showSeriesKey: props.showSeriesKey,\n bodyHeight: props.bodyHeight,\n theme,\n grapherID: props.id,\n dragPositionYOffset: props.dragPositionYOffset,\n showAxisColors,\n bigLabels\n };\n\n return (\n <div className={classNames.join(' ')} style={styles} data-grapher-id={props.id}>\n {\n props.title &&\n <GraphTitle title={props.title} />\n }\n\n <div className=\"grapher-primary-container-outer\">\n {\n showingSidebar &&\n <Sidebar stateController={stateController} />\n }\n\n <div className=\"grapher-primary-container-body\">\n {\n props.showSeriesKey &&\n <SeriesKey\n stateController={stateController}\n draggingY={draggingY}\n theme={props.theme}\n grapherID={props.id}\n dragPositionYOffset={props.dragPositionYOffset}\n />\n }\n\n {\n props.showRangeSelectors &&\n <RangeSelection\n stateController={stateController}\n customBoundsSelectors={props.customBoundsSelectors}\n customBoundsSelectorsOnly={props.customBoundsSelectorsOnly}\n sidebarEnabled={props.sidebarEnabled}\n />\n }\n\n <div className=\"grapher-main-row\">\n {\n draggingY &&\n <div\n className=\"axis y-axis\"\n data-axis-index=\"new-left\"\n data-grapher-id={props.id}\n style={{\n width: Y_AXIS_WIDTH,\n height: typeof props.bodyHeight === 'number' ? props.bodyHeight : undefined\n }}\n />\n }\n\n {\n leftAxes.map((axis, i) => {\n return <YAxis\n key={i}\n axis={axis}\n sideIndex={leftAxes.length - i - 1}\n {...commonYAxisProps}\n />;\n })\n }\n\n <div className=\"central-container\">\n <GraphBody\n stateController={stateController}\n webgl={props.webgl}\n bodyHeight={props.bodyHeight}\n boundsSelectionEnabled={props.boundsSelectionEnabled}\n showTooltips={props.showTooltips}\n showContextMenu={props.showContextMenu}\n tooltipOptions={props.tooltipOptions}\n checkIntersection={props.checkIntersection}\n draggablePoints={props.draggablePoints}\n onPointDrag={props.onPointDrag}\n onDraggablePointsDoubleClick={props.onDraggablePointsDoubleClick}\n onPointClick={props.onPointClick}\n verticalLines={props.verticalLines}\n clockStyle={props.clockStyle}\n timeZone={props.timeZone}\n />\n\n <WindArrows stateController={stateController} />\n\n <XAxis\n showGrid={showGrid}\n showAxes={showAxes}\n stateController={stateController}\n bigLabels={bigLabels}\n xTickUnit={props.xTickUnit}\n clockStyle={props.clockStyle}\n timeZone={props.timeZone}\n integersOnly={props.xAxisIntegersOnly}\n formatXAxisLabel={props.formatXAxisLabel}\n />\n\n {\n props.showRangeGraph &&\n <div className=\"range-graph-container\">\n <RangeGraph\n stateController={stateController}\n webgl={props.webgl}\n checkIntersection={props.checkIntersection}\n markDates={props.markRangeGraphDates}\n timeZone={props.timeZone}\n verticalLines={props.verticalLines}\n />\n </div>\n }\n </div>\n\n {\n rightAxes.map((axis, i) => {\n return <YAxis\n key={i}\n axis={axis}\n sideIndex={i}\n {...commonYAxisProps}\n />;\n })\n }\n\n {\n draggingY &&\n <div\n className=\"axis y-axis\"\n data-axis-index=\"new-right\"\n data-grapher-id={props.id}\n style={{\n width: Y_AXIS_WIDTH,\n height: typeof props.bodyHeight === 'number' ? props.bodyHeight : undefined\n }}\n />\n }\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nGrapher.propTypes = {\n series: CustomPropTypes.Series.isRequired,\n webgl: PropTypes.bool,\n requireWASM: PropTypes.bool,\n checkIntersection: PropTypes.bool,\n\n onAxisChange: PropTypes.func,\n onRenderTime: PropTypes.func,\n exportStateController: PropTypes.func,\n timingFrameCount: PropTypes.number,\n\n stateControllerInitialization: PropTypes.object,\n syncPool: PropTypes.instanceOf(SyncPool),\n id: PropTypes.string,\n dragPositionYOffset: PropTypes.number,\n\n theme: PropTypes.oneOf(['day', 'night', 'export']),\n title: PropTypes.string,\n fullscreen: PropTypes.bool,\n bodyHeight: PropTypes.number,\n height: PropTypes.number,\n width: PropTypes.number,\n\n showAxes: PropTypes.bool,\n showRangeGraph: PropTypes.bool,\n showRangeSelectors: PropTypes.bool,\n showSeriesKey: PropTypes.bool,\n showTooltips: PropTypes.bool,\n showGrid: PropTypes.bool,\n showAxisColors: PropTypes.bool,\n bigLabels: PropTypes.bool,\n xTickUnit: PropTypes.oneOf(['year']),\n formatXAxisLabel: PropTypes.func,\n xAxisIntegersOnly: PropTypes.bool,\n clockStyle: PropTypes.oneOf(['12h', '24h']),\n timeZone: PropTypes.string, // local, utc, or a full timezone string\n markRangeGraphDates: PropTypes.bool,\n\n boundsSelectionEnabled: PropTypes.bool,\n sidebarEnabled: PropTypes.bool,\n\n percentile: PropTypes.number,\n defaultShowOptions: PropTypes.bool,\n defaultShowIndividualPoints: PropTypes.bool,\n defaultShowSidebar: PropTypes.bool,\n defaultShowAnnotations: PropTypes.bool,\n defaultLineWidth: PropTypes.number,\n\n tooltipOptions: CustomPropTypes.TooltipOptions,\n\n customBoundsSelectors: CustomPropTypes.CustomBoundsSelectors,\n customBoundsSelectorsOnly: PropTypes.bool,\n defaultBoundsCalculator: PropTypes.string,\n\n annotations: CustomPropTypes.Annotations,\n draggablePoints: CustomPropTypes.DraggablePoints,\n onPointDrag: PropTypes.func,\n onDraggablePointsDoubleClick: PropTypes.func,\n verticalLines: CustomPropTypes.VerticalLines,\n onPointClick: PropTypes.func\n};\n\nexport const AVAILABLE_COLORS = LINE_COLORS;\nexport const BUILT_IN_BOUND_CALCULATORS = BOUND_CALCULATORS;\n","import Eventable from '../eventable.js';\nimport getColor from '../helpers/colors.js';\nimport nameForSeries from '../helpers/name_for_series.js';\n\nexport default class MultigraphStateController extends Eventable {\n\n constructor({ id }) {\n super();\n\n this._id = id;\n\n this._multiSeries = [];\n this._seriesToGraphIndices = new Map();\n this._graphIndicesToSeries = new Map();\n this._modifiedSeries = new Map();\n this._originalSeriesByMultigrapherIndex = new Map();\n this._stateControllers = new Set();\n this._prevSeries = [];\n\n this._dataCache = new Map();\n this._subscriptions = new Map();\n\n this._draggingY = false;\n\n this.on('multi_series_changed', () => {\n for (let stateController of this._stateControllers) {\n stateController._multiSeries = this._multiSeries;\n }\n });\n }\n\n /**\n * Takes an array of user-supplied series, then splits, modifies, and broadcasts them\n *\n * @param {Array<Object>} series\n */\n setSeries(series) {\n\n if (this._prevSeries.length === series.length) {\n let anyDifferent = false;\n for (let i = 0; i < series.length; i++) {\n if (series[i] !== this._prevSeries[i]) {\n anyDifferent = true;\n break;\n }\n }\n\n if (!anyDifferent) {\n return;\n }\n }\n\n this._prevSeries = series;\n\n const graphIndices = new Set();\n const currentSeriesSet = new Set(series);\n\n for (let singleSeries of series) {\n let graphIndex = singleSeries.graph || 0;\n\n if (this._seriesToGraphIndices.has(singleSeries)) {\n graphIndex = this._seriesToGraphIndices.get(singleSeries);\n }\n\n graphIndices.add(graphIndex);\n\n let seriesSet = this._graphIndicesToSeries.get(graphIndex);\n if (!seriesSet) {\n seriesSet = new Set();\n this._graphIndicesToSeries.set(graphIndex, seriesSet);\n }\n\n seriesSet.add(singleSeries);\n }\n\n const sortedGraphIndices = [...graphIndices].sort();\n\n this._multiSeries = [];\n let globalSeriesIndex = 0;\n\n for (let graphIndex of sortedGraphIndices) {\n const series = [];\n\n for (let singleSeries of this._graphIndicesToSeries.get(graphIndex)) {\n if (!currentSeriesSet.has(singleSeries)) {\n this._graphIndicesToSeries.get(graphIndex).delete(singleSeries);\n continue;\n }\n\n if (this._modifiedSeries.has(singleSeries)) {\n globalSeriesIndex++;\n series.push(this._modifiedSeries.get(singleSeries));\n continue;\n }\n\n const color = getColor(singleSeries.color, globalSeriesIndex);\n const name = nameForSeries(singleSeries, globalSeriesIndex);\n const modifiedSeries = {\n ...singleSeries,\n multigrapherSeriesIndex: globalSeriesIndex,\n multigrapherGraphIndex: graphIndex,\n color,\n name\n };\n\n this._modifiedSeries.set(singleSeries, modifiedSeries);\n this._originalSeriesByMultigrapherIndex.set(globalSeriesIndex, singleSeries);\n\n globalSeriesIndex++;\n series.push(modifiedSeries);\n }\n\n this._multiSeries.push(series);\n }\n\n if (this._nextMultigrapherSeriesIndex) {\n this._nextMultigrapherSeriesIndex = this._nextMultigrapherSeriesIndex - this._multiSeriesCount + globalSeriesIndex;\n } else {\n this._nextMultigrapherSeriesIndex = globalSeriesIndex;\n }\n this._multiSeriesCount = globalSeriesIndex;\n\n this.emit('multi_series_changed', this.multiSeries);\n }\n\n /**\n * Registers a state controller for series switching\n *\n * @param {StateController} stateController\n */\n registerStateController(stateController) {\n if (this._stateControllers.has(stateController)) {\n return;\n }\n\n this._stateControllers.add(stateController);\n stateController._multigraphStateController = this;\n stateController._multiSeries = this._multiSeries;\n\n stateController.on('dragging_y_finalized', ({ grapherID, axisIndex, draggedSeries }={}) => {\n if (grapherID === stateController.grapherID) {\n return;\n }\n\n const [check, multigrapherID, graphIndex] = grapherID.split('-');\n if (check !== 'multigrapher' || multigrapherID !== this._id) {\n return;\n }\n\n setTimeout(() => {\n this.moveSeries({ axisIndex, draggedSeries, graphIndex });\n });\n });\n\n stateController.on('dragging_y_changed', (draggingY) => {\n if (draggingY === this._draggingY) {\n return;\n }\n\n this._draggingY = draggingY;\n this.emit('dragging_y_changed', this._draggingY);\n });\n\n stateController.on('observable_modified', (observable) => {\n for (let otherStateController of this._stateControllers) {\n if (stateController === otherStateController) {\n continue;\n }\n\n otherStateController.markObservableModified(observable);\n }\n });\n\n stateController.on('dispose', () => {\n this._stateControllers.delete(stateController);\n });\n }\n\n /**\n * Moves the given dragged series (as specified by the child state controller) to a different graph\n *\n * @param {String} axisIndex - the axis index on the new graph to move the series to\n * @param {Object} draggedSeries - the series that got dragged. Different identity than what this may access\n * @param {String} graphIndex - the index of the graph to assign it to\n */\n moveSeries({ axisIndex, draggedSeries, graphIndex }) {\n const prevGraphCount = this.graphCount;\n\n const originalSeries = this._originalSeriesByMultigrapherIndex.get(draggedSeries.multigrapherSeriesIndex);\n const modifiedSeries = this._modifiedSeries.get(originalSeries);\n\n this._multiSeries[modifiedSeries.multigrapherGraphIndex].splice(\n this._multiSeries[modifiedSeries.multigrapherGraphIndex].indexOf(modifiedSeries), 1\n );\n this._multiSeries[modifiedSeries.multigrapherGraphIndex] = [...this._multiSeries[modifiedSeries.multigrapherGraphIndex]];\n\n if (graphIndex === 'top') {\n modifiedSeries.multigrapherGraphIndex = this._createGraphAtTop();\n } else if (graphIndex === 'bottom') {\n modifiedSeries.multigrapherGraphIndex = this._createGraphAtBottom();\n } else {\n modifiedSeries.multigrapherGraphIndex = parseInt(graphIndex);\n }\n\n modifiedSeries.axisIndex = axisIndex;\n // safe because stateController operates on a copy. We could also have changed the identify of modifiedSeries,\n // but with that we might reset data when moving it back\n delete modifiedSeries.axis;\n\n this._multiSeries[modifiedSeries.multigrapherGraphIndex] = [...this._multiSeries[modifiedSeries.multigrapherGraphIndex], modifiedSeries];\n this._multiSeries = [...this._multiSeries];\n\n for (let graphIndex = 0; graphIndex < this._multiSeries.length; graphIndex++) {\n const originalSeriesAtIndex = this._multiSeries[graphIndex].map(({ multigrapherSeriesIndex }) =>\n this._originalSeriesByMultigrapherIndex.get(multigrapherSeriesIndex));\n this._graphIndicesToSeries.set(graphIndex, new Set(originalSeriesAtIndex));\n\n for (let singleSeries of originalSeriesAtIndex) {\n this._seriesToGraphIndices.set(singleSeries, graphIndex);\n }\n }\n\n this.emit('multi_series_changed', this.multiSeries);\n this.emit('graph_count_changed', this.graphCount, prevGraphCount);\n }\n\n /**\n * Finds or creates an empty graph at the beginning and returns its index\n *\n * @return {number}\n * @private\n */\n _createGraphAtTop() {\n // check if there's anything at the beginning already\n let emptyAtTopIndex = null;\n\n for (let i = 0; i < this._multiSeries.length; i++) {\n if (this._multiSeries[i].length === 0) {\n emptyAtTopIndex = i;\n } else {\n break;\n }\n }\n\n if (emptyAtTopIndex !== null) {\n return emptyAtTopIndex;\n }\n\n // add a series at the beginning and mutate the graph index of each\n this._multiSeries = [[], ...this._multiSeries];\n for (let graphIndex = 0; graphIndex < this._multiSeries.length; graphIndex++) {\n if (!this._multiSeries[graphIndex].length) {\n continue;\n }\n\n this._multiSeries[graphIndex] = [...this._multiSeries[graphIndex]];\n\n for (let modifiedSeries of this._multiSeries[graphIndex]) {\n modifiedSeries.multigrapherGraphIndex = graphIndex;\n }\n }\n\n return 0;\n }\n\n /**\n * Finds or creates an empty graph at the end and returns its index\n *\n * @return {number}\n * @private\n */\n _createGraphAtBottom() {\n // check if there's anything at the beginning already\n let emptyAtBottomIndex = null;\n\n for (let i = this._multiSeries.length - 1; i >= 0; i--) {\n if (this._multiSeries[i].length === 0) {\n emptyAtBottomIndex = i;\n } else {\n break;\n }\n }\n\n if (emptyAtBottomIndex !== null) {\n return emptyAtBottomIndex;\n }\n\n // add something at the bottom\n this._multiSeries = [...this._multiSeries, []];\n\n return this._multiSeries.length - 1;\n }\n\n get multiSeries() {\n return this._multiSeries.filter((series) => series.length);\n }\n\n get series() {\n return [...this._stateControllers].map((stateController) => stateController.series).flat();\n }\n\n get graphCount() {\n return this.multiSeries.length;\n }\n\n get draggingY() {\n return this._draggingY;\n }\n\n dispose() {\n this.clearListeners();\n\n for (let listener of this._subscriptions.values()) {\n listener.unsubscribe();\n }\n\n this._subscriptions.clear();\n }\n\n get stateControllerInitialization() {\n return {\n sharedDataCache: this._dataCache,\n sharedSubscriptions: this._subscriptions\n };\n }\n\n incrementMultigrapherSeriesIndex() {\n const index = this._nextMultigrapherSeriesIndex;\n\n this._nextMultigrapherSeriesIndex ++;\n\n return index;\n }\n}\n","import React, { useEffect, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport Grapher from './grapher.jsx';\nimport MultigraphStateController from './state/multigraph_state_controller.js';\nimport {useDraggingY, useMultiSeries} from './state/hooks.js';\nimport SyncPool from './state/sync_pool.js';\n\nexport default React.memo(MultiGrapher);\n\n\nfunction MultiGrapher(props) {\n /* eslint-disable react/prop-types */\n\n const multigrapherID = useMemo(() => Math.random().toString(36).slice(2), []);\n\n const multigraphStateController = useMemo(() => new MultigraphStateController({\n id: multigrapherID,\n ...props\n }), []);\n\n const multiSeries = useMultiSeries(multigraphStateController);\n\n const syncPool = useMemo(() => new SyncPool({\n syncBounds: props.syncBounds,\n syncTooltips: props.syncTooltips,\n syncDragState: true\n }), []);\n\n const registerStateController = useMemo(() => multigraphStateController.registerStateController.bind(multigraphStateController), [multigraphStateController]);\n\n useEffect(() => {\n if (process.env.NODE_ENV === 'development') {\n window.multigraphStateController = multigraphStateController;\n }\n\n return () => {\n multigraphStateController.dispose();\n };\n }, [multigraphStateController]);\n\n useEffect(() => {\n props.exportStateController && props.exportStateController(multigraphStateController);\n }, [multigraphStateController, props.exportStateController]);\n\n useEffect(() => {\n multigraphStateController.setSeries(props.series);\n }, [multigraphStateController, props.series]);\n\n useEffect(() => {\n if (!props.onMultiseriesChange) {\n return () => {};\n }\n\n multigraphStateController.on('multi_series_changed', props.onMultiseriesChange);\n return () => {\n multigraphStateController.off('multi_series_changed', props.onMultiseriesChange);\n };\n }, [multigraphStateController, props.onMultiseriesChange]);\n\n const draggingY = useDraggingY(multigraphStateController);\n\n return (\n <div className=\"multigrapher\">\n {\n draggingY && props.newUpperEnabled &&\n <div className={`new-grapher grapher-${props.theme}`} data-grapher-id={`multigrapher-${multigrapherID}-top`}>\n New grapher\n </div>\n }\n\n {\n multiSeries.map((series, i) =>\n <Grapher\n key={i}\n {...props}\n syncPool={syncPool}\n stateControllerInitialization={multigraphStateController.stateControllerInitialization}\n series={series}\n id={`multigrapher-${multigrapherID}-${i}`}\n dragPositionYOffset={props.newUpperEnabled ? 38 : 0}\n exportStateController={registerStateController}\n />\n )\n }\n\n {\n draggingY &&\n <div className={`new-grapher grapher-${props.theme}`} data-grapher-id={`multigrapher-${multigrapherID}-bottom`}>\n New grapher\n </div>\n }\n </div>\n );\n}\n\nMultiGrapher.defaultProps = {\n theme: 'night'\n};\n\nMultiGrapher.propTypes = Object.assign({}, Grapher.propTypes, {\n syncBounds: PropTypes.bool,\n syncTooltips: PropTypes.bool,\n newUpperEnabled: PropTypes.bool,\n onMultiseriesChange: PropTypes.func\n});\n"],"names":["leafPrototypes","getProto","inProgress","dataWebpackPrefix","LINE_COLORS","getColor","seriesColor","i","multigrapherSeriesIndex","length","undefined","applyReducedOpacity","color","opacityFactor","startsWith","matches","match","r","g","b","a","parseFloat","hex","slice","split","map","char","join","parseInt","applyReducedOpacityToGradient","gradient","Array","isArray","stop","position","createDefaultGradient","halfOpacityColor","___CSS_LOADER_EXPORT___","push","module","id","exports","cssWithMappingToString","list","toString","this","item","content","needLayer","concat","modules","media","dedupe","supports","layer","alreadyImportedModules","k","_k","cssMapping","btoa","base64","unescape","encodeURIComponent","JSON","stringify","data","sourceMapping","ReactPropTypesSecret","emptyFunction","emptyFunctionWithReset","resetWarningCache","shim","props","propName","componentName","location","propFullName","secret","err","Error","name","getShim","isRequired","ReactPropTypes","array","bigint","bool","func","number","object","string","symbol","any","arrayOf","element","elementType","instanceOf","node","objectOf","oneOf","oneOfType","shape","exact","checkPropTypes","PropTypes","stylesInDOM","getIndexByIdentifier","identifier","result","modulesToDom","options","idCountMap","identifiers","base","count","indexByIdentifier","obj","css","sourceMap","references","updater","addElementStyle","byIndex","splice","api","domAPI","update","newObj","remove","lastIdentifiers","newList","index","newLastIdentifiers","_i","_index","memo","insert","style","target","styleTarget","document","querySelector","window","HTMLIFrameElement","contentDocument","head","e","getTarget","appendChild","createElement","setAttributes","attributes","styleElement","nonce","setAttribute","insertStyleElement","styleTagTransform","apply","parentNode","removeChild","removeStyleElement","styleSheet","cssText","firstChild","createTextNode","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","m","n","getter","__esModule","d","Object","getPrototypeOf","t","value","mode","then","ns","create","def","current","indexOf","getOwnPropertyNames","forEach","key","definition","o","defineProperty","enumerable","get","f","chunkId","Promise","all","keys","reduce","promises","u","prop","prototype","hasOwnProperty","call","l","url","done","script","needAttach","scripts","getElementsByTagName","s","getAttribute","charset","timeout","nc","src","onScriptComplete","prev","event","onerror","onload","clearTimeout","doneFns","fn","setTimeout","bind","type","Symbol","toStringTag","p","installedChunks","j","installedChunkData","promise","resolve","reject","error","errorType","realSrc","message","request","webpackJsonpCallback","parentChunkLoadingFunction","chunkIds","moreModules","runtime","some","chunkLoadingGlobal","globalThis","require","SIMPLE_DATA_TYPES","DATA_TYPES","Data","SingleSeries","xKey","yKey","windXKey","windYKey","windComp","xUnixDates","xLabel","yLabel","ignoreDiscontinuities","dashed","dashPattern","width","rangeSelectorWidth","axis","expandYWith","defaultAlwaysTooltipped","followingMouseTooltip","square","shiftXBy","graph","background","hideFromKey","showIndividualPoints","minPointSpacing","rendering","negativeColor","negativeGradient","zeroLineWidth","zeroLineColor","zeroLineY","pointRadius","tooltipWidth","hasAreaBottom","shadowColor","rangeKey","Series","Axis","axisIndex","series","side","scale","label","Axes","CustomBoundsSelector","calculator","datesOnly","CustomBoundsSelectors","TooltipOptionsRaw","includeSeriesLabel","includeXLabel","includeYLabel","includeXValue","includeYValue","floating","alwaysFixedPosition","floatPosition","floatDelta","savingDisabled","customTooltip","combineTooltips","TooltipOptions","Annotation","x","Date","startX","endX","lineOnly","Annotations","DraggablePoint","y","radius","fillColor","strokeColor","strokeWidth","onClick","onDoubleClick","DraggablePoints","VerticalLine","lineTop","markTop","markerStyle","text","textTop","textStyle","minPixelX","maxPixelX","onRangeGraph","onRangeGraphOnly","VerticalLines","Eventable","constructor","_listeners","clearListeners","on","eventName","Set","add","off","delete","size","emit","args","arguments","inferType","useSimpleData","simpleData","observe","colorToVector","parts","part","test","substr","createGLProgram","gl","vertShaderSource","fragShaderSource","vertexShader","createShader","VERTEX_SHADER","shaderSource","compileShader","getShaderParameter","COMPILE_STATUS","console","getShaderInfoLog","fragmentShader","FRAGMENT_SHADER","program","createProgram","attachShader","linkProgram","getProgramParameter","LINK_STATUS","validateProgram","VALIDATE_STATUS","getProgramInfoLog","BackgroundProgram","_gl","_program","backgroundVert","backgroundFrag","_vertexBuffer","createBuffer","_indexBuffer","getExtension","draw","useProgram","minXt","maxXt","uniform4f","getUniformLocation","vertices","Float32Array","bindBuffer","ARRAY_BUFFER","bufferData","STATIC_DRAW","positionLocation","getAttribLocation","enableVertexAttribArray","vertexAttribPointer","FLOAT","enable","BLEND","blendFunc","SRC_ALPHA","ONE_MINUS_SRC_ALPHA","drawArrays","TRIANGLES","DPI_INCREASE","async","sizeCanvas","canvas","context","reset","height","requestAnimationFrame","boundingRect","getBoundingClientRect","dpr","devicePixelRatio","bsr","webkitBackingStorePixelRatio","mozBackingStorePixelRatio","msBackingStorePixelRatio","oBackingStorePixelRatio","backingStorePixelRatio","pixelRatio","elementWidth","elementHeight","renderWidth","renderHeight","pathsFrom","dataInRenderSpace","splitAtY","paths","currentPath","previouslyDiscontinuous","nullMask","maxYValues","minYValues","yValues","minY","maxY","prevY","drawZeroLine","sizing","zeroColor","zeroWidth","strokeStyle","lineWidth","beginPath","moveTo","lineTo","stroke","renderEntireArea","path","areaBottomPath","zero","hasNegatives","fillStyle","globalGradient","createLinearGradient","addColorStop","areaBottom","firstX","_startY","lastX","_lastY","fill","renderAreaSegment","splitIndex","ghostPoint","isPreCutoff","areaBottomPaths","gradientColor","endIndex","Math","min","lastPoint","startIndex","startPoint","max","drawPointsNormally","individualPoints","pointColor","arc","PI","drawLinesNormally","linePaths","highlighted","drawLinesWithCutoff","timeRatio","cutoffOpacity","cutoffPixelX","preCutoffPaths","postCutoffPaths","prePath","postPath","lastPrePoint","firstPostPoint","x1","y1","x2","y2","unshift","reducedColor","drawPointsWithCutoffByRatio","isBeforeCutoff","getBarWidths","closestSpacing","bounds","axisSeriesCount","fullBarWidth","maxX","minX","totalBarWidth","barWidth","barSpacing","applyPointSpacing","points","minSpacing","spacedPoints","point","rustApiModule","RustAPIPromise","default","RustAPI","extractVerticesFromPaths","pointNumber","positions","prevPositions","indices","Uint32Array","verticesPattern","set","vertexPointer","sourceLength","copyWithin","pointI","prevX","LineProgram","lineVert","lineFrag","_circleProgram","circleVert","circleFrag","_positionBuffer","_prevPositionBuffer","_individualPointBuffer","dispose","clear","drawingBufferWidth","drawingBufferHeight","clearColor","viewport","parameters","thickness","shadowBlur","renderCutoffGradient","cutoffIndex","originalData","drawLineWithCutoff","get_point_number","extract_vertices","extractVertices","positionIndex","prevPositionIndex","vertexIndex","uniform1f","colorVector","cutoffX","ELEMENT_ARRAY_BUFFER","drawElements","UNSIGNED_INT","pointSize","getIndividualPoints","cutoffTime","baseIndex","floor","fraction","cutoffDate","getTime","currentDate","nextDate","currentTime","preCutoffPoints","postCutoffPoints","isPreview","visibleMinTime","selectionBounds","pixelX","pixelY","visibleMaxTime","reducedOpacityColor","flat","POINTS","cutoffTimeValue","visibleCutoffRatio","ShadowProgram","shadowVert","shadowFrag","positionLoc","trapezoidBoundsLoc","trapezoidBottomLoc","_trapezoidBoundsBuffer","_trapezoidBottomBuffer","_gradientTexture","createTexture","deleteTexture","generateTrapezoidGeometry","trapezoids","trapezoidBounds","trapezoidBottom","trap","bottomY1","bottomY2","bottom","parseGradient","fallbackColor","fallbackColorVec","textureData","Uint8Array","textureWidth","gradientCount","colors","stops","stopIndex","colorIndex","params","drawShadowWithCutoff","positiveTrapezoids","negativeTrapezoids","inRenderSpaceAreaBottom","y1RelativeToZero","y2RelativeToZero","xCross","abs","yCross","finalX2","finalY2","finalBottomY2","ratio","trapezoid","renderTrapezoidSet","trapSet","geometry","gradientData","activeTexture","TEXTURE0","bindTexture","TEXTURE_2D","texImage2D","RGBA","UNSIGNED_BYTE","texParameteri","TEXTURE_MIN_FILTER","NEAREST","TEXTURE_MAG_FILTER","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","uniform1i","uniform4fv","getError","NO_ERROR","_lastIndividualPoints","_lastParams","currentItem","nextItem","visibleBounds","firstTime","lastTime","firstItem","lastItem","translucentGradient","drawSplitShadowTrapezoids","disable","DEPTH_TEST","GraphBodyRenderer","stateController","canvasElement","webgl","checkIntersection","super","_stateController","_checkIntersection","_canvas","_webgl","_context","getContext","_lineProgram","_shadowProgram","alert","_context2d","_initialized","_initializeCanvas","_boundResize","resize","_cachedAxisCount","_onAxisChange","axes","filter","_resizeObserver","disconnect","_intersectionObserver","_zeroLineCanvas","_zeroLineContext","_overlayContext","clearRect","_overlayCanvas","_overlayCanvasInitialized","render","singleSeries","inRenderSpace","defaultLineWidth","globalBounds","warn","cutoffData","xValue","yValue","currentPoint","nextPoint","nextTime","useDataSpace","includeBeyondBounds","currentBounds","threshold","pastThreshold","samples","xCoord","inSelectedSpace","inDataSpace","boundsMinX","boundsMaxX","foundBeyondBounds","lastPointBeforeBounds","_sizing","yCoord","beforeXValue","beforeY","beforeXCoord","beforeYCoord","commonCPUParams","willReadFrequently","flush","find","tuple","barParams","indexInAxis","selection","rangeGraphRenderer","_bounds","_selection","barBottom","barColor","dataPoint","negColor","fillRect","drawBarsWithCutoff","drawBars","areaParams","shouldSplitAreaPaths","areaPaths","pathI","reducedOpacityGradient","renderCutoffIndex","preCutoffPath","preCutoffAreaBottomPath","bottomGhostPoint","postCutoffPath","postCutoffAreaBottomPath","visibleTimeRatio","drawAreaWithCutoff","positive","pointsToRender","drawArea","shadowProgram","boundsChanged","_lastBounds","_lastRenderHeight","_lastShadowCache","shadowParams","save","globalCompositeOperation","restore","top","left","pointerEvents","insertBefore","nextSibling","shouldShowIndividualPoints","drawContext","_fallbackContext","fallbackCanvas","drawParams","getRanges","range","pixelMinY","pixelMaxY","setLineDash","xFraction","lastDataTime","ranges","horizontalBarWidth","now","drawLine","renderBackground","inBackgroundSpace","_backgroundProgram","drawBackground","markSizeChanged","ResizeObserver","first","disabled","IntersectionObserver","entries","_intersectionTimeout","isIntersecting","sizingPromise","resizeDebounced","_resizeTimeout","recalculatePosition","calculatePrecision","log10","roundToPrecision","precision","isNaN","rounded","toFixed","ceil","stripped","includes","replace","DATE_TIME_FORMATTERS","timezoneToOffsetMS","timeZone","sampleDate","datetimeFormatter","properTimeZone","Intl","DateTimeFormat","resolvedOptions","timeZoneName","offsetPart","formatToParts","hours","minutes","startOfDayInTimezone","date","timezone","startOfDay","setHours","offset","setUTCHours","valueOf","formatX","dates","justTime","justDate","justMonthAndDay","clockStyle","unitOverride","integersOnly","inverseEnumMap","time","utc","toLowerCase","localOffset","year","getUTCFullYear","getFullYear","month","getUTCMonth","getMonth","day","getUTCDate","getDate","toLocaleDateString","getUTCHours","getHours","getUTCMinutes","getMinutes","seconds","getUTCSeconds","getSeconds","milliseconds","getUTCMilliseconds","getMilliseconds","timeString","padStart","formatTime","round","formatY","log","Y_AXIS_WIDTH","getYLabelContent","fullYPrecision","TooltipLabel","axisLabel","textLeft","formatXOptions","React","propTypes","CustomPropTypes","Tooltip","halfHeight","passThroughProps","preparedTooltips","tooltips","tooltip","tooltipPixelY","fixedPosition","multiplier","caretSize","isFinite","markerTransform","tooltipTransform","commonLabelProps","maxPrecision","baseLeft","yTranslation","axisCount","caretPadding","Boolean","CustomTooltipComponent","groupedTooltips","combinationThreshold","added","group","totalHeight","maxWidth","sort","className","transform","_extends","defaultProps","mouseX","mouseY","ContextMenu","setTextRef","ref","textRef","contextMenu","showing","createRange","getSelection","removeAllRanges","selectNodeContents","addRange","focus","formatDateTime","dateTimeStr","datePart","timePart","formattedDate","period","toLocaleString","displayValue","autoFocus","simpleSeriesToDataSpace","tuples","tuplesToDataSpace","values","valuesToDataSpace","objects","objectsToDataSpace","rangeValues","windDirections","windData","originalXValue","enumToNumber","valueXStart","readBinaryFormatValue","view","getUint32","BYTES_PER_ELEMENT","getUint8","getFloat64","hasWindKeys","buffer","ArrayBuffer","DataView","xIndex","channels","yIndex","offsets","subpoint","windX","windY","sqrt","atan2","finalizeBounds","initial","calculateDataBounds","percentile","percentileAsymmetry","sortedByY","_x","_x1","_x2","rangeValue","asymmetry","inBottomPercentile","inTopPercentile","percentileBounds","spacing","mergeBounds","boundsList","mergedBounds","expandBounds","extendXForNBars","expandedBounds","assign","unscaledMinY","unscaledMaxY","midpoint","binarySearch","targetX","searchParams","returnIndex","middleIndex","searchType","dataSpaceToSelectedSpace","swap","firstAdded","lastAdded","beforeIndex","afterIndex","addToEndOnly","beginningInterpolationIndex","endInterpolationIndex","pop","shift","interpolationIndex","interpolate","lastIncluded","nullIndex","selectedIndex","dataIndex","begPoint","endPoint","firstIndex","secondIndex","boundary","xBefore","yBefore","xAfter","yAfter","percent","scaleBounds","selectedSpaceToRenderSpace","dataChanged","Float64Array","scaledBounds","inParams","dataF64","dataNullMask","copyIndexStart","hasSwap","useSwap","extraSpaceFactor","selected_space_to_render_space","prevI","minSeenY","maxSeenY","curY","selectedSpaceToRenderSpaceInPlace","flattenSimpleData","flattened","fI","extractYValue","extractXValue","moveTooltip","distance","xDistance","pixelWidth","lastMinute","last10Minutes","lastHour","lastDay","condenseDataSpace","targetBucketCount","partiallyCondensedData","CONDENSE_THRESHOLD","condensedData","bucketSize","minInBucket","maxInBucket","currentBucketIndex","bucketIndex","nameForSeries","selectedSpaceToBackgroundSpace","conditions","evaluator","comparator","comparedAgainst","parsedValue","currentSection","condition","interpolatedMaxX","interpolatedMinX","StateController","defaultBoundsCalculator","customBoundsSelectors","requireWASM","defaultShowIndividualPoints","defaultShowSidebar","defaultShowAnnotations","defaultShowOptions","syncPool","grapherID","sharedDataCache","sharedSubscriptions","fullscreen","_requireWASM","_markDirty","_series","_seriesFromOriginalSeries","Map","_axes","_highlightedSeries","_showIndividualPoints","_autoscaleY","_percentile","_percentileAsymmetry","_showingOptions","_maxPrecision","_showingSidebar","_showingAnnotations","_grapherID","_fullscreen","_alwaysTooltipped","_tooltipState","mousePresent","_contextMenuPosition","_savedTooltips","_draggingY","_annotations","_annotationsState","annotations","_enumMap","_hasXEnum","_timingBuffer","_timingIndex","_timingFrameCount","_modifiedSeries","_deferredEmissions","_deferredPriorityEmissions","primaryRenderer","_boundsCalculator","givenLabel","customCalculators","BOUND_CALCULATORS","getDefaultBoundsCalculator","_boundsHistory","_boundsIndex","_dataCache","_subscriptions","_subscriptionsShared","_observablesToSeries","_generators","_generatorsToSeries","_generatorCallArgs","_seriesChangedFromPromises","_syncPool","_onDataChange","listener","unsubscribe","_removeSeries","disposed","setSeries","userSeries","userCreated","propsSeries","anyDifferent","originalSeries","_mustResize","newSeriesSet","has","_tooltipsChanged","deferredEmit","_assignAxisTo","hidden","_hideSeries","_dataChanged","_frameRequested","frameRequestStart","performance","frameExecutionStart","dataProcessingStart","_mustRerender","_annotationsChanged","_onDataAdd","_primarySizeChanged","_calculatePrimarySizeDependents","_rangeGraphSizeChanged","_calculateRangeGraphSizeDependents","dataProcessingEnd","renderPipelineStart","_render","renderPipelineEnd","generatorsStart","_mustCallGenerators","_callGenerators","generatorsEnd","tooltipStart","_recalculateTooltips","tooltipEnd","contextMenuStart","_contextMenuChanged","_recalculateContextMenu","contextMenuEnd","annotationStart","_recalculateAnnotations","annotationEnd","callbacksStart","emission","callbacksEnd","completionTime","loopTime","frameExecution","frameRequestAndExecution","generators","dataProcessing","renderPipeline","callbacks","lastLoopTime","deferredPriorityEmit","_seriesToSimpleData","currentData","sameDataSet","firstSameDataSeries","next","_listenToObservableData","observable","_callGenerator","_listenToPromise","dataPromise","resolved","datum","markObservableModified","_unsubscribeFromStaleSeries","currentSeries","seriesSet","stillHasListener","generator","stillHasSeries","alwaysTooltipped","savedTooltips","allTooltipped","savedTooltip","minDistance","Infinity","trueX","dataMinX","dataMaxX","padding","closestIndex","closestPoint","ignoreYDistanceCheck","xDistanceThreshold","yDistanceThreshold","distanceThreshold","yDistance","enumLike","hasEnum","simplePoint","hasXEnum","followMouse","finalPixelY","unsavedTooltips","unsavedTooltipsCount","calculateTooltipState","_tooltipAllNext","_globalBounds","_tooltipStateArg","newX","right","shownSeries","xRange","annotation","seriesName","isRange","isPoint","xStartValue","xEndValue","convertToNumber","val","pixelStartX","pixelEndX","calculateAnnotationsState","_expandYWith","dataBoundsList","dataSpaceResult","simpleDataSliceStart","_rangeValues","extendedDataSpace","dataBounds","_dataBounds","_recalculateSelection","disableSwap","selectedBounds","selectedBoundsAreaTop","selectedBoundsAreaBottom","inSelectedSpaceAreaBottom","_recalculateAxisBounds","modifiedSeries","newData","modifiedAxes","modifiedSeriesAndDependents","newDataInDataSpace","newDataBounds","newPointCount","previousSelection","newSelectedData","fixedY","targetBounds","byAxis","visibleRangeValues","minXValue","maxXValue","rangeIndex","validRangeValues","selectedBoundsList","selectedDataBounds","boundsCalculator","selectionFromGlobalBounds","_","export","night","_theme","inBackgroundSpacePrimary","inRenderSpacePrimary","_defaultLineWidth","inRenderSpacePrimaryAreaBottom","rangeGraphBounds","inRenderSpaceRangeGraph","inRenderSpaceRangeGraphAreaBottom","toCondensedSelectedSpaceParams","inCondensedSelectedSpacePrimary","toRenderSpaceParams","inCondensedSelectedSpacePrimaryAreaBottom","inBackgroundSpacePrimaryAreaBottom","toSelectedSpaceParams","inSelectedSpaceRangeGraph","inCondensedSelectedSpaceRangeGraph","inSelectedSpaceRangeGraphAreaBottom","inCondensedSelectedSpaceRangeGraphAreaBottom","_createAxis","_moveAxis","newAxis","oldAxis","oldIndex","leftAxes","rightAxes","exportedAxes","originalAxis","seen","candidateAxis","findMatchingAxis","inValueSpacePrimary","inValueSpaceRangeGraph","_showSeries","boundCalculator","reverse","highlightedSeries","autoscaleY","boundHistory","hasNextBounds","hasPreviousBounds","tooltipState","contextMenuState","draggingY","averageLoopTime","loopTimes","averageLoopTimes","axisToName","leftCount","rightCount","showingOptions","showingSidebar","showingAnnotations","userCreatedSeries","annotationState","theme","exportMode","_exportMode","enumMap","renderer","_nonExportTheme","boundingFunction","debounceHistory","_boundingCalculatorDebouncer","_addBoundCalculatorToHistory","boundsSelectors","_customBoundsSelectors","indexedCustomBoundSelectors","registerSeriesClick","selectedSeriesIndex","setHighlightedSeries","toggleIndividualPoints","toggleYAutoscaling","toggleExportMode","setBoundsFromSelection","pixelSelection","minPixelY","maxPixelY","pow","boundCalculatorFromSelection","nextBounds","previousBounds","setLabel","toggleScale","oldScale","recalculateTooltips","setTooltipMousePosition","clientX","_tooltipClientX","clientY","_tooltipClientY","shiftKey","shiftKeyPressedOnMove","tooltipAllNext","tooltipStateArg","showOnlySavedTooltips","newMouseX","newMouseY","setContextMenuMousePosition","toggleAlwaysTooltipped","registerClick","toggleTooltipSaved","oldSavedTooltips","currentTooltips","lastTooltip","currentTooltipIndex","findIndex","clearSavedTooltips","markDragStart","finalizeDrag","draggedSeries","hasAxis","sameGrapherID","timingFrameCount","toggleShowingOptions","toggleMaxPrecision","toggleShowingAnnotations","toggleShowingSidebar","setShowing","skipResize","isX","existingIndex","indexToSet","triggerResize","useEvent","eventSource","initialState","watch","originalInitialState","setValue","useState","useEffect","updatedValue","originalUpdatedValue","usePrimarySize","useAxes","useSeries","useHighlightedSeries","useRightAxisCount","useRightAxes","useLeftAxisCount","useLeftAxes","useSelection","useAxisBounds","useAutoscaleY","useDraggingY","useShowingOptions","useMaxPrecision","useShowingSidebar","useShowingAnnotations","useSizing","useTheme","bodyHeight","validAnnotations","annotationStyle","pointMarkerWidth","approxTextWidth","textAlign","draggablePoints","onPointDrag","onDraggablePointsDoubleClick","onPointlessDoubleClick","newXT","newYT","xT","yT","stopPropagation","cx","cy","onMouseDown","xOffset","yOffset","onMouseMove","moveEvent","onMouseUp","removeEventListener","addEventListener","verticalLines","isRangeGraph","relevantVerticalLines","line","lineStyle","fontSize","textAnchor","dominantBaseline","GraphBody","boundsSelectionEnabled","showTooltips","showContextMenu","tooltipOptions","onPointClick","canvasEl","useCallback","el","boundsSelection","setBoundsSelection","start","useTooltipState","showAnnotations","useAnnotationState","useContextMenu","onScroll","onGlobalMouseMove","getTouch","touches","changedTouches","onGlobalTouchStart","touch","cancelable","closest","preventDefault","onGlobalTouchMove","onGlobalTouchEnd","passive","onMouseLeave","currentNode","classList","contains","seriesToNearestPoint","onContextMenu","placeTick","trueValue","inverted","totalSize","formatter","formatOptions","opts","scaledValue","pixelValue","placeTickByPixel","roundToDivisor","divisor","divisors","bestDelta","bestDivisor","delta","getEvenDateTickSpacing","span","desiredCount","subspan","amount","unit","placeGrid","expectedLabelSize","labelPadding","skipFirst","skipLast","paddedLabelSize","ticks","placementParams","setMinutes","setSeconds","setMilliseconds","setDate","lastDateString","tick","placeDatesGrid","tickSpacing","roundTo","getEvenTickSpacing","roundToEvenNumber","placeNumbersGrid","locals","XAxis","showAxes","showGrid","bigLabels","xTickUnit","formatXAxisLabel","useHasXEnum","useEnumMap","minDate","maxDate","calculateTimePrecision","minLabel","maxLabel","expectedLabelWidth","timeTicks","dateTicks","regularTicks","hourSpan","adjustedDate","alignedHour","currentHour","currentMinute","alignedMinute","currentSecond","alignedSecond","maxPixelForMiddleTicks","lastTick","placeTimeOnlyGrid","spanMultipleYears","customDateFormatter","startTick","endTick","placeDateOnlyGrid","xAxisHeight","marginBottom","skipGrid","singleTick","classes","timezoneLabel","YAxis","showSeriesKey","sideIndex","dragPositionYOffset","showAxisColors","sidePadding","setDraggedSeries","dragDelta","setDragDelta","dx","dy","highlightedOpacity","unhighlightedOpacity","marginLeft","opacity","edge","strokeDasharray","startDrag","startY","mouseUpEvent","dataset","grapherId","onMouseOver","onMouseOut","WindArrows","DefaultWindArrow","angle","arrowSize","strokeLinecap","strokeLinejoin","windSeries","minSpeed","maxSpeed","wind","speed","speedRange","arrows","lastArrowX","CustomArrow","Comp","direction","cos","sin","speedPercentile","display","RangeSelectionButtonBase","selected","children","description","RangeSelectionButton","currentBoundCalculator","PercentileButton","usePercentile","usePercentileAsymmetry","onChange","onKeyUp","keyCode","focusable","viewBox","Options","sidebarEnabled","useShowIndividualPoints","RangeSelection","customBoundsSelectorsOnly","rightAxisCount","leftAxisCount","marginRight","useGlobalBounds","useBoundCalculator","useBoundHistory","customBoundSelectorNames","RangeGraph","state","stopDragging","startScroll","startLeftDrag","startRightDrag","getClientX","componentDidMount","_renderer","setState","componentDidUpdate","prevProps","componentWillUnmount","_dragType","leftX","percentage","_scrollAnchorPercentage","boundToRight","boundToLeft","addListeners","forceUpdate","pixelMinX","pixelMaxX","markDates","touchAction","onTouchStart","SeriesKeyItem","backgroundColor","SeriesKeyAxisContainer","showingLabelInput","toggleLabelInputShowing","placeholder","SeriesKey","dragPosition","setDragPosition","keyRef","useRef","keyWidth","setKeyWidth","sizeCalculationHandle","cancelAnimationFrame","querySelectorAll","clientWidth","calculateStyles","useAlwaysTooltipped","toggleTooltipped","startDragging","seriesKeyEl","targetLeft","seriesKeyLeft","seriesKeyMarginLeft","clientStartX","clientStartY","zIndex","GraphTitle","title","SeriesToggle","checked","defaultChecked","borderColor","Sidebar","SyncPool","syncBounds","syncTooltips","syncDragState","_stateControllers","_syncBounds","_syncTooltips","_syncDragState","otherStateController","stateArg","_tooltipIgnoreState","shouldHideTooltips","random","Grapher","grapherDefaultProps","showRangeGraph","showRangeSelectors","useMemo","stateControllerInitialization","exportStateController","onRenderTime","onAxisChange","styles","classNames","calculateClassNamesAndStyles","commonYAxisProps","xAxisIntegersOnly","markRangeGraphDates","AVAILABLE_COLORS","BUILT_IN_BOUND_CALCULATORS","MultigraphStateController","_id","_multiSeries","_seriesToGraphIndices","_graphIndicesToSeries","_originalSeriesByMultigrapherIndex","_prevSeries","graphIndices","currentSeriesSet","graphIndex","sortedGraphIndices","globalSeriesIndex","multigrapherGraphIndex","_nextMultigrapherSeriesIndex","_multiSeriesCount","multiSeries","registerStateController","_multigraphStateController","check","multigrapherID","moveSeries","prevGraphCount","graphCount","_createGraphAtTop","_createGraphAtBottom","originalSeriesAtIndex","emptyAtTopIndex","emptyAtBottomIndex","incrementMultigrapherSeriesIndex","MultiGrapher","multigraphStateController","useMultiSeries","onMultiseriesChange","newUpperEnabled"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"bundle.cjs","mappings":"UAAIA,EACAC,E,SCDJC,EAAOC,QAAU,6hC,yBCSjBD,EAAOC,QANP,SAAwCC,GACtC,IAAIC,EAAmD,KACnDA,GACFD,EAAaE,aAAa,QAASD,EAEvC,C,qBCNA,IAAIE,EAAc,GAClB,SAASC,EAAqBC,GAE5B,IADA,IAAIC,GAAU,EACLC,EAAI,EAAGA,EAAIJ,EAAYK,OAAQD,IACtC,GAAIJ,EAAYI,GAAGF,aAAeA,EAAY,CAC5CC,EAASC,EACT,KACF,CAEF,OAAOD,CACT,CACA,SAASG,EAAaC,EAAMC,GAG1B,IAFA,IAAIC,EAAa,CAAC,EACdC,EAAc,GACTN,EAAI,EAAGA,EAAIG,EAAKF,OAAQD,IAAK,CACpC,IAAIO,EAAOJ,EAAKH,GACZQ,EAAKJ,EAAQK,KAAOF,EAAK,GAAKH,EAAQK,KAAOF,EAAK,GAClDG,EAAQL,EAAWG,IAAO,EAC1BV,EAAa,GAAGa,OAAOH,EAAI,KAAKG,OAAOD,GAC3CL,EAAWG,GAAME,EAAQ,EACzB,IAAIE,EAAoBf,EAAqBC,GACzCe,EAAM,CACRC,IAAKP,EAAK,GACVQ,MAAOR,EAAK,GACZS,UAAWT,EAAK,GAChBU,SAAUV,EAAK,GACfW,MAAOX,E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AAA,KACdipD,gBAAiBjpD,IAAAA,KACjBgpD,oBAAqBhpD,IAAAA,M","sources":["webpack://Grapher/webpack/runtime/load script","webpack://Grapher/./src/renderer/line.vert","webpack://Grapher/./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js","webpack://Grapher/./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js","webpack://Grapher/./node_modules/style-loader/dist/runtime/styleTagTransform.js","webpack://Grapher/./src/renderer/circle.frag","webpack://Grapher/./node_modules/css-loader/dist/runtime/api.js","webpack://Grapher/./node_modules/css-loader/dist/runtime/sourceMaps.js","webpack://Grapher/./src/helpers/colors.js","webpack://Grapher/./src/renderer/line.frag","webpack://Grapher/./src/renderer/background.frag","webpack://Grapher/./node_modules/style-loader/dist/runtime/insertStyleElement.js","webpack://Grapher/./node_modules/prop-types/index.js","webpack://Grapher/./src/grapher.scss","webpack://Grapher/./node_modules/style-loader/dist/runtime/insertBySelector.js","webpack://Grapher/./node_modules/prop-types/factoryWithThrowingShims.js","webpack://Grapher/./src/renderer/shadow.frag","webpack://Grapher/./src/renderer/background.vert","webpack://Grapher/./src/renderer/circle.vert","webpack://Grapher/./node_modules/style-loader/dist/runtime/styleDomAPI.js","webpack://Grapher/./src/renderer/shadow.vert","webpack://Grapher/./node_modules/prop-types/lib/ReactPropTypesSecret.js","webpack://Grapher/webpack/bootstrap","webpack://Grapher/webpack/runtime/compat get default export","webpack://Grapher/webpack/runtime/define property getters","webpack://Grapher/webpack/runtime/ensure chunk","webpack://Grapher/webpack/runtime/get javascript chunk filename","webpack://Grapher/webpack/runtime/hasOwnProperty shorthand","webpack://Grapher/webpack/runtime/make namespace object","webpack://Grapher/webpack/runtime/publicPath","webpack://Grapher/webpack/runtime/jsonp chunk loading","webpack://Grapher/webpack/runtime/nonce","webpack://Grapher/external commonjs2 \"react\"","webpack://Grapher/./src/state/data_types.js","webpack://Grapher/./src/helpers/custom_prop_types.js","webpack://Grapher/./src/eventable.js","webpack://Grapher/./src/state/infer_type.js","webpack://Grapher/./src/helpers/color_to_vector.js","webpack://Grapher/./src/renderer/create_gl_program.js","webpack://Grapher/./src/renderer/background_program.js","webpack://Grapher/./src/renderer/size_canvas.js","webpack://Grapher/./src/renderer/paths_from.js","webpack://Grapher/./src/renderer/draw_zero_line.js","webpack://Grapher/./src/renderer/draw_area.js","webpack://Grapher/./src/renderer/draw_bars.js","webpack://Grapher/./src/renderer/draw_line.js","webpack://Grapher/./src/state/rust_api.js","webpack://Grapher/./src/renderer/extract_vertices.js","webpack://Grapher/./src/renderer/line_program.js","webpack://Grapher/./src/renderer/shadow_program.js","webpack://Grapher/./src/renderer/graph_body_renderer.js","webpack://Grapher/./src/renderer/draw_background.js","webpack://Grapher/./src/helpers/format.js","webpack://Grapher/./src/helpers/axis_sizes.js","webpack://Grapher/./src/components/tooltip.jsx","webpack://Grapher/./src/components/context_menu.jsx","webpack://Grapher/./src/state/space_conversions/simple_series_to_data_space.js","webpack://Grapher/./src/state/calculate_data_bounds.js","webpack://Grapher/./src/state/merge_bounds.js","webpack://Grapher/./src/state/expand_bounds.js","webpack://Grapher/./src/helpers/binary_search.js","webpack://Grapher/./src/state/space_conversions/data_space_to_selected_space.js","webpack://Grapher/./src/renderer/scale_bounds.js","webpack://Grapher/./src/state/space_conversions/selected_space_to_render_space.js","webpack://Grapher/./src/helpers/flatten_simple_data.js","webpack://Grapher/./src/state/calculate_tooltip_state.js","webpack://Grapher/./src/state/bound_calculators.js","webpack://Grapher/./src/state/space_conversions/condense_data_space.js","webpack://Grapher/./src/helpers/name_for_series.js","webpack://Grapher/./src/state/space_conversions/selected_space_to_background_space.js","webpack://Grapher/./src/state/state_controller.js","webpack://Grapher/./src/state/get_default_bounds_calculator.js","webpack://Grapher/./src/helpers/generator_params_equal.js","webpack://Grapher/./src/state/calculate_annotations_state.js","webpack://Grapher/./src/state/selection_from_global_bounds.js","webpack://Grapher/./src/state/find_matching_axis.js","webpack://Grapher/./src/state/average_loop_times.js","webpack://Grapher/./src/state/bound_calculator_from_selection.js","webpack://Grapher/./src/state/hooks.js","webpack://Grapher/./src/components/annotations.jsx","webpack://Grapher/./src/components/draggable_points.jsx","webpack://Grapher/./src/components/vertical_lines.jsx","webpack://Grapher/./src/components/graph_body.jsx","webpack://Grapher/./src/grapher.scss?e17f","webpack://Grapher/./src/helpers/place_grid.js","webpack://Grapher/./src/components/x_axis.jsx","webpack://Grapher/./src/components/y_axis.jsx","webpack://Grapher/./src/components/wind_arrows.jsx","webpack://Grapher/./src/components/range_selection_button_base.jsx","webpack://Grapher/./src/components/range_selection_button.jsx","webpack://Grapher/./src/components/percentile_button.jsx","webpack://Grapher/./src/components/options.jsx","webpack://Grapher/./src/components/range_selection.jsx","webpack://Grapher/./src/components/range_graph.jsx","webpack://Grapher/./src/components/series_key_item.jsx","webpack://Grapher/./src/components/series_key_axis_container.jsx","webpack://Grapher/./src/components/series_key.jsx","webpack://Grapher/./src/components/graph_title.jsx","webpack://Grapher/./src/components/sidebar.jsx","webpack://Grapher/./src/state/sync_pool.js","webpack://Grapher/./src/grapher.jsx","webpack://Grapher/./src/state/multigraph_state_controller.js","webpack://Grapher/./src/multigrapher.jsx"],"sourcesContent":["var inProgress = {};\nvar dataWebpackPrefix = \"Grapher:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","module.exports = \"precision highp float;\\n\\nattribute vec2 position;\\nattribute vec2 prevPosition;\\nattribute float vertex;\\n\\nuniform float width;\\nuniform float height;\\nuniform float thickness;\\n\\nvarying vec2 position_vec;\\nvarying vec2 prev_position_vec;\\n\\nvoid main() {\\n vec2 delta = position - prevPosition;\\n vec2 alpha = prevPosition;\\n vec2 beta = position;\\n\\n vec2 normalized_delta = normalize(delta);\\n vec2 normal = vec2(-thickness/2.0 * normalized_delta.y, thickness/2.0 * normalized_delta.x);\\n\\n vec2 vertex_position =\\n step(0.5, mod(vertex, 2.0))*alpha + // alpha if vertex is odd, 0 otherwise\\n step(0.5, mod(vertex + 1.0, 2.0))*beta + // beta if vertex is even, 0 otherwise\\n 2.0*(step(1.5, vertex)-0.5)*normal // -normal if vertex < 2, +normal otherwise\\n ;\\n\\n position_vec = vec2(position.x, height - position.y);\\n prev_position_vec = vec2(prevPosition.x, height - prevPosition.y);\\n\\n gl_Position = vec4(2.0*vertex_position.x/width - 1.0, 1.0 - 2.0*vertex_position.y/height, 0.0, 1.0);\\n}\\n\"","\"use strict\";\n\n/* istanbul ignore next */\nfunction setAttributesWithoutAttributes(styleElement) {\n var nonce = typeof __webpack_nonce__ !== \"undefined\" ? __webpack_nonce__ : null;\n if (nonce) {\n styleElement.setAttribute(\"nonce\", nonce);\n }\n}\nmodule.exports = setAttributesWithoutAttributes;","\"use strict\";\n\nvar stylesInDOM = [];\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n for (var i = 0; i < stylesInDOM.length; i++) {\n if (stylesInDOM[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n return result;\n}\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var indexByIdentifier = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3],\n supports: item[4],\n layer: item[5]\n };\n if (indexByIdentifier !== -1) {\n stylesInDOM[indexByIdentifier].references++;\n stylesInDOM[indexByIdentifier].updater(obj);\n } else {\n var updater = addElementStyle(obj, options);\n options.byIndex = i;\n stylesInDOM.splice(i, 0, {\n identifier: identifier,\n updater: updater,\n references: 1\n });\n }\n identifiers.push(identifier);\n }\n return identifiers;\n}\nfunction addElementStyle(obj, options) {\n var api = options.domAPI(options);\n api.update(obj);\n var updater = function updater(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {\n return;\n }\n api.update(obj = newObj);\n } else {\n api.remove();\n }\n };\n return updater;\n}\nmodule.exports = function (list, options) {\n options = options || {};\n list = list || [];\n var lastIdentifiers = modulesToDom(list, options);\n return function update(newList) {\n newList = newList || [];\n for (var i = 0; i < lastIdentifiers.length; i++) {\n var identifier = lastIdentifiers[i];\n var index = getIndexByIdentifier(identifier);\n stylesInDOM[index].references--;\n }\n var newLastIdentifiers = modulesToDom(newList, options);\n for (var _i = 0; _i < lastIdentifiers.length; _i++) {\n var _identifier = lastIdentifiers[_i];\n var _index = getIndexByIdentifier(_identifier);\n if (stylesInDOM[_index].references === 0) {\n stylesInDOM[_index].updater();\n stylesInDOM.splice(_index, 1);\n }\n }\n lastIdentifiers = newLastIdentifiers;\n };\n};","\"use strict\";\n\n/* istanbul ignore next */\nfunction styleTagTransform(css, styleElement) {\n if (styleElement.styleSheet) {\n styleElement.styleSheet.cssText = css;\n } else {\n while (styleElement.firstChild) {\n styleElement.removeChild(styleElement.firstChild);\n }\n styleElement.appendChild(document.createTextNode(css));\n }\n}\nmodule.exports = styleTagTransform;","module.exports = \"#ifdef GL_OES_standard_derivatives\\n#extension GL_OES_standard_derivatives : enable\\n#endif\\n\\nprecision mediump float;\\n\\nuniform vec4 color;\\n\\n// Adapted and modified from https://www.desultoryquest.com/blog/drawing-anti-aliased-circular-points-using-opengl-slash-webgl/\\nvoid main() {\\n float delta = 0.0;\\n float alpha = 1.0;\\n vec2 center = 2.0 * gl_PointCoord - 1.0;\\n float r = dot(center, center);\\n\\n if (r > 1.0) {\\n discard;\\n }\\n\\n #ifdef GL_OES_standard_derivatives\\n delta = fwidth(r);\\n alpha = 1.0 - smoothstep(1.0 - delta, 1.0 + delta, r);\\n #endif\\n\\n gl_FragColor = color * alpha;\\n}\\n\"","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\nmodule.exports = function (cssWithMappingToString) {\n var list = [];\n\n // return the list of modules as css string\n list.toString = function toString() {\n return this.map(function (item) {\n var content = \"\";\n var needLayer = typeof item[5] !== \"undefined\";\n if (item[4]) {\n content += \"@supports (\".concat(item[4], \") {\");\n }\n if (item[2]) {\n content += \"@media \".concat(item[2], \" {\");\n }\n if (needLayer) {\n content += \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\");\n }\n content += cssWithMappingToString(item);\n if (needLayer) {\n content += \"}\";\n }\n if (item[2]) {\n content += \"}\";\n }\n if (item[4]) {\n content += \"}\";\n }\n return content;\n }).join(\"\");\n };\n\n // import a list of modules into the list\n list.i = function i(modules, media, dedupe, supports, layer) {\n if (typeof modules === \"string\") {\n modules = [[null, modules, undefined]];\n }\n var alreadyImportedModules = {};\n if (dedupe) {\n for (var k = 0; k < this.length; k++) {\n var id = this[k][0];\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n for (var _k = 0; _k < modules.length; _k++) {\n var item = [].concat(modules[_k]);\n if (dedupe && alreadyImportedModules[item[0]]) {\n continue;\n }\n if (typeof layer !== \"undefined\") {\n if (typeof item[5] === \"undefined\") {\n item[5] = layer;\n } else {\n item[1] = \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\").concat(item[1], \"}\");\n item[5] = layer;\n }\n }\n if (media) {\n if (!item[2]) {\n item[2] = media;\n } else {\n item[1] = \"@media \".concat(item[2], \" {\").concat(item[1], \"}\");\n item[2] = media;\n }\n }\n if (supports) {\n if (!item[4]) {\n item[4] = \"\".concat(supports);\n } else {\n item[1] = \"@supports (\".concat(item[4], \") {\").concat(item[1], \"}\");\n item[4] = supports;\n }\n }\n list.push(item);\n }\n };\n return list;\n};","\"use strict\";\n\nmodule.exports = function (item) {\n var content = item[1];\n var cssMapping = item[3];\n if (!cssMapping) {\n return content;\n }\n if (typeof btoa === \"function\") {\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n var sourceMapping = \"/*# \".concat(data, \" */\");\n return [content].concat([sourceMapping]).join(\"\\n\");\n }\n return [content].join(\"\\n\");\n};","export const LINE_COLORS = [\n \"#F1C232\",\n \"#1259f8\",\n \"#cb4b4b\",\n \"#4da74d\",\n \"#9440ed\",\n \"#61e0ed\",\n \"#ed6d2c\",\n \"#ed13c6\",\n \"#bbed59\",\n];\n\nexport default function getColor(seriesColor, i, multigrapherSeriesIndex) {\n if (typeof seriesColor === \"string\") {\n return seriesColor;\n }\n\n if (typeof seriesColor === \"number\") {\n return LINE_COLORS[seriesColor % LINE_COLORS.length];\n }\n\n if (multigrapherSeriesIndex !== undefined) {\n return LINE_COLORS[multigrapherSeriesIndex % LINE_COLORS.length];\n }\n\n return LINE_COLORS[i % LINE_COLORS.length];\n}\n\n/**\n * Applies reduced opacity to a color\n * @param {string} color \n * @param {number} opacityFactor \n * @returns {string}\n */\nexport function applyReducedOpacity(color, opacityFactor) {\n if (!color) return color;\n\n if (color.startsWith(\"rgba(\")) {\n const matches = color.match(/rgba\\((\\d+),\\s*(\\d+),\\s*(\\d+),\\s*([\\d.]+)\\)/);\n if (matches) {\n const [, r, g, b, a] = matches;\n const newAlpha = parseFloat(a) * opacityFactor;\n return `rgba(${r}, ${g}, ${b}, ${newAlpha})`;\n }\n }\n\n if (color.startsWith(\"rgb(\")) {\n const matches = color.match(/rgb\\((\\d+),\\s*(\\d+),\\s*(\\d+)\\)/);\n if (matches) {\n const [, r, g, b] = matches;\n return `rgba(${r}, ${g}, ${b}, ${opacityFactor})`;\n }\n }\n\n if (color.startsWith(\"#\")) {\n let hex = color.slice(1);\n if (hex.length === 3) {\n hex = hex\n .split(\"\")\n .map((char) => char + char)\n .join(\"\");\n }\n const r = parseInt(hex.slice(0, 2), 16);\n const g = parseInt(hex.slice(2, 4), 16);\n const b = parseInt(hex.slice(4, 6), 16);\n return `rgba(${r}, ${g}, ${b}, ${opacityFactor})`;\n }\n\n return color;\n}\n\n/**\n * Applies reduced opacity to a gradient\n * @param {Array<[number, string]>} gradient \n * @param {number} opacityFactor \n * @returns {Array<[number, string]>}\n */\nexport function applyReducedOpacityToGradient(gradient, opacityFactor) {\n if (!gradient || !Array.isArray(gradient)) {\n return gradient;\n }\n\n return gradient.map((stop) => {\n if (Array.isArray(stop) && stop.length === 2) {\n const [position, color] = stop;\n const translucentColor = applyReducedOpacity(color, opacityFactor);\n return [position, translucentColor];\n } else if (typeof stop === \"string\") {\n return applyReducedOpacity(stop, opacityFactor);\n }\n return stop;\n });\n}\n\n/**\n * Creates a default gradient from a color at half opacity\n * @param {string} color \n * @returns {Array<[number, string]>}\n */\nexport function createDefaultGradient(color) {\n if (!color) return [[0, 'transparent'], [1, 'transparent']];\n \n const halfOpacityColor = applyReducedOpacity(color, 0.5);\n return [[0, halfOpacityColor], [1, halfOpacityColor]];\n}\n","module.exports = \"precision highp float;\\n\\nuniform vec4 color;\\nuniform float thickness;\\nuniform float shadowBlur;\\nuniform vec4 shadowColor;\\nuniform float width; // Canvas width for normalization\\nuniform float cutoffX; // Cutoff X position as ratio (0.0-1.0)\\nuniform float cutoffOpacity; // Opacity for pre-cutoff area\\n\\nvarying vec2 position_vec;\\nvarying vec2 prev_position_vec;\\n\\n/**\\n * Calculate distance between point and line in screen space (ie, inputs in pixels, returns distance in pixels)\\n */\\nfloat distance_from_line() {\\n float x0 = gl_FragCoord.x;\\n float y0 = gl_FragCoord.y;\\n\\n // let line be defined by ax + by + c = 0;\\n float a, b, c;\\n\\n if (position_vec.x == prev_position_vec.x) {\\n a = 1.0;\\n b = 0.0;\\n c = -position_vec.x;\\n } else {\\n float slope = (position_vec.y - prev_position_vec.y)/(position_vec.x - prev_position_vec.x);\\n float y_intercept = position_vec.y - slope*position_vec.x;\\n\\n // y = slope*x + y_intercept\\n // (-slope)(x) + (1)(y) - y_intercept = 0;\\n a = -slope;\\n b = 1.0;\\n c = -y_intercept;\\n }\\n\\n return abs(a*x0 + b*y0 + c)/length(vec2(a, b));\\n}\\n\\nvoid main() {\\n vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);\\n\\n // Apply cutoff opacity if active\\n vec4 finalColor = vec4(color);\\n if (cutoffX >= 0.0) {\\n // Convert pixel position to normalized coordinate (0.0 to 1.0)\\n float normalizedX = gl_FragCoord.x / width;\\n \\n // Apply reduced opacity to pixels left of cutoff\\n if (normalizedX < cutoffX) {\\n finalColor.a *= cutoffOpacity;\\n }\\n }\\n\\n float dist = distance_from_line();\\n\\n if (dist + shadowBlur >= thickness) {\\n float percent_shadowed = ((thickness - dist) / shadowBlur);\\n gl_FragColor = mix(transparent, shadowColor, percent_shadowed*percent_shadowed);\\n } else {\\n gl_FragColor = finalColor;\\n gl_FragColor.rgb *= gl_FragColor.a;\\n }\\n}\\n\"","module.exports = \"precision highp float;\\n\\nuniform vec4 color;\\n\\nvoid main() {\\n gl_FragColor = vec4(color);\\n}\\n\"","\"use strict\";\n\n/* istanbul ignore next */\nfunction insertStyleElement(options) {\n var element = document.createElement(\"style\");\n options.setAttributes(element, options.attributes);\n options.insert(element, options.options);\n return element;\n}\nmodule.exports = insertStyleElement;","/**\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 (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\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 = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.grapher-night{position:relative;background:linear-gradient(to bottom right, #131313, #1e1e1e);padding:10px;font-family:sans-serif;font-size:12px;line-height:normal}.grapher-night *,.grapher-night :after,.grapher-night :before{box-sizing:content-box}.grapher-night .grapher-title{text-align:center;color:#fff;font-size:18px;margin-bottom:8px}.grapher-night .grapher-primary-container-outer{display:flex}.grapher-night .grapher-primary-container-outer .grapher-sidebar{background:linear-gradient(#111, transparent 75%, transparent 100%);color:#eee;padding:50px 6px 5px 10px;margin-left:-10px;margin-top:-10px;margin-bottom:-10px;overflow-y:auto;flex-shrink:0}.grapher-night .grapher-primary-container-outer .grapher-sidebar .series-toggle{white-space:nowrap}.grapher-night .grapher-primary-container-outer .grapher-sidebar .series-toggle+.series-toggle{margin-top:3px}.grapher-night .grapher-primary-container-outer .grapher-sidebar .series-toggle label{display:inline-block;position:relative;user-select:none}.grapher-night .grapher-primary-container-outer .grapher-sidebar .series-toggle input[type=checkbox]{opacity:0;cursor:pointer;height:0;width:0;margin-right:11px}.grapher-night .grapher-primary-container-outer .grapher-sidebar .series-toggle input:not(:checked)~.checkmark{background-color:rgba(0,0,0,0) !important}.grapher-night .grapher-primary-container-outer .grapher-sidebar .series-toggle input:checked~.checkmark:after{display:block}.grapher-night .grapher-primary-container-outer .grapher-sidebar .series-toggle .checkmark{position:absolute;top:1px;left:0;height:7px;width:7px;background-color:#eee;border:2px solid;border-radius:1px}.grapher-night .grapher-primary-container-outer .grapher-sidebar .series-toggle .checkmark:after{content:\"\";position:absolute;display:none;left:.5px;top:-1.5px;width:3px;height:6px;border:solid #fff;border-width:0 2px 2px 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.grapher-night .grapher-primary-container-outer .grapher-primary-container-body{width:100%;padding-left:2px}.grapher-night .series-key{text-align:center;margin-bottom:-14px;position:relative}.grapher-night .series-key .scale-label{display:inline-block;background:#111;color:silver;transform:rotate(-90deg);width:24px;margin-left:-5px;vertical-align:top;margin-top:4px;padding-bottom:2px;cursor:pointer;user-select:none}.grapher-night .series-key .series-key-axis-container{display:inline-block;border:1px solid #111;min-width:18px;min-height:24px;vertical-align:top;white-space:nowrap}.grapher-night .series-key .series-key-axis-container+.series-key-axis-container{margin-left:4px}.grapher-night .series-key .series-key-axis-container.series-key-axis-container-showing-label .scale-label{width:46px;margin-top:15px;margin-left:-15px;margin-right:-12px}.grapher-night .series-key .series-key-axis-container.series-key-axis-container-showing-label .series-key-axis-label-container{display:block}.grapher-night .series-key .series-key-axis-container.series-key-axis-container-showing-label .label-input-toggler path{fill:#e0e0e3}.grapher-night .series-key .series-key-axis-container .series-key-axis-container-body{display:inline-block}.grapher-night .series-key .series-key-axis-container .series-key-axis-container-body>div{white-space:initial}.grapher-night .series-key .series-key-axis-container .series-key-axis-label-container{display:none}.grapher-night .series-key .series-key-axis-container .label-input-toggler{width:16px;cursor:pointer;display:inline-block;vertical-align:top;margin:4px 2px}.grapher-night .series-key .series-key-axis-container .label-input-toggler path{fill:#111}.grapher-night .series-key .series-key-axis-container .label-input-toggler:hover path{fill:#e0e0e3}.grapher-night .series-key .series-key-item{border:1px solid currentColor;padding:2px;margin:2px;display:inline-block;cursor:pointer;user-select:none;background:rgba(0,0,0,0)}.grapher-night .series-key .series-key-item+.series-key-item{margin-left:4px}.grapher-night .series-key .series-key-item.series-key-item-highlighted{box-shadow:0 0 4px silver}.grapher-night .range-selection{color:silver;user-select:none}.grapher-night .range-selection.range-not-dates{color:#aaa}.grapher-night .range-selection .range-buttons{text-align:right}.grapher-night .range-selection .range-buttons .options-bar{display:inline-block}.grapher-night .range-selection .range-buttons .option-tooltip{position:relative;display:inline-block;border-bottom:1px dotted #000}.grapher-night .range-selection .range-buttons .option-tooltip .option-tooltip-text{visibility:hidden;color:silver;background:#000;text-align:center;padding:5px 5px;border-radius:6px;position:absolute;z-index:1;border:1px solid #000;width:120px;margin-left:-65px;top:calc(100% + 7px);left:50%}.grapher-night .range-selection .range-buttons .option-tooltip:hover .option-tooltip-text{visibility:visible}.grapher-night .range-selection .range-buttons .option-tooltip .option-tooltip-text::after{content:\" \";position:absolute;bottom:100%;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:rgba(0,0,0,0) rgba(0,0,0,0) #000 rgba(0,0,0,0)}.grapher-night .range-selection .range-buttons .range-button{display:inline-block;cursor:pointer;padding:4px 8px;margin-left:6px;border-radius:2px;background:#505053}.grapher-night .range-selection .range-buttons .range-button.range-button-selected{color:silver;background:#000}.grapher-night .range-selection .range-buttons .range-button.range-button-disabled,.grapher-night .range-selection .range-buttons .range-button.range-button-selected.range-button-disabled{cursor:not-allowed;color:#aaa;background:#7a7a7a}.grapher-night .range-selection .range-buttons .range-button .icon-container{position:relative;width:0}.grapher-night .range-selection .range-buttons .range-button .icon-container.icon-container-narrow svg{left:-3px}.grapher-night .range-selection .range-buttons .range-button .icon-container.icon-container-square{width:5px}.grapher-night .range-selection .range-buttons .range-button .icon-container.icon-container-square svg{left:-5px}.grapher-night .range-selection .range-buttons .range-button .icon-container.icon-container-448{width:3px}.grapher-night .range-selection .range-buttons .range-button .icon-container.icon-container-448 svg{left:-5px}.grapher-night .range-selection .range-buttons .range-button .icon-container:before{content:\"A\";opacity:0}.grapher-night .range-selection .range-buttons .range-button .icon-container svg{height:15px;position:absolute;top:-1px;left:-4px}.grapher-night .range-selection .range-buttons .range-selection-history+.range-selection-history{margin-right:8px;margin-left:4px}.grapher-night .range-selection .range-buttons .percentile-button>div{display:inline-block}.grapher-night .range-selection .range-buttons .percentile-button input{background:rgba(0,0,0,0);border:1px solid #505053;margin:2px 8px 2px 0;color:#e0e0e3;padding:1px 2px;width:20px;font-size:11px;-moz-appearance:textfield}.grapher-night .range-selection .range-buttons .percentile-button input:focus{outline:none;border-color:#e0e0e3}.grapher-night .range-selection .range-buttons .percentile-button input::-webkit-outer-spin-button,.grapher-night .range-selection .range-buttons .percentile-button input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.grapher-night .range-selection .range-buttons .percentile-button .icon-container.icon-container-narrow svg{height:12px;top:1px;left:-5px}.grapher-night .range-selection .range-buttons .showing-options-button{margin-right:8px}.grapher-night .grapher-main-row{display:flex}.grapher-night .grapher-main-row .central-container{width:100%}.grapher-night .range-graph-container{display:flex;margin-top:10px}.grapher-night .graph-body{width:100%;height:400px;position:relative}.grapher-night .graph-body canvas{width:100%;height:100%}.grapher-night .graph-body .grapher-tooltip,.grapher-night .graph-body .grapher-draggable-points,.grapher-night .graph-body .grapher-vertical-lines{position:absolute;top:0;left:0;right:0;z-index:20}.grapher-night .graph-body .grapher-tooltip>svg,.grapher-night .graph-body .grapher-draggable-points>svg,.grapher-night .graph-body .grapher-vertical-lines>svg{position:absolute;overflow:visible;left:0}.grapher-night .graph-body .grapher-vertical-lines{pointer-events:none;user-select:none}.grapher-night .graph-body .grapher-tooltip .tooltip-item path{fill:rgba(0,0,0,.6)}.grapher-night .graph-body .grapher-tooltip .tooltip-item text{fill:#f0f0f0;dominant-baseline:hanging;text-anchor:start}.grapher-night .graph-body .grapher-tooltip .tooltip-item.tooltip-item-fixed path{fill:#000}.grapher-night .graph-body .grapher-tooltip .line{position:absolute;height:400px;border-left:1px solid #ccc}.grapher-night .graph-body .grapher-tooltip .custom-tooltip-container{position:absolute}.grapher-night .graph-body .grapher-context-menu{position:absolute;top:0;left:0}.grapher-night .graph-body .grapher-context-menu .menu-item .menu-text{user-select:all;position:absolute;top:0;background:rgba(0,0,0,.6);border:1px solid hsla(0,0%,100%,.3);color:#f0f0f0;padding:2px 4px;max-width:max-content;width:200px}.grapher-night .graph-body .grapher-draggable-points circle{cursor:pointer}.grapher-night .graph-body .grapher-vertical-lines line{stroke:#ccc}.grapher-night .graph-body .grapher-vertical-lines polygon{fill:#ccc}.grapher-night .graph-body .grapher-annotations{position:absolute;top:0;pointer-events:none;user-select:none;z-index:10}.grapher-night .graph-body .grapher-annotations .grapher-annotation{position:absolute}.grapher-night .graph-body .grapher-annotations .grapher-annotation .annotation-marker{display:inline-block;background:hsla(0,0%,100%,.3)}.grapher-night .graph-body .grapher-annotations .grapher-annotation.grapher-annotation-range .annotation-range-marker{display:inline-block;background-color:rgba(128,128,128,.2);background-image:repeating-linear-gradient(53deg, #626266, #626266 1px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.1) 4px);background-size:40px 40px;border-right:1px solid #fff;border-left:1px solid #fff}.grapher-night .graph-body .grapher-annotations .grapher-annotation .annotation-text{position:absolute;background:rgba(0,0,0,.6);border:1px solid hsla(0,0%,100%,.3);color:#f0f0f0;padding:2px 4px;white-space:nowrap;font-size:10px;z-index:10}.grapher-night .graph-body .bounds-selection{position:absolute;background:hsla(0,0%,100%,.1)}.grapher-night .axis{overflow:visible;user-select:none}.grapher-night .axis.x-axis{width:1px;height:20px}.grapher-night .axis.x-axis.x-axis-dual{height:30px}.grapher-night .axis.x-axis{display:block}.grapher-night .axis.y-axis{height:400px}.grapher-night .axis.y-axis .axis-item text{text-anchor:end}.grapher-night .axis.y-axis .y-axis-label{text-anchor:middle;fill:#e0e0e3}.grapher-night .axis.y-axis .y-axis-label.y-axis-big-label{font-size:18px}.grapher-night .axis.y-axis .series-color-box{cursor:pointer}.grapher-night .axis.y-axis.y-axis-right .axis-item text{text-anchor:start}.grapher-night .axis .axis-line{stroke:rgba(192,192,192,.3);stroke-width:1px}.grapher-night .axis .axis-item path{stroke:rgba(192,192,192,.3);stroke-width:1px}.grapher-night .axis .axis-item text{fill:#e0e0e3;font-size:8px}.grapher-night .axis .axis-item.axis-item-major .axis-tick{stroke-width:1px}.grapher-night .axis .axis-item.axis-item-big-labels text{font-size:16px}.grapher-night .wind-arrows{color:#e0e0e3;opacity:.7}.grapher-night .range-selection-graph{width:100%;background-color:rgba(0,0,0,.3);height:calc(50px + 14px)}.grapher-night .range-selection-graph .graph-body-secondary{height:50px}.grapher-night .range-selection-graph .graph-body-secondary canvas{height:100%}.grapher-night .range-selection-graph .graph-body-secondary svg{position:absolute;left:0;width:100%;overflow:visible}.grapher-night .range-selection-graph .graph-body-secondary svg .target-selection{fill:hsla(0,0%,100%,.1);cursor:ew-resize}.grapher-night .range-selection-graph .graph-body-secondary svg .target-selection-outline{stroke:#aaa;cursor:ew-resize;fill:rgba(0,0,0,0)}.grapher-night .range-selection-graph .graph-body-secondary svg .selection-bar-track{fill:#303033}.grapher-night .range-selection-graph .graph-body-secondary svg .selection-bar{fill:#808083;cursor:ew-resize}.grapher-night .range-selection-graph .graph-body-secondary svg .selection-bar-rifles{stroke:#fff;stroke-width:1px;cursor:ew-resize}.grapher-night .range-selection-graph .graph-body-secondary svg .selection-bar-handle-hit{cursor:ew-resize}.grapher-night .range-selection-graph .graph-body-secondary svg .selection-bar-handle{stroke:#aaa;fill:#666;stroke-width:1px;cursor:ew-resize;transition:stroke-width .15s ease,fill .15s ease}.grapher-night .range-selection-graph .graph-body-secondary svg .selection-handle .selection-handle-hit{cursor:ew-resize}.grapher-night .range-selection-graph .graph-body-secondary svg .selection-handle .selection-handle-line{stroke:#aaa;stroke-width:1;transition:stroke-width .15s ease}.grapher-night .range-selection-graph .graph-body-secondary svg .selection-handle:hover .selection-handle-line{stroke-width:3}.grapher-night .range-selection-graph .graph-body-secondary svg .selection-handle.selection-handle-dragging .selection-handle-line{stroke-width:3}.grapher-night .range-selection-graph .graph-body-secondary svg .selection-handle:hover .selection-bar-handle{stroke-width:2px}.grapher-night .range-selection-graph .graph-body-secondary svg .selection-handle.selection-handle-dragging .selection-bar-handle{stroke-width:2px}.grapher-night .range-selection-graph .graph-body-secondary svg .axis-item text{fill:#9f9f9f;text-anchor:start;font-size:8px;user-select:none;dominant-baseline:text-after-edge}.grapher-night .range-selection-graph .graph-body-secondary svg .axis-item path{stroke:#9f9f9f;stroke-width:1px}.grapher-night .range-selection-graph .graph-body-secondary svg .axis-item.axis-item-highlighted path{stroke:#fff}.grapher-night .range-selection-graph .graph-body-secondary svg .axis-item.axis-item-highlighted text{fill:#fff}.grapher-night input,.grapher-night textarea{background:rgba(0,0,0,0);border:1px solid #505053;margin:2px 0;color:#e0e0e3;padding:1px 2px;text-align:center}.grapher-night input:focus,.grapher-night textarea:focus{outline:none;border-color:#e0e0e3}.grapher-night.grapher-dragging-y .y-axis{border:2px dashed silver;margin:-2px;flex-shrink:0}.grapher-night.grapher-dragging-y .y-axis+.y-axis{border-left:none}.grapher-night.grapher-fullscreen{height:calc(100vh - 2*10px)}.grapher-night.grapher-fixed-height .grapher-primary-container-outer{height:100%}.grapher-night.grapher-fixed-height .grapher-primary-container-outer .grapher-primary-container-body{height:100%;display:flex;flex-direction:column}.grapher-night.grapher-fixed-height .grapher-primary-container-outer .grapher-primary-container-body .grapher-main-row{flex-grow:1}.grapher-night.grapher-fixed-height .grapher-primary-container-outer .grapher-primary-container-body .grapher-main-row .central-container{display:flex;flex-direction:column;height:100%}.grapher-night.grapher-fixed-height .grapher-primary-container-outer .grapher-primary-container-body .grapher-main-row .central-container>.graph-body{flex-grow:1;height:unset}.grapher-night.grapher-fixed-height .grapher-primary-container-outer .grapher-primary-container-body .grapher-main-row .axis.y-axis{height:calc(100% - 40px)}.grapher-night.new-grapher{height:auto;border:2px dashed silver;text-align:center;color:#ddd}.grapher-day{position:relative;background:linear-gradient(to bottom right, #FFF, #FFF);padding:10px;font-family:sans-serif;font-size:12px;line-height:normal}.grapher-day *,.grapher-day :after,.grapher-day :before{box-sizing:content-box}.grapher-day .grapher-title{text-align:center;color:#000;font-size:18px;margin-bottom:8px}.grapher-day .grapher-primary-container-outer{display:flex}.grapher-day .grapher-primary-container-outer .grapher-sidebar{background:linear-gradient(#EEE, transparent 75%, transparent 100%);color:#111;padding:50px 6px 5px 10px;margin-left:-10px;margin-top:-10px;margin-bottom:-10px;overflow-y:auto;flex-shrink:0}.grapher-day .grapher-primary-container-outer .grapher-sidebar .series-toggle{white-space:nowrap}.grapher-day .grapher-primary-container-outer .grapher-sidebar .series-toggle+.series-toggle{margin-top:3px}.grapher-day .grapher-primary-container-outer .grapher-sidebar .series-toggle label{display:inline-block;position:relative;user-select:none}.grapher-day .grapher-primary-container-outer .grapher-sidebar .series-toggle input[type=checkbox]{opacity:0;cursor:pointer;height:0;width:0;margin-right:11px}.grapher-day .grapher-primary-container-outer .grapher-sidebar .series-toggle input:not(:checked)~.checkmark{background-color:rgba(0,0,0,0) !important}.grapher-day .grapher-primary-container-outer .grapher-sidebar .series-toggle input:checked~.checkmark:after{display:block}.grapher-day .grapher-primary-container-outer .grapher-sidebar .series-toggle .checkmark{position:absolute;top:1px;left:0;height:7px;width:7px;background-color:#eee;border:2px solid;border-radius:1px}.grapher-day .grapher-primary-container-outer .grapher-sidebar .series-toggle .checkmark:after{content:\"\";position:absolute;display:none;left:.5px;top:-1.5px;width:3px;height:6px;border:solid #fff;border-width:0 2px 2px 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.grapher-day .grapher-primary-container-outer .grapher-primary-container-body{width:100%;padding-left:2px}.grapher-day .series-key{text-align:center;margin-bottom:-14px;position:relative}.grapher-day .series-key .scale-label{display:inline-block;background:#b0b0b7;color:#000;transform:rotate(-90deg);width:24px;margin-left:-5px;vertical-align:top;margin-top:4px;padding-bottom:2px;cursor:pointer;user-select:none}.grapher-day .series-key .series-key-axis-container{display:inline-block;border:1px solid #b0b0b7;min-width:18px;min-height:24px;vertical-align:top;white-space:nowrap}.grapher-day .series-key .series-key-axis-container+.series-key-axis-container{margin-left:4px}.grapher-day .series-key .series-key-axis-container.series-key-axis-container-showing-label .scale-label{width:46px;margin-top:15px;margin-left:-15px;margin-right:-12px}.grapher-day .series-key .series-key-axis-container.series-key-axis-container-showing-label .series-key-axis-label-container{display:block}.grapher-day .series-key .series-key-axis-container.series-key-axis-container-showing-label .label-input-toggler path{fill:#505053}.grapher-day .series-key .series-key-axis-container .series-key-axis-container-body{display:inline-block}.grapher-day .series-key .series-key-axis-container .series-key-axis-container-body>div{white-space:initial}.grapher-day .series-key .series-key-axis-container .series-key-axis-label-container{display:none}.grapher-day .series-key .series-key-axis-container .label-input-toggler{width:16px;cursor:pointer;display:inline-block;vertical-align:top;margin:4px 2px}.grapher-day .series-key .series-key-axis-container .label-input-toggler path{fill:#b0b0b7}.grapher-day .series-key .series-key-axis-container .label-input-toggler:hover path{fill:#505053}.grapher-day .series-key .series-key-item{border:1px solid currentColor;padding:2px;margin:2px;display:inline-block;cursor:pointer;user-select:none}.grapher-day .series-key .series-key-item+.series-key-item{margin-left:4px}.grapher-day .series-key .series-key-item.series-key-item-highlighted{box-shadow:0 0 4px #000}.grapher-day .range-selection{color:#444;user-select:none}.grapher-day .range-selection.range-not-dates{color:#888}.grapher-day .range-selection .range-buttons{text-align:right}.grapher-day .range-selection .range-buttons .options-bar{display:inline-block}.grapher-day .range-selection .range-buttons .option-tooltip{position:relative;display:inline-block;border-bottom:1px dotted #000}.grapher-day .range-selection .range-buttons .option-tooltip .option-tooltip-text{visibility:hidden;color:#000;background:#fff;text-align:center;padding:5px 5px;border-radius:6px;position:absolute;z-index:1;border:1px solid #000;width:120px;margin-left:-65px;top:calc(100% + 7px);left:50%}.grapher-day .range-selection .range-buttons .option-tooltip:hover .option-tooltip-text{visibility:visible}.grapher-day .range-selection .range-buttons .option-tooltip .option-tooltip-text::after{content:\" \";position:absolute;bottom:100%;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:rgba(0,0,0,0) rgba(0,0,0,0) #000 rgba(0,0,0,0)}.grapher-day .range-selection .range-buttons .range-button{display:inline-block;cursor:pointer;padding:4px 8px;margin-left:4px;border-radius:2px;background:#fff;border:1px dotted silver}.grapher-day .range-selection .range-buttons .range-button.range-button-selected{color:#000;background:#fff;border:1px solid #000}.grapher-day .range-selection .range-buttons .range-button.range-button-disabled,.grapher-day .range-selection .range-buttons .range-button.range-button-selected.range-button-disabled{cursor:not-allowed;color:#888;background:#eee}.grapher-day .range-selection .range-buttons .range-button .icon-container{position:relative;width:0}.grapher-day .range-selection .range-buttons .range-button .icon-container.icon-container-narrow svg{left:-3px}.grapher-day .range-selection .range-buttons .range-button .icon-container.icon-container-square{width:5px}.grapher-day .range-selection .range-buttons .range-button .icon-container.icon-container-square svg{left:-5px}.grapher-day .range-selection .range-buttons .range-button .icon-container.icon-container-448{width:3px}.grapher-day .range-selection .range-buttons .range-button .icon-container.icon-container-448 svg{left:-5px}.grapher-day .range-selection .range-buttons .range-button .icon-container:before{content:\"A\";opacity:0}.grapher-day .range-selection .range-buttons .range-button .icon-container svg{height:15px;position:absolute;top:-1px;left:-4px}.grapher-day .range-selection .range-buttons .range-selection-history+.range-selection-history{margin-right:8px;margin-left:4px}.grapher-day .range-selection .range-buttons .percentile-button>div{display:inline-block}.grapher-day .range-selection .range-buttons .percentile-button input{background:rgba(0,0,0,0);border:1px solid #e0e0e3;margin:2px 8px 2px 0;color:#222;padding:1px 2px;width:20px;font-size:11px;-moz-appearance:textfield}.grapher-day .range-selection .range-buttons .percentile-button input:focus{outline:none;border-color:#505053}.grapher-day .range-selection .range-buttons .percentile-button input::-webkit-outer-spin-button,.grapher-day .range-selection .range-buttons .percentile-button input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.grapher-day .range-selection .range-buttons .percentile-button .icon-container.icon-container-narrow svg{height:12px;top:1px;left:-5px}.grapher-day .range-selection .range-buttons .showing-options-button{margin-right:8px}.grapher-day .grapher-main-row{display:flex}.grapher-day .grapher-main-row .central-container{width:100%}.grapher-day .range-graph-container{display:flex;margin-top:10px}.grapher-day .graph-body{width:100%;height:400px;position:relative}.grapher-day .graph-body canvas{width:100%;height:100%}.grapher-day .graph-body .grapher-tooltip,.grapher-day .graph-body .grapher-draggable-points,.grapher-day .graph-body .grapher-vertical-lines{position:absolute;top:0;left:0;right:0;z-index:20}.grapher-day .graph-body .grapher-tooltip>svg,.grapher-day .graph-body .grapher-draggable-points>svg,.grapher-day .graph-body .grapher-vertical-lines>svg{position:absolute;overflow:visible;left:0}.grapher-day .graph-body .grapher-vertical-lines{pointer-events:none;user-select:none}.grapher-day .graph-body .grapher-tooltip .tooltip-item path{fill:hsla(0,0%,100%,.6)}.grapher-day .graph-body .grapher-tooltip .tooltip-item text{fill:#0f0f0f;dominant-baseline:hanging;text-anchor:start}.grapher-day .graph-body .grapher-tooltip .tooltip-item.tooltip-item-fixed path{fill:#fff}.grapher-day .graph-body .grapher-tooltip .line{position:absolute;height:400px;border-left:1px solid #333}.grapher-day .graph-body .grapher-tooltip .custom-tooltip-container{position:absolute}.grapher-day .graph-body .grapher-context-menu{position:absolute;top:0;left:0}.grapher-day .graph-body .grapher-context-menu .menu-item .menu-text{user-select:all;position:absolute;top:0;background:hsla(0,0%,100%,.6);border:1px solid rgba(0,0,0,.3);color:#0f0f0f;padding:2px 4px;max-width:max-content;width:200px}.grapher-day .graph-body .grapher-draggable-points circle{cursor:pointer}.grapher-day .graph-body .grapher-vertical-lines line{stroke:#333}.grapher-day .graph-body .grapher-vertical-lines polygon{fill:#333}.grapher-day .graph-body .grapher-annotations{position:absolute;top:0;pointer-events:none;user-select:none;z-index:10}.grapher-day .graph-body .grapher-annotations .grapher-annotation{position:absolute}.grapher-day .graph-body .grapher-annotations .grapher-annotation .annotation-marker{display:inline-block;background:rgba(0,0,0,.3)}.grapher-day .graph-body .grapher-annotations .grapher-annotation.grapher-annotation-range .annotation-range-marker{display:inline-block;background-color:rgba(128,128,128,.2);background-image:repeating-linear-gradient(53deg, #626266, #626266 1px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.1) 4px);background-size:40px 40px;border-right:1px solid #fff;border-left:1px solid #fff}.grapher-day .graph-body .grapher-annotations .grapher-annotation .annotation-text{position:absolute;background:hsla(0,0%,100%,.6);border:1px solid rgba(0,0,0,.3);color:#0f0f0f;padding:2px 4px;white-space:nowrap;font-size:10px;z-index:10}.grapher-day .graph-body .bounds-selection{position:absolute;background:rgba(0,0,0,.02)}.grapher-day .axis{overflow:visible;user-select:none}.grapher-day .axis.x-axis{width:1px;height:20px}.grapher-day .axis.x-axis.x-axis-dual{height:30px}.grapher-day .axis.x-axis{display:block}.grapher-day .axis.y-axis{height:400px}.grapher-day .axis.y-axis .axis-item text{text-anchor:end}.grapher-day .axis.y-axis .y-axis-label{text-anchor:middle;fill:#1f1f1c}.grapher-day .axis.y-axis .y-axis-label.y-axis-big-label{font-size:18px}.grapher-day .axis.y-axis .series-color-box{cursor:pointer}.grapher-day .axis.y-axis.y-axis-right .axis-item text{text-anchor:start}.grapher-day .axis .axis-line{stroke:#656565;stroke-width:1px}.grapher-day .axis .axis-item path{stroke:#bfbfbf;stroke-width:1px}.grapher-day .axis .axis-item text{fill:#1f1f1c;font-size:8px}.grapher-day .axis .axis-item.axis-item-major .axis-tick{stroke-width:1px}.grapher-day .axis .axis-item.axis-item-big-labels text{font-size:16px}.grapher-day .wind-arrows{color:#1f1f1c;opacity:.7}.grapher-day .range-selection-graph{width:100%;background-color:hsla(0,0%,100%,.3);height:calc(50px + 14px)}.grapher-day .range-selection-graph .graph-body-secondary{height:50px}.grapher-day .range-selection-graph .graph-body-secondary canvas{height:100%}.grapher-day .range-selection-graph .graph-body-secondary svg{position:absolute;left:0;width:100%;overflow:visible}.grapher-day .range-selection-graph .graph-body-secondary svg .target-selection{fill:rgba(0,0,0,.02);cursor:ew-resize}.grapher-day .range-selection-graph .graph-body-secondary svg .target-selection-outline{stroke:#333;cursor:ew-resize;fill:rgba(0,0,0,0)}.grapher-day .range-selection-graph .graph-body-secondary svg .selection-bar-track{fill:#eee}.grapher-day .range-selection-graph .graph-body-secondary svg .selection-bar{fill:#b0b0b7;cursor:ew-resize}.grapher-day .range-selection-graph .graph-body-secondary svg .selection-bar-rifles{stroke:#333;stroke-width:1px;cursor:ew-resize}.grapher-day .range-selection-graph .graph-body-secondary svg .selection-bar-handle-hit{cursor:ew-resize}.grapher-day .range-selection-graph .graph-body-secondary svg .selection-bar-handle{stroke:#333;fill:#b0b0b7;stroke-width:1px;cursor:ew-resize;transition:stroke-width .15s ease,fill .15s ease}.grapher-day .range-selection-graph .graph-body-secondary svg .selection-handle .selection-handle-hit{cursor:ew-resize}.grapher-day .range-selection-graph .graph-body-secondary svg .selection-handle .selection-handle-line{stroke:#333;stroke-width:1;transition:stroke-width .15s ease}.grapher-day .range-selection-graph .graph-body-secondary svg .selection-handle:hover .selection-handle-line{stroke-width:3}.grapher-day .range-selection-graph .graph-body-secondary svg .selection-handle.selection-handle-dragging .selection-handle-line{stroke-width:3}.grapher-day .range-selection-graph .graph-body-secondary svg .selection-handle:hover .selection-bar-handle{stroke-width:2px}.grapher-day .range-selection-graph .graph-body-secondary svg .selection-handle.selection-handle-dragging .selection-bar-handle{stroke-width:2px}.grapher-day .range-selection-graph .graph-body-secondary svg .axis-item text{fill:#555;text-anchor:start;font-size:8px;user-select:none;dominant-baseline:text-after-edge}.grapher-day .range-selection-graph .graph-body-secondary svg .axis-item path{stroke:#555;stroke-width:1px}.grapher-day .range-selection-graph .graph-body-secondary svg .axis-item.axis-item-highlighted path{stroke:#000}.grapher-day .range-selection-graph .graph-body-secondary svg .axis-item.axis-item-highlighted text{fill:#000}.grapher-day input,.grapher-day textarea{background:rgba(0,0,0,0);border:1px solid #e0e0e3;margin:2px 0;color:#222;padding:1px 2px;text-align:center}.grapher-day input:focus,.grapher-day textarea:focus{outline:none;border-color:#505053}.grapher-day.grapher-dragging-y .y-axis{border:2px dashed silver;margin:-2px;flex-shrink:0}.grapher-day.grapher-dragging-y .y-axis+.y-axis{border-left:none}.grapher-day.grapher-fullscreen{height:calc(100vh - 2*10px)}.grapher-day.grapher-fixed-height .grapher-primary-container-outer{height:100%}.grapher-day.grapher-fixed-height .grapher-primary-container-outer .grapher-primary-container-body{height:100%;display:flex;flex-direction:column}.grapher-day.grapher-fixed-height .grapher-primary-container-outer .grapher-primary-container-body .grapher-main-row{flex-grow:1}.grapher-day.grapher-fixed-height .grapher-primary-container-outer .grapher-primary-container-body .grapher-main-row .central-container{display:flex;flex-direction:column;height:100%}.grapher-day.grapher-fixed-height .grapher-primary-container-outer .grapher-primary-container-body .grapher-main-row .central-container>.graph-body{flex-grow:1;height:unset}.grapher-day.grapher-fixed-height .grapher-primary-container-outer .grapher-primary-container-body .grapher-main-row .axis.y-axis{height:calc(100% - 40px)}.grapher-day.new-grapher{height:auto;border:2px dashed silver;text-align:center;color:#222}.grapher-export{position:relative;background:linear-gradient(to bottom right, #FFF, #FFF);padding:10px;font-family:sans-serif;font-size:12px;line-height:normal}.grapher-export *,.grapher-export :after,.grapher-export :before{box-sizing:content-box}.grapher-export .grapher-title{text-align:center;color:#000;font-size:18px;margin-bottom:8px}.grapher-export .grapher-primary-container-outer{display:flex}.grapher-export .grapher-primary-container-outer .grapher-sidebar{background:linear-gradient(#EEE, transparent 75%, transparent 100%);color:#111;padding:50px 6px 5px 10px;margin-left:-10px;margin-top:-10px;margin-bottom:-10px;overflow-y:auto;flex-shrink:0}.grapher-export .grapher-primary-container-outer .grapher-sidebar .series-toggle{white-space:nowrap}.grapher-export .grapher-primary-container-outer .grapher-sidebar .series-toggle+.series-toggle{margin-top:3px}.grapher-export .grapher-primary-container-outer .grapher-sidebar .series-toggle label{display:inline-block;position:relative;user-select:none}.grapher-export .grapher-primary-container-outer .grapher-sidebar .series-toggle input[type=checkbox]{opacity:0;cursor:pointer;height:0;width:0;margin-right:11px}.grapher-export .grapher-primary-container-outer .grapher-sidebar .series-toggle input:not(:checked)~.checkmark{background-color:rgba(0,0,0,0) !important}.grapher-export .grapher-primary-container-outer .grapher-sidebar .series-toggle input:checked~.checkmark:after{display:block}.grapher-export .grapher-primary-container-outer .grapher-sidebar .series-toggle .checkmark{position:absolute;top:1px;left:0;height:7px;width:7px;background-color:#eee;border:2px solid;border-radius:1px}.grapher-export .grapher-primary-container-outer .grapher-sidebar .series-toggle .checkmark:after{content:\"\";position:absolute;display:none;left:.5px;top:-1.5px;width:3px;height:6px;border:solid #fff;border-width:0 2px 2px 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.grapher-export .grapher-primary-container-outer .grapher-primary-container-body{width:100%;padding-left:2px}.grapher-export .series-key{text-align:center;margin-bottom:-14px;position:relative}.grapher-export .series-key .scale-label{display:inline-block;background:#b0b0b7;color:#000;transform:rotate(-90deg);width:24px;margin-left:-5px;vertical-align:top;margin-top:4px;padding-bottom:2px;cursor:pointer;user-select:none}.grapher-export .series-key .series-key-axis-container{display:inline-block;border:1px solid #b0b0b7;min-width:18px;min-height:24px;vertical-align:top;white-space:nowrap}.grapher-export .series-key .series-key-axis-container+.series-key-axis-container{margin-left:4px}.grapher-export .series-key .series-key-axis-container.series-key-axis-container-showing-label .scale-label{width:46px;margin-top:15px;margin-left:-15px;margin-right:-12px}.grapher-export .series-key .series-key-axis-container.series-key-axis-container-showing-label .series-key-axis-label-container{display:block}.grapher-export .series-key .series-key-axis-container.series-key-axis-container-showing-label .label-input-toggler path{fill:#505053}.grapher-export .series-key .series-key-axis-container .series-key-axis-container-body{display:inline-block}.grapher-export .series-key .series-key-axis-container .series-key-axis-container-body>div{white-space:initial}.grapher-export .series-key .series-key-axis-container .series-key-axis-label-container{display:none}.grapher-export .series-key .series-key-axis-container .label-input-toggler{width:16px;cursor:pointer;display:inline-block;vertical-align:top;margin:4px 2px}.grapher-export .series-key .series-key-axis-container .label-input-toggler path{fill:#b0b0b7}.grapher-export .series-key .series-key-axis-container .label-input-toggler:hover path{fill:#505053}.grapher-export .series-key .series-key-item{border:1px solid currentColor;padding:2px;margin:2px;display:inline-block;cursor:pointer;user-select:none}.grapher-export .series-key .series-key-item+.series-key-item{margin-left:4px}.grapher-export .series-key .series-key-item.series-key-item-highlighted{box-shadow:0 0 4px #000}.grapher-export .range-selection{color:#444;user-select:none}.grapher-export .range-selection.range-not-dates{color:#888}.grapher-export .range-selection .range-buttons{text-align:right}.grapher-export .range-selection .range-buttons .options-bar{display:inline-block}.grapher-export .range-selection .range-buttons .option-tooltip{position:relative;display:inline-block;border-bottom:1px dotted #000}.grapher-export .range-selection .range-buttons .option-tooltip .option-tooltip-text{visibility:hidden;color:#000;background:#fff;text-align:center;padding:5px 5px;border-radius:6px;position:absolute;z-index:1;border:1px solid #000;width:120px;margin-left:-65px;top:calc(100% + 7px);left:50%}.grapher-export .range-selection .range-buttons .option-tooltip:hover .option-tooltip-text{visibility:visible}.grapher-export .range-selection .range-buttons .option-tooltip .option-tooltip-text::after{content:\" \";position:absolute;bottom:100%;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:rgba(0,0,0,0) rgba(0,0,0,0) #000 rgba(0,0,0,0)}.grapher-export .range-selection .range-buttons .range-button{display:inline-block;cursor:pointer;padding:4px 8px;margin-left:4px;border-radius:2px;background:#fff;border:1px dotted silver}.grapher-export .range-selection .range-buttons .range-button.range-button-selected{color:#000;background:#fff;border:1px solid #000}.grapher-export .range-selection .range-buttons .range-button.range-button-disabled,.grapher-export .range-selection .range-buttons .range-button.range-button-selected.range-button-disabled{cursor:not-allowed;color:#888;background:#eee}.grapher-export .range-selection .range-buttons .range-button .icon-container{position:relative;width:0}.grapher-export .range-selection .range-buttons .range-button .icon-container.icon-container-narrow svg{left:-3px}.grapher-export .range-selection .range-buttons .range-button .icon-container.icon-container-square{width:5px}.grapher-export .range-selection .range-buttons .range-button .icon-container.icon-container-square svg{left:-5px}.grapher-export .range-selection .range-buttons .range-button .icon-container.icon-container-448{width:3px}.grapher-export .range-selection .range-buttons .range-button .icon-container.icon-container-448 svg{left:-5px}.grapher-export .range-selection .range-buttons .range-button .icon-container:before{content:\"A\";opacity:0}.grapher-export .range-selection .range-buttons .range-button .icon-container svg{height:15px;position:absolute;top:-1px;left:-4px}.grapher-export .range-selection .range-buttons .range-selection-history+.range-selection-history{margin-right:8px;margin-left:4px}.grapher-export .range-selection .range-buttons .percentile-button>div{display:inline-block}.grapher-export .range-selection .range-buttons .percentile-button input{background:rgba(0,0,0,0);border:1px solid #e0e0e3;margin:2px 8px 2px 0;color:#222;padding:1px 2px;width:20px;font-size:11px;-moz-appearance:textfield}.grapher-export .range-selection .range-buttons .percentile-button input:focus{outline:none;border-color:#505053}.grapher-export .range-selection .range-buttons .percentile-button input::-webkit-outer-spin-button,.grapher-export .range-selection .range-buttons .percentile-button input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.grapher-export .range-selection .range-buttons .percentile-button .icon-container.icon-container-narrow svg{height:12px;top:1px;left:-5px}.grapher-export .range-selection .range-buttons .showing-options-button{margin-right:8px}.grapher-export .grapher-main-row{display:flex}.grapher-export .grapher-main-row .central-container{width:100%}.grapher-export .range-graph-container{display:flex;margin-top:10px}.grapher-export .graph-body{width:100%;height:400px;position:relative}.grapher-export .graph-body canvas{width:100%;height:100%}.grapher-export .graph-body .grapher-tooltip,.grapher-export .graph-body .grapher-draggable-points,.grapher-export .graph-body .grapher-vertical-lines{position:absolute;top:0;left:0;right:0;z-index:20}.grapher-export .graph-body .grapher-tooltip>svg,.grapher-export .graph-body .grapher-draggable-points>svg,.grapher-export .graph-body .grapher-vertical-lines>svg{position:absolute;overflow:visible;left:0}.grapher-export .graph-body .grapher-vertical-lines{pointer-events:none;user-select:none}.grapher-export .graph-body .grapher-tooltip .tooltip-item path{fill:hsla(0,0%,100%,.6)}.grapher-export .graph-body .grapher-tooltip .tooltip-item text{fill:#0f0f0f;dominant-baseline:hanging;text-anchor:start}.grapher-export .graph-body .grapher-tooltip .tooltip-item.tooltip-item-fixed path{fill:#fff}.grapher-export .graph-body .grapher-tooltip .line{position:absolute;height:400px;border-left:1px solid #333}.grapher-export .graph-body .grapher-tooltip .custom-tooltip-container{position:absolute}.grapher-export .graph-body .grapher-context-menu{position:absolute;top:0;left:0}.grapher-export .graph-body .grapher-context-menu .menu-item .menu-text{user-select:all;position:absolute;top:0;background:hsla(0,0%,100%,.6);border:1px solid rgba(0,0,0,.3);color:#0f0f0f;padding:2px 4px;max-width:max-content;width:200px}.grapher-export .graph-body .grapher-draggable-points circle{cursor:pointer}.grapher-export .graph-body .grapher-vertical-lines line{stroke:#333}.grapher-export .graph-body .grapher-vertical-lines polygon{fill:#333}.grapher-export .graph-body .grapher-annotations{position:absolute;top:0;pointer-events:none;user-select:none;z-index:10}.grapher-export .graph-body .grapher-annotations .grapher-annotation{position:absolute}.grapher-export .graph-body .grapher-annotations .grapher-annotation .annotation-marker{display:inline-block;background:rgba(0,0,0,.3)}.grapher-export .graph-body .grapher-annotations .grapher-annotation.grapher-annotation-range .annotation-range-marker{display:inline-block;background-color:rgba(128,128,128,.2);background-image:repeating-linear-gradient(53deg, #626266, #626266 1px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.1) 4px);background-size:40px 40px;border-right:1px solid #fff;border-left:1px solid #fff}.grapher-export .graph-body .grapher-annotations .grapher-annotation .annotation-text{position:absolute;background:hsla(0,0%,100%,.6);border:1px solid rgba(0,0,0,.3);color:#0f0f0f;padding:2px 4px;white-space:nowrap;font-size:10px;z-index:10}.grapher-export .graph-body .bounds-selection{position:absolute;background:rgba(0,0,0,.02)}.grapher-export .axis{overflow:visible;user-select:none}.grapher-export .axis.x-axis{width:1px;height:20px}.grapher-export .axis.x-axis.x-axis-dual{height:30px}.grapher-export .axis.x-axis{display:block}.grapher-export .axis.y-axis{height:400px}.grapher-export .axis.y-axis .axis-item text{text-anchor:end}.grapher-export .axis.y-axis .y-axis-label{text-anchor:middle;fill:#000}.grapher-export .axis.y-axis .y-axis-label.y-axis-big-label{font-size:18px}.grapher-export .axis.y-axis .series-color-box{cursor:pointer}.grapher-export .axis.y-axis.y-axis-right .axis-item text{text-anchor:start}.grapher-export .axis .axis-line{stroke:#000;stroke-width:1px}.grapher-export .axis .axis-item path{stroke:#bfbfbf;stroke-width:1px}.grapher-export .axis .axis-item text{fill:#000;font-size:8px}.grapher-export .axis .axis-item.axis-item-major .axis-tick{stroke-width:1px}.grapher-export .axis .axis-item.axis-item-big-labels text{font-size:16px}.grapher-export .wind-arrows{color:#000;opacity:.7}.grapher-export .range-selection-graph{width:100%;background-color:hsla(0,0%,100%,.3);height:calc(50px + 14px)}.grapher-export .range-selection-graph .graph-body-secondary{height:50px}.grapher-export .range-selection-graph .graph-body-secondary canvas{height:100%}.grapher-export .range-selection-graph .graph-body-secondary svg{position:absolute;left:0;width:100%;overflow:visible}.grapher-export .range-selection-graph .graph-body-secondary svg .target-selection{fill:rgba(0,0,0,.02);cursor:ew-resize}.grapher-export .range-selection-graph .graph-body-secondary svg .target-selection-outline{stroke:#333;cursor:ew-resize;fill:rgba(0,0,0,0)}.grapher-export .range-selection-graph .graph-body-secondary svg .selection-bar-track{fill:#eee}.grapher-export .range-selection-graph .graph-body-secondary svg .selection-bar{fill:#b0b0b7;cursor:ew-resize}.grapher-export .range-selection-graph .graph-body-secondary svg .selection-bar-rifles{stroke:#333;stroke-width:1px;cursor:ew-resize}.grapher-export .range-selection-graph .graph-body-secondary svg .selection-bar-handle-hit{cursor:ew-resize}.grapher-export .range-selection-graph .graph-body-secondary svg .selection-bar-handle{stroke:#333;fill:#b0b0b7;stroke-width:1px;cursor:ew-resize;transition:stroke-width .15s ease,fill .15s ease}.grapher-export .range-selection-graph .graph-body-secondary svg .selection-handle .selection-handle-hit{cursor:ew-resize}.grapher-export .range-selection-graph .graph-body-secondary svg .selection-handle .selection-handle-line{stroke:#333;stroke-width:1;transition:stroke-width .15s ease}.grapher-export .range-selection-graph .graph-body-secondary svg .selection-handle:hover .selection-handle-line{stroke-width:3}.grapher-export .range-selection-graph .graph-body-secondary svg .selection-handle.selection-handle-dragging .selection-handle-line{stroke-width:3}.grapher-export .range-selection-graph .graph-body-secondary svg .selection-handle:hover .selection-bar-handle{stroke-width:2px}.grapher-export .range-selection-graph .graph-body-secondary svg .selection-handle.selection-handle-dragging .selection-bar-handle{stroke-width:2px}.grapher-export .range-selection-graph .graph-body-secondary svg .axis-item text{fill:#333;text-anchor:start;font-size:8px;user-select:none;dominant-baseline:text-after-edge}.grapher-export .range-selection-graph .graph-body-secondary svg .axis-item path{stroke:#333;stroke-width:1px}.grapher-export .range-selection-graph .graph-body-secondary svg .axis-item.axis-item-highlighted path{stroke:#000}.grapher-export .range-selection-graph .graph-body-secondary svg .axis-item.axis-item-highlighted text{fill:#000}.grapher-export input,.grapher-export textarea{background:rgba(0,0,0,0);border:1px solid #e0e0e3;margin:2px 0;color:#222;padding:1px 2px;text-align:center}.grapher-export input:focus,.grapher-export textarea:focus{outline:none;border-color:#505053}.grapher-export.grapher-dragging-y .y-axis{border:2px dashed silver;margin:-2px;flex-shrink:0}.grapher-export.grapher-dragging-y .y-axis+.y-axis{border-left:none}.grapher-export.grapher-fullscreen{height:calc(100vh - 2*10px)}.grapher-export.grapher-fixed-height .grapher-primary-container-outer{height:100%}.grapher-export.grapher-fixed-height .grapher-primary-container-outer .grapher-primary-container-body{height:100%;display:flex;flex-direction:column}.grapher-export.grapher-fixed-height .grapher-primary-container-outer .grapher-primary-container-body .grapher-main-row{flex-grow:1}.grapher-export.grapher-fixed-height .grapher-primary-container-outer .grapher-primary-container-body .grapher-main-row .central-container{display:flex;flex-direction:column;height:100%}.grapher-export.grapher-fixed-height .grapher-primary-container-outer .grapher-primary-container-body .grapher-main-row .central-container>.graph-body{flex-grow:1;height:unset}.grapher-export.grapher-fixed-height .grapher-primary-container-outer .grapher-primary-container-body .grapher-main-row .axis.y-axis{height:calc(100% - 40px)}.grapher-export.new-grapher{height:auto;border:2px dashed silver;text-align:center;color:#222}`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/grapher.scss\"],\"names\":[],\"mappings\":\"AA28BA,eA54BE,iBAAA,CACA,6DAAA,CACA,YAPU,CASV,sBAAA,CACA,cAAA,CACA,kBAAA,CAEA,8DACE,sBAAA,CAGF,8BACE,iBAAA,CACA,UA5BY,CA6BZ,cAAA,CACA,iBAAA,CAGF,gDACE,YAAA,CAEA,iEACE,mEAAA,CACA,UAnCiB,CAoCjB,yBAAA,CACA,iBAAA,CACA,gBAAA,CACA,mBAAA,CACA,eAAA,CACA,aAAA,CAEA,gFACE,kBAAA,CAEA,+FACE,cAAA,CAGF,sFACE,oBAAA,CACA,iBAAA,CACA,gBAAA,CAGF,qGACE,SAAA,CACA,cAAA,CACA,QAAA,CACA,OAAA,CACA,iBAAA,CAGF,+GACE,yCAAA,CAGF,+GACE,aAAA,CAGF,2FACE,iBAAA,CACA,OAAA,CACA,MAAA,CACA,UAAA,CACA,SAAA,CACA,qBAAA,CACA,gBAAA,CACA,iBAAA,CAGF,iGACE,UAAA,CACA,iBAAA,CACA,YAAA,CAEA,SAAA,CACA,UAAA,CACA,SAAA,CACA,UAAA,CACA,iBAAA,CACA,wBAAA,CACA,+BAAA,CACA,2BAAA,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AAA,CACA,mCAyR+C,CAxR/C,wBAAA,CAEA,6DACE,WAyP0B,CAvP1B,oEACE,WAAA,CAGF,iEACE,iBAAA,CACA,MAAA,CACA,UAAA,CACA,gBAAA,CAEA,mFACE,oBAyQoC,CAxQpC,gBAAA,CAIF,2FACE,WAoQsC,CAnQtC,gBAAA,CACA,kBAAA,CAGF,sFACE,SAgQwC,CA7P1C,gFACE,YA2PkC,CA1PlC,gBAAA,CAGF,uFACE,WAwPyC,CAvPzC,gBAAA,CACA,gBAAA,CAGF,2FACE,gBAAA,CAGF,uFACE,WAgP2B,CA/O3B,YAgPgC,CA/OhC,gBAAA,CACA,gBAAA,CACA,gDAAA,CAIA,yGACE,gBAAA,CAGF,0GACE,WAmOyB,CAlOzB,cAAA,CACA,iCAAA,CAGF,gHACE,cAAA,CAGF,oIACE,cAAA,CAGF,+GACE,gBAAA,CAGF,mIACE,gBAAA,CAKF,iFACE,SA6M4B,CA5M5B,iBAAA,CACA,aAAA,CACA,gBAAA,CACA,iCAAA,CAGF,iFACE,WAqM4B,CApM5B,gBAAA,CAIA,uGACE,WAgMiC,CA7LnC,uGACE,SA6LiC,CArL7C,+CACE,wBAAA,CACA,wBAAA,CACA,YAAA,CACA,UAwLoC,CAvLpC,eAAA,CACA,iBAAA,CAEA,2DACE,YAAA,CACA,oBAiL6C,CA5K/C,2CACE,wBAAA,CACA,WAAA,CACA,aAAA,CAEA,mDACE,gBAAA,CAKN,mCACE,2BAAA,CAIA,sEACE,WAAA,CAEA,sGACE,WAAA,CACA,YAAA,CACA,qBAAA,CAEA,wHACE,WAAA,CAEA,2IACE,YAAA,CACA,qBAAA,CACA,WAAA,CAEA,uJACE,WAAA,CACA,YAAA,CAIJ,qIACE,wBAAA,CAOV,4BACE,WAAA,CACA,wBAAA,CACA,iBAAA,CACA,UAqI0B\",\"sourcesContent\":[\"@mixin grapher(\\n $primary-graph-body-height: 400px,\\n $secondary-graph-body-height: 50px,\\n\\n $background-color-1: #131313,\\n $background-color-2: #1e1e1e,\\n\\n $tooltip-line-color: #CCC,\\n $tooltip-background-color: rgba(0, 0, 0, 0.6),\\n $tooltip-text-color: #F0F0F0,\\n $vertical-line-color: #CCC,\\n\\n $axis-line-color: rgb(192, 192, 192, 0.3),\\n $axis-line-width: 1px,\\n $axis-tick-color: rgb(192, 192, 192, 0.3),\\n $axis-text-color: #E0E0E3,\\n\\n $range-selection-text-color: silver,\\n $range-selection-button-color: #505053,\\n $range-selection-button-selected-color: black,\\n $range-selection-text-selected-color: silver,\\n $range-selection-text-color-faded: #AAA,\\n $range-selection-button-color-faded: #7A7A7A,\\n $range-selection-button-border: null,\\n $range-selection-selected-button-border: null,\\n\\n $range-graph-selection-background-color: rgba(0, 0, 0, 0.3),\\n $range-graph-selection-range-color: rgba(255, 255, 255, 0.1),\\n $range-graph-selection-outline-color: #AAA,\\n $range-graph-selection-bar-color: #808083,\\n $range-graph-selection-bar-track-color: #303033,\\n $range-graph-selection-bar-rifles-color: #FFF,\\n $range-graph-selection-bar-height: 14px,\\n $range-graph-handle-color: #AAA,\\n $range-graph-handle-fill-color: #666,\\n $range-graph-axis-text-color: #9f9f9f,\\n $range-graph-tick-highlighted-color: #FFF,\\n $range-graph-text-highlighted-color: #FFF,\\n\\n $annotation-background-color: rgba(255, 255, 255, 0.3),\\n\\n $series-key-axis-container-color: #111,\\n $series-key-input-border-color: #505053,\\n $series-key-input-selected-border-color: #E0E0E3,\\n $series-key-input-text-color: #E0E0E3,\\n $series-key-background: transparent,\\n $scale-label-color: silver,\\n $series-key-shadow-color: silver,\\n\\n $title-color: white,\\n\\n $sidebar-background-color: #111,\\n $sidebar-text-color: #EEE,\\n\\n $new-grapher-color: #DDD\\n) {\\n $x-axis-height: 20px;\\n $x-axis-dual-height: 30px;\\n $padding: 10px;\\n\\n $axis-z-index: 0;\\n $graph-body-z-index: 1;\\n\\n position: relative;\\n background: linear-gradient(to bottom right, $background-color-1, $background-color-2);\\n padding: $padding;\\n\\n font-family: sans-serif;\\n font-size: 12px;\\n line-height: normal;\\n\\n *, :after, :before {\\n box-sizing: content-box;\\n }\\n\\n .grapher-title {\\n text-align: center;\\n color: $title-color;\\n font-size: 18px;\\n margin-bottom: 8px;\\n }\\n\\n .grapher-primary-container-outer {\\n display: flex;\\n\\n .grapher-sidebar {\\n background: linear-gradient($sidebar-background-color, transparent 75%, transparent 100%);\\n color: $sidebar-text-color;\\n padding: 50px 6px 5px 10px;\\n margin-left: -$padding;\\n margin-top: -$padding;\\n margin-bottom: -$padding;\\n overflow-y: auto;\\n flex-shrink: 0;\\n\\n .series-toggle {\\n white-space: nowrap;\\n\\n & + .series-toggle {\\n margin-top: 3px;\\n }\\n\\n label {\\n display: inline-block;\\n position: relative;\\n user-select: none;\\n }\\n\\n input[type='checkbox'] {\\n opacity: 0;\\n cursor: pointer;\\n height: 0;\\n width: 0;\\n margin-right: 11px;\\n }\\n\\n input:not(:checked) ~ .checkmark {\\n background-color: transparent !important;\\n }\\n\\n input:checked ~ .checkmark:after {\\n display: block;\\n }\\n\\n .checkmark {\\n position: absolute;\\n top: 1px;\\n left: 0;\\n height: 7px;\\n width: 7px;\\n background-color: #eee;\\n border: 2px solid;\\n border-radius: 1px;\\n }\\n\\n .checkmark:after {\\n content: \\\"\\\";\\n position: absolute;\\n display: none;\\n\\n left: 0.5px;\\n top: -1.5px;\\n width: 3px;\\n height: 6px;\\n border: solid white;\\n border-width: 0 2px 2px 0;\\n -webkit-transform: rotate(45deg);\\n -ms-transform: rotate(45deg);\\n transform: rotate(45deg);\\n }\\n }\\n }\\n\\n .grapher-primary-container-body {\\n width: 100%;\\n padding-left: 2px;\\n }\\n }\\n\\n .series-key {\\n text-align: center;\\n margin-bottom: -14px;\\n position: relative;\\n\\n .scale-label {\\n display: inline-block;\\n background: $series-key-axis-container-color;\\n color: $scale-label-color;\\n transform: rotate(-90deg);\\n width: 24px;\\n margin-left: -5px;\\n vertical-align: top;\\n margin-top: 4px;\\n padding-bottom: 2px;\\n cursor: pointer;\\n user-select: none;\\n }\\n\\n .series-key-axis-container {\\n display: inline-block;\\n border: 1px solid $series-key-axis-container-color;\\n\\n min-width: 18px;\\n min-height: 24px;\\n vertical-align: top;\\n\\n white-space: nowrap;\\n\\n & + .series-key-axis-container {\\n margin-left: 4px;\\n }\\n\\n &.series-key-axis-container-showing-label {\\n .scale-label {\\n width: 46px;\\n margin-top: 15px;\\n margin-left: -15px;\\n margin-right: -12px;\\n }\\n\\n .series-key-axis-label-container {\\n display: block;\\n }\\n\\n .label-input-toggler {\\n path {\\n fill: $series-key-input-selected-border-color;\\n }\\n }\\n }\\n\\n .series-key-axis-container-body {\\n display: inline-block;\\n\\n & > div {\\n white-space: initial;\\n }\\n }\\n\\n .series-key-axis-label-container {\\n display: none;\\n }\\n\\n .label-input-toggler {\\n width: 16px;\\n cursor: pointer;\\n display: inline-block;\\n vertical-align: top;\\n margin: 4px 2px;\\n\\n path {\\n fill: $series-key-axis-container-color;\\n }\\n\\n &:hover {\\n path {\\n fill: $series-key-input-selected-border-color;\\n }\\n }\\n }\\n }\\n\\n .series-key-item {\\n border: 1px solid currentColor;\\n padding: 2px;\\n margin: 2px;\\n display: inline-block;\\n cursor: pointer;\\n user-select: none;\\n background: $series-key-background;\\n\\n & + .series-key-item {\\n margin-left: 4px;\\n }\\n\\n &.series-key-item-highlighted {\\n box-shadow: 0 0 4px $series-key-shadow-color;\\n }\\n }\\n }\\n\\n .range-selection {\\n color: $range-selection-text-color;\\n user-select: none;\\n\\n &.range-not-dates {\\n color: $range-selection-text-color-faded;\\n }\\n\\n .range-buttons {\\n text-align: right;\\n\\n .options-bar {\\n display: inline-block;\\n }\\n\\n .option-tooltip {\\n position: relative;\\n display: inline-block;\\n border-bottom: 1px dotted black;\\n\\n .option-tooltip-text {\\n visibility: hidden;\\n color: $range-selection-text-selected-color;\\n background: $range-selection-button-selected-color;\\n text-align: center;\\n padding: 5px 5px;\\n border-radius: 6px;\\n position: absolute;\\n z-index: 1;\\n border: 1px solid black;\\n\\n width: 120px;\\n margin-left: -65px;\\n top: calc(100% + 7px);\\n left: 50%;\\n }\\n\\n &:hover .option-tooltip-text {\\n visibility: visible;\\n }\\n\\n .option-tooltip-text::after {\\n content: \\\" \\\";\\n position: absolute;\\n bottom: 100%;\\n left: 50%;\\n margin-left: -5px;\\n border-width: 5px;\\n border-style: solid;\\n border-color: transparent transparent black transparent;\\n }\\n }\\n\\n .range-button {\\n display: inline-block;\\n cursor: pointer;\\n padding: 4px 8px;\\n @if ($range-selection-button-border == null) {\\n margin-left: 6px;\\n } @else {\\n margin-left: 4px;\\n }\\n\\n border-radius: 2px;\\n background: $range-selection-button-color;\\n border: $range-selection-button-border;\\n\\n &.range-button-selected {\\n color: $range-selection-text-selected-color;\\n background: $range-selection-button-selected-color;\\n border: $range-selection-selected-button-border;\\n }\\n\\n &.range-button-disabled, &.range-button-selected.range-button-disabled {\\n cursor: not-allowed;\\n color: $range-selection-text-color-faded;\\n background: $range-selection-button-color-faded;\\n }\\n\\n .icon-container {\\n position: relative;\\n width: 0;\\n\\n &.icon-container-narrow {\\n svg {\\n left: -3px;\\n }\\n }\\n\\n &.icon-container-square {\\n width: 5px;\\n\\n svg {\\n left: -5px;\\n }\\n }\\n\\n &.icon-container-448 {\\n width: 3px;\\n\\n svg {\\n left: -5px;\\n }\\n }\\n\\n &:before {\\n content: 'A';\\n opacity: 0;\\n }\\n\\n svg {\\n height: 15px;\\n position: absolute;\\n top: -1px;\\n left: -4px;\\n }\\n }\\n }\\n\\n .range-selection-history + .range-selection-history {\\n margin-right: 8px;\\n margin-left: 4px;\\n }\\n\\n .percentile-button {\\n & > div {\\n display: inline-block;\\n }\\n\\n input {\\n background: transparent;\\n border: 1px solid $series-key-input-border-color;\\n margin: 2px 8px 2px 0;\\n color: $series-key-input-text-color;\\n padding: 1px 2px;\\n width: 20px;\\n font-size: 11px;\\n -moz-appearance: textfield;\\n\\n &:focus {\\n outline: none;\\n border-color: $series-key-input-selected-border-color;\\n }\\n\\n &::-webkit-outer-spin-button,\\n &::-webkit-inner-spin-button {\\n -webkit-appearance: none;\\n margin: 0;\\n }\\n }\\n\\n .icon-container.icon-container-narrow {\\n svg {\\n height: 12px;\\n top: 1px;\\n left: -5px;\\n }\\n }\\n }\\n\\n .showing-options-button {\\n margin-right: 8px;\\n }\\n }\\n }\\n\\n .grapher-main-row {\\n display: flex;\\n\\n .central-container {\\n width: 100%;\\n }\\n }\\n\\n .range-graph-container {\\n display: flex;\\n margin-top: 10px;\\n }\\n\\n .graph-body {\\n width: 100%;\\n height: $primary-graph-body-height;\\n position: relative;\\n\\n canvas {\\n width: 100%;\\n height: 100%;\\n }\\n\\n .grapher-tooltip, .grapher-draggable-points, .grapher-vertical-lines {\\n position: absolute;\\n top: 0;\\n left: 0;\\n right: 0;\\n z-index: 20;\\n\\n > svg {\\n position: absolute;\\n overflow: visible;\\n left: 0;\\n }\\n }\\n\\n .grapher-vertical-lines {\\n pointer-events: none;\\n user-select: none;\\n }\\n\\n .grapher-tooltip {\\n .tooltip-item {\\n path {\\n fill: $tooltip-background-color;\\n }\\n\\n text {\\n fill: $tooltip-text-color;\\n dominant-baseline: hanging;\\n text-anchor: start;\\n }\\n\\n &.tooltip-item-fixed {\\n path {\\n fill: rgba($tooltip-background-color, 1);\\n }\\n }\\n }\\n\\n .line {\\n position: absolute;\\n height: 400px;\\n border-left: 1px solid $tooltip-line-color;\\n }\\n\\n .custom-tooltip-container {\\n position: absolute;\\n }\\n }\\n\\n .grapher-context-menu {\\n position: absolute;\\n top: 0;\\n left: 0;\\n .menu-item {\\n\\n .menu-text {\\n user-select: all;\\n position: absolute;\\n top: 0;\\n background: $tooltip-background-color;\\n border: 1px solid $annotation-background-color;\\n color: $tooltip-text-color;\\n padding: 2px 4px;\\n max-width: max-content;\\n width: 200px;\\n }\\n }\\n }\\n\\n .grapher-draggable-points {\\n circle {\\n cursor: pointer;\\n }\\n }\\n\\n .grapher-vertical-lines {\\n line {\\n stroke: $vertical-line-color;\\n }\\n\\n polygon {\\n fill: $vertical-line-color;\\n }\\n }\\n\\n .grapher-annotations {\\n position: absolute;\\n top: 0;\\n pointer-events: none;\\n user-select: none;\\n z-index: 10;\\n\\n .grapher-annotation {\\n position: absolute;\\n\\n .annotation-marker {\\n display: inline-block;\\n background: $annotation-background-color;\\n }\\n\\n &.grapher-annotation-range {\\n .annotation-range-marker {\\n display: inline-block;\\n background-color: rgba(128, 128, 128, 0.2);\\n background-image: repeating-linear-gradient(53deg, #626266, #626266 1px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.1) 4px);\\n background-size: 40px 40px;\\n border-right: 1px solid white;\\n border-left: 1px solid white;\\n }\\n }\\n\\n .annotation-text {\\n position: absolute;\\n background: $tooltip-background-color;\\n border: 1px solid $annotation-background-color;\\n color: $tooltip-text-color;\\n padding: 2px 4px;\\n white-space: nowrap;\\n font-size: 10px;\\n z-index: 10;\\n }\\n }\\n }\\n\\n .bounds-selection {\\n position: absolute;\\n background: $range-graph-selection-range-color;\\n }\\n }\\n\\n .axis {\\n overflow: visible;\\n user-select: none;\\n\\n &.x-axis {\\n width: 1px;\\n height: $x-axis-height;\\n \\n &.x-axis-dual {\\n height: $x-axis-dual-height;\\n }\\n display: block;\\n }\\n\\n &.y-axis {\\n height: $primary-graph-body-height;\\n\\n .axis-item text {\\n text-anchor: end;\\n }\\n\\n .y-axis-label {\\n text-anchor: middle;\\n fill: $axis-text-color;\\n\\n &.y-axis-big-label {\\n font-size: 18px;\\n }\\n }\\n\\n .series-color-box {\\n cursor: pointer;\\n }\\n\\n &.y-axis-right {\\n .axis-item text {\\n text-anchor: start;\\n }\\n }\\n }\\n\\n .axis-line {\\n stroke: $axis-line-color;\\n stroke-width: $axis-line-width;\\n }\\n\\n .axis-item {\\n path {\\n stroke: $axis-tick-color;\\n stroke-width: 1px;\\n }\\n\\n text {\\n fill: $axis-text-color;\\n font-size: 8px;\\n }\\n\\n &.axis-item-major {\\n .axis-tick {\\n stroke-width: 1px;\\n }\\n }\\n\\n &.axis-item-big-labels {\\n text {\\n font-size: 16px;\\n }\\n }\\n }\\n }\\n\\n .wind-arrows {\\n color: $axis-text-color;\\n opacity: 0.7;\\n }\\n\\n .range-selection-graph {\\n width: 100%;\\n background-color: $range-graph-selection-background-color;\\n height: calc(#{$secondary-graph-body-height} + #{$range-graph-selection-bar-height}); \\n\\n .graph-body-secondary {\\n height: $secondary-graph-body-height;\\n\\n canvas {\\n height: 100%;\\n }\\n\\n svg {\\n position: absolute;\\n left: 0;\\n width: 100%;\\n overflow: visible;\\n\\n .target-selection {\\n fill: $range-graph-selection-range-color;\\n cursor: ew-resize;\\n }\\n\\n\\n .target-selection-outline {\\n stroke: $range-graph-selection-outline-color;\\n cursor: ew-resize;\\n fill: transparent;\\n }\\n\\n .selection-bar-track {\\n fill: $range-graph-selection-bar-track-color;\\n }\\n\\n .selection-bar {\\n fill: $range-graph-selection-bar-color;\\n cursor: ew-resize;\\n }\\n\\n .selection-bar-rifles {\\n stroke: $range-graph-selection-bar-rifles-color;\\n stroke-width: 1px;\\n cursor: ew-resize;\\n }\\n\\n .selection-bar-handle-hit {\\n cursor: ew-resize;\\n }\\n\\n .selection-bar-handle {\\n stroke: $range-graph-handle-color;\\n fill: $range-graph-handle-fill-color;\\n stroke-width: 1px;\\n cursor: ew-resize;\\n transition: stroke-width 0.15s ease, fill 0.15s ease;\\n }\\n\\n .selection-handle {\\n .selection-handle-hit {\\n cursor: ew-resize;\\n }\\n\\n .selection-handle-line {\\n stroke: $range-graph-handle-color;\\n stroke-width: 1;\\n transition: stroke-width 0.15s ease;\\n }\\n\\n &:hover .selection-handle-line {\\n stroke-width: 3;\\n }\\n\\n &.selection-handle-dragging .selection-handle-line {\\n stroke-width: 3;\\n }\\n\\n &:hover .selection-bar-handle {\\n stroke-width: 2px;\\n }\\n\\n &.selection-handle-dragging .selection-bar-handle {\\n stroke-width: 2px;\\n }\\n }\\n\\n .axis-item {\\n text {\\n fill: $range-graph-axis-text-color;\\n text-anchor: start;\\n font-size: 8px;\\n user-select: none;\\n dominant-baseline: text-after-edge;\\n }\\n\\n path {\\n stroke: $range-graph-axis-text-color;\\n stroke-width: 1px;\\n }\\n \\n &.axis-item-highlighted {\\n path {\\n stroke: $range-graph-tick-highlighted-color;\\n }\\n \\n text {\\n fill: $range-graph-text-highlighted-color;\\n }\\n }\\n }\\n }\\n }\\n }\\n\\n input, textarea {\\n background: transparent;\\n border: 1px solid $series-key-input-border-color;\\n margin: 2px 0;\\n color: $series-key-input-text-color;\\n padding: 1px 2px;\\n text-align: center;\\n\\n &:focus {\\n outline: none;\\n border-color: $series-key-input-selected-border-color;\\n }\\n }\\n\\n &.grapher-dragging-y {\\n .y-axis {\\n border: 2px dashed silver;\\n margin: -2px;\\n flex-shrink: 0;\\n\\n & + .y-axis {\\n border-left: none;\\n }\\n }\\n }\\n\\n &.grapher-fullscreen {\\n height: calc(100vh - 2*#{$padding});\\n }\\n\\n &.grapher-fixed-height {\\n .grapher-primary-container-outer {\\n height: 100%;\\n\\n .grapher-primary-container-body {\\n height: 100%;\\n display: flex;\\n flex-direction: column;\\n\\n .grapher-main-row {\\n flex-grow: 1;\\n\\n .central-container {\\n display: flex;\\n flex-direction: column;\\n height: 100%;\\n\\n > .graph-body {\\n flex-grow: 1;\\n height: unset;\\n }\\n }\\n\\n .axis.y-axis {\\n height: calc(100% - #{2*$x-axis-height});\\n }\\n }\\n }\\n }\\n }\\n\\n &.new-grapher {\\n height: auto;\\n border: 2px dashed silver;\\n text-align: center;\\n color: $new-grapher-color;\\n }\\n}\\n\\n@mixin grapher-theme-night (\\n $primary-graph-body-height: 400px,\\n $secondary-graph-body-height: 50px,\\n) {\\n @include grapher(\\n $primary-graph-body-height,\\n $secondary-graph-body-height\\n );\\n}\\n\\n@mixin grapher-theme-day (\\n $primary-graph-body-height: 400px,\\n $secondary-graph-body-height: 50px,\\n) {\\n @include grapher(\\n $primary-graph-body-height,\\n $secondary-graph-body-height,\\n\\n $background-color-1: #FFF,\\n $background-color-2: #FFF,\\n\\n $tooltip-line-color: invert(#CCC),\\n $tooltip-background-color: invert(rgba(0, 0, 0, 0.6)),\\n $tooltip-text-color: invert(#F0F0F0),\\n $vertical-line-color: invert(#CCC),\\n\\n $axis-line-color: #656565,\\n $axis-tick-color: #BFBFBF,\\n $axis-text-color: invert(#E0E0E3),\\n\\n $range-selection-text-color: #444,\\n $range-selection-button-color: white,\\n $range-selection-button-selected-color: white,\\n $range-selection-text-selected-color: black,\\n $range-selection-text-color-faded: #888,\\n $range-selection-button-color-faded: #EEE,\\n $range-selection-button-border: 1px dotted silver,\\n $range-selection-selected-button-border: 1px solid black,\\n\\n $range-graph-selection-background-color: rgba(255, 255, 255, 0.3),\\n $range-graph-selection-range-color: rgba(0, 0, 0, 0.02),\\n $range-graph-selection-outline-color: #333,\\n $range-graph-selection-bar-color: #B0B0B7,\\n $range-graph-selection-bar-track-color: #EEE,\\n $range-graph-selection-bar-rifles-color: #333,\\n $range-graph-selection-bar-height: 14px,\\n $range-graph-handle-color: #333,\\n $range-graph-handle-fill-color: #B0B0B7,\\n $range-graph-axis-text-color: #555,\\n $range-graph-tick-highlighted-color: #000,\\n $range-graph-text-highlighted-color: #000,\\n\\n $annotation-background-color: rgba(0, 0, 0, 0.3),\\n\\n $series-key-axis-container-color: #B0B0B7,\\n $series-key-input-border-color: #E0E0E3,\\n $series-key-input-selected-border-color: #505053,\\n $series-key-input-text-color: #222,\\n $series-key-background: null,\\n $series-key-shadow-color: black,\\n $scale-label-color: black,\\n\\n $title-color: black,\\n\\n $sidebar-background-color: #EEE,\\n $sidebar-text-color: #111,\\n\\n $new-grapher-color: #222\\n );\\n}\\n\\n@mixin grapher-theme-export (\\n $primary-graph-body-height: 400px,\\n $secondary-graph-body-height: 50px,\\n) {\\n @include grapher(\\n $primary-graph-body-height,\\n $secondary-graph-body-height,\\n\\n $background-color-1: #FFF,\\n $background-color-2: #FFF,\\n\\n $tooltip-line-color: invert(#CCC),\\n $tooltip-background-color: invert(rgba(0, 0, 0, 0.6)),\\n $tooltip-text-color: invert(#F0F0F0),\\n $vertical-line-color: invert(#CCC),\\n\\n $axis-line-color: black,\\n $axis-line-width: 1px,\\n $axis-tick-color: #BFBFBF,\\n $axis-text-color: black,\\n\\n $range-selection-text-color: #444,\\n $range-selection-button-color: white,\\n $range-selection-button-selected-color: white,\\n $range-selection-text-selected-color: black,\\n $range-selection-text-color-faded: #888,\\n $range-selection-button-color-faded: #EEE,\\n $range-selection-button-border: 1px dotted silver,\\n $range-selection-selected-button-border: 1px solid black,\\n\\n $range-graph-selection-background-color: rgba(255, 255, 255, 0.3),\\n $range-graph-selection-range-color: rgba(0, 0, 0, 0.02),\\n $range-graph-selection-outline-color: #333,\\n $range-graph-selection-bar-color: #B0B0B7,\\n $range-graph-selection-bar-track-color: #EEE,\\n $range-graph-selection-bar-rifles-color: #333,\\n $range-graph-selection-bar-height: 14px,\\n $range-graph-handle-color: #333,\\n $range-graph-handle-fill-color: #B0B0B7,\\n $range-graph-axis-text-color: #333,\\n $range-graph-tick-highlighted-color: #000,\\n $range-graph-text-highlighted-color: #000,\\n\\n $annotation-background-color: rgba(0, 0, 0, 0.3),\\n\\n $series-key-axis-container-color: #B0B0B7,\\n $series-key-input-border-color: #E0E0E3,\\n $series-key-input-selected-border-color: #505053,\\n $series-key-input-text-color: #222,\\n $series-key-background: null,\\n $series-key-shadow-color: black,\\n $scale-label-color: black,\\n\\n $title-color: black,\\n\\n $sidebar-background-color: #EEE,\\n $sidebar-text-color: #111,\\n\\n $new-grapher-color: #222\\n );\\n}\\n\\n.grapher-night {\\n @include grapher-theme-night();\\n}\\n\\n.grapher-day {\\n @include grapher-theme-day();\\n}\\n\\n.grapher-export {\\n @include grapher-theme-export();\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","\"use strict\";\n\nvar memo = {};\n\n/* istanbul ignore next */\nfunction getTarget(target) {\n if (typeof memo[target] === \"undefined\") {\n var styleTarget = document.querySelector(target);\n\n // Special case to return head of iframe instead of iframe itself\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n memo[target] = styleTarget;\n }\n return memo[target];\n}\n\n/* istanbul ignore next */\nfunction insertBySelector(insert, style) {\n var target = getTarget(insert);\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n target.appendChild(style);\n}\nmodule.exports = insertBySelector;","/**\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'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\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 };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bigint: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","module.exports = \"precision highp float;\\n\\nvarying vec4 trapBounds; // [x1, lineY1, x2, lineY2]\\nvarying vec4 trapBottom; // [x1, bottomY1, x2, bottomY2] \\nvarying vec2 worldPos; // World position\\n\\nuniform int gradientCount;\\nuniform sampler2D gradientTexture; // Texture containing gradient data\\nuniform vec4 fallbackColor;\\n\\nvec4 interpolateGradient(float position) {\\n if (gradientCount <= 0) {\\n return fallbackColor;\\n }\\n if (gradientCount == 1) {\\n return texture2D(gradientTexture, vec2(0.5 / float(gradientCount * 2), 0.5));\\n }\\n\\n float textureWidth = float(gradientCount * 2);\\n float firstStop = texture2D(gradientTexture, vec2(0.5 / textureWidth, 0.5)).r;\\n float lastStop = texture2D(gradientTexture, vec2((float((gradientCount - 1) * 2) + 0.5) / textureWidth, 0.5)).r;\\n \\n // Scale position to fit the gradient range\\n if (lastStop > firstStop) {\\n position = firstStop + position * (lastStop - firstStop);\\n }\\n \\n position = clamp(position, 0.0, 1.0);\\n\\n // Handle boundary cases first\\n vec4 firstColor = texture2D(gradientTexture, vec2(1.5 / textureWidth, 0.5));\\n vec4 lastColor = texture2D(gradientTexture, vec2((float((gradientCount - 1) * 2 + 1) + 0.5) / textureWidth, 0.5));\\n \\n if (position <= firstStop) return firstColor;\\n if (position >= lastStop) return lastColor;\\n \\n // Calculate normalized position within the gradient range\\n float normalizedPos = (position - firstStop) / max(lastStop - firstStop, 0.001);\\n normalizedPos = clamp(normalizedPos, 0.0, 1.0);\\n \\n // Map to segment index using only float operations\\n float segmentFloat = normalizedPos * float(gradientCount - 1);\\n float segmentIndex = floor(segmentFloat);\\n \\n // Ensure segment index is within valid bounds using float operations\\n segmentIndex = min(segmentIndex, float(gradientCount - 2));\\n segmentIndex = max(segmentIndex, 0.0);\\n \\n // Calculate texture coordinates for the two colors to interpolate\\n float texCoordA = (segmentIndex * 2.0 + 1.0 + 0.5) / textureWidth;\\n float texCoordB = ((segmentIndex + 1.0) * 2.0 + 1.0 + 0.5) / textureWidth;\\n \\n // Sample the two colors\\n vec4 colorA = texture2D(gradientTexture, vec2(texCoordA, 0.5));\\n vec4 colorB = texture2D(gradientTexture, vec2(texCoordB, 0.5));\\n \\n // Get the actual gradient stops for proper interpolation\\n float stopA = texture2D(gradientTexture, vec2((segmentIndex * 2.0 + 0.5) / textureWidth, 0.5)).r;\\n float stopB = texture2D(gradientTexture, vec2(((segmentIndex + 1.0) * 2.0 + 0.5) / textureWidth, 0.5)).r;\\n \\n // Calculate interpolation factor based on actual stop positions\\n float stopRange = stopB - stopA;\\n float t = stopRange > 0.001 ? (position - stopA) / stopRange : 0.0;\\n t = clamp(t, 0.0, 1.0);\\n \\n return mix(colorA, colorB, t);\\n}\\n\\nvoid main() {\\n float pixelX = worldPos.x;\\n float pixelY = worldPos.y;\\n \\n // Extract trapezoid corners\\n float x1 = trapBounds.x;\\n float lineY1 = trapBounds.y;\\n float x2 = trapBounds.z;\\n float lineY2 = trapBounds.w;\\n \\n float bottomX1 = trapBottom.x;\\n float bottomY1 = trapBottom.y;\\n float bottomX2 = trapBottom.z;\\n float bottomY2 = trapBottom.w;\\n \\n // Interpolate line Y at current pixel X\\n float t = (pixelX - x1) / (x2 - x1 + 0.001); // Avoid division by zero\\n t = clamp(t, 0.0, 1.0);\\n \\n float lineYAtPixel = mix(lineY1, lineY2, t);\\n float bottomYAtPixel = mix(bottomY1, bottomY2, t);\\n \\n // Calculate gradient position: 0.0 at line, 1.0 at bottom\\n float totalDistance = abs(bottomYAtPixel - lineYAtPixel);\\n float gradientPos = totalDistance > 0.001 ? \\n abs(pixelY - lineYAtPixel) / totalDistance : 0.0;\\n \\n vec4 color = interpolateGradient(gradientPos);\\n gl_FragColor = color;\\n}\\n\"","module.exports = \"precision highp float;\\n\\nattribute vec2 position;\\n\\nvoid main() {\\n gl_Position = vec4((position - 0.5)*2.0, 0.0, 1.0);\\n}\\n\"","module.exports = \"precision mediump float;\\n\\nattribute vec2 position;\\n\\nuniform float width;\\nuniform float height;\\nuniform float pointSize;\\n\\nvoid main() {\\n gl_Position = vec4(2.0*position.x/width - 1.0, 1.0 - 2.0*position.y/height, 0.0, 1.0);\\n gl_PointSize = pointSize;\\n}\"","\"use strict\";\n\n/* istanbul ignore next */\nfunction apply(styleElement, options, obj) {\n var css = \"\";\n if (obj.supports) {\n css += \"@supports (\".concat(obj.supports, \") {\");\n }\n if (obj.media) {\n css += \"@media \".concat(obj.media, \" {\");\n }\n var needLayer = typeof obj.layer !== \"undefined\";\n if (needLayer) {\n css += \"@layer\".concat(obj.layer.length > 0 ? \" \".concat(obj.layer) : \"\", \" {\");\n }\n css += obj.css;\n if (needLayer) {\n css += \"}\";\n }\n if (obj.media) {\n css += \"}\";\n }\n if (obj.supports) {\n css += \"}\";\n }\n var sourceMap = obj.sourceMap;\n if (sourceMap && typeof btoa !== \"undefined\") {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n }\n\n // For old IE\n /* istanbul ignore if */\n options.styleTagTransform(css, styleElement, options.options);\n}\nfunction removeStyleElement(styleElement) {\n // istanbul ignore if\n if (styleElement.parentNode === null) {\n return false;\n }\n styleElement.parentNode.removeChild(styleElement);\n}\n\n/* istanbul ignore next */\nfunction domAPI(options) {\n if (typeof document === \"undefined\") {\n return {\n update: function update() {},\n remove: function remove() {}\n };\n }\n var styleElement = options.insertStyleElement(options);\n return {\n update: function update(obj) {\n apply(styleElement, options, obj);\n },\n remove: function remove() {\n removeStyleElement(styleElement);\n }\n };\n}\nmodule.exports = domAPI;","module.exports = \"precision highp float;\\n\\nattribute vec2 position;\\nattribute vec4 trapezoidBounds; // [x1, y1_line, x2, y2_line] - the line segment \\nattribute vec4 trapezoidBottom; // [x1, y1_bottom, x2, y2_bottom] - the bottom segment\\n\\nuniform float width;\\nuniform float height;\\n\\nvarying vec4 trapBounds; // Pass trapezoid line bounds to fragment\\nvarying vec4 trapBottom; // Pass trapezoid bottom bounds to fragment \\nvarying vec2 worldPos; // Pass world position\\n\\nvoid main() {\\n trapBounds = trapezoidBounds;\\n trapBottom = trapezoidBottom;\\n worldPos = position;\\n \\n gl_Position = vec4(2.0*position.x/width - 1.0, 1.0 - 2.0*position.y/height, 0.0, 1.0);\\n}\\n\"","/**\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'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".bundle.cjs\";\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.p = \"/assets/\";","__webpack_require__.b = (typeof document !== 'undefined' && document.baseURI) || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t792: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunkGrapher\"] = globalThis[\"webpackChunkGrapher\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","__webpack_require__.nc = undefined;","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react\");","export const SIMPLE_DATA_TYPES = [\n 'values',\n 'tuples',\n 'objects'\n];\n\nexport const COMPLEX_DATA_TYPES = [\n 'tuple_observable',\n 'object_observable',\n 'generator'\n];\n\nexport const DATA_TYPES = [...SIMPLE_DATA_TYPES, ...COMPLEX_DATA_TYPES];\n","import PropTypes from 'prop-types';\nimport {DATA_TYPES} from '../state/data_types';\n\n// checking the shape of data is slow if there's a lot of it\n// it can be convenient in development, but should not be done when testing high cardinality data\nconst ENABLE_DATA_CHECK = false;\n\nconst PointY = function (props, propName) {\n if (typeof props[propName] !== 'number' && props[propName] !== null) {\n return new Error(`${propName} needs to be a number or null`);\n }\n\n return null;\n};\n\nconst PointTuple = function (props, propName) {\n if (!Array.isArray(props) || props.length !== 2) { // eslint-disable-line react/prop-types\n return new Error(`${propName} needs to be an array of length two`);\n }\n\n const [x, y] = props;\n if (typeof x !== 'number' && !(x instanceof Date)) {\n return new Error(`${propName}.x needs to be a number or date`);\n }\n\n if (typeof y !== 'number' && y !== null) {\n return new Error(`${propName}.y needs to be a number or null`);\n }\n\n return null;\n};\n\nconst Data = ENABLE_DATA_CHECK ? PropTypes.oneOfType([\n PropTypes.arrayOf(PointY), // values\n PropTypes.arrayOf(PropTypes.arrayOf(PointTuple)), // tuples\n PropTypes.arrayOf(PropTypes.object), // objects\n PropTypes.shape({ observe: PropTypes.func.isRequired }), // observable\n PropTypes.func // generator function\n]) : PropTypes.any;\n\nconst SingleSeries = PropTypes.shape({\n data: Data.isRequired,\n type: PropTypes.oneOf([\n ...DATA_TYPES,\n 'infer'\n ]),\n xKey: PropTypes.string,\n yKey: PropTypes.string,\n windXKey: PropTypes.string,\n windYKey: PropTypes.string,\n windComp: PropTypes.elementType,\n xUnixDates: PropTypes.bool,\n color: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n name: PropTypes.string,\n xLabel: PropTypes.string,\n yLabel: PropTypes.string,\n ignoreDiscontinuities: PropTypes.bool,\n dashed: PropTypes.bool,\n dashPattern: PropTypes.arrayOf(PropTypes.number),\n width: PropTypes.number,\n rangeSelectorWidth: PropTypes.number,\n axis: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),\n expandYWith: PropTypes.arrayOf(PropTypes.number),\n defaultAlwaysTooltipped: PropTypes.bool,\n followingMouseTooltip: PropTypes.bool,\n square: PropTypes.bool,\n shiftXBy: PropTypes.number,\n graph: PropTypes.number, // affects multigrapher only\n background: PropTypes.object,\n hideFromKey: PropTypes.bool,\n showIndividualPoints: PropTypes.bool,\n minPointSpacing: PropTypes.number,\n rendering: PropTypes.oneOf(['line', 'bar', 'area', 'shadow']), // defaults to line\n negativeColor: PropTypes.string, // colors lines and points below zero for all renderings\n gradient: PropTypes.array, // only applies to area and shadow\n negativeGradient: PropTypes.array, // gradient for values below zero (area and shadow)\n zeroLineWidth: PropTypes.number, // only applies to bar and area\n zeroLineColor: PropTypes.string, // only applies to bar and area\n zeroLineY: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), // only applies to bar and area\n pointRadius: PropTypes.number, // only applies to area\n tooltipWidth: PropTypes.number,\n hasAreaBottom: PropTypes.bool,\n shadowColor: PropTypes.string,\n gradient: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.array])), // gradient colors or [position, color] pairs\n rangeKey: PropTypes.string\n});\n\nconst Series = PropTypes.arrayOf(SingleSeries);\n\nconst Axis = PropTypes.shape({\n axisIndex: PropTypes.number.isRequired,\n series: PropTypes.array.isRequired,\n side: PropTypes.oneOf(['left', 'right']).isRequired,\n scale: PropTypes.oneOf(['linear', 'log']).isRequired,\n label: PropTypes.string\n});\n\nconst Axes = PropTypes.arrayOf(Axis);\n\nconst CustomBoundsSelector = PropTypes.shape({\n label: PropTypes.string.isRequired,\n calculator: PropTypes.func.isRequired,\n datesOnly: PropTypes.bool\n});\n\nconst CustomBoundsSelectors = PropTypes.arrayOf(CustomBoundsSelector);\n\nconst TooltipOptionsRaw = {\n includeSeriesLabel: PropTypes.bool,\n includeXLabel: PropTypes.bool,\n includeYLabel: PropTypes.bool,\n includeXValue: PropTypes.bool,\n includeYValue: PropTypes.bool,\n floating: PropTypes.bool,\n alwaysFixedPosition: PropTypes.bool,\n floatPosition: PropTypes.oneOf(['top', 'bottom']),\n floatDelta: PropTypes.number,\n savingDisabled: PropTypes.bool,\n customTooltip: PropTypes.func,\n combineTooltips: PropTypes.oneOfType([PropTypes.bool, PropTypes.number])\n};\n\nconst TooltipOptions = PropTypes.shape(TooltipOptionsRaw);\n\nconst Annotation = PropTypes.shape({\n x: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.instanceOf(Date)]),\n startX: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.instanceOf(Date)]),\n endX: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.instanceOf(Date)]),\n series: PropTypes.arrayOf(PropTypes.string),\n content: PropTypes.string,\n lineOnly: PropTypes.bool\n});\nconst Annotations = PropTypes.arrayOf(Annotation);\n\nconst DraggablePoint = PropTypes.shape({\n x: PropTypes.number.isRequired,\n y: PropTypes.number.isRequired,\n radius: PropTypes.number,\n fillColor: PropTypes.string,\n strokeColor: PropTypes.string,\n strokeWidth: PropTypes.number,\n onClick: PropTypes.func,\n onDoubleClick: PropTypes.func\n});\nconst DraggablePoints = PropTypes.arrayOf(DraggablePoint);\n\nconst VerticalLine = PropTypes.shape({\n x: PropTypes.oneOfType([PropTypes.number, PropTypes.instanceOf(Date)]).isRequired,\n color: PropTypes.string,\n lineTop: PropTypes.number,\n width: PropTypes.number,\n markTop: PropTypes.bool,\n style: PropTypes.object,\n markerStyle: PropTypes.object,\n text: PropTypes.string,\n textTop: PropTypes.number,\n textStyle: PropTypes.object,\n minPixelX: PropTypes.number,\n maxPixelX: PropTypes.number,\n onRangeGraph: PropTypes.oneOfType([\n PropTypes.bool,\n PropTypes.object // anything that can be passed into the overall vertical line\n ]),\n onRangeGraphOnly: PropTypes.bool\n});\nconst VerticalLines = PropTypes.arrayOf(VerticalLine);\n\nconst CustomPropTypes = {\n Data,\n SingleSeries,\n Series,\n Axis,\n Axes,\n CustomBoundsSelector,\n CustomBoundsSelectors,\n TooltipOptions,\n TooltipOptionsRaw,\n Annotations,\n DraggablePoint,\n DraggablePoints,\n VerticalLine,\n VerticalLines\n};\n\n\nexport default CustomPropTypes;\n","export default class Eventable {\n\n constructor() {\n this._listeners = {};\n }\n\n /**\n * Clears all listeners\n * @protected\n */\n clearListeners() {\n this._listeners = {};\n }\n\n /**\n * Create a new listener for the event\n * When the event is emitted, it will call the provided function\n *\n * @param {String|symbol} eventName - the name of the event to start listening to\n * @param {Function} fn - the listener to add\n */\n on(eventName, fn) {\n this._listeners[eventName] = this._listeners[eventName] || new Set();\n this._listeners[eventName].add(fn);\n }\n\n /**\n * Removes an existing listener for the event\n *\n * @param {String|symbol} eventName - the name of the event to stop listening to\n * @param {Function} fn - the listener to remove\n */\n off(eventName, fn) {\n if (!this._listeners[eventName]) {\n return;\n }\n\n this._listeners[eventName].delete(fn);\n\n if (this._listeners[eventName].size === 0) {\n delete this._listeners[eventName];\n }\n }\n\n /**\n * Emits an event that will go out to all _listeners on eventName\n *\n * @param {String|symbol} eventName - the name of the event to emit\n */\n emit(eventName) {\n if (!this._listeners[eventName]) {\n return;\n }\n\n const args = [];\n for (let i = 1; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n\n this._listeners[eventName].forEach((fn) => {\n fn.apply(this, args);\n });\n }\n\n}\n","import {extractYValue} from '../helpers/flatten_simple_data.js';\n\n/**\n * Given a series object, figures out the form of the data\n * Note that this is not a validator, nor is it guaranteed to get it right 100% of the time!\n * If it is giving the wrong type, it is recommended to specify the type manually\n *\n * @param {*} series\n * @param {Boolean} options.useSimpleData\n * @param {Array} options.data\n * @return {String}\n */\nexport default function inferType(series, options={ useSimpleData: false }) {\n if (series.type && series.type !== 'infer') {\n return series.type;\n }\n\n const data = options.data || (options.useSimpleData ? (series.simpleData || series.data) : series.data);\n\n if (!data) {\n throw new Error('Data must be provided');\n }\n\n if (Array.isArray(data)) {\n if (data.length === 0) {\n return 'tuples';\n }\n\n if (Array.isArray(data[0])) {\n return 'tuples';\n }\n\n if (typeof data[0] === 'number' || !data[0]) {\n return 'values';\n }\n\n return 'objects';\n }\n\n if (data.observe) {\n if (series.xKey) {\n return 'object_observable';\n } else {\n return 'tuple_observable';\n }\n }\n\n if (typeof data === 'function') {\n return 'generator';\n }\n\n throw new Error('Could not infer type');\n}\n\n/**\n *\n * @param simpleData\n * @param singleSeries\n * @return {boolean}\n */\nexport function isEnumLike(simpleData, singleSeries) {\n for (let i = 0; i < simpleData.length; i++) {\n const y = extractYValue(simpleData[simpleData.length - 1], singleSeries);\n if (y === null || y === undefined) {\n continue;\n }\n\n if (typeof y === 'string') {\n return true;\n }\n }\n\n return false;\n}\n","/**\n * Returns the color as a [r, g, b, a] array with domain 0 to 1 for use in webgl\n *\n * @param color\n * @return {[number, number, number, number]|[number, number, number, number]}\n */\nexport default function colorToVector(color) {\n if (color === 'black') {\n color = '#000000';\n } else if (color === 'white') {\n color = '#FFFFFF';\n } else if (color === 'transparent') {\n return [0, 0, 0, 0];\n }\n\n if (color.startsWith('rgb')) {\n const parts = color.split(',').map((part) => parseFloat(part.match(/\\d+(\\.\\d+)?/)[0]));\n return [\n parts[0]/255,\n parts[1]/255,\n parts[2]/255,\n parts.length >= 4 ? parts[3] : 1\n ];\n }\n\n if (typeof color !== 'string' || !/^#[\\dA-F]{3}$|^#[\\dA-F]{6}$/i.test(color)) {\n throw new Error(`Color must be a hex string: ${color}`);\n }\n\n // support for short hex codes, expanding 3-digit hex to 6-digit\n if (color.length === 4) {\n color = '#' + color[1] + color[1] + color[2] + color[2] + color[3] + color[3];\n }\n\n const r = parseInt(color.substr(1, 2), 16)/255;\n const g = parseInt(color.substr(3, 2), 16)/255;\n const b = parseInt(color.substr(5, 2), 16)/255;\n const a = 1.0;\n return [r, g, b, a];\n}\n","/**\n * Creates a webgl program, linking the shaders and checking for errors\n *\n * @param gl\n * @param vertShaderSource\n * @param fragShaderSource\n * @return {WebGLProgram}\n */\nexport default function createGLProgram(gl, vertShaderSource, fragShaderSource) {\n const vertexShader = gl.createShader(gl.VERTEX_SHADER);\n gl.shaderSource(vertexShader, vertShaderSource);\n gl.compileShader(vertexShader);\n if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) {\n console.error(gl.getShaderInfoLog(vertexShader)); // eslint-disable-line no-console\n return null;\n }\n\n const fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n gl.shaderSource(fragmentShader, fragShaderSource);\n gl.compileShader(fragmentShader);\n if (!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)) {\n console.error(gl.getShaderInfoLog(fragmentShader)); // eslint-disable-line no-console\n return null;\n }\n\n const program = gl.createProgram();\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n\n gl.linkProgram(program);\n \n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n console.error('Shader program linking failed:', gl.getProgramInfoLog(program));\n return null;\n }\n\n gl.validateProgram(program);\n if (!gl.getProgramParameter(program, gl.VALIDATE_STATUS)) {\n console.error('Shader program validation failed:', gl.getProgramInfoLog(program));\n return null;\n }\n\n return program;\n}\n","import backgroundFrag from './background.frag';\nimport backgroundVert from './background.vert';\nimport colorToVector from '../helpers/color_to_vector';\nimport createGLProgram from './create_gl_program';\n\nexport default class BackgroundProgram {\n\n constructor(gl) {\n this._gl = gl;\n\n this._program = createGLProgram(gl, backgroundVert, backgroundFrag);\n\n this._vertexBuffer = gl.createBuffer();\n this._indexBuffer = gl.createBuffer();\n\n if (!gl.getExtension('OES_element_index_uint')) {\n console.error('Your browser does not support OES_element_index_uint'); // eslint-disable-line no-console\n }\n }\n\n draw({ data }) {\n const gl = this._gl;\n gl.useProgram(this._program);\n\n // gl.disable(gl.DEPTH_TEST);\n\n for (let { minXt, maxXt, color } of data) {\n gl.uniform4f(gl.getUniformLocation(this._program, 'color'), ...colorToVector(color));\n\n const vertices = new Float32Array([\n minXt, 1, maxXt, 1, maxXt, -1,\n minXt, 1, maxXt, -1, minXt, -1\n ]);\n\n gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n\n const positionLocation = gl.getAttribLocation(this._program, 'position');\n gl.enableVertexAttribArray(positionLocation);\n gl.vertexAttribPointer(positionLocation, 2, gl.FLOAT, false, 0, 0);\n\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n }\n }\n\n}\n","export const DPI_INCREASE = 2;\n\n/**\n * Sizes the canvas such that rendering is pixel perfect\n * Returns the sizing information\n *\n * @param {HTMLCanvasElement} canvas\n * @param {CanvasRenderingContext2D} context\n * @param {Boolean} reset - if true, will reset the canvas size before checking sizing\n * @return {Promise<{boundingRect: DOMRect, pixelRatio: number, elementHeight: number, renderWidth: number, renderHeight: number, elementWidth: number}>}\n */\nexport default async function sizeCanvas(canvas, context, {reset=true}={}) {\n if (reset) {\n canvas.width = '';\n canvas.height = '';\n canvas.style.width = '0';\n canvas.style.height = '';\n\n await new Promise((resolve) => requestAnimationFrame(resolve));\n }\n\n let boundingRect = canvas.parentNode.getBoundingClientRect();\n\n while (boundingRect.width === 0) {\n await new Promise((resolve) => requestAnimationFrame(resolve));\n boundingRect = canvas.getBoundingClientRect();\n }\n\n const dpr = window.devicePixelRatio || 1;\n const bsr = context.webkitBackingStorePixelRatio ||\n context.mozBackingStorePixelRatio ||\n context.msBackingStorePixelRatio ||\n context.oBackingStorePixelRatio ||\n context.backingStorePixelRatio || 1;\n\n const pixelRatio = DPI_INCREASE*dpr / bsr;\n\n const elementWidth = boundingRect.width;\n const elementHeight = boundingRect.height;\n const renderWidth = elementWidth * pixelRatio;\n const renderHeight = elementHeight * pixelRatio;\n\n canvas.width = renderWidth;\n canvas.height = renderHeight;\n canvas.style.width = `${elementWidth}px`;\n canvas.style.height = `${elementHeight}px`;\n\n // We could us this to make coordinates behave as if they weren't transformed if we wanted\n // context.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0)\n\n return {\n pixelRatio,\n elementWidth,\n elementHeight,\n renderWidth,\n renderHeight,\n boundingRect\n };\n}\n","import {DPI_INCREASE} from './size_canvas';\n\n/**\n * Returns an array of contiguous paths from data in render space\n *\n * @param {{nullMask: Uint8Array, maxYValues: Float64Array, minYValues: Float64Array, yValues: Float64Array}} dataInRenderSpace\n * @param {Object} options\n * @param {Number} options.splitAtY - split the path whenever it's suddenly less or greater than this value\n * @return {[[Number]]}\n */\nexport default function pathsFrom(dataInRenderSpace, {splitAtY}={}) {\n const paths = [];\n let currentPath = [];\n let previouslyDiscontinuous = true;\n\n const { nullMask, maxYValues, minYValues, yValues } = dataInRenderSpace;\n\n for (let i = 0; i < yValues.length; i++) {\n const x = i*DPI_INCREASE;\n const y = yValues[i];\n\n if (nullMask[i] & 0b001) { // y null\n if (!previouslyDiscontinuous) {\n paths.push(currentPath);\n currentPath = [];\n }\n\n previouslyDiscontinuous = true;\n continue;\n }\n\n currentPath.push([x, y]);\n\n const minY = minYValues[i];\n const maxY = maxYValues[i];\n\n if (minY !== maxY) {\n if (!(nullMask[i] & 0b010)) {\n currentPath.push([x, minY]);\n }\n\n if (!(nullMask[i] & 0b100)) {\n currentPath.push([x, maxY]);\n }\n currentPath.push([x, y]);\n }\n\n previouslyDiscontinuous = false;\n\n if (typeof splitAtY === 'number' && i > 0) {\n const prevY = yValues[i-1];\n const signFlipped = !(nullMask[i-1] & 0b001) && (prevY < splitAtY && y >= splitAtY) || (prevY > splitAtY && y <= splitAtY) || (prevY === splitAtY && y !== splitAtY);\n\n if (signFlipped) {\n if (!previouslyDiscontinuous) {\n paths.push(currentPath);\n currentPath = [\n [x, y]\n ];\n }\n\n previouslyDiscontinuous = true;\n }\n }\n }\n\n if (!previouslyDiscontinuous) {\n paths.push(currentPath);\n }\n\n return paths;\n}\n","/**\n * Draws a horizontal line at the specified y-coordinate.\n *\n * @param {Number} y\n * @param {Object} options\n * @param {CanvasRenderingContext2D} options.context\n * @param {{renderWidth: Number, renderHeight: Number}} options.sizing\n * @param {String} options.color\n * @param {String} options.zeroColor\n * @param {Number} options.zeroWidth\n */\nexport function drawZeroLine(y, { context, sizing, color, zeroColor, zeroWidth}) {\n if (!zeroWidth) {\n return;\n }\n\n if (!context) {\n console.error('Canvas context is null in drawZeroLine');\n return;\n }\n\n context.strokeStyle = zeroColor || color;\n context.lineWidth = zeroWidth;\n\n context.beginPath();\n context.moveTo(0, y);\n context.lineTo(sizing.renderWidth, y);\n context.stroke();\n}\n","import pathsFrom from \"./paths_from\";\nimport { drawZeroLine } from \"./draw_zero_line\";\nimport { DPI_INCREASE } from \"./size_canvas\";\nimport { applyReducedOpacity, applyReducedOpacityToGradient } from \"../helpers/colors\";\n\n/**\n * Draws the data on the canvas\n * Assumes the data is in individual point render space, ie x and y in pixels\n *\n * @param {Array<[number, number]>} individualPoints - data to draw\n * @param {Object} dataInRenderSpace\n * @param {Object} options - set of options\n * @param {Object} options.context - the context to draw on\n * @param {String} options.color - color of the bar to draw\n * @param {{renderWidth: Number, renderHeight: Number}} options.sizing - size of the canvas, in pixels\n * @param {Number} options.zero - y coordinate that represents \"zero\"\n * @param {Boolean} options.hasNegatives - if any values are negative (in which case should render from zero)\n * @param {Array<String>} [options.gradient] - an array of stops, from top to bottom of canvas, to draw with\n * @param {String} [options.zeroColor] - color of the zero line\n * @param {Number} [options.zeroWidth] - width of the zero line\n * @param {Boolean} [options.showIndividualPoints] - draw circles at each point\n * @param {String} [options.negativeColor] - color of the area below zero\n * @param {Number} [options.width] - line width\n * @param {Object} [options.inRenderSpaceAreaBottom] - if provided, will use this as the area bottom instead of zero/sizing.renderHeight\n * @private\n */\nexport default function drawArea(\n individualPoints,\n dataInRenderSpace,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n negativeGradient,\n zeroColor,\n zeroWidth,\n showIndividualPoints,\n negativeColor,\n pointRadius,\n minPointSpacing,\n width,\n highlighted,\n shadowColor = \"black\",\n shadowBlur = 5,\n inRenderSpaceAreaBottom,\n cutoffIndex,\n cutoffOpacity,\n originalData,\n renderCutoffGradient,\n selectionBounds,\n isPreview,\n }\n) {\n if (!context) {\n console.error(\"Canvas context is null in drawArea\");\n return;\n }\n\n context.fillStyle = color;\n context.shadowColor = shadowColor;\n context.shadowBlur = shadowBlur;\n\n if (gradient && gradient.length >= 2) {\n const globalGradient = context.createLinearGradient(\n 0,\n 0,\n 0,\n sizing.renderHeight\n );\n\n for (let i = 0; i < gradient.length; i++) {\n const value = gradient[i];\n if (Array.isArray(value)) {\n globalGradient.addColorStop(value[0], value[1]);\n } else {\n globalGradient.addColorStop(i / (gradient.length - 1), value);\n }\n }\n\n context.fillStyle = globalGradient;\n\n if (color === \"gradient\") {\n context.strokeStyle = globalGradient;\n }\n } else {\n context.fillStyle = color;\n }\n\n if (!individualPoints.length) {\n return;\n }\n\n // we want to draw a polygon with a flat line at areaBottom, and then follows the shape of the data\n const areaBottom = hasNegatives ? zero : sizing.renderHeight;\n\n const shouldSplitAreaPaths = hasNegatives && negativeGradient;\n const areaPaths = pathsFrom(dataInRenderSpace, shouldSplitAreaPaths ? { splitAtY: zero } : undefined);\n const areaBottomPaths =\n inRenderSpaceAreaBottom && pathsFrom(inRenderSpaceAreaBottom, shouldSplitAreaPaths ? { splitAtY: zero } : undefined);\n\n const linePaths = pathsFrom(dataInRenderSpace, {\n splitAtY: zero,\n });\n\n if (renderCutoffGradient && cutoffIndex !== undefined && originalData) {\n drawAreaWithCutoff(\n individualPoints,\n areaPaths,\n areaBottomPaths,\n linePaths,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n showIndividualPoints,\n negativeColor,\n pointRadius,\n width,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n cutoffIndex,\n cutoffOpacity,\n originalData,\n selectionBounds,\n isPreview,\n }\n );\n return;\n }\n\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n context.beginPath();\n\n const [firstX, _startY] = path[0];\n const [lastX, _lastY] = path[path.length - 1];\n\n if (!areaBottomPaths) {\n context.moveTo(firstX, areaBottom);\n }\n\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n context.lineTo(x, y);\n }\n\n if (areaBottomPath && areaBottomPath.length) {\n for (let i = areaBottomPath.length - 1; i >= 0; i--) {\n const [x, y] = areaBottomPath[i];\n context.lineTo(x, y);\n }\n\n context.lineTo(...path[0]);\n } else {\n context.lineTo(lastX, areaBottom);\n }\n\n context.fill();\n }\n\n if (highlighted) {\n width += 2;\n }\n\n width *= DPI_INCREASE;\n context.strokeStyle = color;\n context.lineWidth = width;\n\n for (let path of linePaths) {\n if (!path.length) {\n continue;\n }\n\n if (hasNegatives && negativeColor) {\n let positive = true;\n if (path.length >= 2) {\n positive = path[1][1] <= zero;\n } else {\n positive = path[0][1] <= zero;\n }\n\n if (positive) {\n context.strokeStyle = color;\n } else {\n context.strokeStyle = negativeColor;\n }\n } else {\n context.strokeStyle = color;\n }\n\n context.beginPath();\n\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n\n context.stroke();\n }\n\n if (zeroWidth) {\n drawZeroLine(areaBottom, {\n context,\n sizing,\n color,\n zero,\n zeroColor,\n zeroWidth,\n });\n }\n\n if (showIndividualPoints && !renderCutoffGradient) {\n // Apply point spacing for individual point circles only\n function applyPointSpacing(points, minSpacing) {\n if (!minSpacing || points.length <= 1) {\n return points;\n }\n \n const spacedPoints = [];\n let lastX = -Infinity;\n \n for (const point of points) {\n const [x] = point;\n if (x - lastX >= minSpacing) {\n spacedPoints.push(point);\n lastX = x;\n }\n }\n \n return spacedPoints;\n }\n\n const pointsToRender = applyPointSpacing(individualPoints, minPointSpacing);\n for (let [x, y] of pointsToRender) {\n // Determine the color for this point\n let pointColor = color;\n if (negativeColor && hasNegatives) {\n if (y === zero && zeroColor) {\n pointColor = zeroColor;\n } else if (y < zero) {\n pointColor = color;\n } else {\n pointColor = negativeColor;\n }\n }\n \n context.fillStyle = pointColor;\n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n }\n}\n\n/**\n * Draws the data on the canvas with cutoff\n * Assumes the data is in individual point render space, ie x and y in pixels\n *\n * @param {Array<[number, number]>} individualPoints - data to draw\n * @param {Object} options - set of options\n * @param {Object} options.context - the context to draw on\n * @param {String} options.color - color of the area to draw\n * @param {{renderWidth: Number, renderHeight: Number}} options.sizing - size of the canvas, in pixels\n * @param {Number} options.zero - y coordinate that represents \"zero\"\n * @param {Boolean} options.hasNegatives - if any values are negative (in which case should render from zero)\n * @param {Array<String>} [options.gradient] - an array of stops, from top to bottom of canvas, to draw with\n * @param {String} [options.zeroColor] - color of the zero line\n * @param {Number} [options.zeroWidth] - width of the zero line\n * @param {Boolean} [options.showIndividualPoints] - draw circles at each point\n * @param {String} [options.negativeColor] - color of the area below zero\n * @param {Number} [options.width] - line width\n * @param {Object} [options.inRenderSpaceAreaBottom] - if provided, will use this as the area bottom instead of zero/sizing.renderHeight\n * @private\n */\nfunction drawAreaWithCutoff(\n individualPoints,\n areaPaths,\n areaBottomPaths,\n linePaths,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n showIndividualPoints,\n negativeColor,\n pointRadius,\n width,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n cutoffIndex,\n cutoffOpacity,\n originalData,\n selectionBounds,\n isPreview,\n }\n) {\n let cutoffTime;\n if (typeof originalData[0] === \"object\" && originalData[0].length === 2) {\n const baseIndex = Math.floor(cutoffIndex);\n const fraction = cutoffIndex - baseIndex;\n\n if (fraction === 0 || baseIndex >= originalData.length - 1) {\n const cutoffDate =\n originalData[Math.min(baseIndex, originalData.length - 1)][0];\n cutoffTime =\n cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n } else {\n const currentDate = originalData[baseIndex][0];\n const nextDate = originalData[baseIndex + 1][0];\n const currentTime =\n currentDate instanceof Date ? currentDate.getTime() : currentDate;\n const nextTime = nextDate instanceof Date ? nextDate.getTime() : nextDate;\n cutoffTime = currentTime + fraction * (nextTime - currentTime);\n }\n } else {\n cutoffTime = cutoffIndex;\n }\n\n let firstTime, lastTime;\n if (isPreview && selectionBounds) {\n firstTime = selectionBounds.minX instanceof Date ? selectionBounds.minX.getTime() : selectionBounds.minX;\n lastTime = selectionBounds.maxX instanceof Date ? selectionBounds.maxX.getTime() : selectionBounds.maxX;\n } else {\n firstTime = originalData[0][0] instanceof Date ? originalData[0][0].getTime() : originalData[0][0];\n lastTime = originalData[originalData.length - 1][0] instanceof Date ? \n originalData[originalData.length - 1][0].getTime() : originalData[originalData.length - 1][0];\n }\n\n const timeRatio = (cutoffTime - firstTime) / (lastTime - firstTime);\n\n if (timeRatio < 0) {\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n renderEntireArea(path, areaBottomPath, {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n } else if (timeRatio > 1) {\n const reducedOpacityGradient = gradient\n ? applyReducedOpacityToGradient(gradient, cutoffOpacity)\n : null;\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n renderEntireArea(path, areaBottomPath, {\n color: applyReducedOpacity(color, cutoffOpacity),\n context,\n sizing,\n zero,\n hasNegatives,\n gradient: reducedOpacityGradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n } else {\n if (isPreview) {\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n if (!path.length) {\n continue;\n }\n\n const renderCutoffIndex = timeRatio * path.length;\n const splitIndex = Math.floor(renderCutoffIndex);\n const fraction = renderCutoffIndex - splitIndex;\n\n let ghostPoint = null;\n if (splitIndex < path.length - 1 && fraction > 0) {\n const [x1, y1] = path[splitIndex];\n const [x2, y2] = path[splitIndex + 1];\n ghostPoint = [x1 + fraction * (x2 - x1), y1 + fraction * (y2 - y1)];\n }\n\n const shouldRenderPre =\n splitIndex > 0 || (splitIndex === 0 && fraction > 0);\n\n if (shouldRenderPre) {\n const preCutoffPath = path.slice(0, splitIndex + 1);\n if (ghostPoint && splitIndex < path.length - 1) {\n preCutoffPath.push(ghostPoint);\n }\n\n const preCutoffAreaBottomPath = areaBottomPath\n ? areaBottomPath.slice(0, splitIndex + 1)\n : null;\n if (\n ghostPoint &&\n preCutoffAreaBottomPath &&\n splitIndex < areaBottomPath.length - 1\n ) {\n const bottomGhostPoint = [ghostPoint[0], zero];\n preCutoffAreaBottomPath.push(bottomGhostPoint);\n }\n\n const reducedOpacityGradient = gradient\n ? applyReducedOpacityToGradient(gradient, cutoffOpacity)\n : null;\n renderEntireArea(preCutoffPath, preCutoffAreaBottomPath, {\n color: applyReducedOpacity(color, cutoffOpacity),\n context,\n sizing,\n zero,\n hasNegatives,\n gradient: reducedOpacityGradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n\n const shouldRenderPost =\n splitIndex < path.length - 1 ||\n (splitIndex === path.length - 1 && fraction === 0);\n\n if (shouldRenderPost) {\n const postCutoffPath = [];\n if (ghostPoint && splitIndex < path.length - 1) {\n postCutoffPath.push(ghostPoint);\n }\n postCutoffPath.push(...path.slice(splitIndex + 1));\n\n const postCutoffAreaBottomPath = [];\n if (\n ghostPoint &&\n areaBottomPath &&\n splitIndex < areaBottomPath.length - 1\n ) {\n const bottomGhostPoint = [ghostPoint[0], zero];\n postCutoffAreaBottomPath.push(bottomGhostPoint);\n }\n if (areaBottomPath) {\n postCutoffAreaBottomPath.push(\n ...areaBottomPath.slice(splitIndex + 1)\n );\n }\n\n renderEntireArea(\n postCutoffPath,\n postCutoffAreaBottomPath.length ? postCutoffAreaBottomPath : null,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n }\n );\n }\n }\n\n if (linePaths && linePaths.length > 0) {\n drawLinesWithCutoff(linePaths, timeRatio, {\n color,\n context,\n hasNegatives,\n negativeColor,\n zero,\n width,\n highlighted,\n cutoffOpacity,\n });\n }\n\n if (\n showIndividualPoints &&\n individualPoints &&\n individualPoints.length > 0\n ) {\n drawPointsWithCutoffByRatio(individualPoints, timeRatio, {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n cutoffOpacity,\n });\n }\n } else {\n if (!selectionBounds) {\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n renderEntireArea(path, areaBottomPath, {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n } else {\n const visibleMinTime =\n selectionBounds.minX instanceof Date\n ? selectionBounds.minX.getTime()\n : selectionBounds.minX;\n const visibleMaxTime =\n selectionBounds.maxX instanceof Date\n ? selectionBounds.maxX.getTime()\n : selectionBounds.maxX;\n\n if (cutoffTime < visibleMinTime) {\n // cutoff before visible range - render entire area normally\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n renderEntireArea(path, areaBottomPath, {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n } else if (cutoffTime > visibleMaxTime) {\n // cutoff after visible range - render entire area with reduced opacity\n const reducedOpacityGradient = gradient\n ? applyReducedOpacityToGradient(gradient, cutoffOpacity)\n : null;\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n renderEntireArea(path, areaBottomPath, {\n color: applyReducedOpacity(color, cutoffOpacity),\n context,\n sizing,\n zero,\n hasNegatives,\n gradient: reducedOpacityGradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n } else {\n // cutoff within visible range - calculate position relative to visible bounds\n const visibleTimeRatio =\n (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n if (!path.length) {\n continue;\n }\n\n const renderCutoffIndex = visibleTimeRatio * path.length;\n const splitIndex = Math.floor(renderCutoffIndex);\n const fraction = renderCutoffIndex - splitIndex;\n\n // create ghost point for continuity if needed\n let ghostPoint = null;\n if (splitIndex < path.length - 1 && fraction > 0) {\n const [x1, y1] = path[splitIndex];\n const [x2, y2] = path[splitIndex + 1];\n ghostPoint = [\n x1 + fraction * (x2 - x1),\n y1 + fraction * (y2 - y1),\n ];\n }\n\n // render pre-cutoff area with reduced opacity\n const shouldRenderPre =\n splitIndex > 0 || (splitIndex === 0 && fraction > 0);\n\n if (shouldRenderPre) {\n renderAreaSegment(\n path,\n areaBottomPath,\n splitIndex,\n ghostPoint,\n true,\n {\n color: applyReducedOpacity(color, cutoffOpacity),\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n areaBottomPaths,\n }\n );\n }\n\n // render post-cutoff area with normal opacity\n const shouldRenderPost = splitIndex < path.length - 1;\n\n if (shouldRenderPost) {\n renderAreaSegment(\n path,\n areaBottomPath,\n splitIndex,\n ghostPoint,\n false,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n areaBottomPaths,\n }\n );\n }\n }\n }\n }\n }\n\n // draw outline lines with cutoff\n if (timeRatio >= 0 && timeRatio <= 1 && !isPreview) {\n if (selectionBounds) {\n const visibleMinTime =\n selectionBounds.minX instanceof Date\n ? selectionBounds.minX.getTime()\n : selectionBounds.minX;\n const visibleMaxTime =\n selectionBounds.maxX instanceof Date\n ? selectionBounds.maxX.getTime()\n : selectionBounds.maxX;\n\n // test case time\n if (cutoffTime < visibleMinTime) {\n // cutoff before visible range - draw lines normally\n drawLinesNormally(linePaths, {\n color,\n context,\n hasNegatives,\n negativeColor,\n width,\n highlighted,\n });\n } else if (cutoffTime > visibleMaxTime) {\n // cutoff after visible range - draw lines with reduced opacity (to match area)\n const reducedColor = applyReducedOpacity(color, cutoffOpacity);\n const reducedNegativeColor = negativeColor\n ? applyReducedOpacity(negativeColor, cutoffOpacity)\n : negativeColor;\n drawLinesNormally(linePaths, {\n color: reducedColor,\n context,\n hasNegatives,\n negativeColor: reducedNegativeColor,\n width,\n highlighted,\n });\n } else {\n // cutoff within visible range - split lines at cutoff\n const visibleTimeRatio =\n (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n drawLinesWithCutoff(linePaths, visibleTimeRatio, {\n color,\n context,\n hasNegatives,\n negativeColor,\n zero,\n width,\n highlighted,\n cutoffOpacity,\n });\n }\n } else {\n // no bounds available - draw lines normally\n drawLinesNormally(linePaths, {\n color,\n context,\n hasNegatives,\n negativeColor,\n width,\n highlighted,\n });\n }\n } else if (!isPreview) {\n // draw lines normally without cutoff\n drawLinesNormally(linePaths, {\n color,\n context,\n hasNegatives,\n negativeColor,\n width,\n highlighted,\n });\n }\n\n // draw other elements (zero line, points) normally\n if (zeroWidth) {\n const areaBottom = hasNegatives ? zero : sizing.renderHeight;\n drawZeroLine(areaBottom, {\n context,\n sizing,\n color,\n zero,\n zeroColor,\n zeroWidth,\n });\n }\n\n if (showIndividualPoints && !isPreview) {\n if (timeRatio >= 0 && timeRatio <= 1) {\n if (selectionBounds) {\n const visibleMinTime =\n selectionBounds.minX instanceof Date\n ? selectionBounds.minX.getTime()\n : selectionBounds.minX;\n const visibleMaxTime =\n selectionBounds.maxX instanceof Date\n ? selectionBounds.maxX.getTime()\n : selectionBounds.maxX;\n\n //test case time\n if (cutoffTime < visibleMinTime) {\n // cutoff before visible range - draw points normally\n drawPointsNormally(individualPoints, {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n });\n } else if (cutoffTime > visibleMaxTime) {\n // cutoff after visible range - draw points with reduced opacity\n const reducedColor = applyReducedOpacity(color, cutoffOpacity);\n const reducedNegativeColor = negativeColor\n ? applyReducedOpacity(negativeColor, cutoffOpacity)\n : negativeColor;\n const reducedZeroColor = zeroColor\n ? applyReducedOpacity(zeroColor, cutoffOpacity)\n : zeroColor;\n drawPointsNormally(individualPoints, {\n color: reducedColor,\n context,\n negativeColor: reducedNegativeColor,\n hasNegatives,\n zero,\n zeroColor: reducedZeroColor,\n pointRadius,\n });\n } else {\n // cutoff within visible range - split points at cutoff\n const visibleTimeRatio =\n (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n drawPointsWithCutoffByRatio(individualPoints, visibleTimeRatio, {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n cutoffOpacity,\n });\n }\n } else {\n // no bounds available - draw points normally\n drawPointsNormally(individualPoints, {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n });\n }\n } else {\n // cutoff outside data range - draw points normally\n drawPointsNormally(individualPoints, {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n });\n }\n } \n }\n}\n\nfunction renderEntireArea(\n path,\n areaBottomPath,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n }\n) {\n context.fillStyle = color;\n\n if (gradient && gradient.length >= 2) {\n const globalGradient = context.createLinearGradient(\n 0,\n 0,\n 0,\n sizing.renderHeight\n );\n for (let i = 0; i < gradient.length; i++) {\n const value = gradient[i];\n if (Array.isArray(value)) {\n globalGradient.addColorStop(value[0], value[1]);\n } else {\n globalGradient.addColorStop(i / (gradient.length - 1), value);\n }\n }\n context.fillStyle = globalGradient;\n } else {\n }\n\n const areaBottom = hasNegatives ? zero : sizing.renderHeight;\n\n context.beginPath();\n\n const [firstX, _startY] = path[0];\n const [lastX, _lastY] = path[path.length - 1];\n\n if (!areaBottomPath) {\n context.moveTo(firstX, areaBottom);\n }\n\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n context.lineTo(x, y);\n }\n\n if (areaBottomPath && areaBottomPath.length) {\n for (let i = areaBottomPath.length - 1; i >= 0; i--) {\n const [x, y] = areaBottomPath[i];\n context.lineTo(x, y);\n }\n context.lineTo(...path[0]);\n } else {\n context.lineTo(lastX, areaBottom);\n }\n\n context.fill();\n}\n\nfunction renderAreaSegment(\n path,\n areaBottomPath,\n splitIndex,\n ghostPoint,\n isPreCutoff,\n { color, context, sizing, zero, hasNegatives, gradient, areaBottomPaths }\n) {\n context.fillStyle = color;\n\n if (gradient && gradient.length >= 2) {\n const globalGradient = context.createLinearGradient(\n 0,\n 0,\n 0,\n sizing.renderHeight\n );\n for (let i = 0; i < gradient.length; i++) {\n const value = gradient[i];\n if (Array.isArray(value)) {\n const gradientColor = isPreCutoff\n ? applyReducedOpacity(value[1], 0.35)\n : value[1];\n globalGradient.addColorStop(value[0], gradientColor);\n } else {\n const gradientColor = isPreCutoff\n ? applyReducedOpacity(value, 0.35)\n : value;\n globalGradient.addColorStop(i / (gradient.length - 1), gradientColor);\n }\n }\n context.fillStyle = globalGradient;\n } else {\n }\n\n const areaBottom = hasNegatives ? zero : sizing.renderHeight;\n\n context.beginPath();\n\n if (isPreCutoff) {\n const endIndex = ghostPoint ? splitIndex + 1 : splitIndex;\n const [firstX] = path[0];\n\n if (!areaBottomPaths) {\n context.moveTo(firstX, areaBottom);\n }\n\n for (let i = 0; i <= endIndex && i < path.length; i++) {\n const [x, y] = i === endIndex && ghostPoint ? ghostPoint : path[i];\n context.lineTo(x, y);\n }\n\n if (areaBottomPath && areaBottomPath.length) {\n for (let i = Math.min(endIndex, areaBottomPath.length - 1); i >= 0; i--) {\n const [x, y] = areaBottomPath[i];\n context.lineTo(x, y);\n }\n context.lineTo(...path[0]);\n } else {\n const lastPoint = ghostPoint || path[endIndex] || path[path.length - 1];\n context.lineTo(lastPoint[0], areaBottom);\n }\n } else {\n const startIndex = ghostPoint ? splitIndex : splitIndex + 1;\n const startPoint = ghostPoint || path[startIndex];\n\n if (startPoint) {\n context.moveTo(startPoint[0], areaBottom);\n\n if (ghostPoint) {\n context.lineTo(...ghostPoint);\n }\n for (let i = startIndex; i < path.length; i++) {\n context.lineTo(...path[i]);\n }\n\n if (areaBottomPath && areaBottomPath.length) {\n for (\n let i = areaBottomPath.length - 1;\n i >= Math.max(startIndex, 0);\n i--\n ) {\n const [x, y] = areaBottomPath[i];\n context.lineTo(x, y);\n }\n if (ghostPoint) {\n context.lineTo(ghostPoint[0], areaBottom);\n }\n } else {\n const [lastX] = path[path.length - 1];\n context.lineTo(lastX, areaBottom);\n }\n }\n }\n\n context.fill();\n}\n\nfunction drawPointsNormally(\n individualPoints,\n { color, context, negativeColor, hasNegatives, zero, zeroColor, pointRadius }\n) {\n if (!individualPoints || !Array.isArray(individualPoints)) {\n return;\n }\n\n for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[i];\n\n let pointColor = color;\n if (negativeColor && hasNegatives) {\n if (y === zero && zeroColor) {\n pointColor = zeroColor;\n } else if (y < zero) {\n pointColor = color;\n } else {\n pointColor = negativeColor;\n }\n }\n\n context.fillStyle = pointColor;\n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n}\n\nfunction drawLinesNormally(\n linePaths,\n { color, context, hasNegatives, negativeColor, width, highlighted }\n) {\n if (!linePaths || !Array.isArray(linePaths)) {\n return;\n }\n\n if (highlighted) {\n width += 2;\n }\n width *= DPI_INCREASE;\n\n for (let path of linePaths) {\n if (!path.length) continue;\n\n context.strokeStyle = hasNegatives && negativeColor ? negativeColor : color;\n context.lineWidth = width;\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n }\n}\n\nfunction drawLinesWithCutoff(\n linePaths,\n timeRatio,\n {\n color,\n context,\n hasNegatives,\n negativeColor,\n zero,\n width,\n highlighted,\n cutoffOpacity,\n }\n) {\n if (!linePaths || !Array.isArray(linePaths)) {\n return;\n }\n\n if (highlighted) {\n width += 2;\n }\n width *= DPI_INCREASE;\n\n const cutoffPixelX = timeRatio * context.canvas.width;\n const preCutoffPaths = [];\n const postCutoffPaths = [];\n\n for (let path of linePaths) {\n if (!path.length) continue;\n\n const prePath = [];\n const postPath = [];\n let ghostPoint = null;\n let splitIndex = -1;\n\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n \n if (x < cutoffPixelX) {\n prePath.push([x, y]);\n splitIndex = i;\n } else {\n postPath.push([x, y]);\n }\n }\n\n if (prePath.length > 0 && postPath.length > 0) {\n const lastPrePoint = prePath[prePath.length - 1];\n const firstPostPoint = postPath[0];\n const [x1, y1] = lastPrePoint;\n const [x2, y2] = firstPostPoint;\n \n if (x2 !== x1) {\n const fraction = (cutoffPixelX - x1) / (x2 - x1);\n ghostPoint = [cutoffPixelX, y1 + fraction * (y2 - y1)];\n prePath.push(ghostPoint);\n postPath.unshift(ghostPoint);\n }\n }\n\n if (prePath.length > 0) {\n preCutoffPaths.push(prePath);\n }\n if (postPath.length > 0) {\n postCutoffPaths.push(postPath);\n }\n }\n\n if (preCutoffPaths.length > 0) {\n const reducedColor = applyReducedOpacity(color, cutoffOpacity);\n context.strokeStyle = reducedColor;\n context.lineWidth = width;\n\n for (let path of preCutoffPaths) {\n if (path.length > 1) {\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n }\n }\n }\n\n if (postCutoffPaths.length > 0) {\n context.strokeStyle = hasNegatives && negativeColor ? negativeColor : color;\n context.lineWidth = width;\n\n for (let path of postCutoffPaths) {\n if (path.length > 1) {\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n }\n }\n }\n}\n\nfunction drawPointsWithCutoffByRatio(\n individualPoints,\n timeRatio,\n {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n cutoffOpacity,\n }\n) {\n if (!individualPoints || !Array.isArray(individualPoints)) {\n return;\n }\n\n const canvasWidth = context.canvas.width;\n const cutoffPixelX = timeRatio * canvasWidth;\n\n for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[i];\n\n const isBeforeCutoff = x < cutoffPixelX;\n\n let pointColor = color;\n if (isBeforeCutoff) {\n pointColor = applyReducedOpacity(color, cutoffOpacity);\n }\n\n if (negativeColor && hasNegatives) {\n if (y === zero && zeroColor) {\n pointColor = zeroColor;\n } else if (y < zero) {\n pointColor = isBeforeCutoff\n ? applyReducedOpacity(color, cutoffOpacity)\n : color;\n } else {\n pointColor = isBeforeCutoff\n ? applyReducedOpacity(negativeColor, cutoffOpacity)\n : negativeColor;\n }\n }\n\n context.fillStyle = pointColor;\n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n}\n","import {drawZeroLine} from './draw_zero_line';\nimport { applyReducedOpacity } from \"../helpers/colors\";\n\n/**\n * Draws the data on the canvas\n * Assumes the data is in individual point render space, ie x and y in pixels\n *\n * @param {Array<[number, number]>} individualPoints - data to draw\n * @param {Object} options - set of options\n * @param {Object} options.context - the context to draw on\n * @param {String} options.color - color of the bar to draw\n * @param {{renderWidth: Number, renderHeight: Number}} options.sizing - size of the canvas, in pixels\n * @param {Number} options.indexInAxis - index of the series in the axis\n * @param {Number} options.axisSeriesCount - number of series in the axis\n * @param {Number} options.zero - y coordinate that represents \"zero\"\n * @param {Boolean} options.hasNegatives - if any values are negative (in which case should render from zero)\n * @param {String} options.negativeColor - color of the bar to draw if negative\n * @param {String} options.zeroColor - color of the zero line\n * @param {Number} options.zeroWidth - width of the zero line\n * @param {Number} options.closestSpacing - closest x spacing between points, in data space\n * @param {{minX: Number, maxX: Number}} options.bounds - bounds of the data as rendered\n * @private\n */\nexport default function drawBars(individualPoints, {\n color, context, sizing, indexInAxis, axisSeriesCount, zero, hasNegatives, negativeColor, zeroColor, zeroWidth, closestSpacing, bounds, cutoffIndex, cutoffOpacity, originalData, renderCutoffGradient, selectionBounds\n}) {\n if (!context) {\n console.error('Canvas context is null in drawBars');\n return;\n }\n \n context.strokeStyle = color;\n context.fillStyle = color;\n\n const {barWidth, totalBarWidth} = getBarWidths({ closestSpacing, bounds, sizing, axisSeriesCount });\n const barBottom = hasNegatives ? zero : sizing.renderHeight;\n\n if (renderCutoffGradient && cutoffIndex !== undefined && originalData) {\n drawBarsWithCutoff(individualPoints, {\n color, context, sizing, indexInAxis, axisSeriesCount, zero, hasNegatives, negativeColor, zeroColor, zeroWidth, closestSpacing, bounds, cutoffIndex, cutoffOpacity, originalData, selectionBounds, barWidth, totalBarWidth, barBottom\n });\n return;\n }\n\n for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[i];\n\n if (hasNegatives) {\n if (y <= zero) {\n context.fillStyle = color;\n } else {\n context.fillStyle = negativeColor;\n }\n }\n\n context.fillRect(x - totalBarWidth / 2 + barWidth*indexInAxis, y, barWidth, barBottom-y);\n }\n\n if (zeroWidth) {\n drawZeroLine(barBottom, {\n context,\n sizing,\n color,\n zero,\n zeroColor,\n zeroWidth\n });\n }\n}\n\nexport function getBarWidths({closestSpacing, bounds, sizing, axisSeriesCount}) {\n const fullBarWidth = closestSpacing / (bounds.maxX - bounds.minX) * sizing.renderWidth;\n\n const totalBarWidth = fullBarWidth * 0.8;\n const barSpacing = fullBarWidth * 0.2;\n const barWidth = totalBarWidth / axisSeriesCount;\n\n return {\n barWidth,\n totalBarWidth,\n barSpacing\n };\n}\n\n/**\n * Draws the data on the canvas with cutoff\n * Assumes the data is in individual point render space, ie x and y in pixels\n *\n * @param {Array<[number, number]>} individualPoints - data to draw\n * @param {Object} options - set of options\n * @param {Object} options.context - the context to draw on\n * @param {String} options.color - color of the bar to draw\n * @param {{renderWidth: Number, renderHeight: Number}} options.sizing - size of the canvas, in pixels\n * @param {Number} options.indexInAxis - index of the series in the axis\n * @param {Number} options.axisSeriesCount - number of series in the axis\n * @param {Number} options.zero - y coordinate that represents \"zero\"\n * @param {Boolean} options.hasNegatives - if any values are negative (in which case should render from zero)\n * @param {String} options.negativeColor - color of the bar to draw if negative\n * @param {String} options.zeroColor - color of the zero line\n * @param {Number} options.zeroWidth - width of the zero line\n * @param {Number} options.closestSpacing - closest x spacing between points, in data space\n * @param {{minX: Number, maxX: Number}} options.bounds - bounds of the data as rendered\n * @param {Number} options.cutoffIndex - index of the cutoff\n * @param {Number} options.cutoffOpacity - opacity of the cutoff\n * @param {Array<[number, number]>} options.originalData - original data\n * @param {Boolean} options.selectionBounds - if selection bounds are available\n * @param {Number} options.barWidth - width of the bar\n * @param {Number} options.totalBarWidth - total width of the bar\n * @param {Number} options.barBottom - y coordinate that represents the bottom of the bar\n * @private\n */\nfunction drawBarsWithCutoff(individualPoints, {\n color, context, sizing, indexInAxis, axisSeriesCount, zero, hasNegatives, negativeColor, zeroColor, zeroWidth, closestSpacing, bounds, cutoffIndex, cutoffOpacity, originalData, selectionBounds, barWidth, totalBarWidth, barBottom\n}) {\n let cutoffTime;\n if (typeof originalData[0] === 'object' && originalData[0].length === 2) {\n const baseIndex = Math.floor(cutoffIndex);\n const fraction = cutoffIndex - baseIndex;\n \n if (fraction === 0 || baseIndex >= originalData.length - 1) {\n const cutoffDate = originalData[Math.min(baseIndex, originalData.length - 1)][0];\n cutoffTime = cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n } else {\n const currentDate = originalData[baseIndex][0];\n const nextDate = originalData[baseIndex + 1][0];\n const currentTime = currentDate instanceof Date ? currentDate.getTime() : currentDate;\n const nextTime = nextDate instanceof Date ? nextDate.getTime() : nextDate;\n cutoffTime = currentTime + fraction * (nextTime - currentTime);\n }\n } else {\n cutoffTime = cutoffIndex; \n }\n\n for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[i];\n \n let barColor = color;\n let isBeforeCutoff = false;\n\n if (i < originalData.length) {\n const dataPoint = originalData[i];\n const pointTime = dataPoint[0] instanceof Date ? dataPoint[0].getTime() : dataPoint[0];\n isBeforeCutoff = pointTime < cutoffTime;\n \n if (isBeforeCutoff) {\n barColor = applyReducedOpacity(color, cutoffOpacity);\n }\n }\n\n if (hasNegatives) {\n if (y <= zero) {\n context.fillStyle = barColor;\n } else {\n const negColor = isBeforeCutoff ? applyReducedOpacity(negativeColor, cutoffOpacity) : negativeColor;\n context.fillStyle = negColor;\n }\n } else {\n context.fillStyle = barColor;\n }\n\n context.fillRect(x - totalBarWidth / 2 + barWidth*indexInAxis, y, barWidth, barBottom-y);\n }\n\n if (zeroWidth) {\n drawZeroLine(barBottom, {\n context, sizing, color, zero, zeroColor, zeroWidth\n });\n }\n}\n","import {DPI_INCREASE} from './size_canvas';\nimport pathsFrom from './paths_from';\nimport { applyReducedOpacity } from \"../helpers/colors\";\n\nfunction applyPointSpacing(points, minSpacing) {\n if (!minSpacing || points.length <= 1) {\n return points;\n }\n \n const spacedPoints = [];\n let lastX = -Infinity;\n \n for (const point of points) {\n const [x] = point;\n if (x - lastX >= minSpacing) {\n spacedPoints.push(point);\n lastX = x;\n }\n }\n \n return spacedPoints;\n}\n\nexport default function drawLine(dataInRenderSpace, {\n color, width=1, context, shadowColor='black', shadowBlur=5, dashed=false, dashPattern=null, highlighted=false, showIndividualPoints=false, pointRadius, minPointSpacing, getIndividualPoints, getRanges, cutoffIndex, cutoffTimeValue, cutoffOpacity, originalData, renderCutoffGradient, currentBounds, selectionBounds, rendering, isPreview, negativeColor, hasNegatives, zero, zeroColor\n}) {\n if (!context) {\n console.error(\"Canvas context is null in drawLine\");\n return;\n }\n \n if (!context.setLineDash) {\n console.error('drawLine called with WebGL context instead of 2D context');\n return;\n }\n \n if (highlighted) {\n width += 2;\n }\n width *= DPI_INCREASE;\n\n context.strokeStyle = color;\n context.lineWidth = width;\n context.shadowColor = shadowColor;\n context.shadowBlur = shadowBlur;\n\n if (dashed) {\n context.setLineDash(dashPattern || [5, 5]);\n } else {\n context.setLineDash([]);\n }\n\n // Split paths at zero line if negativeColor is specified\n const paths = pathsFrom(dataInRenderSpace, hasNegatives && negativeColor ? { splitAtY: zero } : undefined);\n\n for (let path of paths) {\n if (renderCutoffGradient && cutoffIndex !== undefined && originalData) {\n let cutoffTime;\n if (cutoffTimeValue !== undefined && cutoffTimeValue !== null) {\n cutoffTime = cutoffTimeValue;\n } else if (typeof originalData[0] === 'object' && originalData[0].length === 2) {\n const baseIndex = Math.floor(cutoffIndex);\n const fraction = cutoffIndex - baseIndex;\n \n if (fraction === 0 || baseIndex >= originalData.length - 1) {\n const cutoffDate = originalData[Math.min(baseIndex, originalData.length - 1)][0];\n cutoffTime = cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n } else {\n const currentDate = originalData[baseIndex][0];\n const nextDate = originalData[baseIndex + 1][0];\n const currentTime = currentDate instanceof Date ? currentDate.getTime() : currentDate;\n const nextTime = nextDate instanceof Date ? nextDate.getTime() : nextDate;\n cutoffTime = currentTime + fraction * (nextTime - currentTime);\n }\n } else {\n cutoffTime = cutoffIndex; \n }\n \n if (isPreview) {\n const firstTime = originalData[0][0] instanceof Date ? originalData[0][0].getTime() : originalData[0][0];\n const lastTime = originalData[originalData.length - 1][0] instanceof Date ? \n originalData[originalData.length - 1][0].getTime() : originalData[originalData.length - 1][0];\n const timeRatio = (cutoffTime - firstTime) / (lastTime - firstTime);\n \n if (timeRatio < 0) {\n context.lineWidth = width;\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n } else if (timeRatio > 1) {\n const reducedColor = applyReducedOpacity(color, cutoffOpacity);\n context.strokeStyle = reducedColor;\n context.lineWidth = width;\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n } else {\n const renderCutoffIndex = timeRatio * (path.length - 1);\n const splitIndex = Math.floor(renderCutoffIndex);\n const fraction = renderCutoffIndex - splitIndex;\n \n let ghostPoint = null;\n if (splitIndex < path.length - 1 && fraction > 0) {\n const [x1, y1] = path[splitIndex];\n const [x2, y2] = path[splitIndex + 1];\n ghostPoint = [\n x1 + fraction * (x2 - x1),\n y1 + fraction * (y2 - y1)\n ];\n }\n \n if (splitIndex > 0 || (splitIndex === 0 && fraction > 0)) {\n const reducedColor = applyReducedOpacity(color, cutoffOpacity);\n context.strokeStyle = reducedColor;\n context.lineWidth = width;\n context.beginPath();\n \n for (let i = 0; i <= splitIndex; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n \n if (ghostPoint) {\n context.lineTo(ghostPoint[0], ghostPoint[1]);\n }\n \n context.stroke();\n }\n \n if (splitIndex < path.length - 1) {\n context.strokeStyle = color;\n context.lineWidth = width;\n context.beginPath();\n \n if (ghostPoint) {\n context.moveTo(ghostPoint[0], ghostPoint[1]);\n } else {\n context.moveTo(path[splitIndex + 1][0], path[splitIndex + 1][1]);\n }\n \n for (let i = splitIndex + 1; i < path.length; i++) {\n const [x, y] = path[i];\n context.lineTo(x, y);\n }\n \n context.stroke();\n }\n }\n } else {\n if (!selectionBounds) {\n context.lineWidth = width;\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n continue;\n }\n \n const visibleMinTime = selectionBounds.minX instanceof Date ? selectionBounds.minX.getTime() : selectionBounds.minX;\n const visibleMaxTime = selectionBounds.maxX instanceof Date ? selectionBounds.maxX.getTime() : selectionBounds.maxX;\n \n if (cutoffTime < visibleMinTime) {\n context.lineWidth = width;\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n } else if (cutoffTime > visibleMaxTime) {\n const reducedColor = applyReducedOpacity(color, cutoffOpacity);\n context.strokeStyle = reducedColor;\n context.lineWidth = width;\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n context.strokeStyle = color;\n } else {\n const timeRatio = (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n const canvasWidth = context.canvas.width;\n const cutoffPixelX = timeRatio * canvasWidth;\n \n // Find the path segment that contains this x position\n let renderCutoffIndex = -1;\n let ghostPoint = null;\n \n for (let i = 0; i < path.length - 1; i++) {\n const [x1] = path[i];\n const [x2] = path[i + 1];\n \n if (x1 <= cutoffPixelX && cutoffPixelX <= x2) {\n const xFraction = (cutoffPixelX - x1) / (x2 - x1);\n renderCutoffIndex = i + xFraction;\n \n // Create ghost point at exact cutoff x position\n const [, y1] = path[i];\n const [, y2] = path[i + 1];\n ghostPoint = [\n cutoffPixelX,\n y1 + xFraction * (y2 - y1)\n ];\n break;\n }\n }\n \n // If cutoff is beyond the data range, check if we should still draw the full line\n if (renderCutoffIndex === -1) {\n const lastDataTime = originalData[originalData.length - 1][0];\n const lastDataTimeMs = lastDataTime instanceof Date ? lastDataTime.getTime() : lastDataTime;\n \n if (cutoffPixelX >= path[path.length - 1][0]) {\n // Cutoff is after the last point - draw all as pre-cutoff (reduced opacity)\n renderCutoffIndex = path.length - 1;\n } else if (cutoffPixelX < path[0][0]) {\n // Cutoff is before the first point - draw all as post-cutoff (full opacity)\n renderCutoffIndex = 0;\n }\n }\n \n const preCutoffPath = [];\n const postCutoffPath = [];\n \n for (let i = 0; i < path.length; i++) {\n if (i < renderCutoffIndex) {\n preCutoffPath.push(path[i]);\n } else {\n postCutoffPath.push(path[i]);\n }\n }\n \n if (ghostPoint) {\n if (preCutoffPath.length > 0) {\n preCutoffPath.push(ghostPoint);\n }\n if (postCutoffPath.length > 0) {\n postCutoffPath.unshift(ghostPoint);\n }\n }\n \n if (preCutoffPath.length > 1) {\n const reducedColor = applyReducedOpacity(color, cutoffOpacity);\n context.strokeStyle = reducedColor;\n context.lineWidth = width;\n context.beginPath();\n for (let i = 0; i < preCutoffPath.length; i++) {\n const [x, y] = preCutoffPath[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n }\n \n if (postCutoffPath.length > 1) {\n context.strokeStyle = color;\n context.lineWidth = width;\n context.beginPath();\n for (let i = 0; i < postCutoffPath.length; i++) {\n const [x, y] = postCutoffPath[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n }\n }\n }\n } else {\n if (hasNegatives && negativeColor) {\n let positive = true;\n if (path.length >= 2) {\n positive = path[1][1] <= zero;\n } else if (path.length > 0) {\n positive = path[0][1] <= zero;\n }\n context.strokeStyle = positive ? color : negativeColor;\n } else {\n context.strokeStyle = color;\n }\n\n context.beginPath();\n\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n\n context.stroke();\n }\n }\n\n if (getRanges) {\n const ranges = getRanges();\n\n context.lineWidth = width;\n context.strokeStyle = color;\n context.setLineDash([]);\n const horizontalBarWidth = 8 * DPI_INCREASE;\n\n for (let range of ranges) {\n if (!range) {\n continue;\n }\n\n const { pixelX, pixelMinY, pixelMaxY } = range;\n\n if (pixelMinY !== null) {\n context.beginPath();\n context.moveTo(pixelX - (horizontalBarWidth / 2), pixelMinY);\n context.lineTo(pixelX + (horizontalBarWidth / 2), pixelMinY);\n context.stroke();\n }\n\n if (pixelMaxY !== null) {\n context.beginPath();\n context.moveTo(pixelX - (horizontalBarWidth / 2), pixelMaxY);\n context.lineTo(pixelX + (horizontalBarWidth / 2), pixelMaxY);\n context.stroke();\n }\n\n if (pixelMinY === null || pixelMaxY === null) {\n continue;\n }\n\n context.beginPath();\n context.moveTo(pixelX, pixelMinY);\n context.lineTo(pixelX, pixelMaxY);\n context.stroke();\n }\n }\n\n if (showIndividualPoints) {\n const individualPoints = getIndividualPoints();\n\n if (renderCutoffGradient && cutoffIndex !== undefined && originalData && selectionBounds) {\n const visibleBounds = selectionBounds;\n let firstTime, lastTime;\n \n if (visibleBounds && visibleBounds.minX !== undefined && visibleBounds.maxX !== undefined) {\n firstTime = visibleBounds.minX instanceof Date ? visibleBounds.minX.getTime() : visibleBounds.minX;\n lastTime = visibleBounds.maxX instanceof Date ? visibleBounds.maxX.getTime() : visibleBounds.maxX;\n } else {\n const firstItem = originalData[0];\n const lastItem = originalData[originalData.length - 1];\n const firstX = firstItem[0];\n const lastX = lastItem[0];\n \n firstTime = firstX instanceof Date ? firstX.getTime() : firstX;\n lastTime = lastX instanceof Date ? lastX.getTime() : lastX;\n }\n \n let cutoffTime;\n if (typeof cutoffIndex === 'string' && cutoffIndex === 'now') {\n cutoffTime = Date.now();\n } else if (typeof originalData[0] === 'object' && originalData[0].length === 2) {\n const baseIndex = Math.floor(cutoffIndex);\n const fraction = cutoffIndex - baseIndex;\n \n if (fraction === 0 || baseIndex >= originalData.length - 1) {\n const cutoffDate = originalData[Math.min(baseIndex, originalData.length - 1)][0];\n cutoffTime = cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n } else {\n const currentDate = originalData[baseIndex][0];\n const nextDate = originalData[baseIndex + 1][0];\n const currentTime = currentDate instanceof Date ? currentDate.getTime() : currentDate;\n const nextTime = nextDate instanceof Date ? nextDate.getTime() : nextDate;\n cutoffTime = currentTime + fraction * (nextTime - currentTime);\n }\n } else {\n cutoffTime = cutoffIndex; \n }\n \n if (cutoffTime !== null) {\n const timeDiff = cutoffTime - firstTime;\n const totalTime = lastTime - firstTime;\n const timeRatio = timeDiff / totalTime;\n \n if (timeRatio > 1) {\n const spacedPoints = applyPointSpacing(individualPoints, minPointSpacing);\n for (let i = 0; i < spacedPoints.length; i++) {\n const [x, y] = spacedPoints[i];\n \n let pointColor = color;\n if (negativeColor && hasNegatives) {\n if (y === zero && zeroColor) {\n pointColor = zeroColor;\n } else if (y < zero) {\n pointColor = color;\n } else {\n pointColor = negativeColor;\n }\n }\n \n const { applyReducedOpacity } = require(\"../helpers/colors\");\n const reducedOpacityColor = applyReducedOpacity(pointColor, cutoffOpacity);\n context.fillStyle = reducedOpacityColor;\n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n return;\n }\n }\n \n if (isPreview) {\n const visibleMinTime = selectionBounds.minX instanceof Date ? selectionBounds.minX.getTime() : selectionBounds.minX;\n const visibleMaxTime = selectionBounds.maxX instanceof Date ? selectionBounds.maxX.getTime() : selectionBounds.maxX;\n \n const spacedPoints = applyPointSpacing(individualPoints, minPointSpacing);\n for (let i = 0; i < spacedPoints.length; i++) {\n const [x, y] = spacedPoints[i];\n \n let isBeforeCutoff = false;\n if (cutoffTime < visibleMinTime) {\n isBeforeCutoff = false;\n } else if (cutoffTime > visibleMaxTime) {\n isBeforeCutoff = (rendering !== 'shadow');\n } else {\n const visibleCutoffRatio = (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n const cutoffPixelX = visibleCutoffRatio * context.canvas.width;\n isBeforeCutoff = x < cutoffPixelX;\n }\n \n let pointColor = color;\n if (negativeColor && hasNegatives) {\n if (y === zero && zeroColor) {\n pointColor = zeroColor;\n } else if (y < zero) {\n pointColor = color;\n } else {\n pointColor = negativeColor;\n }\n }\n \n if (isBeforeCutoff) {\n const reducedOpacityColor = applyReducedOpacity(pointColor, cutoffOpacity);\n context.fillStyle = reducedOpacityColor;\n } else {\n context.fillStyle = pointColor;\n }\n \n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n } else if (!selectionBounds) {\n const spacedPoints = applyPointSpacing(individualPoints, minPointSpacing);\n for (let i = 0; i < spacedPoints.length; i++) {\n const [x, y] = spacedPoints[i];\n \n let pointColor = color;\n if (negativeColor && hasNegatives) {\n if (y === zero && zeroColor) {\n pointColor = zeroColor;\n } else if (y < zero) {\n pointColor = color;\n } else {\n pointColor = negativeColor;\n }\n }\n \n context.fillStyle = pointColor;\n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n } else {\n const visibleMinTime = selectionBounds.minX instanceof Date ? selectionBounds.minX.getTime() : selectionBounds.minX;\n const visibleMaxTime = selectionBounds.maxX instanceof Date ? selectionBounds.maxX.getTime() : selectionBounds.maxX;\n \n const spacedPoints = applyPointSpacing(individualPoints, minPointSpacing);\n for (let i = 0; i < spacedPoints.length; i++) {\n const [x, y] = spacedPoints[i];\n \n let isBeforeCutoff = false;\n if (cutoffTime < visibleMinTime) {\n isBeforeCutoff = false;\n } else if (cutoffTime > visibleMaxTime) {\n isBeforeCutoff = (rendering !== 'shadow');\n } else {\n const visibleCutoffRatio = (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n const cutoffPixelX = visibleCutoffRatio * context.canvas.width;\n isBeforeCutoff = x < cutoffPixelX;\n }\n \n let pointColor = color;\n if (negativeColor && hasNegatives) {\n if (y === zero && zeroColor) {\n pointColor = zeroColor;\n } else if (y < zero) {\n pointColor = color;\n } else {\n pointColor = negativeColor;\n }\n }\n \n if (isBeforeCutoff) {\n const reducedOpacityColor = applyReducedOpacity(pointColor, cutoffOpacity);\n context.fillStyle = reducedOpacityColor;\n } else {\n context.fillStyle = pointColor;\n }\n \n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n }\n } else {\n const spacedPoints = applyPointSpacing(individualPoints, minPointSpacing);\n for (let i = 0; i < spacedPoints.length; i++) {\n const [x, y] = spacedPoints[i];\n \n // Determine point color based on position relative to zero\n let pointColor = color;\n if (negativeColor && hasNegatives) {\n if (y === zero && zeroColor) {\n pointColor = zeroColor;\n } else if (y < zero) {\n pointColor = color;\n } else {\n pointColor = negativeColor;\n }\n }\n \n context.fillStyle = pointColor;\n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n }\n }\n}\n","let rustApiModule;\nexport const RustAPIPromise = import('../rust/pkg/index.js').then((module) => {\n return module.default().then(() => {\n rustApiModule = module;\n });\n});\n\nexport default function RustAPI() {\n return rustApiModule;\n}\n","import pathsFrom from './paths_from';\nimport {DPI_INCREASE} from './size_canvas';\nimport RustAPI from '../state/rust_api';\n\n/**\n *\n * @param {[[Number]]} paths\n * @param {Boolean} dashed\n * @param {Array} dashPattern\n * @return {{prevPositions: Float32Array, indices: Uint32Array, vertices: Float32Array, positions: Float32Array}}\n */\nexport function extractVerticesFromPaths(paths, { dashed, dashPattern }) {\n let pointNumber = 0;\n for (let path of paths) {\n if (dashed) {\n for (let i = 0; i < path.length; i++) {\n if (dashed && i % (dashPattern[0] + dashPattern[1]) >= dashPattern[0]) {\n continue;\n }\n pointNumber++;\n }\n } else {\n pointNumber += path.length;\n }\n }\n\n const positions = new Float32Array(pointNumber*8);\n const prevPositions = new Float32Array(pointNumber*8);\n const vertices = new Float32Array(pointNumber*4);\n const indices = new Uint32Array(pointNumber*6);\n\n if (pointNumber > 0) {\n const verticesPattern = new Float32Array([0, 1, 2, 3]);\n vertices.set(verticesPattern);\n let vertexPointer = verticesPattern.length;\n let sourceLength = verticesPattern.length;\n while (vertexPointer < vertices.length) {\n if (vertexPointer + sourceLength > vertices.length) {\n sourceLength = vertices.length - vertexPointer;\n }\n\n vertices.copyWithin(vertexPointer, 0, sourceLength);\n vertexPointer += sourceLength;\n sourceLength <<= 1;\n }\n }\n\n let pointI = 0;\n for (let path of paths) {\n for (let i = 0; i < path.length; i++) {\n if (dashed && i % (dashPattern[0] + dashPattern[1]) >= dashPattern[0]) {\n continue;\n }\n\n const [x, y] = path[i];\n\n let prevX, prevY;\n\n if (i === 0) {\n prevX = x - 1;\n prevY = y;\n } else {\n [prevX, prevY] = path[i - 1];\n }\n\n for (let j = 0; j < 4; j++) {\n positions[pointI * 8 + 2 * j] = x;\n positions[pointI * 8 + 2 * j + 1] = y;\n prevPositions[pointI * 8 + 2 * j] = prevX;\n prevPositions[pointI * 8 + 2 * j + 1] = prevY;\n }\n\n indices[pointI * 6] = pointI * 4;\n indices[pointI * 6 + 1] = pointI * 4 + 1;\n indices[pointI * 6 + 2] = pointI * 4 + 3;\n\n indices[pointI * 6 + 3] = pointI * 4;\n indices[pointI * 6 + 4] = pointI * 4 + 2;\n indices[pointI * 6 + 5] = pointI * 4 + 3;\n\n pointI++;\n }\n }\n\n return {\n positions,\n prevPositions,\n vertices,\n indices\n };\n}\n\n/**\n * Takes the paths and turns them into what's needed for the line webgl program\n *\n * @param {{nullMask: Uint8Array, maxYValues: Float64Array, minYValues: Float64Array, yValues: Float64Array, paths?: [[Number]]}} dataInRenderSpace\n * @param {Boolean} dashed\n * @param {Array} dashPattern\n * @return {{prevPositions: Float32Array, indices: Uint32Array, vertices: Float32Array, positions: Float32Array}}\n */\nexport default function extractVertices(dataInRenderSpace, { dashed, dashPattern }) {\n if (dataInRenderSpace && dataInRenderSpace.paths) {\n return extractVerticesFromPaths(dataInRenderSpace.paths, { dashed, dashPattern});\n }\n\n if (!RustAPI()) {\n const paths = pathsFrom(dataInRenderSpace);\n return extractVerticesFromPaths(paths, { dashed, dashPattern});\n }\n\n const pointNumber = RustAPI().get_point_number(\n dataInRenderSpace.nullMask, dataInRenderSpace.yValues, dataInRenderSpace.minYValues, dataInRenderSpace.maxYValues,\n dashed, dashPattern[0], dashPattern[1]\n );\n\n let positions = new Float32Array(pointNumber*8);\n let prevPositions = new Float32Array(pointNumber*8);\n let vertices = new Float32Array(pointNumber*4);\n let indices = new Uint32Array(pointNumber*6);\n\n RustAPI().extract_vertices(\n DPI_INCREASE,\n dataInRenderSpace.nullMask, dataInRenderSpace.yValues, dataInRenderSpace.minYValues, dataInRenderSpace.maxYValues,\n positions, prevPositions, vertices, indices,\n dashed, dashPattern[0], dashPattern[1]\n );\n\n return {\n positions,\n prevPositions,\n vertices,\n indices\n };\n}\n","import lineFrag from './line.frag';\nimport lineVert from './line.vert';\nimport circleFrag from './circle.frag';\nimport circleVert from './circle.vert';\nimport colorToVector from '../helpers/color_to_vector';\nimport extractVertices from './extract_vertices';\nimport createGLProgram from './create_gl_program';\nimport {DPI_INCREASE} from './size_canvas';\nimport { applyReducedOpacity } from \"../helpers/colors\";\n\nexport default class LineProgram {\n\n constructor(gl) {\n this._gl = gl;\n\n this._program = createGLProgram(gl, lineVert, lineFrag);\n this._circleProgram = createGLProgram(gl, circleVert, circleFrag);\n\n this._positionBuffer = gl.createBuffer();\n this._prevPositionBuffer = gl.createBuffer();\n this._vertexBuffer = gl.createBuffer();\n this._indexBuffer = gl.createBuffer();\n this._individualPointBuffer = gl.createBuffer();\n\n if (!gl.getExtension('OES_element_index_uint')) {\n console.error('Your browser does not support OES_element_index_uint'); // eslint-disable-line no-console\n }\n }\n\n dispose() {\n\n }\n\n clear() {\n const gl = this._gl;\n const width = gl.drawingBufferWidth;\n const height = gl.drawingBufferHeight;\n\n gl.clearColor(0, 0, 0, 0);\n gl.viewport(0, 0, width, height);\n }\n\n /**\n * Draws the data on the canvas\n * Assumes the data is in render space\n *\n * @param {{nullMask: Uint8Array, maxYValues: Float64Array, minYValues: Float64Array, yValues: Float64Array}} dataInRenderSpace - the data to render\n * @param {Object} parameters - set of options\n * @param {String} parameters.color - color of the line to draw\n * @param {Number} [parameters.width] - line width\n * @param {Number} [parameters.shadowBlur] - level to blur shadow to\n * @param {String} [parameters.shadowColor] - color of the shadow\n * @param {String} [parameters.dashed] - whether or not to make the line dashed\n * @param {Array<Number>} [parameters.dashPattern] - dash array for the canvas\n * @param {Boolean} [parameters.highlighted] - whether the line is highlighted or not\n * @param {Boolean} [parameters.showIndividualPoints] - draw circles at each point\n * @param {Function} [parameters.getIndividualPoints] - points to draw circles at. Only called when needed.\n * @private\n */\n draw(dataInRenderSpace, parameters) {\n const gl = this._gl;\n const width = gl.drawingBufferWidth;\n const height = gl.drawingBufferHeight;\n gl.useProgram(this._program);\n\n const thickness = DPI_INCREASE*((parameters.width || 1) + (parameters.highlighted ? 2 : 0));\n const shadowBlur = parameters.shadowBlur === undefined ? 2 : parameters.shadowBlur;\n const shadowColor = parameters.shadowColor || 'black';\n const dashed = parameters.dashed || false;\n const dashPattern = parameters.dashPattern || [5, 5];\n if (parameters.renderCutoffGradient && parameters.cutoffIndex !== undefined && parameters.originalData) {\n this.drawLineWithCutoff(dataInRenderSpace, parameters);\n return;\n }\n\n const {positions, prevPositions, vertices, indices} = extractVertices(dataInRenderSpace, { dashed, dashPattern });\n\n if (!this._program) {\n console.error('WebGL line program is null - shader compilation failed!');\n return;\n }\n\n const positionIndex = gl.getAttribLocation(this._program, 'position');\n const prevPositionIndex = gl.getAttribLocation(this._program, 'prevPosition');\n const vertexIndex = gl.getAttribLocation(this._program, 'vertex');\n\n gl.enableVertexAttribArray(positionIndex);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._positionBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, positions, gl.STATIC_DRAW);\n gl.vertexAttribPointer(positionIndex, 2, gl.FLOAT, false, 0, 0);\n\n gl.enableVertexAttribArray(prevPositionIndex);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._prevPositionBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, prevPositions, gl.STATIC_DRAW);\n gl.vertexAttribPointer(prevPositionIndex, 2, gl.FLOAT, false, 0, 0);\n\n gl.enableVertexAttribArray(vertexIndex);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n gl.vertexAttribPointer(vertexIndex, 1, gl.FLOAT, false, 0, 0);\n\n gl.uniform1f(gl.getUniformLocation(this._program, 'width'), width);\n gl.uniform1f(gl.getUniformLocation(this._program, 'height'), height);\n gl.uniform1f(gl.getUniformLocation(this._program, 'thickness'), Math.max(thickness, 1)+shadowBlur);\n gl.uniform1f(gl.getUniformLocation(this._program, 'shadowBlur'), shadowBlur);\n const colorVector = colorToVector(parameters.color);\n gl.uniform4f(gl.getUniformLocation(this._program, 'color'), ...colorVector);\n gl.uniform4f(gl.getUniformLocation(this._program, 'shadowColor'), ...colorToVector(shadowColor));\n \n const cutoffX = parameters.cutoffX !== undefined ? parameters.cutoffX : -1.0; // Use parameter or disable\n const cutoffOpacity = parameters.cutoffOpacity !== undefined ? parameters.cutoffOpacity : 0.35;\n \n gl.uniform1f(gl.getUniformLocation(this._program, 'cutoffX'), cutoffX);\n gl.uniform1f(gl.getUniformLocation(this._program, 'cutoffOpacity'), cutoffOpacity);\n\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW);\n gl.drawElements(gl.TRIANGLES, indices.length, gl.UNSIGNED_INT, 0);\n\n if (parameters.showIndividualPoints) {\n gl.useProgram(this._circleProgram);\n\n gl.uniform1f(gl.getUniformLocation(this._circleProgram, 'width'), width);\n gl.uniform1f(gl.getUniformLocation(this._circleProgram, 'height'), height);\n const pointSize = parameters.pointRadius ? parameters.pointRadius * 2 * DPI_INCREASE : 2*(thickness+6);\n gl.uniform1f(gl.getUniformLocation(this._circleProgram, 'pointSize'), pointSize);\n\n let individualPoints = parameters.getIndividualPoints();\n \n if (parameters.minPointSpacing && individualPoints.length > 1) {\n const spacedPoints = [];\n let lastX = -Infinity;\n \n for (const point of individualPoints) {\n const [x] = point;\n if (x - lastX >= parameters.minPointSpacing) {\n spacedPoints.push(point);\n lastX = x;\n }\n }\n \n individualPoints = spacedPoints;\n }\n\n if (parameters.cutoffIndex !== undefined && parameters.cutoffIndex > 0 && parameters.originalData) {\n const { originalData } = parameters;\n let cutoffTime;\n \n if (typeof originalData[0] === 'object' && originalData[0].length === 2) {\n const baseIndex = Math.floor(parameters.cutoffIndex);\n const fraction = parameters.cutoffIndex - baseIndex;\n \n if (fraction === 0 || baseIndex >= originalData.length - 1) {\n const cutoffDate = originalData[Math.min(baseIndex, originalData.length - 1)][0];\n cutoffTime = cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n } else {\n const currentDate = originalData[baseIndex][0];\n const nextDate = originalData[baseIndex + 1][0];\n const currentTime = currentDate instanceof Date ? currentDate.getTime() : currentDate;\n const nextTime = nextDate instanceof Date ? nextDate.getTime() : nextDate;\n cutoffTime = currentTime + fraction * (nextTime - currentTime);\n }\n }\n \n const preCutoffPoints = [];\n const postCutoffPoints = [];\n\n if (parameters.isPreview) {\n const visibleMinTime = parameters.selectionBounds.minX instanceof Date ? parameters.selectionBounds.minX.getTime() : parameters.selectionBounds.minX;\n const visibleMaxTime = parameters.selectionBounds.maxX instanceof Date ? parameters.selectionBounds.maxX.getTime() : parameters.selectionBounds.maxX;\n const timeRatio = (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n const cutoffPixelX = timeRatio * width;\n \n for (let i = 0; i < individualPoints.length; i++) {\n const [pixelX, pixelY] = individualPoints[i];\n if (pixelX < cutoffPixelX) {\n preCutoffPoints.push(individualPoints[i]);\n } else {\n postCutoffPoints.push(individualPoints[i]);\n }\n }\n } else if (!parameters.selectionBounds) {\n postCutoffPoints.push(...individualPoints);\n } else {\n const visibleMinTime = parameters.selectionBounds.minX instanceof Date ? \n parameters.selectionBounds.minX.getTime() : parameters.selectionBounds.minX;\n const visibleMaxTime = parameters.selectionBounds.maxX instanceof Date ? \n parameters.selectionBounds.maxX.getTime() : parameters.selectionBounds.maxX;\n \n if (cutoffTime < visibleMinTime) {\n postCutoffPoints.push(...individualPoints);\n } else if (cutoffTime > visibleMaxTime) {\n if (parameters.rendering === 'shadow') {\n postCutoffPoints.push(...individualPoints);\n } else {\n preCutoffPoints.push(...individualPoints);\n }\n } else {\n const visibleCutoffRatio = (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n const renderWidth = this._gl.canvas.width;\n const cutoffPixelX = visibleCutoffRatio * renderWidth;\n \n individualPoints.forEach((point, index) => {\n const [pixelX, pixelY] = point;\n \n if (pixelX < cutoffPixelX) {\n preCutoffPoints.push(point);\n } else {\n postCutoffPoints.push(point);\n }\n });\n }\n }\n \n if (preCutoffPoints.length > 0) {\n const reducedOpacityColor = applyReducedOpacity(parameters.color, parameters.cutoffOpacity || 0.35);\n gl.uniform4f(gl.getUniformLocation(this._circleProgram, 'color'), ...colorToVector(reducedOpacityColor));\n \n gl.enableVertexAttribArray(0);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._individualPointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(preCutoffPoints.flat()), gl.STATIC_DRAW);\n gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);\n gl.drawArrays(gl.POINTS, 0, preCutoffPoints.length);\n }\n \n if (postCutoffPoints.length > 0) {\n gl.uniform4f(gl.getUniformLocation(this._circleProgram, 'color'), ...colorToVector(parameters.color));\n \n gl.enableVertexAttribArray(0);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._individualPointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(postCutoffPoints.flat()), gl.STATIC_DRAW);\n gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);\n gl.drawArrays(gl.POINTS, 0, postCutoffPoints.length);\n }\n } else {\n gl.uniform4f(gl.getUniformLocation(this._circleProgram, 'color'), ...colorToVector(parameters.color));\n\n gl.enableVertexAttribArray(0);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._individualPointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(individualPoints.flat()), gl.STATIC_DRAW);\n gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);\n\n gl.drawArrays(gl.POINTS, 0, individualPoints.length);\n }\n }\n }\n\n drawLineWithCutoff(dataInRenderSpace, parameters) {\n const { cutoffIndex, cutoffTimeValue, cutoffOpacity, originalData, selectionBounds } = parameters;\n \n let cutoffTime;\n if (cutoffTimeValue !== undefined && cutoffTimeValue !== null) {\n cutoffTime = cutoffTimeValue;\n } else if (typeof originalData[0] === 'object' && originalData[0].length === 2) {\n const baseIndex = Math.floor(cutoffIndex);\n const fraction = cutoffIndex - baseIndex;\n \n if (fraction === 0 || baseIndex >= originalData.length - 1) {\n const cutoffDate = originalData[Math.min(baseIndex, originalData.length - 1)][0];\n cutoffTime = cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n } else {\n const currentDate = originalData[baseIndex][0];\n const nextDate = originalData[baseIndex + 1][0];\n const currentTime = currentDate instanceof Date ? currentDate.getTime() : currentDate;\n const nextTime = nextDate instanceof Date ? nextDate.getTime() : nextDate;\n cutoffTime = currentTime + fraction * (nextTime - currentTime);\n }\n } else {\n cutoffTime = cutoffIndex; \n }\n\n if (parameters.isPreview) {\n const gl = this._gl;\n const visibleMinTime = selectionBounds.minX instanceof Date ? selectionBounds.minX.getTime() : selectionBounds.minX;\n const visibleMaxTime = selectionBounds.maxX instanceof Date ? selectionBounds.maxX.getTime() : selectionBounds.maxX;\n const timeRatio = (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n \n if (timeRatio < 0) {\n this.draw(dataInRenderSpace, { ...parameters, renderCutoffGradient: false });\n } else if (timeRatio > 1) {\n const reducedOpacityColor = applyReducedOpacity(parameters.color, cutoffOpacity);\n this.draw(dataInRenderSpace, { \n ...parameters, \n color: reducedOpacityColor,\n renderCutoffGradient: false \n });\n } else {\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n \n this.draw(dataInRenderSpace, {\n ...parameters,\n renderCutoffGradient: false,\n cutoffX: timeRatio,\n cutoffOpacity: cutoffOpacity || 0.35\n });\n }\n } else {\n if (!selectionBounds) {\n this.draw(dataInRenderSpace, { ...parameters, renderCutoffGradient: false });\n return;\n }\n \n const visibleMinTime = selectionBounds.minX instanceof Date ? selectionBounds.minX.getTime() : selectionBounds.minX;\n const visibleMaxTime = selectionBounds.maxX instanceof Date ? selectionBounds.maxX.getTime() : selectionBounds.maxX;\n\n if (cutoffTime < visibleMinTime) {\n this.draw(dataInRenderSpace, { ...parameters, renderCutoffGradient: false });\n } else if (cutoffTime > visibleMaxTime) {\n const reducedOpacityColor = applyReducedOpacity(parameters.color, cutoffOpacity);\n this.draw(dataInRenderSpace, { \n ...parameters, \n color: reducedOpacityColor,\n renderCutoffGradient: false \n });\n } else {\n const visibleCutoffRatio = (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n \n const gl = this._gl;\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n \n this.draw(dataInRenderSpace, {\n ...parameters,\n renderCutoffGradient: false,\n cutoffX: visibleCutoffRatio,\n cutoffOpacity: cutoffOpacity || 0.35\n });\n }\n }\n }\n}\n","import shadowFrag from \"./shadow.frag\";\nimport shadowVert from \"./shadow.vert\";\nimport colorToVector from \"../helpers/color_to_vector\";\nimport createGLProgram from \"./create_gl_program\";\nimport { applyReducedOpacity, applyReducedOpacityToGradient } from \"../helpers/colors\";\n\nexport default class ShadowProgram {\n constructor(gl) {\n this._gl = gl;\n\n this._program = createGLProgram(gl, shadowVert, shadowFrag);\n\n if (!this._program) {\n console.error(\"Failed to create shadow shader program\");\n this._program = null;\n return;\n }\n\n gl.validateProgram(this._program);\n if (!gl.getProgramParameter(this._program, gl.VALIDATE_STATUS)) {\n console.error(\n \"Shadow program validation failed:\",\n gl.getProgramInfoLog(this._program)\n );\n }\n\n const positionLoc = gl.getAttribLocation(this._program, \"position\");\n const trapezoidBoundsLoc = gl.getAttribLocation(\n this._program,\n \"trapezoidBounds\"\n );\n const trapezoidBottomLoc = gl.getAttribLocation(\n this._program,\n \"trapezoidBottom\"\n );\n\n if (\n positionLoc === -1 ||\n trapezoidBoundsLoc === -1 ||\n trapezoidBottomLoc === -1\n ) {\n console.error(\"Missing required shader attributes\");\n }\n\n this._positionBuffer = gl.createBuffer();\n this._trapezoidBoundsBuffer = gl.createBuffer();\n this._trapezoidBottomBuffer = gl.createBuffer();\n this._indexBuffer = gl.createBuffer();\n\n this._gradientTexture = gl.createTexture();\n\n if (!gl.getExtension(\"OES_element_index_uint\")) {\n console.error(\"Your browser does not support OES_element_index_uint\");\n }\n }\n\n dispose() {\n const gl = this._gl;\n if (this._gradientTexture) {\n gl.deleteTexture(this._gradientTexture);\n this._gradientTexture = null;\n }\n }\n\n /**\n * Convert trapezoids into WebGL geometry\n * @param {Array} trapezoids - Array of trapezoid definitions\n * @returns {Object} - Geometry data for WebGL\n */\n generateTrapezoidGeometry(trapezoids) {\n const positions = [];\n const trapezoidBounds = [];\n const trapezoidBottom = [];\n const indices = [];\n\n let vertexIndex = 0;\n\n for (const trap of trapezoids) {\n const { x1, y1, x2, y2, bottomY1, bottomY2 } = trap;\n\n const vertices = [\n [x1, y1],\n [x2, y2],\n [x2, bottomY2],\n [x1, bottomY1],\n ];\n\n const bounds = [x1, y1, x2, y2];\n const bottom = [x1, bottomY1, x2, bottomY2];\n\n for (let i = 0; i < 4; i++) {\n const [x, y] = vertices[i];\n\n positions.push(x, y);\n trapezoidBounds.push(...bounds);\n trapezoidBottom.push(...bottom);\n }\n\n indices.push(\n vertexIndex,\n vertexIndex + 1,\n vertexIndex + 2,\n vertexIndex,\n vertexIndex + 2,\n vertexIndex + 3\n );\n\n vertexIndex += 4;\n }\n\n return {\n positions: new Float32Array(positions),\n trapezoidBounds: new Float32Array(trapezoidBounds),\n trapezoidBottom: new Float32Array(trapezoidBottom),\n indices: new Uint32Array(indices),\n };\n }\n\n /**\n * Parse gradient definition to shader uniforms (supports up to 16 stops)\n * @param {Array} gradient - Gradient definition\n * @param {String} fallbackColor - Fallback color\n * @returns {Object} - Shader uniform data\n */\n parseGradient(gradient, fallbackColor) {\n if (!gradient || !Array.isArray(gradient) || gradient.length < 2) {\n const fallbackColorVec = colorToVector(fallbackColor);\n return {\n textureData: new Uint8Array([\n 0,\n 0,\n 0,\n 255,\n Math.floor(fallbackColorVec[0] * 255),\n Math.floor(fallbackColorVec[1] * 255),\n Math.floor(fallbackColorVec[2] * 255),\n Math.floor(fallbackColorVec[3] * 255),\n ]),\n textureWidth: 2,\n gradientCount: 1,\n fallbackColor: fallbackColorVec,\n };\n }\n\n const colors = [];\n const stops = [];\n\n for (let i = 0; i < gradient.length; i++) {\n const item = gradient[i];\n\n if (Array.isArray(item)) {\n stops.push(item[0]);\n colors.push(colorToVector(item[1]));\n } else {\n stops.push(i / (gradient.length - 1));\n colors.push(colorToVector(item));\n }\n }\n\n const textureWidth = colors.length * 2;\n const textureData = new Uint8Array(textureWidth * 4);\n\n for (let i = 0; i < colors.length; i++) {\n const stopIndex = i * 8;\n const colorIndex = stopIndex + 4;\n\n textureData[stopIndex] = Math.floor(stops[i] * 255);\n textureData[stopIndex + 1] = 0;\n textureData[stopIndex + 2] = 0;\n textureData[stopIndex + 3] = 255;\n\n textureData[colorIndex] = Math.floor(colors[i][0] * 255);\n textureData[colorIndex + 1] = Math.floor(colors[i][1] * 255);\n textureData[colorIndex + 2] = Math.floor(colors[i][2] * 255);\n textureData[colorIndex + 3] = Math.floor(colors[i][3] * 255);\n }\n\n return {\n textureData,\n textureWidth,\n gradientCount: colors.length,\n fallbackColor: colorToVector(fallbackColor),\n };\n }\n\n /**\n * Draw shadow/trapezoid geometry\n * @param {Array} individualPoints - Points defining the line\n * @param {Object} params - Rendering parameters\n */\n draw(individualPoints, params) {\n\n if (!individualPoints || individualPoints.length < 2) {\n return;\n }\n\n const gl = this._gl;\n const width = gl.drawingBufferWidth;\n const height = gl.drawingBufferHeight;\n\n gl.useProgram(this._program);\n\n if (\n params.renderCutoffGradient &&\n params.cutoffIndex !== undefined &&\n params.originalData\n ) {\n this.drawShadowWithCutoff(individualPoints, params);\n return;\n }\n\n const trapezoids = [];\n const positiveTrapezoids = [];\n const negativeTrapezoids = [];\n const { zero, inRenderSpaceAreaBottom, negativeGradient, hasNegatives } = params;\n\n\n for (let i = 0; i < individualPoints.length - 1; i++) {\n const [x1, y1] = individualPoints[i];\n const [x2, y2] = individualPoints[i + 1];\n\n let bottomY1 = zero;\n let bottomY2 = zero;\n\n const y1RelativeToZero = y1 - zero;\n const y2RelativeToZero = y2 - zero;\n const crossesZero = y1RelativeToZero * y2RelativeToZero < 0;\n\n if (crossesZero) {\n const t =\n Math.abs(y1RelativeToZero) /\n (Math.abs(y1RelativeToZero) + Math.abs(y2RelativeToZero));\n const xCross = x1 + (x2 - x1) * t;\n const yCross = zero;\n\n if (Math.abs(y1 - yCross) > 0.1) {\n const trap = {\n x1,\n y1,\n x2: xCross,\n y2: yCross,\n bottomY1,\n bottomY2: zero,\n };\n trapezoids.push(trap);\n \n // Determine if positive or negative (in screen coords, smaller Y is higher/positive)\n if (hasNegatives && negativeGradient) {\n if (y1 <= zero) {\n positiveTrapezoids.push(trap);\n } else {\n negativeTrapezoids.push(trap);\n }\n }\n }\n\n if (Math.abs(y2 - yCross) > 0.1) {\n const trap = {\n x1: xCross,\n y1: yCross,\n x2,\n y2,\n bottomY1: zero,\n bottomY2,\n };\n trapezoids.push(trap);\n \n // Determine if positive or negative\n if (hasNegatives && negativeGradient) {\n if (y2 <= zero) {\n positiveTrapezoids.push(trap);\n } else {\n negativeTrapezoids.push(trap);\n }\n }\n }\n } else {\n // Skip trapezoids completely outside canvas\n if (x1 > width || x2 < 0) {\n continue;\n }\n \n // Clip trapezoid to canvas bounds if it extends beyond\n let finalX2 = x2;\n let finalY2 = y2;\n let finalBottomY2 = bottomY2;\n \n if (x2 > width) {\n const ratio = (width - x1) / (x2 - x1);\n finalX2 = width;\n finalY2 = y1 + (y2 - y1) * ratio;\n finalBottomY2 = bottomY1 + (bottomY2 - bottomY1) * ratio;\n }\n \n const trapezoid = { x1, y1, x2: finalX2, y2: finalY2, bottomY1, bottomY2: finalBottomY2 };\n trapezoids.push(trapezoid);\n \n // Determine if positive or negative\n if (hasNegatives && negativeGradient) {\n // Check average Y position\n const avgY = (y1 + finalY2) / 2;\n if (avgY <= zero) {\n positiveTrapezoids.push(trapezoid);\n } else {\n negativeTrapezoids.push(trapezoid);\n }\n }\n }\n }\n\n if (trapezoids.length === 0) {\n return;\n }\n\n const positionLoc = gl.getAttribLocation(this._program, \"position\");\n const trapezoidBoundsLoc = gl.getAttribLocation(\n this._program,\n \"trapezoidBounds\"\n );\n const trapezoidBottomLoc = gl.getAttribLocation(\n this._program,\n \"trapezoidBottom\"\n );\n\n gl.uniform1f(gl.getUniformLocation(this._program, \"width\"), width);\n gl.uniform1f(gl.getUniformLocation(this._program, \"height\"), height);\n\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n\n // Helper function to render a set of trapezoids with a given gradient\n const renderTrapezoidSet = (trapSet, gradient, color) => {\n if (trapSet.length === 0) return;\n\n const geometry = this.generateTrapezoidGeometry(trapSet);\n\n gl.enableVertexAttribArray(positionLoc);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._positionBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, geometry.positions, gl.STATIC_DRAW);\n gl.vertexAttribPointer(positionLoc, 2, gl.FLOAT, false, 0, 0);\n\n gl.enableVertexAttribArray(trapezoidBoundsLoc);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._trapezoidBoundsBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, geometry.trapezoidBounds, gl.STATIC_DRAW);\n gl.vertexAttribPointer(trapezoidBoundsLoc, 4, gl.FLOAT, false, 0, 0);\n\n gl.enableVertexAttribArray(trapezoidBottomLoc);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._trapezoidBottomBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, geometry.trapezoidBottom, gl.STATIC_DRAW);\n gl.vertexAttribPointer(trapezoidBottomLoc, 4, gl.FLOAT, false, 0, 0);\n\n const gradientData = this.parseGradient(gradient, color);\n\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, this._gradientTexture);\n\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gradientData.textureWidth,\n 1,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n gradientData.textureData\n );\n\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\n gl.uniform1i(gl.getUniformLocation(this._program, \"gradientTexture\"), 0);\n gl.uniform1i(\n gl.getUniformLocation(this._program, \"gradientCount\"),\n gradientData.gradientCount\n );\n gl.uniform4fv(\n gl.getUniformLocation(this._program, \"fallbackColor\"),\n gradientData.fallbackColor\n );\n\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, geometry.indices, gl.STATIC_DRAW);\n\n gl.drawElements(gl.TRIANGLES, geometry.indices.length, gl.UNSIGNED_INT, 0);\n };\n\n // If we have negativeGradient and separate trapezoid sets, render them separately\n if (hasNegatives && negativeGradient && (positiveTrapezoids.length > 0 || negativeTrapezoids.length > 0)) {\n // Render positive trapezoids with the normal gradient\n renderTrapezoidSet(positiveTrapezoids, params.gradient, params.color);\n \n // Render negative trapezoids with negativeGradient\n renderTrapezoidSet(negativeTrapezoids, negativeGradient, params.color);\n } else {\n // Fallback to rendering all trapezoids with the same gradient (original behavior)\n renderTrapezoidSet(trapezoids, params.gradient, params.color);\n }\n \n const error = gl.getError();\n if (error !== gl.NO_ERROR) {\n console.error('WebGL error in shadow rendering:', error);\n } else {\n //he he he haw\n }\n }\n\n /**\n * Draw shadow chart with cutoff gradient\n * @param {Array} individualPoints - Points defining the line\n * @param {Object} params - Rendering parameters with cutoff info\n */\n drawShadowWithCutoff(individualPoints, params) {\n\n const { cutoffIndex, cutoffTimeValue, cutoffOpacity, originalData, selectionBounds, zero } =\n params;\n\n this._lastIndividualPoints = null;\n this._lastParams = null;\n\n let cutoffTime;\n if (cutoffTimeValue !== undefined && cutoffTimeValue !== null) {\n cutoffTime = cutoffTimeValue;\n } else if (Array.isArray(originalData[0]) && originalData[0].length === 2) {\n const baseIndex = Math.floor(cutoffIndex);\n const fraction = cutoffIndex - baseIndex;\n\n if (fraction === 0 || baseIndex >= originalData.length - 1) {\n const cutoffItem = originalData[Math.min(baseIndex, originalData.length - 1)];\n const cutoffDate = cutoffItem[0];\n cutoffTime = cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n } else {\n const currentItem = originalData[baseIndex];\n const nextItem = originalData[baseIndex + 1];\n const currentDate = currentItem[0];\n const nextDate = nextItem[0];\n const currentTime = currentDate instanceof Date ? currentDate.getTime() : currentDate;\n const nextTime = nextDate instanceof Date ? nextDate.getTime() : nextDate;\n cutoffTime = currentTime + fraction * (nextTime - currentTime);\n }\n } else {\n cutoffTime = cutoffIndex;\n }\n\n const visibleBounds = params.selectionBounds;\n let firstTime, lastTime;\n \n if (visibleBounds && visibleBounds.minX !== undefined && visibleBounds.maxX !== undefined) {\n firstTime = visibleBounds.minX instanceof Date ? visibleBounds.minX.getTime() : visibleBounds.minX;\n lastTime = visibleBounds.maxX instanceof Date ? visibleBounds.maxX.getTime() : visibleBounds.maxX;\n } else {\n const firstItem = originalData[0];\n const lastItem = originalData[originalData.length - 1];\n const firstX = firstItem[0];\n const lastX = lastItem[0];\n \n firstTime = firstX instanceof Date ? firstX.getTime() : firstX;\n lastTime = lastX instanceof Date ? lastX.getTime() : lastX;\n }\n \n const timeDiff = cutoffTime - firstTime;\n const totalTime = lastTime - firstTime;\n const timeRatio = timeDiff / totalTime;\n\n if (timeRatio < 0) {\n this.draw(individualPoints, { ...params, renderCutoffGradient: false });\n } else if (timeRatio > 1) {\n const reducedOpacityColor = applyReducedOpacity(\n params.color,\n cutoffOpacity\n );\n const translucentGradient = applyReducedOpacityToGradient(\n params.gradient,\n cutoffOpacity\n );\n this.draw(individualPoints, {\n ...params,\n color: reducedOpacityColor,\n gradient: translucentGradient,\n renderCutoffGradient: false,\n });\n } else {\n this.drawSplitShadowTrapezoids(\n individualPoints,\n { ...params, selectionBounds: params.selectionBounds },\n timeRatio,\n cutoffTime\n );\n }\n }\n\n /**\n * Draw split shadow trapezoids with cutoff\n * @param {Array} individualPoints - Points defining the line\n * @param {Object} params - Rendering parameters\n * @param {number} timeRatio - Position of cutoff in visible range (0-1)\n * @param {number} cutoffTime - Cutoff timestamp\n */\n drawSplitShadowTrapezoids(individualPoints, params, timeRatio, cutoffTime) {\n const { zero, cutoffOpacity, selectionBounds } = params;\n const gl = this._gl;\n\n const renderWidth = gl.canvas.width;\n const cutoffPixelX = timeRatio * renderWidth;\n\n const preCutoffPoints = [];\n const postCutoffPoints = [];\n \n for (let i = 0; i < individualPoints.length; i++) {\n const [pixelX, pixelY] = individualPoints[i];\n \n if (pixelX < cutoffPixelX) {\n preCutoffPoints.push(individualPoints[i]);\n } else {\n postCutoffPoints.push(individualPoints[i]);\n }\n }\n \n let ghostPoint = null;\n if (preCutoffPoints.length > 0 && postCutoffPoints.length > 0) {\n const lastPrePoint = preCutoffPoints[preCutoffPoints.length - 1];\n const firstPostPoint = postCutoffPoints[0];\n \n const [x1, y1] = lastPrePoint;\n const [x2, y2] = firstPostPoint;\n \n if (x2 !== x1) {\n const interpolationRatio = (cutoffPixelX - x1) / (x2 - x1);\n const ghostY = y1 + interpolationRatio * (y2 - y1);\n ghostPoint = [cutoffPixelX, ghostY];\n \n preCutoffPoints.push(ghostPoint);\n postCutoffPoints.unshift(ghostPoint);\n }\n }\n\n if (preCutoffPoints.length >= 2) {\n const reducedOpacityColor = applyReducedOpacity(\n params.color,\n cutoffOpacity\n );\n const gl = this._gl;\n\n gl.disable(gl.DEPTH_TEST);\n\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n\n const translucentGradient = applyReducedOpacityToGradient(\n params.gradient,\n cutoffOpacity\n );\n\n this.draw(preCutoffPoints, {\n ...params,\n color: reducedOpacityColor,\n gradient: translucentGradient,\n renderCutoffGradient: false,\n });\n } else {\n }\n\n if (postCutoffPoints.length >= 2) {\n this.draw(postCutoffPoints, {\n ...params,\n renderCutoffGradient: false,\n });\n } else {\n }\n }\n}\n","import Eventable from '../eventable';\nimport getColor, { createDefaultGradient } from '../helpers/colors';\nimport inferType from '../state/infer_type';\nimport BackgroundProgram from './background_program.js';\nimport drawArea from './draw_area';\nimport drawBackground from './draw_background.js';\nimport drawBars from './draw_bars';\nimport drawLine from './draw_line';\nimport LineProgram from './line_program';\nimport ShadowProgram from './shadow_program';\nimport sizeCanvas, { DPI_INCREASE } from './size_canvas';\n\nexport default class GraphBodyRenderer extends Eventable {\n\n constructor({stateController, canvasElement, webgl=false, checkIntersection=true }) {\n super();\n\n this._stateController = stateController;\n\n this._checkIntersection = checkIntersection;\n this._canvas = canvasElement;\n this._webgl = webgl;\n \n if (!this._canvas) {\n console.error('Canvas element is null in GraphBodyRenderer constructor');\n this._initialized = false;\n return;\n }\n \n if (webgl) {\n this._context = this._canvas.getContext('webgl');\n if (this._context) {\n this._lineProgram = new LineProgram(this._context);\n this._shadowProgram = new ShadowProgram(this._context);\n } else {\n console.error('❌ WebGL context creation failed');\n alert('WebGL failed! Attempting fallback to CPU rendering');\n this._webgl = false;\n }\n }\n\n if (!this._webgl) {\n this._context = this._canvas.getContext('2d');\n this._context2d = this._context;\n }\n\n if (!this._context) {\n console.error('Failed to get canvas context in GraphBodyRenderer');\n this._initialized = false;\n return;\n }\n\n this._initialized = this._initializeCanvas();\n\n this._boundResize = this.resize.bind(this);\n this._cachedAxisCount = null;\n this._onAxisChange = (axes) => {\n const count = axes.filter(({ series }) => series.length > 0).length;\n if (this._cachedAxisCount !== count) {\n this._cachedAxisCount = count;\n this.resize();\n }\n };\n\n stateController.on('axes_changed', this._onAxisChange);\n stateController.on('dragging_y_changed', this._boundResize);\n stateController.on('showing_sidebar_changed', this._boundResize);\n }\n\n /**\n * Cleans up after this renderer\n */\n dispose() {\n this.clearListeners();\n this._lineProgram && this._lineProgram.dispose();\n this._shadowProgram && this._shadowProgram.dispose();\n this._cachedAxisCount = null;\n this._stateController.off('axes_changed', this._onAxisChange);\n this._stateController.off('dragging_y_changed', this._boundResize);\n\n if (this._resizeObserver) {\n this._resizeObserver.disconnect();\n }\n\n if (this._intersectionObserver) {\n this._intersectionObserver.disconnect();\n }\n\n if (this._zeroLineCanvas && this._zeroLineCanvas.parentNode) {\n this._zeroLineCanvas.parentNode.removeChild(this._zeroLineCanvas);\n this._zeroLineCanvas = null;\n this._zeroLineContext = null;\n }\n }\n\n clear() {\n if (this._webgl) {\n this._lineProgram.clear();\n // Also clear the overlay canvas if it exists (for multi shadow charts)\n if (this._overlayContext) {\n this._overlayContext.clearRect(0, 0, this._overlayCanvas.width, this._overlayCanvas.height);\n }\n // Reset the initialization flag so canvas can be resized if needed\n this._overlayCanvasInitialized = false;\n } else {\n this._context.clearRect(0, 0, this._context.canvas.width, this._context.canvas.height);\n }\n }\n\n render(singleSeries, inRenderSpace, { highlighted, showIndividualPoints, shadowColor, shadowBlur, width, defaultLineWidth, bounds, globalBounds, inRenderSpaceAreaBottom }) {\n if (!this._initialized || !this._context || !this._canvas) {\n console.warn('GraphBodyRenderer: Cannot render - not initialized, missing context, or missing canvas');\n return;\n }\n \n let cutoffIndex = -1;\n let cutoffTime = null; \n let cutoffData = singleSeries.data; \n\n const isObjectFormat = singleSeries.data && singleSeries.data.length > 0 && \n typeof singleSeries.data[0] === 'object' && \n !Array.isArray(singleSeries.data[0]);\n \n if (isObjectFormat && singleSeries.cutoffTime) {\n cutoffData = singleSeries.data.map(point => {\n const xValue = point[singleSeries.xKey || 'x'];\n const yValue = point[singleSeries.yKey || 'y'];\n \n const convertedX = typeof xValue === 'string' ? new Date(xValue) : xValue;\n \n return [convertedX, yValue];\n });\n }\n \n if (singleSeries.cutoffTime && singleSeries.data && singleSeries.data.length > 0) {\n let cutoffDate;\n if (singleSeries.cutoffTime === 'now') {\n cutoffDate = new Date();\n } else if (typeof singleSeries.cutoffTime === 'number') {\n cutoffDate = new Date(singleSeries.cutoffTime);\n } else {\n cutoffDate = singleSeries.cutoffTime;\n }\n \n cutoffTime = cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n \n for (let i = 0; i < cutoffData.length - 1; i++) {\n const currentPoint = cutoffData[i];\n const nextPoint = cutoffData[i + 1];\n \n const currentTime = currentPoint[0] instanceof Date ? currentPoint[0].getTime() : currentPoint[0];\n const nextTime = nextPoint[0] instanceof Date ? nextPoint[0].getTime() : nextPoint[0];\n \n if (currentTime <= cutoffTime && cutoffTime <= nextTime) {\n const timeRatio = (cutoffTime - currentTime) / (nextTime - currentTime);\n cutoffIndex = i + timeRatio;\n break;\n } else if (currentTime > cutoffTime) {\n cutoffIndex = i;\n break;\n }\n }\n \n if (cutoffIndex === -1) {\n cutoffIndex = cutoffData.length - 1;\n }\n }\n \n const getIndividualPoints = (useDataSpace, includeBeyondBounds = false) => {\n if (!useDataSpace && inRenderSpace && inRenderSpace.yValues && !showIndividualPoints) {\n if (!bounds) {\n bounds = singleSeries.axis.currentBounds;\n }\n \n const individualPoints = [];\n const { yValues, nullMask } = inRenderSpace;\n const threshold = yValues.length / 2;\n let pastThreshold = 0;\n const samples = [];\n \n for (let pixelX = 0; pixelX < yValues.length; pixelX++) {\n if (nullMask[pixelX] === 0) {\n const xCoord = pixelX * DPI_INCREASE;\n individualPoints.push([xCoord, yValues[pixelX]]);\n \n if (pixelX > threshold) {\n pastThreshold++;\n if (samples.length < 3) samples.push({pixelX, xCoord, nullMask: nullMask[pixelX]});\n }\n }\n }\n \n if (individualPoints.length < 50) {\n return getIndividualPoints(true, includeBeyondBounds);\n }\n\n return individualPoints;\n }\n\n if (!bounds) {\n bounds = singleSeries.axis.currentBounds;\n }\n\n const individualPoints = [];\n let data = singleSeries.inSelectedSpace.data;\n if (useDataSpace) {\n data = singleSeries.inDataSpace;\n }\n\n let boundsMinX = bounds.minX instanceof Date ? bounds.minX.getTime() : bounds.minX;\n let boundsMaxX = bounds.maxX instanceof Date ? bounds.maxX.getTime() : bounds.maxX;\n \n let foundBeyondBounds = false;\n let lastPointBeforeBounds = null;\n \n for (let i = 0; i < data.length; i++) {\n let x, y;\n \n if (Array.isArray(data[i])) {\n [x, y] = data[i];\n } else if (typeof data[i] === 'object' && data[i] !== null) {\n x = data[i][singleSeries.xKey];\n y = data[i][singleSeries.yKey];\n } else {\n continue;\n }\n \n if (y === null || y === undefined) {\n continue;\n }\n\n let xValue = x instanceof Date ? x.getTime() : x;\n \n if (xValue < boundsMinX) {\n if (includeBeyondBounds) {\n lastPointBeforeBounds = [xValue, y];\n }\n continue;\n }\n \n if (xValue > boundsMaxX) {\n if (includeBeyondBounds && !foundBeyondBounds) {\n foundBeyondBounds = true;\n } else {\n break;\n }\n }\n\n const renderWidth = this._sizing.renderWidth / DPI_INCREASE;\n const xCoord = (xValue - boundsMinX) / (boundsMaxX - boundsMinX) * (renderWidth - 1) * DPI_INCREASE;\n const yCoord = (1.0 - (y - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight;\n \n individualPoints.push([xCoord, yCoord]);\n }\n\n if (lastPointBeforeBounds && includeBeyondBounds) {\n const [beforeXValue, beforeY] = lastPointBeforeBounds;\n const renderWidth = this._sizing.renderWidth / DPI_INCREASE;\n const beforeXCoord = (beforeXValue - boundsMinX) / (boundsMaxX - boundsMinX) * (renderWidth - 1) * DPI_INCREASE;\n const beforeYCoord = (1.0 - (beforeY - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight;\n individualPoints.unshift([beforeXCoord, beforeYCoord]);\n }\n\n return individualPoints;\n };\n\n const getRanges = () => {\n if (!bounds) {\n bounds = singleSeries.axis.currentBounds;\n }\n\n if (!singleSeries.rangeKey) {\n return [];\n }\n\n const inferredType = inferType(singleSeries, { useSimpleData: true });\n if (inferredType !== 'objects') {\n return [];\n }\n\n return (singleSeries.simpleData || singleSeries.data).map((object) => {\n const range = object[singleSeries.rangeKey];\n\n if (!range) {\n return null;\n }\n\n const min = range.min;\n const max = range.max;\n const x = object[singleSeries.xKey];\n\n return {\n x,\n range,\n\n pixelX: (x - bounds.minX) / (bounds.maxX - bounds.minX) * this._sizing.renderWidth,\n pixelMinY: typeof min === 'number' ? (1.0 - (min - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight : null,\n pixelMaxY: typeof max === 'number' ? (1.0 - (max - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight : null\n };\n });\n };\n\n const cpuRendering = singleSeries.rendering === 'bar' || singleSeries.rendering === 'area';\n let commonCPUParams;\n\n if (cpuRendering) {\n if (this._webgl) {\n console.warn(`CPU rendering (${singleSeries.rendering}) is not supported with webgl={true}. Use webgl={false} or switch to 'line' rendering.`);\n return;\n }\n \n if (!this._context2d) {\n this._context2d = this._canvas.getContext('2d', { willReadFrequently: false });\n }\n \n if (!this._context2d) {\n console.error('Failed to get 2D context for CPU rendering');\n return;\n }\n\n if (this._webgl) {\n this._context.flush();\n }\n\n if (!bounds) {\n bounds = singleSeries.axis?.currentBounds;\n }\n\n if (!bounds) {\n console.error('No bounds available for rendering');\n return;\n }\n\n const zero = singleSeries.zeroLineY === 'bottom' ?\n this._sizing.renderHeight :\n (1.0 - ((singleSeries.zeroLineY || 0) - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight;\n\n commonCPUParams = {\n context: this._context2d,\n color: getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex),\n sizing: this._sizing,\n zero,\n hasNegatives: !!singleSeries.inDataSpace.find((tuple) => tuple[1] < 0),\n negativeColor: singleSeries.negativeColor,\n zeroWidth: singleSeries.zeroLineWidth,\n zeroColor: singleSeries.zeroLineColor\n };\n\n if (!commonCPUParams.hasNegatives && singleSeries.expandYWith) {\n commonCPUParams.hasNegatives = singleSeries.expandYWith.some((y) => y < 0);\n }\n }\n\n if (singleSeries.rendering === 'bar') {\n const barSeriesInAxis = singleSeries.axis.series.filter(s => s.rendering === 'bar');\n let barClosestSpacing = null;\n for (const s of barSeriesInAxis) {\n const sp = s.dataBounds?.closestSpacing;\n if (sp != null && sp > 0 && (barClosestSpacing === null || sp > barClosestSpacing)) {\n barClosestSpacing = sp;\n }\n }\n let barParams = {\n ...commonCPUParams,\n indexInAxis: barSeriesInAxis.indexOf(singleSeries),\n axisSeriesCount: barSeriesInAxis.length,\n closestSpacing: barClosestSpacing || globalBounds.closestSpacing,\n bounds\n };\n\n if (singleSeries.cutoffTime) {\n barParams.cutoffIndex = cutoffIndex;\n barParams.cutoffOpacity = singleSeries.cutoffOpacity !== undefined ? singleSeries.cutoffOpacity : 0.35;\n barParams.originalData = cutoffData;\n barParams.renderCutoffGradient = cutoffIndex >= 0; \n \n const selection = this === this._stateController.rangeGraphRenderer \n ? this._stateController._bounds \n : (this._stateController._selection || this._stateController._bounds);\n barParams.selectionBounds = selection;\n }\n\n drawBars(getIndividualPoints(true), barParams);\n return;\n }\n\n if (singleSeries.rendering === 'area') {\n let areaParams = {\n ...commonCPUParams,\n showIndividualPoints: typeof singleSeries.showIndividualPoints === 'boolean' ? singleSeries.showIndividualPoints : showIndividualPoints,\n gradient: singleSeries.gradient,\n negativeGradient: singleSeries.negativeGradient,\n pointRadius: singleSeries.pointRadius,\n minPointSpacing: singleSeries.minPointSpacing,\n highlighted,\n width: width || singleSeries.width || defaultLineWidth,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom\n };\n\n if (singleSeries.cutoffTime) {\n areaParams.cutoffIndex = cutoffIndex;\n areaParams.cutoffTimeValue = cutoffTime;\n areaParams.cutoffOpacity = singleSeries.cutoffOpacity !== undefined ? singleSeries.cutoffOpacity : 0.35;\n areaParams.originalData = cutoffData;\n areaParams.renderCutoffGradient = cutoffIndex >= 0; \n areaParams.isPreview = this === this._stateController.rangeGraphRenderer; \n \n const selection = this === this._stateController.rangeGraphRenderer \n ? this._stateController._bounds \n : (this._stateController._selection || this._stateController._bounds);\n areaParams.selectionBounds = selection;\n }\n\n drawArea(getIndividualPoints(true), inRenderSpace, areaParams);\n }\n\n if (singleSeries.rendering === 'shadow') {\n if (!this._webgl || !this._shadowProgram) {\n console.warn('Shadow rendering requires WebGL. Enable webgl={true} on your Grapher component.', {\n webgl: !!this._webgl,\n shadowProgram: !!this._shadowProgram,\n program: !!this._shadowProgram?._program\n });\n return;\n }\n \n if (!this._shadowProgram._program) {\n console.error('ShadowProgram has no valid WebGL program');\n return;\n }\n \n if (!inRenderSpace) {\n console.error('inRenderSpace is null for shadow rendering');\n return;\n }\n \n if (!bounds) {\n bounds = singleSeries.axis?.currentBounds;\n }\n \n if (!bounds) {\n console.error('No bounds available for shadow rendering');\n return;\n }\n \n let zero;\n if (singleSeries.zeroLineY === 'bottom') {\n zero = this._sizing.renderHeight;\n } else if (singleSeries.zeroLineY !== undefined) {\n zero = (1.0 - ((singleSeries.zeroLineY) - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight;\n } else {\n if (bounds.minY <= 0 && bounds.maxY >= 0) {\n zero = (1.0 - (0 - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight;\n } else {\n zero = this._sizing.renderHeight;\n }\n }\n \n const boundsChanged = !this._lastBounds || \n bounds.minY !== this._lastBounds.minY || \n bounds.maxY !== this._lastBounds.maxY || \n this._sizing.renderHeight !== this._lastRenderHeight;\n \n this._lastBounds = {...bounds};\n this._lastRenderHeight = this._sizing.renderHeight;\n \n if (boundsChanged && this._lastShadowCache) {\n this._lastShadowCache = null;\n }\n \n if (zero > this._sizing.renderHeight * 1.5) {\n zero = this._sizing.renderHeight;\n } else if (zero < -this._sizing.renderHeight * 0.5) {\n zero = 0;\n }\n \n const shadowColor = getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex);\n const hasNegatives = !!singleSeries.inDataSpace.find((tuple) => tuple[1] < 0);\n let shadowParams = {\n color: shadowColor,\n gradient: singleSeries.gradient || createDefaultGradient(shadowColor),\n negativeGradient: singleSeries.negativeGradient,\n hasNegatives,\n zero,\n sizing: this._sizing,\n inRenderSpaceAreaBottom\n };\n\n if (singleSeries.cutoffTime) {\n shadowParams.cutoffIndex = cutoffIndex;\n shadowParams.cutoffTimeValue = cutoffTime;\n shadowParams.cutoffOpacity = singleSeries.cutoffOpacity !== undefined ? singleSeries.cutoffOpacity : 0.35;\n shadowParams.originalData = cutoffData;\n shadowParams.renderCutoffGradient = cutoffIndex >= 0; \n shadowParams.isPreview = this === this._stateController.rangeGraphRenderer; \n\n const selection = this === this._stateController.rangeGraphRenderer \n ? this._stateController._bounds \n : (this._stateController._selection || this._stateController._bounds);\n shadowParams.selectionBounds = selection || bounds;\n }\n\n this._shadowProgram.draw(getIndividualPoints(false, true), shadowParams);\n \n if (this._webgl) {\n const gl = this._context;\n gl.disable(gl.BLEND);\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n }\n \n if (singleSeries.zeroLineWidth && singleSeries.zeroLineWidth > 0) {\n if (this._context2d) {\n this._context2d.save();\n this._context2d.strokeStyle = singleSeries.zeroLineColor || getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex);\n this._context2d.lineWidth = singleSeries.zeroLineWidth;\n this._context2d.globalCompositeOperation = 'source-over';\n \n this._context2d.beginPath();\n this._context2d.moveTo(0, zero);\n this._context2d.lineTo(this._sizing.renderWidth, zero);\n this._context2d.stroke();\n this._context2d.restore();\n } else {\n if (!this._zeroLineCanvas) {\n this._zeroLineCanvas = document.createElement('canvas');\n this._zeroLineCanvas.style.position = 'absolute';\n this._zeroLineCanvas.style.top = '0';\n this._zeroLineCanvas.style.left = '0';\n this._zeroLineCanvas.style.pointerEvents = 'none';\n this._zeroLineContext = this._zeroLineCanvas.getContext('2d');\n this._canvas.parentNode.insertBefore(this._zeroLineCanvas, this._canvas.nextSibling);\n }\n \n this._zeroLineCanvas.width = this._canvas.width;\n this._zeroLineCanvas.height = this._canvas.height;\n this._zeroLineCanvas.style.width = this._canvas.style.width;\n this._zeroLineCanvas.style.height = this._canvas.style.height;\n \n this._zeroLineContext.clearRect(0, 0, this._zeroLineCanvas.width, this._zeroLineCanvas.height);\n this._zeroLineContext.strokeStyle = singleSeries.zeroLineColor || getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex);\n this._zeroLineContext.lineWidth = singleSeries.zeroLineWidth;\n \n this._zeroLineContext.beginPath();\n this._zeroLineContext.moveTo(0, zero);\n this._zeroLineContext.lineTo(this._sizing.renderWidth, zero);\n this._zeroLineContext.stroke();\n }\n }\n }\n\n const isRangeGraph = this === this._stateController.rangeGraphRenderer;\n const shouldShowIndividualPoints = isRangeGraph \n ? false \n : (typeof singleSeries.showIndividualPoints === 'boolean' ? singleSeries.showIndividualPoints : showIndividualPoints);\n\n if (!bounds) {\n bounds = singleSeries.axis?.currentBounds || globalBounds;\n }\n\n let zero;\n if (singleSeries.zeroLineY === 'bottom') {\n zero = this._sizing.renderHeight;\n } else if (singleSeries.zeroLineY !== undefined && bounds) {\n zero = (1.0 - ((singleSeries.zeroLineY) - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight;\n } else if (bounds) {\n if (bounds.minY <= 0 && bounds.maxY >= 0) {\n zero = (1.0 - (0 - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight;\n } else {\n zero = this._sizing.renderHeight;\n }\n } else {\n zero = this._sizing.renderHeight;\n }\n const hasNegatives = !!singleSeries.inDataSpace.find((tuple) => tuple[1] < 0);\n\n // For WebGL shadow rendering, we need a separate 2D canvas overlay for lines/points\n // since WebGL and 2D contexts can't coexist on the same canvas\n let drawContext = this._context;\n \n if (this._webgl && singleSeries.rendering === 'shadow') {\n // Always create overlay for shadow charts since they need 2D context for drawLine\n if (!this._overlayCanvas) {\n this._overlayCanvas = document.createElement('canvas');\n this._overlayCanvas.style.position = 'absolute';\n this._overlayCanvas.style.top = '0';\n this._overlayCanvas.style.left = '0';\n this._overlayCanvas.style.pointerEvents = 'none';\n this._overlayContext = this._overlayCanvas.getContext('2d');\n this._canvas.parentNode.insertBefore(this._overlayCanvas, this._canvas.nextSibling);\n }\n \n // Size the overlay canvas to match the main canvas (only once when creating)\n if (!this._overlayCanvasInitialized) {\n this._overlayCanvas.width = this._canvas.width;\n this._overlayCanvas.height = this._canvas.height;\n this._overlayCanvas.style.width = this._canvas.style.width;\n this._overlayCanvas.style.height = this._canvas.style.height;\n this._overlayCanvasInitialized = true;\n }\n drawContext = this._overlayContext;\n } else if (this._context2d) {\n // For non-WebGL or non-shadow charts with 2D context\n drawContext = this._context2d;\n } else if (this._webgl) {\n // Fallback for WebGL: create a temporary context for drawing lines\n console.warn('Creating fallback 2D context for WebGL shadow chart');\n if (!this._fallbackContext) {\n const fallbackCanvas = document.createElement('canvas');\n fallbackCanvas.width = this._canvas.width;\n fallbackCanvas.height = this._canvas.height;\n this._fallbackContext = fallbackCanvas.getContext('2d');\n }\n drawContext = this._fallbackContext;\n }\n\n const drawParams = {\n color: getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex),\n context: drawContext,\n width: width || singleSeries.width || defaultLineWidth,\n shadowColor,\n shadowBlur,\n dashed: singleSeries.dashed,\n dashPattern: singleSeries.dashPattern,\n highlighted,\n showIndividualPoints: shouldShowIndividualPoints,\n pointRadius: singleSeries.pointRadius,\n minPointSpacing: singleSeries.minPointSpacing,\n getIndividualPoints,\n getRanges: singleSeries.rangeKey ? getRanges : null,\n rendering: singleSeries.rendering, // Pass rendering type for all charts\n negativeColor: singleSeries.negativeColor,\n hasNegatives,\n zero,\n zeroColor: singleSeries.zeroLineColor\n };\n \n if (this._webgl && singleSeries.rendering === 'shadow' && singleSeries.cutoffTime && (width > 0 || shouldShowIndividualPoints)) {\n drawParams.cutoffIndex = cutoffIndex;\n drawParams.cutoffTimeValue = cutoffTime;\n drawParams.cutoffOpacity = singleSeries.cutoffOpacity !== undefined ? singleSeries.cutoffOpacity : 0.35;\n drawParams.originalData = cutoffData;\n drawParams.renderCutoffGradient = cutoffIndex >= 0;\n \n const selection = this === this._stateController.rangeGraphRenderer \n ? this._stateController._bounds \n : (this._stateController._selection || this._stateController._bounds);\n drawParams.selectionBounds = selection || bounds;\n drawParams.currentBounds = bounds;\n }\n \n\n if (!inRenderSpace) {\n console.error('inRenderSpace is null for line rendering');\n return;\n }\n \n if (singleSeries.cutoffTime) {\n drawParams.cutoffIndex = cutoffIndex;\n drawParams.cutoffTimeValue = cutoffTime; \n drawParams.cutoffOpacity = singleSeries.cutoffOpacity !== undefined ? singleSeries.cutoffOpacity : 0.35;\n drawParams.originalData = cutoffData;\n drawParams.renderCutoffGradient = cutoffIndex >= 0;\n drawParams.currentBounds = bounds;\n drawParams.isPreview = this === this._stateController.rangeGraphRenderer;\n \n const selection = this === this._stateController.rangeGraphRenderer \n ? this._stateController._bounds \n : (this._stateController._selection || this._stateController._bounds);\n drawParams.selectionBounds = selection || bounds;\n }\n \n // For shadow rendering, always use 2D canvas for lines/points even with WebGL\n // This is because shadow uses WebGL for the fill but needs 2D canvas for lines/points\n // to support negativeColor and other features\n if (this._webgl && singleSeries.rendering !== 'shadow') {\n this._lineProgram.draw(inRenderSpace, drawParams);\n } else {\n drawLine(inRenderSpace, drawParams);\n }\n \n }\n\n renderBackground(inBackgroundSpace) {\n if (!inBackgroundSpace) {\n return;\n }\n\n if (this._webgl) {\n if (!this._backgroundProgram) {\n this._backgroundProgram = new BackgroundProgram(this._context);\n }\n \n this._backgroundProgram.draw(inBackgroundSpace);\n } else {\n drawBackground(inBackgroundSpace, {\n context: this._context\n });\n }\n }\n\n /**\n * Initializes canvas\n * Currently, just sets sizing\n */\n async _initializeCanvas() {\n this._sizing = await sizeCanvas(this._canvas, this._context);\n\n this.emit('size_changed', this._sizing);\n this._stateController.markSizeChanged();\n\n if (window.ResizeObserver) {\n let first = true;\n let disabled = false;\n\n this._resizeObserver = new window.ResizeObserver( () => {\n if (first) { // always fires once at the beginning\n first = false;\n return;\n }\n\n if (disabled) {\n return;\n }\n\n disabled = true;\n this.resize().then(() => {\n disabled = false;\n });\n });\n\n this._resizeObserver.observe(this._canvas.parentNode);\n }\n\n if (this._checkIntersection && window.IntersectionObserver) {\n this._intersectionObserver = new window.IntersectionObserver((entries) => {\n clearTimeout(this._intersectionTimeout);\n\n if (!entries[0].isIntersecting) {\n return;\n }\n\n this._intersectionTimeout = setTimeout(() => {\n this.resize();\n }, 50);\n }, {\n threshold: 0.1\n });\n\n this._intersectionObserver.observe(this._canvas.parentNode);\n }\n }\n\n async resize() {\n const sizingPromise = sizeCanvas(this._canvas, this._context, { reset: true });\n this._initialized = sizingPromise;\n\n this._sizing = await this._initialized;\n if (this._initialized !== sizingPromise) {\n return;\n }\n\n this.emit('size_changed', this._sizing);\n this._stateController.markSizeChanged(this);\n }\n\n resizeDebounced() {\n if (this._resizeTimeout) {\n clearTimeout(this._resizeTimeout);\n }\n\n this._resizeTimeout = setTimeout(() => {\n this.resize();\n this._resizeTimeout = null;\n }, 50);\n }\n\n recalculatePosition() {\n if (!this._sizing) {\n return;\n }\n\n this._sizing.boundingRect = this._canvas.getBoundingClientRect();\n }\n\n /**\n * Returns the bounding rect of the element\n *\n * @return {DOMRect}\n */\n get boundingRect() {\n return this._sizing?.boundingRect;\n }\n\n get sizing() {\n return this._sizing;\n }\n\n}\n","/**\n * Draws the background on a 2d canvas\n *\n * @param {Array<{ minXt: number, maxXt: number, color: string }>} data\n * @param {CanvasRenderingContext2D} context\n */\nexport default function drawBackground({ data }, { context }) {\n if (!context) {\n console.error('Canvas context is null in drawBackground');\n return;\n }\n \n const width = context.canvas.width;\n const height = context.canvas.height;\n\n for (let { minXt, maxXt, color } of data) {\n context.fillStyle = color;\n context.fillRect(minXt*width, 0, (maxXt - minXt)*width, height);\n }\n}\n","export function calculatePrecision(value) {\n return Math.max(-Math.log10(Math.abs(value)) + 2, 0);\n}\n\nexport function calculateTimePrecision(minDate, maxDate) {\n minDate = new Date(minDate);\n maxDate = new Date(maxDate);\n\n const range = maxDate.valueOf() - minDate.valueOf();\n if (range < 3*1000) {\n return 'ms';\n } else if (range < 10*60*1000) {\n return 's';\n } else {\n return 'm';\n }\n}\n\nexport function roundToPrecision(value, precision=null) {\n if (precision === null) {\n precision = calculatePrecision(value);\n }\n\n if (isNaN(precision) || precision > 100) {\n return value.toString();\n }\n\n const rounded = value.toFixed(Math.ceil(precision));\n let stripped = rounded;\n if (rounded.includes('.')) {\n stripped = stripped.replace(/\\.?0+$/g, '');\n }\n\n if (stripped === '') {\n return '0';\n }\n\n return stripped;\n}\n\nconst DATE_TIME_FORMATTERS = {};\n\n/**\n * Given a timezone string, gets the offset relative to utc in milliseconds\n * For example, America/New_York in winter is GMT-05:00, so it evaluates to -5*60*60*1000\n *\n * @param {String} timeZone - the time zone string\n * @param {Date} sampleDate - a date to use in the conversions, since it can be time-of-year dependent with Daylight Savings Time\n * @return {number|null}\n */\nexport function timezoneToOffsetMS(timeZone, sampleDate) {\n try { // formats are finicky, so give up rather than abort rendering\n let datetimeFormatter = DATE_TIME_FORMATTERS[timeZone];\n if (!datetimeFormatter) {\n let properTimeZone = timeZone;\n if (!timeZone || timeZone === 'local') {\n properTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n datetimeFormatter = new Intl.DateTimeFormat('en-US', {\n timeZone: properTimeZone,\n timeZoneName: 'longOffset'\n });\n DATE_TIME_FORMATTERS[timeZone] = datetimeFormatter;\n }\n\n const parts = datetimeFormatter.formatToParts(sampleDate);\n const offsetPart = parts.find(part => part.type === 'timeZoneName');\n\n if (!offsetPart) {\n return null;\n }\n\n if (offsetPart.value === 'GMT') {\n return 0;\n }\n\n if (!/^GMT[+-]\\d{2}:\\d{2}$/.test(offsetPart.value)) {\n return null;\n }\n\n const [hours, minutes] = offsetPart.value.slice(3).split(':');\n\n return parseInt(hours)*60*60*1000 + parseInt(minutes)*60*1000;\n } catch (e) {\n console.error(new Error(`Could not parse timezone offset for ${sampleDate} in ${timeZone}`)); // eslint-disable-line no-console\n console.error(e); // eslint-disable-line no-console\n return null;\n }\n}\n\n/**\n * Gets the Date object that represents the start of day in a given timezone\n * Note that this is still a native date object, so it will be in the local timezone\n * Its timestamp, however, will correspond to the start of the day in the given timezone\n *\n * @param date\n * @param timezone\n * @return {Date}\n */\nexport function startOfDayInTimezone(date, timezone) {\n if (!timezone) {\n const startOfDay = new Date(date);\n startOfDay.setHours(0, 0, 0, 0);\n return startOfDay;\n }\n\n const offset = timezoneToOffsetMS(timezone, date); // ms between timezone and utc\n let startOfDay = new Date(date);\n startOfDay.setUTCHours(0, 0, 0, 0);\n\n const difference = startOfDay.valueOf() - date.valueOf();\n\n // if we would have gone forward a day when offset is taken into account, we need to go back a day again\n if (difference > offset) {\n startOfDay = new Date(startOfDay.valueOf() - 24*60*60*1000);\n }\n\n return new Date(startOfDay.valueOf() - offset);\n}\n\nfunction formatTime(time, {precision, justTime, justDate, justMonthAndDay, unitOverride, clockStyle='24h', timeZone}) {\n const utc = timeZone && timeZone.toLowerCase() === 'utc';\n if (timeZone && !utc && timeZone !== 'local' && window.Intl && window.Intl.DateTimeFormat) {\n const offset = timezoneToOffsetMS(timeZone, time);\n const localOffset = timezoneToOffsetMS('local', time);\n\n if (typeof offset === 'number' && typeof localOffset === 'number') {\n time = new Date(time.valueOf() + offset - localOffset);\n }\n }\n\n const year = utc ? time.getUTCFullYear() : time.getFullYear();\n const month = (utc ? time.getUTCMonth() : time.getMonth()) + 1;\n const day = utc ? time.getUTCDate() : time.getDate();\n\n if (unitOverride === 'year') {\n return year.toString();\n }\n\n if (justDate) {\n return utc ? `${month}/${day}/${year}` : time.toLocaleDateString();\n }\n\n if (justMonthAndDay) {\n // eg Jan 19\n const monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n return `${monthNames[month - 1]} ${day}`;\n }\n\n const hours = utc ? time.getUTCHours() : time.getHours();\n const minutes = utc ? time.getUTCMinutes() : time.getMinutes();\n const seconds = utc ? time.getUTCSeconds() : time.getSeconds();\n const milliseconds = utc ? time.getUTCMilliseconds() : time.getMilliseconds();\n\n let timeString;\n\n if (clockStyle === '12h') {\n timeString = `${((hours + 11) % 12 + 1).toString()}:${minutes.toString().padStart(2, '0')}`;\n } else {\n timeString = `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}`;\n }\n\n if (precision === 's' || precision === 'ms') {\n timeString += `:${seconds.toString().padStart(2, '0')}`;\n }\n\n if (precision === 'ms') {\n timeString += `.${milliseconds.toString().padStart(3, '0')}`;\n }\n\n if (clockStyle === '12h') {\n timeString += hours >= 12 ? 'pm' : 'am';\n }\n\n if (justTime) {\n return timeString;\n }\n\n if (utc) {\n timeString += ' UTC';\n }\n\n return (utc ? `${month}/${day}/${year}` : time.toLocaleDateString()) + ' ' + timeString;\n}\n\nexport function formatX(x, {dates=false, precision=null, justTime=false, justDate=false, justMonthAndDay=false, clockStyle='24h', unitOverride, timeZone, integersOnly=false, inverseEnumMap}={}) {\n if (dates && !(x instanceof Date)) {\n x = new Date(x);\n\n if (isNaN(x)) {\n return 'Invalid Date';\n }\n }\n\n if (x instanceof Date) {\n return formatTime(x, {precision, justTime, justDate, justMonthAndDay, unitOverride, clockStyle, timeZone});\n }\n\n if (isNaN(x)) {\n return 'NaN';\n }\n\n if (inverseEnumMap) {\n if (Math.abs(x - Math.round(x)) > 1e-10) {\n return '';\n }\n\n return inverseEnumMap[Math.round(x)];\n }\n\n if (integersOnly && Math.abs(x - Math.round(x)) > 1e-10) {\n return '';\n }\n\n return roundToPrecision(x, precision);\n}\n\nexport function formatY(y, {precision=null, log=false}={}) {\n if (y === null) {\n return 'null';\n }\n\n if (isNaN(y)) {\n return 'NaN';\n }\n\n if (log) {\n return `10^${roundToPrecision(Math.log10(y), precision)}`;\n }\n\n return roundToPrecision(y, precision);\n}\n","export const Y_AXIS_WIDTH = 32;\nexport const BIG_Y_AXIS_LABEL_OFFSET = 20;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport {formatX, formatY} from '../helpers/format';\nimport {Y_AXIS_WIDTH} from '../helpers/axis_sizes';\nimport CustomPropTypes from '../helpers/custom_prop_types';\n\nfunction getYLabelContent({ yLabel, y, fullYPrecision}) {\n if (fullYPrecision && !yLabel) {\n if (y === undefined) {\n return 'undefined';\n }\n\n if (y === null) {\n return 'null';\n }\n\n return y.toString();\n }\n\n if (typeof yLabel === 'number') {\n if (fullYPrecision) {\n return yLabel.toString();\n } else {\n return formatY(yLabel);\n }\n }\n\n if (typeof yLabel === 'object') {\n return formatY(y);\n }\n\n return yLabel || formatY(y);\n}\n\nfunction TooltipLabel({ axisLabel, x, y, xLabel, yLabel, textLeft, textTop, includeSeriesLabel, includeXValue, includeYValue, includeXLabel, includeYLabel, fullYPrecision, formatXOptions }) {\n let i = 0;\n\n return (\n <g>\n {\n includeSeriesLabel &&\n <text x={textLeft} y={textTop + (i++)*12}>\n {axisLabel}\n </text>\n }\n\n {\n includeXValue &&\n <text x={textLeft} y={textTop + (i++) * 12}>\n {includeXLabel && 'x: '}{xLabel || formatX(x, formatXOptions)}\n </text>\n }\n\n {\n includeYValue &&\n <text x={textLeft} y={textTop + (i++) * 12}>\n {includeYLabel && 'y: '}{getYLabelContent({ yLabel, y, fullYPrecision})}\n </text>\n }\n </g>\n );\n}\n\nTooltipLabel.propTypes = {\n axisLabel: PropTypes.string,\n x: PropTypes.oneOfType([PropTypes.number, PropTypes.instanceOf(Date)]),\n y: PropTypes.number,\n xLabel: PropTypes.string,\n yLabel: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n textLeft: PropTypes.number.isRequired,\n textTop: PropTypes.number.isRequired,\n fullYPrecision: PropTypes.bool,\n formatXOptions: PropTypes.object,\n ...CustomPropTypes.TooltipOptionsRaw\n};\n\nexport default class Tooltip extends React.PureComponent {\n\n render() {\n const textPadding = 3;\n let height = 12*3 + 2*textPadding;\n\n if (!this.props.includeSeriesLabel) {\n height -= 12;\n }\n\n if (!this.props.includeXValue) {\n height -= 12;\n }\n\n if (!this.props.includeYValue) {\n height -= 12;\n }\n\n const caretSize = 7;\n const halfHeight = height/2;\n const caretPadding = 4;\n\n const textTop = -halfHeight + textPadding;\n\n const formatXOptions = {\n clockStyle: this.props.clockStyle,\n timeZone: this.props.timeZone\n };\n\n const passThroughProps = {\n includeSeriesLabel: this.props.includeSeriesLabel,\n includeXLabel: this.props.includeXLabel,\n includeYLabel: this.props.includeYLabel,\n includeXValue: this.props.includeXValue,\n includeYValue: this.props.includeYValue,\n formatXOptions\n };\n\n const preparedTooltips = this.props.tooltips.map((tooltip) => {\n const { x, y, pixelY, tooltipPixelY, pixelX, series, index, xLabel, yLabel, fullYPrecision } = tooltip;\n\n if (typeof pixelX !== 'number') {\n return null;\n }\n\n const axisLabel = (series.name || series.yKey || index).toString();\n let width = Math.max(axisLabel.length, (xLabel || formatX(x, formatXOptions)).length + 4, getYLabelContent({ yLabel, y, fullYPrecision}).length + 4) * 7.5;\n if (series.tooltipWidth) {\n width = series.tooltipWidth;\n }\n\n let fixedPosition = this.props.elementWidth < (width + 2*caretSize + 2*caretPadding);\n\n let multiplier = 1;\n if (pixelX >= this.props.elementWidth - (width + 2*caretSize + caretPadding)) {\n multiplier = -1;\n }\n\n if (pixelX < width + 2*caretSize + caretPadding && multiplier === -1) {\n fixedPosition = true;\n }\n\n if (y === null) {\n fixedPosition = true;\n }\n\n if (this.props.alwaysFixedPosition) {\n fixedPosition = true;\n }\n\n let textLeft = caretSize + caretPadding;\n if (multiplier < 0) {\n textLeft = -width - textLeft;\n } else {\n textLeft += 6;\n }\n\n if (!isFinite(pixelX)) {\n return null;\n }\n\n const markerTransform = `translate(${pixelX},${pixelY})`;\n const tooltipTransform = `translate(${pixelX},${tooltipPixelY ?? pixelY})`;\n\n const commonLabelProps = {\n fullYPrecision: fullYPrecision || this.props.maxPrecision,\n x,\n y,\n axisLabel,\n xLabel,\n yLabel,\n ...passThroughProps\n };\n\n let yTranslation = 0;\n let baseLeft;\n\n if (fixedPosition) {\n textLeft = 6;\n\n baseLeft = this.props.elementWidth / 2 - width / 2;\n\n if (width > this.props.elementWidth && !this.props.floating) {\n baseLeft -= Y_AXIS_WIDTH * this.props.axisCount / 2;\n }\n\n yTranslation = 18;\n\n if (this.props.floating) {\n if (this.props.floatPosition === 'bottom') {\n yTranslation = this.props.elementHeight + halfHeight + 4;\n } else {\n yTranslation = -height;\n }\n\n if (this.props.floatDelta) {\n yTranslation += this.props.floatDelta;\n }\n }\n }\n\n return {\n ...tooltip,\n label: axisLabel,\n indexInAxis: series?.axis?.series?.indexOf(series),\n axisLabel,\n width,\n fixedPosition,\n multiplier,\n textLeft,\n markerTransform,\n tooltipTransform,\n commonLabelProps,\n textTop,\n height,\n caretSize,\n halfHeight,\n caretPadding,\n yTranslation,\n baseLeft\n };\n }).filter(Boolean);\n\n const CustomTooltipComponent = this.props.customTooltip;\n\n let groupedTooltips;\n if (this.props.combineTooltips) {\n let combinationThreshold = 50; // in px how close tooltips should be to combine\n if (typeof this.props.combineTooltips === 'number') {\n combinationThreshold = this.props.combineTooltips;\n }\n\n groupedTooltips = [];\n\n for (let tooltip of preparedTooltips) {\n let added = false;\n for (let group of groupedTooltips) {\n if (Math.abs(group.pixelX - tooltip.pixelX) <= combinationThreshold) {\n group.tooltips.push(tooltip);\n if (tooltip.pixelX > group.pixelX) {\n group.pixelX = tooltip.pixelX;\n group.multiplier = tooltip.multiplier;\n }\n\n if (tooltip.pixelY < group.pixelY) {\n group.pixelY = tooltip.pixelY;\n }\n\n added = true;\n break;\n }\n }\n\n if (!added) {\n groupedTooltips.push({\n pixelX: tooltip.pixelX,\n pixelY: tooltip.pixelY,\n multiplier: tooltip.multiplier,\n tooltips: [tooltip]\n });\n }\n }\n\n for (let group of groupedTooltips) {\n let totalHeight = 0;\n let maxWidth = 0;\n\n // sort by indexInAxis\n group.tooltips.sort((a, b) => a.indexInAxis - b.indexInAxis);\n\n for (let i = 0; i < group.tooltips.length; i++) {\n group.tooltips[i].textTop = totalHeight;\n totalHeight += group.tooltips[i].height;\n maxWidth = Math.max(maxWidth, group.tooltips[i].width);\n }\n\n for (let i = 0; i < group.tooltips.length; i++) {\n group.tooltips[i].textTop -= totalHeight/2;\n group.tooltips[i].textTop += textPadding;\n }\n\n group.height = totalHeight;\n group.halfHeight = totalHeight / 2;\n group.caretSize = caretSize;\n group.width = maxWidth;\n }\n }\n\n return (\n <div className=\"grapher-tooltip\">\n <svg>\n {\n preparedTooltips.map((tooltip, i) => {\n const { color, fixedPosition, width, markerTransform, tooltipTransform, baseLeft, commonLabelProps, yTranslation, multiplier, textLeft, textTop } = tooltip;\n\n if (this.props.customTooltip || groupedTooltips) {\n return (\n <g key={i} transform={markerTransform} className=\"tooltip-item\">\n <circle r={4} fill={color}/>\n </g>\n );\n }\n\n // display in a fixed position if not wide enough\n if (fixedPosition) {\n return (\n <g key={i} className=\"tooltip-item tooltip-item-fixed\">\n <circle r={4} fill={color} transform={markerTransform} />\n\n <g transform={`translate(${baseLeft}, ${yTranslation})`}>\n <path stroke={color} d={`M0,0 V-${halfHeight} h${width} V${halfHeight} h${-width} V0`} />\n\n <TooltipLabel\n textLeft={textLeft} textTop={textTop}\n {...commonLabelProps}\n />\n </g>\n </g>\n );\n }\n\n return (\n <g key={i} className=\"tooltip-item\">\n <circle r={4} fill={color} transform={markerTransform} />\n\n <g transform={tooltipTransform}>\n <path stroke={color} d={`M${multiplier*caretPadding},0 L${multiplier*caretSize*2},-${caretSize} V-${halfHeight} h${multiplier*width} V${halfHeight} h${multiplier*-width} V${caretSize} L${multiplier*caretPadding},0`} />\n\n <TooltipLabel\n textLeft={textLeft} textTop={textTop}\n {...commonLabelProps}\n />\n </g>\n </g>\n );\n })\n }\n\n {\n !this.props.customTooltip && groupedTooltips &&\n groupedTooltips.map(({ tooltips, pixelX, pixelY, halfHeight, multiplier, color, width }, i) =>\n <g key={i} transform={`translate(${pixelX},${pixelY})`} className=\"tooltip-item\">\n <path stroke={color} d={`M${multiplier*caretPadding},0 L${multiplier*caretSize*2},-${caretSize} V-${halfHeight} h${multiplier*width} V${halfHeight} h${multiplier*-width} V${caretSize} L${multiplier*caretPadding},0`} />\n\n {\n tooltips.map((tooltip, j) =>\n <TooltipLabel\n key={j}\n textTop={tooltip.textTop}\n textLeft={tooltip.textLeft}\n {...tooltip.commonLabelProps}\n />\n )\n }\n </g>\n )\n }\n </svg>\n\n {\n this.props.customTooltip &&\n (groupedTooltips || preparedTooltips).map((tooltip, i) =>\n <div\n key={i}\n className=\"custom-tooltip-container\"\n style={{top: tooltip.pixelY, left: tooltip.pixelX}}\n >\n <CustomTooltipComponent {...tooltip} />\n </div>\n )\n }\n </div>\n );\n }\n\n}\n\nTooltip.defaultProps = {\n includeSeriesLabel: true,\n includeXLabel: true,\n includeYLabel: true,\n includeXValue: true,\n includeYValue: true\n};\n\nTooltip.propTypes = {\n mouseX: PropTypes.number.isRequired,\n mouseY: PropTypes.number.isRequired,\n elementHeight: PropTypes.number.isRequired,\n elementWidth: PropTypes.number.isRequired,\n tooltips: PropTypes.arrayOf(PropTypes.shape({\n x: PropTypes.oneOfType([PropTypes.number, PropTypes.instanceOf(Date)]),\n y: PropTypes.number,\n pixelY: PropTypes.number,\n color: PropTypes.string,\n xLabel: PropTypes.string,\n yLabel: PropTypes.any,\n fullYPrecision: PropTypes.bool\n })),\n axisCount: PropTypes.number.isRequired,\n maxPrecision: PropTypes.bool.isRequired,\n clockStyle: PropTypes.oneOf(['12h', '24h']),\n timeZone: PropTypes.string,\n ...CustomPropTypes.TooltipOptionsRaw\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nexport default class ContextMenu extends React.PureComponent {\n constructor(props) {\n super(props);\n this.setTextRef = this.setTextRef.bind(this);\n }\n \n setTextRef(ref) {\n this.textRef = ref;\n\n if (this.props.contextMenu.showing && this.textRef) {\n const range = document.createRange();\n const selection = window.getSelection();\n\n selection.removeAllRanges();\n\n range.selectNodeContents(this.textRef);\n selection.addRange(range);\n this.textRef.focus();\n }\n }\n \n formatDateTime(dateTimeStr) {\n const [datePart, timePart] = dateTimeStr.split(', ');\n\n const [month, day, year] = datePart.split('/');\n const formattedDate = `${month.padStart(2, '0')}/${day.padStart(2, '0')}/${year}`;\n\n const [time, period] = timePart.split(' ');\n const [hours, minutes] = time.split(':');\n const formattedHours = hours.padStart(2, '0');\n const formattedTime = `${formattedHours}:${minutes} ${period}`;\n\n return `${formattedDate} ${formattedTime}`;\n }\n \n render() {\n const { x, y, showing, value } = this.props.contextMenu;\n\n const style = { left: x, top: y, width: '150px'};\n \n if (!showing || !value || value.toLocaleString() === 'Invalid Date' || isNaN(x) || isNaN(y)) {\n return null;\n }\n\n const displayValue = value instanceof Date ? this.formatDateTime(value.toLocaleString()) : value;\n return (\n <div className=\"grapher-context-menu\" style={style}>\n <div className=\"menu-item\">\n <div className=\"menu-text\" autoFocus={true} ref={this.setTextRef}>\n {displayValue}\n </div>\n </div>\n </div>\n );\n }\n\n}\n\nContextMenu.propTypes = {\n contextMenu: PropTypes.shape({\n x: PropTypes.number,\n y: PropTypes.number,\n showing: PropTypes.bool,\n value: PropTypes.oneOfType([\n PropTypes.instanceOf(Date),\n PropTypes.number,\n PropTypes.object\n ])\n }).isRequired\n};\n","import inferType from '../infer_type';\nimport { SIMPLE_DATA_TYPES } from '../data_types';\n\n/**\n * Given a series of a simple type (ie, not a function or an observable), converts it into data space\n *\n * @param {*} singleSeries\n * @param {Object} options\n * @return {*}\n */\nexport default function simpleSeriesToDataSpace(singleSeries, options={}) {\n const type = inferType(singleSeries, { useSimpleData: true, data: options.data });\n if (!SIMPLE_DATA_TYPES.includes(type)) {\n throw new Error(`Cannot normalize ${type} (expected a simple type)`);\n }\n\n const result = {\n tuples: tuplesToDataSpace,\n values: valuesToDataSpace,\n objects: objectsToDataSpace\n }[type](options.data || singleSeries.simpleData || singleSeries.data, singleSeries, options);\n\n let inDataSpace;\n let rangeValues = [];\n let windDirections = null;\n let windData = null;\n\n if (Array.isArray(result)) {\n inDataSpace = result;\n } else {\n inDataSpace = result.data;\n rangeValues = result.rangeValues || [];\n windDirections = result.windDirections || null;\n windData = result.windData || null;\n }\n\n if (singleSeries.square) {\n const square = [];\n let prevY = options.prevY;\n for (let tuple of inDataSpace) {\n if (prevY !== undefined) {\n square.push([tuple[0], prevY]);\n }\n square.push(tuple);\n prevY = tuple[1];\n }\n\n return square;\n }\n\n if (singleSeries.shiftXBy) {\n for (let tuple of inDataSpace) {\n if (typeof tuple[0] === 'string') {\n const originalXValue = tuple[0];\n tuple[0] = new Date(new Date(tuple[0]).valueOf() + singleSeries.shiftXBy);\n if (isNaN(tuple[0])) {\n tuple[0] = options.stateController.enumToNumber(originalXValue, singleSeries);\n }\n } else if (tuple[0] instanceof Date) {\n tuple[0] = new Date(tuple[0].valueOf() + singleSeries.shiftXBy);\n } else if (typeof tuple[0] === 'number') {\n tuple[0] += singleSeries.shiftXBy;\n }\n }\n }\n\n if (singleSeries.xUnixDates) {\n for (let tuple of inDataSpace) {\n if (typeof tuple[0] === 'number') {\n tuple[0] = new Date(tuple[0]*1000);\n }\n }\n }\n\n if (rangeValues.length > 0 || windDirections) {\n return {\n data: inDataSpace,\n rangeValues: rangeValues,\n windDirections: windDirections,\n windData: windData\n };\n }\n\n return inDataSpace;\n}\n\n/**\n * Converts a values array to data space\n *\n * @param {Array<Number|String>} data\n * @param {Object} singleSeries\n * @param {Object} options\n * @param {Number} [options.valueXStart]\n * @param {StateController} options.stateController\n * @return {Array<Array<Number|Date|null>>}\n */\nfunction valuesToDataSpace(data, singleSeries, options) {\n const inDataSpace = [];\n\n for (let i = 0; i < data.length; i++) {\n let yValue = data[i];\n\n if (typeof yValue === 'string') {\n yValue = options.stateController.enumToNumber(yValue, singleSeries);\n }\n\n if (typeof yValue === 'boolean') {\n yValue = +yValue;\n }\n\n inDataSpace.push([i + (options.valueXStart || 0), yValue]);\n }\n\n return inDataSpace;\n}\n\n/**\n * Converts a tuples array to data space\n *\n * @param {Array<Array<Number|Date|null>>} data\n * @param {Object} singleSeries\n * @param {Object} options\n * @param {StateController} options.stateController\n * @return {Array<Array<Number|Date|null>>}\n */\nfunction tuplesToDataSpace(data, singleSeries, options) {\n return [...data.map(([ xValue, yValue]) => {\n if (yValue === undefined) {\n yValue = null;\n }\n\n if (typeof xValue === 'string') {\n const originalXValue = xValue;\n xValue = new Date(xValue);\n\n if (isNaN(xValue)) {\n xValue = options.stateController.enumToNumber(originalXValue, singleSeries, true);\n }\n }\n\n if (typeof yValue === 'string') {\n yValue = options.stateController.enumToNumber(yValue, singleSeries);\n }\n\n if (typeof yValue === 'boolean') {\n yValue = +yValue;\n }\n\n return [xValue, yValue];\n })];\n}\n\nfunction readBinaryFormatValue(view, offset, index) {\n const localOffset = view.getUint32(offset + 2 + Uint32Array.BYTES_PER_ELEMENT*index, true);\n\n if (localOffset === 0) {\n return null;\n }\n\n const type = view.getUint8(localOffset);\n\n if (type === 0) {\n return view.getFloat64(offset + localOffset + 1, true);\n } else if (type === 1 || type === 6) {\n return null;\n } else if (type === 3) {\n return new Date(view.getFloat64(offset + localOffset + 1, true));\n } else {\n throw new Error(`Binary format type ${type} not supported`);\n }\n}\n\n/**\n * Converts an objects array to data space\n *\n * @param {Array<Object>} data\n * @param {Object} series\n * @param {Object} options\n * @param {StateController} options.stateController\n * @return {Array<Array<Number|Date|null>>}\n */\nfunction objectsToDataSpace(data, series, options) {\n const hasWindKeys = series.windXKey && series.windYKey;\n\n if (!series.xKey || typeof series.xKey !== 'string') {\n throw new Error('xKey must be provided in the series');\n }\n\n if (!hasWindKeys && (!series.yKey || typeof series.yKey !== 'string')) {\n throw new Error('yKey must be provided in the series (or both windXKey and windYKey)');\n }\n\n const inDataSpace = [];\n const rangeValues = [];\n const windDirections = hasWindKeys ? [] : null;\n const windData = hasWindKeys ? [] : null;\n\n for (let point of data) {\n if (point.buffer instanceof ArrayBuffer) {\n const view = new DataView(point.buffer);\n const xIndex = point.channels[series.xKey];\n const yIndex = point.channels[series.yKey];\n\n for (let offset of point.offsets) {\n inDataSpace.push([readBinaryFormatValue(view, offset, xIndex), readBinaryFormatValue(view, offset, yIndex)]);\n }\n } else if (!hasWindKeys && Array.isArray(point[series.yKey])) {\n if (point[series.yKey].length && !Array.isArray(point[series.yKey][0]) && typeof point[series.yKey][0] === 'object') {\n for (let subpoint of point[series.yKey]) {\n let yValue = subpoint[series.yKey];\n if (yValue === undefined) {\n yValue = null;\n }\n\n if (typeof yValue === 'string') {\n yValue = options.stateController.enumToNumber(yValue, series);\n }\n\n if (typeof yValue === 'boolean') {\n yValue = +yValue;\n }\n\n let xValue = subpoint[series.xKey];\n if (typeof xValue === 'string') {\n xValue = new Date(xValue);\n }\n\n inDataSpace.push([xValue, yValue]);\n }\n } else {\n inDataSpace.push(...point[series.yKey]);\n }\n } else {\n let yValue;\n if (hasWindKeys) {\n const windX = point[series.windXKey];\n const windY = point[series.windYKey];\n if (windX != null && windY != null) {\n yValue = Math.sqrt(windX * windX + windY * windY);\n windDirections.push(Math.atan2(windY, windX));\n windData.push({ x: windX, y: windY });\n } else {\n yValue = null;\n windDirections.push(null);\n windData.push(null);\n }\n } else {\n yValue = point[series.yKey];\n if (yValue === undefined) {\n yValue = null;\n }\n\n if (typeof yValue === 'string') {\n yValue = options.stateController.enumToNumber(yValue, series);\n }\n\n if (typeof yValue === 'boolean') {\n yValue = +yValue;\n }\n }\n\n let xValue = point[series.xKey];\n if (typeof xValue === 'string') {\n xValue = new Date(xValue);\n }\n\n inDataSpace.push([xValue, yValue]);\n\n if (series.rangeKey && point[series.rangeKey]) {\n const range = point[series.rangeKey];\n if (typeof range === 'object' && range.min !== undefined && range.max !== undefined) {\n if (typeof range.min === 'number') {\n rangeValues.push(range.min);\n }\n if (typeof range.max === 'number') {\n rangeValues.push(range.max);\n }\n }\n }\n }\n }\n\n if (rangeValues.length > 0 || windDirections) {\n return {\n data: inDataSpace,\n rangeValues: rangeValues,\n windDirections: windDirections,\n windData: windData\n };\n }\n\n return inDataSpace;\n}\n","function finalizeBounds(bounds, { dates }) {\n const initial = (bounds.minX === null && bounds.maxX === null) || bounds.minY === null || bounds.maxY === null;\n\n for (let key of Object.keys(bounds)) {\n if (typeof bounds[key] !== 'number' && bounds[key] !== null) {\n bounds[key] = null;\n }\n }\n\n bounds.initial = initial;\n bounds.dates = dates;\n\n return bounds;\n}\n\nfunction percentileBounds(inDataSpace, bounds, {percentile=100, percentileAsymmetry=0, rangeValues=[]}={}) {\n let dates = false;\n\n bounds.minX = inDataSpace[0][0];\n if (bounds.minX instanceof Date) {\n bounds.minX = bounds.minX.valueOf();\n dates = true;\n }\n\n bounds.maxX = inDataSpace[inDataSpace.length - 1][0];\n if (bounds.maxX instanceof Date) {\n bounds.maxX = bounds.maxX.valueOf();\n dates = true;\n }\n\n const sortedByY = inDataSpace\n .filter(([_x, y]) => typeof y === 'number')\n .sort(([_x1, y1], [_x2, y2]) => y1 - y2);\n\n for (let rangeValue of rangeValues) {\n if (typeof rangeValue === 'number') {\n sortedByY.push([null, rangeValue]);\n }\n }\n sortedByY.sort(([_x1, y1], [_x2, y2]) => y1 - y2);\n\n if (!sortedByY.length) {\n return finalizeBounds(bounds, {dates});\n }\n\n const asymmetry = Math.min(Math.abs(percentileAsymmetry), (100-percentile)/2) * (percentileAsymmetry < 0 ? -1 : 1);\n const inBottomPercentile = (100-percentile)/2 + asymmetry;\n const inTopPercentile = (100-percentile)/2 - asymmetry;\n\n const startIndex = Math.floor((sortedByY.length-1)*inBottomPercentile/100);\n const endIndex = Math.floor((sortedByY.length-1)*(100-inTopPercentile)/100);\n\n bounds.minY = sortedByY[startIndex][1];\n bounds.maxY = sortedByY[endIndex][1];\n\n return finalizeBounds(bounds, {dates});\n}\n\nexport default function calculateDataBounds(inDataSpace, {percentile=100, percentileAsymmetry=0, rangeValues=[]}={}) {\n let bounds = {\n minX: null,\n maxX: null,\n minY: null,\n maxY: null,\n closestSpacing: null\n };\n\n if (percentile !== 100 && inDataSpace.length) {\n return percentileBounds(inDataSpace, bounds, {percentile, percentileAsymmetry, rangeValues});\n }\n\n let dates = false;\n let prevX = null;\n\n for (let [x, y] of inDataSpace) {\n if (x === null) {\n continue;\n }\n \n if (x instanceof Date) {\n x = x.valueOf();\n dates = true;\n }\n\n if (typeof bounds.minX !== 'number' || x < bounds.minX) {\n bounds.minX = x;\n }\n\n if (typeof bounds.maxX !== 'number' || x > bounds.maxX) {\n bounds.maxX = x;\n }\n\n if (typeof prevX === 'number' && typeof x === 'number') {\n const spacing = x - prevX;\n if (typeof bounds.closestSpacing !== 'number' || spacing < bounds.closestSpacing) {\n bounds.closestSpacing = spacing;\n }\n }\n prevX = x;\n\n if (typeof y !== 'number') {\n continue;\n }\n\n if (typeof bounds.minY !== 'number' || y < bounds.minY) {\n bounds.minY = y;\n }\n\n if (typeof bounds.maxY !== 'number' || y > bounds.maxY) {\n bounds.maxY = y;\n }\n }\n\n for (let rangeValue of rangeValues) {\n if (typeof rangeValue === 'number') {\n if (typeof bounds.minY !== 'number' || rangeValue < bounds.minY) {\n bounds.minY = rangeValue;\n }\n if (typeof bounds.maxY !== 'number' || rangeValue > bounds.maxY) {\n bounds.maxY = rangeValue;\n }\n }\n }\n \n return finalizeBounds(bounds, {dates});\n}\n","export default function mergeBounds(boundsList) {\n const mergedBounds = {\n minX: null,\n maxX: null,\n minY: null,\n maxY: null,\n closestSpacing: null,\n dates: false,\n initial: true\n };\n\n for (let { minX, maxX, minY, maxY, dates, initial, closestSpacing } of boundsList) {\n if (dates) {\n mergedBounds.dates = true;\n }\n\n if (initial) {\n continue;\n }\n mergedBounds.initial = false;\n\n if (minX !== null && (mergedBounds.minX === null || minX < mergedBounds.minX)) {\n mergedBounds.minX = minX;\n }\n\n if (maxX !== null && (mergedBounds.maxX === null || maxX > mergedBounds.maxX)) {\n mergedBounds.maxX = maxX;\n }\n\n if (closestSpacing !== null && (mergedBounds.closestSpacing === null || closestSpacing < mergedBounds.closestSpacing)) {\n mergedBounds.closestSpacing = closestSpacing;\n }\n\n if (minY !== null && (mergedBounds.minY === null || minY < mergedBounds.minY)) {\n mergedBounds.minY = minY;\n }\n\n if (maxY !== null && (mergedBounds.maxY === null || maxY > mergedBounds.maxY)) {\n mergedBounds.maxY = maxY;\n }\n }\n\n if (mergedBounds.minX === null) {\n mergedBounds.minX = 0;\n }\n\n if (mergedBounds.maxX === null) {\n mergedBounds.maxX = 0;\n }\n\n if (mergedBounds.closestSpacing === null) {\n mergedBounds.closestSpacing = 1;\n }\n\n if (mergedBounds.minY === null) {\n mergedBounds.minY = 0;\n }\n\n if (mergedBounds.maxY === null) {\n mergedBounds.maxY = 0;\n }\n\n return mergedBounds;\n}\n","/**\n * Expands bounds to give a little y padding\n *\n * @param {Object} bounds\n * @param {?Number} bounds.minY\n * @param {?Number} bounds.maxY\n * @param {?Number} bounds.minX\n * @param {?Number} bounds.maxX\n * @param {Array<Number>} [expandYWith]\n * @param {Number} [extendXForNBars=0]\n * @return {Object}\n */\nexport default function expandBounds(bounds, {expandYWith = [], extendXForNBars=0}) {\n const expandedBounds = Object.assign({}, bounds);\n for (let y of expandYWith) {\n if (y === null || y === undefined) {\n continue;\n }\n\n if (typeof expandedBounds.minY !== 'number' || y < expandedBounds.minY) {\n expandedBounds.minY = y;\n }\n\n if (typeof expandedBounds.maxY !== 'number' || y > expandedBounds.maxY) {\n expandedBounds.maxY = y;\n }\n }\n\n expandedBounds.unscaledMinY = expandedBounds.minY;\n expandedBounds.unscaledMaxY = expandedBounds.maxY;\n\n const range = expandedBounds.maxY - expandedBounds.minY;\n const midpoint = expandedBounds.minY + range/2;\n expandedBounds.minY = Math.min(expandedBounds.minY, midpoint - 1.05*range/2);\n expandedBounds.maxY = Math.max(expandedBounds.maxY, midpoint + 1.05*range/2);\n \n\n if (expandedBounds.minY === expandedBounds.maxY && expandedBounds.minY !== null) {\n if (expandedBounds.minY > 0) {\n expandedBounds.minY *= 0.95;\n expandedBounds.maxY *= 1.05;\n } else if (expandedBounds.minY < 0) {\n expandedBounds.minY *= 1.05;\n expandedBounds.maxY *= 0.95;\n } else {\n expandedBounds.minY -= 1;\n expandedBounds.maxY += 1;\n }\n }\n\n if (extendXForNBars && expandedBounds.minX !== expandedBounds.maxX && expandedBounds.minX !== null && expandedBounds.maxX !== null) {\n // Base expansion factor on expected bar count\n const barWidth = (expandedBounds.maxX - expandedBounds.minX) / extendXForNBars;\n expandedBounds.minX -= barWidth/2;\n expandedBounds.maxX += barWidth/2;\n }\n\n return expandedBounds;\n}\n","/**\n * Finds the closest point to the target\n *\n * @param {Array} data - the data, in data space\n * @param {Number} targetX - the x coordinate to get closest to\n * @param {Object} [searchParams]\n * @param {String} [searchParams.searchType] - whether to search for the closest, one before, or one after\n * @param {Boolean} [searchParams.returnIndex] - whether to return the index or the object itself\n * @param {Number} [startIndex] - where to start the search from\n * @param {Number} [endIndex] - where to end the search\n * @return {Array|Number}\n */\nexport default function binarySearch(data, targetX, searchParams={}, startIndex=0, endIndex=undefined) {\n if (endIndex === undefined) {\n endIndex = data.length - 1;\n }\n\n if (data.length === 0) {\n return searchParams.returnIndex ? -1 : [null, null];\n }\n\n const middleIndex = Math.floor((startIndex + endIndex)/2);\n\n if (targetX === data[middleIndex][0] || (data[middleIndex][0] instanceof Date && data[middleIndex][0].valueOf() === targetX)) {\n if (searchParams.returnIndex) {\n return middleIndex;\n } else {\n return data[middleIndex];\n }\n }\n\n if (startIndex === endIndex) {\n if (data[startIndex][0] < targetX && searchParams.searchType === 'before') {\n return searchParams.returnIndex ? startIndex : data[startIndex];\n } else if (data[startIndex][0] > targetX && searchParams.searchType === 'after') {\n return searchParams.returnIndex ? startIndex : data[startIndex];\n } else {\n return searchParams.returnIndex ? -1 : [null, null];\n }\n }\n\n if (endIndex - 1 === startIndex) {\n let index;\n\n if (searchParams.searchType === 'before') {\n index = startIndex;\n // index = (targetX <= data[startIndex][0]) ? startIndex : endIndex;\n } else if (searchParams.searchType === 'after') {\n index = endIndex;\n // index = (targetX >= data[endIndex][0]) ? endIndex : startIndex;\n } else {\n index = Math.abs(data[startIndex][0] - targetX) > Math.abs(data[endIndex][0] - targetX) ?\n endIndex :\n startIndex;\n }\n\n return searchParams.returnIndex ? index : data[index];\n }\n\n if (targetX > data[middleIndex][0]) {\n return binarySearch(data, targetX, searchParams, middleIndex, endIndex);\n }\n\n if (targetX < data[middleIndex][0]) {\n return binarySearch(data, targetX, searchParams, startIndex, middleIndex);\n }\n}\n","import binarySearch from '../../helpers/binary_search';\n\nfunction validateSelectedSpaceConversion({ data, inSelectedSpace, firstIndex, lastIndex, ignoreDiscontinuities }) { // eslint-disable-line no-unused-vars\n let correct = data.slice(firstIndex + 1, lastIndex);\n if (ignoreDiscontinuities) {\n correct = correct.filter(([_x, y]) => (y !== null && y !== undefined));\n }\n\n if (correct.length !== inSelectedSpace.length) {\n console.log({ // eslint-disable-line no-console\n data,\n attempt: inSelectedSpace.map(([x, y]) => [undateify(x), y]),\n correct: correct.map(([x, y]) => [undateify(x), y]),\n sdl: window.sdl\n });\n window.tacomaDataPaused = true;\n throw new Error('Failed to select via swap');\n }\n\n for (let i = 0; i < correct.length; i++) {\n if (undateify(correct[i][0]) !== undateify(inSelectedSpace[i][0]) || correct[i][1] !== inSelectedSpace[i][1]) {\n console.log({ // eslint-disable-line no-console\n i,\n attempt: inSelectedSpace.map(([x, y]) => [undateify(x), y]),\n correct: correct.map(([x, y]) => [undateify(x), y]),\n correctX: undateify(correct[i][0]),\n correctY: correct[i][1],\n attemptX: undateify(inSelectedSpace[i][0]),\n attemptY: inSelectedSpace[i][1]\n });\n window.tacomaDataPaused = true;\n throw new Error('Failed to select via swap');\n }\n }\n}\n\n/**\n * Converts from data space to selected space\n *\n * @param {Array<Array<Number>>} data\n * @param {{data: Array<Array<Number>>}|*} [swap]\n * @param {Number} minX\n * @param {Number} maxX\n * @param {Boolean} ignoreDiscontinuities\n * @param {Boolean} square\n * @return {{data: Array<Array<Number>>, lastAdded: boolean, firstAdded: boolean, afterIndex: Number, ignoreDiscontinuities: boolean, minX: Number, maxX: Number, beforeIndex: Number}}\n */\nexport default function dataSpaceToSelectedSpace({ data, swap, minX, maxX, ignoreDiscontinuities, square }) {\n if (!data.length || data.length && minX > data[data.length - 1][0] || data.length && maxX < data[0][0]) {\n //let previouslyEmpty = !data.length;\n return {\n data: [\n [minX, null],\n [maxX, null]\n ],\n firstAdded: true,\n lastAdded: true\n //previouslyEmpty\n };\n }\n\n let beforeIndex = binarySearch(data, minX, { searchType: 'before', returnIndex: true }) || 0;\n let afterIndex = binarySearch(data, maxX, { searchType: 'after', returnIndex: true }) || 0;\n if (afterIndex === -1) {\n afterIndex = 0;\n }\n\n while (beforeIndex >= 0 && data[beforeIndex][0] >= minX) {\n beforeIndex --;\n }\n\n while (afterIndex < data.length && data[afterIndex][0] <= maxX) {\n afterIndex ++;\n }\n\n let inSelectedSpace;\n let addToEndOnly = false;\n\n let firstAdded = false;\n let lastAdded = false;\n\n let beginningInterpolationIndex = beforeIndex;\n let endInterpolationIndex = afterIndex;\n if (ignoreDiscontinuities) {\n while (beginningInterpolationIndex >= 0 && data[beginningInterpolationIndex][1] === null) {\n beginningInterpolationIndex --;\n }\n while (endInterpolationIndex < data.length && data[endInterpolationIndex][1] === null) {\n endInterpolationIndex++;\n }\n }\n\n if (swap) {\n inSelectedSpace = swap.data;\n if (swap.lastAdded) {\n inSelectedSpace.pop();\n }\n if (minX === swap.minX) {\n addToEndOnly = true;\n }\n if (beforeIndex !== swap.beforeIndex) {\n addToEndOnly = false;\n if (swap.firstAdded) {\n inSelectedSpace.shift();\n }\n let index = swap.beforeIndex;\n while (index >= 0 && inSelectedSpace.length && inSelectedSpace[0][0] >= minX) {\n if (!ignoreDiscontinuities || data[index][1] || data[index][1] === 0) {\n inSelectedSpace.unshift(data[index]);\n }\n index --;\n }\n while (index < data.length && inSelectedSpace.length && inSelectedSpace[0][0] < minX) {\n inSelectedSpace.shift();\n index ++;\n }\n }\n\n if (ignoreDiscontinuities && !swap.ignoreDiscontinuities) {\n inSelectedSpace = inSelectedSpace.filter(([_x, y]) => (y !== null && y !== undefined));\n }\n\n if (beforeIndex === swap.beforeIndex && swap.firstAdded) {\n firstAdded = true;\n\n let interpolationIndex = beforeIndex + 1;\n if (ignoreDiscontinuities) {\n while (interpolationIndex < data.length && data[interpolationIndex][1] === null) {\n interpolationIndex ++;\n }\n }\n\n if (beginningInterpolationIndex === -1 && inSelectedSpace.length) {\n inSelectedSpace[0] = [minX, null];\n } else {\n if (square && inSelectedSpace.length) {\n inSelectedSpace[0] = [minX, data[beginningInterpolationIndex][1]];\n } else {\n if (inSelectedSpace.length) {\n inSelectedSpace[0] = [minX, interpolate(data, beginningInterpolationIndex, interpolationIndex, minX)];\n }\n }\n }\n if (data[beforeIndex + 1][0] === inSelectedSpace[0][0] && data[beforeIndex + 1][1] === inSelectedSpace[0][1]) {\n firstAdded = false;\n }\n }\n let lastIncluded = swap.afterIndex;\n if (swap.ignoreDiscontinuities && !ignoreDiscontinuities) {\n let nullIndex = beforeIndex + 1;\n let selectedIndex = 0;\n if (firstAdded) {\n selectedIndex ++;\n }\n while (selectedIndex <= inSelectedSpace.length && nullIndex < data.length && nullIndex < afterIndex) {\n if (data[nullIndex][0] <= maxX && data[nullIndex][1] === null && (!inSelectedSpace[selectedIndex] || inSelectedSpace[selectedIndex][0] !== data[nullIndex][0] || inSelectedSpace[selectedIndex][1] !== data[nullIndex][1])) {\n inSelectedSpace.splice(selectedIndex, 0, data[nullIndex]);\n if (nullIndex >= lastIncluded) {\n lastIncluded = nullIndex + 1;\n }\n }\n nullIndex ++;\n selectedIndex ++;\n }\n }\n\n let dataIndex = lastIncluded || 0;\n while (dataIndex < data.length && data[dataIndex][0] <= maxX) {\n if (data[dataIndex][0] >= minX) {\n if (!ignoreDiscontinuities || data[dataIndex][1] || data[dataIndex][1] === 0) {\n inSelectedSpace.push(data[dataIndex]);\n }\n }\n dataIndex ++;\n }\n while (inSelectedSpace.length && inSelectedSpace[inSelectedSpace.length - 1][0] > maxX) {\n inSelectedSpace.pop();\n }\n\n } else {\n inSelectedSpace = data.slice(beforeIndex + 1, afterIndex);\n if (ignoreDiscontinuities) {\n inSelectedSpace = inSelectedSpace.filter(([_x, y]) => (y !== null && y !== undefined));\n }\n }\n\n if (!inSelectedSpace.length) {\n if (square) {\n if (beginningInterpolationIndex < 0) {\n inSelectedSpace = [[minX, null], [maxX, null]];\n } else {\n inSelectedSpace = [[minX, data[beginningInterpolationIndex][1]], [maxX, data[beginningInterpolationIndex][1]]];\n }\n } else {\n inSelectedSpace = [[minX, interpolate(data, beginningInterpolationIndex, endInterpolationIndex, minX)], [maxX, interpolate(data, beginningInterpolationIndex, endInterpolationIndex, maxX)]];\n }\n firstAdded = true;\n lastAdded = true;\n }\n\n if (!addToEndOnly) {\n let interpolationIndex = beforeIndex + 1;\n if (ignoreDiscontinuities) {\n while (interpolationIndex < data.length && data[interpolationIndex][1] === null) {\n interpolationIndex ++;\n }\n }\n\n if (inSelectedSpace.length && inSelectedSpace[0][0] > minX) {\n firstAdded = true;\n if (beginningInterpolationIndex === -1) {\n inSelectedSpace.unshift([minX, null]);\n } else {\n if (square) {\n inSelectedSpace.unshift([minX, data[beginningInterpolationIndex][1]]);\n } else {\n inSelectedSpace.unshift([minX, interpolate(data, beginningInterpolationIndex, interpolationIndex, minX)]);\n }\n }\n }\n }\n\n if (inSelectedSpace.length && inSelectedSpace[inSelectedSpace.length - 1][0] < maxX) {\n lastAdded = true;\n\n let interpolationIndex = afterIndex - 1;\n if (ignoreDiscontinuities) {\n while (interpolationIndex >= 0 && data[interpolationIndex][1] === null) {\n interpolationIndex --;\n }\n }\n\n if (endInterpolationIndex === data.length) {\n inSelectedSpace.push([maxX, null]);\n } else {\n if (square) {\n inSelectedSpace.push([maxX, inSelectedSpace[inSelectedSpace.length - 1][1]]);\n } else {\n inSelectedSpace.push([maxX, interpolate(data, interpolationIndex, endInterpolationIndex, maxX)]);\n }\n }\n }\n\n if (inSelectedSpace.length === 1) {\n let begPoint;\n let endPoint;\n if (square) {\n if (beginningInterpolationIndex < 0) {\n begPoint = [minX, null];\n } else {\n begPoint = [minX, data[beginningInterpolationIndex][1]];\n }\n endPoint = [maxX, inSelectedSpace[0][1]];\n } else {\n begPoint = [minX, interpolate(data, beginningInterpolationIndex, beforeIndex + 1, minX)];\n endPoint = [maxX, interpolate(data, afterIndex - 1, endInterpolationIndex, maxX)];\n }\n inSelectedSpace.unshift(begPoint);\n inSelectedSpace.push(endPoint);\n firstAdded = true;\n lastAdded = true;\n }\n\n return {\n data: inSelectedSpace,\n minX,\n maxX,\n beforeIndex,\n afterIndex,\n firstAdded,\n lastAdded,\n ignoreDiscontinuities\n //previouslyEmpty: false\n };\n}\n\nfunction undateify(potentialDate) {\n if (potentialDate instanceof Date) {\n return potentialDate.valueOf();\n }\n\n return potentialDate;\n}\n\n/**\n * Finds the point at the boundary via interpolation\n *\n * @param {Array<Array<Number>>} data\n * @param {Number} firstIndex\n * @param {Number} secondIndex\n * @param {Number} boundary\n * @return {null|*}\n */\nfunction interpolate(data, firstIndex, secondIndex, boundary) {\n if (firstIndex < 0 || secondIndex < 0) {\n return null;\n }\n\n if (firstIndex >= data.length || secondIndex >= data.length) {\n return null;\n }\n\n if (firstIndex === secondIndex) {\n return data[firstIndex][1];\n }\n\n const [xBefore, yBefore] = data[firstIndex];\n const [xAfter, yAfter] = data[secondIndex];\n\n if (boundary === xBefore && yBefore !== null) {\n return yBefore;\n }\n\n if (boundary === xAfter && yAfter !== null) {\n return yAfter;\n }\n\n if (yBefore === null || yAfter === null) {\n return null;\n }\n\n const percent = (boundary - xBefore)/(xAfter - xBefore);\n if (percent < 0 || percent > 1) {\n return null;\n }\n\n return percent*(yAfter - yBefore) + yBefore;\n}\n","/**\n * Scales y min and max bounds according to linear or log\n *\n * @param {Number} minY\n * @param {Number} maxY\n * @param {'linear'|'log'} scale\n * @return {{minY: Number, maxY: Number}}\n */\nexport default function scaleBounds({ minY, maxY, scale }) {\n if (scale === 'log') {\n maxY = Math.log10(maxY);\n\n if (minY <= 0) {\n if (maxY > 0) {\n minY = -maxY;\n } else {\n minY = 2*maxY;\n }\n } else {\n minY = Math.log10(minY);\n }\n }\n\n return {\n minY,\n maxY\n };\n}\n","import scaleBounds from '../../renderer/scale_bounds';\nimport RustAPI from '../rust_api';\n\n\nfunction selectedSpaceToRenderSpaceInPlace({ data, renderWidth, renderHeight, minX, maxX, minY, maxY, scale }, { nullMask, yValues, minYValues, maxYValues }) {\n let i = 0;\n let prevI = i - 1;\n\n for (let pixelX = 0; pixelX < renderWidth; pixelX++) {\n // find the x value that corresponds to the x pixel\n const x = (pixelX/(renderWidth - 1))*(maxX - minX) + minX;\n\n // set i such that data[i][0] < x <= data[i+1][0]\n let minSeenY = null;\n let maxSeenY = null;\n\n if (i > 0 && i <= data.length && data[i - 1][1] === null) {\n i--;\n }\n\n if (i < data.length - 2 && data[i + 1][0] < x) {\n i++;\n }\n\n for (i; i < data.length - 2 && data[i + 1][0] < x; i++) {\n const curY = data[i][1];\n\n if (curY === null) {\n continue;\n }\n\n if (minSeenY === null || curY < minSeenY) {\n minSeenY = curY;\n }\n\n if (maxSeenY === null || curY > maxSeenY) {\n maxSeenY = curY;\n }\n }\n\n minYValues[pixelX] = minSeenY === null ? 0 : renderHeight*(1 - ((scale === 'log' ? Math.log10(minSeenY) : minSeenY) - minY)/(maxY - minY));\n maxYValues[pixelX] = maxSeenY === null ? 0 : renderHeight*(1 - ((scale === 'log' ? Math.log10(maxSeenY) : maxSeenY) - minY)/(maxY - minY));\n\n // pass any discontinuities along\n if (i >= data.length - 1 || data[i][1] === null || data[i + 1][1] === null) {\n const y = i >= data.length - 1 ? null : data[i][1];\n\n nullMask[pixelX] = ((y === null) << 0) | ((minSeenY === null) << 1) | ((maxSeenY === null) << 2);\n yValues[pixelX] = y === null ? 0 : renderHeight*(1 - ((scale === 'log' ? Math.log10(y) : y) - minY)/(maxY - minY));\n\n i++;\n\n continue;\n }\n\n // interpolate\n const [xBefore, yBefore] = data[i];\n const [xAfter, yAfter] = data[i + 1];\n\n const percent = (x - xBefore) / (xAfter - xBefore);\n let y = percent * (yAfter - yBefore) + yBefore;\n\n // we're at the first point after the direction changed. Don't interpolate\n if (prevI !== i) {\n y = yBefore;\n }\n\n // // two x's with the same value; common in area charts\n // // to avoid this from having gotten skipped over, save in either min or max as appropriate\n // if (i > 0 && data[i - 1][0] === data[i][0]) {\n // // 0: minY a\n // // 1: original a\n // // 2: minY b\n // // 3: original b\n //\n // const [xBeforeOffset, yBeforeOffset] = data[i - 1];\n // const [xAfter, yAfter] = data[i + 1];\n // }\n\n yValues[pixelX] = y === null ? 0 : renderHeight*(1 - ((scale === 'log' ? Math.log10(y) : y) - minY)/(maxY - minY));\n nullMask[pixelX] = ((y === null) << 0) | ((minSeenY === null) << 1) | ((maxSeenY === null) << 2);\n\n prevI = i;\n }\n}\n\n/**\n * Convert from selected space to value space\n *\n * @param data\n * @param {Object} [swap]\n * @param {Number} renderWidth - width, in pixels, of the area in which the graph is rendered\n * @param {Number} renderHeight - height, in pixels, of the area in which the graph is rendered\n * @param {Number} minX - the minimum x value that is rendered\n * @param {Number} maxX - the maximum x value that is rendered\n * @param {Number} minY - the minimum y value that is rendered\n * @param {Number} maxY - the maximum y value that is rendered\n * @param {'log'|'linear'} scale\n * @param {Boolean} [dataChanged] - if true, will not rely on the prior data state from swap being accurate\n * @return {{nullMask: Uint8Array, maxYValues: Float64Array, minYValues: Float64Array, yValues: Float64Array, dataF64: Float64Array, dataNullMask: Uint8Array}}\n */\nexport default function selectedSpaceToRenderSpace({ data, swap, renderWidth, renderHeight, minX, maxX, minY, maxY, scale, dataChanged }) {\n if (swap && swap.yValues.length !== renderWidth) {\n swap = null;\n }\n\n const nullMask = (swap && swap.nullMask) || new Uint8Array(renderWidth);\n nullMask.fill(0);\n const yValues = new Float64Array(renderWidth);\n const minYValues = new Float64Array(renderWidth);\n const maxYValues = new Float64Array(renderWidth);\n\n const scaledBounds = scaleBounds({ minY, maxY, scale});\n minY = scaledBounds.minY;\n maxY = scaledBounds.maxY;\n\n const inParams = { data, renderWidth, renderHeight, minX, maxX, minY, maxY, scale };\n\n let dataF64, dataNullMask;\n\n if (RustAPI()) {\n let copyIndexStart = 0;\n\n const hasSwap = swap && swap.dataNullMask && swap.dataF64;\n const useSwap = !dataChanged && hasSwap && swap.minX === minX && swap.maxX <= maxX && swap.length <= data.length;\n\n if (!useSwap || swap.dataNullMask.length < data.length) {\n const extraSpaceFactor = 1.25;\n dataF64 = new Float64Array(Math.floor(data.length*2*extraSpaceFactor));\n dataNullMask = new Uint8Array(Math.floor(data.length*extraSpaceFactor));\n\n if (useSwap) {\n dataNullMask.set(swap.dataNullMask);\n dataF64.set(swap.dataF64);\n }\n } else {\n dataF64 = swap.dataF64;\n dataNullMask = swap.dataNullMask;\n }\n\n if (useSwap) {\n copyIndexStart = Math.max(swap.length - 1, 0);\n }\n\n for (let i = copyIndexStart; i < data.length; i++) {\n dataF64[2*i] = data[i][0];\n dataF64[2*i + 1] = data[i][1];\n\n if (data[i][1] === null) {\n dataNullMask[i] = 1;\n } else {\n dataNullMask[i] = 0;\n }\n }\n RustAPI().selected_space_to_render_space(data.length, dataF64, dataNullMask, inParams, nullMask, yValues, minYValues, maxYValues);\n } else {\n selectedSpaceToRenderSpaceInPlace(inParams, { nullMask, yValues, minYValues, maxYValues });\n }\n\n return {\n nullMask,\n yValues,\n minYValues,\n maxYValues,\n dataF64,\n dataNullMask,\n minX,\n maxX,\n length: data.length\n };\n}\n","/**\n * Flattens simple data\n * Returns an array of tuples (x value, simple point)\n *\n * @param simpleData\n * @param series\n * @param inDataSpace\n * @return {[]}\n */\nexport default function flattenSimpleData(simpleData, {series, inDataSpace }) {\n const flattened = [];\n let fI = 0;\n\n for (let point of simpleData) {\n const yValue = extractYValue(point, series);\n\n if (series.yKey && Array.isArray(yValue)) {\n for (let subpoint of point[series.yKey]) {\n if (series.ignoreDiscontinuities && typeof subpoint[series.yKey] !== 'number' && !Array.isArray(subpoint)) {\n continue;\n }\n\n const x = inDataSpace[fI++][0];\n\n if (series.square && flattened.length > 0) {\n flattened.push([x, flattened[flattened.length - 1][1]]);\n }\n\n flattened.push([x, subpoint]);\n }\n\n continue;\n }\n\n if (series.ignoreDiscontinuities && (yValue === undefined || yValue === null)) {\n continue;\n }\n\n const x = inDataSpace[fI++][0];\n\n if (series.square && flattened.length > 0) {\n flattened.push([x, flattened[flattened.length - 1][1]]);\n }\n\n flattened.push([x, point]);\n }\n\n if (flattened.length !== inDataSpace.length) {\n console.warn('Flattening didn\\'t give the same length as it has in data space'); // eslint-disable-line no-console\n }\n\n return flattened;\n}\n\nexport function extractYValue(point, series) {\n if (series.yKey) {\n return point[series.yKey];\n }\n\n if (Array.isArray(point)) {\n if (point.length === 1) {\n return point[0];\n } else {\n return point[1];\n }\n }\n\n return point;\n}\n\nexport function extractXValue(point, series) {\n if (series.xKey) {\n return point[series.xKey];\n }\n\n if (Array.isArray(point)) {\n return point[0];\n }\n\n return point;\n}\n","import binarySearch from '../helpers/binary_search';\nimport scaleBounds from '../renderer/scale_bounds';\nimport getColor from '../helpers/colors';\nimport flattenSimpleData, {extractXValue, extractYValue} from '../helpers/flatten_simple_data';\nimport {getBarWidths} from '../renderer/draw_bars';\n\nconst DISTANCE_THRESHOLD = 20;\n\n/**\n * Figures out the tooltip state\n *\n * @param {Boolean} mousePresent\n * @param {Number} mouseX\n * @param {Number} mouseY\n * @param {Object} sizing\n * @param {Array<Object>} series\n * @param {Set} alwaysTooltipped\n * @param {Array<Object>} savedTooltips\n * @param {Boolean} [allTooltipped]\n * @param {Number} closestSpacing\n * @return {{mouseX: *, mouseY: *, elementWidth: number, elementHeight: number, tooltips: any[]}}\n */\nexport default function calculateTooltipState({mousePresent, mouseX, mouseY, sizing, series, alwaysTooltipped, savedTooltips, allTooltipped, closestSpacing }) {\n // filter out saved tooltips for nonexistent series\n savedTooltips = savedTooltips.filter((tooltip) => tooltip.series.axis);\n\n for (let savedTooltip of savedTooltips) {\n moveTooltip({ mouseX, mouseY, sizing}, savedTooltip);\n }\n\n if (!mousePresent) {\n return {\n mouseX,\n mouseY,\n elementWidth: sizing.elementWidth,\n elementHeight: sizing.elementHeight,\n tooltips: [...savedTooltips]\n };\n }\n\n const tooltips = [];\n\n let minDistance = Infinity;\n\n for (let i = 0; i < series.length; i++) {\n const singleSeries = series[i];\n\n if (singleSeries.hidden) {\n continue;\n }\n\n const axis = singleSeries.axis;\n\n const scale = axis.scale;\n const bounds = axis.currentBounds;\n const { minY, maxY } = scaleBounds({...bounds, scale });\n\n const trueX = mouseX/sizing.elementWidth * (bounds.maxX - bounds.minX) + bounds.minX;\n\n let data = singleSeries.inDataSpace;\n if (singleSeries.ignoreDiscontinuities) {\n data = data.filter((tuple) => typeof tuple[1] === 'number');\n }\n\n if (data.length === 0) {\n continue;\n }\n\n let dataMinX = data[0][0];\n let dataMaxX = data[data.length - 1][0];\n \n if (dataMinX instanceof Date) {\n dataMinX = dataMinX.getTime();\n }\n if (dataMaxX instanceof Date) {\n dataMaxX = dataMaxX.getTime();\n }\n \n const dataRange = dataMaxX - dataMinX;\n const padding = 0; \n\n if (trueX < dataMinX - padding || trueX > dataMaxX + padding) {\n continue;\n }\n\n const closestIndex = binarySearch(data, trueX, { returnIndex: true });\n const closestPoint = data[closestIndex];\n\n if (!closestPoint) {\n continue;\n }\n\n const [x, y] = closestPoint;\n\n if (x === null) {\n continue;\n }\n\n let pixelX = (x - bounds.minX)/(bounds.maxX - bounds.minX) * sizing.elementWidth;\n const pixelY = (1 - ((scale === 'log' ? Math.log10(y) : y) - minY)/(maxY - minY)) * sizing.elementHeight;\n\n if (pixelY > sizing.elementHeight || pixelY < 0) {\n continue;\n }\n\n const ignoreYDistanceCheck = alwaysTooltipped.has(singleSeries) || allTooltipped;\n let xDistanceThreshold = DISTANCE_THRESHOLD;\n let yDistanceThreshold = DISTANCE_THRESHOLD;\n let distanceThreshold = DISTANCE_THRESHOLD;\n\n if (singleSeries.rendering === 'bar') {\n const barSeriesInAxis = singleSeries.axis.series.filter(s => s.rendering === 'bar');\n const indexInAxis = barSeriesInAxis.indexOf(singleSeries);\n const axisSeriesCount = barSeriesInAxis.length;\n\n let barClosestSpacing = null;\n for (const s of barSeriesInAxis) {\n const sp = s.dataBounds?.closestSpacing;\n if (sp != null && sp > 0 && (barClosestSpacing === null || sp > barClosestSpacing)) {\n barClosestSpacing = sp;\n }\n }\n\n const { totalBarWidth, barWidth } = getBarWidths({\n closestSpacing: barClosestSpacing || closestSpacing,\n bounds,\n sizing,\n axisSeriesCount\n });\n\n // currently, pixelX is the center of all the bars\n // shift it to start at the far left, then shift it to the center of the individual bar\n pixelX -= totalBarWidth/2/sizing.pixelRatio;\n pixelX += (barWidth*(indexInAxis + 0.5))/sizing.pixelRatio;\n\n xDistanceThreshold = barWidth/2/sizing.pixelRatio;\n yDistanceThreshold = 100;\n distanceThreshold = xDistanceThreshold + yDistanceThreshold;\n }\n\n const xDistance = Math.abs(pixelX - mouseX);\n const yDistance = Math.abs(pixelY - mouseY);\n const distance = Math.sqrt((xDistance)**2 + (pixelY - mouseY)**2);\n\n if (!ignoreYDistanceCheck && (xDistance > xDistanceThreshold || yDistance > yDistanceThreshold || distance > distanceThreshold)) {\n continue;\n }\n\n let xLabel, yLabel;\n\n const simpleData = singleSeries.simpleData || singleSeries.data;\n\n const enumLike = simpleData.length && !!singleSeries.hasEnum;\n if (singleSeries.xLabel || singleSeries.yLabel || enumLike) {\n let simplePoint;\n\n if (simpleData.length === data.length) {\n simplePoint = simpleData[closestIndex];\n } else {\n const flattenedData = flattenSimpleData(simpleData, { series: singleSeries, inDataSpace: data });\n\n simplePoint = flattenedData[closestIndex][1];\n }\n\n if (singleSeries.xLabel) {\n xLabel = simplePoint[singleSeries.xLabel];\n } else if (singleSeries.hasXEnum) {\n xLabel = extractXValue(simplePoint, singleSeries);\n }\n\n if (singleSeries.yLabel) {\n yLabel = simplePoint[singleSeries.yLabel];\n } else if (enumLike) {\n yLabel = extractYValue(simplePoint, singleSeries);\n }\n }\n\n if (distance < minDistance) {\n minDistance = distance;\n }\n\n let color = getColor(singleSeries.color, i, singleSeries.multigrapherSeriesIndex);\n if (y < 0 && singleSeries.negativeColor) {\n color = singleSeries.negativeColor;\n } else if (y === 0 && singleSeries.zeroLineColor) {\n color = singleSeries.zeroLineColor;\n }\n\n const followMouse = singleSeries.followingMouseTooltip && alwaysTooltipped.has(singleSeries);\n const finalPixelY = isNaN(pixelY) ? sizing.elementHeight/2 : pixelY;\n \n tooltips.push({\n pixelWidth: sizing.elementWidth,\n pixelX: pixelX,\n pixelY: finalPixelY,\n tooltipPixelY: followMouse ? mouseY : finalPixelY,\n x,\n y,\n color,\n distance,\n xDistance,\n index: i,\n series: singleSeries,\n xLabel,\n yLabel,\n fullYPrecision: singleSeries.fullYPrecision,\n ignoreYDistanceCheck\n });\n }\n\n const unsavedTooltips = tooltips.filter(({ distance, ignoreYDistanceCheck }) => {\n return distance === minDistance || ignoreYDistanceCheck;\n }).sort((a, b) => b.distance - a.distance);\n\n return {\n mousePresent,\n mouseX,\n mouseY,\n elementWidth: sizing.elementWidth,\n elementHeight: sizing.elementHeight,\n unsavedTooltipsCount: unsavedTooltips.length,\n tooltips: [...savedTooltips, ...unsavedTooltips]\n };\n}\n\n/**\n * Recalculates the tooltip position, given the new sizing, bounds, etc.\n *\n * @param {Number} mouseX\n * @param {Number} mouseY\n * @param {Object} sizing\n * @param {Object} tooltip - The tooltip object to move\n */\nexport function moveTooltip({ mouseX, mouseY, sizing }, tooltip) {\n const { x, y } = tooltip;\n\n const scale = tooltip.series.axis.scale;\n const bounds = tooltip.series.axis.currentBounds;\n const { minY, maxY } = scaleBounds({...bounds, scale });\n\n const pixelX = (x - bounds.minX)/(bounds.maxX - bounds.minX) * sizing.elementWidth;\n const pixelY = (1 - ((scale === 'log' ? Math.log10(y) : y) - minY)/(maxY - minY)) * sizing.elementHeight;\n\n const distance = Math.sqrt((pixelX - mouseX)**2 + (pixelY - mouseY)**2);\n const xDistance = Math.abs(pixelX - mouseX);\n\n Object.assign(tooltip, {\n pixelWidth: sizing.elementWidth,\n pixelX: pixelX,\n pixelY: isNaN(pixelY) ? sizing.elementHeight/2 : pixelY,\n xDistance,\n distance\n });\n}\n\nexport function toggleTooltipSaved({ currentTooltips, savedTooltips }) {\n if (!currentTooltips.length) {\n return savedTooltips;\n }\n\n const lastTooltip = currentTooltips[currentTooltips.length - 1];\n if (lastTooltip.xDistance > DISTANCE_THRESHOLD || (!lastTooltip.ignoreYDistanceCheck && lastTooltip.distance > DISTANCE_THRESHOLD)) {\n return savedTooltips;\n }\n\n const currentTooltipIndex = savedTooltips.findIndex((tooltip) => {\n return tooltip.x === lastTooltip.x && tooltip.y === lastTooltip.y;\n });\n\n if (currentTooltipIndex === -1) {\n return [...savedTooltips, lastTooltip];\n } else {\n return savedTooltips.filter((_, index) => index !== currentTooltipIndex);\n }\n}\n","const BOUND_CALCULATORS = {\n all: () => {},\n lastMinute: (globalBounds) => {\n if (!globalBounds.dates) {\n return;\n }\n\n return {\n minX: Math.max(new Date(globalBounds.maxX).valueOf() - 60*1000, globalBounds.minX)\n };\n },\n last10Minutes: (globalBounds) => {\n if (!globalBounds.dates) {\n return;\n }\n\n return {\n minX: Math.max(new Date(globalBounds.maxX).valueOf() - 10*60*1000, globalBounds.minX)\n };\n },\n lastHour: (globalBounds) => {\n if (!globalBounds.dates) {\n return;\n }\n\n return {\n minX: Math.max(new Date(globalBounds.maxX).valueOf() - 60*60*1000, globalBounds.minX)\n };\n },\n lastDay: (globalBounds) => {\n if (!globalBounds.dates) {\n return;\n }\n\n return {\n minX: Math.max(new Date(globalBounds.maxX).valueOf() - 24*60*60*1000, globalBounds.minX)\n };\n }\n};\n\nexport default BOUND_CALCULATORS;\n","const BUCKETS_PER_PIXEL = 2;\nconst CONDENSE_THRESHOLD = 2;\n\n/**\n * Condenses the dataset down to a lower number of points to make subsequent operations more efficient\n * Will only condense when data length passes a given threshold\n * Note that this works best on datasets that are relatively evenly distributed across the x axis\n *\n * @param {Array<Array>} data\n * @param {{data: [], minX: Number, maxX: Number, length: Number}} swap\n * @param {Number} minX\n * @param maxX\n * @param renderWidth\n * @param dataChanged\n * @return {{data: [], minX: Number, maxX: Number, length: Number}}\n */\nexport default function condenseDataSpace({ data, swap, minX, maxX, renderWidth, dataChanged }) {\n const targetBucketCount = renderWidth*BUCKETS_PER_PIXEL;\n\n const useSwap = !dataChanged && swap && swap.minX === minX && swap.maxX <= maxX && swap.length <= data.length;\n\n let partiallyCondensedData;\n if (useSwap) {\n partiallyCondensedData = swap.data;\n\n if (data.length > swap.length) {\n // always overwrite the last in case it was mangled by the selected space interpolation\n if (data.length > 0 && partiallyCondensedData.length > 0) {\n partiallyCondensedData[partiallyCondensedData.length - 1] = data[swap.length - 1];\n }\n\n partiallyCondensedData = partiallyCondensedData.concat(data.slice(swap.length));\n }\n } else {\n partiallyCondensedData = [...data];\n }\n\n if (partiallyCondensedData.length / targetBucketCount < CONDENSE_THRESHOLD*2) { // * 2 because min and max\n return {\n data: partiallyCondensedData,\n minX,\n maxX,\n length: data.length\n };\n }\n\n const condensedData = [];\n const bucketSize = (maxX - minX)/targetBucketCount;\n let minInBucket = null;\n let maxInBucket = null;\n let currentBucketIndex = 0;\n\n // always add the first point so that x ranges are preserved\n if (data.length) {\n condensedData.push(data[0]);\n }\n\n for (let tuple of partiallyCondensedData) {\n const [x, y] = tuple;\n\n if (y === null) {\n continue;\n }\n\n const bucketIndex = Math.floor((x - minX)/bucketSize);\n\n if (bucketIndex !== currentBucketIndex) {\n if (minInBucket && maxInBucket) {\n if (minInBucket === maxInBucket) {\n if (condensedData[condensedData.length - 1] !== minInBucket) {\n condensedData.push(minInBucket);\n }\n } else if (minInBucket[0] < maxInBucket[0]) {\n condensedData.push(maxInBucket, minInBucket);\n } else {\n condensedData.push(minInBucket, maxInBucket);\n }\n }\n\n minInBucket = null;\n maxInBucket = null;\n currentBucketIndex = bucketIndex;\n }\n\n if (!minInBucket || y < minInBucket[1]) {\n minInBucket = tuple;\n }\n\n if (!maxInBucket || y > maxInBucket[1]) {\n maxInBucket = tuple;\n }\n }\n\n if (minInBucket && maxInBucket) {\n if (minInBucket === maxInBucket) {\n condensedData.push(minInBucket);\n } else if (minInBucket[0] < maxInBucket[0]) {\n condensedData.push(maxInBucket, minInBucket);\n } else {\n condensedData.push(minInBucket, maxInBucket);\n }\n }\n\n // always add the last point so that x ranges are preserved\n if (data.length >= 2 && data[data.length - 1] !== minInBucket && data[data.length - 1] !== maxInBucket) {\n condensedData.push(data[data.length - 1]);\n }\n\n return {\n data: condensedData,\n minX,\n maxX,\n length: data.length\n };\n}\n","/**\n * Gets the proper name for a series\n *\n * @param {Object} singleSeries\n * @param {Number} index\n * @return {string}\n */\nexport default function nameForSeries(singleSeries, index) {\n let name = singleSeries.name || singleSeries.yKey;\n\n if (!name) {\n name = index.toString();\n }\n\n return name;\n}\n","export function selectedSpaceToBackgroundSpace({ data, background, minX, maxX }) {\n if (!background) {\n return null;\n }\n\n const conditions = [];\n for (let [key, color] of Object.entries(background)) {\n if (typeof color === 'object') {\n if (typeof color.evaluator !== 'function') {\n throw new Error('Invalid background declaration: ' + key + ' (evaluator must be a function)');\n }\n\n conditions.push(Object.assign({\n key,\n comparator: 'custom',\n comparedAgainst: null\n }, color));\n continue;\n }\n\n if (key === 'null') {\n conditions.push({\n evaluator: (y) => y === null && color,\n color,\n key,\n comparator: '=',\n comparedAgainst: null\n });\n continue;\n }\n\n const [comparator, value] = key.split(' ');\n if (!comparator || !value || isNaN(parseFloat(value))) {\n throw new Error('Invalid background declaration: ' + key);\n }\n\n const parsedValue = parseFloat(value);\n\n let evaluator;\n if (comparator === '=') {\n evaluator = (y) => typeof y === 'number' && y === parsedValue && color;\n } else if (comparator === '<') {\n evaluator = (y) => typeof y === 'number' && y < parsedValue && color;\n } else if (comparator === '>') {\n evaluator = (y) => typeof y === 'number' && y > parsedValue && color;\n } else if (comparator === '<=') {\n evaluator = (y) => typeof y === 'number' && y <= parsedValue && color;\n } else if (comparator === '>=') {\n evaluator = (y) => typeof y === 'number' && y >= parsedValue && color;\n } else {\n throw new Error('Invalid background declaration: ' + key);\n }\n\n conditions.push({\n evaluator,\n color,\n key,\n comparator,\n comparedAgainst: parsedValue\n });\n }\n\n const inBackgroundSpace = [];\n let currentSection = null;\n\n for (let i = 0; i < data.length; i++) {\n let [x, y] = data[i];\n if (x instanceof Date) {\n x = x.valueOf();\n }\n\n for (let condition of currentSection ? [currentSection.condition, ...conditions] : conditions) {\n const color = condition.evaluator(y);\n\n if (currentSection) {\n if (currentSection.color === color) {\n break;\n }\n\n let interpolatedMaxX = x;\n if (i > 0) {\n let [prevX, prevY] = data[i - 1];\n if (prevX instanceof Date) {\n prevX = prevX.valueOf();\n }\n\n if (currentSection.condition.comparedAgainst === null) {\n interpolatedMaxX = x;\n } else if (y === null) {\n interpolatedMaxX = prevX;\n } else {\n interpolatedMaxX = prevX + (condition.comparedAgainst - prevY)/(y - prevY)*(x - prevX);\n }\n }\n\n inBackgroundSpace.push({\n ...currentSection,\n maxX: interpolatedMaxX,\n maxXt: (interpolatedMaxX - minX)/(maxX - minX)\n });\n currentSection = null;\n }\n\n if (color) {\n let interpolatedMinX = x;\n if (i > 0) {\n let [prevX, prevY] = data[i - 1];\n if (prevX instanceof Date) {\n prevX = prevX.valueOf();\n }\n\n if (condition.comparedAgainst === null) {\n interpolatedMinX = prevX;\n } else if (prevY === null) {\n interpolatedMinX = x;\n } else {\n interpolatedMinX = prevX + (condition.comparedAgainst - prevY)/(y - prevY)*(x - prevX);\n }\n }\n\n currentSection = {\n minX: interpolatedMinX,\n minXt: (interpolatedMinX - minX)/(maxX - minX),\n color,\n condition\n };\n\n break;\n }\n }\n }\n\n if (currentSection) {\n inBackgroundSpace.push({\n ...currentSection,\n maxX: data[data.length - 1][0],\n maxXt: (data[data.length - 1][0] - minX)/(maxX - minX)\n });\n }\n\n return {\n data: inBackgroundSpace\n };\n}\n","import simpleSeriesToDataSpace from './space_conversions/simple_series_to_data_space';\nimport calculateDataBounds from './calculate_data_bounds';\nimport mergeBounds from './merge_bounds';\nimport expandBounds from './expand_bounds';\nimport selectionFromGlobalBounds from './selection_from_global_bounds';\nimport dataSpaceToSelectedSpace from './space_conversions/data_space_to_selected_space';\nimport selectedSpaceToRenderSpace from './space_conversions/selected_space_to_render_space';\nimport Eventable from '../eventable';\nimport boundCalculatorFromSelection from './bound_calculator_from_selection';\nimport calculateTooltipState, {toggleTooltipSaved} from './calculate_tooltip_state';\nimport getDefaultBoundsCalculator from './get_default_bounds_calculator';\nimport inferType from './infer_type';\nimport {SIMPLE_DATA_TYPES} from './data_types';\nimport generatorParamsEqual from '../helpers/generator_params_equal';\nimport findMatchingAxis from './find_matching_axis';\nimport {DPI_INCREASE} from '../renderer/size_canvas';\nimport {averageLoopTimes} from './average_loop_times';\nimport condenseDataSpace from './space_conversions/condense_data_space.js';\nimport calculateAnnotationsState from './calculate_annotations_state.js';\nimport {selectedSpaceToBackgroundSpace} from './space_conversions/selected_space_to_background_space.js';\nimport RustAPI, {RustAPIPromise} from './rust_api';\n\nexport default class StateController extends Eventable {\n\n constructor({ defaultBoundsCalculator, customBoundsSelectors, requireWASM, defaultShowIndividualPoints, defaultShowSidebar, defaultShowAnnotations, defaultShowOptions, syncPool, grapherID, sharedDataCache, sharedSubscriptions, fullscreen }) {\n super();\n\n this._requireWASM = requireWASM;\n if (requireWASM) {\n RustAPIPromise.then(() => {\n this._markDirty();\n });\n }\n\n this._series = [];\n this._seriesFromOriginalSeries = new Map();\n\n this._axes = [\n {\n series: [],\n scale: 'linear',\n side: 'left',\n axisIndex: 0\n }\n ];\n this._highlightedSeries = null;\n\n this._showIndividualPoints = defaultShowIndividualPoints || false;\n this._autoscaleY = true;\n this._percentile = 100;\n this._percentileAsymmetry = 0;\n this._showingOptions = defaultShowOptions;\n this._maxPrecision = false;\n this._showingSidebar = defaultShowSidebar || false;\n this._showingAnnotations = defaultShowAnnotations || false;\n this._grapherID = grapherID;\n this._fullscreen = fullscreen || false;\n\n this._alwaysTooltipped = new Set();\n this._tooltipState = {\n mousePresent: false,\n mouseX: 0,\n mouseY: 0,\n elementWidth: 0,\n elementHeight: 0,\n tooltips: []\n };\n this._contextMenuPosition = {\n x: 0,\n y: 0,\n showing: false,\n value: null\n };\n this._savedTooltips = [];\n this._draggingY = false;\n this._annotations = [];\n this._annotationsState = {\n elementWidth: 0,\n annotations: []\n };\n this._enumMap = {};\n this._hasXEnum = false;\n\n this._timingBuffer = [];\n this._timingIndex = 0;\n this._timingFrameCount = 0;\n\n this._modifiedSeries = new Set();\n this._deferredEmissions = {};\n this._deferredPriorityEmissions = {};\n this.primaryRenderer = null;\n this.rangeGraphRenderer = null;\n\n this._boundsCalculator = getDefaultBoundsCalculator(defaultBoundsCalculator, customBoundsSelectors);\n this._boundsHistory = [this._boundsCalculator];\n this._boundsIndex = 0;\n\n this._dataCache = sharedDataCache || new Map();\n this._subscriptions = sharedSubscriptions || new Map();\n this._subscriptionsShared = !!sharedSubscriptions;\n this._observablesToSeries = new Map();\n this._generators = new Set();\n this._generatorsToSeries = new Map();\n this._generatorCallArgs = new Map();\n this._seriesChangedFromPromises = new Set();\n\n this._syncPool = syncPool;\n if (this._syncPool) {\n this._syncPool.add(this);\n }\n\n this._onDataChange();\n }\n\n dispose() {\n this.emit('dispose', this);\n\n this.clearListeners();\n\n if (!this._subscriptionsShared) {\n for (let listener of this._subscriptions.values()) {\n listener.unsubscribe();\n }\n this._subscriptions.clear();\n }\n\n for (let singleSeries of this._series) {\n this._removeSeries(singleSeries);\n }\n\n if (this._syncPool) {\n this._syncPool.remove(this);\n }\n\n this.disposed = true;\n }\n\n setSeries(series) {\n const userSeries = this._series.filter((singleSeries) => singleSeries.userCreated);\n const propsSeries = this._series.filter((singleSeries) => !singleSeries.userCreated);\n\n if (series.length === propsSeries.length) {\n let anyDifferent = false;\n for (let i = 0; i < series.length; i++) {\n if (series[i] !== this._series[i].originalSeries) {\n anyDifferent = true;\n break;\n }\n }\n\n if (!anyDifferent) {\n return;\n }\n } else {\n this._mustResize = this._mustResize || this._fullscreen;\n }\n\n const newSeriesSet = new Set(series);\n for (let singleSeries of propsSeries) {\n if (!newSeriesSet.has(singleSeries.originalSeries)) {\n this._removeSeries(singleSeries);\n }\n }\n\n this._series.splice(0);\n for (let i = 0; i < series.length; i++) {\n const originalSeries = series[i];\n\n let singleSeries = this._seriesFromOriginalSeries.get(originalSeries);\n if (!singleSeries) {\n singleSeries = {\n ...originalSeries,\n originalSeries\n };\n this._seriesFromOriginalSeries.set(originalSeries, singleSeries);\n\n if (singleSeries.defaultAlwaysTooltipped) {\n this._alwaysTooltipped.add(singleSeries);\n this._tooltipsChanged = true;\n this.deferredEmit('always_tooltipped_changed', this._alwaysTooltipped);\n }\n }\n\n singleSeries.index = i;\n this._series.push(singleSeries);\n this._assignAxisTo(singleSeries);\n\n if (singleSeries.hidden) {\n this._hideSeries(singleSeries);\n }\n }\n\n for (let i = 0; i < userSeries.length; i++) {\n const singleSeries = userSeries[i];\n singleSeries.index = i + series.length;\n this._series.push(singleSeries);\n }\n\n this.deferredEmit('series_changed', this._series);\n\n this._dataChanged = true;\n this._markDirty();\n }\n\n _markDirty() {\n if (this._frameRequested) {\n return;\n }\n\n if (this._requireWASM && !RustAPI) {\n return;\n }\n\n const frameRequestStart = performance.now();\n this._frameRequested = true;\n requestAnimationFrame(() => {\n if (this.disposed) {\n return;\n }\n\n const frameExecutionStart = performance.now();\n\n const dataProcessingStart = performance.now();\n if (this._dataChanged) {\n this._onDataChange();\n this._mustRerender = true;\n this._tooltipsChanged = true;\n this._annotationsChanged = true;\n } else if (this._modifiedSeries.size) {\n this._onDataAdd(this._modifiedSeries);\n this._mustRerender = true;\n this._tooltipsChanged = true;\n this._annotationsChanged = true;\n } else {\n if (this._primarySizeChanged) {\n this._calculatePrimarySizeDependents();\n this._mustRerender = true;\n }\n if (this._rangeGraphSizeChanged) {\n this._calculateRangeGraphSizeDependents();\n this._mustRerender = true;\n }\n }\n const dataProcessingEnd = performance.now();\n\n const renderPipelineStart = performance.now();\n if (this._mustRerender) {\n this._render();\n }\n const renderPipelineEnd = performance.now();\n\n const generatorsStart = performance.now();\n if (this._mustCallGenerators) {\n this._callGenerators();\n }\n const generatorsEnd = performance.now();\n\n const tooltipStart = performance.now();\n if (this._tooltipsChanged) {\n this._recalculateTooltips();\n }\n const tooltipEnd = performance.now();\n\n const contextMenuStart = performance.now();\n if (this._contextMenuChanged) {\n this._recalculateContextMenu();\n }\n const contextMenuEnd = performance.now();\n\n const annotationStart = performance.now();\n if (this._annotationsChanged) {\n this._recalculateAnnotations();\n }\n const annotationEnd = performance.now();\n\n if (this._mustResize) {\n this.primaryRenderer.resizeDebounced();\n this.rangeGraphRenderer && this.rangeGraphRenderer.resizeDebounced();\n }\n\n this._frameRequested = false;\n this._mustRerender = false;\n this._dataChanged = false;\n this._primarySizeChanged = false;\n this._rangeGraphSizeChanged = false;\n this._modifiedSeries.clear();\n this._seriesChangedFromPromises.clear();\n this._tooltipsChanged = false;\n this._contextMenuChanged = false;\n this._annotationsChanged = false;\n this._mustCallGenerators = false;\n this._mustResize = false;\n\n const callbacksStart = performance.now();\n for (let emission of [...Object.values(this._deferredPriorityEmissions), ...Object.values(this._deferredEmissions)]) {\n this.emit(...emission);\n }\n const callbacksEnd = performance.now();\n this._deferredEmissions = {};\n this._deferredPriorityEmissions = {};\n\n const completionTime = performance.now();\n const loopTime = {\n frameExecution: completionTime - frameExecutionStart,\n frameRequestAndExecution: completionTime - frameRequestStart,\n generators: generatorsEnd - generatorsStart,\n dataProcessing: dataProcessingEnd - dataProcessingStart,\n renderPipeline: renderPipelineEnd - renderPipelineStart,\n tooltips: tooltipEnd - tooltipStart,\n contextMenu: contextMenuEnd - contextMenuStart,\n annotations: annotationEnd - annotationStart,\n callbacks: callbacksEnd - callbacksStart\n };\n this.lastLoopTime = loopTime;\n if (this._timingFrameCount) {\n if (this._timingBuffer.length < this._timingFrameCount) {\n this._timingBuffer.push(loopTime);\n } else {\n this._timingBuffer[this._timingIndex % this._timingFrameCount] = loopTime;\n }\n this._timingIndex++;\n }\n this.emit('render_time', completionTime - frameExecutionStart, loopTime);\n });\n }\n\n deferredEmit(...args) {\n this._deferredEmissions[args[0]] = args;\n }\n\n deferredPriorityEmit(...args) {\n this._deferredPriorityEmissions[args[0]] = args;\n }\n\n _seriesToSimpleData(singleSeries) {\n const type = inferType(singleSeries);\n if (SIMPLE_DATA_TYPES.includes(type)) {\n return singleSeries.data;\n }\n\n // get a reference to whatever you already have\n let currentData = this._dataCache.get(singleSeries.data);\n\n if (currentData && this._seriesChangedFromPromises.has(singleSeries.data)) {\n return currentData;\n }\n\n if (!currentData) {\n currentData = [];\n this._dataCache.set(singleSeries.data, currentData);\n singleSeries.simpleData = currentData;\n }\n\n if (type === 'object_observable' || type === 'tuple_observable') {\n let sameDataSet = this._observablesToSeries.get(singleSeries.data);\n if (sameDataSet) {\n const firstSameDataSeries = sameDataSet.values().next().value;\n currentData = firstSameDataSeries.simpleData;\n if (!currentData) {\n throw new Error(`Cannot find simpleData in ${firstSameDataSeries.name || firstSameDataSeries.yKey || firstSameDataSeries.data}`);\n }\n this._dataCache.set(singleSeries.data, currentData);\n singleSeries.simpleData = currentData;\n } else {\n sameDataSet = new Set();\n singleSeries.simpleData = currentData;\n this._observablesToSeries.set(singleSeries.data, sameDataSet);\n }\n\n sameDataSet.add(singleSeries);\n\n this._listenToObservableData({\n observable: singleSeries.data,\n currentData\n });\n }\n\n if (type === 'generator') {\n if (!this._generatorsToSeries.has(singleSeries.data)) {\n this._generatorsToSeries.set(singleSeries.data, new Set());\n }\n\n this._generatorsToSeries.get(singleSeries.data).add(singleSeries);\n\n if (!this._generators.has(singleSeries.data)) {\n this._generators.add(singleSeries.data);\n this._callGenerator(singleSeries.data);\n }\n }\n\n // return whatever you have; it'll fetch more in the background\n return currentData;\n }\n\n _listenToPromise(singleSeries, dataPromise) {\n dataPromise.then((resolved) => {\n this._dataCache.set(singleSeries.data, resolved);\n singleSeries.simpleData = resolved;\n this._seriesChangedFromPromises.add(singleSeries.data);\n this._dataChanged = true;\n this._markDirty();\n });\n }\n\n _listenToObservableData({ observable, currentData }) {\n if (this._subscriptions.has(observable)) { // someone else already listened to it\n return;\n }\n this._subscriptions.set(observable, true);\n\n // listen to the new data\n const listener = observable.observe((point) => {\n if (Array.isArray(point)) {\n for (let datum of point) {\n currentData.push(datum);\n }\n } else {\n currentData.push(point);\n }\n\n this.emit('observable_modified', observable);\n\n this.markObservableModified(observable);\n });\n this._subscriptions.set(observable, listener);\n }\n\n markObservableModified(observable) {\n if (!this._observablesToSeries.has(observable)) {\n return;\n }\n\n for (let singleSeries of this._observablesToSeries.get(observable)) {\n this._modifiedSeries.add(singleSeries);\n }\n this._markDirty();\n }\n\n _unsubscribeFromStaleSeries() {\n const currentSeries = new Set(this._series);\n for (let [observable, seriesSet] of this._observablesToSeries) {\n let stillHasListener = false;\n\n for (let singleSeries of seriesSet) {\n if (currentSeries.has(singleSeries)) {\n stillHasListener = true;\n break;\n }\n }\n\n if (!stillHasListener) {\n this._subscriptions.get(observable).unsubscribe();\n this._subscriptions.delete(observable);\n this._observablesToSeries.delete(observable);\n }\n }\n\n for (let [generator, seriesSet ] of this._generatorsToSeries) {\n let stillHasSeries = false;\n\n for (let singleSeries of seriesSet) {\n if (currentSeries.has(singleSeries)) {\n stillHasSeries = true;\n break;\n }\n }\n\n if (!stillHasSeries) {\n this._generatorsToSeries.delete(generator);\n this._generators.delete(generator);\n this._generatorCallArgs.delete(generator);\n }\n }\n }\n\n async _callGenerator(generator) {\n const parameters = {\n minX: this._selection.minX,\n maxX: this._selection.maxX,\n sizing: this.primaryRenderer.sizing\n };\n\n if (generatorParamsEqual(this._generatorCallArgs.get(generator), parameters)) {\n return;\n }\n this._generatorCallArgs.set(generator, parameters);\n\n // Note: potential race condition if generator is stupid. For now, we'll rely on generator being smart\n // Race condition: a new, faster one runs before completed\n const data = await Promise.resolve(generator(parameters));\n\n // do nothing if the generator returned nothing\n if (!data) {\n return;\n }\n\n // because calling the generator may have taken some time, check that there are still listeners for it\n if (!this._generatorsToSeries.has(generator)) {\n return;\n }\n\n this._dataChanged = true;\n this._markDirty();\n\n if (typeof data.observe === 'function') {\n const currentData = [];\n this._dataCache.set(generator, currentData);\n for (let singleSeries of this._generatorsToSeries.get(generator)) {\n singleSeries.simpleData = currentData;\n }\n\n for (let singleSeries of this._generatorsToSeries.get(generator)) {\n if (!this._observablesToSeries.has(data)) {\n this._observablesToSeries.set(data, new Set());\n }\n\n this._observablesToSeries.get(data).add(singleSeries);\n }\n\n this._listenToObservableData({\n observable: data,\n currentData\n });\n } else {\n this._dataCache.set(generator, data);\n for (let singleSeries of this._generatorsToSeries.get(generator)) {\n singleSeries.simpleData = data;\n }\n }\n }\n\n _callGenerators() {\n for (let generator of this._generators) {\n this._callGenerator(generator);\n }\n }\n\n _recalculateTooltips() {\n if (!this.primaryRenderer || !this.primaryRenderer.sizing) {\n return;\n }\n\n this._tooltipState = calculateTooltipState({\n mousePresent: this._tooltipState.mousePresent,\n mouseX: this._tooltipState.mouseX,\n mouseY: this._tooltipState.mouseY,\n sizing: this.primaryRenderer.sizing,\n series: this._series,\n alwaysTooltipped: this._alwaysTooltipped,\n savedTooltips: this._savedTooltips,\n allTooltipped: this._tooltipAllNext,\n closestSpacing: this._globalBounds.closestSpacing\n });\n this._tooltipAllNext = false;\n this.deferredEmit('tooltip_state_changed', this._tooltipState, this._tooltipStateArg);\n this._tooltipStateArg = null;\n }\n \n _recalculateContextMenu() {\n if (!this.primaryRenderer || !this.primaryRenderer.sizing) {\n return;\n }\n\n const boundingRect = this.primaryRenderer.boundingRect;\n const sizing = this.primaryRenderer.sizing;\n let value = null;\n let newX = null;\n \n for (let series of this._series) {\n const bounds = series.axis.currentBounds;\n \n newX = this._contextMenuPosition.x - boundingRect.left;\n \n // if it's on the right side, move it to the left one width\n if (this._contextMenuPosition.x > (boundingRect.right - sizing.elementWidth) * 2) newX -= 130;\n\n if (series.xKey === 'timestamp' || series.xKey === 'time' || series.xKey === 'date') {\n value = new Date((this._contextMenuPosition.x - boundingRect.left) / sizing.elementWidth * (bounds.maxX - bounds.minX) + bounds.minX);\n } else {\n value = (this._contextMenuPosition.x - boundingRect.left) / sizing.elementWidth * (bounds.maxX - bounds.minX) + bounds.minX;\n }\n }\n this._contextMenuPosition = {\n x: newX,\n y: this._contextMenuPosition.y - boundingRect.top,\n showing: this._contextMenuPosition.showing,\n value: value\n };\n this.deferredEmit('context_menu_position_changed', this._contextMenuPosition);\n }\n\n _recalculateAnnotations() {\n if (!this.primaryRenderer || !this.primaryRenderer.sizing) {\n return;\n }\n\n this._annotationsState = calculateAnnotationsState({\n annotations: this._annotations,\n series: this._series,\n sizing: this.primaryRenderer.sizing,\n selection: this._selection\n });\n this.deferredEmit('annotations_changed', this._annotationsState);\n }\n\n _onDataChange() {\n this._expandYWith = [];\n const dataBoundsList = [];\n\n for (let singleSeries of this._series) {\n if (singleSeries.hidden) {\n continue;\n }\n\n const simpleData = this._seriesToSimpleData(singleSeries);\n const dataSpaceResult = simpleSeriesToDataSpace({\n ...singleSeries,\n data: simpleData\n }, {\n stateController: this\n });\n \n let inDataSpace, rangeValues, windDirections, windData;\n if (Array.isArray(dataSpaceResult)) {\n inDataSpace = dataSpaceResult;\n rangeValues = [];\n windDirections = null;\n windData = null;\n } else {\n inDataSpace = dataSpaceResult.data;\n rangeValues = dataSpaceResult.rangeValues || [];\n windDirections = dataSpaceResult.windDirections || null;\n windData = dataSpaceResult.windData || null;\n }\n \n singleSeries.inDataSpace = inDataSpace;\n singleSeries.windDirections = windDirections;\n singleSeries.windData = windData;\n singleSeries.simpleDataSliceStart = simpleData.length;\n singleSeries._rangeValues = rangeValues;\n const allYValues = [...inDataSpace.map(([x, y]) => y).filter(y => typeof y === 'number'), ...rangeValues];\n const extendedDataSpace = inDataSpace.map(([x, y]) => [x, y]);\n for (let rangeValue of rangeValues) {\n extendedDataSpace.push([null, rangeValue]);\n }\n \n singleSeries.dataBounds = calculateDataBounds(extendedDataSpace, { \n rangeValues: rangeValues \n });\n \n if (singleSeries.rendering === 'bar') {\n singleSeries.dataBounds = expandBounds(singleSeries.dataBounds, { extendXForNBars: singleSeries.inDataSpace.length, expandYWith: singleSeries.expandYWith });\n }\n\n dataBoundsList.push(singleSeries.dataBounds);\n\n if (singleSeries.expandYWith) {\n this._expandYWith.push(singleSeries.expandYWith);\n }\n }\n\n this._unsubscribeFromStaleSeries();\n\n this._dataBounds = mergeBounds(dataBoundsList);\n\n this._recalculateSelection({ disableSwap: true});\n\n for (let singleSeries of this._series) {\n if (singleSeries.hidden) {\n continue;\n }\n\n singleSeries.selectedBounds = calculateDataBounds(singleSeries.inSelectedSpace.data, { percentile: this._percentile, percentileAsymmetry: this._percentileAsymmetry });\n if (singleSeries.hasAreaBottom) {\n singleSeries.selectedBoundsAreaTop = singleSeries.selectedBounds;\n singleSeries.selectedBoundsAreaBottom = calculateDataBounds(singleSeries.inSelectedSpaceAreaBottom.data, { percentile: this._percentile, percentileAsymmetry: this._percentileAsymmetry });\n\n singleSeries.selectedBounds = mergeBounds([\n singleSeries.selectedBoundsAreaTop,\n singleSeries.selectedBoundsAreaBottom\n ]);\n }\n }\n\n this._recalculateAxisBounds();\n\n for (let singleSeries of this._series) {\n if (singleSeries.hidden) {\n continue;\n }\n\n this._calculatePrimarySizeDependents(singleSeries, { dataChanged: true });\n this._calculateRangeGraphSizeDependents(singleSeries, { dataChanged: true });\n }\n }\n\n _onDataAdd(modifiedSeries) {\n const newData = new Map();\n const modifiedAxes = new Set();\n\n const modifiedSeriesAndDependents = new Set();\n for (let singleSeries of modifiedSeries) {\n modifiedSeriesAndDependents.add(singleSeries);\n }\n\n for (let singleSeries of modifiedSeries) {\n modifiedAxes.add(singleSeries.axis);\n\n if (!singleSeries.inDataSpace) {\n throw new Error('inDataSpace must be present for onDataAdd to be called');\n }\n\n const simpleData = this._seriesToSimpleData(singleSeries);\n\n let prevY;\n if (singleSeries.inDataSpace.length) {\n prevY = singleSeries.inDataSpace[singleSeries.inDataSpace.length - 1][1];\n }\n\n const newDataInDataSpace = simpleSeriesToDataSpace(singleSeries, {\n data: simpleData.slice(singleSeries.simpleDataSliceStart || 0),\n valueXStart: singleSeries.inDataSpace.length,\n prevY,\n stateController: this\n });\n newData.set(singleSeries, newDataInDataSpace);\n singleSeries.simpleDataSliceStart = simpleData.length;\n\n if (newDataInDataSpace.length < 32) {\n singleSeries.inDataSpace.push(...newDataInDataSpace);\n } else {\n for (let point of newDataInDataSpace) {\n singleSeries.inDataSpace.push(point);\n }\n }\n\n let newDataBounds = calculateDataBounds(newDataInDataSpace);\n if (singleSeries.rendering === 'bar') {\n newDataBounds = expandBounds(newDataBounds, { extendXForNBars: singleSeries.inDataSpace.length, expandYWith: singleSeries.expandYWith });\n }\n\n singleSeries.dataBounds = mergeBounds([singleSeries.dataBounds, newDataBounds]);\n this._dataBounds = mergeBounds([this._dataBounds, newDataBounds]);\n\n // save these off for debugging only\n singleSeries.newPointCount = newDataInDataSpace.length;\n singleSeries.newDataBounds = newDataBounds;\n }\n\n const previousSelection = this._selection;\n this._recalculateSelection();\n\n for (let singleSeries of modifiedSeries) {\n if (!singleSeries.inSelectedSpace.data.length) { // empty, trivially fast\n singleSeries.selectedBounds = calculateDataBounds(singleSeries.inSelectedSpace.data);\n continue;\n }\n\n const firstX = singleSeries.inSelectedSpace.data[0][0];\n const lastX = singleSeries.inSelectedSpace.data[singleSeries.inSelectedSpace.data.length - 1][0];\n\n const oldBoundSubsetOfNewBounds = previousSelection.minX >= firstX && previousSelection.maxX <= lastX;\n\n if (!oldBoundSubsetOfNewBounds || this._percentile !== 100) {\n // this is significantly slower, but it's too complex to diff the old bounds and new bounds or diff percentiles\n // besides, it not being a subset hopefully means its a lower volume of data\n singleSeries.selectedBounds = calculateDataBounds(singleSeries.inSelectedSpace.data, { percentile: this._percentile, percentileAsymmetry: this._percentileAsymmetry});\n if (singleSeries.hasAreaBottom) {\n singleSeries.selectedBoundsAreaTop = singleSeries.selectedBounds;\n singleSeries.selectedBoundsAreaBottom = calculateDataBounds(singleSeries.inSelectedSpaceAreaBottom.data, { percentile: this._percentile, percentileAsymmetry: this._percentileAsymmetry });\n\n singleSeries.selectedBounds = mergeBounds([\n singleSeries.selectedBoundsAreaTop,\n singleSeries.selectedBoundsAreaBottom\n ]);\n }\n continue;\n }\n\n // note: we could do a binary search here, but there are typically only a few points added each frame, so it isn't worth it\n const newSelectedData = newData.get(singleSeries)\n .filter((tuple) => tuple[0] >= this._selection.minX && tuple[0] <= this._selection.maxX);\n\n singleSeries.newSelectedData = newSelectedData;\n singleSeries.selectedBounds = mergeBounds([singleSeries.selectedBounds, calculateDataBounds(newSelectedData)]);\n }\n\n this._recalculateAxisBounds();\n\n this.deferredPriorityEmit('axis_bounds_changed', this._axes.map(({ currentBounds }) => currentBounds));\n\n for (let axis of modifiedAxes) {\n for (let singleSeries of axis.series) {\n this._calculatePrimarySizeDependents(singleSeries);\n this._calculateRangeGraphSizeDependents(singleSeries);\n }\n }\n }\n\n _recalculateAxisBounds() {\n for (let axis of this._axes) {\n if (this._selection.fixedY || !this._autoscaleY) {\n axis.targetBounds = this._selection;\n if (axis.targetBounds.byAxis) {\n axis.targetBounds = axis.targetBounds.byAxis[axis.axisIndex];\n }\n\n const expandYWith = [];\n for (let singleSeries of axis.series) {\n if (singleSeries._rangeValues && singleSeries._rangeValues.length > 0) {\n const visibleRangeValues = [];\n \n for (let i = 0; i < singleSeries.inDataSpace.length; i++) {\n const [x, y] = singleSeries.inDataSpace[i];\n let xValue = x;\n let minXValue = axis.targetBounds.minX;\n let maxXValue = axis.targetBounds.maxX;\n \n if (x instanceof Date) {\n xValue = x.valueOf();\n }\n if (minXValue instanceof Date) {\n minXValue = minXValue.valueOf();\n }\n if (maxXValue instanceof Date) {\n maxXValue = maxXValue.valueOf();\n }\n \n if (minXValue !== null && maxXValue !== null && \n xValue >= minXValue && xValue <= maxXValue) {\n const rangeIndex = i * 2;\n if (rangeIndex < singleSeries._rangeValues.length) {\n visibleRangeValues.push(singleSeries._rangeValues[rangeIndex]);\n if (rangeIndex + 1 < singleSeries._rangeValues.length) {\n visibleRangeValues.push(singleSeries._rangeValues[rangeIndex + 1]);\n }\n }\n }\n }\n \n if (visibleRangeValues.length > 0) {\n expandYWith.push(...visibleRangeValues);\n }\n }\n }\n\n if (expandYWith.length > 0) {\n const validRangeValues = expandYWith.filter(y => typeof y === 'number');\n axis.currentBounds = {\n ...axis.targetBounds,\n minY: axis.targetBounds.minY === null ? Math.min(...validRangeValues) : axis.targetBounds.minY,\n maxY: axis.targetBounds.maxY === null ? Math.max(...validRangeValues) : axis.targetBounds.maxY\n };\n } else {\n axis.currentBounds = axis.targetBounds;\n }\n continue;\n }\n\n const selectedBoundsList = [];\n const expandYWith = [];\n\n for (let singleSeries of axis.series) {\n selectedBoundsList.push(singleSeries.selectedBounds);\n\n if (singleSeries.expandYWith) {\n expandYWith.push(...singleSeries.expandYWith);\n }\n\n if (singleSeries.rendering === 'bar') {\n expandYWith.push(singleSeries.selectedBounds.minY, singleSeries.selectedBounds.maxY);\n }\n\n if (singleSeries._rangeValues && singleSeries._rangeValues.length > 0) {\n const visibleRangeValues = [];\n \n for (let i = 0; i < singleSeries.inDataSpace.length; i++) {\n const [x, y] = singleSeries.inDataSpace[i];\n let xValue = x;\n let minXValue = singleSeries.selectedBounds.minX;\n let maxXValue = singleSeries.selectedBounds.maxX;\n \n if (x instanceof Date) {\n xValue = x.valueOf();\n }\n if (minXValue instanceof Date) {\n minXValue = minXValue.valueOf();\n }\n if (maxXValue instanceof Date) {\n maxXValue = maxXValue.valueOf();\n }\n \n if (minXValue !== null && maxXValue !== null && \n xValue >= minXValue && xValue <= maxXValue) {\n const rangeIndex = i * 2;\n if (rangeIndex < singleSeries._rangeValues.length) {\n visibleRangeValues.push(singleSeries._rangeValues[rangeIndex]);\n if (rangeIndex + 1 < singleSeries._rangeValues.length) {\n visibleRangeValues.push(singleSeries._rangeValues[rangeIndex + 1]);\n }\n }\n }\n }\n \n if (visibleRangeValues.length > 0) {\n expandYWith.push(...visibleRangeValues);\n }\n }\n }\n\n axis.selectedDataBounds = mergeBounds(selectedBoundsList);\n axis.targetBounds = axis.currentBounds = expandBounds(axis.selectedDataBounds, {expandYWith});\n }\n this.deferredPriorityEmit('axis_bounds_changed', this._axes.map(({ currentBounds }) => currentBounds));\n }\n\n /**\n * Recalculates global bounds, selection, and data in selected space (for each series)\n * REQUIRES that this._dataBounds and this._expandYWith are set & up-to-date\n *\n * @private\n */\n _recalculateSelection({disableSwap = false}={}) {\n this._globalBounds = expandBounds(this._dataBounds, {expandYWith: this._expandYWith.flat()});\n this.deferredPriorityEmit('global_bounds_changed', this._globalBounds);\n this._selection = selectionFromGlobalBounds(this._globalBounds, this._boundsCalculator);\n this.deferredPriorityEmit('selection_changed', this._selection);\n\n for (let singleSeries of this._series) {\n if (singleSeries.hidden) {\n continue;\n }\n\n singleSeries.inSelectedSpace = dataSpaceToSelectedSpace({\n data: singleSeries.hasAreaBottom ? singleSeries.inDataSpace.filter((_, i) => i % 2 === 1) : singleSeries.inDataSpace,\n swap: disableSwap ? null : singleSeries.inSelectedSpace,\n minX: this._selection.minX,\n maxX: this._selection.maxX,\n ignoreDiscontinuities: singleSeries.ignoreDiscontinuities,\n square: singleSeries.square\n });\n\n if (singleSeries.hasAreaBottom) {\n singleSeries.inSelectedSpaceAreaBottom = dataSpaceToSelectedSpace({\n data:singleSeries.inDataSpace.filter((_, i) => i % 2 === 0),\n swap: disableSwap ? null : singleSeries.inSelectedSpaceAreaBottom,\n minX: this._selection.minX,\n maxX: this._selection.maxX,\n ignoreDiscontinuities: singleSeries.ignoreDiscontinuities,\n square: singleSeries.square\n });\n }\n }\n }\n\n _render() {\n if (!this.primaryRenderer || !this.primaryRenderer.sizing) {\n return;\n }\n\n this.primaryRenderer.clear();\n if (this.rangeGraphRenderer) {\n this.rangeGraphRenderer.clear();\n }\n\n for (let singleSeries of this._series) {\n if (singleSeries.hidden) {\n continue;\n }\n\n const shadowColor = singleSeries.shadowColor || {\n day: 'white',\n export: 'transparent',\n night: 'black'\n }[this._theme] || 'black';\n\n const shadowBlur = undefined;\n\n this.primaryRenderer.renderBackground(singleSeries.inBackgroundSpacePrimary);\n\n this.primaryRenderer.render(singleSeries, singleSeries.inRenderSpacePrimary, {\n highlighted: this._highlightedSeries === singleSeries.index,\n showIndividualPoints: this._showIndividualPoints,\n shadowColor,\n shadowBlur,\n defaultLineWidth: this._defaultLineWidth,\n globalBounds: this._globalBounds,\n inRenderSpaceAreaBottom: singleSeries.inRenderSpacePrimaryAreaBottom\n });\n\n if (this.rangeGraphRenderer && this.rangeGraphRenderer.sizing) {\n // Use tighter bounds for range graph to prevent clipping\n const rangeGraphBounds = {\n ...this._globalBounds,\n minY: this._globalBounds.unscaledMinY !== undefined ? this._globalBounds.unscaledMinY : this._globalBounds.minY,\n maxY: this._globalBounds.unscaledMaxY !== undefined ? this._globalBounds.unscaledMaxY : this._globalBounds.maxY\n };\n \n this.rangeGraphRenderer.render(singleSeries, singleSeries.inRenderSpaceRangeGraph, {\n shadowColor: 'transparent',\n shadowBlur: 0,\n width: 1,\n showIndividualPoints: false,\n bounds: rangeGraphBounds,\n globalBounds: rangeGraphBounds,\n inRenderSpaceAreaBottom: singleSeries.inRenderSpaceRangeGraphAreaBottom\n });\n }\n }\n }\n\n _calculatePrimarySizeDependents(singleSeries, { dataChanged=false } = {}) {\n if (!this.primaryRenderer || !this.primaryRenderer.sizing) {\n return;\n }\n\n if (!singleSeries) {\n for (let s of this._series) {\n this._calculatePrimarySizeDependents(s);\n }\n return;\n }\n\n if (!this._series.includes(singleSeries)) {\n throw new Error('Series no longer exists');\n }\n\n if (singleSeries.hidden) {\n return;\n }\n\n const { currentBounds, scale } = singleSeries.axis;\n const renderWidth = Math.ceil(this.primaryRenderer.sizing.renderWidth/DPI_INCREASE);\n const renderHeight = Math.ceil(this.primaryRenderer.sizing.renderHeight);\n\n const toCondensedSelectedSpaceParams = {\n minX: currentBounds.minX,\n maxX: currentBounds.maxX,\n renderWidth,\n dataChanged\n };\n\n singleSeries.inCondensedSelectedSpacePrimary = condenseDataSpace({\n data: singleSeries.inSelectedSpace.data,\n swap: singleSeries.inCondensedSelectedSpacePrimary,\n ...toCondensedSelectedSpaceParams\n });\n\n const toRenderSpaceParams = {\n minX: currentBounds.minX,\n maxX: currentBounds.maxX,\n minY: currentBounds.minY,\n maxY: currentBounds.maxY,\n renderWidth,\n renderHeight,\n scale,\n dataChanged\n };\n\n singleSeries.inRenderSpacePrimary = selectedSpaceToRenderSpace({\n data: singleSeries.inCondensedSelectedSpacePrimary.data,\n swap: singleSeries.inRenderSpacePrimary,\n ...toRenderSpaceParams\n });\n\n singleSeries.inBackgroundSpacePrimary = selectedSpaceToBackgroundSpace({\n data: singleSeries.inCondensedSelectedSpacePrimary.data,\n background: singleSeries.background,\n swap: singleSeries.inBackgroundSpacePrimary,\n minX: currentBounds.minX,\n maxX: currentBounds.maxX\n });\n\n if (singleSeries.hasAreaBottom) {\n singleSeries.inCondensedSelectedSpacePrimaryAreaBottom = condenseDataSpace({\n data: singleSeries.inSelectedSpaceAreaBottom.data,\n swap: singleSeries.inCondensedSelectedSpacePrimaryAreaBottom,\n ...toCondensedSelectedSpaceParams\n });\n\n singleSeries.inRenderSpacePrimaryAreaBottom = selectedSpaceToRenderSpace({\n data: singleSeries.inCondensedSelectedSpacePrimaryAreaBottom.data,\n swap: singleSeries.inRenderSpacePrimaryAreaBottom,\n ...toRenderSpaceParams\n });\n\n singleSeries.inBackgroundSpacePrimaryAreaBottom = selectedSpaceToBackgroundSpace({\n data: singleSeries.inCondensedSelectedSpacePrimaryAreaBottom.data,\n background: singleSeries.background,\n swap: singleSeries.inBackgroundSpacePrimaryAreaBottom,\n minX: currentBounds.minX,\n maxX: currentBounds.maxX\n });\n }\n }\n\n _calculateRangeGraphSizeDependents(singleSeries, { dataChanged=false } = {}) {\n if (!this.rangeGraphRenderer || !this.rangeGraphRenderer.sizing) {\n return;\n }\n\n if (!singleSeries) {\n for (let s of this._series) {\n this._calculateRangeGraphSizeDependents(s);\n }\n return;\n }\n\n if (!this._series.includes(singleSeries)) {\n throw new Error('Series no longer exists');\n }\n\n if (singleSeries.hidden) {\n return;\n }\n\n const { scale } = singleSeries.axis;\n const globalBounds = this._globalBounds;\n \n const rangeGraphBounds = {\n ...globalBounds,\n minY: globalBounds.unscaledMinY !== undefined ? globalBounds.unscaledMinY : globalBounds.minY,\n maxY: globalBounds.unscaledMaxY !== undefined ? globalBounds.unscaledMaxY : globalBounds.maxY\n };\n \n const renderWidth = Math.ceil(this.rangeGraphRenderer.sizing.renderWidth/DPI_INCREASE);\n const renderHeight = Math.ceil(this.rangeGraphRenderer.sizing.renderHeight);\n\n const toSelectedSpaceParams = {\n minX: globalBounds.minX,\n maxX: globalBounds.maxX,\n ignoreDiscontinuities: singleSeries.ignoreDiscontinuities,\n square: singleSeries.square\n };\n\n singleSeries.inSelectedSpaceRangeGraph = dataSpaceToSelectedSpace({\n data: singleSeries.hasAreaBottom ? singleSeries.inDataSpace.filter((_, i) => i % 2 === 1) : singleSeries.inDataSpace,\n swap: singleSeries.inSelectedSpaceRangeGraph,\n ...toSelectedSpaceParams\n });\n\n const toCondensedSelectedSpaceParams = {\n minX: globalBounds.minX,\n maxX: globalBounds.maxX,\n renderWidth,\n dataChanged\n };\n\n singleSeries.inCondensedSelectedSpaceRangeGraph = condenseDataSpace({\n data: singleSeries.inSelectedSpaceRangeGraph.data,\n swap: singleSeries.inCondensedSelectedSpaceRangeGraph\n });\n\n const toRenderSpaceParams = {\n minX: rangeGraphBounds.minX,\n maxX: rangeGraphBounds.maxX,\n minY: rangeGraphBounds.minY,\n maxY: rangeGraphBounds.maxY,\n renderWidth,\n renderHeight,\n scale,\n dataChanged\n };\n\n singleSeries.inRenderSpaceRangeGraph = selectedSpaceToRenderSpace({\n data: singleSeries.inCondensedSelectedSpaceRangeGraph.data,\n swap: singleSeries.inRenderSpaceRangeGraph,\n ...toRenderSpaceParams\n });\n\n if (singleSeries.hasAreaBottom) {\n singleSeries.inSelectedSpaceRangeGraphAreaBottom = dataSpaceToSelectedSpace({\n data: singleSeries.inDataSpace.filter((_, i) => i % 2 === 0), // take the odd points for area bottom\n swap: singleSeries.inSelectedSpaceRangeGraphAreaBottom,\n ...toSelectedSpaceParams\n });\n\n singleSeries.inCondensedSelectedSpaceRangeGraphAreaBottom = condenseDataSpace({\n data: singleSeries.inSelectedSpaceRangeGraphAreaBottom.data,\n swap: singleSeries.inCondensedSelectedSpaceRangeGraphAreaBottom,\n ...toCondensedSelectedSpaceParams\n });\n\n singleSeries.inRenderSpaceRangeGraphAreaBottom = selectedSpaceToRenderSpace({\n data: singleSeries.inCondensedSelectedSpaceRangeGraphAreaBottom.data,\n swap: singleSeries.inRenderSpaceRangeGraphAreaBottom,\n ...toRenderSpaceParams\n });\n }\n }\n\n _createAxis({ side }) {\n const axis = {\n series: [],\n scale: 'linear',\n side,\n axisIndex: this._axes.length\n };\n this._axes.push(axis);\n return axis;\n }\n\n _moveAxis(singleSeries, axisIndex) {\n if (!this._series.includes(singleSeries)) {\n throw new Error('Series no longer exists');\n }\n\n let newAxis;\n if (axisIndex === 'new-left' || axisIndex === 'new-right') {\n newAxis = this._createAxis({ side: axisIndex.split('-')[1] });\n } else {\n newAxis = this._axes[parseInt(axisIndex)];\n }\n\n if (singleSeries.axis === newAxis) {\n return;\n }\n\n const oldAxis = singleSeries.axis;\n const oldIndex = oldAxis.series.indexOf(singleSeries);\n if (oldIndex === -1) {\n throw new Error('Series not present in axis');\n }\n oldAxis.series.splice(oldIndex, 1);\n\n newAxis.series.push(singleSeries);\n singleSeries.axis = newAxis;\n\n this._dataChanged = true;\n this.deferredEmit('axes_changed', this._axes);\n this.deferredEmit('left_axes_changed', this.leftAxes);\n this.deferredEmit('right_axes_changed', this.rightAxes);\n this.deferredEmit('exported_axes_changed', this.exportedAxes);\n this._markDirty();\n }\n\n _assignAxisTo(singleSeries) {\n if (singleSeries.axis && typeof singleSeries.axis === 'object') {\n return;\n }\n\n let axis;\n\n if (singleSeries.axisIndex) {\n const { axisIndex } = singleSeries;\n\n if (axisIndex === 'new-left' || axisIndex === 'new-right') {\n axis = this._createAxis({ side: axisIndex.split('-')[1] });\n } else {\n axis = this._axes[parseInt(axisIndex)];\n }\n } else if (singleSeries.axis) {\n singleSeries.originalAxis = singleSeries.axis;\n let [side, number] = singleSeries.axis.split('-');\n axis = findMatchingAxis({ axes: this._axes, side, number });\n\n if (!axis) {\n axis = this._createAxis({\n side\n });\n }\n } else {\n axis = this._axes[0];\n }\n\n axis.series.push(singleSeries);\n singleSeries.axis = axis;\n\n this.deferredEmit('axes_changed', this._axes);\n this.deferredEmit('exported_axes_changed', this.exportedAxes);\n\n if (singleSeries.axis.side === 'left') {\n this.deferredEmit('left_axes_changed', this.leftAxes);\n } else {\n this.deferredEmit('right_axes_changed', this.rightAxes);\n }\n }\n\n _removeSeries(singleSeries) {\n this._seriesFromOriginalSeries.delete(singleSeries.originalSeries);\n\n const { axis, data } = singleSeries;\n axis.series.splice(axis.series.indexOf(singleSeries), 1);\n const sameDataSet = this._observablesToSeries.get(data);\n if (sameDataSet) {\n sameDataSet.delete(singleSeries);\n if (sameDataSet.size === 0) {\n this._observablesToSeries.delete(data);\n }\n }\n\n if (this._generatorsToSeries.has(data)) {\n this._generatorsToSeries.get(data).delete(singleSeries);\n if (this._generatorsToSeries.get(data).size === 0) {\n this._generatorsToSeries.delete(data);\n this._generators.delete(data);\n }\n }\n\n this._alwaysTooltipped.delete(singleSeries);\n\n singleSeries.axis = singleSeries.originalAxis;\n delete singleSeries.originalAxis;\n delete singleSeries.inDataSpace;\n delete singleSeries.inSelectedSpace;\n delete singleSeries.inValueSpacePrimary;\n delete singleSeries.inValueSpaceRangeGraph;\n delete singleSeries.inRenderSpacePrimary;\n delete singleSeries.inRenderSpaceRangeGraph;\n delete singleSeries.newPointCount;\n delete singleSeries.newDataBounds;\n delete singleSeries.simpleDataSliceStart;\n\n this.deferredEmit('axes_changed', this._axes);\n this.deferredEmit('exported_axes_changed', this.exportedAxes);\n\n if (axis.side === 'left') {\n this.deferredEmit('left_axes_changed', this.leftAxes);\n } else {\n this.deferredEmit('right_axes_changed', this.rightAxes);\n }\n }\n\n _hideSeries(singleSeries) {\n const { axis } = singleSeries;\n const indexInAxis = axis.series.indexOf(singleSeries);\n singleSeries.indexInAxis = indexInAxis;\n axis.series.splice(indexInAxis, 1);\n\n this.deferredEmit('axes_changed', this._axes);\n\n if (axis.side === 'left') {\n this.deferredEmit('left_axes_changed', this.leftAxes);\n } else {\n this.deferredEmit('right_axes_changed', this.rightAxes);\n }\n }\n\n _showSeries(singleSeries) {\n const { axis } = singleSeries;\n axis.series.splice(singleSeries.indexInAxis, 0, singleSeries);\n\n this.deferredEmit('axes_changed', this._axes);\n\n if (axis.side === 'left') {\n this.deferredEmit('left_axes_changed', this.leftAxes);\n } else {\n this.deferredEmit('right_axes_changed', this.rightAxes);\n }\n }\n\n /*\n * Getters\n *******************\n */\n\n get boundCalculator() {\n return this._boundsCalculator;\n }\n\n get axes() {\n return this._axes;\n }\n\n get leftAxes() {\n const leftAxes = this._axes.filter(({ side, series }) => side === 'left' && series.length > 0).reverse();\n\n if (leftAxes.length === 0 && this.rightAxes.length === 0) {\n leftAxes.push(this._axes[0]);\n }\n\n return leftAxes;\n }\n\n get rightAxes() {\n return this._axes.filter(({ side, series }) => side === 'right' && series.length > 0 );\n }\n\n get bounds() {\n return this._axes.map(({ targetBounds }) => targetBounds);\n }\n\n get selection() {\n return this._selection;\n }\n\n get globalBounds() {\n return this._globalBounds;\n }\n\n get series() {\n return this._series;\n }\n\n get highlightedSeries() {\n return this._highlightedSeries;\n }\n\n get showIndividualPoints() {\n return this._showIndividualPoints;\n }\n\n get autoscaleY() {\n return this._autoscaleY;\n }\n\n get boundHistory() {\n return {\n hasNextBounds: this._boundsIndex < this._boundsHistory.length - 1,\n hasPreviousBounds: this._boundsIndex > 0\n };\n }\n\n get tooltipState() {\n return this._tooltipState;\n }\n \n get contextMenuState() {\n return this._contextMenuPosition;\n }\n\n get alwaysTooltipped() {\n return this._alwaysTooltipped;\n }\n\n get draggingY() {\n return this._draggingY;\n }\n\n get averageLoopTime() {\n return averageLoopTimes(this._timingBuffer);\n }\n\n get exportedAxes() {\n const axisToName = new Map();\n let leftCount = 0;\n let rightCount = 0;\n\n for (let axis of this._axes) {\n let name;\n if (axis.side === 'left') {\n name = `left-${leftCount}`;\n leftCount++;\n } else {\n name = `right-${rightCount}`;\n rightCount++;\n }\n\n for (let singleSeries of axis.series) {\n axisToName.set(singleSeries, name);\n }\n }\n\n return this.series.map((singleSeries) => {\n return {\n ...singleSeries.originalSeries,\n axis: axisToName.get(singleSeries)\n };\n });\n }\n\n get percentile() {\n return this._percentile;\n }\n\n get percentileAsymmetry() {\n return this._percentileAsymmetry;\n }\n\n get showingOptions() {\n return this._showingOptions;\n }\n\n get maxPrecision() {\n return this._maxPrecision;\n }\n\n get showingSidebar() {\n return this._showingSidebar;\n }\n\n get showingAnnotations() {\n return this._showingAnnotations;\n }\n\n get userCreatedSeries() {\n return this._series.filter((singleSeries) => singleSeries.userCreated);\n }\n\n get grapherID() {\n return this._grapherID;\n }\n\n get annotationState() {\n return this._annotationsState;\n }\n\n get sizing() {\n return this.primaryRenderer && this.primaryRenderer.sizing;\n }\n\n get theme() {\n return this._theme;\n }\n\n get exportMode() {\n return this._exportMode;\n }\n\n get enumMap() {\n return this._enumMap;\n }\n\n get hasXEnum() {\n return this._hasXEnum;\n }\n\n /*\n * Setters / ways to mutate the state that aren't the underlying data changing\n ***********************************************************************************\n */\n\n markSizeChanged(renderer) {\n if (renderer === this.primaryRenderer) {\n this.deferredEmit('primary_size_change', this.primaryRenderer.sizing);\n this.deferredEmit('primary_bounding_rect_change', this.primaryRenderer.boundingRect);\n this._primarySizeChanged = true;\n } else if (renderer === this.rangeGraphRenderer) {\n this.deferredEmit('range_graph_size_change', this.rangeGraphRenderer.sizing);\n this.deferredEmit('range_graph_bounding_rect_change', this.rangeGraphRenderer.boundingRect);\n this._rangeGraphSizeChanged = true;\n }\n\n this._mustRerender = true;\n this._tooltipsChanged = true;\n this._annotationsChanged = true;\n this._mustCallGenerators = true;\n this._markDirty();\n }\n\n set theme(value) {\n this._theme = value;\n this._mustRerender = true;\n this.deferredEmit('theme_change', this._theme);\n this._markDirty();\n }\n\n set exportMode(value) {\n this._exportMode = value;\n\n if (value) {\n this._nonExportTheme = this.theme;\n this.theme = 'export';\n } else {\n this.theme = this._nonExportTheme;\n }\n\n this.deferredEmit('export_mode_change', this._exportMode);\n this._markDirty();\n }\n\n set defaultLineWidth(value) {\n this._defaultLineWidth = value;\n this._mustRerender = true;\n this._markDirty();\n }\n\n set boundCalculator(boundingFunction) {\n if (!boundingFunction) {\n return;\n }\n\n if (boundingFunction === this._boundsCalculator) {\n return;\n }\n\n if (boundingFunction.debounceHistory) {\n clearTimeout(this._boundingCalculatorDebouncer);\n this._boundingCalculatorDebouncer = setTimeout(() => {\n this._addBoundCalculatorToHistory(boundingFunction);\n }, 250);\n } else {\n this._addBoundCalculatorToHistory(boundingFunction);\n }\n\n this._boundsCalculator = boundingFunction;\n this.deferredEmit('bound_calculator_changed', this._boundsCalculator);\n this._dataChanged = true;\n this._mustCallGenerators = true;\n this._markDirty();\n }\n\n set customBoundsSelectors(boundsSelectors) {\n this._customBoundsSelectors = this._customBoundsSelectors || {};\n\n const indexedCustomBoundSelectors = {};\n\n for (let { label, calculator } of boundsSelectors) {\n indexedCustomBoundSelectors[label] = calculator;\n\n if (this._boundsCalculator === this._customBoundsSelectors[label] && this._boundsCalculator !== calculator) {\n this.boundCalculator = calculator;\n }\n }\n\n this._customBoundsSelectors = indexedCustomBoundSelectors;\n }\n\n _addBoundCalculatorToHistory(boundingFunction) {\n this._boundsIndex++;\n this._boundsHistory = this._boundsHistory.slice(0, this._boundsIndex);\n this._boundsHistory.push(boundingFunction);\n this.emit('bound_history_changed', this.boundHistory);\n }\n\n registerSeriesClick(selectedSeriesIndex) {\n this.emit('series_click', this._series[selectedSeriesIndex], selectedSeriesIndex);\n }\n\n setHighlightedSeries(highlightedSeries) {\n this._highlightedSeries = highlightedSeries;\n this.deferredEmit('highlighted_series_changed', highlightedSeries);\n this._mustRerender = true;\n this._markDirty();\n }\n\n toggleIndividualPoints() {\n this._showIndividualPoints = !this._showIndividualPoints;\n this.deferredEmit('show_individual_points_changed', this._showIndividualPoints);\n this._mustRerender = true;\n this._markDirty();\n }\n\n toggleYAutoscaling() {\n this._autoscaleY = !this._autoscaleY;\n this.deferredEmit('autoscale_y_changed', this._autoscaleY);\n this._markDirty();\n }\n\n toggleExportMode() {\n this.exportMode = !this._exportMode;\n }\n\n setBoundsFromSelection(pixelSelection) {\n this.boundCalculator = boundCalculatorFromSelection(pixelSelection, {\n elementWidth: this.primaryRenderer.sizing.elementWidth,\n elementHeight: this.primaryRenderer.sizing.elementHeight,\n selection: this._selection,\n axes: this._axes\n });\n }\n\n nextBounds() {\n this._boundsIndex++;\n this._boundsCalculator = this._boundsHistory[this._boundsIndex];\n this.deferredEmit('bound_calculator_changed', this._boundsCalculator);\n this.deferredEmit('bound_history_changed', this.boundHistory);\n this._dataChanged = true;\n this._markDirty();\n }\n\n previousBounds() {\n this._boundsIndex--;\n this._boundsCalculator = this._boundsHistory[this._boundsIndex];\n this.deferredEmit('bound_calculator_changed', this._boundsCalculator);\n this.deferredEmit('bound_history_changed', this.boundHistory);\n this._dataChanged = true;\n this._markDirty();\n }\n\n setLabel({ axisIndex, label }) {\n this._axes[axisIndex].label = label;\n this.deferredEmit('axes_changed', [...this._axes]);\n this._markDirty();\n }\n\n toggleScale({ axisIndex }) {\n const oldScale = this._axes[axisIndex].scale;\n this._axes[axisIndex].scale = oldScale === 'log' ? 'linear' : 'log';\n\n this._dataChanged = true;\n this.deferredEmit('axes_changed', [...this._axes]);\n this._markDirty();\n }\n\n recalculateTooltips() {\n this.primaryRenderer.recalculatePosition();\n this.setTooltipMousePosition({\n clientX: this._tooltipClientX,\n clientY: this._tooltipClientY,\n shiftKey: this.shiftKeyPressedOnMove,\n tooltipAllNext: this._tooltipAllNext,\n tooltipStateArg: this._tooltipStateArg\n });\n }\n\n setTooltipMousePosition({ clientX, clientY, shiftKey, mouseX, mouseY, tooltipAllNext, tooltipStateArg }) {\n const sizing = this.primaryRenderer.sizing;\n if (!sizing) {\n return;\n }\n\n if (typeof clientX === 'number') {\n this._tooltipClientX = clientX;\n\n if (clientX < sizing.boundingRect.left || clientX > sizing.boundingRect.right) {\n this.showOnlySavedTooltips();\n return;\n }\n } else if (typeof mouseY !== 'number') {\n return;\n }\n\n if (typeof clientY === 'number') {\n this._tooltipClientY = clientY;\n\n if (clientY < sizing.boundingRect.top || clientY > sizing.boundingRect.bottom) {\n this.showOnlySavedTooltips();\n return;\n }\n } else if (typeof mouseY !== 'number') {\n return;\n }\n\n const newMouseX = mouseX || (clientX - sizing.boundingRect.left);\n const newMouseY = mouseY || (clientY - sizing.boundingRect.top);\n if (this._tooltipState.mousePresent && newMouseX === this._tooltipState.mouseX && newMouseY === this._tooltipState.mouseY) {\n return;\n }\n\n this._tooltipsChanged = true;\n this._tooltipState.mousePresent = true;\n this._tooltipState.mouseX = newMouseX;\n this._tooltipState.mouseY = newMouseY;\n this.shiftKeyPressedOnMove = shiftKey;\n this._tooltipAllNext = tooltipAllNext;\n this._tooltipStateArg = tooltipStateArg;\n this._markDirty();\n }\n \n setContextMenuMousePosition({ clientX, clientY }) {\n this._contextMenuPosition = { x: clientX, y: clientY, showing: !this._contextMenuPosition.showing };\n this._contextMenuChanged = true;\n this._markDirty();\n }\n\n toggleAlwaysTooltipped(singleSeries, shiftKey) {\n if (this._alwaysTooltipped.has(singleSeries)) {\n if (shiftKey) {\n this._alwaysTooltipped.clear();\n } else {\n this._alwaysTooltipped.delete(singleSeries);\n }\n } else {\n if (shiftKey) {\n for (let series of this._series) {\n this._alwaysTooltipped.add(series);\n }\n } else {\n this._alwaysTooltipped.add(singleSeries);\n }\n }\n\n this._tooltipsChanged = true;\n this.deferredEmit('always_tooltipped_changed', this._alwaysTooltipped);\n this._markDirty();\n }\n\n showOnlySavedTooltips(tooltipStateArg) {\n if (!this._tooltipState.mousePresent) {\n return;\n }\n\n this._tooltipsChanged = true;\n this._tooltipState.mousePresent = false;\n this._tooltipStateArg = tooltipStateArg;\n this._markDirty();\n }\n\n registerClick({ clientX }) {\n if (!this._listeners['series_click']) {\n return;\n }\n\n const boundingRect = this.primaryRenderer.boundingRect;\n const sizing = this.primaryRenderer.sizing;\n\n for (let series of this._series) {\n const bounds = series.axis.currentBounds;\n\n const x = (clientX - boundingRect.left) / sizing.elementWidth * (bounds.maxX - bounds.minX) + bounds.minX;\n this.emit('series_click', { x, series });\n }\n }\n\n toggleTooltipSaved() {\n const oldSavedTooltips = this._savedTooltips;\n this._savedTooltips = toggleTooltipSaved({\n currentTooltips: this._tooltipState.tooltips,\n savedTooltips: this._savedTooltips\n });\n this._tooltipsChanged = this._savedTooltips !== oldSavedTooltips;\n this._markDirty();\n }\n\n clearSavedTooltips() {\n if (this._savedTooltips.length === 0) {\n return;\n }\n\n this._savedTooltips = [];\n this._tooltipsChanged = true;\n this._markDirty();\n }\n\n markDragStart() {\n if (this._draggingY) {\n return;\n }\n\n this._draggingY = true;\n this.deferredEmit('dragging_y_changed', this._draggingY);\n this._markDirty();\n }\n\n finalizeDrag(draggedSeries, axisIndex, grapherID) {\n if (!this._draggingY) {\n return;\n }\n\n this._draggingY = false;\n this.deferredEmit('dragging_y_changed', this._draggingY);\n\n const hasAxis = axisIndex && axisIndex !== 0;\n const sameGrapherID = grapherID === this._grapherID;\n\n if (hasAxis && sameGrapherID) {\n this._moveAxis(draggedSeries, axisIndex);\n this.deferredEmit('dragging_y_finalized', { draggedSeries, axisIndex, grapherID });\n } else if (grapherID) {\n this.deferredEmit('dragging_y_finalized', { draggedSeries, axisIndex, grapherID });\n }\n\n this._markDirty();\n }\n\n set timingFrameCount(value) {\n if (typeof value !== 'number') {\n return;\n }\n\n this._timingBuffer = [];\n this._timingIndex = 0;\n this._timingFrameCount = value;\n }\n\n set percentile(value) {\n if (value === undefined) {\n return;\n }\n\n this.deferredEmit('percentile_changed', value);\n\n if (value === '') {\n value = 100;\n }\n\n value = parseFloat(value);\n if (!isNaN(value) && value <= 100 && value >= 0) {\n this._percentile = value;\n this._dataChanged = true;\n }\n\n this._markDirty();\n }\n\n set percentileAsymmetry(value) {\n if (value === undefined) {\n return;\n }\n\n this.deferredEmit('percentile_asymmetry_changed', value);\n\n if (value === '') {\n value = 0;\n }\n\n value = parseFloat(value);\n if (!isNaN(value) && value <= 50 && value >= -50) {\n this._percentileAsymmetry = value;\n this._dataChanged = true;\n }\n\n this._markDirty();\n }\n\n set showingOptions(value) {\n if (value === undefined) {\n return;\n }\n\n this._showingOptions = value;\n this.deferredEmit('showing_options_changed', value);\n this._markDirty();\n }\n\n toggleShowingOptions() {\n this.showingOptions = !this.showingOptions;\n }\n\n toggleMaxPrecision() {\n this._maxPrecision = !this._maxPrecision;\n this.deferredEmit('max_precision_changed', this._maxPrecision);\n this._markDirty();\n }\n\n toggleShowingAnnotations() {\n this._showingAnnotations = !this._showingAnnotations;\n this.deferredEmit('showing_annotations_changed', this._showingAnnotations);\n this._markDirty();\n }\n\n toggleShowingSidebar() {\n this._showingSidebar = !this._showingSidebar;\n this.deferredEmit('showing_sidebar_changed', this._showingSidebar);\n this._markDirty();\n }\n\n setShowing(singleSeries, showing) {\n singleSeries.hidden = !showing;\n this._series = [...this._series];\n\n if (singleSeries.hidden) {\n this._hideSeries(singleSeries);\n } else {\n this._showSeries(singleSeries);\n }\n\n this.deferredEmit('series_changed', this._series, { skipResize: true });\n this._dataChanged = true;\n this._markDirty();\n }\n\n set annotations(value) {\n this._annotations = value || [];\n this._annotationsChanged = true;\n this._markDirty();\n }\n\n /**\n * Converts an enum to a number, mutating saved state if necessary to track that\n *\n * @param {String} value\n * @param {Object} singleSeries\n * @param {Boolean} [isX]\n * @return {Number}\n */\n enumToNumber(value, singleSeries, isX) {\n const existingIndex = this._enumMap[value];\n if (typeof existingIndex === 'number') {\n return existingIndex;\n }\n\n const indexToSet = Object.keys(this._enumMap).length;\n this._enumMap[value] = indexToSet;\n\n // safely handle reference changes\n this._series[singleSeries.index].hasEnum = true;\n if (isX) {\n this._series[singleSeries.index].hasXEnum = true;\n this._hasXEnum = true;\n this.deferredEmit('has_x_enum_change', this._hasXEnum);\n this.deferredEmit('x_enum_map_change', this._enumMap);\n }\n\n this.deferredEmit('enum_map_change', this._enumMap);\n\n return indexToSet;\n }\n\n triggerResize() {\n this._mustResize = true;\n this._markDirty();\n }\n}\n","import BOUND_CALCULATORS from './bound_calculators';\n\nexport default function getDefaultBoundsCalculator(givenLabel, customCalculators) {\n if (BOUND_CALCULATORS[givenLabel]) {\n return BOUND_CALCULATORS[givenLabel];\n }\n\n for (let { label, calculator } of customCalculators) {\n if (givenLabel === label) {\n return calculator;\n }\n }\n\n return BOUND_CALCULATORS.all;\n}\n","export default function generatorParamsEqual(a, b) {\n if (a === undefined || b === undefined) {\n return a === b;\n }\n\n return (a.minX === b.minX) &&\n (a.maxX === b.maxX) &&\n (a.sizing.elementWidth === b.sizing.elementWidth) &&\n (a.sizing.renderWidth === b.sizing.renderWidth);\n}\n","import nameForSeries from '../helpers/name_for_series.js';\n\nexport default function calculateAnnotationsState({ annotations, series, sizing, selection }) {\n const shownSeries = new Set(series.map((singleSeries, i) => {\n return {\n name: nameForSeries(singleSeries, i),\n hidden: singleSeries.hidden\n };\n }).filter(({ hidden }) => !hidden).map(({ name }) => name));\n\n const { elementWidth } = sizing;\n const { minX, maxX } = selection;\n const xRange = maxX - minX;\n\n // Avoid division by zero if minX === maxX\n if (xRange === 0) {\n return {\n annotations: [],\n elementWidth\n };\n }\n\n const renderableAnnotations = annotations.filter((annotation) => {\n if (!annotation.series) {\n return true;\n }\n\n for (let seriesName of annotation.series) {\n if (shownSeries.has(seriesName)) {\n return true;\n }\n }\n\n return false;\n }).map((annotation) => {\n const isRange = annotation.startX !== undefined && annotation.endX !== undefined;\n const isPoint = annotation.x !== undefined;\n\n let xStartValue = annotation.startX;\n let xEndValue = annotation.endX;\n\n if (!isRange && isPoint) {\n xStartValue = annotation.x;\n xEndValue = annotation.x;\n } else if (!isRange && !isPoint) {\n return null;\n }\n\n const convertToNumber = (val) => {\n if (typeof val === 'string') return new Date(val).valueOf();\n if (val instanceof Date) return val.valueOf();\n return val;\n };\n\n let startX = convertToNumber(xStartValue);\n let endX = convertToNumber(xEndValue);\n\n if (startX > endX) {\n [startX, endX] = [endX, startX];\n }\n\n let pixelStartX = (startX - minX) / xRange * elementWidth;\n let pixelEndX = (endX - minX) / xRange * elementWidth;\n\n // Clamp values to be within the element width\n pixelStartX = Math.max(0, Math.min(elementWidth, pixelStartX));\n pixelEndX = Math.max(0, Math.min(elementWidth, pixelEndX));\n\n let pixelWidth = pixelEndX - pixelStartX;\n if (pixelWidth < 1 && pixelEndX > 0 && pixelStartX < elementWidth) {\n if (!isRange && isPoint) {\n pixelWidth = 1;\n pixelStartX -= 0.5;\n } else if (isRange) {\n pixelWidth = 1;\n } else {\n pixelWidth = 0;\n }\n }\n \n pixelStartX = Math.max(0, Math.min(elementWidth - pixelWidth, pixelStartX));\n\n\n if (pixelWidth <= 0) {\n return null;\n }\n\n\n return {\n ...annotation,\n isRange,\n pixelStartX,\n pixelWidth\n };\n }).filter(annotation => annotation !== null);\n\n return {\n annotations: renderableAnnotations,\n elementWidth\n };\n}\n","export default function selectionFromGlobalBounds(globalBounds, boundsCalculator) {\n const targetBounds = Object.assign({}, globalBounds, boundsCalculator(globalBounds));\n\n if (targetBounds.maxX instanceof Date) {\n targetBounds.maxX = targetBounds.maxX.valueOf();\n }\n\n if (targetBounds.minX instanceof Date) {\n targetBounds.minX = targetBounds.minX.valueOf();\n }\n\n if (targetBounds.maxX < targetBounds.minX) {\n targetBounds.maxX = targetBounds.minX;\n }\n\n if (targetBounds.minX < globalBounds.minX) {\n targetBounds.minX = globalBounds.minX;\n }\n\n if (targetBounds.maxX > globalBounds.maxX) {\n targetBounds.maxX = globalBounds.maxX;\n }\n\n return targetBounds;\n}\n","/**\n *\n * @param {Array<Object>} axes\n * @param {'left'|'right'} [side]\n * @param {String|Number} [number]\n * @return {Object|undefined}\n */\nexport default function findMatchingAxis({ axes, side, number }) {\n if (number) {\n number = parseInt(number) || 0;\n } else {\n number = 0;\n }\n\n let axis;\n let seen = 0;\n for (let candidateAxis of axes) {\n if (candidateAxis.side !== side) {\n continue;\n }\n\n if (seen === number) {\n axis = candidateAxis;\n break;\n }\n\n seen++;\n }\n\n return axis;\n}\n","export function averageLoopTimes(loopTimes) {\n const result = {};\n\n for (let loopTime of loopTimes) {\n for (let [key, value] of Object.entries(loopTime)) {\n result[key] = (result[key] || 0) + value;\n }\n }\n\n for (let [key, value] of Object.entries(result)) {\n result[key] = value/loopTimes.length;\n }\n\n return result;\n}\n","import scaleBounds from '../renderer/scale_bounds';\n\nexport default function boundCalculatorFromSelection({ minPixelX, maxPixelX, minPixelY, maxPixelY}, { elementWidth, elementHeight, selection, axes }) {\n if (Math.abs(maxPixelX - minPixelX) < 1 || Math.abs(maxPixelY - minPixelY) < 1) {\n return;\n }\n\n const minX = (minPixelX/elementWidth)*(selection.maxX - selection.minX) + selection.minX;\n const maxX = (maxPixelX/elementWidth)*(selection.maxX - selection.minX) + selection.minX;\n\n const byAxis = [];\n for (let { currentBounds, scale } of axes) {\n const scaledBounds = scaleBounds({ ...currentBounds, scale });\n let maxY = (1 - minPixelY/elementHeight)*(scaledBounds.maxY - scaledBounds.minY) + scaledBounds.minY;\n let minY = (1 - maxPixelY/elementHeight)*(scaledBounds.maxY - scaledBounds.minY) + scaledBounds.minY;\n\n if (scale === 'log') {\n minY = Math.pow(10, minY);\n maxY = Math.pow(10, maxY);\n }\n byAxis.push({\n minX,\n maxX,\n minY,\n maxY\n });\n }\n\n return () => {\n return {\n minX,\n maxX,\n byAxis\n };\n };\n}\n","import { useState, useEffect } from 'react';\n\nexport function useEvent(eventSource, eventName, initialState=null, watch=[]) {\n if (typeof initialState === 'function') {\n const originalInitialState = initialState;\n initialState = () => originalInitialState;\n }\n\n const [value, setValue] = useState(initialState);\n\n useEffect(() => {\n const listener = (updatedValue) => {\n if (typeof updatedValue === 'function') {\n const originalUpdatedValue = updatedValue;\n updatedValue = () => originalUpdatedValue;\n }\n setValue(updatedValue);\n };\n\n eventSource.on(eventName, listener);\n return () => {\n eventSource.off(eventName, listener);\n };\n }, [...watch, setValue, eventSource]);\n\n return value;\n}\n\nexport function usePrimarySize(stateController) {\n return useEvent(stateController, 'primary_size_change', stateController.primaryRenderer ? stateController.primaryRenderer.sizing : {\n elementWidth: 0,\n elementHeight: 0,\n renderWidth: 0,\n renderHeight: 0\n });\n}\n\nexport function useAxes(stateController) {\n return useEvent(stateController, 'axes_changed', stateController.axes);\n}\n\nexport function useSeries(stateController) {\n return useEvent(stateController, 'series_changed', stateController.series);\n}\n\nexport function useHighlightedSeries(stateController) {\n return useEvent(stateController, 'highlighted_series_changed', stateController.highlightedSeries);\n}\n\nexport function useRightAxisCount(stateController) {\n return useRightAxes(stateController).length;\n}\n\nexport function useLeftAxisCount(stateController) {\n return useLeftAxes(stateController).length;\n}\n\nexport function useRightAxes(stateController) {\n return useEvent(stateController, 'right_axes_changed', stateController.rightAxes);\n}\n\nexport function useLeftAxes(stateController) {\n return useEvent(stateController, 'left_axes_changed', stateController.leftAxes);\n}\n\nexport function useSelection(stateController) {\n return useEvent(stateController, 'selection_changed', stateController.selection);\n}\n\nexport function useGlobalBounds(stateController) {\n return useEvent(stateController, 'global_bounds_changed', stateController.globalBounds);\n}\n\nexport function useAxisBounds(stateController) {\n return useEvent(stateController, 'axis_bounds_changed', stateController.axes.map(({ currentBounds }) => currentBounds));\n}\n\nexport function useBoundCalculator(stateController) {\n return useEvent(stateController, 'bound_calculator_changed', stateController.boundCalculator);\n}\n\nexport function useShowIndividualPoints(stateController) {\n return useEvent(stateController, 'show_individual_points_changed', stateController.showIndividualPoints);\n}\n\nexport function useAutoscaleY(stateController) {\n return useEvent(stateController, 'autoscale_y_changed', stateController.autoscaleY);\n}\n\nexport function useBoundHistory(stateController) {\n return useEvent(stateController, 'bound_history_changed', stateController.boundHistory);\n}\n\nexport function useAlwaysTooltipped(stateController) {\n return useEvent(stateController, 'always_tooltipped_changed', stateController.alwaysTooltipped);\n}\n\nexport function useTooltipState(stateController) {\n return useEvent(stateController, 'tooltip_state_changed', stateController.tooltipState);\n}\n\nexport function useContextMenu(stateController) {\n return useEvent(stateController, 'context_menu_position_changed', stateController.contextMenuState);\n}\n\nexport function useDraggingY(stateController) {\n return useEvent(stateController, 'dragging_y_changed', stateController.draggingY);\n}\n\nexport function usePercentile(stateController) {\n return useEvent(stateController, 'percentile_changed', stateController.percentile);\n}\n\nexport function useShowingOptions(stateController) {\n return useEvent(stateController, 'showing_options_changed', stateController.showingOptions);\n}\n\nexport function useMaxPrecision(stateController) {\n return useEvent(stateController, 'max_precision_changed', stateController.maxPrecision);\n}\n\nexport function usePercentileAsymmetry(stateController) {\n return useEvent(stateController, 'percentile_asymmetry_changed', stateController.percentileAsymmetry);\n}\n\nexport function useShowingSidebar(stateController) {\n return useEvent(stateController, 'showing_sidebar_changed', stateController.showingSidebar);\n}\n\nexport function useShowingAnnotations(stateController) {\n return useEvent(stateController, 'showing_annotations_changed', stateController.showingAnnotations);\n}\n\nexport function useMultiSeries(multigraphStateController) {\n return useEvent(multigraphStateController, 'multi_series_changed', multigraphStateController.multiSeries);\n}\n\nexport function useAnnotationState(stateController) {\n return useEvent(stateController, 'annotations_changed', stateController.annotationState);\n}\n\nexport function useSizing(stateController) {\n return useEvent(stateController, 'primary_size_change', stateController.sizing);\n}\n\nexport function useTheme(stateController) {\n return useEvent(stateController, 'theme_change', stateController.theme);\n}\n\nexport function useExportMode(stateController) {\n return useEvent(stateController, 'export_mode_change', stateController.exportMode);\n}\n\nexport function useHasXEnum(stateController) {\n return useEvent(stateController, 'has_x_enum_change', stateController.hasXEnum);\n}\n\nexport function useEnumMap(stateController) {\n return useEvent(stateController, 'enum_map_change', stateController.enumMap);\n}\n\nexport function useXEnumMap(stateController) {\n return useEvent(stateController, 'x_enum_map_change', stateController.enumMap);\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nexport default class Annotations extends React.PureComponent {\n\n render() {\n const { bodyHeight, annotationState } = this.props;\n const { annotations, elementWidth } = annotationState;\n\n const validAnnotations = annotations.filter(a => a.pixelStartX !== undefined && a.pixelWidth !== undefined);\n\n return (\n <div className=\"grapher-annotations\">\n {\n validAnnotations.map(({ pixelStartX, pixelWidth, content, isRange, lineOnly }, i) => {\n const annotationStyle = {\n left: pixelStartX\n };\n\n if (isRange) {\n return (\n <div key={`range-${i}`} className=\"grapher-annotation grapher-annotation-range\" style={annotationStyle}>\n <div\n className=\"annotation-range-marker\"\n style={{ width: pixelWidth, height: bodyHeight }}\n />\n </div>\n );\n } else {\n const pointMarkerWidth = lineOnly ? pixelWidth : Math.max(pixelWidth, 1);\n\n const textStyle = {};\n if (content) {\n textStyle.top = 21 * i;\n textStyle.position = 'absolute';\n const approxTextWidth = (content || '').length * 5.5;\n if (elementWidth > 0 && elementWidth - pixelStartX < approxTextWidth + 10) {\n textStyle.left = -approxTextWidth - 5;\n textStyle.textAlign = 'right';\n } else {\n textStyle.left = pointMarkerWidth + 5;\n }\n }\n\n return (\n <div key={`point-${i}`} className=\"grapher-annotation grapher-annotation-point\" style={annotationStyle}>\n <div\n className=\"annotation-marker\"\n style={{ width: pointMarkerWidth, height: bodyHeight }}\n />\n {content && !lineOnly &&\n <div className=\"annotation-text\" style={textStyle}>\n {content}\n </div>\n }\n </div>\n );\n }\n })\n }\n </div>\n );\n }\n}\n\nAnnotations.propTypes = {\n annotationState: PropTypes.shape({\n annotations: PropTypes.arrayOf(PropTypes.shape({\n pixelStartX: PropTypes.number,\n pixelWidth: PropTypes.number,\n content: PropTypes.string,\n isRange: PropTypes.bool,\n lineOnly: PropTypes.bool\n })).isRequired,\n elementWidth: PropTypes.number.isRequired\n }),\n bodyHeight: PropTypes.number\n};\n","import React from 'react';\nimport CustomPropTypes from '../helpers/custom_prop_types.js';\nimport PropTypes from 'prop-types';\nimport StateController from '../state/state_controller.js';\nimport {LINE_COLORS} from '../helpers/colors.js';\nimport {useAxisBounds, useSizing} from '../state/hooks.js';\n\nexport default React.memo(DraggablePoints);\n\nfunction DraggablePoints({ stateController, draggablePoints, onPointDrag, onDraggablePointsDoubleClick }) {\n const bounds = useAxisBounds(stateController)[0];\n const sizing = useSizing(stateController);\n\n if (!sizing) {\n return null;\n }\n\n const onPointlessDoubleClick = onDraggablePointsDoubleClick && ((event) => {\n const newXT = (event.clientX - sizing.boundingRect.left)/sizing.elementWidth;\n const newYT = 1 - (event.clientY - sizing.boundingRect.top)/sizing.elementHeight;\n\n onDraggablePointsDoubleClick(event, {\n x: newXT*(bounds.maxX - bounds.minX) + bounds.minX,\n y: newYT*(bounds.maxY - bounds.minY) + bounds.minY\n });\n });\n\n return (\n <div className=\"grapher-draggable-points\" onDoubleClick={onPointlessDoubleClick}>\n <svg width={sizing.elementWidth} height={sizing.elementHeight}>\n {\n draggablePoints.map((point, index) => {\n const xT = (point.x - bounds.minX)/(bounds.maxX - bounds.minX);\n const yT = (1 - (point.y - bounds.minY)/(bounds.maxY - bounds.minY));\n\n if (xT < 0 || xT > 1 || yT < 0 || yT > 1) {\n return null;\n }\n\n const pixelX = xT * sizing.elementWidth;\n const pixelY = yT * sizing.elementHeight;\n\n const radius = point.radius || 5;\n const fillColor = point.fillColor || LINE_COLORS[0];\n const strokeColor = point.strokeColor || 'white';\n const strokeWidth = point.strokeWidth || 1;\n\n const onMouseDown = (event) => {\n event.stopPropagation();\n\n if (!onPointDrag) {\n return;\n }\n\n const xOffset = pixelX - event.clientX;\n const yOffset = pixelY - event.clientY;\n\n const onMouseMove = (moveEvent) => {\n const newXT = (moveEvent.clientX + xOffset)/sizing.elementWidth;\n const newYT = 1 - (moveEvent.clientY + yOffset)/sizing.elementHeight;\n\n onPointDrag({\n index,\n point,\n x: newXT*(bounds.maxX - bounds.minX) + bounds.minX,\n y: newYT*(bounds.maxY - bounds.minY) + bounds.minY\n }, moveEvent);\n };\n\n const onMouseUp = () => {\n window.removeEventListener('mousemove', onMouseMove);\n window.removeEventListener('mouseup', onMouseUp);\n };\n\n window.addEventListener('mousemove', onMouseMove);\n window.addEventListener('mouseup', onMouseUp);\n };\n\n const onClick = point.onClick && ((event) => {\n point.onClick(event, point);\n });\n\n const onDoubleClick = point.onDoubleClick && ((event) => {\n event.stopPropagation();\n point.onDoubleClick(event, point);\n });\n\n return (\n <circle\n key={index}\n cx={pixelX}\n cy={pixelY}\n r={radius}\n fill={fillColor}\n stroke={strokeColor}\n strokeWidth={strokeWidth}\n onMouseDown={onMouseDown}\n onClick={onClick}\n onDoubleClick={onDoubleClick}\n />\n );\n })\n }\n </svg>\n </div>\n );\n}\n\nDraggablePoints.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n draggablePoints: CustomPropTypes.DraggablePoints.isRequired,\n onPointDrag: PropTypes.func,\n onDraggablePointsDoubleClick: PropTypes.func\n};\n","import React from 'react';\nimport CustomPropTypes from '../helpers/custom_prop_types.js';\nimport PropTypes from 'prop-types';\nimport StateController from '../state/state_controller.js';\nimport {useAxisBounds, useSizing} from '../state/hooks.js';\n\nexport default React.memo(VerticalLines);\n\nfunction VerticalLines({ stateController, verticalLines, isRangeGraph, bounds, elementWidth, elementHeight }) {\n bounds = bounds || useAxisBounds(stateController)[0];\n const sizing = useSizing(stateController);\n\n if (!sizing) {\n return null;\n }\n\n const relevantVerticalLines = verticalLines.filter(line => {\n if (isRangeGraph && !line.onRangeGraph) {\n return false;\n }\n\n if (line.onRangeGraphOnly && !isRangeGraph) {\n return false;\n }\n\n return true;\n });\n\n if (relevantVerticalLines.length === 0) {\n return null;\n }\n\n return (\n <div className=\"grapher-vertical-lines\">\n <svg width={elementWidth || sizing.elementWidth} height={elementHeight || sizing.elementHeight}>\n {\n relevantVerticalLines.map((line, index) => {\n if (isRangeGraph && typeof line.onRangeGraph === 'object') {\n line = {\n ...line,\n ...line.onRangeGraph\n };\n }\n\n const xT = (line.x - bounds.minX)/(bounds.maxX - bounds.minX);\n\n if (xT < 0 || xT > 1) {\n return null;\n }\n\n const pixelX = xT * (elementWidth || sizing.elementWidth);\n if (typeof line.minPixelX === 'number' && pixelX < line.minPixelX) {\n return null;\n }\n\n if (typeof line.maxPixelX === 'number' && pixelX > line.maxPixelX) {\n return null;\n }\n\n const lineStyle = {\n stroke: line.color,\n strokeWidth: line.width,\n ...(line.style || {})\n };\n\n const markerStyle = {\n fill: line.color,\n ...(line.markerStyle || {})\n };\n\n const textStyle = {\n ...{\n fontSize: '12px',\n fill: line.color,\n stroke: 'none',\n textAnchor: 'middle',\n dominantBaseline: 'hanging'\n },\n ...(line.textStyle || {})\n };\n\n let lineTop = 0;\n if (typeof line.lineTop === 'number') {\n lineTop = line.lineTop;\n } else if (line.text) {\n lineTop = 18;\n }\n\n let textTop = 5;\n if (typeof line.textTop === 'number') {\n textTop = line.textTop;\n }\n\n return (\n <React.Fragment key={index}>\n <line\n x1={pixelX}\n y1={lineTop}\n x2={pixelX}\n y2={(elementHeight || sizing.elementHeight)}\n style={lineStyle}\n />\n\n {\n line.markTop &&\n <polygon\n points={`${pixelX - 3},0 ${pixelX + 3},0 ${pixelX},3`}\n style={markerStyle}\n />\n }\n\n {\n line.text &&\n <text\n x={pixelX}\n y={textTop}\n style={textStyle}\n >\n {line.text}\n </text>\n }\n </React.Fragment>\n );\n })\n }\n </svg>\n </div>\n );\n}\n\nVerticalLines.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n verticalLines: CustomPropTypes.VerticalLines.isRequired,\n isRangeGraph: PropTypes.bool,\n bounds: PropTypes.object,\n elementWidth: PropTypes.number,\n elementHeight: PropTypes.number\n};\n","import React, { useCallback, useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport CustomPropTypes from '../helpers/custom_prop_types';\nimport GraphBodyRenderer from '../renderer/graph_body_renderer';\nimport Tooltip from './tooltip.jsx';\nimport ContextMenu from './context_menu.jsx';\nimport StateController from '../state/state_controller';\nimport {\n useAnnotationState,\n useAutoscaleY,\n useAxes,\n useMaxPrecision,\n useShowingAnnotations,\n useTooltipState,\n useContextMenu\n} from '../state/hooks';\nimport Annotations from './annotations.jsx';\nimport DraggablePoints from './draggable_points.jsx';\nimport VerticalLines from './vertical_lines.jsx';\nimport binarySearch from '../helpers/binary_search';\n\nexport default React.memo(GraphBody);\n\nfunction GraphBody({ stateController, webgl, bodyHeight, boundsSelectionEnabled, showTooltips, showContextMenu=true, tooltipOptions, checkIntersection, draggablePoints, onPointDrag, onDraggablePointsDoubleClick, verticalLines, clockStyle, timeZone, onPointClick }) {\n const canvasEl = useCallback((el) => {\n if (stateController.primaryRenderer) {\n stateController.primaryRenderer.dispose();\n }\n\n if (!el) {\n return;\n }\n\n const renderer = new GraphBodyRenderer({\n stateController: stateController,\n canvasElement: el,\n webgl,\n checkIntersection\n });\n\n stateController.primaryRenderer = renderer;\n renderer.resize();\n }, [webgl, stateController]);\n\n\n const [boundsSelection, setBoundsSelection] = useState({\n showing: false,\n start: {},\n style: {}\n });\n\n const autoscaleY = useAutoscaleY(stateController);\n\n const axisCount = useAxes(stateController).length;\n\n const tooltip = useTooltipState(stateController);\n const maxPrecision = useMaxPrecision(stateController);\n const showAnnotations = useShowingAnnotations(stateController);\n const annotationState = useAnnotationState(stateController);\n const contextMenu = useContextMenu(stateController);\n\n const onMouseDown = (event) => {\n if (!boundsSelectionEnabled) {\n return;\n }\n\n let currentNode = event.target;\n for (let i = 0; i < 10 && currentNode; i++) {\n if (currentNode.classList.contains('grapher-tooltip')) {\n return;\n }\n currentNode = currentNode.parentNode;\n }\n\n const boundingRect = stateController.primaryRenderer.boundingRect;\n\n const start = {\n x: event.clientX - boundingRect.left,\n y: event.clientY - boundingRect.top\n };\n\n\n setBoundsSelection({\n showing: true,\n start,\n style: {\n left: start.x,\n top: start.y,\n width: 0,\n height: 0\n }\n });\n\n const onMouseUp = (event) => {\n window.removeEventListener('mouseup', onMouseUp);\n\n if (!boundsSelectionEnabled) {\n return;\n }\n\n const x = event.clientX - boundingRect.left;\n const y = event.clientY - boundingRect.top;\n\n stateController.setBoundsFromSelection({\n minPixelX: Math.min(x, start.x),\n maxPixelX: Math.max(x, start.x),\n minPixelY: Math.min(y, start.y),\n maxPixelY: Math.max(y, start.y)\n });\n\n setBoundsSelection({\n showing: false,\n style: {}\n });\n };\n\n window.addEventListener('mouseup', onMouseUp);\n };\n\n const onMouseMove = (event) => {\n if (boundsSelection.showing) {\n const boundingRect = stateController.primaryRenderer.boundingRect;\n const x = event.clientX - boundingRect.left;\n const y = event.clientY - boundingRect.top;\n\n setBoundsSelection(({ start }) => {\n return {\n showing: true,\n start,\n style: {\n left: Math.min(x, start.x),\n top: autoscaleY ? 0 : Math.min(y, start.y),\n width: Math.abs(x - start.x),\n height: autoscaleY ? boundingRect.height : Math.abs(y - start.y)\n }\n };\n });\n }\n };\n\n useEffect(() => {\n const onScroll = () => {\n if (!showTooltips) {\n return;\n }\n\n stateController.recalculateTooltips();\n };\n\n const onGlobalMouseMove = (event) => {\n if (!showTooltips) {\n return;\n }\n\n stateController.setTooltipMousePosition({\n clientX: event.clientX,\n clientY: event.clientY,\n shiftKey: event.shiftKey\n });\n };\n\n const getTouch = (event) => event.touches?.[0] || event.changedTouches?.[0];\n\n const onGlobalTouchStart = (event) => {\n if (!showTooltips) {\n return;\n }\n const touch = getTouch(event);\n if (!touch) return;\n stateController.setTooltipMousePosition({\n clientX: touch.clientX,\n clientY: touch.clientY\n });\n \n // Only prevent default if touch is within grapher bounds\n if (event.cancelable && event.target.closest('.graph-body')) {\n event.preventDefault();\n }\n };\n\n const onGlobalTouchMove = (event) => {\n if (!showTooltips) {\n return;\n }\n const touch = getTouch(event);\n if (!touch) return;\n stateController.setTooltipMousePosition({\n clientX: touch.clientX,\n clientY: touch.clientY\n });\n \n // Only prevent default if touch is within grapher bounds\n if (event.cancelable && event.target.closest('.graph-body')) {\n event.preventDefault();\n }\n };\n\n const onGlobalTouchEnd = () => {\n stateController.showOnlySavedTooltips();\n };\n\n window.addEventListener('scroll', onScroll, { passive: true });\n window.addEventListener('mousemove', onGlobalMouseMove, { passive: true });\n window.addEventListener('touchstart', onGlobalTouchStart, { passive: false });\n window.addEventListener('touchmove', onGlobalTouchMove, { passive: false });\n window.addEventListener('touchend', onGlobalTouchEnd, { passive: true });\n window.addEventListener('touchcancel', onGlobalTouchEnd, { passive: true });\n\n return () => {\n window.removeEventListener('scroll', onScroll);\n window.removeEventListener('mousemove', onGlobalMouseMove);\n window.removeEventListener('touchstart', onGlobalTouchStart);\n window.removeEventListener('touchmove', onGlobalTouchMove);\n window.removeEventListener('touchend', onGlobalTouchEnd);\n window.removeEventListener('touchcancel', onGlobalTouchEnd);\n };\n }, []);\n\n const onMouseLeave = () => {\n stateController.setContextMenuMousePosition({\n showing: false\n });\n };\n\n const onClick = (event) => {\n stateController.registerClick({\n clientX: event.clientX,\n clientY: event.clientY\n });\n\n if (tooltipOptions && tooltipOptions.savingDisabled) {\n stateController.clearSavedTooltips();\n return;\n }\n\n // if it's NOT a child of 'grapher-context-menu', close the context menu\n if (!event.target.closest('.grapher-context-menu')) {\n stateController.setContextMenuMousePosition({\n showing: false\n });\n }\n\n if (!window.getSelection || window.getSelection().type !== 'Range') {\n stateController.toggleTooltipSaved();\n }\n\n if (onPointClick) {\n const seriesToNearestPoint = {};\n\n const series = stateController.series;\n for (let i = 0; i < series.length; i++) {\n const singleSeries = series[i];\n\n const sizing = stateController.sizing;\n const bounds = singleSeries.axis.currentBounds;\n // const trueX = event.clientX/sizing.elementWidth * (bounds.maxX - bounds.minX) + bounds.minX;\n const trueX = stateController.tooltipState.mouseX/sizing.elementWidth * (bounds.maxX - bounds.minX) + bounds.minX;\n\n let data = singleSeries.inDataSpace;\n if (singleSeries.ignoreDiscontinuities) {\n data = data.filter((tuple) => typeof tuple[1] === 'number');\n }\n \n const closestIndex = binarySearch(data, trueX, { returnIndex: true });\n const closestPoint = data[closestIndex];\n\n seriesToNearestPoint[singleSeries.name] = closestPoint[0];\n }\n\n\n\n onPointClick(event, seriesToNearestPoint);\n }\n };\n const onDoubleClick = () => {\n stateController.clearSavedTooltips();\n };\n \n const onContextMenu = (event) => {\n event.preventDefault();\n if (showContextMenu !== false) {\n stateController.setContextMenuMousePosition({\n clientX: event.clientX,\n clientY: event.clientY,\n showing: true\n });\n }\n };\n\n return (\n <div className=\"graph-body graph-body-primary\"\n onMouseMove={onMouseMove}\n onMouseLeave={onMouseLeave}\n onMouseDown={onMouseDown}\n onClick={onClick}\n onDoubleClick={onDoubleClick}\n onContextMenu={onContextMenu}\n style={typeof bodyHeight === 'number' ? { height: bodyHeight } : undefined}\n >\n <canvas ref={canvasEl} />\n\n {\n showTooltips &&\n <Tooltip\n axisCount={axisCount}\n maxPrecision={maxPrecision}\n clockStyle={clockStyle}\n timeZone={timeZone}\n {...(tooltipOptions || {})}\n {...tooltip}\n />\n }\n\n {\n contextMenu.showing &&\n <ContextMenu\n contextMenu={contextMenu}\n />\n }\n\n {\n showAnnotations &&\n <Annotations\n bodyHeight={bodyHeight || stateController?.primaryRenderer?.boundingRect?.height}\n annotationState={annotationState}\n />\n }\n\n {\n verticalLines &&\n <VerticalLines\n stateController={stateController}\n verticalLines={verticalLines}\n />\n }\n\n {\n draggablePoints &&\n <DraggablePoints\n stateController={stateController}\n draggablePoints={draggablePoints}\n onPointDrag={onPointDrag}\n onDraggablePointsDoubleClick={onDraggablePointsDoubleClick}\n />\n }\n\n {\n boundsSelectionEnabled && boundsSelection.showing &&\n <div className=\"bounds-selection\"\n style={boundsSelection.style}\n />\n }\n </div>\n );\n}\n\nGraphBody.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n webgl: PropTypes.bool,\n checkIntersection: PropTypes.bool,\n bodyHeight: PropTypes.number,\n boundsSelectionEnabled: PropTypes.bool.isRequired,\n showTooltips: PropTypes.bool.isRequired,\n tooltipOptions: CustomPropTypes.TooltipOptions,\n verticalLines: CustomPropTypes.VerticalLines,\n draggablePoints: CustomPropTypes.DraggablePoints,\n onPointDrag: PropTypes.func,\n onDraggablePointsDoubleClick: PropTypes.func,\n onPointClick: PropTypes.func,\n clockStyle: PropTypes.oneOf(['12h', '24h']),\n timeZone: PropTypes.string\n};","\n import API from \"!../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../node_modules/css-loader/dist/cjs.js!../node_modules/sass-loader/dist/cjs.js!./grapher.scss\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../node_modules/css-loader/dist/cjs.js!../node_modules/sass-loader/dist/cjs.js!./grapher.scss\";\n export default content && content.locals ? content.locals : undefined;\n","import {startOfDayInTimezone, timezoneToOffsetMS} from './format';\n\nfunction placeTick(trueValue, {scale, min, max, inverted, totalSize, precision, formatter, dates, justTime, justDate, formatOptions={} }, opts={}) {\n let scaledValue = trueValue;\n\n if (scale === 'log') {\n scaledValue = 10**trueValue;\n }\n\n let percent = (trueValue - min)/(max - min);\n if (inverted) {\n percent = 1.0 - percent;\n }\n\n let pixelValue = percent * totalSize;\n if (isNaN(pixelValue)) {\n pixelValue = 0;\n }\n\n return {\n pixelValue,\n trueValue: scaledValue,\n label: formatter(scaledValue, { ...formatOptions, precision, log: scale === 'log', dates, justTime, justDate }),\n size: 'major',\n ...opts\n };\n}\n\nfunction placeTickByPixel(pixelValue, {scale, min, max, inverted, totalSize, precision, formatter, dates, justTime, justDate, formatOptions={} }, opts={}) {\n let percent = pixelValue/totalSize;\n if (inverted) {\n percent = 1.0 - percent;\n }\n\n let trueValue = percent * (max - min) + min;\n\n if (scale === 'log') {\n trueValue = Math.pow(10, trueValue);\n }\n\n return {\n pixelValue,\n trueValue,\n label: formatter(trueValue, { ...formatOptions, precision, log: scale === 'log', dates, justTime, justDate }),\n size: 'major',\n ...opts\n };\n}\n\nfunction roundToEvenNumber(value, tickSpacing) {\n return Math.round(value/tickSpacing)*tickSpacing;\n}\n\nfunction getEvenTickSpacing(span, desiredCount) {\n const subspan = span/desiredCount;\n\n const precision = -Math.log10(Math.abs(subspan)) + 1;\n const multiplier = (precision - Math.floor(precision)) > 0.5 ? 2 : 1;\n\n const roundTo = 10**Math.floor(precision) * multiplier;\n\n return Math.round(subspan * roundTo)/roundTo;\n}\n\nfunction roundToDivisor(value, divisor) {\n if (value <= 1) {\n return 1;\n }\n\n if (divisor === 1) {\n return Math.round(value);\n }\n\n if (value >= divisor) {\n return Math.round(value/divisor)*divisor;\n }\n\n let divisors;\n if (divisor === 24) {\n divisors = [1, 2, 6, 12, 24];\n } else if (divisor === 60) {\n divisors = [1, 2, 5, 10, 15, 30, 60];\n } else {\n throw new Error('Invalid divisor');\n }\n\n let bestDelta = Infinity;\n let bestDivisor = 1;\n for (let i = 0; i < divisors.length; i++) {\n const delta = Math.abs(divisors[i] - value);\n if (delta < bestDelta) {\n bestDivisor = divisors[i];\n bestDelta = delta;\n }\n }\n\n return bestDivisor;\n}\n\nfunction getEvenDateTickSpacing(span, desiredCount, unitOverride) {\n const subspan = span / desiredCount;\n\n if (subspan < 60*1000 && (!unitOverride || unitOverride === 'second')) {\n return {\n amount: roundToDivisor(subspan/1000, 60),\n unit: 's'\n };\n }\n\n if (subspan < 60*60*1000 && (!unitOverride || unitOverride === 'minute')) {\n return {\n amount: roundToDivisor(subspan/(60*1000), 60),\n unit: 'm'\n };\n }\n\n if (subspan < 24*60*60*1000 && (!unitOverride || unitOverride === 'hour')) {\n return {\n amount: roundToDivisor(subspan/(60*60*1000), 24),\n unit: 'h'\n };\n }\n\n if (unitOverride === 'day' || (subspan < 30*24*60*60*1000 && !unitOverride)) {\n return {\n amount: roundToDivisor(subspan/(24*60*60*1000), 1),\n unit: 'd'\n };\n }\n\n if (subspan > 30*24*60*60*1000 && (!unitOverride || unitOverride === 'month')) {\n return {\n amount: roundToDivisor(subspan/30*24*60*60*1000, 1),\n unit: 'month'\n };\n }\n\n if (unitOverride === 'year') {\n return {\n amount: roundToDivisor(subspan/365*24*60*60*1000, 1),\n unit: 'year'\n };\n }\n\n return {\n unit: 'm',\n amount: 60\n };\n}\n\nfunction placeNumbersGrid({ min, max, precision, expectedLabelSize, labelPadding, totalSize, scale='linear', formatter, inverted=false, formatOptions }) {\n const paddedLabelSize = expectedLabelSize + 2*labelPadding;\n\n const ticks = [];\n const placementParams = {scale, min, max, inverted, totalSize, precision, formatter, formatOptions, dates: false };\n\n const labelCount = Math.floor((totalSize - expectedLabelSize*2)/paddedLabelSize);\n const tickSpacing = getEvenTickSpacing(max - min, labelCount);\n if (tickSpacing > 0) {\n for (let value = roundToEvenNumber(min, tickSpacing); value < max; value += tickSpacing) {\n ticks.push(placeTick(value, placementParams));\n }\n }\n\n if (ticks.length) {\n if (inverted && ticks[ticks.length - 1].pixelValue > labelPadding) {\n ticks.push(placeTickByPixel(expectedLabelSize / 2, placementParams));\n }\n }\n\n return ticks.filter(({ pixelValue }) => pixelValue <= totalSize && pixelValue >= 0);\n}\n\nfunction placeDatesGrid({ min, max, precision, expectedLabelSize, labelPadding, totalSize, skipFirst=false, skipLast=false, scale='linear', formatter, inverted=false, formatOptions }) {\n const paddedLabelSize = expectedLabelSize + 2*labelPadding;\n\n const ticks = [];\n const placementParams = {scale, min, max, inverted, totalSize, precision, formatter, formatOptions, dates: true };\n\n const { amount, unit } = getEvenDateTickSpacing(max - min, totalSize/paddedLabelSize, formatOptions.unitOverride);\n\n const justDate = unit === 'month';\n\n if (!skipFirst) {\n ticks.push(placeTickByPixel(0, {...placementParams, justDate}, {position: 'first'}));\n }\n\n let currentDate = new Date(min);\n\n if (unit === 'h') {\n currentDate.setMinutes(0, 0, 0);\n } else if (unit === 'm') {\n currentDate.setSeconds(0, 0);\n } else if (unit === 's') {\n currentDate.setMilliseconds(0);\n } else if (unit === 'month') {\n currentDate = startOfDayInTimezone(currentDate, formatOptions.timeZone);\n currentDate.setDate(1);\n } else if (unit === 'd') {\n currentDate = startOfDayInTimezone(currentDate, formatOptions.timeZone);\n }\n\n let lastDateString = formatter(currentDate, {...formatOptions, ...placementParams, justDate: true });\n while (currentDate < max) {\n let delta = 24*60*60*1000;\n\n if (unit === 'h') {\n delta = (amount - currentDate.getHours() % amount)*60*60*1000;\n } else if (unit === 'm') {\n delta = (amount - currentDate.getMinutes() % amount)*60*1000;\n } else if (unit === 's') {\n delta = (amount - currentDate.getSeconds() % amount)*1000;\n } else if (unit === 'month') {\n delta = 0;\n if (currentDate.getMonth() === 11) {\n currentDate = new Date(currentDate.getFullYear() + 1, 0, 1);\n } else {\n currentDate = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 1);\n }\n } else if (unit === 'year') {\n currentDate = new Date(currentDate.getFullYear() + 1, 0, 0);\n }\n\n currentDate = new Date(currentDate.valueOf() + delta);\n\n const justTime = formatter(currentDate, {...formatOptions, ...placementParams, justDate: true }) === lastDateString;\n\n const tick = placeTick(currentDate, {...placementParams, justTime, justDate});\n\n if (ticks.length && (tick.pixelValue - ticks[ticks.length - 1].pixelValue) < (expectedLabelSize + (labelPadding || 0))) {\n continue;\n }\n\n if (tick.pixelValue + expectedLabelSize/2 >= totalSize) {\n continue;\n }\n\n ticks.push(tick);\n lastDateString = formatter(currentDate, {...formatOptions, ...placementParams, justDate: true });\n }\n\n const justTime = lastDateString === formatter(max, {...formatOptions, ...placementParams, justDate: true });\n\n if (!skipLast && ticks[ticks.length - 1].pixelValue + expectedLabelSize < totalSize) {\n ticks.push(placeTickByPixel(totalSize, {...placementParams, justTime, justDate}, {position: 'last'}));\n }\n\n return ticks.filter(({ pixelValue }) => pixelValue <= totalSize && pixelValue >= 0);\n}\n\nfunction placeTimeOnlyGrid({ min, max, precision, expectedLabelSize, labelPadding, totalSize, skipFirst=false, skipLast=false, scale='linear', formatter, inverted=false, formatOptions={} }) {\n const paddedLabelSize = expectedLabelSize + 2*labelPadding;\n const ticks = [];\n const placementParams = { scale, min, max, inverted, totalSize, precision, formatter, formatOptions, dates: true };\n\n const desiredCount = Math.floor(totalSize/paddedLabelSize);\n const span = max - min;\n \n let unit, amount;\n \n const hourSpan = span / (60 * 60 * 1000);\n const minuteSpan = span / (60 * 1000);\n \n if (hourSpan <= desiredCount * 8) {\n unit = 'h';\n amount = Math.max(1, Math.ceil(hourSpan / desiredCount));\n if (amount <= 6) {\n } else if (amount <= 12) {\n amount = 12;\n } else if (amount <= 24) {\n amount = 24;\n } else {\n amount = Math.ceil(amount / 24) * 24;\n }\n } else {\n unit = 'h';\n amount = 24;\n }\n \n if (!skipFirst) {\n ticks.push(placeTickByPixel(0, {...placementParams, justTime: true}, {position: 'first'}));\n }\n \n let currentDate = new Date(min);\n \n if (unit === 'h') {\n if (amount === 24) {\n currentDate = startOfDayInTimezone(currentDate, formatOptions.timeZone);\n } else {\n const offset = formatOptions.timeZone ? timezoneToOffsetMS(formatOptions.timeZone, currentDate) : 0;\n const localOffset = timezoneToOffsetMS('local', currentDate);\n \n if (offset !== null && localOffset !== null) {\n const adjustedDate = new Date(currentDate.valueOf() + offset - localOffset);\n adjustedDate.setMinutes(0, 0, 0);\n \n if (amount === 12) {\n const currentHour = adjustedDate.getHours();\n const alignedHour = currentHour < 12 ? 0 : 12;\n adjustedDate.setHours(alignedHour);\n } else {\n const currentHour = adjustedDate.getHours();\n const alignedHour = Math.floor(currentHour / amount) * amount;\n adjustedDate.setHours(alignedHour);\n }\n \n currentDate = new Date(adjustedDate.valueOf() - offset + localOffset);\n } else {\n currentDate.setMinutes(0, 0, 0);\n if (amount === 12) {\n const currentHour = currentDate.getHours();\n const alignedHour = currentHour < 12 ? 0 : 12;\n currentDate.setHours(alignedHour);\n } else {\n const currentHour = currentDate.getHours();\n const alignedHour = Math.floor(currentHour / amount) * amount;\n currentDate.setHours(alignedHour);\n }\n }\n }\n } else if (unit === 'm') {\n currentDate.setSeconds(0, 0);\n const currentMinute = currentDate.getMinutes();\n const alignedMinute = Math.floor(currentMinute / amount) * amount;\n currentDate.setMinutes(alignedMinute);\n } else if (unit === 's') {\n currentDate.setMilliseconds(0);\n const currentSecond = currentDate.getSeconds();\n const alignedSecond = Math.floor(currentSecond / amount) * amount;\n currentDate.setSeconds(alignedSecond);\n }\n \n while (currentDate < min) {\n if (unit === 'h') {\n currentDate = new Date(currentDate.valueOf() + amount * 60 * 60 * 1000);\n } else if (unit === 'm') {\n currentDate = new Date(currentDate.valueOf() + amount * 60 * 1000);\n } else if (unit === 's') {\n currentDate = new Date(currentDate.valueOf() + amount * 1000);\n }\n }\n \n while (currentDate < max) {\n const tick = placeTick(currentDate, {...placementParams, justTime: true});\n \n const reservedSpaceForLast = expectedLabelSize + labelPadding;\n const maxPixelForMiddleTicks = totalSize - reservedSpaceForLast;\n \n if (ticks.length && (tick.pixelValue - ticks[ticks.length - 1].pixelValue) < (expectedLabelSize + labelPadding)) {\n } else if (tick.pixelValue + expectedLabelSize < maxPixelForMiddleTicks) {\n ticks.push(tick);\n } else {\n break;\n }\n \n if (unit === 'h') {\n currentDate = new Date(currentDate.valueOf() + amount * 60 * 60 * 1000);\n } else if (unit === 'm') {\n currentDate = new Date(currentDate.valueOf() + amount * 60 * 1000);\n } else if (unit === 's') {\n currentDate = new Date(currentDate.valueOf() + amount * 1000);\n } else {\n break;\n }\n }\n \n if (!skipLast) {\n const lastTick = placeTick(max, {...placementParams, justTime: true}, {position: 'last'});\n if (ticks.length === 0 || (lastTick.pixelValue - ticks[ticks.length - 1].pixelValue) >= (expectedLabelSize + labelPadding/2)) {\n ticks.push(lastTick);\n } else {\n ticks[ticks.length - 1] = lastTick;\n }\n }\n \n return ticks.filter(({ pixelValue }) => pixelValue <= totalSize && pixelValue >= 0);\n}\n\nfunction placeDateOnlyGrid({ min, max, precision, expectedLabelSize, labelPadding, totalSize, skipFirst=false, skipLast=false, scale='linear', formatter, inverted=false, formatOptions={} }) {\n const paddedLabelSize = expectedLabelSize + 2*labelPadding;\n const ticks = [];\n \n const minYear = new Date(min).getFullYear();\n const maxYear = new Date(max).getFullYear();\n const spanMultipleYears = minYear !== maxYear;\n\n const customDateFormatter = (date, options) => {\n const timeZone = formatOptions.timeZone;\n const result = formatter(date, { ...options, dates: true, justMonthAndDay: !spanMultipleYears, justDate: spanMultipleYears, timeZone });\n return result;\n };\n \n const placementParams = { scale, min, max, inverted, totalSize, precision, formatter: customDateFormatter, formatOptions, dates: true };\n \n const span = max - min;\n const hourSpan = span / (60 * 60 * 1000);\n \n let { amount, unit } = getEvenDateTickSpacing(span, totalSize/paddedLabelSize, formatOptions.unitOverride);\n \n if ((unit === 'h' || unit === 'm' || unit === 's') && hourSpan >= 48) {\n unit = 'd';\n amount = Math.max(1, Math.ceil(hourSpan / 24 / Math.floor(totalSize/paddedLabelSize)));\n } else if ((unit === 'h' || unit === 'm' || unit === 's') && hourSpan < 48) {\n const startTick = placeTick(min, {...placementParams, justDate: true}, {position: 'first'});\n const endTick = placeTick(max, {...placementParams, justDate: true}, {position: 'last'});\n \n const ticks = [startTick];\n if ((endTick.pixelValue - startTick.pixelValue) >= (expectedLabelSize + labelPadding)) {\n ticks.push(endTick);\n }\n \n return ticks.filter(({ pixelValue }) => pixelValue <= totalSize && pixelValue >= 0);\n }\n \n if (!skipFirst) {\n ticks.push(placeTickByPixel(0, {...placementParams, justDate: true}, {position: 'first'}));\n }\n \n let currentDate = new Date(min);\n \n if (unit === 'month') {\n currentDate = startOfDayInTimezone(currentDate, formatOptions.timeZone);\n currentDate.setDate(1);\n } else if (unit === 'd') {\n currentDate = startOfDayInTimezone(currentDate, formatOptions.timeZone);\n }\n \n while (currentDate < max) {\n let delta = 24*60*60*1000;\n \n if (unit === 'month') {\n delta = 0;\n if (currentDate.getMonth() === 11) {\n currentDate = new Date(currentDate.getFullYear() + 1, 0, 1);\n } else {\n currentDate = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 1);\n }\n } else if (unit === 'year') {\n currentDate = new Date(currentDate.getFullYear() + 1, 0, 1);\n delta = 0;\n } else if (unit === 'd') {\n delta = amount * 24 * 60 * 60 * 1000;\n }\n \n if (delta > 0) {\n currentDate = new Date(currentDate.valueOf() + delta);\n }\n \n const tick = placeTick(currentDate, {...placementParams, justDate: true});\n \n const reservedSpaceForLast = expectedLabelSize + labelPadding;\n const maxPixelForMiddleTicks = totalSize - reservedSpaceForLast;\n \n if (ticks.length && (tick.pixelValue - ticks[ticks.length - 1].pixelValue) < (expectedLabelSize + (labelPadding || 0))) {\n continue;\n }\n \n if (tick.pixelValue + expectedLabelSize < maxPixelForMiddleTicks) {\n ticks.push(tick);\n } else {\n break;\n }\n }\n \n if (!skipLast) {\n const lastTick = placeTick(max, {...placementParams, justDate: true}, {position: 'last'});\n if (ticks.length === 0 || (lastTick.pixelValue - ticks[ticks.length - 1].pixelValue) >= (expectedLabelSize + labelPadding/2)) {\n ticks.push(lastTick);\n } else {\n ticks[ticks.length - 1] = lastTick;\n }\n }\n\n if (ticks.length === 0 && hourSpan >= 48) {\n ticks.push(placeTickByPixel(0, {...placementParams, justDate: true}, {position: 'first'}));\n }\n \n return ticks.filter(({ pixelValue }) => pixelValue <= totalSize && pixelValue >= 0);\n}\n\nexport { placeTimeOnlyGrid, placeDateOnlyGrid };\n\nexport default function placeGrid(opts) {\n if (opts.dates) {\n return placeDatesGrid(opts);\n } else {\n return placeNumbersGrid(opts);\n }\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport {calculatePrecision, calculateTimePrecision, formatX} from '../helpers/format';\nimport placeGrid, { placeTimeOnlyGrid, placeDateOnlyGrid } from '../helpers/place_grid';\nimport {useEnumMap, useHasXEnum, usePrimarySize, useSelection} from '../state/hooks';\nimport StateController from '../state/state_controller';\n\nexport default React.memo(XAxis);\n\nfunction XAxis({ showAxes, showGrid, stateController, bigLabels, xTickUnit, clockStyle, timeZone, integersOnly, formatXAxisLabel }) {\n if (!showAxes && !showGrid) {\n return null;\n }\n\n const { elementWidth, elementHeight } = usePrimarySize(stateController);\n const {minX, maxX, dates} = useSelection(stateController);\n const hasXEnum = useHasXEnum(stateController);\n const enumMap = useEnumMap(stateController);\n\n let precision;\n if (dates) {\n precision = calculateTimePrecision(minX, maxX);\n } else {\n precision = calculatePrecision(maxX - minX);\n }\n\n let inverseEnumMap = null;\n if (hasXEnum) {\n inverseEnumMap = {};\n for (const [key, value] of Object.entries(enumMap)) {\n inverseEnumMap[value] = key;\n }\n }\n\n const formatOptions = {\n unitOverride: xTickUnit,\n clockStyle,\n timeZone,\n integersOnly,\n inverseEnumMap,\n formatter: formatXAxisLabel\n };\n\n const minLabel = formatX(minX, {...formatOptions, dates, precision }).toString();\n const maxLabel = formatX(maxX, {...formatOptions, dates, precision }).toString();\n\n let expectedLabelWidth = Math.max(minLabel.length, maxLabel.length);\n if (bigLabels) {\n expectedLabelWidth *= 2;\n }\n\n const labelPadding = 30;\n\n let timeTicks = null;\n let dateTicks = null;\n let regularTicks = null;\n \n if (dates) {\n timeTicks = placeTimeOnlyGrid({\n min: minX,\n max: maxX,\n totalSize: elementWidth,\n precision,\n expectedLabelSize: expectedLabelWidth,\n labelPadding: labelPadding * 0.8,\n formatter: formatXAxisLabel || formatX,\n formatOptions\n });\n \n dateTicks = placeDateOnlyGrid({\n min: minX,\n max: maxX,\n totalSize: elementWidth,\n precision,\n expectedLabelSize: expectedLabelWidth * 2,\n labelPadding: labelPadding * 1.5,\n formatter: formatXAxisLabel || formatX,\n formatOptions\n });\n } else {\n regularTicks = placeGrid({\n min: minX,\n max: maxX,\n totalSize: elementWidth,\n precision,\n dates,\n formatter: formatXAxisLabel || formatX,\n expectedLabelSize: expectedLabelWidth,\n labelPadding,\n formatOptions\n });\n }\n\n const xAxisHeight = dates ? 30 : 20;\n\n return (\n <svg className={`axis x-axis${dates ? ' x-axis-dual' : ''}`} style={showAxes ? undefined : {marginBottom: -20}}>\n {\n showAxes &&\n <path d={`M-1,0 H${elementWidth}`} className=\"axis-line\" />\n }\n\n {/* Render time ticks in first row */}\n {\n dates && timeTicks && timeTicks.map(({ pixelValue, label, size, position, skipGrid }, i) => {\n\n const singleTick = timeTicks.length === 1;\n \n if (isNaN(pixelValue)) {\n return null;\n }\n\n const classes = ['axis-item', `axis-item-${size}`, `axis-item-${position}`];\n if (bigLabels) {\n classes.push('axis-item-big-labels');\n }\n \n return (\n <g key={`time-${i}`} className={classes.join(' ')}>\n {\n showAxes &&\n <path d={`M${pixelValue},1 v12`} className=\"axis-tick\" />\n }\n\n {\n showGrid && !skipGrid &&\n <path d={`M${pixelValue},0 v-${elementHeight}`} />\n }\n\n {\n showAxes &&\n <text \n x={(position === 'last' && !singleTick) ? pixelValue - 3 : pixelValue + 3} \n y={12} \n textAnchor={(position === 'last' && !singleTick) ? 'end' : 'start'}\n className='x-axis-text x-axis-time-text'\n >\n {label}\n </text>\n }\n </g>\n );\n })\n }\n \n {/* Render date ticks in second row */}\n {\n dates && dateTicks && dateTicks.map(({ pixelValue, label, size, position, trueValue }, i) => {\n \n if (isNaN(pixelValue)) {\n return null;\n }\n\n const classes = ['axis-item', `axis-item-${size}`, `axis-item-${position}`];\n if (bigLabels) {\n classes.push('axis-item-big-labels');\n }\n\n let timezoneLabel = undefined;\n if (timeZone) {\n if (i === 0) {\n timezoneLabel = timeZone.toLowerCase() === 'utc' ? 'UTC' : timeZone;\n }\n }\n\n return (\n <g key={`date-${i}`} className={classes.join(' ')}>\n {\n showAxes &&\n <text \n x={position === 'last' ? pixelValue - 3 : pixelValue + 3} \n y={25} \n textAnchor={position === 'last' ? 'end' : 'start'}\n className='x-axis-text x-axis-date-text'\n >\n <tspan className='x-axis-date-label'>\n {label}\n </tspan>\n {timezoneLabel && (\n <tspan className='x-axis-timezone-label'>\n {' '}({timezoneLabel})\n </tspan>\n )}\n </text>\n }\n </g>\n );\n })\n }\n \n {/* Render regular ticks for non-date data */}\n {\n !dates && regularTicks && regularTicks.map(({ pixelValue, label, size, position, skipGrid }, i) => {\n if (isNaN(pixelValue)) {\n return null;\n }\n\n const classes = ['axis-item', `axis-item-${size}`, `axis-item-${position}`];\n if (bigLabels) {\n classes.push('axis-item-big-labels');\n }\n\n return (\n <g key={i} className={classes.join(' ')}>\n {\n showAxes &&\n <path d={`M${pixelValue},1 v12`} className=\"axis-tick\" />\n }\n\n {\n showGrid && !skipGrid &&\n <path d={`M${pixelValue},0 v-${elementHeight}`} />\n }\n\n {\n showAxes &&\n <text \n x={position === 'last' ? pixelValue - 3 : pixelValue + 3} \n y={xAxisHeight - 5} \n textAnchor={position === 'last' ? 'end' : 'start'}\n className='x-axis-text'\n >\n {label}\n </text>\n }\n </g>\n );\n })\n }\n </svg>\n );\n}\n\nXAxis.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n showAxes: PropTypes.bool.isRequired,\n showGrid: PropTypes.bool.isRequired,\n bigLabels: PropTypes.bool,\n xTickUnit: PropTypes.oneOf(['year']),\n clockStyle: PropTypes.oneOf(['12h', '24h']),\n timeZone: PropTypes.string,\n integersOnly: PropTypes.bool,\n formatXAxisLabel: PropTypes.func\n};\n","import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport {calculatePrecision, formatY} from '../helpers/format';\nimport {Y_AXIS_WIDTH, BIG_Y_AXIS_LABEL_OFFSET} from '../helpers/axis_sizes';\nimport scaleBounds from '../renderer/scale_bounds';\nimport getColor from '../helpers/colors';\nimport placeGrid from '../helpers/place_grid';\nimport {useAxes, useAxisBounds, useHighlightedSeries, usePrimarySize} from '../state/hooks';\nimport StateController from '../state/state_controller';\nimport CustomPropTypes from '../helpers/custom_prop_types';\n\nexport default React.memo(YAxis);\n\nfunction YAxis({ stateController, showAxes, showGrid, showSeriesKey, axis, sideIndex, bodyHeight, theme, grapherID, dragPositionYOffset=0, bigLabels, showAxisColors }) {\n if (!showAxes && !showGrid) {\n return null;\n }\n\n const { side, scale, axisIndex, label } = useAxes(stateController)[axis.axisIndex];\n\n const { elementWidth, elementHeight } = usePrimarySize(stateController);\n let { minY, maxY } = useAxisBounds(stateController)[axisIndex];\n\n const scaledBounds = scaleBounds({ minY, maxY, scale});\n minY = scaledBounds.minY;\n maxY = scaledBounds.maxY;\n\n const ticks = placeGrid({\n min: minY,\n max: maxY,\n totalSize: elementHeight,\n scale,\n precision: calculatePrecision(maxY - minY),\n formatter: formatY,\n inverted: true,\n expectedLabelSize: bigLabels ? 20 : 10,\n labelPadding: 30\n });\n\n const colorBoxSize = 10;\n const colorBoxPadding = 4;\n\n let sidePadding = 5;\n\n if (scale === 'log') {\n sidePadding = 2;\n }\n\n const highlightedSeries = useHighlightedSeries(stateController);\n\n const [draggedSeries, setDraggedSeries] = useState(null);\n const [dragDelta, setDragDelta] = useState({ dx: 0, dy: 0 });\n\n const startDrag = (event, singleSeries) => {\n let startX = event.clientX;\n let startY = event.clientY;\n\n if (side === 'left') {\n startX += Y_AXIS_WIDTH;\n }\n\n if (side === 'right') {\n startX -= Y_AXIS_WIDTH;\n }\n\n setDragDelta({\n dx: 0,\n dy: 0\n });\n\n const onMouseMove = (moveEvent) => {\n setDragDelta({\n dx: moveEvent.clientX - startX,\n dy: moveEvent.clientY - startY\n });\n };\n\n const onMouseUp = (mouseUpEvent) => {\n window.removeEventListener('mousemove', onMouseMove);\n window.removeEventListener('mouseup', onMouseUp);\n\n let target = mouseUpEvent.target;\n while (target && !(target.dataset || {}).axisIndex) {\n target = target.parentNode;\n }\n\n setDraggedSeries(null);\n stateController.finalizeDrag(singleSeries, target && (target.dataset || {}).axisIndex, target && (target.dataset || {}).grapherId);\n };\n\n window.addEventListener('mousemove', onMouseMove);\n window.addEventListener('mouseup', onMouseUp);\n\n setDraggedSeries(singleSeries);\n stateController.markDragStart();\n };\n\n const highlightedOpacity = theme === 'day' ? 1.0 : 0.5;\n const unhighlightedOpacity = theme === 'day' ? 0.8 : 0.3;\n\n return (\n <svg className={`axis y-axis y-axis-${side}`}\n data-axis-index={axisIndex}\n data-grapher-id={grapherID}\n style={{\n width: Y_AXIS_WIDTH,\n marginLeft: showAxes ? undefined : -Y_AXIS_WIDTH,\n height: typeof bodyHeight === 'number' ? bodyHeight : undefined\n }}\n >\n {\n showAxes &&\n showAxisColors &&\n axis.series.map((singleSeries, i) => {\n const height = elementHeight/axis.series.length;\n\n return (\n <rect\n x={side === 'left' ? 0 : 2}\n y={i*height}\n width={Y_AXIS_WIDTH - 2}\n height={height}\n key={singleSeries.index}\n fill={getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex)}\n opacity={singleSeries.index === highlightedSeries ? highlightedOpacity : unhighlightedOpacity}\n data-element-height={elementHeight}\n data-series-length={axis.series.length}\n />\n );\n })\n }\n\n {\n showAxes &&\n <path d={`M${side === 'left' ? Y_AXIS_WIDTH-1 : 1},3 V${elementHeight}`} className=\"axis-line\" />\n }\n\n {\n ticks.map(({ pixelValue, label, size, skipGrid }, i) => {\n const edge = side === 'left' ? (sideIndex + 1) * Y_AXIS_WIDTH : -sideIndex*Y_AXIS_WIDTH;\n const length = (side === 'left' ? 1 : - 1) * (elementWidth+1);\n\n const classes = ['axis-item', `axis-item-${size}`];\n if (bigLabels) {\n classes.push('axis-item-big-labels');\n }\n\n return (\n <g key={i} className={classes.join(' ')}>\n {\n showGrid &&\n !skipGrid &&\n <path d={`M${edge},${pixelValue} h${length}`} />\n }\n\n {\n showGrid &&\n !skipGrid &&\n sideIndex > 0 &&\n <path\n d={`M${side === 'left' ? Y_AXIS_WIDTH : 0},${pixelValue} h${(side === 'left' ? 1 : -1) * sideIndex * Y_AXIS_WIDTH}`}\n strokeDasharray={'2,2'}\n />\n }\n\n {\n showAxes &&\n <text x={side === 'left' ? Y_AXIS_WIDTH-sidePadding : sidePadding} y={pixelValue}>\n {label}\n </text>\n }\n </g>\n );\n })\n }\n\n {\n showSeriesKey && showAxes &&\n axis.series.map((singleSeries, i) => {\n\n let x = (Y_AXIS_WIDTH - colorBoxSize - colorBoxPadding) + (i % 2 - 1)*(colorBoxSize + colorBoxPadding);\n let y = -(colorBoxPadding + colorBoxSize) * Math.ceil(axis.series.length / 2) + (colorBoxSize + colorBoxPadding) * Math.floor(i / 2);\n\n if (singleSeries === draggedSeries) {\n x += dragDelta.dx;\n y += dragDelta.dy - dragPositionYOffset;\n }\n\n return (\n <rect\n className=\"series-color-box\"\n onMouseDown={(event) => startDrag(event, singleSeries)}\n x={x}\n y={y}\n width={colorBoxSize}\n height={colorBoxSize}\n key={singleSeries.index}\n fill={getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex)}\n onMouseOver={() => stateController.setHighlightedSeries(singleSeries.index)}\n onMouseOut={() => stateController.setHighlightedSeries(null)}\n />\n );\n })\n }\n\n {\n showAxes && !!label &&\n <text\n className={`y-axis-label${bigLabels ? ' y-axis-big-label' : ''}`}\n x={side === 'left' ? 10 : Y_AXIS_WIDTH - 10}\n y={elementHeight/2 + (side === 'left' ? -1 : 1)*(axisIndex + 1)*(bigLabels ? BIG_Y_AXIS_LABEL_OFFSET : 0)}\n transform={`rotate(${side === 'left' ? -90 : 90}, ${side === 'left' ? 10 : Y_AXIS_WIDTH - 10}, ${elementHeight/2})`}\n >\n {label}\n </text>\n }\n </svg>\n );\n}\n\nYAxis.propTypes = {\n stateController: PropTypes.instanceOf(StateController),\n showAxes: PropTypes.bool.isRequired,\n showGrid: PropTypes.bool.isRequired,\n showAxisColors: PropTypes.bool.isRequired,\n showSeriesKey: PropTypes.bool.isRequired,\n axis: CustomPropTypes.Axis.isRequired,\n sideIndex: PropTypes.number.isRequired,\n bodyHeight: PropTypes.number,\n theme: PropTypes.string,\n grapherID: PropTypes.string,\n dragPositionYOffset: PropTypes.number,\n bigLabels: PropTypes.bool\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { usePrimarySize, useSelection, useSeries } from '../state/hooks';\nimport StateController from '../state/state_controller';\n\nexport default React.memo(WindArrows);\n\nfunction DefaultWindArrow({ windX, windY }) {\n const arrowSize = 8;\n const angle = (-Math.atan2(windY, windX) + Math.PI / 2) * 180 / Math.PI;\n\n return (\n <g transform={`rotate(${angle})`}>\n <line\n x1={0}\n y1={-arrowSize / 2}\n x2={0}\n y2={arrowSize / 2}\n stroke=\"currentColor\"\n strokeWidth={1.5}\n />\n <path\n d={`M${-arrowSize / 3},${arrowSize / 4} L0,${arrowSize / 2} L${arrowSize / 3},${arrowSize / 4}`}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={1.5}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </g>\n );\n}\n\nfunction WindArrows({ stateController }) {\n const { elementWidth } = usePrimarySize(stateController);\n const { minX, maxX } = useSelection(stateController);\n const series = useSeries(stateController);\n\n const windSeries = series.filter(s => s.windDirections && s.windDirections.length > 0 && !s.hidden);\n\n if (windSeries.length === 0) {\n return null;\n }\n\n let minSpeed = Infinity;\n let maxSpeed = -Infinity;\n for (const singleSeries of windSeries) {\n const { windData } = singleSeries;\n if (!windData) continue;\n for (const wind of windData) {\n if (!wind) continue;\n const speed = Math.sqrt(wind.x * wind.x + wind.y * wind.y);\n if (speed < minSpeed) minSpeed = speed;\n if (speed > maxSpeed) maxSpeed = speed;\n }\n }\n const speedRange = maxSpeed - minSpeed || 1;\n\n const arrows = [];\n const arrowSpacing = 30;\n let lastArrowX = -arrowSpacing;\n\n for (const singleSeries of windSeries) {\n const { inDataSpace, windDirections, windData, windComp: CustomArrow } = singleSeries;\n if (!inDataSpace || !windDirections) continue;\n\n const Comp = CustomArrow || DefaultWindArrow;\n\n for (let i = 0; i < inDataSpace.length; i++) {\n const [x] = inDataSpace[i];\n const direction = windDirections[i];\n\n if (direction === null) continue;\n\n let xValue = x instanceof Date ? x.valueOf() : x;\n let minXValue = minX instanceof Date ? minX.valueOf() : minX;\n let maxXValue = maxX instanceof Date ? maxX.valueOf() : maxX;\n\n if (xValue < minXValue || xValue > maxXValue) continue;\n\n const pixelX = ((xValue - minXValue) / (maxXValue - minXValue)) * elementWidth;\n\n if (pixelX - lastArrowX < arrowSpacing) continue;\n lastArrowX = pixelX;\n\n const wind = windData ? windData[i] : null;\n const windX = wind ? wind.x : Math.cos(direction);\n const windY = wind ? wind.y : Math.sin(direction);\n const speed = Math.sqrt(windX * windX + windY * windY);\n const speedPercentile = (speed - minSpeed) / speedRange;\n\n arrows.push(\n <g key={`${singleSeries.name || i}-${i}`} transform={`translate(${pixelX}, 10)`}>\n <Comp windX={windX} windY={windY} speed={speed} speedPercentile={speedPercentile} />\n </g>\n );\n }\n }\n\n if (arrows.length === 0) {\n return null;\n }\n\n return (\n <svg className=\"wind-arrows\" style={{ height: 20, width: elementWidth, display: 'block' }}>\n {arrows}\n </svg>\n );\n}\n\nWindArrows.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired\n};\n\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nexport default React.memo(RangeSelectionButtonBase);\n\nfunction RangeSelectionButtonBase({ selected, disabled, className, onClick, children, description }) {\n const classes = [\n 'range-button'\n ];\n\n if (selected) {\n classes.push('range-button-selected');\n }\n\n if (disabled) {\n classes.push('range-button-disabled');\n }\n\n if (className) {\n classes.push(className);\n }\n\n if (description) {\n classes.push('option-tooltip');\n }\n\n return (\n <div\n className={classes.join(' ')}\n onClick={onClick && ((event) => disabled || onClick(event))}\n >\n {children}\n\n {\n description &&\n <div className=\"option-tooltip-text\">\n {description}\n </div>\n }\n </div>\n );\n}\n\nRangeSelectionButtonBase.propTypes = {\n selected: PropTypes.bool.isRequired,\n onClick: PropTypes.func,\n children: PropTypes.node.isRequired,\n disabled: PropTypes.bool,\n className: PropTypes.string,\n description: PropTypes.string\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport RangeSelectionButtonBase from './range_selection_button_base.jsx';\nimport StateController from '../state/state_controller';\n\nexport default React.memo(RangeSelectionButton);\n\nfunction RangeSelectionButton({ stateController, currentBoundCalculator, boundCalculator, children, disabled }) {\n return (\n <RangeSelectionButtonBase\n selected={currentBoundCalculator === boundCalculator}\n onClick={() => stateController.boundCalculator = boundCalculator}\n disabled={disabled}\n >\n {children}\n </RangeSelectionButtonBase>\n );\n}\n\nRangeSelectionButton.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n boundCalculator: PropTypes.func.isRequired,\n currentBoundCalculator: PropTypes.func.isRequired,\n children: PropTypes.node.isRequired,\n disabled: PropTypes.bool\n};\n","import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport RangeSelectionButtonBase from './range_selection_button_base.jsx';\nimport StateController from '../state/state_controller';\nimport {usePercentile, usePercentileAsymmetry} from '../state/hooks';\n\nexport default React.memo(PercentileButton);\n\nfunction PercentileButton({ stateController }) {\n const percentile = usePercentile(stateController);\n const percentileAsymmetry = usePercentileAsymmetry(stateController);\n const [showing, setShowing] = useState(false);\n\n return ([\n showing ? <RangeSelectionButtonBase\n key=\"asymmetry button\"\n className=\"percentile-button\"\n selected={true}\n description=\"Percentile asymmetry\"\n >\n <input\n onClick={(e) => e.stopPropagation()}\n value={percentileAsymmetry}\n onChange={(e) => stateController.percentileAsymmetry = e.target.value}\n onKeyUp={(e) => e.keyCode === 13 && setShowing(false)}\n type=\"number\"\n min={-50}\n max={50}\n />\n\n <div className=\"icon-container icon-container-square\">\n <svg focusable=\"false\" viewBox=\"0 0 512 512\">\n <path fill=\"currentColor\" d=\"M240 96h64a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16h-64a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16zm0 128h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16H240a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16zm256 192H240a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h256a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm-256-64h192a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16H240a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16zM16 160h48v304a16 16 0 0 0 16 16h32a16 16 0 0 0 16-16V160h48c14.21 0 21.39-17.24 11.31-27.31l-80-96a16 16 0 0 0-22.62 0l-80 96C-5.35 142.74 1.78 160 16 160z\" />\n </svg>\n </div>\n </RangeSelectionButtonBase>: null,\n\n <RangeSelectionButtonBase\n key=\"main-button\"\n className=\"percentile-button\"\n selected={showing || parseFloat(percentile) !== 100}\n onClick={() => setShowing(!showing)}\n description=\"Edit percentile\"\n >\n {\n showing &&\n <div>\n <input\n onClick={(e) => e.stopPropagation()}\n autoFocus={true}\n value={percentile}\n onChange={(e) => stateController.percentile = e.target.value}\n onKeyUp={(e) => e.keyCode === 13 && setShowing(false)}\n type=\"number\"\n min={0}\n max={100}\n />\n </div>\n }\n\n <div className=\"icon-container icon-container-narrow\">\n <svg focusable=\"false\" viewBox=\"0 0 448 512\">\n <path fill=\"currentColor\" d=\"M112 224c61.9 0 112-50.1 112-112S173.9 0 112 0 0 50.1 0 112s50.1 112 112 112zm0-160c26.5 0 48 21.5 48 48s-21.5 48-48 48-48-21.5-48-48 21.5-48 48-48zm224 224c-61.9 0-112 50.1-112 112s50.1 112 112 112 112-50.1 112-112-50.1-112-112-112zm0 160c-26.5 0-48-21.5-48-48s21.5-48 48-48 48 21.5 48 48-21.5 48-48 48zM392.3.2l31.6-.1c19.4-.1 30.9 21.8 19.7 37.8L77.4 501.6a23.95 23.95 0 0 1-19.6 10.2l-33.4.1c-19.5 0-30.9-21.9-19.7-37.8l368-463.7C377.2 4 384.5.2 392.3.2z\" />\n </svg>\n </div>\n </RangeSelectionButtonBase>\n ]);\n}\n\nPercentileButton.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired\n};\n","import React from 'react';\nimport PercentileButton from './percentile_button.jsx';\nimport RangeSelectionButtonBase from './range_selection_button_base.jsx';\nimport {\n useAutoscaleY,\n useMaxPrecision,\n useShowIndividualPoints, useShowingAnnotations,\n useShowingSidebar, useTheme\n} from '../state/hooks';\nimport PropTypes from 'prop-types';\nimport StateController from '../state/state_controller';\n\nexport default React.memo(Options);\n\nfunction Options({stateController, sidebarEnabled}) {\n\n const showIndividualPoints = useShowIndividualPoints(stateController);\n const autoscaleY = useAutoscaleY(stateController);\n const maxPrecision = useMaxPrecision(stateController);\n const showingSidebar = useShowingSidebar(stateController);\n const showingAnnotations = useShowingAnnotations(stateController);\n const theme = useTheme(stateController);\n\n return (\n <div className=\"options-bar\">\n {\n sidebarEnabled &&\n <RangeSelectionButtonBase\n selected={showingSidebar}\n onClick={() => stateController.toggleShowingSidebar()}\n description=\"Show sidebar\"\n >\n <div className=\"icon-container icon-container-square\">\n <svg focusable=\"false\" viewBox=\"0 0 512 512\">\n <path fill=\"currentColor\"\n d=\"M464 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V80c0-26.51-21.49-48-48-48zM224 416H64V160h160v256zm224 0H288V160h160v256z\"/>\n </svg>\n </div>\n </RangeSelectionButtonBase>\n }\n\n <RangeSelectionButtonBase\n selected={theme === 'export'}\n onClick={() => stateController.toggleExportMode()}\n description=\"Export mode\"\n >\n <div className=\"icon-container icon-container-square\">\n <svg focusable=\"false\" viewBox=\"0 0 512 512\">\n <path fill=\"currentColor\"\n d=\"M167.02 309.34c-40.12 2.58-76.53 17.86-97.19 72.3-2.35 6.21-8 9.98-14.59 9.98-11.11 0-45.46-27.67-55.25-34.35C0 439.62 37.93 512 128 512c75.86 0 128-43.77 128-120.19 0-3.11-.65-6.08-.97-9.13l-88.01-73.34zM457.89 0c-15.16 0-29.37 6.71-40.21 16.45C213.27 199.05 192 203.34 192 257.09c0 13.7 3.25 26.76 8.73 38.7l63.82 53.18c7.21 1.8 14.64 3.03 22.39 3.03 62.11 0 98.11-45.47 211.16-256.46 7.38-14.35 13.9-29.85 13.9-45.99C512 20.64 486 0 457.89 0z\" />\n </svg>\n </div>\n </RangeSelectionButtonBase>\n\n <RangeSelectionButtonBase\n selected={showingAnnotations}\n onClick={() => stateController.toggleShowingAnnotations()}\n description=\"Show annotations\"\n >\n <div className=\"icon-container icon-container-448\">\n <svg focusable=\"false\" viewBox=\"0 0 448 512\">\n <path fill=\"currentColor\" d=\"M432 416h-23.41L277.88 53.69A32 32 0 0 0 247.58 32h-47.16a32 32 0 0 0-30.3 21.69L39.41 416H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16h-19.58l23.3-64h152.56l23.3 64H304a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM176.85 272L224 142.51 271.15 272z\" />\n </svg>\n </div>\n </RangeSelectionButtonBase>\n\n <PercentileButton stateController={stateController} />\n\n <RangeSelectionButtonBase\n selected={maxPrecision}\n onClick={() => stateController.toggleMaxPrecision()}\n description=\"Max precision\"\n >\n <div className=\"icon-container icon-container-square\">\n <svg focusable=\"false\" viewBox=\"0 0 512 512\">\n <path fill=\"currentColor\" d=\"M478.21 334.093L336 256l142.21-78.093c11.795-6.477 15.961-21.384 9.232-33.037l-19.48-33.741c-6.728-11.653-21.72-15.499-33.227-8.523L296 186.718l3.475-162.204C299.763 11.061 288.937 0 275.48 0h-38.96c-13.456 0-24.283 11.061-23.994 24.514L216 186.718 77.265 102.607c-11.506-6.976-26.499-3.13-33.227 8.523l-19.48 33.741c-6.728 11.653-2.562 26.56 9.233 33.037L176 256 33.79 334.093c-11.795 6.477-15.961 21.384-9.232 33.037l19.48 33.741c6.728 11.653 21.721 15.499 33.227 8.523L216 325.282l-3.475 162.204C212.237 500.939 223.064 512 236.52 512h38.961c13.456 0 24.283-11.061 23.995-24.514L296 325.282l138.735 84.111c11.506 6.976 26.499 3.13 33.227-8.523l19.48-33.741c6.728-11.653 2.563-26.559-9.232-33.036z\" />\n </svg>\n </div>\n </RangeSelectionButtonBase>\n\n <RangeSelectionButtonBase\n selected={autoscaleY}\n onClick={() => stateController.toggleYAutoscaling()}\n description=\"Autoscale y axis\"\n >\n <div className=\"icon-container\">\n <svg focusable=\"false\" viewBox=\"0 0 256 512\">\n <path fill=\"currentColor\" d=\"M168 416c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88v-64h-88c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88v-64h-88c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88v-64h-88c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88V32c0-17.67-14.33-32-32-32H32C14.33 0 0 14.33 0 32v448c0 17.67 14.33 32 32 32h192c17.67 0 32-14.33 32-32v-64h-88z\"/>\n </svg>\n </div>\n </RangeSelectionButtonBase>\n\n <RangeSelectionButtonBase\n selected={showIndividualPoints}\n onClick={() => stateController.toggleIndividualPoints()}\n description=\"Show individual points\"\n >\n <div className=\"icon-container icon-container-narrow\">\n <svg focusable=\"false\" viewBox=\"0 0 192 512\">\n <path fill=\"currentColor\" d=\"M96 184c39.8 0 72 32.2 72 72s-32.2 72-72 72-72-32.2-72-72 32.2-72 72-72zM24 80c0 39.8 32.2 72 72 72s72-32.2 72-72S135.8 8 96 8 24 40.2 24 80zm0 352c0 39.8 32.2 72 72 72s72-32.2 72-72-32.2-72-72-72-72 32.2-72 72z\" />\n </svg>\n </div>\n </RangeSelectionButtonBase>\n </div>\n );\n}\n\nOptions.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n sidebarEnabled: PropTypes.bool\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport RangeSelectionButton from './range_selection_button.jsx';\nimport RangeSelectionButtonBase from './range_selection_button_base.jsx';\nimport {Y_AXIS_WIDTH} from '../helpers/axis_sizes';\nimport CustomPropTypes from '../helpers/custom_prop_types';\nimport StateController from '../state/state_controller';\nimport {\n useBoundCalculator, useBoundHistory,\n useGlobalBounds,\n useLeftAxisCount,\n useRightAxisCount,\n useShowingOptions\n} from '../state/hooks';\nimport BOUND_CALCULATORS from '../state/bound_calculators';\nimport Options from './options.jsx';\n\nexport default React.memo(RangeSelection);\n\nfunction RangeSelection({stateController, customBoundsSelectors, customBoundsSelectorsOnly, sidebarEnabled}) {\n const rightAxisCount = useRightAxisCount(stateController);\n const leftAxisCount = useLeftAxisCount(stateController);\n const showingOptions = useShowingOptions(stateController);\n\n let marginRight = Y_AXIS_WIDTH*rightAxisCount;\n if (rightAxisCount > 0) {\n marginRight += 5;\n }\n\n let marginLeft = Y_AXIS_WIDTH*leftAxisCount;\n if (leftAxisCount > 0) {\n marginLeft += 5;\n }\n\n const { dates } = useGlobalBounds(stateController);\n\n const currentBoundCalculator = useBoundCalculator(stateController);\n const { hasPreviousBounds, hasNextBounds } = useBoundHistory(stateController);\n\n const customBoundSelectorNames = new Set(customBoundsSelectors.map(({ label }) => label));\n\n return (\n <div className={`range-selection${dates ? '' : ' range-not-dates'}`} style={{ marginRight, marginLeft }}>\n <div className=\"range-buttons\">\n {\n showingOptions &&\n <Options\n stateController={stateController}\n sidebarEnabled={sidebarEnabled}\n />\n }\n\n <RangeSelectionButtonBase\n className=\"showing-options-button\"\n selected={showingOptions}\n onClick={() => stateController.toggleShowingOptions()}\n description=\"Show additional options\"\n >\n <div className=\"icon-container icon-container-square\">\n <svg focusable=\"false\" viewBox=\"0 0 512 512\">\n <path fill=\"currentColor\" d=\"M487.4 315.7l-42.6-24.6c4.3-23.2 4.3-47 0-70.2l42.6-24.6c4.9-2.8 7.1-8.6 5.5-14-11.1-35.6-30-67.8-54.7-94.6-3.8-4.1-10-5.1-14.8-2.3L380.8 110c-17.9-15.4-38.5-27.3-60.8-35.1V25.8c0-5.6-3.9-10.5-9.4-11.7-36.7-8.2-74.3-7.8-109.2 0-5.5 1.2-9.4 6.1-9.4 11.7V75c-22.2 7.9-42.8 19.8-60.8 35.1L88.7 85.5c-4.9-2.8-11-1.9-14.8 2.3-24.7 26.7-43.6 58.9-54.7 94.6-1.7 5.4.6 11.2 5.5 14L67.3 221c-4.3 23.2-4.3 47 0 70.2l-42.6 24.6c-4.9 2.8-7.1 8.6-5.5 14 11.1 35.6 30 67.8 54.7 94.6 3.8 4.1 10 5.1 14.8 2.3l42.6-24.6c17.9 15.4 38.5 27.3 60.8 35.1v49.2c0 5.6 3.9 10.5 9.4 11.7 36.7 8.2 74.3 7.8 109.2 0 5.5-1.2 9.4-6.1 9.4-11.7v-49.2c22.2-7.9 42.8-19.8 60.8-35.1l42.6 24.6c4.9 2.8 11 1.9 14.8-2.3 24.7-26.7 43.6-58.9 54.7-94.6 1.5-5.5-.7-11.3-5.6-14.1zM256 336c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80z\" />\n </svg>\n </div>\n </RangeSelectionButtonBase>\n \n <RangeSelectionButtonBase\n className=\"range-selection-history\"\n selected={false}\n onClick={() => stateController.previousBounds()}\n disabled={!hasPreviousBounds}\n >\n <div className=\"icon-container\">\n <svg focusable=\"false\" viewBox=\"0 0 256 512\">\n <path fill=\"currentColor\" d=\"M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z\" />\n </svg>\n </div>\n </RangeSelectionButtonBase>\n \n <RangeSelectionButtonBase\n className=\"range-selection-history\"\n selected={false}\n onClick={() => stateController.nextBounds()}\n disabled={!hasNextBounds}\n >\n <div className=\"icon-container\">\n <svg focusable=\"false\" viewBox=\"0 0 256 512\">\n <path fill=\"currentColor\" d=\"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z\"/>\n </svg>\n </div>\n </RangeSelectionButtonBase>\n\n {\n customBoundsSelectors.map(({label, calculator, datesOnly}, i) => {\n return (\n <RangeSelectionButton\n key={i}\n stateController={stateController}\n currentBoundCalculator={currentBoundCalculator}\n boundCalculator={calculator}\n disabled={datesOnly && !dates}\n >\n {label}\n </RangeSelectionButton>\n );\n })\n }\n\n {\n !customBoundSelectorNames.has('1m') && !customBoundsSelectorsOnly &&\n <RangeSelectionButton\n stateController={stateController}\n currentBoundCalculator={currentBoundCalculator}\n boundCalculator={BOUND_CALCULATORS.lastMinute}\n disabled={!dates}\n >\n 1m\n </RangeSelectionButton>\n }\n\n {\n !customBoundSelectorNames.has('10m') && !customBoundsSelectorsOnly &&\n <RangeSelectionButton\n stateController={stateController}\n currentBoundCalculator={currentBoundCalculator}\n boundCalculator={BOUND_CALCULATORS.last10Minutes}\n disabled={!dates}\n >\n 10m\n </RangeSelectionButton>\n }\n\n {\n !customBoundSelectorNames.has('1h') && !customBoundsSelectorsOnly &&\n <RangeSelectionButton\n stateController={stateController}\n currentBoundCalculator={currentBoundCalculator}\n boundCalculator={BOUND_CALCULATORS.lastHour}\n disabled={!dates}\n >\n 1h\n </RangeSelectionButton>\n }\n\n {\n !customBoundSelectorNames.has('1d') && !customBoundsSelectorsOnly &&\n <RangeSelectionButton\n stateController={stateController}\n currentBoundCalculator={currentBoundCalculator}\n boundCalculator={BOUND_CALCULATORS.lastDay}\n disabled={!dates}\n >\n 1d\n </RangeSelectionButton>\n }\n\n <RangeSelectionButton\n stateController={stateController}\n currentBoundCalculator={currentBoundCalculator}\n boundCalculator={BOUND_CALCULATORS.all}\n disabled={false}\n >\n All\n </RangeSelectionButton>\n </div>\n </div>\n );\n\n}\n\nRangeSelection.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n customBoundsSelectors: CustomPropTypes.CustomBoundsSelectors.isRequired,\n customBoundsSelectorsOnly: PropTypes.bool,\n sidebarEnabled: PropTypes.bool\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport GraphBodyRenderer from '../renderer/graph_body_renderer';\nimport StateController from '../state/state_controller';\nimport placeGrid from '../helpers/place_grid';\nimport {formatX} from '../helpers/format';\nimport VerticalLines from './vertical_lines.jsx';\nimport CustomPropTypes from '../helpers/custom_prop_types';\n\nexport default class RangeGraph extends React.PureComponent {\n\n constructor(props) {\n super(props);\n\n this.state = {\n elementWidth: 0,\n elementHeight: 0,\n selectionBounds: {\n minX: 0,\n maxX: 0\n },\n globalBounds: {\n minX: 0,\n maxX: 0\n }\n };\n\n this.onMouseMove = this.onMouseMove.bind(this);\n this.stopDragging = this.stopDragging.bind(this);\n this.startScroll = this.startScroll.bind(this);\n this.startLeftDrag = this.startLeftDrag.bind(this);\n this.startRightDrag = this.startRightDrag.bind(this);\n }\n\n getClientX(event) {\n if (event && event.touches && event.touches[0]) {\n return event.touches[0].clientX;\n }\n if (event && event.changedTouches && event.changedTouches[0]) {\n return event.changedTouches[0].clientX;\n }\n return event.clientX;\n }\n\n componentDidMount() {\n this._renderer = new GraphBodyRenderer({\n stateController: this.props.stateController,\n canvasElement: this.el,\n webgl: this.props.webgl,\n checkIntersection: this.props.checkIntersection\n });\n this.props.stateController.rangeGraphRenderer = this._renderer;\n\n this._renderer.on('size_changed', (sizing) => {\n this.setState(sizing);\n });\n\n this.setState({\n selectionBounds: this.props.stateController._selection,\n globalBounds: this.props.stateController._globalBounds\n });\n\n this.props.stateController.on('selection_changed', (selectionBounds) =>{\n this.setState({ selectionBounds });\n });\n\n this.props.stateController.on('global_bounds_changed', (globalBounds) =>{\n this.setState({ globalBounds: globalBounds });\n });\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.draggingY !== this.props.draggingY && this._renderer) {\n this._renderer.resize();\n }\n }\n\n componentWillUnmount() {\n if (this._renderer) {\n this._renderer.dispose();\n this._renderer = null;\n }\n }\n\n onMouseMove(event) {\n if (!this._dragType) {\n return;\n }\n\n // Prevent scrolling during touch-drag\n if (event && event.touches && event.preventDefault) {\n event.preventDefault();\n }\n\n let boundCalculator;\n const leftX = this.el.getBoundingClientRect().left;\n\n this.setState(({selectionBounds, globalBounds, elementWidth}) => {\n const pixelX = this.getClientX(event) - leftX;\n let percentage = pixelX/elementWidth;\n\n percentage = Math.max(percentage, 0);\n percentage = Math.min(percentage, 1);\n\n let trueX = percentage * (globalBounds.maxX - globalBounds.minX) + globalBounds.minX;\n\n if (this._dragType === 'scroll') {\n const range = selectionBounds.maxX - selectionBounds.minX;\n let minX = trueX - range*this._scrollAnchorPercentage;\n let maxX = trueX + range*(1-this._scrollAnchorPercentage);\n\n if (minX < globalBounds.minX) {\n minX = globalBounds.minX;\n maxX = minX + range;\n }\n\n if (maxX > globalBounds.maxX) {\n maxX = globalBounds.maxX;\n minX = maxX - range;\n }\n\n boundCalculator = () => {\n return {minX, maxX};\n };\n\n return {\n selectionBounds: Object.assign({}, selectionBounds, {\n minX, maxX\n })\n };\n } else if (this._dragType === 'left') {\n if (trueX > selectionBounds.maxX) {\n trueX = selectionBounds.maxX;\n }\n\n const boundToRight = globalBounds.maxX === selectionBounds.maxX;\n\n boundCalculator = () => {\n if (boundToRight) {\n return {\n minX: trueX\n };\n } else {\n return {\n minX: trueX,\n maxX: selectionBounds.maxX\n };\n }\n };\n\n return {\n selectionBounds: Object.assign({}, selectionBounds, {\n minX: trueX\n })\n };\n } else if (this._dragType === 'right') {\n if (trueX < selectionBounds.minX) {\n trueX = selectionBounds.minX;\n }\n\n const boundToLeft = globalBounds.minX === selectionBounds.minX;\n\n boundCalculator = () => {\n if (boundToLeft) {\n return {\n maxX: trueX\n };\n } else {\n return {\n minX: selectionBounds.minX,\n maxX: trueX\n };\n }\n };\n\n return {\n selectionBounds: Object.assign({}, selectionBounds, {\n maxX: trueX\n })\n };\n }\n }, () => {\n if (!boundCalculator) {\n return;\n }\n\n boundCalculator.debounceHistory = true;\n this.props.stateController.boundCalculator = boundCalculator;\n });\n }\n\n addListeners() {\n window.addEventListener('mousemove', this.onMouseMove);\n window.addEventListener('mouseup', this.stopDragging);\n window.addEventListener('touchmove', this.onMouseMove, { passive: false });\n window.addEventListener('touchend', this.stopDragging);\n window.addEventListener('touchcancel', this.stopDragging);\n }\n\n stopDragging() {\n this._dragType = null;\n this.forceUpdate();\n window.removeEventListener('mousemove', this.onMouseMove);\n window.removeEventListener('mouseup', this.stopDragging);\n window.removeEventListener('touchmove', this.onMouseMove);\n window.removeEventListener('touchend', this.stopDragging);\n window.removeEventListener('touchcancel', this.stopDragging);\n }\n\n startScroll(event) {\n this._dragType = 'scroll';\n\n const {selectionBounds, globalBounds, elementWidth} = this.state;\n const leftX = this.el.getBoundingClientRect().left;\n\n const pixelStartX = this.getClientX(event) - leftX;\n const pixelMinX = (selectionBounds.minX - globalBounds.minX)/(globalBounds.maxX - globalBounds.minX) * elementWidth || 0;\n const pixelMaxX = (selectionBounds.maxX - globalBounds.minX)/(globalBounds.maxX - globalBounds.minX) * elementWidth || 0;\n\n this._scrollAnchorPercentage = (pixelStartX-pixelMinX)/(pixelMaxX - pixelMinX);\n this.addListeners();\n }\n\n startLeftDrag(event) {\n this._dragType = 'left';\n this.addListeners();\n }\n\n startRightDrag(event) {\n this._dragType = 'right';\n this.addListeners();\n }\n\n render() {\n const { globalBounds, selectionBounds, elementWidth, elementHeight } = this.state;\n\n let pixelMinX = Math.min(Math.max((selectionBounds.minX - globalBounds.minX)/(globalBounds.maxX - globalBounds.minX), 0), 1) * elementWidth || 0;\n let pixelMaxX = Math.min(Math.max((selectionBounds.maxX - globalBounds.minX)/(globalBounds.maxX - globalBounds.minX), 0), 1) * elementWidth || 0;\n\n if (isNaN(pixelMinX) || !isFinite(pixelMinX) || selectionBounds.maxX < selectionBounds.minX) {\n pixelMinX = 0;\n }\n\n if (isNaN(pixelMaxX) || !isFinite(pixelMaxX) || selectionBounds.maxX < selectionBounds.minX) {\n pixelMaxX = 0;\n }\n\n const barSize = 14;\n const totalHeight = elementHeight + barSize; \n let ticks;\n\n if (selectionBounds.dates && this.props.markDates) {\n ticks = placeGrid({\n min: globalBounds.minX,\n max: globalBounds.maxX,\n totalSize: elementWidth,\n precision: 'day',\n dates: selectionBounds.dates,\n formatter: formatX,\n expectedLabelSize: 30,\n labelPadding: 5,\n formatOptions: {\n justMonthAndDay: true,\n unitOverride: 'day',\n timeZone: this.props.timeZone\n },\n skipFirst: true,\n skipLast: true\n });\n }\n\n return (\n <div className=\"range-selection-graph\">\n <div className=\"graph-body graph-body-secondary\" style={{ touchAction: 'none' }}>\n <canvas ref={(el) => this.el = el} />\n\n <svg style={{ height: totalHeight }}>\n <g>\n <rect\n x={0}\n y={elementHeight}\n width={elementWidth}\n height={barSize}\n className=\"selection-bar-track\"\n />\n\n {\n ticks && ticks.map(({ pixelValue, label, size, position }, i) => {\n if (isNaN(pixelValue)) {\n return null;\n }\n\n const classes = ['axis-item', `axis-item-${size}`, `axis-item-${position}`];\n \n const isHighlighted = pixelValue >= pixelMinX && pixelValue <= pixelMaxX;\n if (isHighlighted) {\n classes.push('axis-item-highlighted');\n }\n\n return (\n <g key={i} className={classes.join(' ')}>\n <path d={`M${pixelValue},0 v${elementHeight}`} />\n\n <text x={pixelValue + 3} y={elementHeight}>\n {label}\n </text>\n </g>\n );\n })\n }\n\n <rect\n x={pixelMinX}\n y={elementHeight}\n width={pixelMaxX - pixelMinX}\n height={barSize}\n className=\"selection-bar\"\n onMouseDown={this.startScroll}\n onTouchStart={this.startScroll}\n />\n\n <path\n d=\"M -3 3.5 L -3 9.333333333333334 M 0 3.5 L 0 9.333333333333334 M 3 3.5 L 3 9.333333333333334\"\n className=\"selection-bar-rifles\"\n transform={`translate(${pixelMinX + (pixelMaxX - pixelMinX)/2},${elementHeight})`}\n onMouseDown={this.startScroll}\n onTouchStart={this.startScroll}\n />\n </g>\n\n <g>\n <rect\n x={pixelMinX}\n y={0}\n width={pixelMaxX - pixelMinX}\n height={totalHeight}\n className=\"target-selection-outline\"\n onMouseDown={this.startScroll}\n onTouchStart={this.startScroll}\n />\n </g>\n\n {/* Left handle */}\n <g className={`selection-handle${(this._dragType === 'left' || this._dragType === 'scroll') ? ' selection-handle-dragging' : ''}`}>\n <rect\n x={pixelMinX - 15}\n y={(elementHeight - 30)/2}\n width={30}\n height={30}\n fill=\"transparent\"\n className=\"selection-bar-handle-hit\"\n onMouseDown={this.startLeftDrag}\n onTouchStart={this.startLeftDrag}\n />\n <path\n d=\"M -4.5 0.5 L 3.5 0.5 L 3.5 15.5 L -4.5 15.5 L -4.5 0.5 M -1.5 4 L -1.5 12 M 0.5 4 L 0.5 12\"\n className=\"selection-bar-handle\"\n transform={`translate(${pixelMinX},${(elementHeight - 15)/2})`}\n onMouseDown={this.startLeftDrag}\n onTouchStart={this.startLeftDrag}\n />\n </g>\n\n {/* Right handle */}\n <g className={`selection-handle${(this._dragType === 'right' || this._dragType === 'scroll') ? ' selection-handle-dragging' : ''}`}>\n <rect\n x={pixelMaxX - 15}\n y={(elementHeight - 30)/2}\n width={30}\n height={30}\n fill=\"transparent\"\n className=\"selection-bar-handle-hit\"\n onMouseDown={this.startRightDrag}\n onTouchStart={this.startRightDrag}\n />\n <path\n d=\"M -4.5 0.5 L 3.5 0.5 L 3.5 15.5 L -4.5 15.5 L -4.5 0.5 M -1.5 4 L -1.5 12 M 0.5 4 L 0.5 12\"\n className=\"selection-bar-handle\"\n transform={`translate(${pixelMaxX},${(elementHeight - 15)/2})`}\n onMouseDown={this.startRightDrag}\n onTouchStart={this.startRightDrag}\n />\n </g>\n\n </svg>\n\n {\n this.props.verticalLines &&\n <VerticalLines\n stateController={this.props.stateController}\n verticalLines={this.props.verticalLines}\n isRangeGraph={true}\n bounds={globalBounds}\n elementHeight={elementHeight}\n elementWidth={elementWidth}\n />\n }\n </div>\n </div>\n );\n }\n\n}\n\nRangeGraph.defaultProps = {\n width: 3,\n shadowColor: 'transparent'\n};\n\nRangeGraph.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n webgl: PropTypes.bool,\n draggingY: PropTypes.bool,\n checkIntersection: PropTypes.bool,\n markDates: PropTypes.bool,\n timeZone: PropTypes.string,\n verticalLines: CustomPropTypes.VerticalLines\n};","import React from 'react';\nimport getColor from '../helpers/colors';\nimport CustomPropTypes from '../helpers/custom_prop_types';\nimport PropTypes from 'prop-types';\nimport StateController from '../state/state_controller';\nimport nameForSeries from '../helpers/name_for_series';\n\nexport default React.memo(SeriesKeyItem);\n\nfunction SeriesKeyItem({ series, i, style, onMouseDown, theme, stateController, highlighted }) {\n const color = getColor(series.color, i, series.multigrapherSeriesIndex);\n\n if (theme === 'day') {\n style = Object.assign({}, style, {\n backgroundColor: color\n });\n } else {\n style = Object.assign({}, style, {\n color\n });\n }\n\n const classes = ['series-key-item'];\n if (highlighted) {\n classes.push('series-key-item-highlighted');\n }\n\n const name = nameForSeries(series, i);\n\n return (\n <div\n className={classes.join(' ')}\n style={style}\n onMouseDown={onMouseDown}\n onMouseOver={() => stateController.setHighlightedSeries(i)}\n onMouseOut={() => stateController.setHighlightedSeries(null)}\n onClick={() => stateController.registerSeriesClick(i)}\n >\n {name}\n </div>\n );\n}\n\nSeriesKeyItem.propTypes = {\n series: CustomPropTypes.SingleSeries.isRequired,\n stateController: PropTypes.instanceOf(StateController),\n i: PropTypes.number.isRequired,\n style: PropTypes.object,\n onMouseDown: PropTypes.func,\n theme: PropTypes.string.isRequired,\n highlighted: PropTypes.bool\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport StateController from '../state/state_controller';\n\nexport default class SeriesKeyAxisContainer extends React.PureComponent {\n\n constructor(props) {\n super(props);\n\n this.state = {\n showingLabelInput: false\n };\n\n this.toggleLabelInputShowing = this.toggleLabelInputShowing.bind(this);\n }\n\n toggleLabelInputShowing() {\n this.setState(({ showingLabelInput }) => {\n return {\n showingLabelInput: !showingLabelInput\n };\n });\n }\n\n render() {\n const {children, stateController, axisIndex, scale, label, grapherID} = this.props;\n\n const { showingLabelInput } = this.state;\n\n return (\n <div\n className={`series-key-axis-container${showingLabelInput ? ' series-key-axis-container-showing-label' : ''}`}\n data-axis-index={axisIndex}\n data-grapher-id={grapherID}\n >\n <div className=\"scale-label\" onClick={() => stateController.toggleScale({axisIndex})}>\n {scale.slice(0, showingLabelInput ? 6 : 3)}\n </div>\n\n <div className=\"series-key-axis-container-body\">\n <div>\n {children}\n\n <svg className=\"label-input-toggler\" viewBox=\"0 0 512 512\" onClick={this.toggleLabelInputShowing}>\n <path\n d=\"M0 252.118V48C0 21.49 21.49 0 48 0h204.118a48 48 0 0 1 33.941 14.059l211.882 211.882c18.745 18.745 18.745 49.137 0 67.882L293.823 497.941c-18.745 18.745-49.137 18.745-67.882 0L14.059 286.059A48 48 0 0 1 0 252.118zM112 64c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48z\"/>\n </svg>\n </div>\n\n <div className=\"series-key-axis-label-container\">\n <input\n onChange={(event) => stateController.setLabel({axisIndex, label: event.target.value})}\n placeholder=\"Enter label\"\n value={label || ''}\n />\n </div>\n </div>\n </div>\n );\n }\n}\n\nSeriesKeyAxisContainer.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n children: PropTypes.node.isRequired,\n axisIndex: PropTypes.number.isRequired,\n scale: PropTypes.string.isRequired,\n label: PropTypes.string,\n grapherID: PropTypes.string\n};\n","import React, { useState, useEffect, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport {Y_AXIS_WIDTH} from '../helpers/axis_sizes';\nimport StateController from '../state/state_controller';\nimport {\n useAlwaysTooltipped,\n useAxes,\n useHighlightedSeries,\n useLeftAxisCount,\n usePrimarySize,\n useRightAxisCount,\n useSeries, useShowingOptions\n} from '../state/hooks';\nimport SeriesKeyItem from './series_key_item.jsx';\nimport SeriesKeyAxisContainer from './series_key_axis_container.jsx';\n\nfunction calculateStyles({stateController, keyWidth}) {\n const rightAxisCount = useRightAxisCount(stateController);\n const leftAxisCount = useLeftAxisCount(stateController);\n const showingOptions = useShowingOptions(stateController);\n\n let marginRight = Y_AXIS_WIDTH*rightAxisCount;\n if (rightAxisCount > 0) {\n marginRight += 5;\n }\n\n marginRight += 250;\n\n if (showingOptions) {\n marginRight += 70;\n }\n\n let marginLeft = Y_AXIS_WIDTH*leftAxisCount;\n\n if (leftAxisCount > 0) {\n marginLeft += 5;\n }\n\n marginLeft = Math.max(marginRight, marginLeft);\n marginRight = Math.max(marginRight, marginLeft);\n\n let marginBottom;\n\n const { elementWidth } = usePrimarySize(stateController);\n\n const shouldBreak = elementWidth - marginLeft - marginRight < keyWidth;\n\n if (shouldBreak) {\n marginLeft = 0;\n marginRight = 0;\n marginBottom = 10;\n }\n\n return { marginRight, marginLeft, marginBottom };\n}\n\nexport default React.memo(SeriesKey);\n\nfunction SeriesKey({ stateController, theme, draggingY, grapherID, dragPositionYOffset=0 }) {\n const series = useSeries(stateController);\n const [draggedSeries, setDraggedSeries] = useState(null);\n const [dragPosition, setDragPosition] = useState({\n x: 0,\n y: 0\n });\n\n const highlightedSeries = useHighlightedSeries(stateController);\n\n const keyRef = useRef(null);\n const [keyWidth, setKeyWidth] = useState(series.map(({ name, yKey }, i) => (name || yKey || i).toString().length).reduce((a, b) => a + b, 0) * 5);\n\n let sizeCalculationHandle;\n useEffect(() => {\n if (keyRef.current) {\n cancelAnimationFrame(sizeCalculationHandle);\n\n sizeCalculationHandle = requestAnimationFrame(() => {\n if (!keyRef.current) { // has become invalid in the last frame\n return;\n }\n\n const width = [...keyRef.current.querySelectorAll('.series-key-axis-container')]\n .map((el) => el.clientWidth)\n .reduce((a, b) => a + b, 0);\n setKeyWidth(width);\n });\n }\n }, [series, keyRef.current]);\n\n const style = calculateStyles({ stateController, keyWidth });\n\n const axes = useAxes(stateController);\n const alwaysTooltipped = useAlwaysTooltipped(stateController);\n\n const startDragging = (event, singleSeries) => {\n let seriesKeyEl = event.target;\n while (seriesKeyEl && seriesKeyEl.className !== 'series-key') {\n seriesKeyEl = seriesKeyEl.parentNode;\n }\n const targetLeft = event.target.getBoundingClientRect().left;\n let seriesKeyLeft = seriesKeyEl.getBoundingClientRect().left;\n let seriesKeyMarginLeft = seriesKeyEl.style.marginLeft;\n\n const startX = event.clientX;\n const startY = event.clientY;\n const clientStartX = event.clientX;\n const clientStartY = event.clientY;\n\n setDraggedSeries(singleSeries);\n setDragPosition({\n x: event.clientX - startX + (targetLeft - seriesKeyLeft) - 2,\n y: event.clientY - startY + 1\n });\n\n const onMouseMove = (moveEvent) => {\n if (seriesKeyEl.style.marginLeft !== seriesKeyMarginLeft) {\n seriesKeyLeft = seriesKeyEl.getBoundingClientRect().left;\n seriesKeyMarginLeft = seriesKeyEl.style.marginLeft;\n }\n\n setDragPosition({\n x: moveEvent.clientX - startX + (targetLeft - seriesKeyLeft) - 2,\n y: moveEvent.clientY - startY + 1\n });\n };\n\n const onMouseUp = (mouseUpEvent) => {\n window.removeEventListener('mousemove', onMouseMove);\n window.removeEventListener('mouseup', onMouseUp);\n\n let target = mouseUpEvent.target;\n while (target && !(target.dataset || {}).axisIndex && !(target.dataset || {}).grapherId) {\n target = target.parentNode;\n }\n\n setDraggedSeries(null);\n stateController.finalizeDrag(singleSeries, target && (target.dataset || {}).axisIndex, target && (target.dataset || {}).grapherId);\n\n if (mouseUpEvent.clientX === clientStartX && mouseUpEvent.clientY === clientStartY) {\n stateController.toggleAlwaysTooltipped(singleSeries, mouseUpEvent.shiftKey);\n }\n };\n\n window.addEventListener('mousemove', onMouseMove);\n window.addEventListener('mouseup', onMouseUp);\n\n stateController.markDragStart();\n };\n\n return (\n <div className=\"series-key\" style={style} ref={keyRef}>\n {\n draggingY &&\n <div\n className=\"series-key-axis-container\"\n data-axis-index=\"new-left\"\n data-grapher-id={grapherID}\n />\n }\n\n {\n axes.map((axis, i) => {\n if (!axis.series.length && axes.length > 1) {\n return null;\n }\n\n return (\n <SeriesKeyAxisContainer\n key={i}\n label={axis.label}\n axisIndex={axis.axisIndex}\n scale={axis.scale}\n stateController={stateController}\n grapherID={grapherID}\n >\n {\n axis.series.map((singleSeries) => {\n if (singleSeries.hideFromKey) {\n return null;\n }\n\n return (\n <SeriesKeyItem\n key={singleSeries.index}\n series={singleSeries}\n i={singleSeries.index}\n onMouseDown={(event, toggleTooltipped) => startDragging(event, singleSeries, toggleTooltipped)}\n theme={theme}\n stateController={stateController}\n highlighted={highlightedSeries === singleSeries.index || alwaysTooltipped.has(singleSeries)}\n />\n );\n })\n }\n </SeriesKeyAxisContainer>\n );\n })\n }\n\n {\n draggingY &&\n <div\n className=\"series-key-axis-container\"\n data-axis-index=\"new-right\"\n data-grapher-id={grapherID}\n />\n }\n\n {\n draggedSeries &&\n <SeriesKeyItem\n style={{\n left: dragPosition.x,\n top: dragPosition.y - dragPositionYOffset,\n position: 'absolute',\n pointerEvents: 'none',\n zIndex: 1\n }}\n series={draggedSeries}\n i={draggedSeries.index}\n theme={theme}\n stateController={stateController}\n />\n }\n </div>\n );\n}\n\nSeriesKey.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n theme: PropTypes.string.isRequired,\n draggingY: PropTypes.bool.isRequired,\n grapherID: PropTypes.string,\n dragPositionYOffset: PropTypes.number\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nexport default React.memo(GraphTitle);\n\nfunction GraphTitle({ title }) {\n return (\n <div className=\"grapher-title\">\n {title}\n </div>\n );\n}\n\nGraphTitle.propTypes = {\n title: PropTypes.string.isRequired\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport StateController from '../state/state_controller';\nimport {useSeries} from '../state/hooks';\nimport CustomPropTypes from '../helpers/custom_prop_types';\nimport getColor from '../helpers/colors';\n\nclass SeriesToggle extends React.PureComponent {\n\n constructor(props) {\n super(props);\n\n this.onChange = this.onChange.bind(this);\n }\n\n // NOTE: event listeners here do not follow React best practices, because when handled through React\n // there were ~500ms of latency when toggling the checkbox. It's unclear why\n onChange(event) {\n setTimeout(() => {\n this.props.stateController.setShowing(this.props.singleSeries, event.target.checked);\n });\n }\n\n render() {\n const { singleSeries } = this.props;\n const color = getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex);\n\n let name = singleSeries.name || singleSeries.yKey;\n\n if (!name) {\n name = singleSeries.index;\n }\n\n return (\n <div className=\"series-toggle\">\n <label>\n <input\n type=\"checkbox\"\n defaultChecked={!singleSeries.hidden}\n ref={(el) => el && el.addEventListener('change', this.onChange)}\n />\n <span className=\"checkmark\" style={{ background: color, borderColor: color }} />\n\n {name}\n </label>\n </div>\n );\n }\n}\n\nSeriesToggle.propTypes = {\n singleSeries: CustomPropTypes.SingleSeries.isRequired,\n stateController: PropTypes.instanceOf(StateController).isRequired\n};\n\nexport default function Sidebar({ stateController }) {\n const series = useSeries(stateController);\n\n return (\n <div className=\"grapher-sidebar\">\n {\n series.map((singleSeries, i) =>\n <SeriesToggle\n key={i}\n singleSeries={singleSeries}\n stateController={stateController}\n />\n )\n }\n </div>\n );\n}\n\nSidebar.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired\n};\n","export default class SyncPool {\n\n /**\n *\n * @param {Boolean} syncBounds\n * @param {Boolean|'onShift'} syncTooltips\n * @param {Boolean} syncDragState\n */\n constructor({ syncBounds=true, syncTooltips=true, syncDragState=false } = {}) {\n this._stateControllers = new Set();\n this._syncBounds = syncBounds;\n this._syncTooltips = syncTooltips;\n this._syncDragState = syncDragState;\n }\n\n add(stateController) {\n this._stateControllers.add(stateController);\n\n if (this._syncBounds) {\n this.syncBounds(stateController);\n }\n\n if (this._syncTooltips) {\n this.syncTooltips(stateController);\n }\n\n if (this._syncDragState) {\n this.syncDragState(stateController);\n }\n }\n\n remove(stateController) {\n this._stateControllers.delete(stateController);\n\n // TODO: remove listeners\n // (though since this is currently only called by stateController dispose, it probably doesn't matter)\n }\n\n syncDragState(stateController) {\n stateController.on('dragging_y_changed', (draggingY) => {\n for (let otherStateController of this._stateControllers) {\n if (stateController === otherStateController) {\n continue;\n }\n\n if (draggingY) {\n otherStateController.markDragStart();\n } else {\n otherStateController.finalizeDrag(null, null);\n }\n }\n });\n }\n\n syncBounds(stateController) {\n stateController.on('bound_calculator_changed', (boundCalculator) => {\n for (let otherStateController of this._stateControllers) {\n if (stateController === otherStateController) {\n continue;\n }\n\n otherStateController.boundCalculator = boundCalculator;\n }\n });\n }\n\n syncTooltips(stateController) {\n stateController.on('tooltip_state_changed', (tooltipState, stateArg) => {\n if (this._tooltipIgnoreState === stateArg) { // avoid cascading changes\n return;\n }\n\n const shouldHideTooltips = tooltipState.unsavedTooltipsCount === 0 ||\n !tooltipState.mousePresent ||\n (this._syncTooltips === 'onShift' && !stateController.shiftKeyPressedOnMove);\n\n if (shouldHideTooltips) {\n this._tooltipIgnoreState = Math.random();\n }\n\n for (let otherStateController of this._stateControllers) {\n if (stateController === otherStateController) {\n continue;\n }\n\n if (shouldHideTooltips) {\n otherStateController.showOnlySavedTooltips(this._tooltipIgnoreState);\n continue;\n }\n\n otherStateController.setTooltipMousePosition({\n mouseX: tooltipState.mouseX,\n mouseY: tooltipState.mouseY,\n tooltipAllNext: true,\n tooltipStateArg: this._tooltipIgnoreState\n });\n }\n });\n }\n\n}\n","import React, { useEffect, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport CustomPropTypes from './helpers/custom_prop_types';\nimport GraphBody from './components/graph_body.jsx';\nimport './grapher.scss';\nimport XAxis from './components/x_axis.jsx';\nimport YAxis from './components/y_axis.jsx';\nimport WindArrows from './components/wind_arrows.jsx';\nimport RangeSelection from './components/range_selection.jsx';\nimport RangeGraph from './components/range_graph.jsx';\nimport SeriesKey from './components/series_key.jsx';\nimport {Y_AXIS_WIDTH} from './helpers/axis_sizes';\nimport GraphTitle from './components/graph_title.jsx';\nimport {LINE_COLORS} from './helpers/colors';\nimport StateController from './state/state_controller';\nimport {useDraggingY, useLeftAxes, useRightAxes, useShowingSidebar, useTheme} from './state/hooks';\nimport Sidebar from './components/sidebar.jsx';\nimport SyncPool from './state/sync_pool.js';\nimport BOUND_CALCULATORS from './state/bound_calculators.js';\n\nfunction calculateClassNamesAndStyles(props, { draggingY, theme }) {\n const { fullscreen, height, width } = props;\n\n const classNames = [\n 'grapher',\n `grapher-${theme}`\n ];\n\n const styles = {};\n\n if (draggingY) {\n classNames.push('grapher-dragging-y');\n }\n\n if (fullscreen) {\n classNames.push('grapher-fullscreen');\n classNames.push('grapher-fixed-height');\n } else if (height) {\n classNames.push('grapher-fixed-height');\n if (typeof height === 'number') {\n styles.height = height - 20;\n } else {\n styles.height = `calc(${height} - 20px)`;\n }\n }\n\n if (width) {\n styles.width = width;\n }\n\n return {\n styles,\n classNames\n };\n}\n\nexport default React.memo(Grapher);\n\nconst grapherDefaultProps = {\n theme: 'night',\n showAxes: true,\n showRangeGraph: true,\n showRangeSelectors: true,\n showSeriesKey: true,\n showTooltips: true,\n boundsSelectionEnabled: true,\n customBoundsSelectors: [],\n sidebarEnabled: false,\n defaultShowAnnotations: true,\n defaultShowOptions: true\n};\n\nfunction Grapher(props) {\n props = {...grapherDefaultProps, ...props};\n\n const stateController = useMemo(() => new StateController({\n grapherID: props.id,\n ...props,\n ...props.stateControllerInitialization\n }), []);\n\n useEffect(() => {\n if (process.env.NODE_ENV === 'development') {\n window.stateController = stateController;\n }\n\n return () => {\n stateController.dispose();\n };\n }, [stateController]);\n\n useEffect(() => {\n props.exportStateController && props.exportStateController(stateController);\n }, [stateController, props.exportStateController]);\n\n useEffect(() => {\n stateController.timingFrameCount = props.timingFrameCount;\n }, [stateController, props.timingFrameCount]);\n\n useEffect(() => {\n props.onRenderTime && stateController.on('render_time', props.onRenderTime);\n\n return () => {\n props.onRenderTime && stateController.off('render_time', props.onRenderTime);\n };\n }, [stateController, props.onRenderTime]);\n\n useEffect(() => {\n stateController.setSeries(props.series);\n }, [stateController, props.series]);\n\n useEffect(() => {\n stateController.theme = props.theme;\n }, [stateController, props.theme]);\n\n const theme = useTheme(stateController);\n const bigLabels = props.bigLabels || theme === 'export';\n\n const defaultLineWidth = props.defaultLineWidth || (theme === 'export' ? 3 : undefined);\n useEffect(() => {\n stateController.defaultLineWidth = defaultLineWidth;\n }, [stateController, defaultLineWidth]);\n\n useEffect(() => {\n stateController.percentile = props.percentile;\n }, [stateController, props.percentile]);\n\n useEffect(() => {\n stateController.customBoundsSelectors = props.customBoundsSelectors;\n }, [stateController, props.customBoundsSelectors]);\n\n useEffect(() => {\n stateController.annotations = props.annotations;\n }, [stateController, props.annotations]);\n\n useEffect(() => {\n if (!props.onAxisChange) {\n return () => {};\n }\n\n stateController.on('exported_axes_changed', props.onAxisChange);\n return () => {\n stateController.off('exported_axes_changed', props.onAxisChange);\n };\n }, [stateController, props.onAxisChange]);\n\n useEffect(() => {\n stateController.primaryRenderer.resize();\n }, [props.height]);\n\n const draggingY = useDraggingY(stateController);\n\n const {styles, classNames} = calculateClassNamesAndStyles(props, { draggingY, theme });\n\n const rightAxes = useRightAxes(stateController);\n const leftAxes = useLeftAxes(stateController);\n const showingSidebar = useShowingSidebar(stateController);\n\n const showAxisColors = typeof props.showAxisColors === 'boolean' ? props.showAxisColors : (theme !== 'export');\n const showGrid = typeof props.showGrid === 'boolean' ? props.showGrid : true;\n const showAxes = typeof props.showAxes === 'boolean' ? props.showAxes : false;\n\n const commonYAxisProps = {\n stateController,\n showAxes,\n showGrid,\n showSeriesKey: props.showSeriesKey,\n bodyHeight: props.bodyHeight,\n theme,\n grapherID: props.id,\n dragPositionYOffset: props.dragPositionYOffset,\n showAxisColors,\n bigLabels\n };\n\n return (\n <div className={classNames.join(' ')} style={styles} data-grapher-id={props.id}>\n {\n props.title &&\n <GraphTitle title={props.title} />\n }\n\n <div className=\"grapher-primary-container-outer\">\n {\n showingSidebar &&\n <Sidebar stateController={stateController} />\n }\n\n <div className=\"grapher-primary-container-body\">\n {\n props.showSeriesKey &&\n <SeriesKey\n stateController={stateController}\n draggingY={draggingY}\n theme={props.theme}\n grapherID={props.id}\n dragPositionYOffset={props.dragPositionYOffset}\n />\n }\n\n {\n props.showRangeSelectors &&\n <RangeSelection\n stateController={stateController}\n customBoundsSelectors={props.customBoundsSelectors}\n customBoundsSelectorsOnly={props.customBoundsSelectorsOnly}\n sidebarEnabled={props.sidebarEnabled}\n />\n }\n\n <div className=\"grapher-main-row\">\n {\n draggingY &&\n <div\n className=\"axis y-axis\"\n data-axis-index=\"new-left\"\n data-grapher-id={props.id}\n style={{\n width: Y_AXIS_WIDTH,\n height: typeof props.bodyHeight === 'number' ? props.bodyHeight : undefined\n }}\n />\n }\n\n {\n leftAxes.map((axis, i) => {\n return <YAxis\n key={i}\n axis={axis}\n sideIndex={leftAxes.length - i - 1}\n {...commonYAxisProps}\n />;\n })\n }\n\n <div className=\"central-container\">\n <GraphBody\n stateController={stateController}\n webgl={props.webgl}\n bodyHeight={props.bodyHeight}\n boundsSelectionEnabled={props.boundsSelectionEnabled}\n showTooltips={props.showTooltips}\n showContextMenu={props.showContextMenu}\n tooltipOptions={props.tooltipOptions}\n checkIntersection={props.checkIntersection}\n draggablePoints={props.draggablePoints}\n onPointDrag={props.onPointDrag}\n onDraggablePointsDoubleClick={props.onDraggablePointsDoubleClick}\n onPointClick={props.onPointClick}\n verticalLines={props.verticalLines}\n clockStyle={props.clockStyle}\n timeZone={props.timeZone}\n />\n\n <WindArrows stateController={stateController} />\n\n <XAxis\n showGrid={showGrid}\n showAxes={showAxes}\n stateController={stateController}\n bigLabels={bigLabels}\n xTickUnit={props.xTickUnit}\n clockStyle={props.clockStyle}\n timeZone={props.timeZone}\n integersOnly={props.xAxisIntegersOnly}\n formatXAxisLabel={props.formatXAxisLabel}\n />\n\n {\n props.showRangeGraph &&\n <div className=\"range-graph-container\">\n <RangeGraph\n stateController={stateController}\n webgl={props.webgl}\n checkIntersection={props.checkIntersection}\n markDates={props.markRangeGraphDates}\n timeZone={props.timeZone}\n verticalLines={props.verticalLines}\n />\n </div>\n }\n </div>\n\n {\n rightAxes.map((axis, i) => {\n return <YAxis\n key={i}\n axis={axis}\n sideIndex={i}\n {...commonYAxisProps}\n />;\n })\n }\n\n {\n draggingY &&\n <div\n className=\"axis y-axis\"\n data-axis-index=\"new-right\"\n data-grapher-id={props.id}\n style={{\n width: Y_AXIS_WIDTH,\n height: typeof props.bodyHeight === 'number' ? props.bodyHeight : undefined\n }}\n />\n }\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nGrapher.propTypes = {\n series: CustomPropTypes.Series.isRequired,\n webgl: PropTypes.bool,\n requireWASM: PropTypes.bool,\n checkIntersection: PropTypes.bool,\n\n onAxisChange: PropTypes.func,\n onRenderTime: PropTypes.func,\n exportStateController: PropTypes.func,\n timingFrameCount: PropTypes.number,\n\n stateControllerInitialization: PropTypes.object,\n syncPool: PropTypes.instanceOf(SyncPool),\n id: PropTypes.string,\n dragPositionYOffset: PropTypes.number,\n\n theme: PropTypes.oneOf(['day', 'night', 'export']),\n title: PropTypes.string,\n fullscreen: PropTypes.bool,\n bodyHeight: PropTypes.number,\n height: PropTypes.number,\n width: PropTypes.number,\n\n showAxes: PropTypes.bool,\n showRangeGraph: PropTypes.bool,\n showRangeSelectors: PropTypes.bool,\n showSeriesKey: PropTypes.bool,\n showTooltips: PropTypes.bool,\n showGrid: PropTypes.bool,\n showAxisColors: PropTypes.bool,\n bigLabels: PropTypes.bool,\n xTickUnit: PropTypes.oneOf(['year']),\n formatXAxisLabel: PropTypes.func,\n xAxisIntegersOnly: PropTypes.bool,\n clockStyle: PropTypes.oneOf(['12h', '24h']),\n timeZone: PropTypes.string, // local, utc, or a full timezone string\n markRangeGraphDates: PropTypes.bool,\n\n boundsSelectionEnabled: PropTypes.bool,\n sidebarEnabled: PropTypes.bool,\n\n percentile: PropTypes.number,\n defaultShowOptions: PropTypes.bool,\n defaultShowIndividualPoints: PropTypes.bool,\n defaultShowSidebar: PropTypes.bool,\n defaultShowAnnotations: PropTypes.bool,\n defaultLineWidth: PropTypes.number,\n\n tooltipOptions: CustomPropTypes.TooltipOptions,\n\n customBoundsSelectors: CustomPropTypes.CustomBoundsSelectors,\n customBoundsSelectorsOnly: PropTypes.bool,\n defaultBoundsCalculator: PropTypes.string,\n\n annotations: CustomPropTypes.Annotations,\n draggablePoints: CustomPropTypes.DraggablePoints,\n onPointDrag: PropTypes.func,\n onDraggablePointsDoubleClick: PropTypes.func,\n verticalLines: CustomPropTypes.VerticalLines,\n onPointClick: PropTypes.func\n};\n\nexport const AVAILABLE_COLORS = LINE_COLORS;\nexport const BUILT_IN_BOUND_CALCULATORS = BOUND_CALCULATORS;\n","import Eventable from '../eventable.js';\nimport getColor from '../helpers/colors.js';\nimport nameForSeries from '../helpers/name_for_series.js';\n\nexport default class MultigraphStateController extends Eventable {\n\n constructor({ id }) {\n super();\n\n this._id = id;\n\n this._multiSeries = [];\n this._seriesToGraphIndices = new Map();\n this._graphIndicesToSeries = new Map();\n this._modifiedSeries = new Map();\n this._originalSeriesByMultigrapherIndex = new Map();\n this._stateControllers = new Set();\n this._prevSeries = [];\n\n this._dataCache = new Map();\n this._subscriptions = new Map();\n\n this._draggingY = false;\n\n this.on('multi_series_changed', () => {\n for (let stateController of this._stateControllers) {\n stateController._multiSeries = this._multiSeries;\n }\n });\n }\n\n /**\n * Takes an array of user-supplied series, then splits, modifies, and broadcasts them\n *\n * @param {Array<Object>} series\n */\n setSeries(series) {\n\n if (this._prevSeries.length === series.length) {\n let anyDifferent = false;\n for (let i = 0; i < series.length; i++) {\n if (series[i] !== this._prevSeries[i]) {\n anyDifferent = true;\n break;\n }\n }\n\n if (!anyDifferent) {\n return;\n }\n }\n\n this._prevSeries = series;\n\n const graphIndices = new Set();\n const currentSeriesSet = new Set(series);\n\n for (let singleSeries of series) {\n let graphIndex = singleSeries.graph || 0;\n\n if (this._seriesToGraphIndices.has(singleSeries)) {\n graphIndex = this._seriesToGraphIndices.get(singleSeries);\n }\n\n graphIndices.add(graphIndex);\n\n let seriesSet = this._graphIndicesToSeries.get(graphIndex);\n if (!seriesSet) {\n seriesSet = new Set();\n this._graphIndicesToSeries.set(graphIndex, seriesSet);\n }\n\n seriesSet.add(singleSeries);\n }\n\n const sortedGraphIndices = [...graphIndices].sort();\n\n this._multiSeries = [];\n let globalSeriesIndex = 0;\n\n for (let graphIndex of sortedGraphIndices) {\n const series = [];\n\n for (let singleSeries of this._graphIndicesToSeries.get(graphIndex)) {\n if (!currentSeriesSet.has(singleSeries)) {\n this._graphIndicesToSeries.get(graphIndex).delete(singleSeries);\n continue;\n }\n\n if (this._modifiedSeries.has(singleSeries)) {\n globalSeriesIndex++;\n series.push(this._modifiedSeries.get(singleSeries));\n continue;\n }\n\n const color = getColor(singleSeries.color, globalSeriesIndex);\n const name = nameForSeries(singleSeries, globalSeriesIndex);\n const modifiedSeries = {\n ...singleSeries,\n multigrapherSeriesIndex: globalSeriesIndex,\n multigrapherGraphIndex: graphIndex,\n color,\n name\n };\n\n this._modifiedSeries.set(singleSeries, modifiedSeries);\n this._originalSeriesByMultigrapherIndex.set(globalSeriesIndex, singleSeries);\n\n globalSeriesIndex++;\n series.push(modifiedSeries);\n }\n\n this._multiSeries.push(series);\n }\n\n if (this._nextMultigrapherSeriesIndex) {\n this._nextMultigrapherSeriesIndex = this._nextMultigrapherSeriesIndex - this._multiSeriesCount + globalSeriesIndex;\n } else {\n this._nextMultigrapherSeriesIndex = globalSeriesIndex;\n }\n this._multiSeriesCount = globalSeriesIndex;\n\n this.emit('multi_series_changed', this.multiSeries);\n }\n\n /**\n * Registers a state controller for series switching\n *\n * @param {StateController} stateController\n */\n registerStateController(stateController) {\n if (this._stateControllers.has(stateController)) {\n return;\n }\n\n this._stateControllers.add(stateController);\n stateController._multigraphStateController = this;\n stateController._multiSeries = this._multiSeries;\n\n stateController.on('dragging_y_finalized', ({ grapherID, axisIndex, draggedSeries }={}) => {\n if (grapherID === stateController.grapherID) {\n return;\n }\n\n const [check, multigrapherID, graphIndex] = grapherID.split('-');\n if (check !== 'multigrapher' || multigrapherID !== this._id) {\n return;\n }\n\n setTimeout(() => {\n this.moveSeries({ axisIndex, draggedSeries, graphIndex });\n });\n });\n\n stateController.on('dragging_y_changed', (draggingY) => {\n if (draggingY === this._draggingY) {\n return;\n }\n\n this._draggingY = draggingY;\n this.emit('dragging_y_changed', this._draggingY);\n });\n\n stateController.on('observable_modified', (observable) => {\n for (let otherStateController of this._stateControllers) {\n if (stateController === otherStateController) {\n continue;\n }\n\n otherStateController.markObservableModified(observable);\n }\n });\n\n stateController.on('dispose', () => {\n this._stateControllers.delete(stateController);\n });\n }\n\n /**\n * Moves the given dragged series (as specified by the child state controller) to a different graph\n *\n * @param {String} axisIndex - the axis index on the new graph to move the series to\n * @param {Object} draggedSeries - the series that got dragged. Different identity than what this may access\n * @param {String} graphIndex - the index of the graph to assign it to\n */\n moveSeries({ axisIndex, draggedSeries, graphIndex }) {\n const prevGraphCount = this.graphCount;\n\n const originalSeries = this._originalSeriesByMultigrapherIndex.get(draggedSeries.multigrapherSeriesIndex);\n const modifiedSeries = this._modifiedSeries.get(originalSeries);\n\n this._multiSeries[modifiedSeries.multigrapherGraphIndex].splice(\n this._multiSeries[modifiedSeries.multigrapherGraphIndex].indexOf(modifiedSeries), 1\n );\n this._multiSeries[modifiedSeries.multigrapherGraphIndex] = [...this._multiSeries[modifiedSeries.multigrapherGraphIndex]];\n\n if (graphIndex === 'top') {\n modifiedSeries.multigrapherGraphIndex = this._createGraphAtTop();\n } else if (graphIndex === 'bottom') {\n modifiedSeries.multigrapherGraphIndex = this._createGraphAtBottom();\n } else {\n modifiedSeries.multigrapherGraphIndex = parseInt(graphIndex);\n }\n\n modifiedSeries.axisIndex = axisIndex;\n // safe because stateController operates on a copy. We could also have changed the identify of modifiedSeries,\n // but with that we might reset data when moving it back\n delete modifiedSeries.axis;\n\n this._multiSeries[modifiedSeries.multigrapherGraphIndex] = [...this._multiSeries[modifiedSeries.multigrapherGraphIndex], modifiedSeries];\n this._multiSeries = [...this._multiSeries];\n\n for (let graphIndex = 0; graphIndex < this._multiSeries.length; graphIndex++) {\n const originalSeriesAtIndex = this._multiSeries[graphIndex].map(({ multigrapherSeriesIndex }) =>\n this._originalSeriesByMultigrapherIndex.get(multigrapherSeriesIndex));\n this._graphIndicesToSeries.set(graphIndex, new Set(originalSeriesAtIndex));\n\n for (let singleSeries of originalSeriesAtIndex) {\n this._seriesToGraphIndices.set(singleSeries, graphIndex);\n }\n }\n\n this.emit('multi_series_changed', this.multiSeries);\n this.emit('graph_count_changed', this.graphCount, prevGraphCount);\n }\n\n /**\n * Finds or creates an empty graph at the beginning and returns its index\n *\n * @return {number}\n * @private\n */\n _createGraphAtTop() {\n // check if there's anything at the beginning already\n let emptyAtTopIndex = null;\n\n for (let i = 0; i < this._multiSeries.length; i++) {\n if (this._multiSeries[i].length === 0) {\n emptyAtTopIndex = i;\n } else {\n break;\n }\n }\n\n if (emptyAtTopIndex !== null) {\n return emptyAtTopIndex;\n }\n\n // add a series at the beginning and mutate the graph index of each\n this._multiSeries = [[], ...this._multiSeries];\n for (let graphIndex = 0; graphIndex < this._multiSeries.length; graphIndex++) {\n if (!this._multiSeries[graphIndex].length) {\n continue;\n }\n\n this._multiSeries[graphIndex] = [...this._multiSeries[graphIndex]];\n\n for (let modifiedSeries of this._multiSeries[graphIndex]) {\n modifiedSeries.multigrapherGraphIndex = graphIndex;\n }\n }\n\n return 0;\n }\n\n /**\n * Finds or creates an empty graph at the end and returns its index\n *\n * @return {number}\n * @private\n */\n _createGraphAtBottom() {\n // check if there's anything at the beginning already\n let emptyAtBottomIndex = null;\n\n for (let i = this._multiSeries.length - 1; i >= 0; i--) {\n if (this._multiSeries[i].length === 0) {\n emptyAtBottomIndex = i;\n } else {\n break;\n }\n }\n\n if (emptyAtBottomIndex !== null) {\n return emptyAtBottomIndex;\n }\n\n // add something at the bottom\n this._multiSeries = [...this._multiSeries, []];\n\n return this._multiSeries.length - 1;\n }\n\n get multiSeries() {\n return this._multiSeries.filter((series) => series.length);\n }\n\n get series() {\n return [...this._stateControllers].map((stateController) => stateController.series).flat();\n }\n\n get graphCount() {\n return this.multiSeries.length;\n }\n\n get draggingY() {\n return this._draggingY;\n }\n\n dispose() {\n this.clearListeners();\n\n for (let listener of this._subscriptions.values()) {\n listener.unsubscribe();\n }\n\n this._subscriptions.clear();\n }\n\n get stateControllerInitialization() {\n return {\n sharedDataCache: this._dataCache,\n sharedSubscriptions: this._subscriptions\n };\n }\n\n incrementMultigrapherSeriesIndex() {\n const index = this._nextMultigrapherSeriesIndex;\n\n this._nextMultigrapherSeriesIndex ++;\n\n return index;\n }\n}\n","import React, { useEffect, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport Grapher from './grapher.jsx';\nimport MultigraphStateController from './state/multigraph_state_controller.js';\nimport {useDraggingY, useMultiSeries} from './state/hooks.js';\nimport SyncPool from './state/sync_pool.js';\n\nexport default React.memo(MultiGrapher);\n\n\nfunction MultiGrapher(props) {\n /* eslint-disable react/prop-types */\n\n const multigrapherID = useMemo(() => Math.random().toString(36).slice(2), []);\n\n const multigraphStateController = useMemo(() => new MultigraphStateController({\n id: multigrapherID,\n ...props\n }), []);\n\n const multiSeries = useMultiSeries(multigraphStateController);\n\n const syncPool = useMemo(() => new SyncPool({\n syncBounds: props.syncBounds,\n syncTooltips: props.syncTooltips,\n syncDragState: true\n }), []);\n\n const registerStateController = useMemo(() => multigraphStateController.registerStateController.bind(multigraphStateController), [multigraphStateController]);\n\n useEffect(() => {\n if (process.env.NODE_ENV === 'development') {\n window.multigraphStateController = multigraphStateController;\n }\n\n return () => {\n multigraphStateController.dispose();\n };\n }, [multigraphStateController]);\n\n useEffect(() => {\n props.exportStateController && props.exportStateController(multigraphStateController);\n }, [multigraphStateController, props.exportStateController]);\n\n useEffect(() => {\n multigraphStateController.setSeries(props.series);\n }, [multigraphStateController, props.series]);\n\n useEffect(() => {\n if (!props.onMultiseriesChange) {\n return () => {};\n }\n\n multigraphStateController.on('multi_series_changed', props.onMultiseriesChange);\n return () => {\n multigraphStateController.off('multi_series_changed', props.onMultiseriesChange);\n };\n }, [multigraphStateController, props.onMultiseriesChange]);\n\n const draggingY = useDraggingY(multigraphStateController);\n\n return (\n <div className=\"multigrapher\">\n {\n draggingY && props.newUpperEnabled &&\n <div className={`new-grapher grapher-${props.theme}`} data-grapher-id={`multigrapher-${multigrapherID}-top`}>\n New grapher\n </div>\n }\n\n {\n multiSeries.map((series, i) =>\n <Grapher\n key={i}\n {...props}\n syncPool={syncPool}\n stateControllerInitialization={multigraphStateController.stateControllerInitialization}\n series={series}\n id={`multigrapher-${multigrapherID}-${i}`}\n dragPositionYOffset={props.newUpperEnabled ? 38 : 0}\n exportStateController={registerStateController}\n />\n )\n }\n\n {\n draggingY &&\n <div className={`new-grapher grapher-${props.theme}`} data-grapher-id={`multigrapher-${multigrapherID}-bottom`}>\n New grapher\n </div>\n }\n </div>\n );\n}\n\nMultiGrapher.defaultProps = {\n theme: 'night'\n};\n\nMultiGrapher.propTypes = Object.assign({}, Grapher.propTypes, {\n syncBounds: PropTypes.bool,\n syncTooltips: PropTypes.bool,\n newUpperEnabled: PropTypes.bool,\n onMultiseriesChange: PropTypes.func\n});\n"],"names":["inProgress","dataWebpackPrefix","module","exports","styleElement","nonce","setAttribute","stylesInDOM","getIndexByIdentifier","identifier","result","i","length","modulesToDom","list","options","idCountMap","identifiers","item","id","base","count","concat","indexByIdentifier","obj","css","media","sourceMap","supports","layer","references","updater","addElementStyle","byIndex","splice","push","api","domAPI","update","newObj","remove","lastIdentifiers","newList","index","newLastIdentifiers","_i","_index","styleSheet","cssText","firstChild","removeChild","appendChild","document","createTextNode","cssWithMappingToString","toString","this","map","content","needLayer","join","modules","dedupe","undefined","alreadyImportedModules","k","_k","cssMapping","btoa","base64","unescape","encodeURIComponent","JSON","stringify","data","sourceMapping","LINE_COLORS","getColor","seriesColor","multigrapherSeriesIndex","applyReducedOpacity","color","opacityFactor","startsWith","matches","match","r","g","b","a","parseFloat","hex","slice","split","char","parseInt","applyReducedOpacityToGradient","gradient","Array","isArray","stop","position","createDefaultGradient","halfOpacityColor","element","createElement","setAttributes","attributes","insert","___CSS_LOADER_EXPORT___","memo","style","target","styleTarget","querySelector","window","HTMLIFrameElement","contentDocument","head","e","getTarget","Error","ReactPropTypesSecret","emptyFunction","emptyFunctionWithReset","resetWarningCache","shim","props","propName","componentName","location","propFullName","secret","err","name","getShim","isRequired","ReactPropTypes","array","bigint","bool","func","number","object","string","symbol","any","arrayOf","elementType","instanceOf","node","objectOf","oneOf","oneOfType","shape","exact","checkPropTypes","PropTypes","insertStyleElement","styleTagTransform","apply","parentNode","removeStyleElement","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","m","n","getter","__esModule","d","definition","key","o","Object","defineProperty","enumerable","get","f","chunkId","Promise","all","keys","reduce","promises","u","prop","prototype","hasOwnProperty","call","l","url","done","script","needAttach","scripts","getElementsByTagName","s","getAttribute","charset","nc","src","onScriptComplete","prev","event","onerror","onload","clearTimeout","timeout","doneFns","forEach","fn","setTimeout","bind","type","Symbol","toStringTag","value","p","baseURI","self","href","installedChunks","j","installedChunkData","promise","resolve","reject","error","errorType","realSrc","message","request","webpackJsonpCallback","parentChunkLoadingFunction","chunkIds","moreModules","runtime","some","chunkLoadingGlobal","globalThis","require","SIMPLE_DATA_TYPES","DATA_TYPES","Data","SingleSeries","xKey","yKey","windXKey","windYKey","windComp","xUnixDates","xLabel","yLabel","ignoreDiscontinuities","dashed","dashPattern","width","rangeSelectorWidth","axis","expandYWith","defaultAlwaysTooltipped","followingMouseTooltip","square","shiftXBy","graph","background","hideFromKey","showIndividualPoints","minPointSpacing","rendering","negativeColor","negativeGradient","zeroLineWidth","zeroLineColor","zeroLineY","pointRadius","tooltipWidth","hasAreaBottom","shadowColor","rangeKey","Series","Axis","axisIndex","series","side","scale","label","Axes","CustomBoundsSelector","calculator","datesOnly","CustomBoundsSelectors","TooltipOptionsRaw","includeSeriesLabel","includeXLabel","includeYLabel","includeXValue","includeYValue","floating","alwaysFixedPosition","floatPosition","floatDelta","savingDisabled","customTooltip","combineTooltips","TooltipOptions","Annotation","x","Date","startX","endX","lineOnly","Annotations","DraggablePoint","y","radius","fillColor","strokeColor","strokeWidth","onClick","onDoubleClick","DraggablePoints","VerticalLine","lineTop","markTop","markerStyle","text","textTop","textStyle","minPixelX","maxPixelX","onRangeGraph","onRangeGraphOnly","VerticalLines","Eventable","constructor","_listeners","clearListeners","on","eventName","Set","add","off","delete","size","emit","args","arguments","inferType","useSimpleData","simpleData","observe","colorToVector","parts","part","test","substr","createGLProgram","gl","vertShaderSource","fragShaderSource","vertexShader","createShader","VERTEX_SHADER","shaderSource","compileShader","getShaderParameter","COMPILE_STATUS","console","getShaderInfoLog","fragmentShader","FRAGMENT_SHADER","program","createProgram","attachShader","linkProgram","getProgramParameter","LINK_STATUS","validateProgram","VALIDATE_STATUS","getProgramInfoLog","BackgroundProgram","_gl","_program","backgroundVert","backgroundFrag","_vertexBuffer","createBuffer","_indexBuffer","getExtension","draw","useProgram","minXt","maxXt","uniform4f","getUniformLocation","vertices","Float32Array","bindBuffer","ARRAY_BUFFER","bufferData","STATIC_DRAW","positionLocation","getAttribLocation","enableVertexAttribArray","vertexAttribPointer","FLOAT","enable","BLEND","blendFunc","SRC_ALPHA","ONE_MINUS_SRC_ALPHA","drawArrays","TRIANGLES","async","sizeCanvas","canvas","context","reset","height","requestAnimationFrame","boundingRect","getBoundingClientRect","pixelRatio","devicePixelRatio","webkitBackingStorePixelRatio","mozBackingStorePixelRatio","msBackingStorePixelRatio","oBackingStorePixelRatio","backingStorePixelRatio","elementWidth","elementHeight","renderWidth","renderHeight","pathsFrom","dataInRenderSpace","splitAtY","paths","currentPath","previouslyDiscontinuous","nullMask","maxYValues","minYValues","yValues","minY","maxY","prevY","drawZeroLine","sizing","zeroColor","zeroWidth","strokeStyle","lineWidth","beginPath","moveTo","lineTo","stroke","renderEntireArea","path","areaBottomPath","zero","hasNegatives","fillStyle","globalGradient","createLinearGradient","addColorStop","areaBottom","firstX","_startY","lastX","_lastY","fill","renderAreaSegment","splitIndex","ghostPoint","isPreCutoff","areaBottomPaths","gradientColor","endIndex","Math","min","lastPoint","startIndex","startPoint","max","drawPointsNormally","individualPoints","pointColor","arc","PI","drawLinesNormally","linePaths","highlighted","drawLinesWithCutoff","timeRatio","cutoffOpacity","cutoffPixelX","preCutoffPaths","postCutoffPaths","prePath","postPath","lastPrePoint","firstPostPoint","x1","y1","x2","y2","unshift","reducedColor","drawPointsWithCutoffByRatio","isBeforeCutoff","getBarWidths","closestSpacing","bounds","axisSeriesCount","fullBarWidth","maxX","minX","totalBarWidth","barWidth","barSpacing","applyPointSpacing","points","minSpacing","spacedPoints","point","rustApiModule","RustAPIPromise","then","default","RustAPI","extractVerticesFromPaths","pointNumber","positions","prevPositions","indices","Uint32Array","verticesPattern","set","vertexPointer","sourceLength","copyWithin","pointI","prevX","LineProgram","lineVert","lineFrag","_circleProgram","circleVert","circleFrag","_positionBuffer","_prevPositionBuffer","_individualPointBuffer","dispose","clear","drawingBufferWidth","drawingBufferHeight","clearColor","viewport","parameters","thickness","shadowBlur","renderCutoffGradient","cutoffIndex","originalData","drawLineWithCutoff","get_point_number","extract_vertices","extractVertices","positionIndex","prevPositionIndex","vertexIndex","uniform1f","colorVector","cutoffX","ELEMENT_ARRAY_BUFFER","drawElements","UNSIGNED_INT","pointSize","getIndividualPoints","cutoffTime","baseIndex","floor","fraction","cutoffDate","getTime","currentDate","nextDate","currentTime","preCutoffPoints","postCutoffPoints","isPreview","visibleMinTime","selectionBounds","pixelX","pixelY","visibleMaxTime","reducedOpacityColor","flat","POINTS","cutoffTimeValue","visibleCutoffRatio","ShadowProgram","shadowVert","shadowFrag","positionLoc","trapezoidBoundsLoc","trapezoidBottomLoc","_trapezoidBoundsBuffer","_trapezoidBottomBuffer","_gradientTexture","createTexture","deleteTexture","generateTrapezoidGeometry","trapezoids","trapezoidBounds","trapezoidBottom","trap","bottomY1","bottomY2","bottom","parseGradient","fallbackColor","fallbackColorVec","textureData","Uint8Array","textureWidth","gradientCount","colors","stops","stopIndex","colorIndex","params","drawShadowWithCutoff","positiveTrapezoids","negativeTrapezoids","inRenderSpaceAreaBottom","y1RelativeToZero","y2RelativeToZero","xCross","abs","yCross","finalX2","finalY2","finalBottomY2","ratio","trapezoid","renderTrapezoidSet","trapSet","geometry","gradientData","activeTexture","TEXTURE0","bindTexture","TEXTURE_2D","texImage2D","RGBA","UNSIGNED_BYTE","texParameteri","TEXTURE_MIN_FILTER","NEAREST","TEXTURE_MAG_FILTER","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","uniform1i","uniform4fv","getError","NO_ERROR","_lastIndividualPoints","_lastParams","currentItem","nextItem","visibleBounds","firstTime","lastTime","firstItem","lastItem","translucentGradient","drawSplitShadowTrapezoids","disable","DEPTH_TEST","GraphBodyRenderer","stateController","canvasElement","webgl","checkIntersection","super","_stateController","_checkIntersection","_canvas","_webgl","_context","getContext","_lineProgram","_shadowProgram","alert","_context2d","_initialized","_initializeCanvas","_boundResize","resize","_cachedAxisCount","_onAxisChange","axes","filter","_resizeObserver","disconnect","_intersectionObserver","_zeroLineCanvas","_zeroLineContext","_overlayContext","clearRect","_overlayCanvas","_overlayCanvasInitialized","render","singleSeries","inRenderSpace","defaultLineWidth","globalBounds","warn","cutoffData","xValue","yValue","currentPoint","nextPoint","nextTime","useDataSpace","includeBeyondBounds","currentBounds","threshold","pastThreshold","samples","xCoord","inSelectedSpace","inDataSpace","boundsMinX","boundsMaxX","foundBeyondBounds","lastPointBeforeBounds","_sizing","yCoord","beforeXValue","beforeY","beforeXCoord","beforeYCoord","commonCPUParams","willReadFrequently","flush","find","tuple","barSeriesInAxis","barClosestSpacing","sp","dataBounds","barParams","indexInAxis","indexOf","selection","rangeGraphRenderer","_bounds","_selection","barBottom","barColor","dataPoint","negColor","fillRect","drawBarsWithCutoff","drawBars","areaParams","shouldSplitAreaPaths","areaPaths","pathI","reducedOpacityGradient","renderCutoffIndex","preCutoffPath","preCutoffAreaBottomPath","bottomGhostPoint","postCutoffPath","postCutoffAreaBottomPath","visibleTimeRatio","drawAreaWithCutoff","positive","pointsToRender","drawArea","shadowProgram","boundsChanged","_lastBounds","_lastRenderHeight","_lastShadowCache","shadowParams","save","globalCompositeOperation","restore","top","left","pointerEvents","insertBefore","nextSibling","shouldShowIndividualPoints","drawContext","_fallbackContext","fallbackCanvas","drawParams","getRanges","range","pixelMinY","pixelMaxY","setLineDash","xFraction","lastDataTime","ranges","horizontalBarWidth","now","drawLine","renderBackground","inBackgroundSpace","_backgroundProgram","drawBackground","markSizeChanged","ResizeObserver","first","disabled","IntersectionObserver","entries","_intersectionTimeout","isIntersecting","sizingPromise","resizeDebounced","_resizeTimeout","recalculatePosition","calculatePrecision","log10","roundToPrecision","precision","isNaN","rounded","toFixed","ceil","stripped","includes","replace","DATE_TIME_FORMATTERS","timezoneToOffsetMS","timeZone","sampleDate","datetimeFormatter","properTimeZone","Intl","DateTimeFormat","resolvedOptions","timeZoneName","offsetPart","formatToParts","hours","minutes","startOfDayInTimezone","date","timezone","startOfDay","setHours","offset","setUTCHours","valueOf","formatX","dates","justTime","justDate","justMonthAndDay","clockStyle","unitOverride","integersOnly","inverseEnumMap","time","utc","toLowerCase","localOffset","year","getUTCFullYear","getFullYear","month","getUTCMonth","getMonth","day","getUTCDate","getDate","toLocaleDateString","getUTCHours","getHours","getUTCMinutes","getMinutes","seconds","getUTCSeconds","getSeconds","milliseconds","getUTCMilliseconds","getMilliseconds","timeString","padStart","formatTime","round","formatY","log","Y_AXIS_WIDTH","getYLabelContent","fullYPrecision","TooltipLabel","axisLabel","textLeft","formatXOptions","React","propTypes","CustomPropTypes","Tooltip","halfHeight","passThroughProps","preparedTooltips","tooltips","tooltip","tooltipPixelY","fixedPosition","multiplier","caretSize","isFinite","markerTransform","tooltipTransform","commonLabelProps","maxPrecision","baseLeft","yTranslation","axisCount","caretPadding","Boolean","CustomTooltipComponent","groupedTooltips","combinationThreshold","added","group","totalHeight","maxWidth","sort","className","transform","_extends","defaultProps","mouseX","mouseY","ContextMenu","setTextRef","ref","textRef","contextMenu","showing","createRange","getSelection","removeAllRanges","selectNodeContents","addRange","focus","formatDateTime","dateTimeStr","datePart","timePart","formattedDate","period","toLocaleString","displayValue","autoFocus","simpleSeriesToDataSpace","tuples","tuplesToDataSpace","values","valuesToDataSpace","objects","objectsToDataSpace","rangeValues","windDirections","windData","originalXValue","enumToNumber","valueXStart","readBinaryFormatValue","view","getUint32","BYTES_PER_ELEMENT","getUint8","getFloat64","hasWindKeys","buffer","ArrayBuffer","DataView","xIndex","channels","yIndex","offsets","subpoint","windX","windY","sqrt","atan2","finalizeBounds","initial","calculateDataBounds","percentile","percentileAsymmetry","sortedByY","_x","_x1","_x2","rangeValue","asymmetry","inBottomPercentile","inTopPercentile","percentileBounds","spacing","mergeBounds","boundsList","mergedBounds","expandBounds","extendXForNBars","expandedBounds","assign","unscaledMinY","unscaledMaxY","midpoint","binarySearch","targetX","searchParams","returnIndex","middleIndex","searchType","dataSpaceToSelectedSpace","swap","firstAdded","lastAdded","beforeIndex","afterIndex","addToEndOnly","beginningInterpolationIndex","endInterpolationIndex","pop","shift","interpolationIndex","interpolate","lastIncluded","nullIndex","selectedIndex","dataIndex","begPoint","endPoint","firstIndex","secondIndex","boundary","xBefore","yBefore","xAfter","yAfter","percent","scaleBounds","selectedSpaceToRenderSpace","dataChanged","Float64Array","scaledBounds","inParams","dataF64","dataNullMask","copyIndexStart","hasSwap","useSwap","extraSpaceFactor","selected_space_to_render_space","prevI","minSeenY","maxSeenY","curY","selectedSpaceToRenderSpaceInPlace","flattenSimpleData","flattened","fI","extractYValue","extractXValue","moveTooltip","distance","xDistance","pixelWidth","lastMinute","last10Minutes","lastHour","lastDay","condenseDataSpace","targetBucketCount","partiallyCondensedData","CONDENSE_THRESHOLD","condensedData","bucketSize","minInBucket","maxInBucket","currentBucketIndex","bucketIndex","nameForSeries","selectedSpaceToBackgroundSpace","conditions","evaluator","comparator","comparedAgainst","parsedValue","currentSection","condition","interpolatedMaxX","interpolatedMinX","StateController","defaultBoundsCalculator","customBoundsSelectors","requireWASM","defaultShowIndividualPoints","defaultShowSidebar","defaultShowAnnotations","defaultShowOptions","syncPool","grapherID","sharedDataCache","sharedSubscriptions","fullscreen","_requireWASM","_markDirty","_series","_seriesFromOriginalSeries","Map","_axes","_highlightedSeries","_showIndividualPoints","_autoscaleY","_percentile","_percentileAsymmetry","_showingOptions","_maxPrecision","_showingSidebar","_showingAnnotations","_grapherID","_fullscreen","_alwaysTooltipped","_tooltipState","mousePresent","_contextMenuPosition","_savedTooltips","_draggingY","_annotations","_annotationsState","annotations","_enumMap","_hasXEnum","_timingBuffer","_timingIndex","_timingFrameCount","_modifiedSeries","_deferredEmissions","_deferredPriorityEmissions","primaryRenderer","_boundsCalculator","givenLabel","customCalculators","BOUND_CALCULATORS","getDefaultBoundsCalculator","_boundsHistory","_boundsIndex","_dataCache","_subscriptions","_subscriptionsShared","_observablesToSeries","_generators","_generatorsToSeries","_generatorCallArgs","_seriesChangedFromPromises","_syncPool","_onDataChange","listener","unsubscribe","_removeSeries","disposed","setSeries","userSeries","userCreated","propsSeries","anyDifferent","originalSeries","_mustResize","newSeriesSet","has","_tooltipsChanged","deferredEmit","_assignAxisTo","hidden","_hideSeries","_dataChanged","_frameRequested","frameRequestStart","performance","frameExecutionStart","dataProcessingStart","_mustRerender","_annotationsChanged","_onDataAdd","_primarySizeChanged","_calculatePrimarySizeDependents","_rangeGraphSizeChanged","_calculateRangeGraphSizeDependents","dataProcessingEnd","renderPipelineStart","_render","renderPipelineEnd","generatorsStart","_mustCallGenerators","_callGenerators","generatorsEnd","tooltipStart","_recalculateTooltips","tooltipEnd","contextMenuStart","_contextMenuChanged","_recalculateContextMenu","contextMenuEnd","annotationStart","_recalculateAnnotations","annotationEnd","callbacksStart","emission","callbacksEnd","completionTime","loopTime","frameExecution","frameRequestAndExecution","generators","dataProcessing","renderPipeline","callbacks","lastLoopTime","deferredPriorityEmit","_seriesToSimpleData","currentData","sameDataSet","firstSameDataSeries","next","_listenToObservableData","observable","_callGenerator","_listenToPromise","dataPromise","resolved","datum","markObservableModified","_unsubscribeFromStaleSeries","currentSeries","seriesSet","stillHasListener","generator","stillHasSeries","alwaysTooltipped","savedTooltips","allTooltipped","savedTooltip","minDistance","Infinity","trueX","dataMinX","dataMaxX","padding","closestIndex","closestPoint","ignoreYDistanceCheck","xDistanceThreshold","yDistanceThreshold","distanceThreshold","yDistance","enumLike","hasEnum","simplePoint","hasXEnum","followMouse","finalPixelY","unsavedTooltips","unsavedTooltipsCount","calculateTooltipState","_tooltipAllNext","_globalBounds","_tooltipStateArg","newX","right","shownSeries","xRange","annotation","seriesName","isRange","isPoint","xStartValue","xEndValue","convertToNumber","val","pixelStartX","pixelEndX","calculateAnnotationsState","_expandYWith","dataBoundsList","dataSpaceResult","simpleDataSliceStart","_rangeValues","extendedDataSpace","_dataBounds","_recalculateSelection","disableSwap","selectedBounds","selectedBoundsAreaTop","selectedBoundsAreaBottom","inSelectedSpaceAreaBottom","_recalculateAxisBounds","modifiedSeries","newData","modifiedAxes","modifiedSeriesAndDependents","newDataInDataSpace","newDataBounds","newPointCount","previousSelection","newSelectedData","fixedY","targetBounds","byAxis","visibleRangeValues","minXValue","maxXValue","rangeIndex","validRangeValues","selectedBoundsList","selectedDataBounds","boundsCalculator","selectionFromGlobalBounds","_","export","night","_theme","inBackgroundSpacePrimary","inRenderSpacePrimary","_defaultLineWidth","inRenderSpacePrimaryAreaBottom","rangeGraphBounds","inRenderSpaceRangeGraph","inRenderSpaceRangeGraphAreaBottom","toCondensedSelectedSpaceParams","inCondensedSelectedSpacePrimary","toRenderSpaceParams","inCondensedSelectedSpacePrimaryAreaBottom","inBackgroundSpacePrimaryAreaBottom","toSelectedSpaceParams","inSelectedSpaceRangeGraph","inCondensedSelectedSpaceRangeGraph","inSelectedSpaceRangeGraphAreaBottom","inCondensedSelectedSpaceRangeGraphAreaBottom","_createAxis","_moveAxis","newAxis","oldAxis","oldIndex","leftAxes","rightAxes","exportedAxes","originalAxis","seen","candidateAxis","findMatchingAxis","inValueSpacePrimary","inValueSpaceRangeGraph","_showSeries","boundCalculator","reverse","highlightedSeries","autoscaleY","boundHistory","hasNextBounds","hasPreviousBounds","tooltipState","contextMenuState","draggingY","averageLoopTime","loopTimes","averageLoopTimes","axisToName","leftCount","rightCount","showingOptions","showingSidebar","showingAnnotations","userCreatedSeries","annotationState","theme","exportMode","_exportMode","enumMap","renderer","_nonExportTheme","boundingFunction","debounceHistory","_boundingCalculatorDebouncer","_addBoundCalculatorToHistory","boundsSelectors","_customBoundsSelectors","indexedCustomBoundSelectors","registerSeriesClick","selectedSeriesIndex","setHighlightedSeries","toggleIndividualPoints","toggleYAutoscaling","toggleExportMode","setBoundsFromSelection","pixelSelection","minPixelY","maxPixelY","pow","boundCalculatorFromSelection","nextBounds","previousBounds","setLabel","toggleScale","oldScale","recalculateTooltips","setTooltipMousePosition","clientX","_tooltipClientX","clientY","_tooltipClientY","shiftKey","shiftKeyPressedOnMove","tooltipAllNext","tooltipStateArg","showOnlySavedTooltips","newMouseX","newMouseY","setContextMenuMousePosition","toggleAlwaysTooltipped","registerClick","toggleTooltipSaved","oldSavedTooltips","currentTooltips","lastTooltip","currentTooltipIndex","findIndex","clearSavedTooltips","markDragStart","finalizeDrag","draggedSeries","hasAxis","sameGrapherID","timingFrameCount","toggleShowingOptions","toggleMaxPrecision","toggleShowingAnnotations","toggleShowingSidebar","setShowing","skipResize","isX","existingIndex","indexToSet","triggerResize","useEvent","eventSource","initialState","watch","originalInitialState","setValue","useState","useEffect","updatedValue","originalUpdatedValue","usePrimarySize","useAxes","useSeries","useHighlightedSeries","useRightAxisCount","useRightAxes","useLeftAxisCount","useLeftAxes","useSelection","useAxisBounds","useAutoscaleY","useDraggingY","useShowingOptions","useMaxPrecision","useShowingSidebar","useShowingAnnotations","useSizing","useTheme","bodyHeight","validAnnotations","annotationStyle","pointMarkerWidth","approxTextWidth","textAlign","draggablePoints","onPointDrag","onDraggablePointsDoubleClick","onPointlessDoubleClick","newXT","newYT","xT","yT","stopPropagation","cx","cy","onMouseDown","xOffset","yOffset","onMouseMove","moveEvent","onMouseUp","removeEventListener","addEventListener","verticalLines","isRangeGraph","relevantVerticalLines","line","lineStyle","fontSize","textAnchor","dominantBaseline","GraphBody","boundsSelectionEnabled","showTooltips","showContextMenu","tooltipOptions","onPointClick","canvasEl","useCallback","el","boundsSelection","setBoundsSelection","start","useTooltipState","showAnnotations","useAnnotationState","useContextMenu","onScroll","onGlobalMouseMove","getTouch","touches","changedTouches","onGlobalTouchStart","touch","cancelable","closest","preventDefault","onGlobalTouchMove","onGlobalTouchEnd","passive","onMouseLeave","currentNode","classList","contains","seriesToNearestPoint","onContextMenu","placeTick","trueValue","inverted","totalSize","formatter","formatOptions","opts","scaledValue","pixelValue","placeTickByPixel","roundToDivisor","divisor","divisors","bestDelta","bestDivisor","delta","getEvenDateTickSpacing","span","desiredCount","subspan","amount","unit","placeGrid","expectedLabelSize","labelPadding","skipFirst","skipLast","paddedLabelSize","ticks","placementParams","setMinutes","setSeconds","setMilliseconds","setDate","lastDateString","tick","placeDatesGrid","tickSpacing","roundTo","getEvenTickSpacing","roundToEvenNumber","placeNumbersGrid","locals","XAxis","showAxes","showGrid","bigLabels","xTickUnit","formatXAxisLabel","useHasXEnum","useEnumMap","minDate","maxDate","calculateTimePrecision","minLabel","maxLabel","expectedLabelWidth","timeTicks","dateTicks","regularTicks","hourSpan","adjustedDate","alignedHour","currentHour","currentMinute","alignedMinute","currentSecond","alignedSecond","maxPixelForMiddleTicks","lastTick","placeTimeOnlyGrid","spanMultipleYears","customDateFormatter","startTick","endTick","placeDateOnlyGrid","xAxisHeight","marginBottom","skipGrid","singleTick","classes","timezoneLabel","YAxis","showSeriesKey","sideIndex","dragPositionYOffset","showAxisColors","sidePadding","setDraggedSeries","dragDelta","setDragDelta","dx","dy","highlightedOpacity","unhighlightedOpacity","marginLeft","opacity","edge","strokeDasharray","startDrag","startY","mouseUpEvent","dataset","grapherId","onMouseOver","onMouseOut","WindArrows","DefaultWindArrow","angle","arrowSize","strokeLinecap","strokeLinejoin","windSeries","minSpeed","maxSpeed","wind","speed","speedRange","arrows","lastArrowX","CustomArrow","Comp","direction","cos","sin","speedPercentile","display","RangeSelectionButtonBase","selected","children","description","RangeSelectionButton","currentBoundCalculator","PercentileButton","usePercentile","usePercentileAsymmetry","onChange","onKeyUp","keyCode","focusable","viewBox","Options","sidebarEnabled","useShowIndividualPoints","RangeSelection","customBoundsSelectorsOnly","rightAxisCount","leftAxisCount","marginRight","useGlobalBounds","useBoundCalculator","useBoundHistory","customBoundSelectorNames","RangeGraph","state","stopDragging","startScroll","startLeftDrag","startRightDrag","getClientX","componentDidMount","_renderer","setState","componentDidUpdate","prevProps","componentWillUnmount","_dragType","leftX","percentage","_scrollAnchorPercentage","boundToRight","boundToLeft","addListeners","forceUpdate","pixelMinX","pixelMaxX","markDates","touchAction","onTouchStart","SeriesKeyItem","backgroundColor","SeriesKeyAxisContainer","showingLabelInput","toggleLabelInputShowing","placeholder","SeriesKey","dragPosition","setDragPosition","keyRef","useRef","keyWidth","setKeyWidth","sizeCalculationHandle","current","cancelAnimationFrame","querySelectorAll","clientWidth","calculateStyles","useAlwaysTooltipped","toggleTooltipped","startDragging","seriesKeyEl","targetLeft","seriesKeyLeft","seriesKeyMarginLeft","clientStartX","clientStartY","zIndex","GraphTitle","title","SeriesToggle","checked","defaultChecked","borderColor","Sidebar","SyncPool","syncBounds","syncTooltips","syncDragState","_stateControllers","_syncBounds","_syncTooltips","_syncDragState","otherStateController","stateArg","_tooltipIgnoreState","shouldHideTooltips","random","Grapher","grapherDefaultProps","showRangeGraph","showRangeSelectors","useMemo","stateControllerInitialization","exportStateController","onRenderTime","onAxisChange","styles","classNames","calculateClassNamesAndStyles","commonYAxisProps","xAxisIntegersOnly","markRangeGraphDates","AVAILABLE_COLORS","BUILT_IN_BOUND_CALCULATORS","MultigraphStateController","_id","_multiSeries","_seriesToGraphIndices","_graphIndicesToSeries","_originalSeriesByMultigrapherIndex","_prevSeries","graphIndices","currentSeriesSet","graphIndex","sortedGraphIndices","globalSeriesIndex","multigrapherGraphIndex","_nextMultigrapherSeriesIndex","_multiSeriesCount","multiSeries","registerStateController","_multigraphStateController","check","multigrapherID","moveSeries","prevGraphCount","graphCount","_createGraphAtTop","_createGraphAtBottom","originalSeriesAtIndex","emptyAtTopIndex","emptyAtBottomIndex","incrementMultigrapherSeriesIndex","MultiGrapher","multigraphStateController","useMultiSeries","onMultiseriesChange","newUpperEnabled"],"ignoreList":[],"sourceRoot":""}
|