@windborne/grapher 1.0.31 → 1.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.cjs +1 -1
- package/dist/bundle.cjs.map +1 -1
- package/dist/bundle.esm.js +1 -1
- package/dist/bundle.esm.js.map +1 -1
- package/package.json +1 -1
- package/readme.md +4 -2
- package/src/helpers/custom_prop_types.js +3 -2
- package/src/index.d.ts +1 -0
- package/src/renderer/draw_area.js +64 -9
- package/src/renderer/draw_line.js +69 -8
- package/src/renderer/graph_body_renderer.js +59 -3
- package/src/renderer/shadow_program.js +106 -57
- package/src/state/calculate_tooltip_state.js +13 -0
package/dist/bundle.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.cjs","mappings":"UAAIA,EACAC,E,8ECEAC,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,ki6CAAmi6C,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,gCAAgC,MAAQ,GAAG,SAAW,mvaAAmva,eAAiB,CAAC,gkvBAAgkvB,WAAa,MAE/+jF,S,uBCDAD,EAAOE,QAAU,SAAUC,GACzB,IAAIC,EAAO,GA4EX,OAzEAA,EAAKC,SAAW,WACd,OAAOC,KAAKC,KAAI,SAAUC,GACxB,IAAIC,EAAU,GACVC,OAA+B,IAAZF,EAAK,GAoB5B,OAnBIA,EAAK,KACPC,GAAW,cAAcE,OAAOH,EAAK,GAAI,QAEvCA,EAAK,KACPC,GAAW,UAAUE,OAAOH,EAAK,GAAI,OAEnCE,IACFD,GAAW,SAASE,OAAOH,EAAK,GAAGI,OAAS,EAAI,IAAID,OAAOH,EAAK,IAAM,GAAI,OAE5EC,GAAWN,EAAuBK,GAC9BE,IACFD,GAAW,KAETD,EAAK,KACPC,GAAW,KAETD,EAAK,KACPC,GAAW,KAENA,CACT,IAAGI,KAAK,GACV,EAGAT,EAAKU,EAAI,SAAWC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U,KACNqV,EAA0B3mB,UAAUtlC,EAAMwN,OAAO,GAClD,CAACy+C,EAA2BjsD,EAAMwN,UAErCopC,EAAAA,EAAAA,YAAU,IACD52C,EAAMmsD,qBAIXF,EAA0Bl7C,GAAG,uBAAwB/Q,EAAMmsD,qBACpD,KACHF,EAA0B96C,IAAI,uBAAwBnR,EAAMmsD,oBAAoB,GALzE,QAOZ,CAACF,EAA2BjsD,EAAMmsD,sBAErC,MAAM/a,EAAYqG,GAAawU,GAE/B,OACI32B,IAAAA,cAAA,OAAK6B,UAAU,gBAEPia,GAAapxC,EAAMosD,iBACf92B,IAAAA,cAAA,OAAK6B,UAAY,uBAAsBn3B,EAAMgyC,QAAS,kBAAkB,gBAAesZ,SAAsB,eAMjHJ,EAAYjtD,KAAI,CAACuP,EAAQhP,IACrB82B,IAAAA,cAAC4zB,GAAO9xB,GAAA,CACJ3wB,IAAKjI,GACDwB,EAAK,CACTyhC,SAAUA,EACV8nB,8BAA+B0C,EAA0B1C,8BACzD/7C,OAAQA,EACR7P,GAAK,gBAAe2tD,KAAkB9sD,IACtCgjD,oBAAqBxhD,EAAMosD,gBAAkB,GAAK,EAClD5C,sBAAuB2B,OAM/B/Z,GACA9b,IAAAA,cAAA,OAAK6B,UAAY,uBAAsBn3B,EAAMgyC,QAAS,kBAAkB,gBAAesZ,YAAyB,eAMhI,CAEAU,GAAa30B,aAAe,CACxB2a,MAAO,SAGXga,GAAaz2B,UAAY5uB,OAAO80B,OAAO,CAAC,EAAGytB,GAAQ3zB,UAAW,CAC1D+yB,WAAYtmD,IAAAA,KACZumD,aAAcvmD,IAAAA,KACdoqD,gBAAiBpqD,IAAAA,KACjBmqD,oBAAqBnqD,IAAAA,M","sources":["webpack://Grapher/webpack/runtime/load script","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/helpers/colors.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};","// 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(0,0,0,.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(0,0,0,.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\":\"AAo8BA,eAr4BE,iBAAA,CACA,6DAAA,CACA,YAPU,CASV,sBAAA,CACA,cAAA,CACA,kBAAA,CAEA,8DACE,sBAAA,CAGF,8BACE,iBAAA,CACA,UA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,YAAA,CACA,oBA+K6C,CA1K/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,UAmI0B\",\"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-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-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, // only applies to bar\n gradient: PropTypes.array, // only applies to area\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","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","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 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 areaPaths = pathsFrom(dataInRenderSpace);\n const areaBottomPaths =\n inRenderSpaceAreaBottom && pathsFrom(inRenderSpaceAreaBottom);\n\n const linePaths = pathsFrom(dataInRenderSpace, {\n splitAtY: zero,\n });\n\n if (renderCutoffGradient && cutoffIndex !== undefined && originalData) {\n drawAreaWithCutoff(\n individualPoints,\n areaPaths,\n areaBottomPaths,\n linePaths,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n showIndividualPoints,\n negativeColor,\n pointRadius,\n width,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n cutoffIndex,\n cutoffOpacity,\n originalData,\n selectionBounds,\n isPreview,\n }\n );\n return;\n }\n\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n context.beginPath();\n\n const [firstX, _startY] = path[0];\n const [lastX, _lastY] = path[path.length - 1];\n\n if (!areaBottomPaths) {\n context.moveTo(firstX, areaBottom);\n }\n\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n context.lineTo(x, y);\n }\n\n if (areaBottomPath && areaBottomPath.length) {\n for (let i = areaBottomPath.length - 1; i >= 0; i--) {\n const [x, y] = areaBottomPath[i];\n context.lineTo(x, y);\n }\n\n context.lineTo(...path[0]);\n } else {\n context.lineTo(lastX, areaBottom);\n }\n\n context.fill();\n }\n\n if (highlighted) {\n width += 2;\n }\n\n width *= DPI_INCREASE;\n context.strokeStyle = color;\n context.lineWidth = width;\n\n for (let path of linePaths) {\n if (!path.length) {\n continue;\n }\n\n if (hasNegatives) {\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 }\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 context.fillStyle = color;\n\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 if (negativeColor && hasNegatives) {\n if (y === zero && zeroColor) {\n context.fillStyle = zeroColor;\n } else if (y < zero) {\n context.fillStyle = color;\n } else {\n context.fillStyle = negativeColor;\n }\n }\n\n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n }\n}\n\n/**\n * Draws the data on the canvas with cutoff\n * Assumes the data is in individual point render space, ie x and y in pixels\n *\n * @param {Array<[number, number]>} individualPoints - data to draw\n * @param {Object} options - set of options\n * @param {Object} options.context - the context to draw on\n * @param {String} options.color - color of the area to draw\n * @param {{renderWidth: Number, renderHeight: Number}} options.sizing - size of the canvas, in pixels\n * @param {Number} options.zero - y coordinate that represents \"zero\"\n * @param {Boolean} options.hasNegatives - if any values are negative (in which case should render from zero)\n * @param {Array<String>} [options.gradient] - an array of stops, from top to bottom of canvas, to draw with\n * @param {String} [options.zeroColor] - color of the zero line\n * @param {Number} [options.zeroWidth] - width of the zero line\n * @param {Boolean} [options.showIndividualPoints] - draw circles at each point\n * @param {String} [options.negativeColor] - color of the area below zero\n * @param {Number} [options.width] - line width\n * @param {Object} [options.inRenderSpaceAreaBottom] - if provided, will use this as the area bottom instead of zero/sizing.renderHeight\n * @private\n */\nfunction drawAreaWithCutoff(\n individualPoints,\n areaPaths,\n areaBottomPaths,\n linePaths,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n showIndividualPoints,\n negativeColor,\n pointRadius,\n width,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n cutoffIndex,\n cutoffOpacity,\n originalData,\n selectionBounds,\n isPreview,\n }\n) {\n let cutoffTime;\n if (typeof originalData[0] === \"object\" && originalData[0].length === 2) {\n const baseIndex = Math.floor(cutoffIndex);\n const fraction = cutoffIndex - baseIndex;\n\n if (fraction === 0 || baseIndex >= originalData.length - 1) {\n const cutoffDate =\n originalData[Math.min(baseIndex, originalData.length - 1)][0];\n cutoffTime =\n cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n } else {\n const currentDate = originalData[baseIndex][0];\n const nextDate = originalData[baseIndex + 1][0];\n const currentTime =\n currentDate instanceof Date ? currentDate.getTime() : currentDate;\n const nextTime = nextDate instanceof Date ? nextDate.getTime() : nextDate;\n cutoffTime = currentTime + fraction * (nextTime - currentTime);\n }\n } else {\n cutoffTime = cutoffIndex;\n }\n\n let firstTime, lastTime;\n if (isPreview && selectionBounds) {\n firstTime = selectionBounds.minX instanceof Date ? selectionBounds.minX.getTime() : selectionBounds.minX;\n lastTime = selectionBounds.maxX instanceof Date ? selectionBounds.maxX.getTime() : selectionBounds.maxX;\n } else {\n firstTime = originalData[0][0] instanceof Date ? originalData[0][0].getTime() : originalData[0][0];\n lastTime = originalData[originalData.length - 1][0] instanceof Date ? \n originalData[originalData.length - 1][0].getTime() : originalData[originalData.length - 1][0];\n }\n\n const timeRatio = (cutoffTime - firstTime) / (lastTime - firstTime);\n\n if (timeRatio < 0) {\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n renderEntireArea(path, areaBottomPath, {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n } else if (timeRatio > 1) {\n const reducedOpacityGradient = gradient\n ? applyReducedOpacityToGradient(gradient, cutoffOpacity)\n : null;\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n renderEntireArea(path, areaBottomPath, {\n color: applyReducedOpacity(color, cutoffOpacity),\n context,\n sizing,\n zero,\n hasNegatives,\n gradient: reducedOpacityGradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n } else {\n if (isPreview) {\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n if (!path.length) {\n continue;\n }\n\n const renderCutoffIndex = timeRatio * path.length;\n const splitIndex = Math.floor(renderCutoffIndex);\n const fraction = renderCutoffIndex - splitIndex;\n\n let ghostPoint = null;\n if (splitIndex < path.length - 1 && fraction > 0) {\n const [x1, y1] = path[splitIndex];\n const [x2, y2] = path[splitIndex + 1];\n ghostPoint = [x1 + fraction * (x2 - x1), y1 + fraction * (y2 - y1)];\n }\n\n const shouldRenderPre =\n splitIndex > 0 || (splitIndex === 0 && fraction > 0);\n\n if (shouldRenderPre) {\n const preCutoffPath = path.slice(0, splitIndex + 1);\n if (ghostPoint && splitIndex < path.length - 1) {\n preCutoffPath.push(ghostPoint);\n }\n\n const preCutoffAreaBottomPath = areaBottomPath\n ? areaBottomPath.slice(0, splitIndex + 1)\n : null;\n if (\n ghostPoint &&\n preCutoffAreaBottomPath &&\n splitIndex < areaBottomPath.length - 1\n ) {\n const bottomGhostPoint = [ghostPoint[0], zero];\n preCutoffAreaBottomPath.push(bottomGhostPoint);\n }\n\n const reducedOpacityGradient = gradient\n ? applyReducedOpacityToGradient(gradient, cutoffOpacity)\n : null;\n renderEntireArea(preCutoffPath, preCutoffAreaBottomPath, {\n color: applyReducedOpacity(color, cutoffOpacity),\n context,\n sizing,\n zero,\n hasNegatives,\n gradient: reducedOpacityGradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n\n const shouldRenderPost =\n splitIndex < path.length - 1 ||\n (splitIndex === path.length - 1 && fraction === 0);\n\n if (shouldRenderPost) {\n const postCutoffPath = [];\n if (ghostPoint && splitIndex < path.length - 1) {\n postCutoffPath.push(ghostPoint);\n }\n postCutoffPath.push(...path.slice(splitIndex + 1));\n\n const postCutoffAreaBottomPath = [];\n if (\n ghostPoint &&\n areaBottomPath &&\n splitIndex < areaBottomPath.length - 1\n ) {\n const bottomGhostPoint = [ghostPoint[0], zero];\n postCutoffAreaBottomPath.push(bottomGhostPoint);\n }\n if (areaBottomPath) {\n postCutoffAreaBottomPath.push(\n ...areaBottomPath.slice(splitIndex + 1)\n );\n }\n\n renderEntireArea(\n postCutoffPath,\n postCutoffAreaBottomPath.length ? postCutoffAreaBottomPath : null,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n }\n );\n }\n }\n\n if (linePaths && linePaths.length > 0) {\n drawLinesWithCutoff(linePaths, timeRatio, {\n color,\n context,\n hasNegatives,\n negativeColor,\n zero,\n width,\n highlighted,\n cutoffOpacity,\n });\n }\n\n if (\n showIndividualPoints &&\n individualPoints &&\n individualPoints.length > 0\n ) {\n drawPointsWithCutoffByRatio(individualPoints, timeRatio, {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n cutoffOpacity,\n });\n }\n } else {\n if (!selectionBounds) {\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n renderEntireArea(path, areaBottomPath, {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n } else {\n const visibleMinTime =\n selectionBounds.minX instanceof Date\n ? selectionBounds.minX.getTime()\n : selectionBounds.minX;\n const visibleMaxTime =\n selectionBounds.maxX instanceof Date\n ? selectionBounds.maxX.getTime()\n : selectionBounds.maxX;\n\n if (cutoffTime < visibleMinTime) {\n // cutoff before visible range - render entire area normally\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n renderEntireArea(path, areaBottomPath, {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n } else if (cutoffTime > visibleMaxTime) {\n // cutoff after visible range - render entire area with reduced opacity\n const reducedOpacityGradient = gradient\n ? applyReducedOpacityToGradient(gradient, cutoffOpacity)\n : null;\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n renderEntireArea(path, areaBottomPath, {\n color: applyReducedOpacity(color, cutoffOpacity),\n context,\n sizing,\n zero,\n hasNegatives,\n gradient: reducedOpacityGradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n } else {\n // cutoff within visible range - calculate position relative to visible bounds\n const visibleTimeRatio =\n (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n if (!path.length) {\n continue;\n }\n\n const renderCutoffIndex = visibleTimeRatio * path.length;\n const splitIndex = Math.floor(renderCutoffIndex);\n const fraction = renderCutoffIndex - splitIndex;\n\n // create ghost point for continuity if needed\n let ghostPoint = null;\n if (splitIndex < path.length - 1 && fraction > 0) {\n const [x1, y1] = path[splitIndex];\n const [x2, y2] = path[splitIndex + 1];\n ghostPoint = [\n x1 + fraction * (x2 - x1),\n y1 + fraction * (y2 - y1),\n ];\n }\n\n // render pre-cutoff area with reduced opacity\n const shouldRenderPre =\n splitIndex > 0 || (splitIndex === 0 && fraction > 0);\n\n if (shouldRenderPre) {\n renderAreaSegment(\n path,\n areaBottomPath,\n splitIndex,\n ghostPoint,\n true,\n {\n color: applyReducedOpacity(color, cutoffOpacity),\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n areaBottomPaths,\n }\n );\n }\n\n // render post-cutoff area with normal opacity\n const shouldRenderPost = splitIndex < path.length - 1;\n\n if (shouldRenderPost) {\n renderAreaSegment(\n path,\n areaBottomPath,\n splitIndex,\n ghostPoint,\n false,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n areaBottomPaths,\n }\n );\n }\n }\n }\n }\n }\n\n // draw outline lines with cutoff\n if (timeRatio >= 0 && timeRatio <= 1 && !isPreview) {\n if (selectionBounds) {\n const visibleMinTime =\n selectionBounds.minX instanceof Date\n ? selectionBounds.minX.getTime()\n : selectionBounds.minX;\n const visibleMaxTime =\n selectionBounds.maxX instanceof Date\n ? selectionBounds.maxX.getTime()\n : selectionBounds.maxX;\n\n // test case time\n if (cutoffTime < visibleMinTime) {\n // cutoff before visible range - draw lines normally\n drawLinesNormally(linePaths, {\n color,\n context,\n hasNegatives,\n negativeColor,\n width,\n highlighted,\n });\n } else if (cutoffTime > visibleMaxTime) {\n // cutoff after visible range - draw lines with reduced opacity (to match area)\n const reducedColor = applyReducedOpacity(color, cutoffOpacity);\n const reducedNegativeColor = negativeColor\n ? applyReducedOpacity(negativeColor, cutoffOpacity)\n : negativeColor;\n drawLinesNormally(linePaths, {\n color: reducedColor,\n context,\n hasNegatives,\n negativeColor: reducedNegativeColor,\n width,\n highlighted,\n });\n } else {\n // cutoff within visible range - split lines at cutoff\n const visibleTimeRatio =\n (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n drawLinesWithCutoff(linePaths, visibleTimeRatio, {\n color,\n context,\n hasNegatives,\n negativeColor,\n zero,\n width,\n highlighted,\n cutoffOpacity,\n });\n }\n } else {\n // no bounds available - draw lines normally\n drawLinesNormally(linePaths, {\n color,\n context,\n hasNegatives,\n negativeColor,\n width,\n highlighted,\n });\n }\n } else if (!isPreview) {\n // draw lines normally without cutoff\n drawLinesNormally(linePaths, {\n color,\n context,\n hasNegatives,\n negativeColor,\n width,\n highlighted,\n });\n }\n\n // draw other elements (zero line, points) normally\n if (zeroWidth) {\n const areaBottom = hasNegatives ? zero : sizing.renderHeight;\n drawZeroLine(areaBottom, {\n context,\n sizing,\n color,\n zero,\n zeroColor,\n zeroWidth,\n });\n }\n\n if (showIndividualPoints && !isPreview) {\n if (timeRatio >= 0 && timeRatio <= 1) {\n if (selectionBounds) {\n const visibleMinTime =\n selectionBounds.minX instanceof Date\n ? selectionBounds.minX.getTime()\n : selectionBounds.minX;\n const visibleMaxTime =\n selectionBounds.maxX instanceof Date\n ? selectionBounds.maxX.getTime()\n : selectionBounds.maxX;\n\n //test case time\n if (cutoffTime < visibleMinTime) {\n // cutoff before visible range - draw points normally\n drawPointsNormally(individualPoints, {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n });\n } else if (cutoffTime > visibleMaxTime) {\n // cutoff after visible range - draw points with reduced opacity\n const reducedColor = applyReducedOpacity(color, cutoffOpacity);\n const reducedNegativeColor = negativeColor\n ? applyReducedOpacity(negativeColor, cutoffOpacity)\n : negativeColor;\n const reducedZeroColor = zeroColor\n ? applyReducedOpacity(zeroColor, cutoffOpacity)\n : zeroColor;\n drawPointsNormally(individualPoints, {\n color: reducedColor,\n context,\n negativeColor: reducedNegativeColor,\n hasNegatives,\n zero,\n zeroColor: reducedZeroColor,\n pointRadius,\n });\n } else {\n // cutoff within visible range - split points at cutoff\n const visibleTimeRatio =\n (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n drawPointsWithCutoffByRatio(individualPoints, visibleTimeRatio, {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n cutoffOpacity,\n });\n }\n } else {\n // no bounds available - draw points normally\n drawPointsNormally(individualPoints, {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n });\n }\n } else {\n // cutoff outside data range - draw points normally\n drawPointsNormally(individualPoints, {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n });\n }\n } \n }\n}\n\nfunction renderEntireArea(\n path,\n areaBottomPath,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n }\n) {\n context.fillStyle = color;\n\n if (gradient && gradient.length >= 2) {\n const globalGradient = context.createLinearGradient(\n 0,\n 0,\n 0,\n sizing.renderHeight\n );\n for (let i = 0; i < gradient.length; i++) {\n const value = gradient[i];\n if (Array.isArray(value)) {\n globalGradient.addColorStop(value[0], value[1]);\n } else {\n globalGradient.addColorStop(i / (gradient.length - 1), value);\n }\n }\n context.fillStyle = globalGradient;\n } else {\n }\n\n const areaBottom = hasNegatives ? zero : sizing.renderHeight;\n\n context.beginPath();\n\n const [firstX, _startY] = path[0];\n const [lastX, _lastY] = path[path.length - 1];\n\n if (!areaBottomPath) {\n context.moveTo(firstX, areaBottom);\n }\n\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n context.lineTo(x, y);\n }\n\n if (areaBottomPath && areaBottomPath.length) {\n for (let i = areaBottomPath.length - 1; i >= 0; i--) {\n const [x, y] = areaBottomPath[i];\n context.lineTo(x, y);\n }\n context.lineTo(...path[0]);\n } else {\n context.lineTo(lastX, areaBottom);\n }\n\n context.fill();\n}\n\nfunction renderAreaSegment(\n path,\n areaBottomPath,\n splitIndex,\n ghostPoint,\n isPreCutoff,\n { color, context, sizing, zero, hasNegatives, gradient, areaBottomPaths }\n) {\n context.fillStyle = color;\n\n if (gradient && gradient.length >= 2) {\n const globalGradient = context.createLinearGradient(\n 0,\n 0,\n 0,\n sizing.renderHeight\n );\n for (let i = 0; i < gradient.length; i++) {\n const value = gradient[i];\n if (Array.isArray(value)) {\n const gradientColor = isPreCutoff\n ? applyReducedOpacity(value[1], 0.35)\n : value[1];\n globalGradient.addColorStop(value[0], gradientColor);\n } else {\n const gradientColor = isPreCutoff\n ? applyReducedOpacity(value, 0.35)\n : value;\n globalGradient.addColorStop(i / (gradient.length - 1), gradientColor);\n }\n }\n context.fillStyle = globalGradient;\n } else {\n }\n\n const areaBottom = hasNegatives ? zero : sizing.renderHeight;\n\n context.beginPath();\n\n if (isPreCutoff) {\n const endIndex = ghostPoint ? splitIndex + 1 : splitIndex;\n const [firstX] = path[0];\n\n if (!areaBottomPaths) {\n context.moveTo(firstX, areaBottom);\n }\n\n for (let i = 0; i <= endIndex && i < path.length; i++) {\n const [x, y] = i === endIndex && ghostPoint ? ghostPoint : path[i];\n context.lineTo(x, y);\n }\n\n if (areaBottomPath && areaBottomPath.length) {\n for (let i = Math.min(endIndex, areaBottomPath.length - 1); i >= 0; i--) {\n const [x, y] = areaBottomPath[i];\n context.lineTo(x, y);\n }\n context.lineTo(...path[0]);\n } else {\n const lastPoint = ghostPoint || path[endIndex] || path[path.length - 1];\n context.lineTo(lastPoint[0], areaBottom);\n }\n } else {\n const startIndex = ghostPoint ? splitIndex : splitIndex + 1;\n const startPoint = ghostPoint || path[startIndex];\n\n if (startPoint) {\n context.moveTo(startPoint[0], areaBottom);\n\n if (ghostPoint) {\n context.lineTo(...ghostPoint);\n }\n for (let i = startIndex; i < path.length; i++) {\n context.lineTo(...path[i]);\n }\n\n if (areaBottomPath && areaBottomPath.length) {\n for (\n let i = areaBottomPath.length - 1;\n i >= Math.max(startIndex, 0);\n i--\n ) {\n const [x, y] = areaBottomPath[i];\n context.lineTo(x, y);\n }\n if (ghostPoint) {\n context.lineTo(ghostPoint[0], areaBottom);\n }\n } else {\n const [lastX] = path[path.length - 1];\n context.lineTo(lastX, areaBottom);\n }\n }\n }\n\n context.fill();\n}\n\nfunction drawPointsNormally(\n individualPoints,\n { color, context, negativeColor, hasNegatives, zero, zeroColor, pointRadius }\n) {\n if (!individualPoints || !Array.isArray(individualPoints)) {\n return;\n }\n\n for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[i];\n\n let pointColor = color;\n if (negativeColor && hasNegatives) {\n if (y === zero && zeroColor) {\n pointColor = zeroColor;\n } else if (y < zero) {\n pointColor = color;\n } else {\n pointColor = negativeColor;\n }\n }\n\n context.fillStyle = pointColor;\n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n}\n\nfunction drawLinesNormally(\n linePaths,\n { color, context, hasNegatives, negativeColor, width, highlighted }\n) {\n if (!linePaths || !Array.isArray(linePaths)) {\n return;\n }\n\n if (highlighted) {\n width += 2;\n }\n width *= DPI_INCREASE;\n\n for (let path of linePaths) {\n if (!path.length) continue;\n\n context.strokeStyle = hasNegatives && negativeColor ? negativeColor : color;\n context.lineWidth = width;\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n }\n}\n\nfunction drawLinesWithCutoff(\n linePaths,\n timeRatio,\n {\n color,\n context,\n hasNegatives,\n negativeColor,\n zero,\n width,\n highlighted,\n cutoffOpacity,\n }\n) {\n if (!linePaths || !Array.isArray(linePaths)) {\n return;\n }\n\n if (highlighted) {\n width += 2;\n }\n width *= DPI_INCREASE;\n\n const cutoffPixelX = timeRatio * context.canvas.width;\n const preCutoffPaths = [];\n const postCutoffPaths = [];\n\n for (let path of linePaths) {\n if (!path.length) continue;\n\n const prePath = [];\n const postPath = [];\n let ghostPoint = null;\n let splitIndex = -1;\n\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n \n if (x < cutoffPixelX) {\n prePath.push([x, y]);\n splitIndex = i;\n } else {\n postPath.push([x, y]);\n }\n }\n\n if (prePath.length > 0 && postPath.length > 0) {\n const lastPrePoint = prePath[prePath.length - 1];\n const firstPostPoint = postPath[0];\n const [x1, y1] = lastPrePoint;\n const [x2, y2] = firstPostPoint;\n \n if (x2 !== x1) {\n const fraction = (cutoffPixelX - x1) / (x2 - x1);\n ghostPoint = [cutoffPixelX, y1 + fraction * (y2 - y1)];\n prePath.push(ghostPoint);\n postPath.unshift(ghostPoint);\n }\n }\n\n if (prePath.length > 0) {\n preCutoffPaths.push(prePath);\n }\n if (postPath.length > 0) {\n postCutoffPaths.push(postPath);\n }\n }\n\n if (preCutoffPaths.length > 0) {\n const reducedColor = applyReducedOpacity(color, cutoffOpacity);\n context.strokeStyle = reducedColor;\n context.lineWidth = width;\n\n for (let path of preCutoffPaths) {\n if (path.length > 1) {\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n }\n }\n }\n\n if (postCutoffPaths.length > 0) {\n context.strokeStyle = hasNegatives && negativeColor ? negativeColor : color;\n context.lineWidth = width;\n\n for (let path of postCutoffPaths) {\n if (path.length > 1) {\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n }\n }\n }\n}\n\nfunction drawPointsWithCutoffByRatio(\n individualPoints,\n timeRatio,\n {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n cutoffOpacity,\n }\n) {\n if (!individualPoints || !Array.isArray(individualPoints)) {\n return;\n }\n\n const canvasWidth = context.canvas.width;\n const cutoffPixelX = timeRatio * canvasWidth;\n\n for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[i];\n\n const isBeforeCutoff = x < cutoffPixelX;\n\n let pointColor = color;\n if (isBeforeCutoff) {\n pointColor = applyReducedOpacity(color, cutoffOpacity);\n }\n\n if (negativeColor && hasNegatives) {\n if (y === zero && zeroColor) {\n pointColor = zeroColor;\n } else if (y < zero) {\n pointColor = isBeforeCutoff\n ? applyReducedOpacity(color, cutoffOpacity)\n : color;\n } else {\n pointColor = isBeforeCutoff\n ? applyReducedOpacity(negativeColor, cutoffOpacity)\n : negativeColor;\n }\n }\n\n context.fillStyle = pointColor;\n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n}\n","import {drawZeroLine} from './draw_zero_line';\nimport { applyReducedOpacity } from \"../helpers/colors\";\n\n/**\n * Draws the data on the canvas\n * Assumes the data is in individual point render space, ie x and y in pixels\n *\n * @param {Array<[number, number]>} individualPoints - data to draw\n * @param {Object} options - set of options\n * @param {Object} options.context - the context to draw on\n * @param {String} options.color - color of the bar to draw\n * @param {{renderWidth: Number, renderHeight: Number}} options.sizing - size of the canvas, in pixels\n * @param {Number} options.indexInAxis - index of the series in the axis\n * @param {Number} options.axisSeriesCount - number of series in the axis\n * @param {Number} options.zero - y coordinate that represents \"zero\"\n * @param {Boolean} options.hasNegatives - if any values are negative (in which case should render from zero)\n * @param {String} options.negativeColor - color of the bar to draw if negative\n * @param {String} options.zeroColor - color of the zero line\n * @param {Number} options.zeroWidth - width of the zero line\n * @param {Number} options.closestSpacing - closest x spacing between points, in data space\n * @param {{minX: Number, maxX: Number}} options.bounds - bounds of the data as rendered\n * @private\n */\nexport default function drawBars(individualPoints, {\n color, context, sizing, indexInAxis, axisSeriesCount, zero, hasNegatives, negativeColor, zeroColor, zeroWidth, closestSpacing, bounds, cutoffIndex, cutoffOpacity, originalData, renderCutoffGradient, selectionBounds\n}) {\n if (!context) {\n console.error('Canvas context is null in drawBars');\n return;\n }\n \n context.strokeStyle = color;\n context.fillStyle = color;\n\n const {barWidth, totalBarWidth} = getBarWidths({ closestSpacing, bounds, sizing, axisSeriesCount });\n const barBottom = hasNegatives ? zero : sizing.renderHeight;\n\n if (renderCutoffGradient && cutoffIndex !== undefined && originalData) {\n drawBarsWithCutoff(individualPoints, {\n color, context, sizing, indexInAxis, axisSeriesCount, zero, hasNegatives, negativeColor, zeroColor, zeroWidth, closestSpacing, bounds, cutoffIndex, cutoffOpacity, originalData, selectionBounds, barWidth, totalBarWidth, barBottom\n });\n return;\n }\n\n for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[i];\n\n if (hasNegatives) {\n if (y <= zero) {\n context.fillStyle = color;\n } else {\n context.fillStyle = negativeColor;\n }\n }\n\n context.fillRect(x - totalBarWidth / 2 + barWidth*indexInAxis, y, barWidth, barBottom-y);\n }\n\n if (zeroWidth) {\n drawZeroLine(barBottom, {\n context,\n sizing,\n color,\n zero,\n zeroColor,\n zeroWidth\n });\n }\n}\n\nexport function getBarWidths({closestSpacing, bounds, sizing, axisSeriesCount}) {\n const fullBarWidth = closestSpacing / (bounds.maxX - bounds.minX) * sizing.renderWidth;\n\n const totalBarWidth = fullBarWidth * 0.8;\n const barSpacing = fullBarWidth * 0.2;\n const barWidth = totalBarWidth / axisSeriesCount;\n\n return {\n barWidth,\n totalBarWidth,\n barSpacing\n };\n}\n\n/**\n * Draws the data on the canvas with cutoff\n * Assumes the data is in individual point render space, ie x and y in pixels\n *\n * @param {Array<[number, number]>} individualPoints - data to draw\n * @param {Object} options - set of options\n * @param {Object} options.context - the context to draw on\n * @param {String} options.color - color of the bar to draw\n * @param {{renderWidth: Number, renderHeight: Number}} options.sizing - size of the canvas, in pixels\n * @param {Number} options.indexInAxis - index of the series in the axis\n * @param {Number} options.axisSeriesCount - number of series in the axis\n * @param {Number} options.zero - y coordinate that represents \"zero\"\n * @param {Boolean} options.hasNegatives - if any values are negative (in which case should render from zero)\n * @param {String} options.negativeColor - color of the bar to draw if negative\n * @param {String} options.zeroColor - color of the zero line\n * @param {Number} options.zeroWidth - width of the zero line\n * @param {Number} options.closestSpacing - closest x spacing between points, in data space\n * @param {{minX: Number, maxX: Number}} options.bounds - bounds of the data as rendered\n * @param {Number} options.cutoffIndex - index of the cutoff\n * @param {Number} options.cutoffOpacity - opacity of the cutoff\n * @param {Array<[number, number]>} options.originalData - original data\n * @param {Boolean} options.selectionBounds - if selection bounds are available\n * @param {Number} options.barWidth - width of the bar\n * @param {Number} options.totalBarWidth - total width of the bar\n * @param {Number} options.barBottom - y coordinate that represents the bottom of the bar\n * @private\n */\nfunction drawBarsWithCutoff(individualPoints, {\n color, context, sizing, indexInAxis, axisSeriesCount, zero, hasNegatives, negativeColor, zeroColor, zeroWidth, closestSpacing, bounds, cutoffIndex, cutoffOpacity, originalData, selectionBounds, barWidth, totalBarWidth, barBottom\n}) {\n let cutoffTime;\n if (typeof originalData[0] === 'object' && originalData[0].length === 2) {\n const baseIndex = Math.floor(cutoffIndex);\n const fraction = cutoffIndex - baseIndex;\n \n if (fraction === 0 || baseIndex >= originalData.length - 1) {\n const cutoffDate = originalData[Math.min(baseIndex, originalData.length - 1)][0];\n cutoffTime = cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n } else {\n const currentDate = originalData[baseIndex][0];\n const nextDate = originalData[baseIndex + 1][0];\n const currentTime = currentDate instanceof Date ? currentDate.getTime() : currentDate;\n const nextTime = nextDate instanceof Date ? nextDate.getTime() : nextDate;\n cutoffTime = currentTime + fraction * (nextTime - currentTime);\n }\n } else {\n cutoffTime = cutoffIndex; \n }\n\n for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[i];\n \n let barColor = color;\n let isBeforeCutoff = false;\n\n if (i < originalData.length) {\n const dataPoint = originalData[i];\n const pointTime = dataPoint[0] instanceof Date ? dataPoint[0].getTime() : dataPoint[0];\n isBeforeCutoff = pointTime < cutoffTime;\n \n if (isBeforeCutoff) {\n barColor = applyReducedOpacity(color, cutoffOpacity);\n }\n }\n\n if (hasNegatives) {\n if (y <= zero) {\n context.fillStyle = barColor;\n } else {\n const negColor = isBeforeCutoff ? applyReducedOpacity(negativeColor, cutoffOpacity) : negativeColor;\n context.fillStyle = negColor;\n }\n } else {\n context.fillStyle = barColor;\n }\n\n context.fillRect(x - totalBarWidth / 2 + barWidth*indexInAxis, y, barWidth, barBottom-y);\n }\n\n if (zeroWidth) {\n drawZeroLine(barBottom, {\n context, sizing, color, zero, zeroColor, zeroWidth\n });\n }\n}\n","import {DPI_INCREASE} from './size_canvas';\nimport pathsFrom from './paths_from';\nimport { applyReducedOpacity } from \"../helpers/colors\";\n\nfunction applyPointSpacing(points, minSpacing) {\n if (!minSpacing || points.length <= 1) {\n return points;\n }\n \n const spacedPoints = [];\n let lastX = -Infinity;\n \n for (const point of points) {\n const [x] = point;\n if (x - lastX >= minSpacing) {\n spacedPoints.push(point);\n lastX = x;\n }\n }\n \n return spacedPoints;\n}\n\nexport default function drawLine(dataInRenderSpace, {\n color, width=1, context, shadowColor='black', shadowBlur=5, dashed=false, dashPattern=null, highlighted=false, showIndividualPoints=false, pointRadius, minPointSpacing, getIndividualPoints, getRanges, cutoffIndex, cutoffOpacity, originalData, renderCutoffGradient, currentBounds, selectionBounds, rendering, isPreview\n}) {\n if (!context) {\n console.error(\"Canvas context is null in drawLine\");\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 const paths = pathsFrom(dataInRenderSpace);\n\n for (let path of paths) {\n if (renderCutoffGradient && cutoffIndex !== undefined && originalData) {\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 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 renderCutoffIndex = timeRatio * path.length;\n \n const preCutoffPath = [];\n const postCutoffPath = [];\n let ghostPoint = null;\n \n if (renderCutoffIndex > 0 && renderCutoffIndex < path.length - 1) {\n const beforeIndex = Math.floor(renderCutoffIndex);\n const afterIndex = Math.ceil(renderCutoffIndex);\n \n if (beforeIndex !== afterIndex) {\n const fraction = renderCutoffIndex - beforeIndex;\n const beforePoint = path[beforeIndex];\n const afterPoint = path[afterIndex];\n \n ghostPoint = [\n beforePoint[0] + fraction * (afterPoint[0] - beforePoint[0]),\n beforePoint[1] + fraction * (afterPoint[1] - beforePoint[1])\n ];\n \n } else {\n ghostPoint = path[renderCutoffIndex];\n }\n }\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 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) {\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 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 if (isBeforeCutoff) {\n const reducedOpacityColor = applyReducedOpacity(color, cutoffOpacity);\n context.fillStyle = reducedOpacityColor;\n } else {\n context.fillStyle = color;\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 context.fillStyle = color;\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 if (isBeforeCutoff) {\n const reducedOpacityColor = applyReducedOpacity(color, cutoffOpacity);\n context.fillStyle = reducedOpacityColor;\n } else {\n context.fillStyle = color;\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 context.fillStyle = color;\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, cutoffOpacity, originalData, selectionBounds } = parameters;\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 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 { zero, inRenderSpaceAreaBottom } = 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 trapezoids.push({\n x1,\n y1,\n x2: xCross,\n y2: yCross,\n bottomY1,\n bottomY2: zero,\n });\n }\n\n if (Math.abs(y2 - yCross) > 0.1) {\n trapezoids.push({\n x1: xCross,\n y1: yCross,\n x2,\n y2,\n bottomY1: zero,\n bottomY2,\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 }\n \n\n\n if (trapezoids.length === 0) {\n return;\n }\n\n const geometry = this.generateTrapezoidGeometry(trapezoids);\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.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 gl.uniform1f(gl.getUniformLocation(this._program, \"width\"), width);\n gl.uniform1f(gl.getUniformLocation(this._program, \"height\"), height);\n\n const gradientData = this.parseGradient(params.gradient, params.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.enable(gl.BLEND);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\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 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, cutoffOpacity, originalData, selectionBounds, zero } =\n params;\n\n this._lastIndividualPoints = null;\n this._lastParams = null;\n\n // All cutoff data is now in tuple format [x, y] from graph_body_renderer\n let cutoffTime;\n \n 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 } 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 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 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.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 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 let shadowParams = {\n color: shadowColor,\n gradient: singleSeries.gradient || createDefaultGradient(shadowColor),\n zero,\n sizing: this._sizing,\n inRenderSpaceAreaBottom\n };\n\n if (singleSeries.cutoffTime) {\n shadowParams.cutoffIndex = cutoffIndex;\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 shouldShowIndividualPoints = typeof singleSeries.showIndividualPoints === 'boolean' ? singleSeries.showIndividualPoints : showIndividualPoints;\n\n const drawParams = {\n color: getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex),\n context: this._context,\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 };\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.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 if (this._webgl) {\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 */\nfunction 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 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 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, 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 stateController.setContextMenuMousePosition({\n clientX: event.clientX,\n clientY: event.clientY,\n showing: true\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} 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 currentDate.setMinutes(0, 0, 0);\n if (amount === 24) {\n currentDate.setHours(0);\n } else 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 } 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 currentDate.setHours(0, 0, 0, 0);\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 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","___CSS_LOADER_EXPORT___","push","module","id","exports","cssWithMappingToString","list","toString","this","map","item","content","needLayer","concat","length","join","i","modules","media","dedupe","supports","layer","undefined","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","a","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","r","Symbol","toStringTag","value","p","b","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","color","xLabel","yLabel","ignoreDiscontinuities","dashed","dashPattern","width","rangeSelectorWidth","axis","expandYWith","defaultAlwaysTooltipped","square","shiftXBy","graph","background","hideFromKey","showIndividualPoints","minPointSpacing","rendering","negativeColor","gradient","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","LINE_COLORS","getColor","seriesColor","multigrapherSeriesIndex","applyReducedOpacity","opacityFactor","startsWith","matches","match","g","parseFloat","hex","slice","split","char","parseInt","applyReducedOpacityToGradient","Array","isArray","stop","position","createDefaultGradient","halfOpacityColor","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","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","inRenderSpaceAreaBottom","y1RelativeToZero","y2RelativeToZero","xCross","abs","yCross","finalX2","finalY2","finalBottomY2","ratio","trapezoid","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","clearRect","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","areaPaths","pathI","reducedOpacityGradient","renderCutoffIndex","preCutoffPath","preCutoffAreaBottomPath","bottomGhostPoint","postCutoffPath","postCutoffAreaBottomPath","visibleTimeRatio","drawAreaWithCutoff","positive","pointsToRender","drawArea","shadowProgram","boundsChanged","_lastBounds","_lastRenderHeight","_lastShadowCache","shadowParams","save","globalCompositeOperation","restore","top","left","pointerEvents","insertBefore","nextSibling","shouldShowIndividualPoints","drawParams","getRanges","range","pixelMinY","pixelMaxY","setLineDash","beforeIndex","afterIndex","ceil","beforePoint","afterPoint","ranges","horizontalBarWidth","drawLine","renderBackground","inBackgroundSpace","_backgroundProgram","drawBackground","markSizeChanged","ResizeObserver","first","disabled","IntersectionObserver","entries","_intersectionTimeout","isIntersecting","sizingPromise","resizeDebounced","_resizeTimeout","recalculatePosition","calculatePrecision","log10","roundToPrecision","precision","isNaN","rounded","toFixed","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","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","now","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","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","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","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,8ECEAC,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,ki6CAAmi6C,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,gCAAgC,MAAQ,GAAG,SAAW,mvaAAmva,eAAiB,CAAC,gkvBAAgkvB,WAAa,MAE/+jF,S,uBCDAD,EAAOE,QAAU,SAAUC,GACzB,IAAIC,EAAO,GA4EX,OAzEAA,EAAKC,SAAW,WACd,OAAOC,KAAKC,KAAI,SAAUC,GACxB,IAAIC,EAAU,GACVC,OAA+B,IAAZF,EAAK,GAoB5B,OAnBIA,EAAK,KACPC,GAAW,cAAcE,OAAOH,EAAK,GAAI,QAEvCA,EAAK,KACPC,GAAW,UAAUE,OAAOH,EAAK,GAAI,OAEnCE,IACFD,GAAW,SAASE,OAAOH,EAAK,GAAGI,OAAS,EAAI,IAAID,OAAOH,EAAK,IAAM,GAAI,OAE5EC,GAAWN,EAAuBK,GAC9BE,IACFD,GAAW,KAETD,EAAK,KACPC,GAAW,KAETD,EAAK,KACPC,GAAW,KAENA,CACT,IAAGI,KAAK,GACV,EAGAT,EAAKU,EAAI,SAAWC,EAASC,EAAOC,EAAQC,EAAUC,GAC7B,iBAAZJ,IACTA,EAAU,CAAC,CAAC,KAAMA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IAAAA,KACZ2mD,aAAc3mD,IAAAA,KACdwqD,gBAAiBxqD,IAAAA,KACjBuqD,oBAAqBvqD,IAAAA,M","sources":["webpack://Grapher/webpack/runtime/load script","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/helpers/colors.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};","// 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(0,0,0,.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(0,0,0,.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\":\"AAo8BA,eAr4BE,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,CA0HhB,wBAAA,CACA,UAAA,CACA,gBAAA,CACA,kBAAA,CACA,cAAA,CACA,kBAAA,CACA,cAAA,CACA,gBAAA,CAGF,sDACE,oBAAA,CACA,qBAAA,CAEA,cAAA,CACA,eAAA,CACA,kBAAA,CAEA,kBAAA,CAEA,iFACE,eAAA,CAIA,2GACE,UAAA,CACA,eAAA,CACA,iBAAA,CACA,kBAAA,CAGF,+HACE,a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AAA,CAGF,mIACE,gBAAA,CAKF,iFACE,SA2M4B,CA1M5B,iBAAA,CACA,aAAA,CACA,gBAAA,CACA,iCAAA,CAGF,iFACE,WAmM4B,CAlM5B,gBAAA,CAIA,uGACE,WA8LiC,CA3LnC,uGACE,SA2LiC,CAnL7C,+CACE,wBAAA,CACA,wBAAA,CACA,YAAA,CACA,UAsLoC,CArLpC,eAAA,CACA,iBAAA,CAEA,2DACE,YAAA,CACA,oBA+K6C,CA1K/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,UAmI0B\",\"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-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-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, // only applies to bar\n gradient: PropTypes.array, // only applies to area\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","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","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 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 areaPaths = pathsFrom(dataInRenderSpace);\n const areaBottomPaths =\n inRenderSpaceAreaBottom && pathsFrom(inRenderSpaceAreaBottom);\n\n const linePaths = pathsFrom(dataInRenderSpace, {\n splitAtY: zero,\n });\n\n if (renderCutoffGradient && cutoffIndex !== undefined && originalData) {\n drawAreaWithCutoff(\n individualPoints,\n areaPaths,\n areaBottomPaths,\n linePaths,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n showIndividualPoints,\n negativeColor,\n pointRadius,\n width,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n cutoffIndex,\n cutoffOpacity,\n originalData,\n selectionBounds,\n isPreview,\n }\n );\n return;\n }\n\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n context.beginPath();\n\n const [firstX, _startY] = path[0];\n const [lastX, _lastY] = path[path.length - 1];\n\n if (!areaBottomPaths) {\n context.moveTo(firstX, areaBottom);\n }\n\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n context.lineTo(x, y);\n }\n\n if (areaBottomPath && areaBottomPath.length) {\n for (let i = areaBottomPath.length - 1; i >= 0; i--) {\n const [x, y] = areaBottomPath[i];\n context.lineTo(x, y);\n }\n\n context.lineTo(...path[0]);\n } else {\n context.lineTo(lastX, areaBottom);\n }\n\n context.fill();\n }\n\n if (highlighted) {\n width += 2;\n }\n\n width *= DPI_INCREASE;\n context.strokeStyle = color;\n context.lineWidth = width;\n\n for (let path of linePaths) {\n if (!path.length) {\n continue;\n }\n\n if (hasNegatives) {\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 }\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 context.fillStyle = color;\n\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 if (negativeColor && hasNegatives) {\n if (y === zero && zeroColor) {\n context.fillStyle = zeroColor;\n } else if (y < zero) {\n context.fillStyle = color;\n } else {\n context.fillStyle = negativeColor;\n }\n }\n\n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n }\n}\n\n/**\n * Draws the data on the canvas with cutoff\n * Assumes the data is in individual point render space, ie x and y in pixels\n *\n * @param {Array<[number, number]>} individualPoints - data to draw\n * @param {Object} options - set of options\n * @param {Object} options.context - the context to draw on\n * @param {String} options.color - color of the area to draw\n * @param {{renderWidth: Number, renderHeight: Number}} options.sizing - size of the canvas, in pixels\n * @param {Number} options.zero - y coordinate that represents \"zero\"\n * @param {Boolean} options.hasNegatives - if any values are negative (in which case should render from zero)\n * @param {Array<String>} [options.gradient] - an array of stops, from top to bottom of canvas, to draw with\n * @param {String} [options.zeroColor] - color of the zero line\n * @param {Number} [options.zeroWidth] - width of the zero line\n * @param {Boolean} [options.showIndividualPoints] - draw circles at each point\n * @param {String} [options.negativeColor] - color of the area below zero\n * @param {Number} [options.width] - line width\n * @param {Object} [options.inRenderSpaceAreaBottom] - if provided, will use this as the area bottom instead of zero/sizing.renderHeight\n * @private\n */\nfunction drawAreaWithCutoff(\n individualPoints,\n areaPaths,\n areaBottomPaths,\n linePaths,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n showIndividualPoints,\n negativeColor,\n pointRadius,\n width,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n cutoffIndex,\n cutoffOpacity,\n originalData,\n selectionBounds,\n isPreview,\n }\n) {\n let cutoffTime;\n if (typeof originalData[0] === \"object\" && originalData[0].length === 2) {\n const baseIndex = Math.floor(cutoffIndex);\n const fraction = cutoffIndex - baseIndex;\n\n if (fraction === 0 || baseIndex >= originalData.length - 1) {\n const cutoffDate =\n originalData[Math.min(baseIndex, originalData.length - 1)][0];\n cutoffTime =\n cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n } else {\n const currentDate = originalData[baseIndex][0];\n const nextDate = originalData[baseIndex + 1][0];\n const currentTime =\n currentDate instanceof Date ? currentDate.getTime() : currentDate;\n const nextTime = nextDate instanceof Date ? nextDate.getTime() : nextDate;\n cutoffTime = currentTime + fraction * (nextTime - currentTime);\n }\n } else {\n cutoffTime = cutoffIndex;\n }\n\n let firstTime, lastTime;\n if (isPreview && selectionBounds) {\n firstTime = selectionBounds.minX instanceof Date ? selectionBounds.minX.getTime() : selectionBounds.minX;\n lastTime = selectionBounds.maxX instanceof Date ? selectionBounds.maxX.getTime() : selectionBounds.maxX;\n } else {\n firstTime = originalData[0][0] instanceof Date ? originalData[0][0].getTime() : originalData[0][0];\n lastTime = originalData[originalData.length - 1][0] instanceof Date ? \n originalData[originalData.length - 1][0].getTime() : originalData[originalData.length - 1][0];\n }\n\n const timeRatio = (cutoffTime - firstTime) / (lastTime - firstTime);\n\n if (timeRatio < 0) {\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n renderEntireArea(path, areaBottomPath, {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n } else if (timeRatio > 1) {\n const reducedOpacityGradient = gradient\n ? applyReducedOpacityToGradient(gradient, cutoffOpacity)\n : null;\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n renderEntireArea(path, areaBottomPath, {\n color: applyReducedOpacity(color, cutoffOpacity),\n context,\n sizing,\n zero,\n hasNegatives,\n gradient: reducedOpacityGradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n } else {\n if (isPreview) {\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n if (!path.length) {\n continue;\n }\n\n const renderCutoffIndex = timeRatio * path.length;\n const splitIndex = Math.floor(renderCutoffIndex);\n const fraction = renderCutoffIndex - splitIndex;\n\n let ghostPoint = null;\n if (splitIndex < path.length - 1 && fraction > 0) {\n const [x1, y1] = path[splitIndex];\n const [x2, y2] = path[splitIndex + 1];\n ghostPoint = [x1 + fraction * (x2 - x1), y1 + fraction * (y2 - y1)];\n }\n\n const shouldRenderPre =\n splitIndex > 0 || (splitIndex === 0 && fraction > 0);\n\n if (shouldRenderPre) {\n const preCutoffPath = path.slice(0, splitIndex + 1);\n if (ghostPoint && splitIndex < path.length - 1) {\n preCutoffPath.push(ghostPoint);\n }\n\n const preCutoffAreaBottomPath = areaBottomPath\n ? areaBottomPath.slice(0, splitIndex + 1)\n : null;\n if (\n ghostPoint &&\n preCutoffAreaBottomPath &&\n splitIndex < areaBottomPath.length - 1\n ) {\n const bottomGhostPoint = [ghostPoint[0], zero];\n preCutoffAreaBottomPath.push(bottomGhostPoint);\n }\n\n const reducedOpacityGradient = gradient\n ? applyReducedOpacityToGradient(gradient, cutoffOpacity)\n : null;\n renderEntireArea(preCutoffPath, preCutoffAreaBottomPath, {\n color: applyReducedOpacity(color, cutoffOpacity),\n context,\n sizing,\n zero,\n hasNegatives,\n gradient: reducedOpacityGradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n\n const shouldRenderPost =\n splitIndex < path.length - 1 ||\n (splitIndex === path.length - 1 && fraction === 0);\n\n if (shouldRenderPost) {\n const postCutoffPath = [];\n if (ghostPoint && splitIndex < path.length - 1) {\n postCutoffPath.push(ghostPoint);\n }\n postCutoffPath.push(...path.slice(splitIndex + 1));\n\n const postCutoffAreaBottomPath = [];\n if (\n ghostPoint &&\n areaBottomPath &&\n splitIndex < areaBottomPath.length - 1\n ) {\n const bottomGhostPoint = [ghostPoint[0], zero];\n postCutoffAreaBottomPath.push(bottomGhostPoint);\n }\n if (areaBottomPath) {\n postCutoffAreaBottomPath.push(\n ...areaBottomPath.slice(splitIndex + 1)\n );\n }\n\n renderEntireArea(\n postCutoffPath,\n postCutoffAreaBottomPath.length ? postCutoffAreaBottomPath : null,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n }\n );\n }\n }\n\n if (linePaths && linePaths.length > 0) {\n drawLinesWithCutoff(linePaths, timeRatio, {\n color,\n context,\n hasNegatives,\n negativeColor,\n zero,\n width,\n highlighted,\n cutoffOpacity,\n });\n }\n\n if (\n showIndividualPoints &&\n individualPoints &&\n individualPoints.length > 0\n ) {\n drawPointsWithCutoffByRatio(individualPoints, timeRatio, {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n cutoffOpacity,\n });\n }\n } else {\n if (!selectionBounds) {\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n renderEntireArea(path, areaBottomPath, {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n } else {\n const visibleMinTime =\n selectionBounds.minX instanceof Date\n ? selectionBounds.minX.getTime()\n : selectionBounds.minX;\n const visibleMaxTime =\n selectionBounds.maxX instanceof Date\n ? selectionBounds.maxX.getTime()\n : selectionBounds.maxX;\n\n if (cutoffTime < visibleMinTime) {\n // cutoff before visible range - render entire area normally\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n renderEntireArea(path, areaBottomPath, {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n } else if (cutoffTime > visibleMaxTime) {\n // cutoff after visible range - render entire area with reduced opacity\n const reducedOpacityGradient = gradient\n ? applyReducedOpacityToGradient(gradient, cutoffOpacity)\n : null;\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n renderEntireArea(path, areaBottomPath, {\n color: applyReducedOpacity(color, cutoffOpacity),\n context,\n sizing,\n zero,\n hasNegatives,\n gradient: reducedOpacityGradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n } else {\n // cutoff within visible range - calculate position relative to visible bounds\n const visibleTimeRatio =\n (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n if (!path.length) {\n continue;\n }\n\n const renderCutoffIndex = visibleTimeRatio * path.length;\n const splitIndex = Math.floor(renderCutoffIndex);\n const fraction = renderCutoffIndex - splitIndex;\n\n // create ghost point for continuity if needed\n let ghostPoint = null;\n if (splitIndex < path.length - 1 && fraction > 0) {\n const [x1, y1] = path[splitIndex];\n const [x2, y2] = path[splitIndex + 1];\n ghostPoint = [\n x1 + fraction * (x2 - x1),\n y1 + fraction * (y2 - y1),\n ];\n }\n\n // render pre-cutoff area with reduced opacity\n const shouldRenderPre =\n splitIndex > 0 || (splitIndex === 0 && fraction > 0);\n\n if (shouldRenderPre) {\n renderAreaSegment(\n path,\n areaBottomPath,\n splitIndex,\n ghostPoint,\n true,\n {\n color: applyReducedOpacity(color, cutoffOpacity),\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n areaBottomPaths,\n }\n );\n }\n\n // render post-cutoff area with normal opacity\n const shouldRenderPost = splitIndex < path.length - 1;\n\n if (shouldRenderPost) {\n renderAreaSegment(\n path,\n areaBottomPath,\n splitIndex,\n ghostPoint,\n false,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n areaBottomPaths,\n }\n );\n }\n }\n }\n }\n }\n\n // draw outline lines with cutoff\n if (timeRatio >= 0 && timeRatio <= 1 && !isPreview) {\n if (selectionBounds) {\n const visibleMinTime =\n selectionBounds.minX instanceof Date\n ? selectionBounds.minX.getTime()\n : selectionBounds.minX;\n const visibleMaxTime =\n selectionBounds.maxX instanceof Date\n ? selectionBounds.maxX.getTime()\n : selectionBounds.maxX;\n\n // test case time\n if (cutoffTime < visibleMinTime) {\n // cutoff before visible range - draw lines normally\n drawLinesNormally(linePaths, {\n color,\n context,\n hasNegatives,\n negativeColor,\n width,\n highlighted,\n });\n } else if (cutoffTime > visibleMaxTime) {\n // cutoff after visible range - draw lines with reduced opacity (to match area)\n const reducedColor = applyReducedOpacity(color, cutoffOpacity);\n const reducedNegativeColor = negativeColor\n ? applyReducedOpacity(negativeColor, cutoffOpacity)\n : negativeColor;\n drawLinesNormally(linePaths, {\n color: reducedColor,\n context,\n hasNegatives,\n negativeColor: reducedNegativeColor,\n width,\n highlighted,\n });\n } else {\n // cutoff within visible range - split lines at cutoff\n const visibleTimeRatio =\n (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n drawLinesWithCutoff(linePaths, visibleTimeRatio, {\n color,\n context,\n hasNegatives,\n negativeColor,\n zero,\n width,\n highlighted,\n cutoffOpacity,\n });\n }\n } else {\n // no bounds available - draw lines normally\n drawLinesNormally(linePaths, {\n color,\n context,\n hasNegatives,\n negativeColor,\n width,\n highlighted,\n });\n }\n } else if (!isPreview) {\n // draw lines normally without cutoff\n drawLinesNormally(linePaths, {\n color,\n context,\n hasNegatives,\n negativeColor,\n width,\n highlighted,\n });\n }\n\n // draw other elements (zero line, points) normally\n if (zeroWidth) {\n const areaBottom = hasNegatives ? zero : sizing.renderHeight;\n drawZeroLine(areaBottom, {\n context,\n sizing,\n color,\n zero,\n zeroColor,\n zeroWidth,\n });\n }\n\n if (showIndividualPoints && !isPreview) {\n if (timeRatio >= 0 && timeRatio <= 1) {\n if (selectionBounds) {\n const visibleMinTime =\n selectionBounds.minX instanceof Date\n ? selectionBounds.minX.getTime()\n : selectionBounds.minX;\n const visibleMaxTime =\n selectionBounds.maxX instanceof Date\n ? selectionBounds.maxX.getTime()\n : selectionBounds.maxX;\n\n //test case time\n if (cutoffTime < visibleMinTime) {\n // cutoff before visible range - draw points normally\n drawPointsNormally(individualPoints, {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n });\n } else if (cutoffTime > visibleMaxTime) {\n // cutoff after visible range - draw points with reduced opacity\n const reducedColor = applyReducedOpacity(color, cutoffOpacity);\n const reducedNegativeColor = negativeColor\n ? applyReducedOpacity(negativeColor, cutoffOpacity)\n : negativeColor;\n const reducedZeroColor = zeroColor\n ? applyReducedOpacity(zeroColor, cutoffOpacity)\n : zeroColor;\n drawPointsNormally(individualPoints, {\n color: reducedColor,\n context,\n negativeColor: reducedNegativeColor,\n hasNegatives,\n zero,\n zeroColor: reducedZeroColor,\n pointRadius,\n });\n } else {\n // cutoff within visible range - split points at cutoff\n const visibleTimeRatio =\n (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n drawPointsWithCutoffByRatio(individualPoints, visibleTimeRatio, {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n cutoffOpacity,\n });\n }\n } else {\n // no bounds available - draw points normally\n drawPointsNormally(individualPoints, {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n });\n }\n } else {\n // cutoff outside data range - draw points normally\n drawPointsNormally(individualPoints, {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n });\n }\n } \n }\n}\n\nfunction renderEntireArea(\n path,\n areaBottomPath,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n }\n) {\n context.fillStyle = color;\n\n if (gradient && gradient.length >= 2) {\n const globalGradient = context.createLinearGradient(\n 0,\n 0,\n 0,\n sizing.renderHeight\n );\n for (let i = 0; i < gradient.length; i++) {\n const value = gradient[i];\n if (Array.isArray(value)) {\n globalGradient.addColorStop(value[0], value[1]);\n } else {\n globalGradient.addColorStop(i / (gradient.length - 1), value);\n }\n }\n context.fillStyle = globalGradient;\n } else {\n }\n\n const areaBottom = hasNegatives ? zero : sizing.renderHeight;\n\n context.beginPath();\n\n const [firstX, _startY] = path[0];\n const [lastX, _lastY] = path[path.length - 1];\n\n if (!areaBottomPath) {\n context.moveTo(firstX, areaBottom);\n }\n\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n context.lineTo(x, y);\n }\n\n if (areaBottomPath && areaBottomPath.length) {\n for (let i = areaBottomPath.length - 1; i >= 0; i--) {\n const [x, y] = areaBottomPath[i];\n context.lineTo(x, y);\n }\n context.lineTo(...path[0]);\n } else {\n context.lineTo(lastX, areaBottom);\n }\n\n context.fill();\n}\n\nfunction renderAreaSegment(\n path,\n areaBottomPath,\n splitIndex,\n ghostPoint,\n isPreCutoff,\n { color, context, sizing, zero, hasNegatives, gradient, areaBottomPaths }\n) {\n context.fillStyle = color;\n\n if (gradient && gradient.length >= 2) {\n const globalGradient = context.createLinearGradient(\n 0,\n 0,\n 0,\n sizing.renderHeight\n );\n for (let i = 0; i < gradient.length; i++) {\n const value = gradient[i];\n if (Array.isArray(value)) {\n const gradientColor = isPreCutoff\n ? applyReducedOpacity(value[1], 0.35)\n : value[1];\n globalGradient.addColorStop(value[0], gradientColor);\n } else {\n const gradientColor = isPreCutoff\n ? applyReducedOpacity(value, 0.35)\n : value;\n globalGradient.addColorStop(i / (gradient.length - 1), gradientColor);\n }\n }\n context.fillStyle = globalGradient;\n } else {\n }\n\n const areaBottom = hasNegatives ? zero : sizing.renderHeight;\n\n context.beginPath();\n\n if (isPreCutoff) {\n const endIndex = ghostPoint ? splitIndex + 1 : splitIndex;\n const [firstX] = path[0];\n\n if (!areaBottomPaths) {\n context.moveTo(firstX, areaBottom);\n }\n\n for (let i = 0; i <= endIndex && i < path.length; i++) {\n const [x, y] = i === endIndex && ghostPoint ? ghostPoint : path[i];\n context.lineTo(x, y);\n }\n\n if (areaBottomPath && areaBottomPath.length) {\n for (let i = Math.min(endIndex, areaBottomPath.length - 1); i >= 0; i--) {\n const [x, y] = areaBottomPath[i];\n context.lineTo(x, y);\n }\n context.lineTo(...path[0]);\n } else {\n const lastPoint = ghostPoint || path[endIndex] || path[path.length - 1];\n context.lineTo(lastPoint[0], areaBottom);\n }\n } else {\n const startIndex = ghostPoint ? splitIndex : splitIndex + 1;\n const startPoint = ghostPoint || path[startIndex];\n\n if (startPoint) {\n context.moveTo(startPoint[0], areaBottom);\n\n if (ghostPoint) {\n context.lineTo(...ghostPoint);\n }\n for (let i = startIndex; i < path.length; i++) {\n context.lineTo(...path[i]);\n }\n\n if (areaBottomPath && areaBottomPath.length) {\n for (\n let i = areaBottomPath.length - 1;\n i >= Math.max(startIndex, 0);\n i--\n ) {\n const [x, y] = areaBottomPath[i];\n context.lineTo(x, y);\n }\n if (ghostPoint) {\n context.lineTo(ghostPoint[0], areaBottom);\n }\n } else {\n const [lastX] = path[path.length - 1];\n context.lineTo(lastX, areaBottom);\n }\n }\n }\n\n context.fill();\n}\n\nfunction drawPointsNormally(\n individualPoints,\n { color, context, negativeColor, hasNegatives, zero, zeroColor, pointRadius }\n) {\n if (!individualPoints || !Array.isArray(individualPoints)) {\n return;\n }\n\n for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[i];\n\n let pointColor = color;\n if (negativeColor && hasNegatives) {\n if (y === zero && zeroColor) {\n pointColor = zeroColor;\n } else if (y < zero) {\n pointColor = color;\n } else {\n pointColor = negativeColor;\n }\n }\n\n context.fillStyle = pointColor;\n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n}\n\nfunction drawLinesNormally(\n linePaths,\n { color, context, hasNegatives, negativeColor, width, highlighted }\n) {\n if (!linePaths || !Array.isArray(linePaths)) {\n return;\n }\n\n if (highlighted) {\n width += 2;\n }\n width *= DPI_INCREASE;\n\n for (let path of linePaths) {\n if (!path.length) continue;\n\n context.strokeStyle = hasNegatives && negativeColor ? negativeColor : color;\n context.lineWidth = width;\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n }\n}\n\nfunction drawLinesWithCutoff(\n linePaths,\n timeRatio,\n {\n color,\n context,\n hasNegatives,\n negativeColor,\n zero,\n width,\n highlighted,\n cutoffOpacity,\n }\n) {\n if (!linePaths || !Array.isArray(linePaths)) {\n return;\n }\n\n if (highlighted) {\n width += 2;\n }\n width *= DPI_INCREASE;\n\n const cutoffPixelX = timeRatio * context.canvas.width;\n const preCutoffPaths = [];\n const postCutoffPaths = [];\n\n for (let path of linePaths) {\n if (!path.length) continue;\n\n const prePath = [];\n const postPath = [];\n let ghostPoint = null;\n let splitIndex = -1;\n\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n \n if (x < cutoffPixelX) {\n prePath.push([x, y]);\n splitIndex = i;\n } else {\n postPath.push([x, y]);\n }\n }\n\n if (prePath.length > 0 && postPath.length > 0) {\n const lastPrePoint = prePath[prePath.length - 1];\n const firstPostPoint = postPath[0];\n const [x1, y1] = lastPrePoint;\n const [x2, y2] = firstPostPoint;\n \n if (x2 !== x1) {\n const fraction = (cutoffPixelX - x1) / (x2 - x1);\n ghostPoint = [cutoffPixelX, y1 + fraction * (y2 - y1)];\n prePath.push(ghostPoint);\n postPath.unshift(ghostPoint);\n }\n }\n\n if (prePath.length > 0) {\n preCutoffPaths.push(prePath);\n }\n if (postPath.length > 0) {\n postCutoffPaths.push(postPath);\n }\n }\n\n if (preCutoffPaths.length > 0) {\n const reducedColor = applyReducedOpacity(color, cutoffOpacity);\n context.strokeStyle = reducedColor;\n context.lineWidth = width;\n\n for (let path of preCutoffPaths) {\n if (path.length > 1) {\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n }\n }\n }\n\n if (postCutoffPaths.length > 0) {\n context.strokeStyle = hasNegatives && negativeColor ? negativeColor : color;\n context.lineWidth = width;\n\n for (let path of postCutoffPaths) {\n if (path.length > 1) {\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n }\n }\n }\n}\n\nfunction drawPointsWithCutoffByRatio(\n individualPoints,\n timeRatio,\n {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n cutoffOpacity,\n }\n) {\n if (!individualPoints || !Array.isArray(individualPoints)) {\n return;\n }\n\n const canvasWidth = context.canvas.width;\n const cutoffPixelX = timeRatio * canvasWidth;\n\n for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[i];\n\n const isBeforeCutoff = x < cutoffPixelX;\n\n let pointColor = color;\n if (isBeforeCutoff) {\n pointColor = applyReducedOpacity(color, cutoffOpacity);\n }\n\n if (negativeColor && hasNegatives) {\n if (y === zero && zeroColor) {\n pointColor = zeroColor;\n } else if (y < zero) {\n pointColor = isBeforeCutoff\n ? applyReducedOpacity(color, cutoffOpacity)\n : color;\n } else {\n pointColor = isBeforeCutoff\n ? applyReducedOpacity(negativeColor, cutoffOpacity)\n : negativeColor;\n }\n }\n\n context.fillStyle = pointColor;\n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n}\n","import {drawZeroLine} from './draw_zero_line';\nimport { applyReducedOpacity } from \"../helpers/colors\";\n\n/**\n * Draws the data on the canvas\n * Assumes the data is in individual point render space, ie x and y in pixels\n *\n * @param {Array<[number, number]>} individualPoints - data to draw\n * @param {Object} options - set of options\n * @param {Object} options.context - the context to draw on\n * @param {String} options.color - color of the bar to draw\n * @param {{renderWidth: Number, renderHeight: Number}} options.sizing - size of the canvas, in pixels\n * @param {Number} options.indexInAxis - index of the series in the axis\n * @param {Number} options.axisSeriesCount - number of series in the axis\n * @param {Number} options.zero - y coordinate that represents \"zero\"\n * @param {Boolean} options.hasNegatives - if any values are negative (in which case should render from zero)\n * @param {String} options.negativeColor - color of the bar to draw if negative\n * @param {String} options.zeroColor - color of the zero line\n * @param {Number} options.zeroWidth - width of the zero line\n * @param {Number} options.closestSpacing - closest x spacing between points, in data space\n * @param {{minX: Number, maxX: Number}} options.bounds - bounds of the data as rendered\n * @private\n */\nexport default function drawBars(individualPoints, {\n color, context, sizing, indexInAxis, axisSeriesCount, zero, hasNegatives, negativeColor, zeroColor, zeroWidth, closestSpacing, bounds, cutoffIndex, cutoffOpacity, originalData, renderCutoffGradient, selectionBounds\n}) {\n if (!context) {\n console.error('Canvas context is null in drawBars');\n return;\n }\n \n context.strokeStyle = color;\n context.fillStyle = color;\n\n const {barWidth, totalBarWidth} = getBarWidths({ closestSpacing, bounds, sizing, axisSeriesCount });\n const barBottom = hasNegatives ? zero : sizing.renderHeight;\n\n if (renderCutoffGradient && cutoffIndex !== undefined && originalData) {\n drawBarsWithCutoff(individualPoints, {\n color, context, sizing, indexInAxis, axisSeriesCount, zero, hasNegatives, negativeColor, zeroColor, zeroWidth, closestSpacing, bounds, cutoffIndex, cutoffOpacity, originalData, selectionBounds, barWidth, totalBarWidth, barBottom\n });\n return;\n }\n\n for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[i];\n\n if (hasNegatives) {\n if (y <= zero) {\n context.fillStyle = color;\n } else {\n context.fillStyle = negativeColor;\n }\n }\n\n context.fillRect(x - totalBarWidth / 2 + barWidth*indexInAxis, y, barWidth, barBottom-y);\n }\n\n if (zeroWidth) {\n drawZeroLine(barBottom, {\n context,\n sizing,\n color,\n zero,\n zeroColor,\n zeroWidth\n });\n }\n}\n\nexport function getBarWidths({closestSpacing, bounds, sizing, axisSeriesCount}) {\n const fullBarWidth = closestSpacing / (bounds.maxX - bounds.minX) * sizing.renderWidth;\n\n const totalBarWidth = fullBarWidth * 0.8;\n const barSpacing = fullBarWidth * 0.2;\n const barWidth = totalBarWidth / axisSeriesCount;\n\n return {\n barWidth,\n totalBarWidth,\n barSpacing\n };\n}\n\n/**\n * Draws the data on the canvas with cutoff\n * Assumes the data is in individual point render space, ie x and y in pixels\n *\n * @param {Array<[number, number]>} individualPoints - data to draw\n * @param {Object} options - set of options\n * @param {Object} options.context - the context to draw on\n * @param {String} options.color - color of the bar to draw\n * @param {{renderWidth: Number, renderHeight: Number}} options.sizing - size of the canvas, in pixels\n * @param {Number} options.indexInAxis - index of the series in the axis\n * @param {Number} options.axisSeriesCount - number of series in the axis\n * @param {Number} options.zero - y coordinate that represents \"zero\"\n * @param {Boolean} options.hasNegatives - if any values are negative (in which case should render from zero)\n * @param {String} options.negativeColor - color of the bar to draw if negative\n * @param {String} options.zeroColor - color of the zero line\n * @param {Number} options.zeroWidth - width of the zero line\n * @param {Number} options.closestSpacing - closest x spacing between points, in data space\n * @param {{minX: Number, maxX: Number}} options.bounds - bounds of the data as rendered\n * @param {Number} options.cutoffIndex - index of the cutoff\n * @param {Number} options.cutoffOpacity - opacity of the cutoff\n * @param {Array<[number, number]>} options.originalData - original data\n * @param {Boolean} options.selectionBounds - if selection bounds are available\n * @param {Number} options.barWidth - width of the bar\n * @param {Number} options.totalBarWidth - total width of the bar\n * @param {Number} options.barBottom - y coordinate that represents the bottom of the bar\n * @private\n */\nfunction drawBarsWithCutoff(individualPoints, {\n color, context, sizing, indexInAxis, axisSeriesCount, zero, hasNegatives, negativeColor, zeroColor, zeroWidth, closestSpacing, bounds, cutoffIndex, cutoffOpacity, originalData, selectionBounds, barWidth, totalBarWidth, barBottom\n}) {\n let cutoffTime;\n if (typeof originalData[0] === 'object' && originalData[0].length === 2) {\n const baseIndex = Math.floor(cutoffIndex);\n const fraction = cutoffIndex - baseIndex;\n \n if (fraction === 0 || baseIndex >= originalData.length - 1) {\n const cutoffDate = originalData[Math.min(baseIndex, originalData.length - 1)][0];\n cutoffTime = cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n } else {\n const currentDate = originalData[baseIndex][0];\n const nextDate = originalData[baseIndex + 1][0];\n const currentTime = currentDate instanceof Date ? currentDate.getTime() : currentDate;\n const nextTime = nextDate instanceof Date ? nextDate.getTime() : nextDate;\n cutoffTime = currentTime + fraction * (nextTime - currentTime);\n }\n } else {\n cutoffTime = cutoffIndex; \n }\n\n for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[i];\n \n let barColor = color;\n let isBeforeCutoff = false;\n\n if (i < originalData.length) {\n const dataPoint = originalData[i];\n const pointTime = dataPoint[0] instanceof Date ? dataPoint[0].getTime() : dataPoint[0];\n isBeforeCutoff = pointTime < cutoffTime;\n \n if (isBeforeCutoff) {\n barColor = applyReducedOpacity(color, cutoffOpacity);\n }\n }\n\n if (hasNegatives) {\n if (y <= zero) {\n context.fillStyle = barColor;\n } else {\n const negColor = isBeforeCutoff ? applyReducedOpacity(negativeColor, cutoffOpacity) : negativeColor;\n context.fillStyle = negColor;\n }\n } else {\n context.fillStyle = barColor;\n }\n\n context.fillRect(x - totalBarWidth / 2 + barWidth*indexInAxis, y, barWidth, barBottom-y);\n }\n\n if (zeroWidth) {\n drawZeroLine(barBottom, {\n context, sizing, color, zero, zeroColor, zeroWidth\n });\n }\n}\n","import {DPI_INCREASE} from './size_canvas';\nimport pathsFrom from './paths_from';\nimport { applyReducedOpacity } from \"../helpers/colors\";\n\nfunction applyPointSpacing(points, minSpacing) {\n if (!minSpacing || points.length <= 1) {\n return points;\n }\n \n const spacedPoints = [];\n let lastX = -Infinity;\n \n for (const point of points) {\n const [x] = point;\n if (x - lastX >= minSpacing) {\n spacedPoints.push(point);\n lastX = x;\n }\n }\n \n return spacedPoints;\n}\n\nexport default function drawLine(dataInRenderSpace, {\n color, width=1, context, shadowColor='black', shadowBlur=5, dashed=false, dashPattern=null, highlighted=false, showIndividualPoints=false, pointRadius, minPointSpacing, getIndividualPoints, getRanges, cutoffIndex, cutoffOpacity, originalData, renderCutoffGradient, currentBounds, selectionBounds, rendering, isPreview\n}) {\n if (!context) {\n console.error(\"Canvas context is null in drawLine\");\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 const paths = pathsFrom(dataInRenderSpace);\n\n for (let path of paths) {\n if (renderCutoffGradient && cutoffIndex !== undefined && originalData) {\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 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 renderCutoffIndex = timeRatio * path.length;\n \n const preCutoffPath = [];\n const postCutoffPath = [];\n let ghostPoint = null;\n \n if (renderCutoffIndex > 0 && renderCutoffIndex < path.length - 1) {\n const beforeIndex = Math.floor(renderCutoffIndex);\n const afterIndex = Math.ceil(renderCutoffIndex);\n \n if (beforeIndex !== afterIndex) {\n const fraction = renderCutoffIndex - beforeIndex;\n const beforePoint = path[beforeIndex];\n const afterPoint = path[afterIndex];\n \n ghostPoint = [\n beforePoint[0] + fraction * (afterPoint[0] - beforePoint[0]),\n beforePoint[1] + fraction * (afterPoint[1] - beforePoint[1])\n ];\n \n } else {\n ghostPoint = path[renderCutoffIndex];\n }\n }\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 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) {\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 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 if (isBeforeCutoff) {\n const reducedOpacityColor = applyReducedOpacity(color, cutoffOpacity);\n context.fillStyle = reducedOpacityColor;\n } else {\n context.fillStyle = color;\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 context.fillStyle = color;\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 if (isBeforeCutoff) {\n const reducedOpacityColor = applyReducedOpacity(color, cutoffOpacity);\n context.fillStyle = reducedOpacityColor;\n } else {\n context.fillStyle = color;\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 context.fillStyle = color;\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, cutoffOpacity, originalData, selectionBounds } = parameters;\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 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 { zero, inRenderSpaceAreaBottom } = 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 trapezoids.push({\n x1,\n y1,\n x2: xCross,\n y2: yCross,\n bottomY1,\n bottomY2: zero,\n });\n }\n\n if (Math.abs(y2 - yCross) > 0.1) {\n trapezoids.push({\n x1: xCross,\n y1: yCross,\n x2,\n y2,\n bottomY1: zero,\n bottomY2,\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 }\n \n\n\n if (trapezoids.length === 0) {\n return;\n }\n\n const geometry = this.generateTrapezoidGeometry(trapezoids);\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.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 gl.uniform1f(gl.getUniformLocation(this._program, \"width\"), width);\n gl.uniform1f(gl.getUniformLocation(this._program, \"height\"), height);\n\n const gradientData = this.parseGradient(params.gradient, params.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.enable(gl.BLEND);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\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 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, cutoffOpacity, originalData, selectionBounds, zero } =\n params;\n\n this._lastIndividualPoints = null;\n this._lastParams = null;\n\n // All cutoff data is now in tuple format [x, y] from graph_body_renderer\n let cutoffTime;\n \n 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 } 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 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 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.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 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 let shadowParams = {\n color: shadowColor,\n gradient: singleSeries.gradient || createDefaultGradient(shadowColor),\n zero,\n sizing: this._sizing,\n inRenderSpaceAreaBottom\n };\n\n if (singleSeries.cutoffTime) {\n shadowParams.cutoffIndex = cutoffIndex;\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 shouldShowIndividualPoints = typeof singleSeries.showIndividualPoints === 'boolean' ? singleSeries.showIndividualPoints : showIndividualPoints;\n\n const drawParams = {\n color: getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex),\n context: this._context,\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 };\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.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 if (this._webgl) {\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 */\nfunction 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 const dataMinX = data[0][0];\n const dataMaxX = data[data.length - 1][0];\n const dataRange = dataMaxX - dataMinX;\n const padding = Math.max(dataRange * 0.05, (bounds.maxX - bounds.minX) * 0.02); \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 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, 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 stateController.setContextMenuMousePosition({\n clientX: event.clientX,\n clientY: event.clientY,\n showing: true\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} 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 currentDate.setMinutes(0, 0, 0);\n if (amount === 24) {\n currentDate.setHours(0);\n } else 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 } 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 currentDate.setHours(0, 0, 0, 0);\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 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","___CSS_LOADER_EXPORT___","push","module","id","exports","cssWithMappingToString","list","toString","this","map","item","content","needLayer","concat","length","join","i","modules","media","dedupe","supports","layer","undefined","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","a","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","r","Symbol","toStringTag","value","p","b","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","color","xLabel","yLabel","ignoreDiscontinuities","dashed","dashPattern","width","rangeSelectorWidth","axis","expandYWith","defaultAlwaysTooltipped","square","shiftXBy","graph","background","hideFromKey","showIndividualPoints","minPointSpacing","rendering","negativeColor","gradient","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","LINE_COLORS","getColor","seriesColor","multigrapherSeriesIndex","applyReducedOpacity","opacityFactor","startsWith","matches","match","g","parseFloat","hex","slice","split","char","parseInt","applyReducedOpacityToGradient","Array","isArray","stop","position","createDefaultGradient","halfOpacityColor","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","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","inRenderSpaceAreaBottom","y1RelativeToZero","y2RelativeToZero","xCross","abs","yCross","finalX2","finalY2","finalBottomY2","ratio","trapezoid","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","clearRect","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","areaPaths","pathI","reducedOpacityGradient","renderCutoffIndex","preCutoffPath","preCutoffAreaBottomPath","bottomGhostPoint","postCutoffPath","postCutoffAreaBottomPath","visibleTimeRatio","drawAreaWithCutoff","positive","pointsToRender","drawArea","shadowProgram","boundsChanged","_lastBounds","_lastRenderHeight","_lastShadowCache","shadowParams","save","globalCompositeOperation","restore","top","left","pointerEvents","insertBefore","nextSibling","shouldShowIndividualPoints","drawParams","getRanges","range","pixelMinY","pixelMaxY","setLineDash","beforeIndex","afterIndex","ceil","beforePoint","afterPoint","ranges","horizontalBarWidth","drawLine","renderBackground","inBackgroundSpace","_backgroundProgram","drawBackground","markSizeChanged","ResizeObserver","first","disabled","IntersectionObserver","entries","_intersectionTimeout","isIntersecting","sizingPromise","resizeDebounced","_resizeTimeout","recalculatePosition","calculatePrecision","log10","roundToPrecision","precision","isNaN","rounded","toFixed","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","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","now","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","dataRange","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","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","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":""}
|