@windborne/grapher 1.0.27 → 1.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"bundle.esm.js","mappings":"6FAGIA,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,UCDAD,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,OAASK,KAE7B,IAAIC,EAAyB,CAAC,EAC9B,GAAIJ,EACF,IAAK,IAAIK,EAAI,EAAGA,EAAIhB,KAAKM,OAAQU,IAAK,CACpC,IAAIrB,EAAKK,KAAKgB,GAAG,GACP,MAANrB,IACFoB,EAAuBpB,IAAM,EAEjC,CAEF,IAAK,IAAIsB,EAAK,EAAGA,EAAKR,EAAQH,OAAQW,IAAM,CAC1C,IAAIf,EAAO,GAAGG,OAAOI,EAAQQ,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jI,GACDwB,EAAK,CACT8+B,SAAUA,EACVioB,8BAA+B0C,EAA0B1C,8BACzDt7C,OAAQA,EACR9N,GAAK,gBAAemrD,KAAkBtqD,IACtCwgD,oBAAqBh/C,EAAM4pD,gBAAkB,GAAK,EAClD5C,sBAAuB2B,OAM/Bja,GACA/b,EAAAA,QAAAA,cAAA,OAAK6B,UAAY,uBAAsBx0B,EAAMsvC,QAAS,kBAAkB,gBAAewZ,YAAyB,eAMhI,CAEAU,GAAa90B,aAAe,CACxB4a,MAAO,SAGXka,GAAa52B,UAAYjsB,OAAOmyB,OAAO,CAAC,EAAG4tB,GAAQ9zB,UAAW,CAC1DkzB,WAAY9jD,IAAAA,KACZ+jD,aAAc/jD,IAAAA,KACd4nD,gBAAiB5nD,IAAAA,KACjB2nD,oBAAqB3nD,IAAAA,M","sources":["webpack://@windborne/grapher/./src/grapher.scss","webpack://@windborne/grapher/./node_modules/css-loader/dist/runtime/api.js","webpack://@windborne/grapher/./node_modules/css-loader/dist/runtime/sourceMaps.js","webpack://@windborne/grapher/./node_modules/prop-types/factoryWithThrowingShims.js","webpack://@windborne/grapher/./node_modules/prop-types/index.js","webpack://@windborne/grapher/./node_modules/prop-types/lib/ReactPropTypesSecret.js","webpack://@windborne/grapher/./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js","webpack://@windborne/grapher/./node_modules/style-loader/dist/runtime/insertBySelector.js","webpack://@windborne/grapher/./node_modules/style-loader/dist/runtime/insertStyleElement.js","webpack://@windborne/grapher/./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js","webpack://@windborne/grapher/./node_modules/style-loader/dist/runtime/styleDomAPI.js","webpack://@windborne/grapher/./node_modules/style-loader/dist/runtime/styleTagTransform.js","webpack://@windborne/grapher/./src/renderer/background.frag","webpack://@windborne/grapher/./src/renderer/background.vert","webpack://@windborne/grapher/./src/renderer/circle.frag","webpack://@windborne/grapher/./src/renderer/circle.vert","webpack://@windborne/grapher/./src/renderer/line.frag","webpack://@windborne/grapher/./src/renderer/line.vert","webpack://@windborne/grapher/./src/renderer/shadow.frag","webpack://@windborne/grapher/./src/renderer/shadow.vert","webpack://@windborne/grapher/webpack/bootstrap","webpack://@windborne/grapher/webpack/runtime/compat get default export","webpack://@windborne/grapher/webpack/runtime/define property getters","webpack://@windborne/grapher/webpack/runtime/ensure chunk","webpack://@windborne/grapher/webpack/runtime/get javascript chunk filename","webpack://@windborne/grapher/webpack/runtime/hasOwnProperty shorthand","webpack://@windborne/grapher/webpack/runtime/make namespace object","webpack://@windborne/grapher/webpack/runtime/publicPath","webpack://@windborne/grapher/webpack/runtime/import chunk loading","webpack://@windborne/grapher/webpack/runtime/nonce","webpack://@windborne/grapher/external module \"react\"","webpack://@windborne/grapher/./src/state/data_types.js","webpack://@windborne/grapher/./src/helpers/custom_prop_types.js","webpack://@windborne/grapher/./src/eventable.js","webpack://@windborne/grapher/./src/helpers/colors.js","webpack://@windborne/grapher/./src/state/infer_type.js","webpack://@windborne/grapher/./src/helpers/color_to_vector.js","webpack://@windborne/grapher/./src/renderer/create_gl_program.js","webpack://@windborne/grapher/./src/renderer/background_program.js","webpack://@windborne/grapher/./src/renderer/size_canvas.js","webpack://@windborne/grapher/./src/renderer/paths_from.js","webpack://@windborne/grapher/./src/renderer/draw_zero_line.js","webpack://@windborne/grapher/./src/renderer/draw_area.js","webpack://@windborne/grapher/./src/renderer/draw_bars.js","webpack://@windborne/grapher/./src/state/rust_api.js","webpack://@windborne/grapher/./src/renderer/extract_vertices.js","webpack://@windborne/grapher/./src/renderer/line_program.js","webpack://@windborne/grapher/./src/renderer/shadow_program.js","webpack://@windborne/grapher/./src/renderer/graph_body_renderer.js","webpack://@windborne/grapher/./src/renderer/draw_line.js","webpack://@windborne/grapher/./src/renderer/draw_background.js","webpack://@windborne/grapher/./src/helpers/format.js","webpack://@windborne/grapher/./src/helpers/axis_sizes.js","webpack://@windborne/grapher/./src/components/tooltip.jsx","webpack://@windborne/grapher/./src/components/context_menu.jsx","webpack://@windborne/grapher/./src/state/space_conversions/simple_series_to_data_space.js","webpack://@windborne/grapher/./src/state/calculate_data_bounds.js","webpack://@windborne/grapher/./src/state/merge_bounds.js","webpack://@windborne/grapher/./src/state/expand_bounds.js","webpack://@windborne/grapher/./src/helpers/binary_search.js","webpack://@windborne/grapher/./src/state/space_conversions/data_space_to_selected_space.js","webpack://@windborne/grapher/./src/renderer/scale_bounds.js","webpack://@windborne/grapher/./src/state/space_conversions/selected_space_to_render_space.js","webpack://@windborne/grapher/./src/helpers/flatten_simple_data.js","webpack://@windborne/grapher/./src/state/calculate_tooltip_state.js","webpack://@windborne/grapher/./src/state/bound_calculators.js","webpack://@windborne/grapher/./src/state/space_conversions/condense_data_space.js","webpack://@windborne/grapher/./src/helpers/name_for_series.js","webpack://@windborne/grapher/./src/state/space_conversions/selected_space_to_background_space.js","webpack://@windborne/grapher/./src/state/state_controller.js","webpack://@windborne/grapher/./src/state/get_default_bounds_calculator.js","webpack://@windborne/grapher/./src/helpers/generator_params_equal.js","webpack://@windborne/grapher/./src/state/calculate_annotations_state.js","webpack://@windborne/grapher/./src/state/selection_from_global_bounds.js","webpack://@windborne/grapher/./src/state/find_matching_axis.js","webpack://@windborne/grapher/./src/state/average_loop_times.js","webpack://@windborne/grapher/./src/state/bound_calculator_from_selection.js","webpack://@windborne/grapher/./src/state/hooks.js","webpack://@windborne/grapher/./src/components/annotations.jsx","webpack://@windborne/grapher/./src/components/draggable_points.jsx","webpack://@windborne/grapher/./src/components/vertical_lines.jsx","webpack://@windborne/grapher/./src/components/graph_body.jsx","webpack://@windborne/grapher/./src/grapher.scss?e17f","webpack://@windborne/grapher/./src/helpers/place_grid.js","webpack://@windborne/grapher/./src/components/x_axis.jsx","webpack://@windborne/grapher/./src/components/y_axis.jsx","webpack://@windborne/grapher/./src/components/range_selection_button_base.jsx","webpack://@windborne/grapher/./src/components/range_selection_button.jsx","webpack://@windborne/grapher/./src/components/percentile_button.jsx","webpack://@windborne/grapher/./src/components/options.jsx","webpack://@windborne/grapher/./src/components/range_selection.jsx","webpack://@windborne/grapher/./src/components/range_graph.jsx","webpack://@windborne/grapher/./src/components/series_key_item.jsx","webpack://@windborne/grapher/./src/components/series_key_axis_container.jsx","webpack://@windborne/grapher/./src/components/series_key.jsx","webpack://@windborne/grapher/./src/components/graph_title.jsx","webpack://@windborne/grapher/./src/components/sidebar.jsx","webpack://@windborne/grapher/./src/state/sync_pool.js","webpack://@windborne/grapher/./src/grapher.jsx","webpack://@windborne/grapher/./src/state/multigraph_state_controller.js","webpack://@windborne/grapher/./src/multigrapher.jsx"],"sourcesContent":["// 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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lM5B,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.esm.js\";\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 = new URL(\"./\", import.meta.url);\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t792: 0\n};\n\nvar installChunk = (data) => {\n\tvar {ids, modules, runtime} = data;\n\t// add \"modules\" to the modules object,\n\t// then flag all \"ids\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tfor(moduleId in modules) {\n\t\tif(__webpack_require__.o(modules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = modules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\tfor(;i < ids.length; i++) {\n\t\tchunkId = ids[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[ids[i]] = 0;\n\t}\n\n}\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// import() 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[1]);\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 = import(\"./\" + __webpack_require__.u(chunkId)).then(installChunk, (e) => {\n\t\t\t\t\t\tif(installedChunks[chunkId] !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t});\n\t\t\t\t\tvar promise = Promise.race([promise, new Promise((resolve) => (installedChunkData = installedChunks[chunkId] = [resolve]))])\n\t\t\t\t\tpromises.push(installedChunkData[1] = promise);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no external install chunk\n\n// no on chunks loaded","__webpack_require__.nc = undefined;","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"default\"]: () => (__WEBPACK_EXTERNAL_MODULE_react__[\"default\"]), [\"useCallback\"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.useCallback), [\"useEffect\"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.useEffect), [\"useMemo\"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.useMemo), [\"useRef\"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.useRef), [\"useState\"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.useState) });","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 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.number.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","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 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) {\n context.fillStyle = color;\n\n for (let [x, y] of individualPoints) {\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 const firstTime =\n originalData[0][0] instanceof Date\n ? originalData[0][0].getTime()\n : originalData[0][0];\n const lastTime =\n originalData[originalData.length - 1][0] instanceof Date\n ? originalData[originalData.length - 1][0].getTime()\n : originalData[originalData.length - 1][0];\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) {\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 {\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) {\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 let totalLength = 0;\n const pathLengths = [];\n\n for (let path of linePaths) {\n if (path.length > 0) {\n pathLengths.push(path.length);\n totalLength += path.length;\n } else {\n pathLengths.push(0);\n }\n }\n\n if (totalLength === 0) return;\n\n const globalCutoffIndex = timeRatio * totalLength;\n\n let currentIndex = 0;\n let targetPathIndex = -1;\n let cutoffIndexInPath = 0;\n\n for (let i = 0; i < pathLengths.length; i++) {\n if (pathLengths[i] === 0) continue;\n\n if (globalCutoffIndex <= currentIndex + pathLengths[i]) {\n targetPathIndex = i;\n cutoffIndexInPath = globalCutoffIndex - currentIndex;\n break;\n }\n currentIndex += pathLengths[i];\n }\n\n const preCutoffPaths = [];\n const postCutoffPaths = [];\n let ghostPoint = null;\n\n for (let i = 0; i < linePaths.length; i++) {\n const path = linePaths[i];\n if (!path.length) continue;\n\n if (i < targetPathIndex) {\n preCutoffPaths.push(path);\n } else if (i > targetPathIndex) {\n postCutoffPaths.push(path);\n } else if (i === targetPathIndex) {\n const splitIndex = Math.floor(cutoffIndexInPath);\n const fraction = cutoffIndexInPath - splitIndex;\n\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 if (splitIndex > 0) {\n const prePath = path.slice(0, splitIndex + 1);\n if (ghostPoint) prePath.push(ghostPoint);\n preCutoffPaths.push(prePath);\n }\n\n if (splitIndex < path.length - 1) {\n const postPath = [];\n if (ghostPoint) postPath.push(ghostPoint);\n postPath.push(...path.slice(splitIndex + 1));\n postCutoffPaths.push(postPath);\n }\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 cutoffPixelIndex = timeRatio * individualPoints.length;\n\n for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[i];\n\n const isBeforeCutoff = i < cutoffPixelIndex;\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","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 gl.uniform1f(gl.getUniformLocation(this._circleProgram, 'pointSize'), 2*(thickness+6));\n\n const individualPoints = parameters.getIndividualPoints();\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 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 for (let i = 0; i < individualPoints.length; i++) {\n const pointRatio = i / (individualPoints.length - 1);\n if (pointRatio < timeRatio) {\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 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 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 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: 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 const trapezoid = { x1, y1, x2, y2, bottomY1, bottomY2 };\n trapezoids.push(trapezoid);\n }\n }\n\n\n if (trapezoids.length === 0) {\n return;\n }\n\n const geometry = this.generateTrapezoidGeometry(trapezoids);\n\n const positionLoc = gl.getAttribLocation(this._program, \"position\");\n const trapezoidBoundsLoc = gl.getAttribLocation(\n this._program,\n \"trapezoidBounds\"\n );\n const trapezoidBottomLoc = gl.getAttribLocation(\n this._program,\n \"trapezoidBottom\"\n );\n\n gl.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 this.draw(individualPoints, {\n ...params,\n color: reducedOpacityColor,\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 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 from './size_canvas';\nimport { applyReducedOpacity } from \"../helpers/colors\";\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) => {\n if (!useDataSpace && inRenderSpace && inRenderSpace.yValues) {\n const individualPoints = [];\n const { yValues, nullMask } = inRenderSpace;\n \n for (let pixelX = 0; pixelX < yValues.length; pixelX++) {\n if (nullMask[pixelX] === 0) {\n individualPoints.push([pixelX, yValues[pixelX]]);\n }\n }\n \n if (individualPoints.length === 0) {\n return getIndividualPoints(true);\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 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 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 individualPoints.push([\n (xValue - boundsMinX) / (boundsMaxX - boundsMinX) * this._sizing.renderWidth,\n (1.0 - (y - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight\n ]);\n }\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 = 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 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 = 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 = singleSeries.zeroLineY === 'bottom' ?\n this._sizing.renderHeight :\n singleSeries.zeroLineY !== undefined ? \n (1.0 - ((singleSeries.zeroLineY) - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight :\n this._sizing.renderHeight;\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 let shadowParams = {\n color: getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex),\n gradient: singleSeries.gradient,\n zero,\n sizing: this._sizing,\n inRenderSpaceAreaBottom\n };\n\n if (singleSeries.cutoffTime) {\n shadowParams.cutoffIndex = cutoffIndex;\n shadowParams.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), 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 \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 getIndividualPoints,\n getRanges: singleSeries.rangeKey ? getRanges : null,\n rendering: singleSeries.rendering // Pass rendering type for all charts\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 = 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","import {DPI_INCREASE} from './size_canvas';\nimport pathsFrom from './paths_from';\nimport { applyReducedOpacity } from \"../helpers/colors\";\n\nexport default function drawLine(dataInRenderSpace, {\n color, width=1, context, shadowColor='black', shadowBlur=5, dashed=false, dashPattern=null, highlighted=false, showIndividualPoints=false, 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 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 for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[i];\n \n const pointRatio = i / (individualPoints.length - 1);\n const isBeforeCutoff = pointRatio < timeRatio;\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, width + 4, 0, 2 * Math.PI, false);\n context.fill();\n }\n } else if (!selectionBounds) {\n for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[i];\n context.fillStyle = color;\n context.beginPath();\n context.arc(x, y, width + 4, 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 for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[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, width + 4, 0, 2 * Math.PI, false);\n context.fill();\n }\n }\n } else {\n for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[i];\n context.fillStyle = color;\n context.beginPath();\n context.arc(x, y, width + 4, 0, 2 * Math.PI, false);\n context.fill();\n }\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 if (event.cancelable) event.preventDefault();\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 if (event.cancelable) event.preventDefault();\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":["___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","r","Symbol","toStringTag","value","p","b","URL","url","installedChunks","installChunk","ids","runtime","j","installedChunkData","promise","import","then","race","resolve","nc","y","__WEBPACK_EXTERNAL_MODULE_react__","x","SIMPLE_DATA_TYPES","DATA_TYPES","Data","SingleSeries","type","xKey","yKey","xUnixDates","color","xLabel","yLabel","ignoreDiscontinuities","dashed","dashPattern","width","rangeSelectorWidth","axis","expandYWith","defaultAlwaysTooltipped","square","shiftXBy","graph","background","hideFromKey","showIndividualPoints","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","Date","startX","endX","lineOnly","Annotations","DraggablePoint","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","fn","Set","add","off","delete","size","emit","args","arguments","forEach","LINE_COLORS","getColor","seriesColor","multigrapherSeriesIndex","applyReducedOpacity","opacityFactor","startsWith","matches","match","g","parseFloat","hex","slice","split","char","parseInt","applyReducedOpacityToGradient","Array","isArray","stop","position","inferType","useSimpleData","simpleData","observe","colorToVector","parts","part","test","substr","createGLProgram","gl","vertShaderSource","fragShaderSource","vertexShader","createShader","VERTEX_SHADER","shaderSource","compileShader","getShaderParameter","COMPILE_STATUS","console","error","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","totalLength","pathLengths","globalCutoffIndex","currentIndex","targetPathIndex","cutoffIndexInPath","preCutoffPaths","postCutoffPaths","floor","fraction","x1","y1","x2","y2","prePath","postPath","reducedColor","drawPointsWithCutoffByRatio","cutoffPixelIndex","isBeforeCutoff","getBarWidths","closestSpacing","bounds","axisSeriesCount","fullBarWidth","maxX","minX","totalBarWidth","barWidth","barSpacing","rustApiModule","RustAPIPromise","default","RustAPI","extractVerticesFromPaths","pointNumber","positions","prevPositions","indices","Uint32Array","verticesPattern","set","vertexPointer","sourceLength","copyWithin","pointI","prevX","LineProgram","lineVert","lineFrag","_circleProgram","circleVert","circleFrag","_positionBuffer","_prevPositionBuffer","_individualPointBuffer","dispose","clear","drawingBufferWidth","drawingBufferHeight","clearColor","viewport","parameters","thickness","shadowBlur","renderCutoffGradient","cutoffIndex","originalData","drawLineWithCutoff","get_point_number","extract_vertices","extractVertices","positionIndex","prevPositionIndex","vertexIndex","uniform1f","colorVector","cutoffX","ELEMENT_ARRAY_BUFFER","drawElements","UNSIGNED_INT","getIndividualPoints","cutoffTime","baseIndex","cutoffDate","getTime","currentDate","nextDate","currentTime","preCutoffPoints","postCutoffPoints","isPreview","firstTime","selectionBounds","visibleMinTime","visibleMaxTime","cutoffPixelX","point","pixelX","pixelY","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","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","lastTime","firstItem","lastItem","drawSplitShadowTrapezoids","lastPrePoint","firstPostPoint","unshift","disable","DEPTH_TEST","translucentGradient","GraphBodyRenderer","stateController","canvasElement","webgl","checkIntersection","super","_stateController","_checkIntersection","_canvas","_webgl","_context","getContext","_lineProgram","_shadowProgram","alert","_context2d","_initialized","_initializeCanvas","_boundResize","resize","bind","_cachedAxisCount","_onAxisChange","axes","filter","_resizeObserver","disconnect","_intersectionObserver","_zeroLineCanvas","_zeroLineContext","clearRect","render","singleSeries","inRenderSpace","defaultLineWidth","globalBounds","warn","cutoffData","xValue","yValue","currentPoint","nextPoint","nextTime","useDataSpace","currentBounds","inSelectedSpace","inDataSpace","boundsMinX","boundsMaxX","_sizing","commonCPUParams","willReadFrequently","flush","find","tuple","some","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","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","clearTimeout","_intersectionTimeout","isIntersecting","setTimeout","threshold","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","s","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","event","newXT","newYT","xT","yT","stopPropagation","cx","cy","onMouseDown","xOffset","yOffset","onMouseMove","moveEvent","onMouseUp","removeEventListener","addEventListener","verticalLines","isRangeGraph","relevantVerticalLines","line","lineStyle","fontSize","textAnchor","dominantBaseline","points","GraphBody","boundsSelectionEnabled","showTooltips","tooltipOptions","onPointClick","canvasEl","useCallback","el","boundsSelection","setBoundsSelection","start","useTooltipState","showAnnotations","useAnnotationState","useContextMenu","onScroll","onGlobalMouseMove","getTouch","touches","changedTouches","onGlobalTouchStart","touch","cancelable","preventDefault","onGlobalTouchMove","onGlobalTouchEnd","passive","onMouseLeave","currentNode","classList","contains","closest","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.esm.js","mappings":"6FAGIA,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,UCDAD,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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,QAAAA,cAAA,OAAK6B,UAAY,uBAAsBv1B,EAAMqwC,QAAS,kBAAkB,gBAAewZ,SAAsB,eAMjHJ,EAAYxrD,KAAI,CAACwN,EAAQjN,IACrBk1B,EAAAA,QAAAA,cAAC+zB,GAAOjyB,GAAA,CACJ/uB,IAAKjI,GACDwB,EAAK,CACT6/B,SAAUA,EACVioB,8BAA+B0C,EAA0B1C,8BACzDr8C,OAAQA,EACR9N,GAAK,gBAAeksD,KAAkBrrD,IACtCuhD,oBAAqB//C,EAAM2qD,gBAAkB,GAAK,EAClD5C,sBAAuB2B,OAM/Bja,GACA/b,EAAAA,QAAAA,cAAA,OAAK6B,UAAY,uBAAsBv1B,EAAMqwC,QAAS,kBAAkB,gBAAewZ,YAAyB,eAMhI,CAEAU,GAAa90B,aAAe,CACxB4a,MAAO,SAGXka,GAAa52B,UAAYhtB,OAAOkzB,OAAO,CAAC,EAAG4tB,GAAQ9zB,UAAW,CAC1DkzB,WAAY7kD,IAAAA,KACZ8kD,aAAc9kD,IAAAA,KACd2oD,gBAAiB3oD,IAAAA,KACjB0oD,oBAAqB1oD,IAAAA,M","sources":["webpack://@windborne/grapher/./src/grapher.scss","webpack://@windborne/grapher/./node_modules/css-loader/dist/runtime/api.js","webpack://@windborne/grapher/./node_modules/css-loader/dist/runtime/sourceMaps.js","webpack://@windborne/grapher/./node_modules/prop-types/factoryWithThrowingShims.js","webpack://@windborne/grapher/./node_modules/prop-types/index.js","webpack://@windborne/grapher/./node_modules/prop-types/lib/ReactPropTypesSecret.js","webpack://@windborne/grapher/./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js","webpack://@windborne/grapher/./node_modules/style-loader/dist/runtime/insertBySelector.js","webpack://@windborne/grapher/./node_modules/style-loader/dist/runtime/insertStyleElement.js","webpack://@windborne/grapher/./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js","webpack://@windborne/grapher/./node_modules/style-loader/dist/runtime/styleDomAPI.js","webpack://@windborne/grapher/./node_modules/style-loader/dist/runtime/styleTagTransform.js","webpack://@windborne/grapher/./src/renderer/background.frag","webpack://@windborne/grapher/./src/renderer/background.vert","webpack://@windborne/grapher/./src/renderer/circle.frag","webpack://@windborne/grapher/./src/renderer/circle.vert","webpack://@windborne/grapher/./src/renderer/line.frag","webpack://@windborne/grapher/./src/renderer/line.vert","webpack://@windborne/grapher/./src/renderer/shadow.frag","webpack://@windborne/grapher/./src/renderer/shadow.vert","webpack://@windborne/grapher/webpack/bootstrap","webpack://@windborne/grapher/webpack/runtime/compat get default export","webpack://@windborne/grapher/webpack/runtime/define property getters","webpack://@windborne/grapher/webpack/runtime/ensure chunk","webpack://@windborne/grapher/webpack/runtime/get javascript chunk filename","webpack://@windborne/grapher/webpack/runtime/hasOwnProperty shorthand","webpack://@windborne/grapher/webpack/runtime/make namespace object","webpack://@windborne/grapher/webpack/runtime/publicPath","webpack://@windborne/grapher/webpack/runtime/import chunk loading","webpack://@windborne/grapher/webpack/runtime/nonce","webpack://@windborne/grapher/external module \"react\"","webpack://@windborne/grapher/./src/state/data_types.js","webpack://@windborne/grapher/./src/helpers/custom_prop_types.js","webpack://@windborne/grapher/./src/eventable.js","webpack://@windborne/grapher/./src/helpers/colors.js","webpack://@windborne/grapher/./src/state/infer_type.js","webpack://@windborne/grapher/./src/helpers/color_to_vector.js","webpack://@windborne/grapher/./src/renderer/create_gl_program.js","webpack://@windborne/grapher/./src/renderer/background_program.js","webpack://@windborne/grapher/./src/renderer/size_canvas.js","webpack://@windborne/grapher/./src/renderer/paths_from.js","webpack://@windborne/grapher/./src/renderer/draw_zero_line.js","webpack://@windborne/grapher/./src/renderer/draw_area.js","webpack://@windborne/grapher/./src/renderer/draw_bars.js","webpack://@windborne/grapher/./src/state/rust_api.js","webpack://@windborne/grapher/./src/renderer/extract_vertices.js","webpack://@windborne/grapher/./src/renderer/line_program.js","webpack://@windborne/grapher/./src/renderer/shadow_program.js","webpack://@windborne/grapher/./src/renderer/graph_body_renderer.js","webpack://@windborne/grapher/./src/renderer/draw_line.js","webpack://@windborne/grapher/./src/renderer/draw_background.js","webpack://@windborne/grapher/./src/helpers/format.js","webpack://@windborne/grapher/./src/helpers/axis_sizes.js","webpack://@windborne/grapher/./src/components/tooltip.jsx","webpack://@windborne/grapher/./src/components/context_menu.jsx","webpack://@windborne/grapher/./src/state/space_conversions/simple_series_to_data_space.js","webpack://@windborne/grapher/./src/state/calculate_data_bounds.js","webpack://@windborne/grapher/./src/state/merge_bounds.js","webpack://@windborne/grapher/./src/state/expand_bounds.js","webpack://@windborne/grapher/./src/helpers/binary_search.js","webpack://@windborne/grapher/./src/state/space_conversions/data_space_to_selected_space.js","webpack://@windborne/grapher/./src/renderer/scale_bounds.js","webpack://@windborne/grapher/./src/state/space_conversions/selected_space_to_render_space.js","webpack://@windborne/grapher/./src/helpers/flatten_simple_data.js","webpack://@windborne/grapher/./src/state/calculate_tooltip_state.js","webpack://@windborne/grapher/./src/state/bound_calculators.js","webpack://@windborne/grapher/./src/state/space_conversions/condense_data_space.js","webpack://@windborne/grapher/./src/helpers/name_for_series.js","webpack://@windborne/grapher/./src/state/space_conversions/selected_space_to_background_space.js","webpack://@windborne/grapher/./src/state/state_controller.js","webpack://@windborne/grapher/./src/state/get_default_bounds_calculator.js","webpack://@windborne/grapher/./src/helpers/generator_params_equal.js","webpack://@windborne/grapher/./src/state/calculate_annotations_state.js","webpack://@windborne/grapher/./src/state/selection_from_global_bounds.js","webpack://@windborne/grapher/./src/state/find_matching_axis.js","webpack://@windborne/grapher/./src/state/average_loop_times.js","webpack://@windborne/grapher/./src/state/bound_calculator_from_selection.js","webpack://@windborne/grapher/./src/state/hooks.js","webpack://@windborne/grapher/./src/components/annotations.jsx","webpack://@windborne/grapher/./src/components/draggable_points.jsx","webpack://@windborne/grapher/./src/components/vertical_lines.jsx","webpack://@windborne/grapher/./src/components/graph_body.jsx","webpack://@windborne/grapher/./src/grapher.scss?e17f","webpack://@windborne/grapher/./src/helpers/place_grid.js","webpack://@windborne/grapher/./src/components/x_axis.jsx","webpack://@windborne/grapher/./src/components/y_axis.jsx","webpack://@windborne/grapher/./src/components/range_selection_button_base.jsx","webpack://@windborne/grapher/./src/components/range_selection_button.jsx","webpack://@windborne/grapher/./src/components/percentile_button.jsx","webpack://@windborne/grapher/./src/components/options.jsx","webpack://@windborne/grapher/./src/components/range_selection.jsx","webpack://@windborne/grapher/./src/components/range_graph.jsx","webpack://@windborne/grapher/./src/components/series_key_item.jsx","webpack://@windborne/grapher/./src/components/series_key_axis_container.jsx","webpack://@windborne/grapher/./src/components/series_key.jsx","webpack://@windborne/grapher/./src/components/graph_title.jsx","webpack://@windborne/grapher/./src/components/sidebar.jsx","webpack://@windborne/grapher/./src/state/sync_pool.js","webpack://@windborne/grapher/./src/grapher.jsx","webpack://@windborne/grapher/./src/state/multigraph_state_controller.js","webpack://@windborne/grapher/./src/multigrapher.jsx"],"sourcesContent":["// 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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AAA,CACA,iCAAA,CAGF,gHACE,cAAA,CAGF,oIACE,cAAA,CAGF,+GACE,gBAAA,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.esm.js\";\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 = new URL(\"./\", import.meta.url);\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t792: 0\n};\n\nvar installChunk = (data) => {\n\tvar {ids, modules, runtime} = data;\n\t// add \"modules\" to the modules object,\n\t// then flag all \"ids\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tfor(moduleId in modules) {\n\t\tif(__webpack_require__.o(modules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = modules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\tfor(;i < ids.length; i++) {\n\t\tchunkId = ids[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[ids[i]] = 0;\n\t}\n\n}\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// import() 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[1]);\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 = import(\"./\" + __webpack_require__.u(chunkId)).then(installChunk, (e) => {\n\t\t\t\t\t\tif(installedChunks[chunkId] !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t});\n\t\t\t\t\tvar promise = Promise.race([promise, new Promise((resolve) => (installedChunkData = installedChunks[chunkId] = [resolve]))])\n\t\t\t\t\tpromises.push(installedChunkData[1] = promise);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no external install chunk\n\n// no on chunks loaded","__webpack_require__.nc = undefined;","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"default\"]: () => (__WEBPACK_EXTERNAL_MODULE_react__[\"default\"]), [\"useCallback\"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.useCallback), [\"useEffect\"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.useEffect), [\"useMemo\"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.useMemo), [\"useRef\"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.useRef), [\"useState\"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.useState) });","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 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.number.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","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 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) {\n context.fillStyle = color;\n\n for (let [x, y] of individualPoints) {\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 const firstTime =\n originalData[0][0] instanceof Date\n ? originalData[0][0].getTime()\n : originalData[0][0];\n const lastTime =\n originalData[originalData.length - 1][0] instanceof Date\n ? originalData[originalData.length - 1][0].getTime()\n : originalData[originalData.length - 1][0];\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) {\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 {\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) {\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 let totalLength = 0;\n const pathLengths = [];\n\n for (let path of linePaths) {\n if (path.length > 0) {\n pathLengths.push(path.length);\n totalLength += path.length;\n } else {\n pathLengths.push(0);\n }\n }\n\n if (totalLength === 0) return;\n\n const globalCutoffIndex = timeRatio * totalLength;\n\n let currentIndex = 0;\n let targetPathIndex = -1;\n let cutoffIndexInPath = 0;\n\n for (let i = 0; i < pathLengths.length; i++) {\n if (pathLengths[i] === 0) continue;\n\n if (globalCutoffIndex <= currentIndex + pathLengths[i]) {\n targetPathIndex = i;\n cutoffIndexInPath = globalCutoffIndex - currentIndex;\n break;\n }\n currentIndex += pathLengths[i];\n }\n\n const preCutoffPaths = [];\n const postCutoffPaths = [];\n let ghostPoint = null;\n\n for (let i = 0; i < linePaths.length; i++) {\n const path = linePaths[i];\n if (!path.length) continue;\n\n if (i < targetPathIndex) {\n preCutoffPaths.push(path);\n } else if (i > targetPathIndex) {\n postCutoffPaths.push(path);\n } else if (i === targetPathIndex) {\n const splitIndex = Math.floor(cutoffIndexInPath);\n const fraction = cutoffIndexInPath - splitIndex;\n\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 if (splitIndex > 0) {\n const prePath = path.slice(0, splitIndex + 1);\n if (ghostPoint) prePath.push(ghostPoint);\n preCutoffPaths.push(prePath);\n }\n\n if (splitIndex < path.length - 1) {\n const postPath = [];\n if (ghostPoint) postPath.push(ghostPoint);\n postPath.push(...path.slice(splitIndex + 1));\n postCutoffPaths.push(postPath);\n }\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 cutoffPixelIndex = timeRatio * individualPoints.length;\n\n for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[i];\n\n const isBeforeCutoff = i < cutoffPixelIndex;\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","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 gl.uniform1f(gl.getUniformLocation(this._circleProgram, 'pointSize'), 2*(thickness+6));\n\n const individualPoints = parameters.getIndividualPoints();\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 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 for (let i = 0; i < individualPoints.length; i++) {\n const pointRatio = i / (individualPoints.length - 1);\n if (pointRatio < timeRatio) {\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 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 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 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: 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 this.draw(individualPoints, {\n ...params,\n color: reducedOpacityColor,\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 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) {\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 = 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 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 = 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 = singleSeries.zeroLineY === 'bottom' ?\n this._sizing.renderHeight :\n singleSeries.zeroLineY !== undefined ? \n (1.0 - ((singleSeries.zeroLineY) - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight :\n this._sizing.renderHeight;\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 let shadowParams = {\n color: getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex),\n gradient: singleSeries.gradient,\n zero,\n sizing: this._sizing,\n inRenderSpaceAreaBottom\n };\n\n if (singleSeries.cutoffTime) {\n shadowParams.cutoffIndex = cutoffIndex;\n shadowParams.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 getIndividualPoints,\n getRanges: singleSeries.rangeKey ? getRanges : null,\n rendering: singleSeries.rendering // Pass rendering type for all charts\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 = 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","import {DPI_INCREASE} from './size_canvas';\nimport pathsFrom from './paths_from';\nimport { applyReducedOpacity } from \"../helpers/colors\";\n\nexport default function drawLine(dataInRenderSpace, {\n color, width=1, context, shadowColor='black', shadowBlur=5, dashed=false, dashPattern=null, highlighted=false, showIndividualPoints=false, 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 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 for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[i];\n \n const pointRatio = i / (individualPoints.length - 1);\n const isBeforeCutoff = pointRatio < timeRatio;\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, width + 4, 0, 2 * Math.PI, false);\n context.fill();\n }\n } else if (!selectionBounds) {\n for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[i];\n context.fillStyle = color;\n context.beginPath();\n context.arc(x, y, width + 4, 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 for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[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, width + 4, 0, 2 * Math.PI, false);\n context.fill();\n }\n }\n } else {\n for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[i];\n context.fillStyle = color;\n context.beginPath();\n context.arc(x, y, width + 4, 0, 2 * Math.PI, false);\n context.fill();\n }\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 if (event.cancelable) event.preventDefault();\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 if (event.cancelable) event.preventDefault();\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":["___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","r","Symbol","toStringTag","value","p","b","URL","url","installedChunks","installChunk","ids","runtime","j","installedChunkData","promise","import","then","race","resolve","nc","y","__WEBPACK_EXTERNAL_MODULE_react__","x","SIMPLE_DATA_TYPES","DATA_TYPES","Data","SingleSeries","type","xKey","yKey","xUnixDates","color","xLabel","yLabel","ignoreDiscontinuities","dashed","dashPattern","width","rangeSelectorWidth","axis","expandYWith","defaultAlwaysTooltipped","square","shiftXBy","graph","background","hideFromKey","showIndividualPoints","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","Date","startX","endX","lineOnly","Annotations","DraggablePoint","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","fn","Set","add","off","delete","size","emit","args","arguments","forEach","LINE_COLORS","getColor","seriesColor","multigrapherSeriesIndex","applyReducedOpacity","opacityFactor","startsWith","matches","match","g","parseFloat","hex","slice","split","char","parseInt","applyReducedOpacityToGradient","Array","isArray","stop","position","inferType","useSimpleData","simpleData","observe","colorToVector","parts","part","test","substr","createGLProgram","gl","vertShaderSource","fragShaderSource","vertexShader","createShader","VERTEX_SHADER","shaderSource","compileShader","getShaderParameter","COMPILE_STATUS","console","error","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","totalLength","pathLengths","globalCutoffIndex","currentIndex","targetPathIndex","cutoffIndexInPath","preCutoffPaths","postCutoffPaths","floor","fraction","x1","y1","x2","y2","prePath","postPath","reducedColor","drawPointsWithCutoffByRatio","cutoffPixelIndex","isBeforeCutoff","getBarWidths","closestSpacing","bounds","axisSeriesCount","fullBarWidth","maxX","minX","totalBarWidth","barWidth","barSpacing","rustApiModule","RustAPIPromise","default","RustAPI","extractVerticesFromPaths","pointNumber","positions","prevPositions","indices","Uint32Array","verticesPattern","set","vertexPointer","sourceLength","copyWithin","pointI","prevX","LineProgram","lineVert","lineFrag","_circleProgram","circleVert","circleFrag","_positionBuffer","_prevPositionBuffer","_individualPointBuffer","dispose","clear","drawingBufferWidth","drawingBufferHeight","clearColor","viewport","parameters","thickness","shadowBlur","renderCutoffGradient","cutoffIndex","originalData","drawLineWithCutoff","get_point_number","extract_vertices","extractVertices","positionIndex","prevPositionIndex","vertexIndex","uniform1f","colorVector","cutoffX","ELEMENT_ARRAY_BUFFER","drawElements","UNSIGNED_INT","getIndividualPoints","cutoffTime","baseIndex","cutoffDate","getTime","currentDate","nextDate","currentTime","preCutoffPoints","postCutoffPoints","isPreview","firstTime","selectionBounds","visibleMinTime","visibleMaxTime","cutoffPixelX","point","pixelX","pixelY","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","lastTime","firstItem","lastItem","drawSplitShadowTrapezoids","lastPrePoint","firstPostPoint","unshift","disable","DEPTH_TEST","translucentGradient","GraphBodyRenderer","stateController","canvasElement","webgl","checkIntersection","super","_stateController","_checkIntersection","_canvas","_webgl","_context","getContext","_lineProgram","_shadowProgram","alert","_context2d","_initialized","_initializeCanvas","_boundResize","resize","bind","_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","some","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","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","clearTimeout","_intersectionTimeout","isIntersecting","setTimeout","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","s","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","event","newXT","newYT","xT","yT","stopPropagation","cx","cy","onMouseDown","xOffset","yOffset","onMouseMove","moveEvent","onMouseUp","removeEventListener","addEventListener","verticalLines","isRangeGraph","relevantVerticalLines","line","lineStyle","fontSize","textAnchor","dominantBaseline","points","GraphBody","boundsSelectionEnabled","showTooltips","tooltipOptions","onPointClick","canvasEl","useCallback","el","boundsSelection","setBoundsSelection","start","useTooltipState","showAnnotations","useAnnotationState","useContextMenu","onScroll","onGlobalMouseMove","getTouch","touches","changedTouches","onGlobalTouchStart","touch","cancelable","preventDefault","onGlobalTouchMove","onGlobalTouchEnd","passive","onMouseLeave","currentNode","classList","contains","closest","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":""}