@windborne/grapher 1.0.33 → 1.0.34

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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C,EAA2B7qD,EAAM0L,UAErC6pC,EAAAA,EAAAA,YAAU,IACDv1C,EAAM+qD,qBAIXF,EAA0B97C,GAAG,uBAAwB/O,EAAM+qD,qBACpD,KACHF,EAA0Bz7C,IAAI,uBAAwBpP,EAAM+qD,oBAAoB,GALzE,QAOZ,CAACF,EAA2B7qD,EAAM+qD,sBAErC,MAAMhb,EAAYqG,GAAayU,GAE/B,OACIj3B,EAAAA,QAAAA,cAAA,OAAK6B,UAAU,gBAEPsa,GAAa/vC,EAAMgrD,iBACfp3B,EAAAA,QAAAA,cAAA,OAAK6B,UAAY,uBAAsBz1B,EAAM2wC,QAAS,kBAAkB,gBAAeuZ,SAAsB,eAMjHJ,EAAY7rD,KAAI,CAACyN,EAAQlN,IACrBo1B,EAAAA,QAAAA,cAACk0B,GAAOpyB,GAAA,CACJjvB,IAAKjI,GACDwB,EAAK,CACT+/B,SAAUA,EACVooB,8BAA+B0C,EAA0B1C,8BACzDz8C,OAAQA,EACR/N,GAAK,gBAAeusD,KAAkB1rD,IACtC4hD,oBAAqBpgD,EAAMgrD,gBAAkB,GAAK,EAClD5C,sBAAuB2B,OAM/Bha,GACAnc,EAAAA,QAAAA,cAAA,OAAK6B,UAAY,uBAAsBz1B,EAAM2wC,QAAS,kBAAkB,gBAAeuZ,YAAyB,eAMhI,CAEAU,GAAaj1B,aAAe,CACxBgb,MAAO,SAGXia,GAAa/2B,UAAYltB,OAAOozB,OAAO,CAAC,EAAG+tB,GAAQj0B,UAAW,CAC1DqzB,WAAYllD,IAAAA,KACZmlD,aAAcnlD,IAAAA,KACdgpD,gBAAiBhpD,IAAAA,KACjB+oD,oBAAqB/oD,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/renderer/draw_line.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_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,CAC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,CAEA,mFACE,oBAuQoC,CAtQpC,gBAAA,CAIF,2FACE,WAkQsC,CAjQtC,gBAAA,CACA,kBAAA,CAGF,sFACE,SA8PwC,CA3P1C,gFACE,YAyPkC,CAxPlC,gBAAA,CAGF,uFACE,WAsPyC,CArPzC,gBAAA,CACA,gBAAA,CAGF,2FACE,gBAAA,CAGF,uFACE,WA8O2B,CA7O3B,YA8OgC,CA7OhC,gBAAA,CACA,gBAAA,CACA,gDAAA,CAIA,yGACE,gBAAA,CAGF,0GACE,WAiOyB,CAhOzB,cAAA,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 minPointSpacing: PropTypes.number,\n rendering: PropTypes.oneOf(['line', 'bar', 'area', 'shadow']), // defaults to line\n negativeColor: PropTypes.string, // only applies to bar\n gradient: PropTypes.array, // only applies to area\n zeroLineWidth: PropTypes.number, // only applies to bar and area\n zeroLineColor: PropTypes.string, // only applies to bar and area\n zeroLineY: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), // only applies to bar and area\n pointRadius: PropTypes.number, // only applies to area\n tooltipWidth: PropTypes.number,\n hasAreaBottom: PropTypes.bool,\n shadowColor: PropTypes.string,\n gradient: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.array])), // gradient colors or [position, color] pairs\n rangeKey: PropTypes.string\n});\n\nconst Series = PropTypes.arrayOf(SingleSeries);\n\nconst Axis = PropTypes.shape({\n axisIndex: PropTypes.number.isRequired,\n series: PropTypes.array.isRequired,\n side: PropTypes.oneOf(['left', 'right']).isRequired,\n scale: PropTypes.oneOf(['linear', 'log']).isRequired,\n label: PropTypes.string\n});\n\nconst Axes = PropTypes.arrayOf(Axis);\n\nconst CustomBoundsSelector = PropTypes.shape({\n label: PropTypes.string.isRequired,\n calculator: PropTypes.func.isRequired,\n datesOnly: PropTypes.bool\n});\n\nconst CustomBoundsSelectors = PropTypes.arrayOf(CustomBoundsSelector);\n\nconst TooltipOptionsRaw = {\n includeSeriesLabel: PropTypes.bool,\n includeXLabel: PropTypes.bool,\n includeYLabel: PropTypes.bool,\n includeXValue: PropTypes.bool,\n includeYValue: PropTypes.bool,\n floating: PropTypes.bool,\n alwaysFixedPosition: PropTypes.bool,\n floatPosition: PropTypes.oneOf(['top', 'bottom']),\n floatDelta: PropTypes.number,\n savingDisabled: PropTypes.bool,\n customTooltip: PropTypes.func,\n combineTooltips: PropTypes.oneOfType([PropTypes.bool, PropTypes.number])\n};\n\nconst TooltipOptions = PropTypes.shape(TooltipOptionsRaw);\n\nconst Annotation = PropTypes.shape({\n x: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.instanceOf(Date)]),\n startX: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.instanceOf(Date)]),\n endX: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.instanceOf(Date)]),\n series: PropTypes.arrayOf(PropTypes.string),\n content: PropTypes.string,\n lineOnly: PropTypes.bool\n});\nconst Annotations = PropTypes.arrayOf(Annotation);\n\nconst DraggablePoint = PropTypes.shape({\n x: PropTypes.number.isRequired,\n y: PropTypes.number.isRequired,\n radius: PropTypes.number,\n fillColor: PropTypes.string,\n strokeColor: PropTypes.string,\n strokeWidth: PropTypes.number,\n onClick: PropTypes.func,\n onDoubleClick: PropTypes.func\n});\nconst DraggablePoints = PropTypes.arrayOf(DraggablePoint);\n\nconst VerticalLine = PropTypes.shape({\n x: PropTypes.oneOfType([PropTypes.number, PropTypes.instanceOf(Date)]).isRequired,\n color: PropTypes.string,\n lineTop: PropTypes.number,\n width: PropTypes.number,\n markTop: PropTypes.bool,\n style: PropTypes.object,\n markerStyle: PropTypes.object,\n text: PropTypes.string,\n textTop: PropTypes.number,\n textStyle: PropTypes.object,\n minPixelX: PropTypes.number,\n maxPixelX: PropTypes.number,\n onRangeGraph: PropTypes.oneOfType([\n PropTypes.bool,\n PropTypes.object // anything that can be passed into the overall vertical line\n ]),\n onRangeGraphOnly: PropTypes.bool\n});\nconst VerticalLines = PropTypes.arrayOf(VerticalLine);\n\nconst CustomPropTypes = {\n Data,\n SingleSeries,\n Series,\n Axis,\n Axes,\n CustomBoundsSelector,\n CustomBoundsSelectors,\n TooltipOptions,\n TooltipOptionsRaw,\n Annotations,\n DraggablePoint,\n DraggablePoints,\n VerticalLine,\n VerticalLines\n};\n\n\nexport default CustomPropTypes;\n","export default class Eventable {\n\n constructor() {\n this._listeners = {};\n }\n\n /**\n * Clears all listeners\n * @protected\n */\n clearListeners() {\n this._listeners = {};\n }\n\n /**\n * Create a new listener for the event\n * When the event is emitted, it will call the provided function\n *\n * @param {String|symbol} eventName - the name of the event to start listening to\n * @param {Function} fn - the listener to add\n */\n on(eventName, fn) {\n this._listeners[eventName] = this._listeners[eventName] || new Set();\n this._listeners[eventName].add(fn);\n }\n\n /**\n * Removes an existing listener for the event\n *\n * @param {String|symbol} eventName - the name of the event to stop listening to\n * @param {Function} fn - the listener to remove\n */\n off(eventName, fn) {\n if (!this._listeners[eventName]) {\n return;\n }\n\n this._listeners[eventName].delete(fn);\n\n if (this._listeners[eventName].size === 0) {\n delete this._listeners[eventName];\n }\n }\n\n /**\n * Emits an event that will go out to all _listeners on eventName\n *\n * @param {String|symbol} eventName - the name of the event to emit\n */\n emit(eventName) {\n if (!this._listeners[eventName]) {\n return;\n }\n\n const args = [];\n for (let i = 1; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n\n this._listeners[eventName].forEach((fn) => {\n fn.apply(this, args);\n });\n }\n\n}\n","export const LINE_COLORS = [\n \"#F1C232\",\n \"#1259f8\",\n \"#cb4b4b\",\n \"#4da74d\",\n \"#9440ed\",\n \"#61e0ed\",\n \"#ed6d2c\",\n \"#ed13c6\",\n \"#bbed59\",\n];\n\nexport default function getColor(seriesColor, i, multigrapherSeriesIndex) {\n if (typeof seriesColor === \"string\") {\n return seriesColor;\n }\n\n if (typeof seriesColor === \"number\") {\n return LINE_COLORS[seriesColor % LINE_COLORS.length];\n }\n\n if (multigrapherSeriesIndex !== undefined) {\n return LINE_COLORS[multigrapherSeriesIndex % LINE_COLORS.length];\n }\n\n return LINE_COLORS[i % LINE_COLORS.length];\n}\n\n/**\n * Applies reduced opacity to a color\n * @param {string} color \n * @param {number} opacityFactor \n * @returns {string}\n */\nexport function applyReducedOpacity(color, opacityFactor) {\n if (!color) return color;\n\n if (color.startsWith(\"rgba(\")) {\n const matches = color.match(/rgba\\((\\d+),\\s*(\\d+),\\s*(\\d+),\\s*([\\d.]+)\\)/);\n if (matches) {\n const [, r, g, b, a] = matches;\n const newAlpha = parseFloat(a) * opacityFactor;\n return `rgba(${r}, ${g}, ${b}, ${newAlpha})`;\n }\n }\n\n if (color.startsWith(\"rgb(\")) {\n const matches = color.match(/rgb\\((\\d+),\\s*(\\d+),\\s*(\\d+)\\)/);\n if (matches) {\n const [, r, g, b] = matches;\n return `rgba(${r}, ${g}, ${b}, ${opacityFactor})`;\n }\n }\n\n if (color.startsWith(\"#\")) {\n let hex = color.slice(1);\n if (hex.length === 3) {\n hex = hex\n .split(\"\")\n .map((char) => char + char)\n .join(\"\");\n }\n const r = parseInt(hex.slice(0, 2), 16);\n const g = parseInt(hex.slice(2, 4), 16);\n const b = parseInt(hex.slice(4, 6), 16);\n return `rgba(${r}, ${g}, ${b}, ${opacityFactor})`;\n }\n\n return color;\n}\n\n/**\n * Applies reduced opacity to a gradient\n * @param {Array<[number, string]>} gradient \n * @param {number} opacityFactor \n * @returns {Array<[number, string]>}\n */\nexport function applyReducedOpacityToGradient(gradient, opacityFactor) {\n if (!gradient || !Array.isArray(gradient)) {\n return gradient;\n }\n\n return gradient.map((stop) => {\n if (Array.isArray(stop) && stop.length === 2) {\n const [position, color] = stop;\n const translucentColor = applyReducedOpacity(color, opacityFactor);\n return [position, translucentColor];\n } else if (typeof stop === \"string\") {\n return applyReducedOpacity(stop, opacityFactor);\n }\n return stop;\n });\n}\n\n/**\n * Creates a default gradient from a color at half opacity\n * @param {string} color \n * @returns {Array<[number, string]>}\n */\nexport function createDefaultGradient(color) {\n if (!color) return [[0, 'transparent'], [1, 'transparent']];\n \n const halfOpacityColor = applyReducedOpacity(color, 0.5);\n return [[0, halfOpacityColor], [1, halfOpacityColor]];\n}\n","import {extractYValue} from '../helpers/flatten_simple_data.js';\n\n/**\n * Given a series object, figures out the form of the data\n * Note that this is not a validator, nor is it guaranteed to get it right 100% of the time!\n * If it is giving the wrong type, it is recommended to specify the type manually\n *\n * @param {*} series\n * @param {Boolean} options.useSimpleData\n * @param {Array} options.data\n * @return {String}\n */\nexport default function inferType(series, options={ useSimpleData: false }) {\n if (series.type && series.type !== 'infer') {\n return series.type;\n }\n\n const data = options.data || (options.useSimpleData ? (series.simpleData || series.data) : series.data);\n\n if (!data) {\n throw new Error('Data must be provided');\n }\n\n if (Array.isArray(data)) {\n if (data.length === 0) {\n return 'tuples';\n }\n\n if (Array.isArray(data[0])) {\n return 'tuples';\n }\n\n if (typeof data[0] === 'number' || !data[0]) {\n return 'values';\n }\n\n return 'objects';\n }\n\n if (data.observe) {\n if (series.xKey) {\n return 'object_observable';\n } else {\n return 'tuple_observable';\n }\n }\n\n if (typeof data === 'function') {\n return 'generator';\n }\n\n throw new Error('Could not infer type');\n}\n\n/**\n *\n * @param simpleData\n * @param singleSeries\n * @return {boolean}\n */\nexport function isEnumLike(simpleData, singleSeries) {\n for (let i = 0; i < simpleData.length; i++) {\n const y = extractYValue(simpleData[simpleData.length - 1], singleSeries);\n if (y === null || y === undefined) {\n continue;\n }\n\n if (typeof y === 'string') {\n return true;\n }\n }\n\n return false;\n}\n","/**\n * Returns the color as a [r, g, b, a] array with domain 0 to 1 for use in webgl\n *\n * @param color\n * @return {[number, number, number, number]|[number, number, number, number]}\n */\nexport default function colorToVector(color) {\n if (color === 'black') {\n color = '#000000';\n } else if (color === 'white') {\n color = '#FFFFFF';\n } else if (color === 'transparent') {\n return [0, 0, 0, 0];\n }\n\n if (color.startsWith('rgb')) {\n const parts = color.split(',').map((part) => parseFloat(part.match(/\\d+(\\.\\d+)?/)[0]));\n return [\n parts[0]/255,\n parts[1]/255,\n parts[2]/255,\n parts.length >= 4 ? parts[3] : 1\n ];\n }\n\n if (typeof color !== 'string' || !/^#[\\dA-F]{3}$|^#[\\dA-F]{6}$/i.test(color)) {\n throw new Error(`Color must be a hex string: ${color}`);\n }\n\n // support for short hex codes, expanding 3-digit hex to 6-digit\n if (color.length === 4) {\n color = '#' + color[1] + color[1] + color[2] + color[2] + color[3] + color[3];\n }\n\n const r = parseInt(color.substr(1, 2), 16)/255;\n const g = parseInt(color.substr(3, 2), 16)/255;\n const b = parseInt(color.substr(5, 2), 16)/255;\n const a = 1.0;\n return [r, g, b, a];\n}\n","/**\n * Creates a webgl program, linking the shaders and checking for errors\n *\n * @param gl\n * @param vertShaderSource\n * @param fragShaderSource\n * @return {WebGLProgram}\n */\nexport default function createGLProgram(gl, vertShaderSource, fragShaderSource) {\n const vertexShader = gl.createShader(gl.VERTEX_SHADER);\n gl.shaderSource(vertexShader, vertShaderSource);\n gl.compileShader(vertexShader);\n if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) {\n console.error(gl.getShaderInfoLog(vertexShader)); // eslint-disable-line no-console\n return null;\n }\n\n const fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n gl.shaderSource(fragmentShader, fragShaderSource);\n gl.compileShader(fragmentShader);\n if (!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)) {\n console.error(gl.getShaderInfoLog(fragmentShader)); // eslint-disable-line no-console\n return null;\n }\n\n const program = gl.createProgram();\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n\n gl.linkProgram(program);\n \n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n console.error('Shader program linking failed:', gl.getProgramInfoLog(program));\n return null;\n }\n\n gl.validateProgram(program);\n if (!gl.getProgramParameter(program, gl.VALIDATE_STATUS)) {\n console.error('Shader program validation failed:', gl.getProgramInfoLog(program));\n return null;\n }\n\n return program;\n}\n","import backgroundFrag from './background.frag';\nimport backgroundVert from './background.vert';\nimport colorToVector from '../helpers/color_to_vector';\nimport createGLProgram from './create_gl_program';\n\nexport default class BackgroundProgram {\n\n constructor(gl) {\n this._gl = gl;\n\n this._program = createGLProgram(gl, backgroundVert, backgroundFrag);\n\n this._vertexBuffer = gl.createBuffer();\n this._indexBuffer = gl.createBuffer();\n\n if (!gl.getExtension('OES_element_index_uint')) {\n console.error('Your browser does not support OES_element_index_uint'); // eslint-disable-line no-console\n }\n }\n\n draw({ data }) {\n const gl = this._gl;\n gl.useProgram(this._program);\n\n // gl.disable(gl.DEPTH_TEST);\n\n for (let { minXt, maxXt, color } of data) {\n gl.uniform4f(gl.getUniformLocation(this._program, 'color'), ...colorToVector(color));\n\n const vertices = new Float32Array([\n minXt, 1, maxXt, 1, maxXt, -1,\n minXt, 1, maxXt, -1, minXt, -1\n ]);\n\n gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n\n const positionLocation = gl.getAttribLocation(this._program, 'position');\n gl.enableVertexAttribArray(positionLocation);\n gl.vertexAttribPointer(positionLocation, 2, gl.FLOAT, false, 0, 0);\n\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n }\n }\n\n}\n","export const DPI_INCREASE = 2;\n\n/**\n * Sizes the canvas such that rendering is pixel perfect\n * Returns the sizing information\n *\n * @param {HTMLCanvasElement} canvas\n * @param {CanvasRenderingContext2D} context\n * @param {Boolean} reset - if true, will reset the canvas size before checking sizing\n * @return {Promise<{boundingRect: DOMRect, pixelRatio: number, elementHeight: number, renderWidth: number, renderHeight: number, elementWidth: number}>}\n */\nexport default async function sizeCanvas(canvas, context, {reset=true}={}) {\n if (reset) {\n canvas.width = '';\n canvas.height = '';\n canvas.style.width = '0';\n canvas.style.height = '';\n\n await new Promise((resolve) => requestAnimationFrame(resolve));\n }\n\n let boundingRect = canvas.parentNode.getBoundingClientRect();\n\n while (boundingRect.width === 0) {\n await new Promise((resolve) => requestAnimationFrame(resolve));\n boundingRect = canvas.getBoundingClientRect();\n }\n\n const dpr = window.devicePixelRatio || 1;\n const bsr = context.webkitBackingStorePixelRatio ||\n context.mozBackingStorePixelRatio ||\n context.msBackingStorePixelRatio ||\n context.oBackingStorePixelRatio ||\n context.backingStorePixelRatio || 1;\n\n const pixelRatio = DPI_INCREASE*dpr / bsr;\n\n const elementWidth = boundingRect.width;\n const elementHeight = boundingRect.height;\n const renderWidth = elementWidth * pixelRatio;\n const renderHeight = elementHeight * pixelRatio;\n\n canvas.width = renderWidth;\n canvas.height = renderHeight;\n canvas.style.width = `${elementWidth}px`;\n canvas.style.height = `${elementHeight}px`;\n\n // We could us this to make coordinates behave as if they weren't transformed if we wanted\n // context.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0)\n\n return {\n pixelRatio,\n elementWidth,\n elementHeight,\n renderWidth,\n renderHeight,\n boundingRect\n };\n}\n","import {DPI_INCREASE} from './size_canvas';\n\n/**\n * Returns an array of contiguous paths from data in render space\n *\n * @param {{nullMask: Uint8Array, maxYValues: Float64Array, minYValues: Float64Array, yValues: Float64Array}} dataInRenderSpace\n * @param {Object} options\n * @param {Number} options.splitAtY - split the path whenever it's suddenly less or greater than this value\n * @return {[[Number]]}\n */\nexport default function pathsFrom(dataInRenderSpace, {splitAtY}={}) {\n const paths = [];\n let currentPath = [];\n let previouslyDiscontinuous = true;\n\n const { nullMask, maxYValues, minYValues, yValues } = dataInRenderSpace;\n\n for (let i = 0; i < yValues.length; i++) {\n const x = i*DPI_INCREASE;\n const y = yValues[i];\n\n if (nullMask[i] & 0b001) { // y null\n if (!previouslyDiscontinuous) {\n paths.push(currentPath);\n currentPath = [];\n }\n\n previouslyDiscontinuous = true;\n continue;\n }\n\n currentPath.push([x, y]);\n\n const minY = minYValues[i];\n const maxY = maxYValues[i];\n\n if (minY !== maxY) {\n if (!(nullMask[i] & 0b010)) {\n currentPath.push([x, minY]);\n }\n\n if (!(nullMask[i] & 0b100)) {\n currentPath.push([x, maxY]);\n }\n currentPath.push([x, y]);\n }\n\n previouslyDiscontinuous = false;\n\n if (typeof splitAtY === 'number' && i > 0) {\n const prevY = yValues[i-1];\n const signFlipped = !(nullMask[i-1] & 0b001) && (prevY < splitAtY && y >= splitAtY) || (prevY > splitAtY && y <= splitAtY) || (prevY === splitAtY && y !== splitAtY);\n\n if (signFlipped) {\n if (!previouslyDiscontinuous) {\n paths.push(currentPath);\n currentPath = [\n [x, y]\n ];\n }\n\n previouslyDiscontinuous = true;\n }\n }\n }\n\n if (!previouslyDiscontinuous) {\n paths.push(currentPath);\n }\n\n return paths;\n}\n","/**\n * Draws a horizontal line at the specified y-coordinate.\n *\n * @param {Number} y\n * @param {Object} options\n * @param {CanvasRenderingContext2D} options.context\n * @param {{renderWidth: Number, renderHeight: Number}} options.sizing\n * @param {String} options.color\n * @param {String} options.zeroColor\n * @param {Number} options.zeroWidth\n */\nexport function drawZeroLine(y, { context, sizing, color, zeroColor, zeroWidth}) {\n if (!zeroWidth) {\n return;\n }\n\n if (!context) {\n console.error('Canvas context is null in drawZeroLine');\n return;\n }\n\n context.strokeStyle = zeroColor || color;\n context.lineWidth = zeroWidth;\n\n context.beginPath();\n context.moveTo(0, y);\n context.lineTo(sizing.renderWidth, y);\n context.stroke();\n}\n","import pathsFrom from \"./paths_from\";\nimport { drawZeroLine } from \"./draw_zero_line\";\nimport { DPI_INCREASE } from \"./size_canvas\";\nimport { applyReducedOpacity, applyReducedOpacityToGradient } from \"../helpers/colors\";\n\n/**\n * Draws the data on the canvas\n * Assumes the data is in individual point render space, ie x and y in pixels\n *\n * @param {Array<[number, number]>} individualPoints - data to draw\n * @param {Object} dataInRenderSpace\n * @param {Object} options - set of options\n * @param {Object} options.context - the context to draw on\n * @param {String} options.color - color of the bar to draw\n * @param {{renderWidth: Number, renderHeight: Number}} options.sizing - size of the canvas, in pixels\n * @param {Number} options.zero - y coordinate that represents \"zero\"\n * @param {Boolean} options.hasNegatives - if any values are negative (in which case should render from zero)\n * @param {Array<String>} [options.gradient] - an array of stops, from top to bottom of canvas, to draw with\n * @param {String} [options.zeroColor] - color of the zero line\n * @param {Number} [options.zeroWidth] - width of the zero line\n * @param {Boolean} [options.showIndividualPoints] - draw circles at each point\n * @param {String} [options.negativeColor] - color of the area below zero\n * @param {Number} [options.width] - line width\n * @param {Object} [options.inRenderSpaceAreaBottom] - if provided, will use this as the area bottom instead of zero/sizing.renderHeight\n * @private\n */\nexport default function drawArea(\n individualPoints,\n dataInRenderSpace,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n showIndividualPoints,\n negativeColor,\n pointRadius,\n minPointSpacing,\n width,\n highlighted,\n shadowColor = \"black\",\n shadowBlur = 5,\n inRenderSpaceAreaBottom,\n cutoffIndex,\n cutoffOpacity,\n originalData,\n renderCutoffGradient,\n selectionBounds,\n isPreview,\n }\n) {\n if (!context) {\n console.error(\"Canvas context is null in drawArea\");\n return;\n }\n\n context.fillStyle = color;\n context.shadowColor = shadowColor;\n context.shadowBlur = shadowBlur;\n\n if (gradient && gradient.length >= 2) {\n const globalGradient = context.createLinearGradient(\n 0,\n 0,\n 0,\n sizing.renderHeight\n );\n\n for (let i = 0; i < gradient.length; i++) {\n const value = gradient[i];\n if (Array.isArray(value)) {\n globalGradient.addColorStop(value[0], value[1]);\n } else {\n globalGradient.addColorStop(i / (gradient.length - 1), value);\n }\n }\n\n context.fillStyle = globalGradient;\n\n if (color === \"gradient\") {\n context.strokeStyle = globalGradient;\n }\n } else {\n context.fillStyle = color;\n }\n\n if (!individualPoints.length) {\n return;\n }\n\n // we want to draw a polygon with a flat line at areaBottom, and then follows the shape of the data\n const areaBottom = hasNegatives ? zero : sizing.renderHeight;\n\n const areaPaths = pathsFrom(dataInRenderSpace);\n const areaBottomPaths =\n inRenderSpaceAreaBottom && pathsFrom(inRenderSpaceAreaBottom);\n\n const linePaths = pathsFrom(dataInRenderSpace, {\n splitAtY: zero,\n });\n\n if (renderCutoffGradient && cutoffIndex !== undefined && originalData) {\n drawAreaWithCutoff(\n individualPoints,\n areaPaths,\n areaBottomPaths,\n linePaths,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n showIndividualPoints,\n negativeColor,\n pointRadius,\n width,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n cutoffIndex,\n cutoffOpacity,\n originalData,\n selectionBounds,\n isPreview,\n }\n );\n return;\n }\n\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n context.beginPath();\n\n const [firstX, _startY] = path[0];\n const [lastX, _lastY] = path[path.length - 1];\n\n if (!areaBottomPaths) {\n context.moveTo(firstX, areaBottom);\n }\n\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n context.lineTo(x, y);\n }\n\n if (areaBottomPath && areaBottomPath.length) {\n for (let i = areaBottomPath.length - 1; i >= 0; i--) {\n const [x, y] = areaBottomPath[i];\n context.lineTo(x, y);\n }\n\n context.lineTo(...path[0]);\n } else {\n context.lineTo(lastX, areaBottom);\n }\n\n context.fill();\n }\n\n if (highlighted) {\n width += 2;\n }\n\n width *= DPI_INCREASE;\n context.strokeStyle = color;\n context.lineWidth = width;\n\n for (let path of linePaths) {\n if (!path.length) {\n continue;\n }\n\n if (hasNegatives) {\n let positive = true;\n if (path.length >= 2) {\n positive = path[1][1] <= zero;\n } else {\n positive = path[0][1] <= zero;\n }\n\n if (positive) {\n context.strokeStyle = color;\n } else {\n context.strokeStyle = negativeColor;\n }\n }\n\n context.beginPath();\n\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n\n context.stroke();\n }\n\n if (zeroWidth) {\n drawZeroLine(areaBottom, {\n context,\n sizing,\n color,\n zero,\n zeroColor,\n zeroWidth,\n });\n }\n\n if (showIndividualPoints && !renderCutoffGradient) {\n context.fillStyle = color;\n\n // Apply point spacing for individual point circles only\n function applyPointSpacing(points, minSpacing) {\n if (!minSpacing || points.length <= 1) {\n return points;\n }\n \n const spacedPoints = [];\n let lastX = -Infinity;\n \n for (const point of points) {\n const [x] = point;\n if (x - lastX >= minSpacing) {\n spacedPoints.push(point);\n lastX = x;\n }\n }\n \n return spacedPoints;\n }\n\n const pointsToRender = applyPointSpacing(individualPoints, minPointSpacing);\n for (let [x, y] of pointsToRender) {\n if (negativeColor && hasNegatives) {\n if (y === zero && zeroColor) {\n context.fillStyle = zeroColor;\n } else if (y < zero) {\n context.fillStyle = color;\n } else {\n context.fillStyle = negativeColor;\n }\n }\n\n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n }\n}\n\n/**\n * Draws the data on the canvas with cutoff\n * Assumes the data is in individual point render space, ie x and y in pixels\n *\n * @param {Array<[number, number]>} individualPoints - data to draw\n * @param {Object} options - set of options\n * @param {Object} options.context - the context to draw on\n * @param {String} options.color - color of the area to draw\n * @param {{renderWidth: Number, renderHeight: Number}} options.sizing - size of the canvas, in pixels\n * @param {Number} options.zero - y coordinate that represents \"zero\"\n * @param {Boolean} options.hasNegatives - if any values are negative (in which case should render from zero)\n * @param {Array<String>} [options.gradient] - an array of stops, from top to bottom of canvas, to draw with\n * @param {String} [options.zeroColor] - color of the zero line\n * @param {Number} [options.zeroWidth] - width of the zero line\n * @param {Boolean} [options.showIndividualPoints] - draw circles at each point\n * @param {String} [options.negativeColor] - color of the area below zero\n * @param {Number} [options.width] - line width\n * @param {Object} [options.inRenderSpaceAreaBottom] - if provided, will use this as the area bottom instead of zero/sizing.renderHeight\n * @private\n */\nfunction drawAreaWithCutoff(\n individualPoints,\n areaPaths,\n areaBottomPaths,\n linePaths,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n showIndividualPoints,\n negativeColor,\n pointRadius,\n width,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n cutoffIndex,\n cutoffOpacity,\n originalData,\n selectionBounds,\n isPreview,\n }\n) {\n let cutoffTime;\n if (typeof originalData[0] === \"object\" && originalData[0].length === 2) {\n const baseIndex = Math.floor(cutoffIndex);\n const fraction = cutoffIndex - baseIndex;\n\n if (fraction === 0 || baseIndex >= originalData.length - 1) {\n const cutoffDate =\n originalData[Math.min(baseIndex, originalData.length - 1)][0];\n cutoffTime =\n cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n } else {\n const currentDate = originalData[baseIndex][0];\n const nextDate = originalData[baseIndex + 1][0];\n const currentTime =\n currentDate instanceof Date ? currentDate.getTime() : currentDate;\n const nextTime = nextDate instanceof Date ? nextDate.getTime() : nextDate;\n cutoffTime = currentTime + fraction * (nextTime - currentTime);\n }\n } else {\n cutoffTime = cutoffIndex;\n }\n\n let firstTime, lastTime;\n if (isPreview && selectionBounds) {\n firstTime = selectionBounds.minX instanceof Date ? selectionBounds.minX.getTime() : selectionBounds.minX;\n lastTime = selectionBounds.maxX instanceof Date ? selectionBounds.maxX.getTime() : selectionBounds.maxX;\n } else {\n firstTime = originalData[0][0] instanceof Date ? originalData[0][0].getTime() : originalData[0][0];\n lastTime = originalData[originalData.length - 1][0] instanceof Date ? \n originalData[originalData.length - 1][0].getTime() : originalData[originalData.length - 1][0];\n }\n\n const timeRatio = (cutoffTime - firstTime) / (lastTime - firstTime);\n\n if (timeRatio < 0) {\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n renderEntireArea(path, areaBottomPath, {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n } else if (timeRatio > 1) {\n const reducedOpacityGradient = gradient\n ? applyReducedOpacityToGradient(gradient, cutoffOpacity)\n : null;\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n renderEntireArea(path, areaBottomPath, {\n color: applyReducedOpacity(color, cutoffOpacity),\n context,\n sizing,\n zero,\n hasNegatives,\n gradient: reducedOpacityGradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n } else {\n if (isPreview) {\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n if (!path.length) {\n continue;\n }\n\n const renderCutoffIndex = timeRatio * path.length;\n const splitIndex = Math.floor(renderCutoffIndex);\n const fraction = renderCutoffIndex - splitIndex;\n\n let ghostPoint = null;\n if (splitIndex < path.length - 1 && fraction > 0) {\n const [x1, y1] = path[splitIndex];\n const [x2, y2] = path[splitIndex + 1];\n ghostPoint = [x1 + fraction * (x2 - x1), y1 + fraction * (y2 - y1)];\n }\n\n const shouldRenderPre =\n splitIndex > 0 || (splitIndex === 0 && fraction > 0);\n\n if (shouldRenderPre) {\n const preCutoffPath = path.slice(0, splitIndex + 1);\n if (ghostPoint && splitIndex < path.length - 1) {\n preCutoffPath.push(ghostPoint);\n }\n\n const preCutoffAreaBottomPath = areaBottomPath\n ? areaBottomPath.slice(0, splitIndex + 1)\n : null;\n if (\n ghostPoint &&\n preCutoffAreaBottomPath &&\n splitIndex < areaBottomPath.length - 1\n ) {\n const bottomGhostPoint = [ghostPoint[0], zero];\n preCutoffAreaBottomPath.push(bottomGhostPoint);\n }\n\n const reducedOpacityGradient = gradient\n ? applyReducedOpacityToGradient(gradient, cutoffOpacity)\n : null;\n renderEntireArea(preCutoffPath, preCutoffAreaBottomPath, {\n color: applyReducedOpacity(color, cutoffOpacity),\n context,\n sizing,\n zero,\n hasNegatives,\n gradient: reducedOpacityGradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n\n const shouldRenderPost =\n splitIndex < path.length - 1 ||\n (splitIndex === path.length - 1 && fraction === 0);\n\n if (shouldRenderPost) {\n const postCutoffPath = [];\n if (ghostPoint && splitIndex < path.length - 1) {\n postCutoffPath.push(ghostPoint);\n }\n postCutoffPath.push(...path.slice(splitIndex + 1));\n\n const postCutoffAreaBottomPath = [];\n if (\n ghostPoint &&\n areaBottomPath &&\n splitIndex < areaBottomPath.length - 1\n ) {\n const bottomGhostPoint = [ghostPoint[0], zero];\n postCutoffAreaBottomPath.push(bottomGhostPoint);\n }\n if (areaBottomPath) {\n postCutoffAreaBottomPath.push(\n ...areaBottomPath.slice(splitIndex + 1)\n );\n }\n\n renderEntireArea(\n postCutoffPath,\n postCutoffAreaBottomPath.length ? postCutoffAreaBottomPath : null,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n }\n );\n }\n }\n\n if (linePaths && linePaths.length > 0) {\n drawLinesWithCutoff(linePaths, timeRatio, {\n color,\n context,\n hasNegatives,\n negativeColor,\n zero,\n width,\n highlighted,\n cutoffOpacity,\n });\n }\n\n if (\n showIndividualPoints &&\n individualPoints &&\n individualPoints.length > 0\n ) {\n drawPointsWithCutoffByRatio(individualPoints, timeRatio, {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n cutoffOpacity,\n });\n }\n } else {\n if (!selectionBounds) {\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n renderEntireArea(path, areaBottomPath, {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n } else {\n const visibleMinTime =\n selectionBounds.minX instanceof Date\n ? selectionBounds.minX.getTime()\n : selectionBounds.minX;\n const visibleMaxTime =\n selectionBounds.maxX instanceof Date\n ? selectionBounds.maxX.getTime()\n : selectionBounds.maxX;\n\n if (cutoffTime < visibleMinTime) {\n // cutoff before visible range - render entire area normally\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n renderEntireArea(path, areaBottomPath, {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n } else if (cutoffTime > visibleMaxTime) {\n // cutoff after visible range - render entire area with reduced opacity\n const reducedOpacityGradient = gradient\n ? applyReducedOpacityToGradient(gradient, cutoffOpacity)\n : null;\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n renderEntireArea(path, areaBottomPath, {\n color: applyReducedOpacity(color, cutoffOpacity),\n context,\n sizing,\n zero,\n hasNegatives,\n gradient: reducedOpacityGradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n } else {\n // cutoff within visible range - calculate position relative to visible bounds\n const visibleTimeRatio =\n (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n if (!path.length) {\n continue;\n }\n\n const renderCutoffIndex = visibleTimeRatio * path.length;\n const splitIndex = Math.floor(renderCutoffIndex);\n const fraction = renderCutoffIndex - splitIndex;\n\n // create ghost point for continuity if needed\n let ghostPoint = null;\n if (splitIndex < path.length - 1 && fraction > 0) {\n const [x1, y1] = path[splitIndex];\n const [x2, y2] = path[splitIndex + 1];\n ghostPoint = [\n x1 + fraction * (x2 - x1),\n y1 + fraction * (y2 - y1),\n ];\n }\n\n // render pre-cutoff area with reduced opacity\n const shouldRenderPre =\n splitIndex > 0 || (splitIndex === 0 && fraction > 0);\n\n if (shouldRenderPre) {\n renderAreaSegment(\n path,\n areaBottomPath,\n splitIndex,\n ghostPoint,\n true,\n {\n color: applyReducedOpacity(color, cutoffOpacity),\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n areaBottomPaths,\n }\n );\n }\n\n // render post-cutoff area with normal opacity\n const shouldRenderPost = splitIndex < path.length - 1;\n\n if (shouldRenderPost) {\n renderAreaSegment(\n path,\n areaBottomPath,\n splitIndex,\n ghostPoint,\n false,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n areaBottomPaths,\n }\n );\n }\n }\n }\n }\n }\n\n // draw outline lines with cutoff\n if (timeRatio >= 0 && timeRatio <= 1 && !isPreview) {\n if (selectionBounds) {\n const visibleMinTime =\n selectionBounds.minX instanceof Date\n ? selectionBounds.minX.getTime()\n : selectionBounds.minX;\n const visibleMaxTime =\n selectionBounds.maxX instanceof Date\n ? selectionBounds.maxX.getTime()\n : selectionBounds.maxX;\n\n // test case time\n if (cutoffTime < visibleMinTime) {\n // cutoff before visible range - draw lines normally\n drawLinesNormally(linePaths, {\n color,\n context,\n hasNegatives,\n negativeColor,\n width,\n highlighted,\n });\n } else if (cutoffTime > visibleMaxTime) {\n // cutoff after visible range - draw lines with reduced opacity (to match area)\n const reducedColor = applyReducedOpacity(color, cutoffOpacity);\n const reducedNegativeColor = negativeColor\n ? applyReducedOpacity(negativeColor, cutoffOpacity)\n : negativeColor;\n drawLinesNormally(linePaths, {\n color: reducedColor,\n context,\n hasNegatives,\n negativeColor: reducedNegativeColor,\n width,\n highlighted,\n });\n } else {\n // cutoff within visible range - split lines at cutoff\n const visibleTimeRatio =\n (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n drawLinesWithCutoff(linePaths, visibleTimeRatio, {\n color,\n context,\n hasNegatives,\n negativeColor,\n zero,\n width,\n highlighted,\n cutoffOpacity,\n });\n }\n } else {\n // no bounds available - draw lines normally\n drawLinesNormally(linePaths, {\n color,\n context,\n hasNegatives,\n negativeColor,\n width,\n highlighted,\n });\n }\n } else if (!isPreview) {\n // draw lines normally without cutoff\n drawLinesNormally(linePaths, {\n color,\n context,\n hasNegatives,\n negativeColor,\n width,\n highlighted,\n });\n }\n\n // draw other elements (zero line, points) normally\n if (zeroWidth) {\n const areaBottom = hasNegatives ? zero : sizing.renderHeight;\n drawZeroLine(areaBottom, {\n context,\n sizing,\n color,\n zero,\n zeroColor,\n zeroWidth,\n });\n }\n\n if (showIndividualPoints && !isPreview) {\n if (timeRatio >= 0 && timeRatio <= 1) {\n if (selectionBounds) {\n const visibleMinTime =\n selectionBounds.minX instanceof Date\n ? selectionBounds.minX.getTime()\n : selectionBounds.minX;\n const visibleMaxTime =\n selectionBounds.maxX instanceof Date\n ? selectionBounds.maxX.getTime()\n : selectionBounds.maxX;\n\n //test case time\n if (cutoffTime < visibleMinTime) {\n // cutoff before visible range - draw points normally\n drawPointsNormally(individualPoints, {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n });\n } else if (cutoffTime > visibleMaxTime) {\n // cutoff after visible range - draw points with reduced opacity\n const reducedColor = applyReducedOpacity(color, cutoffOpacity);\n const reducedNegativeColor = negativeColor\n ? applyReducedOpacity(negativeColor, cutoffOpacity)\n : negativeColor;\n const reducedZeroColor = zeroColor\n ? applyReducedOpacity(zeroColor, cutoffOpacity)\n : zeroColor;\n drawPointsNormally(individualPoints, {\n color: reducedColor,\n context,\n negativeColor: reducedNegativeColor,\n hasNegatives,\n zero,\n zeroColor: reducedZeroColor,\n pointRadius,\n });\n } else {\n // cutoff within visible range - split points at cutoff\n const visibleTimeRatio =\n (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n drawPointsWithCutoffByRatio(individualPoints, visibleTimeRatio, {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n cutoffOpacity,\n });\n }\n } else {\n // no bounds available - draw points normally\n drawPointsNormally(individualPoints, {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n });\n }\n } else {\n // cutoff outside data range - draw points normally\n drawPointsNormally(individualPoints, {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n });\n }\n } \n }\n}\n\nfunction renderEntireArea(\n path,\n areaBottomPath,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n }\n) {\n context.fillStyle = color;\n\n if (gradient && gradient.length >= 2) {\n const globalGradient = context.createLinearGradient(\n 0,\n 0,\n 0,\n sizing.renderHeight\n );\n for (let i = 0; i < gradient.length; i++) {\n const value = gradient[i];\n if (Array.isArray(value)) {\n globalGradient.addColorStop(value[0], value[1]);\n } else {\n globalGradient.addColorStop(i / (gradient.length - 1), value);\n }\n }\n context.fillStyle = globalGradient;\n } else {\n }\n\n const areaBottom = hasNegatives ? zero : sizing.renderHeight;\n\n context.beginPath();\n\n const [firstX, _startY] = path[0];\n const [lastX, _lastY] = path[path.length - 1];\n\n if (!areaBottomPath) {\n context.moveTo(firstX, areaBottom);\n }\n\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n context.lineTo(x, y);\n }\n\n if (areaBottomPath && areaBottomPath.length) {\n for (let i = areaBottomPath.length - 1; i >= 0; i--) {\n const [x, y] = areaBottomPath[i];\n context.lineTo(x, y);\n }\n context.lineTo(...path[0]);\n } else {\n context.lineTo(lastX, areaBottom);\n }\n\n context.fill();\n}\n\nfunction renderAreaSegment(\n path,\n areaBottomPath,\n splitIndex,\n ghostPoint,\n isPreCutoff,\n { color, context, sizing, zero, hasNegatives, gradient, areaBottomPaths }\n) {\n context.fillStyle = color;\n\n if (gradient && gradient.length >= 2) {\n const globalGradient = context.createLinearGradient(\n 0,\n 0,\n 0,\n sizing.renderHeight\n );\n for (let i = 0; i < gradient.length; i++) {\n const value = gradient[i];\n if (Array.isArray(value)) {\n const gradientColor = isPreCutoff\n ? applyReducedOpacity(value[1], 0.35)\n : value[1];\n globalGradient.addColorStop(value[0], gradientColor);\n } else {\n const gradientColor = isPreCutoff\n ? applyReducedOpacity(value, 0.35)\n : value;\n globalGradient.addColorStop(i / (gradient.length - 1), gradientColor);\n }\n }\n context.fillStyle = globalGradient;\n } else {\n }\n\n const areaBottom = hasNegatives ? zero : sizing.renderHeight;\n\n context.beginPath();\n\n if (isPreCutoff) {\n const endIndex = ghostPoint ? splitIndex + 1 : splitIndex;\n const [firstX] = path[0];\n\n if (!areaBottomPaths) {\n context.moveTo(firstX, areaBottom);\n }\n\n for (let i = 0; i <= endIndex && i < path.length; i++) {\n const [x, y] = i === endIndex && ghostPoint ? ghostPoint : path[i];\n context.lineTo(x, y);\n }\n\n if (areaBottomPath && areaBottomPath.length) {\n for (let i = Math.min(endIndex, areaBottomPath.length - 1); i >= 0; i--) {\n const [x, y] = areaBottomPath[i];\n context.lineTo(x, y);\n }\n context.lineTo(...path[0]);\n } else {\n const lastPoint = ghostPoint || path[endIndex] || path[path.length - 1];\n context.lineTo(lastPoint[0], areaBottom);\n }\n } else {\n const startIndex = ghostPoint ? splitIndex : splitIndex + 1;\n const startPoint = ghostPoint || path[startIndex];\n\n if (startPoint) {\n context.moveTo(startPoint[0], areaBottom);\n\n if (ghostPoint) {\n context.lineTo(...ghostPoint);\n }\n for (let i = startIndex; i < path.length; i++) {\n context.lineTo(...path[i]);\n }\n\n if (areaBottomPath && areaBottomPath.length) {\n for (\n let i = areaBottomPath.length - 1;\n i >= Math.max(startIndex, 0);\n i--\n ) {\n const [x, y] = areaBottomPath[i];\n context.lineTo(x, y);\n }\n if (ghostPoint) {\n context.lineTo(ghostPoint[0], areaBottom);\n }\n } else {\n const [lastX] = path[path.length - 1];\n context.lineTo(lastX, areaBottom);\n }\n }\n }\n\n context.fill();\n}\n\nfunction drawPointsNormally(\n individualPoints,\n { color, context, negativeColor, hasNegatives, zero, zeroColor, pointRadius }\n) {\n if (!individualPoints || !Array.isArray(individualPoints)) {\n return;\n }\n\n for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[i];\n\n let pointColor = color;\n if (negativeColor && hasNegatives) {\n if (y === zero && zeroColor) {\n pointColor = zeroColor;\n } else if (y < zero) {\n pointColor = color;\n } else {\n pointColor = negativeColor;\n }\n }\n\n context.fillStyle = pointColor;\n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n}\n\nfunction drawLinesNormally(\n linePaths,\n { color, context, hasNegatives, negativeColor, width, highlighted }\n) {\n if (!linePaths || !Array.isArray(linePaths)) {\n return;\n }\n\n if (highlighted) {\n width += 2;\n }\n width *= DPI_INCREASE;\n\n for (let path of linePaths) {\n if (!path.length) continue;\n\n context.strokeStyle = hasNegatives && negativeColor ? negativeColor : color;\n context.lineWidth = width;\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n }\n}\n\nfunction drawLinesWithCutoff(\n linePaths,\n timeRatio,\n {\n color,\n context,\n hasNegatives,\n negativeColor,\n zero,\n width,\n highlighted,\n cutoffOpacity,\n }\n) {\n if (!linePaths || !Array.isArray(linePaths)) {\n return;\n }\n\n if (highlighted) {\n width += 2;\n }\n width *= DPI_INCREASE;\n\n const cutoffPixelX = timeRatio * context.canvas.width;\n const preCutoffPaths = [];\n const postCutoffPaths = [];\n\n for (let path of linePaths) {\n if (!path.length) continue;\n\n const prePath = [];\n const postPath = [];\n let ghostPoint = null;\n let splitIndex = -1;\n\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n \n if (x < cutoffPixelX) {\n prePath.push([x, y]);\n splitIndex = i;\n } else {\n postPath.push([x, y]);\n }\n }\n\n if (prePath.length > 0 && postPath.length > 0) {\n const lastPrePoint = prePath[prePath.length - 1];\n const firstPostPoint = postPath[0];\n const [x1, y1] = lastPrePoint;\n const [x2, y2] = firstPostPoint;\n \n if (x2 !== x1) {\n const fraction = (cutoffPixelX - x1) / (x2 - x1);\n ghostPoint = [cutoffPixelX, y1 + fraction * (y2 - y1)];\n prePath.push(ghostPoint);\n postPath.unshift(ghostPoint);\n }\n }\n\n if (prePath.length > 0) {\n preCutoffPaths.push(prePath);\n }\n if (postPath.length > 0) {\n postCutoffPaths.push(postPath);\n }\n }\n\n if (preCutoffPaths.length > 0) {\n const reducedColor = applyReducedOpacity(color, cutoffOpacity);\n context.strokeStyle = reducedColor;\n context.lineWidth = width;\n\n for (let path of preCutoffPaths) {\n if (path.length > 1) {\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n }\n }\n }\n\n if (postCutoffPaths.length > 0) {\n context.strokeStyle = hasNegatives && negativeColor ? negativeColor : color;\n context.lineWidth = width;\n\n for (let path of postCutoffPaths) {\n if (path.length > 1) {\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n }\n }\n }\n}\n\nfunction drawPointsWithCutoffByRatio(\n individualPoints,\n timeRatio,\n {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n cutoffOpacity,\n }\n) {\n if (!individualPoints || !Array.isArray(individualPoints)) {\n return;\n }\n\n const canvasWidth = context.canvas.width;\n const cutoffPixelX = timeRatio * canvasWidth;\n\n for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[i];\n\n const isBeforeCutoff = x < cutoffPixelX;\n\n let pointColor = color;\n if (isBeforeCutoff) {\n pointColor = applyReducedOpacity(color, cutoffOpacity);\n }\n\n if (negativeColor && hasNegatives) {\n if (y === zero && zeroColor) {\n pointColor = zeroColor;\n } else if (y < zero) {\n pointColor = isBeforeCutoff\n ? applyReducedOpacity(color, cutoffOpacity)\n : color;\n } else {\n pointColor = isBeforeCutoff\n ? applyReducedOpacity(negativeColor, cutoffOpacity)\n : negativeColor;\n }\n }\n\n context.fillStyle = pointColor;\n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n}\n","import {drawZeroLine} from './draw_zero_line';\nimport { applyReducedOpacity } from \"../helpers/colors\";\n\n/**\n * Draws the data on the canvas\n * Assumes the data is in individual point render space, ie x and y in pixels\n *\n * @param {Array<[number, number]>} individualPoints - data to draw\n * @param {Object} options - set of options\n * @param {Object} options.context - the context to draw on\n * @param {String} options.color - color of the bar to draw\n * @param {{renderWidth: Number, renderHeight: Number}} options.sizing - size of the canvas, in pixels\n * @param {Number} options.indexInAxis - index of the series in the axis\n * @param {Number} options.axisSeriesCount - number of series in the axis\n * @param {Number} options.zero - y coordinate that represents \"zero\"\n * @param {Boolean} options.hasNegatives - if any values are negative (in which case should render from zero)\n * @param {String} options.negativeColor - color of the bar to draw if negative\n * @param {String} options.zeroColor - color of the zero line\n * @param {Number} options.zeroWidth - width of the zero line\n * @param {Number} options.closestSpacing - closest x spacing between points, in data space\n * @param {{minX: Number, maxX: Number}} options.bounds - bounds of the data as rendered\n * @private\n */\nexport default function drawBars(individualPoints, {\n color, context, sizing, indexInAxis, axisSeriesCount, zero, hasNegatives, negativeColor, zeroColor, zeroWidth, closestSpacing, bounds, cutoffIndex, cutoffOpacity, originalData, renderCutoffGradient, selectionBounds\n}) {\n if (!context) {\n console.error('Canvas context is null in drawBars');\n return;\n }\n \n context.strokeStyle = color;\n context.fillStyle = color;\n\n const {barWidth, totalBarWidth} = getBarWidths({ closestSpacing, bounds, sizing, axisSeriesCount });\n const barBottom = hasNegatives ? zero : sizing.renderHeight;\n\n if (renderCutoffGradient && cutoffIndex !== undefined && originalData) {\n drawBarsWithCutoff(individualPoints, {\n color, context, sizing, indexInAxis, axisSeriesCount, zero, hasNegatives, negativeColor, zeroColor, zeroWidth, closestSpacing, bounds, cutoffIndex, cutoffOpacity, originalData, selectionBounds, barWidth, totalBarWidth, barBottom\n });\n return;\n }\n\n for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[i];\n\n if (hasNegatives) {\n if (y <= zero) {\n context.fillStyle = color;\n } else {\n context.fillStyle = negativeColor;\n }\n }\n\n context.fillRect(x - totalBarWidth / 2 + barWidth*indexInAxis, y, barWidth, barBottom-y);\n }\n\n if (zeroWidth) {\n drawZeroLine(barBottom, {\n context,\n sizing,\n color,\n zero,\n zeroColor,\n zeroWidth\n });\n }\n}\n\nexport function getBarWidths({closestSpacing, bounds, sizing, axisSeriesCount}) {\n const fullBarWidth = closestSpacing / (bounds.maxX - bounds.minX) * sizing.renderWidth;\n\n const totalBarWidth = fullBarWidth * 0.8;\n const barSpacing = fullBarWidth * 0.2;\n const barWidth = totalBarWidth / axisSeriesCount;\n\n return {\n barWidth,\n totalBarWidth,\n barSpacing\n };\n}\n\n/**\n * Draws the data on the canvas with cutoff\n * Assumes the data is in individual point render space, ie x and y in pixels\n *\n * @param {Array<[number, number]>} individualPoints - data to draw\n * @param {Object} options - set of options\n * @param {Object} options.context - the context to draw on\n * @param {String} options.color - color of the bar to draw\n * @param {{renderWidth: Number, renderHeight: Number}} options.sizing - size of the canvas, in pixels\n * @param {Number} options.indexInAxis - index of the series in the axis\n * @param {Number} options.axisSeriesCount - number of series in the axis\n * @param {Number} options.zero - y coordinate that represents \"zero\"\n * @param {Boolean} options.hasNegatives - if any values are negative (in which case should render from zero)\n * @param {String} options.negativeColor - color of the bar to draw if negative\n * @param {String} options.zeroColor - color of the zero line\n * @param {Number} options.zeroWidth - width of the zero line\n * @param {Number} options.closestSpacing - closest x spacing between points, in data space\n * @param {{minX: Number, maxX: Number}} options.bounds - bounds of the data as rendered\n * @param {Number} options.cutoffIndex - index of the cutoff\n * @param {Number} options.cutoffOpacity - opacity of the cutoff\n * @param {Array<[number, number]>} options.originalData - original data\n * @param {Boolean} options.selectionBounds - if selection bounds are available\n * @param {Number} options.barWidth - width of the bar\n * @param {Number} options.totalBarWidth - total width of the bar\n * @param {Number} options.barBottom - y coordinate that represents the bottom of the bar\n * @private\n */\nfunction drawBarsWithCutoff(individualPoints, {\n color, context, sizing, indexInAxis, axisSeriesCount, zero, hasNegatives, negativeColor, zeroColor, zeroWidth, closestSpacing, bounds, cutoffIndex, cutoffOpacity, originalData, selectionBounds, barWidth, totalBarWidth, barBottom\n}) {\n let cutoffTime;\n if (typeof originalData[0] === 'object' && originalData[0].length === 2) {\n const baseIndex = Math.floor(cutoffIndex);\n const fraction = cutoffIndex - baseIndex;\n \n if (fraction === 0 || baseIndex >= originalData.length - 1) {\n const cutoffDate = originalData[Math.min(baseIndex, originalData.length - 1)][0];\n cutoffTime = cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n } else {\n const currentDate = originalData[baseIndex][0];\n const nextDate = originalData[baseIndex + 1][0];\n const currentTime = currentDate instanceof Date ? currentDate.getTime() : currentDate;\n const nextTime = nextDate instanceof Date ? nextDate.getTime() : nextDate;\n cutoffTime = currentTime + fraction * (nextTime - currentTime);\n }\n } else {\n cutoffTime = cutoffIndex; \n }\n\n for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[i];\n \n let barColor = color;\n let isBeforeCutoff = false;\n\n if (i < originalData.length) {\n const dataPoint = originalData[i];\n const pointTime = dataPoint[0] instanceof Date ? dataPoint[0].getTime() : dataPoint[0];\n isBeforeCutoff = pointTime < cutoffTime;\n \n if (isBeforeCutoff) {\n barColor = applyReducedOpacity(color, cutoffOpacity);\n }\n }\n\n if (hasNegatives) {\n if (y <= zero) {\n context.fillStyle = barColor;\n } else {\n const negColor = isBeforeCutoff ? applyReducedOpacity(negativeColor, cutoffOpacity) : negativeColor;\n context.fillStyle = negColor;\n }\n } else {\n context.fillStyle = barColor;\n }\n\n context.fillRect(x - totalBarWidth / 2 + barWidth*indexInAxis, y, barWidth, barBottom-y);\n }\n\n if (zeroWidth) {\n drawZeroLine(barBottom, {\n context, sizing, color, zero, zeroColor, zeroWidth\n });\n }\n}\n","import {DPI_INCREASE} from './size_canvas';\nimport pathsFrom from './paths_from';\nimport { applyReducedOpacity } from \"../helpers/colors\";\n\nfunction applyPointSpacing(points, minSpacing) {\n if (!minSpacing || points.length <= 1) {\n return points;\n }\n \n const spacedPoints = [];\n let lastX = -Infinity;\n \n for (const point of points) {\n const [x] = point;\n if (x - lastX >= minSpacing) {\n spacedPoints.push(point);\n lastX = x;\n }\n }\n \n return spacedPoints;\n}\n\nexport default function drawLine(dataInRenderSpace, {\n color, width=1, context, shadowColor='black', shadowBlur=5, dashed=false, dashPattern=null, highlighted=false, showIndividualPoints=false, pointRadius, minPointSpacing, getIndividualPoints, getRanges, cutoffIndex, cutoffOpacity, originalData, renderCutoffGradient, currentBounds, selectionBounds, rendering, isPreview\n}) {\n if (!context) {\n console.error(\"Canvas context is null in drawLine\");\n return;\n }\n \n if (highlighted) {\n width += 2;\n }\n width *= DPI_INCREASE;\n\n context.strokeStyle = color;\n context.lineWidth = width;\n context.shadowColor = shadowColor;\n context.shadowBlur = shadowBlur;\n\n if (dashed) {\n context.setLineDash(dashPattern || [5, 5]);\n } else {\n context.setLineDash([]);\n }\n\n const paths = pathsFrom(dataInRenderSpace);\n\n for (let path of paths) {\n if (renderCutoffGradient && cutoffIndex !== undefined && originalData) {\n let cutoffTime;\n if (typeof originalData[0] === 'object' && originalData[0].length === 2) {\n const baseIndex = Math.floor(cutoffIndex);\n const fraction = cutoffIndex - baseIndex;\n \n if (fraction === 0 || baseIndex >= originalData.length - 1) {\n const cutoffDate = originalData[Math.min(baseIndex, originalData.length - 1)][0];\n cutoffTime = cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n } else {\n const currentDate = originalData[baseIndex][0];\n const nextDate = originalData[baseIndex + 1][0];\n const currentTime = currentDate instanceof Date ? currentDate.getTime() : currentDate;\n const nextTime = nextDate instanceof Date ? nextDate.getTime() : nextDate;\n cutoffTime = currentTime + fraction * (nextTime - currentTime);\n }\n } else {\n cutoffTime = cutoffIndex; \n }\n \n if (isPreview) {\n const firstTime = originalData[0][0] instanceof Date ? originalData[0][0].getTime() : originalData[0][0];\n const lastTime = originalData[originalData.length - 1][0] instanceof Date ? \n originalData[originalData.length - 1][0].getTime() : originalData[originalData.length - 1][0];\n const timeRatio = (cutoffTime - firstTime) / (lastTime - firstTime);\n \n if (timeRatio < 0) {\n context.lineWidth = width;\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n } else if (timeRatio > 1) {\n const reducedColor = applyReducedOpacity(color, cutoffOpacity);\n context.strokeStyle = reducedColor;\n context.lineWidth = width;\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n } else {\n const renderCutoffIndex = timeRatio * (path.length - 1);\n const splitIndex = Math.floor(renderCutoffIndex);\n const fraction = renderCutoffIndex - splitIndex;\n \n let ghostPoint = null;\n if (splitIndex < path.length - 1 && fraction > 0) {\n const [x1, y1] = path[splitIndex];\n const [x2, y2] = path[splitIndex + 1];\n ghostPoint = [\n x1 + fraction * (x2 - x1),\n y1 + fraction * (y2 - y1)\n ];\n }\n \n if (splitIndex > 0 || (splitIndex === 0 && fraction > 0)) {\n const reducedColor = applyReducedOpacity(color, cutoffOpacity);\n context.strokeStyle = reducedColor;\n context.lineWidth = width;\n context.beginPath();\n \n for (let i = 0; i <= splitIndex; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n \n if (ghostPoint) {\n context.lineTo(ghostPoint[0], ghostPoint[1]);\n }\n \n context.stroke();\n }\n \n if (splitIndex < path.length - 1) {\n context.strokeStyle = color;\n context.lineWidth = width;\n context.beginPath();\n \n if (ghostPoint) {\n context.moveTo(ghostPoint[0], ghostPoint[1]);\n } else {\n context.moveTo(path[splitIndex + 1][0], path[splitIndex + 1][1]);\n }\n \n for (let i = splitIndex + 1; i < path.length; i++) {\n const [x, y] = path[i];\n context.lineTo(x, y);\n }\n \n context.stroke();\n }\n }\n } else {\n if (!selectionBounds) {\n context.lineWidth = width;\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n continue;\n }\n \n const visibleMinTime = selectionBounds.minX instanceof Date ? selectionBounds.minX.getTime() : selectionBounds.minX;\n const visibleMaxTime = selectionBounds.maxX instanceof Date ? selectionBounds.maxX.getTime() : selectionBounds.maxX;\n \n if (cutoffTime < visibleMinTime) {\n context.lineWidth = width;\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n } else if (cutoffTime > visibleMaxTime) {\n const reducedColor = applyReducedOpacity(color, cutoffOpacity);\n context.strokeStyle = reducedColor;\n context.lineWidth = width;\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n context.strokeStyle = color;\n } else {\n const timeRatio = (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n const renderCutoffIndex = timeRatio * path.length;\n \n const preCutoffPath = [];\n const postCutoffPath = [];\n let ghostPoint = null;\n \n if (renderCutoffIndex > 0 && renderCutoffIndex < path.length - 1) {\n const beforeIndex = Math.floor(renderCutoffIndex);\n const afterIndex = Math.ceil(renderCutoffIndex);\n \n if (beforeIndex !== afterIndex) {\n const fraction = renderCutoffIndex - beforeIndex;\n const beforePoint = path[beforeIndex];\n const afterPoint = path[afterIndex];\n \n ghostPoint = [\n beforePoint[0] + fraction * (afterPoint[0] - beforePoint[0]),\n beforePoint[1] + fraction * (afterPoint[1] - beforePoint[1])\n ];\n \n } else {\n ghostPoint = path[renderCutoffIndex];\n }\n }\n \n for (let i = 0; i < path.length; i++) {\n if (i < renderCutoffIndex) {\n preCutoffPath.push(path[i]);\n } else {\n postCutoffPath.push(path[i]);\n }\n }\n \n if (ghostPoint) {\n if (preCutoffPath.length > 0) {\n preCutoffPath.push(ghostPoint);\n }\n if (postCutoffPath.length > 0) {\n postCutoffPath.unshift(ghostPoint);\n }\n }\n \n if (preCutoffPath.length > 1) {\n const reducedColor = applyReducedOpacity(color, cutoffOpacity);\n context.strokeStyle = reducedColor;\n context.lineWidth = width;\n context.beginPath();\n for (let i = 0; i < preCutoffPath.length; i++) {\n const [x, y] = preCutoffPath[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n }\n \n if (postCutoffPath.length > 1) {\n context.strokeStyle = color;\n context.lineWidth = width;\n context.beginPath();\n for (let i = 0; i < postCutoffPath.length; i++) {\n const [x, y] = postCutoffPath[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n }\n }\n }\n } else {\n context.beginPath();\n\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n\n context.stroke();\n }\n }\n\n if (getRanges) {\n const ranges = getRanges();\n\n context.lineWidth = width;\n context.strokeStyle = color;\n context.setLineDash([]);\n const horizontalBarWidth = 8 * DPI_INCREASE;\n\n for (let range of ranges) {\n if (!range) {\n continue;\n }\n\n const { pixelX, pixelMinY, pixelMaxY } = range;\n\n if (pixelMinY !== null) {\n context.beginPath();\n context.moveTo(pixelX - (horizontalBarWidth / 2), pixelMinY);\n context.lineTo(pixelX + (horizontalBarWidth / 2), pixelMinY);\n context.stroke();\n }\n\n if (pixelMaxY !== null) {\n context.beginPath();\n context.moveTo(pixelX - (horizontalBarWidth / 2), pixelMaxY);\n context.lineTo(pixelX + (horizontalBarWidth / 2), pixelMaxY);\n context.stroke();\n }\n\n if (pixelMinY === null || pixelMaxY === null) {\n continue;\n }\n\n context.beginPath();\n context.moveTo(pixelX, pixelMinY);\n context.lineTo(pixelX, pixelMaxY);\n context.stroke();\n }\n }\n\n if (showIndividualPoints) {\n const individualPoints = getIndividualPoints();\n\n if (renderCutoffGradient && cutoffIndex !== undefined && originalData) {\n let cutoffTime;\n if (typeof originalData[0] === 'object' && originalData[0].length === 2) {\n const baseIndex = Math.floor(cutoffIndex);\n const fraction = cutoffIndex - baseIndex;\n \n if (fraction === 0 || baseIndex >= originalData.length - 1) {\n const cutoffDate = originalData[Math.min(baseIndex, originalData.length - 1)][0];\n cutoffTime = cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n } else {\n const currentDate = originalData[baseIndex][0];\n const nextDate = originalData[baseIndex + 1][0];\n const currentTime = currentDate instanceof Date ? currentDate.getTime() : currentDate;\n const nextTime = nextDate instanceof Date ? nextDate.getTime() : nextDate;\n cutoffTime = currentTime + fraction * (nextTime - currentTime);\n }\n } else {\n cutoffTime = cutoffIndex; \n }\n \n if (isPreview) {\n const visibleMinTime = selectionBounds.minX instanceof Date ? selectionBounds.minX.getTime() : selectionBounds.minX;\n const visibleMaxTime = selectionBounds.maxX instanceof Date ? selectionBounds.maxX.getTime() : selectionBounds.maxX;\n \n const spacedPoints = applyPointSpacing(individualPoints, minPointSpacing);\n for (let i = 0; i < spacedPoints.length; i++) {\n const [x, y] = spacedPoints[i];\n \n let isBeforeCutoff = false;\n if (cutoffTime < visibleMinTime) {\n isBeforeCutoff = false;\n } else if (cutoffTime > visibleMaxTime) {\n isBeforeCutoff = (rendering !== 'shadow');\n } else {\n const visibleCutoffRatio = (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n const cutoffPixelX = visibleCutoffRatio * context.canvas.width;\n isBeforeCutoff = x < cutoffPixelX;\n }\n \n if (isBeforeCutoff) {\n const reducedOpacityColor = applyReducedOpacity(color, cutoffOpacity);\n context.fillStyle = reducedOpacityColor;\n } else {\n context.fillStyle = color;\n }\n \n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n } else if (!selectionBounds) {\n const spacedPoints = applyPointSpacing(individualPoints, minPointSpacing);\n for (let i = 0; i < spacedPoints.length; i++) {\n const [x, y] = spacedPoints[i];\n context.fillStyle = color;\n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n } else {\n const visibleMinTime = selectionBounds.minX instanceof Date ? selectionBounds.minX.getTime() : selectionBounds.minX;\n const visibleMaxTime = selectionBounds.maxX instanceof Date ? selectionBounds.maxX.getTime() : selectionBounds.maxX;\n \n const spacedPoints = applyPointSpacing(individualPoints, minPointSpacing);\n for (let i = 0; i < spacedPoints.length; i++) {\n const [x, y] = spacedPoints[i];\n \n let isBeforeCutoff = false;\n if (cutoffTime < visibleMinTime) {\n isBeforeCutoff = false;\n } else if (cutoffTime > visibleMaxTime) {\n isBeforeCutoff = (rendering !== 'shadow');\n } else {\n const visibleCutoffRatio = (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n const cutoffPixelX = visibleCutoffRatio * context.canvas.width;\n isBeforeCutoff = x < cutoffPixelX;\n }\n \n if (isBeforeCutoff) {\n const reducedOpacityColor = applyReducedOpacity(color, cutoffOpacity);\n context.fillStyle = reducedOpacityColor;\n } else {\n context.fillStyle = color;\n }\n \n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n }\n } else {\n const spacedPoints = applyPointSpacing(individualPoints, minPointSpacing);\n for (let i = 0; i < spacedPoints.length; i++) {\n const [x, y] = spacedPoints[i];\n context.fillStyle = color;\n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n }\n }\n}\n","let rustApiModule;\nexport const RustAPIPromise = import('../rust/pkg/index.js').then((module) => {\n return module.default().then(() => {\n rustApiModule = module;\n });\n});\n\nexport default function RustAPI() {\n return rustApiModule;\n}\n","import pathsFrom from './paths_from';\nimport {DPI_INCREASE} from './size_canvas';\nimport RustAPI from '../state/rust_api';\n\n/**\n *\n * @param {[[Number]]} paths\n * @param {Boolean} dashed\n * @param {Array} dashPattern\n * @return {{prevPositions: Float32Array, indices: Uint32Array, vertices: Float32Array, positions: Float32Array}}\n */\nexport function extractVerticesFromPaths(paths, { dashed, dashPattern }) {\n let pointNumber = 0;\n for (let path of paths) {\n if (dashed) {\n for (let i = 0; i < path.length; i++) {\n if (dashed && i % (dashPattern[0] + dashPattern[1]) >= dashPattern[0]) {\n continue;\n }\n pointNumber++;\n }\n } else {\n pointNumber += path.length;\n }\n }\n\n const positions = new Float32Array(pointNumber*8);\n const prevPositions = new Float32Array(pointNumber*8);\n const vertices = new Float32Array(pointNumber*4);\n const indices = new Uint32Array(pointNumber*6);\n\n if (pointNumber > 0) {\n const verticesPattern = new Float32Array([0, 1, 2, 3]);\n vertices.set(verticesPattern);\n let vertexPointer = verticesPattern.length;\n let sourceLength = verticesPattern.length;\n while (vertexPointer < vertices.length) {\n if (vertexPointer + sourceLength > vertices.length) {\n sourceLength = vertices.length - vertexPointer;\n }\n\n vertices.copyWithin(vertexPointer, 0, sourceLength);\n vertexPointer += sourceLength;\n sourceLength <<= 1;\n }\n }\n\n let pointI = 0;\n for (let path of paths) {\n for (let i = 0; i < path.length; i++) {\n if (dashed && i % (dashPattern[0] + dashPattern[1]) >= dashPattern[0]) {\n continue;\n }\n\n const [x, y] = path[i];\n\n let prevX, prevY;\n\n if (i === 0) {\n prevX = x - 1;\n prevY = y;\n } else {\n [prevX, prevY] = path[i - 1];\n }\n\n for (let j = 0; j < 4; j++) {\n positions[pointI * 8 + 2 * j] = x;\n positions[pointI * 8 + 2 * j + 1] = y;\n prevPositions[pointI * 8 + 2 * j] = prevX;\n prevPositions[pointI * 8 + 2 * j + 1] = prevY;\n }\n\n indices[pointI * 6] = pointI * 4;\n indices[pointI * 6 + 1] = pointI * 4 + 1;\n indices[pointI * 6 + 2] = pointI * 4 + 3;\n\n indices[pointI * 6 + 3] = pointI * 4;\n indices[pointI * 6 + 4] = pointI * 4 + 2;\n indices[pointI * 6 + 5] = pointI * 4 + 3;\n\n pointI++;\n }\n }\n\n return {\n positions,\n prevPositions,\n vertices,\n indices\n };\n}\n\n/**\n * Takes the paths and turns them into what's needed for the line webgl program\n *\n * @param {{nullMask: Uint8Array, maxYValues: Float64Array, minYValues: Float64Array, yValues: Float64Array, paths?: [[Number]]}} dataInRenderSpace\n * @param {Boolean} dashed\n * @param {Array} dashPattern\n * @return {{prevPositions: Float32Array, indices: Uint32Array, vertices: Float32Array, positions: Float32Array}}\n */\nexport default function extractVertices(dataInRenderSpace, { dashed, dashPattern }) {\n if (dataInRenderSpace && dataInRenderSpace.paths) {\n return extractVerticesFromPaths(dataInRenderSpace.paths, { dashed, dashPattern});\n }\n\n if (!RustAPI()) {\n const paths = pathsFrom(dataInRenderSpace);\n return extractVerticesFromPaths(paths, { dashed, dashPattern});\n }\n\n const pointNumber = RustAPI().get_point_number(\n dataInRenderSpace.nullMask, dataInRenderSpace.yValues, dataInRenderSpace.minYValues, dataInRenderSpace.maxYValues,\n dashed, dashPattern[0], dashPattern[1]\n );\n\n let positions = new Float32Array(pointNumber*8);\n let prevPositions = new Float32Array(pointNumber*8);\n let vertices = new Float32Array(pointNumber*4);\n let indices = new Uint32Array(pointNumber*6);\n\n RustAPI().extract_vertices(\n DPI_INCREASE,\n dataInRenderSpace.nullMask, dataInRenderSpace.yValues, dataInRenderSpace.minYValues, dataInRenderSpace.maxYValues,\n positions, prevPositions, vertices, indices,\n dashed, dashPattern[0], dashPattern[1]\n );\n\n return {\n positions,\n prevPositions,\n vertices,\n indices\n };\n}\n","import lineFrag from './line.frag';\nimport lineVert from './line.vert';\nimport circleFrag from './circle.frag';\nimport circleVert from './circle.vert';\nimport colorToVector from '../helpers/color_to_vector';\nimport extractVertices from './extract_vertices';\nimport createGLProgram from './create_gl_program';\nimport {DPI_INCREASE} from './size_canvas';\nimport { applyReducedOpacity } from \"../helpers/colors\";\n\nexport default class LineProgram {\n\n constructor(gl) {\n this._gl = gl;\n\n this._program = createGLProgram(gl, lineVert, lineFrag);\n this._circleProgram = createGLProgram(gl, circleVert, circleFrag);\n\n this._positionBuffer = gl.createBuffer();\n this._prevPositionBuffer = gl.createBuffer();\n this._vertexBuffer = gl.createBuffer();\n this._indexBuffer = gl.createBuffer();\n this._individualPointBuffer = gl.createBuffer();\n\n if (!gl.getExtension('OES_element_index_uint')) {\n console.error('Your browser does not support OES_element_index_uint'); // eslint-disable-line no-console\n }\n }\n\n dispose() {\n\n }\n\n clear() {\n const gl = this._gl;\n const width = gl.drawingBufferWidth;\n const height = gl.drawingBufferHeight;\n\n gl.clearColor(0, 0, 0, 0);\n gl.viewport(0, 0, width, height);\n }\n\n /**\n * Draws the data on the canvas\n * Assumes the data is in render space\n *\n * @param {{nullMask: Uint8Array, maxYValues: Float64Array, minYValues: Float64Array, yValues: Float64Array}} dataInRenderSpace - the data to render\n * @param {Object} parameters - set of options\n * @param {String} parameters.color - color of the line to draw\n * @param {Number} [parameters.width] - line width\n * @param {Number} [parameters.shadowBlur] - level to blur shadow to\n * @param {String} [parameters.shadowColor] - color of the shadow\n * @param {String} [parameters.dashed] - whether or not to make the line dashed\n * @param {Array<Number>} [parameters.dashPattern] - dash array for the canvas\n * @param {Boolean} [parameters.highlighted] - whether the line is highlighted or not\n * @param {Boolean} [parameters.showIndividualPoints] - draw circles at each point\n * @param {Function} [parameters.getIndividualPoints] - points to draw circles at. Only called when needed.\n * @private\n */\n draw(dataInRenderSpace, parameters) {\n const gl = this._gl;\n const width = gl.drawingBufferWidth;\n const height = gl.drawingBufferHeight;\n gl.useProgram(this._program);\n\n const thickness = DPI_INCREASE*((parameters.width || 1) + (parameters.highlighted ? 2 : 0));\n const shadowBlur = parameters.shadowBlur === undefined ? 2 : parameters.shadowBlur;\n const shadowColor = parameters.shadowColor || 'black';\n const dashed = parameters.dashed || false;\n const dashPattern = parameters.dashPattern || [5, 5];\n if (parameters.renderCutoffGradient && parameters.cutoffIndex !== undefined && parameters.originalData) {\n this.drawLineWithCutoff(dataInRenderSpace, parameters);\n return;\n }\n\n const {positions, prevPositions, vertices, indices} = extractVertices(dataInRenderSpace, { dashed, dashPattern });\n\n if (!this._program) {\n console.error('WebGL line program is null - shader compilation failed!');\n return;\n }\n\n const positionIndex = gl.getAttribLocation(this._program, 'position');\n const prevPositionIndex = gl.getAttribLocation(this._program, 'prevPosition');\n const vertexIndex = gl.getAttribLocation(this._program, 'vertex');\n\n gl.enableVertexAttribArray(positionIndex);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._positionBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, positions, gl.STATIC_DRAW);\n gl.vertexAttribPointer(positionIndex, 2, gl.FLOAT, false, 0, 0);\n\n gl.enableVertexAttribArray(prevPositionIndex);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._prevPositionBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, prevPositions, gl.STATIC_DRAW);\n gl.vertexAttribPointer(prevPositionIndex, 2, gl.FLOAT, false, 0, 0);\n\n gl.enableVertexAttribArray(vertexIndex);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n gl.vertexAttribPointer(vertexIndex, 1, gl.FLOAT, false, 0, 0);\n\n gl.uniform1f(gl.getUniformLocation(this._program, 'width'), width);\n gl.uniform1f(gl.getUniformLocation(this._program, 'height'), height);\n gl.uniform1f(gl.getUniformLocation(this._program, 'thickness'), Math.max(thickness, 1)+shadowBlur);\n gl.uniform1f(gl.getUniformLocation(this._program, 'shadowBlur'), shadowBlur);\n const colorVector = colorToVector(parameters.color);\n gl.uniform4f(gl.getUniformLocation(this._program, 'color'), ...colorVector);\n gl.uniform4f(gl.getUniformLocation(this._program, 'shadowColor'), ...colorToVector(shadowColor));\n \n const cutoffX = parameters.cutoffX !== undefined ? parameters.cutoffX : -1.0; // Use parameter or disable\n const cutoffOpacity = parameters.cutoffOpacity !== undefined ? parameters.cutoffOpacity : 0.35;\n \n gl.uniform1f(gl.getUniformLocation(this._program, 'cutoffX'), cutoffX);\n gl.uniform1f(gl.getUniformLocation(this._program, 'cutoffOpacity'), cutoffOpacity);\n\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW);\n gl.drawElements(gl.TRIANGLES, indices.length, gl.UNSIGNED_INT, 0);\n\n if (parameters.showIndividualPoints) {\n gl.useProgram(this._circleProgram);\n\n gl.uniform1f(gl.getUniformLocation(this._circleProgram, 'width'), width);\n gl.uniform1f(gl.getUniformLocation(this._circleProgram, 'height'), height);\n const pointSize = parameters.pointRadius ? parameters.pointRadius * 2 * DPI_INCREASE : 2*(thickness+6);\n gl.uniform1f(gl.getUniformLocation(this._circleProgram, 'pointSize'), pointSize);\n\n let individualPoints = parameters.getIndividualPoints();\n \n if (parameters.minPointSpacing && individualPoints.length > 1) {\n const spacedPoints = [];\n let lastX = -Infinity;\n \n for (const point of individualPoints) {\n const [x] = point;\n if (x - lastX >= parameters.minPointSpacing) {\n spacedPoints.push(point);\n lastX = x;\n }\n }\n \n individualPoints = spacedPoints;\n }\n\n if (parameters.cutoffIndex !== undefined && parameters.cutoffIndex > 0 && parameters.originalData) {\n const { originalData } = parameters;\n let cutoffTime;\n \n if (typeof originalData[0] === 'object' && originalData[0].length === 2) {\n const baseIndex = Math.floor(parameters.cutoffIndex);\n const fraction = parameters.cutoffIndex - baseIndex;\n \n if (fraction === 0 || baseIndex >= originalData.length - 1) {\n const cutoffDate = originalData[Math.min(baseIndex, originalData.length - 1)][0];\n cutoffTime = cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n } else {\n const currentDate = originalData[baseIndex][0];\n const nextDate = originalData[baseIndex + 1][0];\n const currentTime = currentDate instanceof Date ? currentDate.getTime() : currentDate;\n const nextTime = nextDate instanceof Date ? nextDate.getTime() : nextDate;\n cutoffTime = currentTime + fraction * (nextTime - currentTime);\n }\n }\n \n const preCutoffPoints = [];\n const postCutoffPoints = [];\n\n if (parameters.isPreview) {\n const visibleMinTime = parameters.selectionBounds.minX instanceof Date ? parameters.selectionBounds.minX.getTime() : parameters.selectionBounds.minX;\n const visibleMaxTime = parameters.selectionBounds.maxX instanceof Date ? parameters.selectionBounds.maxX.getTime() : parameters.selectionBounds.maxX;\n const timeRatio = (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n const cutoffPixelX = timeRatio * width;\n \n for (let i = 0; i < individualPoints.length; i++) {\n const [pixelX, pixelY] = individualPoints[i];\n if (pixelX < cutoffPixelX) {\n preCutoffPoints.push(individualPoints[i]);\n } else {\n postCutoffPoints.push(individualPoints[i]);\n }\n }\n } else if (!parameters.selectionBounds) {\n postCutoffPoints.push(...individualPoints);\n } else {\n const visibleMinTime = parameters.selectionBounds.minX instanceof Date ? \n parameters.selectionBounds.minX.getTime() : parameters.selectionBounds.minX;\n const visibleMaxTime = parameters.selectionBounds.maxX instanceof Date ? \n parameters.selectionBounds.maxX.getTime() : parameters.selectionBounds.maxX;\n \n if (cutoffTime < visibleMinTime) {\n postCutoffPoints.push(...individualPoints);\n } else if (cutoffTime > visibleMaxTime) {\n if (parameters.rendering === 'shadow') {\n postCutoffPoints.push(...individualPoints);\n } else {\n preCutoffPoints.push(...individualPoints);\n }\n } else {\n const visibleCutoffRatio = (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n const renderWidth = this._gl.canvas.width;\n const cutoffPixelX = visibleCutoffRatio * renderWidth;\n \n individualPoints.forEach((point, index) => {\n const [pixelX, pixelY] = point;\n \n if (pixelX < cutoffPixelX) {\n preCutoffPoints.push(point);\n } else {\n postCutoffPoints.push(point);\n }\n });\n }\n }\n \n if (preCutoffPoints.length > 0) {\n const reducedOpacityColor = applyReducedOpacity(parameters.color, parameters.cutoffOpacity || 0.35);\n gl.uniform4f(gl.getUniformLocation(this._circleProgram, 'color'), ...colorToVector(reducedOpacityColor));\n \n gl.enableVertexAttribArray(0);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._individualPointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(preCutoffPoints.flat()), gl.STATIC_DRAW);\n gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);\n gl.drawArrays(gl.POINTS, 0, preCutoffPoints.length);\n }\n \n if (postCutoffPoints.length > 0) {\n gl.uniform4f(gl.getUniformLocation(this._circleProgram, 'color'), ...colorToVector(parameters.color));\n \n gl.enableVertexAttribArray(0);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._individualPointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(postCutoffPoints.flat()), gl.STATIC_DRAW);\n gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);\n gl.drawArrays(gl.POINTS, 0, postCutoffPoints.length);\n }\n } else {\n gl.uniform4f(gl.getUniformLocation(this._circleProgram, 'color'), ...colorToVector(parameters.color));\n\n gl.enableVertexAttribArray(0);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._individualPointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(individualPoints.flat()), gl.STATIC_DRAW);\n gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);\n\n gl.drawArrays(gl.POINTS, 0, individualPoints.length);\n }\n }\n }\n\n drawLineWithCutoff(dataInRenderSpace, parameters) {\n const { cutoffIndex, cutoffOpacity, originalData, selectionBounds } = parameters;\n \n let cutoffTime;\n if (typeof originalData[0] === 'object' && originalData[0].length === 2) {\n const baseIndex = Math.floor(cutoffIndex);\n const fraction = cutoffIndex - baseIndex;\n \n if (fraction === 0 || baseIndex >= originalData.length - 1) {\n const cutoffDate = originalData[Math.min(baseIndex, originalData.length - 1)][0];\n cutoffTime = cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n } else {\n const currentDate = originalData[baseIndex][0];\n const nextDate = originalData[baseIndex + 1][0];\n const currentTime = currentDate instanceof Date ? currentDate.getTime() : currentDate;\n const nextTime = nextDate instanceof Date ? nextDate.getTime() : nextDate;\n cutoffTime = currentTime + fraction * (nextTime - currentTime);\n }\n } else {\n cutoffTime = cutoffIndex; \n }\n\n if (parameters.isPreview) {\n const gl = this._gl;\n const visibleMinTime = selectionBounds.minX instanceof Date ? selectionBounds.minX.getTime() : selectionBounds.minX;\n const visibleMaxTime = selectionBounds.maxX instanceof Date ? selectionBounds.maxX.getTime() : selectionBounds.maxX;\n const timeRatio = (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n \n if (timeRatio < 0) {\n this.draw(dataInRenderSpace, { ...parameters, renderCutoffGradient: false });\n } else if (timeRatio > 1) {\n const reducedOpacityColor = applyReducedOpacity(parameters.color, cutoffOpacity);\n this.draw(dataInRenderSpace, { \n ...parameters, \n color: reducedOpacityColor,\n renderCutoffGradient: false \n });\n } else {\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n \n this.draw(dataInRenderSpace, {\n ...parameters,\n renderCutoffGradient: false,\n cutoffX: timeRatio,\n cutoffOpacity: cutoffOpacity || 0.35\n });\n }\n } else {\n if (!selectionBounds) {\n this.draw(dataInRenderSpace, { ...parameters, renderCutoffGradient: false });\n return;\n }\n \n const visibleMinTime = selectionBounds.minX instanceof Date ? selectionBounds.minX.getTime() : selectionBounds.minX;\n const visibleMaxTime = selectionBounds.maxX instanceof Date ? selectionBounds.maxX.getTime() : selectionBounds.maxX;\n\n if (cutoffTime < visibleMinTime) {\n this.draw(dataInRenderSpace, { ...parameters, renderCutoffGradient: false });\n } else if (cutoffTime > visibleMaxTime) {\n const reducedOpacityColor = applyReducedOpacity(parameters.color, cutoffOpacity);\n this.draw(dataInRenderSpace, { \n ...parameters, \n color: reducedOpacityColor,\n renderCutoffGradient: false \n });\n } else {\n const visibleCutoffRatio = (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n \n const gl = this._gl;\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n \n this.draw(dataInRenderSpace, {\n ...parameters,\n renderCutoffGradient: false,\n cutoffX: visibleCutoffRatio,\n cutoffOpacity: cutoffOpacity || 0.35\n });\n }\n }\n }\n}\n","import shadowFrag from \"./shadow.frag\";\nimport shadowVert from \"./shadow.vert\";\nimport colorToVector from \"../helpers/color_to_vector\";\nimport createGLProgram from \"./create_gl_program\";\nimport { applyReducedOpacity, applyReducedOpacityToGradient } from \"../helpers/colors\";\n\nexport default class ShadowProgram {\n constructor(gl) {\n this._gl = gl;\n\n this._program = createGLProgram(gl, shadowVert, shadowFrag);\n\n if (!this._program) {\n console.error(\"Failed to create shadow shader program\");\n this._program = null;\n return;\n }\n\n gl.validateProgram(this._program);\n if (!gl.getProgramParameter(this._program, gl.VALIDATE_STATUS)) {\n console.error(\n \"Shadow program validation failed:\",\n gl.getProgramInfoLog(this._program)\n );\n }\n\n const positionLoc = gl.getAttribLocation(this._program, \"position\");\n const trapezoidBoundsLoc = gl.getAttribLocation(\n this._program,\n \"trapezoidBounds\"\n );\n const trapezoidBottomLoc = gl.getAttribLocation(\n this._program,\n \"trapezoidBottom\"\n );\n\n if (\n positionLoc === -1 ||\n trapezoidBoundsLoc === -1 ||\n trapezoidBottomLoc === -1\n ) {\n console.error(\"Missing required shader attributes\");\n }\n\n this._positionBuffer = gl.createBuffer();\n this._trapezoidBoundsBuffer = gl.createBuffer();\n this._trapezoidBottomBuffer = gl.createBuffer();\n this._indexBuffer = gl.createBuffer();\n\n this._gradientTexture = gl.createTexture();\n\n if (!gl.getExtension(\"OES_element_index_uint\")) {\n console.error(\"Your browser does not support OES_element_index_uint\");\n }\n }\n\n dispose() {\n const gl = this._gl;\n if (this._gradientTexture) {\n gl.deleteTexture(this._gradientTexture);\n this._gradientTexture = null;\n }\n }\n\n /**\n * Convert trapezoids into WebGL geometry\n * @param {Array} trapezoids - Array of trapezoid definitions\n * @returns {Object} - Geometry data for WebGL\n */\n generateTrapezoidGeometry(trapezoids) {\n const positions = [];\n const trapezoidBounds = [];\n const trapezoidBottom = [];\n const indices = [];\n\n let vertexIndex = 0;\n\n for (const trap of trapezoids) {\n const { x1, y1, x2, y2, bottomY1, bottomY2 } = trap;\n\n const vertices = [\n [x1, y1],\n [x2, y2],\n [x2, bottomY2],\n [x1, bottomY1],\n ];\n\n const bounds = [x1, y1, x2, y2];\n const bottom = [x1, bottomY1, x2, bottomY2];\n\n for (let i = 0; i < 4; i++) {\n const [x, y] = vertices[i];\n\n positions.push(x, y);\n trapezoidBounds.push(...bounds);\n trapezoidBottom.push(...bottom);\n }\n\n indices.push(\n vertexIndex,\n vertexIndex + 1,\n vertexIndex + 2,\n vertexIndex,\n vertexIndex + 2,\n vertexIndex + 3\n );\n\n vertexIndex += 4;\n }\n\n return {\n positions: new Float32Array(positions),\n trapezoidBounds: new Float32Array(trapezoidBounds),\n trapezoidBottom: new Float32Array(trapezoidBottom),\n indices: new Uint32Array(indices),\n };\n }\n\n /**\n * Parse gradient definition to shader uniforms (supports up to 16 stops)\n * @param {Array} gradient - Gradient definition\n * @param {String} fallbackColor - Fallback color\n * @returns {Object} - Shader uniform data\n */\n parseGradient(gradient, fallbackColor) {\n if (!gradient || !Array.isArray(gradient) || gradient.length < 2) {\n const fallbackColorVec = colorToVector(fallbackColor);\n return {\n textureData: new Uint8Array([\n 0,\n 0,\n 0,\n 255,\n Math.floor(fallbackColorVec[0] * 255),\n Math.floor(fallbackColorVec[1] * 255),\n Math.floor(fallbackColorVec[2] * 255),\n Math.floor(fallbackColorVec[3] * 255),\n ]),\n textureWidth: 2,\n gradientCount: 1,\n fallbackColor: fallbackColorVec,\n };\n }\n\n const colors = [];\n const stops = [];\n\n for (let i = 0; i < gradient.length; i++) {\n const item = gradient[i];\n\n if (Array.isArray(item)) {\n stops.push(item[0]);\n colors.push(colorToVector(item[1]));\n } else {\n stops.push(i / (gradient.length - 1));\n colors.push(colorToVector(item));\n }\n }\n\n const textureWidth = colors.length * 2;\n const textureData = new Uint8Array(textureWidth * 4);\n\n for (let i = 0; i < colors.length; i++) {\n const stopIndex = i * 8;\n const colorIndex = stopIndex + 4;\n\n textureData[stopIndex] = Math.floor(stops[i] * 255);\n textureData[stopIndex + 1] = 0;\n textureData[stopIndex + 2] = 0;\n textureData[stopIndex + 3] = 255;\n\n textureData[colorIndex] = Math.floor(colors[i][0] * 255);\n textureData[colorIndex + 1] = Math.floor(colors[i][1] * 255);\n textureData[colorIndex + 2] = Math.floor(colors[i][2] * 255);\n textureData[colorIndex + 3] = Math.floor(colors[i][3] * 255);\n }\n\n return {\n textureData,\n textureWidth,\n gradientCount: colors.length,\n fallbackColor: colorToVector(fallbackColor),\n };\n }\n\n /**\n * Draw shadow/trapezoid geometry\n * @param {Array} individualPoints - Points defining the line\n * @param {Object} params - Rendering parameters\n */\n draw(individualPoints, params) {\n\n if (!individualPoints || individualPoints.length < 2) {\n return;\n }\n\n const gl = this._gl;\n const width = gl.drawingBufferWidth;\n const height = gl.drawingBufferHeight;\n\n gl.useProgram(this._program);\n\n if (\n params.renderCutoffGradient &&\n params.cutoffIndex !== undefined &&\n params.originalData\n ) {\n this.drawShadowWithCutoff(individualPoints, params);\n return;\n }\n\n const trapezoids = [];\n const { zero, inRenderSpaceAreaBottom } = params;\n\n\n for (let i = 0; i < individualPoints.length - 1; i++) {\n const [x1, y1] = individualPoints[i];\n const [x2, y2] = individualPoints[i + 1];\n\n let bottomY1 = zero;\n let bottomY2 = zero;\n\n const y1RelativeToZero = y1 - zero;\n const y2RelativeToZero = y2 - zero;\n const crossesZero = y1RelativeToZero * y2RelativeToZero < 0;\n\n if (crossesZero) {\n const t =\n Math.abs(y1RelativeToZero) /\n (Math.abs(y1RelativeToZero) + Math.abs(y2RelativeToZero));\n const xCross = x1 + (x2 - x1) * t;\n const yCross = zero;\n\n if (Math.abs(y1 - yCross) > 0.1) {\n trapezoids.push({\n x1,\n y1,\n x2: xCross,\n y2: yCross,\n bottomY1,\n bottomY2: zero,\n });\n }\n\n if (Math.abs(y2 - yCross) > 0.1) {\n trapezoids.push({\n x1: xCross,\n y1: yCross,\n x2,\n y2,\n bottomY1: zero,\n bottomY2,\n });\n }\n } else {\n // Skip trapezoids completely outside canvas\n if (x1 > width || x2 < 0) {\n continue;\n }\n \n // Clip trapezoid to canvas bounds if it extends beyond\n let finalX2 = x2;\n let finalY2 = y2;\n let finalBottomY2 = bottomY2;\n \n if (x2 > width) {\n const ratio = (width - x1) / (x2 - x1);\n finalX2 = width;\n finalY2 = y1 + (y2 - y1) * ratio;\n finalBottomY2 = bottomY1 + (bottomY2 - bottomY1) * ratio;\n }\n \n const trapezoid = { x1, y1, x2: finalX2, y2: finalY2, bottomY1, bottomY2: finalBottomY2 };\n trapezoids.push(trapezoid);\n }\n }\n \n\n\n if (trapezoids.length === 0) {\n return;\n }\n\n const geometry = this.generateTrapezoidGeometry(trapezoids);\n const positionLoc = gl.getAttribLocation(this._program, \"position\");\n const trapezoidBoundsLoc = gl.getAttribLocation(\n this._program,\n \"trapezoidBounds\"\n );\n const trapezoidBottomLoc = gl.getAttribLocation(\n this._program,\n \"trapezoidBottom\"\n );\n\n gl.enableVertexAttribArray(positionLoc);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._positionBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, geometry.positions, gl.STATIC_DRAW);\n gl.vertexAttribPointer(positionLoc, 2, gl.FLOAT, false, 0, 0);\n\n gl.enableVertexAttribArray(trapezoidBoundsLoc);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._trapezoidBoundsBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, geometry.trapezoidBounds, gl.STATIC_DRAW);\n gl.vertexAttribPointer(trapezoidBoundsLoc, 4, gl.FLOAT, false, 0, 0);\n\n gl.enableVertexAttribArray(trapezoidBottomLoc);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._trapezoidBottomBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, geometry.trapezoidBottom, gl.STATIC_DRAW);\n gl.vertexAttribPointer(trapezoidBottomLoc, 4, gl.FLOAT, false, 0, 0);\n\n gl.uniform1f(gl.getUniformLocation(this._program, \"width\"), width);\n gl.uniform1f(gl.getUniformLocation(this._program, \"height\"), height);\n\n const gradientData = this.parseGradient(params.gradient, params.color);\n\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, this._gradientTexture);\n\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gradientData.textureWidth,\n 1,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n gradientData.textureData\n );\n\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\n gl.uniform1i(gl.getUniformLocation(this._program, \"gradientTexture\"), 0);\n gl.uniform1i(\n gl.getUniformLocation(this._program, \"gradientCount\"),\n gradientData.gradientCount\n );\n gl.uniform4fv(\n gl.getUniformLocation(this._program, \"fallbackColor\"),\n gradientData.fallbackColor\n );\n\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, geometry.indices, gl.STATIC_DRAW);\n\n gl.drawElements(gl.TRIANGLES, geometry.indices.length, gl.UNSIGNED_INT, 0);\n \n const error = gl.getError();\n if (error !== gl.NO_ERROR) {\n console.error('WebGL error in shadow rendering:', error);\n } else {\n //he he he haw\n }\n }\n\n /**\n * Draw shadow chart with cutoff gradient\n * @param {Array} individualPoints - Points defining the line\n * @param {Object} params - Rendering parameters with cutoff info\n */\n drawShadowWithCutoff(individualPoints, params) {\n\n const { cutoffIndex, cutoffOpacity, originalData, selectionBounds, zero } =\n params;\n\n this._lastIndividualPoints = null;\n this._lastParams = null;\n\n // All cutoff data is now in tuple format [x, y] from graph_body_renderer\n let cutoffTime;\n \n if (Array.isArray(originalData[0]) && originalData[0].length === 2) {\n const baseIndex = Math.floor(cutoffIndex);\n const fraction = cutoffIndex - baseIndex;\n\n if (fraction === 0 || baseIndex >= originalData.length - 1) {\n const cutoffItem = originalData[Math.min(baseIndex, originalData.length - 1)];\n const cutoffDate = cutoffItem[0];\n cutoffTime = cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n } else {\n const currentItem = originalData[baseIndex];\n const nextItem = originalData[baseIndex + 1];\n const currentDate = currentItem[0];\n const nextDate = nextItem[0];\n const currentTime = currentDate instanceof Date ? currentDate.getTime() : currentDate;\n const nextTime = nextDate instanceof Date ? nextDate.getTime() : nextDate;\n cutoffTime = currentTime + fraction * (nextTime - currentTime);\n }\n } else {\n cutoffTime = cutoffIndex;\n }\n\n const visibleBounds = params.selectionBounds;\n let firstTime, lastTime;\n \n if (visibleBounds && visibleBounds.minX !== undefined && visibleBounds.maxX !== undefined) {\n firstTime = visibleBounds.minX instanceof Date ? visibleBounds.minX.getTime() : visibleBounds.minX;\n lastTime = visibleBounds.maxX instanceof Date ? visibleBounds.maxX.getTime() : visibleBounds.maxX;\n } else {\n const firstItem = originalData[0];\n const lastItem = originalData[originalData.length - 1];\n const firstX = firstItem[0];\n const lastX = lastItem[0];\n \n firstTime = firstX instanceof Date ? firstX.getTime() : firstX;\n lastTime = lastX instanceof Date ? lastX.getTime() : lastX;\n }\n \n const timeDiff = cutoffTime - firstTime;\n const totalTime = lastTime - firstTime;\n const timeRatio = timeDiff / totalTime;\n\n if (timeRatio < 0) {\n this.draw(individualPoints, { ...params, renderCutoffGradient: false });\n } else if (timeRatio > 1) {\n const reducedOpacityColor = applyReducedOpacity(\n params.color,\n cutoffOpacity\n );\n const translucentGradient = applyReducedOpacityToGradient(\n params.gradient,\n cutoffOpacity\n );\n this.draw(individualPoints, {\n ...params,\n color: reducedOpacityColor,\n gradient: translucentGradient,\n renderCutoffGradient: false,\n });\n } else {\n this.drawSplitShadowTrapezoids(\n individualPoints,\n { ...params, selectionBounds: params.selectionBounds },\n timeRatio,\n cutoffTime\n );\n }\n }\n\n /**\n * Draw split shadow trapezoids with cutoff\n * @param {Array} individualPoints - Points defining the line\n * @param {Object} params - Rendering parameters\n * @param {number} timeRatio - Position of cutoff in visible range (0-1)\n * @param {number} cutoffTime - Cutoff timestamp\n */\n drawSplitShadowTrapezoids(individualPoints, params, timeRatio, cutoffTime) {\n const { zero, cutoffOpacity, selectionBounds } = params;\n const gl = this._gl;\n\n const renderWidth = gl.canvas.width;\n const cutoffPixelX = timeRatio * renderWidth;\n\n const preCutoffPoints = [];\n const postCutoffPoints = [];\n \n for (let i = 0; i < individualPoints.length; i++) {\n const [pixelX, pixelY] = individualPoints[i];\n \n if (pixelX < cutoffPixelX) {\n preCutoffPoints.push(individualPoints[i]);\n } else {\n postCutoffPoints.push(individualPoints[i]);\n }\n }\n \n let ghostPoint = null;\n if (preCutoffPoints.length > 0 && postCutoffPoints.length > 0) {\n const lastPrePoint = preCutoffPoints[preCutoffPoints.length - 1];\n const firstPostPoint = postCutoffPoints[0];\n \n const [x1, y1] = lastPrePoint;\n const [x2, y2] = firstPostPoint;\n \n if (x2 !== x1) {\n const interpolationRatio = (cutoffPixelX - x1) / (x2 - x1);\n const ghostY = y1 + interpolationRatio * (y2 - y1);\n ghostPoint = [cutoffPixelX, ghostY];\n \n preCutoffPoints.push(ghostPoint);\n postCutoffPoints.unshift(ghostPoint);\n }\n }\n\n if (preCutoffPoints.length >= 2) {\n const reducedOpacityColor = applyReducedOpacity(\n params.color,\n cutoffOpacity\n );\n const gl = this._gl;\n\n gl.disable(gl.DEPTH_TEST);\n\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n\n const translucentGradient = applyReducedOpacityToGradient(\n params.gradient,\n cutoffOpacity\n );\n\n this.draw(preCutoffPoints, {\n ...params,\n color: reducedOpacityColor,\n gradient: translucentGradient,\n renderCutoffGradient: false,\n });\n } else {\n }\n\n if (postCutoffPoints.length >= 2) {\n this.draw(postCutoffPoints, {\n ...params,\n renderCutoffGradient: false,\n });\n } else {\n }\n }\n}\n","import Eventable from '../eventable';\nimport getColor, { createDefaultGradient } from '../helpers/colors';\nimport inferType from '../state/infer_type';\nimport BackgroundProgram from './background_program.js';\nimport drawArea from './draw_area';\nimport drawBackground from './draw_background.js';\nimport drawBars from './draw_bars';\nimport drawLine from './draw_line';\nimport LineProgram from './line_program';\nimport ShadowProgram from './shadow_program';\nimport sizeCanvas, { DPI_INCREASE } from './size_canvas';\n\nexport default class GraphBodyRenderer extends Eventable {\n\n constructor({stateController, canvasElement, webgl=false, checkIntersection=true }) {\n super();\n\n this._stateController = stateController;\n\n this._checkIntersection = checkIntersection;\n this._canvas = canvasElement;\n this._webgl = webgl;\n \n if (!this._canvas) {\n console.error('Canvas element is null in GraphBodyRenderer constructor');\n this._initialized = false;\n return;\n }\n \n if (webgl) {\n this._context = this._canvas.getContext('webgl');\n if (this._context) {\n this._lineProgram = new LineProgram(this._context);\n this._shadowProgram = new ShadowProgram(this._context);\n } else {\n console.error('❌ WebGL context creation failed');\n alert('WebGL failed! Attempting fallback to CPU rendering');\n this._webgl = false;\n }\n }\n\n if (!this._webgl) {\n this._context = this._canvas.getContext('2d');\n this._context2d = this._context;\n }\n\n if (!this._context) {\n console.error('Failed to get canvas context in GraphBodyRenderer');\n this._initialized = false;\n return;\n }\n\n this._initialized = this._initializeCanvas();\n\n this._boundResize = this.resize.bind(this);\n this._cachedAxisCount = null;\n this._onAxisChange = (axes) => {\n const count = axes.filter(({ series }) => series.length > 0).length;\n if (this._cachedAxisCount !== count) {\n this._cachedAxisCount = count;\n this.resize();\n }\n };\n\n stateController.on('axes_changed', this._onAxisChange);\n stateController.on('dragging_y_changed', this._boundResize);\n stateController.on('showing_sidebar_changed', this._boundResize);\n }\n\n /**\n * Cleans up after this renderer\n */\n dispose() {\n this.clearListeners();\n this._lineProgram && this._lineProgram.dispose();\n this._shadowProgram && this._shadowProgram.dispose();\n this._cachedAxisCount = null;\n this._stateController.off('axes_changed', this._onAxisChange);\n this._stateController.off('dragging_y_changed', this._boundResize);\n\n if (this._resizeObserver) {\n this._resizeObserver.disconnect();\n }\n\n if (this._intersectionObserver) {\n this._intersectionObserver.disconnect();\n }\n\n if (this._zeroLineCanvas && this._zeroLineCanvas.parentNode) {\n this._zeroLineCanvas.parentNode.removeChild(this._zeroLineCanvas);\n this._zeroLineCanvas = null;\n this._zeroLineContext = null;\n }\n }\n\n clear() {\n if (this._webgl) {\n this._lineProgram.clear();\n } else {\n this._context.clearRect(0, 0, this._context.canvas.width, this._context.canvas.height);\n }\n }\n\n render(singleSeries, inRenderSpace, { highlighted, showIndividualPoints, shadowColor, shadowBlur, width, defaultLineWidth, bounds, globalBounds, inRenderSpaceAreaBottom }) {\n if (!this._initialized || !this._context || !this._canvas) {\n console.warn('GraphBodyRenderer: Cannot render - not initialized, missing context, or missing canvas');\n return;\n }\n \n let cutoffIndex = -1;\n let cutoffTime = null; \n let cutoffData = singleSeries.data; \n\n const isObjectFormat = singleSeries.data && singleSeries.data.length > 0 && \n typeof singleSeries.data[0] === 'object' && \n !Array.isArray(singleSeries.data[0]);\n \n if (isObjectFormat && singleSeries.cutoffTime) {\n cutoffData = singleSeries.data.map(point => {\n const xValue = point[singleSeries.xKey || 'x'];\n const yValue = point[singleSeries.yKey || 'y'];\n \n const convertedX = typeof xValue === 'string' ? new Date(xValue) : xValue;\n \n return [convertedX, yValue];\n });\n }\n \n if (singleSeries.cutoffTime && singleSeries.data && singleSeries.data.length > 0) {\n let cutoffDate;\n if (singleSeries.cutoffTime === 'now') {\n cutoffDate = new Date();\n } else if (typeof singleSeries.cutoffTime === 'number') {\n cutoffDate = new Date(singleSeries.cutoffTime);\n } else {\n cutoffDate = singleSeries.cutoffTime;\n }\n \n cutoffTime = cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n \n for (let i = 0; i < cutoffData.length - 1; i++) {\n const currentPoint = cutoffData[i];\n const nextPoint = cutoffData[i + 1];\n \n const currentTime = currentPoint[0] instanceof Date ? currentPoint[0].getTime() : currentPoint[0];\n const nextTime = nextPoint[0] instanceof Date ? nextPoint[0].getTime() : nextPoint[0];\n \n if (currentTime <= cutoffTime && cutoffTime <= nextTime) {\n const timeRatio = (cutoffTime - currentTime) / (nextTime - currentTime);\n cutoffIndex = i + timeRatio;\n break;\n } else if (currentTime > cutoffTime) {\n cutoffIndex = i;\n break;\n }\n }\n \n if (cutoffIndex === -1) {\n cutoffIndex = cutoffData.length - 1;\n }\n }\n \n const getIndividualPoints = (useDataSpace, includeBeyondBounds = false) => {\n if (!useDataSpace && inRenderSpace && inRenderSpace.yValues && !showIndividualPoints) {\n if (!bounds) {\n bounds = singleSeries.axis.currentBounds;\n }\n \n const individualPoints = [];\n const { yValues, nullMask } = inRenderSpace;\n const threshold = yValues.length / 2;\n let pastThreshold = 0;\n const samples = [];\n \n for (let pixelX = 0; pixelX < yValues.length; pixelX++) {\n if (nullMask[pixelX] === 0) {\n const xCoord = pixelX * DPI_INCREASE;\n individualPoints.push([xCoord, yValues[pixelX]]);\n \n if (pixelX > threshold) {\n pastThreshold++;\n if (samples.length < 3) samples.push({pixelX, xCoord, nullMask: nullMask[pixelX]});\n }\n }\n }\n \n if (individualPoints.length < 50) {\n return getIndividualPoints(true, includeBeyondBounds);\n }\n\n return individualPoints;\n }\n\n if (!bounds) {\n bounds = singleSeries.axis.currentBounds;\n }\n\n const individualPoints = [];\n let data = singleSeries.inSelectedSpace.data;\n if (useDataSpace) {\n data = singleSeries.inDataSpace;\n }\n\n let boundsMinX = bounds.minX instanceof Date ? bounds.minX.getTime() : bounds.minX;\n let boundsMaxX = bounds.maxX instanceof Date ? bounds.maxX.getTime() : bounds.maxX;\n \n let foundBeyondBounds = false;\n let lastPointBeforeBounds = null;\n \n for (let i = 0; i < data.length; i++) {\n let x, y;\n \n if (Array.isArray(data[i])) {\n [x, y] = data[i];\n } else if (typeof data[i] === 'object' && data[i] !== null) {\n x = data[i][singleSeries.xKey];\n y = data[i][singleSeries.yKey];\n } else {\n continue;\n }\n \n if (y === null || y === undefined) {\n continue;\n }\n\n let xValue = x instanceof Date ? x.getTime() : x;\n \n if (xValue < boundsMinX) {\n if (includeBeyondBounds) {\n lastPointBeforeBounds = [xValue, y];\n }\n continue;\n }\n \n if (xValue > boundsMaxX) {\n if (includeBeyondBounds && !foundBeyondBounds) {\n foundBeyondBounds = true;\n } else {\n break;\n }\n }\n\n const renderWidth = this._sizing.renderWidth / DPI_INCREASE;\n const xCoord = (xValue - boundsMinX) / (boundsMaxX - boundsMinX) * (renderWidth - 1) * DPI_INCREASE;\n const yCoord = (1.0 - (y - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight;\n \n individualPoints.push([xCoord, yCoord]);\n }\n\n if (lastPointBeforeBounds && includeBeyondBounds) {\n const [beforeXValue, beforeY] = lastPointBeforeBounds;\n const renderWidth = this._sizing.renderWidth / DPI_INCREASE;\n const beforeXCoord = (beforeXValue - boundsMinX) / (boundsMaxX - boundsMinX) * (renderWidth - 1) * DPI_INCREASE;\n const beforeYCoord = (1.0 - (beforeY - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight;\n individualPoints.unshift([beforeXCoord, beforeYCoord]);\n }\n\n return individualPoints;\n };\n\n const getRanges = () => {\n if (!bounds) {\n bounds = singleSeries.axis.currentBounds;\n }\n\n if (!singleSeries.rangeKey) {\n return [];\n }\n\n const inferredType = inferType(singleSeries, { useSimpleData: true });\n if (inferredType !== 'objects') {\n return [];\n }\n\n return (singleSeries.simpleData || singleSeries.data).map((object) => {\n const range = object[singleSeries.rangeKey];\n\n if (!range) {\n return null;\n }\n\n const min = range.min;\n const max = range.max;\n const x = object[singleSeries.xKey];\n\n return {\n x,\n range,\n\n pixelX: (x - bounds.minX) / (bounds.maxX - bounds.minX) * this._sizing.renderWidth,\n pixelMinY: typeof min === 'number' ? (1.0 - (min - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight : null,\n pixelMaxY: typeof max === 'number' ? (1.0 - (max - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight : null\n };\n });\n };\n\n const cpuRendering = singleSeries.rendering === 'bar' || singleSeries.rendering === 'area';\n let commonCPUParams;\n\n if (cpuRendering) {\n if (this._webgl) {\n console.warn(`CPU rendering (${singleSeries.rendering}) is not supported with webgl={true}. Use webgl={false} or switch to 'line' rendering.`);\n return;\n }\n \n if (!this._context2d) {\n this._context2d = this._canvas.getContext('2d', { willReadFrequently: false });\n }\n \n if (!this._context2d) {\n console.error('Failed to get 2D context for CPU rendering');\n return;\n }\n\n if (this._webgl) {\n this._context.flush();\n }\n\n if (!bounds) {\n bounds = singleSeries.axis.currentBounds;\n }\n\n const zero = singleSeries.zeroLineY === 'bottom' ?\n this._sizing.renderHeight :\n (1.0 - ((singleSeries.zeroLineY || 0) - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight;\n\n commonCPUParams = {\n context: this._context2d,\n color: getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex),\n sizing: this._sizing,\n zero,\n hasNegatives: !!singleSeries.inDataSpace.find((tuple) => tuple[1] < 0),\n negativeColor: singleSeries.negativeColor,\n zeroWidth: singleSeries.zeroLineWidth,\n zeroColor: singleSeries.zeroLineColor\n };\n\n if (!commonCPUParams.hasNegatives && singleSeries.expandYWith) {\n commonCPUParams.hasNegatives = singleSeries.expandYWith.some((y) => y < 0);\n }\n }\n\n if (singleSeries.rendering === 'bar') {\n let barParams = {\n ...commonCPUParams,\n indexInAxis: singleSeries.axis.series.indexOf(singleSeries),\n axisSeriesCount: singleSeries.axis.series.length,\n closestSpacing: globalBounds.closestSpacing,\n bounds\n };\n\n if (singleSeries.cutoffTime) {\n barParams.cutoffIndex = cutoffIndex;\n barParams.cutoffOpacity = singleSeries.cutoffOpacity !== undefined ? singleSeries.cutoffOpacity : 0.35;\n barParams.originalData = cutoffData;\n barParams.renderCutoffGradient = cutoffIndex >= 0; \n \n const selection = this === this._stateController.rangeGraphRenderer \n ? this._stateController._bounds \n : (this._stateController._selection || this._stateController._bounds);\n barParams.selectionBounds = selection;\n }\n\n drawBars(getIndividualPoints(true), barParams);\n return;\n }\n\n if (singleSeries.rendering === 'area') {\n let areaParams = {\n ...commonCPUParams,\n showIndividualPoints: typeof singleSeries.showIndividualPoints === 'boolean' ? singleSeries.showIndividualPoints : showIndividualPoints,\n gradient: singleSeries.gradient,\n pointRadius: singleSeries.pointRadius,\n minPointSpacing: singleSeries.minPointSpacing,\n highlighted,\n width: width || singleSeries.width || defaultLineWidth,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom\n };\n\n if (singleSeries.cutoffTime) {\n areaParams.cutoffIndex = cutoffIndex;\n areaParams.cutoffOpacity = singleSeries.cutoffOpacity !== undefined ? singleSeries.cutoffOpacity : 0.35;\n areaParams.originalData = cutoffData;\n areaParams.renderCutoffGradient = cutoffIndex >= 0; \n areaParams.isPreview = this === this._stateController.rangeGraphRenderer; \n \n const selection = this === this._stateController.rangeGraphRenderer \n ? this._stateController._bounds \n : (this._stateController._selection || this._stateController._bounds);\n areaParams.selectionBounds = selection;\n }\n\n drawArea(getIndividualPoints(true), inRenderSpace, areaParams);\n }\n\n if (singleSeries.rendering === 'shadow') {\n if (!this._webgl || !this._shadowProgram) {\n console.warn('Shadow rendering requires WebGL. Enable webgl={true} on your Grapher component.', {\n webgl: !!this._webgl,\n shadowProgram: !!this._shadowProgram,\n program: !!this._shadowProgram?._program\n });\n return;\n }\n \n if (!this._shadowProgram._program) {\n console.error('ShadowProgram has no valid WebGL program');\n return;\n }\n \n if (!inRenderSpace) {\n console.error('inRenderSpace is null for shadow rendering');\n return;\n }\n \n if (!bounds) {\n bounds = singleSeries.axis.currentBounds;\n }\n \n let zero;\n if (singleSeries.zeroLineY === 'bottom') {\n zero = this._sizing.renderHeight;\n } else if (singleSeries.zeroLineY !== undefined) {\n zero = (1.0 - ((singleSeries.zeroLineY) - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight;\n } else {\n if (bounds.minY <= 0 && bounds.maxY >= 0) {\n zero = (1.0 - (0 - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight;\n } else {\n zero = this._sizing.renderHeight;\n }\n }\n \n const boundsChanged = !this._lastBounds || \n bounds.minY !== this._lastBounds.minY || \n bounds.maxY !== this._lastBounds.maxY || \n this._sizing.renderHeight !== this._lastRenderHeight;\n \n this._lastBounds = {...bounds};\n this._lastRenderHeight = this._sizing.renderHeight;\n \n if (boundsChanged && this._lastShadowCache) {\n this._lastShadowCache = null;\n }\n \n if (zero > this._sizing.renderHeight * 1.5) {\n zero = this._sizing.renderHeight;\n } else if (zero < -this._sizing.renderHeight * 0.5) {\n zero = 0;\n }\n \n const shadowColor = getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex);\n let shadowParams = {\n color: shadowColor,\n gradient: singleSeries.gradient || createDefaultGradient(shadowColor),\n zero,\n sizing: this._sizing,\n inRenderSpaceAreaBottom\n };\n\n if (singleSeries.cutoffTime) {\n shadowParams.cutoffIndex = cutoffIndex;\n shadowParams.cutoffOpacity = singleSeries.cutoffOpacity !== undefined ? singleSeries.cutoffOpacity : 0.35;\n shadowParams.originalData = cutoffData;\n shadowParams.renderCutoffGradient = cutoffIndex >= 0; \n shadowParams.isPreview = this === this._stateController.rangeGraphRenderer; \n\n const selection = this === this._stateController.rangeGraphRenderer \n ? this._stateController._bounds \n : (this._stateController._selection || this._stateController._bounds);\n shadowParams.selectionBounds = selection || bounds;\n }\n\n this._shadowProgram.draw(getIndividualPoints(false, true), shadowParams);\n \n if (this._webgl) {\n const gl = this._context;\n gl.disable(gl.BLEND);\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n }\n \n if (singleSeries.zeroLineWidth && singleSeries.zeroLineWidth > 0) {\n if (this._context2d) {\n this._context2d.save();\n this._context2d.strokeStyle = singleSeries.zeroLineColor || getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex);\n this._context2d.lineWidth = singleSeries.zeroLineWidth;\n this._context2d.globalCompositeOperation = 'source-over';\n \n this._context2d.beginPath();\n this._context2d.moveTo(0, zero);\n this._context2d.lineTo(this._sizing.renderWidth, zero);\n this._context2d.stroke();\n this._context2d.restore();\n } else {\n if (!this._zeroLineCanvas) {\n this._zeroLineCanvas = document.createElement('canvas');\n this._zeroLineCanvas.style.position = 'absolute';\n this._zeroLineCanvas.style.top = '0';\n this._zeroLineCanvas.style.left = '0';\n this._zeroLineCanvas.style.pointerEvents = 'none';\n this._zeroLineContext = this._zeroLineCanvas.getContext('2d');\n this._canvas.parentNode.insertBefore(this._zeroLineCanvas, this._canvas.nextSibling);\n }\n \n this._zeroLineCanvas.width = this._canvas.width;\n this._zeroLineCanvas.height = this._canvas.height;\n this._zeroLineCanvas.style.width = this._canvas.style.width;\n this._zeroLineCanvas.style.height = this._canvas.style.height;\n \n this._zeroLineContext.clearRect(0, 0, this._zeroLineCanvas.width, this._zeroLineCanvas.height);\n this._zeroLineContext.strokeStyle = singleSeries.zeroLineColor || getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex);\n this._zeroLineContext.lineWidth = singleSeries.zeroLineWidth;\n \n this._zeroLineContext.beginPath();\n this._zeroLineContext.moveTo(0, zero);\n this._zeroLineContext.lineTo(this._sizing.renderWidth, zero);\n this._zeroLineContext.stroke();\n }\n }\n }\n\n const shouldShowIndividualPoints = typeof singleSeries.showIndividualPoints === 'boolean' ? singleSeries.showIndividualPoints : showIndividualPoints;\n\n const drawParams = {\n color: getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex),\n context: this._context,\n width: width || singleSeries.width || defaultLineWidth,\n shadowColor,\n shadowBlur,\n dashed: singleSeries.dashed,\n dashPattern: singleSeries.dashPattern,\n highlighted,\n showIndividualPoints: shouldShowIndividualPoints,\n pointRadius: singleSeries.pointRadius,\n minPointSpacing: singleSeries.minPointSpacing,\n getIndividualPoints,\n getRanges: singleSeries.rangeKey ? getRanges : null,\n rendering: singleSeries.rendering // Pass rendering type for all charts\n };\n \n\n if (!inRenderSpace) {\n console.error('inRenderSpace is null for line rendering');\n return;\n }\n \n if (singleSeries.cutoffTime) {\n drawParams.cutoffIndex = cutoffIndex;\n drawParams.cutoffOpacity = singleSeries.cutoffOpacity !== undefined ? singleSeries.cutoffOpacity : 0.35;\n drawParams.originalData = cutoffData;\n drawParams.renderCutoffGradient = cutoffIndex >= 0;\n drawParams.currentBounds = bounds;\n drawParams.isPreview = this === this._stateController.rangeGraphRenderer;\n \n const selection = this === this._stateController.rangeGraphRenderer \n ? this._stateController._bounds \n : (this._stateController._selection || this._stateController._bounds);\n drawParams.selectionBounds = selection || bounds; \n }\n \n if (this._webgl) {\n this._lineProgram.draw(inRenderSpace, drawParams);\n } else {\n drawLine(inRenderSpace, drawParams);\n }\n \n }\n\n renderBackground(inBackgroundSpace) {\n if (!inBackgroundSpace) {\n return;\n }\n\n if (this._webgl) {\n if (!this._backgroundProgram) {\n this._backgroundProgram = new BackgroundProgram(this._context);\n }\n \n this._backgroundProgram.draw(inBackgroundSpace);\n } else {\n drawBackground(inBackgroundSpace, {\n context: this._context\n });\n }\n }\n\n /**\n * Initializes canvas\n * Currently, just sets sizing\n */\n async _initializeCanvas() {\n this._sizing = await sizeCanvas(this._canvas, this._context);\n\n this.emit('size_changed', this._sizing);\n this._stateController.markSizeChanged();\n\n if (window.ResizeObserver) {\n let first = true;\n let disabled = false;\n\n this._resizeObserver = new window.ResizeObserver( () => {\n if (first) { // always fires once at the beginning\n first = false;\n return;\n }\n\n if (disabled) {\n return;\n }\n\n disabled = true;\n this.resize().then(() => {\n disabled = false;\n });\n });\n\n this._resizeObserver.observe(this._canvas.parentNode);\n }\n\n if (this._checkIntersection && window.IntersectionObserver) {\n this._intersectionObserver = new window.IntersectionObserver((entries) => {\n clearTimeout(this._intersectionTimeout);\n\n if (!entries[0].isIntersecting) {\n return;\n }\n\n this._intersectionTimeout = setTimeout(() => {\n this.resize();\n }, 50);\n }, {\n threshold: 0.1\n });\n\n this._intersectionObserver.observe(this._canvas.parentNode);\n }\n }\n\n async resize() {\n const sizingPromise = sizeCanvas(this._canvas, this._context, { reset: true });\n this._initialized = sizingPromise;\n\n this._sizing = await this._initialized;\n if (this._initialized !== sizingPromise) {\n return;\n }\n\n this.emit('size_changed', this._sizing);\n this._stateController.markSizeChanged(this);\n }\n\n resizeDebounced() {\n if (this._resizeTimeout) {\n clearTimeout(this._resizeTimeout);\n }\n\n this._resizeTimeout = setTimeout(() => {\n this.resize();\n this._resizeTimeout = null;\n }, 50);\n }\n\n recalculatePosition() {\n if (!this._sizing) {\n return;\n }\n\n this._sizing.boundingRect = this._canvas.getBoundingClientRect();\n }\n\n /**\n * Returns the bounding rect of the element\n *\n * @return {DOMRect}\n */\n get boundingRect() {\n return this._sizing?.boundingRect;\n }\n\n get sizing() {\n return this._sizing;\n }\n\n}\n","/**\n * Draws the background on a 2d canvas\n *\n * @param {Array<{ minXt: number, maxXt: number, color: string }>} data\n * @param {CanvasRenderingContext2D} context\n */\nexport default function drawBackground({ data }, { context }) {\n if (!context) {\n console.error('Canvas context is null in drawBackground');\n return;\n }\n \n const width = context.canvas.width;\n const height = context.canvas.height;\n\n for (let { minXt, maxXt, color } of data) {\n context.fillStyle = color;\n context.fillRect(minXt*width, 0, (maxXt - minXt)*width, height);\n }\n}\n","export function calculatePrecision(value) {\n return Math.max(-Math.log10(Math.abs(value)) + 2, 0);\n}\n\nexport function calculateTimePrecision(minDate, maxDate) {\n minDate = new Date(minDate);\n maxDate = new Date(maxDate);\n\n const range = maxDate.valueOf() - minDate.valueOf();\n if (range < 3*1000) {\n return 'ms';\n } else if (range < 10*60*1000) {\n return 's';\n } else {\n return 'm';\n }\n}\n\nexport function roundToPrecision(value, precision=null) {\n if (precision === null) {\n precision = calculatePrecision(value);\n }\n\n if (isNaN(precision) || precision > 100) {\n return value.toString();\n }\n\n const rounded = value.toFixed(Math.ceil(precision));\n let stripped = rounded;\n if (rounded.includes('.')) {\n stripped = stripped.replace(/\\.?0+$/g, '');\n }\n\n if (stripped === '') {\n return '0';\n }\n\n return stripped;\n}\n\nconst DATE_TIME_FORMATTERS = {};\n\n/**\n * Given a timezone string, gets the offset relative to utc in milliseconds\n * For example, America/New_York in winter is GMT-05:00, so it evaluates to -5*60*60*1000\n *\n * @param {String} timeZone - the time zone string\n * @param {Date} sampleDate - a date to use in the conversions, since it can be time-of-year dependent with Daylight Savings Time\n * @return {number|null}\n */\nfunction timezoneToOffsetMS(timeZone, sampleDate) {\n try { // formats are finicky, so give up rather than abort rendering\n let datetimeFormatter = DATE_TIME_FORMATTERS[timeZone];\n if (!datetimeFormatter) {\n let properTimeZone = timeZone;\n if (!timeZone || timeZone === 'local') {\n properTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n datetimeFormatter = new Intl.DateTimeFormat('en-US', {\n timeZone: properTimeZone,\n timeZoneName: 'longOffset'\n });\n DATE_TIME_FORMATTERS[timeZone] = datetimeFormatter;\n }\n\n const parts = datetimeFormatter.formatToParts(sampleDate);\n const offsetPart = parts.find(part => part.type === 'timeZoneName');\n\n if (!offsetPart) {\n return null;\n }\n\n if (offsetPart.value === 'GMT') {\n return 0;\n }\n\n if (!/^GMT[+-]\\d{2}:\\d{2}$/.test(offsetPart.value)) {\n return null;\n }\n\n const [hours, minutes] = offsetPart.value.slice(3).split(':');\n\n return parseInt(hours)*60*60*1000 + parseInt(minutes)*60*1000;\n } catch (e) {\n console.error(new Error(`Could not parse timezone offset for ${sampleDate} in ${timeZone}`)); // eslint-disable-line no-console\n console.error(e); // eslint-disable-line no-console\n return null;\n }\n}\n\n/**\n * Gets the Date object that represents the start of day in a given timezone\n * Note that this is still a native date object, so it will be in the local timezone\n * Its timestamp, however, will correspond to the start of the day in the given timezone\n *\n * @param date\n * @param timezone\n * @return {Date}\n */\nexport function startOfDayInTimezone(date, timezone) {\n if (!timezone) {\n const startOfDay = new Date(date);\n startOfDay.setHours(0, 0, 0, 0);\n return startOfDay;\n }\n\n const offset = timezoneToOffsetMS(timezone, date); // ms between timezone and utc\n let startOfDay = new Date(date);\n startOfDay.setUTCHours(0, 0, 0, 0);\n\n const difference = startOfDay.valueOf() - date.valueOf();\n\n // if we would have gone forward a day when offset is taken into account, we need to go back a day again\n if (difference > offset) {\n startOfDay = new Date(startOfDay.valueOf() - 24*60*60*1000);\n }\n\n return new Date(startOfDay.valueOf() - offset);\n}\n\nfunction formatTime(time, {precision, justTime, justDate, justMonthAndDay, unitOverride, clockStyle='24h', timeZone}) {\n const utc = timeZone && timeZone.toLowerCase() === 'utc';\n if (timeZone && !utc && timeZone !== 'local' && window.Intl && window.Intl.DateTimeFormat) {\n const offset = timezoneToOffsetMS(timeZone, time);\n const localOffset = timezoneToOffsetMS('local', time);\n\n if (typeof offset === 'number' && typeof localOffset === 'number') {\n time = new Date(time.valueOf() + offset - localOffset);\n }\n }\n\n const year = utc ? time.getUTCFullYear() : time.getFullYear();\n const month = (utc ? time.getUTCMonth() : time.getMonth()) + 1;\n const day = utc ? time.getUTCDate() : time.getDate();\n\n if (unitOverride === 'year') {\n return year.toString();\n }\n\n if (justDate) {\n return utc ? `${month}/${day}/${year}` : time.toLocaleDateString();\n }\n\n if (justMonthAndDay) {\n // eg Jan 19\n const monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n return `${monthNames[month - 1]} ${day}`;\n }\n\n const hours = utc ? time.getUTCHours() : time.getHours();\n const minutes = utc ? time.getUTCMinutes() : time.getMinutes();\n const seconds = utc ? time.getUTCSeconds() : time.getSeconds();\n const milliseconds = utc ? time.getUTCMilliseconds() : time.getMilliseconds();\n\n let timeString;\n\n if (clockStyle === '12h') {\n timeString = `${((hours + 11) % 12 + 1).toString()}:${minutes.toString().padStart(2, '0')}`;\n } else {\n timeString = `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}`;\n }\n\n if (precision === 's' || precision === 'ms') {\n timeString += `:${seconds.toString().padStart(2, '0')}`;\n }\n\n if (precision === 'ms') {\n timeString += `.${milliseconds.toString().padStart(3, '0')}`;\n }\n\n if (clockStyle === '12h') {\n timeString += hours >= 12 ? 'pm' : 'am';\n }\n\n if (justTime) {\n return timeString;\n }\n\n if (utc) {\n timeString += ' UTC';\n }\n\n return (utc ? `${month}/${day}/${year}` : time.toLocaleDateString()) + ' ' + timeString;\n}\n\nexport function formatX(x, {dates=false, precision=null, justTime=false, justDate=false, justMonthAndDay=false, clockStyle='24h', unitOverride, timeZone, integersOnly=false, inverseEnumMap}={}) {\n if (dates && !(x instanceof Date)) {\n x = new Date(x);\n\n if (isNaN(x)) {\n return 'Invalid Date';\n }\n }\n\n if (x instanceof Date) {\n return formatTime(x, {precision, justTime, justDate, justMonthAndDay, unitOverride, clockStyle, timeZone});\n }\n\n if (isNaN(x)) {\n return 'NaN';\n }\n\n if (inverseEnumMap) {\n if (Math.abs(x - Math.round(x)) > 1e-10) {\n return '';\n }\n\n return inverseEnumMap[Math.round(x)];\n }\n\n if (integersOnly && Math.abs(x - Math.round(x)) > 1e-10) {\n return '';\n }\n\n return roundToPrecision(x, precision);\n}\n\nexport function formatY(y, {precision=null, log=false}={}) {\n if (y === null) {\n return 'null';\n }\n\n if (isNaN(y)) {\n return 'NaN';\n }\n\n if (log) {\n return `10^${roundToPrecision(Math.log10(y), precision)}`;\n }\n\n return roundToPrecision(y, precision);\n}\n","export const Y_AXIS_WIDTH = 32;\nexport const BIG_Y_AXIS_LABEL_OFFSET = 20;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport {formatX, formatY} from '../helpers/format';\nimport {Y_AXIS_WIDTH} from '../helpers/axis_sizes';\nimport CustomPropTypes from '../helpers/custom_prop_types';\n\nfunction getYLabelContent({ yLabel, y, fullYPrecision}) {\n if (fullYPrecision && !yLabel) {\n if (y === undefined) {\n return 'undefined';\n }\n\n if (y === null) {\n return 'null';\n }\n\n return y.toString();\n }\n\n if (typeof yLabel === 'number') {\n if (fullYPrecision) {\n return yLabel.toString();\n } else {\n return formatY(yLabel);\n }\n }\n\n if (typeof yLabel === 'object') {\n return formatY(y);\n }\n\n return yLabel || formatY(y);\n}\n\nfunction TooltipLabel({ axisLabel, x, y, xLabel, yLabel, textLeft, textTop, includeSeriesLabel, includeXValue, includeYValue, includeXLabel, includeYLabel, fullYPrecision, formatXOptions }) {\n let i = 0;\n\n return (\n <g>\n {\n includeSeriesLabel &&\n <text x={textLeft} y={textTop + (i++)*12}>\n {axisLabel}\n </text>\n }\n\n {\n includeXValue &&\n <text x={textLeft} y={textTop + (i++) * 12}>\n {includeXLabel && 'x: '}{xLabel || formatX(x, formatXOptions)}\n </text>\n }\n\n {\n includeYValue &&\n <text x={textLeft} y={textTop + (i++) * 12}>\n {includeYLabel && 'y: '}{getYLabelContent({ yLabel, y, fullYPrecision})}\n </text>\n }\n </g>\n );\n}\n\nTooltipLabel.propTypes = {\n axisLabel: PropTypes.string,\n x: PropTypes.oneOfType([PropTypes.number, PropTypes.instanceOf(Date)]),\n y: PropTypes.number,\n xLabel: PropTypes.string,\n yLabel: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n textLeft: PropTypes.number.isRequired,\n textTop: PropTypes.number.isRequired,\n fullYPrecision: PropTypes.bool,\n formatXOptions: PropTypes.object,\n ...CustomPropTypes.TooltipOptionsRaw\n};\n\nexport default class Tooltip extends React.PureComponent {\n\n render() {\n const textPadding = 3;\n let height = 12*3 + 2*textPadding;\n\n if (!this.props.includeSeriesLabel) {\n height -= 12;\n }\n\n if (!this.props.includeXValue) {\n height -= 12;\n }\n\n if (!this.props.includeYValue) {\n height -= 12;\n }\n\n const caretSize = 7;\n const halfHeight = height/2;\n const caretPadding = 4;\n\n const textTop = -halfHeight + textPadding;\n\n const formatXOptions = {\n clockStyle: this.props.clockStyle,\n timeZone: this.props.timeZone\n };\n\n const passThroughProps = {\n includeSeriesLabel: this.props.includeSeriesLabel,\n includeXLabel: this.props.includeXLabel,\n includeYLabel: this.props.includeYLabel,\n includeXValue: this.props.includeXValue,\n includeYValue: this.props.includeYValue,\n formatXOptions\n };\n\n const preparedTooltips = this.props.tooltips.map((tooltip) => {\n const { x, y, pixelY, pixelX, series, index, xLabel, yLabel, fullYPrecision } = tooltip;\n\n if (typeof pixelX !== 'number') {\n return null;\n }\n\n const axisLabel = (series.name || series.yKey || index).toString();\n let width = Math.max(axisLabel.length, (xLabel || formatX(x, formatXOptions)).length + 4, getYLabelContent({ yLabel, y, fullYPrecision}).length + 4) * 7.5;\n if (series.tooltipWidth) {\n width = series.tooltipWidth;\n }\n\n let fixedPosition = this.props.elementWidth < (width + 2*caretSize + 2*caretPadding);\n\n let multiplier = 1;\n if (pixelX >= this.props.elementWidth - (width + 2*caretSize + caretPadding)) {\n multiplier = -1;\n }\n\n if (pixelX < width + 2*caretSize + caretPadding && multiplier === -1) {\n fixedPosition = true;\n }\n\n if (y === null) {\n fixedPosition = true;\n }\n\n if (this.props.alwaysFixedPosition) {\n fixedPosition = true;\n }\n\n let textLeft = caretSize + caretPadding;\n if (multiplier < 0) {\n textLeft = -width - textLeft;\n } else {\n textLeft += 6;\n }\n\n if (!isFinite(pixelX)) {\n return null;\n }\n\n const transform = `translate(${pixelX},${pixelY})`;\n\n const commonLabelProps = {\n fullYPrecision: fullYPrecision || this.props.maxPrecision,\n x,\n y,\n axisLabel,\n xLabel,\n yLabel,\n ...passThroughProps\n };\n\n let yTranslation = 0;\n let baseLeft;\n\n if (fixedPosition) {\n textLeft = 6;\n\n baseLeft = this.props.elementWidth / 2 - width / 2;\n\n if (width > this.props.elementWidth && !this.props.floating) {\n baseLeft -= Y_AXIS_WIDTH * this.props.axisCount / 2;\n }\n\n yTranslation = 18;\n\n if (this.props.floating) {\n if (this.props.floatPosition === 'bottom') {\n yTranslation = this.props.elementHeight + halfHeight + 4;\n } else {\n yTranslation = -height;\n }\n\n if (this.props.floatDelta) {\n yTranslation += this.props.floatDelta;\n }\n }\n }\n\n return {\n ...tooltip,\n label: axisLabel,\n indexInAxis: series?.axis?.series?.indexOf(series),\n axisLabel,\n width,\n fixedPosition,\n multiplier,\n textLeft,\n transform,\n commonLabelProps,\n textTop,\n height,\n caretSize,\n halfHeight,\n caretPadding,\n yTranslation,\n baseLeft\n };\n }).filter(Boolean);\n\n const CustomTooltipComponent = this.props.customTooltip;\n\n let groupedTooltips;\n if (this.props.combineTooltips) {\n let combinationThreshold = 50; // in px how close tooltips should be to combine\n if (typeof this.props.combineTooltips === 'number') {\n combinationThreshold = this.props.combineTooltips;\n }\n\n groupedTooltips = [];\n\n for (let tooltip of preparedTooltips) {\n let added = false;\n for (let group of groupedTooltips) {\n if (Math.abs(group.pixelX - tooltip.pixelX) <= combinationThreshold) {\n group.tooltips.push(tooltip);\n if (tooltip.pixelX > group.pixelX) {\n group.pixelX = tooltip.pixelX;\n group.multiplier = tooltip.multiplier;\n }\n\n if (tooltip.pixelY < group.pixelY) {\n group.pixelY = tooltip.pixelY;\n }\n\n added = true;\n break;\n }\n }\n\n if (!added) {\n groupedTooltips.push({\n pixelX: tooltip.pixelX,\n pixelY: tooltip.pixelY,\n multiplier: tooltip.multiplier,\n tooltips: [tooltip]\n });\n }\n }\n\n for (let group of groupedTooltips) {\n let totalHeight = 0;\n let maxWidth = 0;\n\n // sort by indexInAxis\n group.tooltips.sort((a, b) => a.indexInAxis - b.indexInAxis);\n\n for (let i = 0; i < group.tooltips.length; i++) {\n group.tooltips[i].textTop = totalHeight;\n totalHeight += group.tooltips[i].height;\n maxWidth = Math.max(maxWidth, group.tooltips[i].width);\n }\n\n for (let i = 0; i < group.tooltips.length; i++) {\n group.tooltips[i].textTop -= totalHeight/2;\n group.tooltips[i].textTop += textPadding;\n }\n\n group.height = totalHeight;\n group.halfHeight = totalHeight / 2;\n group.caretSize = caretSize;\n group.width = maxWidth;\n }\n }\n\n return (\n <div className=\"grapher-tooltip\">\n <svg>\n {\n preparedTooltips.map((tooltip, i) => {\n const { color, fixedPosition, width, transform, baseLeft, commonLabelProps, yTranslation, multiplier, textLeft, textTop } = tooltip;\n\n if (this.props.customTooltip || groupedTooltips) {\n return (\n <g key={i} transform={transform} className=\"tooltip-item\">\n <circle r={4} fill={color}/>\n </g>\n );\n }\n\n // display in a fixed position if not wide enough\n if (fixedPosition) {\n return (\n <g key={i} className=\"tooltip-item tooltip-item-fixed\">\n <circle r={4} fill={color} transform={transform} />\n\n <g transform={`translate(${baseLeft}, ${yTranslation})`}>\n <path stroke={color} d={`M0,0 V-${halfHeight} h${width} V${halfHeight} h${-width} V0`} />\n\n <TooltipLabel\n textLeft={textLeft} textTop={textTop}\n {...commonLabelProps}\n />\n </g>\n </g>\n );\n }\n\n return (\n <g key={i} transform={transform} className=\"tooltip-item\">\n <circle r={4} fill={color} />\n\n <path stroke={color} d={`M${multiplier*caretPadding},0 L${multiplier*caretSize*2},-${caretSize} V-${halfHeight} h${multiplier*width} V${halfHeight} h${multiplier*-width} V${caretSize} L${multiplier*caretPadding},0`} />\n\n <TooltipLabel\n textLeft={textLeft} textTop={textTop}\n {...commonLabelProps}\n />\n </g>\n );\n })\n }\n\n {\n !this.props.customTooltip && groupedTooltips &&\n groupedTooltips.map(({ tooltips, pixelX, pixelY, halfHeight, multiplier, color, width }, i) =>\n <g key={i} transform={`translate(${pixelX},${pixelY})`} className=\"tooltip-item\">\n <path stroke={color} d={`M${multiplier*caretPadding},0 L${multiplier*caretSize*2},-${caretSize} V-${halfHeight} h${multiplier*width} V${halfHeight} h${multiplier*-width} V${caretSize} L${multiplier*caretPadding},0`} />\n\n {\n tooltips.map((tooltip, j) =>\n <TooltipLabel\n key={j}\n textTop={tooltip.textTop}\n textLeft={tooltip.textLeft}\n {...tooltip.commonLabelProps}\n />\n )\n }\n </g>\n )\n }\n </svg>\n\n {\n this.props.customTooltip &&\n (groupedTooltips || preparedTooltips).map((tooltip, i) =>\n <div\n key={i}\n className=\"custom-tooltip-container\"\n style={{top: tooltip.pixelY, left: tooltip.pixelX}}\n >\n <CustomTooltipComponent {...tooltip} />\n </div>\n )\n }\n </div>\n );\n }\n\n}\n\nTooltip.defaultProps = {\n includeSeriesLabel: true,\n includeXLabel: true,\n includeYLabel: true,\n includeXValue: true,\n includeYValue: true\n};\n\nTooltip.propTypes = {\n mouseX: PropTypes.number.isRequired,\n mouseY: PropTypes.number.isRequired,\n elementHeight: PropTypes.number.isRequired,\n elementWidth: PropTypes.number.isRequired,\n tooltips: PropTypes.arrayOf(PropTypes.shape({\n x: PropTypes.oneOfType([PropTypes.number, PropTypes.instanceOf(Date)]),\n y: PropTypes.number,\n pixelY: PropTypes.number,\n color: PropTypes.string,\n xLabel: PropTypes.string,\n yLabel: PropTypes.any,\n fullYPrecision: PropTypes.bool\n })),\n axisCount: PropTypes.number.isRequired,\n maxPrecision: PropTypes.bool.isRequired,\n clockStyle: PropTypes.oneOf(['12h', '24h']),\n timeZone: PropTypes.string,\n ...CustomPropTypes.TooltipOptionsRaw\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nexport default class ContextMenu extends React.PureComponent {\n constructor(props) {\n super(props);\n this.setTextRef = this.setTextRef.bind(this);\n }\n \n setTextRef(ref) {\n this.textRef = ref;\n\n if (this.props.contextMenu.showing && this.textRef) {\n const range = document.createRange();\n const selection = window.getSelection();\n\n selection.removeAllRanges();\n\n range.selectNodeContents(this.textRef);\n selection.addRange(range);\n this.textRef.focus();\n }\n }\n \n formatDateTime(dateTimeStr) {\n const [datePart, timePart] = dateTimeStr.split(', ');\n\n const [month, day, year] = datePart.split('/');\n const formattedDate = `${month.padStart(2, '0')}/${day.padStart(2, '0')}/${year}`;\n\n const [time, period] = timePart.split(' ');\n const [hours, minutes] = time.split(':');\n const formattedHours = hours.padStart(2, '0');\n const formattedTime = `${formattedHours}:${minutes} ${period}`;\n\n return `${formattedDate} ${formattedTime}`;\n }\n \n render() {\n const { x, y, showing, value } = this.props.contextMenu;\n\n const style = { left: x, top: y, width: '150px'};\n \n if (!showing || !value || value.toLocaleString() === 'Invalid Date' || isNaN(x) || isNaN(y)) {\n return null;\n }\n\n const displayValue = value instanceof Date ? this.formatDateTime(value.toLocaleString()) : value;\n return (\n <div className=\"grapher-context-menu\" style={style}>\n <div className=\"menu-item\">\n <div className=\"menu-text\" autoFocus={true} ref={this.setTextRef}>\n {displayValue}\n </div>\n </div>\n </div>\n );\n }\n\n}\n\nContextMenu.propTypes = {\n contextMenu: PropTypes.shape({\n x: PropTypes.number,\n y: PropTypes.number,\n showing: PropTypes.bool,\n value: PropTypes.oneOfType([\n PropTypes.instanceOf(Date),\n PropTypes.number,\n PropTypes.object\n ])\n }).isRequired\n};\n","import inferType from '../infer_type';\nimport { SIMPLE_DATA_TYPES } from '../data_types';\n\n/**\n * Given a series of a simple type (ie, not a function or an observable), converts it into data space\n *\n * @param {*} singleSeries\n * @param {Object} options\n * @return {*}\n */\nexport default function simpleSeriesToDataSpace(singleSeries, options={}) {\n const type = inferType(singleSeries, { useSimpleData: true, data: options.data });\n if (!SIMPLE_DATA_TYPES.includes(type)) {\n throw new Error(`Cannot normalize ${type} (expected a simple type)`);\n }\n\n const inDataSpace = {\n tuples: tuplesToDataSpace,\n values: valuesToDataSpace,\n objects: objectsToDataSpace\n }[type](options.data || singleSeries.simpleData || singleSeries.data, singleSeries, options);\n\n if (singleSeries.square) {\n const square = [];\n let prevY = options.prevY;\n for (let tuple of inDataSpace) {\n if (prevY !== undefined) {\n square.push([tuple[0], prevY]);\n }\n square.push(tuple);\n prevY = tuple[1];\n }\n\n return square;\n }\n\n if (singleSeries.shiftXBy) {\n for (let tuple of inDataSpace) {\n if (typeof tuple[0] === 'string') {\n const originalXValue = tuple[0];\n tuple[0] = new Date(new Date(tuple[0]).valueOf() + singleSeries.shiftXBy);\n if (isNaN(tuple[0])) {\n tuple[0] = options.stateController.enumToNumber(originalXValue, singleSeries);\n }\n } else if (tuple[0] instanceof Date) {\n tuple[0] = new Date(tuple[0].valueOf() + singleSeries.shiftXBy);\n } else if (typeof tuple[0] === 'number') {\n tuple[0] += singleSeries.shiftXBy;\n }\n }\n }\n\n if (singleSeries.xUnixDates) {\n for (let tuple of inDataSpace) {\n if (typeof tuple[0] === 'number') {\n tuple[0] = new Date(tuple[0]*1000);\n }\n }\n }\n\n return inDataSpace;\n}\n\n/**\n * Converts a values array to data space\n *\n * @param {Array<Number|String>} data\n * @param {Object} singleSeries\n * @param {Object} options\n * @param {Number} [options.valueXStart]\n * @param {StateController} options.stateController\n * @return {Array<Array<Number|Date|null>>}\n */\nfunction valuesToDataSpace(data, singleSeries, options) {\n const inDataSpace = [];\n\n for (let i = 0; i < data.length; i++) {\n let yValue = data[i];\n\n if (typeof yValue === 'string') {\n yValue = options.stateController.enumToNumber(yValue, singleSeries);\n }\n\n if (typeof yValue === 'boolean') {\n yValue = +yValue;\n }\n\n inDataSpace.push([i + (options.valueXStart || 0), yValue]);\n }\n\n return inDataSpace;\n}\n\n/**\n * Converts a tuples array to data space\n *\n * @param {Array<Array<Number|Date|null>>} data\n * @param {Object} singleSeries\n * @param {Object} options\n * @param {StateController} options.stateController\n * @return {Array<Array<Number|Date|null>>}\n */\nfunction tuplesToDataSpace(data, singleSeries, options) {\n return [...data.map(([ xValue, yValue]) => {\n if (yValue === undefined) {\n yValue = null;\n }\n\n if (typeof xValue === 'string') {\n const originalXValue = xValue;\n xValue = new Date(xValue);\n\n if (isNaN(xValue)) {\n xValue = options.stateController.enumToNumber(originalXValue, singleSeries, true);\n }\n }\n\n if (typeof yValue === 'string') {\n yValue = options.stateController.enumToNumber(yValue, singleSeries);\n }\n\n if (typeof yValue === 'boolean') {\n yValue = +yValue;\n }\n\n return [xValue, yValue];\n })];\n}\n\nfunction readBinaryFormatValue(view, offset, index) {\n const localOffset = view.getUint32(offset + 2 + Uint32Array.BYTES_PER_ELEMENT*index, true);\n\n if (localOffset === 0) {\n return null;\n }\n\n const type = view.getUint8(localOffset);\n\n if (type === 0) {\n return view.getFloat64(offset + localOffset + 1, true);\n } else if (type === 1 || type === 6) {\n return null;\n } else if (type === 3) {\n return new Date(view.getFloat64(offset + localOffset + 1, true));\n } else {\n throw new Error(`Binary format type ${type} not supported`);\n }\n}\n\n/**\n * Converts an objects array to data space\n *\n * @param {Array<Object>} data\n * @param {Object} series\n * @param {Object} options\n * @param {StateController} options.stateController\n * @return {Array<Array<Number|Date|null>>}\n */\nfunction objectsToDataSpace(data, series, options) {\n if (!series.xKey || typeof series.xKey !== 'string') {\n throw new Error('xKey must be provided in the series');\n }\n\n if (!series.yKey || typeof series.yKey !== 'string') {\n throw new Error('yKey must be provided in the series');\n }\n\n const inDataSpace = [];\n\n for (let point of data) {\n if (point.buffer instanceof ArrayBuffer) {\n const view = new DataView(point.buffer);\n const xIndex = point.channels[series.xKey];\n const yIndex = point.channels[series.yKey];\n\n for (let offset of point.offsets) {\n inDataSpace.push([readBinaryFormatValue(view, offset, xIndex), readBinaryFormatValue(view, offset, yIndex)]);\n }\n } else if (Array.isArray(point[series.yKey])) {\n if (point[series.yKey].length && !Array.isArray(point[series.yKey][0]) && typeof point[series.yKey][0] === 'object') {\n for (let subpoint of point[series.yKey]) {\n let yValue = subpoint[series.yKey];\n if (yValue === undefined) {\n yValue = null;\n }\n\n if (typeof yValue === 'string') {\n yValue = options.stateController.enumToNumber(yValue, series);\n }\n\n if (typeof yValue === 'boolean') {\n yValue = +yValue;\n }\n\n let xValue = subpoint[series.xKey];\n if (typeof xValue === 'string') {\n xValue = new Date(xValue);\n }\n\n inDataSpace.push([xValue, yValue]);\n }\n } else {\n inDataSpace.push(...point[series.yKey]);\n }\n } else {\n let yValue = point[series.yKey];\n if (yValue === undefined) {\n yValue = null;\n }\n\n let xValue = point[series.xKey];\n if (typeof xValue === 'string') {\n xValue = new Date(xValue);\n }\n\n if (typeof yValue === 'string') {\n yValue = options.stateController.enumToNumber(yValue, series);\n }\n\n if (typeof yValue === 'boolean') {\n yValue = +yValue;\n }\n\n inDataSpace.push([xValue, yValue]);\n }\n }\n\n return inDataSpace;\n}\n","function finalizeBounds(bounds, { dates }) {\n const initial = (bounds.minX === null && bounds.maxX === null) || bounds.minY === null || bounds.maxY === null;\n\n for (let key of Object.keys(bounds)) {\n if (typeof bounds[key] !== 'number') {\n bounds[key] = 0;\n }\n }\n\n bounds.initial = initial;\n bounds.dates = dates;\n\n return bounds;\n}\n\nfunction percentileBounds(inDataSpace, bounds, {percentile=100, percentileAsymmetry=0}={}) {\n let dates = false;\n\n bounds.minX = inDataSpace[0][0];\n if (bounds.minX instanceof Date) {\n bounds.minX = bounds.minX.valueOf();\n dates = true;\n }\n\n bounds.maxX = inDataSpace[inDataSpace.length - 1][0];\n if (bounds.maxX instanceof Date) {\n bounds.maxX = bounds.maxX.valueOf();\n dates = true;\n }\n\n const sortedByY = inDataSpace\n .filter(([_x, y]) => typeof y === 'number')\n .sort(([_x1, y1], [_x2, y2]) => y1 - y2);\n\n if (!sortedByY.length) {\n return finalizeBounds(bounds, {dates});\n }\n\n const asymmetry = Math.min(Math.abs(percentileAsymmetry), (100-percentile)/2) * (percentileAsymmetry < 0 ? -1 : 1);\n const inBottomPercentile = (100-percentile)/2 + asymmetry;\n const inTopPercentile = (100-percentile)/2 - asymmetry;\n\n const startIndex = Math.floor((sortedByY.length-1)*inBottomPercentile/100);\n const endIndex = Math.floor((sortedByY.length-1)*(100-inTopPercentile)/100);\n\n bounds.minY = sortedByY[startIndex][1];\n bounds.maxY = sortedByY[endIndex][1];\n\n return finalizeBounds(bounds, {dates});\n}\n\nexport default function calculateDataBounds(inDataSpace, {percentile=100, percentileAsymmetry=0}={}) {\n let bounds = {\n minX: null,\n maxX: null,\n minY: null,\n maxY: null,\n closestSpacing: null\n };\n\n if (percentile !== 100 && inDataSpace.length) {\n return percentileBounds(inDataSpace, bounds, {percentile, percentileAsymmetry});\n }\n\n let dates = false;\n let prevX = null;\n\n for (let [x, y] of inDataSpace) {\n if (x instanceof Date) {\n x = x.valueOf();\n dates = true;\n }\n\n if (typeof bounds.minX !== 'number' || x < bounds.minX) {\n bounds.minX = x;\n }\n\n if (typeof bounds.maxX !== 'number' || x > bounds.maxX) {\n bounds.maxX = x;\n }\n\n if (typeof prevX === 'number' && typeof x === 'number') {\n const spacing = x - prevX;\n if (typeof bounds.closestSpacing !== 'number' || spacing < bounds.closestSpacing) {\n bounds.closestSpacing = spacing;\n }\n }\n prevX = x;\n\n if (typeof y !== 'number') {\n continue;\n }\n\n if (typeof bounds.minY !== 'number' || y < bounds.minY) {\n bounds.minY = y;\n }\n\n if (typeof bounds.maxY !== 'number' || y > bounds.maxY) {\n bounds.maxY = y;\n }\n }\n\n return finalizeBounds(bounds, {dates});\n}\n","export default function mergeBounds(boundsList) {\n const mergedBounds = {\n minX: null,\n maxX: null,\n minY: null,\n maxY: null,\n closestSpacing: null,\n dates: false,\n initial: true\n };\n\n for (let { minX, maxX, minY, maxY, dates, initial, closestSpacing } of boundsList) {\n if (dates) {\n mergedBounds.dates = true;\n }\n\n if (initial) {\n continue;\n }\n mergedBounds.initial = false;\n\n if (mergedBounds.minX === null || minX < mergedBounds.minX) {\n mergedBounds.minX = minX;\n }\n\n if (mergedBounds.maxX === null || maxX > mergedBounds.maxX) {\n mergedBounds.maxX = maxX;\n }\n\n if (mergedBounds.closestSpacing === null || closestSpacing < mergedBounds.closestSpacing) {\n mergedBounds.closestSpacing = closestSpacing;\n }\n\n if (mergedBounds.minY === null || minY < mergedBounds.minY) {\n mergedBounds.minY = minY;\n }\n\n if (mergedBounds.maxY === null || maxY > mergedBounds.maxY) {\n mergedBounds.maxY = maxY;\n }\n }\n\n if (mergedBounds.minX === null) {\n mergedBounds.minX = 0;\n }\n\n if (mergedBounds.maxX === null) {\n mergedBounds.maxX = 0;\n }\n\n if (mergedBounds.closestSpacing === null) {\n mergedBounds.closestSpacing = 1;\n }\n\n if (mergedBounds.minY === null) {\n mergedBounds.minY = 0;\n }\n\n if (mergedBounds.maxY === null) {\n mergedBounds.maxY = 0;\n }\n\n return mergedBounds;\n}\n","/**\n * Expands bounds to give a little y padding\n *\n * @param {Object} bounds\n * @param {?Number} bounds.minY\n * @param {?Number} bounds.maxY\n * @param {?Number} bounds.minX\n * @param {?Number} bounds.maxX\n * @param {Array<Number>} [expandYWith]\n * @param {Number} [extendXForNBars=0]\n * @return {Object}\n */\nexport default function expandBounds(bounds, {expandYWith = [], extendXForNBars=0}) {\n const expandedBounds = Object.assign({}, bounds);\n for (let y of expandYWith) {\n if (y === null || y === undefined) {\n continue;\n }\n\n if (typeof expandedBounds.minY !== 'number' || y < expandedBounds.minY) {\n expandedBounds.minY = y;\n }\n\n if (typeof expandedBounds.maxY !== 'number' || y > expandedBounds.maxY) {\n expandedBounds.maxY = y;\n }\n }\n\n expandedBounds.unscaledMinY = expandedBounds.minY;\n expandedBounds.unscaledMaxY = expandedBounds.maxY;\n\n const range = expandedBounds.maxY - expandedBounds.minY;\n const midpoint = expandedBounds.minY + range/2;\n expandedBounds.minY = midpoint - 1.05*range/2;\n expandedBounds.maxY = midpoint + 1.05*range/2;\n\n if (expandedBounds.minY === expandedBounds.maxY && expandedBounds.minY !== null) {\n if (expandedBounds.minY > 0) {\n expandedBounds.minY *= 0.95;\n expandedBounds.maxY *= 1.05;\n } else if (expandedBounds.minY < 0) {\n expandedBounds.minY *= 1.05;\n expandedBounds.maxY *= 0.95;\n } else {\n expandedBounds.minY -= 1;\n expandedBounds.maxY += 1;\n }\n }\n\n if (extendXForNBars && expandedBounds.minX !== expandedBounds.maxX && expandedBounds.minX !== null && expandedBounds.maxX !== null) {\n // Base expansion factor on expected bar count\n const barWidth = (expandedBounds.maxX - expandedBounds.minX) / extendXForNBars;\n expandedBounds.minX -= barWidth/2;\n expandedBounds.maxX += barWidth/2;\n }\n\n return expandedBounds;\n}\n","/**\n * Finds the closest point to the target\n *\n * @param {Array} data - the data, in data space\n * @param {Number} targetX - the x coordinate to get closest to\n * @param {Object} [searchParams]\n * @param {String} [searchParams.searchType] - whether to search for the closest, one before, or one after\n * @param {Boolean} [searchParams.returnIndex] - whether to return the index or the object itself\n * @param {Number} [startIndex] - where to start the search from\n * @param {Number} [endIndex] - where to end the search\n * @return {Array|Number}\n */\nexport default function binarySearch(data, targetX, searchParams={}, startIndex=0, endIndex=undefined) {\n if (endIndex === undefined) {\n endIndex = data.length - 1;\n }\n\n if (data.length === 0) {\n return searchParams.returnIndex ? -1 : [null, null];\n }\n\n const middleIndex = Math.floor((startIndex + endIndex)/2);\n\n if (targetX === data[middleIndex][0] || (data[middleIndex][0] instanceof Date && data[middleIndex][0].valueOf() === targetX)) {\n if (searchParams.returnIndex) {\n return middleIndex;\n } else {\n return data[middleIndex];\n }\n }\n\n if (startIndex === endIndex) {\n if (data[startIndex][0] < targetX && searchParams.searchType === 'before') {\n return searchParams.returnIndex ? startIndex : data[startIndex];\n } else if (data[startIndex][0] > targetX && searchParams.searchType === 'after') {\n return searchParams.returnIndex ? startIndex : data[startIndex];\n } else {\n return searchParams.returnIndex ? -1 : [null, null];\n }\n }\n\n if (endIndex - 1 === startIndex) {\n let index;\n\n if (searchParams.searchType === 'before') {\n index = startIndex;\n // index = (targetX <= data[startIndex][0]) ? startIndex : endIndex;\n } else if (searchParams.searchType === 'after') {\n index = endIndex;\n // index = (targetX >= data[endIndex][0]) ? endIndex : startIndex;\n } else {\n index = Math.abs(data[startIndex][0] - targetX) > Math.abs(data[endIndex][0] - targetX) ?\n endIndex :\n startIndex;\n }\n\n return searchParams.returnIndex ? index : data[index];\n }\n\n if (targetX > data[middleIndex][0]) {\n return binarySearch(data, targetX, searchParams, middleIndex, endIndex);\n }\n\n if (targetX < data[middleIndex][0]) {\n return binarySearch(data, targetX, searchParams, startIndex, middleIndex);\n }\n}\n","import binarySearch from '../../helpers/binary_search';\n\nfunction validateSelectedSpaceConversion({ data, inSelectedSpace, firstIndex, lastIndex, ignoreDiscontinuities }) { // eslint-disable-line no-unused-vars\n let correct = data.slice(firstIndex + 1, lastIndex);\n if (ignoreDiscontinuities) {\n correct = correct.filter(([_x, y]) => (y !== null && y !== undefined));\n }\n\n if (correct.length !== inSelectedSpace.length) {\n console.log({ // eslint-disable-line no-console\n data,\n attempt: inSelectedSpace.map(([x, y]) => [undateify(x), y]),\n correct: correct.map(([x, y]) => [undateify(x), y]),\n sdl: window.sdl\n });\n window.tacomaDataPaused = true;\n throw new Error('Failed to select via swap');\n }\n\n for (let i = 0; i < correct.length; i++) {\n if (undateify(correct[i][0]) !== undateify(inSelectedSpace[i][0]) || correct[i][1] !== inSelectedSpace[i][1]) {\n console.log({ // eslint-disable-line no-console\n i,\n attempt: inSelectedSpace.map(([x, y]) => [undateify(x), y]),\n correct: correct.map(([x, y]) => [undateify(x), y]),\n correctX: undateify(correct[i][0]),\n correctY: correct[i][1],\n attemptX: undateify(inSelectedSpace[i][0]),\n attemptY: inSelectedSpace[i][1]\n });\n window.tacomaDataPaused = true;\n throw new Error('Failed to select via swap');\n }\n }\n}\n\n/**\n * Converts from data space to selected space\n *\n * @param {Array<Array<Number>>} data\n * @param {{data: Array<Array<Number>>}|*} [swap]\n * @param {Number} minX\n * @param {Number} maxX\n * @param {Boolean} ignoreDiscontinuities\n * @param {Boolean} square\n * @return {{data: Array<Array<Number>>, lastAdded: boolean, firstAdded: boolean, afterIndex: Number, ignoreDiscontinuities: boolean, minX: Number, maxX: Number, beforeIndex: Number}}\n */\nexport default function dataSpaceToSelectedSpace({ data, swap, minX, maxX, ignoreDiscontinuities, square }) {\n if (!data.length || data.length && minX > data[data.length - 1][0] || data.length && maxX < data[0][0]) {\n //let previouslyEmpty = !data.length;\n return {\n data: [\n [minX, null],\n [maxX, null]\n ],\n firstAdded: true,\n lastAdded: true\n //previouslyEmpty\n };\n }\n\n let beforeIndex = binarySearch(data, minX, { searchType: 'before', returnIndex: true }) || 0;\n let afterIndex = binarySearch(data, maxX, { searchType: 'after', returnIndex: true }) || 0;\n if (afterIndex === -1) {\n afterIndex = 0;\n }\n\n while (beforeIndex >= 0 && data[beforeIndex][0] >= minX) {\n beforeIndex --;\n }\n\n while (afterIndex < data.length && data[afterIndex][0] <= maxX) {\n afterIndex ++;\n }\n\n let inSelectedSpace;\n let addToEndOnly = false;\n\n let firstAdded = false;\n let lastAdded = false;\n\n let beginningInterpolationIndex = beforeIndex;\n let endInterpolationIndex = afterIndex;\n if (ignoreDiscontinuities) {\n while (beginningInterpolationIndex >= 0 && data[beginningInterpolationIndex][1] === null) {\n beginningInterpolationIndex --;\n }\n while (endInterpolationIndex < data.length && data[endInterpolationIndex][1] === null) {\n endInterpolationIndex++;\n }\n }\n\n if (swap) {\n inSelectedSpace = swap.data;\n if (swap.lastAdded) {\n inSelectedSpace.pop();\n }\n if (minX === swap.minX) {\n addToEndOnly = true;\n }\n if (beforeIndex !== swap.beforeIndex) {\n addToEndOnly = false;\n if (swap.firstAdded) {\n inSelectedSpace.shift();\n }\n let index = swap.beforeIndex;\n while (index >= 0 && inSelectedSpace.length && inSelectedSpace[0][0] >= minX) {\n if (!ignoreDiscontinuities || data[index][1] || data[index][1] === 0) {\n inSelectedSpace.unshift(data[index]);\n }\n index --;\n }\n while (index < data.length && inSelectedSpace.length && inSelectedSpace[0][0] < minX) {\n inSelectedSpace.shift();\n index ++;\n }\n }\n\n if (ignoreDiscontinuities && !swap.ignoreDiscontinuities) {\n inSelectedSpace = inSelectedSpace.filter(([_x, y]) => (y !== null && y !== undefined));\n }\n\n if (beforeIndex === swap.beforeIndex && swap.firstAdded) {\n firstAdded = true;\n\n let interpolationIndex = beforeIndex + 1;\n if (ignoreDiscontinuities) {\n while (interpolationIndex < data.length && data[interpolationIndex][1] === null) {\n interpolationIndex ++;\n }\n }\n\n if (beginningInterpolationIndex === -1 && inSelectedSpace.length) {\n inSelectedSpace[0] = [minX, null];\n } else {\n if (square && inSelectedSpace.length) {\n inSelectedSpace[0] = [minX, data[beginningInterpolationIndex][1]];\n } else {\n if (inSelectedSpace.length) {\n inSelectedSpace[0] = [minX, interpolate(data, beginningInterpolationIndex, interpolationIndex, minX)];\n }\n }\n }\n if (data[beforeIndex + 1][0] === inSelectedSpace[0][0] && data[beforeIndex + 1][1] === inSelectedSpace[0][1]) {\n firstAdded = false;\n }\n }\n let lastIncluded = swap.afterIndex;\n if (swap.ignoreDiscontinuities && !ignoreDiscontinuities) {\n let nullIndex = beforeIndex + 1;\n let selectedIndex = 0;\n if (firstAdded) {\n selectedIndex ++;\n }\n while (selectedIndex <= inSelectedSpace.length && nullIndex < data.length && nullIndex < afterIndex) {\n if (data[nullIndex][0] <= maxX && data[nullIndex][1] === null && (!inSelectedSpace[selectedIndex] || inSelectedSpace[selectedIndex][0] !== data[nullIndex][0] || inSelectedSpace[selectedIndex][1] !== data[nullIndex][1])) {\n inSelectedSpace.splice(selectedIndex, 0, data[nullIndex]);\n if (nullIndex >= lastIncluded) {\n lastIncluded = nullIndex + 1;\n }\n }\n nullIndex ++;\n selectedIndex ++;\n }\n }\n\n let dataIndex = lastIncluded || 0;\n while (dataIndex < data.length && data[dataIndex][0] <= maxX) {\n if (data[dataIndex][0] >= minX) {\n if (!ignoreDiscontinuities || data[dataIndex][1] || data[dataIndex][1] === 0) {\n inSelectedSpace.push(data[dataIndex]);\n }\n }\n dataIndex ++;\n }\n while (inSelectedSpace.length && inSelectedSpace[inSelectedSpace.length - 1][0] > maxX) {\n inSelectedSpace.pop();\n }\n\n } else {\n inSelectedSpace = data.slice(beforeIndex + 1, afterIndex);\n if (ignoreDiscontinuities) {\n inSelectedSpace = inSelectedSpace.filter(([_x, y]) => (y !== null && y !== undefined));\n }\n }\n\n if (!inSelectedSpace.length) {\n if (square) {\n if (beginningInterpolationIndex < 0) {\n inSelectedSpace = [[minX, null], [maxX, null]];\n } else {\n inSelectedSpace = [[minX, data[beginningInterpolationIndex][1]], [maxX, data[beginningInterpolationIndex][1]]];\n }\n } else {\n inSelectedSpace = [[minX, interpolate(data, beginningInterpolationIndex, endInterpolationIndex, minX)], [maxX, interpolate(data, beginningInterpolationIndex, endInterpolationIndex, maxX)]];\n }\n firstAdded = true;\n lastAdded = true;\n }\n\n if (!addToEndOnly) {\n let interpolationIndex = beforeIndex + 1;\n if (ignoreDiscontinuities) {\n while (interpolationIndex < data.length && data[interpolationIndex][1] === null) {\n interpolationIndex ++;\n }\n }\n\n if (inSelectedSpace.length && inSelectedSpace[0][0] > minX) {\n firstAdded = true;\n if (beginningInterpolationIndex === -1) {\n inSelectedSpace.unshift([minX, null]);\n } else {\n if (square) {\n inSelectedSpace.unshift([minX, data[beginningInterpolationIndex][1]]);\n } else {\n inSelectedSpace.unshift([minX, interpolate(data, beginningInterpolationIndex, interpolationIndex, minX)]);\n }\n }\n }\n }\n\n if (inSelectedSpace.length && inSelectedSpace[inSelectedSpace.length - 1][0] < maxX) {\n lastAdded = true;\n\n let interpolationIndex = afterIndex - 1;\n if (ignoreDiscontinuities) {\n while (interpolationIndex >= 0 && data[interpolationIndex][1] === null) {\n interpolationIndex --;\n }\n }\n\n if (endInterpolationIndex === data.length) {\n inSelectedSpace.push([maxX, null]);\n } else {\n if (square) {\n inSelectedSpace.push([maxX, inSelectedSpace[inSelectedSpace.length - 1][1]]);\n } else {\n inSelectedSpace.push([maxX, interpolate(data, interpolationIndex, endInterpolationIndex, maxX)]);\n }\n }\n }\n\n if (inSelectedSpace.length === 1) {\n let begPoint;\n let endPoint;\n if (square) {\n if (beginningInterpolationIndex < 0) {\n begPoint = [minX, null];\n } else {\n begPoint = [minX, data[beginningInterpolationIndex][1]];\n }\n endPoint = [maxX, inSelectedSpace[0][1]];\n } else {\n begPoint = [minX, interpolate(data, beginningInterpolationIndex, beforeIndex + 1, minX)];\n endPoint = [maxX, interpolate(data, afterIndex - 1, endInterpolationIndex, maxX)];\n }\n inSelectedSpace.unshift(begPoint);\n inSelectedSpace.push(endPoint);\n firstAdded = true;\n lastAdded = true;\n }\n\n return {\n data: inSelectedSpace,\n minX,\n maxX,\n beforeIndex,\n afterIndex,\n firstAdded,\n lastAdded,\n ignoreDiscontinuities\n //previouslyEmpty: false\n };\n}\n\nfunction undateify(potentialDate) {\n if (potentialDate instanceof Date) {\n return potentialDate.valueOf();\n }\n\n return potentialDate;\n}\n\n/**\n * Finds the point at the boundary via interpolation\n *\n * @param {Array<Array<Number>>} data\n * @param {Number} firstIndex\n * @param {Number} secondIndex\n * @param {Number} boundary\n * @return {null|*}\n */\nfunction interpolate(data, firstIndex, secondIndex, boundary) {\n if (firstIndex < 0 || secondIndex < 0) {\n return null;\n }\n\n if (firstIndex >= data.length || secondIndex >= data.length) {\n return null;\n }\n\n if (firstIndex === secondIndex) {\n return data[firstIndex][1];\n }\n\n const [xBefore, yBefore] = data[firstIndex];\n const [xAfter, yAfter] = data[secondIndex];\n\n if (boundary === xBefore && yBefore !== null) {\n return yBefore;\n }\n\n if (boundary === xAfter && yAfter !== null) {\n return yAfter;\n }\n\n if (yBefore === null || yAfter === null) {\n return null;\n }\n\n const percent = (boundary - xBefore)/(xAfter - xBefore);\n if (percent < 0 || percent > 1) {\n return null;\n }\n\n return percent*(yAfter - yBefore) + yBefore;\n}\n","/**\n * Scales y min and max bounds according to linear or log\n *\n * @param {Number} minY\n * @param {Number} maxY\n * @param {'linear'|'log'} scale\n * @return {{minY: Number, maxY: Number}}\n */\nexport default function scaleBounds({ minY, maxY, scale }) {\n if (scale === 'log') {\n maxY = Math.log10(maxY);\n\n if (minY <= 0) {\n if (maxY > 0) {\n minY = -maxY;\n } else {\n minY = 2*maxY;\n }\n } else {\n minY = Math.log10(minY);\n }\n }\n\n return {\n minY,\n maxY\n };\n}\n","import scaleBounds from '../../renderer/scale_bounds';\nimport RustAPI from '../rust_api';\n\n\nfunction selectedSpaceToRenderSpaceInPlace({ data, renderWidth, renderHeight, minX, maxX, minY, maxY, scale }, { nullMask, yValues, minYValues, maxYValues }) {\n let i = 0;\n let prevI = i - 1;\n\n for (let pixelX = 0; pixelX < renderWidth; pixelX++) {\n // find the x value that corresponds to the x pixel\n const x = (pixelX/(renderWidth - 1))*(maxX - minX) + minX;\n\n // set i such that data[i][0] < x <= data[i+1][0]\n let minSeenY = null;\n let maxSeenY = null;\n\n if (i > 0 && i <= data.length && data[i - 1][1] === null) {\n i--;\n }\n\n if (i < data.length - 2 && data[i + 1][0] < x) {\n i++;\n }\n\n for (i; i < data.length - 2 && data[i + 1][0] < x; i++) {\n const curY = data[i][1];\n\n if (curY === null) {\n continue;\n }\n\n if (minSeenY === null || curY < minSeenY) {\n minSeenY = curY;\n }\n\n if (maxSeenY === null || curY > maxSeenY) {\n maxSeenY = curY;\n }\n }\n\n minYValues[pixelX] = minSeenY === null ? 0 : renderHeight*(1 - ((scale === 'log' ? Math.log10(minSeenY) : minSeenY) - minY)/(maxY - minY));\n maxYValues[pixelX] = maxSeenY === null ? 0 : renderHeight*(1 - ((scale === 'log' ? Math.log10(maxSeenY) : maxSeenY) - minY)/(maxY - minY));\n\n // pass any discontinuities along\n if (i >= data.length - 1 || data[i][1] === null || data[i + 1][1] === null) {\n const y = i >= data.length - 1 ? null : data[i][1];\n\n nullMask[pixelX] = ((y === null) << 0) | ((minSeenY === null) << 1) | ((maxSeenY === null) << 2);\n yValues[pixelX] = y === null ? 0 : renderHeight*(1 - ((scale === 'log' ? Math.log10(y) : y) - minY)/(maxY - minY));\n\n i++;\n\n continue;\n }\n\n // interpolate\n const [xBefore, yBefore] = data[i];\n const [xAfter, yAfter] = data[i + 1];\n\n const percent = (x - xBefore) / (xAfter - xBefore);\n let y = percent * (yAfter - yBefore) + yBefore;\n\n // we're at the first point after the direction changed. Don't interpolate\n if (prevI !== i) {\n y = yBefore;\n }\n\n // // two x's with the same value; common in area charts\n // // to avoid this from having gotten skipped over, save in either min or max as appropriate\n // if (i > 0 && data[i - 1][0] === data[i][0]) {\n // // 0: minY a\n // // 1: original a\n // // 2: minY b\n // // 3: original b\n //\n // const [xBeforeOffset, yBeforeOffset] = data[i - 1];\n // const [xAfter, yAfter] = data[i + 1];\n // }\n\n yValues[pixelX] = y === null ? 0 : renderHeight*(1 - ((scale === 'log' ? Math.log10(y) : y) - minY)/(maxY - minY));\n nullMask[pixelX] = ((y === null) << 0) | ((minSeenY === null) << 1) | ((maxSeenY === null) << 2);\n\n prevI = i;\n }\n}\n\n/**\n * Convert from selected space to value space\n *\n * @param data\n * @param {Object} [swap]\n * @param {Number} renderWidth - width, in pixels, of the area in which the graph is rendered\n * @param {Number} renderHeight - height, in pixels, of the area in which the graph is rendered\n * @param {Number} minX - the minimum x value that is rendered\n * @param {Number} maxX - the maximum x value that is rendered\n * @param {Number} minY - the minimum y value that is rendered\n * @param {Number} maxY - the maximum y value that is rendered\n * @param {'log'|'linear'} scale\n * @param {Boolean} [dataChanged] - if true, will not rely on the prior data state from swap being accurate\n * @return {{nullMask: Uint8Array, maxYValues: Float64Array, minYValues: Float64Array, yValues: Float64Array, dataF64: Float64Array, dataNullMask: Uint8Array}}\n */\nexport default function selectedSpaceToRenderSpace({ data, swap, renderWidth, renderHeight, minX, maxX, minY, maxY, scale, dataChanged }) {\n if (swap && swap.yValues.length !== renderWidth) {\n swap = null;\n }\n\n const nullMask = (swap && swap.nullMask) || new Uint8Array(renderWidth);\n nullMask.fill(0);\n const yValues = new Float64Array(renderWidth);\n const minYValues = new Float64Array(renderWidth);\n const maxYValues = new Float64Array(renderWidth);\n\n const scaledBounds = scaleBounds({ minY, maxY, scale});\n minY = scaledBounds.minY;\n maxY = scaledBounds.maxY;\n\n const inParams = { data, renderWidth, renderHeight, minX, maxX, minY, maxY, scale };\n\n let dataF64, dataNullMask;\n\n if (RustAPI()) {\n let copyIndexStart = 0;\n\n const hasSwap = swap && swap.dataNullMask && swap.dataF64;\n const useSwap = !dataChanged && hasSwap && swap.minX === minX && swap.maxX <= maxX && swap.length <= data.length;\n\n if (!useSwap || swap.dataNullMask.length < data.length) {\n const extraSpaceFactor = 1.25;\n dataF64 = new Float64Array(Math.floor(data.length*2*extraSpaceFactor));\n dataNullMask = new Uint8Array(Math.floor(data.length*extraSpaceFactor));\n\n if (useSwap) {\n dataNullMask.set(swap.dataNullMask);\n dataF64.set(swap.dataF64);\n }\n } else {\n dataF64 = swap.dataF64;\n dataNullMask = swap.dataNullMask;\n }\n\n if (useSwap) {\n copyIndexStart = Math.max(swap.length - 1, 0);\n }\n\n for (let i = copyIndexStart; i < data.length; i++) {\n dataF64[2*i] = data[i][0];\n dataF64[2*i + 1] = data[i][1];\n\n if (data[i][1] === null) {\n dataNullMask[i] = 1;\n } else {\n dataNullMask[i] = 0;\n }\n }\n RustAPI().selected_space_to_render_space(data.length, dataF64, dataNullMask, inParams, nullMask, yValues, minYValues, maxYValues);\n } else {\n selectedSpaceToRenderSpaceInPlace(inParams, { nullMask, yValues, minYValues, maxYValues });\n }\n\n return {\n nullMask,\n yValues,\n minYValues,\n maxYValues,\n dataF64,\n dataNullMask,\n minX,\n maxX,\n length: data.length\n };\n}\n","/**\n * Flattens simple data\n * Returns an array of tuples (x value, simple point)\n *\n * @param simpleData\n * @param series\n * @param inDataSpace\n * @return {[]}\n */\nexport default function flattenSimpleData(simpleData, {series, inDataSpace }) {\n const flattened = [];\n let fI = 0;\n\n for (let point of simpleData) {\n const yValue = extractYValue(point, series);\n\n if (series.yKey && Array.isArray(yValue)) {\n for (let subpoint of point[series.yKey]) {\n if (series.ignoreDiscontinuities && typeof subpoint[series.yKey] !== 'number' && !Array.isArray(subpoint)) {\n continue;\n }\n\n const x = inDataSpace[fI++][0];\n\n if (series.square && flattened.length > 0) {\n flattened.push([x, flattened[flattened.length - 1][1]]);\n }\n\n flattened.push([x, subpoint]);\n }\n\n continue;\n }\n\n if (series.ignoreDiscontinuities && (yValue === undefined || yValue === null)) {\n continue;\n }\n\n const x = inDataSpace[fI++][0];\n\n if (series.square && flattened.length > 0) {\n flattened.push([x, flattened[flattened.length - 1][1]]);\n }\n\n flattened.push([x, point]);\n }\n\n if (flattened.length !== inDataSpace.length) {\n console.warn('Flattening didn\\'t give the same length as it has in data space'); // eslint-disable-line no-console\n }\n\n return flattened;\n}\n\nexport function extractYValue(point, series) {\n if (series.yKey) {\n return point[series.yKey];\n }\n\n if (Array.isArray(point)) {\n if (point.length === 1) {\n return point[0];\n } else {\n return point[1];\n }\n }\n\n return point;\n}\n\nexport function extractXValue(point, series) {\n if (series.xKey) {\n return point[series.xKey];\n }\n\n if (Array.isArray(point)) {\n return point[0];\n }\n\n return point;\n}\n","import binarySearch from '../helpers/binary_search';\nimport scaleBounds from '../renderer/scale_bounds';\nimport getColor from '../helpers/colors';\nimport flattenSimpleData, {extractXValue, extractYValue} from '../helpers/flatten_simple_data';\nimport {getBarWidths} from '../renderer/draw_bars';\n\nconst DISTANCE_THRESHOLD = 20;\n\n/**\n * Figures out the tooltip state\n *\n * @param {Boolean} mousePresent\n * @param {Number} mouseX\n * @param {Number} mouseY\n * @param {Object} sizing\n * @param {Array<Object>} series\n * @param {Set} alwaysTooltipped\n * @param {Array<Object>} savedTooltips\n * @param {Boolean} [allTooltipped]\n * @param {Number} closestSpacing\n * @return {{mouseX: *, mouseY: *, elementWidth: number, elementHeight: number, tooltips: any[]}}\n */\nexport default function calculateTooltipState({mousePresent, mouseX, mouseY, sizing, series, alwaysTooltipped, savedTooltips, allTooltipped, closestSpacing }) {\n // filter out saved tooltips for nonexistent series\n savedTooltips = savedTooltips.filter((tooltip) => tooltip.series.axis);\n\n for (let savedTooltip of savedTooltips) {\n moveTooltip({ mouseX, mouseY, sizing}, savedTooltip);\n }\n\n if (!mousePresent) {\n return {\n mouseX,\n mouseY,\n elementWidth: sizing.elementWidth,\n elementHeight: sizing.elementHeight,\n tooltips: [...savedTooltips]\n };\n }\n\n const tooltips = [];\n\n let minDistance = Infinity;\n\n for (let i = 0; i < series.length; i++) {\n const singleSeries = series[i];\n\n if (singleSeries.hidden) {\n continue;\n }\n\n const axis = singleSeries.axis;\n\n const scale = axis.scale;\n const bounds = axis.currentBounds;\n const { minY, maxY } = scaleBounds({...bounds, scale });\n\n const trueX = mouseX/sizing.elementWidth * (bounds.maxX - bounds.minX) + bounds.minX;\n\n let data = singleSeries.inDataSpace;\n if (singleSeries.ignoreDiscontinuities) {\n data = data.filter((tuple) => typeof tuple[1] === 'number');\n }\n\n if (data.length === 0) {\n continue;\n }\n\n const dataMinX = data[0][0];\n const dataMaxX = data[data.length - 1][0];\n const dataRange = dataMaxX - dataMinX;\n const padding = Math.max(dataRange * 0.05, (bounds.maxX - bounds.minX) * 0.02); \n\n if (trueX < dataMinX - padding || trueX > dataMaxX + padding) {\n continue;\n }\n\n const closestIndex = binarySearch(data, trueX, { returnIndex: true });\n const closestPoint = data[closestIndex];\n\n if (!closestPoint) {\n continue;\n }\n\n const [x, y] = closestPoint;\n\n if (x === null) {\n continue;\n }\n\n let pixelX = (x - bounds.minX)/(bounds.maxX - bounds.minX) * sizing.elementWidth;\n const pixelY = (1 - ((scale === 'log' ? Math.log10(y) : y) - minY)/(maxY - minY)) * sizing.elementHeight;\n\n if (pixelY > sizing.elementHeight || pixelY < 0) {\n continue;\n }\n\n const ignoreYDistanceCheck = alwaysTooltipped.has(singleSeries) || allTooltipped;\n let xDistanceThreshold = DISTANCE_THRESHOLD;\n let yDistanceThreshold = DISTANCE_THRESHOLD;\n let distanceThreshold = DISTANCE_THRESHOLD;\n\n if (singleSeries.rendering === 'bar') {\n const indexInAxis = singleSeries.axis.series.indexOf(singleSeries);\n const axisSeriesCount = singleSeries.axis.series.length;\n\n const { totalBarWidth, barWidth } = getBarWidths({\n closestSpacing,\n bounds,\n sizing,\n axisSeriesCount\n });\n\n // currently, pixelX is the center of all the bars\n // shift it to start at the far left, then shift it to the center of the individual bar\n pixelX -= totalBarWidth/2/sizing.pixelRatio;\n pixelX += (barWidth*(indexInAxis + 0.5))/sizing.pixelRatio;\n\n xDistanceThreshold = barWidth/2/sizing.pixelRatio;\n yDistanceThreshold = 100;\n distanceThreshold = xDistanceThreshold + yDistanceThreshold;\n }\n\n const xDistance = Math.abs(pixelX - mouseX);\n const yDistance = Math.abs(pixelY - mouseY);\n const distance = Math.sqrt((xDistance)**2 + (pixelY - mouseY)**2);\n\n if (!ignoreYDistanceCheck && (xDistance > xDistanceThreshold || yDistance > yDistanceThreshold || distance > distanceThreshold)) {\n continue;\n }\n\n let xLabel, yLabel;\n\n const simpleData = singleSeries.simpleData || singleSeries.data;\n\n const enumLike = simpleData.length && !!singleSeries.hasEnum;\n if (singleSeries.xLabel || singleSeries.yLabel || enumLike) {\n let simplePoint;\n\n if (simpleData.length === data.length) {\n simplePoint = simpleData[closestIndex];\n } else {\n const flattenedData = flattenSimpleData(simpleData, { series: singleSeries, inDataSpace: data });\n\n simplePoint = flattenedData[closestIndex][1];\n }\n\n if (singleSeries.xLabel) {\n xLabel = simplePoint[singleSeries.xLabel];\n } else if (singleSeries.hasXEnum) {\n xLabel = extractXValue(simplePoint, singleSeries);\n }\n\n if (singleSeries.yLabel) {\n yLabel = simplePoint[singleSeries.yLabel];\n } else if (enumLike) {\n yLabel = extractYValue(simplePoint, singleSeries);\n }\n }\n\n if (distance < minDistance) {\n minDistance = distance;\n }\n\n let color = getColor(singleSeries.color, i, singleSeries.multigrapherSeriesIndex);\n if (y < 0 && singleSeries.negativeColor) {\n color = singleSeries.negativeColor;\n } else if (y === 0 && singleSeries.zeroLineColor) {\n color = singleSeries.zeroLineColor;\n }\n\n tooltips.push({\n pixelWidth: sizing.elementWidth,\n pixelX: pixelX,\n pixelY: isNaN(pixelY) ? sizing.elementHeight/2 : pixelY,\n x,\n y,\n color,\n distance,\n xDistance,\n index: i,\n series: singleSeries,\n xLabel,\n yLabel,\n fullYPrecision: singleSeries.fullYPrecision,\n ignoreYDistanceCheck\n });\n }\n\n const unsavedTooltips = tooltips.filter(({ distance, ignoreYDistanceCheck }) => {\n return distance === minDistance || ignoreYDistanceCheck;\n }).sort((a, b) => b.distance - a.distance);\n\n return {\n mousePresent,\n mouseX,\n mouseY,\n elementWidth: sizing.elementWidth,\n elementHeight: sizing.elementHeight,\n unsavedTooltipsCount: unsavedTooltips.length,\n tooltips: [...savedTooltips, ...unsavedTooltips]\n };\n}\n\n/**\n * Recalculates the tooltip position, given the new sizing, bounds, etc.\n *\n * @param {Number} mouseX\n * @param {Number} mouseY\n * @param {Object} sizing\n * @param {Object} tooltip - The tooltip object to move\n */\nexport function moveTooltip({ mouseX, mouseY, sizing }, tooltip) {\n const { x, y } = tooltip;\n\n const scale = tooltip.series.axis.scale;\n const bounds = tooltip.series.axis.currentBounds;\n const { minY, maxY } = scaleBounds({...bounds, scale });\n\n const pixelX = (x - bounds.minX)/(bounds.maxX - bounds.minX) * sizing.elementWidth;\n const pixelY = (1 - ((scale === 'log' ? Math.log10(y) : y) - minY)/(maxY - minY)) * sizing.elementHeight;\n\n const distance = Math.sqrt((pixelX - mouseX)**2 + (pixelY - mouseY)**2);\n const xDistance = Math.abs(pixelX - mouseX);\n\n Object.assign(tooltip, {\n pixelWidth: sizing.elementWidth,\n pixelX: pixelX,\n pixelY: isNaN(pixelY) ? sizing.elementHeight/2 : pixelY,\n xDistance,\n distance\n });\n}\n\nexport function toggleTooltipSaved({ currentTooltips, savedTooltips }) {\n if (!currentTooltips.length) {\n return savedTooltips;\n }\n\n const lastTooltip = currentTooltips[currentTooltips.length - 1];\n if (lastTooltip.xDistance > DISTANCE_THRESHOLD || (!lastTooltip.ignoreYDistanceCheck && lastTooltip.distance > DISTANCE_THRESHOLD)) {\n return savedTooltips;\n }\n\n const currentTooltipIndex = savedTooltips.findIndex((tooltip) => {\n return tooltip.x === lastTooltip.x && tooltip.y === lastTooltip.y;\n });\n\n if (currentTooltipIndex === -1) {\n return [...savedTooltips, lastTooltip];\n } else {\n return savedTooltips.filter((_, index) => index !== currentTooltipIndex);\n }\n}\n","const BOUND_CALCULATORS = {\n all: () => {},\n lastMinute: (globalBounds) => {\n if (!globalBounds.dates) {\n return;\n }\n\n return {\n minX: Math.max(new Date(globalBounds.maxX).valueOf() - 60*1000, globalBounds.minX)\n };\n },\n last10Minutes: (globalBounds) => {\n if (!globalBounds.dates) {\n return;\n }\n\n return {\n minX: Math.max(new Date(globalBounds.maxX).valueOf() - 10*60*1000, globalBounds.minX)\n };\n },\n lastHour: (globalBounds) => {\n if (!globalBounds.dates) {\n return;\n }\n\n return {\n minX: Math.max(new Date(globalBounds.maxX).valueOf() - 60*60*1000, globalBounds.minX)\n };\n },\n lastDay: (globalBounds) => {\n if (!globalBounds.dates) {\n return;\n }\n\n return {\n minX: Math.max(new Date(globalBounds.maxX).valueOf() - 24*60*60*1000, globalBounds.minX)\n };\n }\n};\n\nexport default BOUND_CALCULATORS;\n","const BUCKETS_PER_PIXEL = 2;\nconst CONDENSE_THRESHOLD = 2;\n\n/**\n * Condenses the dataset down to a lower number of points to make subsequent operations more efficient\n * Will only condense when data length passes a given threshold\n * Note that this works best on datasets that are relatively evenly distributed across the x axis\n *\n * @param {Array<Array>} data\n * @param {{data: [], minX: Number, maxX: Number, length: Number}} swap\n * @param {Number} minX\n * @param maxX\n * @param renderWidth\n * @param dataChanged\n * @return {{data: [], minX: Number, maxX: Number, length: Number}}\n */\nexport default function condenseDataSpace({ data, swap, minX, maxX, renderWidth, dataChanged }) {\n const targetBucketCount = renderWidth*BUCKETS_PER_PIXEL;\n\n const useSwap = !dataChanged && swap && swap.minX === minX && swap.maxX <= maxX && swap.length <= data.length;\n\n let partiallyCondensedData;\n if (useSwap) {\n partiallyCondensedData = swap.data;\n\n if (data.length > swap.length) {\n // always overwrite the last in case it was mangled by the selected space interpolation\n if (data.length > 0 && partiallyCondensedData.length > 0) {\n partiallyCondensedData[partiallyCondensedData.length - 1] = data[swap.length - 1];\n }\n\n partiallyCondensedData = partiallyCondensedData.concat(data.slice(swap.length));\n }\n } else {\n partiallyCondensedData = [...data];\n }\n\n if (partiallyCondensedData.length / targetBucketCount < CONDENSE_THRESHOLD*2) { // * 2 because min and max\n return {\n data: partiallyCondensedData,\n minX,\n maxX,\n length: data.length\n };\n }\n\n const condensedData = [];\n const bucketSize = (maxX - minX)/targetBucketCount;\n let minInBucket = null;\n let maxInBucket = null;\n let currentBucketIndex = 0;\n\n // always add the first point so that x ranges are preserved\n if (data.length) {\n condensedData.push(data[0]);\n }\n\n for (let tuple of partiallyCondensedData) {\n const [x, y] = tuple;\n\n if (y === null) {\n continue;\n }\n\n const bucketIndex = Math.floor((x - minX)/bucketSize);\n\n if (bucketIndex !== currentBucketIndex) {\n if (minInBucket && maxInBucket) {\n if (minInBucket === maxInBucket) {\n if (condensedData[condensedData.length - 1] !== minInBucket) {\n condensedData.push(minInBucket);\n }\n } else if (minInBucket[0] < maxInBucket[0]) {\n condensedData.push(maxInBucket, minInBucket);\n } else {\n condensedData.push(minInBucket, maxInBucket);\n }\n }\n\n minInBucket = null;\n maxInBucket = null;\n currentBucketIndex = bucketIndex;\n }\n\n if (!minInBucket || y < minInBucket[1]) {\n minInBucket = tuple;\n }\n\n if (!maxInBucket || y > maxInBucket[1]) {\n maxInBucket = tuple;\n }\n }\n\n if (minInBucket && maxInBucket) {\n if (minInBucket === maxInBucket) {\n condensedData.push(minInBucket);\n } else if (minInBucket[0] < maxInBucket[0]) {\n condensedData.push(maxInBucket, minInBucket);\n } else {\n condensedData.push(minInBucket, maxInBucket);\n }\n }\n\n // always add the last point so that x ranges are preserved\n if (data.length >= 2 && data[data.length - 1] !== minInBucket && data[data.length - 1] !== maxInBucket) {\n condensedData.push(data[data.length - 1]);\n }\n\n return {\n data: condensedData,\n minX,\n maxX,\n length: data.length\n };\n}\n","/**\n * Gets the proper name for a series\n *\n * @param {Object} singleSeries\n * @param {Number} index\n * @return {string}\n */\nexport default function nameForSeries(singleSeries, index) {\n let name = singleSeries.name || singleSeries.yKey;\n\n if (!name) {\n name = index.toString();\n }\n\n return name;\n}\n","export function selectedSpaceToBackgroundSpace({ data, background, minX, maxX }) {\n if (!background) {\n return null;\n }\n\n const conditions = [];\n for (let [key, color] of Object.entries(background)) {\n if (typeof color === 'object') {\n if (typeof color.evaluator !== 'function') {\n throw new Error('Invalid background declaration: ' + key + ' (evaluator must be a function)');\n }\n\n conditions.push(Object.assign({\n key,\n comparator: 'custom',\n comparedAgainst: null\n }, color));\n continue;\n }\n\n if (key === 'null') {\n conditions.push({\n evaluator: (y) => y === null && color,\n color,\n key,\n comparator: '=',\n comparedAgainst: null\n });\n continue;\n }\n\n const [comparator, value] = key.split(' ');\n if (!comparator || !value || isNaN(parseFloat(value))) {\n throw new Error('Invalid background declaration: ' + key);\n }\n\n const parsedValue = parseFloat(value);\n\n let evaluator;\n if (comparator === '=') {\n evaluator = (y) => typeof y === 'number' && y === parsedValue && color;\n } else if (comparator === '<') {\n evaluator = (y) => typeof y === 'number' && y < parsedValue && color;\n } else if (comparator === '>') {\n evaluator = (y) => typeof y === 'number' && y > parsedValue && color;\n } else if (comparator === '<=') {\n evaluator = (y) => typeof y === 'number' && y <= parsedValue && color;\n } else if (comparator === '>=') {\n evaluator = (y) => typeof y === 'number' && y >= parsedValue && color;\n } else {\n throw new Error('Invalid background declaration: ' + key);\n }\n\n conditions.push({\n evaluator,\n color,\n key,\n comparator,\n comparedAgainst: parsedValue\n });\n }\n\n const inBackgroundSpace = [];\n let currentSection = null;\n\n for (let i = 0; i < data.length; i++) {\n let [x, y] = data[i];\n if (x instanceof Date) {\n x = x.valueOf();\n }\n\n for (let condition of currentSection ? [currentSection.condition, ...conditions] : conditions) {\n const color = condition.evaluator(y);\n\n if (currentSection) {\n if (currentSection.color === color) {\n break;\n }\n\n let interpolatedMaxX = x;\n if (i > 0) {\n let [prevX, prevY] = data[i - 1];\n if (prevX instanceof Date) {\n prevX = prevX.valueOf();\n }\n\n if (currentSection.condition.comparedAgainst === null) {\n interpolatedMaxX = x;\n } else if (y === null) {\n interpolatedMaxX = prevX;\n } else {\n interpolatedMaxX = prevX + (condition.comparedAgainst - prevY)/(y - prevY)*(x - prevX);\n }\n }\n\n inBackgroundSpace.push({\n ...currentSection,\n maxX: interpolatedMaxX,\n maxXt: (interpolatedMaxX - minX)/(maxX - minX)\n });\n currentSection = null;\n }\n\n if (color) {\n let interpolatedMinX = x;\n if (i > 0) {\n let [prevX, prevY] = data[i - 1];\n if (prevX instanceof Date) {\n prevX = prevX.valueOf();\n }\n\n if (condition.comparedAgainst === null) {\n interpolatedMinX = prevX;\n } else if (prevY === null) {\n interpolatedMinX = x;\n } else {\n interpolatedMinX = prevX + (condition.comparedAgainst - prevY)/(y - prevY)*(x - prevX);\n }\n }\n\n currentSection = {\n minX: interpolatedMinX,\n minXt: (interpolatedMinX - minX)/(maxX - minX),\n color,\n condition\n };\n\n break;\n }\n }\n }\n\n if (currentSection) {\n inBackgroundSpace.push({\n ...currentSection,\n maxX: data[data.length - 1][0],\n maxXt: (data[data.length - 1][0] - minX)/(maxX - minX)\n });\n }\n\n return {\n data: inBackgroundSpace\n };\n}\n","import simpleSeriesToDataSpace from './space_conversions/simple_series_to_data_space';\nimport calculateDataBounds from './calculate_data_bounds';\nimport mergeBounds from './merge_bounds';\nimport expandBounds from './expand_bounds';\nimport selectionFromGlobalBounds from './selection_from_global_bounds';\nimport dataSpaceToSelectedSpace from './space_conversions/data_space_to_selected_space';\nimport selectedSpaceToRenderSpace from './space_conversions/selected_space_to_render_space';\nimport Eventable from '../eventable';\nimport boundCalculatorFromSelection from './bound_calculator_from_selection';\nimport calculateTooltipState, {toggleTooltipSaved} from './calculate_tooltip_state';\nimport getDefaultBoundsCalculator from './get_default_bounds_calculator';\nimport inferType from './infer_type';\nimport {SIMPLE_DATA_TYPES} from './data_types';\nimport generatorParamsEqual from '../helpers/generator_params_equal';\nimport findMatchingAxis from './find_matching_axis';\nimport {DPI_INCREASE} from '../renderer/size_canvas';\nimport {averageLoopTimes} from './average_loop_times';\nimport condenseDataSpace from './space_conversions/condense_data_space.js';\nimport calculateAnnotationsState from './calculate_annotations_state.js';\nimport {selectedSpaceToBackgroundSpace} from './space_conversions/selected_space_to_background_space.js';\nimport RustAPI, {RustAPIPromise} from './rust_api';\n\nexport default class StateController extends Eventable {\n\n constructor({ defaultBoundsCalculator, customBoundsSelectors, requireWASM, defaultShowIndividualPoints, defaultShowSidebar, defaultShowAnnotations, defaultShowOptions, syncPool, grapherID, sharedDataCache, sharedSubscriptions, fullscreen }) {\n super();\n\n this._requireWASM = requireWASM;\n if (requireWASM) {\n RustAPIPromise.then(() => {\n this._markDirty();\n });\n }\n\n this._series = [];\n this._seriesFromOriginalSeries = new Map();\n\n this._axes = [\n {\n series: [],\n scale: 'linear',\n side: 'left',\n axisIndex: 0\n }\n ];\n this._highlightedSeries = null;\n\n this._showIndividualPoints = defaultShowIndividualPoints || false;\n this._autoscaleY = true;\n this._percentile = 100;\n this._percentileAsymmetry = 0;\n this._showingOptions = defaultShowOptions;\n this._maxPrecision = false;\n this._showingSidebar = defaultShowSidebar || false;\n this._showingAnnotations = defaultShowAnnotations || false;\n this._grapherID = grapherID;\n this._fullscreen = fullscreen || false;\n\n this._alwaysTooltipped = new Set();\n this._tooltipState = {\n mousePresent: false,\n mouseX: 0,\n mouseY: 0,\n elementWidth: 0,\n elementHeight: 0,\n tooltips: []\n };\n this._contextMenuPosition = {\n x: 0,\n y: 0,\n showing: false,\n value: null\n };\n this._savedTooltips = [];\n this._draggingY = false;\n this._annotations = [];\n this._annotationsState = {\n elementWidth: 0,\n annotations: []\n };\n this._enumMap = {};\n this._hasXEnum = false;\n\n this._timingBuffer = [];\n this._timingIndex = 0;\n this._timingFrameCount = 0;\n\n this._modifiedSeries = new Set();\n this._deferredEmissions = {};\n this._deferredPriorityEmissions = {};\n this.primaryRenderer = null;\n this.rangeGraphRenderer = null;\n\n this._boundsCalculator = getDefaultBoundsCalculator(defaultBoundsCalculator, customBoundsSelectors);\n this._boundsHistory = [this._boundsCalculator];\n this._boundsIndex = 0;\n\n this._dataCache = sharedDataCache || new Map();\n this._subscriptions = sharedSubscriptions || new Map();\n this._subscriptionsShared = !!sharedSubscriptions;\n this._observablesToSeries = new Map();\n this._generators = new Set();\n this._generatorsToSeries = new Map();\n this._generatorCallArgs = new Map();\n this._seriesChangedFromPromises = new Set();\n\n this._syncPool = syncPool;\n if (this._syncPool) {\n this._syncPool.add(this);\n }\n\n this._onDataChange();\n }\n\n dispose() {\n this.emit('dispose', this);\n\n this.clearListeners();\n\n if (!this._subscriptionsShared) {\n for (let listener of this._subscriptions.values()) {\n listener.unsubscribe();\n }\n this._subscriptions.clear();\n }\n\n for (let singleSeries of this._series) {\n this._removeSeries(singleSeries);\n }\n\n if (this._syncPool) {\n this._syncPool.remove(this);\n }\n\n this.disposed = true;\n }\n\n setSeries(series) {\n const userSeries = this._series.filter((singleSeries) => singleSeries.userCreated);\n const propsSeries = this._series.filter((singleSeries) => !singleSeries.userCreated);\n\n if (series.length === propsSeries.length) {\n let anyDifferent = false;\n for (let i = 0; i < series.length; i++) {\n if (series[i] !== this._series[i].originalSeries) {\n anyDifferent = true;\n break;\n }\n }\n\n if (!anyDifferent) {\n return;\n }\n } else {\n this._mustResize = this._mustResize || this._fullscreen;\n }\n\n const newSeriesSet = new Set(series);\n for (let singleSeries of propsSeries) {\n if (!newSeriesSet.has(singleSeries.originalSeries)) {\n this._removeSeries(singleSeries);\n }\n }\n\n this._series.splice(0);\n for (let i = 0; i < series.length; i++) {\n const originalSeries = series[i];\n\n let singleSeries = this._seriesFromOriginalSeries.get(originalSeries);\n if (!singleSeries) {\n singleSeries = {\n ...originalSeries,\n originalSeries\n };\n this._seriesFromOriginalSeries.set(originalSeries, singleSeries);\n\n if (singleSeries.defaultAlwaysTooltipped) {\n this._alwaysTooltipped.add(singleSeries);\n this._tooltipsChanged = true;\n this.deferredEmit('always_tooltipped_changed', this._alwaysTooltipped);\n }\n }\n\n singleSeries.index = i;\n this._series.push(singleSeries);\n this._assignAxisTo(singleSeries);\n\n if (singleSeries.hidden) {\n this._hideSeries(singleSeries);\n }\n }\n\n for (let i = 0; i < userSeries.length; i++) {\n const singleSeries = userSeries[i];\n singleSeries.index = i + series.length;\n this._series.push(singleSeries);\n }\n\n this.deferredEmit('series_changed', this._series);\n\n this._dataChanged = true;\n this._markDirty();\n }\n\n _markDirty() {\n if (this._frameRequested) {\n return;\n }\n\n if (this._requireWASM && !RustAPI) {\n return;\n }\n\n const frameRequestStart = performance.now();\n this._frameRequested = true;\n requestAnimationFrame(() => {\n if (this.disposed) {\n return;\n }\n\n const frameExecutionStart = performance.now();\n\n const dataProcessingStart = performance.now();\n if (this._dataChanged) {\n this._onDataChange();\n this._mustRerender = true;\n this._tooltipsChanged = true;\n this._annotationsChanged = true;\n } else if (this._modifiedSeries.size) {\n this._onDataAdd(this._modifiedSeries);\n this._mustRerender = true;\n this._tooltipsChanged = true;\n this._annotationsChanged = true;\n } else {\n if (this._primarySizeChanged) {\n this._calculatePrimarySizeDependents();\n this._mustRerender = true;\n }\n if (this._rangeGraphSizeChanged) {\n this._calculateRangeGraphSizeDependents();\n this._mustRerender = true;\n }\n }\n const dataProcessingEnd = performance.now();\n\n const renderPipelineStart = performance.now();\n if (this._mustRerender) {\n this._render();\n }\n const renderPipelineEnd = performance.now();\n\n const generatorsStart = performance.now();\n if (this._mustCallGenerators) {\n this._callGenerators();\n }\n const generatorsEnd = performance.now();\n\n const tooltipStart = performance.now();\n if (this._tooltipsChanged) {\n this._recalculateTooltips();\n }\n const tooltipEnd = performance.now();\n\n const contextMenuStart = performance.now();\n if (this._contextMenuChanged) {\n this._recalculateContextMenu();\n }\n const contextMenuEnd = performance.now();\n\n const annotationStart = performance.now();\n if (this._annotationsChanged) {\n this._recalculateAnnotations();\n }\n const annotationEnd = performance.now();\n\n if (this._mustResize) {\n this.primaryRenderer.resizeDebounced();\n this.rangeGraphRenderer && this.rangeGraphRenderer.resizeDebounced();\n }\n\n this._frameRequested = false;\n this._mustRerender = false;\n this._dataChanged = false;\n this._primarySizeChanged = false;\n this._rangeGraphSizeChanged = false;\n this._modifiedSeries.clear();\n this._seriesChangedFromPromises.clear();\n this._tooltipsChanged = false;\n this._contextMenuChanged = false;\n this._annotationsChanged = false;\n this._mustCallGenerators = false;\n this._mustResize = false;\n\n const callbacksStart = performance.now();\n for (let emission of [...Object.values(this._deferredPriorityEmissions), ...Object.values(this._deferredEmissions)]) {\n this.emit(...emission);\n }\n const callbacksEnd = performance.now();\n this._deferredEmissions = {};\n this._deferredPriorityEmissions = {};\n\n const completionTime = performance.now();\n const loopTime = {\n frameExecution: completionTime - frameExecutionStart,\n frameRequestAndExecution: completionTime - frameRequestStart,\n generators: generatorsEnd - generatorsStart,\n dataProcessing: dataProcessingEnd - dataProcessingStart,\n renderPipeline: renderPipelineEnd - renderPipelineStart,\n tooltips: tooltipEnd - tooltipStart,\n contextMenu: contextMenuEnd - contextMenuStart,\n annotations: annotationEnd - annotationStart,\n callbacks: callbacksEnd - callbacksStart\n };\n this.lastLoopTime = loopTime;\n if (this._timingFrameCount) {\n if (this._timingBuffer.length < this._timingFrameCount) {\n this._timingBuffer.push(loopTime);\n } else {\n this._timingBuffer[this._timingIndex % this._timingFrameCount] = loopTime;\n }\n this._timingIndex++;\n }\n this.emit('render_time', completionTime - frameExecutionStart, loopTime);\n });\n }\n\n deferredEmit(...args) {\n this._deferredEmissions[args[0]] = args;\n }\n\n deferredPriorityEmit(...args) {\n this._deferredPriorityEmissions[args[0]] = args;\n }\n\n _seriesToSimpleData(singleSeries) {\n const type = inferType(singleSeries);\n if (SIMPLE_DATA_TYPES.includes(type)) {\n return singleSeries.data;\n }\n\n // get a reference to whatever you already have\n let currentData = this._dataCache.get(singleSeries.data);\n\n if (currentData && this._seriesChangedFromPromises.has(singleSeries.data)) {\n return currentData;\n }\n\n if (!currentData) {\n currentData = [];\n this._dataCache.set(singleSeries.data, currentData);\n singleSeries.simpleData = currentData;\n }\n\n if (type === 'object_observable' || type === 'tuple_observable') {\n let sameDataSet = this._observablesToSeries.get(singleSeries.data);\n if (sameDataSet) {\n const firstSameDataSeries = sameDataSet.values().next().value;\n currentData = firstSameDataSeries.simpleData;\n if (!currentData) {\n throw new Error(`Cannot find simpleData in ${firstSameDataSeries.name || firstSameDataSeries.yKey || firstSameDataSeries.data}`);\n }\n this._dataCache.set(singleSeries.data, currentData);\n singleSeries.simpleData = currentData;\n } else {\n sameDataSet = new Set();\n singleSeries.simpleData = currentData;\n this._observablesToSeries.set(singleSeries.data, sameDataSet);\n }\n\n sameDataSet.add(singleSeries);\n\n this._listenToObservableData({\n observable: singleSeries.data,\n currentData\n });\n }\n\n if (type === 'generator') {\n if (!this._generatorsToSeries.has(singleSeries.data)) {\n this._generatorsToSeries.set(singleSeries.data, new Set());\n }\n\n this._generatorsToSeries.get(singleSeries.data).add(singleSeries);\n\n if (!this._generators.has(singleSeries.data)) {\n this._generators.add(singleSeries.data);\n this._callGenerator(singleSeries.data);\n }\n }\n\n // return whatever you have; it'll fetch more in the background\n return currentData;\n }\n\n _listenToPromise(singleSeries, dataPromise) {\n dataPromise.then((resolved) => {\n this._dataCache.set(singleSeries.data, resolved);\n singleSeries.simpleData = resolved;\n this._seriesChangedFromPromises.add(singleSeries.data);\n this._dataChanged = true;\n this._markDirty();\n });\n }\n\n _listenToObservableData({ observable, currentData }) {\n if (this._subscriptions.has(observable)) { // someone else already listened to it\n return;\n }\n this._subscriptions.set(observable, true);\n\n // listen to the new data\n const listener = observable.observe((point) => {\n if (Array.isArray(point)) {\n for (let datum of point) {\n currentData.push(datum);\n }\n } else {\n currentData.push(point);\n }\n\n this.emit('observable_modified', observable);\n\n this.markObservableModified(observable);\n });\n this._subscriptions.set(observable, listener);\n }\n\n markObservableModified(observable) {\n if (!this._observablesToSeries.has(observable)) {\n return;\n }\n\n for (let singleSeries of this._observablesToSeries.get(observable)) {\n this._modifiedSeries.add(singleSeries);\n }\n this._markDirty();\n }\n\n _unsubscribeFromStaleSeries() {\n const currentSeries = new Set(this._series);\n for (let [observable, seriesSet] of this._observablesToSeries) {\n let stillHasListener = false;\n\n for (let singleSeries of seriesSet) {\n if (currentSeries.has(singleSeries)) {\n stillHasListener = true;\n break;\n }\n }\n\n if (!stillHasListener) {\n this._subscriptions.get(observable).unsubscribe();\n this._subscriptions.delete(observable);\n this._observablesToSeries.delete(observable);\n }\n }\n\n for (let [generator, seriesSet ] of this._generatorsToSeries) {\n let stillHasSeries = false;\n\n for (let singleSeries of seriesSet) {\n if (currentSeries.has(singleSeries)) {\n stillHasSeries = true;\n break;\n }\n }\n\n if (!stillHasSeries) {\n this._generatorsToSeries.delete(generator);\n this._generators.delete(generator);\n this._generatorCallArgs.delete(generator);\n }\n }\n }\n\n async _callGenerator(generator) {\n const parameters = {\n minX: this._selection.minX,\n maxX: this._selection.maxX,\n sizing: this.primaryRenderer.sizing\n };\n\n if (generatorParamsEqual(this._generatorCallArgs.get(generator), parameters)) {\n return;\n }\n this._generatorCallArgs.set(generator, parameters);\n\n // Note: potential race condition if generator is stupid. For now, we'll rely on generator being smart\n // Race condition: a new, faster one runs before completed\n const data = await Promise.resolve(generator(parameters));\n\n // do nothing if the generator returned nothing\n if (!data) {\n return;\n }\n\n // because calling the generator may have taken some time, check that there are still listeners for it\n if (!this._generatorsToSeries.has(generator)) {\n return;\n }\n\n this._dataChanged = true;\n this._markDirty();\n\n if (typeof data.observe === 'function') {\n const currentData = [];\n this._dataCache.set(generator, currentData);\n for (let singleSeries of this._generatorsToSeries.get(generator)) {\n singleSeries.simpleData = currentData;\n }\n\n for (let singleSeries of this._generatorsToSeries.get(generator)) {\n if (!this._observablesToSeries.has(data)) {\n this._observablesToSeries.set(data, new Set());\n }\n\n this._observablesToSeries.get(data).add(singleSeries);\n }\n\n this._listenToObservableData({\n observable: data,\n currentData\n });\n } else {\n this._dataCache.set(generator, data);\n for (let singleSeries of this._generatorsToSeries.get(generator)) {\n singleSeries.simpleData = data;\n }\n }\n }\n\n _callGenerators() {\n for (let generator of this._generators) {\n this._callGenerator(generator);\n }\n }\n\n _recalculateTooltips() {\n if (!this.primaryRenderer || !this.primaryRenderer.sizing) {\n return;\n }\n\n this._tooltipState = calculateTooltipState({\n mousePresent: this._tooltipState.mousePresent,\n mouseX: this._tooltipState.mouseX,\n mouseY: this._tooltipState.mouseY,\n sizing: this.primaryRenderer.sizing,\n series: this._series,\n alwaysTooltipped: this._alwaysTooltipped,\n savedTooltips: this._savedTooltips,\n allTooltipped: this._tooltipAllNext,\n closestSpacing: this._globalBounds.closestSpacing\n });\n this._tooltipAllNext = false;\n this.deferredEmit('tooltip_state_changed', this._tooltipState, this._tooltipStateArg);\n this._tooltipStateArg = null;\n }\n \n _recalculateContextMenu() {\n if (!this.primaryRenderer || !this.primaryRenderer.sizing) {\n return;\n }\n\n const boundingRect = this.primaryRenderer.boundingRect;\n const sizing = this.primaryRenderer.sizing;\n let value = null;\n let newX = null;\n \n for (let series of this._series) {\n const bounds = series.axis.currentBounds;\n \n newX = this._contextMenuPosition.x - boundingRect.left;\n \n // if it's on the right side, move it to the left one width\n if (this._contextMenuPosition.x > (boundingRect.right - sizing.elementWidth) * 2) newX -= 130;\n\n if (series.xKey === 'timestamp' || series.xKey === 'time' || series.xKey === 'date') {\n value = new Date((this._contextMenuPosition.x - boundingRect.left) / sizing.elementWidth * (bounds.maxX - bounds.minX) + bounds.minX);\n } else {\n value = (this._contextMenuPosition.x - boundingRect.left) / sizing.elementWidth * (bounds.maxX - bounds.minX) + bounds.minX;\n }\n }\n this._contextMenuPosition = {\n x: newX,\n y: this._contextMenuPosition.y - boundingRect.top,\n showing: this._contextMenuPosition.showing,\n value: value\n };\n this.deferredEmit('context_menu_position_changed', this._contextMenuPosition);\n }\n\n _recalculateAnnotations() {\n if (!this.primaryRenderer || !this.primaryRenderer.sizing) {\n return;\n }\n\n this._annotationsState = calculateAnnotationsState({\n annotations: this._annotations,\n series: this._series,\n sizing: this.primaryRenderer.sizing,\n selection: this._selection\n });\n this.deferredEmit('annotations_changed', this._annotationsState);\n }\n\n _onDataChange() {\n this._expandYWith = [];\n const dataBoundsList = [];\n\n for (let singleSeries of this._series) {\n if (singleSeries.hidden) {\n continue;\n }\n\n const simpleData = this._seriesToSimpleData(singleSeries);\n singleSeries.inDataSpace = simpleSeriesToDataSpace({\n ...singleSeries,\n data: simpleData\n }, {\n stateController: this\n });\n singleSeries.simpleDataSliceStart = simpleData.length;\n singleSeries.dataBounds = calculateDataBounds(singleSeries.inDataSpace);\n if (singleSeries.rendering === 'bar') {\n singleSeries.dataBounds = expandBounds(singleSeries.dataBounds, { extendXForNBars: singleSeries.inDataSpace.length, expandYWith: singleSeries.expandYWith });\n }\n\n dataBoundsList.push(singleSeries.dataBounds);\n\n if (singleSeries.expandYWith) {\n this._expandYWith.push(singleSeries.expandYWith);\n }\n }\n\n this._unsubscribeFromStaleSeries();\n\n this._dataBounds = mergeBounds(dataBoundsList);\n\n this._recalculateSelection({ disableSwap: true});\n\n for (let singleSeries of this._series) {\n if (singleSeries.hidden) {\n continue;\n }\n\n singleSeries.selectedBounds = calculateDataBounds(singleSeries.inSelectedSpace.data, { percentile: this._percentile, percentileAsymmetry: this._percentileAsymmetry });\n if (singleSeries.hasAreaBottom) {\n singleSeries.selectedBoundsAreaTop = singleSeries.selectedBounds;\n singleSeries.selectedBoundsAreaBottom = calculateDataBounds(singleSeries.inSelectedSpaceAreaBottom.data, { percentile: this._percentile, percentileAsymmetry: this._percentileAsymmetry });\n\n singleSeries.selectedBounds = mergeBounds([\n singleSeries.selectedBoundsAreaTop,\n singleSeries.selectedBoundsAreaBottom\n ]);\n }\n }\n\n this._recalculateAxisBounds();\n\n for (let singleSeries of this._series) {\n if (singleSeries.hidden) {\n continue;\n }\n\n this._calculatePrimarySizeDependents(singleSeries, { dataChanged: true });\n this._calculateRangeGraphSizeDependents(singleSeries, { dataChanged: true });\n }\n }\n\n _onDataAdd(modifiedSeries) {\n const newData = new Map();\n const modifiedAxes = new Set();\n\n const modifiedSeriesAndDependents = new Set();\n for (let singleSeries of modifiedSeries) {\n modifiedSeriesAndDependents.add(singleSeries);\n }\n\n for (let singleSeries of modifiedSeries) {\n modifiedAxes.add(singleSeries.axis);\n\n if (!singleSeries.inDataSpace) {\n throw new Error('inDataSpace must be present for onDataAdd to be called');\n }\n\n const simpleData = this._seriesToSimpleData(singleSeries);\n\n let prevY;\n if (singleSeries.inDataSpace.length) {\n prevY = singleSeries.inDataSpace[singleSeries.inDataSpace.length - 1][1];\n }\n\n const newDataInDataSpace = simpleSeriesToDataSpace(singleSeries, {\n data: simpleData.slice(singleSeries.simpleDataSliceStart || 0),\n valueXStart: singleSeries.inDataSpace.length,\n prevY,\n stateController: this\n });\n newData.set(singleSeries, newDataInDataSpace);\n singleSeries.simpleDataSliceStart = simpleData.length;\n\n if (newDataInDataSpace.length < 32) {\n singleSeries.inDataSpace.push(...newDataInDataSpace);\n } else {\n for (let point of newDataInDataSpace) {\n singleSeries.inDataSpace.push(point);\n }\n }\n\n let newDataBounds = calculateDataBounds(newDataInDataSpace);\n if (singleSeries.rendering === 'bar') {\n newDataBounds = expandBounds(newDataBounds, { extendXForNBars: singleSeries.inDataSpace.length, expandYWith: singleSeries.expandYWith });\n }\n\n singleSeries.dataBounds = mergeBounds([singleSeries.dataBounds, newDataBounds]);\n this._dataBounds = mergeBounds([this._dataBounds, newDataBounds]);\n\n // save these off for debugging only\n singleSeries.newPointCount = newDataInDataSpace.length;\n singleSeries.newDataBounds = newDataBounds;\n }\n\n const previousSelection = this._selection;\n this._recalculateSelection();\n\n for (let singleSeries of modifiedSeries) {\n if (!singleSeries.inSelectedSpace.data.length) { // empty, trivially fast\n singleSeries.selectedBounds = calculateDataBounds(singleSeries.inSelectedSpace.data);\n continue;\n }\n\n const firstX = singleSeries.inSelectedSpace.data[0][0];\n const lastX = singleSeries.inSelectedSpace.data[singleSeries.inSelectedSpace.data.length - 1][0];\n\n const oldBoundSubsetOfNewBounds = previousSelection.minX >= firstX && previousSelection.maxX <= lastX;\n\n if (!oldBoundSubsetOfNewBounds || this._percentile !== 100) {\n // this is significantly slower, but it's too complex to diff the old bounds and new bounds or diff percentiles\n // besides, it not being a subset hopefully means its a lower volume of data\n singleSeries.selectedBounds = calculateDataBounds(singleSeries.inSelectedSpace.data, { percentile: this._percentile, percentileAsymmetry: this._percentileAsymmetry});\n if (singleSeries.hasAreaBottom) {\n singleSeries.selectedBoundsAreaTop = singleSeries.selectedBounds;\n singleSeries.selectedBoundsAreaBottom = calculateDataBounds(singleSeries.inSelectedSpaceAreaBottom.data, { percentile: this._percentile, percentileAsymmetry: this._percentileAsymmetry });\n\n singleSeries.selectedBounds = mergeBounds([\n singleSeries.selectedBoundsAreaTop,\n singleSeries.selectedBoundsAreaBottom\n ]);\n }\n continue;\n }\n\n // note: we could do a binary search here, but there are typically only a few points added each frame, so it isn't worth it\n const newSelectedData = newData.get(singleSeries)\n .filter((tuple) => tuple[0] >= this._selection.minX && tuple[0] <= this._selection.maxX);\n\n singleSeries.newSelectedData = newSelectedData;\n singleSeries.selectedBounds = mergeBounds([singleSeries.selectedBounds, calculateDataBounds(newSelectedData)]);\n }\n\n this._recalculateAxisBounds();\n\n this.deferredPriorityEmit('axis_bounds_changed', this._axes.map(({ currentBounds }) => currentBounds));\n\n for (let axis of modifiedAxes) {\n for (let singleSeries of axis.series) {\n this._calculatePrimarySizeDependents(singleSeries);\n this._calculateRangeGraphSizeDependents(singleSeries);\n }\n }\n }\n\n _recalculateAxisBounds() {\n for (let axis of this._axes) {\n if (this._selection.fixedY || !this._autoscaleY) {\n axis.targetBounds = this._selection;\n if (axis.targetBounds.byAxis) {\n axis.targetBounds = axis.targetBounds.byAxis[axis.axisIndex];\n }\n\n axis.currentBounds = axis.targetBounds;\n continue;\n }\n\n const selectedBoundsList = [];\n const expandYWith = [];\n\n for (let singleSeries of axis.series) {\n selectedBoundsList.push(singleSeries.selectedBounds);\n\n if (singleSeries.expandYWith) {\n expandYWith.push(...singleSeries.expandYWith);\n }\n\n if (singleSeries.rendering === 'bar') {\n expandYWith.push(singleSeries.selectedBounds.minY, singleSeries.selectedBounds.maxY);\n }\n }\n\n axis.selectedDataBounds = mergeBounds(selectedBoundsList);\n axis.targetBounds = axis.currentBounds = expandBounds(axis.selectedDataBounds, {expandYWith});\n }\n this.deferredPriorityEmit('axis_bounds_changed', this._axes.map(({ currentBounds }) => currentBounds));\n }\n\n /**\n * Recalculates global bounds, selection, and data in selected space (for each series)\n * REQUIRES that this._dataBounds and this._expandYWith are set & up-to-date\n *\n * @private\n */\n _recalculateSelection({disableSwap = false}={}) {\n this._globalBounds = expandBounds(this._dataBounds, {expandYWith: this._expandYWith.flat()});\n this.deferredPriorityEmit('global_bounds_changed', this._globalBounds);\n this._selection = selectionFromGlobalBounds(this._globalBounds, this._boundsCalculator);\n this.deferredPriorityEmit('selection_changed', this._selection);\n\n for (let singleSeries of this._series) {\n if (singleSeries.hidden) {\n continue;\n }\n\n singleSeries.inSelectedSpace = dataSpaceToSelectedSpace({\n data: singleSeries.hasAreaBottom ? singleSeries.inDataSpace.filter((_, i) => i % 2 === 1) : singleSeries.inDataSpace,\n swap: disableSwap ? null : singleSeries.inSelectedSpace,\n minX: this._selection.minX,\n maxX: this._selection.maxX,\n ignoreDiscontinuities: singleSeries.ignoreDiscontinuities,\n square: singleSeries.square\n });\n\n if (singleSeries.hasAreaBottom) {\n singleSeries.inSelectedSpaceAreaBottom = dataSpaceToSelectedSpace({\n data:singleSeries.inDataSpace.filter((_, i) => i % 2 === 0),\n swap: disableSwap ? null : singleSeries.inSelectedSpaceAreaBottom,\n minX: this._selection.minX,\n maxX: this._selection.maxX,\n ignoreDiscontinuities: singleSeries.ignoreDiscontinuities,\n square: singleSeries.square\n });\n }\n }\n }\n\n _render() {\n if (!this.primaryRenderer || !this.primaryRenderer.sizing) {\n return;\n }\n\n this.primaryRenderer.clear();\n if (this.rangeGraphRenderer) {\n this.rangeGraphRenderer.clear();\n }\n\n for (let singleSeries of this._series) {\n if (singleSeries.hidden) {\n continue;\n }\n\n const shadowColor = singleSeries.shadowColor || {\n day: 'white',\n export: 'transparent',\n night: 'black'\n }[this._theme] || 'black';\n\n const shadowBlur = undefined;\n\n this.primaryRenderer.renderBackground(singleSeries.inBackgroundSpacePrimary);\n\n this.primaryRenderer.render(singleSeries, singleSeries.inRenderSpacePrimary, {\n highlighted: this._highlightedSeries === singleSeries.index,\n showIndividualPoints: this._showIndividualPoints,\n shadowColor,\n shadowBlur,\n defaultLineWidth: this._defaultLineWidth,\n globalBounds: this._globalBounds,\n inRenderSpaceAreaBottom: singleSeries.inRenderSpacePrimaryAreaBottom\n });\n\n if (this.rangeGraphRenderer && this.rangeGraphRenderer.sizing) {\n // Use tighter bounds for range graph to prevent clipping\n const rangeGraphBounds = {\n ...this._globalBounds,\n minY: this._globalBounds.unscaledMinY !== undefined ? this._globalBounds.unscaledMinY : this._globalBounds.minY,\n maxY: this._globalBounds.unscaledMaxY !== undefined ? this._globalBounds.unscaledMaxY : this._globalBounds.maxY\n };\n \n this.rangeGraphRenderer.render(singleSeries, singleSeries.inRenderSpaceRangeGraph, {\n shadowColor: 'transparent',\n shadowBlur: 0,\n width: 1,\n bounds: rangeGraphBounds,\n globalBounds: rangeGraphBounds,\n inRenderSpaceAreaBottom: singleSeries.inRenderSpaceRangeGraphAreaBottom\n });\n }\n }\n }\n\n _calculatePrimarySizeDependents(singleSeries, { dataChanged=false } = {}) {\n if (!this.primaryRenderer || !this.primaryRenderer.sizing) {\n return;\n }\n\n if (!singleSeries) {\n for (let s of this._series) {\n this._calculatePrimarySizeDependents(s);\n }\n return;\n }\n\n if (!this._series.includes(singleSeries)) {\n throw new Error('Series no longer exists');\n }\n\n if (singleSeries.hidden) {\n return;\n }\n\n const { currentBounds, scale } = singleSeries.axis;\n const renderWidth = Math.ceil(this.primaryRenderer.sizing.renderWidth/DPI_INCREASE);\n const renderHeight = Math.ceil(this.primaryRenderer.sizing.renderHeight);\n\n const toCondensedSelectedSpaceParams = {\n minX: currentBounds.minX,\n maxX: currentBounds.maxX,\n renderWidth,\n dataChanged\n };\n\n singleSeries.inCondensedSelectedSpacePrimary = condenseDataSpace({\n data: singleSeries.inSelectedSpace.data,\n swap: singleSeries.inCondensedSelectedSpacePrimary,\n ...toCondensedSelectedSpaceParams\n });\n\n const toRenderSpaceParams = {\n minX: currentBounds.minX,\n maxX: currentBounds.maxX,\n minY: currentBounds.minY,\n maxY: currentBounds.maxY,\n renderWidth,\n renderHeight,\n scale,\n dataChanged\n };\n\n singleSeries.inRenderSpacePrimary = selectedSpaceToRenderSpace({\n data: singleSeries.inCondensedSelectedSpacePrimary.data,\n swap: singleSeries.inRenderSpacePrimary,\n ...toRenderSpaceParams\n });\n\n singleSeries.inBackgroundSpacePrimary = selectedSpaceToBackgroundSpace({\n data: singleSeries.inCondensedSelectedSpacePrimary.data,\n background: singleSeries.background,\n swap: singleSeries.inBackgroundSpacePrimary,\n minX: currentBounds.minX,\n maxX: currentBounds.maxX\n });\n\n if (singleSeries.hasAreaBottom) {\n singleSeries.inCondensedSelectedSpacePrimaryAreaBottom = condenseDataSpace({\n data: singleSeries.inSelectedSpaceAreaBottom.data,\n swap: singleSeries.inCondensedSelectedSpacePrimaryAreaBottom,\n ...toCondensedSelectedSpaceParams\n });\n\n singleSeries.inRenderSpacePrimaryAreaBottom = selectedSpaceToRenderSpace({\n data: singleSeries.inCondensedSelectedSpacePrimaryAreaBottom.data,\n swap: singleSeries.inRenderSpacePrimaryAreaBottom,\n ...toRenderSpaceParams\n });\n\n singleSeries.inBackgroundSpacePrimaryAreaBottom = selectedSpaceToBackgroundSpace({\n data: singleSeries.inCondensedSelectedSpacePrimaryAreaBottom.data,\n background: singleSeries.background,\n swap: singleSeries.inBackgroundSpacePrimaryAreaBottom,\n minX: currentBounds.minX,\n maxX: currentBounds.maxX\n });\n }\n }\n\n _calculateRangeGraphSizeDependents(singleSeries, { dataChanged=false } = {}) {\n if (!this.rangeGraphRenderer || !this.rangeGraphRenderer.sizing) {\n return;\n }\n\n if (!singleSeries) {\n for (let s of this._series) {\n this._calculateRangeGraphSizeDependents(s);\n }\n return;\n }\n\n if (!this._series.includes(singleSeries)) {\n throw new Error('Series no longer exists');\n }\n\n if (singleSeries.hidden) {\n return;\n }\n\n const { scale } = singleSeries.axis;\n const globalBounds = this._globalBounds;\n \n const rangeGraphBounds = {\n ...globalBounds,\n minY: globalBounds.unscaledMinY !== undefined ? globalBounds.unscaledMinY : globalBounds.minY,\n maxY: globalBounds.unscaledMaxY !== undefined ? globalBounds.unscaledMaxY : globalBounds.maxY\n };\n \n const renderWidth = Math.ceil(this.rangeGraphRenderer.sizing.renderWidth/DPI_INCREASE);\n const renderHeight = Math.ceil(this.rangeGraphRenderer.sizing.renderHeight);\n\n const toSelectedSpaceParams = {\n minX: globalBounds.minX,\n maxX: globalBounds.maxX,\n ignoreDiscontinuities: singleSeries.ignoreDiscontinuities,\n square: singleSeries.square\n };\n\n singleSeries.inSelectedSpaceRangeGraph = dataSpaceToSelectedSpace({\n data: singleSeries.hasAreaBottom ? singleSeries.inDataSpace.filter((_, i) => i % 2 === 1) : singleSeries.inDataSpace,\n swap: singleSeries.inSelectedSpaceRangeGraph,\n ...toSelectedSpaceParams\n });\n\n const toCondensedSelectedSpaceParams = {\n minX: globalBounds.minX,\n maxX: globalBounds.maxX,\n renderWidth,\n dataChanged\n };\n\n singleSeries.inCondensedSelectedSpaceRangeGraph = condenseDataSpace({\n data: singleSeries.inSelectedSpaceRangeGraph.data,\n swap: singleSeries.inCondensedSelectedSpaceRangeGraph\n });\n\n const toRenderSpaceParams = {\n minX: rangeGraphBounds.minX,\n maxX: rangeGraphBounds.maxX,\n minY: rangeGraphBounds.minY,\n maxY: rangeGraphBounds.maxY,\n renderWidth,\n renderHeight,\n scale,\n dataChanged\n };\n\n singleSeries.inRenderSpaceRangeGraph = selectedSpaceToRenderSpace({\n data: singleSeries.inCondensedSelectedSpaceRangeGraph.data,\n swap: singleSeries.inRenderSpaceRangeGraph,\n ...toRenderSpaceParams\n });\n\n if (singleSeries.hasAreaBottom) {\n singleSeries.inSelectedSpaceRangeGraphAreaBottom = dataSpaceToSelectedSpace({\n data: singleSeries.inDataSpace.filter((_, i) => i % 2 === 0), // take the odd points for area bottom\n swap: singleSeries.inSelectedSpaceRangeGraphAreaBottom,\n ...toSelectedSpaceParams\n });\n\n singleSeries.inCondensedSelectedSpaceRangeGraphAreaBottom = condenseDataSpace({\n data: singleSeries.inSelectedSpaceRangeGraphAreaBottom.data,\n swap: singleSeries.inCondensedSelectedSpaceRangeGraphAreaBottom,\n ...toCondensedSelectedSpaceParams\n });\n\n singleSeries.inRenderSpaceRangeGraphAreaBottom = selectedSpaceToRenderSpace({\n data: singleSeries.inCondensedSelectedSpaceRangeGraphAreaBottom.data,\n swap: singleSeries.inRenderSpaceRangeGraphAreaBottom,\n ...toRenderSpaceParams\n });\n }\n }\n\n _createAxis({ side }) {\n const axis = {\n series: [],\n scale: 'linear',\n side,\n axisIndex: this._axes.length\n };\n this._axes.push(axis);\n return axis;\n }\n\n _moveAxis(singleSeries, axisIndex) {\n if (!this._series.includes(singleSeries)) {\n throw new Error('Series no longer exists');\n }\n\n let newAxis;\n if (axisIndex === 'new-left' || axisIndex === 'new-right') {\n newAxis = this._createAxis({ side: axisIndex.split('-')[1] });\n } else {\n newAxis = this._axes[parseInt(axisIndex)];\n }\n\n if (singleSeries.axis === newAxis) {\n return;\n }\n\n const oldAxis = singleSeries.axis;\n const oldIndex = oldAxis.series.indexOf(singleSeries);\n if (oldIndex === -1) {\n throw new Error('Series not present in axis');\n }\n oldAxis.series.splice(oldIndex, 1);\n\n newAxis.series.push(singleSeries);\n singleSeries.axis = newAxis;\n\n this._dataChanged = true;\n this.deferredEmit('axes_changed', this._axes);\n this.deferredEmit('left_axes_changed', this.leftAxes);\n this.deferredEmit('right_axes_changed', this.rightAxes);\n this.deferredEmit('exported_axes_changed', this.exportedAxes);\n this._markDirty();\n }\n\n _assignAxisTo(singleSeries) {\n if (singleSeries.axis && typeof singleSeries.axis === 'object') {\n return;\n }\n\n let axis;\n\n if (singleSeries.axisIndex) {\n const { axisIndex } = singleSeries;\n\n if (axisIndex === 'new-left' || axisIndex === 'new-right') {\n axis = this._createAxis({ side: axisIndex.split('-')[1] });\n } else {\n axis = this._axes[parseInt(axisIndex)];\n }\n } else if (singleSeries.axis) {\n singleSeries.originalAxis = singleSeries.axis;\n let [side, number] = singleSeries.axis.split('-');\n axis = findMatchingAxis({ axes: this._axes, side, number });\n\n if (!axis) {\n axis = this._createAxis({\n side\n });\n }\n } else {\n axis = this._axes[0];\n }\n\n axis.series.push(singleSeries);\n singleSeries.axis = axis;\n\n this.deferredEmit('axes_changed', this._axes);\n this.deferredEmit('exported_axes_changed', this.exportedAxes);\n\n if (singleSeries.axis.side === 'left') {\n this.deferredEmit('left_axes_changed', this.leftAxes);\n } else {\n this.deferredEmit('right_axes_changed', this.rightAxes);\n }\n }\n\n _removeSeries(singleSeries) {\n this._seriesFromOriginalSeries.delete(singleSeries.originalSeries);\n\n const { axis, data } = singleSeries;\n axis.series.splice(axis.series.indexOf(singleSeries), 1);\n const sameDataSet = this._observablesToSeries.get(data);\n if (sameDataSet) {\n sameDataSet.delete(singleSeries);\n if (sameDataSet.size === 0) {\n this._observablesToSeries.delete(data);\n }\n }\n\n if (this._generatorsToSeries.has(data)) {\n this._generatorsToSeries.get(data).delete(singleSeries);\n if (this._generatorsToSeries.get(data).size === 0) {\n this._generatorsToSeries.delete(data);\n this._generators.delete(data);\n }\n }\n\n this._alwaysTooltipped.delete(singleSeries);\n\n singleSeries.axis = singleSeries.originalAxis;\n delete singleSeries.originalAxis;\n delete singleSeries.inDataSpace;\n delete singleSeries.inSelectedSpace;\n delete singleSeries.inValueSpacePrimary;\n delete singleSeries.inValueSpaceRangeGraph;\n delete singleSeries.inRenderSpacePrimary;\n delete singleSeries.inRenderSpaceRangeGraph;\n delete singleSeries.newPointCount;\n delete singleSeries.newDataBounds;\n delete singleSeries.simpleDataSliceStart;\n\n this.deferredEmit('axes_changed', this._axes);\n this.deferredEmit('exported_axes_changed', this.exportedAxes);\n\n if (axis.side === 'left') {\n this.deferredEmit('left_axes_changed', this.leftAxes);\n } else {\n this.deferredEmit('right_axes_changed', this.rightAxes);\n }\n }\n\n _hideSeries(singleSeries) {\n const { axis } = singleSeries;\n const indexInAxis = axis.series.indexOf(singleSeries);\n singleSeries.indexInAxis = indexInAxis;\n axis.series.splice(indexInAxis, 1);\n\n this.deferredEmit('axes_changed', this._axes);\n\n if (axis.side === 'left') {\n this.deferredEmit('left_axes_changed', this.leftAxes);\n } else {\n this.deferredEmit('right_axes_changed', this.rightAxes);\n }\n }\n\n _showSeries(singleSeries) {\n const { axis } = singleSeries;\n axis.series.splice(singleSeries.indexInAxis, 0, singleSeries);\n\n this.deferredEmit('axes_changed', this._axes);\n\n if (axis.side === 'left') {\n this.deferredEmit('left_axes_changed', this.leftAxes);\n } else {\n this.deferredEmit('right_axes_changed', this.rightAxes);\n }\n }\n\n /*\n * Getters\n *******************\n */\n\n get boundCalculator() {\n return this._boundsCalculator;\n }\n\n get axes() {\n return this._axes;\n }\n\n get leftAxes() {\n const leftAxes = this._axes.filter(({ side, series }) => side === 'left' && series.length > 0).reverse();\n\n if (leftAxes.length === 0 && this.rightAxes.length === 0) {\n leftAxes.push(this._axes[0]);\n }\n\n return leftAxes;\n }\n\n get rightAxes() {\n return this._axes.filter(({ side, series }) => side === 'right' && series.length > 0 );\n }\n\n get bounds() {\n return this._axes.map(({ targetBounds }) => targetBounds);\n }\n\n get selection() {\n return this._selection;\n }\n\n get globalBounds() {\n return this._globalBounds;\n }\n\n get series() {\n return this._series;\n }\n\n get highlightedSeries() {\n return this._highlightedSeries;\n }\n\n get showIndividualPoints() {\n return this._showIndividualPoints;\n }\n\n get autoscaleY() {\n return this._autoscaleY;\n }\n\n get boundHistory() {\n return {\n hasNextBounds: this._boundsIndex < this._boundsHistory.length - 1,\n hasPreviousBounds: this._boundsIndex > 0\n };\n }\n\n get tooltipState() {\n return this._tooltipState;\n }\n \n get contextMenuState() {\n return this._contextMenuPosition;\n }\n\n get alwaysTooltipped() {\n return this._alwaysTooltipped;\n }\n\n get draggingY() {\n return this._draggingY;\n }\n\n get averageLoopTime() {\n return averageLoopTimes(this._timingBuffer);\n }\n\n get exportedAxes() {\n const axisToName = new Map();\n let leftCount = 0;\n let rightCount = 0;\n\n for (let axis of this._axes) {\n let name;\n if (axis.side === 'left') {\n name = `left-${leftCount}`;\n leftCount++;\n } else {\n name = `right-${rightCount}`;\n rightCount++;\n }\n\n for (let singleSeries of axis.series) {\n axisToName.set(singleSeries, name);\n }\n }\n\n return this.series.map((singleSeries) => {\n return {\n ...singleSeries.originalSeries,\n axis: axisToName.get(singleSeries)\n };\n });\n }\n\n get percentile() {\n return this._percentile;\n }\n\n get percentileAsymmetry() {\n return this._percentileAsymmetry;\n }\n\n get showingOptions() {\n return this._showingOptions;\n }\n\n get maxPrecision() {\n return this._maxPrecision;\n }\n\n get showingSidebar() {\n return this._showingSidebar;\n }\n\n get showingAnnotations() {\n return this._showingAnnotations;\n }\n\n get userCreatedSeries() {\n return this._series.filter((singleSeries) => singleSeries.userCreated);\n }\n\n get grapherID() {\n return this._grapherID;\n }\n\n get annotationState() {\n return this._annotationsState;\n }\n\n get sizing() {\n return this.primaryRenderer && this.primaryRenderer.sizing;\n }\n\n get theme() {\n return this._theme;\n }\n\n get exportMode() {\n return this._exportMode;\n }\n\n get enumMap() {\n return this._enumMap;\n }\n\n get hasXEnum() {\n return this._hasXEnum;\n }\n\n /*\n * Setters / ways to mutate the state that aren't the underlying data changing\n ***********************************************************************************\n */\n\n markSizeChanged(renderer) {\n if (renderer === this.primaryRenderer) {\n this.deferredEmit('primary_size_change', this.primaryRenderer.sizing);\n this.deferredEmit('primary_bounding_rect_change', this.primaryRenderer.boundingRect);\n this._primarySizeChanged = true;\n } else if (renderer === this.rangeGraphRenderer) {\n this.deferredEmit('range_graph_size_change', this.rangeGraphRenderer.sizing);\n this.deferredEmit('range_graph_bounding_rect_change', this.rangeGraphRenderer.boundingRect);\n this._rangeGraphSizeChanged = true;\n }\n\n this._mustRerender = true;\n this._tooltipsChanged = true;\n this._annotationsChanged = true;\n this._mustCallGenerators = true;\n this._markDirty();\n }\n\n set theme(value) {\n this._theme = value;\n this._mustRerender = true;\n this.deferredEmit('theme_change', this._theme);\n this._markDirty();\n }\n\n set exportMode(value) {\n this._exportMode = value;\n\n if (value) {\n this._nonExportTheme = this.theme;\n this.theme = 'export';\n } else {\n this.theme = this._nonExportTheme;\n }\n\n this.deferredEmit('export_mode_change', this._exportMode);\n this._markDirty();\n }\n\n set defaultLineWidth(value) {\n this._defaultLineWidth = value;\n this._mustRerender = true;\n this._markDirty();\n }\n\n set boundCalculator(boundingFunction) {\n if (!boundingFunction) {\n return;\n }\n\n if (boundingFunction === this._boundsCalculator) {\n return;\n }\n\n if (boundingFunction.debounceHistory) {\n clearTimeout(this._boundingCalculatorDebouncer);\n this._boundingCalculatorDebouncer = setTimeout(() => {\n this._addBoundCalculatorToHistory(boundingFunction);\n }, 250);\n } else {\n this._addBoundCalculatorToHistory(boundingFunction);\n }\n\n this._boundsCalculator = boundingFunction;\n this.deferredEmit('bound_calculator_changed', this._boundsCalculator);\n this._dataChanged = true;\n this._mustCallGenerators = true;\n this._markDirty();\n }\n\n set customBoundsSelectors(boundsSelectors) {\n this._customBoundsSelectors = this._customBoundsSelectors || {};\n\n const indexedCustomBoundSelectors = {};\n\n for (let { label, calculator } of boundsSelectors) {\n indexedCustomBoundSelectors[label] = calculator;\n\n if (this._boundsCalculator === this._customBoundsSelectors[label] && this._boundsCalculator !== calculator) {\n this.boundCalculator = calculator;\n }\n }\n\n this._customBoundsSelectors = indexedCustomBoundSelectors;\n }\n\n _addBoundCalculatorToHistory(boundingFunction) {\n this._boundsIndex++;\n this._boundsHistory = this._boundsHistory.slice(0, this._boundsIndex);\n this._boundsHistory.push(boundingFunction);\n this.emit('bound_history_changed', this.boundHistory);\n }\n\n registerSeriesClick(selectedSeriesIndex) {\n this.emit('series_click', this._series[selectedSeriesIndex], selectedSeriesIndex);\n }\n\n setHighlightedSeries(highlightedSeries) {\n this._highlightedSeries = highlightedSeries;\n this.deferredEmit('highlighted_series_changed', highlightedSeries);\n this._mustRerender = true;\n this._markDirty();\n }\n\n toggleIndividualPoints() {\n this._showIndividualPoints = !this._showIndividualPoints;\n this.deferredEmit('show_individual_points_changed', this._showIndividualPoints);\n this._mustRerender = true;\n this._markDirty();\n }\n\n toggleYAutoscaling() {\n this._autoscaleY = !this._autoscaleY;\n this.deferredEmit('autoscale_y_changed', this._autoscaleY);\n this._markDirty();\n }\n\n toggleExportMode() {\n this.exportMode = !this._exportMode;\n }\n\n setBoundsFromSelection(pixelSelection) {\n this.boundCalculator = boundCalculatorFromSelection(pixelSelection, {\n elementWidth: this.primaryRenderer.sizing.elementWidth,\n elementHeight: this.primaryRenderer.sizing.elementHeight,\n selection: this._selection,\n axes: this._axes\n });\n }\n\n nextBounds() {\n this._boundsIndex++;\n this._boundsCalculator = this._boundsHistory[this._boundsIndex];\n this.deferredEmit('bound_calculator_changed', this._boundsCalculator);\n this.deferredEmit('bound_history_changed', this.boundHistory);\n this._dataChanged = true;\n this._markDirty();\n }\n\n previousBounds() {\n this._boundsIndex--;\n this._boundsCalculator = this._boundsHistory[this._boundsIndex];\n this.deferredEmit('bound_calculator_changed', this._boundsCalculator);\n this.deferredEmit('bound_history_changed', this.boundHistory);\n this._dataChanged = true;\n this._markDirty();\n }\n\n setLabel({ axisIndex, label }) {\n this._axes[axisIndex].label = label;\n this.deferredEmit('axes_changed', [...this._axes]);\n this._markDirty();\n }\n\n toggleScale({ axisIndex }) {\n const oldScale = this._axes[axisIndex].scale;\n this._axes[axisIndex].scale = oldScale === 'log' ? 'linear' : 'log';\n\n this._dataChanged = true;\n this.deferredEmit('axes_changed', [...this._axes]);\n this._markDirty();\n }\n\n recalculateTooltips() {\n this.primaryRenderer.recalculatePosition();\n this.setTooltipMousePosition({\n clientX: this._tooltipClientX,\n clientY: this._tooltipClientY,\n shiftKey: this.shiftKeyPressedOnMove,\n tooltipAllNext: this._tooltipAllNext,\n tooltipStateArg: this._tooltipStateArg\n });\n }\n\n setTooltipMousePosition({ clientX, clientY, shiftKey, mouseX, mouseY, tooltipAllNext, tooltipStateArg }) {\n const sizing = this.primaryRenderer.sizing;\n if (!sizing) {\n return;\n }\n\n if (typeof clientX === 'number') {\n this._tooltipClientX = clientX;\n\n if (clientX < sizing.boundingRect.left || clientX > sizing.boundingRect.right) {\n this.showOnlySavedTooltips();\n return;\n }\n } else if (typeof mouseY !== 'number') {\n return;\n }\n\n if (typeof clientY === 'number') {\n this._tooltipClientY = clientY;\n\n if (clientY < sizing.boundingRect.top || clientY > sizing.boundingRect.bottom) {\n this.showOnlySavedTooltips();\n return;\n }\n } else if (typeof mouseY !== 'number') {\n return;\n }\n\n const newMouseX = mouseX || (clientX - sizing.boundingRect.left);\n const newMouseY = mouseY || (clientY - sizing.boundingRect.top);\n if (this._tooltipState.mousePresent && newMouseX === this._tooltipState.mouseX && newMouseY === this._tooltipState.mouseY) {\n return;\n }\n\n this._tooltipsChanged = true;\n this._tooltipState.mousePresent = true;\n this._tooltipState.mouseX = newMouseX;\n this._tooltipState.mouseY = newMouseY;\n this.shiftKeyPressedOnMove = shiftKey;\n this._tooltipAllNext = tooltipAllNext;\n this._tooltipStateArg = tooltipStateArg;\n this._markDirty();\n }\n \n setContextMenuMousePosition({ clientX, clientY }) {\n this._contextMenuPosition = { x: clientX, y: clientY, showing: !this._contextMenuPosition.showing };\n this._contextMenuChanged = true;\n this._markDirty();\n }\n\n toggleAlwaysTooltipped(singleSeries, shiftKey) {\n if (this._alwaysTooltipped.has(singleSeries)) {\n if (shiftKey) {\n this._alwaysTooltipped.clear();\n } else {\n this._alwaysTooltipped.delete(singleSeries);\n }\n } else {\n if (shiftKey) {\n for (let series of this._series) {\n this._alwaysTooltipped.add(series);\n }\n } else {\n this._alwaysTooltipped.add(singleSeries);\n }\n }\n\n this._tooltipsChanged = true;\n this.deferredEmit('always_tooltipped_changed', this._alwaysTooltipped);\n this._markDirty();\n }\n\n showOnlySavedTooltips(tooltipStateArg) {\n if (!this._tooltipState.mousePresent) {\n return;\n }\n\n this._tooltipsChanged = true;\n this._tooltipState.mousePresent = false;\n this._tooltipStateArg = tooltipStateArg;\n this._markDirty();\n }\n\n registerClick({ clientX }) {\n if (!this._listeners['series_click']) {\n return;\n }\n\n const boundingRect = this.primaryRenderer.boundingRect;\n const sizing = this.primaryRenderer.sizing;\n\n for (let series of this._series) {\n const bounds = series.axis.currentBounds;\n\n const x = (clientX - boundingRect.left) / sizing.elementWidth * (bounds.maxX - bounds.minX) + bounds.minX;\n this.emit('series_click', { x, series });\n }\n }\n\n toggleTooltipSaved() {\n const oldSavedTooltips = this._savedTooltips;\n this._savedTooltips = toggleTooltipSaved({\n currentTooltips: this._tooltipState.tooltips,\n savedTooltips: this._savedTooltips\n });\n this._tooltipsChanged = this._savedTooltips !== oldSavedTooltips;\n this._markDirty();\n }\n\n clearSavedTooltips() {\n if (this._savedTooltips.length === 0) {\n return;\n }\n\n this._savedTooltips = [];\n this._tooltipsChanged = true;\n this._markDirty();\n }\n\n markDragStart() {\n if (this._draggingY) {\n return;\n }\n\n this._draggingY = true;\n this.deferredEmit('dragging_y_changed', this._draggingY);\n this._markDirty();\n }\n\n finalizeDrag(draggedSeries, axisIndex, grapherID) {\n if (!this._draggingY) {\n return;\n }\n\n this._draggingY = false;\n this.deferredEmit('dragging_y_changed', this._draggingY);\n\n const hasAxis = axisIndex && axisIndex !== 0;\n const sameGrapherID = grapherID === this._grapherID;\n\n if (hasAxis && sameGrapherID) {\n this._moveAxis(draggedSeries, axisIndex);\n this.deferredEmit('dragging_y_finalized', { draggedSeries, axisIndex, grapherID });\n } else if (grapherID) {\n this.deferredEmit('dragging_y_finalized', { draggedSeries, axisIndex, grapherID });\n }\n\n this._markDirty();\n }\n\n set timingFrameCount(value) {\n if (typeof value !== 'number') {\n return;\n }\n\n this._timingBuffer = [];\n this._timingIndex = 0;\n this._timingFrameCount = value;\n }\n\n set percentile(value) {\n if (value === undefined) {\n return;\n }\n\n this.deferredEmit('percentile_changed', value);\n\n if (value === '') {\n value = 100;\n }\n\n value = parseFloat(value);\n if (!isNaN(value) && value <= 100 && value >= 0) {\n this._percentile = value;\n this._dataChanged = true;\n }\n\n this._markDirty();\n }\n\n set percentileAsymmetry(value) {\n if (value === undefined) {\n return;\n }\n\n this.deferredEmit('percentile_asymmetry_changed', value);\n\n if (value === '') {\n value = 0;\n }\n\n value = parseFloat(value);\n if (!isNaN(value) && value <= 50 && value >= -50) {\n this._percentileAsymmetry = value;\n this._dataChanged = true;\n }\n\n this._markDirty();\n }\n\n set showingOptions(value) {\n if (value === undefined) {\n return;\n }\n\n this._showingOptions = value;\n this.deferredEmit('showing_options_changed', value);\n this._markDirty();\n }\n\n toggleShowingOptions() {\n this.showingOptions = !this.showingOptions;\n }\n\n toggleMaxPrecision() {\n this._maxPrecision = !this._maxPrecision;\n this.deferredEmit('max_precision_changed', this._maxPrecision);\n this._markDirty();\n }\n\n toggleShowingAnnotations() {\n this._showingAnnotations = !this._showingAnnotations;\n this.deferredEmit('showing_annotations_changed', this._showingAnnotations);\n this._markDirty();\n }\n\n toggleShowingSidebar() {\n this._showingSidebar = !this._showingSidebar;\n this.deferredEmit('showing_sidebar_changed', this._showingSidebar);\n this._markDirty();\n }\n\n setShowing(singleSeries, showing) {\n singleSeries.hidden = !showing;\n this._series = [...this._series];\n\n if (singleSeries.hidden) {\n this._hideSeries(singleSeries);\n } else {\n this._showSeries(singleSeries);\n }\n\n this.deferredEmit('series_changed', this._series, { skipResize: true });\n this._dataChanged = true;\n this._markDirty();\n }\n\n set annotations(value) {\n this._annotations = value || [];\n this._annotationsChanged = true;\n this._markDirty();\n }\n\n /**\n * Converts an enum to a number, mutating saved state if necessary to track that\n *\n * @param {String} value\n * @param {Object} singleSeries\n * @param {Boolean} [isX]\n * @return {Number}\n */\n enumToNumber(value, singleSeries, isX) {\n const existingIndex = this._enumMap[value];\n if (typeof existingIndex === 'number') {\n return existingIndex;\n }\n\n const indexToSet = Object.keys(this._enumMap).length;\n this._enumMap[value] = indexToSet;\n\n // safely handle reference changes\n this._series[singleSeries.index].hasEnum = true;\n if (isX) {\n this._series[singleSeries.index].hasXEnum = true;\n this._hasXEnum = true;\n this.deferredEmit('has_x_enum_change', this._hasXEnum);\n this.deferredEmit('x_enum_map_change', this._enumMap);\n }\n\n this.deferredEmit('enum_map_change', this._enumMap);\n\n return indexToSet;\n }\n\n triggerResize() {\n this._mustResize = true;\n this._markDirty();\n }\n}\n","import BOUND_CALCULATORS from './bound_calculators';\n\nexport default function getDefaultBoundsCalculator(givenLabel, customCalculators) {\n if (BOUND_CALCULATORS[givenLabel]) {\n return BOUND_CALCULATORS[givenLabel];\n }\n\n for (let { label, calculator } of customCalculators) {\n if (givenLabel === label) {\n return calculator;\n }\n }\n\n return BOUND_CALCULATORS.all;\n}\n","export default function generatorParamsEqual(a, b) {\n if (a === undefined || b === undefined) {\n return a === b;\n }\n\n return (a.minX === b.minX) &&\n (a.maxX === b.maxX) &&\n (a.sizing.elementWidth === b.sizing.elementWidth) &&\n (a.sizing.renderWidth === b.sizing.renderWidth);\n}\n","import nameForSeries from '../helpers/name_for_series.js';\n\nexport default function calculateAnnotationsState({ annotations, series, sizing, selection }) {\n const shownSeries = new Set(series.map((singleSeries, i) => {\n return {\n name: nameForSeries(singleSeries, i),\n hidden: singleSeries.hidden\n };\n }).filter(({ hidden }) => !hidden).map(({ name }) => name));\n\n const { elementWidth } = sizing;\n const { minX, maxX } = selection;\n const xRange = maxX - minX;\n\n // Avoid division by zero if minX === maxX\n if (xRange === 0) {\n return {\n annotations: [],\n elementWidth\n };\n }\n\n const renderableAnnotations = annotations.filter((annotation) => {\n if (!annotation.series) {\n return true;\n }\n\n for (let seriesName of annotation.series) {\n if (shownSeries.has(seriesName)) {\n return true;\n }\n }\n\n return false;\n }).map((annotation) => {\n const isRange = annotation.startX !== undefined && annotation.endX !== undefined;\n const isPoint = annotation.x !== undefined;\n\n let xStartValue = annotation.startX;\n let xEndValue = annotation.endX;\n\n if (!isRange && isPoint) {\n xStartValue = annotation.x;\n xEndValue = annotation.x;\n } else if (!isRange && !isPoint) {\n return null;\n }\n\n const convertToNumber = (val) => {\n if (typeof val === 'string') return new Date(val).valueOf();\n if (val instanceof Date) return val.valueOf();\n return val;\n };\n\n let startX = convertToNumber(xStartValue);\n let endX = convertToNumber(xEndValue);\n\n if (startX > endX) {\n [startX, endX] = [endX, startX];\n }\n\n let pixelStartX = (startX - minX) / xRange * elementWidth;\n let pixelEndX = (endX - minX) / xRange * elementWidth;\n\n // Clamp values to be within the element width\n pixelStartX = Math.max(0, Math.min(elementWidth, pixelStartX));\n pixelEndX = Math.max(0, Math.min(elementWidth, pixelEndX));\n\n let pixelWidth = pixelEndX - pixelStartX;\n if (pixelWidth < 1 && pixelEndX > 0 && pixelStartX < elementWidth) {\n if (!isRange && isPoint) {\n pixelWidth = 1;\n pixelStartX -= 0.5;\n } else if (isRange) {\n pixelWidth = 1;\n } else {\n pixelWidth = 0;\n }\n }\n \n pixelStartX = Math.max(0, Math.min(elementWidth - pixelWidth, pixelStartX));\n\n\n if (pixelWidth <= 0) {\n return null;\n }\n\n\n return {\n ...annotation,\n isRange,\n pixelStartX,\n pixelWidth\n };\n }).filter(annotation => annotation !== null);\n\n return {\n annotations: renderableAnnotations,\n elementWidth\n };\n}\n","export default function selectionFromGlobalBounds(globalBounds, boundsCalculator) {\n const targetBounds = Object.assign({}, globalBounds, boundsCalculator(globalBounds));\n\n if (targetBounds.maxX instanceof Date) {\n targetBounds.maxX = targetBounds.maxX.valueOf();\n }\n\n if (targetBounds.minX instanceof Date) {\n targetBounds.minX = targetBounds.minX.valueOf();\n }\n\n if (targetBounds.maxX < targetBounds.minX) {\n targetBounds.maxX = targetBounds.minX;\n }\n\n if (targetBounds.minX < globalBounds.minX) {\n targetBounds.minX = globalBounds.minX;\n }\n\n if (targetBounds.maxX > globalBounds.maxX) {\n targetBounds.maxX = globalBounds.maxX;\n }\n\n return targetBounds;\n}\n","/**\n *\n * @param {Array<Object>} axes\n * @param {'left'|'right'} [side]\n * @param {String|Number} [number]\n * @return {Object|undefined}\n */\nexport default function findMatchingAxis({ axes, side, number }) {\n if (number) {\n number = parseInt(number) || 0;\n } else {\n number = 0;\n }\n\n let axis;\n let seen = 0;\n for (let candidateAxis of axes) {\n if (candidateAxis.side !== side) {\n continue;\n }\n\n if (seen === number) {\n axis = candidateAxis;\n break;\n }\n\n seen++;\n }\n\n return axis;\n}\n","export function averageLoopTimes(loopTimes) {\n const result = {};\n\n for (let loopTime of loopTimes) {\n for (let [key, value] of Object.entries(loopTime)) {\n result[key] = (result[key] || 0) + value;\n }\n }\n\n for (let [key, value] of Object.entries(result)) {\n result[key] = value/loopTimes.length;\n }\n\n return result;\n}\n","import scaleBounds from '../renderer/scale_bounds';\n\nexport default function boundCalculatorFromSelection({ minPixelX, maxPixelX, minPixelY, maxPixelY}, { elementWidth, elementHeight, selection, axes }) {\n if (Math.abs(maxPixelX - minPixelX) < 1 || Math.abs(maxPixelY - minPixelY) < 1) {\n return;\n }\n\n const minX = (minPixelX/elementWidth)*(selection.maxX - selection.minX) + selection.minX;\n const maxX = (maxPixelX/elementWidth)*(selection.maxX - selection.minX) + selection.minX;\n\n const byAxis = [];\n for (let { currentBounds, scale } of axes) {\n const scaledBounds = scaleBounds({ ...currentBounds, scale });\n let maxY = (1 - minPixelY/elementHeight)*(scaledBounds.maxY - scaledBounds.minY) + scaledBounds.minY;\n let minY = (1 - maxPixelY/elementHeight)*(scaledBounds.maxY - scaledBounds.minY) + scaledBounds.minY;\n\n if (scale === 'log') {\n minY = Math.pow(10, minY);\n maxY = Math.pow(10, maxY);\n }\n byAxis.push({\n minX,\n maxX,\n minY,\n maxY\n });\n }\n\n return () => {\n return {\n minX,\n maxX,\n byAxis\n };\n };\n}\n","import { useState, useEffect } from 'react';\n\nexport function useEvent(eventSource, eventName, initialState=null, watch=[]) {\n if (typeof initialState === 'function') {\n const originalInitialState = initialState;\n initialState = () => originalInitialState;\n }\n\n const [value, setValue] = useState(initialState);\n\n useEffect(() => {\n const listener = (updatedValue) => {\n if (typeof updatedValue === 'function') {\n const originalUpdatedValue = updatedValue;\n updatedValue = () => originalUpdatedValue;\n }\n setValue(updatedValue);\n };\n\n eventSource.on(eventName, listener);\n return () => {\n eventSource.off(eventName, listener);\n };\n }, [...watch, setValue, eventSource]);\n\n return value;\n}\n\nexport function usePrimarySize(stateController) {\n return useEvent(stateController, 'primary_size_change', stateController.primaryRenderer ? stateController.primaryRenderer.sizing : {\n elementWidth: 0,\n elementHeight: 0,\n renderWidth: 0,\n renderHeight: 0\n });\n}\n\nexport function useAxes(stateController) {\n return useEvent(stateController, 'axes_changed', stateController.axes);\n}\n\nexport function useSeries(stateController) {\n return useEvent(stateController, 'series_changed', stateController.series);\n}\n\nexport function useHighlightedSeries(stateController) {\n return useEvent(stateController, 'highlighted_series_changed', stateController.highlightedSeries);\n}\n\nexport function useRightAxisCount(stateController) {\n return useRightAxes(stateController).length;\n}\n\nexport function useLeftAxisCount(stateController) {\n return useLeftAxes(stateController).length;\n}\n\nexport function useRightAxes(stateController) {\n return useEvent(stateController, 'right_axes_changed', stateController.rightAxes);\n}\n\nexport function useLeftAxes(stateController) {\n return useEvent(stateController, 'left_axes_changed', stateController.leftAxes);\n}\n\nexport function useSelection(stateController) {\n return useEvent(stateController, 'selection_changed', stateController.selection);\n}\n\nexport function useGlobalBounds(stateController) {\n return useEvent(stateController, 'global_bounds_changed', stateController.globalBounds);\n}\n\nexport function useAxisBounds(stateController) {\n return useEvent(stateController, 'axis_bounds_changed', stateController.axes.map(({ currentBounds }) => currentBounds));\n}\n\nexport function useBoundCalculator(stateController) {\n return useEvent(stateController, 'bound_calculator_changed', stateController.boundCalculator);\n}\n\nexport function useShowIndividualPoints(stateController) {\n return useEvent(stateController, 'show_individual_points_changed', stateController.showIndividualPoints);\n}\n\nexport function useAutoscaleY(stateController) {\n return useEvent(stateController, 'autoscale_y_changed', stateController.autoscaleY);\n}\n\nexport function useBoundHistory(stateController) {\n return useEvent(stateController, 'bound_history_changed', stateController.boundHistory);\n}\n\nexport function useAlwaysTooltipped(stateController) {\n return useEvent(stateController, 'always_tooltipped_changed', stateController.alwaysTooltipped);\n}\n\nexport function useTooltipState(stateController) {\n return useEvent(stateController, 'tooltip_state_changed', stateController.tooltipState);\n}\n\nexport function useContextMenu(stateController) {\n return useEvent(stateController, 'context_menu_position_changed', stateController.contextMenuState);\n}\n\nexport function useDraggingY(stateController) {\n return useEvent(stateController, 'dragging_y_changed', stateController.draggingY);\n}\n\nexport function usePercentile(stateController) {\n return useEvent(stateController, 'percentile_changed', stateController.percentile);\n}\n\nexport function useShowingOptions(stateController) {\n return useEvent(stateController, 'showing_options_changed', stateController.showingOptions);\n}\n\nexport function useMaxPrecision(stateController) {\n return useEvent(stateController, 'max_precision_changed', stateController.maxPrecision);\n}\n\nexport function usePercentileAsymmetry(stateController) {\n return useEvent(stateController, 'percentile_asymmetry_changed', stateController.percentileAsymmetry);\n}\n\nexport function useShowingSidebar(stateController) {\n return useEvent(stateController, 'showing_sidebar_changed', stateController.showingSidebar);\n}\n\nexport function useShowingAnnotations(stateController) {\n return useEvent(stateController, 'showing_annotations_changed', stateController.showingAnnotations);\n}\n\nexport function useMultiSeries(multigraphStateController) {\n return useEvent(multigraphStateController, 'multi_series_changed', multigraphStateController.multiSeries);\n}\n\nexport function useAnnotationState(stateController) {\n return useEvent(stateController, 'annotations_changed', stateController.annotationState);\n}\n\nexport function useSizing(stateController) {\n return useEvent(stateController, 'primary_size_change', stateController.sizing);\n}\n\nexport function useTheme(stateController) {\n return useEvent(stateController, 'theme_change', stateController.theme);\n}\n\nexport function useExportMode(stateController) {\n return useEvent(stateController, 'export_mode_change', stateController.exportMode);\n}\n\nexport function useHasXEnum(stateController) {\n return useEvent(stateController, 'has_x_enum_change', stateController.hasXEnum);\n}\n\nexport function useEnumMap(stateController) {\n return useEvent(stateController, 'enum_map_change', stateController.enumMap);\n}\n\nexport function useXEnumMap(stateController) {\n return useEvent(stateController, 'x_enum_map_change', stateController.enumMap);\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nexport default class Annotations extends React.PureComponent {\n\n render() {\n const { bodyHeight, annotationState } = this.props;\n const { annotations, elementWidth } = annotationState;\n\n const validAnnotations = annotations.filter(a => a.pixelStartX !== undefined && a.pixelWidth !== undefined);\n\n return (\n <div className=\"grapher-annotations\">\n {\n validAnnotations.map(({ pixelStartX, pixelWidth, content, isRange, lineOnly }, i) => {\n const annotationStyle = {\n left: pixelStartX\n };\n\n if (isRange) {\n return (\n <div key={`range-${i}`} className=\"grapher-annotation grapher-annotation-range\" style={annotationStyle}>\n <div\n className=\"annotation-range-marker\"\n style={{ width: pixelWidth, height: bodyHeight }}\n />\n </div>\n );\n } else {\n const pointMarkerWidth = lineOnly ? pixelWidth : Math.max(pixelWidth, 1);\n\n const textStyle = {};\n if (content) {\n textStyle.top = 21 * i;\n textStyle.position = 'absolute';\n const approxTextWidth = (content || '').length * 5.5;\n if (elementWidth > 0 && elementWidth - pixelStartX < approxTextWidth + 10) {\n textStyle.left = -approxTextWidth - 5;\n textStyle.textAlign = 'right';\n } else {\n textStyle.left = pointMarkerWidth + 5;\n }\n }\n\n return (\n <div key={`point-${i}`} className=\"grapher-annotation grapher-annotation-point\" style={annotationStyle}>\n <div\n className=\"annotation-marker\"\n style={{ width: pointMarkerWidth, height: bodyHeight }}\n />\n {content && !lineOnly &&\n <div className=\"annotation-text\" style={textStyle}>\n {content}\n </div>\n }\n </div>\n );\n }\n })\n }\n </div>\n );\n }\n}\n\nAnnotations.propTypes = {\n annotationState: PropTypes.shape({\n annotations: PropTypes.arrayOf(PropTypes.shape({\n pixelStartX: PropTypes.number,\n pixelWidth: PropTypes.number,\n content: PropTypes.string,\n isRange: PropTypes.bool,\n lineOnly: PropTypes.bool\n })).isRequired,\n elementWidth: PropTypes.number.isRequired\n }),\n bodyHeight: PropTypes.number\n};\n","import React from 'react';\nimport CustomPropTypes from '../helpers/custom_prop_types.js';\nimport PropTypes from 'prop-types';\nimport StateController from '../state/state_controller.js';\nimport {LINE_COLORS} from '../helpers/colors.js';\nimport {useAxisBounds, useSizing} from '../state/hooks.js';\n\nexport default React.memo(DraggablePoints);\n\nfunction DraggablePoints({ stateController, draggablePoints, onPointDrag, onDraggablePointsDoubleClick }) {\n const bounds = useAxisBounds(stateController)[0];\n const sizing = useSizing(stateController);\n\n if (!sizing) {\n return null;\n }\n\n const onPointlessDoubleClick = onDraggablePointsDoubleClick && ((event) => {\n const newXT = (event.clientX - sizing.boundingRect.left)/sizing.elementWidth;\n const newYT = 1 - (event.clientY - sizing.boundingRect.top)/sizing.elementHeight;\n\n onDraggablePointsDoubleClick(event, {\n x: newXT*(bounds.maxX - bounds.minX) + bounds.minX,\n y: newYT*(bounds.maxY - bounds.minY) + bounds.minY\n });\n });\n\n return (\n <div className=\"grapher-draggable-points\" onDoubleClick={onPointlessDoubleClick}>\n <svg width={sizing.elementWidth} height={sizing.elementHeight}>\n {\n draggablePoints.map((point, index) => {\n const xT = (point.x - bounds.minX)/(bounds.maxX - bounds.minX);\n const yT = (1 - (point.y - bounds.minY)/(bounds.maxY - bounds.minY));\n\n if (xT < 0 || xT > 1 || yT < 0 || yT > 1) {\n return null;\n }\n\n const pixelX = xT * sizing.elementWidth;\n const pixelY = yT * sizing.elementHeight;\n\n const radius = point.radius || 5;\n const fillColor = point.fillColor || LINE_COLORS[0];\n const strokeColor = point.strokeColor || 'white';\n const strokeWidth = point.strokeWidth || 1;\n\n const onMouseDown = (event) => {\n event.stopPropagation();\n\n if (!onPointDrag) {\n return;\n }\n\n const xOffset = pixelX - event.clientX;\n const yOffset = pixelY - event.clientY;\n\n const onMouseMove = (moveEvent) => {\n const newXT = (moveEvent.clientX + xOffset)/sizing.elementWidth;\n const newYT = 1 - (moveEvent.clientY + yOffset)/sizing.elementHeight;\n\n onPointDrag({\n index,\n point,\n x: newXT*(bounds.maxX - bounds.minX) + bounds.minX,\n y: newYT*(bounds.maxY - bounds.minY) + bounds.minY\n }, moveEvent);\n };\n\n const onMouseUp = () => {\n window.removeEventListener('mousemove', onMouseMove);\n window.removeEventListener('mouseup', onMouseUp);\n };\n\n window.addEventListener('mousemove', onMouseMove);\n window.addEventListener('mouseup', onMouseUp);\n };\n\n const onClick = point.onClick && ((event) => {\n point.onClick(event, point);\n });\n\n const onDoubleClick = point.onDoubleClick && ((event) => {\n event.stopPropagation();\n point.onDoubleClick(event, point);\n });\n\n return (\n <circle\n key={index}\n cx={pixelX}\n cy={pixelY}\n r={radius}\n fill={fillColor}\n stroke={strokeColor}\n strokeWidth={strokeWidth}\n onMouseDown={onMouseDown}\n onClick={onClick}\n onDoubleClick={onDoubleClick}\n />\n );\n })\n }\n </svg>\n </div>\n );\n}\n\nDraggablePoints.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n draggablePoints: CustomPropTypes.DraggablePoints.isRequired,\n onPointDrag: PropTypes.func,\n onDraggablePointsDoubleClick: PropTypes.func\n};\n","import React from 'react';\nimport CustomPropTypes from '../helpers/custom_prop_types.js';\nimport PropTypes from 'prop-types';\nimport StateController from '../state/state_controller.js';\nimport {useAxisBounds, useSizing} from '../state/hooks.js';\n\nexport default React.memo(VerticalLines);\n\nfunction VerticalLines({ stateController, verticalLines, isRangeGraph, bounds, elementWidth, elementHeight }) {\n bounds = bounds || useAxisBounds(stateController)[0];\n const sizing = useSizing(stateController);\n\n if (!sizing) {\n return null;\n }\n\n const relevantVerticalLines = verticalLines.filter(line => {\n if (isRangeGraph && !line.onRangeGraph) {\n return false;\n }\n\n if (line.onRangeGraphOnly && !isRangeGraph) {\n return false;\n }\n\n return true;\n });\n\n if (relevantVerticalLines.length === 0) {\n return null;\n }\n\n return (\n <div className=\"grapher-vertical-lines\">\n <svg width={elementWidth || sizing.elementWidth} height={elementHeight || sizing.elementHeight}>\n {\n relevantVerticalLines.map((line, index) => {\n if (isRangeGraph && typeof line.onRangeGraph === 'object') {\n line = {\n ...line,\n ...line.onRangeGraph\n };\n }\n\n const xT = (line.x - bounds.minX)/(bounds.maxX - bounds.minX);\n\n if (xT < 0 || xT > 1) {\n return null;\n }\n\n const pixelX = xT * (elementWidth || sizing.elementWidth);\n if (typeof line.minPixelX === 'number' && pixelX < line.minPixelX) {\n return null;\n }\n\n if (typeof line.maxPixelX === 'number' && pixelX > line.maxPixelX) {\n return null;\n }\n\n const lineStyle = {\n stroke: line.color,\n strokeWidth: line.width,\n ...(line.style || {})\n };\n\n const markerStyle = {\n fill: line.color,\n ...(line.markerStyle || {})\n };\n\n const textStyle = {\n ...{\n fontSize: '12px',\n fill: line.color,\n stroke: 'none',\n textAnchor: 'middle',\n dominantBaseline: 'hanging'\n },\n ...(line.textStyle || {})\n };\n\n let lineTop = 0;\n if (typeof line.lineTop === 'number') {\n lineTop = line.lineTop;\n } else if (line.text) {\n lineTop = 18;\n }\n\n let textTop = 5;\n if (typeof line.textTop === 'number') {\n textTop = line.textTop;\n }\n\n return (\n <React.Fragment key={index}>\n <line\n x1={pixelX}\n y1={lineTop}\n x2={pixelX}\n y2={(elementHeight || sizing.elementHeight)}\n style={lineStyle}\n />\n\n {\n line.markTop &&\n <polygon\n points={`${pixelX - 3},0 ${pixelX + 3},0 ${pixelX},3`}\n style={markerStyle}\n />\n }\n\n {\n line.text &&\n <text\n x={pixelX}\n y={textTop}\n style={textStyle}\n >\n {line.text}\n </text>\n }\n </React.Fragment>\n );\n })\n }\n </svg>\n </div>\n );\n}\n\nVerticalLines.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n verticalLines: CustomPropTypes.VerticalLines.isRequired,\n isRangeGraph: PropTypes.bool,\n bounds: PropTypes.object,\n elementWidth: PropTypes.number,\n elementHeight: PropTypes.number\n};\n","import React, { useCallback, useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport CustomPropTypes from '../helpers/custom_prop_types';\nimport GraphBodyRenderer from '../renderer/graph_body_renderer';\nimport Tooltip from './tooltip.jsx';\nimport ContextMenu from './context_menu.jsx';\nimport StateController from '../state/state_controller';\nimport {\n useAnnotationState,\n useAutoscaleY,\n useAxes,\n useMaxPrecision,\n useShowingAnnotations,\n useTooltipState,\n useContextMenu\n} from '../state/hooks';\nimport Annotations from './annotations.jsx';\nimport DraggablePoints from './draggable_points.jsx';\nimport VerticalLines from './vertical_lines.jsx';\nimport binarySearch from '../helpers/binary_search';\n\nexport default React.memo(GraphBody);\n\nfunction GraphBody({ stateController, webgl, bodyHeight, boundsSelectionEnabled, showTooltips, tooltipOptions, checkIntersection, draggablePoints, onPointDrag, onDraggablePointsDoubleClick, verticalLines, clockStyle, timeZone, onPointClick }) {\n const canvasEl = useCallback((el) => {\n if (stateController.primaryRenderer) {\n stateController.primaryRenderer.dispose();\n }\n\n if (!el) {\n return;\n }\n\n const renderer = new GraphBodyRenderer({\n stateController: stateController,\n canvasElement: el,\n webgl,\n checkIntersection\n });\n\n stateController.primaryRenderer = renderer;\n renderer.resize();\n }, [webgl, stateController]);\n\n\n const [boundsSelection, setBoundsSelection] = useState({\n showing: false,\n start: {},\n style: {}\n });\n\n const autoscaleY = useAutoscaleY(stateController);\n\n const axisCount = useAxes(stateController).length;\n\n const tooltip = useTooltipState(stateController);\n const maxPrecision = useMaxPrecision(stateController);\n const showAnnotations = useShowingAnnotations(stateController);\n const annotationState = useAnnotationState(stateController);\n const contextMenu = useContextMenu(stateController);\n\n const onMouseDown = (event) => {\n if (!boundsSelectionEnabled) {\n return;\n }\n\n let currentNode = event.target;\n for (let i = 0; i < 10 && currentNode; i++) {\n if (currentNode.classList.contains('grapher-tooltip')) {\n return;\n }\n currentNode = currentNode.parentNode;\n }\n\n const boundingRect = stateController.primaryRenderer.boundingRect;\n\n const start = {\n x: event.clientX - boundingRect.left,\n y: event.clientY - boundingRect.top\n };\n\n\n setBoundsSelection({\n showing: true,\n start,\n style: {\n left: start.x,\n top: start.y,\n width: 0,\n height: 0\n }\n });\n\n const onMouseUp = (event) => {\n window.removeEventListener('mouseup', onMouseUp);\n\n if (!boundsSelectionEnabled) {\n return;\n }\n\n const x = event.clientX - boundingRect.left;\n const y = event.clientY - boundingRect.top;\n\n stateController.setBoundsFromSelection({\n minPixelX: Math.min(x, start.x),\n maxPixelX: Math.max(x, start.x),\n minPixelY: Math.min(y, start.y),\n maxPixelY: Math.max(y, start.y)\n });\n\n setBoundsSelection({\n showing: false,\n style: {}\n });\n };\n\n window.addEventListener('mouseup', onMouseUp);\n };\n\n const onMouseMove = (event) => {\n if (boundsSelection.showing) {\n const boundingRect = stateController.primaryRenderer.boundingRect;\n const x = event.clientX - boundingRect.left;\n const y = event.clientY - boundingRect.top;\n\n setBoundsSelection(({ start }) => {\n return {\n showing: true,\n start,\n style: {\n left: Math.min(x, start.x),\n top: autoscaleY ? 0 : Math.min(y, start.y),\n width: Math.abs(x - start.x),\n height: autoscaleY ? boundingRect.height : Math.abs(y - start.y)\n }\n };\n });\n }\n };\n\n useEffect(() => {\n const onScroll = () => {\n if (!showTooltips) {\n return;\n }\n\n stateController.recalculateTooltips();\n };\n\n const onGlobalMouseMove = (event) => {\n if (!showTooltips) {\n return;\n }\n\n stateController.setTooltipMousePosition({\n clientX: event.clientX,\n clientY: event.clientY,\n shiftKey: event.shiftKey\n });\n };\n\n const getTouch = (event) => event.touches?.[0] || event.changedTouches?.[0];\n\n const onGlobalTouchStart = (event) => {\n if (!showTooltips) {\n return;\n }\n const touch = getTouch(event);\n if (!touch) return;\n stateController.setTooltipMousePosition({\n clientX: touch.clientX,\n clientY: touch.clientY\n });\n \n // Only prevent default if touch is within grapher bounds\n if (event.cancelable && event.target.closest('.graph-body')) {\n event.preventDefault();\n }\n };\n\n const onGlobalTouchMove = (event) => {\n if (!showTooltips) {\n return;\n }\n const touch = getTouch(event);\n if (!touch) return;\n stateController.setTooltipMousePosition({\n clientX: touch.clientX,\n clientY: touch.clientY\n });\n \n // Only prevent default if touch is within grapher bounds\n if (event.cancelable && event.target.closest('.graph-body')) {\n event.preventDefault();\n }\n };\n\n const onGlobalTouchEnd = () => {\n stateController.showOnlySavedTooltips();\n };\n\n window.addEventListener('scroll', onScroll, { passive: true });\n window.addEventListener('mousemove', onGlobalMouseMove, { passive: true });\n window.addEventListener('touchstart', onGlobalTouchStart, { passive: false });\n window.addEventListener('touchmove', onGlobalTouchMove, { passive: false });\n window.addEventListener('touchend', onGlobalTouchEnd, { passive: true });\n window.addEventListener('touchcancel', onGlobalTouchEnd, { passive: true });\n\n return () => {\n window.removeEventListener('scroll', onScroll);\n window.removeEventListener('mousemove', onGlobalMouseMove);\n window.removeEventListener('touchstart', onGlobalTouchStart);\n window.removeEventListener('touchmove', onGlobalTouchMove);\n window.removeEventListener('touchend', onGlobalTouchEnd);\n window.removeEventListener('touchcancel', onGlobalTouchEnd);\n };\n }, []);\n\n const onMouseLeave = () => {\n stateController.setContextMenuMousePosition({\n showing: false\n });\n };\n\n const onClick = (event) => {\n stateController.registerClick({\n clientX: event.clientX,\n clientY: event.clientY\n });\n\n if (tooltipOptions && tooltipOptions.savingDisabled) {\n stateController.clearSavedTooltips();\n return;\n }\n\n // if it's NOT a child of 'grapher-context-menu', close the context menu\n if (!event.target.closest('.grapher-context-menu')) {\n stateController.setContextMenuMousePosition({\n showing: false\n });\n }\n\n if (!window.getSelection || window.getSelection().type !== 'Range') {\n stateController.toggleTooltipSaved();\n }\n\n if (onPointClick) {\n const seriesToNearestPoint = {};\n\n const series = stateController.series;\n for (let i = 0; i < series.length; i++) {\n const singleSeries = series[i];\n\n const sizing = stateController.sizing;\n const bounds = singleSeries.axis.currentBounds;\n // const trueX = event.clientX/sizing.elementWidth * (bounds.maxX - bounds.minX) + bounds.minX;\n const trueX = stateController.tooltipState.mouseX/sizing.elementWidth * (bounds.maxX - bounds.minX) + bounds.minX;\n\n let data = singleSeries.inDataSpace;\n if (singleSeries.ignoreDiscontinuities) {\n data = data.filter((tuple) => typeof tuple[1] === 'number');\n }\n \n const closestIndex = binarySearch(data, trueX, { returnIndex: true });\n const closestPoint = data[closestIndex];\n\n seriesToNearestPoint[singleSeries.name] = closestPoint[0];\n }\n\n\n\n onPointClick(event, seriesToNearestPoint);\n }\n };\n const onDoubleClick = () => {\n stateController.clearSavedTooltips();\n };\n \n const onContextMenu = (event) => {\n event.preventDefault();\n stateController.setContextMenuMousePosition({\n clientX: event.clientX,\n clientY: event.clientY,\n showing: true\n });\n };\n\n return (\n <div className=\"graph-body graph-body-primary\"\n onMouseMove={onMouseMove}\n onMouseLeave={onMouseLeave}\n onMouseDown={onMouseDown}\n onClick={onClick}\n onDoubleClick={onDoubleClick}\n onContextMenu={onContextMenu}\n style={typeof bodyHeight === 'number' ? { height: bodyHeight } : undefined}\n >\n <canvas ref={canvasEl} />\n\n {\n showTooltips &&\n <Tooltip\n axisCount={axisCount}\n maxPrecision={maxPrecision}\n clockStyle={clockStyle}\n timeZone={timeZone}\n {...(tooltipOptions || {})}\n {...tooltip}\n />\n }\n\n {\n contextMenu.showing &&\n <ContextMenu\n contextMenu={contextMenu}\n />\n }\n\n {\n showAnnotations &&\n <Annotations\n bodyHeight={bodyHeight || stateController?.primaryRenderer?.boundingRect?.height}\n annotationState={annotationState}\n />\n }\n\n {\n verticalLines &&\n <VerticalLines\n stateController={stateController}\n verticalLines={verticalLines}\n />\n }\n\n {\n draggablePoints &&\n <DraggablePoints\n stateController={stateController}\n draggablePoints={draggablePoints}\n onPointDrag={onPointDrag}\n onDraggablePointsDoubleClick={onDraggablePointsDoubleClick}\n />\n }\n\n {\n boundsSelectionEnabled && boundsSelection.showing &&\n <div className=\"bounds-selection\"\n style={boundsSelection.style}\n />\n }\n </div>\n );\n}\n\nGraphBody.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n webgl: PropTypes.bool,\n checkIntersection: PropTypes.bool,\n bodyHeight: PropTypes.number,\n boundsSelectionEnabled: PropTypes.bool.isRequired,\n showTooltips: PropTypes.bool.isRequired,\n tooltipOptions: CustomPropTypes.TooltipOptions,\n verticalLines: CustomPropTypes.VerticalLines,\n draggablePoints: CustomPropTypes.DraggablePoints,\n onPointDrag: PropTypes.func,\n onDraggablePointsDoubleClick: PropTypes.func,\n onPointClick: PropTypes.func,\n clockStyle: PropTypes.oneOf(['12h', '24h']),\n timeZone: PropTypes.string\n};","\n import API from \"!../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../node_modules/css-loader/dist/cjs.js!../node_modules/sass-loader/dist/cjs.js!./grapher.scss\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../node_modules/css-loader/dist/cjs.js!../node_modules/sass-loader/dist/cjs.js!./grapher.scss\";\n export default content && content.locals ? content.locals : undefined;\n","import {startOfDayInTimezone} from './format';\n\nfunction placeTick(trueValue, {scale, min, max, inverted, totalSize, precision, formatter, dates, justTime, justDate, formatOptions={} }, opts={}) {\n let scaledValue = trueValue;\n\n if (scale === 'log') {\n scaledValue = 10**trueValue;\n }\n\n let percent = (trueValue - min)/(max - min);\n if (inverted) {\n percent = 1.0 - percent;\n }\n\n let pixelValue = percent * totalSize;\n if (isNaN(pixelValue)) {\n pixelValue = 0;\n }\n\n return {\n pixelValue,\n trueValue: scaledValue,\n label: formatter(scaledValue, { ...formatOptions, precision, log: scale === 'log', dates, justTime, justDate }),\n size: 'major',\n ...opts\n };\n}\n\nfunction placeTickByPixel(pixelValue, {scale, min, max, inverted, totalSize, precision, formatter, dates, justTime, justDate, formatOptions={} }, opts={}) {\n let percent = pixelValue/totalSize;\n if (inverted) {\n percent = 1.0 - percent;\n }\n\n let trueValue = percent * (max - min) + min;\n\n if (scale === 'log') {\n trueValue = Math.pow(10, trueValue);\n }\n\n return {\n pixelValue,\n trueValue,\n label: formatter(trueValue, { ...formatOptions, precision, log: scale === 'log', dates, justTime, justDate }),\n size: 'major',\n ...opts\n };\n}\n\nfunction roundToEvenNumber(value, tickSpacing) {\n return Math.round(value/tickSpacing)*tickSpacing;\n}\n\nfunction getEvenTickSpacing(span, desiredCount) {\n const subspan = span/desiredCount;\n\n const precision = -Math.log10(Math.abs(subspan)) + 1;\n const multiplier = (precision - Math.floor(precision)) > 0.5 ? 2 : 1;\n\n const roundTo = 10**Math.floor(precision) * multiplier;\n\n return Math.round(subspan * roundTo)/roundTo;\n}\n\nfunction roundToDivisor(value, divisor) {\n if (value <= 1) {\n return 1;\n }\n\n if (divisor === 1) {\n return Math.round(value);\n }\n\n if (value >= divisor) {\n return Math.round(value/divisor)*divisor;\n }\n\n let divisors;\n if (divisor === 24) {\n divisors = [1, 2, 6, 12, 24];\n } else if (divisor === 60) {\n divisors = [1, 2, 5, 10, 15, 30, 60];\n } else {\n throw new Error('Invalid divisor');\n }\n\n let bestDelta = Infinity;\n let bestDivisor = 1;\n for (let i = 0; i < divisors.length; i++) {\n const delta = Math.abs(divisors[i] - value);\n if (delta < bestDelta) {\n bestDivisor = divisors[i];\n bestDelta = delta;\n }\n }\n\n return bestDivisor;\n}\n\nfunction getEvenDateTickSpacing(span, desiredCount, unitOverride) {\n const subspan = span / desiredCount;\n\n if (subspan < 60*1000 && (!unitOverride || unitOverride === 'second')) {\n return {\n amount: roundToDivisor(subspan/1000, 60),\n unit: 's'\n };\n }\n\n if (subspan < 60*60*1000 && (!unitOverride || unitOverride === 'minute')) {\n return {\n amount: roundToDivisor(subspan/(60*1000), 60),\n unit: 'm'\n };\n }\n\n if (subspan < 24*60*60*1000 && (!unitOverride || unitOverride === 'hour')) {\n return {\n amount: roundToDivisor(subspan/(60*60*1000), 24),\n unit: 'h'\n };\n }\n\n if (unitOverride === 'day' || (subspan < 30*24*60*60*1000 && !unitOverride)) {\n return {\n amount: roundToDivisor(subspan/(24*60*60*1000), 1),\n unit: 'd'\n };\n }\n\n if (subspan > 30*24*60*60*1000 && (!unitOverride || unitOverride === 'month')) {\n return {\n amount: roundToDivisor(subspan/30*24*60*60*1000, 1),\n unit: 'month'\n };\n }\n\n if (unitOverride === 'year') {\n return {\n amount: roundToDivisor(subspan/365*24*60*60*1000, 1),\n unit: 'year'\n };\n }\n\n return {\n unit: 'm',\n amount: 60\n };\n}\n\nfunction placeNumbersGrid({ min, max, precision, expectedLabelSize, labelPadding, totalSize, scale='linear', formatter, inverted=false, formatOptions }) {\n const paddedLabelSize = expectedLabelSize + 2*labelPadding;\n\n const ticks = [];\n const placementParams = {scale, min, max, inverted, totalSize, precision, formatter, formatOptions, dates: false };\n\n const labelCount = Math.floor((totalSize - expectedLabelSize*2)/paddedLabelSize);\n const tickSpacing = getEvenTickSpacing(max - min, labelCount);\n if (tickSpacing > 0) {\n for (let value = roundToEvenNumber(min, tickSpacing); value < max; value += tickSpacing) {\n ticks.push(placeTick(value, placementParams));\n }\n }\n\n if (ticks.length) {\n if (inverted && ticks[ticks.length - 1].pixelValue > labelPadding) {\n ticks.push(placeTickByPixel(expectedLabelSize / 2, placementParams));\n }\n }\n\n return ticks.filter(({ pixelValue }) => pixelValue <= totalSize && pixelValue >= 0);\n}\n\nfunction placeDatesGrid({ min, max, precision, expectedLabelSize, labelPadding, totalSize, skipFirst=false, skipLast=false, scale='linear', formatter, inverted=false, formatOptions }) {\n const paddedLabelSize = expectedLabelSize + 2*labelPadding;\n\n const ticks = [];\n const placementParams = {scale, min, max, inverted, totalSize, precision, formatter, formatOptions, dates: true };\n\n const { amount, unit } = getEvenDateTickSpacing(max - min, totalSize/paddedLabelSize, formatOptions.unitOverride);\n\n const justDate = unit === 'month';\n\n if (!skipFirst) {\n ticks.push(placeTickByPixel(0, {...placementParams, justDate}, {position: 'first'}));\n }\n\n let currentDate = new Date(min);\n\n if (unit === 'h') {\n currentDate.setMinutes(0, 0, 0);\n } else if (unit === 'm') {\n currentDate.setSeconds(0, 0);\n } else if (unit === 's') {\n currentDate.setMilliseconds(0);\n } else if (unit === 'month') {\n currentDate = startOfDayInTimezone(currentDate, formatOptions.timeZone);\n currentDate.setDate(1);\n } else if (unit === 'd') {\n currentDate = startOfDayInTimezone(currentDate, formatOptions.timeZone);\n }\n\n let lastDateString = formatter(currentDate, {...formatOptions, ...placementParams, justDate: true });\n while (currentDate < max) {\n let delta = 24*60*60*1000;\n\n if (unit === 'h') {\n delta = (amount - currentDate.getHours() % amount)*60*60*1000;\n } else if (unit === 'm') {\n delta = (amount - currentDate.getMinutes() % amount)*60*1000;\n } else if (unit === 's') {\n delta = (amount - currentDate.getSeconds() % amount)*1000;\n } else if (unit === 'month') {\n delta = 0;\n if (currentDate.getMonth() === 11) {\n currentDate = new Date(currentDate.getFullYear() + 1, 0, 1);\n } else {\n currentDate = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 1);\n }\n } else if (unit === 'year') {\n currentDate = new Date(currentDate.getFullYear() + 1, 0, 0);\n }\n\n currentDate = new Date(currentDate.valueOf() + delta);\n\n const justTime = formatter(currentDate, {...formatOptions, ...placementParams, justDate: true }) === lastDateString;\n\n const tick = placeTick(currentDate, {...placementParams, justTime, justDate});\n\n if (ticks.length && (tick.pixelValue - ticks[ticks.length - 1].pixelValue) < (expectedLabelSize + (labelPadding || 0))) {\n continue;\n }\n\n if (tick.pixelValue + expectedLabelSize/2 >= totalSize) {\n continue;\n }\n\n ticks.push(tick);\n lastDateString = formatter(currentDate, {...formatOptions, ...placementParams, justDate: true });\n }\n\n const justTime = lastDateString === formatter(max, {...formatOptions, ...placementParams, justDate: true });\n\n if (!skipLast && ticks[ticks.length - 1].pixelValue + expectedLabelSize < totalSize) {\n ticks.push(placeTickByPixel(totalSize, {...placementParams, justTime, justDate}, {position: 'last'}));\n }\n\n return ticks.filter(({ pixelValue }) => pixelValue <= totalSize && pixelValue >= 0);\n}\n\nfunction placeTimeOnlyGrid({ min, max, precision, expectedLabelSize, labelPadding, totalSize, skipFirst=false, skipLast=false, scale='linear', formatter, inverted=false, formatOptions={} }) {\n const paddedLabelSize = expectedLabelSize + 2*labelPadding;\n const ticks = [];\n const placementParams = { scale, min, max, inverted, totalSize, precision, formatter, formatOptions, dates: true };\n\n const desiredCount = Math.floor(totalSize/paddedLabelSize);\n const span = max - min;\n \n let unit, amount;\n \n const hourSpan = span / (60 * 60 * 1000);\n const minuteSpan = span / (60 * 1000);\n \n if (hourSpan <= desiredCount * 8) {\n unit = 'h';\n amount = Math.max(1, Math.ceil(hourSpan / desiredCount));\n if (amount <= 6) {\n } else if (amount <= 12) {\n amount = 12;\n } else if (amount <= 24) {\n amount = 24;\n } else {\n amount = Math.ceil(amount / 24) * 24;\n }\n } else {\n unit = 'h';\n amount = 24;\n }\n \n if (!skipFirst) {\n ticks.push(placeTickByPixel(0, {...placementParams, justTime: true}, {position: 'first'}));\n }\n \n let currentDate = new Date(min);\n \n if (unit === 'h') {\n currentDate.setMinutes(0, 0, 0);\n if (amount === 24) {\n currentDate.setHours(0);\n } else if (amount === 12) {\n const currentHour = currentDate.getHours();\n const alignedHour = currentHour < 12 ? 0 : 12;\n currentDate.setHours(alignedHour);\n } else {\n const currentHour = currentDate.getHours();\n const alignedHour = Math.floor(currentHour / amount) * amount;\n currentDate.setHours(alignedHour);\n }\n } else if (unit === 'm') {\n currentDate.setSeconds(0, 0);\n const currentMinute = currentDate.getMinutes();\n const alignedMinute = Math.floor(currentMinute / amount) * amount;\n currentDate.setMinutes(alignedMinute);\n } else if (unit === 's') {\n currentDate.setMilliseconds(0);\n const currentSecond = currentDate.getSeconds();\n const alignedSecond = Math.floor(currentSecond / amount) * amount;\n currentDate.setSeconds(alignedSecond);\n }\n \n while (currentDate < min) {\n if (unit === 'h') {\n currentDate = new Date(currentDate.valueOf() + amount * 60 * 60 * 1000);\n } else if (unit === 'm') {\n currentDate = new Date(currentDate.valueOf() + amount * 60 * 1000);\n } else if (unit === 's') {\n currentDate = new Date(currentDate.valueOf() + amount * 1000);\n }\n }\n \n while (currentDate < max) {\n const tick = placeTick(currentDate, {...placementParams, justTime: true});\n \n const reservedSpaceForLast = expectedLabelSize + labelPadding;\n const maxPixelForMiddleTicks = totalSize - reservedSpaceForLast;\n \n if (ticks.length && (tick.pixelValue - ticks[ticks.length - 1].pixelValue) < (expectedLabelSize + labelPadding)) {\n } else if (tick.pixelValue + expectedLabelSize < maxPixelForMiddleTicks) {\n ticks.push(tick);\n } else {\n break;\n }\n \n if (unit === 'h') {\n currentDate = new Date(currentDate.valueOf() + amount * 60 * 60 * 1000);\n } else if (unit === 'm') {\n currentDate = new Date(currentDate.valueOf() + amount * 60 * 1000);\n } else if (unit === 's') {\n currentDate = new Date(currentDate.valueOf() + amount * 1000);\n } else {\n break;\n }\n }\n \n if (!skipLast) {\n const lastTick = placeTick(max, {...placementParams, justTime: true}, {position: 'last'});\n if (ticks.length === 0 || (lastTick.pixelValue - ticks[ticks.length - 1].pixelValue) >= (expectedLabelSize + labelPadding/2)) {\n ticks.push(lastTick);\n } else {\n ticks[ticks.length - 1] = lastTick;\n }\n }\n \n return ticks.filter(({ pixelValue }) => pixelValue <= totalSize && pixelValue >= 0);\n}\n\nfunction placeDateOnlyGrid({ min, max, precision, expectedLabelSize, labelPadding, totalSize, skipFirst=false, skipLast=false, scale='linear', formatter, inverted=false, formatOptions={} }) {\n const paddedLabelSize = expectedLabelSize + 2*labelPadding;\n const ticks = [];\n \n const minYear = new Date(min).getFullYear();\n const maxYear = new Date(max).getFullYear();\n const spanMultipleYears = minYear !== maxYear;\n\n const customDateFormatter = (date, options) => {\n const monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n const d = new Date(date);\n const month = monthNames[d.getMonth()];\n const day = d.getDate();\n const year = d.getFullYear();\n \n if (spanMultipleYears) {\n return `${month} ${day} ${year}`;\n } else {\n return `${month} ${day}`;\n }\n };\n \n const placementParams = { scale, min, max, inverted, totalSize, precision, formatter: customDateFormatter, formatOptions, dates: true };\n \n const span = max - min;\n const hourSpan = span / (60 * 60 * 1000);\n \n let { amount, unit } = getEvenDateTickSpacing(span, totalSize/paddedLabelSize, formatOptions.unitOverride);\n \n if ((unit === 'h' || unit === 'm' || unit === 's') && hourSpan >= 48) {\n unit = 'd';\n amount = Math.max(1, Math.ceil(hourSpan / 24 / Math.floor(totalSize/paddedLabelSize)));\n } else if ((unit === 'h' || unit === 'm' || unit === 's') && hourSpan < 48) {\n const startTick = placeTick(min, {...placementParams, justDate: true}, {position: 'first'});\n const endTick = placeTick(max, {...placementParams, justDate: true}, {position: 'last'});\n \n const ticks = [startTick];\n if ((endTick.pixelValue - startTick.pixelValue) >= (expectedLabelSize + labelPadding)) {\n ticks.push(endTick);\n }\n \n return ticks.filter(({ pixelValue }) => pixelValue <= totalSize && pixelValue >= 0);\n }\n \n if (!skipFirst) {\n ticks.push(placeTickByPixel(0, {...placementParams, justDate: true}, {position: 'first'}));\n }\n \n let currentDate = new Date(min);\n \n if (unit === 'month') {\n currentDate = startOfDayInTimezone(currentDate, formatOptions.timeZone);\n currentDate.setDate(1);\n } else if (unit === 'd') {\n currentDate = startOfDayInTimezone(currentDate, formatOptions.timeZone);\n currentDate.setHours(0, 0, 0, 0);\n }\n \n while (currentDate < max) {\n let delta = 24*60*60*1000;\n \n if (unit === 'month') {\n delta = 0;\n if (currentDate.getMonth() === 11) {\n currentDate = new Date(currentDate.getFullYear() + 1, 0, 1);\n } else {\n currentDate = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 1);\n }\n } else if (unit === 'year') {\n currentDate = new Date(currentDate.getFullYear() + 1, 0, 1);\n delta = 0;\n } else if (unit === 'd') {\n delta = amount * 24 * 60 * 60 * 1000;\n }\n \n if (delta > 0) {\n currentDate = new Date(currentDate.valueOf() + delta);\n }\n \n const tick = placeTick(currentDate, {...placementParams, justDate: true});\n \n const reservedSpaceForLast = expectedLabelSize + labelPadding;\n const maxPixelForMiddleTicks = totalSize - reservedSpaceForLast;\n \n if (ticks.length && (tick.pixelValue - ticks[ticks.length - 1].pixelValue) < (expectedLabelSize + (labelPadding || 0))) {\n continue;\n }\n \n if (tick.pixelValue + expectedLabelSize < maxPixelForMiddleTicks) {\n ticks.push(tick);\n } else {\n break;\n }\n }\n \n if (!skipLast) {\n const lastTick = placeTick(max, {...placementParams, justDate: true}, {position: 'last'});\n if (ticks.length === 0 || (lastTick.pixelValue - ticks[ticks.length - 1].pixelValue) >= (expectedLabelSize + labelPadding/2)) {\n ticks.push(lastTick);\n } else {\n ticks[ticks.length - 1] = lastTick;\n }\n }\n\n if (ticks.length === 0 && hourSpan >= 48) {\n ticks.push(placeTickByPixel(0, {...placementParams, justDate: true}, {position: 'first'}));\n }\n \n return ticks.filter(({ pixelValue }) => pixelValue <= totalSize && pixelValue >= 0);\n}\n\nexport { placeTimeOnlyGrid, placeDateOnlyGrid };\n\nexport default function placeGrid(opts) {\n if (opts.dates) {\n return placeDatesGrid(opts);\n } else {\n return placeNumbersGrid(opts);\n }\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport {calculatePrecision, calculateTimePrecision, formatX} from '../helpers/format';\nimport placeGrid, { placeTimeOnlyGrid, placeDateOnlyGrid } from '../helpers/place_grid';\nimport {useEnumMap, useHasXEnum, usePrimarySize, useSelection} from '../state/hooks';\nimport StateController from '../state/state_controller';\n\nexport default React.memo(XAxis);\n\nfunction XAxis({ showAxes, showGrid, stateController, bigLabels, xTickUnit, clockStyle, timeZone, integersOnly, formatXAxisLabel }) {\n if (!showAxes && !showGrid) {\n return null;\n }\n\n const { elementWidth, elementHeight } = usePrimarySize(stateController);\n const {minX, maxX, dates} = useSelection(stateController);\n const hasXEnum = useHasXEnum(stateController);\n const enumMap = useEnumMap(stateController);\n\n let precision;\n if (dates) {\n precision = calculateTimePrecision(minX, maxX);\n } else {\n precision = calculatePrecision(maxX - minX);\n }\n\n let inverseEnumMap = null;\n if (hasXEnum) {\n inverseEnumMap = {};\n for (const [key, value] of Object.entries(enumMap)) {\n inverseEnumMap[value] = key;\n }\n }\n\n const formatOptions = {\n unitOverride: xTickUnit,\n clockStyle,\n timeZone,\n integersOnly,\n inverseEnumMap,\n formatter: formatXAxisLabel\n };\n\n const minLabel = formatX(minX, {...formatOptions, dates, precision }).toString();\n const maxLabel = formatX(maxX, {...formatOptions, dates, precision }).toString();\n\n let expectedLabelWidth = Math.max(minLabel.length, maxLabel.length);\n if (bigLabels) {\n expectedLabelWidth *= 2;\n }\n\n const labelPadding = 30;\n\n let timeTicks = null;\n let dateTicks = null;\n let regularTicks = null;\n \n if (dates) {\n timeTicks = placeTimeOnlyGrid({\n min: minX,\n max: maxX,\n totalSize: elementWidth,\n precision,\n expectedLabelSize: expectedLabelWidth,\n labelPadding: labelPadding * 0.8,\n formatter: formatXAxisLabel || formatX,\n formatOptions\n });\n \n dateTicks = placeDateOnlyGrid({\n min: minX,\n max: maxX,\n totalSize: elementWidth,\n precision,\n expectedLabelSize: expectedLabelWidth * 2,\n labelPadding: labelPadding * 1.5,\n formatter: formatXAxisLabel || formatX,\n formatOptions\n });\n } else {\n regularTicks = placeGrid({\n min: minX,\n max: maxX,\n totalSize: elementWidth,\n precision,\n dates,\n formatter: formatXAxisLabel || formatX,\n expectedLabelSize: expectedLabelWidth,\n labelPadding,\n formatOptions\n });\n }\n\n const xAxisHeight = dates ? 30 : 20;\n\n return (\n <svg className={`axis x-axis${dates ? ' x-axis-dual' : ''}`} style={showAxes ? undefined : {marginBottom: -20}}>\n {\n showAxes &&\n <path d={`M-1,0 H${elementWidth}`} className=\"axis-line\" />\n }\n\n {/* Render time ticks in first row */}\n {\n dates && timeTicks && timeTicks.map(({ pixelValue, label, size, position, skipGrid }, i) => {\n\n const singleTick = timeTicks.length === 1;\n \n if (isNaN(pixelValue)) {\n return null;\n }\n\n const classes = ['axis-item', `axis-item-${size}`, `axis-item-${position}`];\n if (bigLabels) {\n classes.push('axis-item-big-labels');\n }\n \n return (\n <g key={`time-${i}`} className={classes.join(' ')}>\n {\n showAxes &&\n <path d={`M${pixelValue},1 v12`} className=\"axis-tick\" />\n }\n\n {\n showGrid && !skipGrid &&\n <path d={`M${pixelValue},0 v-${elementHeight}`} />\n }\n\n {\n showAxes &&\n <text \n x={(position === 'last' && !singleTick) ? pixelValue - 3 : pixelValue + 3} \n y={12} \n textAnchor={(position === 'last' && !singleTick) ? 'end' : 'start'}\n className='x-axis-text x-axis-time-text'\n >\n {label}\n </text>\n }\n </g>\n );\n })\n }\n \n {/* Render date ticks in second row */}\n {\n dates && dateTicks && dateTicks.map(({ pixelValue, label, size, position, trueValue }, i) => {\n \n if (isNaN(pixelValue)) {\n return null;\n }\n\n const classes = ['axis-item', `axis-item-${size}`, `axis-item-${position}`];\n if (bigLabels) {\n classes.push('axis-item-big-labels');\n }\n\n let timezoneLabel = undefined;\n if (timeZone) {\n if (i === 0) {\n timezoneLabel = timeZone.toLowerCase() === 'utc' ? 'UTC' : timeZone;\n }\n }\n\n return (\n <g key={`date-${i}`} className={classes.join(' ')}>\n {\n showAxes &&\n <text \n x={position === 'last' ? pixelValue - 3 : pixelValue + 3} \n y={25} \n textAnchor={position === 'last' ? 'end' : 'start'}\n className='x-axis-text x-axis-date-text'\n >\n <tspan className='x-axis-date-label'>\n {label}\n </tspan>\n {timezoneLabel && (\n <tspan className='x-axis-timezone-label'>\n {' '}({timezoneLabel})\n </tspan>\n )}\n </text>\n }\n </g>\n );\n })\n }\n \n {/* Render regular ticks for non-date data */}\n {\n !dates && regularTicks && regularTicks.map(({ pixelValue, label, size, position, skipGrid }, i) => {\n if (isNaN(pixelValue)) {\n return null;\n }\n\n const classes = ['axis-item', `axis-item-${size}`, `axis-item-${position}`];\n if (bigLabels) {\n classes.push('axis-item-big-labels');\n }\n\n return (\n <g key={i} className={classes.join(' ')}>\n {\n showAxes &&\n <path d={`M${pixelValue},1 v12`} className=\"axis-tick\" />\n }\n\n {\n showGrid && !skipGrid &&\n <path d={`M${pixelValue},0 v-${elementHeight}`} />\n }\n\n {\n showAxes &&\n <text \n x={position === 'last' ? pixelValue - 3 : pixelValue + 3} \n y={xAxisHeight - 5} \n textAnchor={position === 'last' ? 'end' : 'start'}\n className='x-axis-text'\n >\n {label}\n </text>\n }\n </g>\n );\n })\n }\n </svg>\n );\n}\n\nXAxis.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n showAxes: PropTypes.bool.isRequired,\n showGrid: PropTypes.bool.isRequired,\n bigLabels: PropTypes.bool,\n xTickUnit: PropTypes.oneOf(['year']),\n clockStyle: PropTypes.oneOf(['12h', '24h']),\n timeZone: PropTypes.string,\n integersOnly: PropTypes.bool,\n formatXAxisLabel: PropTypes.func\n};\n","import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport {calculatePrecision, formatY} from '../helpers/format';\nimport {Y_AXIS_WIDTH, BIG_Y_AXIS_LABEL_OFFSET} from '../helpers/axis_sizes';\nimport scaleBounds from '../renderer/scale_bounds';\nimport getColor from '../helpers/colors';\nimport placeGrid from '../helpers/place_grid';\nimport {useAxes, useAxisBounds, useHighlightedSeries, usePrimarySize} from '../state/hooks';\nimport StateController from '../state/state_controller';\nimport CustomPropTypes from '../helpers/custom_prop_types';\n\nexport default React.memo(YAxis);\n\nfunction YAxis({ stateController, showAxes, showGrid, showSeriesKey, axis, sideIndex, bodyHeight, theme, grapherID, dragPositionYOffset=0, bigLabels, showAxisColors }) {\n if (!showAxes && !showGrid) {\n return null;\n }\n\n const { side, scale, axisIndex, label } = useAxes(stateController)[axis.axisIndex];\n\n const { elementWidth, elementHeight } = usePrimarySize(stateController);\n let { minY, maxY } = useAxisBounds(stateController)[axisIndex];\n\n const scaledBounds = scaleBounds({ minY, maxY, scale});\n minY = scaledBounds.minY;\n maxY = scaledBounds.maxY;\n\n const ticks = placeGrid({\n min: minY,\n max: maxY,\n totalSize: elementHeight,\n scale,\n precision: calculatePrecision(maxY - minY),\n formatter: formatY,\n inverted: true,\n expectedLabelSize: bigLabels ? 20 : 10,\n labelPadding: 30\n });\n\n const colorBoxSize = 10;\n const colorBoxPadding = 4;\n\n let sidePadding = 5;\n\n if (scale === 'log') {\n sidePadding = 2;\n }\n\n const highlightedSeries = useHighlightedSeries(stateController);\n\n const [draggedSeries, setDraggedSeries] = useState(null);\n const [dragDelta, setDragDelta] = useState({ dx: 0, dy: 0 });\n\n const startDrag = (event, singleSeries) => {\n let startX = event.clientX;\n let startY = event.clientY;\n\n if (side === 'left') {\n startX += Y_AXIS_WIDTH;\n }\n\n if (side === 'right') {\n startX -= Y_AXIS_WIDTH;\n }\n\n setDragDelta({\n dx: 0,\n dy: 0\n });\n\n const onMouseMove = (moveEvent) => {\n setDragDelta({\n dx: moveEvent.clientX - startX,\n dy: moveEvent.clientY - startY\n });\n };\n\n const onMouseUp = (mouseUpEvent) => {\n window.removeEventListener('mousemove', onMouseMove);\n window.removeEventListener('mouseup', onMouseUp);\n\n let target = mouseUpEvent.target;\n while (target && !(target.dataset || {}).axisIndex) {\n target = target.parentNode;\n }\n\n setDraggedSeries(null);\n stateController.finalizeDrag(singleSeries, target && (target.dataset || {}).axisIndex, target && (target.dataset || {}).grapherId);\n };\n\n window.addEventListener('mousemove', onMouseMove);\n window.addEventListener('mouseup', onMouseUp);\n\n setDraggedSeries(singleSeries);\n stateController.markDragStart();\n };\n\n const highlightedOpacity = theme === 'day' ? 1.0 : 0.5;\n const unhighlightedOpacity = theme === 'day' ? 0.8 : 0.3;\n\n return (\n <svg className={`axis y-axis y-axis-${side}`}\n data-axis-index={axisIndex}\n data-grapher-id={grapherID}\n style={{\n width: Y_AXIS_WIDTH,\n marginLeft: showAxes ? undefined : -Y_AXIS_WIDTH,\n height: typeof bodyHeight === 'number' ? bodyHeight : undefined\n }}\n >\n {\n showAxes &&\n showAxisColors &&\n axis.series.map((singleSeries, i) => {\n const height = elementHeight/axis.series.length;\n\n return (\n <rect\n x={side === 'left' ? 0 : 2}\n y={i*height}\n width={Y_AXIS_WIDTH - 2}\n height={height}\n key={singleSeries.index}\n fill={getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex)}\n opacity={singleSeries.index === highlightedSeries ? highlightedOpacity : unhighlightedOpacity}\n data-element-height={elementHeight}\n data-series-length={axis.series.length}\n />\n );\n })\n }\n\n {\n showAxes &&\n <path d={`M${side === 'left' ? Y_AXIS_WIDTH-1 : 1},3 V${elementHeight}`} className=\"axis-line\" />\n }\n\n {\n ticks.map(({ pixelValue, label, size, skipGrid }, i) => {\n const edge = side === 'left' ? (sideIndex + 1) * Y_AXIS_WIDTH : -sideIndex*Y_AXIS_WIDTH;\n const length = (side === 'left' ? 1 : - 1) * (elementWidth+1);\n\n const classes = ['axis-item', `axis-item-${size}`];\n if (bigLabels) {\n classes.push('axis-item-big-labels');\n }\n\n return (\n <g key={i} className={classes.join(' ')}>\n {\n showGrid &&\n !skipGrid &&\n <path d={`M${edge},${pixelValue} h${length}`} />\n }\n\n {\n showGrid &&\n !skipGrid &&\n sideIndex > 0 &&\n <path\n d={`M${side === 'left' ? Y_AXIS_WIDTH : 0},${pixelValue} h${(side === 'left' ? 1 : -1) * sideIndex * Y_AXIS_WIDTH}`}\n strokeDasharray={'2,2'}\n />\n }\n\n {\n showAxes &&\n <text x={side === 'left' ? Y_AXIS_WIDTH-sidePadding : sidePadding} y={pixelValue}>\n {label}\n </text>\n }\n </g>\n );\n })\n }\n\n {\n showSeriesKey && showAxes &&\n axis.series.map((singleSeries, i) => {\n\n let x = (Y_AXIS_WIDTH - colorBoxSize - colorBoxPadding) + (i % 2 - 1)*(colorBoxSize + colorBoxPadding);\n let y = -(colorBoxPadding + colorBoxSize) * Math.ceil(axis.series.length / 2) + (colorBoxSize + colorBoxPadding) * Math.floor(i / 2);\n\n if (singleSeries === draggedSeries) {\n x += dragDelta.dx;\n y += dragDelta.dy - dragPositionYOffset;\n }\n\n return (\n <rect\n className=\"series-color-box\"\n onMouseDown={(event) => startDrag(event, singleSeries)}\n x={x}\n y={y}\n width={colorBoxSize}\n height={colorBoxSize}\n key={singleSeries.index}\n fill={getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex)}\n onMouseOver={() => stateController.setHighlightedSeries(singleSeries.index)}\n onMouseOut={() => stateController.setHighlightedSeries(null)}\n />\n );\n })\n }\n\n {\n showAxes && !!label &&\n <text\n className={`y-axis-label${bigLabels ? ' y-axis-big-label' : ''}`}\n x={side === 'left' ? 10 : Y_AXIS_WIDTH - 10}\n y={elementHeight/2 + (side === 'left' ? -1 : 1)*(axisIndex + 1)*(bigLabels ? BIG_Y_AXIS_LABEL_OFFSET : 0)}\n transform={`rotate(${side === 'left' ? -90 : 90}, ${side === 'left' ? 10 : Y_AXIS_WIDTH - 10}, ${elementHeight/2})`}\n >\n {label}\n </text>\n }\n </svg>\n );\n}\n\nYAxis.propTypes = {\n stateController: PropTypes.instanceOf(StateController),\n showAxes: PropTypes.bool.isRequired,\n showGrid: PropTypes.bool.isRequired,\n showAxisColors: PropTypes.bool.isRequired,\n showSeriesKey: PropTypes.bool.isRequired,\n axis: CustomPropTypes.Axis.isRequired,\n sideIndex: PropTypes.number.isRequired,\n bodyHeight: PropTypes.number,\n theme: PropTypes.string,\n grapherID: PropTypes.string,\n dragPositionYOffset: PropTypes.number,\n bigLabels: PropTypes.bool\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nexport default React.memo(RangeSelectionButtonBase);\n\nfunction RangeSelectionButtonBase({ selected, disabled, className, onClick, children, description }) {\n const classes = [\n 'range-button'\n ];\n\n if (selected) {\n classes.push('range-button-selected');\n }\n\n if (disabled) {\n classes.push('range-button-disabled');\n }\n\n if (className) {\n classes.push(className);\n }\n\n if (description) {\n classes.push('option-tooltip');\n }\n\n return (\n <div\n className={classes.join(' ')}\n onClick={onClick && ((event) => disabled || onClick(event))}\n >\n {children}\n\n {\n description &&\n <div className=\"option-tooltip-text\">\n {description}\n </div>\n }\n </div>\n );\n}\n\nRangeSelectionButtonBase.propTypes = {\n selected: PropTypes.bool.isRequired,\n onClick: PropTypes.func,\n children: PropTypes.node.isRequired,\n disabled: PropTypes.bool,\n className: PropTypes.string,\n description: PropTypes.string\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport RangeSelectionButtonBase from './range_selection_button_base.jsx';\nimport StateController from '../state/state_controller';\n\nexport default React.memo(RangeSelectionButton);\n\nfunction RangeSelectionButton({ stateController, currentBoundCalculator, boundCalculator, children, disabled }) {\n return (\n <RangeSelectionButtonBase\n selected={currentBoundCalculator === boundCalculator}\n onClick={() => stateController.boundCalculator = boundCalculator}\n disabled={disabled}\n >\n {children}\n </RangeSelectionButtonBase>\n );\n}\n\nRangeSelectionButton.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n boundCalculator: PropTypes.func.isRequired,\n currentBoundCalculator: PropTypes.func.isRequired,\n children: PropTypes.node.isRequired,\n disabled: PropTypes.bool\n};\n","import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport RangeSelectionButtonBase from './range_selection_button_base.jsx';\nimport StateController from '../state/state_controller';\nimport {usePercentile, usePercentileAsymmetry} from '../state/hooks';\n\nexport default React.memo(PercentileButton);\n\nfunction PercentileButton({ stateController }) {\n const percentile = usePercentile(stateController);\n const percentileAsymmetry = usePercentileAsymmetry(stateController);\n const [showing, setShowing] = useState(false);\n\n return ([\n showing ? <RangeSelectionButtonBase\n key=\"asymmetry button\"\n className=\"percentile-button\"\n selected={true}\n description=\"Percentile asymmetry\"\n >\n <input\n onClick={(e) => e.stopPropagation()}\n value={percentileAsymmetry}\n onChange={(e) => stateController.percentileAsymmetry = e.target.value}\n onKeyUp={(e) => e.keyCode === 13 && setShowing(false)}\n type=\"number\"\n min={-50}\n max={50}\n />\n\n <div className=\"icon-container icon-container-square\">\n <svg focusable=\"false\" viewBox=\"0 0 512 512\">\n <path fill=\"currentColor\" d=\"M240 96h64a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16h-64a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16zm0 128h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16H240a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16zm256 192H240a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h256a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm-256-64h192a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16H240a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16zM16 160h48v304a16 16 0 0 0 16 16h32a16 16 0 0 0 16-16V160h48c14.21 0 21.39-17.24 11.31-27.31l-80-96a16 16 0 0 0-22.62 0l-80 96C-5.35 142.74 1.78 160 16 160z\" />\n </svg>\n </div>\n </RangeSelectionButtonBase>: null,\n\n <RangeSelectionButtonBase\n key=\"main-button\"\n className=\"percentile-button\"\n selected={showing || parseFloat(percentile) !== 100}\n onClick={() => setShowing(!showing)}\n description=\"Edit percentile\"\n >\n {\n showing &&\n <div>\n <input\n onClick={(e) => e.stopPropagation()}\n autoFocus={true}\n value={percentile}\n onChange={(e) => stateController.percentile = e.target.value}\n onKeyUp={(e) => e.keyCode === 13 && setShowing(false)}\n type=\"number\"\n min={0}\n max={100}\n />\n </div>\n }\n\n <div className=\"icon-container icon-container-narrow\">\n <svg focusable=\"false\" viewBox=\"0 0 448 512\">\n <path fill=\"currentColor\" d=\"M112 224c61.9 0 112-50.1 112-112S173.9 0 112 0 0 50.1 0 112s50.1 112 112 112zm0-160c26.5 0 48 21.5 48 48s-21.5 48-48 48-48-21.5-48-48 21.5-48 48-48zm224 224c-61.9 0-112 50.1-112 112s50.1 112 112 112 112-50.1 112-112-50.1-112-112-112zm0 160c-26.5 0-48-21.5-48-48s21.5-48 48-48 48 21.5 48 48-21.5 48-48 48zM392.3.2l31.6-.1c19.4-.1 30.9 21.8 19.7 37.8L77.4 501.6a23.95 23.95 0 0 1-19.6 10.2l-33.4.1c-19.5 0-30.9-21.9-19.7-37.8l368-463.7C377.2 4 384.5.2 392.3.2z\" />\n </svg>\n </div>\n </RangeSelectionButtonBase>\n ]);\n}\n\nPercentileButton.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired\n};\n","import React from 'react';\nimport PercentileButton from './percentile_button.jsx';\nimport RangeSelectionButtonBase from './range_selection_button_base.jsx';\nimport {\n useAutoscaleY,\n useMaxPrecision,\n useShowIndividualPoints, useShowingAnnotations,\n useShowingSidebar, useTheme\n} from '../state/hooks';\nimport PropTypes from 'prop-types';\nimport StateController from '../state/state_controller';\n\nexport default React.memo(Options);\n\nfunction Options({stateController, sidebarEnabled}) {\n\n const showIndividualPoints = useShowIndividualPoints(stateController);\n const autoscaleY = useAutoscaleY(stateController);\n const maxPrecision = useMaxPrecision(stateController);\n const showingSidebar = useShowingSidebar(stateController);\n const showingAnnotations = useShowingAnnotations(stateController);\n const theme = useTheme(stateController);\n\n return (\n <div className=\"options-bar\">\n {\n sidebarEnabled &&\n <RangeSelectionButtonBase\n selected={showingSidebar}\n onClick={() => stateController.toggleShowingSidebar()}\n description=\"Show sidebar\"\n >\n <div className=\"icon-container icon-container-square\">\n <svg focusable=\"false\" viewBox=\"0 0 512 512\">\n <path fill=\"currentColor\"\n d=\"M464 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V80c0-26.51-21.49-48-48-48zM224 416H64V160h160v256zm224 0H288V160h160v256z\"/>\n </svg>\n </div>\n </RangeSelectionButtonBase>\n }\n\n <RangeSelectionButtonBase\n selected={theme === 'export'}\n onClick={() => stateController.toggleExportMode()}\n description=\"Export mode\"\n >\n <div className=\"icon-container icon-container-square\">\n <svg focusable=\"false\" viewBox=\"0 0 512 512\">\n <path fill=\"currentColor\"\n d=\"M167.02 309.34c-40.12 2.58-76.53 17.86-97.19 72.3-2.35 6.21-8 9.98-14.59 9.98-11.11 0-45.46-27.67-55.25-34.35C0 439.62 37.93 512 128 512c75.86 0 128-43.77 128-120.19 0-3.11-.65-6.08-.97-9.13l-88.01-73.34zM457.89 0c-15.16 0-29.37 6.71-40.21 16.45C213.27 199.05 192 203.34 192 257.09c0 13.7 3.25 26.76 8.73 38.7l63.82 53.18c7.21 1.8 14.64 3.03 22.39 3.03 62.11 0 98.11-45.47 211.16-256.46 7.38-14.35 13.9-29.85 13.9-45.99C512 20.64 486 0 457.89 0z\" />\n </svg>\n </div>\n </RangeSelectionButtonBase>\n\n <RangeSelectionButtonBase\n selected={showingAnnotations}\n onClick={() => stateController.toggleShowingAnnotations()}\n description=\"Show annotations\"\n >\n <div className=\"icon-container icon-container-448\">\n <svg focusable=\"false\" viewBox=\"0 0 448 512\">\n <path fill=\"currentColor\" d=\"M432 416h-23.41L277.88 53.69A32 32 0 0 0 247.58 32h-47.16a32 32 0 0 0-30.3 21.69L39.41 416H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16h-19.58l23.3-64h152.56l23.3 64H304a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM176.85 272L224 142.51 271.15 272z\" />\n </svg>\n </div>\n </RangeSelectionButtonBase>\n\n <PercentileButton stateController={stateController} />\n\n <RangeSelectionButtonBase\n selected={maxPrecision}\n onClick={() => stateController.toggleMaxPrecision()}\n description=\"Max precision\"\n >\n <div className=\"icon-container icon-container-square\">\n <svg focusable=\"false\" viewBox=\"0 0 512 512\">\n <path fill=\"currentColor\" d=\"M478.21 334.093L336 256l142.21-78.093c11.795-6.477 15.961-21.384 9.232-33.037l-19.48-33.741c-6.728-11.653-21.72-15.499-33.227-8.523L296 186.718l3.475-162.204C299.763 11.061 288.937 0 275.48 0h-38.96c-13.456 0-24.283 11.061-23.994 24.514L216 186.718 77.265 102.607c-11.506-6.976-26.499-3.13-33.227 8.523l-19.48 33.741c-6.728 11.653-2.562 26.56 9.233 33.037L176 256 33.79 334.093c-11.795 6.477-15.961 21.384-9.232 33.037l19.48 33.741c6.728 11.653 21.721 15.499 33.227 8.523L216 325.282l-3.475 162.204C212.237 500.939 223.064 512 236.52 512h38.961c13.456 0 24.283-11.061 23.995-24.514L296 325.282l138.735 84.111c11.506 6.976 26.499 3.13 33.227-8.523l19.48-33.741c6.728-11.653 2.563-26.559-9.232-33.036z\" />\n </svg>\n </div>\n </RangeSelectionButtonBase>\n\n <RangeSelectionButtonBase\n selected={autoscaleY}\n onClick={() => stateController.toggleYAutoscaling()}\n description=\"Autoscale y axis\"\n >\n <div className=\"icon-container\">\n <svg focusable=\"false\" viewBox=\"0 0 256 512\">\n <path fill=\"currentColor\" d=\"M168 416c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88v-64h-88c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88v-64h-88c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88v-64h-88c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88V32c0-17.67-14.33-32-32-32H32C14.33 0 0 14.33 0 32v448c0 17.67 14.33 32 32 32h192c17.67 0 32-14.33 32-32v-64h-88z\"/>\n </svg>\n </div>\n </RangeSelectionButtonBase>\n\n <RangeSelectionButtonBase\n selected={showIndividualPoints}\n onClick={() => stateController.toggleIndividualPoints()}\n description=\"Show individual points\"\n >\n <div className=\"icon-container icon-container-narrow\">\n <svg focusable=\"false\" viewBox=\"0 0 192 512\">\n <path fill=\"currentColor\" d=\"M96 184c39.8 0 72 32.2 72 72s-32.2 72-72 72-72-32.2-72-72 32.2-72 72-72zM24 80c0 39.8 32.2 72 72 72s72-32.2 72-72S135.8 8 96 8 24 40.2 24 80zm0 352c0 39.8 32.2 72 72 72s72-32.2 72-72-32.2-72-72-72-72 32.2-72 72z\" />\n </svg>\n </div>\n </RangeSelectionButtonBase>\n </div>\n );\n}\n\nOptions.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n sidebarEnabled: PropTypes.bool\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport RangeSelectionButton from './range_selection_button.jsx';\nimport RangeSelectionButtonBase from './range_selection_button_base.jsx';\nimport {Y_AXIS_WIDTH} from '../helpers/axis_sizes';\nimport CustomPropTypes from '../helpers/custom_prop_types';\nimport StateController from '../state/state_controller';\nimport {\n useBoundCalculator, useBoundHistory,\n useGlobalBounds,\n useLeftAxisCount,\n useRightAxisCount,\n useShowingOptions\n} from '../state/hooks';\nimport BOUND_CALCULATORS from '../state/bound_calculators';\nimport Options from './options.jsx';\n\nexport default React.memo(RangeSelection);\n\nfunction RangeSelection({stateController, customBoundsSelectors, customBoundsSelectorsOnly, sidebarEnabled}) {\n const rightAxisCount = useRightAxisCount(stateController);\n const leftAxisCount = useLeftAxisCount(stateController);\n const showingOptions = useShowingOptions(stateController);\n\n let marginRight = Y_AXIS_WIDTH*rightAxisCount;\n if (rightAxisCount > 0) {\n marginRight += 5;\n }\n\n let marginLeft = Y_AXIS_WIDTH*leftAxisCount;\n if (leftAxisCount > 0) {\n marginLeft += 5;\n }\n\n const { dates } = useGlobalBounds(stateController);\n\n const currentBoundCalculator = useBoundCalculator(stateController);\n const { hasPreviousBounds, hasNextBounds } = useBoundHistory(stateController);\n\n const customBoundSelectorNames = new Set(customBoundsSelectors.map(({ label }) => label));\n\n return (\n <div className={`range-selection${dates ? '' : ' range-not-dates'}`} style={{ marginRight, marginLeft }}>\n <div className=\"range-buttons\">\n {\n showingOptions &&\n <Options\n stateController={stateController}\n sidebarEnabled={sidebarEnabled}\n />\n }\n\n <RangeSelectionButtonBase\n className=\"showing-options-button\"\n selected={showingOptions}\n onClick={() => stateController.toggleShowingOptions()}\n description=\"Show additional options\"\n >\n <div className=\"icon-container icon-container-square\">\n <svg focusable=\"false\" viewBox=\"0 0 512 512\">\n <path fill=\"currentColor\" d=\"M487.4 315.7l-42.6-24.6c4.3-23.2 4.3-47 0-70.2l42.6-24.6c4.9-2.8 7.1-8.6 5.5-14-11.1-35.6-30-67.8-54.7-94.6-3.8-4.1-10-5.1-14.8-2.3L380.8 110c-17.9-15.4-38.5-27.3-60.8-35.1V25.8c0-5.6-3.9-10.5-9.4-11.7-36.7-8.2-74.3-7.8-109.2 0-5.5 1.2-9.4 6.1-9.4 11.7V75c-22.2 7.9-42.8 19.8-60.8 35.1L88.7 85.5c-4.9-2.8-11-1.9-14.8 2.3-24.7 26.7-43.6 58.9-54.7 94.6-1.7 5.4.6 11.2 5.5 14L67.3 221c-4.3 23.2-4.3 47 0 70.2l-42.6 24.6c-4.9 2.8-7.1 8.6-5.5 14 11.1 35.6 30 67.8 54.7 94.6 3.8 4.1 10 5.1 14.8 2.3l42.6-24.6c17.9 15.4 38.5 27.3 60.8 35.1v49.2c0 5.6 3.9 10.5 9.4 11.7 36.7 8.2 74.3 7.8 109.2 0 5.5-1.2 9.4-6.1 9.4-11.7v-49.2c22.2-7.9 42.8-19.8 60.8-35.1l42.6 24.6c4.9 2.8 11 1.9 14.8-2.3 24.7-26.7 43.6-58.9 54.7-94.6 1.5-5.5-.7-11.3-5.6-14.1zM256 336c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80z\" />\n </svg>\n </div>\n </RangeSelectionButtonBase>\n \n <RangeSelectionButtonBase\n className=\"range-selection-history\"\n selected={false}\n onClick={() => stateController.previousBounds()}\n disabled={!hasPreviousBounds}\n >\n <div className=\"icon-container\">\n <svg focusable=\"false\" viewBox=\"0 0 256 512\">\n <path fill=\"currentColor\" d=\"M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z\" />\n </svg>\n </div>\n </RangeSelectionButtonBase>\n \n <RangeSelectionButtonBase\n className=\"range-selection-history\"\n selected={false}\n onClick={() => stateController.nextBounds()}\n disabled={!hasNextBounds}\n >\n <div className=\"icon-container\">\n <svg focusable=\"false\" viewBox=\"0 0 256 512\">\n <path fill=\"currentColor\" d=\"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z\"/>\n </svg>\n </div>\n </RangeSelectionButtonBase>\n\n {\n customBoundsSelectors.map(({label, calculator, datesOnly}, i) => {\n return (\n <RangeSelectionButton\n key={i}\n stateController={stateController}\n currentBoundCalculator={currentBoundCalculator}\n boundCalculator={calculator}\n disabled={datesOnly && !dates}\n >\n {label}\n </RangeSelectionButton>\n );\n })\n }\n\n {\n !customBoundSelectorNames.has('1m') && !customBoundsSelectorsOnly &&\n <RangeSelectionButton\n stateController={stateController}\n currentBoundCalculator={currentBoundCalculator}\n boundCalculator={BOUND_CALCULATORS.lastMinute}\n disabled={!dates}\n >\n 1m\n </RangeSelectionButton>\n }\n\n {\n !customBoundSelectorNames.has('10m') && !customBoundsSelectorsOnly &&\n <RangeSelectionButton\n stateController={stateController}\n currentBoundCalculator={currentBoundCalculator}\n boundCalculator={BOUND_CALCULATORS.last10Minutes}\n disabled={!dates}\n >\n 10m\n </RangeSelectionButton>\n }\n\n {\n !customBoundSelectorNames.has('1h') && !customBoundsSelectorsOnly &&\n <RangeSelectionButton\n stateController={stateController}\n currentBoundCalculator={currentBoundCalculator}\n boundCalculator={BOUND_CALCULATORS.lastHour}\n disabled={!dates}\n >\n 1h\n </RangeSelectionButton>\n }\n\n {\n !customBoundSelectorNames.has('1d') && !customBoundsSelectorsOnly &&\n <RangeSelectionButton\n stateController={stateController}\n currentBoundCalculator={currentBoundCalculator}\n boundCalculator={BOUND_CALCULATORS.lastDay}\n disabled={!dates}\n >\n 1d\n </RangeSelectionButton>\n }\n\n <RangeSelectionButton\n stateController={stateController}\n currentBoundCalculator={currentBoundCalculator}\n boundCalculator={BOUND_CALCULATORS.all}\n disabled={false}\n >\n All\n </RangeSelectionButton>\n </div>\n </div>\n );\n\n}\n\nRangeSelection.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n customBoundsSelectors: CustomPropTypes.CustomBoundsSelectors.isRequired,\n customBoundsSelectorsOnly: PropTypes.bool,\n sidebarEnabled: PropTypes.bool\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport GraphBodyRenderer from '../renderer/graph_body_renderer';\nimport StateController from '../state/state_controller';\nimport placeGrid from '../helpers/place_grid';\nimport {formatX} from '../helpers/format';\nimport VerticalLines from './vertical_lines.jsx';\nimport CustomPropTypes from '../helpers/custom_prop_types';\n\nexport default class RangeGraph extends React.PureComponent {\n\n constructor(props) {\n super(props);\n\n this.state = {\n elementWidth: 0,\n elementHeight: 0,\n selectionBounds: {\n minX: 0,\n maxX: 0\n },\n globalBounds: {\n minX: 0,\n maxX: 0\n }\n };\n\n this.onMouseMove = this.onMouseMove.bind(this);\n this.stopDragging = this.stopDragging.bind(this);\n this.startScroll = this.startScroll.bind(this);\n this.startLeftDrag = this.startLeftDrag.bind(this);\n this.startRightDrag = this.startRightDrag.bind(this);\n }\n\n getClientX(event) {\n if (event && event.touches && event.touches[0]) {\n return event.touches[0].clientX;\n }\n if (event && event.changedTouches && event.changedTouches[0]) {\n return event.changedTouches[0].clientX;\n }\n return event.clientX;\n }\n\n componentDidMount() {\n this._renderer = new GraphBodyRenderer({\n stateController: this.props.stateController,\n canvasElement: this.el,\n webgl: this.props.webgl,\n checkIntersection: this.props.checkIntersection\n });\n this.props.stateController.rangeGraphRenderer = this._renderer;\n\n this._renderer.on('size_changed', (sizing) => {\n this.setState(sizing);\n });\n\n this.setState({\n selectionBounds: this.props.stateController._selection,\n globalBounds: this.props.stateController._globalBounds\n });\n\n this.props.stateController.on('selection_changed', (selectionBounds) =>{\n this.setState({ selectionBounds });\n });\n\n this.props.stateController.on('global_bounds_changed', (globalBounds) =>{\n this.setState({ globalBounds: globalBounds });\n });\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.draggingY !== this.props.draggingY && this._renderer) {\n this._renderer.resize();\n }\n }\n\n componentWillUnmount() {\n if (this._renderer) {\n this._renderer.dispose();\n this._renderer = null;\n }\n }\n\n onMouseMove(event) {\n if (!this._dragType) {\n return;\n }\n\n // Prevent scrolling during touch-drag\n if (event && event.touches && event.preventDefault) {\n event.preventDefault();\n }\n\n let boundCalculator;\n const leftX = this.el.getBoundingClientRect().left;\n\n this.setState(({selectionBounds, globalBounds, elementWidth}) => {\n const pixelX = this.getClientX(event) - leftX;\n let percentage = pixelX/elementWidth;\n\n percentage = Math.max(percentage, 0);\n percentage = Math.min(percentage, 1);\n\n let trueX = percentage * (globalBounds.maxX - globalBounds.minX) + globalBounds.minX;\n\n if (this._dragType === 'scroll') {\n const range = selectionBounds.maxX - selectionBounds.minX;\n let minX = trueX - range*this._scrollAnchorPercentage;\n let maxX = trueX + range*(1-this._scrollAnchorPercentage);\n\n if (minX < globalBounds.minX) {\n minX = globalBounds.minX;\n maxX = minX + range;\n }\n\n if (maxX > globalBounds.maxX) {\n maxX = globalBounds.maxX;\n minX = maxX - range;\n }\n\n boundCalculator = () => {\n return {minX, maxX};\n };\n\n return {\n selectionBounds: Object.assign({}, selectionBounds, {\n minX, maxX\n })\n };\n } else if (this._dragType === 'left') {\n if (trueX > selectionBounds.maxX) {\n trueX = selectionBounds.maxX;\n }\n\n const boundToRight = globalBounds.maxX === selectionBounds.maxX;\n\n boundCalculator = () => {\n if (boundToRight) {\n return {\n minX: trueX\n };\n } else {\n return {\n minX: trueX,\n maxX: selectionBounds.maxX\n };\n }\n };\n\n return {\n selectionBounds: Object.assign({}, selectionBounds, {\n minX: trueX\n })\n };\n } else if (this._dragType === 'right') {\n if (trueX < selectionBounds.minX) {\n trueX = selectionBounds.minX;\n }\n\n const boundToLeft = globalBounds.minX === selectionBounds.minX;\n\n boundCalculator = () => {\n if (boundToLeft) {\n return {\n maxX: trueX\n };\n } else {\n return {\n minX: selectionBounds.minX,\n maxX: trueX\n };\n }\n };\n\n return {\n selectionBounds: Object.assign({}, selectionBounds, {\n maxX: trueX\n })\n };\n }\n }, () => {\n if (!boundCalculator) {\n return;\n }\n\n boundCalculator.debounceHistory = true;\n this.props.stateController.boundCalculator = boundCalculator;\n });\n }\n\n addListeners() {\n window.addEventListener('mousemove', this.onMouseMove);\n window.addEventListener('mouseup', this.stopDragging);\n window.addEventListener('touchmove', this.onMouseMove, { passive: false });\n window.addEventListener('touchend', this.stopDragging);\n window.addEventListener('touchcancel', this.stopDragging);\n }\n\n stopDragging() {\n this._dragType = null;\n this.forceUpdate();\n window.removeEventListener('mousemove', this.onMouseMove);\n window.removeEventListener('mouseup', this.stopDragging);\n window.removeEventListener('touchmove', this.onMouseMove);\n window.removeEventListener('touchend', this.stopDragging);\n window.removeEventListener('touchcancel', this.stopDragging);\n }\n\n startScroll(event) {\n this._dragType = 'scroll';\n\n const {selectionBounds, globalBounds, elementWidth} = this.state;\n const leftX = this.el.getBoundingClientRect().left;\n\n const pixelStartX = this.getClientX(event) - leftX;\n const pixelMinX = (selectionBounds.minX - globalBounds.minX)/(globalBounds.maxX - globalBounds.minX) * elementWidth || 0;\n const pixelMaxX = (selectionBounds.maxX - globalBounds.minX)/(globalBounds.maxX - globalBounds.minX) * elementWidth || 0;\n\n this._scrollAnchorPercentage = (pixelStartX-pixelMinX)/(pixelMaxX - pixelMinX);\n this.addListeners();\n }\n\n startLeftDrag(event) {\n this._dragType = 'left';\n this.addListeners();\n }\n\n startRightDrag(event) {\n this._dragType = 'right';\n this.addListeners();\n }\n\n render() {\n const { globalBounds, selectionBounds, elementWidth, elementHeight } = this.state;\n\n let pixelMinX = Math.min(Math.max((selectionBounds.minX - globalBounds.minX)/(globalBounds.maxX - globalBounds.minX), 0), 1) * elementWidth || 0;\n let pixelMaxX = Math.min(Math.max((selectionBounds.maxX - globalBounds.minX)/(globalBounds.maxX - globalBounds.minX), 0), 1) * elementWidth || 0;\n\n if (isNaN(pixelMinX) || !isFinite(pixelMinX) || selectionBounds.maxX < selectionBounds.minX) {\n pixelMinX = 0;\n }\n\n if (isNaN(pixelMaxX) || !isFinite(pixelMaxX) || selectionBounds.maxX < selectionBounds.minX) {\n pixelMaxX = 0;\n }\n\n const barSize = 14;\n const totalHeight = elementHeight + barSize; \n let ticks;\n\n if (selectionBounds.dates && this.props.markDates) {\n ticks = placeGrid({\n min: globalBounds.minX,\n max: globalBounds.maxX,\n totalSize: elementWidth,\n precision: 'day',\n dates: selectionBounds.dates,\n formatter: formatX,\n expectedLabelSize: 30,\n labelPadding: 5,\n formatOptions: {\n justMonthAndDay: true,\n unitOverride: 'day',\n timeZone: this.props.timeZone\n },\n skipFirst: true,\n skipLast: true\n });\n }\n\n return (\n <div className=\"range-selection-graph\">\n <div className=\"graph-body graph-body-secondary\" style={{ touchAction: 'none' }}>\n <canvas ref={(el) => this.el = el} />\n\n <svg style={{ height: totalHeight }}>\n <g>\n <rect\n x={0}\n y={elementHeight}\n width={elementWidth}\n height={barSize}\n className=\"selection-bar-track\"\n />\n\n {\n ticks && ticks.map(({ pixelValue, label, size, position }, i) => {\n if (isNaN(pixelValue)) {\n return null;\n }\n\n const classes = ['axis-item', `axis-item-${size}`, `axis-item-${position}`];\n \n const isHighlighted = pixelValue >= pixelMinX && pixelValue <= pixelMaxX;\n if (isHighlighted) {\n classes.push('axis-item-highlighted');\n }\n\n return (\n <g key={i} className={classes.join(' ')}>\n <path d={`M${pixelValue},0 v${elementHeight}`} />\n\n <text x={pixelValue + 3} y={elementHeight}>\n {label}\n </text>\n </g>\n );\n })\n }\n\n <rect\n x={pixelMinX}\n y={elementHeight}\n width={pixelMaxX - pixelMinX}\n height={barSize}\n className=\"selection-bar\"\n onMouseDown={this.startScroll}\n onTouchStart={this.startScroll}\n />\n\n <path\n d=\"M -3 3.5 L -3 9.333333333333334 M 0 3.5 L 0 9.333333333333334 M 3 3.5 L 3 9.333333333333334\"\n className=\"selection-bar-rifles\"\n transform={`translate(${pixelMinX + (pixelMaxX - pixelMinX)/2},${elementHeight})`}\n onMouseDown={this.startScroll}\n onTouchStart={this.startScroll}\n />\n </g>\n\n <g>\n <rect\n x={pixelMinX}\n y={0}\n width={pixelMaxX - pixelMinX}\n height={totalHeight}\n className=\"target-selection-outline\"\n onMouseDown={this.startScroll}\n onTouchStart={this.startScroll}\n />\n </g>\n\n {/* Left handle */}\n <g className={`selection-handle${(this._dragType === 'left' || this._dragType === 'scroll') ? ' selection-handle-dragging' : ''}`}>\n <rect\n x={pixelMinX - 15}\n y={(elementHeight - 30)/2}\n width={30}\n height={30}\n fill=\"transparent\"\n className=\"selection-bar-handle-hit\"\n onMouseDown={this.startLeftDrag}\n onTouchStart={this.startLeftDrag}\n />\n <path\n d=\"M -4.5 0.5 L 3.5 0.5 L 3.5 15.5 L -4.5 15.5 L -4.5 0.5 M -1.5 4 L -1.5 12 M 0.5 4 L 0.5 12\"\n className=\"selection-bar-handle\"\n transform={`translate(${pixelMinX},${(elementHeight - 15)/2})`}\n onMouseDown={this.startLeftDrag}\n onTouchStart={this.startLeftDrag}\n />\n </g>\n\n {/* Right handle */}\n <g className={`selection-handle${(this._dragType === 'right' || this._dragType === 'scroll') ? ' selection-handle-dragging' : ''}`}>\n <rect\n x={pixelMaxX - 15}\n y={(elementHeight - 30)/2}\n width={30}\n height={30}\n fill=\"transparent\"\n className=\"selection-bar-handle-hit\"\n onMouseDown={this.startRightDrag}\n onTouchStart={this.startRightDrag}\n />\n <path\n d=\"M -4.5 0.5 L 3.5 0.5 L 3.5 15.5 L -4.5 15.5 L -4.5 0.5 M -1.5 4 L -1.5 12 M 0.5 4 L 0.5 12\"\n className=\"selection-bar-handle\"\n transform={`translate(${pixelMaxX},${(elementHeight - 15)/2})`}\n onMouseDown={this.startRightDrag}\n onTouchStart={this.startRightDrag}\n />\n </g>\n\n </svg>\n\n {\n this.props.verticalLines &&\n <VerticalLines\n stateController={this.props.stateController}\n verticalLines={this.props.verticalLines}\n isRangeGraph={true}\n bounds={globalBounds}\n elementHeight={elementHeight}\n elementWidth={elementWidth}\n />\n }\n </div>\n </div>\n );\n }\n\n}\n\nRangeGraph.defaultProps = {\n width: 3,\n shadowColor: 'transparent'\n};\n\nRangeGraph.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n webgl: PropTypes.bool,\n draggingY: PropTypes.bool,\n checkIntersection: PropTypes.bool,\n markDates: PropTypes.bool,\n timeZone: PropTypes.string,\n verticalLines: CustomPropTypes.VerticalLines\n};","import React from 'react';\nimport getColor from '../helpers/colors';\nimport CustomPropTypes from '../helpers/custom_prop_types';\nimport PropTypes from 'prop-types';\nimport StateController from '../state/state_controller';\nimport nameForSeries from '../helpers/name_for_series';\n\nexport default React.memo(SeriesKeyItem);\n\nfunction SeriesKeyItem({ series, i, style, onMouseDown, theme, stateController, highlighted }) {\n const color = getColor(series.color, i, series.multigrapherSeriesIndex);\n\n if (theme === 'day') {\n style = Object.assign({}, style, {\n backgroundColor: color\n });\n } else {\n style = Object.assign({}, style, {\n color\n });\n }\n\n const classes = ['series-key-item'];\n if (highlighted) {\n classes.push('series-key-item-highlighted');\n }\n\n const name = nameForSeries(series, i);\n\n return (\n <div\n className={classes.join(' ')}\n style={style}\n onMouseDown={onMouseDown}\n onMouseOver={() => stateController.setHighlightedSeries(i)}\n onMouseOut={() => stateController.setHighlightedSeries(null)}\n onClick={() => stateController.registerSeriesClick(i)}\n >\n {name}\n </div>\n );\n}\n\nSeriesKeyItem.propTypes = {\n series: CustomPropTypes.SingleSeries.isRequired,\n stateController: PropTypes.instanceOf(StateController),\n i: PropTypes.number.isRequired,\n style: PropTypes.object,\n onMouseDown: PropTypes.func,\n theme: PropTypes.string.isRequired,\n highlighted: PropTypes.bool\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport StateController from '../state/state_controller';\n\nexport default class SeriesKeyAxisContainer extends React.PureComponent {\n\n constructor(props) {\n super(props);\n\n this.state = {\n showingLabelInput: false\n };\n\n this.toggleLabelInputShowing = this.toggleLabelInputShowing.bind(this);\n }\n\n toggleLabelInputShowing() {\n this.setState(({ showingLabelInput }) => {\n return {\n showingLabelInput: !showingLabelInput\n };\n });\n }\n\n render() {\n const {children, stateController, axisIndex, scale, label, grapherID} = this.props;\n\n const { showingLabelInput } = this.state;\n\n return (\n <div\n className={`series-key-axis-container${showingLabelInput ? ' series-key-axis-container-showing-label' : ''}`}\n data-axis-index={axisIndex}\n data-grapher-id={grapherID}\n >\n <div className=\"scale-label\" onClick={() => stateController.toggleScale({axisIndex})}>\n {scale.slice(0, showingLabelInput ? 6 : 3)}\n </div>\n\n <div className=\"series-key-axis-container-body\">\n <div>\n {children}\n\n <svg className=\"label-input-toggler\" viewBox=\"0 0 512 512\" onClick={this.toggleLabelInputShowing}>\n <path\n d=\"M0 252.118V48C0 21.49 21.49 0 48 0h204.118a48 48 0 0 1 33.941 14.059l211.882 211.882c18.745 18.745 18.745 49.137 0 67.882L293.823 497.941c-18.745 18.745-49.137 18.745-67.882 0L14.059 286.059A48 48 0 0 1 0 252.118zM112 64c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48z\"/>\n </svg>\n </div>\n\n <div className=\"series-key-axis-label-container\">\n <input\n onChange={(event) => stateController.setLabel({axisIndex, label: event.target.value})}\n placeholder=\"Enter label\"\n value={label || ''}\n />\n </div>\n </div>\n </div>\n );\n }\n}\n\nSeriesKeyAxisContainer.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n children: PropTypes.node.isRequired,\n axisIndex: PropTypes.number.isRequired,\n scale: PropTypes.string.isRequired,\n label: PropTypes.string,\n grapherID: PropTypes.string\n};\n","import React, { useState, useEffect, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport {Y_AXIS_WIDTH} from '../helpers/axis_sizes';\nimport StateController from '../state/state_controller';\nimport {\n useAlwaysTooltipped,\n useAxes,\n useHighlightedSeries,\n useLeftAxisCount,\n usePrimarySize,\n useRightAxisCount,\n useSeries, useShowingOptions\n} from '../state/hooks';\nimport SeriesKeyItem from './series_key_item.jsx';\nimport SeriesKeyAxisContainer from './series_key_axis_container.jsx';\n\nfunction calculateStyles({stateController, keyWidth}) {\n const rightAxisCount = useRightAxisCount(stateController);\n const leftAxisCount = useLeftAxisCount(stateController);\n const showingOptions = useShowingOptions(stateController);\n\n let marginRight = Y_AXIS_WIDTH*rightAxisCount;\n if (rightAxisCount > 0) {\n marginRight += 5;\n }\n\n marginRight += 250;\n\n if (showingOptions) {\n marginRight += 70;\n }\n\n let marginLeft = Y_AXIS_WIDTH*leftAxisCount;\n\n if (leftAxisCount > 0) {\n marginLeft += 5;\n }\n\n marginLeft = Math.max(marginRight, marginLeft);\n marginRight = Math.max(marginRight, marginLeft);\n\n let marginBottom;\n\n const { elementWidth } = usePrimarySize(stateController);\n\n const shouldBreak = elementWidth - marginLeft - marginRight < keyWidth;\n\n if (shouldBreak) {\n marginLeft = 0;\n marginRight = 0;\n marginBottom = 10;\n }\n\n return { marginRight, marginLeft, marginBottom };\n}\n\nexport default React.memo(SeriesKey);\n\nfunction SeriesKey({ stateController, theme, draggingY, grapherID, dragPositionYOffset=0 }) {\n const series = useSeries(stateController);\n const [draggedSeries, setDraggedSeries] = useState(null);\n const [dragPosition, setDragPosition] = useState({\n x: 0,\n y: 0\n });\n\n const highlightedSeries = useHighlightedSeries(stateController);\n\n const keyRef = useRef(null);\n const [keyWidth, setKeyWidth] = useState(series.map(({ name, yKey }, i) => (name || yKey || i).toString().length).reduce((a, b) => a + b, 0) * 5);\n\n let sizeCalculationHandle;\n useEffect(() => {\n if (keyRef.current) {\n cancelAnimationFrame(sizeCalculationHandle);\n\n sizeCalculationHandle = requestAnimationFrame(() => {\n if (!keyRef.current) { // has become invalid in the last frame\n return;\n }\n\n const width = [...keyRef.current.querySelectorAll('.series-key-axis-container')]\n .map((el) => el.clientWidth)\n .reduce((a, b) => a + b, 0);\n setKeyWidth(width);\n });\n }\n }, [series, keyRef.current]);\n\n const style = calculateStyles({ stateController, keyWidth });\n\n const axes = useAxes(stateController);\n const alwaysTooltipped = useAlwaysTooltipped(stateController);\n\n const startDragging = (event, singleSeries) => {\n let seriesKeyEl = event.target;\n while (seriesKeyEl && seriesKeyEl.className !== 'series-key') {\n seriesKeyEl = seriesKeyEl.parentNode;\n }\n const targetLeft = event.target.getBoundingClientRect().left;\n let seriesKeyLeft = seriesKeyEl.getBoundingClientRect().left;\n let seriesKeyMarginLeft = seriesKeyEl.style.marginLeft;\n\n const startX = event.clientX;\n const startY = event.clientY;\n const clientStartX = event.clientX;\n const clientStartY = event.clientY;\n\n setDraggedSeries(singleSeries);\n setDragPosition({\n x: event.clientX - startX + (targetLeft - seriesKeyLeft) - 2,\n y: event.clientY - startY + 1\n });\n\n const onMouseMove = (moveEvent) => {\n if (seriesKeyEl.style.marginLeft !== seriesKeyMarginLeft) {\n seriesKeyLeft = seriesKeyEl.getBoundingClientRect().left;\n seriesKeyMarginLeft = seriesKeyEl.style.marginLeft;\n }\n\n setDragPosition({\n x: moveEvent.clientX - startX + (targetLeft - seriesKeyLeft) - 2,\n y: moveEvent.clientY - startY + 1\n });\n };\n\n const onMouseUp = (mouseUpEvent) => {\n window.removeEventListener('mousemove', onMouseMove);\n window.removeEventListener('mouseup', onMouseUp);\n\n let target = mouseUpEvent.target;\n while (target && !(target.dataset || {}).axisIndex && !(target.dataset || {}).grapherId) {\n target = target.parentNode;\n }\n\n setDraggedSeries(null);\n stateController.finalizeDrag(singleSeries, target && (target.dataset || {}).axisIndex, target && (target.dataset || {}).grapherId);\n\n if (mouseUpEvent.clientX === clientStartX && mouseUpEvent.clientY === clientStartY) {\n stateController.toggleAlwaysTooltipped(singleSeries, mouseUpEvent.shiftKey);\n }\n };\n\n window.addEventListener('mousemove', onMouseMove);\n window.addEventListener('mouseup', onMouseUp);\n\n stateController.markDragStart();\n };\n\n return (\n <div className=\"series-key\" style={style} ref={keyRef}>\n {\n draggingY &&\n <div\n className=\"series-key-axis-container\"\n data-axis-index=\"new-left\"\n data-grapher-id={grapherID}\n />\n }\n\n {\n axes.map((axis, i) => {\n if (!axis.series.length && axes.length > 1) {\n return null;\n }\n\n return (\n <SeriesKeyAxisContainer\n key={i}\n label={axis.label}\n axisIndex={axis.axisIndex}\n scale={axis.scale}\n stateController={stateController}\n grapherID={grapherID}\n >\n {\n axis.series.map((singleSeries) => {\n if (singleSeries.hideFromKey) {\n return null;\n }\n\n return (\n <SeriesKeyItem\n key={singleSeries.index}\n series={singleSeries}\n i={singleSeries.index}\n onMouseDown={(event, toggleTooltipped) => startDragging(event, singleSeries, toggleTooltipped)}\n theme={theme}\n stateController={stateController}\n highlighted={highlightedSeries === singleSeries.index || alwaysTooltipped.has(singleSeries)}\n />\n );\n })\n }\n </SeriesKeyAxisContainer>\n );\n })\n }\n\n {\n draggingY &&\n <div\n className=\"series-key-axis-container\"\n data-axis-index=\"new-right\"\n data-grapher-id={grapherID}\n />\n }\n\n {\n draggedSeries &&\n <SeriesKeyItem\n style={{\n left: dragPosition.x,\n top: dragPosition.y - dragPositionYOffset,\n position: 'absolute',\n pointerEvents: 'none',\n zIndex: 1\n }}\n series={draggedSeries}\n i={draggedSeries.index}\n theme={theme}\n stateController={stateController}\n />\n }\n </div>\n );\n}\n\nSeriesKey.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n theme: PropTypes.string.isRequired,\n draggingY: PropTypes.bool.isRequired,\n grapherID: PropTypes.string,\n dragPositionYOffset: PropTypes.number\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nexport default React.memo(GraphTitle);\n\nfunction GraphTitle({ title }) {\n return (\n <div className=\"grapher-title\">\n {title}\n </div>\n );\n}\n\nGraphTitle.propTypes = {\n title: PropTypes.string.isRequired\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport StateController from '../state/state_controller';\nimport {useSeries} from '../state/hooks';\nimport CustomPropTypes from '../helpers/custom_prop_types';\nimport getColor from '../helpers/colors';\n\nclass SeriesToggle extends React.PureComponent {\n\n constructor(props) {\n super(props);\n\n this.onChange = this.onChange.bind(this);\n }\n\n // NOTE: event listeners here do not follow React best practices, because when handled through React\n // there were ~500ms of latency when toggling the checkbox. It's unclear why\n onChange(event) {\n setTimeout(() => {\n this.props.stateController.setShowing(this.props.singleSeries, event.target.checked);\n });\n }\n\n render() {\n const { singleSeries } = this.props;\n const color = getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex);\n\n let name = singleSeries.name || singleSeries.yKey;\n\n if (!name) {\n name = singleSeries.index;\n }\n\n return (\n <div className=\"series-toggle\">\n <label>\n <input\n type=\"checkbox\"\n defaultChecked={!singleSeries.hidden}\n ref={(el) => el && el.addEventListener('change', this.onChange)}\n />\n <span className=\"checkmark\" style={{ background: color, borderColor: color }} />\n\n {name}\n </label>\n </div>\n );\n }\n}\n\nSeriesToggle.propTypes = {\n singleSeries: CustomPropTypes.SingleSeries.isRequired,\n stateController: PropTypes.instanceOf(StateController).isRequired\n};\n\nexport default function Sidebar({ stateController }) {\n const series = useSeries(stateController);\n\n return (\n <div className=\"grapher-sidebar\">\n {\n series.map((singleSeries, i) =>\n <SeriesToggle\n key={i}\n singleSeries={singleSeries}\n stateController={stateController}\n />\n )\n }\n </div>\n );\n}\n\nSidebar.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired\n};\n","export default class SyncPool {\n\n /**\n *\n * @param {Boolean} syncBounds\n * @param {Boolean|'onShift'} syncTooltips\n * @param {Boolean} syncDragState\n */\n constructor({ syncBounds=true, syncTooltips=true, syncDragState=false } = {}) {\n this._stateControllers = new Set();\n this._syncBounds = syncBounds;\n this._syncTooltips = syncTooltips;\n this._syncDragState = syncDragState;\n }\n\n add(stateController) {\n this._stateControllers.add(stateController);\n\n if (this._syncBounds) {\n this.syncBounds(stateController);\n }\n\n if (this._syncTooltips) {\n this.syncTooltips(stateController);\n }\n\n if (this._syncDragState) {\n this.syncDragState(stateController);\n }\n }\n\n remove(stateController) {\n this._stateControllers.delete(stateController);\n\n // TODO: remove listeners\n // (though since this is currently only called by stateController dispose, it probably doesn't matter)\n }\n\n syncDragState(stateController) {\n stateController.on('dragging_y_changed', (draggingY) => {\n for (let otherStateController of this._stateControllers) {\n if (stateController === otherStateController) {\n continue;\n }\n\n if (draggingY) {\n otherStateController.markDragStart();\n } else {\n otherStateController.finalizeDrag(null, null);\n }\n }\n });\n }\n\n syncBounds(stateController) {\n stateController.on('bound_calculator_changed', (boundCalculator) => {\n for (let otherStateController of this._stateControllers) {\n if (stateController === otherStateController) {\n continue;\n }\n\n otherStateController.boundCalculator = boundCalculator;\n }\n });\n }\n\n syncTooltips(stateController) {\n stateController.on('tooltip_state_changed', (tooltipState, stateArg) => {\n if (this._tooltipIgnoreState === stateArg) { // avoid cascading changes\n return;\n }\n\n const shouldHideTooltips = tooltipState.unsavedTooltipsCount === 0 ||\n !tooltipState.mousePresent ||\n (this._syncTooltips === 'onShift' && !stateController.shiftKeyPressedOnMove);\n\n if (shouldHideTooltips) {\n this._tooltipIgnoreState = Math.random();\n }\n\n for (let otherStateController of this._stateControllers) {\n if (stateController === otherStateController) {\n continue;\n }\n\n if (shouldHideTooltips) {\n otherStateController.showOnlySavedTooltips(this._tooltipIgnoreState);\n continue;\n }\n\n otherStateController.setTooltipMousePosition({\n mouseX: tooltipState.mouseX,\n mouseY: tooltipState.mouseY,\n tooltipAllNext: true,\n tooltipStateArg: this._tooltipIgnoreState\n });\n }\n });\n }\n\n}\n","import React, { useEffect, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport CustomPropTypes from './helpers/custom_prop_types';\nimport GraphBody from './components/graph_body.jsx';\nimport './grapher.scss';\nimport XAxis from './components/x_axis.jsx';\nimport YAxis from './components/y_axis.jsx';\nimport RangeSelection from './components/range_selection.jsx';\nimport RangeGraph from './components/range_graph.jsx';\nimport SeriesKey from './components/series_key.jsx';\nimport {Y_AXIS_WIDTH} from './helpers/axis_sizes';\nimport GraphTitle from './components/graph_title.jsx';\nimport {LINE_COLORS} from './helpers/colors';\nimport StateController from './state/state_controller';\nimport {useDraggingY, useLeftAxes, useRightAxes, useShowingSidebar, useTheme} from './state/hooks';\nimport Sidebar from './components/sidebar.jsx';\nimport SyncPool from './state/sync_pool.js';\nimport BOUND_CALCULATORS from './state/bound_calculators.js';\n\nfunction calculateClassNamesAndStyles(props, { draggingY, theme }) {\n const { fullscreen, height, width } = props;\n\n const classNames = [\n 'grapher',\n `grapher-${theme}`\n ];\n\n const styles = {};\n\n if (draggingY) {\n classNames.push('grapher-dragging-y');\n }\n\n if (fullscreen) {\n classNames.push('grapher-fullscreen');\n classNames.push('grapher-fixed-height');\n } else if (height) {\n classNames.push('grapher-fixed-height');\n if (typeof height === 'number') {\n styles.height = height - 20;\n } else {\n styles.height = `calc(${height} - 20px)`;\n }\n }\n\n if (width) {\n styles.width = width;\n }\n\n return {\n styles,\n classNames\n };\n}\n\nexport default React.memo(Grapher);\n\nconst grapherDefaultProps = {\n theme: 'night',\n showAxes: true,\n showRangeGraph: true,\n showRangeSelectors: true,\n showSeriesKey: true,\n showTooltips: true,\n boundsSelectionEnabled: true,\n customBoundsSelectors: [],\n sidebarEnabled: false,\n defaultShowAnnotations: true,\n defaultShowOptions: true\n};\n\nfunction Grapher(props) {\n props = {...grapherDefaultProps, ...props};\n\n const stateController = useMemo(() => new StateController({\n grapherID: props.id,\n ...props,\n ...props.stateControllerInitialization\n }), []);\n\n useEffect(() => {\n if (process.env.NODE_ENV === 'development') {\n window.stateController = stateController;\n }\n\n return () => {\n stateController.dispose();\n };\n }, [stateController]);\n\n useEffect(() => {\n props.exportStateController && props.exportStateController(stateController);\n }, [stateController, props.exportStateController]);\n\n useEffect(() => {\n stateController.timingFrameCount = props.timingFrameCount;\n }, [stateController, props.timingFrameCount]);\n\n useEffect(() => {\n props.onRenderTime && stateController.on('render_time', props.onRenderTime);\n\n return () => {\n props.onRenderTime && stateController.off('render_time', props.onRenderTime);\n };\n }, [stateController, props.onRenderTime]);\n\n useEffect(() => {\n stateController.setSeries(props.series);\n }, [stateController, props.series]);\n\n useEffect(() => {\n stateController.theme = props.theme;\n }, [stateController, props.theme]);\n\n const theme = useTheme(stateController);\n const bigLabels = props.bigLabels || theme === 'export';\n\n const defaultLineWidth = props.defaultLineWidth || (theme === 'export' ? 3 : undefined);\n useEffect(() => {\n stateController.defaultLineWidth = defaultLineWidth;\n }, [stateController, defaultLineWidth]);\n\n useEffect(() => {\n stateController.percentile = props.percentile;\n }, [stateController, props.percentile]);\n\n useEffect(() => {\n stateController.customBoundsSelectors = props.customBoundsSelectors;\n }, [stateController, props.customBoundsSelectors]);\n\n useEffect(() => {\n stateController.annotations = props.annotations;\n }, [stateController, props.annotations]);\n\n useEffect(() => {\n if (!props.onAxisChange) {\n return () => {};\n }\n\n stateController.on('exported_axes_changed', props.onAxisChange);\n return () => {\n stateController.off('exported_axes_changed', props.onAxisChange);\n };\n }, [stateController, props.onAxisChange]);\n\n useEffect(() => {\n stateController.primaryRenderer.resize();\n }, [props.height]);\n\n const draggingY = useDraggingY(stateController);\n\n const {styles, classNames} = calculateClassNamesAndStyles(props, { draggingY, theme });\n\n const rightAxes = useRightAxes(stateController);\n const leftAxes = useLeftAxes(stateController);\n const showingSidebar = useShowingSidebar(stateController);\n\n const showAxisColors = typeof props.showAxisColors === 'boolean' ? props.showAxisColors : (theme !== 'export');\n const showGrid = typeof props.showGrid === 'boolean' ? props.showGrid : true;\n const showAxes = typeof props.showAxes === 'boolean' ? props.showAxes : false;\n\n const commonYAxisProps = {\n stateController,\n showAxes,\n showGrid,\n showSeriesKey: props.showSeriesKey,\n bodyHeight: props.bodyHeight,\n theme,\n grapherID: props.id,\n dragPositionYOffset: props.dragPositionYOffset,\n showAxisColors,\n bigLabels\n };\n\n return (\n <div className={classNames.join(' ')} style={styles} data-grapher-id={props.id}>\n {\n props.title &&\n <GraphTitle title={props.title} />\n }\n\n <div className=\"grapher-primary-container-outer\">\n {\n showingSidebar &&\n <Sidebar stateController={stateController} />\n }\n\n <div className=\"grapher-primary-container-body\">\n {\n props.showSeriesKey &&\n <SeriesKey\n stateController={stateController}\n draggingY={draggingY}\n theme={props.theme}\n grapherID={props.id}\n dragPositionYOffset={props.dragPositionYOffset}\n />\n }\n\n {\n props.showRangeSelectors &&\n <RangeSelection\n stateController={stateController}\n customBoundsSelectors={props.customBoundsSelectors}\n customBoundsSelectorsOnly={props.customBoundsSelectorsOnly}\n sidebarEnabled={props.sidebarEnabled}\n />\n }\n\n <div className=\"grapher-main-row\">\n {\n draggingY &&\n <div\n className=\"axis y-axis\"\n data-axis-index=\"new-left\"\n data-grapher-id={props.id}\n style={{\n width: Y_AXIS_WIDTH,\n height: typeof props.bodyHeight === 'number' ? props.bodyHeight : undefined\n }}\n />\n }\n\n {\n leftAxes.map((axis, i) => {\n return <YAxis\n key={i}\n axis={axis}\n sideIndex={leftAxes.length - i - 1}\n {...commonYAxisProps}\n />;\n })\n }\n\n <div className=\"central-container\">\n <GraphBody\n stateController={stateController}\n webgl={props.webgl}\n bodyHeight={props.bodyHeight}\n boundsSelectionEnabled={props.boundsSelectionEnabled}\n showTooltips={props.showTooltips}\n tooltipOptions={props.tooltipOptions}\n checkIntersection={props.checkIntersection}\n draggablePoints={props.draggablePoints}\n onPointDrag={props.onPointDrag}\n onDraggablePointsDoubleClick={props.onDraggablePointsDoubleClick}\n onPointClick={props.onPointClick}\n verticalLines={props.verticalLines}\n clockStyle={props.clockStyle}\n timeZone={props.timeZone}\n />\n\n <XAxis\n showGrid={showGrid}\n showAxes={showAxes}\n stateController={stateController}\n bigLabels={bigLabels}\n xTickUnit={props.xTickUnit}\n clockStyle={props.clockStyle}\n timeZone={props.timeZone}\n integersOnly={props.xAxisIntegersOnly}\n formatXAxisLabel={props.formatXAxisLabel}\n />\n\n {\n props.showRangeGraph &&\n <div className=\"range-graph-container\">\n <RangeGraph\n stateController={stateController}\n webgl={props.webgl}\n checkIntersection={props.checkIntersection}\n markDates={props.markRangeGraphDates}\n timeZone={props.timeZone}\n verticalLines={props.verticalLines}\n />\n </div>\n }\n </div>\n\n {\n rightAxes.map((axis, i) => {\n return <YAxis\n key={i}\n axis={axis}\n sideIndex={i}\n {...commonYAxisProps}\n />;\n })\n }\n\n {\n draggingY &&\n <div\n className=\"axis y-axis\"\n data-axis-index=\"new-right\"\n data-grapher-id={props.id}\n style={{\n width: Y_AXIS_WIDTH,\n height: typeof props.bodyHeight === 'number' ? props.bodyHeight : undefined\n }}\n />\n }\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nGrapher.propTypes = {\n series: CustomPropTypes.Series.isRequired,\n webgl: PropTypes.bool,\n requireWASM: PropTypes.bool,\n checkIntersection: PropTypes.bool,\n\n onAxisChange: PropTypes.func,\n onRenderTime: PropTypes.func,\n exportStateController: PropTypes.func,\n timingFrameCount: PropTypes.number,\n\n stateControllerInitialization: PropTypes.object,\n syncPool: PropTypes.instanceOf(SyncPool),\n id: PropTypes.string,\n dragPositionYOffset: PropTypes.number,\n\n theme: PropTypes.oneOf(['day', 'night', 'export']),\n title: PropTypes.string,\n fullscreen: PropTypes.bool,\n bodyHeight: PropTypes.number,\n height: PropTypes.number,\n width: PropTypes.number,\n\n showAxes: PropTypes.bool,\n showRangeGraph: PropTypes.bool,\n showRangeSelectors: PropTypes.bool,\n showSeriesKey: PropTypes.bool,\n showTooltips: PropTypes.bool,\n showGrid: PropTypes.bool,\n showAxisColors: PropTypes.bool,\n bigLabels: PropTypes.bool,\n xTickUnit: PropTypes.oneOf(['year']),\n formatXAxisLabel: PropTypes.func,\n xAxisIntegersOnly: PropTypes.bool,\n clockStyle: PropTypes.oneOf(['12h', '24h']),\n timeZone: PropTypes.string, // local, utc, or a full timezone string\n markRangeGraphDates: PropTypes.bool,\n\n boundsSelectionEnabled: PropTypes.bool,\n sidebarEnabled: PropTypes.bool,\n\n percentile: PropTypes.number,\n defaultShowOptions: PropTypes.bool,\n defaultShowIndividualPoints: PropTypes.bool,\n defaultShowSidebar: PropTypes.bool,\n defaultShowAnnotations: PropTypes.bool,\n defaultLineWidth: PropTypes.number,\n\n tooltipOptions: CustomPropTypes.TooltipOptions,\n\n customBoundsSelectors: CustomPropTypes.CustomBoundsSelectors,\n customBoundsSelectorsOnly: PropTypes.bool,\n defaultBoundsCalculator: PropTypes.string,\n\n annotations: CustomPropTypes.Annotations,\n draggablePoints: CustomPropTypes.DraggablePoints,\n onPointDrag: PropTypes.func,\n onDraggablePointsDoubleClick: PropTypes.func,\n verticalLines: CustomPropTypes.VerticalLines,\n onPointClick: PropTypes.func\n};\n\nexport const AVAILABLE_COLORS = LINE_COLORS;\nexport const BUILT_IN_BOUND_CALCULATORS = BOUND_CALCULATORS;\n","import Eventable from '../eventable.js';\nimport getColor from '../helpers/colors.js';\nimport nameForSeries from '../helpers/name_for_series.js';\n\nexport default class MultigraphStateController extends Eventable {\n\n constructor({ id }) {\n super();\n\n this._id = id;\n\n this._multiSeries = [];\n this._seriesToGraphIndices = new Map();\n this._graphIndicesToSeries = new Map();\n this._modifiedSeries = new Map();\n this._originalSeriesByMultigrapherIndex = new Map();\n this._stateControllers = new Set();\n this._prevSeries = [];\n\n this._dataCache = new Map();\n this._subscriptions = new Map();\n\n this._draggingY = false;\n\n this.on('multi_series_changed', () => {\n for (let stateController of this._stateControllers) {\n stateController._multiSeries = this._multiSeries;\n }\n });\n }\n\n /**\n * Takes an array of user-supplied series, then splits, modifies, and broadcasts them\n *\n * @param {Array<Object>} series\n */\n setSeries(series) {\n\n if (this._prevSeries.length === series.length) {\n let anyDifferent = false;\n for (let i = 0; i < series.length; i++) {\n if (series[i] !== this._prevSeries[i]) {\n anyDifferent = true;\n break;\n }\n }\n\n if (!anyDifferent) {\n return;\n }\n }\n\n this._prevSeries = series;\n\n const graphIndices = new Set();\n const currentSeriesSet = new Set(series);\n\n for (let singleSeries of series) {\n let graphIndex = singleSeries.graph || 0;\n\n if (this._seriesToGraphIndices.has(singleSeries)) {\n graphIndex = this._seriesToGraphIndices.get(singleSeries);\n }\n\n graphIndices.add(graphIndex);\n\n let seriesSet = this._graphIndicesToSeries.get(graphIndex);\n if (!seriesSet) {\n seriesSet = new Set();\n this._graphIndicesToSeries.set(graphIndex, seriesSet);\n }\n\n seriesSet.add(singleSeries);\n }\n\n const sortedGraphIndices = [...graphIndices].sort();\n\n this._multiSeries = [];\n let globalSeriesIndex = 0;\n\n for (let graphIndex of sortedGraphIndices) {\n const series = [];\n\n for (let singleSeries of this._graphIndicesToSeries.get(graphIndex)) {\n if (!currentSeriesSet.has(singleSeries)) {\n this._graphIndicesToSeries.get(graphIndex).delete(singleSeries);\n continue;\n }\n\n if (this._modifiedSeries.has(singleSeries)) {\n globalSeriesIndex++;\n series.push(this._modifiedSeries.get(singleSeries));\n continue;\n }\n\n const color = getColor(singleSeries.color, globalSeriesIndex);\n const name = nameForSeries(singleSeries, globalSeriesIndex);\n const modifiedSeries = {\n ...singleSeries,\n multigrapherSeriesIndex: globalSeriesIndex,\n multigrapherGraphIndex: graphIndex,\n color,\n name\n };\n\n this._modifiedSeries.set(singleSeries, modifiedSeries);\n this._originalSeriesByMultigrapherIndex.set(globalSeriesIndex, singleSeries);\n\n globalSeriesIndex++;\n series.push(modifiedSeries);\n }\n\n this._multiSeries.push(series);\n }\n\n if (this._nextMultigrapherSeriesIndex) {\n this._nextMultigrapherSeriesIndex = this._nextMultigrapherSeriesIndex - this._multiSeriesCount + globalSeriesIndex;\n } else {\n this._nextMultigrapherSeriesIndex = globalSeriesIndex;\n }\n this._multiSeriesCount = globalSeriesIndex;\n\n this.emit('multi_series_changed', this.multiSeries);\n }\n\n /**\n * Registers a state controller for series switching\n *\n * @param {StateController} stateController\n */\n registerStateController(stateController) {\n if (this._stateControllers.has(stateController)) {\n return;\n }\n\n this._stateControllers.add(stateController);\n stateController._multigraphStateController = this;\n stateController._multiSeries = this._multiSeries;\n\n stateController.on('dragging_y_finalized', ({ grapherID, axisIndex, draggedSeries }={}) => {\n if (grapherID === stateController.grapherID) {\n return;\n }\n\n const [check, multigrapherID, graphIndex] = grapherID.split('-');\n if (check !== 'multigrapher' || multigrapherID !== this._id) {\n return;\n }\n\n setTimeout(() => {\n this.moveSeries({ axisIndex, draggedSeries, graphIndex });\n });\n });\n\n stateController.on('dragging_y_changed', (draggingY) => {\n if (draggingY === this._draggingY) {\n return;\n }\n\n this._draggingY = draggingY;\n this.emit('dragging_y_changed', this._draggingY);\n });\n\n stateController.on('observable_modified', (observable) => {\n for (let otherStateController of this._stateControllers) {\n if (stateController === otherStateController) {\n continue;\n }\n\n otherStateController.markObservableModified(observable);\n }\n });\n\n stateController.on('dispose', () => {\n this._stateControllers.delete(stateController);\n });\n }\n\n /**\n * Moves the given dragged series (as specified by the child state controller) to a different graph\n *\n * @param {String} axisIndex - the axis index on the new graph to move the series to\n * @param {Object} draggedSeries - the series that got dragged. Different identity than what this may access\n * @param {String} graphIndex - the index of the graph to assign it to\n */\n moveSeries({ axisIndex, draggedSeries, graphIndex }) {\n const prevGraphCount = this.graphCount;\n\n const originalSeries = this._originalSeriesByMultigrapherIndex.get(draggedSeries.multigrapherSeriesIndex);\n const modifiedSeries = this._modifiedSeries.get(originalSeries);\n\n this._multiSeries[modifiedSeries.multigrapherGraphIndex].splice(\n this._multiSeries[modifiedSeries.multigrapherGraphIndex].indexOf(modifiedSeries), 1\n );\n this._multiSeries[modifiedSeries.multigrapherGraphIndex] = [...this._multiSeries[modifiedSeries.multigrapherGraphIndex]];\n\n if (graphIndex === 'top') {\n modifiedSeries.multigrapherGraphIndex = this._createGraphAtTop();\n } else if (graphIndex === 'bottom') {\n modifiedSeries.multigrapherGraphIndex = this._createGraphAtBottom();\n } else {\n modifiedSeries.multigrapherGraphIndex = parseInt(graphIndex);\n }\n\n modifiedSeries.axisIndex = axisIndex;\n // safe because stateController operates on a copy. We could also have changed the identify of modifiedSeries,\n // but with that we might reset data when moving it back\n delete modifiedSeries.axis;\n\n this._multiSeries[modifiedSeries.multigrapherGraphIndex] = [...this._multiSeries[modifiedSeries.multigrapherGraphIndex], modifiedSeries];\n this._multiSeries = [...this._multiSeries];\n\n for (let graphIndex = 0; graphIndex < this._multiSeries.length; graphIndex++) {\n const originalSeriesAtIndex = this._multiSeries[graphIndex].map(({ multigrapherSeriesIndex }) =>\n this._originalSeriesByMultigrapherIndex.get(multigrapherSeriesIndex));\n this._graphIndicesToSeries.set(graphIndex, new Set(originalSeriesAtIndex));\n\n for (let singleSeries of originalSeriesAtIndex) {\n this._seriesToGraphIndices.set(singleSeries, graphIndex);\n }\n }\n\n this.emit('multi_series_changed', this.multiSeries);\n this.emit('graph_count_changed', this.graphCount, prevGraphCount);\n }\n\n /**\n * Finds or creates an empty graph at the beginning and returns its index\n *\n * @return {number}\n * @private\n */\n _createGraphAtTop() {\n // check if there's anything at the beginning already\n let emptyAtTopIndex = null;\n\n for (let i = 0; i < this._multiSeries.length; i++) {\n if (this._multiSeries[i].length === 0) {\n emptyAtTopIndex = i;\n } else {\n break;\n }\n }\n\n if (emptyAtTopIndex !== null) {\n return emptyAtTopIndex;\n }\n\n // add a series at the beginning and mutate the graph index of each\n this._multiSeries = [[], ...this._multiSeries];\n for (let graphIndex = 0; graphIndex < this._multiSeries.length; graphIndex++) {\n if (!this._multiSeries[graphIndex].length) {\n continue;\n }\n\n this._multiSeries[graphIndex] = [...this._multiSeries[graphIndex]];\n\n for (let modifiedSeries of this._multiSeries[graphIndex]) {\n modifiedSeries.multigrapherGraphIndex = graphIndex;\n }\n }\n\n return 0;\n }\n\n /**\n * Finds or creates an empty graph at the end and returns its index\n *\n * @return {number}\n * @private\n */\n _createGraphAtBottom() {\n // check if there's anything at the beginning already\n let emptyAtBottomIndex = null;\n\n for (let i = this._multiSeries.length - 1; i >= 0; i--) {\n if (this._multiSeries[i].length === 0) {\n emptyAtBottomIndex = i;\n } else {\n break;\n }\n }\n\n if (emptyAtBottomIndex !== null) {\n return emptyAtBottomIndex;\n }\n\n // add something at the bottom\n this._multiSeries = [...this._multiSeries, []];\n\n return this._multiSeries.length - 1;\n }\n\n get multiSeries() {\n return this._multiSeries.filter((series) => series.length);\n }\n\n get series() {\n return [...this._stateControllers].map((stateController) => stateController.series).flat();\n }\n\n get graphCount() {\n return this.multiSeries.length;\n }\n\n get draggingY() {\n return this._draggingY;\n }\n\n dispose() {\n this.clearListeners();\n\n for (let listener of this._subscriptions.values()) {\n listener.unsubscribe();\n }\n\n this._subscriptions.clear();\n }\n\n get stateControllerInitialization() {\n return {\n sharedDataCache: this._dataCache,\n sharedSubscriptions: this._subscriptions\n };\n }\n\n incrementMultigrapherSeriesIndex() {\n const index = this._nextMultigrapherSeriesIndex;\n\n this._nextMultigrapherSeriesIndex ++;\n\n return index;\n }\n}\n","import React, { useEffect, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport Grapher from './grapher.jsx';\nimport MultigraphStateController from './state/multigraph_state_controller.js';\nimport {useDraggingY, useMultiSeries} from './state/hooks.js';\nimport SyncPool from './state/sync_pool.js';\n\nexport default React.memo(MultiGrapher);\n\n\nfunction MultiGrapher(props) {\n /* eslint-disable react/prop-types */\n\n const multigrapherID = useMemo(() => Math.random().toString(36).slice(2), []);\n\n const multigraphStateController = useMemo(() => new MultigraphStateController({\n id: multigrapherID,\n ...props\n }), []);\n\n const multiSeries = useMultiSeries(multigraphStateController);\n\n const syncPool = useMemo(() => new SyncPool({\n syncBounds: props.syncBounds,\n syncTooltips: props.syncTooltips,\n syncDragState: true\n }), []);\n\n const registerStateController = useMemo(() => multigraphStateController.registerStateController.bind(multigraphStateController), [multigraphStateController]);\n\n useEffect(() => {\n if (process.env.NODE_ENV === 'development') {\n window.multigraphStateController = multigraphStateController;\n }\n\n return () => {\n multigraphStateController.dispose();\n };\n }, [multigraphStateController]);\n\n useEffect(() => {\n props.exportStateController && props.exportStateController(multigraphStateController);\n }, [multigraphStateController, props.exportStateController]);\n\n useEffect(() => {\n multigraphStateController.setSeries(props.series);\n }, [multigraphStateController, props.series]);\n\n useEffect(() => {\n if (!props.onMultiseriesChange) {\n return () => {};\n }\n\n multigraphStateController.on('multi_series_changed', props.onMultiseriesChange);\n return () => {\n multigraphStateController.off('multi_series_changed', props.onMultiseriesChange);\n };\n }, [multigraphStateController, props.onMultiseriesChange]);\n\n const draggingY = useDraggingY(multigraphStateController);\n\n return (\n <div className=\"multigrapher\">\n {\n draggingY && props.newUpperEnabled &&\n <div className={`new-grapher grapher-${props.theme}`} data-grapher-id={`multigrapher-${multigrapherID}-top`}>\n New grapher\n </div>\n }\n\n {\n multiSeries.map((series, i) =>\n <Grapher\n key={i}\n {...props}\n syncPool={syncPool}\n stateControllerInitialization={multigraphStateController.stateControllerInitialization}\n series={series}\n id={`multigrapher-${multigrapherID}-${i}`}\n dragPositionYOffset={props.newUpperEnabled ? 38 : 0}\n exportStateController={registerStateController}\n />\n )\n }\n\n {\n draggingY &&\n <div className={`new-grapher grapher-${props.theme}`} data-grapher-id={`multigrapher-${multigrapherID}-bottom`}>\n New grapher\n </div>\n }\n </div>\n );\n}\n\nMultiGrapher.defaultProps = {\n theme: 'night'\n};\n\nMultiGrapher.propTypes = Object.assign({}, Grapher.propTypes, {\n syncBounds: PropTypes.bool,\n syncTooltips: PropTypes.bool,\n newUpperEnabled: PropTypes.bool,\n onMultiseriesChange: PropTypes.func\n});\n"],"names":["___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","minPointSpacing","rendering","negativeColor","gradient","zeroLineWidth","zeroLineColor","zeroLineY","pointRadius","tooltipWidth","hasAreaBottom","shadowColor","rangeKey","Series","Axis","axisIndex","series","side","scale","label","Axes","CustomBoundsSelector","calculator","datesOnly","CustomBoundsSelectors","TooltipOptionsRaw","includeSeriesLabel","includeXLabel","includeYLabel","includeXValue","includeYValue","floating","alwaysFixedPosition","floatPosition","floatDelta","savingDisabled","customTooltip","combineTooltips","TooltipOptions","Annotation","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","createDefaultGradient","halfOpacityColor","inferType","useSimpleData","simpleData","observe","colorToVector","parts","part","test","substr","createGLProgram","gl","vertShaderSource","fragShaderSource","vertexShader","createShader","VERTEX_SHADER","shaderSource","compileShader","getShaderParameter","COMPILE_STATUS","console","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","cutoffPixelX","preCutoffPaths","postCutoffPaths","prePath","postPath","lastPrePoint","firstPostPoint","x1","y1","x2","y2","unshift","reducedColor","drawPointsWithCutoffByRatio","isBeforeCutoff","getBarWidths","closestSpacing","bounds","axisSeriesCount","fullBarWidth","maxX","minX","totalBarWidth","barWidth","barSpacing","applyPointSpacing","points","minSpacing","spacedPoints","point","rustApiModule","RustAPIPromise","default","RustAPI","extractVerticesFromPaths","pointNumber","positions","prevPositions","indices","Uint32Array","verticesPattern","set","vertexPointer","sourceLength","copyWithin","pointI","prevX","LineProgram","lineVert","lineFrag","_circleProgram","circleVert","circleFrag","_positionBuffer","_prevPositionBuffer","_individualPointBuffer","dispose","clear","drawingBufferWidth","drawingBufferHeight","clearColor","viewport","parameters","thickness","shadowBlur","renderCutoffGradient","cutoffIndex","originalData","drawLineWithCutoff","get_point_number","extract_vertices","extractVertices","positionIndex","prevPositionIndex","vertexIndex","uniform1f","colorVector","cutoffX","ELEMENT_ARRAY_BUFFER","drawElements","UNSIGNED_INT","pointSize","getIndividualPoints","cutoffTime","baseIndex","floor","fraction","cutoffDate","getTime","currentDate","nextDate","currentTime","preCutoffPoints","postCutoffPoints","isPreview","visibleMinTime","selectionBounds","pixelX","pixelY","visibleMaxTime","reducedOpacityColor","flat","POINTS","visibleCutoffRatio","ShadowProgram","shadowVert","shadowFrag","positionLoc","trapezoidBoundsLoc","trapezoidBottomLoc","_trapezoidBoundsBuffer","_trapezoidBottomBuffer","_gradientTexture","createTexture","deleteTexture","generateTrapezoidGeometry","trapezoids","trapezoidBounds","trapezoidBottom","trap","bottomY1","bottomY2","bottom","parseGradient","fallbackColor","fallbackColorVec","textureData","Uint8Array","textureWidth","gradientCount","colors","stops","stopIndex","colorIndex","params","drawShadowWithCutoff","inRenderSpaceAreaBottom","y1RelativeToZero","y2RelativeToZero","xCross","abs","yCross","finalX2","finalY2","finalBottomY2","ratio","trapezoid","geometry","gradientData","activeTexture","TEXTURE0","bindTexture","TEXTURE_2D","texImage2D","RGBA","UNSIGNED_BYTE","texParameteri","TEXTURE_MIN_FILTER","NEAREST","TEXTURE_MAG_FILTER","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","uniform1i","uniform4fv","getError","NO_ERROR","_lastIndividualPoints","_lastParams","currentItem","nextItem","visibleBounds","firstTime","lastTime","firstItem","lastItem","translucentGradient","drawSplitShadowTrapezoids","disable","DEPTH_TEST","GraphBodyRenderer","stateController","canvasElement","webgl","checkIntersection","super","_stateController","_checkIntersection","_canvas","_webgl","_context","getContext","_lineProgram","_shadowProgram","alert","_context2d","_initialized","_initializeCanvas","_boundResize","resize","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","pointsToRender","drawArea","shadowProgram","boundsChanged","_lastBounds","_lastRenderHeight","_lastShadowCache","shadowParams","save","globalCompositeOperation","restore","top","left","pointerEvents","insertBefore","nextSibling","shouldShowIndividualPoints","drawParams","getRanges","range","pixelMinY","pixelMaxY","setLineDash","beforeIndex","afterIndex","ceil","beforePoint","afterPoint","ranges","horizontalBarWidth","drawLine","renderBackground","inBackgroundSpace","_backgroundProgram","drawBackground","markSizeChanged","ResizeObserver","first","disabled","IntersectionObserver","entries","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","dataMinX","dataMaxX","dataRange","padding","closestIndex","closestPoint","ignoreYDistanceCheck","xDistanceThreshold","yDistanceThreshold","distanceThreshold","yDistance","enumLike","hasEnum","simplePoint","hasXEnum","unsavedTooltips","unsavedTooltipsCount","calculateTooltipState","_tooltipAllNext","_globalBounds","_tooltipStateArg","newX","right","shownSeries","xRange","annotation","seriesName","isRange","isPoint","xStartValue","xEndValue","convertToNumber","val","pixelStartX","pixelEndX","calculateAnnotationsState","_expandYWith","dataBoundsList","simpleDataSliceStart","dataBounds","_dataBounds","_recalculateSelection","disableSwap","selectedBounds","selectedBoundsAreaTop","selectedBoundsAreaBottom","inSelectedSpaceAreaBottom","_recalculateAxisBounds","modifiedSeries","newData","modifiedAxes","modifiedSeriesAndDependents","newDataInDataSpace","newDataBounds","newPointCount","previousSelection","newSelectedData","fixedY","targetBounds","byAxis","selectedBoundsList","selectedDataBounds","boundsCalculator","selectionFromGlobalBounds","_","export","night","_theme","inBackgroundSpacePrimary","inRenderSpacePrimary","_defaultLineWidth","inRenderSpacePrimaryAreaBottom","rangeGraphBounds","inRenderSpaceRangeGraph","inRenderSpaceRangeGraphAreaBottom","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","GraphBody","boundsSelectionEnabled","showTooltips","tooltipOptions","onPointClick","canvasEl","useCallback","el","boundsSelection","setBoundsSelection","start","useTooltipState","showAnnotations","useAnnotationState","useContextMenu","onScroll","onGlobalMouseMove","getTouch","touches","changedTouches","onGlobalTouchStart","touch","cancelable","closest","preventDefault","onGlobalTouchMove","onGlobalTouchEnd","passive","onMouseLeave","currentNode","classList","contains","seriesToNearestPoint","onContextMenu","placeTick","trueValue","inverted","totalSize","formatter","formatOptions","opts","scaledValue","pixelValue","placeTickByPixel","roundToDivisor","divisor","divisors","bestDelta","bestDivisor","delta","getEvenDateTickSpacing","span","desiredCount","subspan","amount","unit","placeGrid","expectedLabelSize","labelPadding","skipFirst","skipLast","paddedLabelSize","ticks","placementParams","setMinutes","setSeconds","setMilliseconds","setDate","lastDateString","tick","placeDatesGrid","tickSpacing","roundTo","getEvenTickSpacing","roundToEvenNumber","placeNumbersGrid","locals","XAxis","showAxes","showGrid","bigLabels","xTickUnit","formatXAxisLabel","useSelection","useHasXEnum","useEnumMap","minDate","maxDate","calculateTimePrecision","minLabel","maxLabel","expectedLabelWidth","timeTicks","dateTicks","regularTicks","hourSpan","alignedHour","currentHour","currentMinute","alignedMinute","currentSecond","alignedSecond","maxPixelForMiddleTicks","lastTick","placeTimeOnlyGrid","spanMultipleYears","customDateFormatter","startTick","endTick","placeDateOnlyGrid","xAxisHeight","marginBottom","skipGrid","singleTick","classes","timezoneLabel","YAxis","showSeriesKey","sideIndex","dragPositionYOffset","showAxisColors","sidePadding","setDraggedSeries","dragDelta","setDragDelta","dx","dy","highlightedOpacity","unhighlightedOpacity","marginLeft","opacity","edge","strokeDasharray","startDrag","startY","mouseUpEvent","dataset","grapherId","onMouseOver","onMouseOut","RangeSelectionButtonBase","selected","children","description","RangeSelectionButton","currentBoundCalculator","PercentileButton","usePercentile","usePercentileAsymmetry","onChange","onKeyUp","keyCode","focusable","viewBox","Options","sidebarEnabled","useShowIndividualPoints","RangeSelection","customBoundsSelectorsOnly","rightAxisCount","leftAxisCount","marginRight","useGlobalBounds","useBoundCalculator","useBoundHistory","customBoundSelectorNames","RangeGraph","state","stopDragging","startScroll","startLeftDrag","startRightDrag","getClientX","componentDidMount","_renderer","setState","componentDidUpdate","prevProps","componentWillUnmount","_dragType","leftX","percentage","_scrollAnchorPercentage","boundToRight","boundToLeft","addListeners","forceUpdate","pixelMinX","pixelMaxX","markDates","touchAction","onTouchStart","SeriesKeyItem","backgroundColor","SeriesKeyAxisContainer","showingLabelInput","toggleLabelInputShowing","placeholder","SeriesKey","dragPosition","setDragPosition","keyRef","useRef","keyWidth","setKeyWidth","sizeCalculationHandle","current","cancelAnimationFrame","querySelectorAll","clientWidth","calculateStyles","useAlwaysTooltipped","toggleTooltipped","startDragging","seriesKeyEl","targetLeft","seriesKeyLeft","seriesKeyMarginLeft","clientStartX","clientStartY","zIndex","GraphTitle","title","SeriesToggle","checked","defaultChecked","borderColor","Sidebar","SyncPool","syncBounds","syncTooltips","syncDragState","_stateControllers","_syncBounds","_syncTooltips","_syncDragState","otherStateController","stateArg","_tooltipIgnoreState","shouldHideTooltips","random","Grapher","grapherDefaultProps","showRangeGraph","showRangeSelectors","useMemo","stateControllerInitialization","exportStateController","onRenderTime","onAxisChange","styles","classNames","calculateClassNamesAndStyles","commonYAxisProps","xAxisIntegersOnly","markRangeGraphDates","AVAILABLE_COLORS","BUILT_IN_BOUND_CALCULATORS","MultigraphStateController","_id","_multiSeries","_seriesToGraphIndices","_graphIndicesToSeries","_originalSeriesByMultigrapherIndex","_prevSeries","graphIndices","currentSeriesSet","graphIndex","sortedGraphIndices","globalSeriesIndex","multigrapherGraphIndex","_nextMultigrapherSeriesIndex","_multiSeriesCount","multiSeries","registerStateController","_multigraphStateController","check","multigrapherID","moveSeries","prevGraphCount","graphCount","_createGraphAtTop","_createGraphAtBottom","originalSeriesAtIndex","emptyAtTopIndex","emptyAtBottomIndex","incrementMultigrapherSeriesIndex","MultiGrapher","multigraphStateController","useMultiSeries","onMultiseriesChange","newUpperEnabled"],"sourceRoot":""}
1
+ {"version":3,"file":"bundle.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,EAA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F,EAA0Bp8C,IAAI,uBAAwBrP,EAAM2rD,oBAAoB,GALzE,QAOZ,CAACF,EAA2BzrD,EAAM2rD,sBAErC,MAAMhb,EAAYqG,GAAayU,GAE/B,OACIj3B,EAAAA,QAAAA,cAAA,OAAK6B,UAAU,gBAEPsa,GAAa3wC,EAAM4rD,iBACfp3B,EAAAA,QAAAA,cAAA,OAAK6B,UAAY,uBAAsBr2B,EAAMuxC,QAAS,kBAAkB,gBAAeuZ,SAAsB,eAMjHJ,EAAYzsD,KAAI,CAAC0N,EAAQnN,IACrBg2B,EAAAA,QAAAA,cAACk0B,GAAOpyB,GAAA,CACJ7vB,IAAKjI,GACDwB,EAAK,CACT2gC,SAAUA,EACVooB,8BAA+B0C,EAA0B1C,8BACzDp9C,OAAQA,EACRhO,GAAK,gBAAemtD,KAAkBtsD,IACtCwiD,oBAAqBhhD,EAAM4rD,gBAAkB,GAAK,EAClD5C,sBAAuB2B,OAM/Bha,GACAnc,EAAAA,QAAAA,cAAA,OAAK6B,UAAY,uBAAsBr2B,EAAMuxC,QAAS,kBAAkB,gBAAeuZ,YAAyB,eAMhI,CAEAU,GAAaj1B,aAAe,CACxBgb,MAAO,SAGXia,GAAa/2B,UAAY9tB,OAAOg0B,OAAO,CAAC,EAAG+tB,GAAQj0B,UAAW,CAC1DqzB,WAAY9lD,IAAAA,KACZ+lD,aAAc/lD,IAAAA,KACd4pD,gBAAiB5pD,IAAAA,KACjB2pD,oBAAqB3pD,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/renderer/draw_line.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_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,CAC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ACE,YAyPkC,CAxPlC,gBAAA,CAGF,uFACE,WAsPyC,CArPzC,gBAAA,CACA,gBAAA,CAGF,2FACE,gBAAA,CAGF,uFACE,WA8O2B,CA7O3B,YA8OgC,CA7OhC,gBAAA,CACA,gBAAA,CACA,gDAAA,CAIA,yGACE,gBAAA,CAGF,0GACE,WAiOyB,CAhOzB,cAAA,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 minPointSpacing: PropTypes.number,\n rendering: PropTypes.oneOf(['line', 'bar', 'area', 'shadow']), // defaults to line\n negativeColor: PropTypes.string, // colors lines and points below zero for all renderings\n gradient: PropTypes.array, // only applies to area and shadow\n negativeGradient: PropTypes.array, // gradient for values below zero (area and shadow)\n zeroLineWidth: PropTypes.number, // only applies to bar and area\n zeroLineColor: PropTypes.string, // only applies to bar and area\n zeroLineY: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), // only applies to bar and area\n pointRadius: PropTypes.number, // only applies to area\n tooltipWidth: PropTypes.number,\n hasAreaBottom: PropTypes.bool,\n shadowColor: PropTypes.string,\n gradient: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.array])), // gradient colors or [position, color] pairs\n rangeKey: PropTypes.string\n});\n\nconst Series = PropTypes.arrayOf(SingleSeries);\n\nconst Axis = PropTypes.shape({\n axisIndex: PropTypes.number.isRequired,\n series: PropTypes.array.isRequired,\n side: PropTypes.oneOf(['left', 'right']).isRequired,\n scale: PropTypes.oneOf(['linear', 'log']).isRequired,\n label: PropTypes.string\n});\n\nconst Axes = PropTypes.arrayOf(Axis);\n\nconst CustomBoundsSelector = PropTypes.shape({\n label: PropTypes.string.isRequired,\n calculator: PropTypes.func.isRequired,\n datesOnly: PropTypes.bool\n});\n\nconst CustomBoundsSelectors = PropTypes.arrayOf(CustomBoundsSelector);\n\nconst TooltipOptionsRaw = {\n includeSeriesLabel: PropTypes.bool,\n includeXLabel: PropTypes.bool,\n includeYLabel: PropTypes.bool,\n includeXValue: PropTypes.bool,\n includeYValue: PropTypes.bool,\n floating: PropTypes.bool,\n alwaysFixedPosition: PropTypes.bool,\n floatPosition: PropTypes.oneOf(['top', 'bottom']),\n floatDelta: PropTypes.number,\n savingDisabled: PropTypes.bool,\n customTooltip: PropTypes.func,\n combineTooltips: PropTypes.oneOfType([PropTypes.bool, PropTypes.number])\n};\n\nconst TooltipOptions = PropTypes.shape(TooltipOptionsRaw);\n\nconst Annotation = PropTypes.shape({\n x: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.instanceOf(Date)]),\n startX: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.instanceOf(Date)]),\n endX: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.instanceOf(Date)]),\n series: PropTypes.arrayOf(PropTypes.string),\n content: PropTypes.string,\n lineOnly: PropTypes.bool\n});\nconst Annotations = PropTypes.arrayOf(Annotation);\n\nconst DraggablePoint = PropTypes.shape({\n x: PropTypes.number.isRequired,\n y: PropTypes.number.isRequired,\n radius: PropTypes.number,\n fillColor: PropTypes.string,\n strokeColor: PropTypes.string,\n strokeWidth: PropTypes.number,\n onClick: PropTypes.func,\n onDoubleClick: PropTypes.func\n});\nconst DraggablePoints = PropTypes.arrayOf(DraggablePoint);\n\nconst VerticalLine = PropTypes.shape({\n x: PropTypes.oneOfType([PropTypes.number, PropTypes.instanceOf(Date)]).isRequired,\n color: PropTypes.string,\n lineTop: PropTypes.number,\n width: PropTypes.number,\n markTop: PropTypes.bool,\n style: PropTypes.object,\n markerStyle: PropTypes.object,\n text: PropTypes.string,\n textTop: PropTypes.number,\n textStyle: PropTypes.object,\n minPixelX: PropTypes.number,\n maxPixelX: PropTypes.number,\n onRangeGraph: PropTypes.oneOfType([\n PropTypes.bool,\n PropTypes.object // anything that can be passed into the overall vertical line\n ]),\n onRangeGraphOnly: PropTypes.bool\n});\nconst VerticalLines = PropTypes.arrayOf(VerticalLine);\n\nconst CustomPropTypes = {\n Data,\n SingleSeries,\n Series,\n Axis,\n Axes,\n CustomBoundsSelector,\n CustomBoundsSelectors,\n TooltipOptions,\n TooltipOptionsRaw,\n Annotations,\n DraggablePoint,\n DraggablePoints,\n VerticalLine,\n VerticalLines\n};\n\n\nexport default CustomPropTypes;\n","export default class Eventable {\n\n constructor() {\n this._listeners = {};\n }\n\n /**\n * Clears all listeners\n * @protected\n */\n clearListeners() {\n this._listeners = {};\n }\n\n /**\n * Create a new listener for the event\n * When the event is emitted, it will call the provided function\n *\n * @param {String|symbol} eventName - the name of the event to start listening to\n * @param {Function} fn - the listener to add\n */\n on(eventName, fn) {\n this._listeners[eventName] = this._listeners[eventName] || new Set();\n this._listeners[eventName].add(fn);\n }\n\n /**\n * Removes an existing listener for the event\n *\n * @param {String|symbol} eventName - the name of the event to stop listening to\n * @param {Function} fn - the listener to remove\n */\n off(eventName, fn) {\n if (!this._listeners[eventName]) {\n return;\n }\n\n this._listeners[eventName].delete(fn);\n\n if (this._listeners[eventName].size === 0) {\n delete this._listeners[eventName];\n }\n }\n\n /**\n * Emits an event that will go out to all _listeners on eventName\n *\n * @param {String|symbol} eventName - the name of the event to emit\n */\n emit(eventName) {\n if (!this._listeners[eventName]) {\n return;\n }\n\n const args = [];\n for (let i = 1; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n\n this._listeners[eventName].forEach((fn) => {\n fn.apply(this, args);\n });\n }\n\n}\n","export const LINE_COLORS = [\n \"#F1C232\",\n \"#1259f8\",\n \"#cb4b4b\",\n \"#4da74d\",\n \"#9440ed\",\n \"#61e0ed\",\n \"#ed6d2c\",\n \"#ed13c6\",\n \"#bbed59\",\n];\n\nexport default function getColor(seriesColor, i, multigrapherSeriesIndex) {\n if (typeof seriesColor === \"string\") {\n return seriesColor;\n }\n\n if (typeof seriesColor === \"number\") {\n return LINE_COLORS[seriesColor % LINE_COLORS.length];\n }\n\n if (multigrapherSeriesIndex !== undefined) {\n return LINE_COLORS[multigrapherSeriesIndex % LINE_COLORS.length];\n }\n\n return LINE_COLORS[i % LINE_COLORS.length];\n}\n\n/**\n * Applies reduced opacity to a color\n * @param {string} color \n * @param {number} opacityFactor \n * @returns {string}\n */\nexport function applyReducedOpacity(color, opacityFactor) {\n if (!color) return color;\n\n if (color.startsWith(\"rgba(\")) {\n const matches = color.match(/rgba\\((\\d+),\\s*(\\d+),\\s*(\\d+),\\s*([\\d.]+)\\)/);\n if (matches) {\n const [, r, g, b, a] = matches;\n const newAlpha = parseFloat(a) * opacityFactor;\n return `rgba(${r}, ${g}, ${b}, ${newAlpha})`;\n }\n }\n\n if (color.startsWith(\"rgb(\")) {\n const matches = color.match(/rgb\\((\\d+),\\s*(\\d+),\\s*(\\d+)\\)/);\n if (matches) {\n const [, r, g, b] = matches;\n return `rgba(${r}, ${g}, ${b}, ${opacityFactor})`;\n }\n }\n\n if (color.startsWith(\"#\")) {\n let hex = color.slice(1);\n if (hex.length === 3) {\n hex = hex\n .split(\"\")\n .map((char) => char + char)\n .join(\"\");\n }\n const r = parseInt(hex.slice(0, 2), 16);\n const g = parseInt(hex.slice(2, 4), 16);\n const b = parseInt(hex.slice(4, 6), 16);\n return `rgba(${r}, ${g}, ${b}, ${opacityFactor})`;\n }\n\n return color;\n}\n\n/**\n * Applies reduced opacity to a gradient\n * @param {Array<[number, string]>} gradient \n * @param {number} opacityFactor \n * @returns {Array<[number, string]>}\n */\nexport function applyReducedOpacityToGradient(gradient, opacityFactor) {\n if (!gradient || !Array.isArray(gradient)) {\n return gradient;\n }\n\n return gradient.map((stop) => {\n if (Array.isArray(stop) && stop.length === 2) {\n const [position, color] = stop;\n const translucentColor = applyReducedOpacity(color, opacityFactor);\n return [position, translucentColor];\n } else if (typeof stop === \"string\") {\n return applyReducedOpacity(stop, opacityFactor);\n }\n return stop;\n });\n}\n\n/**\n * Creates a default gradient from a color at half opacity\n * @param {string} color \n * @returns {Array<[number, string]>}\n */\nexport function createDefaultGradient(color) {\n if (!color) return [[0, 'transparent'], [1, 'transparent']];\n \n const halfOpacityColor = applyReducedOpacity(color, 0.5);\n return [[0, halfOpacityColor], [1, halfOpacityColor]];\n}\n","import {extractYValue} from '../helpers/flatten_simple_data.js';\n\n/**\n * Given a series object, figures out the form of the data\n * Note that this is not a validator, nor is it guaranteed to get it right 100% of the time!\n * If it is giving the wrong type, it is recommended to specify the type manually\n *\n * @param {*} series\n * @param {Boolean} options.useSimpleData\n * @param {Array} options.data\n * @return {String}\n */\nexport default function inferType(series, options={ useSimpleData: false }) {\n if (series.type && series.type !== 'infer') {\n return series.type;\n }\n\n const data = options.data || (options.useSimpleData ? (series.simpleData || series.data) : series.data);\n\n if (!data) {\n throw new Error('Data must be provided');\n }\n\n if (Array.isArray(data)) {\n if (data.length === 0) {\n return 'tuples';\n }\n\n if (Array.isArray(data[0])) {\n return 'tuples';\n }\n\n if (typeof data[0] === 'number' || !data[0]) {\n return 'values';\n }\n\n return 'objects';\n }\n\n if (data.observe) {\n if (series.xKey) {\n return 'object_observable';\n } else {\n return 'tuple_observable';\n }\n }\n\n if (typeof data === 'function') {\n return 'generator';\n }\n\n throw new Error('Could not infer type');\n}\n\n/**\n *\n * @param simpleData\n * @param singleSeries\n * @return {boolean}\n */\nexport function isEnumLike(simpleData, singleSeries) {\n for (let i = 0; i < simpleData.length; i++) {\n const y = extractYValue(simpleData[simpleData.length - 1], singleSeries);\n if (y === null || y === undefined) {\n continue;\n }\n\n if (typeof y === 'string') {\n return true;\n }\n }\n\n return false;\n}\n","/**\n * Returns the color as a [r, g, b, a] array with domain 0 to 1 for use in webgl\n *\n * @param color\n * @return {[number, number, number, number]|[number, number, number, number]}\n */\nexport default function colorToVector(color) {\n if (color === 'black') {\n color = '#000000';\n } else if (color === 'white') {\n color = '#FFFFFF';\n } else if (color === 'transparent') {\n return [0, 0, 0, 0];\n }\n\n if (color.startsWith('rgb')) {\n const parts = color.split(',').map((part) => parseFloat(part.match(/\\d+(\\.\\d+)?/)[0]));\n return [\n parts[0]/255,\n parts[1]/255,\n parts[2]/255,\n parts.length >= 4 ? parts[3] : 1\n ];\n }\n\n if (typeof color !== 'string' || !/^#[\\dA-F]{3}$|^#[\\dA-F]{6}$/i.test(color)) {\n throw new Error(`Color must be a hex string: ${color}`);\n }\n\n // support for short hex codes, expanding 3-digit hex to 6-digit\n if (color.length === 4) {\n color = '#' + color[1] + color[1] + color[2] + color[2] + color[3] + color[3];\n }\n\n const r = parseInt(color.substr(1, 2), 16)/255;\n const g = parseInt(color.substr(3, 2), 16)/255;\n const b = parseInt(color.substr(5, 2), 16)/255;\n const a = 1.0;\n return [r, g, b, a];\n}\n","/**\n * Creates a webgl program, linking the shaders and checking for errors\n *\n * @param gl\n * @param vertShaderSource\n * @param fragShaderSource\n * @return {WebGLProgram}\n */\nexport default function createGLProgram(gl, vertShaderSource, fragShaderSource) {\n const vertexShader = gl.createShader(gl.VERTEX_SHADER);\n gl.shaderSource(vertexShader, vertShaderSource);\n gl.compileShader(vertexShader);\n if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) {\n console.error(gl.getShaderInfoLog(vertexShader)); // eslint-disable-line no-console\n return null;\n }\n\n const fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n gl.shaderSource(fragmentShader, fragShaderSource);\n gl.compileShader(fragmentShader);\n if (!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)) {\n console.error(gl.getShaderInfoLog(fragmentShader)); // eslint-disable-line no-console\n return null;\n }\n\n const program = gl.createProgram();\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n\n gl.linkProgram(program);\n \n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n console.error('Shader program linking failed:', gl.getProgramInfoLog(program));\n return null;\n }\n\n gl.validateProgram(program);\n if (!gl.getProgramParameter(program, gl.VALIDATE_STATUS)) {\n console.error('Shader program validation failed:', gl.getProgramInfoLog(program));\n return null;\n }\n\n return program;\n}\n","import backgroundFrag from './background.frag';\nimport backgroundVert from './background.vert';\nimport colorToVector from '../helpers/color_to_vector';\nimport createGLProgram from './create_gl_program';\n\nexport default class BackgroundProgram {\n\n constructor(gl) {\n this._gl = gl;\n\n this._program = createGLProgram(gl, backgroundVert, backgroundFrag);\n\n this._vertexBuffer = gl.createBuffer();\n this._indexBuffer = gl.createBuffer();\n\n if (!gl.getExtension('OES_element_index_uint')) {\n console.error('Your browser does not support OES_element_index_uint'); // eslint-disable-line no-console\n }\n }\n\n draw({ data }) {\n const gl = this._gl;\n gl.useProgram(this._program);\n\n // gl.disable(gl.DEPTH_TEST);\n\n for (let { minXt, maxXt, color } of data) {\n gl.uniform4f(gl.getUniformLocation(this._program, 'color'), ...colorToVector(color));\n\n const vertices = new Float32Array([\n minXt, 1, maxXt, 1, maxXt, -1,\n minXt, 1, maxXt, -1, minXt, -1\n ]);\n\n gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n\n const positionLocation = gl.getAttribLocation(this._program, 'position');\n gl.enableVertexAttribArray(positionLocation);\n gl.vertexAttribPointer(positionLocation, 2, gl.FLOAT, false, 0, 0);\n\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n }\n }\n\n}\n","export const DPI_INCREASE = 2;\n\n/**\n * Sizes the canvas such that rendering is pixel perfect\n * Returns the sizing information\n *\n * @param {HTMLCanvasElement} canvas\n * @param {CanvasRenderingContext2D} context\n * @param {Boolean} reset - if true, will reset the canvas size before checking sizing\n * @return {Promise<{boundingRect: DOMRect, pixelRatio: number, elementHeight: number, renderWidth: number, renderHeight: number, elementWidth: number}>}\n */\nexport default async function sizeCanvas(canvas, context, {reset=true}={}) {\n if (reset) {\n canvas.width = '';\n canvas.height = '';\n canvas.style.width = '0';\n canvas.style.height = '';\n\n await new Promise((resolve) => requestAnimationFrame(resolve));\n }\n\n let boundingRect = canvas.parentNode.getBoundingClientRect();\n\n while (boundingRect.width === 0) {\n await new Promise((resolve) => requestAnimationFrame(resolve));\n boundingRect = canvas.getBoundingClientRect();\n }\n\n const dpr = window.devicePixelRatio || 1;\n const bsr = context.webkitBackingStorePixelRatio ||\n context.mozBackingStorePixelRatio ||\n context.msBackingStorePixelRatio ||\n context.oBackingStorePixelRatio ||\n context.backingStorePixelRatio || 1;\n\n const pixelRatio = DPI_INCREASE*dpr / bsr;\n\n const elementWidth = boundingRect.width;\n const elementHeight = boundingRect.height;\n const renderWidth = elementWidth * pixelRatio;\n const renderHeight = elementHeight * pixelRatio;\n\n canvas.width = renderWidth;\n canvas.height = renderHeight;\n canvas.style.width = `${elementWidth}px`;\n canvas.style.height = `${elementHeight}px`;\n\n // We could us this to make coordinates behave as if they weren't transformed if we wanted\n // context.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0)\n\n return {\n pixelRatio,\n elementWidth,\n elementHeight,\n renderWidth,\n renderHeight,\n boundingRect\n };\n}\n","import {DPI_INCREASE} from './size_canvas';\n\n/**\n * Returns an array of contiguous paths from data in render space\n *\n * @param {{nullMask: Uint8Array, maxYValues: Float64Array, minYValues: Float64Array, yValues: Float64Array}} dataInRenderSpace\n * @param {Object} options\n * @param {Number} options.splitAtY - split the path whenever it's suddenly less or greater than this value\n * @return {[[Number]]}\n */\nexport default function pathsFrom(dataInRenderSpace, {splitAtY}={}) {\n const paths = [];\n let currentPath = [];\n let previouslyDiscontinuous = true;\n\n const { nullMask, maxYValues, minYValues, yValues } = dataInRenderSpace;\n\n for (let i = 0; i < yValues.length; i++) {\n const x = i*DPI_INCREASE;\n const y = yValues[i];\n\n if (nullMask[i] & 0b001) { // y null\n if (!previouslyDiscontinuous) {\n paths.push(currentPath);\n currentPath = [];\n }\n\n previouslyDiscontinuous = true;\n continue;\n }\n\n currentPath.push([x, y]);\n\n const minY = minYValues[i];\n const maxY = maxYValues[i];\n\n if (minY !== maxY) {\n if (!(nullMask[i] & 0b010)) {\n currentPath.push([x, minY]);\n }\n\n if (!(nullMask[i] & 0b100)) {\n currentPath.push([x, maxY]);\n }\n currentPath.push([x, y]);\n }\n\n previouslyDiscontinuous = false;\n\n if (typeof splitAtY === 'number' && i > 0) {\n const prevY = yValues[i-1];\n const signFlipped = !(nullMask[i-1] & 0b001) && (prevY < splitAtY && y >= splitAtY) || (prevY > splitAtY && y <= splitAtY) || (prevY === splitAtY && y !== splitAtY);\n\n if (signFlipped) {\n if (!previouslyDiscontinuous) {\n paths.push(currentPath);\n currentPath = [\n [x, y]\n ];\n }\n\n previouslyDiscontinuous = true;\n }\n }\n }\n\n if (!previouslyDiscontinuous) {\n paths.push(currentPath);\n }\n\n return paths;\n}\n","/**\n * Draws a horizontal line at the specified y-coordinate.\n *\n * @param {Number} y\n * @param {Object} options\n * @param {CanvasRenderingContext2D} options.context\n * @param {{renderWidth: Number, renderHeight: Number}} options.sizing\n * @param {String} options.color\n * @param {String} options.zeroColor\n * @param {Number} options.zeroWidth\n */\nexport function drawZeroLine(y, { context, sizing, color, zeroColor, zeroWidth}) {\n if (!zeroWidth) {\n return;\n }\n\n if (!context) {\n console.error('Canvas context is null in drawZeroLine');\n return;\n }\n\n context.strokeStyle = zeroColor || color;\n context.lineWidth = zeroWidth;\n\n context.beginPath();\n context.moveTo(0, y);\n context.lineTo(sizing.renderWidth, y);\n context.stroke();\n}\n","import pathsFrom from \"./paths_from\";\nimport { drawZeroLine } from \"./draw_zero_line\";\nimport { DPI_INCREASE } from \"./size_canvas\";\nimport { applyReducedOpacity, applyReducedOpacityToGradient } from \"../helpers/colors\";\n\n/**\n * Draws the data on the canvas\n * Assumes the data is in individual point render space, ie x and y in pixels\n *\n * @param {Array<[number, number]>} individualPoints - data to draw\n * @param {Object} dataInRenderSpace\n * @param {Object} options - set of options\n * @param {Object} options.context - the context to draw on\n * @param {String} options.color - color of the bar to draw\n * @param {{renderWidth: Number, renderHeight: Number}} options.sizing - size of the canvas, in pixels\n * @param {Number} options.zero - y coordinate that represents \"zero\"\n * @param {Boolean} options.hasNegatives - if any values are negative (in which case should render from zero)\n * @param {Array<String>} [options.gradient] - an array of stops, from top to bottom of canvas, to draw with\n * @param {String} [options.zeroColor] - color of the zero line\n * @param {Number} [options.zeroWidth] - width of the zero line\n * @param {Boolean} [options.showIndividualPoints] - draw circles at each point\n * @param {String} [options.negativeColor] - color of the area below zero\n * @param {Number} [options.width] - line width\n * @param {Object} [options.inRenderSpaceAreaBottom] - if provided, will use this as the area bottom instead of zero/sizing.renderHeight\n * @private\n */\nexport default function drawArea(\n individualPoints,\n dataInRenderSpace,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n negativeGradient,\n zeroColor,\n zeroWidth,\n showIndividualPoints,\n negativeColor,\n pointRadius,\n minPointSpacing,\n width,\n highlighted,\n shadowColor = \"black\",\n shadowBlur = 5,\n inRenderSpaceAreaBottom,\n cutoffIndex,\n cutoffOpacity,\n originalData,\n renderCutoffGradient,\n selectionBounds,\n isPreview,\n }\n) {\n if (!context) {\n console.error(\"Canvas context is null in drawArea\");\n return;\n }\n\n context.fillStyle = color;\n context.shadowColor = shadowColor;\n context.shadowBlur = shadowBlur;\n\n if (gradient && gradient.length >= 2) {\n const globalGradient = context.createLinearGradient(\n 0,\n 0,\n 0,\n sizing.renderHeight\n );\n\n for (let i = 0; i < gradient.length; i++) {\n const value = gradient[i];\n if (Array.isArray(value)) {\n globalGradient.addColorStop(value[0], value[1]);\n } else {\n globalGradient.addColorStop(i / (gradient.length - 1), value);\n }\n }\n\n context.fillStyle = globalGradient;\n\n if (color === \"gradient\") {\n context.strokeStyle = globalGradient;\n }\n } else {\n context.fillStyle = color;\n }\n\n if (!individualPoints.length) {\n return;\n }\n\n // we want to draw a polygon with a flat line at areaBottom, and then follows the shape of the data\n const areaBottom = hasNegatives ? zero : sizing.renderHeight;\n\n const shouldSplitAreaPaths = hasNegatives && negativeGradient;\n const areaPaths = pathsFrom(dataInRenderSpace, shouldSplitAreaPaths ? { splitAtY: zero } : undefined);\n const areaBottomPaths =\n inRenderSpaceAreaBottom && pathsFrom(inRenderSpaceAreaBottom, shouldSplitAreaPaths ? { splitAtY: zero } : undefined);\n\n const linePaths = pathsFrom(dataInRenderSpace, {\n splitAtY: zero,\n });\n\n if (renderCutoffGradient && cutoffIndex !== undefined && originalData) {\n drawAreaWithCutoff(\n individualPoints,\n areaPaths,\n areaBottomPaths,\n linePaths,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n showIndividualPoints,\n negativeColor,\n pointRadius,\n width,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n cutoffIndex,\n cutoffOpacity,\n originalData,\n selectionBounds,\n isPreview,\n }\n );\n return;\n }\n\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n \n // Determine if this path segment is positive or negative for gradient application\n let isPositive = true;\n if (hasNegatives && negativeGradient && path.length > 0) {\n // Check the average Y position of the path to determine if it's above or below zero\n let sumY = 0;\n for (let i = 0; i < path.length; i++) {\n sumY += path[i][1];\n }\n const avgY = sumY / path.length;\n isPositive = avgY <= zero; // In screen coordinates, smaller Y is higher up (positive)\n }\n \n // Set the fill style based on whether this is a positive or negative segment\n if (hasNegatives && negativeGradient) {\n if (isPositive) {\n // Use the original gradient or color for positive areas\n if (gradient && gradient.length >= 2) {\n const globalGradient = context.createLinearGradient(0, 0, 0, sizing.renderHeight);\n for (let i = 0; i < gradient.length; i++) {\n const value = gradient[i];\n if (Array.isArray(value)) {\n globalGradient.addColorStop(value[0], value[1]);\n } else {\n globalGradient.addColorStop(i / (gradient.length - 1), value);\n }\n }\n context.fillStyle = globalGradient;\n } else {\n context.fillStyle = color;\n }\n } else {\n // Use negativeGradient for negative areas\n if (negativeGradient.length >= 2) {\n const negGradient = context.createLinearGradient(0, 0, 0, sizing.renderHeight);\n for (let i = 0; i < negativeGradient.length; i++) {\n const value = negativeGradient[i];\n if (Array.isArray(value)) {\n negGradient.addColorStop(value[0], value[1]);\n } else {\n negGradient.addColorStop(i / (negativeGradient.length - 1), value);\n }\n }\n context.fillStyle = negGradient;\n } else {\n context.fillStyle = negativeColor || color;\n }\n }\n }\n \n context.beginPath();\n\n const [firstX, _startY] = path[0];\n const [lastX, _lastY] = path[path.length - 1];\n\n if (!areaBottomPaths) {\n context.moveTo(firstX, areaBottom);\n }\n\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n context.lineTo(x, y);\n }\n\n if (areaBottomPath && areaBottomPath.length) {\n for (let i = areaBottomPath.length - 1; i >= 0; i--) {\n const [x, y] = areaBottomPath[i];\n context.lineTo(x, y);\n }\n\n context.lineTo(...path[0]);\n } else {\n context.lineTo(lastX, areaBottom);\n }\n\n context.fill();\n }\n\n if (highlighted) {\n width += 2;\n }\n\n width *= DPI_INCREASE;\n context.strokeStyle = color;\n context.lineWidth = width;\n\n for (let path of linePaths) {\n if (!path.length) {\n continue;\n }\n\n if (hasNegatives && negativeColor) {\n let positive = true;\n if (path.length >= 2) {\n positive = path[1][1] <= zero;\n } else {\n positive = path[0][1] <= zero;\n }\n\n if (positive) {\n context.strokeStyle = color;\n } else {\n context.strokeStyle = negativeColor;\n }\n } else {\n context.strokeStyle = color;\n }\n\n context.beginPath();\n\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n\n context.stroke();\n }\n\n if (zeroWidth) {\n drawZeroLine(areaBottom, {\n context,\n sizing,\n color,\n zero,\n zeroColor,\n zeroWidth,\n });\n }\n\n if (showIndividualPoints && !renderCutoffGradient) {\n // Apply point spacing for individual point circles only\n function applyPointSpacing(points, minSpacing) {\n if (!minSpacing || points.length <= 1) {\n return points;\n }\n \n const spacedPoints = [];\n let lastX = -Infinity;\n \n for (const point of points) {\n const [x] = point;\n if (x - lastX >= minSpacing) {\n spacedPoints.push(point);\n lastX = x;\n }\n }\n \n return spacedPoints;\n }\n\n const pointsToRender = applyPointSpacing(individualPoints, minPointSpacing);\n for (let [x, y] of pointsToRender) {\n // Determine the color for this point\n let pointColor = color;\n if (negativeColor && hasNegatives) {\n if (y === zero && zeroColor) {\n pointColor = zeroColor;\n } else if (y < zero) {\n pointColor = color;\n } else {\n pointColor = negativeColor;\n }\n }\n \n context.fillStyle = pointColor;\n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n }\n}\n\n/**\n * Draws the data on the canvas with cutoff\n * Assumes the data is in individual point render space, ie x and y in pixels\n *\n * @param {Array<[number, number]>} individualPoints - data to draw\n * @param {Object} options - set of options\n * @param {Object} options.context - the context to draw on\n * @param {String} options.color - color of the area to draw\n * @param {{renderWidth: Number, renderHeight: Number}} options.sizing - size of the canvas, in pixels\n * @param {Number} options.zero - y coordinate that represents \"zero\"\n * @param {Boolean} options.hasNegatives - if any values are negative (in which case should render from zero)\n * @param {Array<String>} [options.gradient] - an array of stops, from top to bottom of canvas, to draw with\n * @param {String} [options.zeroColor] - color of the zero line\n * @param {Number} [options.zeroWidth] - width of the zero line\n * @param {Boolean} [options.showIndividualPoints] - draw circles at each point\n * @param {String} [options.negativeColor] - color of the area below zero\n * @param {Number} [options.width] - line width\n * @param {Object} [options.inRenderSpaceAreaBottom] - if provided, will use this as the area bottom instead of zero/sizing.renderHeight\n * @private\n */\nfunction drawAreaWithCutoff(\n individualPoints,\n areaPaths,\n areaBottomPaths,\n linePaths,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n showIndividualPoints,\n negativeColor,\n pointRadius,\n width,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n cutoffIndex,\n cutoffOpacity,\n originalData,\n selectionBounds,\n isPreview,\n }\n) {\n let cutoffTime;\n if (typeof originalData[0] === \"object\" && originalData[0].length === 2) {\n const baseIndex = Math.floor(cutoffIndex);\n const fraction = cutoffIndex - baseIndex;\n\n if (fraction === 0 || baseIndex >= originalData.length - 1) {\n const cutoffDate =\n originalData[Math.min(baseIndex, originalData.length - 1)][0];\n cutoffTime =\n cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n } else {\n const currentDate = originalData[baseIndex][0];\n const nextDate = originalData[baseIndex + 1][0];\n const currentTime =\n currentDate instanceof Date ? currentDate.getTime() : currentDate;\n const nextTime = nextDate instanceof Date ? nextDate.getTime() : nextDate;\n cutoffTime = currentTime + fraction * (nextTime - currentTime);\n }\n } else {\n cutoffTime = cutoffIndex;\n }\n\n let firstTime, lastTime;\n if (isPreview && selectionBounds) {\n firstTime = selectionBounds.minX instanceof Date ? selectionBounds.minX.getTime() : selectionBounds.minX;\n lastTime = selectionBounds.maxX instanceof Date ? selectionBounds.maxX.getTime() : selectionBounds.maxX;\n } else {\n firstTime = originalData[0][0] instanceof Date ? originalData[0][0].getTime() : originalData[0][0];\n lastTime = originalData[originalData.length - 1][0] instanceof Date ? \n originalData[originalData.length - 1][0].getTime() : originalData[originalData.length - 1][0];\n }\n\n const timeRatio = (cutoffTime - firstTime) / (lastTime - firstTime);\n\n if (timeRatio < 0) {\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n renderEntireArea(path, areaBottomPath, {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n } else if (timeRatio > 1) {\n const reducedOpacityGradient = gradient\n ? applyReducedOpacityToGradient(gradient, cutoffOpacity)\n : null;\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n renderEntireArea(path, areaBottomPath, {\n color: applyReducedOpacity(color, cutoffOpacity),\n context,\n sizing,\n zero,\n hasNegatives,\n gradient: reducedOpacityGradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n } else {\n if (isPreview) {\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n if (!path.length) {\n continue;\n }\n\n const renderCutoffIndex = timeRatio * path.length;\n const splitIndex = Math.floor(renderCutoffIndex);\n const fraction = renderCutoffIndex - splitIndex;\n\n let ghostPoint = null;\n if (splitIndex < path.length - 1 && fraction > 0) {\n const [x1, y1] = path[splitIndex];\n const [x2, y2] = path[splitIndex + 1];\n ghostPoint = [x1 + fraction * (x2 - x1), y1 + fraction * (y2 - y1)];\n }\n\n const shouldRenderPre =\n splitIndex > 0 || (splitIndex === 0 && fraction > 0);\n\n if (shouldRenderPre) {\n const preCutoffPath = path.slice(0, splitIndex + 1);\n if (ghostPoint && splitIndex < path.length - 1) {\n preCutoffPath.push(ghostPoint);\n }\n\n const preCutoffAreaBottomPath = areaBottomPath\n ? areaBottomPath.slice(0, splitIndex + 1)\n : null;\n if (\n ghostPoint &&\n preCutoffAreaBottomPath &&\n splitIndex < areaBottomPath.length - 1\n ) {\n const bottomGhostPoint = [ghostPoint[0], zero];\n preCutoffAreaBottomPath.push(bottomGhostPoint);\n }\n\n const reducedOpacityGradient = gradient\n ? applyReducedOpacityToGradient(gradient, cutoffOpacity)\n : null;\n renderEntireArea(preCutoffPath, preCutoffAreaBottomPath, {\n color: applyReducedOpacity(color, cutoffOpacity),\n context,\n sizing,\n zero,\n hasNegatives,\n gradient: reducedOpacityGradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n\n const shouldRenderPost =\n splitIndex < path.length - 1 ||\n (splitIndex === path.length - 1 && fraction === 0);\n\n if (shouldRenderPost) {\n const postCutoffPath = [];\n if (ghostPoint && splitIndex < path.length - 1) {\n postCutoffPath.push(ghostPoint);\n }\n postCutoffPath.push(...path.slice(splitIndex + 1));\n\n const postCutoffAreaBottomPath = [];\n if (\n ghostPoint &&\n areaBottomPath &&\n splitIndex < areaBottomPath.length - 1\n ) {\n const bottomGhostPoint = [ghostPoint[0], zero];\n postCutoffAreaBottomPath.push(bottomGhostPoint);\n }\n if (areaBottomPath) {\n postCutoffAreaBottomPath.push(\n ...areaBottomPath.slice(splitIndex + 1)\n );\n }\n\n renderEntireArea(\n postCutoffPath,\n postCutoffAreaBottomPath.length ? postCutoffAreaBottomPath : null,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n }\n );\n }\n }\n\n if (linePaths && linePaths.length > 0) {\n drawLinesWithCutoff(linePaths, timeRatio, {\n color,\n context,\n hasNegatives,\n negativeColor,\n zero,\n width,\n highlighted,\n cutoffOpacity,\n });\n }\n\n if (\n showIndividualPoints &&\n individualPoints &&\n individualPoints.length > 0\n ) {\n drawPointsWithCutoffByRatio(individualPoints, timeRatio, {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n cutoffOpacity,\n });\n }\n } else {\n if (!selectionBounds) {\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n renderEntireArea(path, areaBottomPath, {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n } else {\n const visibleMinTime =\n selectionBounds.minX instanceof Date\n ? selectionBounds.minX.getTime()\n : selectionBounds.minX;\n const visibleMaxTime =\n selectionBounds.maxX instanceof Date\n ? selectionBounds.maxX.getTime()\n : selectionBounds.maxX;\n\n if (cutoffTime < visibleMinTime) {\n // cutoff before visible range - render entire area normally\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n renderEntireArea(path, areaBottomPath, {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n } else if (cutoffTime > visibleMaxTime) {\n // cutoff after visible range - render entire area with reduced opacity\n const reducedOpacityGradient = gradient\n ? applyReducedOpacityToGradient(gradient, cutoffOpacity)\n : null;\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n renderEntireArea(path, areaBottomPath, {\n color: applyReducedOpacity(color, cutoffOpacity),\n context,\n sizing,\n zero,\n hasNegatives,\n gradient: reducedOpacityGradient,\n zeroColor,\n zeroWidth,\n highlighted,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom,\n });\n }\n } else {\n // cutoff within visible range - calculate position relative to visible bounds\n const visibleTimeRatio =\n (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n\n for (let pathI = 0; pathI < areaPaths.length; pathI++) {\n const path = areaPaths[pathI];\n const areaBottomPath = areaBottomPaths && areaBottomPaths[pathI];\n\n if (!path.length) {\n continue;\n }\n\n const renderCutoffIndex = visibleTimeRatio * path.length;\n const splitIndex = Math.floor(renderCutoffIndex);\n const fraction = renderCutoffIndex - splitIndex;\n\n // create ghost point for continuity if needed\n let ghostPoint = null;\n if (splitIndex < path.length - 1 && fraction > 0) {\n const [x1, y1] = path[splitIndex];\n const [x2, y2] = path[splitIndex + 1];\n ghostPoint = [\n x1 + fraction * (x2 - x1),\n y1 + fraction * (y2 - y1),\n ];\n }\n\n // render pre-cutoff area with reduced opacity\n const shouldRenderPre =\n splitIndex > 0 || (splitIndex === 0 && fraction > 0);\n\n if (shouldRenderPre) {\n renderAreaSegment(\n path,\n areaBottomPath,\n splitIndex,\n ghostPoint,\n true,\n {\n color: applyReducedOpacity(color, cutoffOpacity),\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n areaBottomPaths,\n }\n );\n }\n\n // render post-cutoff area with normal opacity\n const shouldRenderPost = splitIndex < path.length - 1;\n\n if (shouldRenderPost) {\n renderAreaSegment(\n path,\n areaBottomPath,\n splitIndex,\n ghostPoint,\n false,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n areaBottomPaths,\n }\n );\n }\n }\n }\n }\n }\n\n // draw outline lines with cutoff\n if (timeRatio >= 0 && timeRatio <= 1 && !isPreview) {\n if (selectionBounds) {\n const visibleMinTime =\n selectionBounds.minX instanceof Date\n ? selectionBounds.minX.getTime()\n : selectionBounds.minX;\n const visibleMaxTime =\n selectionBounds.maxX instanceof Date\n ? selectionBounds.maxX.getTime()\n : selectionBounds.maxX;\n\n // test case time\n if (cutoffTime < visibleMinTime) {\n // cutoff before visible range - draw lines normally\n drawLinesNormally(linePaths, {\n color,\n context,\n hasNegatives,\n negativeColor,\n width,\n highlighted,\n });\n } else if (cutoffTime > visibleMaxTime) {\n // cutoff after visible range - draw lines with reduced opacity (to match area)\n const reducedColor = applyReducedOpacity(color, cutoffOpacity);\n const reducedNegativeColor = negativeColor\n ? applyReducedOpacity(negativeColor, cutoffOpacity)\n : negativeColor;\n drawLinesNormally(linePaths, {\n color: reducedColor,\n context,\n hasNegatives,\n negativeColor: reducedNegativeColor,\n width,\n highlighted,\n });\n } else {\n // cutoff within visible range - split lines at cutoff\n const visibleTimeRatio =\n (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n drawLinesWithCutoff(linePaths, visibleTimeRatio, {\n color,\n context,\n hasNegatives,\n negativeColor,\n zero,\n width,\n highlighted,\n cutoffOpacity,\n });\n }\n } else {\n // no bounds available - draw lines normally\n drawLinesNormally(linePaths, {\n color,\n context,\n hasNegatives,\n negativeColor,\n width,\n highlighted,\n });\n }\n } else if (!isPreview) {\n // draw lines normally without cutoff\n drawLinesNormally(linePaths, {\n color,\n context,\n hasNegatives,\n negativeColor,\n width,\n highlighted,\n });\n }\n\n // draw other elements (zero line, points) normally\n if (zeroWidth) {\n const areaBottom = hasNegatives ? zero : sizing.renderHeight;\n drawZeroLine(areaBottom, {\n context,\n sizing,\n color,\n zero,\n zeroColor,\n zeroWidth,\n });\n }\n\n if (showIndividualPoints && !isPreview) {\n if (timeRatio >= 0 && timeRatio <= 1) {\n if (selectionBounds) {\n const visibleMinTime =\n selectionBounds.minX instanceof Date\n ? selectionBounds.minX.getTime()\n : selectionBounds.minX;\n const visibleMaxTime =\n selectionBounds.maxX instanceof Date\n ? selectionBounds.maxX.getTime()\n : selectionBounds.maxX;\n\n //test case time\n if (cutoffTime < visibleMinTime) {\n // cutoff before visible range - draw points normally\n drawPointsNormally(individualPoints, {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n });\n } else if (cutoffTime > visibleMaxTime) {\n // cutoff after visible range - draw points with reduced opacity\n const reducedColor = applyReducedOpacity(color, cutoffOpacity);\n const reducedNegativeColor = negativeColor\n ? applyReducedOpacity(negativeColor, cutoffOpacity)\n : negativeColor;\n const reducedZeroColor = zeroColor\n ? applyReducedOpacity(zeroColor, cutoffOpacity)\n : zeroColor;\n drawPointsNormally(individualPoints, {\n color: reducedColor,\n context,\n negativeColor: reducedNegativeColor,\n hasNegatives,\n zero,\n zeroColor: reducedZeroColor,\n pointRadius,\n });\n } else {\n // cutoff within visible range - split points at cutoff\n const visibleTimeRatio =\n (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n drawPointsWithCutoffByRatio(individualPoints, visibleTimeRatio, {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n cutoffOpacity,\n });\n }\n } else {\n // no bounds available - draw points normally\n drawPointsNormally(individualPoints, {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n });\n }\n } else {\n // cutoff outside data range - draw points normally\n drawPointsNormally(individualPoints, {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n });\n }\n } \n }\n}\n\nfunction renderEntireArea(\n path,\n areaBottomPath,\n {\n color,\n context,\n sizing,\n zero,\n hasNegatives,\n gradient,\n }\n) {\n context.fillStyle = color;\n\n if (gradient && gradient.length >= 2) {\n const globalGradient = context.createLinearGradient(\n 0,\n 0,\n 0,\n sizing.renderHeight\n );\n for (let i = 0; i < gradient.length; i++) {\n const value = gradient[i];\n if (Array.isArray(value)) {\n globalGradient.addColorStop(value[0], value[1]);\n } else {\n globalGradient.addColorStop(i / (gradient.length - 1), value);\n }\n }\n context.fillStyle = globalGradient;\n } else {\n }\n\n const areaBottom = hasNegatives ? zero : sizing.renderHeight;\n\n context.beginPath();\n\n const [firstX, _startY] = path[0];\n const [lastX, _lastY] = path[path.length - 1];\n\n if (!areaBottomPath) {\n context.moveTo(firstX, areaBottom);\n }\n\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n context.lineTo(x, y);\n }\n\n if (areaBottomPath && areaBottomPath.length) {\n for (let i = areaBottomPath.length - 1; i >= 0; i--) {\n const [x, y] = areaBottomPath[i];\n context.lineTo(x, y);\n }\n context.lineTo(...path[0]);\n } else {\n context.lineTo(lastX, areaBottom);\n }\n\n context.fill();\n}\n\nfunction renderAreaSegment(\n path,\n areaBottomPath,\n splitIndex,\n ghostPoint,\n isPreCutoff,\n { color, context, sizing, zero, hasNegatives, gradient, areaBottomPaths }\n) {\n context.fillStyle = color;\n\n if (gradient && gradient.length >= 2) {\n const globalGradient = context.createLinearGradient(\n 0,\n 0,\n 0,\n sizing.renderHeight\n );\n for (let i = 0; i < gradient.length; i++) {\n const value = gradient[i];\n if (Array.isArray(value)) {\n const gradientColor = isPreCutoff\n ? applyReducedOpacity(value[1], 0.35)\n : value[1];\n globalGradient.addColorStop(value[0], gradientColor);\n } else {\n const gradientColor = isPreCutoff\n ? applyReducedOpacity(value, 0.35)\n : value;\n globalGradient.addColorStop(i / (gradient.length - 1), gradientColor);\n }\n }\n context.fillStyle = globalGradient;\n } else {\n }\n\n const areaBottom = hasNegatives ? zero : sizing.renderHeight;\n\n context.beginPath();\n\n if (isPreCutoff) {\n const endIndex = ghostPoint ? splitIndex + 1 : splitIndex;\n const [firstX] = path[0];\n\n if (!areaBottomPaths) {\n context.moveTo(firstX, areaBottom);\n }\n\n for (let i = 0; i <= endIndex && i < path.length; i++) {\n const [x, y] = i === endIndex && ghostPoint ? ghostPoint : path[i];\n context.lineTo(x, y);\n }\n\n if (areaBottomPath && areaBottomPath.length) {\n for (let i = Math.min(endIndex, areaBottomPath.length - 1); i >= 0; i--) {\n const [x, y] = areaBottomPath[i];\n context.lineTo(x, y);\n }\n context.lineTo(...path[0]);\n } else {\n const lastPoint = ghostPoint || path[endIndex] || path[path.length - 1];\n context.lineTo(lastPoint[0], areaBottom);\n }\n } else {\n const startIndex = ghostPoint ? splitIndex : splitIndex + 1;\n const startPoint = ghostPoint || path[startIndex];\n\n if (startPoint) {\n context.moveTo(startPoint[0], areaBottom);\n\n if (ghostPoint) {\n context.lineTo(...ghostPoint);\n }\n for (let i = startIndex; i < path.length; i++) {\n context.lineTo(...path[i]);\n }\n\n if (areaBottomPath && areaBottomPath.length) {\n for (\n let i = areaBottomPath.length - 1;\n i >= Math.max(startIndex, 0);\n i--\n ) {\n const [x, y] = areaBottomPath[i];\n context.lineTo(x, y);\n }\n if (ghostPoint) {\n context.lineTo(ghostPoint[0], areaBottom);\n }\n } else {\n const [lastX] = path[path.length - 1];\n context.lineTo(lastX, areaBottom);\n }\n }\n }\n\n context.fill();\n}\n\nfunction drawPointsNormally(\n individualPoints,\n { color, context, negativeColor, hasNegatives, zero, zeroColor, pointRadius }\n) {\n if (!individualPoints || !Array.isArray(individualPoints)) {\n return;\n }\n\n for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[i];\n\n let pointColor = color;\n if (negativeColor && hasNegatives) {\n if (y === zero && zeroColor) {\n pointColor = zeroColor;\n } else if (y < zero) {\n pointColor = color;\n } else {\n pointColor = negativeColor;\n }\n }\n\n context.fillStyle = pointColor;\n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n}\n\nfunction drawLinesNormally(\n linePaths,\n { color, context, hasNegatives, negativeColor, width, highlighted }\n) {\n if (!linePaths || !Array.isArray(linePaths)) {\n return;\n }\n\n if (highlighted) {\n width += 2;\n }\n width *= DPI_INCREASE;\n\n for (let path of linePaths) {\n if (!path.length) continue;\n\n context.strokeStyle = hasNegatives && negativeColor ? negativeColor : color;\n context.lineWidth = width;\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n }\n}\n\nfunction drawLinesWithCutoff(\n linePaths,\n timeRatio,\n {\n color,\n context,\n hasNegatives,\n negativeColor,\n zero,\n width,\n highlighted,\n cutoffOpacity,\n }\n) {\n if (!linePaths || !Array.isArray(linePaths)) {\n return;\n }\n\n if (highlighted) {\n width += 2;\n }\n width *= DPI_INCREASE;\n\n const cutoffPixelX = timeRatio * context.canvas.width;\n const preCutoffPaths = [];\n const postCutoffPaths = [];\n\n for (let path of linePaths) {\n if (!path.length) continue;\n\n const prePath = [];\n const postPath = [];\n let ghostPoint = null;\n let splitIndex = -1;\n\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n \n if (x < cutoffPixelX) {\n prePath.push([x, y]);\n splitIndex = i;\n } else {\n postPath.push([x, y]);\n }\n }\n\n if (prePath.length > 0 && postPath.length > 0) {\n const lastPrePoint = prePath[prePath.length - 1];\n const firstPostPoint = postPath[0];\n const [x1, y1] = lastPrePoint;\n const [x2, y2] = firstPostPoint;\n \n if (x2 !== x1) {\n const fraction = (cutoffPixelX - x1) / (x2 - x1);\n ghostPoint = [cutoffPixelX, y1 + fraction * (y2 - y1)];\n prePath.push(ghostPoint);\n postPath.unshift(ghostPoint);\n }\n }\n\n if (prePath.length > 0) {\n preCutoffPaths.push(prePath);\n }\n if (postPath.length > 0) {\n postCutoffPaths.push(postPath);\n }\n }\n\n if (preCutoffPaths.length > 0) {\n const reducedColor = applyReducedOpacity(color, cutoffOpacity);\n context.strokeStyle = reducedColor;\n context.lineWidth = width;\n\n for (let path of preCutoffPaths) {\n if (path.length > 1) {\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n }\n }\n }\n\n if (postCutoffPaths.length > 0) {\n context.strokeStyle = hasNegatives && negativeColor ? negativeColor : color;\n context.lineWidth = width;\n\n for (let path of postCutoffPaths) {\n if (path.length > 1) {\n context.beginPath();\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n context.stroke();\n }\n }\n }\n}\n\nfunction drawPointsWithCutoffByRatio(\n individualPoints,\n timeRatio,\n {\n color,\n context,\n negativeColor,\n hasNegatives,\n zero,\n zeroColor,\n pointRadius,\n cutoffOpacity,\n }\n) {\n if (!individualPoints || !Array.isArray(individualPoints)) {\n return;\n }\n\n const canvasWidth = context.canvas.width;\n const cutoffPixelX = timeRatio * canvasWidth;\n\n for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[i];\n\n const isBeforeCutoff = x < cutoffPixelX;\n\n let pointColor = color;\n if (isBeforeCutoff) {\n pointColor = applyReducedOpacity(color, cutoffOpacity);\n }\n\n if (negativeColor && hasNegatives) {\n if (y === zero && zeroColor) {\n pointColor = zeroColor;\n } else if (y < zero) {\n pointColor = isBeforeCutoff\n ? applyReducedOpacity(color, cutoffOpacity)\n : color;\n } else {\n pointColor = isBeforeCutoff\n ? applyReducedOpacity(negativeColor, cutoffOpacity)\n : negativeColor;\n }\n }\n\n context.fillStyle = pointColor;\n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n}\n","import {drawZeroLine} from './draw_zero_line';\nimport { applyReducedOpacity } from \"../helpers/colors\";\n\n/**\n * Draws the data on the canvas\n * Assumes the data is in individual point render space, ie x and y in pixels\n *\n * @param {Array<[number, number]>} individualPoints - data to draw\n * @param {Object} options - set of options\n * @param {Object} options.context - the context to draw on\n * @param {String} options.color - color of the bar to draw\n * @param {{renderWidth: Number, renderHeight: Number}} options.sizing - size of the canvas, in pixels\n * @param {Number} options.indexInAxis - index of the series in the axis\n * @param {Number} options.axisSeriesCount - number of series in the axis\n * @param {Number} options.zero - y coordinate that represents \"zero\"\n * @param {Boolean} options.hasNegatives - if any values are negative (in which case should render from zero)\n * @param {String} options.negativeColor - color of the bar to draw if negative\n * @param {String} options.zeroColor - color of the zero line\n * @param {Number} options.zeroWidth - width of the zero line\n * @param {Number} options.closestSpacing - closest x spacing between points, in data space\n * @param {{minX: Number, maxX: Number}} options.bounds - bounds of the data as rendered\n * @private\n */\nexport default function drawBars(individualPoints, {\n color, context, sizing, indexInAxis, axisSeriesCount, zero, hasNegatives, negativeColor, zeroColor, zeroWidth, closestSpacing, bounds, cutoffIndex, cutoffOpacity, originalData, renderCutoffGradient, selectionBounds\n}) {\n if (!context) {\n console.error('Canvas context is null in drawBars');\n return;\n }\n \n context.strokeStyle = color;\n context.fillStyle = color;\n\n const {barWidth, totalBarWidth} = getBarWidths({ closestSpacing, bounds, sizing, axisSeriesCount });\n const barBottom = hasNegatives ? zero : sizing.renderHeight;\n\n if (renderCutoffGradient && cutoffIndex !== undefined && originalData) {\n drawBarsWithCutoff(individualPoints, {\n color, context, sizing, indexInAxis, axisSeriesCount, zero, hasNegatives, negativeColor, zeroColor, zeroWidth, closestSpacing, bounds, cutoffIndex, cutoffOpacity, originalData, selectionBounds, barWidth, totalBarWidth, barBottom\n });\n return;\n }\n\n for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[i];\n\n if (hasNegatives) {\n if (y <= zero) {\n context.fillStyle = color;\n } else {\n context.fillStyle = negativeColor;\n }\n }\n\n context.fillRect(x - totalBarWidth / 2 + barWidth*indexInAxis, y, barWidth, barBottom-y);\n }\n\n if (zeroWidth) {\n drawZeroLine(barBottom, {\n context,\n sizing,\n color,\n zero,\n zeroColor,\n zeroWidth\n });\n }\n}\n\nexport function getBarWidths({closestSpacing, bounds, sizing, axisSeriesCount}) {\n const fullBarWidth = closestSpacing / (bounds.maxX - bounds.minX) * sizing.renderWidth;\n\n const totalBarWidth = fullBarWidth * 0.8;\n const barSpacing = fullBarWidth * 0.2;\n const barWidth = totalBarWidth / axisSeriesCount;\n\n return {\n barWidth,\n totalBarWidth,\n barSpacing\n };\n}\n\n/**\n * Draws the data on the canvas with cutoff\n * Assumes the data is in individual point render space, ie x and y in pixels\n *\n * @param {Array<[number, number]>} individualPoints - data to draw\n * @param {Object} options - set of options\n * @param {Object} options.context - the context to draw on\n * @param {String} options.color - color of the bar to draw\n * @param {{renderWidth: Number, renderHeight: Number}} options.sizing - size of the canvas, in pixels\n * @param {Number} options.indexInAxis - index of the series in the axis\n * @param {Number} options.axisSeriesCount - number of series in the axis\n * @param {Number} options.zero - y coordinate that represents \"zero\"\n * @param {Boolean} options.hasNegatives - if any values are negative (in which case should render from zero)\n * @param {String} options.negativeColor - color of the bar to draw if negative\n * @param {String} options.zeroColor - color of the zero line\n * @param {Number} options.zeroWidth - width of the zero line\n * @param {Number} options.closestSpacing - closest x spacing between points, in data space\n * @param {{minX: Number, maxX: Number}} options.bounds - bounds of the data as rendered\n * @param {Number} options.cutoffIndex - index of the cutoff\n * @param {Number} options.cutoffOpacity - opacity of the cutoff\n * @param {Array<[number, number]>} options.originalData - original data\n * @param {Boolean} options.selectionBounds - if selection bounds are available\n * @param {Number} options.barWidth - width of the bar\n * @param {Number} options.totalBarWidth - total width of the bar\n * @param {Number} options.barBottom - y coordinate that represents the bottom of the bar\n * @private\n */\nfunction drawBarsWithCutoff(individualPoints, {\n color, context, sizing, indexInAxis, axisSeriesCount, zero, hasNegatives, negativeColor, zeroColor, zeroWidth, closestSpacing, bounds, cutoffIndex, cutoffOpacity, originalData, selectionBounds, barWidth, totalBarWidth, barBottom\n}) {\n let cutoffTime;\n if (typeof originalData[0] === 'object' && originalData[0].length === 2) {\n const baseIndex = Math.floor(cutoffIndex);\n const fraction = cutoffIndex - baseIndex;\n \n if (fraction === 0 || baseIndex >= originalData.length - 1) {\n const cutoffDate = originalData[Math.min(baseIndex, originalData.length - 1)][0];\n cutoffTime = cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n } else {\n const currentDate = originalData[baseIndex][0];\n const nextDate = originalData[baseIndex + 1][0];\n const currentTime = currentDate instanceof Date ? currentDate.getTime() : currentDate;\n const nextTime = nextDate instanceof Date ? nextDate.getTime() : nextDate;\n cutoffTime = currentTime + fraction * (nextTime - currentTime);\n }\n } else {\n cutoffTime = cutoffIndex; \n }\n\n for (let i = 0; i < individualPoints.length; i++) {\n const [x, y] = individualPoints[i];\n \n let barColor = color;\n let isBeforeCutoff = false;\n\n if (i < originalData.length) {\n const dataPoint = originalData[i];\n const pointTime = dataPoint[0] instanceof Date ? dataPoint[0].getTime() : dataPoint[0];\n isBeforeCutoff = pointTime < cutoffTime;\n \n if (isBeforeCutoff) {\n barColor = applyReducedOpacity(color, cutoffOpacity);\n }\n }\n\n if (hasNegatives) {\n if (y <= zero) {\n context.fillStyle = barColor;\n } else {\n const negColor = isBeforeCutoff ? applyReducedOpacity(negativeColor, cutoffOpacity) : negativeColor;\n context.fillStyle = negColor;\n }\n } else {\n context.fillStyle = barColor;\n }\n\n context.fillRect(x - totalBarWidth / 2 + barWidth*indexInAxis, y, barWidth, barBottom-y);\n }\n\n if (zeroWidth) {\n drawZeroLine(barBottom, {\n context, sizing, color, zero, zeroColor, zeroWidth\n });\n }\n}\n","import {DPI_INCREASE} from './size_canvas';\nimport pathsFrom from './paths_from';\nimport { applyReducedOpacity } from \"../helpers/colors\";\n\nfunction applyPointSpacing(points, minSpacing) {\n if (!minSpacing || points.length <= 1) {\n return points;\n }\n \n const spacedPoints = [];\n let lastX = -Infinity;\n \n for (const point of points) {\n const [x] = point;\n if (x - lastX >= minSpacing) {\n spacedPoints.push(point);\n lastX = x;\n }\n }\n \n return spacedPoints;\n}\n\nexport default function drawLine(dataInRenderSpace, {\n color, width=1, context, shadowColor='black', shadowBlur=5, dashed=false, dashPattern=null, highlighted=false, showIndividualPoints=false, pointRadius, minPointSpacing, getIndividualPoints, getRanges, cutoffIndex, cutoffOpacity, originalData, renderCutoffGradient, currentBounds, selectionBounds, rendering, isPreview, negativeColor, hasNegatives, zero, zeroColor\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 // Split paths at zero line if negativeColor is specified\n const paths = pathsFrom(dataInRenderSpace, hasNegatives && negativeColor ? { splitAtY: zero } : undefined);\n\n for (let path of paths) {\n if (renderCutoffGradient && cutoffIndex !== undefined && originalData) {\n let cutoffTime;\n if (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 if (hasNegatives && negativeColor) {\n let positive = true;\n if (path.length >= 2) {\n positive = path[1][1] <= zero;\n } else if (path.length > 0) {\n positive = path[0][1] <= zero;\n }\n context.strokeStyle = positive ? color : negativeColor;\n } else {\n context.strokeStyle = color;\n }\n\n context.beginPath();\n\n for (let i = 0; i < path.length; i++) {\n const [x, y] = path[i];\n\n if (i === 0) {\n context.moveTo(x, y);\n } else {\n context.lineTo(x, y);\n }\n }\n\n context.stroke();\n }\n }\n\n if (getRanges) {\n const ranges = getRanges();\n\n context.lineWidth = width;\n context.strokeStyle = color;\n context.setLineDash([]);\n const horizontalBarWidth = 8 * DPI_INCREASE;\n\n for (let range of ranges) {\n if (!range) {\n continue;\n }\n\n const { pixelX, pixelMinY, pixelMaxY } = range;\n\n if (pixelMinY !== null) {\n context.beginPath();\n context.moveTo(pixelX - (horizontalBarWidth / 2), pixelMinY);\n context.lineTo(pixelX + (horizontalBarWidth / 2), pixelMinY);\n context.stroke();\n }\n\n if (pixelMaxY !== null) {\n context.beginPath();\n context.moveTo(pixelX - (horizontalBarWidth / 2), pixelMaxY);\n context.lineTo(pixelX + (horizontalBarWidth / 2), pixelMaxY);\n context.stroke();\n }\n\n if (pixelMinY === null || pixelMaxY === null) {\n continue;\n }\n\n context.beginPath();\n context.moveTo(pixelX, pixelMinY);\n context.lineTo(pixelX, pixelMaxY);\n context.stroke();\n }\n }\n\n if (showIndividualPoints) {\n const individualPoints = getIndividualPoints();\n\n if (renderCutoffGradient && cutoffIndex !== undefined && originalData) {\n let cutoffTime;\n if (typeof originalData[0] === 'object' && originalData[0].length === 2) {\n const baseIndex = Math.floor(cutoffIndex);\n const fraction = cutoffIndex - baseIndex;\n \n if (fraction === 0 || baseIndex >= originalData.length - 1) {\n const cutoffDate = originalData[Math.min(baseIndex, originalData.length - 1)][0];\n cutoffTime = cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n } else {\n const currentDate = originalData[baseIndex][0];\n const nextDate = originalData[baseIndex + 1][0];\n const currentTime = currentDate instanceof Date ? currentDate.getTime() : currentDate;\n const nextTime = nextDate instanceof Date ? nextDate.getTime() : nextDate;\n cutoffTime = currentTime + fraction * (nextTime - currentTime);\n }\n } else {\n cutoffTime = cutoffIndex; \n }\n \n if (isPreview) {\n const visibleMinTime = selectionBounds.minX instanceof Date ? selectionBounds.minX.getTime() : selectionBounds.minX;\n const visibleMaxTime = selectionBounds.maxX instanceof Date ? selectionBounds.maxX.getTime() : selectionBounds.maxX;\n \n const spacedPoints = applyPointSpacing(individualPoints, minPointSpacing);\n for (let i = 0; i < spacedPoints.length; i++) {\n const [x, y] = spacedPoints[i];\n \n let isBeforeCutoff = false;\n if (cutoffTime < visibleMinTime) {\n isBeforeCutoff = false;\n } else if (cutoffTime > visibleMaxTime) {\n isBeforeCutoff = (rendering !== 'shadow');\n } else {\n const visibleCutoffRatio = (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n const cutoffPixelX = visibleCutoffRatio * context.canvas.width;\n isBeforeCutoff = x < cutoffPixelX;\n }\n \n let pointColor = color;\n if (negativeColor && hasNegatives) {\n if (y === zero && zeroColor) {\n pointColor = zeroColor;\n } else if (y < zero) {\n pointColor = color;\n } else {\n pointColor = negativeColor;\n }\n }\n \n if (isBeforeCutoff) {\n const reducedOpacityColor = applyReducedOpacity(pointColor, cutoffOpacity);\n context.fillStyle = reducedOpacityColor;\n } else {\n context.fillStyle = pointColor;\n }\n \n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n } else if (!selectionBounds) {\n const spacedPoints = applyPointSpacing(individualPoints, minPointSpacing);\n for (let i = 0; i < spacedPoints.length; i++) {\n const [x, y] = spacedPoints[i];\n \n // Determine point color based on position relative to zero\n let pointColor = color;\n if (negativeColor && hasNegatives) {\n if (y === zero && zeroColor) {\n pointColor = zeroColor;\n } else if (y < zero) {\n pointColor = color;\n } else {\n pointColor = negativeColor;\n }\n }\n \n context.fillStyle = pointColor;\n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n } else {\n const visibleMinTime = selectionBounds.minX instanceof Date ? selectionBounds.minX.getTime() : selectionBounds.minX;\n const visibleMaxTime = selectionBounds.maxX instanceof Date ? selectionBounds.maxX.getTime() : selectionBounds.maxX;\n \n const spacedPoints = applyPointSpacing(individualPoints, minPointSpacing);\n for (let i = 0; i < spacedPoints.length; i++) {\n const [x, y] = spacedPoints[i];\n \n let isBeforeCutoff = false;\n if (cutoffTime < visibleMinTime) {\n isBeforeCutoff = false;\n } else if (cutoffTime > visibleMaxTime) {\n isBeforeCutoff = (rendering !== 'shadow');\n } else {\n const visibleCutoffRatio = (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n const cutoffPixelX = visibleCutoffRatio * context.canvas.width;\n isBeforeCutoff = x < cutoffPixelX;\n }\n \n let pointColor = color;\n if (negativeColor && hasNegatives) {\n if (y === zero && zeroColor) {\n pointColor = zeroColor;\n } else if (y < zero) {\n pointColor = color;\n } else {\n pointColor = negativeColor;\n }\n }\n \n if (isBeforeCutoff) {\n const reducedOpacityColor = applyReducedOpacity(pointColor, cutoffOpacity);\n context.fillStyle = reducedOpacityColor;\n } else {\n context.fillStyle = pointColor;\n }\n \n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n }\n } else {\n const spacedPoints = applyPointSpacing(individualPoints, minPointSpacing);\n for (let i = 0; i < spacedPoints.length; i++) {\n const [x, y] = spacedPoints[i];\n \n // Determine point color based on position relative to zero\n let pointColor = color;\n if (negativeColor && hasNegatives) {\n if (y === zero && zeroColor) {\n pointColor = zeroColor;\n } else if (y < zero) {\n pointColor = color;\n } else {\n pointColor = negativeColor;\n }\n }\n \n context.fillStyle = pointColor;\n context.beginPath();\n context.arc(x, y, pointRadius || 8, 0, 2 * Math.PI, false);\n context.fill();\n }\n }\n }\n}\n","let rustApiModule;\nexport const RustAPIPromise = import('../rust/pkg/index.js').then((module) => {\n return module.default().then(() => {\n rustApiModule = module;\n });\n});\n\nexport default function RustAPI() {\n return rustApiModule;\n}\n","import pathsFrom from './paths_from';\nimport {DPI_INCREASE} from './size_canvas';\nimport RustAPI from '../state/rust_api';\n\n/**\n *\n * @param {[[Number]]} paths\n * @param {Boolean} dashed\n * @param {Array} dashPattern\n * @return {{prevPositions: Float32Array, indices: Uint32Array, vertices: Float32Array, positions: Float32Array}}\n */\nexport function extractVerticesFromPaths(paths, { dashed, dashPattern }) {\n let pointNumber = 0;\n for (let path of paths) {\n if (dashed) {\n for (let i = 0; i < path.length; i++) {\n if (dashed && i % (dashPattern[0] + dashPattern[1]) >= dashPattern[0]) {\n continue;\n }\n pointNumber++;\n }\n } else {\n pointNumber += path.length;\n }\n }\n\n const positions = new Float32Array(pointNumber*8);\n const prevPositions = new Float32Array(pointNumber*8);\n const vertices = new Float32Array(pointNumber*4);\n const indices = new Uint32Array(pointNumber*6);\n\n if (pointNumber > 0) {\n const verticesPattern = new Float32Array([0, 1, 2, 3]);\n vertices.set(verticesPattern);\n let vertexPointer = verticesPattern.length;\n let sourceLength = verticesPattern.length;\n while (vertexPointer < vertices.length) {\n if (vertexPointer + sourceLength > vertices.length) {\n sourceLength = vertices.length - vertexPointer;\n }\n\n vertices.copyWithin(vertexPointer, 0, sourceLength);\n vertexPointer += sourceLength;\n sourceLength <<= 1;\n }\n }\n\n let pointI = 0;\n for (let path of paths) {\n for (let i = 0; i < path.length; i++) {\n if (dashed && i % (dashPattern[0] + dashPattern[1]) >= dashPattern[0]) {\n continue;\n }\n\n const [x, y] = path[i];\n\n let prevX, prevY;\n\n if (i === 0) {\n prevX = x - 1;\n prevY = y;\n } else {\n [prevX, prevY] = path[i - 1];\n }\n\n for (let j = 0; j < 4; j++) {\n positions[pointI * 8 + 2 * j] = x;\n positions[pointI * 8 + 2 * j + 1] = y;\n prevPositions[pointI * 8 + 2 * j] = prevX;\n prevPositions[pointI * 8 + 2 * j + 1] = prevY;\n }\n\n indices[pointI * 6] = pointI * 4;\n indices[pointI * 6 + 1] = pointI * 4 + 1;\n indices[pointI * 6 + 2] = pointI * 4 + 3;\n\n indices[pointI * 6 + 3] = pointI * 4;\n indices[pointI * 6 + 4] = pointI * 4 + 2;\n indices[pointI * 6 + 5] = pointI * 4 + 3;\n\n pointI++;\n }\n }\n\n return {\n positions,\n prevPositions,\n vertices,\n indices\n };\n}\n\n/**\n * Takes the paths and turns them into what's needed for the line webgl program\n *\n * @param {{nullMask: Uint8Array, maxYValues: Float64Array, minYValues: Float64Array, yValues: Float64Array, paths?: [[Number]]}} dataInRenderSpace\n * @param {Boolean} dashed\n * @param {Array} dashPattern\n * @return {{prevPositions: Float32Array, indices: Uint32Array, vertices: Float32Array, positions: Float32Array}}\n */\nexport default function extractVertices(dataInRenderSpace, { dashed, dashPattern }) {\n if (dataInRenderSpace && dataInRenderSpace.paths) {\n return extractVerticesFromPaths(dataInRenderSpace.paths, { dashed, dashPattern});\n }\n\n if (!RustAPI()) {\n const paths = pathsFrom(dataInRenderSpace);\n return extractVerticesFromPaths(paths, { dashed, dashPattern});\n }\n\n const pointNumber = RustAPI().get_point_number(\n dataInRenderSpace.nullMask, dataInRenderSpace.yValues, dataInRenderSpace.minYValues, dataInRenderSpace.maxYValues,\n dashed, dashPattern[0], dashPattern[1]\n );\n\n let positions = new Float32Array(pointNumber*8);\n let prevPositions = new Float32Array(pointNumber*8);\n let vertices = new Float32Array(pointNumber*4);\n let indices = new Uint32Array(pointNumber*6);\n\n RustAPI().extract_vertices(\n DPI_INCREASE,\n dataInRenderSpace.nullMask, dataInRenderSpace.yValues, dataInRenderSpace.minYValues, dataInRenderSpace.maxYValues,\n positions, prevPositions, vertices, indices,\n dashed, dashPattern[0], dashPattern[1]\n );\n\n return {\n positions,\n prevPositions,\n vertices,\n indices\n };\n}\n","import lineFrag from './line.frag';\nimport lineVert from './line.vert';\nimport circleFrag from './circle.frag';\nimport circleVert from './circle.vert';\nimport colorToVector from '../helpers/color_to_vector';\nimport extractVertices from './extract_vertices';\nimport createGLProgram from './create_gl_program';\nimport {DPI_INCREASE} from './size_canvas';\nimport { applyReducedOpacity } from \"../helpers/colors\";\n\nexport default class LineProgram {\n\n constructor(gl) {\n this._gl = gl;\n\n this._program = createGLProgram(gl, lineVert, lineFrag);\n this._circleProgram = createGLProgram(gl, circleVert, circleFrag);\n\n this._positionBuffer = gl.createBuffer();\n this._prevPositionBuffer = gl.createBuffer();\n this._vertexBuffer = gl.createBuffer();\n this._indexBuffer = gl.createBuffer();\n this._individualPointBuffer = gl.createBuffer();\n\n if (!gl.getExtension('OES_element_index_uint')) {\n console.error('Your browser does not support OES_element_index_uint'); // eslint-disable-line no-console\n }\n }\n\n dispose() {\n\n }\n\n clear() {\n const gl = this._gl;\n const width = gl.drawingBufferWidth;\n const height = gl.drawingBufferHeight;\n\n gl.clearColor(0, 0, 0, 0);\n gl.viewport(0, 0, width, height);\n }\n\n /**\n * Draws the data on the canvas\n * Assumes the data is in render space\n *\n * @param {{nullMask: Uint8Array, maxYValues: Float64Array, minYValues: Float64Array, yValues: Float64Array}} dataInRenderSpace - the data to render\n * @param {Object} parameters - set of options\n * @param {String} parameters.color - color of the line to draw\n * @param {Number} [parameters.width] - line width\n * @param {Number} [parameters.shadowBlur] - level to blur shadow to\n * @param {String} [parameters.shadowColor] - color of the shadow\n * @param {String} [parameters.dashed] - whether or not to make the line dashed\n * @param {Array<Number>} [parameters.dashPattern] - dash array for the canvas\n * @param {Boolean} [parameters.highlighted] - whether the line is highlighted or not\n * @param {Boolean} [parameters.showIndividualPoints] - draw circles at each point\n * @param {Function} [parameters.getIndividualPoints] - points to draw circles at. Only called when needed.\n * @private\n */\n draw(dataInRenderSpace, parameters) {\n const gl = this._gl;\n const width = gl.drawingBufferWidth;\n const height = gl.drawingBufferHeight;\n gl.useProgram(this._program);\n\n const thickness = DPI_INCREASE*((parameters.width || 1) + (parameters.highlighted ? 2 : 0));\n const shadowBlur = parameters.shadowBlur === undefined ? 2 : parameters.shadowBlur;\n const shadowColor = parameters.shadowColor || 'black';\n const dashed = parameters.dashed || false;\n const dashPattern = parameters.dashPattern || [5, 5];\n if (parameters.renderCutoffGradient && parameters.cutoffIndex !== undefined && parameters.originalData) {\n this.drawLineWithCutoff(dataInRenderSpace, parameters);\n return;\n }\n\n const {positions, prevPositions, vertices, indices} = extractVertices(dataInRenderSpace, { dashed, dashPattern });\n\n if (!this._program) {\n console.error('WebGL line program is null - shader compilation failed!');\n return;\n }\n\n const positionIndex = gl.getAttribLocation(this._program, 'position');\n const prevPositionIndex = gl.getAttribLocation(this._program, 'prevPosition');\n const vertexIndex = gl.getAttribLocation(this._program, 'vertex');\n\n gl.enableVertexAttribArray(positionIndex);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._positionBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, positions, gl.STATIC_DRAW);\n gl.vertexAttribPointer(positionIndex, 2, gl.FLOAT, false, 0, 0);\n\n gl.enableVertexAttribArray(prevPositionIndex);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._prevPositionBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, prevPositions, gl.STATIC_DRAW);\n gl.vertexAttribPointer(prevPositionIndex, 2, gl.FLOAT, false, 0, 0);\n\n gl.enableVertexAttribArray(vertexIndex);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n gl.vertexAttribPointer(vertexIndex, 1, gl.FLOAT, false, 0, 0);\n\n gl.uniform1f(gl.getUniformLocation(this._program, 'width'), width);\n gl.uniform1f(gl.getUniformLocation(this._program, 'height'), height);\n gl.uniform1f(gl.getUniformLocation(this._program, 'thickness'), Math.max(thickness, 1)+shadowBlur);\n gl.uniform1f(gl.getUniformLocation(this._program, 'shadowBlur'), shadowBlur);\n const colorVector = colorToVector(parameters.color);\n gl.uniform4f(gl.getUniformLocation(this._program, 'color'), ...colorVector);\n gl.uniform4f(gl.getUniformLocation(this._program, 'shadowColor'), ...colorToVector(shadowColor));\n \n const cutoffX = parameters.cutoffX !== undefined ? parameters.cutoffX : -1.0; // Use parameter or disable\n const cutoffOpacity = parameters.cutoffOpacity !== undefined ? parameters.cutoffOpacity : 0.35;\n \n gl.uniform1f(gl.getUniformLocation(this._program, 'cutoffX'), cutoffX);\n gl.uniform1f(gl.getUniformLocation(this._program, 'cutoffOpacity'), cutoffOpacity);\n\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW);\n gl.drawElements(gl.TRIANGLES, indices.length, gl.UNSIGNED_INT, 0);\n\n if (parameters.showIndividualPoints) {\n gl.useProgram(this._circleProgram);\n\n gl.uniform1f(gl.getUniformLocation(this._circleProgram, 'width'), width);\n gl.uniform1f(gl.getUniformLocation(this._circleProgram, 'height'), height);\n const pointSize = parameters.pointRadius ? parameters.pointRadius * 2 * DPI_INCREASE : 2*(thickness+6);\n gl.uniform1f(gl.getUniformLocation(this._circleProgram, 'pointSize'), pointSize);\n\n let individualPoints = parameters.getIndividualPoints();\n \n if (parameters.minPointSpacing && individualPoints.length > 1) {\n const spacedPoints = [];\n let lastX = -Infinity;\n \n for (const point of individualPoints) {\n const [x] = point;\n if (x - lastX >= parameters.minPointSpacing) {\n spacedPoints.push(point);\n lastX = x;\n }\n }\n \n individualPoints = spacedPoints;\n }\n\n if (parameters.cutoffIndex !== undefined && parameters.cutoffIndex > 0 && parameters.originalData) {\n const { originalData } = parameters;\n let cutoffTime;\n \n if (typeof originalData[0] === 'object' && originalData[0].length === 2) {\n const baseIndex = Math.floor(parameters.cutoffIndex);\n const fraction = parameters.cutoffIndex - baseIndex;\n \n if (fraction === 0 || baseIndex >= originalData.length - 1) {\n const cutoffDate = originalData[Math.min(baseIndex, originalData.length - 1)][0];\n cutoffTime = cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n } else {\n const currentDate = originalData[baseIndex][0];\n const nextDate = originalData[baseIndex + 1][0];\n const currentTime = currentDate instanceof Date ? currentDate.getTime() : currentDate;\n const nextTime = nextDate instanceof Date ? nextDate.getTime() : nextDate;\n cutoffTime = currentTime + fraction * (nextTime - currentTime);\n }\n }\n \n const preCutoffPoints = [];\n const postCutoffPoints = [];\n\n if (parameters.isPreview) {\n const visibleMinTime = parameters.selectionBounds.minX instanceof Date ? parameters.selectionBounds.minX.getTime() : parameters.selectionBounds.minX;\n const visibleMaxTime = parameters.selectionBounds.maxX instanceof Date ? parameters.selectionBounds.maxX.getTime() : parameters.selectionBounds.maxX;\n const timeRatio = (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n const cutoffPixelX = timeRatio * width;\n \n for (let i = 0; i < individualPoints.length; i++) {\n const [pixelX, pixelY] = individualPoints[i];\n if (pixelX < cutoffPixelX) {\n preCutoffPoints.push(individualPoints[i]);\n } else {\n postCutoffPoints.push(individualPoints[i]);\n }\n }\n } else if (!parameters.selectionBounds) {\n postCutoffPoints.push(...individualPoints);\n } else {\n const visibleMinTime = parameters.selectionBounds.minX instanceof Date ? \n parameters.selectionBounds.minX.getTime() : parameters.selectionBounds.minX;\n const visibleMaxTime = parameters.selectionBounds.maxX instanceof Date ? \n parameters.selectionBounds.maxX.getTime() : parameters.selectionBounds.maxX;\n \n if (cutoffTime < visibleMinTime) {\n postCutoffPoints.push(...individualPoints);\n } else if (cutoffTime > visibleMaxTime) {\n if (parameters.rendering === 'shadow') {\n postCutoffPoints.push(...individualPoints);\n } else {\n preCutoffPoints.push(...individualPoints);\n }\n } else {\n const visibleCutoffRatio = (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n const renderWidth = this._gl.canvas.width;\n const cutoffPixelX = visibleCutoffRatio * renderWidth;\n \n individualPoints.forEach((point, index) => {\n const [pixelX, pixelY] = point;\n \n if (pixelX < cutoffPixelX) {\n preCutoffPoints.push(point);\n } else {\n postCutoffPoints.push(point);\n }\n });\n }\n }\n \n if (preCutoffPoints.length > 0) {\n const reducedOpacityColor = applyReducedOpacity(parameters.color, parameters.cutoffOpacity || 0.35);\n gl.uniform4f(gl.getUniformLocation(this._circleProgram, 'color'), ...colorToVector(reducedOpacityColor));\n \n gl.enableVertexAttribArray(0);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._individualPointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(preCutoffPoints.flat()), gl.STATIC_DRAW);\n gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);\n gl.drawArrays(gl.POINTS, 0, preCutoffPoints.length);\n }\n \n if (postCutoffPoints.length > 0) {\n gl.uniform4f(gl.getUniformLocation(this._circleProgram, 'color'), ...colorToVector(parameters.color));\n \n gl.enableVertexAttribArray(0);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._individualPointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(postCutoffPoints.flat()), gl.STATIC_DRAW);\n gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);\n gl.drawArrays(gl.POINTS, 0, postCutoffPoints.length);\n }\n } else {\n gl.uniform4f(gl.getUniformLocation(this._circleProgram, 'color'), ...colorToVector(parameters.color));\n\n gl.enableVertexAttribArray(0);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._individualPointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(individualPoints.flat()), gl.STATIC_DRAW);\n gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);\n\n gl.drawArrays(gl.POINTS, 0, individualPoints.length);\n }\n }\n }\n\n drawLineWithCutoff(dataInRenderSpace, parameters) {\n const { cutoffIndex, cutoffOpacity, originalData, selectionBounds } = parameters;\n \n let cutoffTime;\n if (typeof originalData[0] === 'object' && originalData[0].length === 2) {\n const baseIndex = Math.floor(cutoffIndex);\n const fraction = cutoffIndex - baseIndex;\n \n if (fraction === 0 || baseIndex >= originalData.length - 1) {\n const cutoffDate = originalData[Math.min(baseIndex, originalData.length - 1)][0];\n cutoffTime = cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n } else {\n const currentDate = originalData[baseIndex][0];\n const nextDate = originalData[baseIndex + 1][0];\n const currentTime = currentDate instanceof Date ? currentDate.getTime() : currentDate;\n const nextTime = nextDate instanceof Date ? nextDate.getTime() : nextDate;\n cutoffTime = currentTime + fraction * (nextTime - currentTime);\n }\n } else {\n cutoffTime = cutoffIndex; \n }\n\n if (parameters.isPreview) {\n const gl = this._gl;\n const visibleMinTime = selectionBounds.minX instanceof Date ? selectionBounds.minX.getTime() : selectionBounds.minX;\n const visibleMaxTime = selectionBounds.maxX instanceof Date ? selectionBounds.maxX.getTime() : selectionBounds.maxX;\n const timeRatio = (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n \n if (timeRatio < 0) {\n this.draw(dataInRenderSpace, { ...parameters, renderCutoffGradient: false });\n } else if (timeRatio > 1) {\n const reducedOpacityColor = applyReducedOpacity(parameters.color, cutoffOpacity);\n this.draw(dataInRenderSpace, { \n ...parameters, \n color: reducedOpacityColor,\n renderCutoffGradient: false \n });\n } else {\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n \n this.draw(dataInRenderSpace, {\n ...parameters,\n renderCutoffGradient: false,\n cutoffX: timeRatio,\n cutoffOpacity: cutoffOpacity || 0.35\n });\n }\n } else {\n if (!selectionBounds) {\n this.draw(dataInRenderSpace, { ...parameters, renderCutoffGradient: false });\n return;\n }\n \n const visibleMinTime = selectionBounds.minX instanceof Date ? selectionBounds.minX.getTime() : selectionBounds.minX;\n const visibleMaxTime = selectionBounds.maxX instanceof Date ? selectionBounds.maxX.getTime() : selectionBounds.maxX;\n\n if (cutoffTime < visibleMinTime) {\n this.draw(dataInRenderSpace, { ...parameters, renderCutoffGradient: false });\n } else if (cutoffTime > visibleMaxTime) {\n const reducedOpacityColor = applyReducedOpacity(parameters.color, cutoffOpacity);\n this.draw(dataInRenderSpace, { \n ...parameters, \n color: reducedOpacityColor,\n renderCutoffGradient: false \n });\n } else {\n const visibleCutoffRatio = (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);\n \n const gl = this._gl;\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n \n this.draw(dataInRenderSpace, {\n ...parameters,\n renderCutoffGradient: false,\n cutoffX: visibleCutoffRatio,\n cutoffOpacity: cutoffOpacity || 0.35\n });\n }\n }\n }\n}\n","import shadowFrag from \"./shadow.frag\";\nimport shadowVert from \"./shadow.vert\";\nimport colorToVector from \"../helpers/color_to_vector\";\nimport createGLProgram from \"./create_gl_program\";\nimport { applyReducedOpacity, applyReducedOpacityToGradient } from \"../helpers/colors\";\n\nexport default class ShadowProgram {\n constructor(gl) {\n this._gl = gl;\n\n this._program = createGLProgram(gl, shadowVert, shadowFrag);\n\n if (!this._program) {\n console.error(\"Failed to create shadow shader program\");\n this._program = null;\n return;\n }\n\n gl.validateProgram(this._program);\n if (!gl.getProgramParameter(this._program, gl.VALIDATE_STATUS)) {\n console.error(\n \"Shadow program validation failed:\",\n gl.getProgramInfoLog(this._program)\n );\n }\n\n const positionLoc = gl.getAttribLocation(this._program, \"position\");\n const trapezoidBoundsLoc = gl.getAttribLocation(\n this._program,\n \"trapezoidBounds\"\n );\n const trapezoidBottomLoc = gl.getAttribLocation(\n this._program,\n \"trapezoidBottom\"\n );\n\n if (\n positionLoc === -1 ||\n trapezoidBoundsLoc === -1 ||\n trapezoidBottomLoc === -1\n ) {\n console.error(\"Missing required shader attributes\");\n }\n\n this._positionBuffer = gl.createBuffer();\n this._trapezoidBoundsBuffer = gl.createBuffer();\n this._trapezoidBottomBuffer = gl.createBuffer();\n this._indexBuffer = gl.createBuffer();\n\n this._gradientTexture = gl.createTexture();\n\n if (!gl.getExtension(\"OES_element_index_uint\")) {\n console.error(\"Your browser does not support OES_element_index_uint\");\n }\n }\n\n dispose() {\n const gl = this._gl;\n if (this._gradientTexture) {\n gl.deleteTexture(this._gradientTexture);\n this._gradientTexture = null;\n }\n }\n\n /**\n * Convert trapezoids into WebGL geometry\n * @param {Array} trapezoids - Array of trapezoid definitions\n * @returns {Object} - Geometry data for WebGL\n */\n generateTrapezoidGeometry(trapezoids) {\n const positions = [];\n const trapezoidBounds = [];\n const trapezoidBottom = [];\n const indices = [];\n\n let vertexIndex = 0;\n\n for (const trap of trapezoids) {\n const { x1, y1, x2, y2, bottomY1, bottomY2 } = trap;\n\n const vertices = [\n [x1, y1],\n [x2, y2],\n [x2, bottomY2],\n [x1, bottomY1],\n ];\n\n const bounds = [x1, y1, x2, y2];\n const bottom = [x1, bottomY1, x2, bottomY2];\n\n for (let i = 0; i < 4; i++) {\n const [x, y] = vertices[i];\n\n positions.push(x, y);\n trapezoidBounds.push(...bounds);\n trapezoidBottom.push(...bottom);\n }\n\n indices.push(\n vertexIndex,\n vertexIndex + 1,\n vertexIndex + 2,\n vertexIndex,\n vertexIndex + 2,\n vertexIndex + 3\n );\n\n vertexIndex += 4;\n }\n\n return {\n positions: new Float32Array(positions),\n trapezoidBounds: new Float32Array(trapezoidBounds),\n trapezoidBottom: new Float32Array(trapezoidBottom),\n indices: new Uint32Array(indices),\n };\n }\n\n /**\n * Parse gradient definition to shader uniforms (supports up to 16 stops)\n * @param {Array} gradient - Gradient definition\n * @param {String} fallbackColor - Fallback color\n * @returns {Object} - Shader uniform data\n */\n parseGradient(gradient, fallbackColor) {\n if (!gradient || !Array.isArray(gradient) || gradient.length < 2) {\n const fallbackColorVec = colorToVector(fallbackColor);\n return {\n textureData: new Uint8Array([\n 0,\n 0,\n 0,\n 255,\n Math.floor(fallbackColorVec[0] * 255),\n Math.floor(fallbackColorVec[1] * 255),\n Math.floor(fallbackColorVec[2] * 255),\n Math.floor(fallbackColorVec[3] * 255),\n ]),\n textureWidth: 2,\n gradientCount: 1,\n fallbackColor: fallbackColorVec,\n };\n }\n\n const colors = [];\n const stops = [];\n\n for (let i = 0; i < gradient.length; i++) {\n const item = gradient[i];\n\n if (Array.isArray(item)) {\n stops.push(item[0]);\n colors.push(colorToVector(item[1]));\n } else {\n stops.push(i / (gradient.length - 1));\n colors.push(colorToVector(item));\n }\n }\n\n const textureWidth = colors.length * 2;\n const textureData = new Uint8Array(textureWidth * 4);\n\n for (let i = 0; i < colors.length; i++) {\n const stopIndex = i * 8;\n const colorIndex = stopIndex + 4;\n\n textureData[stopIndex] = Math.floor(stops[i] * 255);\n textureData[stopIndex + 1] = 0;\n textureData[stopIndex + 2] = 0;\n textureData[stopIndex + 3] = 255;\n\n textureData[colorIndex] = Math.floor(colors[i][0] * 255);\n textureData[colorIndex + 1] = Math.floor(colors[i][1] * 255);\n textureData[colorIndex + 2] = Math.floor(colors[i][2] * 255);\n textureData[colorIndex + 3] = Math.floor(colors[i][3] * 255);\n }\n\n return {\n textureData,\n textureWidth,\n gradientCount: colors.length,\n fallbackColor: colorToVector(fallbackColor),\n };\n }\n\n /**\n * Draw shadow/trapezoid geometry\n * @param {Array} individualPoints - Points defining the line\n * @param {Object} params - Rendering parameters\n */\n draw(individualPoints, params) {\n\n if (!individualPoints || individualPoints.length < 2) {\n return;\n }\n\n const gl = this._gl;\n const width = gl.drawingBufferWidth;\n const height = gl.drawingBufferHeight;\n\n gl.useProgram(this._program);\n\n if (\n params.renderCutoffGradient &&\n params.cutoffIndex !== undefined &&\n params.originalData\n ) {\n this.drawShadowWithCutoff(individualPoints, params);\n return;\n }\n\n const trapezoids = [];\n const positiveTrapezoids = [];\n const negativeTrapezoids = [];\n const { zero, inRenderSpaceAreaBottom, negativeGradient, hasNegatives } = params;\n\n\n for (let i = 0; i < individualPoints.length - 1; i++) {\n const [x1, y1] = individualPoints[i];\n const [x2, y2] = individualPoints[i + 1];\n\n let bottomY1 = zero;\n let bottomY2 = zero;\n\n const y1RelativeToZero = y1 - zero;\n const y2RelativeToZero = y2 - zero;\n const crossesZero = y1RelativeToZero * y2RelativeToZero < 0;\n\n if (crossesZero) {\n const t =\n Math.abs(y1RelativeToZero) /\n (Math.abs(y1RelativeToZero) + Math.abs(y2RelativeToZero));\n const xCross = x1 + (x2 - x1) * t;\n const yCross = zero;\n\n if (Math.abs(y1 - yCross) > 0.1) {\n const trap = {\n x1,\n y1,\n x2: xCross,\n y2: yCross,\n bottomY1,\n bottomY2: zero,\n };\n trapezoids.push(trap);\n \n // Determine if positive or negative (in screen coords, smaller Y is higher/positive)\n if (hasNegatives && negativeGradient) {\n if (y1 <= zero) {\n positiveTrapezoids.push(trap);\n } else {\n negativeTrapezoids.push(trap);\n }\n }\n }\n\n if (Math.abs(y2 - yCross) > 0.1) {\n const trap = {\n x1: xCross,\n y1: yCross,\n x2,\n y2,\n bottomY1: zero,\n bottomY2,\n };\n trapezoids.push(trap);\n \n // Determine if positive or negative\n if (hasNegatives && negativeGradient) {\n if (y2 <= zero) {\n positiveTrapezoids.push(trap);\n } else {\n negativeTrapezoids.push(trap);\n }\n }\n }\n } else {\n // Skip trapezoids completely outside canvas\n if (x1 > width || x2 < 0) {\n continue;\n }\n \n // Clip trapezoid to canvas bounds if it extends beyond\n let finalX2 = x2;\n let finalY2 = y2;\n let finalBottomY2 = bottomY2;\n \n if (x2 > width) {\n const ratio = (width - x1) / (x2 - x1);\n finalX2 = width;\n finalY2 = y1 + (y2 - y1) * ratio;\n finalBottomY2 = bottomY1 + (bottomY2 - bottomY1) * ratio;\n }\n \n const trapezoid = { x1, y1, x2: finalX2, y2: finalY2, bottomY1, bottomY2: finalBottomY2 };\n trapezoids.push(trapezoid);\n \n // Determine if positive or negative\n if (hasNegatives && negativeGradient) {\n // Check average Y position\n const avgY = (y1 + finalY2) / 2;\n if (avgY <= zero) {\n positiveTrapezoids.push(trapezoid);\n } else {\n negativeTrapezoids.push(trapezoid);\n }\n }\n }\n }\n\n if (trapezoids.length === 0) {\n return;\n }\n\n const positionLoc = gl.getAttribLocation(this._program, \"position\");\n const trapezoidBoundsLoc = gl.getAttribLocation(\n this._program,\n \"trapezoidBounds\"\n );\n const trapezoidBottomLoc = gl.getAttribLocation(\n this._program,\n \"trapezoidBottom\"\n );\n\n gl.uniform1f(gl.getUniformLocation(this._program, \"width\"), width);\n gl.uniform1f(gl.getUniformLocation(this._program, \"height\"), height);\n\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n\n // Helper function to render a set of trapezoids with a given gradient\n const renderTrapezoidSet = (trapSet, gradient, color) => {\n if (trapSet.length === 0) return;\n\n const geometry = this.generateTrapezoidGeometry(trapSet);\n\n gl.enableVertexAttribArray(positionLoc);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._positionBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, geometry.positions, gl.STATIC_DRAW);\n gl.vertexAttribPointer(positionLoc, 2, gl.FLOAT, false, 0, 0);\n\n gl.enableVertexAttribArray(trapezoidBoundsLoc);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._trapezoidBoundsBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, geometry.trapezoidBounds, gl.STATIC_DRAW);\n gl.vertexAttribPointer(trapezoidBoundsLoc, 4, gl.FLOAT, false, 0, 0);\n\n gl.enableVertexAttribArray(trapezoidBottomLoc);\n gl.bindBuffer(gl.ARRAY_BUFFER, this._trapezoidBottomBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, geometry.trapezoidBottom, gl.STATIC_DRAW);\n gl.vertexAttribPointer(trapezoidBottomLoc, 4, gl.FLOAT, false, 0, 0);\n\n const gradientData = this.parseGradient(gradient, color);\n\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, this._gradientTexture);\n\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gradientData.textureWidth,\n 1,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n gradientData.textureData\n );\n\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\n gl.uniform1i(gl.getUniformLocation(this._program, \"gradientTexture\"), 0);\n gl.uniform1i(\n gl.getUniformLocation(this._program, \"gradientCount\"),\n gradientData.gradientCount\n );\n gl.uniform4fv(\n gl.getUniformLocation(this._program, \"fallbackColor\"),\n gradientData.fallbackColor\n );\n\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, geometry.indices, gl.STATIC_DRAW);\n\n gl.drawElements(gl.TRIANGLES, geometry.indices.length, gl.UNSIGNED_INT, 0);\n };\n\n // If we have negativeGradient and separate trapezoid sets, render them separately\n if (hasNegatives && negativeGradient && (positiveTrapezoids.length > 0 || negativeTrapezoids.length > 0)) {\n // Render positive trapezoids with the normal gradient\n renderTrapezoidSet(positiveTrapezoids, params.gradient, params.color);\n \n // Render negative trapezoids with negativeGradient\n renderTrapezoidSet(negativeTrapezoids, negativeGradient, params.color);\n } else {\n // Fallback to rendering all trapezoids with the same gradient (original behavior)\n renderTrapezoidSet(trapezoids, params.gradient, params.color);\n }\n \n const error = gl.getError();\n if (error !== gl.NO_ERROR) {\n console.error('WebGL error in shadow rendering:', error);\n } else {\n //he he he haw\n }\n }\n\n /**\n * Draw shadow chart with cutoff gradient\n * @param {Array} individualPoints - Points defining the line\n * @param {Object} params - Rendering parameters with cutoff info\n */\n drawShadowWithCutoff(individualPoints, params) {\n\n const { cutoffIndex, cutoffOpacity, originalData, selectionBounds, zero } =\n params;\n\n this._lastIndividualPoints = null;\n this._lastParams = null;\n\n // All cutoff data is now in tuple format [x, y] from graph_body_renderer\n let cutoffTime;\n \n if (Array.isArray(originalData[0]) && originalData[0].length === 2) {\n const baseIndex = Math.floor(cutoffIndex);\n const fraction = cutoffIndex - baseIndex;\n\n if (fraction === 0 || baseIndex >= originalData.length - 1) {\n const cutoffItem = originalData[Math.min(baseIndex, originalData.length - 1)];\n const cutoffDate = cutoffItem[0];\n cutoffTime = cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n } else {\n const currentItem = originalData[baseIndex];\n const nextItem = originalData[baseIndex + 1];\n const currentDate = currentItem[0];\n const nextDate = nextItem[0];\n const currentTime = currentDate instanceof Date ? currentDate.getTime() : currentDate;\n const nextTime = nextDate instanceof Date ? nextDate.getTime() : nextDate;\n cutoffTime = currentTime + fraction * (nextTime - currentTime);\n }\n } else {\n cutoffTime = cutoffIndex;\n }\n\n const visibleBounds = params.selectionBounds;\n let firstTime, lastTime;\n \n if (visibleBounds && visibleBounds.minX !== undefined && visibleBounds.maxX !== undefined) {\n firstTime = visibleBounds.minX instanceof Date ? visibleBounds.minX.getTime() : visibleBounds.minX;\n lastTime = visibleBounds.maxX instanceof Date ? visibleBounds.maxX.getTime() : visibleBounds.maxX;\n } else {\n const firstItem = originalData[0];\n const lastItem = originalData[originalData.length - 1];\n const firstX = firstItem[0];\n const lastX = lastItem[0];\n \n firstTime = firstX instanceof Date ? firstX.getTime() : firstX;\n lastTime = lastX instanceof Date ? lastX.getTime() : lastX;\n }\n \n const timeDiff = cutoffTime - firstTime;\n const totalTime = lastTime - firstTime;\n const timeRatio = timeDiff / totalTime;\n\n if (timeRatio < 0) {\n this.draw(individualPoints, { ...params, renderCutoffGradient: false });\n } else if (timeRatio > 1) {\n const reducedOpacityColor = applyReducedOpacity(\n params.color,\n cutoffOpacity\n );\n const translucentGradient = applyReducedOpacityToGradient(\n params.gradient,\n cutoffOpacity\n );\n this.draw(individualPoints, {\n ...params,\n color: reducedOpacityColor,\n gradient: translucentGradient,\n renderCutoffGradient: false,\n });\n } else {\n this.drawSplitShadowTrapezoids(\n individualPoints,\n { ...params, selectionBounds: params.selectionBounds },\n timeRatio,\n cutoffTime\n );\n }\n }\n\n /**\n * Draw split shadow trapezoids with cutoff\n * @param {Array} individualPoints - Points defining the line\n * @param {Object} params - Rendering parameters\n * @param {number} timeRatio - Position of cutoff in visible range (0-1)\n * @param {number} cutoffTime - Cutoff timestamp\n */\n drawSplitShadowTrapezoids(individualPoints, params, timeRatio, cutoffTime) {\n const { zero, cutoffOpacity, selectionBounds } = params;\n const gl = this._gl;\n\n const renderWidth = gl.canvas.width;\n const cutoffPixelX = timeRatio * renderWidth;\n\n const preCutoffPoints = [];\n const postCutoffPoints = [];\n \n for (let i = 0; i < individualPoints.length; i++) {\n const [pixelX, pixelY] = individualPoints[i];\n \n if (pixelX < cutoffPixelX) {\n preCutoffPoints.push(individualPoints[i]);\n } else {\n postCutoffPoints.push(individualPoints[i]);\n }\n }\n \n let ghostPoint = null;\n if (preCutoffPoints.length > 0 && postCutoffPoints.length > 0) {\n const lastPrePoint = preCutoffPoints[preCutoffPoints.length - 1];\n const firstPostPoint = postCutoffPoints[0];\n \n const [x1, y1] = lastPrePoint;\n const [x2, y2] = firstPostPoint;\n \n if (x2 !== x1) {\n const interpolationRatio = (cutoffPixelX - x1) / (x2 - x1);\n const ghostY = y1 + interpolationRatio * (y2 - y1);\n ghostPoint = [cutoffPixelX, ghostY];\n \n preCutoffPoints.push(ghostPoint);\n postCutoffPoints.unshift(ghostPoint);\n }\n }\n\n if (preCutoffPoints.length >= 2) {\n const reducedOpacityColor = applyReducedOpacity(\n params.color,\n cutoffOpacity\n );\n const gl = this._gl;\n\n gl.disable(gl.DEPTH_TEST);\n\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n\n const translucentGradient = applyReducedOpacityToGradient(\n params.gradient,\n cutoffOpacity\n );\n\n this.draw(preCutoffPoints, {\n ...params,\n color: reducedOpacityColor,\n gradient: translucentGradient,\n renderCutoffGradient: false,\n });\n } else {\n }\n\n if (postCutoffPoints.length >= 2) {\n this.draw(postCutoffPoints, {\n ...params,\n renderCutoffGradient: false,\n });\n } else {\n }\n }\n}\n","import Eventable from '../eventable';\nimport getColor, { createDefaultGradient } from '../helpers/colors';\nimport inferType from '../state/infer_type';\nimport BackgroundProgram from './background_program.js';\nimport drawArea from './draw_area';\nimport drawBackground from './draw_background.js';\nimport drawBars from './draw_bars';\nimport drawLine from './draw_line';\nimport LineProgram from './line_program';\nimport ShadowProgram from './shadow_program';\nimport sizeCanvas, { DPI_INCREASE } from './size_canvas';\n\nexport default class GraphBodyRenderer extends Eventable {\n\n constructor({stateController, canvasElement, webgl=false, checkIntersection=true }) {\n super();\n\n this._stateController = stateController;\n\n this._checkIntersection = checkIntersection;\n this._canvas = canvasElement;\n this._webgl = webgl;\n \n if (!this._canvas) {\n console.error('Canvas element is null in GraphBodyRenderer constructor');\n this._initialized = false;\n return;\n }\n \n if (webgl) {\n this._context = this._canvas.getContext('webgl');\n if (this._context) {\n this._lineProgram = new LineProgram(this._context);\n this._shadowProgram = new ShadowProgram(this._context);\n } else {\n console.error('❌ WebGL context creation failed');\n alert('WebGL failed! Attempting fallback to CPU rendering');\n this._webgl = false;\n }\n }\n\n if (!this._webgl) {\n this._context = this._canvas.getContext('2d');\n this._context2d = this._context;\n }\n\n if (!this._context) {\n console.error('Failed to get canvas context in GraphBodyRenderer');\n this._initialized = false;\n return;\n }\n\n this._initialized = this._initializeCanvas();\n\n this._boundResize = this.resize.bind(this);\n this._cachedAxisCount = null;\n this._onAxisChange = (axes) => {\n const count = axes.filter(({ series }) => series.length > 0).length;\n if (this._cachedAxisCount !== count) {\n this._cachedAxisCount = count;\n this.resize();\n }\n };\n\n stateController.on('axes_changed', this._onAxisChange);\n stateController.on('dragging_y_changed', this._boundResize);\n stateController.on('showing_sidebar_changed', this._boundResize);\n }\n\n /**\n * Cleans up after this renderer\n */\n dispose() {\n this.clearListeners();\n this._lineProgram && this._lineProgram.dispose();\n this._shadowProgram && this._shadowProgram.dispose();\n this._cachedAxisCount = null;\n this._stateController.off('axes_changed', this._onAxisChange);\n this._stateController.off('dragging_y_changed', this._boundResize);\n\n if (this._resizeObserver) {\n this._resizeObserver.disconnect();\n }\n\n if (this._intersectionObserver) {\n this._intersectionObserver.disconnect();\n }\n\n if (this._zeroLineCanvas && this._zeroLineCanvas.parentNode) {\n this._zeroLineCanvas.parentNode.removeChild(this._zeroLineCanvas);\n this._zeroLineCanvas = null;\n this._zeroLineContext = null;\n }\n }\n\n clear() {\n if (this._webgl) {\n this._lineProgram.clear();\n } else {\n this._context.clearRect(0, 0, this._context.canvas.width, this._context.canvas.height);\n }\n }\n\n render(singleSeries, inRenderSpace, { highlighted, showIndividualPoints, shadowColor, shadowBlur, width, defaultLineWidth, bounds, globalBounds, inRenderSpaceAreaBottom }) {\n if (!this._initialized || !this._context || !this._canvas) {\n console.warn('GraphBodyRenderer: Cannot render - not initialized, missing context, or missing canvas');\n return;\n }\n \n let cutoffIndex = -1;\n let cutoffTime = null; \n let cutoffData = singleSeries.data; \n\n const isObjectFormat = singleSeries.data && singleSeries.data.length > 0 && \n typeof singleSeries.data[0] === 'object' && \n !Array.isArray(singleSeries.data[0]);\n \n if (isObjectFormat && singleSeries.cutoffTime) {\n cutoffData = singleSeries.data.map(point => {\n const xValue = point[singleSeries.xKey || 'x'];\n const yValue = point[singleSeries.yKey || 'y'];\n \n const convertedX = typeof xValue === 'string' ? new Date(xValue) : xValue;\n \n return [convertedX, yValue];\n });\n }\n \n if (singleSeries.cutoffTime && singleSeries.data && singleSeries.data.length > 0) {\n let cutoffDate;\n if (singleSeries.cutoffTime === 'now') {\n cutoffDate = new Date();\n } else if (typeof singleSeries.cutoffTime === 'number') {\n cutoffDate = new Date(singleSeries.cutoffTime);\n } else {\n cutoffDate = singleSeries.cutoffTime;\n }\n \n cutoffTime = cutoffDate instanceof Date ? cutoffDate.getTime() : cutoffDate;\n \n for (let i = 0; i < cutoffData.length - 1; i++) {\n const currentPoint = cutoffData[i];\n const nextPoint = cutoffData[i + 1];\n \n const currentTime = currentPoint[0] instanceof Date ? currentPoint[0].getTime() : currentPoint[0];\n const nextTime = nextPoint[0] instanceof Date ? nextPoint[0].getTime() : nextPoint[0];\n \n if (currentTime <= cutoffTime && cutoffTime <= nextTime) {\n const timeRatio = (cutoffTime - currentTime) / (nextTime - currentTime);\n cutoffIndex = i + timeRatio;\n break;\n } else if (currentTime > cutoffTime) {\n cutoffIndex = i;\n break;\n }\n }\n \n if (cutoffIndex === -1) {\n cutoffIndex = cutoffData.length - 1;\n }\n }\n \n const getIndividualPoints = (useDataSpace, includeBeyondBounds = false) => {\n if (!useDataSpace && inRenderSpace && inRenderSpace.yValues && !showIndividualPoints) {\n if (!bounds) {\n bounds = singleSeries.axis.currentBounds;\n }\n \n const individualPoints = [];\n const { yValues, nullMask } = inRenderSpace;\n const threshold = yValues.length / 2;\n let pastThreshold = 0;\n const samples = [];\n \n for (let pixelX = 0; pixelX < yValues.length; pixelX++) {\n if (nullMask[pixelX] === 0) {\n const xCoord = pixelX * DPI_INCREASE;\n individualPoints.push([xCoord, yValues[pixelX]]);\n \n if (pixelX > threshold) {\n pastThreshold++;\n if (samples.length < 3) samples.push({pixelX, xCoord, nullMask: nullMask[pixelX]});\n }\n }\n }\n \n if (individualPoints.length < 50) {\n return getIndividualPoints(true, includeBeyondBounds);\n }\n\n return individualPoints;\n }\n\n if (!bounds) {\n bounds = singleSeries.axis.currentBounds;\n }\n\n const individualPoints = [];\n let data = singleSeries.inSelectedSpace.data;\n if (useDataSpace) {\n data = singleSeries.inDataSpace;\n }\n\n let boundsMinX = bounds.minX instanceof Date ? bounds.minX.getTime() : bounds.minX;\n let boundsMaxX = bounds.maxX instanceof Date ? bounds.maxX.getTime() : bounds.maxX;\n \n let foundBeyondBounds = false;\n let lastPointBeforeBounds = null;\n \n for (let i = 0; i < data.length; i++) {\n let x, y;\n \n if (Array.isArray(data[i])) {\n [x, y] = data[i];\n } else if (typeof data[i] === 'object' && data[i] !== null) {\n x = data[i][singleSeries.xKey];\n y = data[i][singleSeries.yKey];\n } else {\n continue;\n }\n \n if (y === null || y === undefined) {\n continue;\n }\n\n let xValue = x instanceof Date ? x.getTime() : x;\n \n if (xValue < boundsMinX) {\n if (includeBeyondBounds) {\n lastPointBeforeBounds = [xValue, y];\n }\n continue;\n }\n \n if (xValue > boundsMaxX) {\n if (includeBeyondBounds && !foundBeyondBounds) {\n foundBeyondBounds = true;\n } else {\n break;\n }\n }\n\n const renderWidth = this._sizing.renderWidth / DPI_INCREASE;\n const xCoord = (xValue - boundsMinX) / (boundsMaxX - boundsMinX) * (renderWidth - 1) * DPI_INCREASE;\n const yCoord = (1.0 - (y - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight;\n \n individualPoints.push([xCoord, yCoord]);\n }\n\n if (lastPointBeforeBounds && includeBeyondBounds) {\n const [beforeXValue, beforeY] = lastPointBeforeBounds;\n const renderWidth = this._sizing.renderWidth / DPI_INCREASE;\n const beforeXCoord = (beforeXValue - boundsMinX) / (boundsMaxX - boundsMinX) * (renderWidth - 1) * DPI_INCREASE;\n const beforeYCoord = (1.0 - (beforeY - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight;\n individualPoints.unshift([beforeXCoord, beforeYCoord]);\n }\n\n return individualPoints;\n };\n\n const getRanges = () => {\n if (!bounds) {\n bounds = singleSeries.axis.currentBounds;\n }\n\n if (!singleSeries.rangeKey) {\n return [];\n }\n\n const inferredType = inferType(singleSeries, { useSimpleData: true });\n if (inferredType !== 'objects') {\n return [];\n }\n\n return (singleSeries.simpleData || singleSeries.data).map((object) => {\n const range = object[singleSeries.rangeKey];\n\n if (!range) {\n return null;\n }\n\n const min = range.min;\n const max = range.max;\n const x = object[singleSeries.xKey];\n\n return {\n x,\n range,\n\n pixelX: (x - bounds.minX) / (bounds.maxX - bounds.minX) * this._sizing.renderWidth,\n pixelMinY: typeof min === 'number' ? (1.0 - (min - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight : null,\n pixelMaxY: typeof max === 'number' ? (1.0 - (max - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight : null\n };\n });\n };\n\n const cpuRendering = singleSeries.rendering === 'bar' || singleSeries.rendering === 'area';\n let commonCPUParams;\n\n if (cpuRendering) {\n if (this._webgl) {\n console.warn(`CPU rendering (${singleSeries.rendering}) is not supported with webgl={true}. Use webgl={false} or switch to 'line' rendering.`);\n return;\n }\n \n if (!this._context2d) {\n this._context2d = this._canvas.getContext('2d', { willReadFrequently: false });\n }\n \n if (!this._context2d) {\n console.error('Failed to get 2D context for CPU rendering');\n return;\n }\n\n if (this._webgl) {\n this._context.flush();\n }\n\n if (!bounds) {\n bounds = singleSeries.axis.currentBounds;\n }\n\n const zero = singleSeries.zeroLineY === 'bottom' ?\n this._sizing.renderHeight :\n (1.0 - ((singleSeries.zeroLineY || 0) - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight;\n\n commonCPUParams = {\n context: this._context2d,\n color: getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex),\n sizing: this._sizing,\n zero,\n hasNegatives: !!singleSeries.inDataSpace.find((tuple) => tuple[1] < 0),\n negativeColor: singleSeries.negativeColor,\n zeroWidth: singleSeries.zeroLineWidth,\n zeroColor: singleSeries.zeroLineColor\n };\n\n if (!commonCPUParams.hasNegatives && singleSeries.expandYWith) {\n commonCPUParams.hasNegatives = singleSeries.expandYWith.some((y) => y < 0);\n }\n }\n\n if (singleSeries.rendering === 'bar') {\n let barParams = {\n ...commonCPUParams,\n indexInAxis: singleSeries.axis.series.indexOf(singleSeries),\n axisSeriesCount: singleSeries.axis.series.length,\n closestSpacing: globalBounds.closestSpacing,\n bounds\n };\n\n if (singleSeries.cutoffTime) {\n barParams.cutoffIndex = cutoffIndex;\n barParams.cutoffOpacity = singleSeries.cutoffOpacity !== undefined ? singleSeries.cutoffOpacity : 0.35;\n barParams.originalData = cutoffData;\n barParams.renderCutoffGradient = cutoffIndex >= 0; \n \n const selection = this === this._stateController.rangeGraphRenderer \n ? this._stateController._bounds \n : (this._stateController._selection || this._stateController._bounds);\n barParams.selectionBounds = selection;\n }\n\n drawBars(getIndividualPoints(true), barParams);\n return;\n }\n\n if (singleSeries.rendering === 'area') {\n let areaParams = {\n ...commonCPUParams,\n showIndividualPoints: typeof singleSeries.showIndividualPoints === 'boolean' ? singleSeries.showIndividualPoints : showIndividualPoints,\n gradient: singleSeries.gradient,\n negativeGradient: singleSeries.negativeGradient,\n pointRadius: singleSeries.pointRadius,\n minPointSpacing: singleSeries.minPointSpacing,\n highlighted,\n width: width || singleSeries.width || defaultLineWidth,\n shadowColor,\n shadowBlur,\n inRenderSpaceAreaBottom\n };\n\n if (singleSeries.cutoffTime) {\n areaParams.cutoffIndex = cutoffIndex;\n areaParams.cutoffOpacity = singleSeries.cutoffOpacity !== undefined ? singleSeries.cutoffOpacity : 0.35;\n areaParams.originalData = cutoffData;\n areaParams.renderCutoffGradient = cutoffIndex >= 0; \n areaParams.isPreview = this === this._stateController.rangeGraphRenderer; \n \n const selection = this === this._stateController.rangeGraphRenderer \n ? this._stateController._bounds \n : (this._stateController._selection || this._stateController._bounds);\n areaParams.selectionBounds = selection;\n }\n\n drawArea(getIndividualPoints(true), inRenderSpace, areaParams);\n }\n\n if (singleSeries.rendering === 'shadow') {\n if (!this._webgl || !this._shadowProgram) {\n console.warn('Shadow rendering requires WebGL. Enable webgl={true} on your Grapher component.', {\n webgl: !!this._webgl,\n shadowProgram: !!this._shadowProgram,\n program: !!this._shadowProgram?._program\n });\n return;\n }\n \n if (!this._shadowProgram._program) {\n console.error('ShadowProgram has no valid WebGL program');\n return;\n }\n \n if (!inRenderSpace) {\n console.error('inRenderSpace is null for shadow rendering');\n return;\n }\n \n if (!bounds) {\n bounds = singleSeries.axis.currentBounds;\n }\n \n let zero;\n if (singleSeries.zeroLineY === 'bottom') {\n zero = this._sizing.renderHeight;\n } else if (singleSeries.zeroLineY !== undefined) {\n zero = (1.0 - ((singleSeries.zeroLineY) - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight;\n } else {\n if (bounds.minY <= 0 && bounds.maxY >= 0) {\n zero = (1.0 - (0 - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight;\n } else {\n zero = this._sizing.renderHeight;\n }\n }\n \n const boundsChanged = !this._lastBounds || \n bounds.minY !== this._lastBounds.minY || \n bounds.maxY !== this._lastBounds.maxY || \n this._sizing.renderHeight !== this._lastRenderHeight;\n \n this._lastBounds = {...bounds};\n this._lastRenderHeight = this._sizing.renderHeight;\n \n if (boundsChanged && this._lastShadowCache) {\n this._lastShadowCache = null;\n }\n \n if (zero > this._sizing.renderHeight * 1.5) {\n zero = this._sizing.renderHeight;\n } else if (zero < -this._sizing.renderHeight * 0.5) {\n zero = 0;\n }\n \n const shadowColor = getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex);\n const hasNegatives = !!singleSeries.inDataSpace.find((tuple) => tuple[1] < 0);\n let shadowParams = {\n color: shadowColor,\n gradient: singleSeries.gradient || createDefaultGradient(shadowColor),\n negativeGradient: singleSeries.negativeGradient,\n hasNegatives,\n zero,\n sizing: this._sizing,\n inRenderSpaceAreaBottom\n };\n\n if (singleSeries.cutoffTime) {\n shadowParams.cutoffIndex = cutoffIndex;\n shadowParams.cutoffOpacity = singleSeries.cutoffOpacity !== undefined ? singleSeries.cutoffOpacity : 0.35;\n shadowParams.originalData = cutoffData;\n shadowParams.renderCutoffGradient = cutoffIndex >= 0; \n shadowParams.isPreview = this === this._stateController.rangeGraphRenderer; \n\n const selection = this === this._stateController.rangeGraphRenderer \n ? this._stateController._bounds \n : (this._stateController._selection || this._stateController._bounds);\n shadowParams.selectionBounds = selection || bounds;\n }\n\n this._shadowProgram.draw(getIndividualPoints(false, true), shadowParams);\n \n if (this._webgl) {\n const gl = this._context;\n gl.disable(gl.BLEND);\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n }\n \n if (singleSeries.zeroLineWidth && singleSeries.zeroLineWidth > 0) {\n if (this._context2d) {\n this._context2d.save();\n this._context2d.strokeStyle = singleSeries.zeroLineColor || getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex);\n this._context2d.lineWidth = singleSeries.zeroLineWidth;\n this._context2d.globalCompositeOperation = 'source-over';\n \n this._context2d.beginPath();\n this._context2d.moveTo(0, zero);\n this._context2d.lineTo(this._sizing.renderWidth, zero);\n this._context2d.stroke();\n this._context2d.restore();\n } else {\n if (!this._zeroLineCanvas) {\n this._zeroLineCanvas = document.createElement('canvas');\n this._zeroLineCanvas.style.position = 'absolute';\n this._zeroLineCanvas.style.top = '0';\n this._zeroLineCanvas.style.left = '0';\n this._zeroLineCanvas.style.pointerEvents = 'none';\n this._zeroLineContext = this._zeroLineCanvas.getContext('2d');\n this._canvas.parentNode.insertBefore(this._zeroLineCanvas, this._canvas.nextSibling);\n }\n \n this._zeroLineCanvas.width = this._canvas.width;\n this._zeroLineCanvas.height = this._canvas.height;\n this._zeroLineCanvas.style.width = this._canvas.style.width;\n this._zeroLineCanvas.style.height = this._canvas.style.height;\n \n this._zeroLineContext.clearRect(0, 0, this._zeroLineCanvas.width, this._zeroLineCanvas.height);\n this._zeroLineContext.strokeStyle = singleSeries.zeroLineColor || getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex);\n this._zeroLineContext.lineWidth = singleSeries.zeroLineWidth;\n \n this._zeroLineContext.beginPath();\n this._zeroLineContext.moveTo(0, zero);\n this._zeroLineContext.lineTo(this._sizing.renderWidth, zero);\n this._zeroLineContext.stroke();\n }\n }\n }\n\n const shouldShowIndividualPoints = typeof singleSeries.showIndividualPoints === 'boolean' ? singleSeries.showIndividualPoints : showIndividualPoints;\n\n let zero;\n if (singleSeries.zeroLineY === 'bottom') {\n zero = this._sizing.renderHeight;\n } else if (singleSeries.zeroLineY !== undefined) {\n zero = (1.0 - ((singleSeries.zeroLineY) - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight;\n } else {\n if (bounds.minY <= 0 && bounds.maxY >= 0) {\n zero = (1.0 - (0 - bounds.minY) / (bounds.maxY - bounds.minY)) * this._sizing.renderHeight;\n } else {\n zero = this._sizing.renderHeight;\n }\n }\n const hasNegatives = !!singleSeries.inDataSpace.find((tuple) => tuple[1] < 0);\n\n // For WebGL shadow rendering, we need a separate 2D canvas overlay for lines/points\n // since WebGL and 2D contexts can't coexist on the same canvas\n let drawContext = this._context;\n \n if (this._webgl && singleSeries.rendering === 'shadow' && (width > 0 || shouldShowIndividualPoints)) {\n // Only create overlay if we're actually drawing lines or points\n if (!this._overlayCanvas) {\n this._overlayCanvas = document.createElement('canvas');\n this._overlayCanvas.style.position = 'absolute';\n this._overlayCanvas.style.top = '0';\n this._overlayCanvas.style.left = '0';\n this._overlayCanvas.style.pointerEvents = 'none';\n this._overlayContext = this._overlayCanvas.getContext('2d');\n this._canvas.parentNode.insertBefore(this._overlayCanvas, this._canvas.nextSibling);\n }\n \n // Size the overlay canvas to match the main canvas\n this._overlayCanvas.width = this._canvas.width;\n this._overlayCanvas.height = this._canvas.height;\n this._overlayCanvas.style.width = this._canvas.style.width;\n this._overlayCanvas.style.height = this._canvas.style.height;\n \n // Clear the overlay before drawing\n this._overlayContext.clearRect(0, 0, this._overlayCanvas.width, this._overlayCanvas.height);\n \n drawContext = this._overlayContext;\n } else if (this._context2d) {\n // For non-WebGL or non-shadow charts with 2D context\n drawContext = this._context2d;\n }\n\n const drawParams = {\n color: getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex),\n context: drawContext,\n width: width || singleSeries.width || defaultLineWidth,\n shadowColor,\n shadowBlur,\n dashed: singleSeries.dashed,\n dashPattern: singleSeries.dashPattern,\n highlighted,\n showIndividualPoints: shouldShowIndividualPoints,\n pointRadius: singleSeries.pointRadius,\n minPointSpacing: singleSeries.minPointSpacing,\n getIndividualPoints,\n getRanges: singleSeries.rangeKey ? getRanges : null,\n rendering: singleSeries.rendering, // Pass rendering type for all charts\n negativeColor: singleSeries.negativeColor,\n hasNegatives,\n zero,\n zeroColor: singleSeries.zeroLineColor\n };\n \n\n if (!inRenderSpace) {\n console.error('inRenderSpace is null for line rendering');\n return;\n }\n \n if (singleSeries.cutoffTime) {\n drawParams.cutoffIndex = cutoffIndex;\n drawParams.cutoffOpacity = singleSeries.cutoffOpacity !== undefined ? singleSeries.cutoffOpacity : 0.35;\n drawParams.originalData = cutoffData;\n drawParams.renderCutoffGradient = cutoffIndex >= 0;\n drawParams.currentBounds = bounds;\n drawParams.isPreview = this === this._stateController.rangeGraphRenderer;\n \n const selection = this === this._stateController.rangeGraphRenderer \n ? this._stateController._bounds \n : (this._stateController._selection || this._stateController._bounds);\n drawParams.selectionBounds = selection || bounds; \n }\n \n // For shadow rendering, always use 2D canvas for lines/points even with WebGL\n // This is because shadow uses WebGL for the fill but needs 2D canvas for lines/points\n // to support negativeColor and other features\n if (this._webgl && singleSeries.rendering !== 'shadow') {\n this._lineProgram.draw(inRenderSpace, drawParams);\n } else {\n drawLine(inRenderSpace, drawParams);\n }\n \n }\n\n renderBackground(inBackgroundSpace) {\n if (!inBackgroundSpace) {\n return;\n }\n\n if (this._webgl) {\n if (!this._backgroundProgram) {\n this._backgroundProgram = new BackgroundProgram(this._context);\n }\n \n this._backgroundProgram.draw(inBackgroundSpace);\n } else {\n drawBackground(inBackgroundSpace, {\n context: this._context\n });\n }\n }\n\n /**\n * Initializes canvas\n * Currently, just sets sizing\n */\n async _initializeCanvas() {\n this._sizing = await sizeCanvas(this._canvas, this._context);\n\n this.emit('size_changed', this._sizing);\n this._stateController.markSizeChanged();\n\n if (window.ResizeObserver) {\n let first = true;\n let disabled = false;\n\n this._resizeObserver = new window.ResizeObserver( () => {\n if (first) { // always fires once at the beginning\n first = false;\n return;\n }\n\n if (disabled) {\n return;\n }\n\n disabled = true;\n this.resize().then(() => {\n disabled = false;\n });\n });\n\n this._resizeObserver.observe(this._canvas.parentNode);\n }\n\n if (this._checkIntersection && window.IntersectionObserver) {\n this._intersectionObserver = new window.IntersectionObserver((entries) => {\n clearTimeout(this._intersectionTimeout);\n\n if (!entries[0].isIntersecting) {\n return;\n }\n\n this._intersectionTimeout = setTimeout(() => {\n this.resize();\n }, 50);\n }, {\n threshold: 0.1\n });\n\n this._intersectionObserver.observe(this._canvas.parentNode);\n }\n }\n\n async resize() {\n const sizingPromise = sizeCanvas(this._canvas, this._context, { reset: true });\n this._initialized = sizingPromise;\n\n this._sizing = await this._initialized;\n if (this._initialized !== sizingPromise) {\n return;\n }\n\n this.emit('size_changed', this._sizing);\n this._stateController.markSizeChanged(this);\n }\n\n resizeDebounced() {\n if (this._resizeTimeout) {\n clearTimeout(this._resizeTimeout);\n }\n\n this._resizeTimeout = setTimeout(() => {\n this.resize();\n this._resizeTimeout = null;\n }, 50);\n }\n\n recalculatePosition() {\n if (!this._sizing) {\n return;\n }\n\n this._sizing.boundingRect = this._canvas.getBoundingClientRect();\n }\n\n /**\n * Returns the bounding rect of the element\n *\n * @return {DOMRect}\n */\n get boundingRect() {\n return this._sizing?.boundingRect;\n }\n\n get sizing() {\n return this._sizing;\n }\n\n}\n","/**\n * Draws the background on a 2d canvas\n *\n * @param {Array<{ minXt: number, maxXt: number, color: string }>} data\n * @param {CanvasRenderingContext2D} context\n */\nexport default function drawBackground({ data }, { context }) {\n if (!context) {\n console.error('Canvas context is null in drawBackground');\n return;\n }\n \n const width = context.canvas.width;\n const height = context.canvas.height;\n\n for (let { minXt, maxXt, color } of data) {\n context.fillStyle = color;\n context.fillRect(minXt*width, 0, (maxXt - minXt)*width, height);\n }\n}\n","export function calculatePrecision(value) {\n return Math.max(-Math.log10(Math.abs(value)) + 2, 0);\n}\n\nexport function calculateTimePrecision(minDate, maxDate) {\n minDate = new Date(minDate);\n maxDate = new Date(maxDate);\n\n const range = maxDate.valueOf() - minDate.valueOf();\n if (range < 3*1000) {\n return 'ms';\n } else if (range < 10*60*1000) {\n return 's';\n } else {\n return 'm';\n }\n}\n\nexport function roundToPrecision(value, precision=null) {\n if (precision === null) {\n precision = calculatePrecision(value);\n }\n\n if (isNaN(precision) || precision > 100) {\n return value.toString();\n }\n\n const rounded = value.toFixed(Math.ceil(precision));\n let stripped = rounded;\n if (rounded.includes('.')) {\n stripped = stripped.replace(/\\.?0+$/g, '');\n }\n\n if (stripped === '') {\n return '0';\n }\n\n return stripped;\n}\n\nconst DATE_TIME_FORMATTERS = {};\n\n/**\n * Given a timezone string, gets the offset relative to utc in milliseconds\n * For example, America/New_York in winter is GMT-05:00, so it evaluates to -5*60*60*1000\n *\n * @param {String} timeZone - the time zone string\n * @param {Date} sampleDate - a date to use in the conversions, since it can be time-of-year dependent with Daylight Savings Time\n * @return {number|null}\n */\nfunction timezoneToOffsetMS(timeZone, sampleDate) {\n try { // formats are finicky, so give up rather than abort rendering\n let datetimeFormatter = DATE_TIME_FORMATTERS[timeZone];\n if (!datetimeFormatter) {\n let properTimeZone = timeZone;\n if (!timeZone || timeZone === 'local') {\n properTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n datetimeFormatter = new Intl.DateTimeFormat('en-US', {\n timeZone: properTimeZone,\n timeZoneName: 'longOffset'\n });\n DATE_TIME_FORMATTERS[timeZone] = datetimeFormatter;\n }\n\n const parts = datetimeFormatter.formatToParts(sampleDate);\n const offsetPart = parts.find(part => part.type === 'timeZoneName');\n\n if (!offsetPart) {\n return null;\n }\n\n if (offsetPart.value === 'GMT') {\n return 0;\n }\n\n if (!/^GMT[+-]\\d{2}:\\d{2}$/.test(offsetPart.value)) {\n return null;\n }\n\n const [hours, minutes] = offsetPart.value.slice(3).split(':');\n\n return parseInt(hours)*60*60*1000 + parseInt(minutes)*60*1000;\n } catch (e) {\n console.error(new Error(`Could not parse timezone offset for ${sampleDate} in ${timeZone}`)); // eslint-disable-line no-console\n console.error(e); // eslint-disable-line no-console\n return null;\n }\n}\n\n/**\n * Gets the Date object that represents the start of day in a given timezone\n * Note that this is still a native date object, so it will be in the local timezone\n * Its timestamp, however, will correspond to the start of the day in the given timezone\n *\n * @param date\n * @param timezone\n * @return {Date}\n */\nexport function startOfDayInTimezone(date, timezone) {\n if (!timezone) {\n const startOfDay = new Date(date);\n startOfDay.setHours(0, 0, 0, 0);\n return startOfDay;\n }\n\n const offset = timezoneToOffsetMS(timezone, date); // ms between timezone and utc\n let startOfDay = new Date(date);\n startOfDay.setUTCHours(0, 0, 0, 0);\n\n const difference = startOfDay.valueOf() - date.valueOf();\n\n // if we would have gone forward a day when offset is taken into account, we need to go back a day again\n if (difference > offset) {\n startOfDay = new Date(startOfDay.valueOf() - 24*60*60*1000);\n }\n\n return new Date(startOfDay.valueOf() - offset);\n}\n\nfunction formatTime(time, {precision, justTime, justDate, justMonthAndDay, unitOverride, clockStyle='24h', timeZone}) {\n const utc = timeZone && timeZone.toLowerCase() === 'utc';\n if (timeZone && !utc && timeZone !== 'local' && window.Intl && window.Intl.DateTimeFormat) {\n const offset = timezoneToOffsetMS(timeZone, time);\n const localOffset = timezoneToOffsetMS('local', time);\n\n if (typeof offset === 'number' && typeof localOffset === 'number') {\n time = new Date(time.valueOf() + offset - localOffset);\n }\n }\n\n const year = utc ? time.getUTCFullYear() : time.getFullYear();\n const month = (utc ? time.getUTCMonth() : time.getMonth()) + 1;\n const day = utc ? time.getUTCDate() : time.getDate();\n\n if (unitOverride === 'year') {\n return year.toString();\n }\n\n if (justDate) {\n return utc ? `${month}/${day}/${year}` : time.toLocaleDateString();\n }\n\n if (justMonthAndDay) {\n // eg Jan 19\n const monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n return `${monthNames[month - 1]} ${day}`;\n }\n\n const hours = utc ? time.getUTCHours() : time.getHours();\n const minutes = utc ? time.getUTCMinutes() : time.getMinutes();\n const seconds = utc ? time.getUTCSeconds() : time.getSeconds();\n const milliseconds = utc ? time.getUTCMilliseconds() : time.getMilliseconds();\n\n let timeString;\n\n if (clockStyle === '12h') {\n timeString = `${((hours + 11) % 12 + 1).toString()}:${minutes.toString().padStart(2, '0')}`;\n } else {\n timeString = `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}`;\n }\n\n if (precision === 's' || precision === 'ms') {\n timeString += `:${seconds.toString().padStart(2, '0')}`;\n }\n\n if (precision === 'ms') {\n timeString += `.${milliseconds.toString().padStart(3, '0')}`;\n }\n\n if (clockStyle === '12h') {\n timeString += hours >= 12 ? 'pm' : 'am';\n }\n\n if (justTime) {\n return timeString;\n }\n\n if (utc) {\n timeString += ' UTC';\n }\n\n return (utc ? `${month}/${day}/${year}` : time.toLocaleDateString()) + ' ' + timeString;\n}\n\nexport function formatX(x, {dates=false, precision=null, justTime=false, justDate=false, justMonthAndDay=false, clockStyle='24h', unitOverride, timeZone, integersOnly=false, inverseEnumMap}={}) {\n if (dates && !(x instanceof Date)) {\n x = new Date(x);\n\n if (isNaN(x)) {\n return 'Invalid Date';\n }\n }\n\n if (x instanceof Date) {\n return formatTime(x, {precision, justTime, justDate, justMonthAndDay, unitOverride, clockStyle, timeZone});\n }\n\n if (isNaN(x)) {\n return 'NaN';\n }\n\n if (inverseEnumMap) {\n if (Math.abs(x - Math.round(x)) > 1e-10) {\n return '';\n }\n\n return inverseEnumMap[Math.round(x)];\n }\n\n if (integersOnly && Math.abs(x - Math.round(x)) > 1e-10) {\n return '';\n }\n\n return roundToPrecision(x, precision);\n}\n\nexport function formatY(y, {precision=null, log=false}={}) {\n if (y === null) {\n return 'null';\n }\n\n if (isNaN(y)) {\n return 'NaN';\n }\n\n if (log) {\n return `10^${roundToPrecision(Math.log10(y), precision)}`;\n }\n\n return roundToPrecision(y, precision);\n}\n","export const Y_AXIS_WIDTH = 32;\nexport const BIG_Y_AXIS_LABEL_OFFSET = 20;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport {formatX, formatY} from '../helpers/format';\nimport {Y_AXIS_WIDTH} from '../helpers/axis_sizes';\nimport CustomPropTypes from '../helpers/custom_prop_types';\n\nfunction getYLabelContent({ yLabel, y, fullYPrecision}) {\n if (fullYPrecision && !yLabel) {\n if (y === undefined) {\n return 'undefined';\n }\n\n if (y === null) {\n return 'null';\n }\n\n return y.toString();\n }\n\n if (typeof yLabel === 'number') {\n if (fullYPrecision) {\n return yLabel.toString();\n } else {\n return formatY(yLabel);\n }\n }\n\n if (typeof yLabel === 'object') {\n return formatY(y);\n }\n\n return yLabel || formatY(y);\n}\n\nfunction TooltipLabel({ axisLabel, x, y, xLabel, yLabel, textLeft, textTop, includeSeriesLabel, includeXValue, includeYValue, includeXLabel, includeYLabel, fullYPrecision, formatXOptions }) {\n let i = 0;\n\n return (\n <g>\n {\n includeSeriesLabel &&\n <text x={textLeft} y={textTop + (i++)*12}>\n {axisLabel}\n </text>\n }\n\n {\n includeXValue &&\n <text x={textLeft} y={textTop + (i++) * 12}>\n {includeXLabel && 'x: '}{xLabel || formatX(x, formatXOptions)}\n </text>\n }\n\n {\n includeYValue &&\n <text x={textLeft} y={textTop + (i++) * 12}>\n {includeYLabel && 'y: '}{getYLabelContent({ yLabel, y, fullYPrecision})}\n </text>\n }\n </g>\n );\n}\n\nTooltipLabel.propTypes = {\n axisLabel: PropTypes.string,\n x: PropTypes.oneOfType([PropTypes.number, PropTypes.instanceOf(Date)]),\n y: PropTypes.number,\n xLabel: PropTypes.string,\n yLabel: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n textLeft: PropTypes.number.isRequired,\n textTop: PropTypes.number.isRequired,\n fullYPrecision: PropTypes.bool,\n formatXOptions: PropTypes.object,\n ...CustomPropTypes.TooltipOptionsRaw\n};\n\nexport default class Tooltip extends React.PureComponent {\n\n render() {\n const textPadding = 3;\n let height = 12*3 + 2*textPadding;\n\n if (!this.props.includeSeriesLabel) {\n height -= 12;\n }\n\n if (!this.props.includeXValue) {\n height -= 12;\n }\n\n if (!this.props.includeYValue) {\n height -= 12;\n }\n\n const caretSize = 7;\n const halfHeight = height/2;\n const caretPadding = 4;\n\n const textTop = -halfHeight + textPadding;\n\n const formatXOptions = {\n clockStyle: this.props.clockStyle,\n timeZone: this.props.timeZone\n };\n\n const passThroughProps = {\n includeSeriesLabel: this.props.includeSeriesLabel,\n includeXLabel: this.props.includeXLabel,\n includeYLabel: this.props.includeYLabel,\n includeXValue: this.props.includeXValue,\n includeYValue: this.props.includeYValue,\n formatXOptions\n };\n\n const preparedTooltips = this.props.tooltips.map((tooltip) => {\n const { x, y, pixelY, pixelX, series, index, xLabel, yLabel, fullYPrecision } = tooltip;\n\n if (typeof pixelX !== 'number') {\n return null;\n }\n\n const axisLabel = (series.name || series.yKey || index).toString();\n let width = Math.max(axisLabel.length, (xLabel || formatX(x, formatXOptions)).length + 4, getYLabelContent({ yLabel, y, fullYPrecision}).length + 4) * 7.5;\n if (series.tooltipWidth) {\n width = series.tooltipWidth;\n }\n\n let fixedPosition = this.props.elementWidth < (width + 2*caretSize + 2*caretPadding);\n\n let multiplier = 1;\n if (pixelX >= this.props.elementWidth - (width + 2*caretSize + caretPadding)) {\n multiplier = -1;\n }\n\n if (pixelX < width + 2*caretSize + caretPadding && multiplier === -1) {\n fixedPosition = true;\n }\n\n if (y === null) {\n fixedPosition = true;\n }\n\n if (this.props.alwaysFixedPosition) {\n fixedPosition = true;\n }\n\n let textLeft = caretSize + caretPadding;\n if (multiplier < 0) {\n textLeft = -width - textLeft;\n } else {\n textLeft += 6;\n }\n\n if (!isFinite(pixelX)) {\n return null;\n }\n\n const transform = `translate(${pixelX},${pixelY})`;\n\n const commonLabelProps = {\n fullYPrecision: fullYPrecision || this.props.maxPrecision,\n x,\n y,\n axisLabel,\n xLabel,\n yLabel,\n ...passThroughProps\n };\n\n let yTranslation = 0;\n let baseLeft;\n\n if (fixedPosition) {\n textLeft = 6;\n\n baseLeft = this.props.elementWidth / 2 - width / 2;\n\n if (width > this.props.elementWidth && !this.props.floating) {\n baseLeft -= Y_AXIS_WIDTH * this.props.axisCount / 2;\n }\n\n yTranslation = 18;\n\n if (this.props.floating) {\n if (this.props.floatPosition === 'bottom') {\n yTranslation = this.props.elementHeight + halfHeight + 4;\n } else {\n yTranslation = -height;\n }\n\n if (this.props.floatDelta) {\n yTranslation += this.props.floatDelta;\n }\n }\n }\n\n return {\n ...tooltip,\n label: axisLabel,\n indexInAxis: series?.axis?.series?.indexOf(series),\n axisLabel,\n width,\n fixedPosition,\n multiplier,\n textLeft,\n transform,\n commonLabelProps,\n textTop,\n height,\n caretSize,\n halfHeight,\n caretPadding,\n yTranslation,\n baseLeft\n };\n }).filter(Boolean);\n\n const CustomTooltipComponent = this.props.customTooltip;\n\n let groupedTooltips;\n if (this.props.combineTooltips) {\n let combinationThreshold = 50; // in px how close tooltips should be to combine\n if (typeof this.props.combineTooltips === 'number') {\n combinationThreshold = this.props.combineTooltips;\n }\n\n groupedTooltips = [];\n\n for (let tooltip of preparedTooltips) {\n let added = false;\n for (let group of groupedTooltips) {\n if (Math.abs(group.pixelX - tooltip.pixelX) <= combinationThreshold) {\n group.tooltips.push(tooltip);\n if (tooltip.pixelX > group.pixelX) {\n group.pixelX = tooltip.pixelX;\n group.multiplier = tooltip.multiplier;\n }\n\n if (tooltip.pixelY < group.pixelY) {\n group.pixelY = tooltip.pixelY;\n }\n\n added = true;\n break;\n }\n }\n\n if (!added) {\n groupedTooltips.push({\n pixelX: tooltip.pixelX,\n pixelY: tooltip.pixelY,\n multiplier: tooltip.multiplier,\n tooltips: [tooltip]\n });\n }\n }\n\n for (let group of groupedTooltips) {\n let totalHeight = 0;\n let maxWidth = 0;\n\n // sort by indexInAxis\n group.tooltips.sort((a, b) => a.indexInAxis - b.indexInAxis);\n\n for (let i = 0; i < group.tooltips.length; i++) {\n group.tooltips[i].textTop = totalHeight;\n totalHeight += group.tooltips[i].height;\n maxWidth = Math.max(maxWidth, group.tooltips[i].width);\n }\n\n for (let i = 0; i < group.tooltips.length; i++) {\n group.tooltips[i].textTop -= totalHeight/2;\n group.tooltips[i].textTop += textPadding;\n }\n\n group.height = totalHeight;\n group.halfHeight = totalHeight / 2;\n group.caretSize = caretSize;\n group.width = maxWidth;\n }\n }\n\n return (\n <div className=\"grapher-tooltip\">\n <svg>\n {\n preparedTooltips.map((tooltip, i) => {\n const { color, fixedPosition, width, transform, baseLeft, commonLabelProps, yTranslation, multiplier, textLeft, textTop } = tooltip;\n\n if (this.props.customTooltip || groupedTooltips) {\n return (\n <g key={i} transform={transform} className=\"tooltip-item\">\n <circle r={4} fill={color}/>\n </g>\n );\n }\n\n // display in a fixed position if not wide enough\n if (fixedPosition) {\n return (\n <g key={i} className=\"tooltip-item tooltip-item-fixed\">\n <circle r={4} fill={color} transform={transform} />\n\n <g transform={`translate(${baseLeft}, ${yTranslation})`}>\n <path stroke={color} d={`M0,0 V-${halfHeight} h${width} V${halfHeight} h${-width} V0`} />\n\n <TooltipLabel\n textLeft={textLeft} textTop={textTop}\n {...commonLabelProps}\n />\n </g>\n </g>\n );\n }\n\n return (\n <g key={i} transform={transform} className=\"tooltip-item\">\n <circle r={4} fill={color} />\n\n <path stroke={color} d={`M${multiplier*caretPadding},0 L${multiplier*caretSize*2},-${caretSize} V-${halfHeight} h${multiplier*width} V${halfHeight} h${multiplier*-width} V${caretSize} L${multiplier*caretPadding},0`} />\n\n <TooltipLabel\n textLeft={textLeft} textTop={textTop}\n {...commonLabelProps}\n />\n </g>\n );\n })\n }\n\n {\n !this.props.customTooltip && groupedTooltips &&\n groupedTooltips.map(({ tooltips, pixelX, pixelY, halfHeight, multiplier, color, width }, i) =>\n <g key={i} transform={`translate(${pixelX},${pixelY})`} className=\"tooltip-item\">\n <path stroke={color} d={`M${multiplier*caretPadding},0 L${multiplier*caretSize*2},-${caretSize} V-${halfHeight} h${multiplier*width} V${halfHeight} h${multiplier*-width} V${caretSize} L${multiplier*caretPadding},0`} />\n\n {\n tooltips.map((tooltip, j) =>\n <TooltipLabel\n key={j}\n textTop={tooltip.textTop}\n textLeft={tooltip.textLeft}\n {...tooltip.commonLabelProps}\n />\n )\n }\n </g>\n )\n }\n </svg>\n\n {\n this.props.customTooltip &&\n (groupedTooltips || preparedTooltips).map((tooltip, i) =>\n <div\n key={i}\n className=\"custom-tooltip-container\"\n style={{top: tooltip.pixelY, left: tooltip.pixelX}}\n >\n <CustomTooltipComponent {...tooltip} />\n </div>\n )\n }\n </div>\n );\n }\n\n}\n\nTooltip.defaultProps = {\n includeSeriesLabel: true,\n includeXLabel: true,\n includeYLabel: true,\n includeXValue: true,\n includeYValue: true\n};\n\nTooltip.propTypes = {\n mouseX: PropTypes.number.isRequired,\n mouseY: PropTypes.number.isRequired,\n elementHeight: PropTypes.number.isRequired,\n elementWidth: PropTypes.number.isRequired,\n tooltips: PropTypes.arrayOf(PropTypes.shape({\n x: PropTypes.oneOfType([PropTypes.number, PropTypes.instanceOf(Date)]),\n y: PropTypes.number,\n pixelY: PropTypes.number,\n color: PropTypes.string,\n xLabel: PropTypes.string,\n yLabel: PropTypes.any,\n fullYPrecision: PropTypes.bool\n })),\n axisCount: PropTypes.number.isRequired,\n maxPrecision: PropTypes.bool.isRequired,\n clockStyle: PropTypes.oneOf(['12h', '24h']),\n timeZone: PropTypes.string,\n ...CustomPropTypes.TooltipOptionsRaw\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nexport default class ContextMenu extends React.PureComponent {\n constructor(props) {\n super(props);\n this.setTextRef = this.setTextRef.bind(this);\n }\n \n setTextRef(ref) {\n this.textRef = ref;\n\n if (this.props.contextMenu.showing && this.textRef) {\n const range = document.createRange();\n const selection = window.getSelection();\n\n selection.removeAllRanges();\n\n range.selectNodeContents(this.textRef);\n selection.addRange(range);\n this.textRef.focus();\n }\n }\n \n formatDateTime(dateTimeStr) {\n const [datePart, timePart] = dateTimeStr.split(', ');\n\n const [month, day, year] = datePart.split('/');\n const formattedDate = `${month.padStart(2, '0')}/${day.padStart(2, '0')}/${year}`;\n\n const [time, period] = timePart.split(' ');\n const [hours, minutes] = time.split(':');\n const formattedHours = hours.padStart(2, '0');\n const formattedTime = `${formattedHours}:${minutes} ${period}`;\n\n return `${formattedDate} ${formattedTime}`;\n }\n \n render() {\n const { x, y, showing, value } = this.props.contextMenu;\n\n const style = { left: x, top: y, width: '150px'};\n \n if (!showing || !value || value.toLocaleString() === 'Invalid Date' || isNaN(x) || isNaN(y)) {\n return null;\n }\n\n const displayValue = value instanceof Date ? this.formatDateTime(value.toLocaleString()) : value;\n return (\n <div className=\"grapher-context-menu\" style={style}>\n <div className=\"menu-item\">\n <div className=\"menu-text\" autoFocus={true} ref={this.setTextRef}>\n {displayValue}\n </div>\n </div>\n </div>\n );\n }\n\n}\n\nContextMenu.propTypes = {\n contextMenu: PropTypes.shape({\n x: PropTypes.number,\n y: PropTypes.number,\n showing: PropTypes.bool,\n value: PropTypes.oneOfType([\n PropTypes.instanceOf(Date),\n PropTypes.number,\n PropTypes.object\n ])\n }).isRequired\n};\n","import inferType from '../infer_type';\nimport { SIMPLE_DATA_TYPES } from '../data_types';\n\n/**\n * Given a series of a simple type (ie, not a function or an observable), converts it into data space\n *\n * @param {*} singleSeries\n * @param {Object} options\n * @return {*}\n */\nexport default function simpleSeriesToDataSpace(singleSeries, options={}) {\n const type = inferType(singleSeries, { useSimpleData: true, data: options.data });\n if (!SIMPLE_DATA_TYPES.includes(type)) {\n throw new Error(`Cannot normalize ${type} (expected a simple type)`);\n }\n\n const inDataSpace = {\n tuples: tuplesToDataSpace,\n values: valuesToDataSpace,\n objects: objectsToDataSpace\n }[type](options.data || singleSeries.simpleData || singleSeries.data, singleSeries, options);\n\n if (singleSeries.square) {\n const square = [];\n let prevY = options.prevY;\n for (let tuple of inDataSpace) {\n if (prevY !== undefined) {\n square.push([tuple[0], prevY]);\n }\n square.push(tuple);\n prevY = tuple[1];\n }\n\n return square;\n }\n\n if (singleSeries.shiftXBy) {\n for (let tuple of inDataSpace) {\n if (typeof tuple[0] === 'string') {\n const originalXValue = tuple[0];\n tuple[0] = new Date(new Date(tuple[0]).valueOf() + singleSeries.shiftXBy);\n if (isNaN(tuple[0])) {\n tuple[0] = options.stateController.enumToNumber(originalXValue, singleSeries);\n }\n } else if (tuple[0] instanceof Date) {\n tuple[0] = new Date(tuple[0].valueOf() + singleSeries.shiftXBy);\n } else if (typeof tuple[0] === 'number') {\n tuple[0] += singleSeries.shiftXBy;\n }\n }\n }\n\n if (singleSeries.xUnixDates) {\n for (let tuple of inDataSpace) {\n if (typeof tuple[0] === 'number') {\n tuple[0] = new Date(tuple[0]*1000);\n }\n }\n }\n\n return inDataSpace;\n}\n\n/**\n * Converts a values array to data space\n *\n * @param {Array<Number|String>} data\n * @param {Object} singleSeries\n * @param {Object} options\n * @param {Number} [options.valueXStart]\n * @param {StateController} options.stateController\n * @return {Array<Array<Number|Date|null>>}\n */\nfunction valuesToDataSpace(data, singleSeries, options) {\n const inDataSpace = [];\n\n for (let i = 0; i < data.length; i++) {\n let yValue = data[i];\n\n if (typeof yValue === 'string') {\n yValue = options.stateController.enumToNumber(yValue, singleSeries);\n }\n\n if (typeof yValue === 'boolean') {\n yValue = +yValue;\n }\n\n inDataSpace.push([i + (options.valueXStart || 0), yValue]);\n }\n\n return inDataSpace;\n}\n\n/**\n * Converts a tuples array to data space\n *\n * @param {Array<Array<Number|Date|null>>} data\n * @param {Object} singleSeries\n * @param {Object} options\n * @param {StateController} options.stateController\n * @return {Array<Array<Number|Date|null>>}\n */\nfunction tuplesToDataSpace(data, singleSeries, options) {\n return [...data.map(([ xValue, yValue]) => {\n if (yValue === undefined) {\n yValue = null;\n }\n\n if (typeof xValue === 'string') {\n const originalXValue = xValue;\n xValue = new Date(xValue);\n\n if (isNaN(xValue)) {\n xValue = options.stateController.enumToNumber(originalXValue, singleSeries, true);\n }\n }\n\n if (typeof yValue === 'string') {\n yValue = options.stateController.enumToNumber(yValue, singleSeries);\n }\n\n if (typeof yValue === 'boolean') {\n yValue = +yValue;\n }\n\n return [xValue, yValue];\n })];\n}\n\nfunction readBinaryFormatValue(view, offset, index) {\n const localOffset = view.getUint32(offset + 2 + Uint32Array.BYTES_PER_ELEMENT*index, true);\n\n if (localOffset === 0) {\n return null;\n }\n\n const type = view.getUint8(localOffset);\n\n if (type === 0) {\n return view.getFloat64(offset + localOffset + 1, true);\n } else if (type === 1 || type === 6) {\n return null;\n } else if (type === 3) {\n return new Date(view.getFloat64(offset + localOffset + 1, true));\n } else {\n throw new Error(`Binary format type ${type} not supported`);\n }\n}\n\n/**\n * Converts an objects array to data space\n *\n * @param {Array<Object>} data\n * @param {Object} series\n * @param {Object} options\n * @param {StateController} options.stateController\n * @return {Array<Array<Number|Date|null>>}\n */\nfunction objectsToDataSpace(data, series, options) {\n if (!series.xKey || typeof series.xKey !== 'string') {\n throw new Error('xKey must be provided in the series');\n }\n\n if (!series.yKey || typeof series.yKey !== 'string') {\n throw new Error('yKey must be provided in the series');\n }\n\n const inDataSpace = [];\n\n for (let point of data) {\n if (point.buffer instanceof ArrayBuffer) {\n const view = new DataView(point.buffer);\n const xIndex = point.channels[series.xKey];\n const yIndex = point.channels[series.yKey];\n\n for (let offset of point.offsets) {\n inDataSpace.push([readBinaryFormatValue(view, offset, xIndex), readBinaryFormatValue(view, offset, yIndex)]);\n }\n } else if (Array.isArray(point[series.yKey])) {\n if (point[series.yKey].length && !Array.isArray(point[series.yKey][0]) && typeof point[series.yKey][0] === 'object') {\n for (let subpoint of point[series.yKey]) {\n let yValue = subpoint[series.yKey];\n if (yValue === undefined) {\n yValue = null;\n }\n\n if (typeof yValue === 'string') {\n yValue = options.stateController.enumToNumber(yValue, series);\n }\n\n if (typeof yValue === 'boolean') {\n yValue = +yValue;\n }\n\n let xValue = subpoint[series.xKey];\n if (typeof xValue === 'string') {\n xValue = new Date(xValue);\n }\n\n inDataSpace.push([xValue, yValue]);\n }\n } else {\n inDataSpace.push(...point[series.yKey]);\n }\n } else {\n let yValue = point[series.yKey];\n if (yValue === undefined) {\n yValue = null;\n }\n\n let xValue = point[series.xKey];\n if (typeof xValue === 'string') {\n xValue = new Date(xValue);\n }\n\n if (typeof yValue === 'string') {\n yValue = options.stateController.enumToNumber(yValue, series);\n }\n\n if (typeof yValue === 'boolean') {\n yValue = +yValue;\n }\n\n inDataSpace.push([xValue, yValue]);\n }\n }\n\n return inDataSpace;\n}\n","function finalizeBounds(bounds, { dates }) {\n const initial = (bounds.minX === null && bounds.maxX === null) || bounds.minY === null || bounds.maxY === null;\n\n for (let key of Object.keys(bounds)) {\n if (typeof bounds[key] !== 'number') {\n bounds[key] = 0;\n }\n }\n\n bounds.initial = initial;\n bounds.dates = dates;\n\n return bounds;\n}\n\nfunction percentileBounds(inDataSpace, bounds, {percentile=100, percentileAsymmetry=0}={}) {\n let dates = false;\n\n bounds.minX = inDataSpace[0][0];\n if (bounds.minX instanceof Date) {\n bounds.minX = bounds.minX.valueOf();\n dates = true;\n }\n\n bounds.maxX = inDataSpace[inDataSpace.length - 1][0];\n if (bounds.maxX instanceof Date) {\n bounds.maxX = bounds.maxX.valueOf();\n dates = true;\n }\n\n const sortedByY = inDataSpace\n .filter(([_x, y]) => typeof y === 'number')\n .sort(([_x1, y1], [_x2, y2]) => y1 - y2);\n\n if (!sortedByY.length) {\n return finalizeBounds(bounds, {dates});\n }\n\n const asymmetry = Math.min(Math.abs(percentileAsymmetry), (100-percentile)/2) * (percentileAsymmetry < 0 ? -1 : 1);\n const inBottomPercentile = (100-percentile)/2 + asymmetry;\n const inTopPercentile = (100-percentile)/2 - asymmetry;\n\n const startIndex = Math.floor((sortedByY.length-1)*inBottomPercentile/100);\n const endIndex = Math.floor((sortedByY.length-1)*(100-inTopPercentile)/100);\n\n bounds.minY = sortedByY[startIndex][1];\n bounds.maxY = sortedByY[endIndex][1];\n\n return finalizeBounds(bounds, {dates});\n}\n\nexport default function calculateDataBounds(inDataSpace, {percentile=100, percentileAsymmetry=0}={}) {\n let bounds = {\n minX: null,\n maxX: null,\n minY: null,\n maxY: null,\n closestSpacing: null\n };\n\n if (percentile !== 100 && inDataSpace.length) {\n return percentileBounds(inDataSpace, bounds, {percentile, percentileAsymmetry});\n }\n\n let dates = false;\n let prevX = null;\n\n for (let [x, y] of inDataSpace) {\n if (x instanceof Date) {\n x = x.valueOf();\n dates = true;\n }\n\n if (typeof bounds.minX !== 'number' || x < bounds.minX) {\n bounds.minX = x;\n }\n\n if (typeof bounds.maxX !== 'number' || x > bounds.maxX) {\n bounds.maxX = x;\n }\n\n if (typeof prevX === 'number' && typeof x === 'number') {\n const spacing = x - prevX;\n if (typeof bounds.closestSpacing !== 'number' || spacing < bounds.closestSpacing) {\n bounds.closestSpacing = spacing;\n }\n }\n prevX = x;\n\n if (typeof y !== 'number') {\n continue;\n }\n\n if (typeof bounds.minY !== 'number' || y < bounds.minY) {\n bounds.minY = y;\n }\n\n if (typeof bounds.maxY !== 'number' || y > bounds.maxY) {\n bounds.maxY = y;\n }\n }\n\n return finalizeBounds(bounds, {dates});\n}\n","export default function mergeBounds(boundsList) {\n const mergedBounds = {\n minX: null,\n maxX: null,\n minY: null,\n maxY: null,\n closestSpacing: null,\n dates: false,\n initial: true\n };\n\n for (let { minX, maxX, minY, maxY, dates, initial, closestSpacing } of boundsList) {\n if (dates) {\n mergedBounds.dates = true;\n }\n\n if (initial) {\n continue;\n }\n mergedBounds.initial = false;\n\n if (mergedBounds.minX === null || minX < mergedBounds.minX) {\n mergedBounds.minX = minX;\n }\n\n if (mergedBounds.maxX === null || maxX > mergedBounds.maxX) {\n mergedBounds.maxX = maxX;\n }\n\n if (mergedBounds.closestSpacing === null || closestSpacing < mergedBounds.closestSpacing) {\n mergedBounds.closestSpacing = closestSpacing;\n }\n\n if (mergedBounds.minY === null || minY < mergedBounds.minY) {\n mergedBounds.minY = minY;\n }\n\n if (mergedBounds.maxY === null || maxY > mergedBounds.maxY) {\n mergedBounds.maxY = maxY;\n }\n }\n\n if (mergedBounds.minX === null) {\n mergedBounds.minX = 0;\n }\n\n if (mergedBounds.maxX === null) {\n mergedBounds.maxX = 0;\n }\n\n if (mergedBounds.closestSpacing === null) {\n mergedBounds.closestSpacing = 1;\n }\n\n if (mergedBounds.minY === null) {\n mergedBounds.minY = 0;\n }\n\n if (mergedBounds.maxY === null) {\n mergedBounds.maxY = 0;\n }\n\n return mergedBounds;\n}\n","/**\n * Expands bounds to give a little y padding\n *\n * @param {Object} bounds\n * @param {?Number} bounds.minY\n * @param {?Number} bounds.maxY\n * @param {?Number} bounds.minX\n * @param {?Number} bounds.maxX\n * @param {Array<Number>} [expandYWith]\n * @param {Number} [extendXForNBars=0]\n * @return {Object}\n */\nexport default function expandBounds(bounds, {expandYWith = [], extendXForNBars=0}) {\n const expandedBounds = Object.assign({}, bounds);\n for (let y of expandYWith) {\n if (y === null || y === undefined) {\n continue;\n }\n\n if (typeof expandedBounds.minY !== 'number' || y < expandedBounds.minY) {\n expandedBounds.minY = y;\n }\n\n if (typeof expandedBounds.maxY !== 'number' || y > expandedBounds.maxY) {\n expandedBounds.maxY = y;\n }\n }\n\n expandedBounds.unscaledMinY = expandedBounds.minY;\n expandedBounds.unscaledMaxY = expandedBounds.maxY;\n\n const range = expandedBounds.maxY - expandedBounds.minY;\n const midpoint = expandedBounds.minY + range/2;\n expandedBounds.minY = midpoint - 1.05*range/2;\n expandedBounds.maxY = midpoint + 1.05*range/2;\n\n if (expandedBounds.minY === expandedBounds.maxY && expandedBounds.minY !== null) {\n if (expandedBounds.minY > 0) {\n expandedBounds.minY *= 0.95;\n expandedBounds.maxY *= 1.05;\n } else if (expandedBounds.minY < 0) {\n expandedBounds.minY *= 1.05;\n expandedBounds.maxY *= 0.95;\n } else {\n expandedBounds.minY -= 1;\n expandedBounds.maxY += 1;\n }\n }\n\n if (extendXForNBars && expandedBounds.minX !== expandedBounds.maxX && expandedBounds.minX !== null && expandedBounds.maxX !== null) {\n // Base expansion factor on expected bar count\n const barWidth = (expandedBounds.maxX - expandedBounds.minX) / extendXForNBars;\n expandedBounds.minX -= barWidth/2;\n expandedBounds.maxX += barWidth/2;\n }\n\n return expandedBounds;\n}\n","/**\n * Finds the closest point to the target\n *\n * @param {Array} data - the data, in data space\n * @param {Number} targetX - the x coordinate to get closest to\n * @param {Object} [searchParams]\n * @param {String} [searchParams.searchType] - whether to search for the closest, one before, or one after\n * @param {Boolean} [searchParams.returnIndex] - whether to return the index or the object itself\n * @param {Number} [startIndex] - where to start the search from\n * @param {Number} [endIndex] - where to end the search\n * @return {Array|Number}\n */\nexport default function binarySearch(data, targetX, searchParams={}, startIndex=0, endIndex=undefined) {\n if (endIndex === undefined) {\n endIndex = data.length - 1;\n }\n\n if (data.length === 0) {\n return searchParams.returnIndex ? -1 : [null, null];\n }\n\n const middleIndex = Math.floor((startIndex + endIndex)/2);\n\n if (targetX === data[middleIndex][0] || (data[middleIndex][0] instanceof Date && data[middleIndex][0].valueOf() === targetX)) {\n if (searchParams.returnIndex) {\n return middleIndex;\n } else {\n return data[middleIndex];\n }\n }\n\n if (startIndex === endIndex) {\n if (data[startIndex][0] < targetX && searchParams.searchType === 'before') {\n return searchParams.returnIndex ? startIndex : data[startIndex];\n } else if (data[startIndex][0] > targetX && searchParams.searchType === 'after') {\n return searchParams.returnIndex ? startIndex : data[startIndex];\n } else {\n return searchParams.returnIndex ? -1 : [null, null];\n }\n }\n\n if (endIndex - 1 === startIndex) {\n let index;\n\n if (searchParams.searchType === 'before') {\n index = startIndex;\n // index = (targetX <= data[startIndex][0]) ? startIndex : endIndex;\n } else if (searchParams.searchType === 'after') {\n index = endIndex;\n // index = (targetX >= data[endIndex][0]) ? endIndex : startIndex;\n } else {\n index = Math.abs(data[startIndex][0] - targetX) > Math.abs(data[endIndex][0] - targetX) ?\n endIndex :\n startIndex;\n }\n\n return searchParams.returnIndex ? index : data[index];\n }\n\n if (targetX > data[middleIndex][0]) {\n return binarySearch(data, targetX, searchParams, middleIndex, endIndex);\n }\n\n if (targetX < data[middleIndex][0]) {\n return binarySearch(data, targetX, searchParams, startIndex, middleIndex);\n }\n}\n","import binarySearch from '../../helpers/binary_search';\n\nfunction validateSelectedSpaceConversion({ data, inSelectedSpace, firstIndex, lastIndex, ignoreDiscontinuities }) { // eslint-disable-line no-unused-vars\n let correct = data.slice(firstIndex + 1, lastIndex);\n if (ignoreDiscontinuities) {\n correct = correct.filter(([_x, y]) => (y !== null && y !== undefined));\n }\n\n if (correct.length !== inSelectedSpace.length) {\n console.log({ // eslint-disable-line no-console\n data,\n attempt: inSelectedSpace.map(([x, y]) => [undateify(x), y]),\n correct: correct.map(([x, y]) => [undateify(x), y]),\n sdl: window.sdl\n });\n window.tacomaDataPaused = true;\n throw new Error('Failed to select via swap');\n }\n\n for (let i = 0; i < correct.length; i++) {\n if (undateify(correct[i][0]) !== undateify(inSelectedSpace[i][0]) || correct[i][1] !== inSelectedSpace[i][1]) {\n console.log({ // eslint-disable-line no-console\n i,\n attempt: inSelectedSpace.map(([x, y]) => [undateify(x), y]),\n correct: correct.map(([x, y]) => [undateify(x), y]),\n correctX: undateify(correct[i][0]),\n correctY: correct[i][1],\n attemptX: undateify(inSelectedSpace[i][0]),\n attemptY: inSelectedSpace[i][1]\n });\n window.tacomaDataPaused = true;\n throw new Error('Failed to select via swap');\n }\n }\n}\n\n/**\n * Converts from data space to selected space\n *\n * @param {Array<Array<Number>>} data\n * @param {{data: Array<Array<Number>>}|*} [swap]\n * @param {Number} minX\n * @param {Number} maxX\n * @param {Boolean} ignoreDiscontinuities\n * @param {Boolean} square\n * @return {{data: Array<Array<Number>>, lastAdded: boolean, firstAdded: boolean, afterIndex: Number, ignoreDiscontinuities: boolean, minX: Number, maxX: Number, beforeIndex: Number}}\n */\nexport default function dataSpaceToSelectedSpace({ data, swap, minX, maxX, ignoreDiscontinuities, square }) {\n if (!data.length || data.length && minX > data[data.length - 1][0] || data.length && maxX < data[0][0]) {\n //let previouslyEmpty = !data.length;\n return {\n data: [\n [minX, null],\n [maxX, null]\n ],\n firstAdded: true,\n lastAdded: true\n //previouslyEmpty\n };\n }\n\n let beforeIndex = binarySearch(data, minX, { searchType: 'before', returnIndex: true }) || 0;\n let afterIndex = binarySearch(data, maxX, { searchType: 'after', returnIndex: true }) || 0;\n if (afterIndex === -1) {\n afterIndex = 0;\n }\n\n while (beforeIndex >= 0 && data[beforeIndex][0] >= minX) {\n beforeIndex --;\n }\n\n while (afterIndex < data.length && data[afterIndex][0] <= maxX) {\n afterIndex ++;\n }\n\n let inSelectedSpace;\n let addToEndOnly = false;\n\n let firstAdded = false;\n let lastAdded = false;\n\n let beginningInterpolationIndex = beforeIndex;\n let endInterpolationIndex = afterIndex;\n if (ignoreDiscontinuities) {\n while (beginningInterpolationIndex >= 0 && data[beginningInterpolationIndex][1] === null) {\n beginningInterpolationIndex --;\n }\n while (endInterpolationIndex < data.length && data[endInterpolationIndex][1] === null) {\n endInterpolationIndex++;\n }\n }\n\n if (swap) {\n inSelectedSpace = swap.data;\n if (swap.lastAdded) {\n inSelectedSpace.pop();\n }\n if (minX === swap.minX) {\n addToEndOnly = true;\n }\n if (beforeIndex !== swap.beforeIndex) {\n addToEndOnly = false;\n if (swap.firstAdded) {\n inSelectedSpace.shift();\n }\n let index = swap.beforeIndex;\n while (index >= 0 && inSelectedSpace.length && inSelectedSpace[0][0] >= minX) {\n if (!ignoreDiscontinuities || data[index][1] || data[index][1] === 0) {\n inSelectedSpace.unshift(data[index]);\n }\n index --;\n }\n while (index < data.length && inSelectedSpace.length && inSelectedSpace[0][0] < minX) {\n inSelectedSpace.shift();\n index ++;\n }\n }\n\n if (ignoreDiscontinuities && !swap.ignoreDiscontinuities) {\n inSelectedSpace = inSelectedSpace.filter(([_x, y]) => (y !== null && y !== undefined));\n }\n\n if (beforeIndex === swap.beforeIndex && swap.firstAdded) {\n firstAdded = true;\n\n let interpolationIndex = beforeIndex + 1;\n if (ignoreDiscontinuities) {\n while (interpolationIndex < data.length && data[interpolationIndex][1] === null) {\n interpolationIndex ++;\n }\n }\n\n if (beginningInterpolationIndex === -1 && inSelectedSpace.length) {\n inSelectedSpace[0] = [minX, null];\n } else {\n if (square && inSelectedSpace.length) {\n inSelectedSpace[0] = [minX, data[beginningInterpolationIndex][1]];\n } else {\n if (inSelectedSpace.length) {\n inSelectedSpace[0] = [minX, interpolate(data, beginningInterpolationIndex, interpolationIndex, minX)];\n }\n }\n }\n if (data[beforeIndex + 1][0] === inSelectedSpace[0][0] && data[beforeIndex + 1][1] === inSelectedSpace[0][1]) {\n firstAdded = false;\n }\n }\n let lastIncluded = swap.afterIndex;\n if (swap.ignoreDiscontinuities && !ignoreDiscontinuities) {\n let nullIndex = beforeIndex + 1;\n let selectedIndex = 0;\n if (firstAdded) {\n selectedIndex ++;\n }\n while (selectedIndex <= inSelectedSpace.length && nullIndex < data.length && nullIndex < afterIndex) {\n if (data[nullIndex][0] <= maxX && data[nullIndex][1] === null && (!inSelectedSpace[selectedIndex] || inSelectedSpace[selectedIndex][0] !== data[nullIndex][0] || inSelectedSpace[selectedIndex][1] !== data[nullIndex][1])) {\n inSelectedSpace.splice(selectedIndex, 0, data[nullIndex]);\n if (nullIndex >= lastIncluded) {\n lastIncluded = nullIndex + 1;\n }\n }\n nullIndex ++;\n selectedIndex ++;\n }\n }\n\n let dataIndex = lastIncluded || 0;\n while (dataIndex < data.length && data[dataIndex][0] <= maxX) {\n if (data[dataIndex][0] >= minX) {\n if (!ignoreDiscontinuities || data[dataIndex][1] || data[dataIndex][1] === 0) {\n inSelectedSpace.push(data[dataIndex]);\n }\n }\n dataIndex ++;\n }\n while (inSelectedSpace.length && inSelectedSpace[inSelectedSpace.length - 1][0] > maxX) {\n inSelectedSpace.pop();\n }\n\n } else {\n inSelectedSpace = data.slice(beforeIndex + 1, afterIndex);\n if (ignoreDiscontinuities) {\n inSelectedSpace = inSelectedSpace.filter(([_x, y]) => (y !== null && y !== undefined));\n }\n }\n\n if (!inSelectedSpace.length) {\n if (square) {\n if (beginningInterpolationIndex < 0) {\n inSelectedSpace = [[minX, null], [maxX, null]];\n } else {\n inSelectedSpace = [[minX, data[beginningInterpolationIndex][1]], [maxX, data[beginningInterpolationIndex][1]]];\n }\n } else {\n inSelectedSpace = [[minX, interpolate(data, beginningInterpolationIndex, endInterpolationIndex, minX)], [maxX, interpolate(data, beginningInterpolationIndex, endInterpolationIndex, maxX)]];\n }\n firstAdded = true;\n lastAdded = true;\n }\n\n if (!addToEndOnly) {\n let interpolationIndex = beforeIndex + 1;\n if (ignoreDiscontinuities) {\n while (interpolationIndex < data.length && data[interpolationIndex][1] === null) {\n interpolationIndex ++;\n }\n }\n\n if (inSelectedSpace.length && inSelectedSpace[0][0] > minX) {\n firstAdded = true;\n if (beginningInterpolationIndex === -1) {\n inSelectedSpace.unshift([minX, null]);\n } else {\n if (square) {\n inSelectedSpace.unshift([minX, data[beginningInterpolationIndex][1]]);\n } else {\n inSelectedSpace.unshift([minX, interpolate(data, beginningInterpolationIndex, interpolationIndex, minX)]);\n }\n }\n }\n }\n\n if (inSelectedSpace.length && inSelectedSpace[inSelectedSpace.length - 1][0] < maxX) {\n lastAdded = true;\n\n let interpolationIndex = afterIndex - 1;\n if (ignoreDiscontinuities) {\n while (interpolationIndex >= 0 && data[interpolationIndex][1] === null) {\n interpolationIndex --;\n }\n }\n\n if (endInterpolationIndex === data.length) {\n inSelectedSpace.push([maxX, null]);\n } else {\n if (square) {\n inSelectedSpace.push([maxX, inSelectedSpace[inSelectedSpace.length - 1][1]]);\n } else {\n inSelectedSpace.push([maxX, interpolate(data, interpolationIndex, endInterpolationIndex, maxX)]);\n }\n }\n }\n\n if (inSelectedSpace.length === 1) {\n let begPoint;\n let endPoint;\n if (square) {\n if (beginningInterpolationIndex < 0) {\n begPoint = [minX, null];\n } else {\n begPoint = [minX, data[beginningInterpolationIndex][1]];\n }\n endPoint = [maxX, inSelectedSpace[0][1]];\n } else {\n begPoint = [minX, interpolate(data, beginningInterpolationIndex, beforeIndex + 1, minX)];\n endPoint = [maxX, interpolate(data, afterIndex - 1, endInterpolationIndex, maxX)];\n }\n inSelectedSpace.unshift(begPoint);\n inSelectedSpace.push(endPoint);\n firstAdded = true;\n lastAdded = true;\n }\n\n return {\n data: inSelectedSpace,\n minX,\n maxX,\n beforeIndex,\n afterIndex,\n firstAdded,\n lastAdded,\n ignoreDiscontinuities\n //previouslyEmpty: false\n };\n}\n\nfunction undateify(potentialDate) {\n if (potentialDate instanceof Date) {\n return potentialDate.valueOf();\n }\n\n return potentialDate;\n}\n\n/**\n * Finds the point at the boundary via interpolation\n *\n * @param {Array<Array<Number>>} data\n * @param {Number} firstIndex\n * @param {Number} secondIndex\n * @param {Number} boundary\n * @return {null|*}\n */\nfunction interpolate(data, firstIndex, secondIndex, boundary) {\n if (firstIndex < 0 || secondIndex < 0) {\n return null;\n }\n\n if (firstIndex >= data.length || secondIndex >= data.length) {\n return null;\n }\n\n if (firstIndex === secondIndex) {\n return data[firstIndex][1];\n }\n\n const [xBefore, yBefore] = data[firstIndex];\n const [xAfter, yAfter] = data[secondIndex];\n\n if (boundary === xBefore && yBefore !== null) {\n return yBefore;\n }\n\n if (boundary === xAfter && yAfter !== null) {\n return yAfter;\n }\n\n if (yBefore === null || yAfter === null) {\n return null;\n }\n\n const percent = (boundary - xBefore)/(xAfter - xBefore);\n if (percent < 0 || percent > 1) {\n return null;\n }\n\n return percent*(yAfter - yBefore) + yBefore;\n}\n","/**\n * Scales y min and max bounds according to linear or log\n *\n * @param {Number} minY\n * @param {Number} maxY\n * @param {'linear'|'log'} scale\n * @return {{minY: Number, maxY: Number}}\n */\nexport default function scaleBounds({ minY, maxY, scale }) {\n if (scale === 'log') {\n maxY = Math.log10(maxY);\n\n if (minY <= 0) {\n if (maxY > 0) {\n minY = -maxY;\n } else {\n minY = 2*maxY;\n }\n } else {\n minY = Math.log10(minY);\n }\n }\n\n return {\n minY,\n maxY\n };\n}\n","import scaleBounds from '../../renderer/scale_bounds';\nimport RustAPI from '../rust_api';\n\n\nfunction selectedSpaceToRenderSpaceInPlace({ data, renderWidth, renderHeight, minX, maxX, minY, maxY, scale }, { nullMask, yValues, minYValues, maxYValues }) {\n let i = 0;\n let prevI = i - 1;\n\n for (let pixelX = 0; pixelX < renderWidth; pixelX++) {\n // find the x value that corresponds to the x pixel\n const x = (pixelX/(renderWidth - 1))*(maxX - minX) + minX;\n\n // set i such that data[i][0] < x <= data[i+1][0]\n let minSeenY = null;\n let maxSeenY = null;\n\n if (i > 0 && i <= data.length && data[i - 1][1] === null) {\n i--;\n }\n\n if (i < data.length - 2 && data[i + 1][0] < x) {\n i++;\n }\n\n for (i; i < data.length - 2 && data[i + 1][0] < x; i++) {\n const curY = data[i][1];\n\n if (curY === null) {\n continue;\n }\n\n if (minSeenY === null || curY < minSeenY) {\n minSeenY = curY;\n }\n\n if (maxSeenY === null || curY > maxSeenY) {\n maxSeenY = curY;\n }\n }\n\n minYValues[pixelX] = minSeenY === null ? 0 : renderHeight*(1 - ((scale === 'log' ? Math.log10(minSeenY) : minSeenY) - minY)/(maxY - minY));\n maxYValues[pixelX] = maxSeenY === null ? 0 : renderHeight*(1 - ((scale === 'log' ? Math.log10(maxSeenY) : maxSeenY) - minY)/(maxY - minY));\n\n // pass any discontinuities along\n if (i >= data.length - 1 || data[i][1] === null || data[i + 1][1] === null) {\n const y = i >= data.length - 1 ? null : data[i][1];\n\n nullMask[pixelX] = ((y === null) << 0) | ((minSeenY === null) << 1) | ((maxSeenY === null) << 2);\n yValues[pixelX] = y === null ? 0 : renderHeight*(1 - ((scale === 'log' ? Math.log10(y) : y) - minY)/(maxY - minY));\n\n i++;\n\n continue;\n }\n\n // interpolate\n const [xBefore, yBefore] = data[i];\n const [xAfter, yAfter] = data[i + 1];\n\n const percent = (x - xBefore) / (xAfter - xBefore);\n let y = percent * (yAfter - yBefore) + yBefore;\n\n // we're at the first point after the direction changed. Don't interpolate\n if (prevI !== i) {\n y = yBefore;\n }\n\n // // two x's with the same value; common in area charts\n // // to avoid this from having gotten skipped over, save in either min or max as appropriate\n // if (i > 0 && data[i - 1][0] === data[i][0]) {\n // // 0: minY a\n // // 1: original a\n // // 2: minY b\n // // 3: original b\n //\n // const [xBeforeOffset, yBeforeOffset] = data[i - 1];\n // const [xAfter, yAfter] = data[i + 1];\n // }\n\n yValues[pixelX] = y === null ? 0 : renderHeight*(1 - ((scale === 'log' ? Math.log10(y) : y) - minY)/(maxY - minY));\n nullMask[pixelX] = ((y === null) << 0) | ((minSeenY === null) << 1) | ((maxSeenY === null) << 2);\n\n prevI = i;\n }\n}\n\n/**\n * Convert from selected space to value space\n *\n * @param data\n * @param {Object} [swap]\n * @param {Number} renderWidth - width, in pixels, of the area in which the graph is rendered\n * @param {Number} renderHeight - height, in pixels, of the area in which the graph is rendered\n * @param {Number} minX - the minimum x value that is rendered\n * @param {Number} maxX - the maximum x value that is rendered\n * @param {Number} minY - the minimum y value that is rendered\n * @param {Number} maxY - the maximum y value that is rendered\n * @param {'log'|'linear'} scale\n * @param {Boolean} [dataChanged] - if true, will not rely on the prior data state from swap being accurate\n * @return {{nullMask: Uint8Array, maxYValues: Float64Array, minYValues: Float64Array, yValues: Float64Array, dataF64: Float64Array, dataNullMask: Uint8Array}}\n */\nexport default function selectedSpaceToRenderSpace({ data, swap, renderWidth, renderHeight, minX, maxX, minY, maxY, scale, dataChanged }) {\n if (swap && swap.yValues.length !== renderWidth) {\n swap = null;\n }\n\n const nullMask = (swap && swap.nullMask) || new Uint8Array(renderWidth);\n nullMask.fill(0);\n const yValues = new Float64Array(renderWidth);\n const minYValues = new Float64Array(renderWidth);\n const maxYValues = new Float64Array(renderWidth);\n\n const scaledBounds = scaleBounds({ minY, maxY, scale});\n minY = scaledBounds.minY;\n maxY = scaledBounds.maxY;\n\n const inParams = { data, renderWidth, renderHeight, minX, maxX, minY, maxY, scale };\n\n let dataF64, dataNullMask;\n\n if (RustAPI()) {\n let copyIndexStart = 0;\n\n const hasSwap = swap && swap.dataNullMask && swap.dataF64;\n const useSwap = !dataChanged && hasSwap && swap.minX === minX && swap.maxX <= maxX && swap.length <= data.length;\n\n if (!useSwap || swap.dataNullMask.length < data.length) {\n const extraSpaceFactor = 1.25;\n dataF64 = new Float64Array(Math.floor(data.length*2*extraSpaceFactor));\n dataNullMask = new Uint8Array(Math.floor(data.length*extraSpaceFactor));\n\n if (useSwap) {\n dataNullMask.set(swap.dataNullMask);\n dataF64.set(swap.dataF64);\n }\n } else {\n dataF64 = swap.dataF64;\n dataNullMask = swap.dataNullMask;\n }\n\n if (useSwap) {\n copyIndexStart = Math.max(swap.length - 1, 0);\n }\n\n for (let i = copyIndexStart; i < data.length; i++) {\n dataF64[2*i] = data[i][0];\n dataF64[2*i + 1] = data[i][1];\n\n if (data[i][1] === null) {\n dataNullMask[i] = 1;\n } else {\n dataNullMask[i] = 0;\n }\n }\n RustAPI().selected_space_to_render_space(data.length, dataF64, dataNullMask, inParams, nullMask, yValues, minYValues, maxYValues);\n } else {\n selectedSpaceToRenderSpaceInPlace(inParams, { nullMask, yValues, minYValues, maxYValues });\n }\n\n return {\n nullMask,\n yValues,\n minYValues,\n maxYValues,\n dataF64,\n dataNullMask,\n minX,\n maxX,\n length: data.length\n };\n}\n","/**\n * Flattens simple data\n * Returns an array of tuples (x value, simple point)\n *\n * @param simpleData\n * @param series\n * @param inDataSpace\n * @return {[]}\n */\nexport default function flattenSimpleData(simpleData, {series, inDataSpace }) {\n const flattened = [];\n let fI = 0;\n\n for (let point of simpleData) {\n const yValue = extractYValue(point, series);\n\n if (series.yKey && Array.isArray(yValue)) {\n for (let subpoint of point[series.yKey]) {\n if (series.ignoreDiscontinuities && typeof subpoint[series.yKey] !== 'number' && !Array.isArray(subpoint)) {\n continue;\n }\n\n const x = inDataSpace[fI++][0];\n\n if (series.square && flattened.length > 0) {\n flattened.push([x, flattened[flattened.length - 1][1]]);\n }\n\n flattened.push([x, subpoint]);\n }\n\n continue;\n }\n\n if (series.ignoreDiscontinuities && (yValue === undefined || yValue === null)) {\n continue;\n }\n\n const x = inDataSpace[fI++][0];\n\n if (series.square && flattened.length > 0) {\n flattened.push([x, flattened[flattened.length - 1][1]]);\n }\n\n flattened.push([x, point]);\n }\n\n if (flattened.length !== inDataSpace.length) {\n console.warn('Flattening didn\\'t give the same length as it has in data space'); // eslint-disable-line no-console\n }\n\n return flattened;\n}\n\nexport function extractYValue(point, series) {\n if (series.yKey) {\n return point[series.yKey];\n }\n\n if (Array.isArray(point)) {\n if (point.length === 1) {\n return point[0];\n } else {\n return point[1];\n }\n }\n\n return point;\n}\n\nexport function extractXValue(point, series) {\n if (series.xKey) {\n return point[series.xKey];\n }\n\n if (Array.isArray(point)) {\n return point[0];\n }\n\n return point;\n}\n","import binarySearch from '../helpers/binary_search';\nimport scaleBounds from '../renderer/scale_bounds';\nimport getColor from '../helpers/colors';\nimport flattenSimpleData, {extractXValue, extractYValue} from '../helpers/flatten_simple_data';\nimport {getBarWidths} from '../renderer/draw_bars';\n\nconst DISTANCE_THRESHOLD = 20;\n\n/**\n * Figures out the tooltip state\n *\n * @param {Boolean} mousePresent\n * @param {Number} mouseX\n * @param {Number} mouseY\n * @param {Object} sizing\n * @param {Array<Object>} series\n * @param {Set} alwaysTooltipped\n * @param {Array<Object>} savedTooltips\n * @param {Boolean} [allTooltipped]\n * @param {Number} closestSpacing\n * @return {{mouseX: *, mouseY: *, elementWidth: number, elementHeight: number, tooltips: any[]}}\n */\nexport default function calculateTooltipState({mousePresent, mouseX, mouseY, sizing, series, alwaysTooltipped, savedTooltips, allTooltipped, closestSpacing }) {\n // filter out saved tooltips for nonexistent series\n savedTooltips = savedTooltips.filter((tooltip) => tooltip.series.axis);\n\n for (let savedTooltip of savedTooltips) {\n moveTooltip({ mouseX, mouseY, sizing}, savedTooltip);\n }\n\n if (!mousePresent) {\n return {\n mouseX,\n mouseY,\n elementWidth: sizing.elementWidth,\n elementHeight: sizing.elementHeight,\n tooltips: [...savedTooltips]\n };\n }\n\n const tooltips = [];\n\n let minDistance = Infinity;\n\n for (let i = 0; i < series.length; i++) {\n const singleSeries = series[i];\n\n if (singleSeries.hidden) {\n continue;\n }\n\n const axis = singleSeries.axis;\n\n const scale = axis.scale;\n const bounds = axis.currentBounds;\n const { minY, maxY } = scaleBounds({...bounds, scale });\n\n const trueX = mouseX/sizing.elementWidth * (bounds.maxX - bounds.minX) + bounds.minX;\n\n let data = singleSeries.inDataSpace;\n if (singleSeries.ignoreDiscontinuities) {\n data = data.filter((tuple) => typeof tuple[1] === 'number');\n }\n\n if (data.length === 0) {\n continue;\n }\n\n const dataMinX = data[0][0];\n const dataMaxX = data[data.length - 1][0];\n const dataRange = dataMaxX - dataMinX;\n const padding = Math.max(dataRange * 0.05, (bounds.maxX - bounds.minX) * 0.02); \n\n if (trueX < dataMinX - padding || trueX > dataMaxX + padding) {\n continue;\n }\n\n const closestIndex = binarySearch(data, trueX, { returnIndex: true });\n const closestPoint = data[closestIndex];\n\n if (!closestPoint) {\n continue;\n }\n\n const [x, y] = closestPoint;\n\n if (x === null) {\n continue;\n }\n\n let pixelX = (x - bounds.minX)/(bounds.maxX - bounds.minX) * sizing.elementWidth;\n const pixelY = (1 - ((scale === 'log' ? Math.log10(y) : y) - minY)/(maxY - minY)) * sizing.elementHeight;\n\n if (pixelY > sizing.elementHeight || pixelY < 0) {\n continue;\n }\n\n const ignoreYDistanceCheck = alwaysTooltipped.has(singleSeries) || allTooltipped;\n let xDistanceThreshold = DISTANCE_THRESHOLD;\n let yDistanceThreshold = DISTANCE_THRESHOLD;\n let distanceThreshold = DISTANCE_THRESHOLD;\n\n if (singleSeries.rendering === 'bar') {\n const indexInAxis = singleSeries.axis.series.indexOf(singleSeries);\n const axisSeriesCount = singleSeries.axis.series.length;\n\n const { totalBarWidth, barWidth } = getBarWidths({\n closestSpacing,\n bounds,\n sizing,\n axisSeriesCount\n });\n\n // currently, pixelX is the center of all the bars\n // shift it to start at the far left, then shift it to the center of the individual bar\n pixelX -= totalBarWidth/2/sizing.pixelRatio;\n pixelX += (barWidth*(indexInAxis + 0.5))/sizing.pixelRatio;\n\n xDistanceThreshold = barWidth/2/sizing.pixelRatio;\n yDistanceThreshold = 100;\n distanceThreshold = xDistanceThreshold + yDistanceThreshold;\n }\n\n const xDistance = Math.abs(pixelX - mouseX);\n const yDistance = Math.abs(pixelY - mouseY);\n const distance = Math.sqrt((xDistance)**2 + (pixelY - mouseY)**2);\n\n if (!ignoreYDistanceCheck && (xDistance > xDistanceThreshold || yDistance > yDistanceThreshold || distance > distanceThreshold)) {\n continue;\n }\n\n let xLabel, yLabel;\n\n const simpleData = singleSeries.simpleData || singleSeries.data;\n\n const enumLike = simpleData.length && !!singleSeries.hasEnum;\n if (singleSeries.xLabel || singleSeries.yLabel || enumLike) {\n let simplePoint;\n\n if (simpleData.length === data.length) {\n simplePoint = simpleData[closestIndex];\n } else {\n const flattenedData = flattenSimpleData(simpleData, { series: singleSeries, inDataSpace: data });\n\n simplePoint = flattenedData[closestIndex][1];\n }\n\n if (singleSeries.xLabel) {\n xLabel = simplePoint[singleSeries.xLabel];\n } else if (singleSeries.hasXEnum) {\n xLabel = extractXValue(simplePoint, singleSeries);\n }\n\n if (singleSeries.yLabel) {\n yLabel = simplePoint[singleSeries.yLabel];\n } else if (enumLike) {\n yLabel = extractYValue(simplePoint, singleSeries);\n }\n }\n\n if (distance < minDistance) {\n minDistance = distance;\n }\n\n let color = getColor(singleSeries.color, i, singleSeries.multigrapherSeriesIndex);\n if (y < 0 && singleSeries.negativeColor) {\n color = singleSeries.negativeColor;\n } else if (y === 0 && singleSeries.zeroLineColor) {\n color = singleSeries.zeroLineColor;\n }\n\n tooltips.push({\n pixelWidth: sizing.elementWidth,\n pixelX: pixelX,\n pixelY: isNaN(pixelY) ? sizing.elementHeight/2 : pixelY,\n x,\n y,\n color,\n distance,\n xDistance,\n index: i,\n series: singleSeries,\n xLabel,\n yLabel,\n fullYPrecision: singleSeries.fullYPrecision,\n ignoreYDistanceCheck\n });\n }\n\n const unsavedTooltips = tooltips.filter(({ distance, ignoreYDistanceCheck }) => {\n return distance === minDistance || ignoreYDistanceCheck;\n }).sort((a, b) => b.distance - a.distance);\n\n return {\n mousePresent,\n mouseX,\n mouseY,\n elementWidth: sizing.elementWidth,\n elementHeight: sizing.elementHeight,\n unsavedTooltipsCount: unsavedTooltips.length,\n tooltips: [...savedTooltips, ...unsavedTooltips]\n };\n}\n\n/**\n * Recalculates the tooltip position, given the new sizing, bounds, etc.\n *\n * @param {Number} mouseX\n * @param {Number} mouseY\n * @param {Object} sizing\n * @param {Object} tooltip - The tooltip object to move\n */\nexport function moveTooltip({ mouseX, mouseY, sizing }, tooltip) {\n const { x, y } = tooltip;\n\n const scale = tooltip.series.axis.scale;\n const bounds = tooltip.series.axis.currentBounds;\n const { minY, maxY } = scaleBounds({...bounds, scale });\n\n const pixelX = (x - bounds.minX)/(bounds.maxX - bounds.minX) * sizing.elementWidth;\n const pixelY = (1 - ((scale === 'log' ? Math.log10(y) : y) - minY)/(maxY - minY)) * sizing.elementHeight;\n\n const distance = Math.sqrt((pixelX - mouseX)**2 + (pixelY - mouseY)**2);\n const xDistance = Math.abs(pixelX - mouseX);\n\n Object.assign(tooltip, {\n pixelWidth: sizing.elementWidth,\n pixelX: pixelX,\n pixelY: isNaN(pixelY) ? sizing.elementHeight/2 : pixelY,\n xDistance,\n distance\n });\n}\n\nexport function toggleTooltipSaved({ currentTooltips, savedTooltips }) {\n if (!currentTooltips.length) {\n return savedTooltips;\n }\n\n const lastTooltip = currentTooltips[currentTooltips.length - 1];\n if (lastTooltip.xDistance > DISTANCE_THRESHOLD || (!lastTooltip.ignoreYDistanceCheck && lastTooltip.distance > DISTANCE_THRESHOLD)) {\n return savedTooltips;\n }\n\n const currentTooltipIndex = savedTooltips.findIndex((tooltip) => {\n return tooltip.x === lastTooltip.x && tooltip.y === lastTooltip.y;\n });\n\n if (currentTooltipIndex === -1) {\n return [...savedTooltips, lastTooltip];\n } else {\n return savedTooltips.filter((_, index) => index !== currentTooltipIndex);\n }\n}\n","const BOUND_CALCULATORS = {\n all: () => {},\n lastMinute: (globalBounds) => {\n if (!globalBounds.dates) {\n return;\n }\n\n return {\n minX: Math.max(new Date(globalBounds.maxX).valueOf() - 60*1000, globalBounds.minX)\n };\n },\n last10Minutes: (globalBounds) => {\n if (!globalBounds.dates) {\n return;\n }\n\n return {\n minX: Math.max(new Date(globalBounds.maxX).valueOf() - 10*60*1000, globalBounds.minX)\n };\n },\n lastHour: (globalBounds) => {\n if (!globalBounds.dates) {\n return;\n }\n\n return {\n minX: Math.max(new Date(globalBounds.maxX).valueOf() - 60*60*1000, globalBounds.minX)\n };\n },\n lastDay: (globalBounds) => {\n if (!globalBounds.dates) {\n return;\n }\n\n return {\n minX: Math.max(new Date(globalBounds.maxX).valueOf() - 24*60*60*1000, globalBounds.minX)\n };\n }\n};\n\nexport default BOUND_CALCULATORS;\n","const BUCKETS_PER_PIXEL = 2;\nconst CONDENSE_THRESHOLD = 2;\n\n/**\n * Condenses the dataset down to a lower number of points to make subsequent operations more efficient\n * Will only condense when data length passes a given threshold\n * Note that this works best on datasets that are relatively evenly distributed across the x axis\n *\n * @param {Array<Array>} data\n * @param {{data: [], minX: Number, maxX: Number, length: Number}} swap\n * @param {Number} minX\n * @param maxX\n * @param renderWidth\n * @param dataChanged\n * @return {{data: [], minX: Number, maxX: Number, length: Number}}\n */\nexport default function condenseDataSpace({ data, swap, minX, maxX, renderWidth, dataChanged }) {\n const targetBucketCount = renderWidth*BUCKETS_PER_PIXEL;\n\n const useSwap = !dataChanged && swap && swap.minX === minX && swap.maxX <= maxX && swap.length <= data.length;\n\n let partiallyCondensedData;\n if (useSwap) {\n partiallyCondensedData = swap.data;\n\n if (data.length > swap.length) {\n // always overwrite the last in case it was mangled by the selected space interpolation\n if (data.length > 0 && partiallyCondensedData.length > 0) {\n partiallyCondensedData[partiallyCondensedData.length - 1] = data[swap.length - 1];\n }\n\n partiallyCondensedData = partiallyCondensedData.concat(data.slice(swap.length));\n }\n } else {\n partiallyCondensedData = [...data];\n }\n\n if (partiallyCondensedData.length / targetBucketCount < CONDENSE_THRESHOLD*2) { // * 2 because min and max\n return {\n data: partiallyCondensedData,\n minX,\n maxX,\n length: data.length\n };\n }\n\n const condensedData = [];\n const bucketSize = (maxX - minX)/targetBucketCount;\n let minInBucket = null;\n let maxInBucket = null;\n let currentBucketIndex = 0;\n\n // always add the first point so that x ranges are preserved\n if (data.length) {\n condensedData.push(data[0]);\n }\n\n for (let tuple of partiallyCondensedData) {\n const [x, y] = tuple;\n\n if (y === null) {\n continue;\n }\n\n const bucketIndex = Math.floor((x - minX)/bucketSize);\n\n if (bucketIndex !== currentBucketIndex) {\n if (minInBucket && maxInBucket) {\n if (minInBucket === maxInBucket) {\n if (condensedData[condensedData.length - 1] !== minInBucket) {\n condensedData.push(minInBucket);\n }\n } else if (minInBucket[0] < maxInBucket[0]) {\n condensedData.push(maxInBucket, minInBucket);\n } else {\n condensedData.push(minInBucket, maxInBucket);\n }\n }\n\n minInBucket = null;\n maxInBucket = null;\n currentBucketIndex = bucketIndex;\n }\n\n if (!minInBucket || y < minInBucket[1]) {\n minInBucket = tuple;\n }\n\n if (!maxInBucket || y > maxInBucket[1]) {\n maxInBucket = tuple;\n }\n }\n\n if (minInBucket && maxInBucket) {\n if (minInBucket === maxInBucket) {\n condensedData.push(minInBucket);\n } else if (minInBucket[0] < maxInBucket[0]) {\n condensedData.push(maxInBucket, minInBucket);\n } else {\n condensedData.push(minInBucket, maxInBucket);\n }\n }\n\n // always add the last point so that x ranges are preserved\n if (data.length >= 2 && data[data.length - 1] !== minInBucket && data[data.length - 1] !== maxInBucket) {\n condensedData.push(data[data.length - 1]);\n }\n\n return {\n data: condensedData,\n minX,\n maxX,\n length: data.length\n };\n}\n","/**\n * Gets the proper name for a series\n *\n * @param {Object} singleSeries\n * @param {Number} index\n * @return {string}\n */\nexport default function nameForSeries(singleSeries, index) {\n let name = singleSeries.name || singleSeries.yKey;\n\n if (!name) {\n name = index.toString();\n }\n\n return name;\n}\n","export function selectedSpaceToBackgroundSpace({ data, background, minX, maxX }) {\n if (!background) {\n return null;\n }\n\n const conditions = [];\n for (let [key, color] of Object.entries(background)) {\n if (typeof color === 'object') {\n if (typeof color.evaluator !== 'function') {\n throw new Error('Invalid background declaration: ' + key + ' (evaluator must be a function)');\n }\n\n conditions.push(Object.assign({\n key,\n comparator: 'custom',\n comparedAgainst: null\n }, color));\n continue;\n }\n\n if (key === 'null') {\n conditions.push({\n evaluator: (y) => y === null && color,\n color,\n key,\n comparator: '=',\n comparedAgainst: null\n });\n continue;\n }\n\n const [comparator, value] = key.split(' ');\n if (!comparator || !value || isNaN(parseFloat(value))) {\n throw new Error('Invalid background declaration: ' + key);\n }\n\n const parsedValue = parseFloat(value);\n\n let evaluator;\n if (comparator === '=') {\n evaluator = (y) => typeof y === 'number' && y === parsedValue && color;\n } else if (comparator === '<') {\n evaluator = (y) => typeof y === 'number' && y < parsedValue && color;\n } else if (comparator === '>') {\n evaluator = (y) => typeof y === 'number' && y > parsedValue && color;\n } else if (comparator === '<=') {\n evaluator = (y) => typeof y === 'number' && y <= parsedValue && color;\n } else if (comparator === '>=') {\n evaluator = (y) => typeof y === 'number' && y >= parsedValue && color;\n } else {\n throw new Error('Invalid background declaration: ' + key);\n }\n\n conditions.push({\n evaluator,\n color,\n key,\n comparator,\n comparedAgainst: parsedValue\n });\n }\n\n const inBackgroundSpace = [];\n let currentSection = null;\n\n for (let i = 0; i < data.length; i++) {\n let [x, y] = data[i];\n if (x instanceof Date) {\n x = x.valueOf();\n }\n\n for (let condition of currentSection ? [currentSection.condition, ...conditions] : conditions) {\n const color = condition.evaluator(y);\n\n if (currentSection) {\n if (currentSection.color === color) {\n break;\n }\n\n let interpolatedMaxX = x;\n if (i > 0) {\n let [prevX, prevY] = data[i - 1];\n if (prevX instanceof Date) {\n prevX = prevX.valueOf();\n }\n\n if (currentSection.condition.comparedAgainst === null) {\n interpolatedMaxX = x;\n } else if (y === null) {\n interpolatedMaxX = prevX;\n } else {\n interpolatedMaxX = prevX + (condition.comparedAgainst - prevY)/(y - prevY)*(x - prevX);\n }\n }\n\n inBackgroundSpace.push({\n ...currentSection,\n maxX: interpolatedMaxX,\n maxXt: (interpolatedMaxX - minX)/(maxX - minX)\n });\n currentSection = null;\n }\n\n if (color) {\n let interpolatedMinX = x;\n if (i > 0) {\n let [prevX, prevY] = data[i - 1];\n if (prevX instanceof Date) {\n prevX = prevX.valueOf();\n }\n\n if (condition.comparedAgainst === null) {\n interpolatedMinX = prevX;\n } else if (prevY === null) {\n interpolatedMinX = x;\n } else {\n interpolatedMinX = prevX + (condition.comparedAgainst - prevY)/(y - prevY)*(x - prevX);\n }\n }\n\n currentSection = {\n minX: interpolatedMinX,\n minXt: (interpolatedMinX - minX)/(maxX - minX),\n color,\n condition\n };\n\n break;\n }\n }\n }\n\n if (currentSection) {\n inBackgroundSpace.push({\n ...currentSection,\n maxX: data[data.length - 1][0],\n maxXt: (data[data.length - 1][0] - minX)/(maxX - minX)\n });\n }\n\n return {\n data: inBackgroundSpace\n };\n}\n","import simpleSeriesToDataSpace from './space_conversions/simple_series_to_data_space';\nimport calculateDataBounds from './calculate_data_bounds';\nimport mergeBounds from './merge_bounds';\nimport expandBounds from './expand_bounds';\nimport selectionFromGlobalBounds from './selection_from_global_bounds';\nimport dataSpaceToSelectedSpace from './space_conversions/data_space_to_selected_space';\nimport selectedSpaceToRenderSpace from './space_conversions/selected_space_to_render_space';\nimport Eventable from '../eventable';\nimport boundCalculatorFromSelection from './bound_calculator_from_selection';\nimport calculateTooltipState, {toggleTooltipSaved} from './calculate_tooltip_state';\nimport getDefaultBoundsCalculator from './get_default_bounds_calculator';\nimport inferType from './infer_type';\nimport {SIMPLE_DATA_TYPES} from './data_types';\nimport generatorParamsEqual from '../helpers/generator_params_equal';\nimport findMatchingAxis from './find_matching_axis';\nimport {DPI_INCREASE} from '../renderer/size_canvas';\nimport {averageLoopTimes} from './average_loop_times';\nimport condenseDataSpace from './space_conversions/condense_data_space.js';\nimport calculateAnnotationsState from './calculate_annotations_state.js';\nimport {selectedSpaceToBackgroundSpace} from './space_conversions/selected_space_to_background_space.js';\nimport RustAPI, {RustAPIPromise} from './rust_api';\n\nexport default class StateController extends Eventable {\n\n constructor({ defaultBoundsCalculator, customBoundsSelectors, requireWASM, defaultShowIndividualPoints, defaultShowSidebar, defaultShowAnnotations, defaultShowOptions, syncPool, grapherID, sharedDataCache, sharedSubscriptions, fullscreen }) {\n super();\n\n this._requireWASM = requireWASM;\n if (requireWASM) {\n RustAPIPromise.then(() => {\n this._markDirty();\n });\n }\n\n this._series = [];\n this._seriesFromOriginalSeries = new Map();\n\n this._axes = [\n {\n series: [],\n scale: 'linear',\n side: 'left',\n axisIndex: 0\n }\n ];\n this._highlightedSeries = null;\n\n this._showIndividualPoints = defaultShowIndividualPoints || false;\n this._autoscaleY = true;\n this._percentile = 100;\n this._percentileAsymmetry = 0;\n this._showingOptions = defaultShowOptions;\n this._maxPrecision = false;\n this._showingSidebar = defaultShowSidebar || false;\n this._showingAnnotations = defaultShowAnnotations || false;\n this._grapherID = grapherID;\n this._fullscreen = fullscreen || false;\n\n this._alwaysTooltipped = new Set();\n this._tooltipState = {\n mousePresent: false,\n mouseX: 0,\n mouseY: 0,\n elementWidth: 0,\n elementHeight: 0,\n tooltips: []\n };\n this._contextMenuPosition = {\n x: 0,\n y: 0,\n showing: false,\n value: null\n };\n this._savedTooltips = [];\n this._draggingY = false;\n this._annotations = [];\n this._annotationsState = {\n elementWidth: 0,\n annotations: []\n };\n this._enumMap = {};\n this._hasXEnum = false;\n\n this._timingBuffer = [];\n this._timingIndex = 0;\n this._timingFrameCount = 0;\n\n this._modifiedSeries = new Set();\n this._deferredEmissions = {};\n this._deferredPriorityEmissions = {};\n this.primaryRenderer = null;\n this.rangeGraphRenderer = null;\n\n this._boundsCalculator = getDefaultBoundsCalculator(defaultBoundsCalculator, customBoundsSelectors);\n this._boundsHistory = [this._boundsCalculator];\n this._boundsIndex = 0;\n\n this._dataCache = sharedDataCache || new Map();\n this._subscriptions = sharedSubscriptions || new Map();\n this._subscriptionsShared = !!sharedSubscriptions;\n this._observablesToSeries = new Map();\n this._generators = new Set();\n this._generatorsToSeries = new Map();\n this._generatorCallArgs = new Map();\n this._seriesChangedFromPromises = new Set();\n\n this._syncPool = syncPool;\n if (this._syncPool) {\n this._syncPool.add(this);\n }\n\n this._onDataChange();\n }\n\n dispose() {\n this.emit('dispose', this);\n\n this.clearListeners();\n\n if (!this._subscriptionsShared) {\n for (let listener of this._subscriptions.values()) {\n listener.unsubscribe();\n }\n this._subscriptions.clear();\n }\n\n for (let singleSeries of this._series) {\n this._removeSeries(singleSeries);\n }\n\n if (this._syncPool) {\n this._syncPool.remove(this);\n }\n\n this.disposed = true;\n }\n\n setSeries(series) {\n const userSeries = this._series.filter((singleSeries) => singleSeries.userCreated);\n const propsSeries = this._series.filter((singleSeries) => !singleSeries.userCreated);\n\n if (series.length === propsSeries.length) {\n let anyDifferent = false;\n for (let i = 0; i < series.length; i++) {\n if (series[i] !== this._series[i].originalSeries) {\n anyDifferent = true;\n break;\n }\n }\n\n if (!anyDifferent) {\n return;\n }\n } else {\n this._mustResize = this._mustResize || this._fullscreen;\n }\n\n const newSeriesSet = new Set(series);\n for (let singleSeries of propsSeries) {\n if (!newSeriesSet.has(singleSeries.originalSeries)) {\n this._removeSeries(singleSeries);\n }\n }\n\n this._series.splice(0);\n for (let i = 0; i < series.length; i++) {\n const originalSeries = series[i];\n\n let singleSeries = this._seriesFromOriginalSeries.get(originalSeries);\n if (!singleSeries) {\n singleSeries = {\n ...originalSeries,\n originalSeries\n };\n this._seriesFromOriginalSeries.set(originalSeries, singleSeries);\n\n if (singleSeries.defaultAlwaysTooltipped) {\n this._alwaysTooltipped.add(singleSeries);\n this._tooltipsChanged = true;\n this.deferredEmit('always_tooltipped_changed', this._alwaysTooltipped);\n }\n }\n\n singleSeries.index = i;\n this._series.push(singleSeries);\n this._assignAxisTo(singleSeries);\n\n if (singleSeries.hidden) {\n this._hideSeries(singleSeries);\n }\n }\n\n for (let i = 0; i < userSeries.length; i++) {\n const singleSeries = userSeries[i];\n singleSeries.index = i + series.length;\n this._series.push(singleSeries);\n }\n\n this.deferredEmit('series_changed', this._series);\n\n this._dataChanged = true;\n this._markDirty();\n }\n\n _markDirty() {\n if (this._frameRequested) {\n return;\n }\n\n if (this._requireWASM && !RustAPI) {\n return;\n }\n\n const frameRequestStart = performance.now();\n this._frameRequested = true;\n requestAnimationFrame(() => {\n if (this.disposed) {\n return;\n }\n\n const frameExecutionStart = performance.now();\n\n const dataProcessingStart = performance.now();\n if (this._dataChanged) {\n this._onDataChange();\n this._mustRerender = true;\n this._tooltipsChanged = true;\n this._annotationsChanged = true;\n } else if (this._modifiedSeries.size) {\n this._onDataAdd(this._modifiedSeries);\n this._mustRerender = true;\n this._tooltipsChanged = true;\n this._annotationsChanged = true;\n } else {\n if (this._primarySizeChanged) {\n this._calculatePrimarySizeDependents();\n this._mustRerender = true;\n }\n if (this._rangeGraphSizeChanged) {\n this._calculateRangeGraphSizeDependents();\n this._mustRerender = true;\n }\n }\n const dataProcessingEnd = performance.now();\n\n const renderPipelineStart = performance.now();\n if (this._mustRerender) {\n this._render();\n }\n const renderPipelineEnd = performance.now();\n\n const generatorsStart = performance.now();\n if (this._mustCallGenerators) {\n this._callGenerators();\n }\n const generatorsEnd = performance.now();\n\n const tooltipStart = performance.now();\n if (this._tooltipsChanged) {\n this._recalculateTooltips();\n }\n const tooltipEnd = performance.now();\n\n const contextMenuStart = performance.now();\n if (this._contextMenuChanged) {\n this._recalculateContextMenu();\n }\n const contextMenuEnd = performance.now();\n\n const annotationStart = performance.now();\n if (this._annotationsChanged) {\n this._recalculateAnnotations();\n }\n const annotationEnd = performance.now();\n\n if (this._mustResize) {\n this.primaryRenderer.resizeDebounced();\n this.rangeGraphRenderer && this.rangeGraphRenderer.resizeDebounced();\n }\n\n this._frameRequested = false;\n this._mustRerender = false;\n this._dataChanged = false;\n this._primarySizeChanged = false;\n this._rangeGraphSizeChanged = false;\n this._modifiedSeries.clear();\n this._seriesChangedFromPromises.clear();\n this._tooltipsChanged = false;\n this._contextMenuChanged = false;\n this._annotationsChanged = false;\n this._mustCallGenerators = false;\n this._mustResize = false;\n\n const callbacksStart = performance.now();\n for (let emission of [...Object.values(this._deferredPriorityEmissions), ...Object.values(this._deferredEmissions)]) {\n this.emit(...emission);\n }\n const callbacksEnd = performance.now();\n this._deferredEmissions = {};\n this._deferredPriorityEmissions = {};\n\n const completionTime = performance.now();\n const loopTime = {\n frameExecution: completionTime - frameExecutionStart,\n frameRequestAndExecution: completionTime - frameRequestStart,\n generators: generatorsEnd - generatorsStart,\n dataProcessing: dataProcessingEnd - dataProcessingStart,\n renderPipeline: renderPipelineEnd - renderPipelineStart,\n tooltips: tooltipEnd - tooltipStart,\n contextMenu: contextMenuEnd - contextMenuStart,\n annotations: annotationEnd - annotationStart,\n callbacks: callbacksEnd - callbacksStart\n };\n this.lastLoopTime = loopTime;\n if (this._timingFrameCount) {\n if (this._timingBuffer.length < this._timingFrameCount) {\n this._timingBuffer.push(loopTime);\n } else {\n this._timingBuffer[this._timingIndex % this._timingFrameCount] = loopTime;\n }\n this._timingIndex++;\n }\n this.emit('render_time', completionTime - frameExecutionStart, loopTime);\n });\n }\n\n deferredEmit(...args) {\n this._deferredEmissions[args[0]] = args;\n }\n\n deferredPriorityEmit(...args) {\n this._deferredPriorityEmissions[args[0]] = args;\n }\n\n _seriesToSimpleData(singleSeries) {\n const type = inferType(singleSeries);\n if (SIMPLE_DATA_TYPES.includes(type)) {\n return singleSeries.data;\n }\n\n // get a reference to whatever you already have\n let currentData = this._dataCache.get(singleSeries.data);\n\n if (currentData && this._seriesChangedFromPromises.has(singleSeries.data)) {\n return currentData;\n }\n\n if (!currentData) {\n currentData = [];\n this._dataCache.set(singleSeries.data, currentData);\n singleSeries.simpleData = currentData;\n }\n\n if (type === 'object_observable' || type === 'tuple_observable') {\n let sameDataSet = this._observablesToSeries.get(singleSeries.data);\n if (sameDataSet) {\n const firstSameDataSeries = sameDataSet.values().next().value;\n currentData = firstSameDataSeries.simpleData;\n if (!currentData) {\n throw new Error(`Cannot find simpleData in ${firstSameDataSeries.name || firstSameDataSeries.yKey || firstSameDataSeries.data}`);\n }\n this._dataCache.set(singleSeries.data, currentData);\n singleSeries.simpleData = currentData;\n } else {\n sameDataSet = new Set();\n singleSeries.simpleData = currentData;\n this._observablesToSeries.set(singleSeries.data, sameDataSet);\n }\n\n sameDataSet.add(singleSeries);\n\n this._listenToObservableData({\n observable: singleSeries.data,\n currentData\n });\n }\n\n if (type === 'generator') {\n if (!this._generatorsToSeries.has(singleSeries.data)) {\n this._generatorsToSeries.set(singleSeries.data, new Set());\n }\n\n this._generatorsToSeries.get(singleSeries.data).add(singleSeries);\n\n if (!this._generators.has(singleSeries.data)) {\n this._generators.add(singleSeries.data);\n this._callGenerator(singleSeries.data);\n }\n }\n\n // return whatever you have; it'll fetch more in the background\n return currentData;\n }\n\n _listenToPromise(singleSeries, dataPromise) {\n dataPromise.then((resolved) => {\n this._dataCache.set(singleSeries.data, resolved);\n singleSeries.simpleData = resolved;\n this._seriesChangedFromPromises.add(singleSeries.data);\n this._dataChanged = true;\n this._markDirty();\n });\n }\n\n _listenToObservableData({ observable, currentData }) {\n if (this._subscriptions.has(observable)) { // someone else already listened to it\n return;\n }\n this._subscriptions.set(observable, true);\n\n // listen to the new data\n const listener = observable.observe((point) => {\n if (Array.isArray(point)) {\n for (let datum of point) {\n currentData.push(datum);\n }\n } else {\n currentData.push(point);\n }\n\n this.emit('observable_modified', observable);\n\n this.markObservableModified(observable);\n });\n this._subscriptions.set(observable, listener);\n }\n\n markObservableModified(observable) {\n if (!this._observablesToSeries.has(observable)) {\n return;\n }\n\n for (let singleSeries of this._observablesToSeries.get(observable)) {\n this._modifiedSeries.add(singleSeries);\n }\n this._markDirty();\n }\n\n _unsubscribeFromStaleSeries() {\n const currentSeries = new Set(this._series);\n for (let [observable, seriesSet] of this._observablesToSeries) {\n let stillHasListener = false;\n\n for (let singleSeries of seriesSet) {\n if (currentSeries.has(singleSeries)) {\n stillHasListener = true;\n break;\n }\n }\n\n if (!stillHasListener) {\n this._subscriptions.get(observable).unsubscribe();\n this._subscriptions.delete(observable);\n this._observablesToSeries.delete(observable);\n }\n }\n\n for (let [generator, seriesSet ] of this._generatorsToSeries) {\n let stillHasSeries = false;\n\n for (let singleSeries of seriesSet) {\n if (currentSeries.has(singleSeries)) {\n stillHasSeries = true;\n break;\n }\n }\n\n if (!stillHasSeries) {\n this._generatorsToSeries.delete(generator);\n this._generators.delete(generator);\n this._generatorCallArgs.delete(generator);\n }\n }\n }\n\n async _callGenerator(generator) {\n const parameters = {\n minX: this._selection.minX,\n maxX: this._selection.maxX,\n sizing: this.primaryRenderer.sizing\n };\n\n if (generatorParamsEqual(this._generatorCallArgs.get(generator), parameters)) {\n return;\n }\n this._generatorCallArgs.set(generator, parameters);\n\n // Note: potential race condition if generator is stupid. For now, we'll rely on generator being smart\n // Race condition: a new, faster one runs before completed\n const data = await Promise.resolve(generator(parameters));\n\n // do nothing if the generator returned nothing\n if (!data) {\n return;\n }\n\n // because calling the generator may have taken some time, check that there are still listeners for it\n if (!this._generatorsToSeries.has(generator)) {\n return;\n }\n\n this._dataChanged = true;\n this._markDirty();\n\n if (typeof data.observe === 'function') {\n const currentData = [];\n this._dataCache.set(generator, currentData);\n for (let singleSeries of this._generatorsToSeries.get(generator)) {\n singleSeries.simpleData = currentData;\n }\n\n for (let singleSeries of this._generatorsToSeries.get(generator)) {\n if (!this._observablesToSeries.has(data)) {\n this._observablesToSeries.set(data, new Set());\n }\n\n this._observablesToSeries.get(data).add(singleSeries);\n }\n\n this._listenToObservableData({\n observable: data,\n currentData\n });\n } else {\n this._dataCache.set(generator, data);\n for (let singleSeries of this._generatorsToSeries.get(generator)) {\n singleSeries.simpleData = data;\n }\n }\n }\n\n _callGenerators() {\n for (let generator of this._generators) {\n this._callGenerator(generator);\n }\n }\n\n _recalculateTooltips() {\n if (!this.primaryRenderer || !this.primaryRenderer.sizing) {\n return;\n }\n\n this._tooltipState = calculateTooltipState({\n mousePresent: this._tooltipState.mousePresent,\n mouseX: this._tooltipState.mouseX,\n mouseY: this._tooltipState.mouseY,\n sizing: this.primaryRenderer.sizing,\n series: this._series,\n alwaysTooltipped: this._alwaysTooltipped,\n savedTooltips: this._savedTooltips,\n allTooltipped: this._tooltipAllNext,\n closestSpacing: this._globalBounds.closestSpacing\n });\n this._tooltipAllNext = false;\n this.deferredEmit('tooltip_state_changed', this._tooltipState, this._tooltipStateArg);\n this._tooltipStateArg = null;\n }\n \n _recalculateContextMenu() {\n if (!this.primaryRenderer || !this.primaryRenderer.sizing) {\n return;\n }\n\n const boundingRect = this.primaryRenderer.boundingRect;\n const sizing = this.primaryRenderer.sizing;\n let value = null;\n let newX = null;\n \n for (let series of this._series) {\n const bounds = series.axis.currentBounds;\n \n newX = this._contextMenuPosition.x - boundingRect.left;\n \n // if it's on the right side, move it to the left one width\n if (this._contextMenuPosition.x > (boundingRect.right - sizing.elementWidth) * 2) newX -= 130;\n\n if (series.xKey === 'timestamp' || series.xKey === 'time' || series.xKey === 'date') {\n value = new Date((this._contextMenuPosition.x - boundingRect.left) / sizing.elementWidth * (bounds.maxX - bounds.minX) + bounds.minX);\n } else {\n value = (this._contextMenuPosition.x - boundingRect.left) / sizing.elementWidth * (bounds.maxX - bounds.minX) + bounds.minX;\n }\n }\n this._contextMenuPosition = {\n x: newX,\n y: this._contextMenuPosition.y - boundingRect.top,\n showing: this._contextMenuPosition.showing,\n value: value\n };\n this.deferredEmit('context_menu_position_changed', this._contextMenuPosition);\n }\n\n _recalculateAnnotations() {\n if (!this.primaryRenderer || !this.primaryRenderer.sizing) {\n return;\n }\n\n this._annotationsState = calculateAnnotationsState({\n annotations: this._annotations,\n series: this._series,\n sizing: this.primaryRenderer.sizing,\n selection: this._selection\n });\n this.deferredEmit('annotations_changed', this._annotationsState);\n }\n\n _onDataChange() {\n this._expandYWith = [];\n const dataBoundsList = [];\n\n for (let singleSeries of this._series) {\n if (singleSeries.hidden) {\n continue;\n }\n\n const simpleData = this._seriesToSimpleData(singleSeries);\n singleSeries.inDataSpace = simpleSeriesToDataSpace({\n ...singleSeries,\n data: simpleData\n }, {\n stateController: this\n });\n singleSeries.simpleDataSliceStart = simpleData.length;\n singleSeries.dataBounds = calculateDataBounds(singleSeries.inDataSpace);\n if (singleSeries.rendering === 'bar') {\n singleSeries.dataBounds = expandBounds(singleSeries.dataBounds, { extendXForNBars: singleSeries.inDataSpace.length, expandYWith: singleSeries.expandYWith });\n }\n\n dataBoundsList.push(singleSeries.dataBounds);\n\n if (singleSeries.expandYWith) {\n this._expandYWith.push(singleSeries.expandYWith);\n }\n }\n\n this._unsubscribeFromStaleSeries();\n\n this._dataBounds = mergeBounds(dataBoundsList);\n\n this._recalculateSelection({ disableSwap: true});\n\n for (let singleSeries of this._series) {\n if (singleSeries.hidden) {\n continue;\n }\n\n singleSeries.selectedBounds = calculateDataBounds(singleSeries.inSelectedSpace.data, { percentile: this._percentile, percentileAsymmetry: this._percentileAsymmetry });\n if (singleSeries.hasAreaBottom) {\n singleSeries.selectedBoundsAreaTop = singleSeries.selectedBounds;\n singleSeries.selectedBoundsAreaBottom = calculateDataBounds(singleSeries.inSelectedSpaceAreaBottom.data, { percentile: this._percentile, percentileAsymmetry: this._percentileAsymmetry });\n\n singleSeries.selectedBounds = mergeBounds([\n singleSeries.selectedBoundsAreaTop,\n singleSeries.selectedBoundsAreaBottom\n ]);\n }\n }\n\n this._recalculateAxisBounds();\n\n for (let singleSeries of this._series) {\n if (singleSeries.hidden) {\n continue;\n }\n\n this._calculatePrimarySizeDependents(singleSeries, { dataChanged: true });\n this._calculateRangeGraphSizeDependents(singleSeries, { dataChanged: true });\n }\n }\n\n _onDataAdd(modifiedSeries) {\n const newData = new Map();\n const modifiedAxes = new Set();\n\n const modifiedSeriesAndDependents = new Set();\n for (let singleSeries of modifiedSeries) {\n modifiedSeriesAndDependents.add(singleSeries);\n }\n\n for (let singleSeries of modifiedSeries) {\n modifiedAxes.add(singleSeries.axis);\n\n if (!singleSeries.inDataSpace) {\n throw new Error('inDataSpace must be present for onDataAdd to be called');\n }\n\n const simpleData = this._seriesToSimpleData(singleSeries);\n\n let prevY;\n if (singleSeries.inDataSpace.length) {\n prevY = singleSeries.inDataSpace[singleSeries.inDataSpace.length - 1][1];\n }\n\n const newDataInDataSpace = simpleSeriesToDataSpace(singleSeries, {\n data: simpleData.slice(singleSeries.simpleDataSliceStart || 0),\n valueXStart: singleSeries.inDataSpace.length,\n prevY,\n stateController: this\n });\n newData.set(singleSeries, newDataInDataSpace);\n singleSeries.simpleDataSliceStart = simpleData.length;\n\n if (newDataInDataSpace.length < 32) {\n singleSeries.inDataSpace.push(...newDataInDataSpace);\n } else {\n for (let point of newDataInDataSpace) {\n singleSeries.inDataSpace.push(point);\n }\n }\n\n let newDataBounds = calculateDataBounds(newDataInDataSpace);\n if (singleSeries.rendering === 'bar') {\n newDataBounds = expandBounds(newDataBounds, { extendXForNBars: singleSeries.inDataSpace.length, expandYWith: singleSeries.expandYWith });\n }\n\n singleSeries.dataBounds = mergeBounds([singleSeries.dataBounds, newDataBounds]);\n this._dataBounds = mergeBounds([this._dataBounds, newDataBounds]);\n\n // save these off for debugging only\n singleSeries.newPointCount = newDataInDataSpace.length;\n singleSeries.newDataBounds = newDataBounds;\n }\n\n const previousSelection = this._selection;\n this._recalculateSelection();\n\n for (let singleSeries of modifiedSeries) {\n if (!singleSeries.inSelectedSpace.data.length) { // empty, trivially fast\n singleSeries.selectedBounds = calculateDataBounds(singleSeries.inSelectedSpace.data);\n continue;\n }\n\n const firstX = singleSeries.inSelectedSpace.data[0][0];\n const lastX = singleSeries.inSelectedSpace.data[singleSeries.inSelectedSpace.data.length - 1][0];\n\n const oldBoundSubsetOfNewBounds = previousSelection.minX >= firstX && previousSelection.maxX <= lastX;\n\n if (!oldBoundSubsetOfNewBounds || this._percentile !== 100) {\n // this is significantly slower, but it's too complex to diff the old bounds and new bounds or diff percentiles\n // besides, it not being a subset hopefully means its a lower volume of data\n singleSeries.selectedBounds = calculateDataBounds(singleSeries.inSelectedSpace.data, { percentile: this._percentile, percentileAsymmetry: this._percentileAsymmetry});\n if (singleSeries.hasAreaBottom) {\n singleSeries.selectedBoundsAreaTop = singleSeries.selectedBounds;\n singleSeries.selectedBoundsAreaBottom = calculateDataBounds(singleSeries.inSelectedSpaceAreaBottom.data, { percentile: this._percentile, percentileAsymmetry: this._percentileAsymmetry });\n\n singleSeries.selectedBounds = mergeBounds([\n singleSeries.selectedBoundsAreaTop,\n singleSeries.selectedBoundsAreaBottom\n ]);\n }\n continue;\n }\n\n // note: we could do a binary search here, but there are typically only a few points added each frame, so it isn't worth it\n const newSelectedData = newData.get(singleSeries)\n .filter((tuple) => tuple[0] >= this._selection.minX && tuple[0] <= this._selection.maxX);\n\n singleSeries.newSelectedData = newSelectedData;\n singleSeries.selectedBounds = mergeBounds([singleSeries.selectedBounds, calculateDataBounds(newSelectedData)]);\n }\n\n this._recalculateAxisBounds();\n\n this.deferredPriorityEmit('axis_bounds_changed', this._axes.map(({ currentBounds }) => currentBounds));\n\n for (let axis of modifiedAxes) {\n for (let singleSeries of axis.series) {\n this._calculatePrimarySizeDependents(singleSeries);\n this._calculateRangeGraphSizeDependents(singleSeries);\n }\n }\n }\n\n _recalculateAxisBounds() {\n for (let axis of this._axes) {\n if (this._selection.fixedY || !this._autoscaleY) {\n axis.targetBounds = this._selection;\n if (axis.targetBounds.byAxis) {\n axis.targetBounds = axis.targetBounds.byAxis[axis.axisIndex];\n }\n\n axis.currentBounds = axis.targetBounds;\n continue;\n }\n\n const selectedBoundsList = [];\n const expandYWith = [];\n\n for (let singleSeries of axis.series) {\n selectedBoundsList.push(singleSeries.selectedBounds);\n\n if (singleSeries.expandYWith) {\n expandYWith.push(...singleSeries.expandYWith);\n }\n\n if (singleSeries.rendering === 'bar') {\n expandYWith.push(singleSeries.selectedBounds.minY, singleSeries.selectedBounds.maxY);\n }\n }\n\n axis.selectedDataBounds = mergeBounds(selectedBoundsList);\n axis.targetBounds = axis.currentBounds = expandBounds(axis.selectedDataBounds, {expandYWith});\n }\n this.deferredPriorityEmit('axis_bounds_changed', this._axes.map(({ currentBounds }) => currentBounds));\n }\n\n /**\n * Recalculates global bounds, selection, and data in selected space (for each series)\n * REQUIRES that this._dataBounds and this._expandYWith are set & up-to-date\n *\n * @private\n */\n _recalculateSelection({disableSwap = false}={}) {\n this._globalBounds = expandBounds(this._dataBounds, {expandYWith: this._expandYWith.flat()});\n this.deferredPriorityEmit('global_bounds_changed', this._globalBounds);\n this._selection = selectionFromGlobalBounds(this._globalBounds, this._boundsCalculator);\n this.deferredPriorityEmit('selection_changed', this._selection);\n\n for (let singleSeries of this._series) {\n if (singleSeries.hidden) {\n continue;\n }\n\n singleSeries.inSelectedSpace = dataSpaceToSelectedSpace({\n data: singleSeries.hasAreaBottom ? singleSeries.inDataSpace.filter((_, i) => i % 2 === 1) : singleSeries.inDataSpace,\n swap: disableSwap ? null : singleSeries.inSelectedSpace,\n minX: this._selection.minX,\n maxX: this._selection.maxX,\n ignoreDiscontinuities: singleSeries.ignoreDiscontinuities,\n square: singleSeries.square\n });\n\n if (singleSeries.hasAreaBottom) {\n singleSeries.inSelectedSpaceAreaBottom = dataSpaceToSelectedSpace({\n data:singleSeries.inDataSpace.filter((_, i) => i % 2 === 0),\n swap: disableSwap ? null : singleSeries.inSelectedSpaceAreaBottom,\n minX: this._selection.minX,\n maxX: this._selection.maxX,\n ignoreDiscontinuities: singleSeries.ignoreDiscontinuities,\n square: singleSeries.square\n });\n }\n }\n }\n\n _render() {\n if (!this.primaryRenderer || !this.primaryRenderer.sizing) {\n return;\n }\n\n this.primaryRenderer.clear();\n if (this.rangeGraphRenderer) {\n this.rangeGraphRenderer.clear();\n }\n\n for (let singleSeries of this._series) {\n if (singleSeries.hidden) {\n continue;\n }\n\n const shadowColor = singleSeries.shadowColor || {\n day: 'white',\n export: 'transparent',\n night: 'black'\n }[this._theme] || 'black';\n\n const shadowBlur = undefined;\n\n this.primaryRenderer.renderBackground(singleSeries.inBackgroundSpacePrimary);\n\n this.primaryRenderer.render(singleSeries, singleSeries.inRenderSpacePrimary, {\n highlighted: this._highlightedSeries === singleSeries.index,\n showIndividualPoints: this._showIndividualPoints,\n shadowColor,\n shadowBlur,\n defaultLineWidth: this._defaultLineWidth,\n globalBounds: this._globalBounds,\n inRenderSpaceAreaBottom: singleSeries.inRenderSpacePrimaryAreaBottom\n });\n\n if (this.rangeGraphRenderer && this.rangeGraphRenderer.sizing) {\n // Use tighter bounds for range graph to prevent clipping\n const rangeGraphBounds = {\n ...this._globalBounds,\n minY: this._globalBounds.unscaledMinY !== undefined ? this._globalBounds.unscaledMinY : this._globalBounds.minY,\n maxY: this._globalBounds.unscaledMaxY !== undefined ? this._globalBounds.unscaledMaxY : this._globalBounds.maxY\n };\n \n this.rangeGraphRenderer.render(singleSeries, singleSeries.inRenderSpaceRangeGraph, {\n shadowColor: 'transparent',\n shadowBlur: 0,\n width: 1,\n bounds: rangeGraphBounds,\n globalBounds: rangeGraphBounds,\n inRenderSpaceAreaBottom: singleSeries.inRenderSpaceRangeGraphAreaBottom\n });\n }\n }\n }\n\n _calculatePrimarySizeDependents(singleSeries, { dataChanged=false } = {}) {\n if (!this.primaryRenderer || !this.primaryRenderer.sizing) {\n return;\n }\n\n if (!singleSeries) {\n for (let s of this._series) {\n this._calculatePrimarySizeDependents(s);\n }\n return;\n }\n\n if (!this._series.includes(singleSeries)) {\n throw new Error('Series no longer exists');\n }\n\n if (singleSeries.hidden) {\n return;\n }\n\n const { currentBounds, scale } = singleSeries.axis;\n const renderWidth = Math.ceil(this.primaryRenderer.sizing.renderWidth/DPI_INCREASE);\n const renderHeight = Math.ceil(this.primaryRenderer.sizing.renderHeight);\n\n const toCondensedSelectedSpaceParams = {\n minX: currentBounds.minX,\n maxX: currentBounds.maxX,\n renderWidth,\n dataChanged\n };\n\n singleSeries.inCondensedSelectedSpacePrimary = condenseDataSpace({\n data: singleSeries.inSelectedSpace.data,\n swap: singleSeries.inCondensedSelectedSpacePrimary,\n ...toCondensedSelectedSpaceParams\n });\n\n const toRenderSpaceParams = {\n minX: currentBounds.minX,\n maxX: currentBounds.maxX,\n minY: currentBounds.minY,\n maxY: currentBounds.maxY,\n renderWidth,\n renderHeight,\n scale,\n dataChanged\n };\n\n singleSeries.inRenderSpacePrimary = selectedSpaceToRenderSpace({\n data: singleSeries.inCondensedSelectedSpacePrimary.data,\n swap: singleSeries.inRenderSpacePrimary,\n ...toRenderSpaceParams\n });\n\n singleSeries.inBackgroundSpacePrimary = selectedSpaceToBackgroundSpace({\n data: singleSeries.inCondensedSelectedSpacePrimary.data,\n background: singleSeries.background,\n swap: singleSeries.inBackgroundSpacePrimary,\n minX: currentBounds.minX,\n maxX: currentBounds.maxX\n });\n\n if (singleSeries.hasAreaBottom) {\n singleSeries.inCondensedSelectedSpacePrimaryAreaBottom = condenseDataSpace({\n data: singleSeries.inSelectedSpaceAreaBottom.data,\n swap: singleSeries.inCondensedSelectedSpacePrimaryAreaBottom,\n ...toCondensedSelectedSpaceParams\n });\n\n singleSeries.inRenderSpacePrimaryAreaBottom = selectedSpaceToRenderSpace({\n data: singleSeries.inCondensedSelectedSpacePrimaryAreaBottom.data,\n swap: singleSeries.inRenderSpacePrimaryAreaBottom,\n ...toRenderSpaceParams\n });\n\n singleSeries.inBackgroundSpacePrimaryAreaBottom = selectedSpaceToBackgroundSpace({\n data: singleSeries.inCondensedSelectedSpacePrimaryAreaBottom.data,\n background: singleSeries.background,\n swap: singleSeries.inBackgroundSpacePrimaryAreaBottom,\n minX: currentBounds.minX,\n maxX: currentBounds.maxX\n });\n }\n }\n\n _calculateRangeGraphSizeDependents(singleSeries, { dataChanged=false } = {}) {\n if (!this.rangeGraphRenderer || !this.rangeGraphRenderer.sizing) {\n return;\n }\n\n if (!singleSeries) {\n for (let s of this._series) {\n this._calculateRangeGraphSizeDependents(s);\n }\n return;\n }\n\n if (!this._series.includes(singleSeries)) {\n throw new Error('Series no longer exists');\n }\n\n if (singleSeries.hidden) {\n return;\n }\n\n const { scale } = singleSeries.axis;\n const globalBounds = this._globalBounds;\n \n const rangeGraphBounds = {\n ...globalBounds,\n minY: globalBounds.unscaledMinY !== undefined ? globalBounds.unscaledMinY : globalBounds.minY,\n maxY: globalBounds.unscaledMaxY !== undefined ? globalBounds.unscaledMaxY : globalBounds.maxY\n };\n \n const renderWidth = Math.ceil(this.rangeGraphRenderer.sizing.renderWidth/DPI_INCREASE);\n const renderHeight = Math.ceil(this.rangeGraphRenderer.sizing.renderHeight);\n\n const toSelectedSpaceParams = {\n minX: globalBounds.minX,\n maxX: globalBounds.maxX,\n ignoreDiscontinuities: singleSeries.ignoreDiscontinuities,\n square: singleSeries.square\n };\n\n singleSeries.inSelectedSpaceRangeGraph = dataSpaceToSelectedSpace({\n data: singleSeries.hasAreaBottom ? singleSeries.inDataSpace.filter((_, i) => i % 2 === 1) : singleSeries.inDataSpace,\n swap: singleSeries.inSelectedSpaceRangeGraph,\n ...toSelectedSpaceParams\n });\n\n const toCondensedSelectedSpaceParams = {\n minX: globalBounds.minX,\n maxX: globalBounds.maxX,\n renderWidth,\n dataChanged\n };\n\n singleSeries.inCondensedSelectedSpaceRangeGraph = condenseDataSpace({\n data: singleSeries.inSelectedSpaceRangeGraph.data,\n swap: singleSeries.inCondensedSelectedSpaceRangeGraph\n });\n\n const toRenderSpaceParams = {\n minX: rangeGraphBounds.minX,\n maxX: rangeGraphBounds.maxX,\n minY: rangeGraphBounds.minY,\n maxY: rangeGraphBounds.maxY,\n renderWidth,\n renderHeight,\n scale,\n dataChanged\n };\n\n singleSeries.inRenderSpaceRangeGraph = selectedSpaceToRenderSpace({\n data: singleSeries.inCondensedSelectedSpaceRangeGraph.data,\n swap: singleSeries.inRenderSpaceRangeGraph,\n ...toRenderSpaceParams\n });\n\n if (singleSeries.hasAreaBottom) {\n singleSeries.inSelectedSpaceRangeGraphAreaBottom = dataSpaceToSelectedSpace({\n data: singleSeries.inDataSpace.filter((_, i) => i % 2 === 0), // take the odd points for area bottom\n swap: singleSeries.inSelectedSpaceRangeGraphAreaBottom,\n ...toSelectedSpaceParams\n });\n\n singleSeries.inCondensedSelectedSpaceRangeGraphAreaBottom = condenseDataSpace({\n data: singleSeries.inSelectedSpaceRangeGraphAreaBottom.data,\n swap: singleSeries.inCondensedSelectedSpaceRangeGraphAreaBottom,\n ...toCondensedSelectedSpaceParams\n });\n\n singleSeries.inRenderSpaceRangeGraphAreaBottom = selectedSpaceToRenderSpace({\n data: singleSeries.inCondensedSelectedSpaceRangeGraphAreaBottom.data,\n swap: singleSeries.inRenderSpaceRangeGraphAreaBottom,\n ...toRenderSpaceParams\n });\n }\n }\n\n _createAxis({ side }) {\n const axis = {\n series: [],\n scale: 'linear',\n side,\n axisIndex: this._axes.length\n };\n this._axes.push(axis);\n return axis;\n }\n\n _moveAxis(singleSeries, axisIndex) {\n if (!this._series.includes(singleSeries)) {\n throw new Error('Series no longer exists');\n }\n\n let newAxis;\n if (axisIndex === 'new-left' || axisIndex === 'new-right') {\n newAxis = this._createAxis({ side: axisIndex.split('-')[1] });\n } else {\n newAxis = this._axes[parseInt(axisIndex)];\n }\n\n if (singleSeries.axis === newAxis) {\n return;\n }\n\n const oldAxis = singleSeries.axis;\n const oldIndex = oldAxis.series.indexOf(singleSeries);\n if (oldIndex === -1) {\n throw new Error('Series not present in axis');\n }\n oldAxis.series.splice(oldIndex, 1);\n\n newAxis.series.push(singleSeries);\n singleSeries.axis = newAxis;\n\n this._dataChanged = true;\n this.deferredEmit('axes_changed', this._axes);\n this.deferredEmit('left_axes_changed', this.leftAxes);\n this.deferredEmit('right_axes_changed', this.rightAxes);\n this.deferredEmit('exported_axes_changed', this.exportedAxes);\n this._markDirty();\n }\n\n _assignAxisTo(singleSeries) {\n if (singleSeries.axis && typeof singleSeries.axis === 'object') {\n return;\n }\n\n let axis;\n\n if (singleSeries.axisIndex) {\n const { axisIndex } = singleSeries;\n\n if (axisIndex === 'new-left' || axisIndex === 'new-right') {\n axis = this._createAxis({ side: axisIndex.split('-')[1] });\n } else {\n axis = this._axes[parseInt(axisIndex)];\n }\n } else if (singleSeries.axis) {\n singleSeries.originalAxis = singleSeries.axis;\n let [side, number] = singleSeries.axis.split('-');\n axis = findMatchingAxis({ axes: this._axes, side, number });\n\n if (!axis) {\n axis = this._createAxis({\n side\n });\n }\n } else {\n axis = this._axes[0];\n }\n\n axis.series.push(singleSeries);\n singleSeries.axis = axis;\n\n this.deferredEmit('axes_changed', this._axes);\n this.deferredEmit('exported_axes_changed', this.exportedAxes);\n\n if (singleSeries.axis.side === 'left') {\n this.deferredEmit('left_axes_changed', this.leftAxes);\n } else {\n this.deferredEmit('right_axes_changed', this.rightAxes);\n }\n }\n\n _removeSeries(singleSeries) {\n this._seriesFromOriginalSeries.delete(singleSeries.originalSeries);\n\n const { axis, data } = singleSeries;\n axis.series.splice(axis.series.indexOf(singleSeries), 1);\n const sameDataSet = this._observablesToSeries.get(data);\n if (sameDataSet) {\n sameDataSet.delete(singleSeries);\n if (sameDataSet.size === 0) {\n this._observablesToSeries.delete(data);\n }\n }\n\n if (this._generatorsToSeries.has(data)) {\n this._generatorsToSeries.get(data).delete(singleSeries);\n if (this._generatorsToSeries.get(data).size === 0) {\n this._generatorsToSeries.delete(data);\n this._generators.delete(data);\n }\n }\n\n this._alwaysTooltipped.delete(singleSeries);\n\n singleSeries.axis = singleSeries.originalAxis;\n delete singleSeries.originalAxis;\n delete singleSeries.inDataSpace;\n delete singleSeries.inSelectedSpace;\n delete singleSeries.inValueSpacePrimary;\n delete singleSeries.inValueSpaceRangeGraph;\n delete singleSeries.inRenderSpacePrimary;\n delete singleSeries.inRenderSpaceRangeGraph;\n delete singleSeries.newPointCount;\n delete singleSeries.newDataBounds;\n delete singleSeries.simpleDataSliceStart;\n\n this.deferredEmit('axes_changed', this._axes);\n this.deferredEmit('exported_axes_changed', this.exportedAxes);\n\n if (axis.side === 'left') {\n this.deferredEmit('left_axes_changed', this.leftAxes);\n } else {\n this.deferredEmit('right_axes_changed', this.rightAxes);\n }\n }\n\n _hideSeries(singleSeries) {\n const { axis } = singleSeries;\n const indexInAxis = axis.series.indexOf(singleSeries);\n singleSeries.indexInAxis = indexInAxis;\n axis.series.splice(indexInAxis, 1);\n\n this.deferredEmit('axes_changed', this._axes);\n\n if (axis.side === 'left') {\n this.deferredEmit('left_axes_changed', this.leftAxes);\n } else {\n this.deferredEmit('right_axes_changed', this.rightAxes);\n }\n }\n\n _showSeries(singleSeries) {\n const { axis } = singleSeries;\n axis.series.splice(singleSeries.indexInAxis, 0, singleSeries);\n\n this.deferredEmit('axes_changed', this._axes);\n\n if (axis.side === 'left') {\n this.deferredEmit('left_axes_changed', this.leftAxes);\n } else {\n this.deferredEmit('right_axes_changed', this.rightAxes);\n }\n }\n\n /*\n * Getters\n *******************\n */\n\n get boundCalculator() {\n return this._boundsCalculator;\n }\n\n get axes() {\n return this._axes;\n }\n\n get leftAxes() {\n const leftAxes = this._axes.filter(({ side, series }) => side === 'left' && series.length > 0).reverse();\n\n if (leftAxes.length === 0 && this.rightAxes.length === 0) {\n leftAxes.push(this._axes[0]);\n }\n\n return leftAxes;\n }\n\n get rightAxes() {\n return this._axes.filter(({ side, series }) => side === 'right' && series.length > 0 );\n }\n\n get bounds() {\n return this._axes.map(({ targetBounds }) => targetBounds);\n }\n\n get selection() {\n return this._selection;\n }\n\n get globalBounds() {\n return this._globalBounds;\n }\n\n get series() {\n return this._series;\n }\n\n get highlightedSeries() {\n return this._highlightedSeries;\n }\n\n get showIndividualPoints() {\n return this._showIndividualPoints;\n }\n\n get autoscaleY() {\n return this._autoscaleY;\n }\n\n get boundHistory() {\n return {\n hasNextBounds: this._boundsIndex < this._boundsHistory.length - 1,\n hasPreviousBounds: this._boundsIndex > 0\n };\n }\n\n get tooltipState() {\n return this._tooltipState;\n }\n \n get contextMenuState() {\n return this._contextMenuPosition;\n }\n\n get alwaysTooltipped() {\n return this._alwaysTooltipped;\n }\n\n get draggingY() {\n return this._draggingY;\n }\n\n get averageLoopTime() {\n return averageLoopTimes(this._timingBuffer);\n }\n\n get exportedAxes() {\n const axisToName = new Map();\n let leftCount = 0;\n let rightCount = 0;\n\n for (let axis of this._axes) {\n let name;\n if (axis.side === 'left') {\n name = `left-${leftCount}`;\n leftCount++;\n } else {\n name = `right-${rightCount}`;\n rightCount++;\n }\n\n for (let singleSeries of axis.series) {\n axisToName.set(singleSeries, name);\n }\n }\n\n return this.series.map((singleSeries) => {\n return {\n ...singleSeries.originalSeries,\n axis: axisToName.get(singleSeries)\n };\n });\n }\n\n get percentile() {\n return this._percentile;\n }\n\n get percentileAsymmetry() {\n return this._percentileAsymmetry;\n }\n\n get showingOptions() {\n return this._showingOptions;\n }\n\n get maxPrecision() {\n return this._maxPrecision;\n }\n\n get showingSidebar() {\n return this._showingSidebar;\n }\n\n get showingAnnotations() {\n return this._showingAnnotations;\n }\n\n get userCreatedSeries() {\n return this._series.filter((singleSeries) => singleSeries.userCreated);\n }\n\n get grapherID() {\n return this._grapherID;\n }\n\n get annotationState() {\n return this._annotationsState;\n }\n\n get sizing() {\n return this.primaryRenderer && this.primaryRenderer.sizing;\n }\n\n get theme() {\n return this._theme;\n }\n\n get exportMode() {\n return this._exportMode;\n }\n\n get enumMap() {\n return this._enumMap;\n }\n\n get hasXEnum() {\n return this._hasXEnum;\n }\n\n /*\n * Setters / ways to mutate the state that aren't the underlying data changing\n ***********************************************************************************\n */\n\n markSizeChanged(renderer) {\n if (renderer === this.primaryRenderer) {\n this.deferredEmit('primary_size_change', this.primaryRenderer.sizing);\n this.deferredEmit('primary_bounding_rect_change', this.primaryRenderer.boundingRect);\n this._primarySizeChanged = true;\n } else if (renderer === this.rangeGraphRenderer) {\n this.deferredEmit('range_graph_size_change', this.rangeGraphRenderer.sizing);\n this.deferredEmit('range_graph_bounding_rect_change', this.rangeGraphRenderer.boundingRect);\n this._rangeGraphSizeChanged = true;\n }\n\n this._mustRerender = true;\n this._tooltipsChanged = true;\n this._annotationsChanged = true;\n this._mustCallGenerators = true;\n this._markDirty();\n }\n\n set theme(value) {\n this._theme = value;\n this._mustRerender = true;\n this.deferredEmit('theme_change', this._theme);\n this._markDirty();\n }\n\n set exportMode(value) {\n this._exportMode = value;\n\n if (value) {\n this._nonExportTheme = this.theme;\n this.theme = 'export';\n } else {\n this.theme = this._nonExportTheme;\n }\n\n this.deferredEmit('export_mode_change', this._exportMode);\n this._markDirty();\n }\n\n set defaultLineWidth(value) {\n this._defaultLineWidth = value;\n this._mustRerender = true;\n this._markDirty();\n }\n\n set boundCalculator(boundingFunction) {\n if (!boundingFunction) {\n return;\n }\n\n if (boundingFunction === this._boundsCalculator) {\n return;\n }\n\n if (boundingFunction.debounceHistory) {\n clearTimeout(this._boundingCalculatorDebouncer);\n this._boundingCalculatorDebouncer = setTimeout(() => {\n this._addBoundCalculatorToHistory(boundingFunction);\n }, 250);\n } else {\n this._addBoundCalculatorToHistory(boundingFunction);\n }\n\n this._boundsCalculator = boundingFunction;\n this.deferredEmit('bound_calculator_changed', this._boundsCalculator);\n this._dataChanged = true;\n this._mustCallGenerators = true;\n this._markDirty();\n }\n\n set customBoundsSelectors(boundsSelectors) {\n this._customBoundsSelectors = this._customBoundsSelectors || {};\n\n const indexedCustomBoundSelectors = {};\n\n for (let { label, calculator } of boundsSelectors) {\n indexedCustomBoundSelectors[label] = calculator;\n\n if (this._boundsCalculator === this._customBoundsSelectors[label] && this._boundsCalculator !== calculator) {\n this.boundCalculator = calculator;\n }\n }\n\n this._customBoundsSelectors = indexedCustomBoundSelectors;\n }\n\n _addBoundCalculatorToHistory(boundingFunction) {\n this._boundsIndex++;\n this._boundsHistory = this._boundsHistory.slice(0, this._boundsIndex);\n this._boundsHistory.push(boundingFunction);\n this.emit('bound_history_changed', this.boundHistory);\n }\n\n registerSeriesClick(selectedSeriesIndex) {\n this.emit('series_click', this._series[selectedSeriesIndex], selectedSeriesIndex);\n }\n\n setHighlightedSeries(highlightedSeries) {\n this._highlightedSeries = highlightedSeries;\n this.deferredEmit('highlighted_series_changed', highlightedSeries);\n this._mustRerender = true;\n this._markDirty();\n }\n\n toggleIndividualPoints() {\n this._showIndividualPoints = !this._showIndividualPoints;\n this.deferredEmit('show_individual_points_changed', this._showIndividualPoints);\n this._mustRerender = true;\n this._markDirty();\n }\n\n toggleYAutoscaling() {\n this._autoscaleY = !this._autoscaleY;\n this.deferredEmit('autoscale_y_changed', this._autoscaleY);\n this._markDirty();\n }\n\n toggleExportMode() {\n this.exportMode = !this._exportMode;\n }\n\n setBoundsFromSelection(pixelSelection) {\n this.boundCalculator = boundCalculatorFromSelection(pixelSelection, {\n elementWidth: this.primaryRenderer.sizing.elementWidth,\n elementHeight: this.primaryRenderer.sizing.elementHeight,\n selection: this._selection,\n axes: this._axes\n });\n }\n\n nextBounds() {\n this._boundsIndex++;\n this._boundsCalculator = this._boundsHistory[this._boundsIndex];\n this.deferredEmit('bound_calculator_changed', this._boundsCalculator);\n this.deferredEmit('bound_history_changed', this.boundHistory);\n this._dataChanged = true;\n this._markDirty();\n }\n\n previousBounds() {\n this._boundsIndex--;\n this._boundsCalculator = this._boundsHistory[this._boundsIndex];\n this.deferredEmit('bound_calculator_changed', this._boundsCalculator);\n this.deferredEmit('bound_history_changed', this.boundHistory);\n this._dataChanged = true;\n this._markDirty();\n }\n\n setLabel({ axisIndex, label }) {\n this._axes[axisIndex].label = label;\n this.deferredEmit('axes_changed', [...this._axes]);\n this._markDirty();\n }\n\n toggleScale({ axisIndex }) {\n const oldScale = this._axes[axisIndex].scale;\n this._axes[axisIndex].scale = oldScale === 'log' ? 'linear' : 'log';\n\n this._dataChanged = true;\n this.deferredEmit('axes_changed', [...this._axes]);\n this._markDirty();\n }\n\n recalculateTooltips() {\n this.primaryRenderer.recalculatePosition();\n this.setTooltipMousePosition({\n clientX: this._tooltipClientX,\n clientY: this._tooltipClientY,\n shiftKey: this.shiftKeyPressedOnMove,\n tooltipAllNext: this._tooltipAllNext,\n tooltipStateArg: this._tooltipStateArg\n });\n }\n\n setTooltipMousePosition({ clientX, clientY, shiftKey, mouseX, mouseY, tooltipAllNext, tooltipStateArg }) {\n const sizing = this.primaryRenderer.sizing;\n if (!sizing) {\n return;\n }\n\n if (typeof clientX === 'number') {\n this._tooltipClientX = clientX;\n\n if (clientX < sizing.boundingRect.left || clientX > sizing.boundingRect.right) {\n this.showOnlySavedTooltips();\n return;\n }\n } else if (typeof mouseY !== 'number') {\n return;\n }\n\n if (typeof clientY === 'number') {\n this._tooltipClientY = clientY;\n\n if (clientY < sizing.boundingRect.top || clientY > sizing.boundingRect.bottom) {\n this.showOnlySavedTooltips();\n return;\n }\n } else if (typeof mouseY !== 'number') {\n return;\n }\n\n const newMouseX = mouseX || (clientX - sizing.boundingRect.left);\n const newMouseY = mouseY || (clientY - sizing.boundingRect.top);\n if (this._tooltipState.mousePresent && newMouseX === this._tooltipState.mouseX && newMouseY === this._tooltipState.mouseY) {\n return;\n }\n\n this._tooltipsChanged = true;\n this._tooltipState.mousePresent = true;\n this._tooltipState.mouseX = newMouseX;\n this._tooltipState.mouseY = newMouseY;\n this.shiftKeyPressedOnMove = shiftKey;\n this._tooltipAllNext = tooltipAllNext;\n this._tooltipStateArg = tooltipStateArg;\n this._markDirty();\n }\n \n setContextMenuMousePosition({ clientX, clientY }) {\n this._contextMenuPosition = { x: clientX, y: clientY, showing: !this._contextMenuPosition.showing };\n this._contextMenuChanged = true;\n this._markDirty();\n }\n\n toggleAlwaysTooltipped(singleSeries, shiftKey) {\n if (this._alwaysTooltipped.has(singleSeries)) {\n if (shiftKey) {\n this._alwaysTooltipped.clear();\n } else {\n this._alwaysTooltipped.delete(singleSeries);\n }\n } else {\n if (shiftKey) {\n for (let series of this._series) {\n this._alwaysTooltipped.add(series);\n }\n } else {\n this._alwaysTooltipped.add(singleSeries);\n }\n }\n\n this._tooltipsChanged = true;\n this.deferredEmit('always_tooltipped_changed', this._alwaysTooltipped);\n this._markDirty();\n }\n\n showOnlySavedTooltips(tooltipStateArg) {\n if (!this._tooltipState.mousePresent) {\n return;\n }\n\n this._tooltipsChanged = true;\n this._tooltipState.mousePresent = false;\n this._tooltipStateArg = tooltipStateArg;\n this._markDirty();\n }\n\n registerClick({ clientX }) {\n if (!this._listeners['series_click']) {\n return;\n }\n\n const boundingRect = this.primaryRenderer.boundingRect;\n const sizing = this.primaryRenderer.sizing;\n\n for (let series of this._series) {\n const bounds = series.axis.currentBounds;\n\n const x = (clientX - boundingRect.left) / sizing.elementWidth * (bounds.maxX - bounds.minX) + bounds.minX;\n this.emit('series_click', { x, series });\n }\n }\n\n toggleTooltipSaved() {\n const oldSavedTooltips = this._savedTooltips;\n this._savedTooltips = toggleTooltipSaved({\n currentTooltips: this._tooltipState.tooltips,\n savedTooltips: this._savedTooltips\n });\n this._tooltipsChanged = this._savedTooltips !== oldSavedTooltips;\n this._markDirty();\n }\n\n clearSavedTooltips() {\n if (this._savedTooltips.length === 0) {\n return;\n }\n\n this._savedTooltips = [];\n this._tooltipsChanged = true;\n this._markDirty();\n }\n\n markDragStart() {\n if (this._draggingY) {\n return;\n }\n\n this._draggingY = true;\n this.deferredEmit('dragging_y_changed', this._draggingY);\n this._markDirty();\n }\n\n finalizeDrag(draggedSeries, axisIndex, grapherID) {\n if (!this._draggingY) {\n return;\n }\n\n this._draggingY = false;\n this.deferredEmit('dragging_y_changed', this._draggingY);\n\n const hasAxis = axisIndex && axisIndex !== 0;\n const sameGrapherID = grapherID === this._grapherID;\n\n if (hasAxis && sameGrapherID) {\n this._moveAxis(draggedSeries, axisIndex);\n this.deferredEmit('dragging_y_finalized', { draggedSeries, axisIndex, grapherID });\n } else if (grapherID) {\n this.deferredEmit('dragging_y_finalized', { draggedSeries, axisIndex, grapherID });\n }\n\n this._markDirty();\n }\n\n set timingFrameCount(value) {\n if (typeof value !== 'number') {\n return;\n }\n\n this._timingBuffer = [];\n this._timingIndex = 0;\n this._timingFrameCount = value;\n }\n\n set percentile(value) {\n if (value === undefined) {\n return;\n }\n\n this.deferredEmit('percentile_changed', value);\n\n if (value === '') {\n value = 100;\n }\n\n value = parseFloat(value);\n if (!isNaN(value) && value <= 100 && value >= 0) {\n this._percentile = value;\n this._dataChanged = true;\n }\n\n this._markDirty();\n }\n\n set percentileAsymmetry(value) {\n if (value === undefined) {\n return;\n }\n\n this.deferredEmit('percentile_asymmetry_changed', value);\n\n if (value === '') {\n value = 0;\n }\n\n value = parseFloat(value);\n if (!isNaN(value) && value <= 50 && value >= -50) {\n this._percentileAsymmetry = value;\n this._dataChanged = true;\n }\n\n this._markDirty();\n }\n\n set showingOptions(value) {\n if (value === undefined) {\n return;\n }\n\n this._showingOptions = value;\n this.deferredEmit('showing_options_changed', value);\n this._markDirty();\n }\n\n toggleShowingOptions() {\n this.showingOptions = !this.showingOptions;\n }\n\n toggleMaxPrecision() {\n this._maxPrecision = !this._maxPrecision;\n this.deferredEmit('max_precision_changed', this._maxPrecision);\n this._markDirty();\n }\n\n toggleShowingAnnotations() {\n this._showingAnnotations = !this._showingAnnotations;\n this.deferredEmit('showing_annotations_changed', this._showingAnnotations);\n this._markDirty();\n }\n\n toggleShowingSidebar() {\n this._showingSidebar = !this._showingSidebar;\n this.deferredEmit('showing_sidebar_changed', this._showingSidebar);\n this._markDirty();\n }\n\n setShowing(singleSeries, showing) {\n singleSeries.hidden = !showing;\n this._series = [...this._series];\n\n if (singleSeries.hidden) {\n this._hideSeries(singleSeries);\n } else {\n this._showSeries(singleSeries);\n }\n\n this.deferredEmit('series_changed', this._series, { skipResize: true });\n this._dataChanged = true;\n this._markDirty();\n }\n\n set annotations(value) {\n this._annotations = value || [];\n this._annotationsChanged = true;\n this._markDirty();\n }\n\n /**\n * Converts an enum to a number, mutating saved state if necessary to track that\n *\n * @param {String} value\n * @param {Object} singleSeries\n * @param {Boolean} [isX]\n * @return {Number}\n */\n enumToNumber(value, singleSeries, isX) {\n const existingIndex = this._enumMap[value];\n if (typeof existingIndex === 'number') {\n return existingIndex;\n }\n\n const indexToSet = Object.keys(this._enumMap).length;\n this._enumMap[value] = indexToSet;\n\n // safely handle reference changes\n this._series[singleSeries.index].hasEnum = true;\n if (isX) {\n this._series[singleSeries.index].hasXEnum = true;\n this._hasXEnum = true;\n this.deferredEmit('has_x_enum_change', this._hasXEnum);\n this.deferredEmit('x_enum_map_change', this._enumMap);\n }\n\n this.deferredEmit('enum_map_change', this._enumMap);\n\n return indexToSet;\n }\n\n triggerResize() {\n this._mustResize = true;\n this._markDirty();\n }\n}\n","import BOUND_CALCULATORS from './bound_calculators';\n\nexport default function getDefaultBoundsCalculator(givenLabel, customCalculators) {\n if (BOUND_CALCULATORS[givenLabel]) {\n return BOUND_CALCULATORS[givenLabel];\n }\n\n for (let { label, calculator } of customCalculators) {\n if (givenLabel === label) {\n return calculator;\n }\n }\n\n return BOUND_CALCULATORS.all;\n}\n","export default function generatorParamsEqual(a, b) {\n if (a === undefined || b === undefined) {\n return a === b;\n }\n\n return (a.minX === b.minX) &&\n (a.maxX === b.maxX) &&\n (a.sizing.elementWidth === b.sizing.elementWidth) &&\n (a.sizing.renderWidth === b.sizing.renderWidth);\n}\n","import nameForSeries from '../helpers/name_for_series.js';\n\nexport default function calculateAnnotationsState({ annotations, series, sizing, selection }) {\n const shownSeries = new Set(series.map((singleSeries, i) => {\n return {\n name: nameForSeries(singleSeries, i),\n hidden: singleSeries.hidden\n };\n }).filter(({ hidden }) => !hidden).map(({ name }) => name));\n\n const { elementWidth } = sizing;\n const { minX, maxX } = selection;\n const xRange = maxX - minX;\n\n // Avoid division by zero if minX === maxX\n if (xRange === 0) {\n return {\n annotations: [],\n elementWidth\n };\n }\n\n const renderableAnnotations = annotations.filter((annotation) => {\n if (!annotation.series) {\n return true;\n }\n\n for (let seriesName of annotation.series) {\n if (shownSeries.has(seriesName)) {\n return true;\n }\n }\n\n return false;\n }).map((annotation) => {\n const isRange = annotation.startX !== undefined && annotation.endX !== undefined;\n const isPoint = annotation.x !== undefined;\n\n let xStartValue = annotation.startX;\n let xEndValue = annotation.endX;\n\n if (!isRange && isPoint) {\n xStartValue = annotation.x;\n xEndValue = annotation.x;\n } else if (!isRange && !isPoint) {\n return null;\n }\n\n const convertToNumber = (val) => {\n if (typeof val === 'string') return new Date(val).valueOf();\n if (val instanceof Date) return val.valueOf();\n return val;\n };\n\n let startX = convertToNumber(xStartValue);\n let endX = convertToNumber(xEndValue);\n\n if (startX > endX) {\n [startX, endX] = [endX, startX];\n }\n\n let pixelStartX = (startX - minX) / xRange * elementWidth;\n let pixelEndX = (endX - minX) / xRange * elementWidth;\n\n // Clamp values to be within the element width\n pixelStartX = Math.max(0, Math.min(elementWidth, pixelStartX));\n pixelEndX = Math.max(0, Math.min(elementWidth, pixelEndX));\n\n let pixelWidth = pixelEndX - pixelStartX;\n if (pixelWidth < 1 && pixelEndX > 0 && pixelStartX < elementWidth) {\n if (!isRange && isPoint) {\n pixelWidth = 1;\n pixelStartX -= 0.5;\n } else if (isRange) {\n pixelWidth = 1;\n } else {\n pixelWidth = 0;\n }\n }\n \n pixelStartX = Math.max(0, Math.min(elementWidth - pixelWidth, pixelStartX));\n\n\n if (pixelWidth <= 0) {\n return null;\n }\n\n\n return {\n ...annotation,\n isRange,\n pixelStartX,\n pixelWidth\n };\n }).filter(annotation => annotation !== null);\n\n return {\n annotations: renderableAnnotations,\n elementWidth\n };\n}\n","export default function selectionFromGlobalBounds(globalBounds, boundsCalculator) {\n const targetBounds = Object.assign({}, globalBounds, boundsCalculator(globalBounds));\n\n if (targetBounds.maxX instanceof Date) {\n targetBounds.maxX = targetBounds.maxX.valueOf();\n }\n\n if (targetBounds.minX instanceof Date) {\n targetBounds.minX = targetBounds.minX.valueOf();\n }\n\n if (targetBounds.maxX < targetBounds.minX) {\n targetBounds.maxX = targetBounds.minX;\n }\n\n if (targetBounds.minX < globalBounds.minX) {\n targetBounds.minX = globalBounds.minX;\n }\n\n if (targetBounds.maxX > globalBounds.maxX) {\n targetBounds.maxX = globalBounds.maxX;\n }\n\n return targetBounds;\n}\n","/**\n *\n * @param {Array<Object>} axes\n * @param {'left'|'right'} [side]\n * @param {String|Number} [number]\n * @return {Object|undefined}\n */\nexport default function findMatchingAxis({ axes, side, number }) {\n if (number) {\n number = parseInt(number) || 0;\n } else {\n number = 0;\n }\n\n let axis;\n let seen = 0;\n for (let candidateAxis of axes) {\n if (candidateAxis.side !== side) {\n continue;\n }\n\n if (seen === number) {\n axis = candidateAxis;\n break;\n }\n\n seen++;\n }\n\n return axis;\n}\n","export function averageLoopTimes(loopTimes) {\n const result = {};\n\n for (let loopTime of loopTimes) {\n for (let [key, value] of Object.entries(loopTime)) {\n result[key] = (result[key] || 0) + value;\n }\n }\n\n for (let [key, value] of Object.entries(result)) {\n result[key] = value/loopTimes.length;\n }\n\n return result;\n}\n","import scaleBounds from '../renderer/scale_bounds';\n\nexport default function boundCalculatorFromSelection({ minPixelX, maxPixelX, minPixelY, maxPixelY}, { elementWidth, elementHeight, selection, axes }) {\n if (Math.abs(maxPixelX - minPixelX) < 1 || Math.abs(maxPixelY - minPixelY) < 1) {\n return;\n }\n\n const minX = (minPixelX/elementWidth)*(selection.maxX - selection.minX) + selection.minX;\n const maxX = (maxPixelX/elementWidth)*(selection.maxX - selection.minX) + selection.minX;\n\n const byAxis = [];\n for (let { currentBounds, scale } of axes) {\n const scaledBounds = scaleBounds({ ...currentBounds, scale });\n let maxY = (1 - minPixelY/elementHeight)*(scaledBounds.maxY - scaledBounds.minY) + scaledBounds.minY;\n let minY = (1 - maxPixelY/elementHeight)*(scaledBounds.maxY - scaledBounds.minY) + scaledBounds.minY;\n\n if (scale === 'log') {\n minY = Math.pow(10, minY);\n maxY = Math.pow(10, maxY);\n }\n byAxis.push({\n minX,\n maxX,\n minY,\n maxY\n });\n }\n\n return () => {\n return {\n minX,\n maxX,\n byAxis\n };\n };\n}\n","import { useState, useEffect } from 'react';\n\nexport function useEvent(eventSource, eventName, initialState=null, watch=[]) {\n if (typeof initialState === 'function') {\n const originalInitialState = initialState;\n initialState = () => originalInitialState;\n }\n\n const [value, setValue] = useState(initialState);\n\n useEffect(() => {\n const listener = (updatedValue) => {\n if (typeof updatedValue === 'function') {\n const originalUpdatedValue = updatedValue;\n updatedValue = () => originalUpdatedValue;\n }\n setValue(updatedValue);\n };\n\n eventSource.on(eventName, listener);\n return () => {\n eventSource.off(eventName, listener);\n };\n }, [...watch, setValue, eventSource]);\n\n return value;\n}\n\nexport function usePrimarySize(stateController) {\n return useEvent(stateController, 'primary_size_change', stateController.primaryRenderer ? stateController.primaryRenderer.sizing : {\n elementWidth: 0,\n elementHeight: 0,\n renderWidth: 0,\n renderHeight: 0\n });\n}\n\nexport function useAxes(stateController) {\n return useEvent(stateController, 'axes_changed', stateController.axes);\n}\n\nexport function useSeries(stateController) {\n return useEvent(stateController, 'series_changed', stateController.series);\n}\n\nexport function useHighlightedSeries(stateController) {\n return useEvent(stateController, 'highlighted_series_changed', stateController.highlightedSeries);\n}\n\nexport function useRightAxisCount(stateController) {\n return useRightAxes(stateController).length;\n}\n\nexport function useLeftAxisCount(stateController) {\n return useLeftAxes(stateController).length;\n}\n\nexport function useRightAxes(stateController) {\n return useEvent(stateController, 'right_axes_changed', stateController.rightAxes);\n}\n\nexport function useLeftAxes(stateController) {\n return useEvent(stateController, 'left_axes_changed', stateController.leftAxes);\n}\n\nexport function useSelection(stateController) {\n return useEvent(stateController, 'selection_changed', stateController.selection);\n}\n\nexport function useGlobalBounds(stateController) {\n return useEvent(stateController, 'global_bounds_changed', stateController.globalBounds);\n}\n\nexport function useAxisBounds(stateController) {\n return useEvent(stateController, 'axis_bounds_changed', stateController.axes.map(({ currentBounds }) => currentBounds));\n}\n\nexport function useBoundCalculator(stateController) {\n return useEvent(stateController, 'bound_calculator_changed', stateController.boundCalculator);\n}\n\nexport function useShowIndividualPoints(stateController) {\n return useEvent(stateController, 'show_individual_points_changed', stateController.showIndividualPoints);\n}\n\nexport function useAutoscaleY(stateController) {\n return useEvent(stateController, 'autoscale_y_changed', stateController.autoscaleY);\n}\n\nexport function useBoundHistory(stateController) {\n return useEvent(stateController, 'bound_history_changed', stateController.boundHistory);\n}\n\nexport function useAlwaysTooltipped(stateController) {\n return useEvent(stateController, 'always_tooltipped_changed', stateController.alwaysTooltipped);\n}\n\nexport function useTooltipState(stateController) {\n return useEvent(stateController, 'tooltip_state_changed', stateController.tooltipState);\n}\n\nexport function useContextMenu(stateController) {\n return useEvent(stateController, 'context_menu_position_changed', stateController.contextMenuState);\n}\n\nexport function useDraggingY(stateController) {\n return useEvent(stateController, 'dragging_y_changed', stateController.draggingY);\n}\n\nexport function usePercentile(stateController) {\n return useEvent(stateController, 'percentile_changed', stateController.percentile);\n}\n\nexport function useShowingOptions(stateController) {\n return useEvent(stateController, 'showing_options_changed', stateController.showingOptions);\n}\n\nexport function useMaxPrecision(stateController) {\n return useEvent(stateController, 'max_precision_changed', stateController.maxPrecision);\n}\n\nexport function usePercentileAsymmetry(stateController) {\n return useEvent(stateController, 'percentile_asymmetry_changed', stateController.percentileAsymmetry);\n}\n\nexport function useShowingSidebar(stateController) {\n return useEvent(stateController, 'showing_sidebar_changed', stateController.showingSidebar);\n}\n\nexport function useShowingAnnotations(stateController) {\n return useEvent(stateController, 'showing_annotations_changed', stateController.showingAnnotations);\n}\n\nexport function useMultiSeries(multigraphStateController) {\n return useEvent(multigraphStateController, 'multi_series_changed', multigraphStateController.multiSeries);\n}\n\nexport function useAnnotationState(stateController) {\n return useEvent(stateController, 'annotations_changed', stateController.annotationState);\n}\n\nexport function useSizing(stateController) {\n return useEvent(stateController, 'primary_size_change', stateController.sizing);\n}\n\nexport function useTheme(stateController) {\n return useEvent(stateController, 'theme_change', stateController.theme);\n}\n\nexport function useExportMode(stateController) {\n return useEvent(stateController, 'export_mode_change', stateController.exportMode);\n}\n\nexport function useHasXEnum(stateController) {\n return useEvent(stateController, 'has_x_enum_change', stateController.hasXEnum);\n}\n\nexport function useEnumMap(stateController) {\n return useEvent(stateController, 'enum_map_change', stateController.enumMap);\n}\n\nexport function useXEnumMap(stateController) {\n return useEvent(stateController, 'x_enum_map_change', stateController.enumMap);\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nexport default class Annotations extends React.PureComponent {\n\n render() {\n const { bodyHeight, annotationState } = this.props;\n const { annotations, elementWidth } = annotationState;\n\n const validAnnotations = annotations.filter(a => a.pixelStartX !== undefined && a.pixelWidth !== undefined);\n\n return (\n <div className=\"grapher-annotations\">\n {\n validAnnotations.map(({ pixelStartX, pixelWidth, content, isRange, lineOnly }, i) => {\n const annotationStyle = {\n left: pixelStartX\n };\n\n if (isRange) {\n return (\n <div key={`range-${i}`} className=\"grapher-annotation grapher-annotation-range\" style={annotationStyle}>\n <div\n className=\"annotation-range-marker\"\n style={{ width: pixelWidth, height: bodyHeight }}\n />\n </div>\n );\n } else {\n const pointMarkerWidth = lineOnly ? pixelWidth : Math.max(pixelWidth, 1);\n\n const textStyle = {};\n if (content) {\n textStyle.top = 21 * i;\n textStyle.position = 'absolute';\n const approxTextWidth = (content || '').length * 5.5;\n if (elementWidth > 0 && elementWidth - pixelStartX < approxTextWidth + 10) {\n textStyle.left = -approxTextWidth - 5;\n textStyle.textAlign = 'right';\n } else {\n textStyle.left = pointMarkerWidth + 5;\n }\n }\n\n return (\n <div key={`point-${i}`} className=\"grapher-annotation grapher-annotation-point\" style={annotationStyle}>\n <div\n className=\"annotation-marker\"\n style={{ width: pointMarkerWidth, height: bodyHeight }}\n />\n {content && !lineOnly &&\n <div className=\"annotation-text\" style={textStyle}>\n {content}\n </div>\n }\n </div>\n );\n }\n })\n }\n </div>\n );\n }\n}\n\nAnnotations.propTypes = {\n annotationState: PropTypes.shape({\n annotations: PropTypes.arrayOf(PropTypes.shape({\n pixelStartX: PropTypes.number,\n pixelWidth: PropTypes.number,\n content: PropTypes.string,\n isRange: PropTypes.bool,\n lineOnly: PropTypes.bool\n })).isRequired,\n elementWidth: PropTypes.number.isRequired\n }),\n bodyHeight: PropTypes.number\n};\n","import React from 'react';\nimport CustomPropTypes from '../helpers/custom_prop_types.js';\nimport PropTypes from 'prop-types';\nimport StateController from '../state/state_controller.js';\nimport {LINE_COLORS} from '../helpers/colors.js';\nimport {useAxisBounds, useSizing} from '../state/hooks.js';\n\nexport default React.memo(DraggablePoints);\n\nfunction DraggablePoints({ stateController, draggablePoints, onPointDrag, onDraggablePointsDoubleClick }) {\n const bounds = useAxisBounds(stateController)[0];\n const sizing = useSizing(stateController);\n\n if (!sizing) {\n return null;\n }\n\n const onPointlessDoubleClick = onDraggablePointsDoubleClick && ((event) => {\n const newXT = (event.clientX - sizing.boundingRect.left)/sizing.elementWidth;\n const newYT = 1 - (event.clientY - sizing.boundingRect.top)/sizing.elementHeight;\n\n onDraggablePointsDoubleClick(event, {\n x: newXT*(bounds.maxX - bounds.minX) + bounds.minX,\n y: newYT*(bounds.maxY - bounds.minY) + bounds.minY\n });\n });\n\n return (\n <div className=\"grapher-draggable-points\" onDoubleClick={onPointlessDoubleClick}>\n <svg width={sizing.elementWidth} height={sizing.elementHeight}>\n {\n draggablePoints.map((point, index) => {\n const xT = (point.x - bounds.minX)/(bounds.maxX - bounds.minX);\n const yT = (1 - (point.y - bounds.minY)/(bounds.maxY - bounds.minY));\n\n if (xT < 0 || xT > 1 || yT < 0 || yT > 1) {\n return null;\n }\n\n const pixelX = xT * sizing.elementWidth;\n const pixelY = yT * sizing.elementHeight;\n\n const radius = point.radius || 5;\n const fillColor = point.fillColor || LINE_COLORS[0];\n const strokeColor = point.strokeColor || 'white';\n const strokeWidth = point.strokeWidth || 1;\n\n const onMouseDown = (event) => {\n event.stopPropagation();\n\n if (!onPointDrag) {\n return;\n }\n\n const xOffset = pixelX - event.clientX;\n const yOffset = pixelY - event.clientY;\n\n const onMouseMove = (moveEvent) => {\n const newXT = (moveEvent.clientX + xOffset)/sizing.elementWidth;\n const newYT = 1 - (moveEvent.clientY + yOffset)/sizing.elementHeight;\n\n onPointDrag({\n index,\n point,\n x: newXT*(bounds.maxX - bounds.minX) + bounds.minX,\n y: newYT*(bounds.maxY - bounds.minY) + bounds.minY\n }, moveEvent);\n };\n\n const onMouseUp = () => {\n window.removeEventListener('mousemove', onMouseMove);\n window.removeEventListener('mouseup', onMouseUp);\n };\n\n window.addEventListener('mousemove', onMouseMove);\n window.addEventListener('mouseup', onMouseUp);\n };\n\n const onClick = point.onClick && ((event) => {\n point.onClick(event, point);\n });\n\n const onDoubleClick = point.onDoubleClick && ((event) => {\n event.stopPropagation();\n point.onDoubleClick(event, point);\n });\n\n return (\n <circle\n key={index}\n cx={pixelX}\n cy={pixelY}\n r={radius}\n fill={fillColor}\n stroke={strokeColor}\n strokeWidth={strokeWidth}\n onMouseDown={onMouseDown}\n onClick={onClick}\n onDoubleClick={onDoubleClick}\n />\n );\n })\n }\n </svg>\n </div>\n );\n}\n\nDraggablePoints.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n draggablePoints: CustomPropTypes.DraggablePoints.isRequired,\n onPointDrag: PropTypes.func,\n onDraggablePointsDoubleClick: PropTypes.func\n};\n","import React from 'react';\nimport CustomPropTypes from '../helpers/custom_prop_types.js';\nimport PropTypes from 'prop-types';\nimport StateController from '../state/state_controller.js';\nimport {useAxisBounds, useSizing} from '../state/hooks.js';\n\nexport default React.memo(VerticalLines);\n\nfunction VerticalLines({ stateController, verticalLines, isRangeGraph, bounds, elementWidth, elementHeight }) {\n bounds = bounds || useAxisBounds(stateController)[0];\n const sizing = useSizing(stateController);\n\n if (!sizing) {\n return null;\n }\n\n const relevantVerticalLines = verticalLines.filter(line => {\n if (isRangeGraph && !line.onRangeGraph) {\n return false;\n }\n\n if (line.onRangeGraphOnly && !isRangeGraph) {\n return false;\n }\n\n return true;\n });\n\n if (relevantVerticalLines.length === 0) {\n return null;\n }\n\n return (\n <div className=\"grapher-vertical-lines\">\n <svg width={elementWidth || sizing.elementWidth} height={elementHeight || sizing.elementHeight}>\n {\n relevantVerticalLines.map((line, index) => {\n if (isRangeGraph && typeof line.onRangeGraph === 'object') {\n line = {\n ...line,\n ...line.onRangeGraph\n };\n }\n\n const xT = (line.x - bounds.minX)/(bounds.maxX - bounds.minX);\n\n if (xT < 0 || xT > 1) {\n return null;\n }\n\n const pixelX = xT * (elementWidth || sizing.elementWidth);\n if (typeof line.minPixelX === 'number' && pixelX < line.minPixelX) {\n return null;\n }\n\n if (typeof line.maxPixelX === 'number' && pixelX > line.maxPixelX) {\n return null;\n }\n\n const lineStyle = {\n stroke: line.color,\n strokeWidth: line.width,\n ...(line.style || {})\n };\n\n const markerStyle = {\n fill: line.color,\n ...(line.markerStyle || {})\n };\n\n const textStyle = {\n ...{\n fontSize: '12px',\n fill: line.color,\n stroke: 'none',\n textAnchor: 'middle',\n dominantBaseline: 'hanging'\n },\n ...(line.textStyle || {})\n };\n\n let lineTop = 0;\n if (typeof line.lineTop === 'number') {\n lineTop = line.lineTop;\n } else if (line.text) {\n lineTop = 18;\n }\n\n let textTop = 5;\n if (typeof line.textTop === 'number') {\n textTop = line.textTop;\n }\n\n return (\n <React.Fragment key={index}>\n <line\n x1={pixelX}\n y1={lineTop}\n x2={pixelX}\n y2={(elementHeight || sizing.elementHeight)}\n style={lineStyle}\n />\n\n {\n line.markTop &&\n <polygon\n points={`${pixelX - 3},0 ${pixelX + 3},0 ${pixelX},3`}\n style={markerStyle}\n />\n }\n\n {\n line.text &&\n <text\n x={pixelX}\n y={textTop}\n style={textStyle}\n >\n {line.text}\n </text>\n }\n </React.Fragment>\n );\n })\n }\n </svg>\n </div>\n );\n}\n\nVerticalLines.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n verticalLines: CustomPropTypes.VerticalLines.isRequired,\n isRangeGraph: PropTypes.bool,\n bounds: PropTypes.object,\n elementWidth: PropTypes.number,\n elementHeight: PropTypes.number\n};\n","import React, { useCallback, useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport CustomPropTypes from '../helpers/custom_prop_types';\nimport GraphBodyRenderer from '../renderer/graph_body_renderer';\nimport Tooltip from './tooltip.jsx';\nimport ContextMenu from './context_menu.jsx';\nimport StateController from '../state/state_controller';\nimport {\n useAnnotationState,\n useAutoscaleY,\n useAxes,\n useMaxPrecision,\n useShowingAnnotations,\n useTooltipState,\n useContextMenu\n} from '../state/hooks';\nimport Annotations from './annotations.jsx';\nimport DraggablePoints from './draggable_points.jsx';\nimport VerticalLines from './vertical_lines.jsx';\nimport binarySearch from '../helpers/binary_search';\n\nexport default React.memo(GraphBody);\n\nfunction GraphBody({ stateController, webgl, bodyHeight, boundsSelectionEnabled, showTooltips, tooltipOptions, checkIntersection, draggablePoints, onPointDrag, onDraggablePointsDoubleClick, verticalLines, clockStyle, timeZone, onPointClick }) {\n const canvasEl = useCallback((el) => {\n if (stateController.primaryRenderer) {\n stateController.primaryRenderer.dispose();\n }\n\n if (!el) {\n return;\n }\n\n const renderer = new GraphBodyRenderer({\n stateController: stateController,\n canvasElement: el,\n webgl,\n checkIntersection\n });\n\n stateController.primaryRenderer = renderer;\n renderer.resize();\n }, [webgl, stateController]);\n\n\n const [boundsSelection, setBoundsSelection] = useState({\n showing: false,\n start: {},\n style: {}\n });\n\n const autoscaleY = useAutoscaleY(stateController);\n\n const axisCount = useAxes(stateController).length;\n\n const tooltip = useTooltipState(stateController);\n const maxPrecision = useMaxPrecision(stateController);\n const showAnnotations = useShowingAnnotations(stateController);\n const annotationState = useAnnotationState(stateController);\n const contextMenu = useContextMenu(stateController);\n\n const onMouseDown = (event) => {\n if (!boundsSelectionEnabled) {\n return;\n }\n\n let currentNode = event.target;\n for (let i = 0; i < 10 && currentNode; i++) {\n if (currentNode.classList.contains('grapher-tooltip')) {\n return;\n }\n currentNode = currentNode.parentNode;\n }\n\n const boundingRect = stateController.primaryRenderer.boundingRect;\n\n const start = {\n x: event.clientX - boundingRect.left,\n y: event.clientY - boundingRect.top\n };\n\n\n setBoundsSelection({\n showing: true,\n start,\n style: {\n left: start.x,\n top: start.y,\n width: 0,\n height: 0\n }\n });\n\n const onMouseUp = (event) => {\n window.removeEventListener('mouseup', onMouseUp);\n\n if (!boundsSelectionEnabled) {\n return;\n }\n\n const x = event.clientX - boundingRect.left;\n const y = event.clientY - boundingRect.top;\n\n stateController.setBoundsFromSelection({\n minPixelX: Math.min(x, start.x),\n maxPixelX: Math.max(x, start.x),\n minPixelY: Math.min(y, start.y),\n maxPixelY: Math.max(y, start.y)\n });\n\n setBoundsSelection({\n showing: false,\n style: {}\n });\n };\n\n window.addEventListener('mouseup', onMouseUp);\n };\n\n const onMouseMove = (event) => {\n if (boundsSelection.showing) {\n const boundingRect = stateController.primaryRenderer.boundingRect;\n const x = event.clientX - boundingRect.left;\n const y = event.clientY - boundingRect.top;\n\n setBoundsSelection(({ start }) => {\n return {\n showing: true,\n start,\n style: {\n left: Math.min(x, start.x),\n top: autoscaleY ? 0 : Math.min(y, start.y),\n width: Math.abs(x - start.x),\n height: autoscaleY ? boundingRect.height : Math.abs(y - start.y)\n }\n };\n });\n }\n };\n\n useEffect(() => {\n const onScroll = () => {\n if (!showTooltips) {\n return;\n }\n\n stateController.recalculateTooltips();\n };\n\n const onGlobalMouseMove = (event) => {\n if (!showTooltips) {\n return;\n }\n\n stateController.setTooltipMousePosition({\n clientX: event.clientX,\n clientY: event.clientY,\n shiftKey: event.shiftKey\n });\n };\n\n const getTouch = (event) => event.touches?.[0] || event.changedTouches?.[0];\n\n const onGlobalTouchStart = (event) => {\n if (!showTooltips) {\n return;\n }\n const touch = getTouch(event);\n if (!touch) return;\n stateController.setTooltipMousePosition({\n clientX: touch.clientX,\n clientY: touch.clientY\n });\n \n // Only prevent default if touch is within grapher bounds\n if (event.cancelable && event.target.closest('.graph-body')) {\n event.preventDefault();\n }\n };\n\n const onGlobalTouchMove = (event) => {\n if (!showTooltips) {\n return;\n }\n const touch = getTouch(event);\n if (!touch) return;\n stateController.setTooltipMousePosition({\n clientX: touch.clientX,\n clientY: touch.clientY\n });\n \n // Only prevent default if touch is within grapher bounds\n if (event.cancelable && event.target.closest('.graph-body')) {\n event.preventDefault();\n }\n };\n\n const onGlobalTouchEnd = () => {\n stateController.showOnlySavedTooltips();\n };\n\n window.addEventListener('scroll', onScroll, { passive: true });\n window.addEventListener('mousemove', onGlobalMouseMove, { passive: true });\n window.addEventListener('touchstart', onGlobalTouchStart, { passive: false });\n window.addEventListener('touchmove', onGlobalTouchMove, { passive: false });\n window.addEventListener('touchend', onGlobalTouchEnd, { passive: true });\n window.addEventListener('touchcancel', onGlobalTouchEnd, { passive: true });\n\n return () => {\n window.removeEventListener('scroll', onScroll);\n window.removeEventListener('mousemove', onGlobalMouseMove);\n window.removeEventListener('touchstart', onGlobalTouchStart);\n window.removeEventListener('touchmove', onGlobalTouchMove);\n window.removeEventListener('touchend', onGlobalTouchEnd);\n window.removeEventListener('touchcancel', onGlobalTouchEnd);\n };\n }, []);\n\n const onMouseLeave = () => {\n stateController.setContextMenuMousePosition({\n showing: false\n });\n };\n\n const onClick = (event) => {\n stateController.registerClick({\n clientX: event.clientX,\n clientY: event.clientY\n });\n\n if (tooltipOptions && tooltipOptions.savingDisabled) {\n stateController.clearSavedTooltips();\n return;\n }\n\n // if it's NOT a child of 'grapher-context-menu', close the context menu\n if (!event.target.closest('.grapher-context-menu')) {\n stateController.setContextMenuMousePosition({\n showing: false\n });\n }\n\n if (!window.getSelection || window.getSelection().type !== 'Range') {\n stateController.toggleTooltipSaved();\n }\n\n if (onPointClick) {\n const seriesToNearestPoint = {};\n\n const series = stateController.series;\n for (let i = 0; i < series.length; i++) {\n const singleSeries = series[i];\n\n const sizing = stateController.sizing;\n const bounds = singleSeries.axis.currentBounds;\n // const trueX = event.clientX/sizing.elementWidth * (bounds.maxX - bounds.minX) + bounds.minX;\n const trueX = stateController.tooltipState.mouseX/sizing.elementWidth * (bounds.maxX - bounds.minX) + bounds.minX;\n\n let data = singleSeries.inDataSpace;\n if (singleSeries.ignoreDiscontinuities) {\n data = data.filter((tuple) => typeof tuple[1] === 'number');\n }\n \n const closestIndex = binarySearch(data, trueX, { returnIndex: true });\n const closestPoint = data[closestIndex];\n\n seriesToNearestPoint[singleSeries.name] = closestPoint[0];\n }\n\n\n\n onPointClick(event, seriesToNearestPoint);\n }\n };\n const onDoubleClick = () => {\n stateController.clearSavedTooltips();\n };\n \n const onContextMenu = (event) => {\n event.preventDefault();\n stateController.setContextMenuMousePosition({\n clientX: event.clientX,\n clientY: event.clientY,\n showing: true\n });\n };\n\n return (\n <div className=\"graph-body graph-body-primary\"\n onMouseMove={onMouseMove}\n onMouseLeave={onMouseLeave}\n onMouseDown={onMouseDown}\n onClick={onClick}\n onDoubleClick={onDoubleClick}\n onContextMenu={onContextMenu}\n style={typeof bodyHeight === 'number' ? { height: bodyHeight } : undefined}\n >\n <canvas ref={canvasEl} />\n\n {\n showTooltips &&\n <Tooltip\n axisCount={axisCount}\n maxPrecision={maxPrecision}\n clockStyle={clockStyle}\n timeZone={timeZone}\n {...(tooltipOptions || {})}\n {...tooltip}\n />\n }\n\n {\n contextMenu.showing &&\n <ContextMenu\n contextMenu={contextMenu}\n />\n }\n\n {\n showAnnotations &&\n <Annotations\n bodyHeight={bodyHeight || stateController?.primaryRenderer?.boundingRect?.height}\n annotationState={annotationState}\n />\n }\n\n {\n verticalLines &&\n <VerticalLines\n stateController={stateController}\n verticalLines={verticalLines}\n />\n }\n\n {\n draggablePoints &&\n <DraggablePoints\n stateController={stateController}\n draggablePoints={draggablePoints}\n onPointDrag={onPointDrag}\n onDraggablePointsDoubleClick={onDraggablePointsDoubleClick}\n />\n }\n\n {\n boundsSelectionEnabled && boundsSelection.showing &&\n <div className=\"bounds-selection\"\n style={boundsSelection.style}\n />\n }\n </div>\n );\n}\n\nGraphBody.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n webgl: PropTypes.bool,\n checkIntersection: PropTypes.bool,\n bodyHeight: PropTypes.number,\n boundsSelectionEnabled: PropTypes.bool.isRequired,\n showTooltips: PropTypes.bool.isRequired,\n tooltipOptions: CustomPropTypes.TooltipOptions,\n verticalLines: CustomPropTypes.VerticalLines,\n draggablePoints: CustomPropTypes.DraggablePoints,\n onPointDrag: PropTypes.func,\n onDraggablePointsDoubleClick: PropTypes.func,\n onPointClick: PropTypes.func,\n clockStyle: PropTypes.oneOf(['12h', '24h']),\n timeZone: PropTypes.string\n};","\n import API from \"!../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../node_modules/css-loader/dist/cjs.js!../node_modules/sass-loader/dist/cjs.js!./grapher.scss\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../node_modules/css-loader/dist/cjs.js!../node_modules/sass-loader/dist/cjs.js!./grapher.scss\";\n export default content && content.locals ? content.locals : undefined;\n","import {startOfDayInTimezone} from './format';\n\nfunction placeTick(trueValue, {scale, min, max, inverted, totalSize, precision, formatter, dates, justTime, justDate, formatOptions={} }, opts={}) {\n let scaledValue = trueValue;\n\n if (scale === 'log') {\n scaledValue = 10**trueValue;\n }\n\n let percent = (trueValue - min)/(max - min);\n if (inverted) {\n percent = 1.0 - percent;\n }\n\n let pixelValue = percent * totalSize;\n if (isNaN(pixelValue)) {\n pixelValue = 0;\n }\n\n return {\n pixelValue,\n trueValue: scaledValue,\n label: formatter(scaledValue, { ...formatOptions, precision, log: scale === 'log', dates, justTime, justDate }),\n size: 'major',\n ...opts\n };\n}\n\nfunction placeTickByPixel(pixelValue, {scale, min, max, inverted, totalSize, precision, formatter, dates, justTime, justDate, formatOptions={} }, opts={}) {\n let percent = pixelValue/totalSize;\n if (inverted) {\n percent = 1.0 - percent;\n }\n\n let trueValue = percent * (max - min) + min;\n\n if (scale === 'log') {\n trueValue = Math.pow(10, trueValue);\n }\n\n return {\n pixelValue,\n trueValue,\n label: formatter(trueValue, { ...formatOptions, precision, log: scale === 'log', dates, justTime, justDate }),\n size: 'major',\n ...opts\n };\n}\n\nfunction roundToEvenNumber(value, tickSpacing) {\n return Math.round(value/tickSpacing)*tickSpacing;\n}\n\nfunction getEvenTickSpacing(span, desiredCount) {\n const subspan = span/desiredCount;\n\n const precision = -Math.log10(Math.abs(subspan)) + 1;\n const multiplier = (precision - Math.floor(precision)) > 0.5 ? 2 : 1;\n\n const roundTo = 10**Math.floor(precision) * multiplier;\n\n return Math.round(subspan * roundTo)/roundTo;\n}\n\nfunction roundToDivisor(value, divisor) {\n if (value <= 1) {\n return 1;\n }\n\n if (divisor === 1) {\n return Math.round(value);\n }\n\n if (value >= divisor) {\n return Math.round(value/divisor)*divisor;\n }\n\n let divisors;\n if (divisor === 24) {\n divisors = [1, 2, 6, 12, 24];\n } else if (divisor === 60) {\n divisors = [1, 2, 5, 10, 15, 30, 60];\n } else {\n throw new Error('Invalid divisor');\n }\n\n let bestDelta = Infinity;\n let bestDivisor = 1;\n for (let i = 0; i < divisors.length; i++) {\n const delta = Math.abs(divisors[i] - value);\n if (delta < bestDelta) {\n bestDivisor = divisors[i];\n bestDelta = delta;\n }\n }\n\n return bestDivisor;\n}\n\nfunction getEvenDateTickSpacing(span, desiredCount, unitOverride) {\n const subspan = span / desiredCount;\n\n if (subspan < 60*1000 && (!unitOverride || unitOverride === 'second')) {\n return {\n amount: roundToDivisor(subspan/1000, 60),\n unit: 's'\n };\n }\n\n if (subspan < 60*60*1000 && (!unitOverride || unitOverride === 'minute')) {\n return {\n amount: roundToDivisor(subspan/(60*1000), 60),\n unit: 'm'\n };\n }\n\n if (subspan < 24*60*60*1000 && (!unitOverride || unitOverride === 'hour')) {\n return {\n amount: roundToDivisor(subspan/(60*60*1000), 24),\n unit: 'h'\n };\n }\n\n if (unitOverride === 'day' || (subspan < 30*24*60*60*1000 && !unitOverride)) {\n return {\n amount: roundToDivisor(subspan/(24*60*60*1000), 1),\n unit: 'd'\n };\n }\n\n if (subspan > 30*24*60*60*1000 && (!unitOverride || unitOverride === 'month')) {\n return {\n amount: roundToDivisor(subspan/30*24*60*60*1000, 1),\n unit: 'month'\n };\n }\n\n if (unitOverride === 'year') {\n return {\n amount: roundToDivisor(subspan/365*24*60*60*1000, 1),\n unit: 'year'\n };\n }\n\n return {\n unit: 'm',\n amount: 60\n };\n}\n\nfunction placeNumbersGrid({ min, max, precision, expectedLabelSize, labelPadding, totalSize, scale='linear', formatter, inverted=false, formatOptions }) {\n const paddedLabelSize = expectedLabelSize + 2*labelPadding;\n\n const ticks = [];\n const placementParams = {scale, min, max, inverted, totalSize, precision, formatter, formatOptions, dates: false };\n\n const labelCount = Math.floor((totalSize - expectedLabelSize*2)/paddedLabelSize);\n const tickSpacing = getEvenTickSpacing(max - min, labelCount);\n if (tickSpacing > 0) {\n for (let value = roundToEvenNumber(min, tickSpacing); value < max; value += tickSpacing) {\n ticks.push(placeTick(value, placementParams));\n }\n }\n\n if (ticks.length) {\n if (inverted && ticks[ticks.length - 1].pixelValue > labelPadding) {\n ticks.push(placeTickByPixel(expectedLabelSize / 2, placementParams));\n }\n }\n\n return ticks.filter(({ pixelValue }) => pixelValue <= totalSize && pixelValue >= 0);\n}\n\nfunction placeDatesGrid({ min, max, precision, expectedLabelSize, labelPadding, totalSize, skipFirst=false, skipLast=false, scale='linear', formatter, inverted=false, formatOptions }) {\n const paddedLabelSize = expectedLabelSize + 2*labelPadding;\n\n const ticks = [];\n const placementParams = {scale, min, max, inverted, totalSize, precision, formatter, formatOptions, dates: true };\n\n const { amount, unit } = getEvenDateTickSpacing(max - min, totalSize/paddedLabelSize, formatOptions.unitOverride);\n\n const justDate = unit === 'month';\n\n if (!skipFirst) {\n ticks.push(placeTickByPixel(0, {...placementParams, justDate}, {position: 'first'}));\n }\n\n let currentDate = new Date(min);\n\n if (unit === 'h') {\n currentDate.setMinutes(0, 0, 0);\n } else if (unit === 'm') {\n currentDate.setSeconds(0, 0);\n } else if (unit === 's') {\n currentDate.setMilliseconds(0);\n } else if (unit === 'month') {\n currentDate = startOfDayInTimezone(currentDate, formatOptions.timeZone);\n currentDate.setDate(1);\n } else if (unit === 'd') {\n currentDate = startOfDayInTimezone(currentDate, formatOptions.timeZone);\n }\n\n let lastDateString = formatter(currentDate, {...formatOptions, ...placementParams, justDate: true });\n while (currentDate < max) {\n let delta = 24*60*60*1000;\n\n if (unit === 'h') {\n delta = (amount - currentDate.getHours() % amount)*60*60*1000;\n } else if (unit === 'm') {\n delta = (amount - currentDate.getMinutes() % amount)*60*1000;\n } else if (unit === 's') {\n delta = (amount - currentDate.getSeconds() % amount)*1000;\n } else if (unit === 'month') {\n delta = 0;\n if (currentDate.getMonth() === 11) {\n currentDate = new Date(currentDate.getFullYear() + 1, 0, 1);\n } else {\n currentDate = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 1);\n }\n } else if (unit === 'year') {\n currentDate = new Date(currentDate.getFullYear() + 1, 0, 0);\n }\n\n currentDate = new Date(currentDate.valueOf() + delta);\n\n const justTime = formatter(currentDate, {...formatOptions, ...placementParams, justDate: true }) === lastDateString;\n\n const tick = placeTick(currentDate, {...placementParams, justTime, justDate});\n\n if (ticks.length && (tick.pixelValue - ticks[ticks.length - 1].pixelValue) < (expectedLabelSize + (labelPadding || 0))) {\n continue;\n }\n\n if (tick.pixelValue + expectedLabelSize/2 >= totalSize) {\n continue;\n }\n\n ticks.push(tick);\n lastDateString = formatter(currentDate, {...formatOptions, ...placementParams, justDate: true });\n }\n\n const justTime = lastDateString === formatter(max, {...formatOptions, ...placementParams, justDate: true });\n\n if (!skipLast && ticks[ticks.length - 1].pixelValue + expectedLabelSize < totalSize) {\n ticks.push(placeTickByPixel(totalSize, {...placementParams, justTime, justDate}, {position: 'last'}));\n }\n\n return ticks.filter(({ pixelValue }) => pixelValue <= totalSize && pixelValue >= 0);\n}\n\nfunction placeTimeOnlyGrid({ min, max, precision, expectedLabelSize, labelPadding, totalSize, skipFirst=false, skipLast=false, scale='linear', formatter, inverted=false, formatOptions={} }) {\n const paddedLabelSize = expectedLabelSize + 2*labelPadding;\n const ticks = [];\n const placementParams = { scale, min, max, inverted, totalSize, precision, formatter, formatOptions, dates: true };\n\n const desiredCount = Math.floor(totalSize/paddedLabelSize);\n const span = max - min;\n \n let unit, amount;\n \n const hourSpan = span / (60 * 60 * 1000);\n const minuteSpan = span / (60 * 1000);\n \n if (hourSpan <= desiredCount * 8) {\n unit = 'h';\n amount = Math.max(1, Math.ceil(hourSpan / desiredCount));\n if (amount <= 6) {\n } else if (amount <= 12) {\n amount = 12;\n } else if (amount <= 24) {\n amount = 24;\n } else {\n amount = Math.ceil(amount / 24) * 24;\n }\n } else {\n unit = 'h';\n amount = 24;\n }\n \n if (!skipFirst) {\n ticks.push(placeTickByPixel(0, {...placementParams, justTime: true}, {position: 'first'}));\n }\n \n let currentDate = new Date(min);\n \n if (unit === 'h') {\n currentDate.setMinutes(0, 0, 0);\n if (amount === 24) {\n currentDate.setHours(0);\n } else if (amount === 12) {\n const currentHour = currentDate.getHours();\n const alignedHour = currentHour < 12 ? 0 : 12;\n currentDate.setHours(alignedHour);\n } else {\n const currentHour = currentDate.getHours();\n const alignedHour = Math.floor(currentHour / amount) * amount;\n currentDate.setHours(alignedHour);\n }\n } else if (unit === 'm') {\n currentDate.setSeconds(0, 0);\n const currentMinute = currentDate.getMinutes();\n const alignedMinute = Math.floor(currentMinute / amount) * amount;\n currentDate.setMinutes(alignedMinute);\n } else if (unit === 's') {\n currentDate.setMilliseconds(0);\n const currentSecond = currentDate.getSeconds();\n const alignedSecond = Math.floor(currentSecond / amount) * amount;\n currentDate.setSeconds(alignedSecond);\n }\n \n while (currentDate < min) {\n if (unit === 'h') {\n currentDate = new Date(currentDate.valueOf() + amount * 60 * 60 * 1000);\n } else if (unit === 'm') {\n currentDate = new Date(currentDate.valueOf() + amount * 60 * 1000);\n } else if (unit === 's') {\n currentDate = new Date(currentDate.valueOf() + amount * 1000);\n }\n }\n \n while (currentDate < max) {\n const tick = placeTick(currentDate, {...placementParams, justTime: true});\n \n const reservedSpaceForLast = expectedLabelSize + labelPadding;\n const maxPixelForMiddleTicks = totalSize - reservedSpaceForLast;\n \n if (ticks.length && (tick.pixelValue - ticks[ticks.length - 1].pixelValue) < (expectedLabelSize + labelPadding)) {\n } else if (tick.pixelValue + expectedLabelSize < maxPixelForMiddleTicks) {\n ticks.push(tick);\n } else {\n break;\n }\n \n if (unit === 'h') {\n currentDate = new Date(currentDate.valueOf() + amount * 60 * 60 * 1000);\n } else if (unit === 'm') {\n currentDate = new Date(currentDate.valueOf() + amount * 60 * 1000);\n } else if (unit === 's') {\n currentDate = new Date(currentDate.valueOf() + amount * 1000);\n } else {\n break;\n }\n }\n \n if (!skipLast) {\n const lastTick = placeTick(max, {...placementParams, justTime: true}, {position: 'last'});\n if (ticks.length === 0 || (lastTick.pixelValue - ticks[ticks.length - 1].pixelValue) >= (expectedLabelSize + labelPadding/2)) {\n ticks.push(lastTick);\n } else {\n ticks[ticks.length - 1] = lastTick;\n }\n }\n \n return ticks.filter(({ pixelValue }) => pixelValue <= totalSize && pixelValue >= 0);\n}\n\nfunction placeDateOnlyGrid({ min, max, precision, expectedLabelSize, labelPadding, totalSize, skipFirst=false, skipLast=false, scale='linear', formatter, inverted=false, formatOptions={} }) {\n const paddedLabelSize = expectedLabelSize + 2*labelPadding;\n const ticks = [];\n \n const minYear = new Date(min).getFullYear();\n const maxYear = new Date(max).getFullYear();\n const spanMultipleYears = minYear !== maxYear;\n\n const customDateFormatter = (date, options) => {\n const monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n const d = new Date(date);\n const month = monthNames[d.getMonth()];\n const day = d.getDate();\n const year = d.getFullYear();\n \n if (spanMultipleYears) {\n return `${month} ${day} ${year}`;\n } else {\n return `${month} ${day}`;\n }\n };\n \n const placementParams = { scale, min, max, inverted, totalSize, precision, formatter: customDateFormatter, formatOptions, dates: true };\n \n const span = max - min;\n const hourSpan = span / (60 * 60 * 1000);\n \n let { amount, unit } = getEvenDateTickSpacing(span, totalSize/paddedLabelSize, formatOptions.unitOverride);\n \n if ((unit === 'h' || unit === 'm' || unit === 's') && hourSpan >= 48) {\n unit = 'd';\n amount = Math.max(1, Math.ceil(hourSpan / 24 / Math.floor(totalSize/paddedLabelSize)));\n } else if ((unit === 'h' || unit === 'm' || unit === 's') && hourSpan < 48) {\n const startTick = placeTick(min, {...placementParams, justDate: true}, {position: 'first'});\n const endTick = placeTick(max, {...placementParams, justDate: true}, {position: 'last'});\n \n const ticks = [startTick];\n if ((endTick.pixelValue - startTick.pixelValue) >= (expectedLabelSize + labelPadding)) {\n ticks.push(endTick);\n }\n \n return ticks.filter(({ pixelValue }) => pixelValue <= totalSize && pixelValue >= 0);\n }\n \n if (!skipFirst) {\n ticks.push(placeTickByPixel(0, {...placementParams, justDate: true}, {position: 'first'}));\n }\n \n let currentDate = new Date(min);\n \n if (unit === 'month') {\n currentDate = startOfDayInTimezone(currentDate, formatOptions.timeZone);\n currentDate.setDate(1);\n } else if (unit === 'd') {\n currentDate = startOfDayInTimezone(currentDate, formatOptions.timeZone);\n currentDate.setHours(0, 0, 0, 0);\n }\n \n while (currentDate < max) {\n let delta = 24*60*60*1000;\n \n if (unit === 'month') {\n delta = 0;\n if (currentDate.getMonth() === 11) {\n currentDate = new Date(currentDate.getFullYear() + 1, 0, 1);\n } else {\n currentDate = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 1);\n }\n } else if (unit === 'year') {\n currentDate = new Date(currentDate.getFullYear() + 1, 0, 1);\n delta = 0;\n } else if (unit === 'd') {\n delta = amount * 24 * 60 * 60 * 1000;\n }\n \n if (delta > 0) {\n currentDate = new Date(currentDate.valueOf() + delta);\n }\n \n const tick = placeTick(currentDate, {...placementParams, justDate: true});\n \n const reservedSpaceForLast = expectedLabelSize + labelPadding;\n const maxPixelForMiddleTicks = totalSize - reservedSpaceForLast;\n \n if (ticks.length && (tick.pixelValue - ticks[ticks.length - 1].pixelValue) < (expectedLabelSize + (labelPadding || 0))) {\n continue;\n }\n \n if (tick.pixelValue + expectedLabelSize < maxPixelForMiddleTicks) {\n ticks.push(tick);\n } else {\n break;\n }\n }\n \n if (!skipLast) {\n const lastTick = placeTick(max, {...placementParams, justDate: true}, {position: 'last'});\n if (ticks.length === 0 || (lastTick.pixelValue - ticks[ticks.length - 1].pixelValue) >= (expectedLabelSize + labelPadding/2)) {\n ticks.push(lastTick);\n } else {\n ticks[ticks.length - 1] = lastTick;\n }\n }\n\n if (ticks.length === 0 && hourSpan >= 48) {\n ticks.push(placeTickByPixel(0, {...placementParams, justDate: true}, {position: 'first'}));\n }\n \n return ticks.filter(({ pixelValue }) => pixelValue <= totalSize && pixelValue >= 0);\n}\n\nexport { placeTimeOnlyGrid, placeDateOnlyGrid };\n\nexport default function placeGrid(opts) {\n if (opts.dates) {\n return placeDatesGrid(opts);\n } else {\n return placeNumbersGrid(opts);\n }\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport {calculatePrecision, calculateTimePrecision, formatX} from '../helpers/format';\nimport placeGrid, { placeTimeOnlyGrid, placeDateOnlyGrid } from '../helpers/place_grid';\nimport {useEnumMap, useHasXEnum, usePrimarySize, useSelection} from '../state/hooks';\nimport StateController from '../state/state_controller';\n\nexport default React.memo(XAxis);\n\nfunction XAxis({ showAxes, showGrid, stateController, bigLabels, xTickUnit, clockStyle, timeZone, integersOnly, formatXAxisLabel }) {\n if (!showAxes && !showGrid) {\n return null;\n }\n\n const { elementWidth, elementHeight } = usePrimarySize(stateController);\n const {minX, maxX, dates} = useSelection(stateController);\n const hasXEnum = useHasXEnum(stateController);\n const enumMap = useEnumMap(stateController);\n\n let precision;\n if (dates) {\n precision = calculateTimePrecision(minX, maxX);\n } else {\n precision = calculatePrecision(maxX - minX);\n }\n\n let inverseEnumMap = null;\n if (hasXEnum) {\n inverseEnumMap = {};\n for (const [key, value] of Object.entries(enumMap)) {\n inverseEnumMap[value] = key;\n }\n }\n\n const formatOptions = {\n unitOverride: xTickUnit,\n clockStyle,\n timeZone,\n integersOnly,\n inverseEnumMap,\n formatter: formatXAxisLabel\n };\n\n const minLabel = formatX(minX, {...formatOptions, dates, precision }).toString();\n const maxLabel = formatX(maxX, {...formatOptions, dates, precision }).toString();\n\n let expectedLabelWidth = Math.max(minLabel.length, maxLabel.length);\n if (bigLabels) {\n expectedLabelWidth *= 2;\n }\n\n const labelPadding = 30;\n\n let timeTicks = null;\n let dateTicks = null;\n let regularTicks = null;\n \n if (dates) {\n timeTicks = placeTimeOnlyGrid({\n min: minX,\n max: maxX,\n totalSize: elementWidth,\n precision,\n expectedLabelSize: expectedLabelWidth,\n labelPadding: labelPadding * 0.8,\n formatter: formatXAxisLabel || formatX,\n formatOptions\n });\n \n dateTicks = placeDateOnlyGrid({\n min: minX,\n max: maxX,\n totalSize: elementWidth,\n precision,\n expectedLabelSize: expectedLabelWidth * 2,\n labelPadding: labelPadding * 1.5,\n formatter: formatXAxisLabel || formatX,\n formatOptions\n });\n } else {\n regularTicks = placeGrid({\n min: minX,\n max: maxX,\n totalSize: elementWidth,\n precision,\n dates,\n formatter: formatXAxisLabel || formatX,\n expectedLabelSize: expectedLabelWidth,\n labelPadding,\n formatOptions\n });\n }\n\n const xAxisHeight = dates ? 30 : 20;\n\n return (\n <svg className={`axis x-axis${dates ? ' x-axis-dual' : ''}`} style={showAxes ? undefined : {marginBottom: -20}}>\n {\n showAxes &&\n <path d={`M-1,0 H${elementWidth}`} className=\"axis-line\" />\n }\n\n {/* Render time ticks in first row */}\n {\n dates && timeTicks && timeTicks.map(({ pixelValue, label, size, position, skipGrid }, i) => {\n\n const singleTick = timeTicks.length === 1;\n \n if (isNaN(pixelValue)) {\n return null;\n }\n\n const classes = ['axis-item', `axis-item-${size}`, `axis-item-${position}`];\n if (bigLabels) {\n classes.push('axis-item-big-labels');\n }\n \n return (\n <g key={`time-${i}`} className={classes.join(' ')}>\n {\n showAxes &&\n <path d={`M${pixelValue},1 v12`} className=\"axis-tick\" />\n }\n\n {\n showGrid && !skipGrid &&\n <path d={`M${pixelValue},0 v-${elementHeight}`} />\n }\n\n {\n showAxes &&\n <text \n x={(position === 'last' && !singleTick) ? pixelValue - 3 : pixelValue + 3} \n y={12} \n textAnchor={(position === 'last' && !singleTick) ? 'end' : 'start'}\n className='x-axis-text x-axis-time-text'\n >\n {label}\n </text>\n }\n </g>\n );\n })\n }\n \n {/* Render date ticks in second row */}\n {\n dates && dateTicks && dateTicks.map(({ pixelValue, label, size, position, trueValue }, i) => {\n \n if (isNaN(pixelValue)) {\n return null;\n }\n\n const classes = ['axis-item', `axis-item-${size}`, `axis-item-${position}`];\n if (bigLabels) {\n classes.push('axis-item-big-labels');\n }\n\n let timezoneLabel = undefined;\n if (timeZone) {\n if (i === 0) {\n timezoneLabel = timeZone.toLowerCase() === 'utc' ? 'UTC' : timeZone;\n }\n }\n\n return (\n <g key={`date-${i}`} className={classes.join(' ')}>\n {\n showAxes &&\n <text \n x={position === 'last' ? pixelValue - 3 : pixelValue + 3} \n y={25} \n textAnchor={position === 'last' ? 'end' : 'start'}\n className='x-axis-text x-axis-date-text'\n >\n <tspan className='x-axis-date-label'>\n {label}\n </tspan>\n {timezoneLabel && (\n <tspan className='x-axis-timezone-label'>\n {' '}({timezoneLabel})\n </tspan>\n )}\n </text>\n }\n </g>\n );\n })\n }\n \n {/* Render regular ticks for non-date data */}\n {\n !dates && regularTicks && regularTicks.map(({ pixelValue, label, size, position, skipGrid }, i) => {\n if (isNaN(pixelValue)) {\n return null;\n }\n\n const classes = ['axis-item', `axis-item-${size}`, `axis-item-${position}`];\n if (bigLabels) {\n classes.push('axis-item-big-labels');\n }\n\n return (\n <g key={i} className={classes.join(' ')}>\n {\n showAxes &&\n <path d={`M${pixelValue},1 v12`} className=\"axis-tick\" />\n }\n\n {\n showGrid && !skipGrid &&\n <path d={`M${pixelValue},0 v-${elementHeight}`} />\n }\n\n {\n showAxes &&\n <text \n x={position === 'last' ? pixelValue - 3 : pixelValue + 3} \n y={xAxisHeight - 5} \n textAnchor={position === 'last' ? 'end' : 'start'}\n className='x-axis-text'\n >\n {label}\n </text>\n }\n </g>\n );\n })\n }\n </svg>\n );\n}\n\nXAxis.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n showAxes: PropTypes.bool.isRequired,\n showGrid: PropTypes.bool.isRequired,\n bigLabels: PropTypes.bool,\n xTickUnit: PropTypes.oneOf(['year']),\n clockStyle: PropTypes.oneOf(['12h', '24h']),\n timeZone: PropTypes.string,\n integersOnly: PropTypes.bool,\n formatXAxisLabel: PropTypes.func\n};\n","import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport {calculatePrecision, formatY} from '../helpers/format';\nimport {Y_AXIS_WIDTH, BIG_Y_AXIS_LABEL_OFFSET} from '../helpers/axis_sizes';\nimport scaleBounds from '../renderer/scale_bounds';\nimport getColor from '../helpers/colors';\nimport placeGrid from '../helpers/place_grid';\nimport {useAxes, useAxisBounds, useHighlightedSeries, usePrimarySize} from '../state/hooks';\nimport StateController from '../state/state_controller';\nimport CustomPropTypes from '../helpers/custom_prop_types';\n\nexport default React.memo(YAxis);\n\nfunction YAxis({ stateController, showAxes, showGrid, showSeriesKey, axis, sideIndex, bodyHeight, theme, grapherID, dragPositionYOffset=0, bigLabels, showAxisColors }) {\n if (!showAxes && !showGrid) {\n return null;\n }\n\n const { side, scale, axisIndex, label } = useAxes(stateController)[axis.axisIndex];\n\n const { elementWidth, elementHeight } = usePrimarySize(stateController);\n let { minY, maxY } = useAxisBounds(stateController)[axisIndex];\n\n const scaledBounds = scaleBounds({ minY, maxY, scale});\n minY = scaledBounds.minY;\n maxY = scaledBounds.maxY;\n\n const ticks = placeGrid({\n min: minY,\n max: maxY,\n totalSize: elementHeight,\n scale,\n precision: calculatePrecision(maxY - minY),\n formatter: formatY,\n inverted: true,\n expectedLabelSize: bigLabels ? 20 : 10,\n labelPadding: 30\n });\n\n const colorBoxSize = 10;\n const colorBoxPadding = 4;\n\n let sidePadding = 5;\n\n if (scale === 'log') {\n sidePadding = 2;\n }\n\n const highlightedSeries = useHighlightedSeries(stateController);\n\n const [draggedSeries, setDraggedSeries] = useState(null);\n const [dragDelta, setDragDelta] = useState({ dx: 0, dy: 0 });\n\n const startDrag = (event, singleSeries) => {\n let startX = event.clientX;\n let startY = event.clientY;\n\n if (side === 'left') {\n startX += Y_AXIS_WIDTH;\n }\n\n if (side === 'right') {\n startX -= Y_AXIS_WIDTH;\n }\n\n setDragDelta({\n dx: 0,\n dy: 0\n });\n\n const onMouseMove = (moveEvent) => {\n setDragDelta({\n dx: moveEvent.clientX - startX,\n dy: moveEvent.clientY - startY\n });\n };\n\n const onMouseUp = (mouseUpEvent) => {\n window.removeEventListener('mousemove', onMouseMove);\n window.removeEventListener('mouseup', onMouseUp);\n\n let target = mouseUpEvent.target;\n while (target && !(target.dataset || {}).axisIndex) {\n target = target.parentNode;\n }\n\n setDraggedSeries(null);\n stateController.finalizeDrag(singleSeries, target && (target.dataset || {}).axisIndex, target && (target.dataset || {}).grapherId);\n };\n\n window.addEventListener('mousemove', onMouseMove);\n window.addEventListener('mouseup', onMouseUp);\n\n setDraggedSeries(singleSeries);\n stateController.markDragStart();\n };\n\n const highlightedOpacity = theme === 'day' ? 1.0 : 0.5;\n const unhighlightedOpacity = theme === 'day' ? 0.8 : 0.3;\n\n return (\n <svg className={`axis y-axis y-axis-${side}`}\n data-axis-index={axisIndex}\n data-grapher-id={grapherID}\n style={{\n width: Y_AXIS_WIDTH,\n marginLeft: showAxes ? undefined : -Y_AXIS_WIDTH,\n height: typeof bodyHeight === 'number' ? bodyHeight : undefined\n }}\n >\n {\n showAxes &&\n showAxisColors &&\n axis.series.map((singleSeries, i) => {\n const height = elementHeight/axis.series.length;\n\n return (\n <rect\n x={side === 'left' ? 0 : 2}\n y={i*height}\n width={Y_AXIS_WIDTH - 2}\n height={height}\n key={singleSeries.index}\n fill={getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex)}\n opacity={singleSeries.index === highlightedSeries ? highlightedOpacity : unhighlightedOpacity}\n data-element-height={elementHeight}\n data-series-length={axis.series.length}\n />\n );\n })\n }\n\n {\n showAxes &&\n <path d={`M${side === 'left' ? Y_AXIS_WIDTH-1 : 1},3 V${elementHeight}`} className=\"axis-line\" />\n }\n\n {\n ticks.map(({ pixelValue, label, size, skipGrid }, i) => {\n const edge = side === 'left' ? (sideIndex + 1) * Y_AXIS_WIDTH : -sideIndex*Y_AXIS_WIDTH;\n const length = (side === 'left' ? 1 : - 1) * (elementWidth+1);\n\n const classes = ['axis-item', `axis-item-${size}`];\n if (bigLabels) {\n classes.push('axis-item-big-labels');\n }\n\n return (\n <g key={i} className={classes.join(' ')}>\n {\n showGrid &&\n !skipGrid &&\n <path d={`M${edge},${pixelValue} h${length}`} />\n }\n\n {\n showGrid &&\n !skipGrid &&\n sideIndex > 0 &&\n <path\n d={`M${side === 'left' ? Y_AXIS_WIDTH : 0},${pixelValue} h${(side === 'left' ? 1 : -1) * sideIndex * Y_AXIS_WIDTH}`}\n strokeDasharray={'2,2'}\n />\n }\n\n {\n showAxes &&\n <text x={side === 'left' ? Y_AXIS_WIDTH-sidePadding : sidePadding} y={pixelValue}>\n {label}\n </text>\n }\n </g>\n );\n })\n }\n\n {\n showSeriesKey && showAxes &&\n axis.series.map((singleSeries, i) => {\n\n let x = (Y_AXIS_WIDTH - colorBoxSize - colorBoxPadding) + (i % 2 - 1)*(colorBoxSize + colorBoxPadding);\n let y = -(colorBoxPadding + colorBoxSize) * Math.ceil(axis.series.length / 2) + (colorBoxSize + colorBoxPadding) * Math.floor(i / 2);\n\n if (singleSeries === draggedSeries) {\n x += dragDelta.dx;\n y += dragDelta.dy - dragPositionYOffset;\n }\n\n return (\n <rect\n className=\"series-color-box\"\n onMouseDown={(event) => startDrag(event, singleSeries)}\n x={x}\n y={y}\n width={colorBoxSize}\n height={colorBoxSize}\n key={singleSeries.index}\n fill={getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex)}\n onMouseOver={() => stateController.setHighlightedSeries(singleSeries.index)}\n onMouseOut={() => stateController.setHighlightedSeries(null)}\n />\n );\n })\n }\n\n {\n showAxes && !!label &&\n <text\n className={`y-axis-label${bigLabels ? ' y-axis-big-label' : ''}`}\n x={side === 'left' ? 10 : Y_AXIS_WIDTH - 10}\n y={elementHeight/2 + (side === 'left' ? -1 : 1)*(axisIndex + 1)*(bigLabels ? BIG_Y_AXIS_LABEL_OFFSET : 0)}\n transform={`rotate(${side === 'left' ? -90 : 90}, ${side === 'left' ? 10 : Y_AXIS_WIDTH - 10}, ${elementHeight/2})`}\n >\n {label}\n </text>\n }\n </svg>\n );\n}\n\nYAxis.propTypes = {\n stateController: PropTypes.instanceOf(StateController),\n showAxes: PropTypes.bool.isRequired,\n showGrid: PropTypes.bool.isRequired,\n showAxisColors: PropTypes.bool.isRequired,\n showSeriesKey: PropTypes.bool.isRequired,\n axis: CustomPropTypes.Axis.isRequired,\n sideIndex: PropTypes.number.isRequired,\n bodyHeight: PropTypes.number,\n theme: PropTypes.string,\n grapherID: PropTypes.string,\n dragPositionYOffset: PropTypes.number,\n bigLabels: PropTypes.bool\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nexport default React.memo(RangeSelectionButtonBase);\n\nfunction RangeSelectionButtonBase({ selected, disabled, className, onClick, children, description }) {\n const classes = [\n 'range-button'\n ];\n\n if (selected) {\n classes.push('range-button-selected');\n }\n\n if (disabled) {\n classes.push('range-button-disabled');\n }\n\n if (className) {\n classes.push(className);\n }\n\n if (description) {\n classes.push('option-tooltip');\n }\n\n return (\n <div\n className={classes.join(' ')}\n onClick={onClick && ((event) => disabled || onClick(event))}\n >\n {children}\n\n {\n description &&\n <div className=\"option-tooltip-text\">\n {description}\n </div>\n }\n </div>\n );\n}\n\nRangeSelectionButtonBase.propTypes = {\n selected: PropTypes.bool.isRequired,\n onClick: PropTypes.func,\n children: PropTypes.node.isRequired,\n disabled: PropTypes.bool,\n className: PropTypes.string,\n description: PropTypes.string\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport RangeSelectionButtonBase from './range_selection_button_base.jsx';\nimport StateController from '../state/state_controller';\n\nexport default React.memo(RangeSelectionButton);\n\nfunction RangeSelectionButton({ stateController, currentBoundCalculator, boundCalculator, children, disabled }) {\n return (\n <RangeSelectionButtonBase\n selected={currentBoundCalculator === boundCalculator}\n onClick={() => stateController.boundCalculator = boundCalculator}\n disabled={disabled}\n >\n {children}\n </RangeSelectionButtonBase>\n );\n}\n\nRangeSelectionButton.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n boundCalculator: PropTypes.func.isRequired,\n currentBoundCalculator: PropTypes.func.isRequired,\n children: PropTypes.node.isRequired,\n disabled: PropTypes.bool\n};\n","import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport RangeSelectionButtonBase from './range_selection_button_base.jsx';\nimport StateController from '../state/state_controller';\nimport {usePercentile, usePercentileAsymmetry} from '../state/hooks';\n\nexport default React.memo(PercentileButton);\n\nfunction PercentileButton({ stateController }) {\n const percentile = usePercentile(stateController);\n const percentileAsymmetry = usePercentileAsymmetry(stateController);\n const [showing, setShowing] = useState(false);\n\n return ([\n showing ? <RangeSelectionButtonBase\n key=\"asymmetry button\"\n className=\"percentile-button\"\n selected={true}\n description=\"Percentile asymmetry\"\n >\n <input\n onClick={(e) => e.stopPropagation()}\n value={percentileAsymmetry}\n onChange={(e) => stateController.percentileAsymmetry = e.target.value}\n onKeyUp={(e) => e.keyCode === 13 && setShowing(false)}\n type=\"number\"\n min={-50}\n max={50}\n />\n\n <div className=\"icon-container icon-container-square\">\n <svg focusable=\"false\" viewBox=\"0 0 512 512\">\n <path fill=\"currentColor\" d=\"M240 96h64a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16h-64a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16zm0 128h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16H240a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16zm256 192H240a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h256a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm-256-64h192a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16H240a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16zM16 160h48v304a16 16 0 0 0 16 16h32a16 16 0 0 0 16-16V160h48c14.21 0 21.39-17.24 11.31-27.31l-80-96a16 16 0 0 0-22.62 0l-80 96C-5.35 142.74 1.78 160 16 160z\" />\n </svg>\n </div>\n </RangeSelectionButtonBase>: null,\n\n <RangeSelectionButtonBase\n key=\"main-button\"\n className=\"percentile-button\"\n selected={showing || parseFloat(percentile) !== 100}\n onClick={() => setShowing(!showing)}\n description=\"Edit percentile\"\n >\n {\n showing &&\n <div>\n <input\n onClick={(e) => e.stopPropagation()}\n autoFocus={true}\n value={percentile}\n onChange={(e) => stateController.percentile = e.target.value}\n onKeyUp={(e) => e.keyCode === 13 && setShowing(false)}\n type=\"number\"\n min={0}\n max={100}\n />\n </div>\n }\n\n <div className=\"icon-container icon-container-narrow\">\n <svg focusable=\"false\" viewBox=\"0 0 448 512\">\n <path fill=\"currentColor\" d=\"M112 224c61.9 0 112-50.1 112-112S173.9 0 112 0 0 50.1 0 112s50.1 112 112 112zm0-160c26.5 0 48 21.5 48 48s-21.5 48-48 48-48-21.5-48-48 21.5-48 48-48zm224 224c-61.9 0-112 50.1-112 112s50.1 112 112 112 112-50.1 112-112-50.1-112-112-112zm0 160c-26.5 0-48-21.5-48-48s21.5-48 48-48 48 21.5 48 48-21.5 48-48 48zM392.3.2l31.6-.1c19.4-.1 30.9 21.8 19.7 37.8L77.4 501.6a23.95 23.95 0 0 1-19.6 10.2l-33.4.1c-19.5 0-30.9-21.9-19.7-37.8l368-463.7C377.2 4 384.5.2 392.3.2z\" />\n </svg>\n </div>\n </RangeSelectionButtonBase>\n ]);\n}\n\nPercentileButton.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired\n};\n","import React from 'react';\nimport PercentileButton from './percentile_button.jsx';\nimport RangeSelectionButtonBase from './range_selection_button_base.jsx';\nimport {\n useAutoscaleY,\n useMaxPrecision,\n useShowIndividualPoints, useShowingAnnotations,\n useShowingSidebar, useTheme\n} from '../state/hooks';\nimport PropTypes from 'prop-types';\nimport StateController from '../state/state_controller';\n\nexport default React.memo(Options);\n\nfunction Options({stateController, sidebarEnabled}) {\n\n const showIndividualPoints = useShowIndividualPoints(stateController);\n const autoscaleY = useAutoscaleY(stateController);\n const maxPrecision = useMaxPrecision(stateController);\n const showingSidebar = useShowingSidebar(stateController);\n const showingAnnotations = useShowingAnnotations(stateController);\n const theme = useTheme(stateController);\n\n return (\n <div className=\"options-bar\">\n {\n sidebarEnabled &&\n <RangeSelectionButtonBase\n selected={showingSidebar}\n onClick={() => stateController.toggleShowingSidebar()}\n description=\"Show sidebar\"\n >\n <div className=\"icon-container icon-container-square\">\n <svg focusable=\"false\" viewBox=\"0 0 512 512\">\n <path fill=\"currentColor\"\n d=\"M464 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V80c0-26.51-21.49-48-48-48zM224 416H64V160h160v256zm224 0H288V160h160v256z\"/>\n </svg>\n </div>\n </RangeSelectionButtonBase>\n }\n\n <RangeSelectionButtonBase\n selected={theme === 'export'}\n onClick={() => stateController.toggleExportMode()}\n description=\"Export mode\"\n >\n <div className=\"icon-container icon-container-square\">\n <svg focusable=\"false\" viewBox=\"0 0 512 512\">\n <path fill=\"currentColor\"\n d=\"M167.02 309.34c-40.12 2.58-76.53 17.86-97.19 72.3-2.35 6.21-8 9.98-14.59 9.98-11.11 0-45.46-27.67-55.25-34.35C0 439.62 37.93 512 128 512c75.86 0 128-43.77 128-120.19 0-3.11-.65-6.08-.97-9.13l-88.01-73.34zM457.89 0c-15.16 0-29.37 6.71-40.21 16.45C213.27 199.05 192 203.34 192 257.09c0 13.7 3.25 26.76 8.73 38.7l63.82 53.18c7.21 1.8 14.64 3.03 22.39 3.03 62.11 0 98.11-45.47 211.16-256.46 7.38-14.35 13.9-29.85 13.9-45.99C512 20.64 486 0 457.89 0z\" />\n </svg>\n </div>\n </RangeSelectionButtonBase>\n\n <RangeSelectionButtonBase\n selected={showingAnnotations}\n onClick={() => stateController.toggleShowingAnnotations()}\n description=\"Show annotations\"\n >\n <div className=\"icon-container icon-container-448\">\n <svg focusable=\"false\" viewBox=\"0 0 448 512\">\n <path fill=\"currentColor\" d=\"M432 416h-23.41L277.88 53.69A32 32 0 0 0 247.58 32h-47.16a32 32 0 0 0-30.3 21.69L39.41 416H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16h-19.58l23.3-64h152.56l23.3 64H304a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM176.85 272L224 142.51 271.15 272z\" />\n </svg>\n </div>\n </RangeSelectionButtonBase>\n\n <PercentileButton stateController={stateController} />\n\n <RangeSelectionButtonBase\n selected={maxPrecision}\n onClick={() => stateController.toggleMaxPrecision()}\n description=\"Max precision\"\n >\n <div className=\"icon-container icon-container-square\">\n <svg focusable=\"false\" viewBox=\"0 0 512 512\">\n <path fill=\"currentColor\" d=\"M478.21 334.093L336 256l142.21-78.093c11.795-6.477 15.961-21.384 9.232-33.037l-19.48-33.741c-6.728-11.653-21.72-15.499-33.227-8.523L296 186.718l3.475-162.204C299.763 11.061 288.937 0 275.48 0h-38.96c-13.456 0-24.283 11.061-23.994 24.514L216 186.718 77.265 102.607c-11.506-6.976-26.499-3.13-33.227 8.523l-19.48 33.741c-6.728 11.653-2.562 26.56 9.233 33.037L176 256 33.79 334.093c-11.795 6.477-15.961 21.384-9.232 33.037l19.48 33.741c6.728 11.653 21.721 15.499 33.227 8.523L216 325.282l-3.475 162.204C212.237 500.939 223.064 512 236.52 512h38.961c13.456 0 24.283-11.061 23.995-24.514L296 325.282l138.735 84.111c11.506 6.976 26.499 3.13 33.227-8.523l19.48-33.741c6.728-11.653 2.563-26.559-9.232-33.036z\" />\n </svg>\n </div>\n </RangeSelectionButtonBase>\n\n <RangeSelectionButtonBase\n selected={autoscaleY}\n onClick={() => stateController.toggleYAutoscaling()}\n description=\"Autoscale y axis\"\n >\n <div className=\"icon-container\">\n <svg focusable=\"false\" viewBox=\"0 0 256 512\">\n <path fill=\"currentColor\" d=\"M168 416c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88v-64h-88c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88v-64h-88c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88v-64h-88c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88V32c0-17.67-14.33-32-32-32H32C14.33 0 0 14.33 0 32v448c0 17.67 14.33 32 32 32h192c17.67 0 32-14.33 32-32v-64h-88z\"/>\n </svg>\n </div>\n </RangeSelectionButtonBase>\n\n <RangeSelectionButtonBase\n selected={showIndividualPoints}\n onClick={() => stateController.toggleIndividualPoints()}\n description=\"Show individual points\"\n >\n <div className=\"icon-container icon-container-narrow\">\n <svg focusable=\"false\" viewBox=\"0 0 192 512\">\n <path fill=\"currentColor\" d=\"M96 184c39.8 0 72 32.2 72 72s-32.2 72-72 72-72-32.2-72-72 32.2-72 72-72zM24 80c0 39.8 32.2 72 72 72s72-32.2 72-72S135.8 8 96 8 24 40.2 24 80zm0 352c0 39.8 32.2 72 72 72s72-32.2 72-72-32.2-72-72-72-72 32.2-72 72z\" />\n </svg>\n </div>\n </RangeSelectionButtonBase>\n </div>\n );\n}\n\nOptions.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n sidebarEnabled: PropTypes.bool\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport RangeSelectionButton from './range_selection_button.jsx';\nimport RangeSelectionButtonBase from './range_selection_button_base.jsx';\nimport {Y_AXIS_WIDTH} from '../helpers/axis_sizes';\nimport CustomPropTypes from '../helpers/custom_prop_types';\nimport StateController from '../state/state_controller';\nimport {\n useBoundCalculator, useBoundHistory,\n useGlobalBounds,\n useLeftAxisCount,\n useRightAxisCount,\n useShowingOptions\n} from '../state/hooks';\nimport BOUND_CALCULATORS from '../state/bound_calculators';\nimport Options from './options.jsx';\n\nexport default React.memo(RangeSelection);\n\nfunction RangeSelection({stateController, customBoundsSelectors, customBoundsSelectorsOnly, sidebarEnabled}) {\n const rightAxisCount = useRightAxisCount(stateController);\n const leftAxisCount = useLeftAxisCount(stateController);\n const showingOptions = useShowingOptions(stateController);\n\n let marginRight = Y_AXIS_WIDTH*rightAxisCount;\n if (rightAxisCount > 0) {\n marginRight += 5;\n }\n\n let marginLeft = Y_AXIS_WIDTH*leftAxisCount;\n if (leftAxisCount > 0) {\n marginLeft += 5;\n }\n\n const { dates } = useGlobalBounds(stateController);\n\n const currentBoundCalculator = useBoundCalculator(stateController);\n const { hasPreviousBounds, hasNextBounds } = useBoundHistory(stateController);\n\n const customBoundSelectorNames = new Set(customBoundsSelectors.map(({ label }) => label));\n\n return (\n <div className={`range-selection${dates ? '' : ' range-not-dates'}`} style={{ marginRight, marginLeft }}>\n <div className=\"range-buttons\">\n {\n showingOptions &&\n <Options\n stateController={stateController}\n sidebarEnabled={sidebarEnabled}\n />\n }\n\n <RangeSelectionButtonBase\n className=\"showing-options-button\"\n selected={showingOptions}\n onClick={() => stateController.toggleShowingOptions()}\n description=\"Show additional options\"\n >\n <div className=\"icon-container icon-container-square\">\n <svg focusable=\"false\" viewBox=\"0 0 512 512\">\n <path fill=\"currentColor\" d=\"M487.4 315.7l-42.6-24.6c4.3-23.2 4.3-47 0-70.2l42.6-24.6c4.9-2.8 7.1-8.6 5.5-14-11.1-35.6-30-67.8-54.7-94.6-3.8-4.1-10-5.1-14.8-2.3L380.8 110c-17.9-15.4-38.5-27.3-60.8-35.1V25.8c0-5.6-3.9-10.5-9.4-11.7-36.7-8.2-74.3-7.8-109.2 0-5.5 1.2-9.4 6.1-9.4 11.7V75c-22.2 7.9-42.8 19.8-60.8 35.1L88.7 85.5c-4.9-2.8-11-1.9-14.8 2.3-24.7 26.7-43.6 58.9-54.7 94.6-1.7 5.4.6 11.2 5.5 14L67.3 221c-4.3 23.2-4.3 47 0 70.2l-42.6 24.6c-4.9 2.8-7.1 8.6-5.5 14 11.1 35.6 30 67.8 54.7 94.6 3.8 4.1 10 5.1 14.8 2.3l42.6-24.6c17.9 15.4 38.5 27.3 60.8 35.1v49.2c0 5.6 3.9 10.5 9.4 11.7 36.7 8.2 74.3 7.8 109.2 0 5.5-1.2 9.4-6.1 9.4-11.7v-49.2c22.2-7.9 42.8-19.8 60.8-35.1l42.6 24.6c4.9 2.8 11 1.9 14.8-2.3 24.7-26.7 43.6-58.9 54.7-94.6 1.5-5.5-.7-11.3-5.6-14.1zM256 336c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80z\" />\n </svg>\n </div>\n </RangeSelectionButtonBase>\n \n <RangeSelectionButtonBase\n className=\"range-selection-history\"\n selected={false}\n onClick={() => stateController.previousBounds()}\n disabled={!hasPreviousBounds}\n >\n <div className=\"icon-container\">\n <svg focusable=\"false\" viewBox=\"0 0 256 512\">\n <path fill=\"currentColor\" d=\"M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z\" />\n </svg>\n </div>\n </RangeSelectionButtonBase>\n \n <RangeSelectionButtonBase\n className=\"range-selection-history\"\n selected={false}\n onClick={() => stateController.nextBounds()}\n disabled={!hasNextBounds}\n >\n <div className=\"icon-container\">\n <svg focusable=\"false\" viewBox=\"0 0 256 512\">\n <path fill=\"currentColor\" d=\"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z\"/>\n </svg>\n </div>\n </RangeSelectionButtonBase>\n\n {\n customBoundsSelectors.map(({label, calculator, datesOnly}, i) => {\n return (\n <RangeSelectionButton\n key={i}\n stateController={stateController}\n currentBoundCalculator={currentBoundCalculator}\n boundCalculator={calculator}\n disabled={datesOnly && !dates}\n >\n {label}\n </RangeSelectionButton>\n );\n })\n }\n\n {\n !customBoundSelectorNames.has('1m') && !customBoundsSelectorsOnly &&\n <RangeSelectionButton\n stateController={stateController}\n currentBoundCalculator={currentBoundCalculator}\n boundCalculator={BOUND_CALCULATORS.lastMinute}\n disabled={!dates}\n >\n 1m\n </RangeSelectionButton>\n }\n\n {\n !customBoundSelectorNames.has('10m') && !customBoundsSelectorsOnly &&\n <RangeSelectionButton\n stateController={stateController}\n currentBoundCalculator={currentBoundCalculator}\n boundCalculator={BOUND_CALCULATORS.last10Minutes}\n disabled={!dates}\n >\n 10m\n </RangeSelectionButton>\n }\n\n {\n !customBoundSelectorNames.has('1h') && !customBoundsSelectorsOnly &&\n <RangeSelectionButton\n stateController={stateController}\n currentBoundCalculator={currentBoundCalculator}\n boundCalculator={BOUND_CALCULATORS.lastHour}\n disabled={!dates}\n >\n 1h\n </RangeSelectionButton>\n }\n\n {\n !customBoundSelectorNames.has('1d') && !customBoundsSelectorsOnly &&\n <RangeSelectionButton\n stateController={stateController}\n currentBoundCalculator={currentBoundCalculator}\n boundCalculator={BOUND_CALCULATORS.lastDay}\n disabled={!dates}\n >\n 1d\n </RangeSelectionButton>\n }\n\n <RangeSelectionButton\n stateController={stateController}\n currentBoundCalculator={currentBoundCalculator}\n boundCalculator={BOUND_CALCULATORS.all}\n disabled={false}\n >\n All\n </RangeSelectionButton>\n </div>\n </div>\n );\n\n}\n\nRangeSelection.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n customBoundsSelectors: CustomPropTypes.CustomBoundsSelectors.isRequired,\n customBoundsSelectorsOnly: PropTypes.bool,\n sidebarEnabled: PropTypes.bool\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport GraphBodyRenderer from '../renderer/graph_body_renderer';\nimport StateController from '../state/state_controller';\nimport placeGrid from '../helpers/place_grid';\nimport {formatX} from '../helpers/format';\nimport VerticalLines from './vertical_lines.jsx';\nimport CustomPropTypes from '../helpers/custom_prop_types';\n\nexport default class RangeGraph extends React.PureComponent {\n\n constructor(props) {\n super(props);\n\n this.state = {\n elementWidth: 0,\n elementHeight: 0,\n selectionBounds: {\n minX: 0,\n maxX: 0\n },\n globalBounds: {\n minX: 0,\n maxX: 0\n }\n };\n\n this.onMouseMove = this.onMouseMove.bind(this);\n this.stopDragging = this.stopDragging.bind(this);\n this.startScroll = this.startScroll.bind(this);\n this.startLeftDrag = this.startLeftDrag.bind(this);\n this.startRightDrag = this.startRightDrag.bind(this);\n }\n\n getClientX(event) {\n if (event && event.touches && event.touches[0]) {\n return event.touches[0].clientX;\n }\n if (event && event.changedTouches && event.changedTouches[0]) {\n return event.changedTouches[0].clientX;\n }\n return event.clientX;\n }\n\n componentDidMount() {\n this._renderer = new GraphBodyRenderer({\n stateController: this.props.stateController,\n canvasElement: this.el,\n webgl: this.props.webgl,\n checkIntersection: this.props.checkIntersection\n });\n this.props.stateController.rangeGraphRenderer = this._renderer;\n\n this._renderer.on('size_changed', (sizing) => {\n this.setState(sizing);\n });\n\n this.setState({\n selectionBounds: this.props.stateController._selection,\n globalBounds: this.props.stateController._globalBounds\n });\n\n this.props.stateController.on('selection_changed', (selectionBounds) =>{\n this.setState({ selectionBounds });\n });\n\n this.props.stateController.on('global_bounds_changed', (globalBounds) =>{\n this.setState({ globalBounds: globalBounds });\n });\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.draggingY !== this.props.draggingY && this._renderer) {\n this._renderer.resize();\n }\n }\n\n componentWillUnmount() {\n if (this._renderer) {\n this._renderer.dispose();\n this._renderer = null;\n }\n }\n\n onMouseMove(event) {\n if (!this._dragType) {\n return;\n }\n\n // Prevent scrolling during touch-drag\n if (event && event.touches && event.preventDefault) {\n event.preventDefault();\n }\n\n let boundCalculator;\n const leftX = this.el.getBoundingClientRect().left;\n\n this.setState(({selectionBounds, globalBounds, elementWidth}) => {\n const pixelX = this.getClientX(event) - leftX;\n let percentage = pixelX/elementWidth;\n\n percentage = Math.max(percentage, 0);\n percentage = Math.min(percentage, 1);\n\n let trueX = percentage * (globalBounds.maxX - globalBounds.minX) + globalBounds.minX;\n\n if (this._dragType === 'scroll') {\n const range = selectionBounds.maxX - selectionBounds.minX;\n let minX = trueX - range*this._scrollAnchorPercentage;\n let maxX = trueX + range*(1-this._scrollAnchorPercentage);\n\n if (minX < globalBounds.minX) {\n minX = globalBounds.minX;\n maxX = minX + range;\n }\n\n if (maxX > globalBounds.maxX) {\n maxX = globalBounds.maxX;\n minX = maxX - range;\n }\n\n boundCalculator = () => {\n return {minX, maxX};\n };\n\n return {\n selectionBounds: Object.assign({}, selectionBounds, {\n minX, maxX\n })\n };\n } else if (this._dragType === 'left') {\n if (trueX > selectionBounds.maxX) {\n trueX = selectionBounds.maxX;\n }\n\n const boundToRight = globalBounds.maxX === selectionBounds.maxX;\n\n boundCalculator = () => {\n if (boundToRight) {\n return {\n minX: trueX\n };\n } else {\n return {\n minX: trueX,\n maxX: selectionBounds.maxX\n };\n }\n };\n\n return {\n selectionBounds: Object.assign({}, selectionBounds, {\n minX: trueX\n })\n };\n } else if (this._dragType === 'right') {\n if (trueX < selectionBounds.minX) {\n trueX = selectionBounds.minX;\n }\n\n const boundToLeft = globalBounds.minX === selectionBounds.minX;\n\n boundCalculator = () => {\n if (boundToLeft) {\n return {\n maxX: trueX\n };\n } else {\n return {\n minX: selectionBounds.minX,\n maxX: trueX\n };\n }\n };\n\n return {\n selectionBounds: Object.assign({}, selectionBounds, {\n maxX: trueX\n })\n };\n }\n }, () => {\n if (!boundCalculator) {\n return;\n }\n\n boundCalculator.debounceHistory = true;\n this.props.stateController.boundCalculator = boundCalculator;\n });\n }\n\n addListeners() {\n window.addEventListener('mousemove', this.onMouseMove);\n window.addEventListener('mouseup', this.stopDragging);\n window.addEventListener('touchmove', this.onMouseMove, { passive: false });\n window.addEventListener('touchend', this.stopDragging);\n window.addEventListener('touchcancel', this.stopDragging);\n }\n\n stopDragging() {\n this._dragType = null;\n this.forceUpdate();\n window.removeEventListener('mousemove', this.onMouseMove);\n window.removeEventListener('mouseup', this.stopDragging);\n window.removeEventListener('touchmove', this.onMouseMove);\n window.removeEventListener('touchend', this.stopDragging);\n window.removeEventListener('touchcancel', this.stopDragging);\n }\n\n startScroll(event) {\n this._dragType = 'scroll';\n\n const {selectionBounds, globalBounds, elementWidth} = this.state;\n const leftX = this.el.getBoundingClientRect().left;\n\n const pixelStartX = this.getClientX(event) - leftX;\n const pixelMinX = (selectionBounds.minX - globalBounds.minX)/(globalBounds.maxX - globalBounds.minX) * elementWidth || 0;\n const pixelMaxX = (selectionBounds.maxX - globalBounds.minX)/(globalBounds.maxX - globalBounds.minX) * elementWidth || 0;\n\n this._scrollAnchorPercentage = (pixelStartX-pixelMinX)/(pixelMaxX - pixelMinX);\n this.addListeners();\n }\n\n startLeftDrag(event) {\n this._dragType = 'left';\n this.addListeners();\n }\n\n startRightDrag(event) {\n this._dragType = 'right';\n this.addListeners();\n }\n\n render() {\n const { globalBounds, selectionBounds, elementWidth, elementHeight } = this.state;\n\n let pixelMinX = Math.min(Math.max((selectionBounds.minX - globalBounds.minX)/(globalBounds.maxX - globalBounds.minX), 0), 1) * elementWidth || 0;\n let pixelMaxX = Math.min(Math.max((selectionBounds.maxX - globalBounds.minX)/(globalBounds.maxX - globalBounds.minX), 0), 1) * elementWidth || 0;\n\n if (isNaN(pixelMinX) || !isFinite(pixelMinX) || selectionBounds.maxX < selectionBounds.minX) {\n pixelMinX = 0;\n }\n\n if (isNaN(pixelMaxX) || !isFinite(pixelMaxX) || selectionBounds.maxX < selectionBounds.minX) {\n pixelMaxX = 0;\n }\n\n const barSize = 14;\n const totalHeight = elementHeight + barSize; \n let ticks;\n\n if (selectionBounds.dates && this.props.markDates) {\n ticks = placeGrid({\n min: globalBounds.minX,\n max: globalBounds.maxX,\n totalSize: elementWidth,\n precision: 'day',\n dates: selectionBounds.dates,\n formatter: formatX,\n expectedLabelSize: 30,\n labelPadding: 5,\n formatOptions: {\n justMonthAndDay: true,\n unitOverride: 'day',\n timeZone: this.props.timeZone\n },\n skipFirst: true,\n skipLast: true\n });\n }\n\n return (\n <div className=\"range-selection-graph\">\n <div className=\"graph-body graph-body-secondary\" style={{ touchAction: 'none' }}>\n <canvas ref={(el) => this.el = el} />\n\n <svg style={{ height: totalHeight }}>\n <g>\n <rect\n x={0}\n y={elementHeight}\n width={elementWidth}\n height={barSize}\n className=\"selection-bar-track\"\n />\n\n {\n ticks && ticks.map(({ pixelValue, label, size, position }, i) => {\n if (isNaN(pixelValue)) {\n return null;\n }\n\n const classes = ['axis-item', `axis-item-${size}`, `axis-item-${position}`];\n \n const isHighlighted = pixelValue >= pixelMinX && pixelValue <= pixelMaxX;\n if (isHighlighted) {\n classes.push('axis-item-highlighted');\n }\n\n return (\n <g key={i} className={classes.join(' ')}>\n <path d={`M${pixelValue},0 v${elementHeight}`} />\n\n <text x={pixelValue + 3} y={elementHeight}>\n {label}\n </text>\n </g>\n );\n })\n }\n\n <rect\n x={pixelMinX}\n y={elementHeight}\n width={pixelMaxX - pixelMinX}\n height={barSize}\n className=\"selection-bar\"\n onMouseDown={this.startScroll}\n onTouchStart={this.startScroll}\n />\n\n <path\n d=\"M -3 3.5 L -3 9.333333333333334 M 0 3.5 L 0 9.333333333333334 M 3 3.5 L 3 9.333333333333334\"\n className=\"selection-bar-rifles\"\n transform={`translate(${pixelMinX + (pixelMaxX - pixelMinX)/2},${elementHeight})`}\n onMouseDown={this.startScroll}\n onTouchStart={this.startScroll}\n />\n </g>\n\n <g>\n <rect\n x={pixelMinX}\n y={0}\n width={pixelMaxX - pixelMinX}\n height={totalHeight}\n className=\"target-selection-outline\"\n onMouseDown={this.startScroll}\n onTouchStart={this.startScroll}\n />\n </g>\n\n {/* Left handle */}\n <g className={`selection-handle${(this._dragType === 'left' || this._dragType === 'scroll') ? ' selection-handle-dragging' : ''}`}>\n <rect\n x={pixelMinX - 15}\n y={(elementHeight - 30)/2}\n width={30}\n height={30}\n fill=\"transparent\"\n className=\"selection-bar-handle-hit\"\n onMouseDown={this.startLeftDrag}\n onTouchStart={this.startLeftDrag}\n />\n <path\n d=\"M -4.5 0.5 L 3.5 0.5 L 3.5 15.5 L -4.5 15.5 L -4.5 0.5 M -1.5 4 L -1.5 12 M 0.5 4 L 0.5 12\"\n className=\"selection-bar-handle\"\n transform={`translate(${pixelMinX},${(elementHeight - 15)/2})`}\n onMouseDown={this.startLeftDrag}\n onTouchStart={this.startLeftDrag}\n />\n </g>\n\n {/* Right handle */}\n <g className={`selection-handle${(this._dragType === 'right' || this._dragType === 'scroll') ? ' selection-handle-dragging' : ''}`}>\n <rect\n x={pixelMaxX - 15}\n y={(elementHeight - 30)/2}\n width={30}\n height={30}\n fill=\"transparent\"\n className=\"selection-bar-handle-hit\"\n onMouseDown={this.startRightDrag}\n onTouchStart={this.startRightDrag}\n />\n <path\n d=\"M -4.5 0.5 L 3.5 0.5 L 3.5 15.5 L -4.5 15.5 L -4.5 0.5 M -1.5 4 L -1.5 12 M 0.5 4 L 0.5 12\"\n className=\"selection-bar-handle\"\n transform={`translate(${pixelMaxX},${(elementHeight - 15)/2})`}\n onMouseDown={this.startRightDrag}\n onTouchStart={this.startRightDrag}\n />\n </g>\n\n </svg>\n\n {\n this.props.verticalLines &&\n <VerticalLines\n stateController={this.props.stateController}\n verticalLines={this.props.verticalLines}\n isRangeGraph={true}\n bounds={globalBounds}\n elementHeight={elementHeight}\n elementWidth={elementWidth}\n />\n }\n </div>\n </div>\n );\n }\n\n}\n\nRangeGraph.defaultProps = {\n width: 3,\n shadowColor: 'transparent'\n};\n\nRangeGraph.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n webgl: PropTypes.bool,\n draggingY: PropTypes.bool,\n checkIntersection: PropTypes.bool,\n markDates: PropTypes.bool,\n timeZone: PropTypes.string,\n verticalLines: CustomPropTypes.VerticalLines\n};","import React from 'react';\nimport getColor from '../helpers/colors';\nimport CustomPropTypes from '../helpers/custom_prop_types';\nimport PropTypes from 'prop-types';\nimport StateController from '../state/state_controller';\nimport nameForSeries from '../helpers/name_for_series';\n\nexport default React.memo(SeriesKeyItem);\n\nfunction SeriesKeyItem({ series, i, style, onMouseDown, theme, stateController, highlighted }) {\n const color = getColor(series.color, i, series.multigrapherSeriesIndex);\n\n if (theme === 'day') {\n style = Object.assign({}, style, {\n backgroundColor: color\n });\n } else {\n style = Object.assign({}, style, {\n color\n });\n }\n\n const classes = ['series-key-item'];\n if (highlighted) {\n classes.push('series-key-item-highlighted');\n }\n\n const name = nameForSeries(series, i);\n\n return (\n <div\n className={classes.join(' ')}\n style={style}\n onMouseDown={onMouseDown}\n onMouseOver={() => stateController.setHighlightedSeries(i)}\n onMouseOut={() => stateController.setHighlightedSeries(null)}\n onClick={() => stateController.registerSeriesClick(i)}\n >\n {name}\n </div>\n );\n}\n\nSeriesKeyItem.propTypes = {\n series: CustomPropTypes.SingleSeries.isRequired,\n stateController: PropTypes.instanceOf(StateController),\n i: PropTypes.number.isRequired,\n style: PropTypes.object,\n onMouseDown: PropTypes.func,\n theme: PropTypes.string.isRequired,\n highlighted: PropTypes.bool\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport StateController from '../state/state_controller';\n\nexport default class SeriesKeyAxisContainer extends React.PureComponent {\n\n constructor(props) {\n super(props);\n\n this.state = {\n showingLabelInput: false\n };\n\n this.toggleLabelInputShowing = this.toggleLabelInputShowing.bind(this);\n }\n\n toggleLabelInputShowing() {\n this.setState(({ showingLabelInput }) => {\n return {\n showingLabelInput: !showingLabelInput\n };\n });\n }\n\n render() {\n const {children, stateController, axisIndex, scale, label, grapherID} = this.props;\n\n const { showingLabelInput } = this.state;\n\n return (\n <div\n className={`series-key-axis-container${showingLabelInput ? ' series-key-axis-container-showing-label' : ''}`}\n data-axis-index={axisIndex}\n data-grapher-id={grapherID}\n >\n <div className=\"scale-label\" onClick={() => stateController.toggleScale({axisIndex})}>\n {scale.slice(0, showingLabelInput ? 6 : 3)}\n </div>\n\n <div className=\"series-key-axis-container-body\">\n <div>\n {children}\n\n <svg className=\"label-input-toggler\" viewBox=\"0 0 512 512\" onClick={this.toggleLabelInputShowing}>\n <path\n d=\"M0 252.118V48C0 21.49 21.49 0 48 0h204.118a48 48 0 0 1 33.941 14.059l211.882 211.882c18.745 18.745 18.745 49.137 0 67.882L293.823 497.941c-18.745 18.745-49.137 18.745-67.882 0L14.059 286.059A48 48 0 0 1 0 252.118zM112 64c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48z\"/>\n </svg>\n </div>\n\n <div className=\"series-key-axis-label-container\">\n <input\n onChange={(event) => stateController.setLabel({axisIndex, label: event.target.value})}\n placeholder=\"Enter label\"\n value={label || ''}\n />\n </div>\n </div>\n </div>\n );\n }\n}\n\nSeriesKeyAxisContainer.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n children: PropTypes.node.isRequired,\n axisIndex: PropTypes.number.isRequired,\n scale: PropTypes.string.isRequired,\n label: PropTypes.string,\n grapherID: PropTypes.string\n};\n","import React, { useState, useEffect, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport {Y_AXIS_WIDTH} from '../helpers/axis_sizes';\nimport StateController from '../state/state_controller';\nimport {\n useAlwaysTooltipped,\n useAxes,\n useHighlightedSeries,\n useLeftAxisCount,\n usePrimarySize,\n useRightAxisCount,\n useSeries, useShowingOptions\n} from '../state/hooks';\nimport SeriesKeyItem from './series_key_item.jsx';\nimport SeriesKeyAxisContainer from './series_key_axis_container.jsx';\n\nfunction calculateStyles({stateController, keyWidth}) {\n const rightAxisCount = useRightAxisCount(stateController);\n const leftAxisCount = useLeftAxisCount(stateController);\n const showingOptions = useShowingOptions(stateController);\n\n let marginRight = Y_AXIS_WIDTH*rightAxisCount;\n if (rightAxisCount > 0) {\n marginRight += 5;\n }\n\n marginRight += 250;\n\n if (showingOptions) {\n marginRight += 70;\n }\n\n let marginLeft = Y_AXIS_WIDTH*leftAxisCount;\n\n if (leftAxisCount > 0) {\n marginLeft += 5;\n }\n\n marginLeft = Math.max(marginRight, marginLeft);\n marginRight = Math.max(marginRight, marginLeft);\n\n let marginBottom;\n\n const { elementWidth } = usePrimarySize(stateController);\n\n const shouldBreak = elementWidth - marginLeft - marginRight < keyWidth;\n\n if (shouldBreak) {\n marginLeft = 0;\n marginRight = 0;\n marginBottom = 10;\n }\n\n return { marginRight, marginLeft, marginBottom };\n}\n\nexport default React.memo(SeriesKey);\n\nfunction SeriesKey({ stateController, theme, draggingY, grapherID, dragPositionYOffset=0 }) {\n const series = useSeries(stateController);\n const [draggedSeries, setDraggedSeries] = useState(null);\n const [dragPosition, setDragPosition] = useState({\n x: 0,\n y: 0\n });\n\n const highlightedSeries = useHighlightedSeries(stateController);\n\n const keyRef = useRef(null);\n const [keyWidth, setKeyWidth] = useState(series.map(({ name, yKey }, i) => (name || yKey || i).toString().length).reduce((a, b) => a + b, 0) * 5);\n\n let sizeCalculationHandle;\n useEffect(() => {\n if (keyRef.current) {\n cancelAnimationFrame(sizeCalculationHandle);\n\n sizeCalculationHandle = requestAnimationFrame(() => {\n if (!keyRef.current) { // has become invalid in the last frame\n return;\n }\n\n const width = [...keyRef.current.querySelectorAll('.series-key-axis-container')]\n .map((el) => el.clientWidth)\n .reduce((a, b) => a + b, 0);\n setKeyWidth(width);\n });\n }\n }, [series, keyRef.current]);\n\n const style = calculateStyles({ stateController, keyWidth });\n\n const axes = useAxes(stateController);\n const alwaysTooltipped = useAlwaysTooltipped(stateController);\n\n const startDragging = (event, singleSeries) => {\n let seriesKeyEl = event.target;\n while (seriesKeyEl && seriesKeyEl.className !== 'series-key') {\n seriesKeyEl = seriesKeyEl.parentNode;\n }\n const targetLeft = event.target.getBoundingClientRect().left;\n let seriesKeyLeft = seriesKeyEl.getBoundingClientRect().left;\n let seriesKeyMarginLeft = seriesKeyEl.style.marginLeft;\n\n const startX = event.clientX;\n const startY = event.clientY;\n const clientStartX = event.clientX;\n const clientStartY = event.clientY;\n\n setDraggedSeries(singleSeries);\n setDragPosition({\n x: event.clientX - startX + (targetLeft - seriesKeyLeft) - 2,\n y: event.clientY - startY + 1\n });\n\n const onMouseMove = (moveEvent) => {\n if (seriesKeyEl.style.marginLeft !== seriesKeyMarginLeft) {\n seriesKeyLeft = seriesKeyEl.getBoundingClientRect().left;\n seriesKeyMarginLeft = seriesKeyEl.style.marginLeft;\n }\n\n setDragPosition({\n x: moveEvent.clientX - startX + (targetLeft - seriesKeyLeft) - 2,\n y: moveEvent.clientY - startY + 1\n });\n };\n\n const onMouseUp = (mouseUpEvent) => {\n window.removeEventListener('mousemove', onMouseMove);\n window.removeEventListener('mouseup', onMouseUp);\n\n let target = mouseUpEvent.target;\n while (target && !(target.dataset || {}).axisIndex && !(target.dataset || {}).grapherId) {\n target = target.parentNode;\n }\n\n setDraggedSeries(null);\n stateController.finalizeDrag(singleSeries, target && (target.dataset || {}).axisIndex, target && (target.dataset || {}).grapherId);\n\n if (mouseUpEvent.clientX === clientStartX && mouseUpEvent.clientY === clientStartY) {\n stateController.toggleAlwaysTooltipped(singleSeries, mouseUpEvent.shiftKey);\n }\n };\n\n window.addEventListener('mousemove', onMouseMove);\n window.addEventListener('mouseup', onMouseUp);\n\n stateController.markDragStart();\n };\n\n return (\n <div className=\"series-key\" style={style} ref={keyRef}>\n {\n draggingY &&\n <div\n className=\"series-key-axis-container\"\n data-axis-index=\"new-left\"\n data-grapher-id={grapherID}\n />\n }\n\n {\n axes.map((axis, i) => {\n if (!axis.series.length && axes.length > 1) {\n return null;\n }\n\n return (\n <SeriesKeyAxisContainer\n key={i}\n label={axis.label}\n axisIndex={axis.axisIndex}\n scale={axis.scale}\n stateController={stateController}\n grapherID={grapherID}\n >\n {\n axis.series.map((singleSeries) => {\n if (singleSeries.hideFromKey) {\n return null;\n }\n\n return (\n <SeriesKeyItem\n key={singleSeries.index}\n series={singleSeries}\n i={singleSeries.index}\n onMouseDown={(event, toggleTooltipped) => startDragging(event, singleSeries, toggleTooltipped)}\n theme={theme}\n stateController={stateController}\n highlighted={highlightedSeries === singleSeries.index || alwaysTooltipped.has(singleSeries)}\n />\n );\n })\n }\n </SeriesKeyAxisContainer>\n );\n })\n }\n\n {\n draggingY &&\n <div\n className=\"series-key-axis-container\"\n data-axis-index=\"new-right\"\n data-grapher-id={grapherID}\n />\n }\n\n {\n draggedSeries &&\n <SeriesKeyItem\n style={{\n left: dragPosition.x,\n top: dragPosition.y - dragPositionYOffset,\n position: 'absolute',\n pointerEvents: 'none',\n zIndex: 1\n }}\n series={draggedSeries}\n i={draggedSeries.index}\n theme={theme}\n stateController={stateController}\n />\n }\n </div>\n );\n}\n\nSeriesKey.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired,\n theme: PropTypes.string.isRequired,\n draggingY: PropTypes.bool.isRequired,\n grapherID: PropTypes.string,\n dragPositionYOffset: PropTypes.number\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nexport default React.memo(GraphTitle);\n\nfunction GraphTitle({ title }) {\n return (\n <div className=\"grapher-title\">\n {title}\n </div>\n );\n}\n\nGraphTitle.propTypes = {\n title: PropTypes.string.isRequired\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport StateController from '../state/state_controller';\nimport {useSeries} from '../state/hooks';\nimport CustomPropTypes from '../helpers/custom_prop_types';\nimport getColor from '../helpers/colors';\n\nclass SeriesToggle extends React.PureComponent {\n\n constructor(props) {\n super(props);\n\n this.onChange = this.onChange.bind(this);\n }\n\n // NOTE: event listeners here do not follow React best practices, because when handled through React\n // there were ~500ms of latency when toggling the checkbox. It's unclear why\n onChange(event) {\n setTimeout(() => {\n this.props.stateController.setShowing(this.props.singleSeries, event.target.checked);\n });\n }\n\n render() {\n const { singleSeries } = this.props;\n const color = getColor(singleSeries.color, singleSeries.index, singleSeries.multigrapherSeriesIndex);\n\n let name = singleSeries.name || singleSeries.yKey;\n\n if (!name) {\n name = singleSeries.index;\n }\n\n return (\n <div className=\"series-toggle\">\n <label>\n <input\n type=\"checkbox\"\n defaultChecked={!singleSeries.hidden}\n ref={(el) => el && el.addEventListener('change', this.onChange)}\n />\n <span className=\"checkmark\" style={{ background: color, borderColor: color }} />\n\n {name}\n </label>\n </div>\n );\n }\n}\n\nSeriesToggle.propTypes = {\n singleSeries: CustomPropTypes.SingleSeries.isRequired,\n stateController: PropTypes.instanceOf(StateController).isRequired\n};\n\nexport default function Sidebar({ stateController }) {\n const series = useSeries(stateController);\n\n return (\n <div className=\"grapher-sidebar\">\n {\n series.map((singleSeries, i) =>\n <SeriesToggle\n key={i}\n singleSeries={singleSeries}\n stateController={stateController}\n />\n )\n }\n </div>\n );\n}\n\nSidebar.propTypes = {\n stateController: PropTypes.instanceOf(StateController).isRequired\n};\n","export default class SyncPool {\n\n /**\n *\n * @param {Boolean} syncBounds\n * @param {Boolean|'onShift'} syncTooltips\n * @param {Boolean} syncDragState\n */\n constructor({ syncBounds=true, syncTooltips=true, syncDragState=false } = {}) {\n this._stateControllers = new Set();\n this._syncBounds = syncBounds;\n this._syncTooltips = syncTooltips;\n this._syncDragState = syncDragState;\n }\n\n add(stateController) {\n this._stateControllers.add(stateController);\n\n if (this._syncBounds) {\n this.syncBounds(stateController);\n }\n\n if (this._syncTooltips) {\n this.syncTooltips(stateController);\n }\n\n if (this._syncDragState) {\n this.syncDragState(stateController);\n }\n }\n\n remove(stateController) {\n this._stateControllers.delete(stateController);\n\n // TODO: remove listeners\n // (though since this is currently only called by stateController dispose, it probably doesn't matter)\n }\n\n syncDragState(stateController) {\n stateController.on('dragging_y_changed', (draggingY) => {\n for (let otherStateController of this._stateControllers) {\n if (stateController === otherStateController) {\n continue;\n }\n\n if (draggingY) {\n otherStateController.markDragStart();\n } else {\n otherStateController.finalizeDrag(null, null);\n }\n }\n });\n }\n\n syncBounds(stateController) {\n stateController.on('bound_calculator_changed', (boundCalculator) => {\n for (let otherStateController of this._stateControllers) {\n if (stateController === otherStateController) {\n continue;\n }\n\n otherStateController.boundCalculator = boundCalculator;\n }\n });\n }\n\n syncTooltips(stateController) {\n stateController.on('tooltip_state_changed', (tooltipState, stateArg) => {\n if (this._tooltipIgnoreState === stateArg) { // avoid cascading changes\n return;\n }\n\n const shouldHideTooltips = tooltipState.unsavedTooltipsCount === 0 ||\n !tooltipState.mousePresent ||\n (this._syncTooltips === 'onShift' && !stateController.shiftKeyPressedOnMove);\n\n if (shouldHideTooltips) {\n this._tooltipIgnoreState = Math.random();\n }\n\n for (let otherStateController of this._stateControllers) {\n if (stateController === otherStateController) {\n continue;\n }\n\n if (shouldHideTooltips) {\n otherStateController.showOnlySavedTooltips(this._tooltipIgnoreState);\n continue;\n }\n\n otherStateController.setTooltipMousePosition({\n mouseX: tooltipState.mouseX,\n mouseY: tooltipState.mouseY,\n tooltipAllNext: true,\n tooltipStateArg: this._tooltipIgnoreState\n });\n }\n });\n }\n\n}\n","import React, { useEffect, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport CustomPropTypes from './helpers/custom_prop_types';\nimport GraphBody from './components/graph_body.jsx';\nimport './grapher.scss';\nimport XAxis from './components/x_axis.jsx';\nimport YAxis from './components/y_axis.jsx';\nimport RangeSelection from './components/range_selection.jsx';\nimport RangeGraph from './components/range_graph.jsx';\nimport SeriesKey from './components/series_key.jsx';\nimport {Y_AXIS_WIDTH} from './helpers/axis_sizes';\nimport GraphTitle from './components/graph_title.jsx';\nimport {LINE_COLORS} from './helpers/colors';\nimport StateController from './state/state_controller';\nimport {useDraggingY, useLeftAxes, useRightAxes, useShowingSidebar, useTheme} from './state/hooks';\nimport Sidebar from './components/sidebar.jsx';\nimport SyncPool from './state/sync_pool.js';\nimport BOUND_CALCULATORS from './state/bound_calculators.js';\n\nfunction calculateClassNamesAndStyles(props, { draggingY, theme }) {\n const { fullscreen, height, width } = props;\n\n const classNames = [\n 'grapher',\n `grapher-${theme}`\n ];\n\n const styles = {};\n\n if (draggingY) {\n classNames.push('grapher-dragging-y');\n }\n\n if (fullscreen) {\n classNames.push('grapher-fullscreen');\n classNames.push('grapher-fixed-height');\n } else if (height) {\n classNames.push('grapher-fixed-height');\n if (typeof height === 'number') {\n styles.height = height - 20;\n } else {\n styles.height = `calc(${height} - 20px)`;\n }\n }\n\n if (width) {\n styles.width = width;\n }\n\n return {\n styles,\n classNames\n };\n}\n\nexport default React.memo(Grapher);\n\nconst grapherDefaultProps = {\n theme: 'night',\n showAxes: true,\n showRangeGraph: true,\n showRangeSelectors: true,\n showSeriesKey: true,\n showTooltips: true,\n boundsSelectionEnabled: true,\n customBoundsSelectors: [],\n sidebarEnabled: false,\n defaultShowAnnotations: true,\n defaultShowOptions: true\n};\n\nfunction Grapher(props) {\n props = {...grapherDefaultProps, ...props};\n\n const stateController = useMemo(() => new StateController({\n grapherID: props.id,\n ...props,\n ...props.stateControllerInitialization\n }), []);\n\n useEffect(() => {\n if (process.env.NODE_ENV === 'development') {\n window.stateController = stateController;\n }\n\n return () => {\n stateController.dispose();\n };\n }, [stateController]);\n\n useEffect(() => {\n props.exportStateController && props.exportStateController(stateController);\n }, [stateController, props.exportStateController]);\n\n useEffect(() => {\n stateController.timingFrameCount = props.timingFrameCount;\n }, [stateController, props.timingFrameCount]);\n\n useEffect(() => {\n props.onRenderTime && stateController.on('render_time', props.onRenderTime);\n\n return () => {\n props.onRenderTime && stateController.off('render_time', props.onRenderTime);\n };\n }, [stateController, props.onRenderTime]);\n\n useEffect(() => {\n stateController.setSeries(props.series);\n }, [stateController, props.series]);\n\n useEffect(() => {\n stateController.theme = props.theme;\n }, [stateController, props.theme]);\n\n const theme = useTheme(stateController);\n const bigLabels = props.bigLabels || theme === 'export';\n\n const defaultLineWidth = props.defaultLineWidth || (theme === 'export' ? 3 : undefined);\n useEffect(() => {\n stateController.defaultLineWidth = defaultLineWidth;\n }, [stateController, defaultLineWidth]);\n\n useEffect(() => {\n stateController.percentile = props.percentile;\n }, [stateController, props.percentile]);\n\n useEffect(() => {\n stateController.customBoundsSelectors = props.customBoundsSelectors;\n }, [stateController, props.customBoundsSelectors]);\n\n useEffect(() => {\n stateController.annotations = props.annotations;\n }, [stateController, props.annotations]);\n\n useEffect(() => {\n if (!props.onAxisChange) {\n return () => {};\n }\n\n stateController.on('exported_axes_changed', props.onAxisChange);\n return () => {\n stateController.off('exported_axes_changed', props.onAxisChange);\n };\n }, [stateController, props.onAxisChange]);\n\n useEffect(() => {\n stateController.primaryRenderer.resize();\n }, [props.height]);\n\n const draggingY = useDraggingY(stateController);\n\n const {styles, classNames} = calculateClassNamesAndStyles(props, { draggingY, theme });\n\n const rightAxes = useRightAxes(stateController);\n const leftAxes = useLeftAxes(stateController);\n const showingSidebar = useShowingSidebar(stateController);\n\n const showAxisColors = typeof props.showAxisColors === 'boolean' ? props.showAxisColors : (theme !== 'export');\n const showGrid = typeof props.showGrid === 'boolean' ? props.showGrid : true;\n const showAxes = typeof props.showAxes === 'boolean' ? props.showAxes : false;\n\n const commonYAxisProps = {\n stateController,\n showAxes,\n showGrid,\n showSeriesKey: props.showSeriesKey,\n bodyHeight: props.bodyHeight,\n theme,\n grapherID: props.id,\n dragPositionYOffset: props.dragPositionYOffset,\n showAxisColors,\n bigLabels\n };\n\n return (\n <div className={classNames.join(' ')} style={styles} data-grapher-id={props.id}>\n {\n props.title &&\n <GraphTitle title={props.title} />\n }\n\n <div className=\"grapher-primary-container-outer\">\n {\n showingSidebar &&\n <Sidebar stateController={stateController} />\n }\n\n <div className=\"grapher-primary-container-body\">\n {\n props.showSeriesKey &&\n <SeriesKey\n stateController={stateController}\n draggingY={draggingY}\n theme={props.theme}\n grapherID={props.id}\n dragPositionYOffset={props.dragPositionYOffset}\n />\n }\n\n {\n props.showRangeSelectors &&\n <RangeSelection\n stateController={stateController}\n customBoundsSelectors={props.customBoundsSelectors}\n customBoundsSelectorsOnly={props.customBoundsSelectorsOnly}\n sidebarEnabled={props.sidebarEnabled}\n />\n }\n\n <div className=\"grapher-main-row\">\n {\n draggingY &&\n <div\n className=\"axis y-axis\"\n data-axis-index=\"new-left\"\n data-grapher-id={props.id}\n style={{\n width: Y_AXIS_WIDTH,\n height: typeof props.bodyHeight === 'number' ? props.bodyHeight : undefined\n }}\n />\n }\n\n {\n leftAxes.map((axis, i) => {\n return <YAxis\n key={i}\n axis={axis}\n sideIndex={leftAxes.length - i - 1}\n {...commonYAxisProps}\n />;\n })\n }\n\n <div className=\"central-container\">\n <GraphBody\n stateController={stateController}\n webgl={props.webgl}\n bodyHeight={props.bodyHeight}\n boundsSelectionEnabled={props.boundsSelectionEnabled}\n showTooltips={props.showTooltips}\n tooltipOptions={props.tooltipOptions}\n checkIntersection={props.checkIntersection}\n draggablePoints={props.draggablePoints}\n onPointDrag={props.onPointDrag}\n onDraggablePointsDoubleClick={props.onDraggablePointsDoubleClick}\n onPointClick={props.onPointClick}\n verticalLines={props.verticalLines}\n clockStyle={props.clockStyle}\n timeZone={props.timeZone}\n />\n\n <XAxis\n showGrid={showGrid}\n showAxes={showAxes}\n stateController={stateController}\n bigLabels={bigLabels}\n xTickUnit={props.xTickUnit}\n clockStyle={props.clockStyle}\n timeZone={props.timeZone}\n integersOnly={props.xAxisIntegersOnly}\n formatXAxisLabel={props.formatXAxisLabel}\n />\n\n {\n props.showRangeGraph &&\n <div className=\"range-graph-container\">\n <RangeGraph\n stateController={stateController}\n webgl={props.webgl}\n checkIntersection={props.checkIntersection}\n markDates={props.markRangeGraphDates}\n timeZone={props.timeZone}\n verticalLines={props.verticalLines}\n />\n </div>\n }\n </div>\n\n {\n rightAxes.map((axis, i) => {\n return <YAxis\n key={i}\n axis={axis}\n sideIndex={i}\n {...commonYAxisProps}\n />;\n })\n }\n\n {\n draggingY &&\n <div\n className=\"axis y-axis\"\n data-axis-index=\"new-right\"\n data-grapher-id={props.id}\n style={{\n width: Y_AXIS_WIDTH,\n height: typeof props.bodyHeight === 'number' ? props.bodyHeight : undefined\n }}\n />\n }\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nGrapher.propTypes = {\n series: CustomPropTypes.Series.isRequired,\n webgl: PropTypes.bool,\n requireWASM: PropTypes.bool,\n checkIntersection: PropTypes.bool,\n\n onAxisChange: PropTypes.func,\n onRenderTime: PropTypes.func,\n exportStateController: PropTypes.func,\n timingFrameCount: PropTypes.number,\n\n stateControllerInitialization: PropTypes.object,\n syncPool: PropTypes.instanceOf(SyncPool),\n id: PropTypes.string,\n dragPositionYOffset: PropTypes.number,\n\n theme: PropTypes.oneOf(['day', 'night', 'export']),\n title: PropTypes.string,\n fullscreen: PropTypes.bool,\n bodyHeight: PropTypes.number,\n height: PropTypes.number,\n width: PropTypes.number,\n\n showAxes: PropTypes.bool,\n showRangeGraph: PropTypes.bool,\n showRangeSelectors: PropTypes.bool,\n showSeriesKey: PropTypes.bool,\n showTooltips: PropTypes.bool,\n showGrid: PropTypes.bool,\n showAxisColors: PropTypes.bool,\n bigLabels: PropTypes.bool,\n xTickUnit: PropTypes.oneOf(['year']),\n formatXAxisLabel: PropTypes.func,\n xAxisIntegersOnly: PropTypes.bool,\n clockStyle: PropTypes.oneOf(['12h', '24h']),\n timeZone: PropTypes.string, // local, utc, or a full timezone string\n markRangeGraphDates: PropTypes.bool,\n\n boundsSelectionEnabled: PropTypes.bool,\n sidebarEnabled: PropTypes.bool,\n\n percentile: PropTypes.number,\n defaultShowOptions: PropTypes.bool,\n defaultShowIndividualPoints: PropTypes.bool,\n defaultShowSidebar: PropTypes.bool,\n defaultShowAnnotations: PropTypes.bool,\n defaultLineWidth: PropTypes.number,\n\n tooltipOptions: CustomPropTypes.TooltipOptions,\n\n customBoundsSelectors: CustomPropTypes.CustomBoundsSelectors,\n customBoundsSelectorsOnly: PropTypes.bool,\n defaultBoundsCalculator: PropTypes.string,\n\n annotations: CustomPropTypes.Annotations,\n draggablePoints: CustomPropTypes.DraggablePoints,\n onPointDrag: PropTypes.func,\n onDraggablePointsDoubleClick: PropTypes.func,\n verticalLines: CustomPropTypes.VerticalLines,\n onPointClick: PropTypes.func\n};\n\nexport const AVAILABLE_COLORS = LINE_COLORS;\nexport const BUILT_IN_BOUND_CALCULATORS = BOUND_CALCULATORS;\n","import Eventable from '../eventable.js';\nimport getColor from '../helpers/colors.js';\nimport nameForSeries from '../helpers/name_for_series.js';\n\nexport default class MultigraphStateController extends Eventable {\n\n constructor({ id }) {\n super();\n\n this._id = id;\n\n this._multiSeries = [];\n this._seriesToGraphIndices = new Map();\n this._graphIndicesToSeries = new Map();\n this._modifiedSeries = new Map();\n this._originalSeriesByMultigrapherIndex = new Map();\n this._stateControllers = new Set();\n this._prevSeries = [];\n\n this._dataCache = new Map();\n this._subscriptions = new Map();\n\n this._draggingY = false;\n\n this.on('multi_series_changed', () => {\n for (let stateController of this._stateControllers) {\n stateController._multiSeries = this._multiSeries;\n }\n });\n }\n\n /**\n * Takes an array of user-supplied series, then splits, modifies, and broadcasts them\n *\n * @param {Array<Object>} series\n */\n setSeries(series) {\n\n if (this._prevSeries.length === series.length) {\n let anyDifferent = false;\n for (let i = 0; i < series.length; i++) {\n if (series[i] !== this._prevSeries[i]) {\n anyDifferent = true;\n break;\n }\n }\n\n if (!anyDifferent) {\n return;\n }\n }\n\n this._prevSeries = series;\n\n const graphIndices = new Set();\n const currentSeriesSet = new Set(series);\n\n for (let singleSeries of series) {\n let graphIndex = singleSeries.graph || 0;\n\n if (this._seriesToGraphIndices.has(singleSeries)) {\n graphIndex = this._seriesToGraphIndices.get(singleSeries);\n }\n\n graphIndices.add(graphIndex);\n\n let seriesSet = this._graphIndicesToSeries.get(graphIndex);\n if (!seriesSet) {\n seriesSet = new Set();\n this._graphIndicesToSeries.set(graphIndex, seriesSet);\n }\n\n seriesSet.add(singleSeries);\n }\n\n const sortedGraphIndices = [...graphIndices].sort();\n\n this._multiSeries = [];\n let globalSeriesIndex = 0;\n\n for (let graphIndex of sortedGraphIndices) {\n const series = [];\n\n for (let singleSeries of this._graphIndicesToSeries.get(graphIndex)) {\n if (!currentSeriesSet.has(singleSeries)) {\n this._graphIndicesToSeries.get(graphIndex).delete(singleSeries);\n continue;\n }\n\n if (this._modifiedSeries.has(singleSeries)) {\n globalSeriesIndex++;\n series.push(this._modifiedSeries.get(singleSeries));\n continue;\n }\n\n const color = getColor(singleSeries.color, globalSeriesIndex);\n const name = nameForSeries(singleSeries, globalSeriesIndex);\n const modifiedSeries = {\n ...singleSeries,\n multigrapherSeriesIndex: globalSeriesIndex,\n multigrapherGraphIndex: graphIndex,\n color,\n name\n };\n\n this._modifiedSeries.set(singleSeries, modifiedSeries);\n this._originalSeriesByMultigrapherIndex.set(globalSeriesIndex, singleSeries);\n\n globalSeriesIndex++;\n series.push(modifiedSeries);\n }\n\n this._multiSeries.push(series);\n }\n\n if (this._nextMultigrapherSeriesIndex) {\n this._nextMultigrapherSeriesIndex = this._nextMultigrapherSeriesIndex - this._multiSeriesCount + globalSeriesIndex;\n } else {\n this._nextMultigrapherSeriesIndex = globalSeriesIndex;\n }\n this._multiSeriesCount = globalSeriesIndex;\n\n this.emit('multi_series_changed', this.multiSeries);\n }\n\n /**\n * Registers a state controller for series switching\n *\n * @param {StateController} stateController\n */\n registerStateController(stateController) {\n if (this._stateControllers.has(stateController)) {\n return;\n }\n\n this._stateControllers.add(stateController);\n stateController._multigraphStateController = this;\n stateController._multiSeries = this._multiSeries;\n\n stateController.on('dragging_y_finalized', ({ grapherID, axisIndex, draggedSeries }={}) => {\n if (grapherID === stateController.grapherID) {\n return;\n }\n\n const [check, multigrapherID, graphIndex] = grapherID.split('-');\n if (check !== 'multigrapher' || multigrapherID !== this._id) {\n return;\n }\n\n setTimeout(() => {\n this.moveSeries({ axisIndex, draggedSeries, graphIndex });\n });\n });\n\n stateController.on('dragging_y_changed', (draggingY) => {\n if (draggingY === this._draggingY) {\n return;\n }\n\n this._draggingY = draggingY;\n this.emit('dragging_y_changed', this._draggingY);\n });\n\n stateController.on('observable_modified', (observable) => {\n for (let otherStateController of this._stateControllers) {\n if (stateController === otherStateController) {\n continue;\n }\n\n otherStateController.markObservableModified(observable);\n }\n });\n\n stateController.on('dispose', () => {\n this._stateControllers.delete(stateController);\n });\n }\n\n /**\n * Moves the given dragged series (as specified by the child state controller) to a different graph\n *\n * @param {String} axisIndex - the axis index on the new graph to move the series to\n * @param {Object} draggedSeries - the series that got dragged. Different identity than what this may access\n * @param {String} graphIndex - the index of the graph to assign it to\n */\n moveSeries({ axisIndex, draggedSeries, graphIndex }) {\n const prevGraphCount = this.graphCount;\n\n const originalSeries = this._originalSeriesByMultigrapherIndex.get(draggedSeries.multigrapherSeriesIndex);\n const modifiedSeries = this._modifiedSeries.get(originalSeries);\n\n this._multiSeries[modifiedSeries.multigrapherGraphIndex].splice(\n this._multiSeries[modifiedSeries.multigrapherGraphIndex].indexOf(modifiedSeries), 1\n );\n this._multiSeries[modifiedSeries.multigrapherGraphIndex] = [...this._multiSeries[modifiedSeries.multigrapherGraphIndex]];\n\n if (graphIndex === 'top') {\n modifiedSeries.multigrapherGraphIndex = this._createGraphAtTop();\n } else if (graphIndex === 'bottom') {\n modifiedSeries.multigrapherGraphIndex = this._createGraphAtBottom();\n } else {\n modifiedSeries.multigrapherGraphIndex = parseInt(graphIndex);\n }\n\n modifiedSeries.axisIndex = axisIndex;\n // safe because stateController operates on a copy. We could also have changed the identify of modifiedSeries,\n // but with that we might reset data when moving it back\n delete modifiedSeries.axis;\n\n this._multiSeries[modifiedSeries.multigrapherGraphIndex] = [...this._multiSeries[modifiedSeries.multigrapherGraphIndex], modifiedSeries];\n this._multiSeries = [...this._multiSeries];\n\n for (let graphIndex = 0; graphIndex < this._multiSeries.length; graphIndex++) {\n const originalSeriesAtIndex = this._multiSeries[graphIndex].map(({ multigrapherSeriesIndex }) =>\n this._originalSeriesByMultigrapherIndex.get(multigrapherSeriesIndex));\n this._graphIndicesToSeries.set(graphIndex, new Set(originalSeriesAtIndex));\n\n for (let singleSeries of originalSeriesAtIndex) {\n this._seriesToGraphIndices.set(singleSeries, graphIndex);\n }\n }\n\n this.emit('multi_series_changed', this.multiSeries);\n this.emit('graph_count_changed', this.graphCount, prevGraphCount);\n }\n\n /**\n * Finds or creates an empty graph at the beginning and returns its index\n *\n * @return {number}\n * @private\n */\n _createGraphAtTop() {\n // check if there's anything at the beginning already\n let emptyAtTopIndex = null;\n\n for (let i = 0; i < this._multiSeries.length; i++) {\n if (this._multiSeries[i].length === 0) {\n emptyAtTopIndex = i;\n } else {\n break;\n }\n }\n\n if (emptyAtTopIndex !== null) {\n return emptyAtTopIndex;\n }\n\n // add a series at the beginning and mutate the graph index of each\n this._multiSeries = [[], ...this._multiSeries];\n for (let graphIndex = 0; graphIndex < this._multiSeries.length; graphIndex++) {\n if (!this._multiSeries[graphIndex].length) {\n continue;\n }\n\n this._multiSeries[graphIndex] = [...this._multiSeries[graphIndex]];\n\n for (let modifiedSeries of this._multiSeries[graphIndex]) {\n modifiedSeries.multigrapherGraphIndex = graphIndex;\n }\n }\n\n return 0;\n }\n\n /**\n * Finds or creates an empty graph at the end and returns its index\n *\n * @return {number}\n * @private\n */\n _createGraphAtBottom() {\n // check if there's anything at the beginning already\n let emptyAtBottomIndex = null;\n\n for (let i = this._multiSeries.length - 1; i >= 0; i--) {\n if (this._multiSeries[i].length === 0) {\n emptyAtBottomIndex = i;\n } else {\n break;\n }\n }\n\n if (emptyAtBottomIndex !== null) {\n return emptyAtBottomIndex;\n }\n\n // add something at the bottom\n this._multiSeries = [...this._multiSeries, []];\n\n return this._multiSeries.length - 1;\n }\n\n get multiSeries() {\n return this._multiSeries.filter((series) => series.length);\n }\n\n get series() {\n return [...this._stateControllers].map((stateController) => stateController.series).flat();\n }\n\n get graphCount() {\n return this.multiSeries.length;\n }\n\n get draggingY() {\n return this._draggingY;\n }\n\n dispose() {\n this.clearListeners();\n\n for (let listener of this._subscriptions.values()) {\n listener.unsubscribe();\n }\n\n this._subscriptions.clear();\n }\n\n get stateControllerInitialization() {\n return {\n sharedDataCache: this._dataCache,\n sharedSubscriptions: this._subscriptions\n };\n }\n\n incrementMultigrapherSeriesIndex() {\n const index = this._nextMultigrapherSeriesIndex;\n\n this._nextMultigrapherSeriesIndex ++;\n\n return index;\n }\n}\n","import React, { useEffect, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport Grapher from './grapher.jsx';\nimport MultigraphStateController from './state/multigraph_state_controller.js';\nimport {useDraggingY, useMultiSeries} from './state/hooks.js';\nimport SyncPool from './state/sync_pool.js';\n\nexport default React.memo(MultiGrapher);\n\n\nfunction MultiGrapher(props) {\n /* eslint-disable react/prop-types */\n\n const multigrapherID = useMemo(() => Math.random().toString(36).slice(2), []);\n\n const multigraphStateController = useMemo(() => new MultigraphStateController({\n id: multigrapherID,\n ...props\n }), []);\n\n const multiSeries = useMultiSeries(multigraphStateController);\n\n const syncPool = useMemo(() => new SyncPool({\n syncBounds: props.syncBounds,\n syncTooltips: props.syncTooltips,\n syncDragState: true\n }), []);\n\n const registerStateController = useMemo(() => multigraphStateController.registerStateController.bind(multigraphStateController), [multigraphStateController]);\n\n useEffect(() => {\n if (process.env.NODE_ENV === 'development') {\n window.multigraphStateController = multigraphStateController;\n }\n\n return () => {\n multigraphStateController.dispose();\n };\n }, [multigraphStateController]);\n\n useEffect(() => {\n props.exportStateController && props.exportStateController(multigraphStateController);\n }, [multigraphStateController, props.exportStateController]);\n\n useEffect(() => {\n multigraphStateController.setSeries(props.series);\n }, [multigraphStateController, props.series]);\n\n useEffect(() => {\n if (!props.onMultiseriesChange) {\n return () => {};\n }\n\n multigraphStateController.on('multi_series_changed', props.onMultiseriesChange);\n return () => {\n multigraphStateController.off('multi_series_changed', props.onMultiseriesChange);\n };\n }, [multigraphStateController, props.onMultiseriesChange]);\n\n const draggingY = useDraggingY(multigraphStateController);\n\n return (\n <div className=\"multigrapher\">\n {\n draggingY && props.newUpperEnabled &&\n <div className={`new-grapher grapher-${props.theme}`} data-grapher-id={`multigrapher-${multigrapherID}-top`}>\n New grapher\n </div>\n }\n\n {\n multiSeries.map((series, i) =>\n <Grapher\n key={i}\n {...props}\n syncPool={syncPool}\n stateControllerInitialization={multigraphStateController.stateControllerInitialization}\n series={series}\n id={`multigrapher-${multigrapherID}-${i}`}\n dragPositionYOffset={props.newUpperEnabled ? 38 : 0}\n exportStateController={registerStateController}\n />\n )\n }\n\n {\n draggingY &&\n <div className={`new-grapher grapher-${props.theme}`} data-grapher-id={`multigrapher-${multigrapherID}-bottom`}>\n New grapher\n </div>\n }\n </div>\n );\n}\n\nMultiGrapher.defaultProps = {\n theme: 'night'\n};\n\nMultiGrapher.propTypes = Object.assign({}, Grapher.propTypes, {\n syncBounds: PropTypes.bool,\n syncTooltips: PropTypes.bool,\n newUpperEnabled: PropTypes.bool,\n onMultiseriesChange: PropTypes.func\n});\n"],"names":["___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","minPointSpacing","rendering","negativeColor","gradient","negativeGradient","zeroLineWidth","zeroLineColor","zeroLineY","pointRadius","tooltipWidth","hasAreaBottom","shadowColor","rangeKey","Series","Axis","axisIndex","series","side","scale","label","Axes","CustomBoundsSelector","calculator","datesOnly","CustomBoundsSelectors","TooltipOptionsRaw","includeSeriesLabel","includeXLabel","includeYLabel","includeXValue","includeYValue","floating","alwaysFixedPosition","floatPosition","floatDelta","savingDisabled","customTooltip","combineTooltips","TooltipOptions","Annotation","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","createDefaultGradient","halfOpacityColor","inferType","useSimpleData","simpleData","observe","colorToVector","parts","part","test","substr","createGLProgram","gl","vertShaderSource","fragShaderSource","vertexShader","createShader","VERTEX_SHADER","shaderSource","compileShader","getShaderParameter","COMPILE_STATUS","console","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","cutoffPixelX","preCutoffPaths","postCutoffPaths","prePath","postPath","lastPrePoint","firstPostPoint","x1","y1","x2","y2","unshift","reducedColor","drawPointsWithCutoffByRatio","isBeforeCutoff","getBarWidths","closestSpacing","bounds","axisSeriesCount","fullBarWidth","maxX","minX","totalBarWidth","barWidth","barSpacing","applyPointSpacing","points","minSpacing","spacedPoints","point","rustApiModule","RustAPIPromise","default","RustAPI","extractVerticesFromPaths","pointNumber","positions","prevPositions","indices","Uint32Array","verticesPattern","set","vertexPointer","sourceLength","copyWithin","pointI","prevX","LineProgram","lineVert","lineFrag","_circleProgram","circleVert","circleFrag","_positionBuffer","_prevPositionBuffer","_individualPointBuffer","dispose","clear","drawingBufferWidth","drawingBufferHeight","clearColor","viewport","parameters","thickness","shadowBlur","renderCutoffGradient","cutoffIndex","originalData","drawLineWithCutoff","get_point_number","extract_vertices","extractVertices","positionIndex","prevPositionIndex","vertexIndex","uniform1f","colorVector","cutoffX","ELEMENT_ARRAY_BUFFER","drawElements","UNSIGNED_INT","pointSize","getIndividualPoints","cutoffTime","baseIndex","floor","fraction","cutoffDate","getTime","currentDate","nextDate","currentTime","preCutoffPoints","postCutoffPoints","isPreview","visibleMinTime","selectionBounds","pixelX","pixelY","visibleMaxTime","reducedOpacityColor","flat","POINTS","visibleCutoffRatio","ShadowProgram","shadowVert","shadowFrag","positionLoc","trapezoidBoundsLoc","trapezoidBottomLoc","_trapezoidBoundsBuffer","_trapezoidBottomBuffer","_gradientTexture","createTexture","deleteTexture","generateTrapezoidGeometry","trapezoids","trapezoidBounds","trapezoidBottom","trap","bottomY1","bottomY2","bottom","parseGradient","fallbackColor","fallbackColorVec","textureData","Uint8Array","textureWidth","gradientCount","colors","stops","stopIndex","colorIndex","params","drawShadowWithCutoff","positiveTrapezoids","negativeTrapezoids","inRenderSpaceAreaBottom","y1RelativeToZero","y2RelativeToZero","xCross","abs","yCross","finalX2","finalY2","finalBottomY2","ratio","trapezoid","renderTrapezoidSet","trapSet","geometry","gradientData","activeTexture","TEXTURE0","bindTexture","TEXTURE_2D","texImage2D","RGBA","UNSIGNED_BYTE","texParameteri","TEXTURE_MIN_FILTER","NEAREST","TEXTURE_MAG_FILTER","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","uniform1i","uniform4fv","getError","NO_ERROR","_lastIndividualPoints","_lastParams","currentItem","nextItem","visibleBounds","firstTime","lastTime","firstItem","lastItem","translucentGradient","drawSplitShadowTrapezoids","disable","DEPTH_TEST","GraphBodyRenderer","stateController","canvasElement","webgl","checkIntersection","super","_stateController","_checkIntersection","_canvas","_webgl","_context","getContext","_lineProgram","_shadowProgram","alert","_context2d","_initialized","_initializeCanvas","_boundResize","resize","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","shouldSplitAreaPaths","areaPaths","pathI","reducedOpacityGradient","renderCutoffIndex","preCutoffPath","preCutoffAreaBottomPath","bottomGhostPoint","postCutoffPath","postCutoffAreaBottomPath","visibleTimeRatio","drawAreaWithCutoff","isPositive","sumY","negGradient","positive","pointsToRender","drawArea","shadowProgram","boundsChanged","_lastBounds","_lastRenderHeight","_lastShadowCache","shadowParams","save","globalCompositeOperation","restore","top","left","pointerEvents","insertBefore","nextSibling","shouldShowIndividualPoints","drawContext","_overlayCanvas","_overlayContext","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","dataMinX","dataMaxX","dataRange","padding","closestIndex","closestPoint","ignoreYDistanceCheck","xDistanceThreshold","yDistanceThreshold","distanceThreshold","yDistance","enumLike","hasEnum","simplePoint","hasXEnum","unsavedTooltips","unsavedTooltipsCount","calculateTooltipState","_tooltipAllNext","_globalBounds","_tooltipStateArg","newX","right","shownSeries","xRange","annotation","seriesName","isRange","isPoint","xStartValue","xEndValue","convertToNumber","val","pixelStartX","pixelEndX","calculateAnnotationsState","_expandYWith","dataBoundsList","simpleDataSliceStart","dataBounds","_dataBounds","_recalculateSelection","disableSwap","selectedBounds","selectedBoundsAreaTop","selectedBoundsAreaBottom","inSelectedSpaceAreaBottom","_recalculateAxisBounds","modifiedSeries","newData","modifiedAxes","modifiedSeriesAndDependents","newDataInDataSpace","newDataBounds","newPointCount","previousSelection","newSelectedData","fixedY","targetBounds","byAxis","selectedBoundsList","selectedDataBounds","boundsCalculator","selectionFromGlobalBounds","_","export","night","_theme","inBackgroundSpacePrimary","inRenderSpacePrimary","_defaultLineWidth","inRenderSpacePrimaryAreaBottom","rangeGraphBounds","inRenderSpaceRangeGraph","inRenderSpaceRangeGraphAreaBottom","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","GraphBody","boundsSelectionEnabled","showTooltips","tooltipOptions","onPointClick","canvasEl","useCallback","el","boundsSelection","setBoundsSelection","start","useTooltipState","showAnnotations","useAnnotationState","useContextMenu","onScroll","onGlobalMouseMove","getTouch","touches","changedTouches","onGlobalTouchStart","touch","cancelable","closest","preventDefault","onGlobalTouchMove","onGlobalTouchEnd","passive","onMouseLeave","currentNode","classList","contains","seriesToNearestPoint","onContextMenu","placeTick","trueValue","inverted","totalSize","formatter","formatOptions","opts","scaledValue","pixelValue","placeTickByPixel","roundToDivisor","divisor","divisors","bestDelta","bestDivisor","delta","getEvenDateTickSpacing","span","desiredCount","subspan","amount","unit","placeGrid","expectedLabelSize","labelPadding","skipFirst","skipLast","paddedLabelSize","ticks","placementParams","setMinutes","setSeconds","setMilliseconds","setDate","lastDateString","tick","placeDatesGrid","tickSpacing","roundTo","getEvenTickSpacing","roundToEvenNumber","placeNumbersGrid","locals","XAxis","showAxes","showGrid","bigLabels","xTickUnit","formatXAxisLabel","useSelection","useHasXEnum","useEnumMap","minDate","maxDate","calculateTimePrecision","minLabel","maxLabel","expectedLabelWidth","timeTicks","dateTicks","regularTicks","hourSpan","alignedHour","currentHour","currentMinute","alignedMinute","currentSecond","alignedSecond","maxPixelForMiddleTicks","lastTick","placeTimeOnlyGrid","spanMultipleYears","customDateFormatter","startTick","endTick","placeDateOnlyGrid","xAxisHeight","marginBottom","skipGrid","singleTick","classes","timezoneLabel","YAxis","showSeriesKey","sideIndex","dragPositionYOffset","showAxisColors","sidePadding","setDraggedSeries","dragDelta","setDragDelta","dx","dy","highlightedOpacity","unhighlightedOpacity","marginLeft","opacity","edge","strokeDasharray","startDrag","startY","mouseUpEvent","dataset","grapherId","onMouseOver","onMouseOut","RangeSelectionButtonBase","selected","children","description","RangeSelectionButton","currentBoundCalculator","PercentileButton","usePercentile","usePercentileAsymmetry","onChange","onKeyUp","keyCode","focusable","viewBox","Options","sidebarEnabled","useShowIndividualPoints","RangeSelection","customBoundsSelectorsOnly","rightAxisCount","leftAxisCount","marginRight","useGlobalBounds","useBoundCalculator","useBoundHistory","customBoundSelectorNames","RangeGraph","state","stopDragging","startScroll","startLeftDrag","startRightDrag","getClientX","componentDidMount","_renderer","setState","componentDidUpdate","prevProps","componentWillUnmount","_dragType","leftX","percentage","_scrollAnchorPercentage","boundToRight","boundToLeft","addListeners","forceUpdate","pixelMinX","pixelMaxX","markDates","touchAction","onTouchStart","SeriesKeyItem","backgroundColor","SeriesKeyAxisContainer","showingLabelInput","toggleLabelInputShowing","placeholder","SeriesKey","dragPosition","setDragPosition","keyRef","useRef","keyWidth","setKeyWidth","sizeCalculationHandle","current","cancelAnimationFrame","querySelectorAll","clientWidth","calculateStyles","useAlwaysTooltipped","toggleTooltipped","startDragging","seriesKeyEl","targetLeft","seriesKeyLeft","seriesKeyMarginLeft","clientStartX","clientStartY","zIndex","GraphTitle","title","SeriesToggle","checked","defaultChecked","borderColor","Sidebar","SyncPool","syncBounds","syncTooltips","syncDragState","_stateControllers","_syncBounds","_syncTooltips","_syncDragState","otherStateController","stateArg","_tooltipIgnoreState","shouldHideTooltips","random","Grapher","grapherDefaultProps","showRangeGraph","showRangeSelectors","useMemo","stateControllerInitialization","exportStateController","onRenderTime","onAxisChange","styles","classNames","calculateClassNamesAndStyles","commonYAxisProps","xAxisIntegersOnly","markRangeGraphDates","AVAILABLE_COLORS","BUILT_IN_BOUND_CALCULATORS","MultigraphStateController","_id","_multiSeries","_seriesToGraphIndices","_graphIndicesToSeries","_originalSeriesByMultigrapherIndex","_prevSeries","graphIndices","currentSeriesSet","graphIndex","sortedGraphIndices","globalSeriesIndex","multigrapherGraphIndex","_nextMultigrapherSeriesIndex","_multiSeriesCount","multiSeries","registerStateController","_multigraphStateController","check","multigrapherID","moveSeries","prevGraphCount","graphCount","_createGraphAtTop","_createGraphAtBottom","originalSeriesAtIndex","emptyAtTopIndex","emptyAtBottomIndex","incrementMultigrapherSeriesIndex","MultiGrapher","multigraphStateController","useMultiSeries","onMultiseriesChange","newUpperEnabled"],"sourceRoot":""}