@windborne/grapher 1.0.41 → 1.0.42

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.
@@ -1 +1 @@
1
- {"version":3,"file":"bundle.cjs","mappings":"UAAIA,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,WAAW,QAAS,CAC5B,MAAMC,EAAUH,EAAMI,MAAM,kCAC5B,GAAID,EAAS,CACX,MAAO,CAAEE,EAAGC,EAAGC,GAAKJ,EACpB,MAAQ,QAAOE,MAAMC,MAAMC,MAAMN,IACnC,CACF,CAEA,GAAID,EAAME,WAAW,KAAM,CACzB,IAAIQ,EAAMV,EAAMW,MAAM,GAUtB,OATmB,IAAfD,EAAIb,SACNa,EAAMA,EACHE,MAAM,IACNC,KAAKC,GAASA,EAAOA,IACrBC,KAAK,KAKF,QAHEC,SAASN,EAAIC,MAAM,EAAG,GAAI,QAC1BK,SAASN,EAAIC,MAAM,EAAG,GAAI,QAC1BK,SAASN,EAAIC,MAAM,EAAG,GAAI,QACHV,IACnC,CAEA,OAAOD,CACT,CAQO,SAASiB,EAA8BC,EAAUjB,GACtD,OAAKiB,GAAaC,MAAM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AAMipD,sBAAsByC,EAA0B,GACtF,CAACA,EAA2B1rD,EAAMipD,yBAErC9S,EAAAA,EAAAA,YAAU,KACNuV,EAA0B/mB,UAAU3kC,EAAMoN,OAAO,GAClD,CAACs+C,EAA2B1rD,EAAMoN,UAErC+oC,EAAAA,EAAAA,YAAU,IACDn2C,EAAM4rD,qBAIXF,EAA0B/6C,GAAG,uBAAwB3Q,EAAM4rD,qBACpD,KACHF,EAA0B36C,IAAI,uBAAwB/Q,EAAM4rD,oBAAoB,GALzE,QAOZ,CAACF,EAA2B1rD,EAAM4rD,sBAErC,MAAMjb,EAAYqG,GAAa0U,GAE/B,OACIj3B,IAAAA,cAAA,OAAK6B,UAAU,gBAEPqa,GAAa3wC,EAAM6rD,iBACfp3B,IAAAA,cAAA,OAAK6B,UAAY,uBAAsBt2B,EAAMuxC,QAAS,kBAAkB,gBAAewZ,SAAsB,eAMjHJ,EAAY1tD,KAAI,CAACmQ,EAAQrR,IACrB04B,IAAAA,cAACk0B,GAAOpyB,GAAA,CACJ/vB,IAAKzK,GACDiE,EAAK,CACT8gC,SAAUA,EACVkoB,8BAA+B0C,EAA0B1C,8BACzD57C,OAAQA,EACRpP,GAAK,gBAAe+sD,KAAkBhvD,IACtCklD,oBAAqBjhD,EAAM6rD,gBAAkB,GAAK,EAClD5C,sBAAuB2B,OAM/Bja,GACAlc,IAAAA,cAAA,OAAK6B,UAAY,uBAAsBt2B,EAAMuxC,QAAS,kBAAkB,gBAAewZ,YAAyB,eAMhI,CAEAU,GAAaj1B,aAAe,CACxB+a,MAAO,SAGXka,GAAa/2B,UAAYhuB,OAAOk0B,OAAO,CAAC,EAAG+tB,GAAQj0B,UAAW,CAC1DqzB,WAAY/lD,IAAAA,KACZgmD,aAAchmD,IAAAA,KACd6pD,gBAAiB7pD,IAAAA,KACjB4pD,oBAAqB5pD,IAAAA,M","sources":["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/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\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 .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 .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 .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\":\"AAs8BA,eAv4BE,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,CACA,uBAAA,CAKN,gFACE,UAAA,CACA,gBAAA,CAIJ,2BACE,iBAAA,CACA,mBAAA,CACA,iBAAA,CAEA,wCACE,oBAAA,CACA,eA7H8B,CA8H9B,YAzHgB,CA0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FACE,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 .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/\";","__webpack_require__.b = 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 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 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 \n // Determine if this path segment is positive or negative for gradient application\n let isPositive = true;\n if (hasNegatives && negativeGradient && path.length > 0) {\n // Check the average Y position of the path to determine if it's above or below zero\n let sumY = 0;\n for (let i = 0; i < path.length; i++) {\n sumY += path[i][1];\n }\n const avgY = sumY / path.length;\n isPositive = avgY <= zero; // In screen coordinates, smaller Y is higher up (positive)\n }\n \n // Set the fill style based on whether this is a positive or negative segment\n if (hasNegatives && negativeGradient) {\n if (isPositive) {\n // Use the original gradient or color for positive areas\n if (gradient && gradient.length >= 2) {\n const globalGradient = context.createLinearGradient(0, 0, 0, sizing.renderHeight);\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 context.fillStyle = color;\n }\n } else {\n // Use negativeGradient for negative areas\n if (negativeGradient.length >= 2) {\n const negGradient = context.createLinearGradient(0, 0, 0, sizing.renderHeight);\n for (let i = 0; i < negativeGradient.length; i++) {\n const value = negativeGradient[i];\n if (Array.isArray(value)) {\n negGradient.addColorStop(value[0], value[1]);\n } else {\n negGradient.addColorStop(i / (negativeGradient.length - 1), value);\n }\n }\n context.fillStyle = negGradient;\n } else {\n context.fillStyle = negativeColor || color;\n }\n }\n }\n \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 cutoffTimeValue,\n cutoffOpacity,\n originalData,\n selectionBounds,\n isPreview,\n }\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 =\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, 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 transform = `translate(${pixelX},${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 transform,\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, transform, baseLeft, commonLabelProps, yTranslation, multiplier, textLeft, textTop } = tooltip;\n\n if (this.props.customTooltip || groupedTooltips) {\n return (\n <g key={i} transform={transform} 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={transform} />\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} transform={transform} className=\"tooltip-item\">\n <circle r={4} fill={color} />\n\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 );\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 inDataSpace = {\n tuples: tuplesToDataSpace,\n values: valuesToDataSpace,\n objects: objectsToDataSpace\n }[type](options.data || singleSeries.simpleData || singleSeries.data, singleSeries, options);\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 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 if (!series.xKey || typeof series.xKey !== 'string') {\n throw new Error('xKey must be provided in the series');\n }\n\n if (!series.yKey || typeof series.yKey !== 'string') {\n throw new Error('yKey must be provided in the series');\n }\n\n const inDataSpace = [];\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 (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 = point[series.yKey];\n if (yValue === undefined) {\n yValue = null;\n }\n\n let xValue = point[series.xKey];\n if (typeof xValue === 'string') {\n xValue = new Date(xValue);\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 inDataSpace.push([xValue, yValue]);\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') {\n bounds[key] = 0;\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}={}) {\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 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}={}) {\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});\n }\n\n let dates = false;\n let prevX = null;\n\n for (let [x, y] of inDataSpace) {\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 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 (mergedBounds.minX === null || minX < mergedBounds.minX) {\n mergedBounds.minX = minX;\n }\n\n if (mergedBounds.maxX === null || maxX > mergedBounds.maxX) {\n mergedBounds.maxX = maxX;\n }\n\n if (mergedBounds.closestSpacing === null || closestSpacing < mergedBounds.closestSpacing) {\n mergedBounds.closestSpacing = closestSpacing;\n }\n\n if (mergedBounds.minY === null || minY < mergedBounds.minY) {\n mergedBounds.minY = minY;\n }\n\n if (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 = midpoint - 1.05*range/2;\n expandedBounds.maxY = midpoint + 1.05*range/2;\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 tooltips.push({\n pixelWidth: sizing.elementWidth,\n pixelX: pixelX,\n pixelY: isNaN(pixelY) ? sizing.elementHeight/2 : pixelY,\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 singleSeries.inDataSpace = simpleSeriesToDataSpace({\n ...singleSeries,\n data: simpleData\n }, {\n stateController: this\n });\n singleSeries.simpleDataSliceStart = simpleData.length;\n singleSeries.dataBounds = calculateDataBounds(singleSeries.inDataSpace);\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 axis.currentBounds = axis.targetBounds;\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\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 monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n const d = new Date(date);\n const month = monthNames[d.getMonth()];\n const day = d.getDate();\n const year = d.getFullYear();\n \n if (spanMultipleYears) {\n return `${month} ${day} ${year}`;\n } else {\n return `${month} ${day}`;\n }\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';\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 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 <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","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","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","timeout","nc","src","onScriptComplete","prev","event","onerror","onload","clearTimeout","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","xUnixDates","xLabel","yLabel","ignoreDiscontinuities","dashed","dashPattern","width","rangeSelectorWidth","axis","expandYWith","defaultAlwaysTooltipped","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","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","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","isPositive","sumY","negGradient","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","fixedPosition","multiplier","caretSize","isFinite","transform","commonLabelProps","maxPrecision","baseLeft","yTranslation","axisCount","caretPadding","Boolean","CustomTooltipComponent","groupedTooltips","combinationThreshold","added","group","totalHeight","maxWidth","sort","className","_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","originalXValue","enumToNumber","valueXStart","readBinaryFormatValue","view","getUint32","BYTES_PER_ELEMENT","getUint8","getFloat64","buffer","ArrayBuffer","DataView","xIndex","channels","yIndex","offsets","subpoint","finalizeBounds","initial","calculateDataBounds","percentile","percentileAsymmetry","sortedByY","_x","_x1","_x2","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","sqrt","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","unsavedTooltips","unsavedTooltipsCount","calculateTooltipState","_tooltipAllNext","_globalBounds","_tooltipStateArg","newX","right","shownSeries","xRange","annotation","seriesName","isRange","isPoint","xStartValue","xEndValue","convertToNumber","val","pixelStartX","pixelEndX","calculateAnnotationsState","_expandYWith","dataBoundsList","simpleDataSliceStart","dataBounds","_dataBounds","_recalculateSelection","disableSwap","selectedBounds","selectedBoundsAreaTop","selectedBoundsAreaBottom","inSelectedSpaceAreaBottom","_recalculateAxisBounds","modifiedSeries","newData","modifiedAxes","modifiedSeriesAndDependents","newDataInDataSpace","newDataBounds","newPointCount","previousSelection","newSelectedData","fixedY","targetBounds","byAxis","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","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","useSelection","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","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"],"sourceRoot":""}
1
+ {"version":3,"file":"bundle.cjs","mappings":"UAAIA,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,EA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0B,GAAOpyB,GAAA,CACJ/vB,IAAKzK,GACDiE,EAAK,CACT8gC,SAAUA,EACVkoB,8BAA+B0C,EAA0B1C,8BACzD57C,OAAQA,EACRpP,GAAK,gBAAe+sD,KAAkBhvD,IACtCklD,oBAAqBjhD,EAAM6rD,gBAAkB,GAAK,EAClD5C,sBAAuB2B,OAM/Bja,GACAlc,IAAAA,cAAA,OAAK6B,UAAY,uBAAsBt2B,EAAMuxC,QAAS,kBAAkB,gBAAewZ,YAAyB,eAMhI,CAEAU,GAAaj1B,aAAe,CACxB+a,MAAO,SAGXka,GAAa/2B,UAAYhuB,OAAOk0B,OAAO,CAAC,EAAG+tB,GAAQj0B,UAAW,CAC1DqzB,WAAY/lD,IAAAA,KACZgmD,aAAchmD,IAAAA,KACd6pD,gBAAiB7pD,IAAAA,KACjB4pD,oBAAqB5pD,IAAAA,M","sources":["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/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\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 .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 .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 .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\":\"AAs8BA,eAv4BE,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,CAoCj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CACE,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 .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/\";","__webpack_require__.b = 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 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 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 \n // Determine if this path segment is positive or negative for gradient application\n let isPositive = true;\n if (hasNegatives && negativeGradient && path.length > 0) {\n // Check the average Y position of the path to determine if it's above or below zero\n let sumY = 0;\n for (let i = 0; i < path.length; i++) {\n sumY += path[i][1];\n }\n const avgY = sumY / path.length;\n isPositive = avgY <= zero; // In screen coordinates, smaller Y is higher up (positive)\n }\n \n // Set the fill style based on whether this is a positive or negative segment\n if (hasNegatives && negativeGradient) {\n if (isPositive) {\n // Use the original gradient or color for positive areas\n if (gradient && gradient.length >= 2) {\n const globalGradient = context.createLinearGradient(0, 0, 0, sizing.renderHeight);\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 context.fillStyle = color;\n }\n } else {\n // Use negativeGradient for negative areas\n if (negativeGradient.length >= 2) {\n const negGradient = context.createLinearGradient(0, 0, 0, sizing.renderHeight);\n for (let i = 0; i < negativeGradient.length; i++) {\n const value = negativeGradient[i];\n if (Array.isArray(value)) {\n negGradient.addColorStop(value[0], value[1]);\n } else {\n negGradient.addColorStop(i / (negativeGradient.length - 1), value);\n }\n }\n context.fillStyle = negGradient;\n } else {\n context.fillStyle = negativeColor || color;\n }\n }\n }\n \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 cutoffTimeValue,\n cutoffOpacity,\n originalData,\n selectionBounds,\n isPreview,\n }\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 =\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, 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 transform = `translate(${pixelX},${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 transform,\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, transform, baseLeft, commonLabelProps, yTranslation, multiplier, textLeft, textTop } = tooltip;\n\n if (this.props.customTooltip || groupedTooltips) {\n return (\n <g key={i} transform={transform} 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={transform} />\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} transform={transform} className=\"tooltip-item\">\n <circle r={4} fill={color} />\n\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 );\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 inDataSpace = {\n tuples: tuplesToDataSpace,\n values: valuesToDataSpace,\n objects: objectsToDataSpace\n }[type](options.data || singleSeries.simpleData || singleSeries.data, singleSeries, options);\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 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 if (!series.xKey || typeof series.xKey !== 'string') {\n throw new Error('xKey must be provided in the series');\n }\n\n if (!series.yKey || typeof series.yKey !== 'string') {\n throw new Error('yKey must be provided in the series');\n }\n\n const inDataSpace = [];\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 (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 = point[series.yKey];\n if (yValue === undefined) {\n yValue = null;\n }\n\n let xValue = point[series.xKey];\n if (typeof xValue === 'string') {\n xValue = new Date(xValue);\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 inDataSpace.push([xValue, yValue]);\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') {\n bounds[key] = 0;\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}={}) {\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 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}={}) {\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});\n }\n\n let dates = false;\n let prevX = null;\n\n for (let [x, y] of inDataSpace) {\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 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 (mergedBounds.minX === null || minX < mergedBounds.minX) {\n mergedBounds.minX = minX;\n }\n\n if (mergedBounds.maxX === null || maxX > mergedBounds.maxX) {\n mergedBounds.maxX = maxX;\n }\n\n if (mergedBounds.closestSpacing === null || closestSpacing < mergedBounds.closestSpacing) {\n mergedBounds.closestSpacing = closestSpacing;\n }\n\n if (mergedBounds.minY === null || minY < mergedBounds.minY) {\n mergedBounds.minY = minY;\n }\n\n if (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 = midpoint - 1.05*range/2;\n expandedBounds.maxY = midpoint + 1.05*range/2;\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 tooltips.push({\n pixelWidth: sizing.elementWidth,\n pixelX: pixelX,\n pixelY: isNaN(pixelY) ? sizing.elementHeight/2 : pixelY,\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 singleSeries.inDataSpace = simpleSeriesToDataSpace({\n ...singleSeries,\n data: simpleData\n }, {\n stateController: this\n });\n singleSeries.simpleDataSliceStart = simpleData.length;\n singleSeries.dataBounds = calculateDataBounds(singleSeries.inDataSpace);\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 axis.currentBounds = axis.targetBounds;\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\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';\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 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 <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","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","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","timeout","nc","src","onScriptComplete","prev","event","onerror","onload","clearTimeout","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","xUnixDates","xLabel","yLabel","ignoreDiscontinuities","dashed","dashPattern","width","rangeSelectorWidth","axis","expandYWith","defaultAlwaysTooltipped","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","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","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","isPositive","sumY","negGradient","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","fixedPosition","multiplier","caretSize","isFinite","transform","commonLabelProps","maxPrecision","baseLeft","yTranslation","axisCount","caretPadding","Boolean","CustomTooltipComponent","groupedTooltips","combinationThreshold","added","group","totalHeight","maxWidth","sort","className","_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","originalXValue","enumToNumber","valueXStart","readBinaryFormatValue","view","getUint32","BYTES_PER_ELEMENT","getUint8","getFloat64","buffer","ArrayBuffer","DataView","xIndex","channels","yIndex","offsets","subpoint","finalizeBounds","initial","calculateDataBounds","percentile","percentileAsymmetry","sortedByY","_x","_x1","_x2","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","sqrt","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","unsavedTooltips","unsavedTooltipsCount","calculateTooltipState","_tooltipAllNext","_globalBounds","_tooltipStateArg","newX","right","shownSeries","xRange","annotation","seriesName","isRange","isPoint","xStartValue","xEndValue","convertToNumber","val","pixelStartX","pixelEndX","calculateAnnotationsState","_expandYWith","dataBoundsList","simpleDataSliceStart","dataBounds","_dataBounds","_recalculateSelection","disableSwap","selectedBounds","selectedBoundsAreaTop","selectedBoundsAreaBottom","inSelectedSpaceAreaBottom","_recalculateAxisBounds","modifiedSeries","newData","modifiedAxes","modifiedSeriesAndDependents","newDataInDataSpace","newDataBounds","newPointCount","previousSelection","newSelectedData","fixedY","targetBounds","byAxis","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","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","useSelection","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","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"],"sourceRoot":""}