{"version":3,"file":"nova-ui-charts.mjs","sources":["../../src/chart-tooltips/chart-tooltip.component.ts","../../src/chart-tooltips/chart-tooltip.component.html","../../src/chart-tooltips/chart-tooltip.directive.ts","../../src/renderers/types.ts","../../src/constants.ts","../../src/core/common/scales/types.ts","../../src/core/common/renderer.ts","../../src/core/common/types.ts","../../src/renderers/radial/radial-renderer.ts","../../src/core/common/chart-plugin.ts","../../src/core/plugins/chart-donut-content-plugin.ts","../../src/chart-donut-content/chart-donut-content.component.ts","../../src/chart-donut-content/chart-donut-content.component.html","../../src/core/plugins/tooltips/chart-tooltips-plugin.ts","../../src/chart-tooltips/chart-tooltips.component.ts","../../src/chart-tooltips/chart-tooltips.component.html","../../src/core/plugins/chart-popover-plugin.ts","../../src/chart-popover/chart-popover.component.ts","../../src/chart-popover/chart-popover.component.html","../../src/chart-marker/chart-marker.component.ts","../../src/chart-marker/chart-marker.component.html","../../src/chart/chart.component.ts","../../src/core/common/event-bus.ts","../../src/core/chart-collection.ts","../../src/chart-collection/chart-collection.service.ts","../../src/chart-collection/chart-collection-id.directive.ts","../../src/legend/types.ts","../../src/legend/legend.component.ts","../../src/legend/legend.component.html","../../src/legend/legend-series/legend-series.component.ts","../../src/legend/legend-series/legend-series.component.html","../../src/legend/legend-tile/basic-legend-tile/basic-legend-tile.component.ts","../../src/legend/legend-tile/basic-legend-tile/basic-legend-tile.component.html","../../src/legend/legend-tile/rich-legend-tile/rich-legend-tile.component.ts","../../src/legend/legend-tile/rich-legend-tile/rich-legend-tile.component.html","../../src/thresholds/types.ts","../../src/core/common/palette/processed-color-provider.ts","../../src/core/common/palette/sequential-value-provider.ts","../../src/core/common/palette/sequential-color-provider.ts","../../src/core/common/palette/text-color-provider.ts","../../src/core/common/palette/chart-palette.ts","../../src/core/common/palette/markers/svg-marker.ts","../../src/core/common/palette/palettes.ts","../../src/core/common/palette/sequential-chart-marker-provider.ts","../../src/core/common/palette/default-providers.ts","../../src/renderers/area/area-accessors.ts","../../src/renderers/accessors/rectangle-accessors.ts","../../src/renderers/bar/accessors/bar-accessors.ts","../../src/renderers/bar/accessors/horizontal-bar-accessors.ts","../../src/renderers/bar/accessors/status-accessors.ts","../../src/renderers/bar/accessors/status-accessors-fn.ts","../../src/core/common/scales/constants.ts","../../src/core/common/scales/helpers/convert.ts","../../src/core/common/scales/helpers/invert.ts","../../src/core/common/utility.service.ts","../../src/renderers/xy-renderer.ts","../../src/renderers/bar/bar-renderer.ts","../../src/renderers/constants.ts","../../src/renderers/accessors/xy-accessors.ts","../../src/renderers/line/line-accessors.ts","../../src/core/common/scales/helpers/is-in-range.ts","../../src/renderers/marker-utils.ts","../../src/renderers/line/line-renderer.ts","../../src/core/types.ts","../../src/renderers/side-indicator-renderer.ts","../../src/thresholds/thresholds-service.ts","../../src/charts.module.ts","../../src/gauge/constants.ts","../../src/core/common/scales/helpers/domain.ts","../../src/core/common/data-manager.ts","../../src/core/common/render-engine.ts","../../src/core/plugins/render-engine-plugin.ts","../../src/core/chart.ts","../../src/core/chart-assists/types.ts","../../src/core/chart-assists/chart-assist.ts","../../src/core/grid/config/dimension-config.ts","../../src/core/grid/default-text-overflow-handler.ts","../../src/core/grid/config/axis-config.ts","../../src/core/grid/config/border-config.ts","../../src/core/grid/config/grid-config.ts","../../src/core/grid/config/xy-grid-config.ts","../../src/core/grid/config/linear-gauge-grid-config-fn.ts","../../src/core/common/mouse-interactive-area.ts","../../src/core/common/scales/domain-calculation/merge-domains.ts","../../src/core/common/scales/domain-calculation/automatic-domain.ts","../../src/core/common/scales/scale.ts","../../src/core/common/scales/linear-scale.ts","../../src/core/common/scales/band-scale.ts","../../src/core/common/scales/domain-calculation/domain-with-ticks.ts","../../src/core/plugins/interaction/interaction-label-plugin.ts","../../src/core/plugins/interaction/interaction-line-plugin.ts","../../src/core/plugins/mouse-interactive-area-plugin.ts","../../src/core/common/lasagna.ts","../../src/core/grid/grid.ts","../../src/core/grid/xy-grid.ts","../../src/core/plugins/gauge/constants.ts","../../src/renderers/radial/gauge/donut-gauge-rendering-util.ts","../../src/renderers/radial/gauge/donut-gauge-thresholds-renderer.ts","../../src/core/plugins/gauge/donut-gauge-labels-plugin.ts","../../src/core/plugins/gauge/linear-gauge-labels-plugin.ts","../../src/renderers/bar/accessors/vertical-bar-accessors.ts","../../src/renderers/bar/bar-scales.ts","../../src/renderers/bar/linear-gauge-renderer-config.ts","../../src/renderers/bar/linear-gauge-thresholds-renderer.ts","../../src/renderers/bar/preprocessor-utils.ts","../../src/renderers/bar/stacked-preprocessor.ts","../../src/renderers/radial/accessors/radial-accessors.ts","../../src/renderers/radial/gauge/donut-gauge-renderer-config.ts","../../src/core/grid/radial-grid.ts","../../src/renderers/radial/radial-grid-fn.ts","../../src/renderers/radial/radial-preprocessor.ts","../../src/renderers/radial/radial-scales.ts","../../src/gauge/gauge-util.ts","../../src/gauge/types.ts","../../src/gauge/public-api.ts","../../src/chart-collection/public-api.ts","../../src/core/common/palette/mapped-value-provider.ts","../../src/core/common/palette/markers/path-marker.ts","../../src/core/common/palette/public-api.ts","../../src/core/common/scales/domain-calculation/domain-with-auxiliary-series.ts","../../src/core/common/scales/point-scale.ts","../../src/core/common/scales/formatters/datetime-formatter.ts","../../src/core/common/scales/time-scale.ts","../../src/core/common/scales/time-interval-scale.ts","../../src/core/common/scales/formatters/public-api.ts","../../src/core/common/scales/noop-scale.ts","../../src/core/common/scales/public-api.ts","../../src/core/common/data-series.ts","../../src/core/common/public-api.ts","../../src/core/grid/config/area-grid-config.ts","../../src/core/grid/config/bar-grid-config.ts","../../src/core/grid/config/bar-horizontal-grid-config.ts","../../src/core/grid/config/bar-status-grid-config.ts","../../src/core/grid/config/spark-chart-grid-config.ts","../../src/core/grid/config/public-api.ts","../../src/core/grid/types.ts","../../src/core/grid/public-api.ts","../../src/core/plugins/gauge/types.ts","../../src/core/plugins/gauge/public-api.ts","../../src/core/plugins/interaction/public-api.ts","../../src/core/plugins/radial-popover-plugin.ts","../../src/core/plugins/tooltips/radial-tooltips-plugin.ts","../../src/core/plugins/tooltips/bar-tooltips-plugin.ts","../../src/core/plugins/tooltips/index.ts","../../src/core/plugins/types.ts","../../src/core/plugins/zoom-plugin.ts","../../src/core/plugins/timeseries-zoom-plugin.ts","../../src/core/plugins/timeseries-zoom-plugin-sync.service.ts","../../src/core/plugins/public-api.ts","../../src/core/chart-assists/spark-chart-assist.ts","../../src/core/chart-assists/public-api.ts","../../src/core/public-api.ts","../../src/legend/legend-tile/public-api.ts","../../src/legend/public-api.ts","../../src/renderers/accessors/noop-accessors.ts","../../src/renderers/accessors/public-api.ts","../../src/renderers/noop-renderer.ts","../../src/renderers/bar/bar-grid.ts","../../src/renderers/bar/types.ts","../../src/renderers/bar/accessors/bar-accessors-fn.ts","../../src/renderers/bar/accessors/public-api.ts","../../src/renderers/bar/highlight-strategies/bar-highlight-strategy.ts","../../src/renderers/bar/highlight-strategies/bar-highlight-strategy-outline.ts","../../src/renderers/bar/highlight-strategies/bar-series-highlight-strategy.ts","../../src/renderers/bar/highlight-strategies/public-api.ts","../../src/renderers/bar/public-api.ts","../../src/renderers/radial/pie-renderer.ts","../../src/renderers/radial/public-api.ts","../../src/renderers/line/calculate-missing-data.ts","../../src/renderers/line/interaction-strategies/line-select-series-interaction-strategy.ts","../../src/renderers/line/interaction-strategies/public-api.ts","../../src/renderers/line/missing-data-line-renderer-config.ts","../../src/renderers/line/public-api.ts","../../src/renderers/area/area-grid.ts","../../src/renderers/area/area-renderer.ts","../../src/renderers/area/stacked-area-preprocessor.ts","../../src/renderers/area/stacked-percentage-area-preprocessor.ts","../../src/renderers/area/stacked-area-accessors.ts","../../src/renderers/area/public-api.ts","../../src/renderers/public-api.ts","../../src/thresholds/thresholds-summary-grid-config.ts","../../src/thresholds/thresholds-top-grid-config.ts","../../src/thresholds/public-api.ts","../../src/public-api.ts","../../src/nova-ui-charts.ts"],"sourcesContent":["// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { animate, style, transition, trigger } from \"@angular/animations\";\nimport {\n    ChangeDetectionStrategy,\n    Component,\n    Input,\n    TemplateRef,\n} from \"@angular/core\";\n\n@Component({\n    selector: \"nui-chart-tooltip\",\n    styleUrls: [\"./chart-tooltip.component.less\"],\n    templateUrl: \"./chart-tooltip.component.html\",\n    changeDetection: ChangeDetectionStrategy.OnPush,\n    animations: [\n        trigger(\"tooltip\", [\n            transition(\":enter\", [\n                style({ opacity: 0 }),\n                animate(300, style({ opacity: 1 })),\n            ]),\n            transition(\":leave\", [animate(300, style({ opacity: 0 }))]),\n        ]),\n    ],\n    standalone: false,\n})\nexport class ChartTooltipComponent {\n    @Input() template: TemplateRef<any>;\n}\n","<div>\n    <div @tooltip class=\"nui-chart-tooltip px-2 py-1 nui-text-small\">\n        <ng-container *ngTemplateOutlet=\"template\"></ng-container>\n    </div>\n</div>\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport {\n    Overlay,\n    OverlayPositionBuilder,\n    ScrollStrategyOptions,\n} from \"@angular/cdk/overlay\";\n// added the import below on a separate line to avoid warning of unused reference when doing build-lib:prod\n// @see https://github.com/angular/angular/issues/21280#issuecomment-608957903\nimport {\n    ConnectedPosition,\n    FlexibleConnectedPositionStrategy,\n    OverlayRef,\n} from \"@angular/cdk/overlay\";\nimport { ComponentPortal } from \"@angular/cdk/portal\";\nimport {\n    Directive,\n    ElementRef,\n    Input,\n    OnDestroy,\n    OnInit,\n    TemplateRef,\n} from \"@angular/core\";\nimport { Subject, Subscription } from \"rxjs\";\n\nimport { ChartTooltipComponent } from \"./chart-tooltip.component\";\n\n/** @ignore */\n@Directive({\n    selector: \"[nuiChartTooltip]\",\n    standalone: false,\n})\nexport class ChartTooltipDirective implements OnInit, OnDestroy {\n    @Input() template: TemplateRef<any>;\n\n    @Input() openRemoteControl: Subject<void>;\n    @Input() closeRemoteControl: Subject<void>;\n\n    @Input() positions: ConnectedPosition[];\n\n    private overlayRef: OverlayRef;\n    private openSubscription: Subscription;\n    private closeSubscription: Subscription;\n    private positionStrategy: FlexibleConnectedPositionStrategy;\n\n    constructor(\n        private overlay: Overlay,\n        private overlayPositionBuilder: OverlayPositionBuilder,\n        private scrollStrategyOptions: ScrollStrategyOptions,\n        public elementRef: ElementRef<HTMLElement>\n    ) {}\n\n    public ngOnInit(): void {\n        this.positionStrategy = this.overlayPositionBuilder\n            .flexibleConnectedTo(this.elementRef)\n            .withPositions(this.positions)\n            .withFlexibleDimensions(false)\n            .withPush(true);\n\n        this.overlayRef = this.overlay.create({\n            panelClass: \"nui-chart-tooltip-pane\",\n            positionStrategy: this.positionStrategy,\n            scrollStrategy: this.scrollStrategyOptions.close(),\n        });\n\n        if (this.openRemoteControl) {\n            this.openSubscription = this.openRemoteControl.subscribe(() => {\n                this.show();\n            });\n        }\n\n        if (this.closeRemoteControl) {\n            this.closeSubscription = this.closeRemoteControl.subscribe(() => {\n                this.hide();\n            });\n        }\n    }\n\n    public show(): void {\n        if (this.overlayRef.hasAttached()) {\n            this.positionStrategy.apply();\n            return;\n        }\n        const tooltipRef = this.overlayRef.attach(\n            new ComponentPortal(ChartTooltipComponent)\n        );\n        tooltipRef.instance.template = this.template;\n    }\n\n    public hide(): void {\n        this.overlayRef.detach();\n    }\n\n    public ngOnDestroy(): void {\n        this.hide();\n\n        if (this.openSubscription) {\n            this.openSubscription.unsubscribe();\n        }\n        if (this.closeSubscription) {\n            this.closeSubscription.unsubscribe();\n        }\n    }\n\n    public getOverlayElement(): HTMLElement {\n        return this.overlayRef.overlayElement;\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { CurveFactory } from \"d3-shape\";\nimport { Subject } from \"rxjs\";\n\nimport { IRectangleAccessors } from \"./accessors/rectangle-accessors\";\nimport { BarRenderer } from \"./bar/bar-renderer\";\nimport { ILineAccessors } from \"./line/line-accessors\";\nimport { LineRenderer } from \"./line/line-renderer\";\nimport { Renderer } from \"../core/common/renderer\";\nimport { Scales } from \"../core/common/scales/types\";\nimport {\n    D3Selection,\n    IAccessors,\n    IDataSeries,\n    IRenderContainers,\n    IRendererConfig,\n    IRendererEventPayload,\n} from \"../core/common/types\";\n\nexport enum RenderState {\n    hidden = \"hidden\",\n    deemphasized = \"deemphasized\",\n    emphasized = \"emphasized\",\n    default = \"default\",\n}\n\nexport enum RenderLayerName {\n    background = \"background\",\n    data = \"data\",\n    unclippedData = \"unclipped-data\",\n    foreground = \"foreground\",\n}\n\n/** The configuration interface for marker interaction */\nexport interface IMarkerInteractionConfig {\n    /** Enables mouse events on data point markers */\n    enabled: boolean;\n    /** Enables the pointer style mouse cursor when data point markers are hovered */\n    clickable?: boolean;\n}\n\n/** The configuration interface for the enhanced line caps */\nexport interface IEnhancedLineCapConfig {\n    /** Set the stroke color */\n    stroke?: string;\n    /** Set the stroke width in pixels */\n    strokeWidth?: number;\n    /** Set the fill color */\n    fill?: string;\n    /** Set the radius in pixels */\n    radius?: number;\n}\n\n/** The configuration interface for the line renderer */\nexport interface ILineRendererConfig extends IRendererConfig {\n    /** Set the width of the line in pixels */\n    strokeWidth?: number;\n    /** Set the stroke-dasharray of the line, e.g. \"1,1\", \"2,2\", etc. */\n    strokeStyle?: string;\n    /** Set the stroke-linecap of the line, e.g. \"round\" */\n    strokeLinecap?: string;\n    /** Set the d3 curve algorithm to be used for drawing the lines */\n    curveType?: CurveFactory;\n    /** Set the strategy for determining the behavior of the chart resulting from user interaction, e.g. LineSelectSeriesInteractionStrategy */\n    interactionStrategy?: IHighlightStrategy<ILineAccessors, LineRenderer>;\n    /** Configure the interaction behavior for markers */\n    markerInteraction?: IMarkerInteractionConfig;\n    /** Set whether enhanced line caps should be displayed */\n    useEnhancedLineCaps?: boolean;\n    /** Optionally configure enhanced line caps. Prerequisite: 'useEnhancedLineCaps' is set to true */\n    enhancedLineCap?: IEnhancedLineCapConfig;\n}\n\n/** The configuration interface for the bar renderer */\nexport interface IBarRendererConfig extends IRendererConfig {\n    /** Set the padding on both sides of each bar */\n    padding?: number;\n    /** Set the class name to apply custom styles to the bars */\n    barClass?: string;\n    /** Set the strategy for determining the behavior of the chart resulting from user interaction, e.g. BarHighlightStrategy */\n    highlightStrategy?: IHighlightStrategy<IRectangleAccessors, BarRenderer>;\n    /** Set the mouse cursor style to use when hovering over individual bars */\n    cursor?: string;\n    /** Enables pointer events on the bars */\n    pointerEvents?: boolean;\n    /** Set the stroke width in pixels */\n    strokeWidth?: number;\n    /** Enable the minimum bar thickness (BarRenderer.MIN_BAR_THICKNESS) */\n    enableMinBarThickness?: boolean;\n}\n\n/** The configuration interface for the area renderer */\nexport interface IAreaRendererConfig extends IRendererConfig {\n    /** Set the d3 curve algorithm to be used for drawing the area boundaries */\n    curveType?: CurveFactory;\n    /** Set the class name to apply custom styles to the areas */\n    areaClass?: string;\n    /** Enables the pointer cursor when data point markers are hovered */\n    markerInteraction?: IMarkerInteractionConfig;\n    /** The width of the area path's stroke in pixels. Default is 1. */\n    strokeWidth?: number;\n}\n\nexport interface IRenderSeries<TA extends IAccessors> {\n    dataSeries: IDataSeries<TA>;\n    containers: IRenderContainers;\n    scales: Scales;\n    parentContainer?: D3Selection<SVGElement>;\n}\n\nexport interface IHighlightStrategy<\n    TA extends IAccessors<any>,\n    T = Renderer<TA>\n> {\n    getDataPointIndex(\n        renderer: T,\n        series: IDataSeries<TA>,\n        values: { [p: string]: any },\n        scales: Scales\n    ): number;\n\n    highlightDataPoint(\n        renderer: T,\n        renderSeries: IRenderSeries<TA>,\n        dataPointIndex: number,\n        rendererSubject: Subject<IRendererEventPayload>\n    ): void;\n\n    draw(\n        renderer: T,\n        renderSeries: IRenderSeries<TA>,\n        rendererSubject: Subject<IRendererEventPayload>\n    ): void;\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { InjectionToken } from \"@angular/core\";\n\nimport { IChartComponent, ILasagnaLayer } from \"./core/common/types\";\nimport { RenderLayerName } from \"./renderers/types\";\n\nexport const MOUSE_ACTIVE_EVENT = \"mouse_active\";\nexport const INTERACTION_VALUES_ACTIVE_EVENT = \"interaction_values_active\";\nexport const INTERACTION_VALUES_EVENT = \"interaction_values\";\nexport const INTERACTION_COORDINATES_EVENT = \"interaction_coordinates\";\nexport const HIGHLIGHT_DATA_POINT_EVENT = \"highlight_data_point\";\nexport const SELECT_DATA_POINT_EVENT = \"select_data_point\";\nexport const HIGHLIGHT_SERIES_EVENT = \"highlight_series\";\nexport const INTERACTION_SERIES_EVENT = \"interaction_series\";\nexport const INTERACTION_DATA_POINTS_EVENT = \"interaction_data_points\";\nexport const INTERACTION_DATA_POINT_EVENT = \"interaction_data_point\";\nexport const DESTROY_EVENT = \"destroy\";\nexport const SET_DOMAIN_EVENT = \"set_domain\";\nexport const REFRESH_EVENT = \"refresh\";\nexport const CHART_VIEW_STATUS_EVENT = \"chart_view_status\";\nexport const SERIES_STATE_CHANGE_EVENT = \"series_state_change\";\nexport const AXES_STYLE_CHANGE_EVENT = \"axes_style_change\";\n\n/** @ignore */\nexport const CHART_COMPONENT = new InjectionToken<IChartComponent>(\n    \"chart_component\"\n);\n\n/** @ignore */\nexport const STANDARD_RENDER_LAYERS: { [name: string]: ILasagnaLayer } = {\n    [RenderLayerName.background]: {\n        name: RenderLayerName.background,\n        order: 0,\n        clipped: true,\n    },\n    [RenderLayerName.data]: {\n        name: RenderLayerName.data,\n        order: 50,\n        clipped: true,\n    },\n    [RenderLayerName.unclippedData]: {\n        name: RenderLayerName.unclippedData,\n        // order is one greater than the data layer to ensure the unclipped data layer appears just after the data layer in the DOM\n        order: 51,\n        clipped: false,\n    },\n    [RenderLayerName.foreground]: {\n        name: RenderLayerName.foreground,\n        order: 1000,\n        clipped: false,\n    },\n};\n\n/** @ignore */\nexport const DATA_POINT_NOT_FOUND = -1;\n\n/** @ignore */\nexport const DATA_POINT_INTERACTION_RESET = -2;\n\n/** Use this class to prevent DOM elements from triggering mouse-interactive-area events */\nexport const IGNORE_INTERACTION_CLASS = \"ignore-interaction\";\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { AxisScale } from \"d3-axis\";\n\nimport { UnitOption } from \"@nova-ui/bits\";\n\nimport { IAccessors, IChartSeries } from \"../types\";\n\n/** Domain for series with empty or null data */\nexport const EMPTY_CONTINUOUS_DOMAIN = [0, 0];\n/** A reasonable non-data-driven domain for charts  */\nexport const NORMALIZED_DOMAIN = [0, 1];\n\n/** Signature for domain calculator */\nexport type DomainCalculator = (\n    chartSeriesSet: IChartSeries<IAccessors>[],\n    scaleId: string,\n    scale: IScale<any>\n) => any[];\n\n/** Signature for a specific domain calculator that rounds domain to the closes tick */\nexport interface IDomainWithTicksCalculator extends DomainCalculator {\n    domainWithTicks?: true;\n}\n\n/** Type guard for the domain calculator with ticks */\nexport function isDomainWithTicksCalculator(\n    obj: any\n): obj is IDomainWithTicksCalculator {\n    return !!obj.domainWithTicks;\n}\n\n/** Interface for scale formatters */\nexport interface IFormatters<T> {\n    /** Formatter for tick labels */\n    tick?: Formatter<T>;\n    /** Additional formatters */\n    [p: string]: Formatter<T> | undefined;\n}\n\n/** Signature for label formatters */\nexport type Formatter<T> = (value: T) => string;\n\n/** Dictionary of scale collections in index and array form */\nexport interface ScalesIndex {\n    [key: string]: {\n        /** Scale collection as an index */\n        index: { [scaleId: string]: IScale<any> };\n        /** Scale collection as an array */\n        list: IScale<any>[];\n    };\n}\n\n/** Dictionary of scales */\nexport type Scales = Record<string, IScale<any>>;\n\nexport interface IXYScales extends Scales {\n    x: IScale<any>;\n    y: IScale<any>;\n}\n\nexport interface IRadialScales extends Scales {\n    r: IScale<number>;\n}\n\n/** Interface for a scale */\nexport interface IScale<T> {\n    /** The scale identifier */\n    readonly id: string;\n    readonly d3Scale: AxisScale<T>; // TODO: maybe AxisScale is to narrow?\n    fixDomainValues?: T[];\n\n    /** If this flag is enabled, the domain of this scale is not recalculated */\n    isDomainFixed?: boolean;\n    /** Method used to calculate the scale's domain */\n    domainCalculator?: DomainCalculator;\n    /** The scales formatters */\n    formatters: IFormatters<T>;\n    /** If this flag is enabled, the domain has been recalculated with ticks in mind */\n    __domainCalculatedWithTicks?: boolean;\n    scaleUnits?: UnitOption;\n\n    /** If this flag is enabled, the label generated by InteractionLabelPlugin will be shown only on a chart that is beeing hovered */\n    isTimeseriesScale?: boolean;\n\n    /**\n     * Sets fix domain to the first and last value and assigns values to fixDomainValues property\n     */\n    setFixDomainValues?(values: T[]): void;\n\n    /**\n     * Determines if the scale's domain is continuous\n     *\n     * @returns {boolean} true if the scale's domain is continuous (numeric), false otherwise\n     */\n    isContinuous(): boolean;\n\n    /**\n     * Determines if the scale's domain is valid\n     *\n     * @returns {boolean} true if the scale's domain is valid, false otherwise\n     */\n    isDomainValid(): boolean;\n\n    /**\n     * Converts a value to its corresponding coordinate\n     *\n     * @param {T} value The value to be converted\n     * @returns {number} The coordinate corresponding to the specified value\n     */\n    convert(value: T): number;\n\n    /**\n     * Converts a coordinate to its corresponding value\n     *\n     * @param {number} coordinate The coordinate to be converted\n     * @returns {T} The value corresponding to the specified coordinate\n     */\n    invert(coordinate: number): T | undefined;\n\n    /**\n     * Gets the scale's range\n     *\n     * @returns {[number, number]} The scale's range\n     */\n    range(): [number, number];\n\n    /**\n     * Sets the scale's range\n     *\n     * @param {[number, number]} range The scale's new range\n     */\n    range(range: [number, number]): this;\n\n    /**\n     * Gets the scale's domain\n     *\n     * @returns {T[]} The scale's domain\n     */\n    domain(): T[];\n\n    /**\n     * Sets the scale's domain\n     *\n     * @param {T[]} domain The scale's new domain\n     */\n    domain(domain: T[]): this;\n\n    /**\n     * Shorthand method for setting the domain and isDomainFixed at once\n     *\n     * @param {T[]} domain The scale's fixed domain\n     */\n    fixDomain(domain: T[]): void;\n\n    /**\n     * Reverse the scale orientation by toggling the reversed flag\n     */\n    reverse(): this;\n\n    /**\n     * Getter for the reversed flag (see #reverse)\n     */\n    reversed(): boolean;\n\n    /**\n     * Setter for the reversed flag (see #reverse)\n     *\n     * @param reversed\n     */\n    reversed(reversed: boolean): this;\n}\n\nexport interface IBandScale<T> extends IScale<T> {\n    bandwidth(): number;\n}\n\nexport function isBandScale(scale: any): scale is IBandScale<any> {\n    return typeof scale.bandwidth === \"function\";\n}\n\nexport interface IHasInnerScale<T> extends IScale<T> {\n    innerScale: IScale<any>;\n}\n\nexport function hasInnerScale(scale: any): scale is IHasInnerScale<any> {\n    return typeof scale.innerScale !== \"undefined\";\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { extent, Numeric } from \"d3\";\nimport { Selection } from \"d3-selection\";\nimport { ValueMap } from \"d3-selection-multi\";\nimport defaultsDeep from \"lodash/defaultsDeep\";\nimport each from \"lodash/each\";\nimport get from \"lodash/get\";\nimport { Subject } from \"rxjs\";\n\nimport { DATA_POINT_NOT_FOUND, STANDARD_RENDER_LAYERS } from \"../../constants\";\nimport { EMPTY_CONTINUOUS_DOMAIN, IScale, Scales } from \"./scales/types\";\nimport {\n    D3Selection,\n    IAccessors,\n    IDataPoint,\n    IDataSeries,\n    ILasagnaLayer,\n    IPosition,\n    IRenderContainers,\n    IRendererConfig,\n    IRendererEventPayload,\n} from \"./types\";\nimport {\n    IRenderSeries,\n    RenderLayerName,\n    RenderState,\n} from \"../../renderers/types\";\n\n/**\n * The abstract base class for chart renderers with some limited default functionality\n */\n// For why the \"dynamic\" decorator is used see https://github.com/ng-packagr/ng-packagr/issues/641\n// @dynamic\nexport abstract class Renderer<TA extends IAccessors> {\n    public static readonly DEFAULT_CONFIG: IRendererConfig = {\n        stateStyles: {\n            [RenderState.default]: {\n                opacity: 1,\n            },\n            [RenderState.hidden]: {\n                opacity: 0,\n            },\n            [RenderState.deemphasized]: {\n                opacity: 0.1,\n            },\n            [RenderState.emphasized]: {\n                opacity: 1,\n            },\n        },\n    };\n\n    constructor(public config: IRendererConfig = {}) {\n        // setting default values to the properties that were not set by user\n        this.config = defaultsDeep(this.config, Renderer.DEFAULT_CONFIG);\n    }\n\n    public interaction: Record<string, any> = {};\n\n    /**\n     * Draw the visual representation of the provided data series\n     *\n     * @param {IRenderSeries} renderSeries The series to render\n     * @param {Subject<IRendererEventPayload>} rendererSubject A subject to optionally invoke for emitting events regarding a data point\n     */\n    public abstract draw(\n        renderSeries: IRenderSeries<TA>,\n        rendererSubject: Subject<IRendererEventPayload>\n    ): void;\n\n    /**\n     * Return position of a specified datapoint\n     *\n     * @param {IDataSeries} dataSeries\n     * @param {number} index\n     * @param {Scales} scales\n     * @returns {IPosition}\n     */\n    public abstract getDataPointPosition(\n        dataSeries: IDataSeries<TA>,\n        index: number,\n        scales: Scales\n    ): IPosition | undefined;\n\n    /**\n     * Based on provided values, return the nearest data point that the given coordinates represent. This is used for mouse hover behavior\n     *\n     * @param {IDataSeries} series series from which to determine the index corresponding to the specified values\n     * @param {{ [axis: string]: any }} values the values from which a data point index can be determined\n     * @param {Scales} scales the scales to be used in the index calculation\n     *\n     * @returns {number} negative value means that index is not found\n     */\n    public getDataPointIndex(\n        series: IDataSeries<TA>,\n        values: { [axis: string]: any },\n        scales: Scales\n    ): number {\n        return DATA_POINT_NOT_FOUND;\n    }\n\n    /**\n     * Highlight the data point corresponding to the specified data point index\n     *\n     * @param {IRenderSeries} renderSeries The series on which to render the data point highlight\n     * @param {number} dataPointIndex index of the highlighted point within the data series (pass -1 to remove the highlight marker)\n     * @param {Subject<IRendererEventPayload>} rendererSubject A subject to optionally invoke for emitting events regarding a data point\n     */\n    public highlightDataPoint(\n        renderSeries: IRenderSeries<TA>,\n        dataPointIndex: number,\n        rendererSubject: Subject<IRendererEventPayload>\n    ): void {}\n\n    /**\n     * Get the style attributes for the specified state that we need to apply to a series container\n     *\n     * @param {RenderState} state the state for which to retrieve container styles\n     *\n     * @returns {ValueMap<any, any>} the container styles for the specified state\n     */\n    public getContainerStateStyles = (\n        state: RenderState\n    ): ValueMap<any, any> => {\n        if (!this.config.stateStyles) {\n            throw new Error(\"stateStyles property is not defined\");\n        }\n        return this.config.stateStyles[state || RenderState.default];\n    };\n\n    /**\n     * Set the RenderState of the target data series\n     *\n     * @param {IRenderContainers} renderContainers the render containers of the series\n     * @param {RenderState} state The new state for the target series\n     */\n    public setSeriesState(\n        renderContainers: IRenderContainers,\n        state: RenderState\n    ): void {}\n\n    /**\n     * Set the RenderState of the target data point\n     *\n     * @param {D3Selection} target the target data point\n     * @param {RenderState} state The new state for the target data point\n     */\n    public setDataPointState(target: D3Selection, state: RenderState): void {}\n\n    /**\n     * Calculate domain for data filtered by given filterScales\n     *\n     * @param dataSeries\n     * @param filterScales\n     * @param scaleKey\n     * @param scale\n     * @returns array of datapoints from <code>dataSeries</code> filtered by domains of given <code>filterScale</code>s\n     */\n    public getDomainOfFilteredData(\n        dataSeries: IDataSeries<TA>,\n        filterScales: Record<string, IScale<any>>,\n        scaleKey: string,\n        scale: IScale<any>\n    ): any[] {\n        let filteredData = dataSeries.data;\n        for (const fixedScaleKey of Object.keys(filterScales)) {\n            const filterScale = filterScales[fixedScaleKey];\n            if (!filterScale.isDomainFixed || !filterScale.isContinuous()) {\n                continue;\n            }\n\n            filteredData = this.filterDataByDomain(\n                filteredData,\n                dataSeries,\n                fixedScaleKey,\n                filterScale.domain()\n            );\n        }\n\n        return this.getDomain(filteredData, dataSeries, scaleKey, scale);\n    }\n\n    /**\n     * Calculate the domain using the data of a series\n     *\n     * @param {any[]} data source data, can be filtered\n     * @param dataSeries related data series\n     * @param {string} scaleName name of the scale for which domain calculation is needed\n     * @param scale\n     *\n     * @returns {[any, any]} min and max values as an array\n     */\n    public getDomain(\n        data: any[],\n        dataSeries: IDataSeries<TA>,\n        scaleName: string,\n        scale: IScale<any>\n    ): any[] {\n        if (!data || data.length === 0) {\n            return EMPTY_CONTINUOUS_DOMAIN;\n        }\n\n        return extent<Numeric, Numeric>(data, (datum, index, arr) =>\n            dataSeries.accessors.data?.[scaleName]?.(\n                datum,\n                index,\n                Array.from(arr),\n                dataSeries\n            )\n        );\n    }\n\n    /**\n     * Filters given dataset by domain of provided scale\n     *\n     * @param data\n     * @param dataSeries\n     * @param scaleName\n     * @param domain\n     */\n    public filterDataByDomain(\n        data: any[],\n        dataSeries: IDataSeries<TA>,\n        scaleName: string,\n        domain: any[]\n    ): any[] {\n        const accessor = dataSeries.accessors.data?.[scaleName];\n\n        // if (isNil(accessor)) {\n        //     throw new Error(\"accessor is not defined\");\n        // }\n\n        return data.filter((d, i) => {\n            // @ts-ignore\n            const value = accessor(d, i, data, dataSeries);\n            return value >= domain[0] && value <= domain[1];\n        });\n    }\n\n    /**\n     * Get the definitions of lasagna layers required for visualizing data\n     *\n     * @returns {ILasagnaLayer[]} lasagna layer definitions\n     */\n    public getRequiredLayers(): ILasagnaLayer[] {\n        return [STANDARD_RENDER_LAYERS[RenderLayerName.data]];\n    }\n\n    protected setupInteraction(\n        path: string[],\n        nativeEvent: string,\n        target: Selection<any, any, any, any>,\n        dataPointSubject: Subject<IRendererEventPayload>,\n        dataPoint: Partial<IDataPoint>\n    ): void {\n        const eventList: string[] = get(this.interaction, path, {})[\n            nativeEvent\n        ];\n        if (!eventList) {\n            return;\n        }\n\n        each(eventList, (targetEvent: string) => {\n            target.on(nativeEvent, () => {\n                const bbox = target.node().getBoundingClientRect();\n                dataPointSubject.next({\n                    eventName: targetEvent,\n                    data: <IDataPoint>{\n                        ...dataPoint,\n                        position: bbox,\n                    },\n                });\n            });\n        });\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { ScaleLinear } from \"d3-scale\";\nimport { Selection } from \"d3-selection\";\nimport { ValueMap } from \"d3-selection-multi\";\n\nimport { ChartPlugin } from \"./chart-plugin\";\nimport { DataManager } from \"./data-manager\";\nimport { EventBus } from \"./event-bus\";\nimport { RenderEngine } from \"./render-engine\";\nimport { Renderer } from \"./renderer\";\nimport { Scales } from \"./scales/types\";\nimport { StandardGaugeThresholdMarkerRadius } from \"../../gauge/constants\";\nimport { RenderState } from \"../../renderers/types\";\nimport { IGrid } from \"../grid/types\";\n\n/**\n * Short-form alias for the most commonly used generic D3 Selection type\n */\nexport type D3Selection<T extends SVGElement = SVGElement> = Selection<\n    T,\n    any,\n    SVGElement,\n    any\n>;\n\n/**\n * Signature for data accessors\n *\n * @param d data point\n * @param i index\n * @param series the whole data series\n */\nexport type DataAccessor<D = any, T = any> = (\n    d: D,\n    i: number,\n    series: D[],\n    dataSeries: IDataSeries<IAccessors>\n) => T;\n\n/**\n * Signature for series accessors\n */\nexport type SeriesAccessor = (\n    seriesId: string,\n    series: IDataSeries<IAccessors>\n) => any;\n\n/** @ignore */\nexport interface ILasagnaLayer {\n    name: string;\n    order: number;\n    clipped: boolean;\n}\n\n/** Mouse interaction types */\nexport enum InteractionType {\n    /** Indicates that an element has been clicked */\n    Click = \"click\",\n    /** Indicates that an element is hovered */\n    Hover = \"hover\",\n    /** Indicates a 'mousedown' event */\n    MouseDown = \"mousedown\",\n    /** Indicates that the mouse has entered the bounds of an element */\n    MouseEnter = \"mouseenter\",\n    /** Indicates that the mouse has left the bounds of an element */\n    MouseLeave = \"mouseleave\",\n    /** Indicates a movement of the mouse across the chart */\n    MouseMove = \"mousemove\",\n    /** Indicates a 'mouseup' event */\n    MouseUp = \"mouseup\",\n}\n\n/** @ignore */\nexport interface ICoordinates {\n    x: number;\n    y: number;\n}\n\n/** @ignore */\nexport interface IInteractionEvent {\n    type: InteractionType;\n    coordinates: ICoordinates;\n}\n\n/**\n * Information about the render state of a series\n */\nexport interface IRenderStateData {\n    /** Series identifier */\n    seriesId: string;\n    /** Series render state */\n    state: RenderState;\n    /** Series */\n    series?: IChartSeries<IAccessors>;\n}\n\n/** @ignore */\nexport interface IDomainLimits<T> {\n    min: T;\n    max: T;\n}\n\nexport interface IRendererConfig {\n    stateStyles?: Record<RenderState, ValueMap<any, any>>;\n    transitionDuration?: number;\n    interactive?: boolean;\n    /** Excludes series from scale domain calculations */\n    ignoreForDomainCalculation?: boolean;\n}\n\nexport interface IRadialRendererConfig extends IRendererConfig {\n    annularWidth?: number;\n    annularPadding?: number;\n    /** annularGrowth is a percentage value to define annular width automatically.\n     *  It will grow until it reaches maxThickness.\n     *  Set one to 0 to use annularWidth constant value instead */\n    maxThickness?: number;\n    annularGrowth?: number;\n    cursor?: string;\n    strokeWidth?: number;\n    enableSeriesHighlighting?: boolean;\n    enableDataPointHighlighting?: boolean;\n}\n\n/**\n * Standard configuration for gauge threshold renderers\n */\nexport interface IGaugeThresholdsRendererConfig {\n    /** The radius of each threshold marker */\n    markerRadius?: StandardGaugeThresholdMarkerRadius | number;\n    /** Boolean indicating whether the renderer is enabled */\n    enabled?: boolean;\n}\n\n/**\n * Configuration for the DonutGaugeThresholdsRenderer\n */\nexport interface IDonutGaugeThresholdsRendererConfig\n    extends IRadialRendererConfig,\n        IGaugeThresholdsRendererConfig {}\n\n/**\n * Configuration for the LinearGaugeThresholdsRenderer\n */\nexport interface ILinearGaugeThresholdsRendererConfig\n    extends IRendererConfig,\n        IGaugeThresholdsRendererConfig {}\n\nexport interface ILinearScales {\n    x: ScaleLinear<number, number>;\n    y: ScaleLinear<number, number>;\n}\n\nexport interface IDataAccessors<D = any> {\n    [key: string]: DataAccessor<D> | undefined;\n}\n\nexport interface ISeriesAccessors {\n    [key: string]: SeriesAccessor | undefined;\n}\n\n/**\n * Accessors describe the data for the consumers.\n */\nexport interface IAccessors<D = any> {\n    /** Data point level accessors for defining what part of a datum is used for visualizations */\n    data?: IDataAccessors<D>;\n    /** Series level accessors - e.g. for colors, markers, etc. */\n    series?: ISeriesAccessors;\n}\n\n/**\n * A set of data to visualize on the chart\n */\nexport interface IDataSeries<A extends IAccessors<D>, D = any> {\n    /** The series identifier */\n    id: string;\n    /**\n     * The series data. It is an array of arbitrary objects, the structure of which is prescribed by the consumer of this data series. Specific\n     * renderers require specific accessor keys that are used to access values on data points. The renderers and other consumers rarely access\n     * data point properties directly, but usually through accessors.\n     */\n    data: D[];\n    /** Accessors describing the data */\n    accessors: A;\n\n    /** Allow any properties to be stored on this object to facilitate the transfer of data from APIs */\n    [key: string]: any;\n}\n\n/**\n * The set of elements required for a chart to visualize some data\n */\nexport interface IChartSeries<A extends IAccessors> extends IDataSeries<A> {\n    /** The renderer to be used for visualizing the data */\n    renderer: Renderer<A>;\n    /**\n     * Information about how chart data should conform to the drawable area.\n     * Grids expect certain scale keys to be used depending on the type of grid, for example an x-y grid\n     * uses 'x' and 'y' as the keys for its scales.\n     */\n    scales: Scales;\n    /**\n     * Represents an emphasis/visibility state of this series\n     */\n    renderState?: RenderState;\n}\n\nexport interface IChartAssistSeries<A extends IAccessors>\n    extends IChartSeries<A> {\n    /**\n     * Whether this series should be shown in the legend\n     */\n    showInLegend?: boolean;\n    /**\n     * Whether this series should be preprocessed in the chart assist\n     */\n    preprocess?: boolean;\n}\n\nexport interface IChartMarker {\n    getSvg(): string;\n    setColor(color: string): void;\n}\n\nexport interface IChart {\n    target?: D3Selection<SVGSVGElement>;\n    configuration?: IChartConfiguration;\n    getEventBus(): EventBus<IChartEvent>;\n    getDataManager(): DataManager;\n    getRenderEngine(): RenderEngine;\n    getGrid(): IGrid;\n    addPlugin(plugin: IChartPlugin): void;\n    removePlugin?(classRef: typeof ChartPlugin): void;\n    build(element: HTMLElement): void;\n    update(seriesSet: IChartSeries<IAccessors>[]): void;\n    updateDimensions(): void;\n    setSeriesStates(renderStateData: IRenderStateData[]): void;\n    destroy(): void;\n}\n\nexport interface IChartConfiguration {\n    updateDomainForEmptySeries?: boolean;\n}\n\n/** @ignore */\nexport interface IChartComponent {\n    chart: IChart;\n}\n\n/** Interface defining a chart plugin */\nexport interface IChartPlugin {\n    /**\n     * Associated chart - set automatically on chart initialization\n     */\n    chart: IChart;\n\n    /** Initialize the plugin - Invoked automatically on chart initialization */\n    initialize(): void;\n\n    /** Update the plugin - Invoked automatically on chart update */\n    update(): void;\n\n    /** Update the plugin's dimensions - Invoked automatically on update of the chart's dimensions */\n    updateDimensions(): void;\n\n    /** Perform plugin cleanup - Invoked automatically on chart destruction */\n    destroy(): void;\n}\n\nexport interface IChartEvent<T = any> {\n    broadcast?: boolean;\n    data: T;\n}\n\n/** @ignore */\nexport interface IChartCollectionEvent {\n    chartIndex: string;\n    event: IChartEvent;\n}\n\n/**\n * Dictionary of render container name to render container\n */\nexport interface IRenderContainers {\n    /** Container name as key to render container */\n    [name: string]: D3Selection<SVGGElement>;\n}\n\n/**\n * Position on the chart\n */\nexport interface IPosition {\n    x: number;\n    y: number;\n    width?: number;\n    height?: number;\n}\n\n/**\n * A point at which a data series enters or exits a threshold zone\n */\nexport interface IZoneCrossPoint extends IPosition {\n    /** Indicates whether the cross point is on the edge of a threshold zone */\n    isZoneEdge?: boolean;\n}\n\n/**\n * Information about a data point\n */\nexport interface IDataPoint {\n    /** Series identifier */\n    seriesId: string;\n    /** Series */\n    dataSeries: IDataSeries<IAccessors>;\n    /** Data index */\n    index: number;\n    /** Data */\n    data: any;\n    /** Position */\n    position?: IPosition;\n}\n\n/**\n * Payload for the chart's visibility status in relation to the nearest scrollable parent\n */\nexport interface IChartViewStatusEventPayload {\n    /**\n     * Indicates whether at least one pixel of the chart's parent element has\n     * intersected with the visible area of its nearest scrollable parent\n     */\n    isChartInView: boolean;\n}\n\n/**\n * Payload for events regarding a data point\n */\nexport interface IRendererEventPayload<T = any> {\n    /** Name of the event */\n    eventName: string;\n    /** Information about the data point */\n    data: T;\n}\n\n/**\n * Collection of one or more data points as a dictionary of seriesId to IDataPoint\n */\nexport interface IDataPointsPayload {\n    /** Series id as key to highlighted data point */\n    [seriesId: string]: IDataPoint;\n}\n\n/**\n * Payload for interaction events\n */\nexport interface IInteractionPayload {\n    interactionType: InteractionType;\n}\n\n/**\n * Payload for interaction events regarding a single data point\n */\nexport interface IInteractionDataPointEvent extends IInteractionPayload {\n    dataPoint: IDataPoint;\n}\n\n/**\n * Payload for axes style change when emphasizing series on grid\n */\nexport type IAxesStyleChangeEventPayload = Record<string, Record<string, any>>;\n\n/**\n * Payload for interaction events regarding one or more data points\n */\nexport interface IInteractionDataPointsEvent extends IInteractionPayload {\n    dataPoints: IDataPointsPayload;\n}\n\nexport interface ISetDomainEventPayload {\n    [scaleId: string]: any[];\n}\n\nexport interface IValueProvider<T> {\n    get(entityId: string): T | undefined;\n    reset(): void;\n}\n\nexport interface IChartPalette {\n    readonly standardColors: IValueProvider<string>;\n    readonly backgroundColors: IValueProvider<string>;\n    readonly textColors: IValueProvider<string>;\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { Arc, arc, DefaultArcObject } from \"d3-shape\";\nimport defaultsDeep from \"lodash/defaultsDeep\";\nimport isUndefined from \"lodash/isUndefined\";\nimport { Subject } from \"rxjs\";\n\nimport {\n    DATA_POINT_NOT_FOUND,\n    HIGHLIGHT_DATA_POINT_EVENT,\n    HIGHLIGHT_SERIES_EVENT,\n    INTERACTION_DATA_POINTS_EVENT,\n    SELECT_DATA_POINT_EVENT,\n} from \"../../constants\";\nimport { Renderer } from \"../../core/common/renderer\";\nimport { Scales } from \"../../core/common/scales/types\";\nimport {\n    IDataPoint,\n    IDataSeries,\n    InteractionType,\n    IPosition,\n    IRadialRendererConfig,\n    IRendererEventPayload,\n} from \"../../core/common/types\";\nimport { IRenderSeries, RenderLayerName } from \"../types\";\nimport { IRadialAccessors } from \"./accessors/radial-accessors\";\n\n/**\n * Default configuration for Radial Renderer\n */\nexport const DEFAULT_RADIAL_RENDERER_CONFIG: IRadialRendererConfig = {\n    annularWidth: 20,\n    annularPadding: 5,\n    maxThickness: 30,\n    annularGrowth: 0.15,\n    cursor: \"default\",\n    enableSeriesHighlighting: true,\n    enableDataPointHighlighting: true,\n};\n\n/**\n * Radial renderer is a generic renderer that is able to draw pie and donut charts\n */\nexport class RadialRenderer extends Renderer<IRadialAccessors> {\n    protected segmentWidth?: number;\n\n    /**\n     * Creates an instance of RadialRenderer.\n     * @param {IRadialRendererConfig} [config]\n     * Renderer configuration object. Defaults to `DEFAULT_RADIAL_RENDERER_CONFIG` constant value.\n     */\n    constructor(public config: IRadialRendererConfig = {}) {\n        super(config);\n        this.config = defaultsDeep(this.config, DEFAULT_RADIAL_RENDERER_CONFIG);\n    }\n\n    /** See {@link Renderer#draw} */\n    public draw(\n        renderSeries: IRenderSeries<IRadialAccessors>,\n        rendererSubject: Subject<IRendererEventPayload>\n    ): void {\n        const dataContainer = renderSeries.containers[RenderLayerName.data];\n\n        const data = renderSeries.dataSeries.data;\n        const accessors = renderSeries.dataSeries.accessors;\n\n        // TODO: This handles several data points withing one series as well. Most probably this can be abstracted to other renderer\n        const arcGenerator = (d: any, index: number) => {\n            const separateArc = this.getArc(\n                renderSeries.scales.r.range(),\n                arc(),\n                index\n            );\n            return separateArc(d);\n        };\n        this.segmentWidth = this.getSegmentWidth(renderSeries);\n\n        const g: any = dataContainer.selectAll(\"path.arc\").data(data);\n\n        g.exit().remove();\n\n        g.enter()\n            .append(\"path\")\n            .attr(\"class\", \"arc pointer-events nui-chart--path__outline\")\n            .style(\"stroke-width\", this.config.strokeWidth)\n            .style(\"cursor\", this.config.cursor)\n            .on(\"mouseenter\", (d: any, i: number) => {\n                this.emitDataPointHighlight(\n                    renderSeries,\n                    d,\n                    i,\n                    rendererSubject\n                );\n            })\n            .on(\"mouseleave\", (d: any, i: number) => {\n                this.emitDataPointHighlight(\n                    renderSeries,\n                    null,\n                    DATA_POINT_NOT_FOUND,\n                    rendererSubject\n                );\n            })\n            // TODO: testing event, remove in favor or generic interaction setup\n            .on(\"click\", (d: any, i: number) => {\n                rendererSubject.next({\n                    eventName: SELECT_DATA_POINT_EVENT,\n                    data: {\n                        seriesId: renderSeries.dataSeries.id,\n                        index: i,\n                        data: d.data,\n                        position: this.getDataPointPosition(\n                            renderSeries.dataSeries,\n                            i,\n                            renderSeries.scales\n                        ),\n                    },\n                });\n            })\n            .merge(g)\n            .attr(\"d\", arcGenerator)\n            .attr(\"fill\", (d: any, i: number) =>\n                accessors.data.color\n                    ? accessors.data.color(\n                          d.data,\n                          i,\n                          data,\n                          renderSeries.dataSeries\n                      )\n                    : accessors.series.color?.(\n                          renderSeries.dataSeries.id,\n                          renderSeries.dataSeries\n                      )\n            );\n    }\n\n    /** See {@link Renderer#getDataPointPosition} */\n    public getDataPointPosition(\n        dataSeries: IDataSeries<IRadialAccessors>,\n        index: number,\n        scales: Scales\n    ): IPosition | undefined {\n        if (index < 0) {\n            return undefined;\n        }\n        const pieArcData: DefaultArcObject = dataSeries.data[index];\n        const dataPointArc = this.getArc(scales.r.range(), arc(), index);\n        const centroid = dataPointArc.centroid(pieArcData);\n\n        return {\n            x: centroid[0],\n            y: centroid[1],\n            width: 0,\n            height: 0,\n        };\n    }\n\n    public getInnerRadius(range: number[], index: number): number {\n        if (\n            isUndefined(this.segmentWidth) ||\n            isUndefined(this.config.annularPadding)\n        ) {\n            throw new Error(\"Can't compute inner radius\");\n        }\n\n        const calculatedRadius =\n            range[1] -\n            range[0] -\n            this.segmentWidth -\n            index * (this.config.annularPadding + this.segmentWidth);\n        return calculatedRadius >= 0 ? calculatedRadius : 0;\n    }\n\n    public getOuterRadius(range: [number, number], index: number): number {\n        if (\n            isUndefined(this.segmentWidth) ||\n            isUndefined(this.config.annularPadding)\n        ) {\n            throw new Error(\"Can't compute outer radius\");\n        }\n\n        const calculatedRadius =\n            range[1] -\n            range[0] -\n            index * (this.config.annularPadding + this.segmentWidth);\n        return calculatedRadius >= 0 ? calculatedRadius : 0;\n    }\n\n    protected getArc(\n        range: [number, number],\n        generatedArc: Arc<any, DefaultArcObject>,\n        index: number\n    ): Arc<any, DefaultArcObject> {\n        const innerRadius = this.getInnerRadius(range, index);\n        return generatedArc\n            .outerRadius(this.getOuterRadius(range, index))\n            .innerRadius(innerRadius);\n    }\n\n    protected getSegmentWidth(\n        renderSeries: IRenderSeries<IRadialAccessors>\n    ): number | undefined {\n        if (!(this.config.maxThickness && this.config.annularGrowth)) {\n            return this.config.annularWidth;\n        }\n        return Math.min(\n            (renderSeries.scales.r.range()[1] -\n                renderSeries.scales.r.range()[0]) *\n                this.config.annularGrowth,\n            this.config.maxThickness\n        );\n    }\n\n    private emitDataPointHighlight(\n        renderSeries: IRenderSeries<IRadialAccessors>,\n        data: any,\n        i: number,\n        rendererSubject: Subject<IRendererEventPayload>\n    ) {\n        const position: IPosition | undefined = this.getDataPointPosition(\n            renderSeries.dataSeries,\n            i,\n            renderSeries.scales\n        );\n\n        const dataPoint: IDataPoint = {\n            seriesId: renderSeries.dataSeries.id,\n            dataSeries: renderSeries.dataSeries,\n            index: i,\n            data: data,\n            position: position,\n        };\n\n        if (this.config.enableSeriesHighlighting) {\n            rendererSubject.next({\n                eventName: HIGHLIGHT_SERIES_EVENT,\n                data: dataPoint,\n            });\n        }\n\n        if (this.config.enableDataPointHighlighting) {\n            rendererSubject.next({\n                eventName: HIGHLIGHT_DATA_POINT_EVENT,\n                data: dataPoint,\n            });\n        }\n\n        // we're emitting this event manually, because it's not triggered by mouse interactive area in this case\n        rendererSubject.next({\n            eventName: INTERACTION_DATA_POINTS_EVENT,\n            data: {\n                interactionType: InteractionType.MouseMove,\n                dataPoints: {\n                    [renderSeries.dataSeries.id]: dataPoint,\n                },\n            },\n        });\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { IChart, IChartPlugin } from \"./types\";\n\nexport abstract class ChartPlugin implements IChartPlugin {\n    constructor() {}\n\n    public chart: IChart;\n\n    public initialize(): void {}\n\n    public update(): void {}\n\n    public updateDimensions(): void {}\n\n    public destroy(): void {}\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport isUndefined from \"lodash/isUndefined\";\nimport { Subject } from \"rxjs\";\n\nimport { IElementPosition } from \"./types\";\nimport { RadialRenderer } from \"../../renderers/radial/radial-renderer\";\nimport { ChartPlugin } from \"../common/chart-plugin\";\n\n/**\n * This plugin calculates new size and position for content inside donut chart\n */\nexport class ChartDonutContentPlugin extends ChartPlugin {\n    /** Subject for getting updates on the content position */\n    public contentPositionUpdateSubject = new Subject<IElementPosition>();\n\n    /** The current content position */\n    public contentPosition: IElementPosition = {\n        top: 0,\n        left: 0,\n        width: 0,\n        height: 0,\n    };\n\n    public updateDimensions(): void {\n        const radius = this.chart\n            .getDataManager()\n            .chartSeriesSet.reduce((prev: number | undefined, current) => {\n                if (\n                    current.renderer instanceof RadialRenderer &&\n                    !isUndefined(prev)\n                ) {\n                    return Math.min(\n                        prev,\n                        current.renderer.getInnerRadius(\n                            current.scales.r.range(),\n                            current.data.length - 1\n                        )\n                    );\n                }\n                return prev;\n            }, Infinity);\n\n        if (isUndefined(radius)) {\n            throw new Error(\"Radius is undefined\");\n        }\n\n        this.contentPosition = this.getContentPosition(radius);\n        this.contentPositionUpdateSubject.next(this.contentPosition);\n    }\n\n    public destroy(): void {\n        this.contentPositionUpdateSubject.complete();\n    }\n\n    private getContentPosition(areaSize: number): IElementPosition {\n        const basics = [\n            this.chart.getGrid().config().dimension.outerHeight() / 2,\n            this.chart.getGrid().config().dimension.outerWidth() / 2,\n        ];\n        return {\n            top: basics[0] - areaSize / Math.sqrt(2),\n            left: basics[1] - areaSize / Math.sqrt(2),\n            width: areaSize * Math.sqrt(2),\n            height: areaSize * Math.sqrt(2),\n        };\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport {\n    Component,\n    Input,\n    OnChanges,\n    OnDestroy,\n    SimpleChanges,\n} from \"@angular/core\";\nimport { Subscription } from \"rxjs\";\n\nimport { ChartDonutContentPlugin } from \"../core/plugins/chart-donut-content-plugin\";\nimport { IElementPosition } from \"../core/plugins/types\";\n\n@Component({\n    selector: \"nui-chart-donut-content\",\n    templateUrl: \"./chart-donut-content.component.html\",\n    styleUrls: [\"./chart-donut-content.component.less\"],\n    standalone: false,\n})\nexport class ChartDonutContentComponent implements OnDestroy, OnChanges {\n    /** The plugin instance */\n    @Input() public plugin: ChartDonutContentPlugin;\n\n    /** The current content position */\n    public contentPosition: IElementPosition;\n\n    private contentPositionUpdateSubscription: Subscription;\n\n    public ngOnChanges(changes: SimpleChanges): void {\n        if (changes.plugin) {\n            this.contentPositionUpdateSubscription?.unsubscribe();\n\n            this.contentPositionUpdateSubscription =\n                this.plugin.contentPositionUpdateSubject.subscribe(\n                    (contentPosition: IElementPosition) => {\n                        this.contentPosition = contentPosition;\n                    }\n                );\n\n            this.plugin.chart.updateDimensions();\n        }\n    }\n\n    public ngOnDestroy(): void {\n        if (this.contentPositionUpdateSubscription) {\n            this.contentPositionUpdateSubscription.unsubscribe();\n        }\n    }\n}\n","<div\n    *ngIf=\"plugin && contentPosition\"\n    class=\"nui-chart-donut-content d-flex justify-content-center align-items-center text-center\"\n    [style.top.px]=\"contentPosition.top\"\n    [style.left.px]=\"contentPosition.left\"\n    [style.height.px]=\"contentPosition.height\"\n    [style.width.px]=\"contentPosition.width\"\n>\n    <ng-content></ng-content>\n</div>\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { ConnectedPosition } from \"@angular/cdk/overlay\";\nimport each from \"lodash/each\";\nimport pickBy from \"lodash/pickBy\";\nimport values from \"lodash/values\";\nimport { Subject } from \"rxjs\";\nimport { takeUntil } from \"rxjs/operators\";\n\nimport {\n    CHART_VIEW_STATUS_EVENT,\n    INTERACTION_DATA_POINTS_EVENT,\n    SERIES_STATE_CHANGE_EVENT,\n} from \"../../../constants\";\nimport { RenderState } from \"../../../renderers/types\";\nimport { ChartPlugin } from \"../../common/chart-plugin\";\nimport {\n    IAccessors,\n    IChartEvent,\n    IChartSeries,\n    IChartViewStatusEventPayload,\n    IDataPoint,\n    IDataPointsPayload,\n    InteractionType,\n    IPosition,\n    IRenderStateData,\n} from \"../../common/types\";\n\n/** Position with extended information for positioning a tooltip */\nexport interface ITooltipPosition extends IPosition {\n    overlayPositions: ConnectedPosition[];\n}\n\n/** How far away from the data point position will the tooltip be positioned */\nexport const TOOLTIP_POSITION_OFFSET = 10;\n\n/** @ignore\n * Used for charts where tooltips should be placed aside of some vertical line */\nexport const getVerticalSetup = (offset: number): ConnectedPosition[] => [\n    {\n        originX: \"end\",\n        originY: \"top\",\n        overlayX: \"start\",\n        overlayY: \"center\",\n        offsetX: offset,\n    },\n    {\n        originX: \"start\",\n        originY: \"center\",\n        overlayX: \"end\",\n        overlayY: \"center\",\n        offsetX: -offset,\n    },\n];\n\n/** @ignore\n * Used for charts where tooltips should be placed aligned to some horizontal line (as Horizontal Bar Charts) */\nexport const getHorizontalSetup = (offset: number): ConnectedPosition[] => [\n    {\n        originX: \"end\",\n        originY: \"top\",\n        overlayX: \"center\",\n        overlayY: \"bottom\",\n        offsetY: -offset,\n    },\n    {\n        originX: \"end\",\n        originY: \"bottom\",\n        overlayX: \"center\",\n        overlayY: \"top\",\n        offsetY: offset,\n    },\n];\n\n/**\n * This plugin listens to the INTERACTION_DATA_POINTS_EVENT and transforms received data into tooltips inputs.\n * The actual tooltips are handled by the ChartTooltipsComponent.\n */\nexport class ChartTooltipsPlugin extends ChartPlugin {\n    /** Highlighted data points received from the chart */\n    public dataPoints: IDataPointsPayload;\n    /** Calculated positions for the data point tooltips */\n    public dataPointPositions: { [stringId: string]: ITooltipPosition } = {};\n\n    /**\n     * This publishes an event to show tooltips\n     */\n    public showSubject = new Subject<void>();\n\n    /**\n     * This publishes an event to hide tooltips\n     */\n    public hideSubject = new Subject<void>();\n\n    protected overlaySetup: ConnectedPosition[];\n\n    private isChartInView = false;\n    private readonly destroy$ = new Subject<void>();\n    private seriesVisibilityMap: Record<string, boolean> = {};\n\n    /**\n     * @param tooltipPositionOffset Offset of a tooltip from edge of a highlighted element\n     * @param orientation\n     */\n    constructor(\n        readonly tooltipPositionOffset: number = TOOLTIP_POSITION_OFFSET,\n        public orientation: \"right\" | \"top\" = \"right\"\n    ) {\n        super();\n\n        if (orientation === \"right\") {\n            this.overlaySetup = getVerticalSetup(tooltipPositionOffset);\n        } else if (orientation === \"top\") {\n            this.overlaySetup = getHorizontalSetup(tooltipPositionOffset);\n        }\n    }\n\n    public initialize(): void {\n        this.chart\n            .getEventBus()\n            .getStream(INTERACTION_DATA_POINTS_EVENT)\n            .pipe(takeUntil(this.destroy$))\n            .subscribe((event: IChartEvent) => {\n                if (\n                    event.data.interactionType === InteractionType.MouseMove &&\n                    this.isChartInView\n                ) {\n                    const dataPoints: IDataPointsPayload =\n                        event.data.dataPoints;\n                    this.processHighlightedDataPoints(dataPoints);\n                }\n            });\n\n        this.chart\n            .getEventBus()\n            .getStream(SERIES_STATE_CHANGE_EVENT)\n            .pipe(takeUntil(this.destroy$))\n            .subscribe((event: IChartEvent<IRenderStateData[]>) => {\n                event.data.forEach((series) => {\n                    this.seriesVisibilityMap[series.seriesId] =\n                        series.state !== RenderState.hidden;\n                });\n            });\n\n        this.chart\n            .getEventBus()\n            .getStream(CHART_VIEW_STATUS_EVENT)\n            .pipe(takeUntil(this.destroy$))\n            .subscribe((event: IChartEvent<IChartViewStatusEventPayload>) => {\n                this.isChartInView = event.data.isChartInView;\n                if (!this.isChartInView) {\n                    this.hideSubject.next();\n                }\n            });\n    }\n\n    public destroy(): void {\n        this.destroy$.next();\n        this.destroy$.complete();\n    }\n\n    public processHighlightedDataPoints(dataPoints: IDataPointsPayload): void {\n        const validDataPoints = pickBy(\n            dataPoints,\n            (d: IDataPoint) =>\n                d.index >= 0 &&\n                d.position &&\n                this.seriesVisibilityMap[d.seriesId] !== false\n        );\n\n        if (values(validDataPoints).length === 0) {\n            this.hideSubject.next();\n            return;\n        }\n\n        this.dataPoints = validDataPoints;\n        const chartElement: any = this.chart.target?.node()?.parentNode; // the one above svg\n\n        if (!chartElement) {\n            throw new Error(\"Chart parent node is not defined\");\n        }\n\n        const bbox = chartElement.getBoundingClientRect();\n        const offsetParentBbox =\n            chartElement.offsetParent.getBoundingClientRect();\n        const chartPosition: IPosition = {\n            x: bbox.left - offsetParentBbox.left,\n            y: bbox.top - offsetParentBbox.top,\n        };\n\n        each(Object.keys(this.dataPoints), (seriesId) => {\n            const dataPoint = this.dataPoints[seriesId];\n\n            const chartSeries = this.chart\n                .getDataManager()\n                .getChartSeries(dataPoint.seriesId);\n            const tooltipRelativePosition = this.getTooltipPosition(\n                dataPoint,\n                chartSeries\n            );\n            this.dataPointPositions[seriesId] = this.getAbsolutePosition(\n                tooltipRelativePosition,\n                chartPosition\n            );\n        });\n\n        this.showSubject.next();\n    }\n\n    /**\n     * Calculate tooltip position. Default implementation shows the tooltip on left / right with\n     * @param dataPoint\n     * @param chartSeries\n     */\n    protected getTooltipPosition(\n        dataPoint: IDataPoint,\n        chartSeries: IChartSeries<IAccessors>\n    ): ITooltipPosition {\n        if (!dataPoint.position) {\n            throw new Error(\"Unable to get tooltip position\");\n        }\n\n        return {\n            x: dataPoint.position.x,\n            y: dataPoint.position.y,\n            height: dataPoint.position?.height || 1,\n            width: dataPoint.position?.width || 1,\n            overlayPositions: this.overlaySetup,\n        };\n    }\n\n    /**\n     * Converts the relative position within a chart into an absolute position on the screen\n     *\n     * @param relativePosition\n     * @param chartPosition\n     */\n    protected getAbsolutePosition(\n        relativePosition: ITooltipPosition,\n        chartPosition: IPosition\n    ): ITooltipPosition {\n        return Object.assign({}, relativePosition, {\n            x:\n                chartPosition.x +\n                this.chart.getGrid().config().dimension.margin.left +\n                relativePosition.x,\n            y:\n                chartPosition.y +\n                this.chart.getGrid().config().dimension.margin.top +\n                relativePosition.y,\n        });\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport {\n    ChangeDetectorRef,\n    Component,\n    ElementRef,\n    Input,\n    OnChanges,\n    OnDestroy,\n    QueryList,\n    SimpleChanges,\n    ViewChildren,\n} from \"@angular/core\";\nimport {\n    forceCollide,\n    forceSimulation,\n    Simulation,\n    SimulationNodeDatum,\n} from \"d3\";\nimport { select } from \"d3\";\nimport each from \"lodash/each\";\nimport isEqual from \"lodash/isEqual\";\nimport isNil from \"lodash/isNil\";\nimport { Subject } from \"rxjs\";\nimport { takeUntil } from \"rxjs/operators\";\n\nimport { ChartTooltipDirective } from \"./chart-tooltip.directive\";\nimport { IPosition } from \"../core/common/types\";\nimport { ChartTooltipsPlugin } from \"../core/plugins/tooltips/chart-tooltips-plugin\";\n\ninterface ITooltipNode extends SimulationNodeDatum {\n    seriesId: string;\n    radius: number;\n}\n\n@Component({\n    selector: \"nui-chart-tooltips\",\n    templateUrl: \"./chart-tooltips.component.html\",\n    styleUrls: [\"./chart-tooltips.component.less\"],\n    standalone: false,\n})\nexport class ChartTooltipsComponent implements OnChanges, OnDestroy {\n    @Input() plugin: ChartTooltipsPlugin;\n\n    @Input() template: ElementRef;\n\n    @ViewChildren(ChartTooltipDirective)\n    tooltips: QueryList<ChartTooltipDirective>;\n\n    public openTooltips = new Subject<void>();\n    public closeTooltips = new Subject<void>();\n\n    private unsubscribe$ = new Subject<void>();\n    private simulation: Simulation<ITooltipNode, undefined>;\n    // index we use for fast access of tooltip directives by seriesId\n    private tooltipDirectivesIndex: {\n        [seriesId: string]: ChartTooltipDirective;\n    } = {};\n    private closePending = false;\n    private isOpen = false;\n    private openTimeout: number;\n    private collisionTimeout: number;\n    private closeTimeout: number;\n\n    constructor(private changeDetector: ChangeDetectorRef) {}\n\n    public ngOnChanges(changes: SimpleChanges): void {\n        if (!(changes[\"plugin\"] && changes[\"plugin\"].currentValue)) {\n            return;\n        }\n\n        this.unsubscribe$.next();\n\n        this.plugin.showSubject\n            .pipe(takeUntil(this.unsubscribe$))\n            .subscribe(() => this.handleOpen());\n        this.plugin.hideSubject\n            .pipe(takeUntil(this.unsubscribe$))\n            .subscribe(() => this.handleClose());\n    }\n\n    public ngOnDestroy(): void {\n        this.unsubscribe$.next();\n        this.unsubscribe$.complete();\n    }\n\n    public trackByFn(index: number, item: any): string | undefined {\n        return item.value.seriesId;\n    }\n\n    private handleOpen() {\n        this.changeDetector.detectChanges();\n\n        const currentTooltipDirectivesIndex: {\n            [seriesId: string]: ChartTooltipDirective;\n        } = {};\n        this.tooltips.forEach((tooltip) => {\n            // this is how we identify which series does the tooltip belong to\n            const seriesId: string | undefined =\n                tooltip.elementRef.nativeElement.getAttribute(\"series-id\") ??\n                undefined;\n\n            if (!seriesId) {\n                throw new Error(\"SeriesId is not defined\");\n            }\n\n            currentTooltipDirectivesIndex[seriesId] = tooltip;\n        });\n\n        const directivesChanged = !isEqual(\n            currentTooltipDirectivesIndex,\n            this.tooltipDirectivesIndex\n        );\n        if (this.closePending || directivesChanged || !this.isOpen) {\n            clearTimeout(this.openTimeout);\n\n            this.openTimeout = window.setTimeout(() => {\n                this.openTooltips.next();\n                clearTimeout(this.collisionTimeout);\n\n                this.collisionTimeout = window.setTimeout(() => {\n                    this.avoidTooltipCollisions();\n                    this.isOpen = true;\n                });\n            });\n        } else {\n            this.openTooltips.next();\n            this.avoidTooltipCollisions();\n            this.isOpen = true;\n        }\n    }\n\n    private handleClose() {\n        if (this.simulation) {\n            this.simulation.stop();\n        }\n\n        this.closePending = true;\n        clearTimeout(this.closeTimeout);\n\n        this.closeTimeout = window.setTimeout(() => {\n            this.closeTooltips.next();\n            this.closePending = false;\n            this.isOpen = false;\n        });\n    }\n\n    /**\n     * Runs the D3 forceCollide based tooltip collision avoidance algorithm\n     */\n    private avoidTooltipCollisions() {\n        // extracted tooltip positions from tooltip directives\n        const tooltipPositions: { [seriesId: string]: IPosition } = {};\n\n        this.tooltips.forEach((tooltip) => {\n            const element = tooltip.getOverlayElement();\n\n            // this is how we identify which series does the tooltip belong to\n            const seriesId: string | undefined =\n                tooltip.elementRef.nativeElement.getAttribute(\"series-id\") ??\n                undefined;\n\n            if (!seriesId) {\n                throw new Error(\"SeriesId is not defined\");\n            }\n\n            this.tooltipDirectivesIndex[seriesId] = tooltip;\n\n            tooltipPositions[seriesId] = {\n                x: element.offsetLeft,\n                y: element.offsetTop,\n                width: element.clientWidth,\n                height: element.clientHeight,\n            };\n        });\n\n        // if there was a previous simulation, then stop it before running a new one\n        if (this.simulation) {\n            this.simulation.stop();\n        }\n\n        this.simulation = this.startSimulation(\n            this.tooltipDirectivesIndex,\n            tooltipPositions\n        );\n    }\n\n    /**\n     * Starts the force simulation to avoid tooltip overlap\n     *\n     * @param tooltipIndex\n     * @param tooltipPositions\n     */\n    private startSimulation(\n        tooltipIndex: { [p: string]: ChartTooltipDirective },\n        tooltipPositions: { [seriesId: string]: IPosition }\n    ) {\n        const nodes = Object.keys(tooltipPositions).map((seriesId) => {\n            const position = tooltipPositions[seriesId];\n\n            if (isNil(position.height) || isNil(position.width)) {\n                throw new Error(\"Position height or width are not defined\");\n            }\n\n            const props: any = {\n                seriesId: seriesId,\n                x: position.x,\n                y: position.y,\n                radius: this.isVertical()\n                    ? position.height / 2\n                    : position.width / 2,\n            };\n            if (this.isVertical()) {\n                props.fx = position.x;\n            } else {\n                props.fy = position.y;\n            }\n            return props;\n        });\n\n        // TODO: these numbers are only based on playing with the library for the while, it's not fine tuned at all\n        const collisionForce = forceCollide((node: any) => node.radius)\n            .strength(0.5)\n            .iterations(20);\n\n        const simulation = forceSimulation(nodes)\n            .alphaDecay(0.3)\n            .force(\"collisionForce\", collisionForce);\n\n        simulation.on(\"tick\", () => {\n            each(nodes, (node: ITooltipNode) => {\n                const tooltip = tooltipIndex[node.seriesId];\n\n                select(tooltip.getOverlayElement()).style(\n                    this.isVertical() ? \"top\" : \"left\",\n                    (this.isVertical() ? node.y : node.x) + \"px\"\n                );\n            });\n        });\n\n        return simulation;\n    }\n\n    private isVertical() {\n        return this.plugin.orientation === \"right\";\n    }\n}\n","<div *ngIf=\"plugin && plugin.dataPoints\">\n    <div *ngFor=\"let item of plugin.dataPoints | keyvalue; trackBy: trackByFn\">\n        <ng-template #tooltipTemplate>\n            <ng-container\n                *ngTemplateOutlet=\"template; context: { dataPoint: item.value }\"\n            ></ng-container>\n        </ng-template>\n\n        <div\n            nuiChartTooltip\n            *ngIf=\"plugin.dataPointPositions[item.key]\"\n            [attr.series-id]=\"item.key\"\n            [template]=\"tooltipTemplate\"\n            [openRemoteControl]=\"openTooltips\"\n            [closeRemoteControl]=\"closeTooltips\"\n            [positions]=\"plugin.dataPointPositions[item.key].overlayPositions\"\n            class=\"chart-tooltips__popover\"\n            [style.left.px]=\"plugin.dataPointPositions[item.key].x\"\n            [style.top.px]=\"plugin.dataPointPositions[item.key].y\"\n            [style.height.px]=\"plugin.dataPointPositions[item.key].height\"\n            [style.width.px]=\"plugin.dataPointPositions[item.key].width\"\n        ></div>\n    </div>\n</div>\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport defaultsDeep from \"lodash/defaultsDeep\";\nimport pickBy from \"lodash/pickBy\";\nimport values from \"lodash/values\";\nimport { Subject } from \"rxjs\";\nimport { takeUntil } from \"rxjs/operators\";\n\nimport { IElementPosition } from \"./types\";\nimport {\n    INTERACTION_DATA_POINTS_EVENT,\n    INTERACTION_DATA_POINT_EVENT,\n} from \"../../constants\";\nimport { ChartPlugin } from \"../common/chart-plugin\";\nimport {\n    IChartEvent,\n    IDataPoint,\n    IDataPointsPayload,\n    InteractionType,\n} from \"../common/types\";\n\n/** Configuration for the popover plugin */\nexport interface IPopoverPluginConfig {\n    /** ID of the event stream the plugin will respond to */\n    eventStreamId?:\n        | typeof INTERACTION_DATA_POINTS_EVENT\n        | typeof INTERACTION_DATA_POINT_EVENT;\n    /** The type of interaction that will trigger the showing and hiding of the popovers */\n    interactionType?: InteractionType;\n}\n\n/**\n * This plugin listens for the INTERACTION_DATA_POINTS_EVENT by default and transforms received data into\n * popover inputs. The listened event can be configured using the 'config.eventStreamId' property.\n * The actual popover is handled by the ChartPopoverComponent.\n */\nexport class ChartPopoverPlugin extends ChartPlugin {\n    /** Info about the data point(s) received in the most recent interaction event */\n    public dataPoints: IDataPointsPayload;\n    /** Emits the popover's target position */\n    public updatePositionSubject = new Subject<IElementPosition>();\n    /** Emits an event indicating the popover should open */\n    public openPopoverSubject = new Subject<void>();\n    /** Emits an event indicating the popover should close */\n    public closePopoverSubject = new Subject<void>();\n    /** The target position of the popover */\n    public popoverTargetPosition: IElementPosition = {\n        top: 0,\n        left: 0,\n        width: 0,\n        height: 0,\n    };\n    /** The default plugin configuration */\n    public DEFAULT_CONFIG: IPopoverPluginConfig = {\n        eventStreamId: INTERACTION_DATA_POINTS_EVENT,\n        interactionType: InteractionType.MouseMove,\n    };\n\n    private isOpen = false;\n    private readonly destroy$ = new Subject<void>();\n\n    constructor(public config: IPopoverPluginConfig = {}) {\n        super();\n        this.config = defaultsDeep(this.config, this.DEFAULT_CONFIG);\n    }\n\n    public initialize(): void {\n        this.chart\n            .getEventBus()\n            .getStream(this.config.eventStreamId as string)\n            .pipe(takeUntil(this.destroy$))\n            .subscribe((event: IChartEvent) => {\n                if (\n                    event.data.interactionType === this.config.interactionType\n                ) {\n                    // here we handle data either of type IInteractionDataPointsEvent or IInteractionDataPointEvent\n                    const dataPoints: IDataPointsPayload = event.data\n                        .dataPoints ?? {\n                        [event.data.dataPoint.seriesId]: event.data.dataPoint,\n                    };\n                    this.processDataPoints(dataPoints);\n                }\n            });\n    }\n\n    public destroy(): void {\n        if (this.updatePositionSubject) {\n            this.updatePositionSubject.complete();\n        }\n        if (this.openPopoverSubject) {\n            this.openPopoverSubject.complete();\n        }\n        if (this.closePopoverSubject) {\n            this.closePopoverSubject.complete();\n        }\n        if (this.destroy$) {\n            this.destroy$.next();\n            this.destroy$.complete();\n        }\n    }\n\n    protected getAbsolutePosition(valuesArray: any[]): IElementPosition {\n        const chartElement: any = this.chart.target?.node()?.parentNode; // the one above svg\n\n        if (!chartElement) {\n            throw new Error(\"Chart parent node is not defined\");\n        }\n\n        const dataPointsLeft = Math.min(\n            ...valuesArray.map((d) => d.position.x)\n        );\n        const left =\n            chartElement.offsetLeft +\n            this.chart.getGrid().config().dimension.margin.left +\n            dataPointsLeft;\n        const top =\n            chartElement.offsetTop +\n            this.chart.getGrid().config().dimension.margin.top;\n        // area for popovers is enlarged to cover the whole chart (top to bottom),\n        // so that we avoid collision of chart visualization and popover (by UX request)\n        return {\n            top: top,\n            left: left,\n            height: chartElement.offsetHeight,\n            width:\n                Math.max(\n                    ...valuesArray.map(\n                        (d) => d.position.x + (d.position.width || 0)\n                    )\n                ) - dataPointsLeft,\n        };\n    }\n\n    private processDataPoints(dataPoints: IDataPointsPayload) {\n        const validDataPoints = pickBy(\n            dataPoints,\n            (d: IDataPoint) => d.index >= 0 && d.position\n        );\n        const validDataPointsValues = values(validDataPoints);\n        if (validDataPointsValues.length > 0) {\n            this.popoverTargetPosition = this.getAbsolutePosition(\n                validDataPointsValues\n            );\n            this.dataPoints = validDataPoints;\n            // timeout is needed in order to successfully open popover on initial hover over the chart\n            setTimeout(() => {\n                this.updatePositionSubject.next(this.popoverTargetPosition);\n                if (!this.isOpen) {\n                    this.isOpen = true;\n                    this.openPopoverSubject.next();\n                }\n            });\n        } else {\n            // timeout is needed for symmetry of timing with above timeout for opening the popover\n            setTimeout(() => {\n                this.closePopoverSubject.next();\n                this.isOpen = false;\n            });\n        }\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport {\n    ChangeDetectorRef,\n    Component,\n    ElementRef,\n    EventEmitter,\n    Input,\n    OnChanges,\n    OnDestroy,\n    OnInit,\n    Output,\n    SimpleChanges,\n    TemplateRef,\n    ViewChild,\n} from \"@angular/core\";\nimport { Subject } from \"rxjs\";\nimport { takeUntil } from \"rxjs/operators\";\n\nimport { PopoverComponent } from \"@nova-ui/bits\";\n\nimport { IDataPointsPayload } from \"../core/common/types\";\nimport { ChartPopoverPlugin } from \"../core/plugins/chart-popover-plugin\";\nimport { IElementPosition } from \"../core/plugins/types\";\n\n@Component({\n    selector: \"nui-chart-popover\",\n    templateUrl: \"./chart-popover.component.html\",\n    styleUrls: [\"./chart-popover.component.less\"],\n    standalone: false,\n})\nexport class ChartPopoverComponent implements OnChanges, OnInit, OnDestroy {\n    @Input() plugin: ChartPopoverPlugin;\n\n    @Input() template: TemplateRef<any>;\n\n    @Output() update = new EventEmitter<IDataPointsPayload>();\n\n    @ViewChild(PopoverComponent) popover: PopoverComponent;\n\n    private readonly destroy$ = new Subject<void>();\n    private initPlugin$ = new Subject<void>();\n\n    constructor(\n        private changeDetector: ChangeDetectorRef,\n        public element: ElementRef\n    ) {}\n\n    public ngOnChanges(changes: SimpleChanges): void {\n        if (changes.plugin && !changes.plugin.isFirstChange()) {\n            this.initPlugin();\n        }\n    }\n\n    public ngOnInit(): void {\n        this.initPlugin();\n    }\n\n    public ngOnDestroy(): void {\n        this.destroy$.next();\n        this.destroy$.complete();\n        this.initPlugin$.complete();\n    }\n\n    private initPlugin() {\n        this.initPlugin$.next();\n\n        this.plugin?.openPopoverSubject\n            .pipe(takeUntil(this.initPlugin$), takeUntil(this.destroy$))\n            .subscribe(() => {\n                this.changeDetector.markForCheck();\n            });\n\n        this.plugin?.updatePositionSubject\n            .pipe(takeUntil(this.initPlugin$), takeUntil(this.destroy$))\n            .subscribe((position: IElementPosition) => {\n                this.popover?.resetSize();\n                // calculating a width offset to position the popover's host element at the midpoint of the popover target\n                const widthOffset = position.width / 2;\n                this.element.nativeElement.style.left =\n                    position.left + widthOffset + \"px\";\n                this.element.nativeElement.style.top = position.top + \"px\";\n                this.popover?.updatePosition();\n                this.update.next(this.plugin?.dataPoints);\n            });\n    }\n}\n","<div *ngIf=\"plugin && plugin.dataPoints\">\n    <nui-popover\n        class=\"chart-popover__popover\"\n        trigger=\"openPopoverSubject\"\n        placement=\"top\"\n        [unlimited]=\"true\"\n        [template]=\"popoverTemplate\"\n        [openPopover]=\"plugin.openPopoverSubject\"\n        [closePopover]=\"plugin.closePopoverSubject\"\n        [hasPadding]=\"false\"\n        [container]=\"element.nativeElement\"\n        [style.height.px]=\"plugin.popoverTargetPosition.height\"\n        [withGrowAfterOpen]=\"true\"\n    >\n    </nui-popover>\n\n    <ng-template #popoverTemplate>\n        <ng-container\n            *ngTemplateOutlet=\"\n                template;\n                context: { dataPoints: plugin.dataPoints }\n            \"\n        ></ng-container>\n    </ng-template>\n</div>\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport {\n    AfterViewInit,\n    ChangeDetectorRef,\n    Component,\n    ElementRef,\n    Input,\n    OnChanges,\n    OnDestroy,\n    SimpleChanges,\n    ViewChild,\n} from \"@angular/core\";\nimport isFunction from \"lodash/isFunction\";\nimport { BehaviorSubject } from \"rxjs\";\n\nimport { IChartMarker } from \"../core/common/types\";\n\n/** @ignore */\nconst SVG_PADDING = 3;\n\n@Component({\n    selector: \"nui-chart-marker\",\n    templateUrl: \"./chart-marker.component.html\",\n    styleUrls: [\"./chart-marker.component.less\"],\n    standalone: false,\n})\nexport class ChartMarkerComponent\n    implements OnDestroy, AfterViewInit, OnChanges\n{\n    @Input() marker: IChartMarker;\n    @Input() drawLine: boolean;\n    @Input() color: string;\n    @Input() maxSize = 20;\n\n    @ViewChild(\"svgContent\") public svgContent: ElementRef<SVGElement>;\n\n    public viewBox: string;\n    public height: string = \"10px\"; // size needs to be defined by default to prevent initial svg element from being huge\n    public width: string = \"10px\"; // same here\n\n    private svg = new BehaviorSubject<string>(\"\");\n\n    constructor(private changeDetector: ChangeDetectorRef) {}\n\n    public ngAfterViewInit(): void {\n        this.svg.subscribe((svg: string) => {\n            this.renderMarkerSvg(svg);\n        });\n    }\n\n    public ngOnChanges(changes: SimpleChanges): void {\n        if (changes[\"marker\"] || changes[\"color\"]) {\n            if (changes[\"color\"]) {\n                this.marker.setColor(this.color);\n            }\n            if (\n                this.marker &&\n                this.marker.getSvg &&\n                isFunction(this.marker.getSvg)\n            ) {\n                this.svg.next(this.marker.getSvg());\n            }\n        }\n    }\n\n    public ngOnDestroy(): void {\n        this.svg.complete();\n    }\n\n    private renderMarkerSvg(svg: string) {\n        const svgContainerElement: any = this.svgContent.nativeElement;\n        const line = `<line x1=\"-10\" y1=\"0\" x2=\"10\" y2=\"0\" style=\"stroke:${this.color};stroke-width:2\" />`;\n        svgContainerElement.innerHTML = \"\";\n\n        if (this.drawLine) {\n            svgContainerElement.insertAdjacentHTML(\"beforeend\", line);\n        }\n        svgContainerElement.insertAdjacentHTML(\"beforeend\", svg);\n\n        setTimeout(() => {\n            const clientRect = svgContainerElement.getBBox();\n            this.viewBox =\n                `${clientRect.x - SVG_PADDING} ${clientRect.y - SVG_PADDING} ` +\n                `${clientRect.width + 2 * SVG_PADDING} ${\n                    clientRect.height + 2 * SVG_PADDING\n                }`;\n            this.width =\n                Math.min(clientRect.width + 2 * SVG_PADDING, this.maxSize) +\n                \"px\";\n            this.height =\n                Math.min(clientRect.height + 2 * SVG_PADDING, this.maxSize) +\n                \"px\";\n\n            this.changeDetector.markForCheck();\n        });\n    }\n}\n","<svg [attr.width]=\"width\" [attr.height]=\"height\" [attr.viewBox]=\"viewBox\">\n    <g #svgContent></g>\n</svg>\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport {\n    AfterContentInit,\n    AfterViewInit,\n    ChangeDetectorRef,\n    Component,\n    ElementRef,\n    forwardRef,\n    Input,\n    NgZone,\n    OnChanges,\n    OnDestroy,\n    OnInit,\n    SimpleChanges,\n} from \"@angular/core\";\nimport debounce from \"lodash/debounce\";\n\nimport {\n    CHART_COMPONENT,\n    CHART_VIEW_STATUS_EVENT,\n    REFRESH_EVENT,\n} from \"../constants\";\nimport {\n    IChart,\n    IChartComponent,\n    IChartViewStatusEventPayload,\n} from \"../core/common/types\";\n\n@Component({\n    selector: \"nui-chart\",\n    template: \"\",\n    providers: [\n        {\n            provide: CHART_COMPONENT,\n            useExisting: forwardRef(() => ChartComponent),\n        },\n    ],\n    standalone: false,\n})\nexport class ChartComponent\n    implements\n        OnInit,\n        AfterContentInit,\n        AfterViewInit,\n        OnDestroy,\n        IChartComponent,\n        OnChanges\n{\n    @Input() public chart: IChart;\n\n    public resizeObserver?: ResizeObserver;\n    private resizeHandler: Function;\n    private intersectionObserver: IntersectionObserver;\n\n    constructor(\n        private elRef: ElementRef,\n        private ngZone: NgZone,\n        private cd: ChangeDetectorRef\n    ) {}\n\n    public ngOnInit(): void {\n        this.intersectionObserver = new IntersectionObserver(\n            this.intersectionObserverCallback\n        );\n        this.intersectionObserver.observe(this.elRef.nativeElement);\n    }\n\n    public ngOnChanges(changes: SimpleChanges): void {\n        if (changes[\"chart\"]) {\n            const previousChart: IChart = changes[\"chart\"].previousValue;\n            if (previousChart) {\n                previousChart.destroy();\n            }\n\n            if (this.chart) {\n                this.chart.build(this.elRef.nativeElement);\n                this.redraw();\n            }\n        }\n    }\n\n    public ngAfterContentInit(): void {\n        this.chart\n            .getEventBus()\n            .getStream(REFRESH_EVENT)\n            .subscribe(() => {\n                this.chart.updateDimensions();\n            });\n    }\n\n    public ngAfterViewInit(): void {\n        this.resizeHandler = debounce(() => this.redraw(), 10);\n        this.resizeObserver = new ResizeObserver(() => {\n            // This was suggested here https://github.com/angular/zone.js/issues/1011\n            this.ngZone.run(() => this.resizeHandler());\n        });\n        this.ngZone.runOutsideAngular(() =>\n            this.resizeObserver?.observe(<Element>this.elRef.nativeElement)\n        );\n    }\n\n    public ngOnDestroy(): void {\n        this.intersectionObserver?.unobserve(<Element>this.elRef.nativeElement);\n        this.resizeObserver?.unobserve(<Element>this.elRef.nativeElement);\n        this.chart?.destroy();\n    }\n\n    public redraw = (): void => {\n        this.chart.updateDimensions();\n        this.cd.detectChanges();\n    };\n\n    private intersectionObserverCallback = (\n        entries: IntersectionObserverEntry[]\n    ): void => {\n        // Since we're only listening for intersection changes for one target (the chart itself), the 'entries' argument always has just one element.\n        const data: IChartViewStatusEventPayload = {\n            isChartInView: entries[0].isIntersecting,\n        };\n        this.chart\n            .getEventBus()\n            .getStream(CHART_VIEW_STATUS_EVENT)\n            .next({ data });\n    };\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport each from \"lodash/each\";\nimport { Subject } from \"rxjs\";\n\nexport class EventBus<T> {\n    private streams: { [key: string]: Subject<T> } = {};\n\n    public getStream(streamId: string): Subject<T> {\n        if (!this.streams[streamId]) {\n            this.streams[streamId] = new Subject<T>();\n        }\n        return this.streams[streamId];\n    }\n\n    public destroy(): void {\n        each(Object.keys(this.streams), (key: string) => {\n            this.streams[key].complete();\n        });\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport each from \"lodash/each\";\nimport findKey from \"lodash/findKey\";\nimport isUndefined from \"lodash/isUndefined\";\nimport { Observable, Subscription } from \"rxjs\";\n\nimport {\n    DESTROY_EVENT,\n    INTERACTION_COORDINATES_EVENT,\n    INTERACTION_VALUES_EVENT,\n    MOUSE_ACTIVE_EVENT,\n    REFRESH_EVENT,\n} from \"../constants\";\nimport { EventBus } from \"./common/event-bus\";\nimport { IChart, IChartCollectionEvent, IChartEvent } from \"./common/types\";\n\n/**\n * @ignore\n *\n * Chart collection takes care of charts grouping and rebroadcasting selected events coming from one charts to other charts\n */\nexport class ChartCollection {\n    public lastIndex = -1;\n\n    /**\n     * These events will be rebroadcasted to other charts in the collection\n     *\n     * @type {[string]}\n     */\n    public events = [\n        INTERACTION_VALUES_EVENT,\n        INTERACTION_COORDINATES_EVENT,\n        MOUSE_ACTIVE_EVENT,\n        REFRESH_EVENT,\n    ];\n\n    private charts: { [key: string]: IChart } = {};\n    private subscriptions: { [key: string]: Subscription[] } = {};\n    private eventBus?: EventBus<IChartCollectionEvent>;\n\n    constructor() {}\n\n    /**\n     * Register chart in this collection and subscribe to all configured events\n     *\n     * @param {IChart} chart\n     */\n    public addChart(chart: IChart): void {\n        const index = (++this.lastIndex).toString();\n\n        this.charts[index] = chart;\n\n        if (!this.eventBus) {\n            this.initializeEventBus();\n        }\n\n        each(this.events, (event) => {\n            this.subscribe(\n                index,\n                chart.getEventBus().getStream(event),\n                (value: IChartEvent) => {\n                    // this is where we check for the __broadcast__ flag, which means it originated in the chart collection\n                    if (!value.broadcast) {\n                        this.eventBus\n                            ?.getStream(event)\n                            .next({ chartIndex: index, event: value });\n                    }\n                }\n            );\n        });\n\n        this.subscribe(\n            index,\n            chart.getEventBus().getStream(DESTROY_EVENT),\n            (value: any) => {\n                this.removeChart(chart);\n\n                if (Object.keys(this.charts).length === 0) {\n                    this.destroy();\n                }\n            }\n        );\n    }\n\n    /**\n     * Removed chart from the collection and unsubscribes all related subscriptions\n     *\n     * @param {IChart} chart\n     */\n    public removeChart(chart: IChart): void {\n        const key = this.getChartKey(chart);\n        if (isUndefined(key)) {\n            throw new Error(\"Chart not registered!\");\n        }\n\n        this.unsubscribeChart(key);\n        delete this.charts[key];\n    }\n\n    /**\n     * Destroy this collection and release related resources\n     */\n    public destroy(): void {\n        this.eventBus?.destroy();\n        this.eventBus = undefined;\n    }\n\n    private initializeEventBus() {\n        this.eventBus = new EventBus<IChartCollectionEvent>();\n\n        for (const event of this.events) {\n            this.eventBus\n                .getStream(event)\n                .subscribe((e: IChartCollectionEvent) => {\n                    for (const i of Object.keys(this.charts)) {\n                        if (i !== e.chartIndex) {\n                            // setting this flag prevents the event from looping infinitely\n                            e.event.broadcast = true;\n                            this.charts[i]\n                                .getEventBus()\n                                .getStream(event)\n                                .next(e.event);\n                        }\n                    }\n                });\n        }\n    }\n\n    /**\n     * Register subscription for given chart key on given observable\n     *\n     * @param {string} chartKey\n     * @param {Observable<any>} observable\n     * @param {(value: any) => void} next\n     */\n    private subscribe(\n        chartKey: string,\n        observable: Observable<any>,\n        next: (value: any) => void\n    ) {\n        const sub = observable.subscribe(next);\n\n        let chartSubscriptions = this.subscriptions[chartKey];\n        if (isUndefined(chartSubscriptions)) {\n            chartSubscriptions = [];\n            this.subscriptions[chartKey] = chartSubscriptions;\n        }\n        chartSubscriptions.push(sub);\n    }\n\n    /**\n     * Unsubscribes subscriptions that belong to given chart key\n     *\n     * @param {string} chartKey\n     */\n    private unsubscribeChart(chartKey: string) {\n        each(this.subscriptions[chartKey], (sub) => {\n            sub.unsubscribe();\n        });\n        delete this.subscriptions[chartKey];\n    }\n\n    private getChartKey(chart: IChart): string | undefined {\n        return findKey(this.charts, (c: IChart) => c === chart);\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { Injectable } from \"@angular/core\";\nimport isUndefined from \"lodash/isUndefined\";\n\nimport { ChartCollection } from \"../core/chart-collection\";\n\n/**\n * This service registers collections of charts identified by given id. It is used primarily by the ChartCollectionId directive.\n */\n@Injectable()\nexport class ChartCollectionService {\n    private collections: { [key: string]: ChartCollection } = {};\n\n    public getChartCollection(collectionId: string): ChartCollection {\n        let collection = this.collections[collectionId];\n        if (isUndefined(collection)) {\n            collection = new ChartCollection();\n            this.collections[collectionId] = collection;\n        }\n        return collection;\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport {\n    Directive,\n    Inject,\n    Input,\n    OnChanges,\n    SimpleChanges,\n} from \"@angular/core\";\n\nimport { CHART_COMPONENT } from \"../constants\";\nimport { ChartCollectionService } from \"./chart-collection.service\";\nimport { IChartComponent } from \"../core/common/types\";\n\n/**\n * This directive represents a grouping behavior that is separated from chart components. Any chart component\n * registering the CHART_COMPONENT provider can be injected into this.\n *\n * A group of charts with the same associated chart collection id will share events broadcasted through their event buses.\n */\n@Directive({\n    selector: \"[nuiChartCollectionId]\",\n    standalone: false,\n})\nexport class ChartCollectionIdDirective implements OnChanges {\n    @Input(\"nuiChartCollectionId\")\n    public collectionId: string;\n\n    constructor(\n        @Inject(CHART_COMPONENT) private chartComponent: IChartComponent,\n        private chartCollectionService: ChartCollectionService\n    ) {}\n\n    public ngOnChanges(changes: SimpleChanges): void {\n        const collectionIdChange = changes.collectionId;\n        if (collectionIdChange) {\n            if (collectionIdChange.previousValue) {\n                this.chartCollectionService\n                    .getChartCollection(collectionIdChange.previousValue)\n                    .removeChart(this.chartComponent.chart);\n            }\n            if (collectionIdChange.currentValue) {\n                this.chartCollectionService\n                    .getChartCollection(collectionIdChange.currentValue)\n                    .addChart(this.chartComponent.chart);\n            }\n        }\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nexport enum LegendOrientation {\n    vertical = \"vertical\",\n    horizontal = \"horizontal\",\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport {\n    Component,\n    EventEmitter,\n    Input,\n    OnChanges,\n    OnDestroy,\n    SimpleChanges,\n    ViewEncapsulation,\n} from \"@angular/core\";\n\nimport { LegendOrientation } from \"./types\";\n\n@Component({\n    selector: \"nui-legend\",\n    host: { class: \"d-inline-block\" },\n    templateUrl: \"./legend.component.html\",\n    encapsulation: ViewEncapsulation.Emulated,\n    standalone: false,\n})\nexport class LegendComponent implements OnChanges, OnDestroy {\n    /**\n     * EventEmitter for notifying subscribers of a change in the active state\n     */\n    public activeChanged = new EventEmitter<boolean>();\n\n    /**\n     * The active state\n     */\n    @Input() public active = false;\n\n    /**\n     * The legend's interactive mode switch\n     */\n    @Input() public interactive = false;\n\n    /**\n     * The legend's orientation\n     */\n    @Input() public orientation: LegendOrientation = LegendOrientation.vertical;\n\n    /**\n     * The legend's overall series color. Individual legend series may override this.\n     */\n    @Input() public seriesColor: string;\n\n    /**\n     * The legend's overall series icon. Individual legend series may override this.\n     */\n    @Input() public seriesIcon: string;\n\n    /**\n     * The legend's overall series unit label. Individual legend series may override this.\n     */\n    @Input() public seriesUnitLabel: string;\n\n    public ngOnChanges(changes: SimpleChanges): void {\n        if (changes[\"active\"]) {\n            this.activeChanged.emit(this.active);\n        }\n    }\n\n    public ngOnDestroy(): void {\n        this.activeChanged.complete();\n    }\n}\n","<div\n    class=\"nui-legend d-flex flex-wrap\"\n    [class.flex-column]=\"orientation === 'vertical'\"\n>\n    <ng-content></ng-content>\n</div>\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport {\n    AfterContentInit,\n    ChangeDetectionStrategy,\n    Component,\n    ElementRef,\n    EventEmitter,\n    Host,\n    HostBinding,\n    HostListener,\n    Input,\n    Optional,\n    Output,\n    ViewChild,\n} from \"@angular/core\";\nimport _isEmpty from \"lodash/isEmpty\";\n\nimport { RenderState } from \"../../renderers/types\";\nimport { LegendComponent } from \"../legend.component\";\nimport { LegendOrientation } from \"../types\";\n\n/** @ignore */\nexport const LEGEND_SERIES_CLASS_NAME = \"nui-legend-series\";\n\n@Component({\n    // eslint-disable-next-line\n    host: { class: LEGEND_SERIES_CLASS_NAME },\n    selector: \"nui-legend-series\",\n    templateUrl: \"./legend-series.component.html\",\n    changeDetection: ChangeDetectionStrategy.OnPush,\n    standalone: false,\n})\nexport class LegendSeriesComponent implements AfterContentInit {\n    /**\n     * Sets the series active status\n     *\n     * @param {boolean} active The new active status\n     */\n    @Input()\n    public set active(active: boolean) {\n        this._active = active;\n    }\n\n    /**\n     * Sets the series interactive mode switch\n     *\n     * @param {boolean} interactive The new interactive mode\n     */\n    @Input()\n    public set interactive(interactive: boolean) {\n        this._interactive = interactive;\n    }\n\n    /**\n     * Gets the series interactive mode value\n     *\n     * @returns {boolean} The current interactive mode\n     */\n    public get interactive(): boolean {\n        return this._interactive;\n    }\n\n    /**\n     * Set whether the series is selected\n     */\n    @Input() public isSelected = true;\n\n    /**\n     * Emits an event with a boolean value indicating a new selected status\n     */\n    @Output() public isSelectedChange = new EventEmitter();\n\n    /**\n     * The primary description of the series\n     */\n    @Input() public descriptionPrimary: string;\n\n    /**\n     * The secondary description of the series\n     */\n    @Input() public descriptionSecondary: string;\n\n    /**\n     * The series icon\n     */\n    @Input() public icon: string;\n\n    /**\n     * Color of the series\n     */\n    @Input() public color: string;\n\n    /**\n     * The render state of the legend series\n     */\n    @Input()\n    public set seriesRenderState(renderState: RenderState) {\n        this._seriesRenderState = renderState;\n    }\n    public get seriesRenderState(): RenderState {\n        return this._seriesRenderState || RenderState.default;\n    }\n\n    @ViewChild(\"projectedDescription\") private projectedDescription: ElementRef;\n\n    @HostBinding(`class.${LEGEND_SERIES_CLASS_NAME}--interactive`)\n    public get isInteractiveClassApplied(): boolean {\n        return this._interactive;\n    }\n\n    @HostBinding(`class.${LEGEND_SERIES_CLASS_NAME}--horizontal`)\n    public isHorizontalClassApplied = false;\n\n    @HostBinding(`class.inverse`)\n    public get isActiveClassApplied(): boolean {\n        return this._active && this.seriesRenderState !== RenderState.hidden;\n    }\n\n    private _seriesRenderState: RenderState;\n    private _active = false;\n    private _interactive: boolean;\n\n    constructor(@Optional() @Host() private legend: LegendComponent) {}\n\n    public ngAfterContentInit(): void {\n        if (this.legend) {\n            this.legend.activeChanged.subscribe(\n                (active: boolean) => (this._active = active)\n            );\n\n            this.icon = this.icon || this.legend.seriesIcon;\n            this._active = this.legend.active;\n            this.interactive = this.interactive ?? this.legend.interactive;\n            this.isHorizontalClassApplied =\n                this.legend.orientation === LegendOrientation.horizontal;\n        }\n    }\n\n    /**\n     * Emits an isSelectedChange event on series click if the series is in interactive mode\n     */\n    @HostListener(\"click\")\n    public onClick(): void {\n        if (this.interactive) {\n            this.isSelectedChange.next(!this.isSelected);\n        }\n    }\n\n    /**\n     * @returns boolean indicating whether the series has a primary or secondary description\n     */\n    public hasInputDescription(): boolean {\n        return (\n            !_isEmpty(this.descriptionPrimary) ||\n            !_isEmpty(this.descriptionSecondary)\n        );\n    }\n\n    /**\n     * @returns boolean indicating whether the series has a projected description\n     */\n    public hasProjectedDescription(): boolean {\n        return (\n            !!this.projectedDescription &&\n            this.projectedDescription.nativeElement.children.length !== 0\n        );\n    }\n}\n","<div\n    class=\"d-flex\"\n    [ngClass]=\"['nui-legend-series--state-' + seriesRenderState]\"\n    [class.nui-legend-series--deselected]=\"!isSelected\"\n>\n    <div class=\"nui-legend-series__tile-wrapper\">\n        <div class=\"nui-legend-series__tile\">\n            <ng-content></ng-content>\n        </div>\n        <div\n            class=\"nui-legend-series__checkbox-wrapper\"\n            [class.nui-legend-series__checkbox--checked]=\"isSelected\"\n        >\n            <div class=\"nui-legend-series__checkbox-mark\">\n                <i class=\"nui-legend-series__checkbox-glyph\"></i>\n            </div>\n        </div>\n    </div>\n    <div\n        *ngIf=\"hasInputDescription(); else descriptionTemplate\"\n        class=\"description-container nui-text-small d-flex flex-column justify-content-center\"\n    >\n        <div\n            *ngIf=\"!!descriptionPrimary\"\n            class=\"description description-primary\"\n            [title]=\"descriptionPrimary\"\n        >\n            {{ descriptionPrimary }}\n        </div>\n        <div\n            *ngIf=\"!!descriptionSecondary\"\n            class=\"description description-secondary\"\n            [title]=\"descriptionSecondary\"\n        >\n            {{ descriptionSecondary }}\n        </div>\n    </div>\n    <div class=\"legend-menu\">\n        <ng-content select=\"[legendMenu]\"></ng-content>\n    </div>\n</div>\n<ng-template #descriptionTemplate>\n    <div class=\"d-flex\" #projectedDescription>\n        <ng-content select=\"[description]\"></ng-content>\n    </div>\n</ng-template>\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { Component, ViewEncapsulation } from \"@angular/core\";\n\n@Component({\n    selector: \"nui-basic-legend-tile\",\n    templateUrl: \"./basic-legend-tile.component.html\",\n    styleUrls: [\"./basic-legend-tile.component.less\"],\n    encapsulation: ViewEncapsulation.Emulated,\n    standalone: false,\n})\nexport class BasicLegendTileComponent {}\n","<div class=\"nui-basic-legend-tile\">\n    <ng-content></ng-content>\n</div>\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport {\n    AfterContentInit,\n    AfterViewInit,\n    ChangeDetectorRef,\n    Component,\n    Host,\n    Input,\n    Optional,\n    ViewEncapsulation,\n} from \"@angular/core\";\nimport _isNil from \"lodash/isNil\";\n\nimport { LegendSeriesComponent } from \"../../legend-series/legend-series.component\";\nimport { LegendComponent } from \"../../legend.component\";\n\n@Component({\n    selector: \"nui-rich-legend-tile\",\n    templateUrl: \"./rich-legend-tile.component.html\",\n    styleUrls: [\"./rich-legend-tile.component.less\"],\n    encapsulation: ViewEncapsulation.Emulated,\n    standalone: false,\n})\nexport class RichLegendTileComponent\n    implements AfterContentInit, AfterViewInit\n{\n    /**\n     * The series unit label\n     */\n    @Input() public unitLabel: string;\n\n    /**\n     * The current value of the series\n     */\n    @Input() public value: string;\n\n    /**\n     * The series color\n     */\n    @Input() public backgroundColor: string;\n\n    /**\n     * Color for the text\n     */\n    @Input() public color: string;\n\n    public seriesHasAdditionalContent: boolean;\n\n    constructor(\n        @Host() private legendSeries: LegendSeriesComponent,\n        @Optional() @Host() private legend: LegendComponent,\n        private changeDetector: ChangeDetectorRef\n    ) {}\n\n    public ngAfterContentInit(): void {\n        if (this.legend) {\n            this.unitLabel = this.unitLabel || this.legend.seriesUnitLabel;\n            this.backgroundColor =\n                this.backgroundColor || this.legend.seriesColor || \"white\";\n        }\n    }\n\n    public ngAfterViewInit(): void {\n        if (this.legendSeries) {\n            this.seriesHasAdditionalContent =\n                this.legendSeries.hasInputDescription() ||\n                this.legendSeries.hasProjectedDescription();\n            this.changeDetector.detectChanges();\n        }\n    }\n\n    public hasInputValue(): boolean {\n        return !_isNil(this.value);\n    }\n\n    public hasInputUnitLabel(): boolean {\n        return !_isNil(this.unitLabel);\n    }\n}\n","<div\n    class=\"nui-rich-legend-tile\"\n    [class.nui-rich-legend-tile--has-point-marker]=\"\n        rightEdge.children.length > 0\n    \"\n    [class.nui-rich-legend-tile--series-has-additional-content]=\"\n        seriesHasAdditionalContent\n    \"\n>\n    <div\n        class=\"nui-rich-legend-tile__tilebox d-flex justify-content-center align-items-end flex-column\"\n        [ngStyle]=\"{ 'background-color': backgroundColor }\"\n        [style.color]=\"color\"\n    >\n        <div\n            *ngIf=\"hasInputValue(); else projectedTopContent\"\n            class=\"nui-rich-legend-tile__tilebox-value nui-rich-legend-tile__ellipsified\"\n        >\n            {{ value }}\n        </div>\n        <div\n            *ngIf=\"hasInputUnitLabel(); else projectedBottomContent\"\n            class=\"nui-rich-legend-tile__tilebox-unit nui-rich-legend-tile__ellipsified\"\n        >\n            {{ unitLabel }}\n        </div>\n        <ng-content></ng-content>\n    </div>\n    <div class=\"nui-rich-legend-tile__icon\" #icon>\n        <ng-content select=\"[leftEdge]\"></ng-content>\n    </div>\n    <div class=\"nui-rich-legend-tile__point-marker\" #rightEdge>\n        <ng-content select=\"[rightEdge]\"></ng-content>\n    </div>\n</div>\n<ng-template #projectedTopContent>\n    <ng-content select=\"[top]\"></ng-content>\n</ng-template>\n<ng-template #projectedBottomContent>\n    <ng-content select=\"[bottom]\"></ng-content>\n</ng-template>\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { Numeric } from \"d3-array\";\n\n/**\n * Used for simplified threshold zone definition. It is expected the <code>start</code> to be <code>&lt; end</code>.\n */\nexport interface ISimpleThresholdZone {\n    status: string;\n    start?: number;\n    end?: number;\n}\n\nexport interface ZoneCross {\n    status: string;\n    start?: Numeric;\n    end?: Numeric;\n}\n\n/**\n * Used for specifying the start or end boundary of a zone\n */\nexport enum ZoneBoundary {\n    Start = \"start\",\n    End = \"end\",\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { IValueProvider } from \"../types\";\n\n/**\n * This color provider processes values provided by the source provider using the given function.\n * Examples would be darken, lighten, reduce opacity, etc.\n */\nexport class ProcessedColorProvider implements IValueProvider<string> {\n    private processedColors: { [key: string]: string };\n\n    constructor(\n        private sourceProvider: IValueProvider<string>,\n        private fn: (input: string) => string\n    ) {\n        this.reset();\n    }\n\n    public get = (entityId: string): string => {\n        const clr = this.sourceProvider.get(entityId);\n\n        if (!clr) {\n            throw new Error(\"clr is not defined\");\n        }\n\n        let processedColor = this.processedColors[clr];\n        if (!processedColor) {\n            processedColor = this.fn(clr);\n            this.processedColors[clr] = processedColor;\n        }\n        return processedColor;\n    };\n\n    public reset(): void {\n        this.processedColors = {};\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { IValueProvider } from \"../types\";\n\n/**\n * This class matches the provided instances of type <T> to given series.\n * It keeps track of already given instances to given entities to avoid conflicts.\n */\nexport class SequentialValueProvider<T> implements IValueProvider<T> {\n    private providedValues: { [key: string]: T };\n    private lastUsedIndex: number;\n\n    constructor(private values: T[]) {\n        this.reset();\n    }\n\n    public get = (entityId: string): T => {\n        let value = this.providedValues[entityId];\n        if (!value) {\n            const index = ++this.lastUsedIndex % this.values.length;\n            value = this.values[index];\n            this.providedValues[entityId] = value;\n        }\n        return value;\n    };\n\n    public reset(): void {\n        this.providedValues = {};\n        this.lastUsedIndex = -1;\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { SequentialValueProvider } from \"./sequential-value-provider\";\n\n/**\n * This class matches the provided colors to given series.\n * It keeps track of already given colors to given entities to avoid conflicts.\n */\nexport class SequentialColorProvider extends SequentialValueProvider<string> {\n    constructor(private colors: string[]) {\n        super(colors);\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { rgb, RGBColor } from \"d3-color\";\n\nimport { IValueProvider } from \"../types\";\nimport { ProcessedColorProvider } from \"./processed-color-provider\";\nimport { getColorValueByName } from \"@nova-ui/bits\";\n\n/** @ignore */\nconst rc = 0.2126;\n/** @ignore */\nconst gc = 0.7152;\n/** @ignore */\nconst bc = 0.0722;\n/** @ignore */\nconst lowc = 1 / 12.92;\n\n/**\n * This color provider calculates foreground color based on contrast ratio of provided colors\n */\nexport class TextColorProvider extends ProcessedColorProvider {\n    constructor(\n        sourceProvider: IValueProvider<string>,\n        colorDefinitions: { light: string; dark: string }\n    ) {\n        super(sourceProvider, (input: string) => {\n            const color = getColorValueByName(input);\n            const rgbInput = rgb(color);\n\n            const ratioToLight = this.getContrastRatio(\n                rgbInput,\n                rgb(colorDefinitions.light)\n            );\n            const ratioToDark = this.getContrastRatio(\n                rgbInput,\n                rgb(colorDefinitions.dark)\n            );\n\n            return ratioToDark > ratioToLight\n                ? colorDefinitions.dark\n                : colorDefinitions.light;\n        });\n    }\n\n    /**\n     * Calculate contrast ratio of two given colors (https://www.w3.org/TR/WCAG20/#contrast-ratiodef)\n     *\n     * @param {RGBColor} color1\n     * @param {RGBColor} color2\n     * @returns {number} luminance ratio\n     */\n    private getContrastRatio(color1: RGBColor, color2: RGBColor) {\n        const luminance1 = this.getRelativeLuminance(color1);\n        const luminance2 = this.getRelativeLuminance(color2);\n        let lighter: number;\n        let darker: number;\n        if (luminance1 > luminance2) {\n            lighter = luminance1;\n            darker = luminance2;\n        } else {\n            lighter = luminance2;\n            darker = luminance1;\n        }\n        return (lighter + 0.05) / (darker + 0.05);\n    }\n\n    /**\n     * Calculates relative luminance of given color (https://www.w3.org/TR/WCAG20/relative-luminance.xml)\n     *\n     * @param {RGBColor} rgbColor\n     * @returns {number}\n     */\n    private getRelativeLuminance(rgbColor: RGBColor) {\n        const rsrgb = rgbColor.r / 255;\n        const gsrgb = rgbColor.g / 255;\n        const bsrgb = rgbColor.b / 255;\n\n        const r = rsrgb <= 0.03928 ? rsrgb * lowc : this.adjustGamma(rsrgb);\n        const g = gsrgb <= 0.03928 ? gsrgb * lowc : this.adjustGamma(gsrgb);\n        const b = bsrgb <= 0.03928 ? bsrgb * lowc : this.adjustGamma(bsrgb);\n\n        return r * rc + g * gc + b * bc;\n    }\n\n    private adjustGamma(g: number) {\n        return Math.pow((g + 0.055) / 1.055, 2.4);\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { rgb } from \"d3-color\";\nimport isArray from \"lodash/isArray\";\n\nimport { IChartPalette, IValueProvider } from \"../types\";\nimport { ProcessedColorProvider } from \"./processed-color-provider\";\nimport { SequentialColorProvider } from \"./sequential-color-provider\";\nimport { TextColorProvider } from \"./text-color-provider\";\nimport { getColorValueByName } from \"@nova-ui/bits\";\n\nexport class ChartPalette implements IChartPalette {\n    private _standardColors: IValueProvider<string>;\n    private _textColors: TextColorProvider;\n    private _backgroundColors: IValueProvider<string>;\n\n    constructor(\n        colors: string[] | IValueProvider<string>,\n        options = { backgroundOpacity: 0.15 }\n    ) {\n        if (isArray(colors)) {\n            this._standardColors = new SequentialColorProvider(\n                <string[]>colors\n            );\n        } else {\n            this._standardColors = <IValueProvider<string>>colors;\n        }\n        this._textColors = new TextColorProvider(this.standardColors, {\n            light: \"white\",\n            dark: \"black\",\n        }); // TODO: oops!\n        this._backgroundColors = new ProcessedColorProvider(\n            this.standardColors,\n            (c: string) => {\n                const color = getColorValueByName(c);\n                const rgbColor = rgb(color);\n                rgbColor.opacity = options.backgroundOpacity;\n                return rgbColor.toString();\n            }\n        );\n    }\n\n    public get standardColors(): IValueProvider<string> {\n        return this._standardColors;\n    }\n\n    public get backgroundColors(): IValueProvider<string> {\n        return this._backgroundColors;\n    }\n\n    public get textColors(): IValueProvider<string> {\n        return this._textColors;\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport isUndefined from \"lodash/isUndefined\";\n\nimport { IChartMarker } from \"../../types\";\n\n/**\n * This class creates a ChartMarker based on provided portion of svg markup\n */\nexport class SvgMarker implements IChartMarker {\n    protected styledSvg: string;\n\n    constructor(protected svg: string) {}\n\n    public getSvg(): string {\n        return this.styledSvg || this.svg;\n    }\n\n    public setColor(color: string): void {\n        this.styledSvg = isUndefined(color)\n            ? color\n            : `<g fill=\"${color}\">${this.svg}</g>`;\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { SvgMarker } from \"./markers/svg-marker\";\n\n/** Default single-shade color sequence for charts */\nexport const CHART_PALETTE_CS1: string[] = [\n    \"var(--nui-color-chart-one)\",\n    \"var(--nui-color-chart-two)\",\n    \"var(--nui-color-chart-three)\",\n    \"var(--nui-color-chart-four)\",\n    \"var(--nui-color-chart-five)\",\n    \"var(--nui-color-chart-six)\",\n    \"var(--nui-color-chart-seven)\",\n    \"var(--nui-color-chart-eight)\",\n    \"var(--nui-color-chart-nine)\",\n    \"var(--nui-color-chart-ten)\",\n];\n\n/** Default two-shade color sequence for charts */\nexport const CHART_PALETTE_CS2: string[] = [\n    \"var(--nui-color-chart-one)\",\n    \"var(--nui-color-chart-one-light)\",\n    \"var(--nui-color-chart-two)\",\n    \"var(--nui-color-chart-two-light)\",\n    \"var(--nui-color-chart-three)\",\n    \"var(--nui-color-chart-three-light)\",\n    \"var(--nui-color-chart-four)\",\n    \"var(--nui-color-chart-four-light)\",\n    \"var(--nui-color-chart-five)\",\n    \"var(--nui-color-chart-five-light)\",\n    \"var(--nui-color-chart-six)\",\n    \"var(--nui-color-chart-six-light)\",\n    \"var(--nui-color-chart-seven)\",\n    \"var(--nui-color-chart-seven-light)\",\n    \"var(--nui-color-chart-eight)\",\n    \"var(--nui-color-chart-eight-light)\",\n    \"var(--nui-color-chart-nine)\",\n    \"var(--nui-color-chart-nine-light)\",\n    \"var(--nui-color-chart-ten)\",\n    \"var(--nui-color-chart-ten-light)\",\n];\n\n/** Default three-shade color sequence for charts */\nexport const CHART_PALETTE_CS3: string[] = [\n    \"var(--nui-color-chart-one)\",\n    \"var(--nui-color-chart-one-light)\",\n    \"var(--nui-color-chart-one-dark)\",\n    \"var(--nui-color-chart-two)\",\n    \"var(--nui-color-chart-two-light)\",\n    \"var(--nui-color-chart-two-dark)\",\n    \"var(--nui-color-chart-three)\",\n    \"var(--nui-color-chart-three-light)\",\n    \"var(--nui-color-chart-three-dark)\",\n    \"var(--nui-color-chart-four)\",\n    \"var(--nui-color-chart-four-light)\",\n    \"var(--nui-color-chart-four-dark)\",\n    \"var(--nui-color-chart-five)\",\n    \"var(--nui-color-chart-five-light)\",\n    \"var(--nui-color-chart-five-dark)\",\n    \"var(--nui-color-chart-six)\",\n    \"var(--nui-color-chart-six-light)\",\n    \"var(--nui-color-chart-six-dark)\",\n    \"var(--nui-color-chart-seven)\",\n    \"var(--nui-color-chart-seven-light)\",\n    \"var(--nui-color-chart-seven-dark)\",\n    \"var(--nui-color-chart-eight)\",\n    \"var(--nui-color-chart-eight-light)\",\n    \"var(--nui-color-chart-eight-dark)\",\n    \"var(--nui-color-chart-nine)\",\n    \"var(--nui-color-chart-nine-light)\",\n    \"var(--nui-color-chart-nine-dark)\",\n    \"var(--nui-color-chart-ten)\",\n    \"var(--nui-color-chart-ten-light)\",\n    \"var(--nui-color-chart-ten-dark)\",\n];\n\n/** @deprecated\n * Will be removed in v.12\n * https://jira.solarwinds.com/browse/NUI-4296?jql=text%20~%20%22v11%22\n *\n * Default status color sequence for charts */\nexport const CHART_PALETTE_CS_S: string[] = [\n    \"var(--nui-color-semantic-down)\",\n    \"var(--nui-color-semantic-critical)\",\n    \"var(--nui-color-semantic-warning)\",\n    \"var(--nui-color-semantic-unknown)\",\n    \"var(--nui-color-semantic-ok)\",\n    \"var(--nui-color-semantic-info)\",\n];\n\n/** Extended status color sequence for charts\n * It will substitute the default one above in v.12\n * https://jira.solarwinds.com/browse/NUI-5367\n */\nexport const CHART_PALETTE_CS_S_EXTENDED: string[] = [\n    \"var(--nui-color-semantic-down)\",\n    \"var(--nui-color-semantic-down-bg)\",\n    \"var(--nui-color-semantic-critical)\",\n    \"var(--nui-color-semantic-critical-bg)\",\n    \"var(--nui-color-semantic-warning)\",\n    \"var(--nui-color-semantic-warning-bg)\",\n    \"var(--nui-color-semantic-unknown)\",\n    \"var(--nui-color-semantic-unknown-bg)\",\n    \"var(--nui-color-semantic-ok)\",\n    \"var(--nui-color-semantic-ok-bg)\",\n    \"var(--nui-color-semantic-info)\",\n    \"var(--nui-color-semantic-info-bg)\",\n    \"var(--nui-color-chart-ten-light)\",\n    \"var(--nui-color-chart-ten)\",\n];\n\n/* eslint-disable max-len */\n/** Standard shapes for chart markers */\nconst regularShapes: string[] = [\n    \"m0 0m-4 0a4 4 0 1 0 8 0 4 4 0 1 0-8 0z\", // circle\n    \"m-4,-4l8,0l0,8l-8,0l0,-8z\", // square\n    \"m0-4 4 8-8 0z\", // triangle up\n    \"m0-4.95 4.95 4.95-4.95 4.95-4.95-4.95 4.95-4.95z\", // diamond\n    \"m0 4-4-8 8 0z\", // triangle down\n    \"m0-3.805 4.001 2.907-1.528 4.703-4.945 0-1.528-4.703z\", // pentagon\n];\n\n/** Standard open shapes for chart markers */\nconst emptyShapes: string[] = [\n    \"m0 2c1.105 0 2-.895 2-2 0-1.105-.895-2-2-2-1.105 0-2 .895-2 2 0 1.105.895 2 2 2zm0 2c-2.209 0-4-1.791-4-4 0-2.209 1.791-4 4-4 2.209 0 4 1.791 4 4 0 2.209-1.791 4-4 4z\", // circle empty\n    \"m-2-2 0 4 4 0 0-4-4 0zm-2-2 8 0 0 8-8 0 0-8z\", // square empty\n    \"m0-4-4 8 8.001 0-4.001-8zm0 3.354 1.573 3.146-3.145 0 1.572-3.146z\", // triangle up empty\n    \"m0-2.121-2.121 2.121 2.121 2.121 2.121-2.121-2.121-2.121zm0-2.828 4.95 4.95-4.95 4.95-4.95-4.95 4.95-4.95z\", // diamond empty\n    \"m0 4-4-8 8.001 0-4.001 8zm0-3.354 1.573-3.146-3.145 0 1.572 3.146z\", // triangle down empty\n    \"m0-1.951-2.237 1.626.855 2.63 2.766 0 .855-2.63-2.237-1.626zm0-1.854 4.001 2.907-1.528 4.703-4.945 0-1.528-4.703 4.001-2.907z\", // pentagon empty\n];\n/* eslint-enable max-len */\n\n/** Default chart marker set */\nexport const CHART_MARKERS: SvgMarker[] = [\n    ...regularShapes.map(\n        (s) => `<path class=\"nui-chart--path__outline\" d=\"${s}\"></path>`\n    ),\n    ...emptyShapes.map(\n        (s, i) =>\n            `<path class=\"nui-chart--path__outline-fill\" stroke=\"none\" d=\"${regularShapes[i]}\"></path>\n            <path class=\"nui-chart--path__outline\" d=\"${s}\"></path>`\n    ),\n].map((s) => new SvgMarker(s));\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { IChartMarker } from \"../types\";\nimport { SequentialValueProvider } from \"./sequential-value-provider\";\n\n/**\n * This class matches the provided markers to given series.\n * It keeps track of already given markers to given entities to avoid conflicts.\n */\nexport class SequentialChartMarkerProvider extends SequentialValueProvider<IChartMarker> {\n    constructor(private markers: IChartMarker[]) {\n        super(markers);\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { IChartMarker, IChartPalette, IValueProvider } from \"../types\";\nimport { ChartPalette } from \"./chart-palette\";\nimport { CHART_MARKERS, CHART_PALETTE_CS1 } from \"./palettes\";\nimport { SequentialChartMarkerProvider } from \"./sequential-chart-marker-provider\";\nimport { SequentialColorProvider } from \"./sequential-color-provider\";\n\nexport function defaultColorProvider(): IValueProvider<string> {\n    return new SequentialColorProvider(CHART_PALETTE_CS1);\n}\n\nexport function defaultPalette(): IChartPalette {\n    return new ChartPalette(defaultColorProvider());\n}\n\nexport function defaultMarkerProvider(): IValueProvider<IChartMarker> {\n    return new SequentialChartMarkerProvider(CHART_MARKERS);\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport {\n    defaultColorProvider,\n    defaultMarkerProvider,\n} from \"../../core/common/palette/default-providers\";\nimport {\n    DataAccessor,\n    IAccessors,\n    IDataAccessors,\n    ISeriesAccessors,\n    SeriesAccessor,\n} from \"../../core/common/types\";\n\nexport interface IAreaDataAccessors extends IDataAccessors {\n    x: DataAccessor;\n    x0: DataAccessor;\n    x1: DataAccessor;\n    absoluteX0: DataAccessor;\n    absoluteX1: DataAccessor;\n    y: DataAccessor;\n    y0: DataAccessor;\n    y1: DataAccessor;\n    absoluteY0: DataAccessor;\n    absoluteY1: DataAccessor;\n}\n\nexport interface IAreaSeriesAccessors extends ISeriesAccessors {\n    color?: SeriesAccessor;\n    marker?: SeriesAccessor;\n}\n\nexport interface IAreaAccessors extends IAccessors {\n    data: IAreaDataAccessors;\n    series: IAreaSeriesAccessors;\n}\n\nexport class AreaAccessors implements IAreaAccessors {\n    data: IAreaDataAccessors;\n    series: IAreaSeriesAccessors;\n\n    constructor(\n        private colorProvider = defaultColorProvider(),\n        private markerProvider = defaultMarkerProvider()\n    ) {\n        this.data = {\n            x: (d, i, ds, s) => d.x,\n            x0: (d, i, ds, s) => this.data.x(d, i, ds, s),\n            x1: (d, i, ds, s) => this.data.x(d, i, ds, s),\n            y: (d, i, ds, s) => d.y,\n            y0: (d, i, ds, s) => this.data.y(d, i, ds, s),\n            y1: (d, i, ds, s) => this.data.y(d, i, ds, s),\n            absoluteX0: (d, i, ds, s) =>\n                d[\"__stack_x\"]?.start ?? this.data.x0(d, i, ds, s),\n            absoluteX1: (d, i, ds, s) =>\n                d[\"__stack_x\"]?.end ?? this.data.x1(d, i, ds, s),\n            absoluteY0: (d, i, ds, s) =>\n                d[\"__stack_y\"]?.start ?? this.data.y0(d, i, ds, s),\n            absoluteY1: (d, i, ds, s) =>\n                d[\"__stack_y\"]?.end ?? this.data.y1(d, i, ds, s),\n        };\n\n        this.series = {\n            color: this.colorProvider ? this.colorProvider.get : undefined,\n            marker: this.markerProvider ? this.markerProvider.get : undefined,\n        };\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport {\n    DataAccessor,\n    IAccessors,\n    IDataAccessors,\n    ISeriesAccessors,\n    SeriesAccessor,\n} from \"../../core/common/types\";\n\nexport interface IStartEndRangeAccessors extends IDataAccessors {\n    start: DataAccessor;\n    end: DataAccessor;\n}\n\nexport interface IValueThicknessAccessors extends IDataAccessors {\n    value: DataAccessor;\n    thickness: DataAccessor;\n}\n\nexport interface IRectangleDataAccessors extends IDataAccessors {\n    startX?: DataAccessor;\n    endX?: DataAccessor;\n    thicknessX?: DataAccessor;\n\n    startY?: DataAccessor;\n    endY?: DataAccessor;\n    thicknessY?: DataAccessor;\n}\n\nexport interface IRectangleSeriesAccessors extends ISeriesAccessors {\n    color?: SeriesAccessor;\n    marker?: SeriesAccessor;\n}\n\nexport interface IRectangleAccessors extends IAccessors {\n    data: IRectangleDataAccessors;\n    series: IRectangleSeriesAccessors;\n}\n\nexport class RectangleAccessors implements IRectangleAccessors {\n    data: IRectangleDataAccessors;\n    series: IRectangleSeriesAccessors;\n\n    constructor() {}\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport {\n    defaultColorProvider,\n    defaultMarkerProvider,\n} from \"../../../core/common/palette/default-providers\";\nimport {\n    DataAccessor,\n    IAccessors,\n    IDataSeries,\n} from \"../../../core/common/types\";\nimport {\n    IRectangleDataAccessors,\n    IRectangleSeriesAccessors,\n    RectangleAccessors,\n} from \"../../accessors/rectangle-accessors\";\n\nexport interface IBarDataAccessors extends IRectangleDataAccessors {\n    category: DataAccessor;\n    start: DataAccessor;\n    end: DataAccessor;\n    thickness?: DataAccessor;\n    value?: DataAccessor;\n    color?: DataAccessor;\n    marker?: DataAccessor;\n    cssClass?: DataAccessor<any, string>;\n}\n\nexport interface IBarAccessors extends IAccessors {\n    data: IBarDataAccessors;\n    series: IRectangleSeriesAccessors;\n}\n\nexport abstract class BarAccessors\n    extends RectangleAccessors\n    implements IBarAccessors\n{\n    data: IBarDataAccessors;\n    series: IRectangleSeriesAccessors;\n\n    constructor(\n        private colorProvider = defaultColorProvider(),\n        private markerProvider = defaultMarkerProvider()\n    ) {\n        super();\n\n        this.data = {\n            value: (data: any) => data.value,\n            category: (\n                d,\n                i,\n                series: any[],\n                dataSeries: IDataSeries<IAccessors>\n            ) => {\n                if (d.category) {\n                    return d.category;\n                }\n\n                if (this.series.category) {\n                    return this.series.category(dataSeries.id, dataSeries);\n                }\n\n                return null;\n            },\n            start: (\n                data: any,\n                index: number,\n                series: any[],\n                dataSeries: IDataSeries<IAccessors>\n            ) => {\n                if (data.__bar) {\n                    return data.__bar.start;\n                }\n                if (typeof data.start !== \"undefined\") {\n                    return data.start;\n                }\n\n                const value = this.getSingleValue(\n                    data,\n                    index,\n                    series,\n                    dataSeries\n                );\n                if (Number.isFinite(value)) {\n                    return Math.min(0, value);\n                }\n\n                return null;\n            },\n            end: (\n                data: any,\n                index: number,\n                series: any[],\n                dataSeries: IDataSeries<IAccessors>\n            ) => {\n                if (data.__bar) {\n                    return data.__bar.end;\n                }\n                if (typeof data.end !== \"undefined\") {\n                    return data.end;\n                }\n\n                const value = this.getSingleValue(\n                    data,\n                    index,\n                    series,\n                    dataSeries\n                );\n                if (Number.isFinite(value)) {\n                    return Math.max(0, value);\n                }\n\n                return null;\n            },\n        };\n\n        this.series = {\n            color: this.colorProvider ? this.colorProvider.get : undefined,\n            marker: this.markerProvider ? this.markerProvider.get : undefined,\n            category: (seriesId, series) => series.name || series.id,\n        };\n    }\n\n    private getSingleValue(\n        data: any,\n        index: number,\n        series: any[],\n        dataSeries: IDataSeries<IAccessors>\n    ) {\n        let value: any;\n        if (this.data.value) {\n            // try to use the value accessor to retrieve value\n            value = this.data.value(data, index, series, dataSeries);\n            // if it fails to retrieve a valid value, then we consider the data point to be a primitive value that is returned directly\n            if (typeof value === \"undefined\") {\n                value = data;\n            }\n        }\n        return value;\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { BarAccessors, IBarDataAccessors } from \"./bar-accessors\";\nimport { IChartMarker, IValueProvider } from \"../../../core/common/types\";\nimport { IRectangleSeriesAccessors } from \"../../accessors/rectangle-accessors\";\n\nexport class HorizontalBarAccessors extends BarAccessors {\n    declare data: IBarDataAccessors;\n    declare series: IRectangleSeriesAccessors;\n\n    constructor(\n        colorProvider?: IValueProvider<string>,\n        markerProvider?: IValueProvider<IChartMarker>\n    ) {\n        super(colorProvider, markerProvider);\n\n        this.data = {\n            ...this.data,\n            startX: (d, i, s, ds) => this.data.start(d, i, s, ds),\n            endX: (d, i, s, ds) => this.data.end(d, i, s, ds),\n            startY: (d, i, s, ds) => this.data.category(d, i, s, ds),\n            endY: (d, i, s, ds) => this.data.category(d, i, s, ds),\n            thicknessY: (d, i, s, ds) =>\n                this.data.thickness\n                    ? this.data.thickness(d, i, s, ds)\n                    : undefined,\n        };\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { IBarAccessors, IBarDataAccessors } from \"./bar-accessors\";\nimport { DataAccessor } from \"../../../core/common/types\";\nimport { IRectangleSeriesAccessors } from \"../../accessors/rectangle-accessors\";\n\nexport interface IStatusDataAccessors extends IBarDataAccessors {\n    status: DataAccessor;\n}\n\nexport interface IStatusAccessors extends IBarAccessors {\n    data: IStatusDataAccessors;\n}\n\nexport class StatusAccessors implements IStatusAccessors {\n    public static STATUS_CATEGORY = \"status\";\n    public static STATUS_DOMAIN = [StatusAccessors.STATUS_CATEGORY];\n\n    public get data(): IStatusDataAccessors {\n        return this.barAccessors.data as IStatusDataAccessors;\n    }\n\n    public get series(): IRectangleSeriesAccessors {\n        return this.barAccessors.series;\n    }\n\n    constructor(private barAccessors: IBarAccessors) {\n        barAccessors.data.status = (d: any) => d.status;\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { HorizontalBarAccessors } from \"./horizontal-bar-accessors\";\nimport { StatusAccessors } from \"./status-accessors\";\nimport { IChartMarker, IValueProvider } from \"../../../core/common/types\";\n\nexport function statusAccessors(\n    colorProvider: IValueProvider<string>,\n    markerProvider?: IValueProvider<IChartMarker>\n): StatusAccessors {\n    const accessors = new StatusAccessors(\n        new HorizontalBarAccessors(colorProvider, markerProvider)\n    );\n    accessors.data.color = (d, i, s, ds) =>\n        colorProvider.get(accessors.data.status(d, i, s, ds));\n    accessors.data.category = () => StatusAccessors.STATUS_CATEGORY;\n    return accessors;\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\n/** The center position within a band on a band scale */\nexport const BAND_CENTER = 0.5;\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport isArray from \"lodash/isArray\";\n\nimport { BandScale } from \"../band-scale\";\nimport { BAND_CENTER } from \"../constants\";\nimport { isBandScale, IScale } from \"../types\";\n\n/**\n * Apart from just calling scale.convert, this method can also handle multilevel band scales that return arrays of values\n *\n * @param scale\n * @param value\n * @param {number} position Number in the range of [0, 1] that will define the point inside of the band. Where 0 stands for start.\n * @param levels how many levels deep can we go during the conversion\n */\nexport function convert(\n    scale: IScale<any>,\n    value: any,\n    position: number = BAND_CENTER,\n    levels: number = Number.MAX_VALUE\n): number {\n    if (!scale) {\n        return 0;\n    }\n    if (!isBandScale(scale)) {\n        return scale.convert(value);\n    }\n\n    const bandScale = scale as BandScale;\n    if (!isArray(value)) {\n        return bandScale.convert(value, position);\n    }\n    const values = value as any[];\n    if (values.length === 1 || !bandScale.innerScale || levels <= 1) {\n        return bandScale.convert(values[0], position);\n    }\n\n    return (\n        bandScale.convert(values[0], 0) +\n        convert(bandScale.innerScale, values.slice(1), position, levels - 1)\n    );\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport isArray from \"lodash/isArray\";\nimport isUndefined from \"lodash/isUndefined\";\n\nimport { BandScale } from \"../band-scale\";\nimport { isBandScale, IScale } from \"../types\";\n\nexport function invert(\n    scale: IScale<any>,\n    coordinate: number\n): number | string | unknown[] {\n    if (!scale) {\n        return 0;\n    }\n\n    const value = scale.invert(coordinate);\n\n    if (!isBandScale(scale) || isUndefined(value)) {\n        return value;\n    }\n    const bandScale = scale as BandScale<any>;\n    if (!bandScale.innerScale) {\n        return value;\n    }\n\n    const val = invert(\n        bandScale.innerScale,\n        coordinate - bandScale.convert(value, 0)\n    );\n    if (isArray(val)) {\n        return [value, ...val];\n    }\n\n    return [value, val];\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport identity from \"lodash/identity\";\nimport isEmpty from \"lodash/isEmpty\";\nimport isUndefined from \"lodash/isUndefined\";\n\nimport { IInteractionValues } from \"../plugins/types\";\nimport { invert } from \"./scales/helpers/invert\";\nimport { IScale } from \"./scales/types\";\n\nexport class UtilityService {\n    private static getValueAccessor(\n        accessor: (d: any, i: number) => any,\n        dataPoint: any\n    ) {\n        const value = accessor(dataPoint, 0);\n        if (typeof value === \"number\" || typeof value === \"string\") {\n            return accessor;\n        }\n        if (value.valueOf && typeof value.valueOf() === \"number\") {\n            return (d: any, i: number) => accessor(d, i).valueOf();\n        }\n\n        throw new Error(\n            \"Value in the data series does not return numeric valueOf().\"\n        );\n    }\n\n    public static getClosestIndex<T>(\n        haystack: T[],\n        accessor: (d: T, i: number) => any,\n        needle: any\n    ): number | undefined {\n        if (haystack.length === 1) {\n            return 0;\n        }\n        if (haystack.length === 0) {\n            return;\n        }\n\n        const valueAccessor = UtilityService.getValueAccessor(\n            accessor,\n            haystack[0]\n        );\n        if (typeof needle === \"string\") {\n            return haystack.findIndex(\n                (straw) => valueAccessor(straw, 0) === needle\n            );\n        }\n\n        let closestDataIndex = this.findNearestIndex(\n            haystack,\n            needle,\n            accessor\n        );\n\n        // Compensate for bisect\n        closestDataIndex =\n            closestDataIndex > 0 ? closestDataIndex - 1 : closestDataIndex;\n        // Ensure inbounds reference if right end of data\n        closestDataIndex =\n            closestDataIndex >= haystack.length - 1 && haystack.length !== 1\n                ? haystack.length - 2\n                : closestDataIndex;\n        const indexIncrement = UtilityService.getCloser(\n            valueAccessor(haystack[closestDataIndex], closestDataIndex),\n            valueAccessor(haystack[closestDataIndex + 1], closestDataIndex + 1),\n            needle\n        );\n\n        return closestDataIndex + indexIncrement;\n    }\n\n    private static getCloser(a: number, b: number, test: number): number {\n        return Math.abs(test - a) <= Math.abs(test - b) ? 0 : 1;\n    }\n\n    /**\n     * Clamps given value to range\n     *\n     * @param {number} value\n     * @param {[number , number]} range\n     * @returns {number}\n     */\n    public static clampToRange(value: number, range: [number, number]): number {\n        if (value < range[0]) {\n            return range[0];\n        }\n\n        if (value > range[1]) {\n            return range[1];\n        }\n\n        return value;\n    }\n\n    public static uuid(): string {\n        let dt = new Date().getTime();\n        const uuid = \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(\n            /[xy]/g,\n            (c) => {\n                // eslint-disable-next-line\n                const r = (dt + Math.random() * 16) % 16 | 0;\n                dt = Math.floor(dt / 16);\n                // eslint-disable-next-line\n                return (c === \"x\" ? r : (r & 0x3) | 0x8).toString(16);\n            }\n        );\n        return uuid;\n    }\n\n    /**\n     *  CSS.escape() replacement\n     * @param value\n     * @returns {string}\n     */\n    public static cssEscape(value: any): string {\n        // TODO: remove when Edge supports CSS.escape\n        // Courtesy of Mathias Bynens: https://github.com/mathiasbynens/CSS.escape.git\n        if (arguments.length === 0) {\n            throw new TypeError(\"`cssEscape` requires an argument.\");\n        }\n        const sstring = String(value);\n        const length = sstring.length;\n        let index = -1;\n        let codeUnit;\n        let result = \"\";\n        const firstCodeUnit = sstring.charCodeAt(0);\n        while (++index < length) {\n            codeUnit = sstring.charCodeAt(index);\n            // Note: there’s no need to special-case astral symbols, surrogate\n            // pairs, or lone surrogates.\n\n            // If the character is NULL (U+0000), then the REPLACEMENT CHARACTER\n            // (U+FFFD).\n            if (codeUnit === 0x0000) {\n                result += \"\\uFFFD\";\n                continue;\n            }\n\n            if (\n                // If the character is in the range [\\1-\\1F] (U+0001 to U+001F) or is\n                // U+007F, […]\n                (codeUnit >= 0x0001 && codeUnit <= 0x001f) ||\n                codeUnit === 0x007f ||\n                // If the character is the first character and is in the range [0-9]\n                // (U+0030 to U+0039), […]\n                (index === 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039) ||\n                // If the character is the second character and is in the range [0-9]\n                // (U+0030 to U+0039) and the first character is a `-` (U+002D), […]\n                (index === 1 &&\n                    codeUnit >= 0x0030 &&\n                    codeUnit <= 0x0039 &&\n                    firstCodeUnit === 0x002d)\n            ) {\n                // https://drafts.csswg.org/cssom/#escape-a-character-as-code-point\n                result += \"\\\\\" + codeUnit.toString(16) + \" \";\n                continue;\n            }\n\n            if (\n                // If the character is the first character and is a `-` (U+002D), and\n                // there is no second character, […]\n                index === 0 &&\n                length === 1 &&\n                codeUnit === 0x002d\n            ) {\n                result += \"\\\\\" + sstring.charAt(index);\n                continue;\n            }\n\n            // If the character is not handled by one of the above rules and is\n            // greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or\n            // is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to\n            // U+005A), or [a-z] (U+0061 to U+007A), […]\n            if (\n                codeUnit >= 0x0080 ||\n                codeUnit === 0x002d ||\n                codeUnit === 0x005f ||\n                (codeUnit >= 0x0030 && codeUnit <= 0x0039) ||\n                (codeUnit >= 0x0041 && codeUnit <= 0x005a) ||\n                (codeUnit >= 0x0061 && codeUnit <= 0x007a)\n            ) {\n                // the character itself\n                result += sstring.charAt(index);\n                continue;\n            }\n\n            // Otherwise, the escaped character.\n            // https://drafts.csswg.org/cssom/#escape-a-character\n            result += \"\\\\\" + sstring.charAt(index);\n        }\n        return result;\n    }\n\n    /**\n     * This method performs a binary search to find an index in the `haystack` that is the closest representation of given `needle`.\n     *\n     * @param haystack\n     * @param needle\n     * @param selector this function is used to process the `haystack` elements\n     */\n    public static findNearestIndex<T>(\n        haystack: T[],\n        needle: any,\n        selector: (d: T, index: number) => any = identity\n    ): number {\n        let low = 0,\n            high = haystack == null ? low : haystack.length;\n\n        while (low < high) {\n            // eslint-disable-next-line no-bitwise\n            const mid = (low + high) >>> 1,\n                computed = selector(haystack[mid], mid);\n\n            if (computed !== null && computed < needle) {\n                low = mid + 1;\n            } else {\n                high = mid;\n            }\n        }\n\n        return Math.round(low);\n    }\n\n    /**\n     * Gets the 'x' and 'y' scale values based on the specified scales and raw x-y coordinates\n     *\n     * @param xScales\n     * @param yScales\n     * @param xCoordinate\n     * @param yCoordinate\n     */\n    public static getXYValues(\n        xScales: IScale<any>[],\n        yScales: IScale<any>[],\n        xCoordinate: number,\n        yCoordinate: number\n    ): IInteractionValues {\n        const xValue = UtilityService.getScaleValues(xScales, xCoordinate);\n        const yValue = UtilityService.getScaleValues(yScales, yCoordinate);\n\n        const values: IInteractionValues = {};\n        if (!isEmpty(xValue)) {\n            values.x = xValue;\n        }\n        if (!isEmpty(yValue)) {\n            values.y = yValue;\n        }\n        return values;\n    }\n\n    /**\n     * Gets the scale value based on the specified scales and raw coordinate\n     *\n     * @param scales\n     * @param coordinate\n     */\n    public static getScaleValues(\n        scales: IScale<any>[],\n        coordinate: number\n    ): Record<string, any> {\n        function callbackFn(result: Record<string, any>, next: IScale<any>) {\n            const inverted = invert(next, coordinate);\n            if (isUndefined(inverted)) {\n                return result;\n            }\n\n            result[next.id] = inverted;\n            return result;\n        }\n        return scales.reduce(callbackFn, {});\n    }\n\n    /**\n     * get values for interaction\n     * @param valueMap map of values by scaleId\n     * @param scaleId preferred scaleId\n     * @returns value from scaleId or first availabel scale\n     */\n    public static getInteractionValues(\n        valueMap: Record<string, any> | null | undefined,\n        scaleId: string\n    ): any {\n        return valueMap\n            ? valueMap[scaleId] ?? Object.values(valueMap)[0]\n            : null;\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport isUndefined from \"lodash/isUndefined\";\nimport { Subject } from \"rxjs\";\n\nimport { DATA_POINT_INTERACTION_RESET } from \"../constants\";\nimport { IRenderSeries } from \"./types\";\nimport { Renderer } from \"../core/common/renderer\";\nimport { Scales } from \"../core/common/scales/types\";\nimport {\n    IAccessors,\n    IDataSeries,\n    IPosition,\n    IRendererEventPayload,\n} from \"../core/common/types\";\nimport { UtilityService } from \"../core/common/utility.service\";\n\nexport class XYRenderer<TA extends IAccessors> extends Renderer<TA> {\n    // This is empty to allow this renderer to be used for series that represent metadata that may be shown in the legend but not visualized on the chart.\n    /** See {@link Renderer#draw} */\n    public draw(\n        renderSeries: IRenderSeries<TA>,\n        rendererSubject: Subject<IRendererEventPayload>\n    ): void {}\n\n    /** See {@link Renderer#getDataPointPosition} */\n    public getDataPointPosition(\n        dataSeries: IDataSeries<TA>,\n        index: number,\n        scales: Scales\n    ): IPosition | undefined {\n        if (index < 0 || index >= dataSeries.data.length) {\n            return undefined;\n        }\n        const point = dataSeries.data[index];\n\n        if (!dataSeries.accessors.data?.x || !dataSeries.accessors.data?.y) {\n            throw new Error(\"Can't get dataPointPosition\");\n        }\n        return {\n            x: scales.x.convert(\n                dataSeries.accessors.data.x(\n                    point,\n                    index,\n                    dataSeries.data,\n                    dataSeries\n                )\n            ),\n            y: scales.y.convert(\n                dataSeries.accessors.data.y(\n                    point,\n                    index,\n                    dataSeries.data,\n                    dataSeries\n                )\n            ),\n        };\n    }\n\n    /** See {@link Renderer#getDataPointIndex} */\n    public getDataPointIndex(\n        series: IDataSeries<TA>,\n        values: { [p: string]: any },\n        scales: Scales\n    ): number {\n        if (isUndefined(values.x)) {\n            return DATA_POINT_INTERACTION_RESET;\n        }\n\n        const index = UtilityService.getClosestIndex(\n            series.data,\n            (d, i) => series.accessors.data?.x?.(d, i, series.data, series),\n            values.x\n        );\n\n        if (isUndefined(index)) {\n            throw new Error(\"Unable to get data point index\");\n        }\n\n        return index;\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { max, min } from \"d3-array\";\nimport { local } from \"d3-selection\";\nimport defaultsDeep from \"lodash/defaultsDeep\";\nimport flatten from \"lodash/flatten\";\nimport isArray from \"lodash/isArray\";\nimport isUndefined from \"lodash/isUndefined\";\nimport uniq from \"lodash/uniq\";\nimport { Subject } from \"rxjs\";\n\nimport {\n    DATA_POINT_INTERACTION_RESET,\n    SELECT_DATA_POINT_EVENT,\n} from \"../../constants\";\nimport { convert } from \"../../core/common/scales/helpers/convert\";\nimport {\n    EMPTY_CONTINUOUS_DOMAIN,\n    isBandScale,\n    IScale,\n    Scales,\n} from \"../../core/common/scales/types\";\nimport {\n    IDataPoint,\n    IDataSeries,\n    IPosition,\n    IRendererEventPayload,\n} from \"../../core/common/types\";\nimport {\n    IRectangleAccessors,\n    IRectangleDataAccessors,\n} from \"../accessors/rectangle-accessors\";\nimport { IBarRendererConfig, IRenderSeries, RenderLayerName } from \"../types\";\nimport { XYRenderer } from \"../xy-renderer\";\n\n/**\n * Renderer that is able to draw bar chart\n */\nexport class BarRenderer extends XYRenderer<IRectangleAccessors> {\n    /**\n     * Creates an instance of BarRenderer.\n     * @param {IBarRendererConfig} [config] Renderer configuration object\n     */\n    constructor(public config: IBarRendererConfig = {}) {\n        super(config);\n        // setting default values to the properties that were not set by user\n        this.config = defaultsDeep(this.config, this.DEFAULT_CONFIG);\n    }\n\n    public static THICK = 11; // 10px + 1 to compensate outline\n    public static THIN = 3; // 2px + 1 to compensate outline\n    public static MIN_BAR_SIZE_FOR_ICON = 10; // Min bar size to render an icon inside.\n    public static MIN_BAR_THICKNESS = 2;\n    public static readonly BAR_RECT_CLASS = \"bar\";\n\n    public DEFAULT_CONFIG: IBarRendererConfig = {\n        transitionDuration: 300,\n        padding: 1,\n        barClass: \"bar-outline\",\n        highlightStrategy: undefined,\n        pointerEvents: true,\n        enableMinBarThickness: true,\n    };\n\n    public readonly barContainerClass = \"bar-container\";\n\n    /** See {@link Renderer#draw} */\n    public draw(\n        renderSeries: IRenderSeries<IRectangleAccessors>,\n        rendererSubject: Subject<IRendererEventPayload>\n    ): void {\n        const target = renderSeries.containers[RenderLayerName.data];\n        const dataSeries = renderSeries.dataSeries;\n        const accessors = dataSeries.accessors;\n\n        const attrsGenerator = this.getAttrsGenerator(\n            dataSeries,\n            renderSeries.scales\n        );\n\n        // We define here a local d3 variable to later re-use saved here data\n        const generatedAttrs = local<IPosition>();\n\n        // TODO: This is tricky: we should not draw anything for hidden data\n        // (seriesOffset will be undefined and this means we should provide empty array to d3).\n        // TODO fix this\n        const bars = target\n            .selectAll(`g.${this.barContainerClass}`)\n            .data(dataSeries.data);\n\n        bars.exit().remove();\n\n        const barContainers = bars\n            .enter()\n            .append(\"g\")\n            .classed(this.barContainerClass, true);\n\n        barContainers.append(\"rect\").on(\"click\", (d: any, i: number) => {\n            this.emitBarClick(renderSeries, d, i, rendererSubject);\n        });\n\n        const getCssClass = (d: any, i: number) =>\n            (typeof accessors.data?.cssClass !== \"undefined\" &&\n                \" \" +\n                    accessors.data.cssClass(\n                        d,\n                        i,\n                        dataSeries.data,\n                        dataSeries\n                    )) ||\n            \"\";\n\n        barContainers\n            .merge(bars as any)\n            .property(generatedAttrs, (d, i) => attrsGenerator(d, i)) // This saves attrsGenerator() output to local d3 variable generatedAttrs\n            .select<Element>(\"rect\")\n            .attr(\n                \"class\",\n                (d, i) =>\n                    `${BarRenderer.BAR_RECT_CLASS} ${this.config.barClass}${\n                        this.config.pointerEvents ? \" pointer-events\" : \"\"\n                    }` + getCssClass(d, i)\n            )\n            .style(\"cursor\", this.config.cursor ?? \"\")\n            .style(\"stroke-width\", this.config?.strokeWidth ?? \"\")\n            .style(\"fill\", (d: any, i: number) =>\n                accessors.data.color\n                    ? accessors.data.color(d, i, dataSeries.data, dataSeries)\n                    : accessors.series.color?.(dataSeries.id, dataSeries)\n            )\n            .attrs(function () {\n                // @ts-ignore: Suppressing shadowed this and implicit any type error\n                return generatedAttrs.get(this) as any;\n            })\n            .select<Element>(\"rect\")\n            .style(\"fill\", (d: any, i: number) =>\n                accessors.data.color\n                    ? accessors.data.color(d, i, dataSeries.data, dataSeries)\n                    : accessors.series.color?.(dataSeries.id, dataSeries)\n            )\n            .attrs(generatedAttrs.get as any); // TODO: find a way to convert to ValueMap<>\n\n        if (accessors.data.marker) {\n            barContainers.append(\"g\").classed(\"bar-icon\", true);\n\n            barContainers\n                .merge(bars as any)\n                .select<Element>(\"g.bar-icon\")\n                .html(function (d, i) {\n                    const barSize = generatedAttrs.get(this);\n\n                    if (\n                        !barSize ||\n                        isUndefined(barSize?.height) ||\n                        isUndefined(barSize?.width)\n                    ) {\n                        throw new Error(\"barSize is undefined\");\n                    }\n\n                    const minBarSide =\n                        Math.min(barSize.height, barSize.width) - 1;\n                    if (minBarSide >= BarRenderer.MIN_BAR_SIZE_FOR_ICON) {\n                        return accessors.data.marker?.(\n                            d,\n                            i,\n                            dataSeries.data,\n                            dataSeries\n                        );\n                    }\n                })\n                .attr(\"transform\", function (this) {\n                    const barAttrs = generatedAttrs.get(this);\n\n                    if (\n                        !barAttrs ||\n                        isUndefined(barAttrs?.height) ||\n                        isUndefined(barAttrs?.width)\n                    ) {\n                        throw new Error(\"barAttrs is undefined\");\n                    }\n\n                    return `translate(${\n                        barAttrs.x + barAttrs.width / 2\n                    }, ${barAttrs.y + barAttrs.height / 2})`;\n                });\n        }\n    }\n\n    /** See {@link Renderer#getDataPointIndex} */\n    public getDataPointIndex(\n        series: IDataSeries<IRectangleAccessors>,\n        values: { [p: string]: any },\n        scales: Scales\n    ): number {\n        return this.config.highlightStrategy\n            ? this.config.highlightStrategy.getDataPointIndex(\n                  this,\n                  series,\n                  values,\n                  scales\n              )\n            : DATA_POINT_INTERACTION_RESET;\n    }\n\n    /** See {@link Renderer#highlightDataPoint} */\n    public highlightDataPoint(\n        renderSeries: IRenderSeries<IRectangleAccessors>,\n        dataPointIndex: number,\n        rendererSubject: Subject<IRendererEventPayload>\n    ): void {\n        if (this.config.highlightStrategy) {\n            this.config.highlightStrategy.highlightDataPoint(\n                this,\n                renderSeries,\n                dataPointIndex,\n                rendererSubject\n            );\n        }\n    }\n\n    /** See {@link Renderer#getDataPointPosition} */\n    public getDataPointPosition(\n        dataSeries: IDataSeries<IRectangleAccessors>,\n        index: number,\n        scales: Scales\n    ): IPosition {\n        const d = dataSeries.data[index];\n        return d && this.getAttrsGenerator(dataSeries, scales)(d, index);\n    }\n\n    public getDataPoint(\n        renderSeries: IRenderSeries<IRectangleAccessors>,\n        data: any,\n        i: number\n    ): IDataPoint {\n        return {\n            seriesId: renderSeries.dataSeries.id,\n            dataSeries: renderSeries.dataSeries,\n            index: i,\n            data: data,\n            position: data\n                ? this.getDataPointPosition(\n                      renderSeries.dataSeries,\n                      i,\n                      renderSeries.scales\n                  )\n                : undefined,\n        };\n    }\n\n    public filterDataByDomain(data: any[]): any[] {\n        return data;\n    }\n\n    public getDomain(\n        data: any[],\n        dataSeries: IDataSeries<IRectangleAccessors>,\n        scaleKey: string,\n        scale: IScale<any>\n    ): any[] {\n        const accessors = dataSeries.accessors.data;\n        const accessorSuffix = scaleKey.toUpperCase();\n        const accessor =\n            (name: string) => (d: any, i: number, arr: ArrayLike<unknown>) =>\n                accessors[name + accessorSuffix]?.(\n                    d,\n                    i,\n                    Array.from(arr),\n                    dataSeries\n                );\n        if (scale.isContinuous()) {\n            return !data || data.length === 0\n                ? EMPTY_CONTINUOUS_DOMAIN\n                : [min(data, accessor(\"start\")), max(data, accessor(\"end\"))];\n        } else {\n            const values =\n                data && data.length > 0 ? data.map(accessor(\"start\")) : [];\n            const maxLength = Math.max(\n                ...values.map((d) => (isArray(d) ? d.length : -1))\n            );\n            if (maxLength >= 0) {\n                return Array.from(Array(maxLength)).map((e, i) => {\n                    const scalesDomains = values.map((d) =>\n                        i < d.length ? d[i] : []\n                    );\n                    return uniq(flatten(scalesDomains));\n                });\n            } else {\n                return [uniq(values)];\n            }\n        }\n    }\n\n    protected emitBarClick(\n        renderSeries: IRenderSeries<IRectangleAccessors>,\n        data: any,\n        i: number,\n        rendererSubject: Subject<IRendererEventPayload>\n    ): void {\n        rendererSubject.next({\n            eventName: SELECT_DATA_POINT_EVENT,\n            data: this.getDataPoint(renderSeries, data, i),\n        });\n    }\n\n    /**\n     * Returns function to generate attributes to draw bar from dataSeries that typically comes from preprocessor with help of accessors that\n     * are aware of how to access renderParameters to draw individual bars\n     * @param dataSeries Series to draw\n     * @param scales Scales used to draw bars\n     * Except of bars this is also used for highlights (which may have a bit different values)\n     */\n    protected getAttrsGenerator(\n        dataSeries: IDataSeries<IRectangleAccessors>,\n        scales: Scales\n    ): (d: any, i: number) => IPosition {\n        const accessors = dataSeries.accessors.data;\n        return (d: any, i: number): IPosition => {\n            const x = this.getDimensions(\n                accessors,\n                d,\n                i,\n                dataSeries,\n                scales.x,\n                \"X\"\n            );\n            const y = this.getDimensions(\n                accessors,\n                d,\n                i,\n                dataSeries,\n                scales.y,\n                \"Y\"\n            );\n\n            return {\n                x: x.start,\n                width: x.thickness,\n                y: y.start,\n                height: y.thickness,\n            };\n        };\n    }\n\n    private getDimensions(\n        accessors: IRectangleDataAccessors,\n        d: any,\n        i: number,\n        dataSeries: IDataSeries<IRectangleAccessors>,\n        scale: IScale<any>,\n        accessorSuffix: string\n    ): { thickness: number; start: number } {\n        let start: number;\n        let thickness: number;\n\n        const thicknessAccessor = accessors[\"thickness\" + accessorSuffix];\n        const startAccessor =\n            dataSeries.accessors.data[\"start\" + accessorSuffix];\n        const endAccessor = dataSeries.accessors.data[\"end\" + accessorSuffix];\n        thickness = thicknessAccessor?.(d, i, dataSeries.data, dataSeries);\n\n        if (!isUndefined(thickness)) {\n            if (!startAccessor) {\n                throw new Error(\"Can't compute dimensions\");\n            }\n\n            start =\n                convert(\n                    scale,\n                    startAccessor(d, i, dataSeries.data, dataSeries),\n                    0.5\n                ) -\n                thickness / 2;\n        } else {\n            if (!startAccessor || !endAccessor) {\n                throw new Error(\"Can't compute dimensions\");\n            }\n\n            const x1 = convert(\n                scale,\n                startAccessor(d, i, dataSeries.data, dataSeries),\n                0\n            );\n            const x2 = convert(\n                scale,\n                endAccessor(d, i, dataSeries.data, dataSeries),\n                1\n            );\n\n            start = Math.min(x1, x2);\n            thickness = Math.abs(x1 - x2);\n\n            if (isBandScale(scale)) {\n                if (isUndefined(this.config.padding)) {\n                    throw new Error(\"Config is not defined\");\n                }\n                start += this.config.padding;\n                thickness -= this.config.padding * 2;\n            }\n\n            if (this.config.enableMinBarThickness) {\n                thickness = Math.max(thickness, BarRenderer.MIN_BAR_THICKNESS);\n            }\n        }\n        return { start, thickness };\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { IMarkerInteractionConfig, RenderState } from \"./types\";\nimport { IRendererConfig } from \"../core/common/types\";\n\n/** Renderer configuration for the thresholds on a chart */\nexport const THRESHOLDS_MAIN_CHART_RENDERER_CONFIG: IRendererConfig = {\n    stateStyles: {\n        [RenderState.default]: {\n            opacity: 0,\n        },\n        [RenderState.hidden]: {\n            opacity: 0,\n        },\n        [RenderState.deemphasized]: {\n            opacity: 0,\n        },\n        [RenderState.emphasized]: {\n            opacity: 1,\n        },\n    },\n    ignoreForDomainCalculation: true,\n};\n\n/** Renderer configuration for a thresholds summary chart */\nexport const THRESHOLDS_SUMMARY_RENDERER_CONFIG: IRendererConfig = {\n    stateStyles: {\n        [RenderState.default]: {\n            opacity: 0.3,\n        },\n        [RenderState.hidden]: {\n            opacity: 0,\n        },\n        [RenderState.deemphasized]: {\n            opacity: 0,\n        },\n        [RenderState.emphasized]: {\n            opacity: 1,\n        },\n    },\n    ignoreForDomainCalculation: true,\n};\n\n/** Default configuration for marker interaction */\nexport const DEFAULT_MARKER_INTERACTION_CONFIG: IMarkerInteractionConfig = {\n    enabled: false,\n    clickable: false,\n};\n\n/**\n * Class name for gauge threshold markers\n */\nexport const GAUGE_THRESHOLD_MARKER_CLASS = \"gauge-threshold-marker\";\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { DataAccessor, IAccessors } from \"../../core/common/types\";\n\nexport interface IXYDataAccessors {\n    /** Accessor for value plotted on the <code>x</code> coordinate */\n    x: DataAccessor;\n    /** Accessor for value plotted on the <code>y</code> coordinate */\n    y: DataAccessor;\n    /** Additional custom keys to match the base interface */\n    [key: string]: DataAccessor | undefined;\n}\n\nexport class XYAccessors implements IAccessors {\n    /** The default data accessors for using with renderers deriving from XYRenderer */\n    public data: IXYDataAccessors = {\n        x: (d: any): number | undefined => d.x,\n        y: (d: any): number | undefined => d.y,\n    };\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport {\n    defaultColorProvider,\n    defaultMarkerProvider,\n} from \"../../core/common/palette/default-providers\";\nimport {\n    DataAccessor,\n    IAccessors,\n    SeriesAccessor,\n} from \"../../core/common/types\";\nimport { IXYDataAccessors, XYAccessors } from \"../accessors/xy-accessors\";\n\nexport interface ILineDataAccessors extends IXYDataAccessors {\n    defined?: DataAccessor<any, boolean>;\n}\n\n/**\n * Series accessors used in {@link LineAccessors}.\n */\nexport interface ILineSeriesAccessors {\n    /** Color of the series */\n    color?: SeriesAccessor;\n    /** Marker for the series */\n    marker?: SeriesAccessor;\n    /** Additional custom keys to match the base interface */\n    [key: string]: SeriesAccessor | undefined;\n}\n\nexport interface ILineAccessors extends IAccessors {\n    data: ILineDataAccessors;\n    /** Series level accessors - e.g. for colors, markers, etc. */\n    series: ILineSeriesAccessors;\n}\n\n/**\n * Accessor class supporting the {@link LineRenderer}, that defines required inputs acquired from data points.\n * This class includes default behavior for all required fields. It's using properties of the same name for data accessors.\n * <p>\n * If colorProvider or markerProvider is not defined in the constructor, every new instance of LineAccessors will instantiate it's own, so that has to be\n * kept in mind when configuring charts as it could cause potential color synchronization problems.\n *\n * <p>See referenced <code>data</code> and <code>series</code> interfaces for required properties.</p>\n */\nexport class LineAccessors extends XYAccessors implements ILineAccessors {\n    public declare data: ILineDataAccessors;\n    public series: ILineSeriesAccessors;\n\n    constructor(\n        public colorProvider = defaultColorProvider(),\n        public markerProvider = defaultMarkerProvider()\n    ) {\n        super();\n\n        this.data.defined = (d: any, i) =>\n            d.hasOwnProperty(\"defined\") ? d.defined : true;\n\n        this.series = {\n            color: this.colorProvider ? this.colorProvider.get : undefined,\n            marker: this.markerProvider ? this.markerProvider.get : undefined,\n        };\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { IScale } from \"../types\";\n\n/**\n * Simple utility function that checks if given 'px' value is within the interval of the range of given scale\n *\n * @param scale\n * @param px\n */\nexport function isInRange(scale: IScale<any>, px: number): boolean {\n    const r = scale.range().map((a) => a);\n    const min = Math.min(r[0], r[1]);\n    const max = Math.max(r[0], r[1]);\n\n    return px >= min && px <= max;\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { Subject } from \"rxjs\";\n\nimport { UtilService } from \"@nova-ui/bits\";\n\nimport {\n    DATA_POINT_INTERACTION_RESET,\n    INTERACTION_DATA_POINT_EVENT,\n} from \"../constants\";\nimport { DEFAULT_MARKER_INTERACTION_CONFIG } from \"./constants\";\nimport { isInRange } from \"../core/common/scales/helpers/is-in-range\";\nimport { IXYScales } from \"../core/common/scales/types\";\nimport {\n    D3Selection,\n    IAccessors,\n    IChartMarker,\n    IDataPoint,\n    IDataSeries,\n    IInteractionDataPointEvent,\n    InteractionType,\n    IRendererEventPayload,\n} from \"../core/common/types\";\n\nexport class MarkerUtils {\n    /** The default class for the marker's container */\n    public static readonly DEFAULT_MARKER_CONTAINER_CLASS = \"marker\";\n\n    /** The class used for the marker's svg path */\n    public static readonly MARKER_PATH_CLASS = \"marker-path\";\n\n    /**\n     * This method impersonates marker related logic used in various renderers\n     *\n     * @param dataSeries\n     * @param scales\n     * @param dataPointIndex\n     * @param container\n     * @param rendererSubject\n     */\n    public static manageMarker(\n        dataSeries: IDataSeries<IAccessors>,\n        scales: IXYScales,\n        dataPointIndex: number,\n        container: D3Selection<SVGGElement>,\n        rendererSubject: Subject<IRendererEventPayload>,\n        markerInteractionConfig = DEFAULT_MARKER_INTERACTION_CONFIG\n    ): void {\n        if (!container) {\n            throw new Error(\"Container doesn't exist!\");\n        }\n\n        if (dataSeries.data.length === 0) {\n            MarkerUtils.removeMarker(container);\n            return;\n        }\n\n        const accessors = dataSeries.accessors;\n\n        if (dataPointIndex < 0) {\n            dataPointIndex = dataSeries.data.length - 1;\n        }\n\n        const dataPoint = dataSeries.data[dataPointIndex];\n\n        if (!accessors.data?.x || !accessors.data.y) {\n            throw new Error(\"Color or marker are undefined\");\n        }\n\n        const x = scales.x.convert(\n            accessors.data.x(\n                dataPoint,\n                dataPointIndex,\n                dataSeries.data,\n                dataSeries\n            )\n        );\n        const y = scales.y.convert(\n            accessors.data.y(\n                dataPoint,\n                dataPointIndex,\n                dataSeries.data,\n                dataSeries\n            )\n        );\n\n        if (\n            typeof x !== \"undefined\" &&\n            typeof y !== \"undefined\" &&\n            isInRange(scales.x, x) &&\n            isInRange(scales.y, y)\n        ) {\n            const seriesId = dataSeries.id;\n            const dataPointInfo: IDataPoint = {\n                index: dataPointIndex,\n                data: dataPoint,\n                seriesId: seriesId,\n                position: { x, y },\n                dataSeries,\n            };\n\n            if (!accessors.series?.marker || !accessors.series?.color) {\n                throw new Error(\"Color or marker are undefined\");\n            }\n\n            MarkerUtils.drawMarker(\n                dataPointInfo,\n                accessors.series.marker(seriesId, dataSeries),\n                accessors.series.color(seriesId, dataSeries),\n                container,\n                rendererSubject,\n                MarkerUtils.DEFAULT_MARKER_CONTAINER_CLASS,\n                markerInteractionConfig\n            );\n        } else {\n            MarkerUtils.removeMarker(container);\n        }\n    }\n\n    public static drawMarker(\n        dataPoint: IDataPoint,\n        marker: IChartMarker,\n        color: string,\n        target: D3Selection<SVGGElement>,\n        dataPointSubject: Subject<\n            IRendererEventPayload<IInteractionDataPointEvent>\n        >,\n        className: string = MarkerUtils.DEFAULT_MARKER_CONTAINER_CLASS,\n        markerInteractionConfig = DEFAULT_MARKER_INTERACTION_CONFIG\n    ): void {\n        let markerTarget: D3Selection | D3Selection<SVGGElement> =\n            target.select(`g.${className}`);\n        const xCoord = dataPoint?.position?.x;\n        const yCoord = dataPoint?.position?.y;\n        const attrs = {\n            transform: `translate(${xCoord}, ${yCoord})`,\n            cursor: \"crosshair\",\n        };\n\n        const getPointerEventsClass = () =>\n            `${markerInteractionConfig.enabled ? \" pointer-events\" : \"\"}`;\n        const getPointerEventsClickClass = () =>\n            `${\n                markerInteractionConfig.enabled &&\n                markerInteractionConfig.clickable\n                    ? \" pointer-events-click\"\n                    : \"\"\n            }`;\n\n        if (markerTarget.empty()) {\n            markerTarget = target\n                .append(\"g\")\n                .classed(\n                    `${className}${getPointerEventsClass()}${getPointerEventsClickClass()}`,\n                    true\n                );\n        }\n\n        marker.setColor(color);\n        markerTarget.attrs(attrs);\n\n        markerTarget.on(\"mouseenter\", () => {\n            dataPointSubject.next({\n                eventName: INTERACTION_DATA_POINT_EVENT,\n                data: { interactionType: InteractionType.Hover, dataPoint },\n            });\n        });\n        markerTarget.on(\"mouseleave\", () => {\n            dataPointSubject.next({\n                eventName: INTERACTION_DATA_POINT_EVENT,\n                data: {\n                    interactionType: InteractionType.Hover,\n                    dataPoint: {\n                        ...dataPoint,\n                        index: DATA_POINT_INTERACTION_RESET,\n                    },\n                },\n            });\n        });\n        markerTarget.on(\"click\", () => {\n            dataPointSubject.next({\n                eventName: INTERACTION_DATA_POINT_EVENT,\n                data: { interactionType: InteractionType.Click, dataPoint },\n            });\n        });\n\n        if (\n            !(<D3Selection<SVGGElement>>markerTarget)\n                .selectAll(\"g > *\")\n                .size() &&\n            markerTarget.node()\n        ) {\n            markerTarget\n                .node()\n                ?.appendChild(UtilService.getSvgFromString(marker.getSvg()));\n            (<D3Selection<SVGGElement>>markerTarget)\n                .select(\"path\")\n                .classed(MarkerUtils.MARKER_PATH_CLASS, true);\n        }\n\n        const path = (<D3Selection<SVGGElement>>markerTarget)\n            .select(\"path\")\n            .node() as HTMLElement;\n        if (path && markerInteractionConfig.enabled) {\n            // Hack to accommodate existing Firefox hack in MouseInteractiveArea\n            const pathRect = path.getBoundingClientRect();\n            // 'x' in this case represents the absolute position of the left side of the marker\n            path.setAttribute(\n                \"x\",\n                Math.ceil(\n                    (dataPoint?.position?.x as number) - pathRect.width / 2\n                ).toString()\n            );\n            // 'y' in this case represents the absolute position of the top side of the marker\n            path.setAttribute(\n                \"y\",\n                Math.ceil(\n                    (dataPoint?.position?.y as number) - pathRect.height / 2\n                ).toString()\n            );\n        }\n    }\n\n    public static removeMarker(\n        target: D3Selection<SVGGElement>,\n        className: string = MarkerUtils.DEFAULT_MARKER_CONTAINER_CLASS\n    ): void {\n        target.select(`g.${className}`).remove();\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { curveLinear, line } from \"d3-shape\";\nimport defaultsDeep from \"lodash/defaultsDeep\";\nimport { Subject } from \"rxjs\";\n\nimport { STANDARD_RENDER_LAYERS } from \"../../constants\";\nimport { IXYScales, Scales } from \"../../core/common/scales/types\";\nimport {\n    D3Selection,\n    IDataSeries,\n    ILasagnaLayer,\n    IPosition,\n    IRendererEventPayload,\n} from \"../../core/common/types\";\nimport { DEFAULT_MARKER_INTERACTION_CONFIG } from \"../constants\";\nimport { MarkerUtils } from \"../marker-utils\";\nimport { ILineRendererConfig, IRenderSeries, RenderLayerName } from \"../types\";\nimport { XYRenderer } from \"../xy-renderer\";\nimport { ILineAccessors } from \"./line-accessors\";\n\n/**\n * Renderer that is able to draw line chart\n */\nexport class LineRenderer extends XYRenderer<ILineAccessors> {\n    public static UNCLIPPED_DATA_LAYER_NAME = \"unclipped-data\";\n    public static LINE_CAP_CLASS_NAME = \"nui-chart-line-cap\";\n\n    public static getStrokeStyleDashed(width: number): string {\n        const dash = width * 2;\n        return `${dash},${dash}`;\n    }\n\n    public static getStrokeStyleDotted(width: number): string {\n        return `${width},${width}`;\n    }\n\n    private DEFAULT_CONFIG: ILineRendererConfig = {\n        strokeWidth: 2,\n        curveType: curveLinear,\n        interactive: true,\n        strokeStyle: \"\",\n        strokeLinecap: \"round\",\n        markerInteraction: DEFAULT_MARKER_INTERACTION_CONFIG,\n        useEnhancedLineCaps: false,\n        enhancedLineCap: {\n            radius: 3,\n        },\n    };\n\n    /**\n     * Creates an instance of LineRenderer.\n     * @param {ILineRendererConfig} [config={}] Renderer configuration object\n     */\n    constructor(public readonly config: ILineRendererConfig = {}) {\n        super(config);\n        // setting default values to the properties that were not set by user\n        this.config = defaultsDeep(this.config, this.DEFAULT_CONFIG);\n    }\n\n    /** See {@link Renderer#draw} */\n    public draw(\n        renderSeries: IRenderSeries<ILineAccessors>,\n        rendererSubject: Subject<IRendererEventPayload>\n    ): void {\n        const target = renderSeries.containers[RenderLayerName.data];\n\n        const strokeValue = renderSeries.dataSeries.accessors.series.color?.(\n            renderSeries.dataSeries.id,\n            renderSeries.dataSeries\n        );\n        let path: D3Selection<SVGPathElement> = target.select(\"path.main\");\n\n        if (path.empty()) {\n            path = target\n                .append(\"path\")\n                .classed(\"main\", true)\n                // Assigning null value to match ValueMap<GElement, Datum> D3's signature\n                .attrs({\n                    stroke: strokeValue ?? null,\n                    \"stroke-width\": this.config.strokeWidth ?? null,\n                    \"stroke-dasharray\": this.config.strokeStyle ?? null,\n                    \"stroke-linecap\": this.config.strokeLinecap ?? null,\n                    fill: \"none\",\n                });\n        }\n        this.drawLine(renderSeries, path);\n\n        if (this.config.interactionStrategy) {\n            this.config.interactionStrategy.draw(\n                this,\n                renderSeries,\n                rendererSubject\n            );\n        }\n    }\n\n    /**\n     * When the data contains only one data point with undefined 'x' value, it is considered an infinite line and special approach is applied\n     *\n     * @param renderSeries\n     */\n    public isInfiniteLineData(\n        renderSeries: IRenderSeries<ILineAccessors>\n    ): boolean {\n        const dataSeries = renderSeries.dataSeries;\n        return (\n            dataSeries.data.length === 1 &&\n            typeof dataSeries.accessors.data.x(\n                dataSeries.data[0],\n                0,\n                dataSeries.data,\n                dataSeries\n            ) === \"undefined\"\n        );\n    }\n\n    /**\n     * Renders the line in prepared <path> element\n     *\n     * @param {IRenderSeries<ILineAccessors>} renderSeries\n     * @param {D3Selection} path D3 Selection with <path> element pre-created and pre-styled\n     */\n    public drawLine(\n        renderSeries: IRenderSeries<ILineAccessors>,\n        path: D3Selection<SVGPathElement>\n    ): void {\n        if (this.isInfiniteLineData(renderSeries)) {\n            this.drawInfiniteLine(renderSeries, path);\n        } else {\n            this.drawStandardLine(renderSeries, path);\n        }\n    }\n\n    /** See {@link Renderer#highlightDataPoint} */\n    public highlightDataPoint(\n        renderSeries: IRenderSeries<ILineAccessors>,\n        dataPointIndex: number,\n        rendererSubject: Subject<IRendererEventPayload>\n    ): void {\n        if (!this.config.interactive) {\n            return;\n        }\n        const dataSeries = renderSeries.dataSeries;\n        const accessors = dataSeries.accessors;\n        if (!accessors.series.marker) {\n            return;\n        }\n\n        MarkerUtils.manageMarker(\n            dataSeries,\n            renderSeries.scales as IXYScales,\n            dataPointIndex,\n            renderSeries.containers[RenderLayerName.foreground],\n            rendererSubject,\n            this.config.markerInteraction\n        );\n    }\n\n    /** See {@link Renderer#getRequiredLayers} */\n    public getRequiredLayers(): ILasagnaLayer[] {\n        return [\n            STANDARD_RENDER_LAYERS[RenderLayerName.data],\n            STANDARD_RENDER_LAYERS[RenderLayerName.foreground],\n            STANDARD_RENDER_LAYERS[RenderLayerName.unclippedData],\n        ];\n    }\n\n    /** See {@link Renderer#getDataPointPosition} */\n    public getDataPointPosition(\n        dataSeries: IDataSeries<ILineAccessors>,\n        index: number,\n        scales: Scales\n    ): IPosition | undefined {\n        // TODO: consider including size of the marker once we have them rendered as symbols\n        return super.getDataPointPosition(dataSeries, index, scales);\n    }\n\n    private drawStandardLine(\n        renderSeries: IRenderSeries<ILineAccessors>,\n        path: D3Selection<SVGPathElement>\n    ) {\n        const dataSeries = renderSeries.dataSeries;\n        const accessors = dataSeries.accessors;\n\n        let warned = false;\n        const validatedData = dataSeries.data.filter((d, i) => {\n            const valid =\n                typeof accessors.data.x(d, i, dataSeries.data, dataSeries) !==\n                    \"undefined\" &&\n                typeof accessors.data.y(d, i, dataSeries.data, dataSeries) !==\n                    \"undefined\";\n            if (!valid && !warned) {\n                console.warn(\n                    \"Data point\",\n                    d,\n                    \"was skipped as accessors didn't manage to extract any data.\"\n                );\n                console.warn(\" -> accessors.data.x:\", accessors.data.x);\n                console.warn(\" -> accessors.data.y:\", accessors.data.y);\n                warned = true;\n            }\n            return valid;\n        });\n\n        if (!this.config.curveType) {\n            throw new Error(\"curveType is not defined\");\n        }\n\n        const lineFunc = line()\n            .x((d: any, i: number) =>\n                renderSeries.scales.x.convert(\n                    accessors.data.x(d, i, dataSeries.data, dataSeries)\n                )\n            )\n            .y((d: any, i: number) =>\n                renderSeries.scales.y.convert(\n                    accessors.data.y(d, i, dataSeries.data, dataSeries)\n                )\n            )\n            .defined((d: any, i: number) =>\n                accessors.data.defined\n                    ? accessors.data.defined(d, i, dataSeries.data, dataSeries)\n                    : true\n            )\n            .curve(this.config.curveType);\n\n        path.attr(\"d\", lineFunc(validatedData) ?? \"\");\n\n        if (this.config.useEnhancedLineCaps) {\n            this.updateLineCaps(\n                validatedData,\n                renderSeries,\n                this.config.enhancedLineCap?.fill || path.attr(\"stroke\")\n            );\n        }\n    }\n\n    private drawInfiniteLine(\n        renderSeries: IRenderSeries<ILineAccessors>,\n        path: D3Selection<SVGPathElement>\n    ) {\n        const dataSeries = renderSeries.dataSeries;\n        const accessors = dataSeries.accessors;\n\n        const y = renderSeries.scales.y.convert(\n            accessors.data.y(dataSeries.data[0], 0, dataSeries.data, dataSeries)\n        );\n        const data: [number, number][] = [\n            [renderSeries.scales.x.range()[0], y],\n            [renderSeries.scales.x.range()[1], y],\n        ];\n\n        const lineFunc = line()\n            .x((d: any) => d[0])\n            .y((d: any) => d[1]);\n\n        const result: string | null = lineFunc(data);\n\n        if (!result) {\n            throw new Error(\"Line cannot be computed\");\n        }\n\n        path.attr(\"shape-rendering\", \"crispEdges\").attr(\"d\", result);\n    }\n\n    private updateLineCaps(\n        validatedData: any[],\n        renderSeries: IRenderSeries<ILineAccessors>,\n        fill: string\n    ) {\n        const dataSeries = renderSeries.dataSeries;\n        const accessors = dataSeries.accessors;\n        const definedData = validatedData.filter((d, i) =>\n            accessors?.data?.defined\n                ? accessors?.data?.defined(d, i, dataSeries.data, dataSeries)\n                : true\n        );\n\n        const updateCx = (d: any, i: number) =>\n            renderSeries.scales.x.convert(\n                accessors.data.x(d, i, dataSeries.data, dataSeries)\n            );\n        const updateCy = (d: any, i: number) =>\n            renderSeries.scales.y.convert(\n                accessors.data.y(d, i, dataSeries.data, dataSeries)\n            );\n\n        // use an unclipped layer to ensure the line caps on the left and right sides of the chart don't get clipped\n        const lineCaps = renderSeries.containers[RenderLayerName.unclippedData]\n            .selectAll(`.${LineRenderer.LINE_CAP_CLASS_NAME}`)\n            .data(definedData)\n            .attr(\"cx\", updateCx)\n            .attr(\"cy\", updateCy);\n\n        lineCaps\n            .enter()\n            .append(\"circle\")\n            .attr(\"class\", LineRenderer.LINE_CAP_CLASS_NAME)\n            .attr(\"r\", this.config.enhancedLineCap?.radius as number)\n            .attr(\"cx\", updateCx)\n            .attr(\"cy\", updateCy)\n            .style(\n                \"stroke-width\",\n                this.config.enhancedLineCap?.strokeWidth as number\n            )\n            .style(\"fill\", fill)\n            .style(\"stroke\", this.config.enhancedLineCap?.stroke as string);\n\n        lineCaps.exit().remove();\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\n/** Common CSS filter IDs */\nexport enum CssFilterId {\n    Grayscale = \"grayscale\",\n}\n\n/** CSS grayscale filter rule value */\nexport const GRAYSCALE_FILTER = `url(\"#${CssFilterId.Grayscale}\")`;\n\n/** Transformation matrix value for applying a 100% grayscale appearance to an svg element */\nexport const GRAYSCALE_COLOR_MATRIX = `\n0.2126 0.7152 0.0722 0 0\n0.2126 0.7152 0.0722 0 0\n0.2126 0.7152 0.0722 0 0\n0      0      0      1 0\n`;\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport defaultsDeep from \"lodash/defaultsDeep\";\nimport { Subject } from \"rxjs\";\n\nimport { STANDARD_RENDER_LAYERS } from \"../constants\";\nimport { IRenderSeries, RenderLayerName } from \"./types\";\nimport { XYRenderer } from \"./xy-renderer\";\nimport { Scales } from \"../core/common/scales/types\";\nimport {\n    DataAccessor,\n    IDataAccessors,\n    IDataSeries,\n    ILasagnaLayer,\n    IRendererConfig,\n    IRendererEventPayload,\n    ISeriesAccessors,\n    SeriesAccessor,\n} from \"../core/common/types\";\nimport { GRAYSCALE_FILTER } from \"../core/types\";\n\n/** Interface for side indicator data accessors */\nexport interface ISideIndicatorDataAccessors extends IDataAccessors {\n    /** Accessor indicating whether the side indicator should be active */\n    active: DataAccessor;\n}\n\n/** Interface for side indicator series accessors */\nexport interface ISideIndicatorSeriesAccessors extends ISeriesAccessors {\n    /** Indicates the start value of the side indicator */\n    start: SeriesAccessor;\n    /** Indicates the end value of the side indicator */\n    end: SeriesAccessor;\n    /** Indicates the active color of the side indicator */\n    activeColor: SeriesAccessor;\n    /** Optional accessor indicating the inactive color of the side indicator. A grayscale filter is applied to the active color by default */\n    inactiveColor?: SeriesAccessor;\n}\n\n/** Interface for side indicator accessors */\nexport interface ISideIndicatorAccessors {\n    /** Accessors for the side indicator data */\n    data: ISideIndicatorDataAccessors;\n    /** Accessors for the side indicator series */\n    series: ISideIndicatorSeriesAccessors;\n}\n\n/** Standard definition for side indicator series and data accessors */\nexport class SideIndicatorAccessors implements ISideIndicatorAccessors {\n    public data: ISideIndicatorDataAccessors;\n    public series: ISideIndicatorSeriesAccessors;\n\n    constructor() {\n        this.data = {\n            active: (d: any) => d.active,\n        };\n        this.series = {\n            start: () => null,\n            end: () => null,\n            activeColor: () => \"magenta\",\n        };\n    }\n}\n\n/**\n * Renderer for drawing threshold side indicators\n */\nexport class SideIndicatorRenderer extends XYRenderer<ISideIndicatorAccessors> {\n    /** @deprecated As of Nova v9, use RenderLayerName.unclippedData enum value instead. Removal: NUI-5753 */\n    public static SIDE_INDICATORS_LAYER = \"side-indicators\";\n\n    private DEFAULT_CONFIG: IRendererConfig = {};\n\n    /**\n     * Creates an instance of SideIndicatorRenderer.\n     * @param {IRendererConfig} [config={}] Renderer configuration object\n     */\n    constructor(config: IRendererConfig = {}) {\n        super(config);\n        // setting default values to the properties that were not set by user\n        this.config = defaultsDeep(this.config, this.DEFAULT_CONFIG);\n    }\n\n    /** See {@link Renderer#draw} */\n    public draw(\n        renderSeries: IRenderSeries<ISideIndicatorAccessors>,\n        rendererSubject: Subject<IRendererEventPayload>\n    ): void {\n        const target = renderSeries.containers[RenderLayerName.unclippedData];\n        const dataSeries = renderSeries.dataSeries;\n        const scales = renderSeries.scales;\n        const accessors = renderSeries.dataSeries.accessors;\n\n        let rect = target.select<SVGRectElement>(\"rect\");\n        const isActive =\n            dataSeries.data.length > 0\n                ? accessors.data.active(\n                      dataSeries.data[0],\n                      0,\n                      renderSeries.dataSeries.data,\n                      renderSeries.dataSeries\n                  )\n                : false;\n        const colorAccessor =\n            !isActive && accessors.series.inactiveColor\n                ? accessors.series.inactiveColor\n                : accessors.series.activeColor;\n        if (rect.empty()) {\n            rect = target.append(\"rect\").attrs({\n                fill: colorAccessor(dataSeries.id, dataSeries),\n            });\n\n            if (!isActive && !accessors.series.inactiveColor) {\n                rect.style(\"filter\", GRAYSCALE_FILTER);\n            }\n        }\n\n        const start = accessors.series.start(dataSeries.id, dataSeries);\n        const end = accessors.series.end(dataSeries.id, dataSeries);\n        const top = end == null ? 0 : scales.y.convert(end);\n        const bottom =\n            start == null\n                ? scales.y.range()[0]\n                : Math.min(scales.y.range()[0], scales.y.convert(start));\n        const height = bottom - top;\n        const width = 2;\n        rect.attrs({\n            x: -width,\n            y: top,\n            height: height < 0 ? 0 : height,\n            width: width,\n        });\n    }\n\n    /** See {@link Renderer#getDataPointIndex} */\n    public getDataPointIndex(\n        series: IDataSeries<ISideIndicatorAccessors>,\n        values: { [p: string]: any },\n        scales: Scales\n    ): number {\n        return -1;\n    }\n\n    /** See {@link Renderer#getRequiredLayers} */\n    public getRequiredLayers(): ILasagnaLayer[] {\n        return [STANDARD_RENDER_LAYERS[RenderLayerName.unclippedData]];\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { Injectable } from \"@angular/core\";\nimport { Numeric } from \"d3-array\";\nimport cloneDeep from \"lodash/cloneDeep\";\nimport sortBy from \"lodash/sortBy\";\nimport unionWith from \"lodash/unionWith\";\nimport values from \"lodash/values\";\n\nimport { LoggerService } from \"@nova-ui/bits\";\n\nimport { ISimpleThresholdZone, ZoneBoundary, ZoneCross } from \"./types\";\nimport { isBandScale, Scales } from \"../core/common/scales/types\";\nimport {\n    DataAccessor,\n    IChartAssistSeries,\n    IDataSeries,\n    IPosition,\n    IRendererConfig,\n    IValueProvider,\n    IZoneCrossPoint,\n} from \"../core/common/types\";\nimport {\n    AreaAccessors,\n    IAreaAccessors,\n} from \"../renderers/area/area-accessors\";\nimport { IStatusAccessors } from \"../renderers/bar/accessors/status-accessors\";\nimport { statusAccessors } from \"../renderers/bar/accessors/status-accessors-fn\";\nimport { BarRenderer } from \"../renderers/bar/bar-renderer\";\nimport { THRESHOLDS_MAIN_CHART_RENDERER_CONFIG } from \"../renderers/constants\";\nimport {\n    ILineAccessors,\n    LineAccessors,\n} from \"../renderers/line/line-accessors\";\nimport { LineRenderer } from \"../renderers/line/line-renderer\";\nimport {\n    ISideIndicatorAccessors,\n    SideIndicatorAccessors,\n    SideIndicatorRenderer,\n} from \"../renderers/side-indicator-renderer\";\n\n/**\n * This service provides functionality that facilitates the creation of thresholds related visual element on charts.\n */\n@Injectable()\nexport class ThresholdsService {\n    public static SERIES_ID_SUFFIX = \"__thresholds-background\";\n\n    constructor(private loggerService: LoggerService) {}\n\n    /**\n     * Calculates the threshold \"statuses\" - from/to and what zone we're in. It is the first step that is required before the usage of other methods. Having\n     * the threshold \"statuses\" assigned to each data point enables us to access the threshold information not only in other methods for threshold\n     * calculation, but also in other places, like legend or tooltips.\n     *\n     * @param dataSeries source data series that will be enhanced with threshold metadata\n     * @param zones zones defined as data series with IAreaAccessors\n     */\n    public injectThresholdsData(\n        dataSeries: IDataSeries<ILineAccessors>,\n        zones: IDataSeries<IAreaAccessors>[]\n    ): void {\n        const zoneIndexes: Record<string, number> = {};\n        zones.forEach((z) => (z.entered = false));\n\n        for (let i = 0; i < dataSeries.data.length; i++) {\n            const d = dataSeries.data[i];\n            const x: Numeric = dataSeries.accessors.data.x(\n                d,\n                i,\n                dataSeries.data,\n                dataSeries\n            );\n            const y: Numeric = dataSeries.accessors.data.y(\n                d,\n                i,\n                dataSeries.data,\n                dataSeries\n            );\n\n            d.__thresholds = {};\n\n            const zone = this.getZoneByXY(zones, zoneIndexes, x, y);\n            if (zone) {\n                zone.entered = true;\n                d.__thresholds.status = zone.value;\n            }\n        }\n    }\n\n    /**\n     * This method creates a background series for TimeInterval or continuous (currently only works with time) scale.\n     * If the series is continuous it detects intersection of source line data with given threshold zones and generates start / end for status periods.\n     * Otherwise it will use the start and the end of the band.\n     *\n     * The default value of the rendererConfig parameter is {@link THRESHOLDS_MAIN_CHART_RENDERER_CONFIG}. For a summary chart, usually a smaller status\n     * chart positioned below a main chart, use {@link THRESHOLDS_SUMMARY_RENDERER_CONFIG}.\n     *\n     * @param sourceSeries The data series from which to derive a background visualization\n     * @param zones Zones defined as data series with IAreaAccessors\n     * @param scales The scales to be used for the background visualization\n     * @param colorProvider A value provider for the colors to be used for each status\n     * @param thicknessMap Map of status to number specifying a custom height per status for the background visualization.\n     *                     If a status is not specified in the map, the default thickness is the full height of the rendering area.\n     * @param rendererConfig The renderer's configuration\n     */\n    public getBackgrounds(\n        sourceSeries: IDataSeries<ILineAccessors>,\n        zones: IDataSeries<IAreaAccessors>[],\n        scales: Scales,\n        colorProvider: IValueProvider<string>,\n        thicknessMap: Record<string, number> = {},\n        rendererConfig: IRendererConfig = cloneDeep(\n            THRESHOLDS_MAIN_CHART_RENDERER_CONFIG\n        )\n    ): IChartAssistSeries<IStatusAccessors> {\n        if (\n            sourceSeries.data.length > 0 &&\n            typeof sourceSeries.data[0].__thresholds === \"undefined\"\n        ) {\n            this.loggerService.warn(\n                \"Thresholds metadata is not defined on provided data series\",\n                sourceSeries\n            );\n        }\n\n        let data: any[];\n        const accessors = statusAccessors(colorProvider);\n        accessors.data.thickness = (d) => thicknessMap[d.status];\n        if (isBandScale(scales.x)) {\n            data = cloneDeep(sourceSeries.data);\n            accessors.data.start = sourceSeries.accessors.data.x;\n            accessors.data.end = sourceSeries.accessors.data.x;\n            accessors.data.color = (d) =>\n                d.__thresholds && d.__thresholds.status\n                    ? colorProvider.get(d.__thresholds.status)\n                    : \"transparent\";\n            accessors.data.thickness = (d) =>\n                thicknessMap[d.__thresholds.status];\n        } else {\n            data = this.getBackgroundsDataForContinuousScale(\n                sourceSeries,\n                zones\n            );\n        }\n        return {\n            id: sourceSeries.id + ThresholdsService.SERIES_ID_SUFFIX,\n            data,\n            accessors,\n            scales,\n            renderer: new BarRenderer(rendererConfig),\n            showInLegend: false,\n        };\n    }\n\n    /**\n     * Calculates background data for continuous scale based on intersections between the source data and zone definitions.\n     *\n     * @param sourceSeries source data series from which to derive background data\n     * @param zones zones defined as data series with IAreaAccessors\n     */\n    private getBackgroundsDataForContinuousScale(\n        sourceSeries: IDataSeries<ILineAccessors>,\n        zones: IDataSeries<IAreaAccessors>[]\n    ) {\n        const backgroundData: ZoneCross[] = [];\n        const breakPoints = this.getBreakPoints(sourceSeries, zones);\n\n        const zoneIndexes: Record<string, number> = {};\n        for (let i = 0; i < breakPoints.length - 1; i++) {\n            const p1 = breakPoints[i];\n            const p2 = breakPoints[i + 1];\n\n            if (!p1 || !p2) {\n                throw new Error(\"p1 or p2 are undefined\");\n            }\n\n            const midPoint: IPosition = {\n                x: (p1.x + p2.x) / 2,\n                y: (p1.y + p2.y) / 2,\n            };\n\n            const zone = this.getZoneByXY(\n                zones,\n                zoneIndexes,\n                midPoint.x,\n                midPoint.y\n            );\n            if (zone) {\n                const lastBgPoint = backgroundData[backgroundData.length - 1];\n                if (\n                    lastBgPoint &&\n                    lastBgPoint.end?.valueOf() === p1.x &&\n                    lastBgPoint.status === zone.value\n                ) {\n                    // Extend previous data point instead of creating a new one\n                    lastBgPoint.end = new Date(p2.x);\n                } else {\n                    backgroundData.push({\n                        status: zone.value,\n                        start: new Date(p1.x),\n                        end: new Date(p2.x),\n                    });\n                }\n            }\n        }\n        return backgroundData;\n    }\n\n    /**\n     * Calculate all \"interesting\" points along the data series that will be important to calculate the threshold status changes\n     *\n     * @param sourceSeries source data series from which to derive the break points\n     * @param zones zones defined as data series with IAreaAccessors\n     */\n    private getBreakPoints(\n        sourceSeries: IDataSeries<ILineAccessors>,\n        zones: IDataSeries<IAreaAccessors>[]\n    ): (IZoneCrossPoint | undefined)[] {\n        const sourceAccessors = sourceSeries.accessors.data;\n\n        let breakPoints: (IZoneCrossPoint | undefined)[] = [];\n\n        for (let i = 0; i < sourceSeries.data.length - 1; i++) {\n            // take two subsequent data points\n            const d1 = sourceSeries.data[i];\n            const d2 = sourceSeries.data[i + 1];\n\n            // calculate their positions\n            const xy1: IZoneCrossPoint = {\n                x: sourceAccessors\n                    .x(d1, i, sourceSeries.data, sourceSeries)\n                    .valueOf(),\n                y: sourceAccessors\n                    .y(d1, i, sourceSeries.data, sourceSeries)\n                    .valueOf(),\n            };\n            const xy2: IZoneCrossPoint = {\n                x: sourceAccessors\n                    .x(d2, i + 1, sourceSeries.data, sourceSeries)\n                    .valueOf(),\n                y: sourceAccessors\n                    .y(d2, i + 1, sourceSeries.data, sourceSeries)\n                    .valueOf(),\n            };\n\n            // try every zone to see if it's limits intersect the line between our two data points\n            for (let j = 0; j < zones.length; j++) {\n                const zone = zones[j];\n\n                // TODO: so far only works with constant thresholds\n                const zoneStartY = zone.accessors.data.start?.(\n                    zone.data[0],\n                    0,\n                    zone.data,\n                    zone\n                );\n                const zoneEndY = zone.accessors.data.end?.(\n                    zone.data[0],\n                    0,\n                    zone.data,\n                    zone\n                );\n\n                const zoneCrossPoints: (IZoneCrossPoint | undefined)[] = [\n                    zoneStartY,\n                    zoneEndY,\n                ]\n                    .map((y) => this.getCrossPointWithY(xy1, xy2, y)) // calculate cross points for both limits\n                    .filter((c) => c); // take only those that actually intersect\n\n                [xy1, xy2].forEach((xy) => {\n                    if (xy.y === zoneStartY || xy.y === zoneEndY) {\n                        xy.isZoneEdge = true;\n                    }\n                });\n\n                // add all crossPoints, dataPoints, but only those with unique \"x\" coordinate\n                breakPoints = unionWith(\n                    breakPoints,\n                    zoneCrossPoints,\n                    [xy1, xy2],\n                    (a, b) => a?.x === b?.x && a?.isZoneEdge === b?.isZoneEdge\n                );\n            }\n        }\n\n        return sortBy(breakPoints, \"x\");\n    }\n\n    /**\n     * Generates threshold zone series from simplified zone definition. Simplified definition provides only two numbers to define the zone interval.\n     * Creating these series manually is also possible for dynamic threshold limits.\n     *\n     * @param sourceSeries source data series from which to derive the zones\n     * @param simpleZones a collection of zones that are each defined by a start value and/or an end value. (A missing\n     start or end value indicates an infinite zone.)\n     * @param colorProvider A value provider for the colors to be used for each status\n     */\n    public getThresholdZones(\n        sourceSeries: IDataSeries<ILineAccessors>,\n        simpleZones: ISimpleThresholdZone[],\n        colorProvider: IValueProvider<string>\n    ): IDataSeries<IAreaAccessors>[] {\n        const areaAccessors = new AreaAccessors();\n        areaAccessors.data.start = (d) => d.start;\n        areaAccessors.data.end = (d) => d.end;\n        areaAccessors.series.color = (seriesId, series) =>\n            colorProvider.get(series.value);\n\n        return simpleZones.map((z, i) => ({\n            id: sourceSeries.id + \"__\" + z.status + \"-\" + i,\n            value: z.status,\n            data: [{ start: z.start, end: z.end }],\n            scales: sourceSeries.scales,\n            accessors: areaAccessors,\n        }));\n    }\n\n    /**\n     * Creates data series representing threshold lines on the chart. Solves collision between zones, where multiple zones are using the same limit value.\n     *\n     * @param zones Zones defined as data series with IAreaAccessors\n     */\n    public getThresholdLines(\n        zones: IDataSeries<IAreaAccessors>[]\n    ): IChartAssistSeries<ILineAccessors>[] {\n        if (-1 === zones.findIndex((z) => z.entered)) {\n            return [];\n        }\n\n        // TODO: works only for static thresholds\n        const limits: Record<\n            number,\n            {\n                series: IDataSeries<IAreaAccessors>;\n                accessor: DataAccessor;\n                zoneBoundary: ZoneBoundary;\n            }\n        > = {};\n\n        function addLimitEntry(\n            accessor: DataAccessor,\n            zone: IDataSeries<IAreaAccessors>,\n            zoneBoundary: ZoneBoundary\n        ) {\n            const value = accessor(zone.data[0], 0, zone.data, zone);\n            if (\n                typeof value !== \"undefined\" &&\n                typeof limits[value] === \"undefined\"\n            ) {\n                limits[value] = { series: zone, accessor, zoneBoundary };\n            }\n        }\n\n        for (const z of zones) {\n            if (z.accessors.data.start && z.accessors.data.end) {\n                addLimitEntry(z.accessors.data.start, z, ZoneBoundary.Start);\n                addLimitEntry(z.accessors.data.end, z, ZoneBoundary.End);\n            }\n        }\n\n        return values(limits).map((limit) =>\n            this.getThresholdLine(\n                limit.series,\n                limit.accessor,\n                limit.zoneBoundary\n            )\n        );\n    }\n\n    /**\n     * Creates a IChartAssistSeries that represents a threshold zone limit defined by given valueAccessor\n     *\n     * @param zone A zone defined as a data series with IAreaAccessors\n     * @param valueAccessor Accessor for the threshold limit\n     * @param zoneBoundary The zone boundary represented by the line. Default is ZoneBoundary.Start.\n     */\n    public getThresholdLine(\n        zone: IDataSeries<IAreaAccessors>,\n        valueAccessor: DataAccessor,\n        zoneBoundary = ZoneBoundary.Start\n    ): IChartAssistSeries<ILineAccessors> {\n        const accessors = new LineAccessors();\n        accessors.data.y = valueAccessor;\n        accessors.series.color = zone.accessors.series.color;\n        const renderer = new LineRenderer({\n            interactive: false,\n            strokeWidth: 1,\n            strokeStyle: LineRenderer.getStrokeStyleDashed(1),\n            stateStyles: cloneDeep(\n                THRESHOLDS_MAIN_CHART_RENDERER_CONFIG.stateStyles\n            ),\n            ignoreForDomainCalculation: true,\n        });\n\n        return {\n            id: `${zone.id}__${zoneBoundary}__threshold-line`,\n            data: zone.data,\n            value: zone.value,\n            accessors,\n            renderer,\n            scales: zone.scales,\n            showInLegend: false,\n        };\n    }\n\n    /**\n     * Calculates the point where the data series line will cross a threshold line using the two closest points for each\n     *\n     * @param {IPosition} dataFrom Data starting point\n     * @param {IPosition} dataTo Data ending point\n     * @param {IPosition} thresholdFrom Threshold starting point\n     * @param {IPosition} thresholdTo Threshold ending point\n     * @returns {IPosition} the position of the cross point or `null` if lines don't cross\n     */\n    public getCrossPoint(\n        dataFrom: IPosition,\n        dataTo: IPosition,\n        thresholdFrom: IPosition,\n        thresholdTo: IPosition\n    ): IPosition | undefined {\n        /* Inspired by https://stackoverflow.com/a/1968345 */\n        const dataShift: IPosition = {\n            x: dataTo.x - dataFrom.x,\n            y: dataTo.y - dataFrom.y,\n        };\n        const thresholdShift: IPosition = {\n            x: thresholdTo.x - thresholdFrom.x,\n            y: thresholdTo.y - thresholdFrom.y,\n        };\n        const s =\n            (-dataShift.y * (dataFrom.x - thresholdFrom.x) +\n                dataShift.x * (dataFrom.y - thresholdFrom.y)) /\n            (-thresholdShift.x * dataShift.y + dataShift.x * thresholdShift.y);\n        const t =\n            (thresholdShift.x * (dataFrom.y - thresholdFrom.y) -\n                thresholdShift.y * (dataFrom.x - thresholdFrom.x)) /\n            (-thresholdShift.x * dataShift.y + dataShift.x * thresholdShift.y);\n\n        if (!(s >= 0 && s <= 1 && t >= 0 && t <= 1)) {\n            // No cross point detected\n            return undefined;\n        }\n\n        return {\n            x: dataFrom.x + t * dataShift.x,\n            y: dataFrom.y + t * dataShift.y,\n        };\n    }\n\n    /**\n     * Find the zone that is relevant for current input data point defined by x, y coordinates.\n     * Keep increasing the index while the next x value of threshold zone is still less than input x\n     *\n     * @param zones Zones defined as data series with IAreaAccessors\n     * @param zoneIndexes provided indexes keep the last used value for searching for the given x coordinate, so it is expected that provided data points\n     * are ordered by x in ascending order.\n     * @param x The x value of the zone\n     * @param y The y value of the zone\n     */\n    private getZoneByXY(\n        zones: IDataSeries<IAreaAccessors>[],\n        zoneIndexes: Record<string, number>,\n        x: Numeric,\n        y: Numeric\n    ) {\n        for (const zone of zones) {\n            if (!zoneIndexes[zone.id]) {\n                zoneIndexes[zone.id] = 0;\n            }\n\n            const zoneIndex = this.moveZoneIndex(zoneIndexes[zone.id], zone, x);\n            zoneIndexes[zone.id] = zoneIndex;\n\n            const zoneDataPoint = zone.data[zoneIndex];\n\n            const zDataAccessors = zone.accessors.data;\n            const start = zDataAccessors.start?.(\n                zoneDataPoint,\n                zoneIndex,\n                zone.data,\n                zone\n            );\n            const end = zDataAccessors.end?.(\n                zoneDataPoint,\n                zoneIndex,\n                zone.data,\n                zone\n            );\n\n            // TODO: this is not going to work for dynamic thresholds, so still have some work to do here\n            if (\n                (typeof start === \"undefined\" || y >= start) &&\n                (typeof end === \"undefined\" || y <= end)\n            ) {\n                return zone;\n            }\n        }\n        return null;\n    }\n\n    private moveZoneIndex(\n        zoneIndex: number,\n        zone: IDataSeries<IAreaAccessors>,\n        x: Numeric\n    ) {\n        while (\n            zoneIndex < zone.data.length - 1 &&\n            zone.accessors.data.x(\n                zone.data[zoneIndex + 1],\n                zoneIndex + 1,\n                zone.data,\n                zone\n            ) < x\n        ) {\n            zoneIndex++;\n        }\n        return zoneIndex;\n    }\n\n    public getCrossPointWithY(\n        dataFrom: IPosition,\n        dataTo: IPosition,\n        y: number\n    ): IPosition | undefined {\n        return this.getCrossPoint(\n            dataFrom,\n            dataTo,\n            { x: dataFrom.x, y },\n            { x: dataTo.x, y }\n        );\n    }\n\n    /**\n     * Creates side indicator data series for given threshold zones\n     *\n     * @param zones Zones defined as data series with IAreaAccessors\n     * @param scales The scales to be used for the side indicators\n     * @param rendererConfig Configuration for the renderer. Default is the exported constant 'THRESHOLDS_MAIN_CHART_RENDERER_CONFIG'\n     */\n    public getSideIndicators(\n        zones: IDataSeries<IAreaAccessors>[],\n        scales: Scales,\n        rendererConfig?: IRendererConfig\n    ): IChartAssistSeries<ISideIndicatorAccessors>[] {\n        const sideIndicators: IChartAssistSeries<ISideIndicatorAccessors>[] =\n            [];\n        const renderer = new SideIndicatorRenderer(\n            rendererConfig || cloneDeep(THRESHOLDS_MAIN_CHART_RENDERER_CONFIG)\n        );\n        const indicatorsActive = -1 !== zones.findIndex((z) => z.entered);\n        for (const z of zones) {\n            const sideIndicatorAccessors = new SideIndicatorAccessors();\n            sideIndicatorAccessors.series = {\n                start: () => z.accessors.data.start?.(z.data[0], 0, z.data, z),\n                end: () => z.accessors.data.end?.(z.data[0], 0, z.data, z),\n                activeColor: () => z.accessors.series.color?.(z.id, z),\n            };\n\n            const sideIndicator: IChartAssistSeries<ISideIndicatorAccessors> = {\n                id: z.id + \"__side-indicator\",\n                data: [{ active: indicatorsActive }],\n                accessors: sideIndicatorAccessors,\n                scales,\n                renderer,\n                showInLegend: false,\n            };\n\n            sideIndicators.push(sideIndicator);\n        }\n\n        return sideIndicators;\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { OverlayModule } from \"@angular/cdk/overlay\";\nimport { NgModule } from \"@angular/core\";\n// This is not technically used here, but it does pull in the type for $localize\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { LocalizeFn } from \"@angular/localize/init\";\nimport \"d3-selection-multi\";\n\nimport {\n    NuiCommonModule,\n    NuiIconModule,\n    NuiPopoverModule,\n} from \"@nova-ui/bits\";\n\nimport { ChartComponent } from \"./chart/chart.component\";\nimport { ChartCollectionIdDirective } from \"./chart-collection/chart-collection-id.directive\";\nimport { ChartCollectionService } from \"./chart-collection/chart-collection.service\";\nimport { ChartDonutContentComponent } from \"./chart-donut-content/chart-donut-content.component\";\nimport { ChartMarkerComponent } from \"./chart-marker/chart-marker.component\";\nimport { ChartPopoverComponent } from \"./chart-popover/chart-popover.component\";\nimport { ChartTooltipComponent } from \"./chart-tooltips/chart-tooltip.component\";\nimport { ChartTooltipDirective } from \"./chart-tooltips/chart-tooltip.directive\";\nimport { ChartTooltipsComponent } from \"./chart-tooltips/chart-tooltips.component\";\nimport { LegendSeriesComponent } from \"./legend/legend-series/legend-series.component\";\nimport { BasicLegendTileComponent } from \"./legend/legend-tile/basic-legend-tile/basic-legend-tile.component\";\nimport { RichLegendTileComponent } from \"./legend/legend-tile/rich-legend-tile/rich-legend-tile.component\";\nimport { LegendComponent } from \"./legend/legend.component\";\nimport { ThresholdsService } from \"./thresholds/thresholds-service\";\n\n@NgModule({\n    imports: [NuiCommonModule, NuiIconModule, NuiPopoverModule, OverlayModule],\n    declarations: [\n        LegendComponent,\n        LegendSeriesComponent,\n        BasicLegendTileComponent,\n        RichLegendTileComponent,\n        ChartComponent,\n        ChartCollectionIdDirective,\n        ChartMarkerComponent,\n        ChartPopoverComponent,\n        ChartDonutContentComponent,\n        ChartTooltipsComponent,\n        ChartTooltipComponent,\n        ChartTooltipDirective,\n    ],\n    exports: [\n        LegendComponent,\n        LegendSeriesComponent,\n        RichLegendTileComponent,\n        BasicLegendTileComponent,\n        ChartComponent,\n        ChartCollectionIdDirective,\n        ChartMarkerComponent,\n        ChartPopoverComponent,\n        ChartDonutContentComponent,\n        ChartTooltipsComponent,\n        ChartTooltipComponent,\n        ChartTooltipDirective,\n    ],\n    providers: [ChartCollectionService, ThresholdsService],\n})\nexport class NuiChartsModule {}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { IAllAround } from \"../core/grid/types\";\n\nexport const GAUGE_QUANTITY_SERIES_ID = \"quantity\";\nexport const GAUGE_REMAINDER_SERIES_ID = \"remainder\";\nexport const GAUGE_THRESHOLD_MARKERS_SERIES_ID = \"threshold-markers\";\n\n/**\n * The visualization modes for a gauge\n */\nexport enum GaugeMode {\n    Donut = \"donut\",\n    Horizontal = \"horizontal\",\n    Vertical = \"vertical\",\n}\n\n/**\n * Standard thicknesses for the linear gauge\n */\nexport enum StandardLinearGaugeThickness {\n    Small = 10,\n    Large = 15,\n}\n\n/**\n * Standard values for gauge threshold marker radii\n */\nexport enum StandardGaugeThresholdMarkerRadius {\n    Small = 3,\n    Large = 4,\n}\n\n/**\n * Standard values for gauge threshold marker radii\n */\nexport enum StandardGaugeThresholdId {\n    Warning = \"warning\",\n    Critical = \"critical\",\n}\n\n/**\n * Standard gauge colors\n */\nexport enum StandardGaugeColor {\n    /** Standard color for the part of the gauge that's not filled in */\n    Remainder = \"var(--nui-color-semantic-unknown-bg-hover)\",\n    /** Standard color for the value part of the gauge when the value represents an ok status */\n    Ok = \"var(--nui-color-chart-one)\",\n    /** Standard color for the value part of the gauge when the value has a warning status */\n    Warning = \"var(--nui-color-semantic-warning)\",\n    /** Standard color for the value part of the gauge when the value has a critical status */\n    Critical = \"var(--nui-color-semantic-critical)\",\n}\n\n/**\n * Default donut gauge margin for label clearance\n */\nexport const DONUT_GAUGE_LABEL_CLEARANCE_DEFAULT = 30;\n\n/**\n * Default linear gauge margins for label clearance\n */\nexport const LINEAR_GAUGE_LABEL_CLEARANCE_DEFAULTS: IAllAround<number> = {\n    top: 20,\n    right: 25,\n    bottom: 20,\n    left: 25,\n};\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport isArray from \"lodash/isArray\";\n\nimport { hasInnerScale, IHasInnerScale, IScale } from \"../types\";\n\nexport function domain(scale: IScale<any>, theDomain: any[]): void {\n    if (!theDomain || theDomain.length === 0) {\n        return;\n    }\n\n    if (!isArray(theDomain[0])) {\n        scale.domain(theDomain);\n        return;\n    }\n\n    scale.domain(theDomain[0]);\n\n    if (!hasInnerScale(scale)) {\n        return;\n    }\n\n    const scaleWithInnerScale = scale as IHasInnerScale<any>;\n\n    domain(scaleWithInnerScale.innerScale, theDomain.slice(1));\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport each from \"lodash/each\";\nimport filter from \"lodash/filter\";\nimport flatten from \"lodash/flatten\";\nimport includes from \"lodash/includes\";\nimport keyBy from \"lodash/keyBy\";\nimport values from \"lodash/values\";\n\nimport { RenderState } from \"../../renderers/types\";\nimport { domain } from \"./scales/helpers/domain\";\nimport { IScale, ScalesIndex } from \"./scales/types\";\nimport { IAccessors, IChart, IChartSeries } from \"./types\";\n\n/**\n * @ignore\n *\n * Manages data and their domains\n */\nexport class DataManager {\n    private _chartSeriesSet: IChartSeries<IAccessors>[] = [];\n    private dataIndex: { [seriesId: string]: IChartSeries<IAccessors> } = {};\n    private _scalesIndexByKey: ScalesIndex = {};\n    private _scalesIndexById: { [scaleId: string]: IScale<any> } = {};\n\n    public get chartSeriesSet(): IChartSeries<IAccessors>[] {\n        return this._chartSeriesSet;\n    }\n\n    public get scalesIndexByKey(): ScalesIndex {\n        return this._scalesIndexByKey;\n    }\n\n    public get scalesIndexById(): { [scaleId: string]: IScale<any> } {\n        return this._scalesIndexById;\n    }\n\n    constructor(private chart?: IChart) {}\n\n    public update(seriesSet: IChartSeries<IAccessors>[]): void {\n        const duplicateIds = filter(\n            seriesSet.map((series) => series.id),\n            (val, i, iteratee) => includes(iteratee, val, i + 1)\n        );\n\n        if (duplicateIds.length > 0) {\n            console.warn(\"Series set contains duplicate IDs:\", duplicateIds);\n        }\n\n        this._chartSeriesSet = seriesSet || [];\n\n        this.dataIndex = keyBy(\n            this._chartSeriesSet,\n            (s: IChartSeries<IAccessors>) => s.id\n        );\n\n        this._scalesIndexByKey = this.buildScalesIndex(this._chartSeriesSet);\n        this._scalesIndexById = keyBy(\n            flatten(values(this._scalesIndexByKey).map((v) => v.list)),\n            (s) => s.id\n        );\n    }\n\n    public getChartSeries(seriesId: string): IChartSeries<IAccessors> {\n        return this.dataIndex[seriesId];\n    }\n\n    private updateScaleDomain(scale: IScale<any>, scaleKey: string) {\n        if (scale.isDomainFixed) {\n            return;\n        }\n\n        if (scale.domainCalculator) {\n            const chartSeriesSet = this.chartSeriesSet\n                .filter(\n                    (cs) =>\n                        cs.scales[scaleKey] === scale &&\n                        !cs.renderer.config.ignoreForDomainCalculation\n                )\n                .filter((c) => c.renderState !== RenderState.hidden);\n            if (\n                chartSeriesSet.length ||\n                this.chart?.configuration?.updateDomainForEmptySeries\n            ) {\n                const calculatedDomain = scale.domainCalculator(\n                    chartSeriesSet,\n                    scaleKey,\n                    scale\n                );\n                domain(scale, calculatedDomain);\n            }\n        }\n    }\n\n    private buildScalesIndex(\n        chartSeries: IChartSeries<IAccessors>[]\n    ): ScalesIndex {\n        const scales: ScalesIndex = {};\n        each(chartSeries, (cs) => {\n            each(Object.keys(cs.scales), (scaleKey) => {\n                const scale = cs.scales[scaleKey];\n                let indexEntry = scales[scaleKey];\n                if (!indexEntry) {\n                    indexEntry = {\n                        index: {},\n                        list: [],\n                    };\n                    scales[scaleKey] = indexEntry;\n                }\n                if (!indexEntry.index[scale.id]) {\n                    indexEntry.index[scale.id] = scale;\n                    indexEntry.list.push(scale);\n                }\n            });\n        });\n        return scales;\n    }\n\n    public updateScaleDomains(): void {\n        each(Object.keys(this._scalesIndexByKey), (scaleKey) => {\n            each(this._scalesIndexByKey[scaleKey].list, (scale) => {\n                this.updateScaleDomain(scale, scaleKey);\n            });\n        });\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport each from \"lodash/each\";\nimport isEqual from \"lodash/isEqual\";\nimport isUndefined from \"lodash/isUndefined\";\nimport values from \"lodash/values\";\nimport { Subject, Subscription } from \"rxjs\";\n\nimport { DataManager } from \"./data-manager\";\nimport { Lasagna } from \"./lasagna\";\nimport {\n    D3Selection,\n    IAccessors,\n    IChartSeries,\n    IDataPoint,\n    IDataPointsPayload,\n    IInteractionDataPointsEvent,\n    ILasagnaLayer,\n    InteractionType,\n    IPosition,\n    IRenderContainers,\n    IRendererEventPayload,\n    IRenderStateData,\n} from \"./types\";\nimport { UtilityService } from \"./utility.service\";\nimport {\n    DATA_POINT_INTERACTION_RESET,\n    HIGHLIGHT_DATA_POINT_EVENT,\n    STANDARD_RENDER_LAYERS,\n} from \"../../constants\";\nimport { IInteractionValuesPayload } from \"../plugins/types\";\n\n/**\n * @ignore\n * Entry for a lasagna layer index used for keeping track of the current series container structure\n */\ninterface ILayerIndexEntry {\n    /** The series that have containers in a layer */\n    seriesUsing: IChartSeries<IAccessors>[];\n    /** The definition for the layer */\n    layerDefinition: ILasagnaLayer;\n}\n\n/**\n * @ignore\n *\n * Manages and executes drawing and data point highlighting for each data series renderer and handles the setting of series display states\n */\nexport class RenderEngine {\n    /** Subject for emitting events to the outside world about data points closest to an interaction on the chart */\n    public interactionDataPointsSubject =\n        new Subject<IInteractionDataPointsEvent>();\n    /** Subject passed to the renderer for triggering events regarding a data point */\n    public rendererSubject = new Subject<IRendererEventPayload>();\n\n    private highlightDataPointSubscription: Subscription;\n    private highlightedDataPoints: IDataPointsPayload = {};\n    private renderLayers: { [layerName: string]: D3Selection } = {};\n    private layerIndex: { [layerName: string]: ILayerIndexEntry } = {};\n\n    constructor(private lasagna: Lasagna, private dataManager: DataManager) {\n        this.highlightDataPointSubscription = this.rendererSubject.subscribe(\n            (event: IRendererEventPayload) => {\n                if (event.eventName === HIGHLIGHT_DATA_POINT_EVENT) {\n                    this.highlightDataPoint(\n                        event.data.seriesId,\n                        event.data.index\n                    );\n                }\n            }\n        );\n    }\n\n    /**\n     * Invokes the draw method on each of the series renderers\n     */\n    public update(): void {\n        const scaleValidity: Record<string, boolean> = {};\n        each(\n            this.dataManager.chartSeriesSet,\n            (chartSeries: IChartSeries<IAccessors>) => {\n                const childContainers = this.getSeriesChildContainers(\n                    chartSeries.id\n                );\n                const areDomainsValid =\n                    -1 ===\n                    Object.values(chartSeries.scales).findIndex((scale) => {\n                        if (typeof scaleValidity[scale.id] === \"undefined\") {\n                            const isValid = scale.isDomainValid();\n                            if (!isValid) {\n                                console.warn(\n                                    \"Invalid scale domain detected for scale:\",\n                                    scale\n                                );\n                            }\n                            scaleValidity[scale.id] = isValid;\n                        }\n                        return !scaleValidity[scale.id];\n                    });\n                if (areDomainsValid) {\n                    chartSeries.renderer.draw(\n                        {\n                            dataSeries: chartSeries,\n                            containers: childContainers,\n                            scales: chartSeries.scales,\n                        },\n                        this.rendererSubject\n                    );\n                }\n            }\n        );\n    }\n\n    /**\n     * Updates the lasagna layers and series containers based on the current series set\n     */\n    public updateSeriesContainers(): void {\n        this.layerIndex = this.buildLayerIndex(this.dataManager.chartSeriesSet);\n        this.removeUnusedLayers();\n        this.addNeededLayers();\n        this.updateLayerContents();\n    }\n\n    /**\n     * Emits the HIGHLIGHT_DATA_POINT_EVENT if the highlighted index changes for a particular series.\n     * Emits an event with information about all of the highlighted data points if the highlighted index changes for any series.\n     *\n     * @param {IHighlightXYPayload} highlightedValues The highlighted values for each scale\n     */\n    public emitInteractionDataPoints(payload: IInteractionValuesPayload): void {\n        let highlightChangeDetected = false;\n\n        const interactionDataPoints = this.dataManager.chartSeriesSet.reduce(\n            (result, chartSeries: IChartSeries<IAccessors>) => {\n                const chartValues: { [axis: string]: any } = {};\n                each(Object.keys(payload.values), (scaleKey) => {\n                    const myScaleId = chartSeries.scales[scaleKey].id;\n                    chartValues[scaleKey] = UtilityService.getInteractionValues(\n                        payload.values[scaleKey],\n                        myScaleId\n                    );\n                });\n\n                let dataIndex = DATA_POINT_INTERACTION_RESET;\n                if (chartSeries.data && chartSeries.data.length > 0) {\n                    dataIndex = chartSeries.renderer.getDataPointIndex(\n                        chartSeries,\n                        chartValues,\n                        chartSeries.scales\n                    );\n                }\n                const position: IPosition | undefined =\n                    chartSeries.renderer.getDataPointPosition(\n                        chartSeries,\n                        dataIndex,\n                        chartSeries.scales\n                    );\n\n                const dataPoint: IDataPoint = {\n                    seriesId: chartSeries.id,\n                    dataSeries: chartSeries,\n                    index: dataIndex,\n                    data: dataIndex >= 0 ? chartSeries.data[dataIndex] : null,\n                    position: position,\n                };\n\n                if (payload.interactionType === InteractionType.MouseMove) {\n                    const prevHighlight =\n                        this.highlightedDataPoints[chartSeries.id];\n                    if (\n                        !isUndefined(dataIndex) &&\n                        (isUndefined(prevHighlight) ||\n                            dataIndex === DATA_POINT_INTERACTION_RESET ||\n                            dataIndex !== prevHighlight.index)\n                    ) {\n                        highlightChangeDetected = true;\n                        this.rendererSubject.next({\n                            eventName: HIGHLIGHT_DATA_POINT_EVENT,\n                            data: dataPoint,\n                        });\n                    }\n                }\n\n                // Note that dataIndex that is equal to -1 or -2 will be treated as \"please show last value\" by the legend, so it is valuable\n                result[chartSeries.id] = dataPoint;\n                return result;\n            },\n            <IDataPointsPayload>{}\n        );\n\n        if (\n            payload.interactionType !== InteractionType.MouseMove ||\n            highlightChangeDetected\n        ) {\n            this.interactionDataPointsSubject.next({\n                interactionType: payload.interactionType,\n                dataPoints: interactionDataPoints,\n            });\n        }\n\n        if (highlightChangeDetected) {\n            this.highlightedDataPoints = interactionDataPoints;\n        }\n    }\n\n    /**\n     * Invokes the renderer highlightDataPoint method for the specified series\n     *\n     * @param {string} seriesId The series on which to highlight a data point\n     * @param {number} index The data point index to highlight\n     */\n    public highlightDataPoint(seriesId: string, index: number): void {\n        const childContainers = this.getSeriesChildContainers(seriesId);\n        const chartSeries = this.dataManager.getChartSeries(seriesId);\n\n        const renderSeries = {\n            dataSeries: chartSeries,\n            containers: childContainers,\n            scales: chartSeries.scales,\n            parentContainer: this.renderLayers.data,\n        };\n        chartSeries.renderer.highlightDataPoint(\n            renderSeries,\n            index,\n            this.rendererSubject\n        );\n    }\n\n    /**\n     * Sets attributes specified in each state data object to the appropriate the series containers.\n     * Invokes a renderer's setSeriesState method when the state of its series container has been updated.\n     *\n     * @param {IRenderStateData[]} stateDataSet A collection of series states\n     */\n    public setSeriesStates(stateDataSet: IRenderStateData[]): void {\n        each(stateDataSet, ({ seriesId, state }) => {\n            const chartSeries = this.dataManager.getChartSeries(seriesId);\n            if (!chartSeries) {\n                return;\n            }\n            const childContainers = this.getSeriesChildContainers(seriesId);\n\n            const attrs = chartSeries.renderer.getContainerStateStyles(state);\n            each(values(childContainers), (cc) => {\n                cc.attrs(attrs);\n            });\n\n            chartSeries.renderer.setSeriesState(childContainers, state);\n        });\n    }\n\n    public destroy(): void {\n        if (this.highlightDataPointSubscription) {\n            this.highlightDataPointSubscription.unsubscribe();\n        }\n        if (this.rendererSubject) {\n            this.rendererSubject.complete();\n        }\n    }\n\n    private buildLayerIndex(chartSeriesSet: IChartSeries<IAccessors>[]): {\n        [layerName: string]: ILayerIndexEntry;\n    } {\n        const layerIndex: { [layerName: string]: ILayerIndexEntry } = {};\n        each(chartSeriesSet, (chartSeries) => {\n            each(chartSeries.renderer.getRequiredLayers(), (layerDef) => {\n                if (\n                    STANDARD_RENDER_LAYERS[layerDef.name] &&\n                    !isEqual(STANDARD_RENDER_LAYERS[layerDef.name], layerDef)\n                ) {\n                    throw new Error(\n                        `Custom definition detected for render layer \"${layerDef.name}\". ` +\n                            `Custom layers must use a name not already taken by the predefined layer set.`\n                    );\n                }\n\n                let layer = layerIndex[layerDef.name];\n                if (!layer) {\n                    layer = {\n                        seriesUsing: [],\n                        layerDefinition: layerDef,\n                    };\n                    layerIndex[layerDef.name] = layer;\n                }\n                layer.seriesUsing.push(chartSeries);\n            });\n        });\n        return layerIndex;\n    }\n\n    private removeUnusedLayers(): void {\n        each(Object.keys(this.renderLayers), (layerName) => {\n            if (!this.layerIndex[layerName]) {\n                this.lasagna.removeLayer(layerName);\n                delete this.renderLayers[layerName];\n            }\n        });\n    }\n\n    private addNeededLayers(): void {\n        each(this.layerIndex, (layerData) => {\n            if (!this.renderLayers[layerData.layerDefinition.name]) {\n                this.renderLayers[layerData.layerDefinition.name] =\n                    this.lasagna.addLayer(layerData.layerDefinition);\n            }\n        });\n    }\n\n    private updateLayerContents(): void {\n        each(Object.keys(this.renderLayers), (layerName) => {\n            const renderLayer = this.renderLayers[layerName];\n            const containers = renderLayer\n                .selectAll<SVGElement, IChartSeries<IAccessors>>(\n                    \"g.data-series-container\"\n                )\n                .data(\n                    this.layerIndex[layerName].seriesUsing,\n                    (d: IChartSeries<IAccessors>) => d.id\n                )\n                .order();\n\n            containers\n                .enter()\n                .append(\"g\")\n                .attrs({\n                    id: (d: IChartSeries<IAccessors>) =>\n                        this.getChildContainerId(layerName, d.id),\n                    class: \"data-series-container\",\n                });\n\n            containers.exit().remove();\n        });\n    }\n\n    private getSeriesChildContainers(seriesId: string): IRenderContainers {\n        const childContainers: { [name: string]: D3Selection<SVGGElement> } =\n            {};\n        each(Object.keys(this.renderLayers), (layerName) => {\n            const renderLayer = this.renderLayers[layerName];\n            childContainers[layerName] = renderLayer.selectAll(\n                `#${layerName}-${UtilityService.cssEscape(seriesId)}`\n            );\n        });\n        return childContainers;\n    }\n\n    private getChildContainerId(layerName: string, seriesId: string): string {\n        return layerName + \"-\" + seriesId;\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { Subject } from \"rxjs\";\nimport { takeUntil } from \"rxjs/operators\";\n\nimport { IInteractionValuesPayload } from \"./types\";\nimport {\n    CHART_VIEW_STATUS_EVENT,\n    INTERACTION_DATA_POINTS_EVENT,\n    INTERACTION_VALUES_EVENT,\n} from \"../../constants\";\nimport { ChartPlugin } from \"../common/chart-plugin\";\nimport { RenderEngine } from \"../common/render-engine\";\nimport {\n    IChartEvent,\n    IChartViewStatusEventPayload,\n    IInteractionDataPointsEvent,\n    IRendererEventPayload,\n} from \"../common/types\";\n\n/** @ignore */\nexport class RenderEnginePlugin extends ChartPlugin {\n    private renderEngine: RenderEngine;\n    // initializing isChartInView to true to ensure emission of initial data point events\n    private isChartInView = true;\n    private lastInteractionValuesPayload: IInteractionValuesPayload;\n    private readonly destroy$ = new Subject<void>();\n\n    public initialize(): void {\n        this.renderEngine = this.chart.getRenderEngine();\n\n        this.chart\n            .getEventBus()\n            .getStream(INTERACTION_VALUES_EVENT)\n            .pipe(takeUntil(this.destroy$))\n            .subscribe((event: IChartEvent) => {\n                this.lastInteractionValuesPayload = event.data;\n                if (this.isChartInView) {\n                    this.chart\n                        .getRenderEngine()\n                        .emitInteractionDataPoints(\n                            this.lastInteractionValuesPayload\n                        );\n                }\n            });\n\n        this.renderEngine.interactionDataPointsSubject\n            .pipe(takeUntil(this.destroy$))\n            .subscribe((event: IInteractionDataPointsEvent) => {\n                this.chart\n                    .getEventBus()\n                    .getStream(INTERACTION_DATA_POINTS_EVENT)\n                    .next({ data: event });\n            });\n\n        this.renderEngine.rendererSubject\n            .pipe(takeUntil(this.destroy$))\n            .subscribe((event: IRendererEventPayload) => {\n                this.chart\n                    .getEventBus()\n                    .getStream(event.eventName)\n                    .next({ data: event.data });\n            });\n\n        this.chart\n            .getEventBus()\n            .getStream(CHART_VIEW_STATUS_EVENT)\n            .pipe(takeUntil(this.destroy$))\n            .subscribe((event: IChartEvent<IChartViewStatusEventPayload>) => {\n                this.isChartInView = event.data.isChartInView;\n                if (this.isChartInView && this.lastInteractionValuesPayload) {\n                    this.chart\n                        .getRenderEngine()\n                        .emitInteractionDataPoints(\n                            this.lastInteractionValuesPayload\n                        );\n                }\n            });\n    }\n\n    public update(): void {\n        this.renderEngine.updateSeriesContainers();\n        this.renderEngine.update();\n    }\n\n    public updateDimensions(): void {\n        this.renderEngine.update();\n    }\n\n    public destroy(): void {\n        this.renderEngine.destroy();\n        this.destroy$.next();\n        this.destroy$.complete();\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { select, Selection } from \"d3-selection\";\nimport each from \"lodash/each\";\nimport { BehaviorSubject, Subject } from \"rxjs\";\nimport { takeUntil } from \"rxjs/operators\";\n\nimport { DESTROY_EVENT, SERIES_STATE_CHANGE_EVENT } from \"../constants\";\nimport { ChartPlugin } from \"./common/chart-plugin\";\nimport { DataManager } from \"./common/data-manager\";\nimport { EventBus } from \"./common/event-bus\";\nimport { Lasagna } from \"./common/lasagna\";\nimport { RenderEngine } from \"./common/render-engine\";\nimport {\n    D3Selection,\n    IAccessors,\n    IChart,\n    IChartConfiguration,\n    IChartEvent,\n    IChartPlugin,\n    IChartSeries,\n    IRenderStateData,\n} from \"./common/types\";\nimport { IDimensionConfig, IDimensions, IGrid } from \"./grid/types\";\nimport { RenderEnginePlugin } from \"./plugins/render-engine-plugin\";\nimport { CssFilterId, GRAYSCALE_COLOR_MATRIX } from \"./types\";\n\nexport class Chart implements IChart {\n    public readonly eventBus = new EventBus<IChartEvent>();\n    public element: HTMLElement;\n    public target?: D3Selection<SVGSVGElement>;\n    public filterDefs?: Selection<SVGDefsElement, any, SVGElement, any>;\n\n    private dataManager: DataManager; // TODO: interface\n    private renderEngine: RenderEngine; // TODO: interface\n\n    private updateSubject = new BehaviorSubject<IChartSeries<IAccessors>[]>([]);\n    private updateDimensionsSubject = new Subject<void>();\n    private seriesStatesSubject = new BehaviorSubject<IRenderStateData[]>([]);\n\n    private plugins: IChartPlugin[] = [];\n\n    constructor(\n        private grid: IGrid,\n        public configuration?: IChartConfiguration\n    ) {\n        if (!grid) {\n            throw new Error(\"Grid has to be defined!\");\n        }\n        grid.updateChartDimensionsSubject = this.updateDimensionsSubject;\n        grid.eventBus = this.eventBus;\n    }\n\n    public getEventBus(): EventBus<IChartEvent> {\n        return this.eventBus;\n    }\n\n    public getDataManager(): DataManager {\n        return this.dataManager;\n    }\n\n    public getRenderEngine(): RenderEngine {\n        return this.renderEngine;\n    }\n\n    public getGrid(): IGrid {\n        return this.grid;\n    }\n\n    public addPlugin(plugin: IChartPlugin): void {\n        plugin.chart = this;\n        this.plugins.push(plugin);\n    }\n\n    public removePlugin(classRef: typeof ChartPlugin): void {\n        const pluginIndex = this.plugins.findIndex(\n            (plugin) => plugin instanceof classRef\n        );\n        if (-1 !== pluginIndex) {\n            this.plugins[pluginIndex].destroy();\n            this.plugins.splice(pluginIndex, 1);\n        }\n    }\n\n    public addPlugins(...plugins: IChartPlugin[]): void {\n        for (const plugin of plugins) {\n            this.addPlugin(plugin);\n        }\n    }\n\n    public removePlugins(...classRefs: (typeof ChartPlugin)[]): void {\n        for (const classRef of classRefs) {\n            this.removePlugin(classRef);\n        }\n    }\n\n    public hasPlugin(classRef: typeof ChartPlugin): boolean {\n        return (\n            -1 !==\n            this.plugins.findIndex((plugin) => plugin instanceof classRef)\n        );\n    }\n\n    public build(element: HTMLElement): void {\n        this.element = element;\n\n        // @ts-ignore: Workaround to avoid strict build crash because of type\n        this.target = select<HTMLElement, SVGElement>(this.element)\n            .append(\"svg\")\n            .attrs({\n                class: \"nui-chart\",\n                height: \"100%\",\n                width: \"100%\",\n            });\n\n        this.configureCssFilters();\n        this.buildGrid();\n\n        this.dataManager = this.buildDataManager();\n        this.renderEngine = this.buildRenderEngine(\n            this.grid.getLasagna(),\n            this.dataManager\n        );\n\n        // Put the render engine at the front of the list since other plugins may be relying on renderers to be updated first\n        const renderEnginePlugin = new RenderEnginePlugin();\n        renderEnginePlugin.chart = this;\n        this.plugins.unshift(renderEnginePlugin);\n\n        for (const gridPlugin of this.getGrid().buildPlugins(this)) {\n            this.addPlugin(gridPlugin);\n        }\n\n        this.initialize();\n\n        const untilDestroy = <T>() =>\n            takeUntil<T>(this.getEventBus().getStream(DESTROY_EVENT));\n        this.updateSubject\n            .pipe(untilDestroy())\n            .subscribe((d: IChartSeries<IAccessors>[]) => this.onUpdate(d));\n        this.updateDimensionsSubject\n            .pipe(untilDestroy())\n            .subscribe(() => this.onUpdateDimensions());\n        this.seriesStatesSubject\n            .pipe(untilDestroy())\n            .subscribe((rs: IRenderStateData[]) => this.onSetSeriesStates(rs));\n    }\n\n    private configureCssFilters() {\n        this.filterDefs = this.target?.append(\"defs\");\n\n        // filter for applying a grayscale appearance to svg elements\n        this.filterDefs\n            ?.append(\"filter\")\n            .attr(\"id\", CssFilterId.Grayscale)\n            .append(\"feColorMatrix\")\n            .attr(\"type\", \"matrix\")\n            .attr(\"values\", GRAYSCALE_COLOR_MATRIX);\n    }\n\n    protected buildDataManager(): DataManager {\n        return new DataManager(this);\n    }\n\n    protected buildGrid(): void {\n        if (this.target) {\n            this.grid.target(this.target);\n            this.grid.build();\n\n            this.updateTargetDimensions(this.grid.config().dimension);\n        }\n    }\n\n    protected buildRenderEngine(\n        lasagna: Lasagna,\n        dataManager: DataManager\n    ): RenderEngine {\n        return new RenderEngine(lasagna, dataManager);\n    }\n\n    public update(seriesSet: IChartSeries<IAccessors>[]): void {\n        this.updateSubject.next(seriesSet);\n    }\n\n    public updateDimensions(): void {\n        this.updateDimensionsSubject.next();\n    }\n\n    public initialize(): void {\n        each(this.plugins, (p: IChartPlugin) => {\n            p.initialize();\n        });\n    }\n\n    public destroy(): void {\n        this.eventBus.getStream(DESTROY_EVENT).next({ data: null });\n        this.eventBus.destroy();\n\n        this.plugins.forEach((p) => p.destroy());\n\n        this.target?.remove();\n        this.target = undefined;\n    }\n\n    public setSeriesStates(renderStateData: IRenderStateData[]): void {\n        this.seriesStatesSubject.next(renderStateData);\n        this.eventBus\n            .getStream(SERIES_STATE_CHANGE_EVENT)\n            .next({ data: renderStateData });\n    }\n\n    private onUpdate(seriesSet: IChartSeries<IAccessors>[]) {\n        this.dataManager.update(seriesSet);\n\n        this.grid.scales = this.dataManager.scalesIndexByKey;\n        this.dataManager.updateScaleDomains();\n        this.grid.updateRanges();\n\n        this.plugins.forEach((p) => p.update());\n    }\n\n    private onUpdateDimensions() {\n        const dimensionConfig = this.grid.config().dimension;\n\n        // if the chart is reused with different grid dimensions, the chart's container dimensions need to be adjusted as well\n        this.updateTargetDimensions(dimensionConfig);\n\n        const dimensions: Partial<IDimensions> = {};\n        if (dimensionConfig.autoHeight) {\n            dimensions.height = this.element.clientHeight;\n        }\n        if (dimensionConfig.autoWidth) {\n            dimensions.width = this.element.clientWidth;\n        }\n        this.grid.updateDimensions(dimensions);\n\n        this.plugins.forEach((p) => p.updateDimensions());\n    }\n\n    private updateTargetDimensions(dimensionConfig: IDimensionConfig) {\n        if (!dimensionConfig.autoHeight) {\n            // use style instead of attr to override css style\n            this.target?.style(\"height\", dimensionConfig.outerHeight() + \"px\");\n        }\n        if (!dimensionConfig.autoWidth) {\n            // use style instead of attr to override css style\n            this.target?.style(\"width\", dimensionConfig.outerWidth() + \"px\");\n        }\n    }\n\n    private onSetSeriesStates(renderStateData: IRenderStateData[]) {\n        this.renderEngine.setSeriesStates(renderStateData);\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { RenderState } from \"../../renderers/types\";\nimport {\n    IAccessors,\n    IChart,\n    IChartAssistSeries,\n    IChartSeries,\n    IRenderStateData,\n} from \"../common/types\";\n\n/**\n * Interface representing the spark chart assist's\n * association between one of its charts and a series set\n */\nexport interface ISpark<TA extends IAccessors> {\n    chartSeriesSet: IChartAssistSeries<TA>[];\n    id?: string;\n    chart?: IChart;\n}\n\n/**\n * Interface representing an assistant that aids in chart usage\n */\nexport interface IChartAssist {\n    /**\n     * Updates the series set for the chart assist's associated chart\n     *\n     * @param inputSeriesSet The updated set of series\n     */\n    update(inputSeriesSet: IChartAssistSeries<IAccessors>[]): void;\n\n    /**\n     * Gets the current highlighted value for the specified series\n     *\n     * @param {IChartSeries<IAccessors>} chartSeries The chart series to get the highlighted value for\n     * @param {string} scaleKey The key for the datapoint value scale\n     * @param {string} [formatterName] The name of the formatter if a custom formatter name is set on the scale\n     *\n     * @returns {string} The highlighted value\n     */\n    getHighlightedValue(\n        chartSeries: IChartSeries<IAccessors>,\n        scaleKey: string,\n        formatterName?: string\n    ): string | number | undefined;\n\n    /**\n     * Returns visible series that are represented by a legend\n     */\n    getVisibleSeriesWithLegend(): IChartAssistSeries<IAccessors>[];\n}\n\n/** Event types that can be emitted from a chart assist */\nexport enum ChartAssistEventType {\n    ToggleSeries = \"ToggleSeries\",\n    ResetVisibleSeries = \"ResetVisibleSeries\",\n    EmphasizeSeries = \"EmphasizeSeries\",\n}\n\n/** Interface for chart assist events */\nexport interface IChartAssistEvent {\n    type: ChartAssistEventType;\n    payload: any;\n}\n\n/**\n * Legend interaction assist uses this class to present the state that consists of emphasisState+visible as one state\n */\nexport class ChartAssistRenderStateData implements IRenderStateData {\n    constructor(\n        public seriesId: string,\n        public series: IChartAssistSeries<IAccessors>,\n        public emphasisState = RenderState.default,\n        public visible = true\n    ) {}\n\n    get state(): RenderState {\n        return this.visible ? this.emphasisState : RenderState.hidden;\n    }\n}\n\nexport type IRenderStatesIndex = Record<string, ChartAssistRenderStateData>;\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport each from \"lodash/each\";\nimport keyBy from \"lodash/keyBy\";\nimport values from \"lodash/values\";\nimport { Observable, of, Subject, Subscription } from \"rxjs\";\n// eslint-disable-next-line import/no-deprecated\nimport { filter, map, switchMap, takeUntil } from \"rxjs/operators\";\n\nimport {\n    ChartAssistEventType,\n    ChartAssistRenderStateData,\n    IChartAssist,\n    IChartAssistEvent,\n    IRenderStatesIndex,\n} from \"./types\";\nimport {\n    DESTROY_EVENT,\n    HIGHLIGHT_SERIES_EVENT,\n    INTERACTION_DATA_POINTS_EVENT,\n    MOUSE_ACTIVE_EVENT,\n} from \"../../constants\";\nimport { RenderState } from \"../../renderers/types\";\nimport { EventBus } from \"../common/event-bus\";\nimport {\n    defaultMarkerProvider,\n    defaultPalette,\n} from \"../common/palette/default-providers\";\nimport {\n    IAccessors,\n    IChart,\n    IChartAssistSeries,\n    IChartEvent,\n    IChartMarker,\n    IChartPalette,\n    IChartSeries,\n    IDataPoint,\n    IDataPointsPayload,\n    IInteractionDataPointsEvent,\n    InteractionType,\n    IRenderStateData,\n    IValueProvider,\n} from \"../common/types\";\n\n/**\n * Helper class that helps to bootstrap a chart with legend, using data pre-processor.\n * It will use the most common settings.\n */\nexport class ChartAssist<T extends IAccessors = IAccessors>\n    implements IChartAssist\n{\n    /**\n     * Retrieves the display value for a data point on the specified series\n     *\n     * @param chartSeries The series containing the data point to get a label for\n     * @param dataPoint The data point to get a label for\n     * @param scaleKey The key for the scale potentially containing a formatter that can be used to format the label\n     * @param formatterName The name of the formatter to use for formatting the label\n     * @param dataAccessorKey The accessor key to use for accessing the data value if the accessor key differs from the scale key\n     *\n     * @returns The display value for a data point\n     */\n    public static getLabel(\n        chartSeries: IChartSeries<IAccessors>,\n        dataPoint: any,\n        scaleKey: string,\n        formatterName?: string,\n        dataAccessorKey?: string\n    ): any {\n        if (!dataPoint || chartSeries.data.length === 0) {\n            return null;\n        }\n\n        const valueAccessor =\n            chartSeries.accessors.data?.[dataAccessorKey || scaleKey];\n        if (!valueAccessor) {\n            return null;\n        }\n\n        const adjustedIndex =\n            dataPoint.index < 0 ? chartSeries.data.length - 1 : dataPoint.index;\n        const data = chartSeries.data[adjustedIndex];\n\n        const rawValue = valueAccessor(\n            data,\n            adjustedIndex,\n            chartSeries.data,\n            chartSeries\n        );\n        const scale = chartSeries.scales[scaleKey];\n        if (!scale || !formatterName) {\n            return rawValue;\n        }\n\n        const formatter = scale.formatters[formatterName];\n        if (!formatter) {\n            return rawValue;\n        }\n\n        return formatter(rawValue);\n    }\n\n    public highlightedDataPoints: IDataPointsPayload;\n    public isLegendActive = false;\n    public inputSeriesSet: IChartAssistSeries<IAccessors>[] = [];\n    public legendSeriesSet: IChartAssistSeries<IAccessors>[] = [];\n\n    /**\n     * Subject for subscribing to IChartAssistEvents such as\n     * ToggleSeries, EmphasizeSeries, and ResetVisibleSeries\n     */\n    public chartAssistSubject = new Subject<IChartAssistEvent>();\n\n    private syncHandlerMap: Record<ChartAssistEventType, any>;\n    private getVisibleSeriesWithLegendBackup: () => IChartAssistSeries<\n        IAccessors<any>\n    >[];\n    private syncSubscription: Subscription;\n    private legendInteractionAssist: LegendInteractionAssist;\n\n    public onEvent: (event: IChartEvent) => void;\n\n    constructor(\n        public chart: IChart,\n        seriesProcessor?: (\n            series: IChartAssistSeries<T>[]\n        ) => IChartAssistSeries<T>[],\n        public palette: IChartPalette = defaultPalette(),\n        public markers: IValueProvider<IChartMarker> = defaultMarkerProvider()\n    ) {\n        this.configureChartEventSubscriptions(chart.getEventBus());\n        if (seriesProcessor) {\n            this.seriesProcessor = seriesProcessor;\n        }\n\n        this.legendInteractionAssist = new LegendInteractionAssist(this);\n\n        this.syncHandlerMap = {\n            [ChartAssistEventType.EmphasizeSeries]: this.emphasizeSeries,\n            [ChartAssistEventType.ResetVisibleSeries]: this.resetVisibleSeries,\n            [ChartAssistEventType.ToggleSeries]: this.toggleSeries,\n        };\n    }\n\n    public get renderStatesIndex(): IRenderStatesIndex {\n        return this.legendInteractionAssist.renderStatesIndex;\n    }\n\n    /**\n     * Convenience stream of highlight events that can be used to populate legend.\n     * It will return highlighted value for the series (while hovering over datapoints) or the last value from series (while not hovering over and if possible),\n     * otherwise it'll return null\n     * @param chartSeries\n     */\n    public legendLabelData$(\n        chartSeries: IChartSeries<IAccessors>\n    ): Observable<any> {\n        const seriesHighlight$ = this.chart\n            .getEventBus()\n            .getStream(INTERACTION_DATA_POINTS_EVENT)\n            .asObservable()\n            .pipe(\n                filter(\n                    (event) =>\n                        event.data.interactionType === InteractionType.MouseMove\n                ),\n                map((event) => event.data.dataPoints[chartSeries.id])\n            );\n\n        // if there is no highlightData, or index is \"-1\", we'll show the last value from series (if possible)\n        const highlightDataPresentPredicate = (highlightData: any) =>\n            highlightData && highlightData.index >= 0;\n\n        return seriesHighlight$.pipe(\n            // eslint-disable-next-line import/no-deprecated\n            switchMap((highlightData) =>\n                highlightDataPresentPredicate(highlightData)\n                    ? of(highlightData.data)\n                    : of(\n                          chartSeries.data && chartSeries.data.length\n                              ? chartSeries.data[chartSeries.data.length - 1]\n                              : null\n                      )\n            )\n        );\n    }\n\n    public seriesProcessor(\n        series: IChartAssistSeries<IAccessors>[]\n    ): IChartAssistSeries<IAccessors>[] {\n        return series;\n    }\n\n    public update(\n        inputSeriesSet: IChartAssistSeries<IAccessors>[],\n        updateLegend = true\n    ): void {\n        this.inputSeriesSet = inputSeriesSet;\n\n        const processedSeriesSet = this.seriesProcessor(\n            inputSeriesSet.map((series) => ({\n                ...series,\n                data: series.data || [],\n            }))\n        );\n\n        this.legendSeriesSet = processedSeriesSet.filter(\n            (s) => s.showInLegend || typeof s.showInLegend === \"undefined\"\n        );\n\n        if (updateLegend) {\n            this.legendInteractionAssist.update(processedSeriesSet);\n        }\n        // add render states to the series for use in the chart\n        const seriesSet = processedSeriesSet.map((s) =>\n            Object.assign(\n                { renderState: this.renderStatesIndex[s.id]?.state },\n                s\n            )\n        );\n\n        this.chart.update(seriesSet);\n\n        this.publishRenderStates();\n    }\n\n    public toggleSeries = (seriesId: string, visible: boolean): void => {\n        this.legendInteractionAssist.setGroupVisibility(seriesId, visible);\n\n        this.update(this.inputSeriesSet, false);\n        this.chartAssistSubject.next({\n            type: ChartAssistEventType.ToggleSeries,\n            payload: { seriesId, visible },\n        });\n    };\n\n    /**\n     * Resets all visible series to default state\n     */\n    public resetVisibleSeries = (): void => {\n        this.legendInteractionAssist.resetSeries();\n\n        this.publishRenderStates();\n        this.chartAssistSubject.next({\n            type: ChartAssistEventType.ResetVisibleSeries,\n            payload: {},\n        });\n    };\n\n    /**\n     * For series that are currently visible, emphasize the given series and deemphasizes all the other ones\n     *\n     * @param seriesId\n     */\n    public emphasizeSeries = (seriesId: string): void => {\n        this.legendInteractionAssist.emphasizeSeries(seriesId);\n\n        this.publishRenderStates();\n        this.chartAssistSubject.next({\n            type: ChartAssistEventType.EmphasizeSeries,\n            payload: { seriesId },\n        });\n    };\n\n    public isSeriesHidden(seriesId: string): boolean {\n        return this.legendInteractionAssist.isSeriesHidden(seriesId);\n    }\n\n    public seriesTrackByFn(\n        index: number,\n        item: IChartAssistSeries<IAccessors>\n    ): string {\n        return item.id;\n    }\n\n    /**\n     * Retrieves the display value for the highlighted data point on the specified series\n     *\n     * @param chartSeries The series containing the highlighted data point to get a label for\n     * @param scaleKey The key for the scale potentially containing a formatter that can be used to format the label\n     * @param formatterName The name of the formatter to use for formatting the label\n     * @param dataAccessorKey The accessor key to use for accessing the data value if the accessor key differs from the scale key\n     *\n     * @returns The display value for the highlighted data point\n     */\n    public getHighlightedValue(\n        chartSeries: IChartSeries<IAccessors>,\n        scaleKey: string,\n        formatterName?: string,\n        dataAccessorKey?: string\n    ): string | number | undefined {\n        if (!this.highlightedDataPoints) {\n            return undefined;\n        }\n\n        const dataPoint = this.highlightedDataPoints[chartSeries.id];\n        return ChartAssist.getLabel(\n            chartSeries,\n            dataPoint,\n            scaleKey,\n            formatterName,\n            dataAccessorKey\n        );\n    }\n\n    public getVisibleSeriesWithLegend = (): IChartAssistSeries<\n        IAccessors<any>\n    >[] => this.legendSeriesSet.filter((s) => !this.isSeriesHidden(s.id));\n\n    /**\n     * Synchronize this chart assist's actions with IChartAssistEvents emitted by the specified\n     * chart assist, and override this chart assist's getVisibleSeriesWithLegend method with the\n     * specified chart assist's getVisibleSeriesWithLegend.\n     *\n     * Note: If the chart instance of the specified chart assist is replaced by a new chart,\n     * this method must be invoked again to resume synchronized behavior.\n     *\n     * @param {ChartAssist} chartAssist The chart assist to synchronize with\n     */\n    public syncWithChartAssist(chartAssist: ChartAssist): void {\n        this.getVisibleSeriesWithLegendBackup = this.getVisibleSeriesWithLegend;\n        this.getVisibleSeriesWithLegend =\n            chartAssist.getVisibleSeriesWithLegend;\n\n        this.syncSubscription = chartAssist.chartAssistSubject\n            .pipe(\n                takeUntil(\n                    chartAssist.chart.getEventBus().getStream(DESTROY_EVENT)\n                )\n            )\n            .subscribe((event: IChartAssistEvent) => {\n                const args = Object.keys(event.payload).map(\n                    (key) => event.payload[key]\n                );\n                this.syncHandlerMap[event.type](...args);\n            });\n    }\n\n    /**\n     * Unsynchronize this chart assist's actions from those of the chart assist\n     * specified in a previous syncWithChartAssist call, and restore this chart\n     * assist's getVisibleSeriesWithLegend method with the instance used before\n     * syncWithChartAssist was called.\n     */\n    public unsyncChartAssist(): void {\n        this.getVisibleSeriesWithLegend = this.getVisibleSeriesWithLegendBackup;\n\n        if (this.syncSubscription) {\n            this.syncSubscription.unsubscribe();\n        }\n    }\n\n    private configureChartEventSubscriptions(\n        eventBus: EventBus<IChartEvent>\n    ): void {\n        const eventHandlers: { [eventName: string]: (data?: any) => void } = {\n            [INTERACTION_DATA_POINTS_EVENT]: (\n                data: IInteractionDataPointsEvent\n            ) => {\n                if (data.interactionType === InteractionType.MouseMove) {\n                    this.highlightedDataPoints = Object.assign(\n                        {},\n                        data.dataPoints\n                    );\n                }\n            },\n            [HIGHLIGHT_SERIES_EVENT]: (data: IDataPoint) => {\n                if (data.index >= 0) {\n                    this.emphasizeSeries(data.seriesId);\n                } else {\n                    this.resetVisibleSeries();\n                }\n            },\n            [MOUSE_ACTIVE_EVENT]: (data: boolean) => {\n                this.isLegendActive = data;\n            },\n        };\n\n        each(Object.keys(eventHandlers), (key) => {\n            eventBus.getStream(key).subscribe((event) => {\n                eventHandlers[key](event.data);\n                if (this.onEvent) {\n                    this.onEvent(event);\n                }\n            });\n        });\n    }\n\n    private publishRenderStates(): void {\n        this.chart.setSeriesStates(\n            this.legendInteractionAssist.getSeriesStates()\n        );\n    }\n}\n\nexport class LegendInteractionAssist {\n    private seriesGroups: Record<string, string[]> = {};\n    private seriesIndex: Record<string, IChartAssistSeries<IAccessors>>;\n\n    public renderStatesIndex: IRenderStatesIndex = {};\n\n    constructor(private chartAssist: ChartAssist) {}\n\n    public update(seriesSet: IChartAssistSeries<IAccessors>[]): void {\n        this.seriesGroups = this.getSeriesGroups(seriesSet);\n        this.seriesIndex = keyBy(seriesSet, (s) => s.id);\n\n        this.resetSeries();\n\n        // override render states\n        for (const series of seriesSet.filter((s) => s.renderState)) {\n            this.renderStatesIndex[series.id] = new ChartAssistRenderStateData(\n                series.id,\n                series,\n                series.renderState === RenderState.hidden\n                    ? RenderState.default\n                    : series.renderState,\n                series.renderState !== RenderState.hidden\n            );\n        }\n    }\n\n    public getSeriesStates(): IRenderStateData[] {\n        return values(this.renderStatesIndex);\n    }\n\n    public isSeriesHidden(seriesId: string): boolean {\n        const renderState = this.renderStatesIndex[seriesId];\n        return renderState && !renderState.visible;\n    }\n\n    private getSeriesGroups(seriesSet: IChartAssistSeries<IAccessors>[]) {\n        const seriesGroups: Record<string, string[]> = {};\n\n        for (const s of seriesSet) {\n            const separatorIndex = s.id.indexOf(\"__\");\n            const parentId =\n                separatorIndex >= 0 ? s.id.substring(0, separatorIndex) : s.id;\n\n            if (!seriesGroups[parentId]) {\n                seriesGroups[parentId] = [];\n            }\n            seriesGroups[parentId].push(s.id);\n        }\n\n        return seriesGroups;\n    }\n\n    /**\n     * @param groupId id of the parent series\n     * @param renderState\n     */\n    public setGroupState(groupId: string, renderState: RenderState): void {\n        if (!this.seriesGroups[groupId]) {\n            return;\n        }\n\n        for (const s of this.seriesGroups[groupId]) {\n            this.setRenderState(s, renderState);\n        }\n    }\n\n    /**\n     * @param groupId id of the parent series\n     * @param visible\n     */\n    public setGroupVisibility(groupId: string, visible: boolean): void {\n        if (!this.seriesGroups[groupId]) {\n            return;\n        }\n\n        for (const s of this.seriesGroups[groupId]) {\n            this.setVisibility(s, visible);\n        }\n    }\n\n    public emphasizeSeries(seriesId: string): void {\n        for (const group of Object.keys(this.seriesGroups)) {\n            this.setGroupState(\n                group,\n                group === seriesId\n                    ? RenderState.emphasized\n                    : RenderState.deemphasized\n            );\n        }\n    }\n\n    public resetSeries(): void {\n        const legendSeries = this.chartAssist.getVisibleSeriesWithLegend();\n        const oneSeriesMode = legendSeries.length === 1;\n\n        if (oneSeriesMode) {\n            this.emphasizeSeries(legendSeries[0].id);\n        } else {\n            for (const group of Object.keys(this.seriesGroups)) {\n                this.setGroupState(group, RenderState.default);\n            }\n        }\n    }\n\n    private setRenderState(seriesId: string, state: RenderState) {\n        let renderState = this.renderStatesIndex[seriesId];\n        if (renderState) {\n            renderState.emphasisState = state;\n        } else {\n            renderState = new ChartAssistRenderStateData(\n                seriesId,\n                this.seriesIndex[seriesId],\n                state\n            );\n            this.renderStatesIndex[seriesId] = renderState;\n        }\n    }\n\n    private setVisibility(seriesId: string, visible: boolean) {\n        let renderState = this.renderStatesIndex[seriesId];\n        if (renderState) {\n            renderState.visible = visible;\n        } else {\n            renderState = new ChartAssistRenderStateData(\n                seriesId,\n                this.seriesIndex[seriesId],\n                RenderState.default,\n                visible\n            );\n            this.renderStatesIndex[seriesId] = renderState;\n        }\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { IAllAround, IDimensionConfig } from \"../types\";\n\nexport class DimensionConfig implements IDimensionConfig {\n    private _width: number = 0;\n    private _height: number = 0;\n    /** See {@link IDimensionConfig#margin} */\n    public margin: IAllAround<number> = {\n        top: 0,\n        right: 0,\n        bottom: 0,\n        left: 0,\n    };\n    /** See {@link IDimensionConfig#padding} */\n    public padding: IAllAround<number> = {\n        top: 0,\n        right: 0,\n        bottom: 0,\n        left: 0,\n    };\n    /** See {@link IDimensionConfig#marginLocked} */\n    public marginLocked: IAllAround<boolean> = {\n        top: false,\n        right: false,\n        bottom: false,\n        left: false,\n    };\n\n    /** See {@link IDimensionConfig#autoWidth} */\n    public autoWidth = true;\n    /** See {@link IDimensionConfig#autoHeight} */\n    public autoHeight = true;\n\n    /** See {@link IDimensionConfig#width} */\n    public width(): number;\n    /** See {@link IDimensionConfig#width} */\n    public width(value: number): IDimensionConfig;\n    /** See {@link IDimensionConfig#width} */\n    public width(value?: number): any {\n        if (value === undefined) {\n            return this._width;\n        }\n        this._width = value;\n        return this;\n    }\n\n    /** See {@link IDimensionConfig#height} */\n    public height(): number;\n    /** See {@link IDimensionConfig#height} */\n    public height(value: number): IDimensionConfig;\n    /** See {@link IDimensionConfig#height} */\n    public height(value?: number): any {\n        if (value === undefined) {\n            return this._height;\n        }\n        this._height = value;\n        return this;\n    }\n\n    /** See {@link IDimensionConfig#outerWidth} */\n    public outerWidth(): number;\n    /** See {@link IDimensionConfig#outerWidth} */\n    public outerWidth(value: number): IDimensionConfig;\n    /** See {@link IDimensionConfig#outerWidth} */\n    public outerWidth(value?: number): any {\n        const marginsWidth = this.margin.right + this.margin.left;\n        if (value === undefined) {\n            return this._width + marginsWidth;\n        }\n        this._width = Math.max(value - marginsWidth, 0);\n        return this;\n    }\n\n    /** See {@link IDimensionConfig#outerHeight} */\n    public outerHeight(): number;\n    /** See {@link IDimensionConfig#outerHeight} */\n    public outerHeight(value: number): IDimensionConfig;\n    /** See {@link IDimensionConfig#outerHeight} */\n    public outerHeight(value?: number): any {\n        const marginsHeight = this.margin.top + this.margin.bottom;\n        if (value === undefined) {\n            return this._height + marginsHeight;\n        }\n        this._height = Math.max(value - marginsHeight, 0);\n        return this;\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { BaseType } from \"d3\";\nimport { Selection } from \"d3-selection\";\n\nimport { ITextOverflowArgs } from \"./types\";\nimport { IGNORE_INTERACTION_CLASS } from \"../../constants\";\n\n/**\n * Default handler for text overflow\n *\n * @param textSelection\n * @param args\n */\nexport function defaultTextOverflowHandler(\n    textSelection: Selection<BaseType, unknown, null, undefined>,\n    args: ITextOverflowArgs\n): void {\n    const originalText = textSelection.text();\n    const chars = originalText.split(\"\");\n    // add IGNORE_INTERACTION_CLASS so that mouse events used for displaying the title don't propagate from the mouse-interactive-area\n    const ellipsisTSpan = textSelection\n        .text(\"\")\n        .append(\"tspan\")\n        .attr(\"class\", `${IGNORE_INTERACTION_CLASS} ellipsis`)\n        .text(\"...\");\n    const textTSpan = textSelection\n        .insert(\"tspan\", \":first-child\")\n        .attr(\"class\", `${IGNORE_INTERACTION_CLASS} text`)\n        .text(originalText);\n\n    const paddingAndEllipsisWidth =\n        args.ellipsisWidth + args.horizontalPadding * 2;\n    const originalCharCount = chars.length;\n    let labelWidth =\n        (textTSpan?.node()?.getComputedTextLength() || 0) +\n        args.horizontalPadding * 2;\n    while (\n        chars.length &&\n        (labelWidth > args.widthLimit || chars[chars.length - 1] === \" \")\n    ) {\n        chars.pop();\n        textTSpan.text(chars.join(\"\"));\n        labelWidth =\n            paddingAndEllipsisWidth +\n            (textTSpan?.node()?.getComputedTextLength() || 0);\n    }\n\n    if (chars.length === originalCharCount) {\n        ellipsisTSpan.remove();\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { defaultTextOverflowHandler } from \"../default-text-overflow-handler\";\nimport { IAxisConfig, ITickLabelConfig } from \"../types\";\n\n/** See {@link IAxisConfig} */\nexport class AxisConfig implements IAxisConfig {\n    /** See {@link IAxisConfig#visible} */\n    public visible: boolean = true;\n\n    /** See {@link IAxisConfig#gridTicks} */\n    public gridTicks: boolean = false;\n\n    /** See {@link IAxisConfig#tickSize} */\n    public tickSize: number = 5;\n\n    /** See {@link IAxisConfig#tickLabel} */\n    public tickLabel: ITickLabelConfig = {\n        horizontalPadding: 0,\n        overflowHandler: defaultTextOverflowHandler,\n    };\n\n    /** See {@link IAxisConfig#fit} */\n    public fit: boolean = false;\n\n    private _approximateTicks: number = 5;\n\n    /** See {@link IAxisConfig#approximateTicks} */\n    get approximateTicks(): any {\n        return this._approximateTicks;\n    }\n\n    /** See {@link IAxisConfig#approximateTicks} */\n    set approximateTicks(ticks: any) {\n        this._approximateTicks = parseInt(ticks, 10);\n    }\n\n    public padding: number = 0;\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { IBorderConfig } from \"../types\";\n\n/** @ignore */\nexport class BorderConfig implements IBorderConfig {\n    public color: string;\n    public width: number;\n    public visible = true;\n\n    constructor(public className?: string) {}\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport {\n    IAllAround,\n    IBorderConfig,\n    IDimensionConfig,\n    IGridConfig,\n} from \"../types\";\nimport { DimensionConfig } from \"./dimension-config\";\n\n/** See {@link IGridConfig} */\nexport class GridConfig implements IGridConfig {\n    // We should avoid this kind of option in future versions of GridConfig\n    // because ideally all plugins should be added manually (NUI-3304).\n    /** See {@link IGridConfig#interactive} */\n    public interactive: boolean = true;\n\n    /** See {@link IGridConfig#dimension} */\n    public dimension: IDimensionConfig = new DimensionConfig();\n    /** See {@link IGridConfig#borders} */\n    public borders: IAllAround<IBorderConfig> = {\n        // TODO: Review this\n        // @ts-ignore\n        top: undefined,\n        // @ts-ignore\n        bottom: undefined,\n        // @ts-ignore\n        left: undefined,\n        // @ts-ignore\n        right: undefined,\n    };\n    /** See {@link IGridConfig#cursor} */\n    public cursor = \"crosshair\";\n    /** See {@link IGridConfig#disableRenderAreaHeightCorrection} */\n    public disableRenderAreaHeightCorrection = false;\n    /** See {@link IGridConfig#disableRenderAreaWidthCorrection} */\n    public disableRenderAreaWidthCorrection = false;\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { IAllAround, IAxisConfig, IXYGridConfig } from \"../types\";\nimport { AxisConfig } from \"./axis-config\";\nimport { BorderConfig } from \"./border-config\";\nimport { GridConfig } from \"./grid-config\";\n\nexport class XYGridConfig extends GridConfig implements IXYGridConfig {\n    /** The default margin */\n    public static readonly DEFAULT_MARGIN: IAllAround<number> = {\n        top: 0,\n        right: 5,\n        bottom: 20,\n        left: 30,\n    };\n\n    public static readonly DEFAULT_PADDING: IAllAround<number> = {\n        left: 0,\n        right: 0,\n        top: 5,\n        bottom: 5,\n    };\n\n    public axis: IAllAround<IAxisConfig> = {\n        top: new AxisConfig(),\n        right: new AxisConfig(),\n        bottom: new AxisConfig(),\n        left: new AxisConfig(),\n    };\n\n    // We should avoid this kind of option in future versions of XYGrid and XYGridConfig\n    // because ideally all plugins should be added manually (NUI-3304).\n    public interactionPlugins = true;\n\n    constructor() {\n        super();\n\n        this.dimension.padding = Object.assign(\n            {},\n            XYGridConfig.DEFAULT_PADDING\n        );\n        this.dimension.margin = Object.assign({}, XYGridConfig.DEFAULT_MARGIN);\n\n        this.borders.bottom = new BorderConfig(\n            \"nui-chart-border nui-chart-border--thick\"\n        );\n        this.borders.left = new BorderConfig(\n            \"nui-chart-border nui-chart-border--thick\"\n        );\n        this.borders.left.visible = false; // TODO: figure out if this is the valid default\n\n        this.axis.left.gridTicks = true;\n        this.axis.left.tickSize = 0;\n        this.axis.left.padding = 10;\n\n        this.axis.right.fit = true;\n        this.axis.right.tickSize = 0;\n        this.axis.right.padding = 10;\n\n        this.axis.bottom.tickLabel.horizontalPadding = 5;\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { DimensionConfig } from \"./dimension-config\";\nimport { XYGridConfig } from \"./xy-grid-config\";\nimport {\n    GaugeMode,\n    StandardLinearGaugeThickness,\n} from \"../../../gauge/constants\";\n\n/**\n * Assembles a linear-gauge-specific grid configuration\n *\n * @param mode vertical or horizontal\n * @param thickness The thickness of the gauge\n *\n * @returns {XYGridConfig} A linear gauge grid configuration\n */\nexport function linearGaugeGridConfig(\n    mode: GaugeMode.Vertical | GaugeMode.Horizontal,\n    thickness = StandardLinearGaugeThickness.Large\n): XYGridConfig {\n    const gridConfig = new XYGridConfig();\n    gridConfig.interactionPlugins = false;\n    gridConfig.disableRenderAreaHeightCorrection = true;\n\n    gridConfig.axis.bottom.visible = false;\n    gridConfig.axis.bottom.gridTicks = false;\n\n    gridConfig.axis.left.visible = false;\n    gridConfig.axis.left.gridTicks = false;\n\n    gridConfig.borders.left.visible = false;\n    gridConfig.borders.bottom.visible = false;\n\n    // reset the dimension config with zero margins and zero padding\n    gridConfig.dimension = new DimensionConfig();\n\n    // set the gauge's thickness\n    if (mode === GaugeMode.Vertical) {\n        gridConfig.dimension.autoWidth = false;\n        gridConfig.dimension.width(thickness);\n    } else {\n        gridConfig.dimension.autoHeight = false;\n        gridConfig.dimension.height(thickness);\n    }\n\n    return gridConfig;\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { event, mouse } from \"d3-selection\";\nimport { BehaviorSubject } from \"rxjs\";\n\nimport { D3Selection, IInteractionEvent, InteractionType } from \"./types\";\nimport { IGNORE_INTERACTION_CLASS } from \"../../constants\";\nimport { IAllAround } from \"../grid/types\";\n\n/**\n * @ignore\n */\nexport class MouseInteractiveArea<\n    TTarget extends D3Selection<SVGGElement> = D3Selection<SVGGElement>,\n    TInteractiveArea extends D3Selection<SVGRectElement> = D3Selection<SVGRectElement>\n> {\n    public static CONTAINER_CLASS = \"mouse-interactive-area\";\n\n    public readonly active = new BehaviorSubject<boolean>(false);\n    public readonly interaction = new BehaviorSubject<IInteractionEvent>({\n        type: InteractionType.Click,\n        coordinates: { x: 0, y: 0 },\n    });\n    private isActive = false;\n\n    constructor(\n        private target: TTarget,\n        private interactiveArea: TInteractiveArea,\n        cursor: string,\n        private gridMargin?: IAllAround<number>\n    ) {\n        this.interactiveArea\n            .style(\"cursor\", cursor)\n            .classed(MouseInteractiveArea.CONTAINER_CLASS, true);\n        this.target\n            .on(\"mouseover\", this.onMouseOver)\n            .on(\"mouseout\", this.onMouseOut)\n            .on(InteractionType.MouseDown, () =>\n                this.onMouseInteraction(InteractionType.MouseDown)\n            )\n            .on(InteractionType.MouseUp, () =>\n                this.onMouseInteraction(InteractionType.MouseUp)\n            )\n            .on(InteractionType.MouseMove, () =>\n                this.onMouseInteraction(InteractionType.MouseMove)\n            )\n            .on(InteractionType.Click, () =>\n                this.onMouseInteraction(InteractionType.Click)\n            );\n    }\n\n    public onMouseInteraction = (interactionType: InteractionType): void => {\n        if (event.target.classList.contains(IGNORE_INTERACTION_CLASS)) {\n            return;\n        }\n\n        let x: number = 0,\n            y: number = 0;\n        const interactiveAreaWidth =\n            parseInt(this.interactiveArea.attr(\"width\"), 10) || 0;\n        const interactiveAreaHeight =\n            parseInt(this.interactiveArea.attr(\"height\"), 10) || 0;\n\n        // Hack from https://stackoverflow.com/questions/7000190/detect-all-firefox-versions-in-js#comment28264971_7000222\n        const isFirefox = /firefox/i.test(navigator.userAgent);\n\n        // Hack from https://github.com/d3/d3-selection/issues/81#issuecomment-528321960\n        if (isFirefox) {\n            // this works in Firefox\n\n            // Note: Margin must be subtracted because of the transform that occurs in XYGrid.recalculateMargins\n            let calculatedX = x + event.offsetX - (this.gridMargin?.left || 0);\n\n            // clamp output to right or left side of interactive area if necessary\n            calculatedX =\n                calculatedX > interactiveAreaWidth\n                    ? interactiveAreaWidth\n                    : calculatedX;\n            x = calculatedX < 0 ? 0 : calculatedX;\n\n            // Note: Margin must be subtracted because of the transform that occurs in XYGrid.recalculateMargins\n            let calculatedY = y + event.offsetY - (this.gridMargin?.top || 0);\n\n            // clamp output to top or bottom side of interactive area if necessary\n            calculatedY =\n                calculatedY > interactiveAreaHeight\n                    ? interactiveAreaHeight\n                    : calculatedY;\n            y = calculatedY < 0 ? 0 : calculatedY;\n        } else {\n            // this works in Chrome\n\n            const mouseOutput = mouse(event.currentTarget);\n\n            // clamp output to right or left side of interactive area if necessary\n            const calculatedX =\n                mouseOutput[0] > interactiveAreaWidth\n                    ? interactiveAreaWidth\n                    : mouseOutput[0];\n            x = calculatedX < 0 ? 0 : calculatedX;\n\n            // clamp output to top or bottom side of interactive area if necessary\n            const calculatedY =\n                mouseOutput[1] > interactiveAreaHeight\n                    ? interactiveAreaHeight\n                    : mouseOutput[1];\n            y = calculatedY < 0 ? 0 : calculatedY;\n        }\n        this.interaction.next({\n            type: interactionType,\n            coordinates: { x, y },\n        });\n    };\n\n    public onMouseOver = (): void => {\n        if (\n            this.isActive ||\n            event.target.classList.contains(IGNORE_INTERACTION_CLASS)\n        ) {\n            return;\n        }\n\n        this.isActive = true;\n        this.active.next(true);\n    };\n\n    public onMouseOut = (): void => {\n        if (!this.isActive) {\n            return;\n        }\n\n        // we're leaving the element – where to? Maybe to a descendant of the lasagna container? If so, we're still active.\n        let relatedTarget = event.relatedTarget;\n        while (relatedTarget) {\n            // go up the parent chain and check – if we're still inside the lasagna container, that's an internal transition – ignore it\n            if (relatedTarget === this.target.node()) {\n                return;\n            }\n\n            relatedTarget = relatedTarget.parentNode;\n        }\n\n        this.isActive = false;\n        this.active.next(false);\n    };\n\n    // Remove in v12 - NUI-5827\n    /** @deprecated - Please use 'onMouseOver' instead */\n    public onMouseEnter = (): void => {\n        this.onMouseOver();\n    };\n\n    // Remove in v12 - NUI-5827\n    /** @deprecated - Please use 'onMouseOut' instead */\n    public onMouseLeave = (): void => {\n        this.onMouseOut();\n    };\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { max, min, Numeric } from \"d3\";\nimport flatten from \"lodash/flatten\";\nimport uniq from \"lodash/uniq\";\n\nimport { EMPTY_CONTINUOUS_DOMAIN, IScale } from \"../types\";\n\n/**\n * Merge given domains\n *\n * @param domains collected from dataSeries on the chart\n * @param scale that owns the domains\n */\nexport function mergeDomains(domains: any[][], scale: IScale<any>): any[] {\n    if (scale.isContinuous()) {\n        const nonEmptyDomains = domains.filter(\n            (d) => d !== EMPTY_CONTINUOUS_DOMAIN\n        );\n\n        if (nonEmptyDomains.length === 0) {\n            return EMPTY_CONTINUOUS_DOMAIN;\n        }\n\n        const domainMin = min<Numeric>(\n            nonEmptyDomains\n                .filter((e) => typeof e[0] !== \"undefined\")\n                .map((e) => e[0])\n        );\n        const domainMax = max<Numeric>(\n            nonEmptyDomains\n                .filter((e) => typeof e[1] !== \"undefined\")\n                .map((e) => e[1])\n        );\n\n        return [domainMin, domainMax];\n    }\n\n    const maxLength = Math.max(...domains.map((d) => d.length));\n    return Array.from(Array(maxLength)).map((e, i) => {\n        const scalesDomains = domains.map((d) => (i < d.length ? d[i] : []));\n        return uniq(flatten(scalesDomains));\n    });\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport indexOf from \"lodash/indexOf\";\n\nimport { IAccessors, IChartSeries } from \"../../types\";\nimport { DomainCalculator, IScale } from \"../types\";\nimport { mergeDomains } from \"./merge-domains\";\n\n/** @ignore */\nfunction getFixedDomains(\n    chartSeriesSet: IChartSeries<IAccessors>[],\n    scaleId: string\n): Record<string, IScale<any>[]> {\n    return chartSeriesSet.reduce((result, next: IChartSeries<IAccessors>) => {\n        for (const scaleKey of Object.keys(next.scales)) {\n            if (scaleKey === scaleId) {\n                continue;\n            }\n            const scale = next.scales[scaleKey];\n            if (!scale.isDomainFixed) {\n                continue;\n            }\n\n            if (!result[scaleKey]) {\n                result[scaleKey] = [];\n            }\n\n            if (indexOf(result[scaleKey], scale) === -1) {\n                result[scaleKey].push(scale);\n            }\n        }\n\n        return result;\n    }, <Record<string, IScale<any>[]>>{});\n}\n\n/**\n * Returns automatically calculated domain for given scaleKey based on given set of chart series. It considers scales with fixed domains for limiting\n * considered data set.\n *\n * @param {IChartSeries<IAccessors>[]} chartSeriesSet\n * @param {string} scaleKey\n * @param scale\n * @returns {[any, any]} domain\n */\nexport const getAutomaticDomain: DomainCalculator = (\n    chartSeriesSet: IChartSeries<IAccessors>[],\n    scaleKey: string,\n    scale: IScale<any>\n): any[] => {\n    const fixedDomains = getFixedDomains(chartSeriesSet, scaleKey);\n\n    const domains: any[][] = chartSeriesSet.map((cs) => {\n        // find fixed, continuous scales that are referenced by this series\n        const filterScales = Object.keys(fixedDomains).reduce(\n            (result, next: string) => {\n                const seriesScale = cs.scales[next];\n                if (\n                    seriesScale &&\n                    seriesScale.isContinuous() &&\n                    indexOf(fixedDomains[next], seriesScale) !== -1\n                ) {\n                    result[next] = seriesScale;\n                }\n                return result;\n            },\n            <Record<string, IScale<any>>>{}\n        );\n\n        return cs.renderer.getDomainOfFilteredData(\n            cs,\n            filterScales,\n            scaleKey,\n            cs.scales[scaleKey]\n        );\n    });\n\n    return mergeDomains(domains, scale);\n};\n\n/**\n * Works like getAutomaticDomain, but also includes provided interval in the calculated result\n *\n * @param {[number , number]} interval\n * @returns {(chartSeriesSet: IChartSeries<IAccessors>[], scaleId: string) => [number , number]} A domain calculator\n * that includes the specified interval in its calculation\n */\nexport const getAutomaticDomainWithIncludedInterval =\n    (interval: [number, number]): DomainCalculator =>\n    (\n        chartSeriesSet: IChartSeries<IAccessors>[],\n        scaleId: string,\n        scale: IScale<any>\n    ) => {\n        const automaticDomain = getAutomaticDomain(\n            chartSeriesSet,\n            scaleId,\n            scale\n        );\n\n        return [\n            Math.min(automaticDomain[0], interval[0]),\n            Math.max(automaticDomain[1], interval[1]),\n        ];\n    };\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { AxisScale } from \"d3-axis\";\n\nimport { UnitOption } from \"@nova-ui/bits\";\n\nimport { UtilityService } from \"../utility.service\";\nimport { getAutomaticDomain } from \"./domain-calculation/automatic-domain\";\nimport { DomainCalculator, IFormatters, IScale } from \"./types\";\n\nexport abstract class Scale<T> implements IScale<T> {\n    public readonly id: string;\n    public domainCalculator: DomainCalculator = getAutomaticDomain;\n    public formatters: IFormatters<T> = {};\n    public isDomainFixed: boolean;\n    public scaleUnits?: UnitOption;\n    public isTimeseriesScale = false;\n    public __domainCalculatedWithTicks?: boolean;\n    private isReversed = false;\n\n    protected _fixDomainValues: T[] = [];\n    protected readonly _d3Scale: any;\n\n    protected constructor(id?: string) {\n        this.id = id || UtilityService.uuid();\n\n        this._d3Scale = this.createD3Scale();\n    }\n\n    /**\n     * Creates a d3 scale based on the scale's type\n     *\n     * @returns {any} A new d3 scale appropriate to the scale type\n     */\n    protected abstract createD3Scale(): any;\n\n    public abstract convert(value: T): number;\n\n    public abstract invert(coordinate: number): T | undefined;\n\n    public abstract isContinuous(): boolean;\n\n    /** See {@link IScale#d3Scale} */\n    public get d3Scale(): AxisScale<T> {\n        return this._d3Scale;\n    }\n\n    public get fixDomainValues(): T[] {\n        return this._fixDomainValues;\n    }\n\n    /** See {@link IScale#setFixDomainValues} */\n    public setFixDomainValues(values: T[]): void {\n        if (values.length > 1) {\n            this.domain([values[0], values[values.length - 1]]);\n            this.isDomainFixed = true;\n        }\n        this._fixDomainValues = values;\n    }\n\n    /** See {@link IScale#range} */\n    public range(): [number, number];\n    public range(range: [number, number]): this;\n    public range(range?: [number, number]): any {\n        if (range) {\n            this._d3Scale.range(this.isReversed ? range.reverse() : range);\n            return this;\n        } else {\n            return this._d3Scale.range();\n        }\n    }\n\n    /** See {@link IScale#domain} */\n    public domain(): T[];\n    public domain(domain: T[]): this;\n    public domain(domain?: T[]): any {\n        if (domain) {\n            this._d3Scale.domain(domain);\n            return this;\n        } else {\n            return this._d3Scale.domain();\n        }\n    }\n\n    /** See {@link IScale#fixDomain} */\n    public fixDomain(domain: T[]): this {\n        this.domain(domain);\n        this.isDomainFixed = true;\n        return this;\n    }\n\n    /** See {@link IScale#reverse} */\n    public isDomainValid(): boolean {\n        return -1 === this.domain().findIndex((value) => value === undefined);\n    }\n\n    public reverse(): this {\n        return this.reversed(!this.isReversed);\n    }\n\n    /** See {@link IScale#reversed} */\n    public reversed(): boolean;\n    public reversed(reversed: boolean): this;\n    public reversed(reversed?: boolean): boolean | this {\n        if (typeof reversed === \"undefined\") {\n            return this.isReversed;\n        } else {\n            this.isReversed = reversed;\n            return this;\n        }\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { scaleLinear } from \"d3-scale\";\n\nimport { Scale } from \"./scale\";\n\n/**\n * Nova wrapper around [D3's scaleLinear](https://d3indepth.com/scales/#scalelinear)\n */\nexport class LinearScale extends Scale<number> {\n    constructor(id?: string) {\n        super(id);\n\n        this.formatters.tick = (value) => value?.toLocaleString();\n    }\n\n    protected createD3Scale(): any {\n        return scaleLinear();\n    }\n\n    public convert(value: number): number {\n        return this._d3Scale(value);\n    }\n\n    public invert(coordinate: number): number {\n        return this._d3Scale.invert(coordinate);\n    }\n\n    public isContinuous(): boolean {\n        return true;\n    }\n\n    public isDomainValid(): boolean {\n        return -1 === this.domain().findIndex((value) => isNaN(value));\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { bisect } from \"d3\";\nimport { scaleBand } from \"d3\";\nimport isUndefined from \"lodash/isUndefined\";\nimport toString from \"lodash/toString\";\n\nimport { BAND_CENTER } from \"./constants\";\nimport { LinearScale } from \"./linear-scale\";\nimport { Scale } from \"./scale\";\nimport { IBandScale, IHasInnerScale, IScale } from \"./types\";\n\n/**\n * Nova wrapper around [D3's scaleBand](https://d3indepth.com/scales/#scaleband)\n * A typical use case for a band scale is a bar chart\n */\nexport class BandScale<T = string>\n    extends Scale<T>\n    implements IBandScale<T>, IHasInnerScale<T>\n{\n    public innerScale: IScale<any>;\n\n    constructor(id?: string) {\n        super(id);\n\n        this.formatters.tick = (value: T) => {\n            if (isUndefined(value)) {\n                throw new Error(\"Can't format bandFormatScale\");\n            }\n            return toString(value);\n        };\n    }\n\n    protected createD3Scale(): any {\n        return scaleBand();\n    }\n\n    /**\n     * This returns center of a band. To return the beginning of a band, manually subtract this.bandwidth()/2\n     * This differs from the \"bandScale.convert\" method in d3\n     *\n     * @param {T} value The value to convert\n     * @param {number} [position=0.5] Number in the range of [0, 1] that will define the point inside of the band. Where 0 stands for start.\n     * @returns {number} Center of a band\n     */\n    public convert(value: T, position: number = BAND_CENTER): number {\n        return this._d3Scale(value) + position * this.bandwidth();\n    }\n\n    /**\n     * Converts the specified coordinate into the value of the closest band data point\n     *\n     * @param {number} coordinate The coordinate to convert\n     * @returns {T} The value of the closest band data point\n     */\n    public invert(coordinate: number): T {\n        const domain = this._d3Scale.domain();\n        if (this.range()[0] < this.range()[1]) {\n            const rangeMidPoints = this.getRangeMidPoints(\n                domain.map(this._d3Scale)\n            );\n            return domain[bisect(rangeMidPoints, coordinate)];\n        } else {\n            // bisector needs to have values sorted in natural order, so we reverse the domain first ...\n            const rangeMidPoints = this.getRangeMidPoints(\n                domain.map((d: any, i: number) =>\n                    this._d3Scale(\n                        domain[domain.length - 1 - i /* ... here ... */]\n                    )\n                )\n            );\n            return domain[\n                domain.length -\n                    1 -\n                    bisect(\n                        rangeMidPoints,\n                        coordinate\n                    ) /* ... and reverse it back here */\n            ];\n        }\n    }\n\n    /** See {@link IScale#range} */\n    public range(): [number, number];\n    public range(range: [number, number]): this;\n    public range(range?: [number, number]): any {\n        const result = range ? super.range(range) : super.range();\n\n        if (range && this.innerScale) {\n            // Updating child scale when outer range is changed\n            this.innerScale.range([0, this.bandwidth()]);\n        }\n\n        return result;\n    }\n\n    /**\n     * Gets the rounded setting for the scale\n     *\n     * @returns {boolean} The value indicating whether the scale is rounded\n     */\n    public round(): boolean;\n    /**\n     * Sets whether the scale should be rounded\n     * Rounding helps to have crisp edges https://github.com/d3/d3-scale#band_round\n     *\n     * @param {boolean} round The specified round setting\n     */\n    public round(round: boolean): this;\n    public round(round?: boolean): any {\n        if (round) {\n            this._d3Scale.round(round);\n            return this;\n        } else {\n            return this._d3Scale.round();\n        }\n    }\n\n    /**\n     * A convenience method for setting the inner and outer padding.\n     * This differs from D3 implementation. We're setting the outer padding to half of the inner padding.\n     *\n     * @param padding Value in [0, 1] interval.\n     */\n    public padding(padding: number): this {\n        this._d3Scale.paddingInner(padding);\n        this._d3Scale.paddingOuter(padding / 2);\n        return this;\n    }\n\n    /**\n     * Returns the current alignment which defaults to 0.5.\n     *\n     * @returns {number} The current alignment\n     */\n    public align(): number;\n\n    /**\n     * Sets the alignment to the specified value which must be in the range [0, 1].\n     *\n     * The default is 0.5.\n     *\n     * The alignment determines how any leftover unused space in the range is distributed.\n     * A value of 0.5 indicates that the leftover space should be equally distributed before the first band and\n     * after the last band, i.e. the bands should be centered within the range. A value of 0 or 1 may be used to\n     * shift the bands to one side, say to position them adjacent to an axis.\n     *\n     * @param {number} align Value for alignment setting in [0, 1] interval.\n     */\n    public align(align: number): this;\n    public align(align?: number): any {\n        if (align) {\n            this._d3Scale.align(align);\n            return this;\n        } else {\n            return this._d3Scale.align();\n        }\n    }\n\n    /**\n     * Returns the width of each band (bar).\n     */\n    public bandwidth(): number {\n        return this._d3Scale.bandwidth();\n    }\n\n    /**\n     * Returns the width of each step with paddings.\n     * Please note the fact that bandScale._d3Scale.step() returns step size without outer paddings!\n     */\n    public step(): number {\n        return this.domain().length\n            ? Math.abs(this.range()[1] - this.range()[0]) / this.domain().length\n            : 0;\n    }\n\n    /**\n     * Creates linear scale with domain and range that are equal to current scale's range\n     */\n    public copyToLinear(): LinearScale {\n        const scale = new LinearScale();\n        scale.domain(this.range()).range(this.range());\n        return scale;\n    }\n\n    /**\n     * Gets the locations for the band ticks\n     *\n     * @returns {number[]} The band tick locations\n     */\n    public bandTicks(): number[] {\n        const ticks = [];\n        const start = this.range()[0];\n        const step = this.step();\n        for (let i = 0; i <= this.domain().length; i++) {\n            ticks.push(start + i * step);\n        }\n        return ticks;\n    }\n\n    public isContinuous(): boolean {\n        return false;\n    }\n\n    private getRangeMidPoints(coords: number[]) {\n        return coords\n            .slice(1)\n            .map(\n                (d: number) =>\n                    d -\n                    (this._d3Scale.step() * this._d3Scale.paddingInner()) / 2\n            );\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport cloneDeep from \"lodash/cloneDeep\";\n\nimport { IAxisConfig } from \"../../../grid/types\";\nimport { IAccessors, IChartSeries } from \"../../types\";\nimport { domain } from \"../helpers/domain\";\nimport { DomainCalculator, IDomainWithTicksCalculator, IScale } from \"../types\";\n\nexport const getAutomaticDomainWithTicks = (\n    config: IAxisConfig,\n    axisGenerator: any,\n    domainCalculator: DomainCalculator\n): IDomainWithTicksCalculator => {\n    const result: IDomainWithTicksCalculator = (\n        chartSeriesSet: IChartSeries<IAccessors>[],\n        scaleKey: string,\n        scale: IScale<any>\n    ): any[] => {\n        const mergedDomains = domainCalculator(chartSeriesSet, scaleKey, scale);\n        const clonedScale = cloneDeep(scale);\n        domain(clonedScale, mergedDomains);\n        const tickAxis: any = axisGenerator(clonedScale.d3Scale);\n        const ticks = tickAxis.scale().ticks(config.approximateTicks);\n        if (ticks.length <= 1) {\n            return mergedDomains;\n        }\n        const ticksAverage = ticks[1] - ticks[0];\n        if (ticks[0] > mergedDomains[0]) {\n            mergedDomains[0] = ticks[0] - ticksAverage;\n        }\n        if (ticks[ticks.length - 1] < mergedDomains[1]) {\n            mergedDomains[1] = ticks[ticks.length - 1] + ticksAverage;\n        }\n        return mergedDomains;\n    };\n    result.domainWithTicks = true;\n    return result;\n};\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport find from \"lodash/find\";\nimport isArray from \"lodash/isArray\";\nimport isEmpty from \"lodash/isEmpty\";\nimport { Subject } from \"rxjs\";\nimport { takeUntil } from \"rxjs/operators\";\n\nimport {\n    CHART_VIEW_STATUS_EVENT,\n    INTERACTION_VALUES_EVENT,\n} from \"../../../constants\";\nimport { ChartPlugin } from \"../../common/chart-plugin\";\nimport { convert } from \"../../common/scales/helpers/convert\";\nimport { IScale } from \"../../common/scales/types\";\nimport {\n    D3Selection,\n    IChartEvent,\n    IChartViewStatusEventPayload,\n    InteractionType,\n} from \"../../common/types\";\nimport { UtilityService } from \"../../common/utility.service\";\nimport { XYGrid } from \"../../grid/xy-grid\";\nimport { IInteractionValuesPayload } from \"../types\";\n\n/** @ignore */\nconst FALLBACK_FORMATTER = \"tick\";\n\n/**\n * Highlights the label on x-axis that corresponds to interaction position\n *\n * @class InteractionLabelPlugin\n * @extends {ChartPlugin}\n */\nexport class InteractionLabelPlugin extends ChartPlugin {\n    public static LAYER_NAME = \"interaction-label\";\n\n    public areLabelUpdatesEnabled = true;\n\n    private isChartInView = false;\n    private lastInteractionValuesPayload: IInteractionValuesPayload;\n    private interactionLabelLayer: D3Selection<SVGElement>;\n    private readonly destroy$ = new Subject<void>();\n    private elBBox: DOMRect;\n\n    constructor(private formatterName = \"title\") {\n        super();\n    }\n\n    public initialize(): void {\n        this.interactionLabelLayer = this.chart\n            .getGrid()\n            .getLasagna()\n            .addLayer({\n                name: InteractionLabelPlugin.LAYER_NAME,\n                order: 901,\n                clipped: false,\n            });\n\n        this.chart\n            .getEventBus()\n            .getStream(INTERACTION_VALUES_EVENT)\n            .pipe(takeUntil(this.destroy$))\n            .subscribe((event: IChartEvent) => {\n                if (event.data.values?.y) {\n                    const chartGrid = this.chart.getGrid();\n\n                    const eventYAxisIds = Object.keys(event.data.values.y);\n                    const chartLeftYAxis = chartGrid.scales.y.list[0];\n                    // shows label only for a chart that is currently being hovered\n                    if (\n                        chartLeftYAxis.isTimeseriesScale &&\n                        !eventYAxisIds.includes(chartLeftYAxis.id)\n                    ) {\n                        return;\n                    }\n                }\n\n                this.lastInteractionValuesPayload = event.data;\n                if (this.isChartInView) {\n                    this.handleLabelUpdate();\n                }\n            });\n\n        this.chart\n            .getEventBus()\n            .getStream(CHART_VIEW_STATUS_EVENT)\n            .pipe(takeUntil(this.destroy$))\n            .subscribe((event: IChartEvent<IChartViewStatusEventPayload>) => {\n                this.isChartInView = event.data.isChartInView;\n                if (this.isChartInView && this.lastInteractionValuesPayload) {\n                    this.handleLabelUpdate();\n                }\n            });\n    }\n\n    protected handleLabelUpdate(): void {\n        const grid = this.chart.getGrid();\n        if (!(grid instanceof XYGrid)) {\n            throw new Error(`${InteractionLabelPlugin.name} requires XYGrid`);\n        }\n\n        const scales = grid.scales;\n        if (\n            !this.areLabelUpdatesEnabled ||\n            this.lastInteractionValuesPayload.interactionType !==\n                InteractionType.MouseMove ||\n            isEmpty(scales)\n        ) {\n            return;\n        }\n\n        const xScale = find(scales[\"x\"].index, { id: grid.bottomScaleId });\n\n        if (!xScale) {\n            throw new Error(\"xScale is not defined\");\n        }\n\n        const xValue = UtilityService.getInteractionValues(\n            this.lastInteractionValuesPayload.values.x,\n            xScale.id\n        );\n\n        this.updateLabel(\n            xScale,\n            isArray(xValue) ? xValue.slice(0, xValue.length - 1) : xValue\n        );\n    }\n\n    protected updateLabel(scale: IScale<any>, value: any): void {\n        let interactionLabel: D3Selection<SVGGElement> =\n            this.interactionLabelLayer.select(\n                `.${InteractionLabelPlugin.LAYER_NAME}`\n            );\n        if (interactionLabel.empty() && !!value) {\n            interactionLabel = this.buildInteractionLabel(\n                this.interactionLabelLayer\n            );\n        } else if (!value) {\n            interactionLabel.remove();\n            return;\n        }\n\n        const formatter =\n            scale.formatters[this.formatterName] ||\n            scale.formatters[FALLBACK_FORMATTER];\n        const labelContent = formatter?.(value);\n\n        if (!labelContent) {\n            throw new Error(\"labelContent is not defined\");\n        }\n\n        const textSelection = interactionLabel\n            .select(\"text\")\n            .text(labelContent);\n\n        if (!this.elBBox) {\n            this.elBBox = (textSelection.node() as SVGSVGElement).getBBox();\n        }\n        const gridDimension = this.chart.getGrid().config().dimension;\n\n        // subtract the relative vertical text offset inside the bbox from\n        // the grid height to determine the label's vertical placement\n        const heightOffset = gridDimension.height() - this.elBBox.y;\n\n        textSelection\n            .attr(\"transform\", `translate(0, ${heightOffset})`)\n            .style(\"text-anchor\", \"middle\");\n\n        // match the horizontal padding to the built-in bbox vertical padding\n        const horizontalPadding = (this.elBBox.height + this.elBBox.y) * 2;\n\n        const labelWidth = this.elBBox.width + horizontalPadding;\n        const allowedRange: [number, number] = [\n            labelWidth / 2,\n            gridDimension.width() - labelWidth / 2,\n        ];\n        const x = convert(scale, value, 0.5);\n        const clampedX = UtilityService.clampToRange(x, allowedRange);\n\n        interactionLabel\n            .attr(\"transform\", `translate(${clampedX},0)`)\n            .select(\"rect\")\n            .attrs({\n                transform: `translate(0,${heightOffset})`,\n                x: -(labelWidth / 2),\n                y: this.elBBox.y,\n                width: labelWidth,\n                height: this.elBBox.height,\n            });\n    }\n\n    public destroy(): void {\n        this.chart\n            .getGrid()\n            .getLasagna()\n            .removeLayer(InteractionLabelPlugin.LAYER_NAME);\n        this.destroy$.next();\n        this.destroy$.complete();\n    }\n\n    private buildInteractionLabel(\n        target: D3Selection\n    ): D3Selection<SVGGElement> {\n        const label = target\n            .append(\"g\")\n            .attr(\"class\", InteractionLabelPlugin.LAYER_NAME);\n\n        label\n            .append(\"rect\")\n            .attr(\"class\", `${InteractionLabelPlugin.LAYER_NAME}__rect`);\n\n        label\n            .append(\"text\")\n            .attr(\"class\", `${InteractionLabelPlugin.LAYER_NAME}__text`);\n\n        return label;\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport find from \"lodash/find\";\nimport isEmpty from \"lodash/isEmpty\";\nimport { Subject } from \"rxjs\";\nimport { takeUntil } from \"rxjs/operators\";\n\nimport {\n    CHART_VIEW_STATUS_EVENT,\n    INTERACTION_VALUES_EVENT,\n} from \"../../../constants\";\nimport { ChartPlugin } from \"../../common/chart-plugin\";\nimport { IScale } from \"../../common/scales/types\";\nimport {\n    D3Selection,\n    IChartEvent,\n    IChartViewStatusEventPayload,\n    InteractionType,\n} from \"../../common/types\";\nimport { UtilityService } from \"../../common/utility.service\";\nimport { XYGrid } from \"../../grid/xy-grid\";\nimport { IInteractionValuesPayload } from \"../types\";\n\n/**\n * Draws a vertical line on the x-axis that corresponds to interaction position\n *\n * @class InteractionLinePlugin\n * @extends {ChartPlugin}\n */\nexport class InteractionLinePlugin extends ChartPlugin {\n    public static LAYER_NAME = \"interaction-line\";\n\n    private isChartInView = false;\n    private lastInteractionValuesPayload: IInteractionValuesPayload;\n    private interactionLineLayer: D3Selection<SVGElement>;\n    private readonly destroy$ = new Subject<void>();\n\n    public initialize(): void {\n        this.interactionLineLayer = this.chart.getGrid().getLasagna().addLayer({\n            name: \"interaction-line\",\n            order: 900,\n            clipped: true,\n        });\n\n        this.chart\n            .getEventBus()\n            .getStream(INTERACTION_VALUES_EVENT)\n            .pipe(takeUntil(this.destroy$))\n            .subscribe((event: IChartEvent) => {\n                this.lastInteractionValuesPayload = event.data;\n                if (this.isChartInView) {\n                    this.handleLineUpdate();\n                }\n            });\n\n        this.chart\n            .getEventBus()\n            .getStream(CHART_VIEW_STATUS_EVENT)\n            .pipe(takeUntil(this.destroy$))\n            .subscribe((event: IChartEvent<IChartViewStatusEventPayload>) => {\n                this.isChartInView = event.data.isChartInView;\n                if (this.isChartInView && this.lastInteractionValuesPayload) {\n                    this.handleLineUpdate();\n                }\n            });\n    }\n\n    private handleLineUpdate() {\n        const grid = this.chart.getGrid();\n        if (!(grid instanceof XYGrid)) {\n            throw new Error(`${InteractionLinePlugin.name} requires XYGrid`);\n        }\n\n        const scales = grid.scales;\n        if (\n            this.lastInteractionValuesPayload.interactionType !==\n                InteractionType.MouseMove ||\n            isEmpty(scales)\n        ) {\n            return;\n        }\n\n        const xScale = find(scales[\"x\"].index, { id: grid.bottomScaleId });\n\n        if (!xScale) {\n            throw new Error(\"xScale is not defined\");\n        }\n\n        const xValue = UtilityService.getInteractionValues(\n            this.lastInteractionValuesPayload.values.x,\n            xScale.id\n        );\n\n        this.updateLine(this.interactionLineLayer, xScale, xValue);\n    }\n\n    private updateLine(layer: D3Selection, xScale: IScale<any>, value: any) {\n        const data = [];\n        if (value) {\n            data.push(value);\n        }\n        const line = layer\n            .selectAll(`.${InteractionLinePlugin.LAYER_NAME}`)\n            .data(data);\n\n        const xFn = (d: any) => xScale.convert(d);\n        const attrs = {\n            class: InteractionLinePlugin.LAYER_NAME,\n            x1: xFn,\n            y1: 0,\n            x2: xFn,\n            y2: this.chart.getGrid().config().dimension.height(),\n        };\n\n        line.enter()\n            .append(\"line\")\n            .merge(line as any)\n            .attrs(attrs);\n\n        line.exit().remove();\n    }\n\n    public destroy(): void {\n        this.chart\n            .getGrid()\n            .getLasagna()\n            .removeLayer(InteractionLinePlugin.LAYER_NAME);\n        this.destroy$.next();\n        this.destroy$.complete();\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport isEmpty from \"lodash/isEmpty\";\nimport { Subject } from \"rxjs\";\nimport { takeUntil } from \"rxjs/operators\";\n\nimport { IInteractionValues } from \"./types\";\nimport {\n    INTERACTION_COORDINATES_EVENT,\n    INTERACTION_VALUES_ACTIVE_EVENT,\n    INTERACTION_VALUES_EVENT,\n    MOUSE_ACTIVE_EVENT,\n} from \"../../constants\";\nimport { ChartPlugin } from \"../common/chart-plugin\";\nimport { MouseInteractiveArea } from \"../common/mouse-interactive-area\";\nimport { IInteractionEvent, InteractionType } from \"../common/types\";\nimport { UtilityService } from \"../common/utility.service\";\n\n/** @ignore */\nexport class MouseInteractiveAreaPlugin extends ChartPlugin {\n    private readonly destroy$ = new Subject<void>();\n    private interactionValuesActive = true;\n\n    constructor(private mouseInteractiveArea: MouseInteractiveArea) {\n        super();\n    }\n\n    public initialize(): void {\n        this.mouseInteractiveArea.active\n            .pipe(takeUntil(this.destroy$))\n            .subscribe((active: boolean) => {\n                this.chart\n                    .getEventBus()\n                    .getStream(MOUSE_ACTIVE_EVENT)\n                    .next({ data: active });\n            });\n\n        this.chart\n            .getEventBus()\n            .getStream(MOUSE_ACTIVE_EVENT)\n            .pipe(takeUntil(this.destroy$))\n            .subscribe((event) => {\n                const active: boolean = event.data;\n                if (!active && this.chart.getDataManager().chartSeriesSet) {\n                    this.highlightReset();\n                }\n            });\n\n        this.chart\n            .getEventBus()\n            .getStream(INTERACTION_VALUES_ACTIVE_EVENT)\n            .pipe(takeUntil(this.destroy$))\n            .subscribe((event) => (this.interactionValuesActive = event.data));\n\n        this.mouseInteractiveArea.interaction\n            .pipe(takeUntil(this.destroy$))\n            .subscribe((event: IInteractionEvent) => {\n                const gridScales = this.chart.getGrid().scales;\n                if (isEmpty(gridScales)) {\n                    return;\n                }\n\n                if (this.interactionValuesActive) {\n                    const xScales = gridScales.x.list;\n                    const yScales = gridScales.y.list;\n                    const xCoordinate = event.coordinates.x;\n                    const yCoordinate = event.coordinates.y;\n\n                    const values: IInteractionValues =\n                        UtilityService.getXYValues(\n                            xScales,\n                            yScales,\n                            xCoordinate,\n                            yCoordinate\n                        );\n                    this.chart\n                        .getEventBus()\n                        .getStream(INTERACTION_VALUES_EVENT)\n                        .next({\n                            data: { interactionType: event.type, values },\n                        });\n                }\n\n                this.chart\n                    .getEventBus()\n                    .getStream(INTERACTION_COORDINATES_EVENT)\n                    .next({\n                        data: {\n                            interactionType: event.type,\n                            coordinates: event.coordinates,\n                        },\n                    });\n            });\n    }\n\n    public update(): void {\n        this.highlightReset();\n    }\n\n    public updateDimensions(): void {\n        this.highlightReset();\n    }\n\n    public destroy(): void {\n        this.destroy$.next();\n        this.destroy$.complete();\n    }\n\n    private highlightReset() {\n        this.chart\n            .getEventBus()\n            .getStream(INTERACTION_VALUES_EVENT)\n            .next({\n                data: {\n                    interactionType: InteractionType.MouseMove,\n                    values: {},\n                },\n            });\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport orderBy from \"lodash/orderBy\";\n\nimport { D3Selection, ILasagnaLayer } from \"./types\";\n\n/** @ignore */\nexport class Lasagna {\n    public static CONTAINER_CLASS = \"lasagna-container\";\n    public static LAYER_CLASS = \"lasagna-layer\";\n\n    public layers: ILasagnaLayer[] = [];\n    private readonly container: D3Selection<SVGGElement>;\n\n    constructor(\n        target: D3Selection<SVGSVGElement>,\n        private readonly clipPath: string\n    ) {\n        this.container = target\n            .append(\"g\")\n            .attr(\"class\", `${Lasagna.CONTAINER_CLASS} pointer-events`);\n    }\n\n    public addLayer(layer: ILasagnaLayer): D3Selection {\n        this.layers = orderBy(this.layers.concat(layer), \"order\");\n\n        this.update();\n\n        return this.getLayerContainer(layer.name);\n    }\n\n    public removeLayer(layerName: string): void {\n        const index = this.layers.findIndex(\n            (layer) => layer.name === layerName\n        );\n        if (index === -1) {\n            return;\n        }\n\n        this.layers.splice(index, 1);\n        this.update();\n    }\n\n    public getLayerContainer(name: string): D3Selection {\n        return this.container.select(`.${Lasagna.LAYER_CLASS}-${name}`);\n    }\n\n    public getContainer(): D3Selection<SVGGElement> {\n        return this.container;\n    }\n\n    private update() {\n        const layerContainers = this.container\n            .selectAll<SVGElement, ILasagnaLayer>(`g.${Lasagna.LAYER_CLASS}`)\n            .data(this.layers, (d: ILasagnaLayer) => d.name)\n            .order();\n\n        layerContainers\n            .enter()\n            .append(\"g\")\n            .attrs({\n                class: (d: ILasagnaLayer) =>\n                    `${Lasagna.LAYER_CLASS} ${Lasagna.LAYER_CLASS}-${d.name}`,\n                \"clip-path\": (d: ILasagnaLayer) =>\n                    d.clipped ? `url(#${this.clipPath})` : \"\",\n                \"pointer-events\": \"none\",\n            });\n\n        layerContainers.exit().remove();\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { select, Selection } from \"d3-selection\";\nimport each from \"lodash/each\";\nimport isEmpty from \"lodash/isEmpty\";\nimport { Subject } from \"rxjs\";\n\nimport { EventBus } from \"../common/event-bus\";\nimport { Lasagna } from \"../common/lasagna\";\nimport { ScalesIndex } from \"../common/scales/types\";\nimport { IChart, IChartEvent, IChartPlugin } from \"../common/types\";\nimport { D3Selection } from \"../common/types\";\nimport { UtilityService } from \"../common/utility.service\";\nimport { GridConfig } from \"./config/grid-config\";\nimport {\n    IAllAround,\n    IBorderConfig,\n    IBorders,\n    IDimensions,\n    IGrid,\n    IGridConfig,\n} from \"./types\";\n\nexport const borderMidpoint = 0.5;\n\ntype BorderKey = keyof IAllAround<IBorderConfig>;\n\n/**\n * @implements {IGrid}\n * Implementation for the dimensions, scaling, interactive area, and borders of a basic grid\n */\nexport abstract class Grid implements IGrid {\n    /** Class name for the grid */\n    public static GRID_CLASS_NAME = \"nui-chart-grid\";\n\n    /** Class name applied to each of the grid's borders by default */\n    public static DEFAULT_BORDER_CLASS_NAME = \"nui-chart-border\";\n\n    /** Prefix applied to the rendering area clip path id */\n    public static RENDERING_AREA_CLIP_PATH_PREFIX = \"clip-path_\";\n\n    /** Name for the lasagna layer containing the grid's rendered elements */\n    public static GRID_ELEMENTS_LAYER_NAME = \"grid-elements\";\n\n    /** Name for the rendering area lasagna layer */\n    public static RENDERING_AREA_LAYER_NAME = \"rendering-area\";\n\n    /** @ignore Height correction needed to prevent interaction gap between vertically stacked charts */\n    public static RENDER_AREA_HEIGHT_CORRECTION = 1;\n\n    /** @ignore Width correction needed to prevent interaction gap between right side of grid and the edge of the rendering area */\n    public static RENDER_AREA_WIDTH_CORRECTION = 1;\n\n    /** @ignore Width correction needed to sync bottom border length and grid width to tick placement */\n    public static TICK_DIMENSION_CORRECTION = 1;\n\n    /** Subject for indicating that the chart's dimensions should be updated */\n    public updateChartDimensionsSubject: Subject<void>;\n\n    /** Event bus provided by the chart */\n    public eventBus: EventBus<IChartEvent>;\n\n    /** d3 container for the grid */\n    protected container: D3Selection<SVGGElement>;\n\n    /** d3 selection for the grid's rendering area clip path */\n    protected renderingAreaClipPath: D3Selection<SVGRectElement>;\n\n    /** d3 selection for the grid's rendering area */\n    protected renderingArea: D3Selection<SVGRectElement>;\n\n    /** d3 selection for the grid's interactive area */\n    protected interactiveArea: D3Selection<SVGRectElement>;\n\n    /** The grid's layer manager */\n    protected lasagna: Lasagna;\n\n    /** Lasagna layer for the grid's rendered elements */\n    protected gridElementsLayer: Selection<SVGElement, any, SVGElement, any>;\n\n    /** Definition of the grid's borders as rendered */\n    protected borders: Partial<IBorders> = {};\n\n    /** Property value of the grid's scales */\n    protected _scales: ScalesIndex;\n\n    /** Property value of the grid's configuration */\n    protected _config: IGridConfig;\n\n    /** Property value of the grid's target d3 selection */\n    protected _target: D3Selection<SVGSVGElement>;\n\n    /** See {@link IGrid#getInteractiveArea} */\n    public getInteractiveArea(): D3Selection<SVGRectElement> {\n        return this.interactiveArea;\n    }\n\n    /** See {@link IGrid#getLasagna} */\n    public getLasagna(): Lasagna {\n        return this.lasagna;\n    }\n\n    /** @ignore */\n    public set scales(scales: ScalesIndex) {\n        this._scales = scales;\n    }\n\n    /** @ignore */\n    public get scales(): ScalesIndex {\n        return this._scales;\n    }\n\n    /** See {@link IGrid#config} */\n    public config(): IGridConfig;\n    /** See {@link IGrid#config} */\n    public config(config: IGridConfig): this;\n    /** See {@link IGrid#config} */\n    public config(config?: IGridConfig): IGridConfig | this {\n        if (config === undefined) {\n            return this._config;\n        }\n        this._config = config;\n        return this;\n    }\n\n    /** See {@link IGrid#target} */\n    public target(): D3Selection<SVGSVGElement>;\n    /** See {@link IGrid#target} */\n    public target(target: D3Selection<SVGSVGElement>): IGrid;\n    /** See {@link IGrid#target} */\n    public target(\n        target?: D3Selection<SVGSVGElement>\n    ): D3Selection<SVGSVGElement> | IGrid {\n        if (target === undefined) {\n            return this._target;\n        }\n        this._target = target;\n        return this;\n    }\n\n    /** See {@link IGrid#build} */\n    public build(): IGrid {\n        if (!this.config()) {\n            const config = new GridConfig();\n            this.config(config);\n        }\n\n        this.container = this._target.append(\"g\").attrs({\n            class: Grid.GRID_CLASS_NAME,\n        });\n\n        const clipPathId =\n            Grid.RENDERING_AREA_CLIP_PATH_PREFIX + UtilityService.uuid();\n        // Asserting similar type to avoid refactoring all the grids\n        // TODO: Refactor lasagna service to accept multiple D3Selection types\n        //  or refactor grid implementations/interfaces to maintain the same selection type\n        this.lasagna = new Lasagna(\n            <D3Selection<SVGSVGElement>>(<unknown>this.container),\n            clipPathId\n        );\n        this.renderingArea = this.buildRenderingArea(clipPathId);\n        this.adjustRenderingArea();\n\n        this.gridElementsLayer = this.lasagna.addLayer({\n            name: Grid.GRID_ELEMENTS_LAYER_NAME,\n            order: 100,\n            clipped: false,\n        });\n\n        const borders = this.buildBorders(this.gridElementsLayer);\n        if (borders) {\n            this.borders = borders;\n        }\n\n        return this;\n    }\n\n    /**\n     * Derived classes override this method to build the grid's plugins\n     *\n     * @param {IChart} chart The chart instance to pass to each plugin\n     *\n     * @returns {IChartPlugin[]} Default implementation returns an empty array\n     */\n    public buildPlugins(chart: IChart): IChartPlugin[] {\n        return [];\n    }\n\n    /** See {@link IGrid#update} */\n    public update(): IGrid {\n        if (isEmpty(this.scales)) {\n            return this;\n        }\n\n        this.updateBorders();\n        this.adjustRenderingArea();\n        return this;\n    }\n\n    /** See {@link IGrid#updateDimensions} */\n    public updateDimensions(dimensions: Partial<IDimensions>): IGrid {\n        const dimensionConfig = this.config().dimension;\n\n        if (dimensions.width) {\n            dimensionConfig.outerWidth(\n                dimensions.width - this.getOuterWidthDimensionCorrection()\n            );\n        }\n        if (dimensions.height) {\n            dimensionConfig.outerHeight(dimensions.height);\n        }\n\n        this.adjustRenderingArea();\n        this.updateRanges();\n\n        return this;\n    }\n    /** See {@link IGrid#updateRanges} */\n    public updateRanges(): IGrid {\n        this.update();\n        return this;\n    }\n\n    /**\n     * Calculate the width correction needed for accommodating grid elements that may extend beyond the chart's configured width\n     */\n    protected getOuterWidthDimensionCorrection(): number {\n        return Grid.TICK_DIMENSION_CORRECTION;\n    }\n\n    /**\n     * Builds the grid borders as SVGElements based on the specified configuration\n     *\n     * @param {D3Selection} container d3 container for the borders\n     *\n     * @returns {Partial<IBorders>} The grid's borders\n     */\n    protected buildBorders(\n        container: D3Selection\n    ): Partial<IBorders> | undefined {\n        if (!this.config() || !this.config().borders) {\n            return;\n        }\n\n        const borderConfigs = this.config().borders;\n        const borders: Partial<IBorders> = {};\n        const borderKeys = <BorderKey[]>Object.keys(borderConfigs);\n        each(borderKeys, (side: BorderKey) => {\n            // We're creating even invisible borders and updating visibility afterwards\n            if (borderConfigs[side]) {\n                borders[side] =\n                    this.createBorder(container, borderConfigs[side]) ??\n                    undefined;\n            }\n        });\n\n        return borders;\n    }\n\n    /**\n     * Adjusts the grid's rendering area and clip path based on the grid's configured width and height\n     */\n    protected adjustRenderingArea = (): void => {\n        const d = this.config().dimension;\n        const disableHeightCorrection =\n            this.config().disableRenderAreaHeightCorrection;\n        const disableWidthCorrection =\n            this.config().disableRenderAreaWidthCorrection;\n\n        const renderingAreaClipPathAttrs = {\n            width: Math.max(0, d.width()),\n            height: Math.max(\n                0,\n                d.height() +\n                    (disableHeightCorrection\n                        ? 0\n                        : Grid.RENDER_AREA_HEIGHT_CORRECTION)\n            ),\n        } as any;\n\n        if (!disableHeightCorrection) {\n            renderingAreaClipPathAttrs[\"y\"] =\n                -Grid.RENDER_AREA_HEIGHT_CORRECTION;\n        }\n\n        const renderingAreaAttrs = {\n            ...renderingAreaClipPathAttrs,\n            // Width correction needed to prevent interaction gap between right side of grid and the edge of the rendering area\n            width: Math.max(\n                0,\n                d.width() -\n                    (disableWidthCorrection\n                        ? 0\n                        : Grid.RENDER_AREA_WIDTH_CORRECTION)\n            ),\n        };\n\n        this.renderingAreaClipPath.attrs(renderingAreaClipPathAttrs);\n        this.renderingArea.attrs(renderingAreaAttrs);\n    };\n\n    /**\n     * Builds the grid's rendering area as a layer on the lasagna\n     *\n     * @param {string} clipPathId The clip path identifier\n     *\n     * @returns {D3Selection} The grid's rendering area\n     */\n    private buildRenderingArea(\n        clipPathId: string\n    ): D3Selection<SVGRectElement> {\n        this.renderingAreaClipPath = this._target\n            .append(\"clipPath\")\n            .attr(\"id\", clipPathId)\n            .append(\"rect\");\n\n        const renderingAreaContainer = this.lasagna.addLayer({\n            name: Grid.RENDERING_AREA_LAYER_NAME,\n            order: -1,\n            clipped: true,\n        });\n        return renderingAreaContainer.append(\"rect\").attrs({\n            \"pointer-events\": \"all\",\n            fill: \"transparent\",\n        });\n    }\n\n    /**\n     * Creates a border with the specified configuration in the provided container\n     *\n     * @param {D3Selection} container The container to append the border to\n     * @param {IBorderConfig} config The configuration to apply to the border\n     *\n     * @returns {SVGElement} The created border\n     */\n    private createBorder(\n        container: D3Selection,\n        config: IBorderConfig\n    ): SVGElement | null {\n        const border = container\n            .append(\"line\")\n            .attr(\"class\", config.className || Grid.DEFAULT_BORDER_CLASS_NAME);\n\n        if (config.width) {\n            // use style instead of attr to override css style\n            border.style(\"stroke-width\", config.width);\n        }\n        if (config.color) {\n            // use style instead of attr to override css style\n            border.style(\"stroke\", config.color);\n        }\n\n        return border.node();\n    }\n\n    // TODO: borders are evil. reconsider!\n    // We're using borders instead of axis line and because of that we need to do these weird size adjustments\n    protected updateBottomBorder(): void {\n        if (!this.borders.bottom) {\n            throw new Error(\"BottomBorder is not defined\");\n        }\n        select(this.borders.bottom)\n            .attrs({\n                x1: 0,\n                y1: this.config().dimension.height() - borderMidpoint,\n                x2:\n                    this.config().dimension.width() +\n                    Grid.TICK_DIMENSION_CORRECTION, // to get nice alignment with ticks\n                y2: this.config().dimension.height() - borderMidpoint,\n                class:\n                    this._config.borders.bottom.className ||\n                    Grid.DEFAULT_BORDER_CLASS_NAME,\n            })\n            .classed(\"hidden\", !this._config.borders.bottom?.visible);\n    }\n\n    /**\n     * Updates the d3 line positioning and visibility attributes of each of the configured borders\n     */\n    protected updateBorders(): void {\n        if (this.borders.bottom) {\n            this.updateBottomBorder();\n        }\n        if (this.borders.top) {\n            select(this.borders.top)\n                .attrs({\n                    x1: 0,\n                    y1: borderMidpoint, // the line was outside of the viewport in some browser when set to 0\n                    x2:\n                        this.config().dimension.width() +\n                        Grid.TICK_DIMENSION_CORRECTION, // to get nice alignment with ticks\n                    y2: borderMidpoint,\n                })\n                .classed(\"hidden\", !this._config.borders.top?.visible);\n        }\n        if (this.borders.right) {\n            select(this.borders.right)\n                .attrs({\n                    x1: this.config().dimension.width() - borderMidpoint,\n                    y1: 0,\n                    x2: this.config().dimension.width() - borderMidpoint,\n                    y2:\n                        this.config().dimension.height() +\n                        Grid.TICK_DIMENSION_CORRECTION, // to get nice alignment with ticks\n                })\n                .classed(\"hidden\", !this._config.borders.right?.visible);\n        }\n        if (this.borders.left) {\n            select(this.borders.left)\n                .attrs({\n                    x1: borderMidpoint,\n                    y1: 0,\n                    x2: borderMidpoint,\n                    y2:\n                        this.config().dimension.height() +\n                        Grid.TICK_DIMENSION_CORRECTION, // to get nice alignment with ticks\n                })\n                .classed(\"hidden\", !this._config.borders.left?.visible);\n        }\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { axisBottom, axisLeft, axisRight, axisTop } from \"d3\";\nimport { select } from \"d3-selection\";\nimport clone from \"lodash/clone\";\nimport each from \"lodash/each\";\nimport isEmpty from \"lodash/isEmpty\";\nimport isNil from \"lodash/isNil\";\nimport isUndefined from \"lodash/isUndefined\";\nimport uniq from \"lodash/uniq\";\nimport { takeUntil } from \"rxjs/operators\";\n\nimport {\n    AXES_STYLE_CHANGE_EVENT,\n    DESTROY_EVENT,\n    IGNORE_INTERACTION_CLASS,\n    SERIES_STATE_CHANGE_EVENT,\n} from \"../../constants\";\nimport { RenderState } from \"../../renderers/types\";\nimport { MouseInteractiveArea } from \"../common/mouse-interactive-area\";\nimport { BandScale } from \"../common/scales/band-scale\";\nimport { getAutomaticDomainWithTicks } from \"../common/scales/domain-calculation/domain-with-ticks\";\nimport { LinearScale } from \"../common/scales/linear-scale\";\nimport {\n    IBandScale,\n    IScale,\n    isDomainWithTicksCalculator,\n    ScalesIndex,\n} from \"../common/scales/types\";\nimport {\n    D3Selection,\n    IAxesStyleChangeEventPayload,\n    IChart,\n    IChartEvent,\n    IChartPlugin,\n    IRenderStateData,\n} from \"../common/types\";\nimport { InteractionLabelPlugin } from \"../plugins/interaction/interaction-label-plugin\";\nimport { InteractionLinePlugin } from \"../plugins/interaction/interaction-line-plugin\";\nimport { MouseInteractiveAreaPlugin } from \"../plugins/mouse-interactive-area-plugin\";\nimport { XYGridConfig } from \"./config/xy-grid-config\";\nimport { Grid } from \"./grid\";\nimport {\n    IAllAround,\n    IAxis,\n    IAxisConfig,\n    IDimensionConfig,\n    IGrid,\n    IXYGridConfig,\n    TextOverflowHandler,\n} from \"./types\";\n\n/**\n * Locally used interface for passing scales and associated SVG elements\n *\n * @internal\n */\ninterface IScaleSVGElement {\n    scaleId: string;\n    element: D3Selection<any>;\n}\n\nexport class XYGrid extends Grid implements IGrid {\n    public static TICK_LABEL_OVERFLOW_DEBOUNCE_INTERVAL = 200;\n\n    protected axisX: IAxis = <any>{};\n    protected axisYLeft: IAxis = <any>{};\n    protected axisYRight: IAxis = <any>{};\n    protected gridY: IAxis = <any>{};\n    protected gridX: IAxis = <any>{};\n\n    private _bottomScaleId?: string;\n    private _leftScaleId?: string;\n    private _rightScaleId: string;\n    private reconcileMarginsDebounce: any;\n    // map of scale id to pending debounce timeout\n    private handleTickLabelOverflowDebounceIndex: Record<string, any> = {};\n\n    /**\n     * Returns the id of the bottom axis scale\n     */\n    public get bottomScaleId(): string | undefined {\n        if (this._bottomScaleId) {\n            return this._bottomScaleId;\n        }\n        if (!isEmpty(this.scales)) {\n            return this.scales[\"x\"].list[0].id;\n        }\n    }\n\n    /**\n     * Sets the id of the bottom axis scale\n     */\n    public set bottomScaleId(id: string | undefined) {\n        this._bottomScaleId = id;\n    }\n\n    /**\n     * Returns the id of the left axis scale\n     */\n    public get leftScaleId(): string | undefined {\n        if (this._leftScaleId) {\n            return this._leftScaleId;\n        }\n        if (!isEmpty(this.scales)) {\n            return this.scales[\"y\"].list[0].id;\n        }\n    }\n\n    /**\n     * Sets the id of the left axis scale\n     */\n    public set leftScaleId(id: string | undefined) {\n        this._leftScaleId = id;\n    }\n\n    /**\n     * Returns the id of the right axis scale\n     */\n    public get rightScaleId(): string {\n        return this._rightScaleId;\n    }\n\n    /**\n     * Sets the id of the right axis scale\n     */\n    public set rightScaleId(id: string) {\n        this._rightScaleId = id;\n    }\n\n    /** @ignore */\n    public set scales(scales: ScalesIndex) {\n        this._scales = scales;\n\n        if (this._scales) {\n            Object.keys(this._scales).forEach((scaleKey) => {\n                // Defaulting to left\n                let config: IAxisConfig = this.config().axis.left;\n                let axisGenerator: any;\n                if (scaleKey !== \"x\" && scaleKey !== \"y\") {\n                    return;\n                }\n                this._scales[scaleKey]?.list\n                    ?.filter((scale) => scale instanceof LinearScale)\n                    .forEach((scale) => {\n                        if (scale?.id === this.leftScaleId) {\n                            config = this.config().axis.left;\n                            axisGenerator = axisLeft;\n                        } else if (scale?.id === this.rightScaleId) {\n                            config = this.config().axis.right;\n                            axisGenerator = axisRight;\n                        } else if (scale?.id === this.bottomScaleId) {\n                            config = this.config().axis.bottom;\n                            axisGenerator = axisBottom;\n                        }\n                        if (\n                            scale.domainCalculator &&\n                            !isDomainWithTicksCalculator(\n                                scale.domainCalculator\n                            ) &&\n                            config.gridTicks\n                        ) {\n                            scale.__domainCalculatedWithTicks = true;\n                            scale.domainCalculator =\n                                getAutomaticDomainWithTicks(\n                                    config,\n                                    axisGenerator,\n                                    scale.domainCalculator\n                                );\n                        }\n                    });\n            });\n        }\n    }\n\n    /** @ignore */\n    public get scales(): ScalesIndex {\n        return this._scales;\n    }\n\n    /** See {@link IGrid#config} */\n    public config(): IXYGridConfig;\n    /** See {@link IGrid#config} */\n    public config(config: IXYGridConfig): this;\n    /** See {@link IGrid#config} */\n    public config(config?: IXYGridConfig): any {\n        if (config === undefined) {\n            return this._config;\n        }\n        this._config = config;\n        return this;\n    }\n\n    constructor(config?: IXYGridConfig) {\n        super();\n        this.config(config || new XYGridConfig());\n    }\n\n    /** See {@link IGrid#build} */\n    public build(): IGrid {\n        super.build();\n        if (this.config().interactive) {\n            this.interactiveArea = this.renderingArea;\n        }\n\n        this.buildAxes(this.gridElementsLayer);\n        this.recalculateMargins(this.container);\n\n        const untilDestroy = <T>() =>\n            takeUntil<T>(this.eventBus.getStream(DESTROY_EVENT));\n        this.eventBus\n            .getStream(SERIES_STATE_CHANGE_EVENT)\n            .pipe(untilDestroy())\n            .subscribe((e: IChartEvent) => {\n                const axesStyles = this.handleSeriesStateChange(e);\n\n                this.eventBus.getStream(AXES_STYLE_CHANGE_EVENT).next({\n                    data: axesStyles,\n                } as IChartEvent<IAxesStyleChangeEventPayload>);\n            });\n\n        return this;\n    }\n\n    /**\n     * Handle axis opacity when emphasizing/deemphasizing chart series\n     *\n     * @param e\n     * @private\n     */\n    public handleSeriesStateChange(\n        e: IChartEvent\n    ): Record<string, Record<string, any>> | undefined {\n        if (!this.rightScaleId) {\n            return;\n        }\n\n        const axes: IScaleSVGElement[] = [\n            {\n                scaleId: this.leftScaleId as string,\n                element: this.axisYLeft.group,\n            },\n            { scaleId: this.rightScaleId, element: this.axisYRight?.group },\n        ];\n\n        const axesStyles = this.calculateAxesStyles(e, axes);\n\n        for (const a of axes) {\n            if (a.scaleId) {\n                a.element.attrs(axesStyles[a.scaleId]);\n            }\n        }\n\n        return axesStyles;\n    }\n\n    /**\n     * Return opacity for each axis\n     *\n     * @param e\n     * @param axes\n     * @private\n     */\n    private calculateAxesStyles(\n        e: IChartEvent,\n        axes: IScaleSVGElement[]\n    ): Record<string, Record<string, any>> {\n        const renderStates = e.data as IRenderStateData[];\n\n        const emphasizedSeries = renderStates\n            .filter((rs) => rs.state === RenderState.emphasized && rs.series)\n            .map((rs) => rs.series);\n\n        if (emphasizedSeries.length > 0) {\n            const emphasizedYScales = uniq(\n                emphasizedSeries\n                    .map((s) => s?.scales[\"y\"] as IScale<any>)\n                    .filter((s) => !!s)\n            );\n            if (emphasizedYScales.length <= 0) {\n                return {};\n            }\n\n            for (const emphasizedYScale of emphasizedYScales) {\n                if (\n                    emphasizedYScale.id === this.leftScaleId ||\n                    emphasizedYScale.id === this.rightScaleId\n                ) {\n                    return axes.reduce((acc, next) => {\n                        acc[next.scaleId] = {\n                            opacity:\n                                emphasizedYScale.id === next.scaleId ? 1 : 0.1,\n                        };\n                        return acc;\n                    }, {} as Record<string, Record<string, any>>);\n                }\n            }\n            return {};\n        } else {\n            return axes.reduce((acc, next) => {\n                acc[next.scaleId] = { opacity: 1 };\n                return acc;\n            }, {} as Record<string, Record<string, any>>);\n        }\n    }\n\n    /** See {@link IGrid#buildPlugins} */\n    public buildPlugins(chart: IChart): IChartPlugin[] {\n        const plugins: IChartPlugin[] = [];\n\n        const config = this.config();\n        if (config.interactive) {\n            plugins.push(\n                new MouseInteractiveAreaPlugin(\n                    new MouseInteractiveArea(\n                        this.getLasagna().getContainer(),\n                        this.getInteractiveArea(),\n                        config.cursor,\n                        config.dimension.margin\n                    )\n                )\n            );\n        }\n\n        if (config.interactionPlugins) {\n            plugins.push(new InteractionLinePlugin());\n            plugins.push(new InteractionLabelPlugin());\n        }\n\n        return plugins;\n    }\n\n    /** See {@link IGrid#update} */\n    public update(): IGrid {\n        super.update();\n\n        this.updateAxes();\n        this.handleMarginUpdate();\n\n        return this;\n    }\n\n    /** @ignore */\n    public drawTicks(\n        config: IAxisConfig,\n        axis: IAxis,\n        scale: IScale<any>,\n        axisGenerator: any\n    ): void {\n        if (config.visible) {\n            const labelAxis = axisGenerator(scale.d3Scale)\n                .ticks(config.approximateTicks)\n                .tickSize(0);\n\n            if (scale.fixDomainValues?.length) {\n                labelAxis.tickValues(scale.fixDomainValues);\n            }\n            labelAxis.tickFormat(scale.formatters[\"tick\"]);\n            axis.labelGroup.call(labelAxis);\n\n            let tickAxis;\n            if (scale instanceof BandScale) {\n                tickAxis = axisGenerator(scale.copyToLinear().d3Scale)\n                    .tickSize(config.tickSize)\n                    .tickValues(scale.bandTicks())\n                    .tickFormat(() => \"\");\n            } else {\n                tickAxis = axisGenerator(scale.d3Scale).tickSize(\n                    config.tickSize\n                );\n\n                if (scale.fixDomainValues?.length) {\n                    tickAxis.tickValues(scale.fixDomainValues);\n                }\n\n                tickAxis.tickFormat(() => \"\");\n                tickAxis.ticks(config.approximateTicks);\n            }\n            axis.tickGroup.call(tickAxis);\n\n            this.adjustAxisTicks(axis.labelGroup, scale);\n        } else {\n            axis.labelGroup.selectAll(\"*\").remove();\n            axis.tickGroup.selectAll(\"*\").remove();\n        }\n    }\n\n    /** @ignore */\n    public drawGrids(\n        config: IAxisConfig,\n        axis: IAxis,\n        axisGenerator: any,\n        scale: IScale<any>,\n        size: number\n    ): void {\n        const modifyZeroLines = (gridGroupSelection: any) =>\n            gridGroupSelection\n                .selectAll(\".tick line\")\n                .classed(\"nui-zero-line\", (d: any) => d === 0);\n\n        const leftGridLines = axisGenerator(scale.d3Scale).tickSize(size);\n\n        if (scale.fixDomainValues?.length) {\n            leftGridLines.tickValues(scale.fixDomainValues);\n        }\n\n        leftGridLines.tickFormat(() => \"\").ticks(config.approximateTicks);\n\n        if (config.gridTicks) {\n            const gridSelection = axis.tickGroup.call(leftGridLines);\n            modifyZeroLines(gridSelection);\n        } else {\n            axis.tickGroup.selectAll(\"*\").remove();\n        }\n    }\n\n    /** See {@link IGrid#updateRanges} */\n    public updateRanges(): IGrid {\n        if (isEmpty(this.scales)) {\n            return this;\n        }\n\n        const dimension = this.config().dimension;\n        const padding = dimension.padding;\n\n        if (this.scales.x) {\n            each(this.scales.x.list, (xScale) => {\n                xScale.range([padding.left, dimension.width() - padding.right]);\n            });\n        }\n        if (this.scales.y) {\n            each(this.scales.y.list, (yScale) => {\n                yScale.range([\n                    dimension.height() - padding.bottom,\n                    padding.top,\n                ]);\n            });\n        }\n\n        super.updateRanges();\n        return this;\n    }\n\n    protected updateXAxis(): void {\n        const xScale = this.bottomScaleId\n            ? this.scales[\"x\"].index[this.bottomScaleId]\n            : undefined;\n        const axis = this.config().axis;\n\n        if (!xScale) {\n            throw new Error(\"xScale is not defined\");\n        }\n\n        this.axisX.group.attr(\n            \"transform\",\n            `translate(0, ${this.config().dimension.height()})`\n        );\n        // Additional transform to not overlap with ticks\n        this.axisX.labelGroup.attr(\n            \"transform\",\n            `translate(0, ${axis.bottom.tickSize})`\n        );\n\n        this.drawTicks(axis.bottom, this.axisX, xScale, axisBottom);\n        this.drawGrids(\n            axis.bottom,\n            this.gridX,\n            axisTop,\n            xScale,\n            this.config().dimension.height()\n        );\n\n        this.gridX.tickGroup.attr(\n            \"transform\",\n            `translate(0, ${this.config().dimension.height()})`\n        );\n    }\n\n    protected updateYAxes(): void {\n        const axis = this.config().axis;\n        const yLeftScale = this.leftScaleId\n            ? this.scales[\"y\"].index[this.leftScaleId]\n            : undefined;\n\n        if (!yLeftScale) {\n            throw new Error(\"yLeftScale is not defined\");\n        }\n\n        this.axisYLeft.labelGroup.attr(\n            \"transform\",\n            `translate(${-axis.left.tickSize - axis.left.padding}, 0)`\n        );\n\n        this.drawTicks(axis.left, this.axisYLeft, yLeftScale, axisLeft);\n        this.drawGrids(\n            axis.left,\n            this.gridY,\n            axisRight,\n            yLeftScale,\n            this.config().dimension.width()\n        );\n\n        if (this.rightScaleId) {\n            const yRightScale = this.scales[\"y\"].index[this.rightScaleId];\n            const rightScaleLabelX =\n                axis.right.padding +\n                this.config().dimension.width() +\n                axis.right.tickSize;\n            this.axisYRight.labelGroup.attr(\n                \"transform\",\n                `translate(${rightScaleLabelX}, 0)`\n            );\n            this.axisYRight.tickGroup.attr(\n                \"transform\",\n                `translate(${this.config().dimension.width()}, 0)`\n            );\n            this.drawTicks(axis.right, this.axisYRight, yRightScale, axisRight);\n        }\n    }\n\n    protected updateAxes(): void {\n        if (!this.target()) {\n            return;\n        }\n\n        this.updateXAxis();\n        this.updateYAxes();\n    }\n\n    protected adjustAxisTicks(\n        labelGroup: D3Selection<SVGGElement>,\n        scale: IScale<any>\n    ): void {\n        const textOfTicks: HTMLElement[] = [];\n\n        labelGroup.attr(\"cursor\", \"default\");\n\n        labelGroup.selectAll(\"g\").each(function () {\n            select(this)\n                .classed(\"sw-hidden\", false)\n                .classed(\"tick-hidden-text\", false);\n            textOfTicks.push(<HTMLElement>this);\n        });\n\n        const toRemove = this.filterRepeatedElements(textOfTicks);\n        toRemove.forEach((group: HTMLElement) => {\n            select(group).classed(\"tick-hidden-text\", true);\n        });\n\n        const allAxisLabels = this.selectAllAxisLabels(labelGroup);\n        allAxisLabels.forEach((group: HTMLElement) => {\n            const groupSelection = select(group);\n            // zero-out the d3-provided x position of all labels since we're manually translating the x position of the entire group;\n            // add IGNORE_INTERACTION_CLASS so that mouse events used for displaying the title don't propagate from the mouse-interactive-area\n            groupSelection\n                .select(\"text\")\n                .attr(\"x\", 0)\n                .classed(IGNORE_INTERACTION_CLASS, true);\n            groupSelection.classed(\"pointer-events\", true);\n            if (groupSelection.select(\"title\").empty()) {\n                const datum = groupSelection.data()[0];\n                const titleText = (\n                    scale.formatters[\"tick\"]\n                        ? scale.formatters[\"tick\"](datum)\n                        : datum\n                ) as string;\n                groupSelection.append(\"title\").text(titleText);\n            }\n        });\n\n        this.handleTickLabelOverflow(labelGroup, scale, allAxisLabels);\n    }\n\n    protected handleTickLabelOverflow(\n        labelGroup: D3Selection<SVGGElement>,\n        scale: IScale<any>,\n        axisLabels: HTMLElement[]\n    ): void {\n        const axisConfig = this.config().axis;\n        if (\n            scale.id === this.bottomScaleId &&\n            (scale.isContinuous() ||\n                !axisConfig.bottom.tickLabel.overflowHandler)\n        ) {\n            const textToHide = this.getElementsToHide(\n                axisLabels,\n                this._config.dimension.width(),\n                true\n            );\n            textToHide.forEach((group: HTMLElement) => {\n                const groupSelection = select(group);\n                groupSelection.classed(\"tick-hidden-text\", true);\n                // disable pointer-events so the title doesn't display for hidden labels\n                groupSelection.classed(\"pointer-events\", false);\n            });\n            return;\n        }\n\n        if (scale.id === this.rightScaleId || scale.id === this.leftScaleId) {\n            const textToHide = this.getElementsToHide(\n                axisLabels,\n                this._config.dimension.height(),\n                false\n            );\n            textToHide.forEach((group: HTMLElement) => {\n                select(group).classed(\"sw-hidden\", true);\n            });\n        }\n\n        const margin = this.config().dimension.margin;\n        let widthLimit = 0;\n        let horizontalPadding = 0;\n        let overflowHandler: TextOverflowHandler | undefined;\n        let fixLeftMargin = false;\n        let fixRightMargin = false;\n        const maxRightWidth = axisConfig.right.tickLabel.maxWidth;\n        const maxLeftWidth = axisConfig.left.tickLabel.maxWidth;\n\n        if (scale.id === this.bottomScaleId) {\n            const maxBottomWidth = axisConfig.bottom.tickLabel.maxWidth;\n            const calculatedBottomWidth = (scale as any).bandwidth\n                ? (scale as IBandScale<any>).bandwidth()\n                : this.getTickDistance(axisLabels);\n\n            if (!isUndefined(maxBottomWidth)) {\n                widthLimit =\n                    calculatedBottomWidth > maxBottomWidth\n                        ? maxBottomWidth\n                        : calculatedBottomWidth;\n            } else {\n                widthLimit = calculatedBottomWidth;\n            }\n\n            horizontalPadding = axisConfig.bottom.tickLabel.horizontalPadding;\n            overflowHandler = axisConfig.bottom.tickLabel.overflowHandler;\n        } else if (scale.id === this.rightScaleId && !axisConfig.right.fit) {\n            const calculatedRightWidth =\n                margin.right -\n                axisConfig.right.padding -\n                axisConfig.right.tickSize;\n\n            if (!isUndefined(maxRightWidth)) {\n                widthLimit =\n                    calculatedRightWidth > maxRightWidth\n                        ? maxRightWidth\n                        : calculatedRightWidth;\n            } else {\n                widthLimit = calculatedRightWidth;\n            }\n\n            horizontalPadding = axisConfig.right.tickLabel.horizontalPadding;\n            overflowHandler = axisConfig.right.tickLabel.overflowHandler;\n        } else if (scale.id === this.leftScaleId && !axisConfig.left.fit) {\n            const calculatedLeftWidth =\n                margin.left -\n                axisConfig.left.padding -\n                axisConfig.left.tickSize;\n\n            if (!isUndefined(maxLeftWidth)) {\n                widthLimit =\n                    calculatedLeftWidth > maxLeftWidth\n                        ? maxLeftWidth\n                        : calculatedLeftWidth;\n            } else {\n                widthLimit = calculatedLeftWidth;\n            }\n\n            horizontalPadding = axisConfig.left.tickLabel.horizontalPadding;\n            overflowHandler = axisConfig.left.tickLabel.overflowHandler;\n        } else if (\n            scale.id === this.rightScaleId &&\n            axisConfig.right.fit &&\n            !isUndefined(maxRightWidth)\n        ) {\n            widthLimit = maxRightWidth;\n            horizontalPadding = axisConfig.right.tickLabel.horizontalPadding;\n            overflowHandler = axisConfig.right.tickLabel.overflowHandler;\n            fixRightMargin = true;\n        } else if (\n            scale.id === this.leftScaleId &&\n            axisConfig.left.fit &&\n            !isUndefined(maxLeftWidth)\n        ) {\n            widthLimit = maxLeftWidth;\n            horizontalPadding = axisConfig.left.tickLabel.horizontalPadding;\n            overflowHandler = axisConfig.left.tickLabel.overflowHandler;\n            fixLeftMargin = true;\n        } else {\n            return;\n        }\n\n        if (!overflowHandler) {\n            return;\n        }\n\n        // sample the length of an ellipsis in the current environment\n        let ellipsisWidth = 0;\n        if (labelGroup.select(\".sample-ellipsis\").empty()) {\n            const testText = labelGroup.append(\"text\");\n            const ellipsis = testText\n                .classed(\"sample-ellipsis\", true)\n                .attr(\"opacity\", 0)\n                .append(\"tspan\")\n                .text(\"...\");\n            ellipsisWidth = ellipsis.node()?.getComputedTextLength() || 0;\n            testText.remove();\n        }\n\n        // reset debounce if necessary\n        if (this.handleTickLabelOverflowDebounceIndex[scale.id]) {\n            clearTimeout(this.handleTickLabelOverflowDebounceIndex[scale.id]);\n            this.handleTickLabelOverflowDebounceIndex[scale.id] = null;\n        }\n\n        // hide the labels and disable pointer-events while debouncing\n        labelGroup.classed(\"tick-hidden-text\", true);\n        axisLabels.forEach((group: HTMLElement) => {\n            select(group).classed(\"pointer-events\", false);\n        });\n        // setTimeout used for debounce when the chart is resized\n        this.handleTickLabelOverflowDebounceIndex[scale.id] = setTimeout(() => {\n            axisLabels.forEach((group: HTMLElement) => {\n                const groupSelection = select(group);\n                // invoke the handler for each text element\n                groupSelection\n                    .select(\"text\")\n                    .call(overflowHandler as TextOverflowHandler, {\n                        widthLimit,\n                        horizontalPadding,\n                        ellipsisWidth,\n                    });\n                // restore pointer events\n                groupSelection.classed(\"pointer-events\", true);\n            });\n\n            const marginLocked = this._config.dimension.marginLocked;\n            if (marginLocked && (fixRightMargin || fixLeftMargin)) {\n                this.handleMarginUpdate();\n                marginLocked.right = fixRightMargin;\n                marginLocked.left = fixLeftMargin;\n            }\n\n            // display the labels\n            labelGroup.classed(\"tick-hidden-text\", false);\n        }, XYGrid.TICK_LABEL_OVERFLOW_DEBOUNCE_INTERVAL);\n    }\n\n    protected selectAllAxisLabels(\n        axisGroup: D3Selection<SVGGElement>\n    ): HTMLElement[] {\n        const actualTextElements: HTMLElement[] = [];\n        axisGroup.selectAll(\"g:not(.tick-hidden-text)\").each(function () {\n            actualTextElements.push(<HTMLElement>this);\n        });\n        return actualTextElements;\n    }\n\n    protected getOuterWidthDimensionCorrection(): number {\n        return this.config().axis.bottom.visible\n            ? Grid.TICK_DIMENSION_CORRECTION\n            : 0;\n    }\n\n    private handleMarginUpdate() {\n        const oldMargin = clone(this._config.dimension.margin);\n        this.recalculateMargins(this.container);\n        this.reconcileMarginsWithDebounce(oldMargin);\n    }\n\n    private hasRightYAxis(): boolean {\n        return (\n            this.config().axis.right.visible && this.rightScaleId?.length > 0\n        );\n    }\n\n    private buildAxes(container: D3Selection) {\n        // Grid lines: no sense to have right\n        this.gridY.tickGroup = container\n            .append(\"g\")\n            .classed(\"sw-axis sw-axis-grid sw-axis-gridY\", true);\n        this.gridX.tickGroup = container\n            .append(\"g\")\n            .classed(\"sw-axis sw-axis-grid sw-axis-gridX\", true);\n\n        // Axis groups\n        this.axisX.group = container\n            .append(\"g\")\n            .classed(\"sw-axis sw-axis-x\", true);\n        this.axisX.tickGroup = this.axisX.group\n            .append(\"g\")\n            .classed(\"sw-axis sw-axis-x sw-axis-x-ticks\", true);\n        this.axisX.labelGroup = this.axisX.group\n            .append(\"g\")\n            .classed(\"sw-axis sw-axis-x sw-axis-x-labels\", true);\n\n        this.axisYLeft.group = container\n            .append(\"g\")\n            .classed(\"sw-axis sw-axis-y sw-axis-y-left\", true);\n        this.axisYLeft.tickGroup = this.axisYLeft.group\n            .append(\"g\")\n            .classed(\"sw-axis sw-axis-y sw-axis-y-ticks\", true);\n        this.axisYLeft.labelGroup = this.axisYLeft.group\n            .append(\"g\")\n            .classed(\"sw-axis sw-axis-y sw-axis-y-labels\", true);\n\n        this.axisYRight.group = container\n            .append(\"g\")\n            .classed(\"sw-axis sw-axis-y sw-axis-y-right\", true);\n        this.axisYRight.tickGroup = this.axisYRight.group\n            .append(\"g\")\n            .classed(\"sw-axis sw-axis-y sw-axis-y-ticks\", true);\n        this.axisYRight.labelGroup = this.axisYRight.group\n            .append(\"g\")\n            .classed(\"sw-axis sw-axis-y sw-axis-y-labels\", true);\n    }\n\n    private filterRepeatedElements(elementsToFilter: HTMLElement[]) {\n        const arr: HTMLElement[] = [elementsToFilter[0]];\n        elementsToFilter.reduce((prev: any, next: any) => {\n            const textInsideNext = select(next).text();\n            if (textInsideNext !== prev) {\n                arr.push(next);\n            }\n            return textInsideNext;\n        }, elementsToFilter[0] && select(elementsToFilter[0]).text());\n        return elementsToFilter.filter(\n            (element) => arr.indexOf(element) === -1\n        );\n    }\n\n    private getElementsToHide(\n        elementsToFilter: HTMLElement[],\n        measurement: number,\n        isBottomAxis: boolean\n    ) {\n        const measureType = isBottomAxis ? \"width\" : \"height\";\n        const measurementComparison =\n            this.getTextMeasurement(elementsToFilter, measureType) <\n            measurement;\n        const bottomAxisComparison = isBottomAxis\n            ? this.getMaxTextWidth(elementsToFilter) <\n              this.getTickDistance(elementsToFilter)\n            : false;\n        const shouldNotFilter = isBottomAxis\n            ? measurementComparison && bottomAxisComparison\n            : measurementComparison;\n\n        if (shouldNotFilter) {\n            return [];\n        }\n\n        const elementsToDisplay = this.elementsFiltering(\n            elementsToFilter,\n            measurement,\n            measureType\n        );\n\n        return elementsToFilter.filter(\n            (element) => elementsToDisplay.indexOf(element) === -1\n        );\n    }\n\n    private elementsFiltering(\n        elementsToFilter: HTMLElement[],\n        parameter: number,\n        measureType: string\n    ): HTMLElement[] {\n        let elementsToDisplay: HTMLElement[];\n        let counter = 2;\n        const condition = (array: HTMLElement[]) =>\n            measureType === \"width\"\n                ? this.getMaxTextWidth(array) > this.getTickDistance(array)\n                : this.getTextMeasurement(array, measureType) > parameter;\n        do {\n            elementsToDisplay = elementsToFilter.filter(\n                (element: HTMLElement, index: number) => index % counter === 0\n            );\n            counter++;\n            // Break the loop when we have only 1 tick and its size is bigger than available width/height\n            if (\n                elementsToDisplay.length === 1 &&\n                condition(elementsToDisplay)\n            ) {\n                break;\n            }\n        } while (condition(elementsToDisplay));\n        return elementsToDisplay;\n    }\n\n    private getTextMeasurement(array: HTMLElement[], measureType: string) {\n        const textPadding = measureType === \"width\" ? 5 : 0;\n        return array.reduce(\n            (prev: number, next: HTMLElement) =>\n                prev +\n                (next.getBoundingClientRect() as any)[measureType] +\n                textPadding,\n            0\n        );\n    }\n\n    private getMaxTextWidth(array: HTMLElement[]) {\n        if (array.length === 0) {\n            return 0;\n        }\n        return Math.max.apply(\n            null,\n            array.map((tick: HTMLElement) => tick.getBoundingClientRect().width)\n        );\n    }\n\n    private getTickDistance(array: HTMLElement[]) {\n        if (array.length === 0) {\n            return 0;\n        }\n        let smallestDiff = Infinity;\n        const arrayOfPositions = array.map((tick: HTMLElement) => {\n            const transformVal = tick.getAttribute(\"transform\");\n\n            if (isNil(transformVal)) {\n                throw new Error(\"tick transform is not defined\");\n            }\n\n            return parseFloat(\n                transformVal.slice(\n                    transformVal.indexOf(\"(\") + 1,\n                    transformVal.indexOf(\",\")\n                )\n            );\n        });\n\n        arrayOfPositions.reduce((p: number, n: number) => {\n            const diff = n - p;\n            if (diff < smallestDiff) {\n                smallestDiff = diff;\n            }\n            return n;\n        });\n        return smallestDiff;\n    }\n\n    private recalculateMargins(container: D3Selection<SVGGElement>) {\n        if (!container) {\n            return;\n        }\n        const d = this._config.dimension;\n        const axis = this.config().axis;\n\n        const oldOuterWidth = d.outerWidth();\n        const oldOuterHeight = d.outerHeight();\n\n        if (!d.marginLocked?.left && axis.left.fit && axis.left.visible) {\n            d.margin.left =\n                this.getMaxTextWidth(\n                    this.selectAllAxisLabels(this.axisYLeft.labelGroup)\n                ) +\n                axis.left.tickSize +\n                axis.left.padding;\n        }\n\n        if (!d.marginLocked?.right && axis.right.fit && this.hasRightYAxis()) {\n            d.margin.right =\n                this.getMaxTextWidth(\n                    this.selectAllAxisLabels(this.axisYRight.labelGroup)\n                ) +\n                axis.right.tickSize +\n                axis.right.padding;\n        }\n\n        const bottomScale =\n            this.bottomScaleId && this.scales\n                ? this.scales[\"x\"]?.index[this.bottomScaleId]\n                : undefined;\n        if (\n            axis.bottom.fit &&\n            axis.bottom.visible &&\n            (bottomScale?.isContinuous() ||\n                !axis.bottom.tickLabel.overflowHandler)\n        ) {\n            this.fitBottomAxis(d);\n        }\n\n        const newTopMargin = d.margin.top; // TODO: Do the calculation, if needed\n        const newBottomMargin = d.margin.bottom; // TODO: Do the calculation, based on bottom Axis height\n\n        d.margin.top = newTopMargin;\n        d.margin.bottom = newBottomMargin;\n\n        // adjust width and height accordingly\n        d.outerWidth(oldOuterWidth);\n        d.outerHeight(oldOuterHeight);\n\n        const tx = this.config().dimension.margin.left;\n        const ty = this.config().dimension.margin.top;\n\n        // Note: This transform results in a firefox hack in MouseInteractiveArea in which\n        // the margins must be subtracted from the mouse event coordinates\n        container.attr(\"transform\", `translate(${tx}, ${ty})`);\n    }\n\n    private fitBottomAxis(d: IDimensionConfig) {\n        const scale = this.scales?.x?.list[0].d3Scale;\n        if (!scale) {\n            return;\n        }\n        let lastTextWidth: number = 0;\n        let lastTickScaleValue: number = 0;\n        const node = this.axisX.labelGroup\n            .select(\".tick:not(.tick-hidden-text):last-child text\")\n            .node();\n        if (node) {\n            lastTextWidth = (node as any).getBoundingClientRect().width;\n            lastTickScaleValue = scale((node as any).innerHTML) ?? 0;\n            const topOfRange = scale.range()[1];\n            const diff =\n                lastTextWidth / 2 -\n                Math.abs(topOfRange - lastTickScaleValue) / 2;\n            d.margin.right = diff > 0 ? diff : 0;\n        }\n    }\n\n    /**\n     * This method invokes updateRanges if the margins have changed, but only after a debounce period.\n     * ----\n     * The debounce is necessary because, in the case of a very short axis, repeated attempts to\n     * alternately fit axis labels and recalculate ticks may conflict with each other\n     * causing the old and new margins to never be equal upon comparison. This scenario can cause a d3\n     * call stack overflow, but with a debounce, d3 can keep up with the recalculations until the chart\n     * is resized to consistently accommodate the width of the labels.\n     */\n    private reconcileMarginsWithDebounce(oldMargin: IAllAround<number>) {\n        if (this.reconcileMarginsDebounce) {\n            clearTimeout(this.reconcileMarginsDebounce);\n            this.reconcileMarginsDebounce = null;\n        }\n\n        this.reconcileMarginsDebounce = setTimeout(() => {\n            if (\n                !this.areMarginsApproximatelyEqual(\n                    oldMargin,\n                    this._config.dimension.margin\n                )\n            ) {\n                this.updateChartDimensionsSubject?.next();\n            }\n        }, 100);\n    }\n\n    private isApproximatelyEqual = (first: number, second: number) =>\n        Math.abs(first - second) < 0.1;\n\n    private areMarginsApproximatelyEqual(\n        margin1: IAllAround<number>,\n        margin2: IAllAround<number>\n    ): boolean {\n        return (\n            this.isApproximatelyEqual(margin1.top, margin2.top) &&\n            this.isApproximatelyEqual(margin1.right, margin2.right) &&\n            this.isApproximatelyEqual(margin1.bottom, margin2.bottom) &&\n            this.isApproximatelyEqual(margin1.left, margin2.left)\n        );\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\n/**\n * Default gauge label formatter name\n */\nexport const GAUGE_LABEL_FORMATTER_NAME_DEFAULT = \"gauge-label\";\n\n/**\n * Gauge labels container class name\n */\nexport const GAUGE_LABELS_CONTAINER_CLASS = \"gauge-labels\";\n\n/**\n * Gauge threshold label class name\n */\nexport const GAUGE_THRESHOLD_LABEL_CLASS = \"threshold-label\";\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { DefaultArcObject } from \"d3\";\nimport { pie } from \"d3-shape\";\n\nimport { IGaugeThresholdDatum } from \"../../../gauge/types\";\n\nexport class DonutGaugeRenderingUtil {\n    public static generateThresholdArcData(\n        data: IGaugeThresholdDatum[]\n    ): DefaultArcObject[] {\n        if (!data.length) {\n            return [];\n        }\n\n        const arcData: number[] =\n            DonutGaugeRenderingUtil.generateArcValues(data);\n        const thresholdsData: any[] = [];\n        const pieGenerator = pie().sort(null);\n        const arcsForMarkers = pieGenerator(arcData);\n\n        arcsForMarkers.forEach((arcDatum: any, i: number) => {\n            if (i % 2 === 1) {\n                thresholdsData.push(arcDatum);\n            }\n        });\n        return thresholdsData;\n    }\n\n    private static generateArcValues(data: IGaugeThresholdDatum[]): number[] {\n        // arcs with a value of zero serve as the threshold points\n        const arcData: number[] = Array(data.length * 2 - 1).fill(0);\n        data.forEach((d: IGaugeThresholdDatum, i: number) => {\n            // arcs with a non-zero value serve as the space between the threshold points\n            arcData[i * 2] = i === 0 ? d.value : d.value - data[i - 1].value;\n        });\n        return arcData;\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { Arc, arc, DefaultArcObject } from \"d3-shape\";\nimport cloneDeep from \"lodash/cloneDeep\";\nimport defaultsDeep from \"lodash/defaultsDeep\";\nimport isUndefined from \"lodash/isUndefined\";\nimport { Subject } from \"rxjs\";\n\nimport {\n    IDonutGaugeThresholdsRendererConfig,\n    IRendererEventPayload,\n} from \"../../../core/common/types\";\nimport { StandardGaugeThresholdMarkerRadius } from \"../../../gauge/constants\";\nimport { GAUGE_THRESHOLD_MARKER_CLASS } from \"../../constants\";\nimport { IRenderSeries, RenderLayerName } from \"../../types\";\nimport { IRadialAccessors } from \"../accessors/radial-accessors\";\nimport { RadialRenderer } from \"../radial-renderer\";\nimport { DonutGaugeRenderingUtil } from \"./donut-gauge-rendering-util\";\n\n/**\n * Default configuration for DonutGaugeThresholdsRenderer\n */\nexport const DEFAULT_DONUT_GAUGE_THRESHOLDS_RENDERER_CONFIG: IDonutGaugeThresholdsRendererConfig =\n    {\n        markerRadius: StandardGaugeThresholdMarkerRadius.Large,\n        enabled: true,\n    };\n\n/**\n * Renderer for drawing threshold level markers for donut gauges\n */\nexport class DonutGaugeThresholdsRenderer extends RadialRenderer {\n    /**\n     * Creates an instance of RadialGaugeThresholdsRenderer.\n     * @param {IDonutGaugeThresholdsRendererConfig} [config]\n     * Renderer configuration object. Defaults to `DEFAULT_DONUT_GAUGE_THRESHOLDS_RENDERER_CONFIG` constant value.\n     */\n    constructor(public config: IDonutGaugeThresholdsRendererConfig = {}) {\n        super(config);\n        this.config = defaultsDeep(\n            this.config,\n            DEFAULT_DONUT_GAUGE_THRESHOLDS_RENDERER_CONFIG\n        );\n    }\n\n    /** See {@link Renderer#draw} */\n    public draw(\n        renderSeries: IRenderSeries<IRadialAccessors>,\n        rendererSubject: Subject<IRendererEventPayload>\n    ): void {\n        const dataContainer = renderSeries.containers[RenderLayerName.data];\n\n        const data = cloneDeep(\n            this.config.enabled ? renderSeries.dataSeries.data : []\n        );\n\n        // ensure the data is sorted in ascending order by value since we're using it to calculate circle arcs\n        data.sort((a, b) => a.value - b.value);\n\n        this.segmentWidth = this.getSegmentWidth(renderSeries);\n\n        const innerRadius = this.getInnerRadius(\n            renderSeries.scales.r.range(),\n            0\n        );\n        const markerGenerator: Arc<any, DefaultArcObject> = arc()\n            .outerRadius(this.getOuterRadius(renderSeries.scales.r.range(), 0))\n            .innerRadius(innerRadius >= 0 ? innerRadius : 0);\n\n        const markerSelection = dataContainer\n            .selectAll<SVGCircleElement, SVGCircleElement>(\n                `circle.${GAUGE_THRESHOLD_MARKER_CLASS}`\n            )\n            .data(DonutGaugeRenderingUtil.generateThresholdArcData(data));\n        markerSelection.exit().remove();\n        markerSelection\n            .enter()\n            .append(\"circle\")\n            .attr(\"class\", GAUGE_THRESHOLD_MARKER_CLASS)\n            .merge(markerSelection)\n            .attr(\"cx\", (d) => markerGenerator.centroid(d)[0])\n            .attr(\"cy\", (d) => markerGenerator.centroid(d)[1])\n            .attr(\"r\", this.config.markerRadius as number)\n            .style(\n                \"fill\",\n                (d, i) =>\n                    `var(--nui-color-${\n                        data[i].hit ? \"text-light\" : \"icon-default\"\n                    })`\n            )\n            .style(\"stroke-width\", 0);\n    }\n\n    public getInnerRadius(range: number[], index: number): number {\n        if (isUndefined(this.segmentWidth)) {\n            throw new Error(\"Can't compute inner radius\");\n        }\n\n        const calculatedRadius = range[1] - range[0] - this.segmentWidth;\n        return calculatedRadius >= 0 ? calculatedRadius : 0;\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { Arc, arc, DefaultArcObject } from \"d3-shape\";\nimport cloneDeep from \"lodash/cloneDeep\";\nimport defaultsDeep from \"lodash/defaultsDeep\";\nimport isUndefined from \"lodash/isUndefined\";\nimport { Subject } from \"rxjs\";\nimport { takeUntil } from \"rxjs/operators\";\n\nimport {\n    GAUGE_LABELS_CONTAINER_CLASS,\n    GAUGE_LABEL_FORMATTER_NAME_DEFAULT,\n    GAUGE_THRESHOLD_LABEL_CLASS,\n} from \"./constants\";\nimport { IGaugeLabelsPluginConfig } from \"./types\";\nimport {\n    DATA_POINT_NOT_FOUND,\n    INTERACTION_DATA_POINTS_EVENT,\n    STANDARD_RENDER_LAYERS,\n} from \"../../../constants\";\nimport { DonutGaugeRenderingUtil } from \"../../../renderers/radial/gauge/donut-gauge-rendering-util\";\nimport { DonutGaugeThresholdsRenderer } from \"../../../renderers/radial/gauge/donut-gauge-thresholds-renderer\";\nimport { RenderLayerName } from \"../../../renderers/types\";\nimport { ChartPlugin } from \"../../common/chart-plugin\";\nimport {\n    D3Selection,\n    IAccessors,\n    IChartEvent,\n    IChartSeries,\n} from \"../../common/types\";\n\n/**\n * A chart plugin that handles the rendering of labels for a donut gauge\n */\nexport class DonutGaugeLabelsPlugin extends ChartPlugin {\n    public static readonly MARGIN_DEFAULT = 25;\n\n    /** The default plugin configuration */\n    public DEFAULT_CONFIG: IGaugeLabelsPluginConfig = {\n        padding: 5,\n        formatterName: GAUGE_LABEL_FORMATTER_NAME_DEFAULT,\n        disableThresholdLabels: false,\n    };\n\n    private readonly destroy$ = new Subject<void>();\n    private lasagnaLayer: D3Selection<SVGElement>;\n\n    constructor(public config: IGaugeLabelsPluginConfig = {}) {\n        super();\n        this.config = defaultsDeep(this.config, this.DEFAULT_CONFIG);\n    }\n\n    public initialize(): void {\n        this.lasagnaLayer = this.chart.getGrid().getLasagna().addLayer({\n            name: GAUGE_LABELS_CONTAINER_CLASS,\n            order: STANDARD_RENDER_LAYERS[RenderLayerName.data].order,\n            clipped: false,\n        });\n\n        this.chart\n            .getEventBus()\n            .getStream(INTERACTION_DATA_POINTS_EVENT as string)\n            .pipe(takeUntil(this.destroy$))\n            .subscribe((event: IChartEvent) => {\n                const gaugeThresholdLabelsGroup = this.lasagnaLayer.select(\n                    `.${GAUGE_LABELS_CONTAINER_CLASS}`\n                );\n                if (!gaugeThresholdLabelsGroup.empty()) {\n                    const dataPoints = event.data.dataPoints;\n                    const labelOpacity = Object.keys(dataPoints).find(\n                        (key, index) =>\n                            dataPoints[key].index === DATA_POINT_NOT_FOUND\n                    )\n                        ? 0\n                        : 1;\n                    gaugeThresholdLabelsGroup.style(\"opacity\", labelOpacity);\n                }\n            });\n    }\n\n    public update(): void {\n        this.drawThresholdLabels();\n    }\n\n    public updateDimensions(): void {\n        this.drawThresholdLabels();\n    }\n\n    public destroy(): void {\n        if (this.destroy$) {\n            this.destroy$.next();\n            this.destroy$.complete();\n        }\n    }\n\n    private drawThresholdLabels() {\n        const thresholdsSeries = this.chart\n            .getDataManager()\n            .chartSeriesSet.find(\n                (series: IChartSeries<IAccessors<any>>) =>\n                    series.renderer instanceof DonutGaugeThresholdsRenderer\n            );\n\n        if (isUndefined(thresholdsSeries)) {\n            console.warn(\n                \"Threshold series is undefined. As a result, threshold labels for the donut gauge will not be rendered.\"\n            );\n            return;\n        }\n\n        let gaugeThresholdsLabelsGroup = this.lasagnaLayer.select(\n            `.${GAUGE_LABELS_CONTAINER_CLASS}`\n        );\n        if (gaugeThresholdsLabelsGroup.empty()) {\n            gaugeThresholdsLabelsGroup = this.lasagnaLayer\n                .append(\"svg:g\")\n                .attr(\"class\", GAUGE_LABELS_CONTAINER_CLASS)\n                .style(\"opacity\", 0);\n        }\n\n        const renderer =\n            thresholdsSeries?.renderer as DonutGaugeThresholdsRenderer;\n        const labelRadius =\n            renderer?.getOuterRadius(\n                thresholdsSeries?.scales.r.range() ?? [0, 0],\n                0\n            ) + (this.config.padding as number);\n        if (isUndefined(labelRadius)) {\n            throw new Error(\"Radius is undefined\");\n        }\n\n        const labelGenerator: Arc<any, DefaultArcObject> = arc()\n            .outerRadius(labelRadius)\n            .innerRadius(labelRadius);\n\n        const formatter =\n            thresholdsSeries?.scales.r.formatters[\n                this.config.formatterName as string\n            ] ?? ((d) => d);\n\n        const data = cloneDeep(\n            this.config.disableThresholdLabels ? [] : thresholdsSeries?.data\n        );\n        if (isUndefined(data)) {\n            throw new Error(\"Gauge threshold series data is undefined\");\n        }\n\n        // ensure the data is sorted in ascending order by value since we're using it to calculate circle arcs\n        data.sort((a, b) => a.value - b.value);\n\n        const labelSelection = gaugeThresholdsLabelsGroup\n            .selectAll(`text.${GAUGE_THRESHOLD_LABEL_CLASS}`)\n            .data(DonutGaugeRenderingUtil.generateThresholdArcData(data));\n        labelSelection.exit().remove();\n        labelSelection\n            .enter()\n            .append(\"text\")\n            .attr(\"class\", GAUGE_THRESHOLD_LABEL_CLASS)\n            .merge(labelSelection as any)\n            .attr(\n                \"transform\",\n                (d) => `translate(${labelGenerator.centroid(d)})`\n            )\n            .attr(\"title\", (d, i) => formatter(data[i].value))\n            .style(\"text-anchor\", (d) => this.getTextAnchor(d.startAngle))\n            .style(\"dominant-baseline\", (d) =>\n                this.getAlignmentBaseline(d.startAngle)\n            )\n            .text((d, i) => formatter(data[i].value));\n    }\n\n    private getTextAnchor(angle: any): string {\n        // pie charts start on the top, so we need to subtract Math.PI / 2 (90 degrees)\n        const cosine = Math.cos(angle - Math.PI / 2);\n        if (cosine > 0.5) {\n            // used for right 120 degrees of chart\n            return \"start\";\n        }\n\n        if (cosine < -0.5) {\n            // used for left 120 degrees of chart\n            return \"end\";\n        }\n\n        // used for top 60 degrees and bottom 60 degrees of chart\n        return \"middle\";\n    }\n\n    private getAlignmentBaseline(angle: any): string {\n        // pie charts start on the top, so we need to add Math.PI / 2 (90 degrees)\n        const sine = Math.sin(angle + Math.PI / 2);\n        if (sine > 0.5) {\n            // used for top 120 degrees of chart\n            return \"text-after-edge\";\n        }\n\n        if (sine < -0.5) {\n            // used for bottom 120 degrees of chart\n            return \"text-before-edge\";\n        }\n\n        // used for left 60 degrees and right 60 degrees of chart\n        return \"central\";\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport cloneDeep from \"lodash/cloneDeep\";\nimport defaultsDeep from \"lodash/defaultsDeep\";\nimport isUndefined from \"lodash/isUndefined\";\nimport { Subject } from \"rxjs\";\nimport { takeUntil } from \"rxjs/operators\";\n\nimport {\n    GAUGE_LABELS_CONTAINER_CLASS,\n    GAUGE_LABEL_FORMATTER_NAME_DEFAULT,\n    GAUGE_THRESHOLD_LABEL_CLASS,\n} from \"./constants\";\nimport { IGaugeLabelsPluginConfig } from \"./types\";\nimport { MOUSE_ACTIVE_EVENT, STANDARD_RENDER_LAYERS } from \"../../../constants\";\nimport { GAUGE_THRESHOLD_MARKERS_SERIES_ID } from \"../../../gauge/constants\";\nimport { RenderLayerName } from \"../../../renderers/types\";\nimport { ChartPlugin } from \"../../common/chart-plugin\";\nimport { LinearScale } from \"../../common/scales/linear-scale\";\nimport {\n    D3Selection,\n    IAccessors,\n    IChartEvent,\n    IChartSeries,\n    IDataSeries,\n} from \"../../common/types\";\n\n/**\n * A chart plugin that handles the rendering of labels for a donut gauge\n */\nexport class LinearGaugeLabelsPlugin extends ChartPlugin {\n    /** The default plugin configuration */\n    public DEFAULT_CONFIG: IGaugeLabelsPluginConfig = {\n        padding: 5,\n        formatterName: GAUGE_LABEL_FORMATTER_NAME_DEFAULT,\n        disableThresholdLabels: false,\n        flippedLabels: false,\n    };\n\n    private readonly destroy$ = new Subject<void>();\n    private lasagnaLayer: D3Selection<SVGElement>;\n    private isHorizontal = true;\n    private thresholdsSeries: IChartSeries<IAccessors<any>> | undefined;\n\n    constructor(public config: IGaugeLabelsPluginConfig = {}) {\n        super();\n        this.config = defaultsDeep(this.config, this.DEFAULT_CONFIG);\n    }\n\n    public initialize(): void {\n        this.lasagnaLayer = this.chart.getGrid().getLasagna().addLayer({\n            name: GAUGE_LABELS_CONTAINER_CLASS,\n            order: STANDARD_RENDER_LAYERS[RenderLayerName.data].order,\n            clipped: false,\n        });\n\n        this.chart\n            .getEventBus()\n            .getStream(MOUSE_ACTIVE_EVENT as string)\n            .pipe(takeUntil(this.destroy$))\n            .subscribe((event: IChartEvent) => {\n                const gaugeThresholdLabelsGroup = this.lasagnaLayer.select(\n                    `.${GAUGE_LABELS_CONTAINER_CLASS}`\n                );\n                if (!gaugeThresholdLabelsGroup.empty()) {\n                    gaugeThresholdLabelsGroup.style(\n                        \"opacity\",\n                        event.data ? 1 : 0\n                    );\n                }\n            });\n    }\n\n    public update(): void {\n        this.updateData();\n        this.drawThresholdLabels();\n    }\n\n    public updateDimensions(): void {\n        this.updateData();\n        this.drawThresholdLabels();\n    }\n\n    public destroy(): void {\n        if (this.destroy$) {\n            this.destroy$.next();\n            this.destroy$.complete();\n        }\n    }\n\n    private updateData() {\n        this.thresholdsSeries = this.chart\n            .getDataManager()\n            .chartSeriesSet.find(\n                (series: IChartSeries<IAccessors<any>>) =>\n                    series.id === GAUGE_THRESHOLD_MARKERS_SERIES_ID\n            );\n        this.isHorizontal =\n            this.thresholdsSeries?.scales.x instanceof LinearScale;\n    }\n\n    private drawThresholdLabels() {\n        if (isUndefined(this.thresholdsSeries)) {\n            console.warn(\n                \"Threshold series is undefined. As a result, threshold labels for the linear gauge will not be rendered.\"\n            );\n            return;\n        }\n\n        let gaugeThresholdsLabelsGroup = this.lasagnaLayer.select(\n            `.${GAUGE_LABELS_CONTAINER_CLASS}`\n        );\n        if (gaugeThresholdsLabelsGroup.empty()) {\n            gaugeThresholdsLabelsGroup = this.lasagnaLayer\n                .append(\"svg:g\")\n                .attr(\"class\", GAUGE_LABELS_CONTAINER_CLASS)\n                .style(\"opacity\", 0);\n        }\n\n        const data = cloneDeep(\n            this.config.disableThresholdLabels\n                ? []\n                : this.thresholdsSeries?.data\n        );\n        if (isUndefined(data)) {\n            throw new Error(\"Gauge threshold series data is undefined\");\n        }\n\n        // last value in the thresholds series is the max value of the gauge (needed by RadialGaugeThresholdsRenderer).\n        // removing this value to avoid rendering a label for it\n        data.pop();\n\n        const formatter =\n            this.thresholdsSeries?.scales[this.isHorizontal ? \"x\" : \"y\"]\n                .formatters[this.config.formatterName as string] ?? ((d) => d);\n        const labelSelection = gaugeThresholdsLabelsGroup\n            .selectAll(`text.${GAUGE_THRESHOLD_LABEL_CLASS}`)\n            .data(data);\n\n        labelSelection.exit().remove();\n        labelSelection\n            .enter()\n            .append(\"text\")\n            .attr(\"class\", GAUGE_THRESHOLD_LABEL_CLASS)\n            .merge(labelSelection as any)\n            .attr(\n                \"transform\",\n                (d, i) =>\n                    `translate(${this.xTranslate(d, i)}, ${this.yTranslate(\n                        d,\n                        i\n                    )})`\n            )\n            .attr(\"title\", (d, i) => formatter(data[i].value))\n            .style(\"text-anchor\", (d) => this.getTextAnchor())\n            .style(\"dominant-baseline\", (d) => this.getAlignmentBaseline())\n            .text((d, i) => formatter(data[i].value));\n    }\n\n    private xTranslate = (d: any, i: number) => {\n        if (this.isHorizontal) {\n            const thresholdsSeries = this\n                .thresholdsSeries as IDataSeries<IAccessors>;\n            const value = this.thresholdsSeries?.accessors?.data?.value?.(\n                d,\n                i,\n                thresholdsSeries?.data as any[],\n                thresholdsSeries\n            );\n            return this.thresholdsSeries?.scales.x.convert(value);\n        }\n\n        return this.getLabelOffset();\n    };\n\n    private yTranslate = (d: any, i: number) => {\n        if (this.isHorizontal) {\n            return this.getLabelOffset();\n        }\n\n        const thresholdsSeries = this\n            .thresholdsSeries as IDataSeries<IAccessors>;\n        const value = this.thresholdsSeries?.accessors?.data?.value?.(\n            d,\n            i,\n            thresholdsSeries?.data as any[],\n            thresholdsSeries\n        );\n        return this.thresholdsSeries?.scales.y.convert(value);\n    };\n\n    private getLabelOffset() {\n        let labelStart = 0;\n        if (!this.config.flippedLabels) {\n            const gridDimensions = this.chart.getGrid().config().dimension;\n            labelStart = this.isHorizontal\n                ? gridDimensions.height()\n                : gridDimensions.width();\n        }\n        let padding = this.config.padding as number;\n        padding = this.config.flippedLabels ? -padding : padding;\n        return labelStart + padding;\n    }\n\n    private getTextAnchor(): string {\n        if (this.isHorizontal) {\n            return \"middle\";\n        }\n\n        return this.config.flippedLabels ? \"end\" : \"start\";\n    }\n\n    private getAlignmentBaseline(): string {\n        if (this.isHorizontal) {\n            return this.config.flippedLabels ? \"text-after-edge\" : \"hanging\";\n        }\n\n        return \"central\";\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { BarAccessors, IBarDataAccessors } from \"./bar-accessors\";\nimport { IChartMarker, IValueProvider } from \"../../../core/common/types\";\nimport { IRectangleSeriesAccessors } from \"../../accessors/rectangle-accessors\";\n\nexport class VerticalBarAccessors extends BarAccessors {\n    declare data: IBarDataAccessors;\n    declare series: IRectangleSeriesAccessors;\n\n    constructor(\n        colorProvider?: IValueProvider<string>,\n        markerProvider?: IValueProvider<IChartMarker>\n    ) {\n        super(colorProvider, markerProvider);\n\n        this.data = {\n            ...this.data,\n            startX: (d, i, s, ds) => this.data.category(d, i, s, ds),\n            endX: (d, i, s, ds) => this.data.category(d, i, s, ds),\n            thicknessX: (d, i, s, ds) =>\n                this.data.thickness\n                    ? this.data.thickness(d, i, s, ds)\n                    : undefined,\n            startY: (d, i, s, ds) => this.data.start(d, i, s, ds),\n            endY: (d, i, s, ds) => this.data.end(d, i, s, ds),\n        };\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { IBarChartConfig } from \"./types\";\nimport { BandScale } from \"../../core/common/scales/band-scale\";\nimport { LinearScale } from \"../../core/common/scales/linear-scale\";\nimport { IXYScales } from \"../../core/common/scales/types\";\n\n/**\n * Generates scales definition to be used with category+value based bar charts\n *\n * @param config\n * @param valueScale\n */\nexport function barScales(\n    config?: IBarChartConfig,\n    valueScale = new LinearScale()\n): IXYScales {\n    const bandScale = new BandScale();\n    if (config && config.grouped) {\n        bandScale.padding(0.25);\n        bandScale.innerScale = new BandScale();\n    }\n    let scales: IXYScales;\n    if (!config || !config.horizontal) {\n        scales = {\n            x: bandScale,\n            y: valueScale,\n        };\n    } else {\n        bandScale.reverse();\n        scales = {\n            x: valueScale,\n            y: bandScale,\n        };\n    }\n    return scales;\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { IBarRendererConfig } from \"../types\";\n\n/**\n * Convenience function for generating a standard renderer configuration for a linear gauge\n *\n * @returns {IBarRendererConfig} Standard renderer configuration for a linear gauge\n */\nexport function linearGaugeRendererConfig(): IBarRendererConfig {\n    return {\n        padding: 0,\n        strokeWidth: 0,\n        enableMinBarThickness: false,\n    };\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport cloneDeep from \"lodash/cloneDeep\";\nimport defaultsDeep from \"lodash/defaultsDeep\";\nimport { Subject } from \"rxjs\";\n\nimport { STANDARD_RENDER_LAYERS } from \"../../constants\";\nimport {\n    ILasagnaLayer,\n    ILinearGaugeThresholdsRendererConfig,\n    IRendererEventPayload,\n} from \"../../core/common/types\";\nimport { StandardGaugeThresholdMarkerRadius } from \"../../gauge/constants\";\nimport { IRectangleAccessors } from \"../accessors/rectangle-accessors\";\nimport { GAUGE_THRESHOLD_MARKER_CLASS } from \"../constants\";\nimport { IRenderSeries, RenderLayerName } from \"../types\";\nimport { BarRenderer } from \"./bar-renderer\";\n\n/**\n * Default configuration for Linear Gauge Thresholds Renderer\n */\nexport const DEFAULT_LINEAR_GAUGE_THRESHOLDS_RENDERER_CONFIG: ILinearGaugeThresholdsRendererConfig =\n    {\n        markerRadius: StandardGaugeThresholdMarkerRadius.Large,\n        enabled: true,\n    };\n\n/**\n * Renderer for drawing threshold level indicators for gauges\n */\nexport class LinearGaugeThresholdsRenderer extends BarRenderer {\n    /**\n     * Creates an instance of LinearGaugeThresholdsRenderer.\n     * @param {ILinearGaugeThresholdsRendererConfig} [config]\n     * Renderer configuration object. Defaults to `DEFAULT_LINEAR_GAUGE_THRESHOLDS_RENDERER_CONFIG` constant value.\n     */\n    constructor(public config: ILinearGaugeThresholdsRendererConfig = {}) {\n        super(config);\n        this.config = defaultsDeep(\n            this.config,\n            DEFAULT_LINEAR_GAUGE_THRESHOLDS_RENDERER_CONFIG\n        );\n    }\n\n    /** See {@link Renderer#draw} */\n    public draw(\n        renderSeries: IRenderSeries<IRectangleAccessors>,\n        rendererSubject: Subject<IRendererEventPayload>\n    ): void {\n        const dataContainer =\n            renderSeries.containers[RenderLayerName.unclippedData];\n        const dataSeries = renderSeries.dataSeries;\n        const accessors = dataSeries.accessors;\n\n        const data = cloneDeep(this.config.enabled ? dataSeries.data : []);\n\n        // last value in the thresholds series is the max value of the gauge (needed by RadialGaugeThresholdsRenderer).\n        // removing this value to avoid rendering a marker for it\n        data.pop();\n\n        const markerSelection = dataContainer\n            .selectAll(`circle.${GAUGE_THRESHOLD_MARKER_CLASS}`)\n            .data(data);\n\n        markerSelection.exit().remove();\n        markerSelection\n            .enter()\n            .append(\"circle\")\n            .attr(\"class\", GAUGE_THRESHOLD_MARKER_CLASS)\n            .merge(markerSelection as any)\n            .attr(\"cx\", (d, i) =>\n                renderSeries.scales.x.convert(\n                    accessors?.data?.endX?.(d, i, dataSeries.data, dataSeries)\n                )\n            )\n            .attr(\"cy\", (d, i) =>\n                renderSeries.scales.y.convert(\n                    accessors?.data?.endY?.(d, i, dataSeries.data, dataSeries)\n                )\n            )\n            .attr(\"r\", this.config.markerRadius as number)\n            .style(\n                \"fill\",\n                (d, i) =>\n                    `var(--nui-color-${\n                        data[i].hit ? \"text-light\" : \"icon-default\"\n                    })`\n            )\n            .style(\"stroke-width\", 0);\n    }\n\n    /** See {@link Renderer#getRequiredLayers} */\n    public getRequiredLayers(): ILasagnaLayer[] {\n        return [STANDARD_RENDER_LAYERS[RenderLayerName.unclippedData]];\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport unionBy from \"lodash/unionBy\";\n\nimport { IBarAccessors } from \"./accessors/bar-accessors\";\nimport { IChartSeries } from \"../../core/common/types\";\n\n/** @ignore */\nexport function gatherCategories(\n    chartSeriesSet: IChartSeries<IBarAccessors>[],\n    type: string = \"category\"\n): string[] {\n    return chartSeriesSet.reduce((acc: any[], chartSeries) => {\n        const categoryAccessor = chartSeries.accessors.data[type];\n        const categories = chartSeries.data.reduce(\n            (accInner: string[], datum, index: number) => {\n                accInner.push(\n                    categoryAccessor?.(\n                        datum,\n                        index,\n                        chartSeries.data,\n                        chartSeries\n                    )\n                );\n                return accInner;\n            },\n            []\n        );\n        return unionBy(acc, categories, (d) => d.valueOf());\n    }, []);\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport isUndefined from \"lodash/isUndefined\";\n\nimport { IBarAccessors } from \"./accessors/bar-accessors\";\nimport { gatherCategories } from \"./preprocessor-utils\";\nimport { ChartAssist } from \"../../core/chart-assists/chart-assist\";\nimport { IChartAssistSeries, IChartSeries } from \"../../core/common/types\";\n\nexport function stackedPreprocessor(\n    chartSeriesSet: IChartSeries<IBarAccessors>[],\n    isVisible: (chartSeries: IChartSeries<IBarAccessors>) => boolean\n): IChartSeries<IBarAccessors>[] {\n    // No need to preprocess empty series.\n    if (chartSeriesSet.length === 0) {\n        return chartSeriesSet;\n    }\n    const categories = gatherCategories(\n        chartSeriesSet.filter(\n            (chartSeries) =>\n                isUndefined(chartSeries.preprocess) || chartSeries.preprocess\n        )\n    );\n\n    // This is adding metadata to the dataset and filling missing\n    chartSeriesSet.reduce((acc: number[], chartSeries) => {\n        if (!isUndefined(chartSeries.preprocess) && !chartSeries.preprocess) {\n            return acc;\n        }\n\n        const categoryAccessor = chartSeries.accessors.data[\"category\"];\n        const valueAccessor = chartSeries.accessors.data[\"value\"];\n\n        if (!valueAccessor) {\n            throw new Error(\"valueAccessor is not defined\");\n        }\n        // index makes algorithm faster\n        const dataIndex = chartSeries.data.reduce(\n            (accInner: any, next: any, i: number) => ({\n                ...accInner,\n                [categoryAccessor(next, i, chartSeries.data, chartSeries)]: i,\n            }),\n            {}\n        );\n        const reorderedData: any[] = [];\n\n        categories.forEach((category: string, i) => {\n            let datum: any;\n            if (dataIndex[category] !== undefined) {\n                datum = chartSeries.data[dataIndex[category]];\n                const metadata: any = {};\n                const coef = isVisible(chartSeries) ? 1 : 0;\n                metadata.start = acc[i];\n                acc[i] +=\n                    (valueAccessor(\n                        datum,\n                        dataIndex[category],\n                        chartSeries.data,\n                        chartSeries\n                    ) || 0) * coef;\n                metadata.end = acc[i];\n                datum[\"__bar\"] = metadata;\n                reorderedData.push(datum);\n            }\n        });\n\n        chartSeries.data = reorderedData;\n        return acc;\n    }, Array(categories.length).fill(0));\n\n    return chartSeriesSet;\n}\n\nexport function stack(\n    this: ChartAssist,\n    chartSeriesSet: IChartAssistSeries<IBarAccessors>[]\n): IChartAssistSeries<IBarAccessors>[] {\n    return stackedPreprocessor(\n        chartSeriesSet,\n        (series: IChartSeries<IBarAccessors>) => !this.isSeriesHidden(series.id)\n    );\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { defaultColorProvider } from \"../../../core/common/palette/default-providers\";\nimport {\n    DataAccessor,\n    IAccessors,\n    SeriesAccessor,\n} from \"../../../core/common/types\";\n\nexport interface IRadialDataAccessors {\n    value: DataAccessor;\n    color?: DataAccessor;\n    /** Additional custom keys to match the base interface */\n    [key: string]: DataAccessor | undefined;\n}\n\nexport interface IRadialSeriesAccessors {\n    color?: SeriesAccessor;\n    /** Additional custom keys to match the base interface */\n    [key: string]: SeriesAccessor | undefined;\n}\n\nexport interface IRadialAccessors extends IAccessors {\n    data: IRadialDataAccessors;\n    series: IRadialSeriesAccessors;\n}\n\nexport class RadialAccessors implements IRadialAccessors {\n    data: IRadialDataAccessors;\n    series: IRadialSeriesAccessors;\n\n    constructor(private colorProvider = defaultColorProvider()) {\n        this.data = {\n            value: (d: any) => (Number.isFinite(d) ? d : d.value),\n        };\n        this.series = {\n            color: this.colorProvider ? this.colorProvider.get : undefined,\n        };\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { IRadialRendererConfig } from \"../../../core/common/types\";\n\n/**\n * Convenience function for generating a standard renderer configuration for a donut gauge\n *\n * @returns {IRadialRendererConfig} Standard renderer configuration for a gauge\n */\nexport function donutGaugeRendererConfig(): IRadialRendererConfig {\n    return {\n        strokeWidth: 0,\n        enableSeriesHighlighting: false,\n    };\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport isUndefined from \"lodash/isUndefined\";\n\nimport { Grid } from \"./grid\";\nimport { IDimensions, IGrid } from \"./types\";\n\n/** @ignore */\nexport class RadialGrid extends Grid implements IGrid {\n    public build(): IGrid {\n        super.build();\n        this.recenter();\n\n        return this;\n    }\n\n    public updateDimensions(dimensions: IDimensions): IGrid {\n        const dimensionConfig = this.config().dimension;\n        if (!isUndefined(dimensions.width)) {\n            dimensionConfig.outerWidth(dimensions.width);\n        }\n        if (!isUndefined(dimensions.height)) {\n            dimensionConfig.outerHeight(dimensions.height);\n        }\n\n        // TODO: Chart's update: this.grid.scales = collectScales(seriesSet) may not yet happened\n        if (this.scales) {\n            const radiusScale = this.scales[\"r\"];\n            if (radiusScale) {\n                radiusScale.list[0].range([\n                    0,\n                    Math.min(\n                        dimensionConfig.width(),\n                        dimensionConfig.height()\n                    ) / 2,\n                ]);\n            }\n        }\n\n        this.adjustRenderingArea();\n        this.updateRanges();\n        // This setTimeout is for the safari browser which has problems rendering radial charts during animations\n        // e.g. inside an expander that opens with an animation\n        setTimeout(() => {\n            this.recenter();\n        });\n\n        return this;\n    }\n\n    protected adjustRenderingArea = (): void => {\n        const d = this.config().dimension;\n        const attrs = {\n            width: d.outerWidth(),\n            height: d.outerHeight(),\n            transform: `translate(${-d.outerWidth() / 2}, ${\n                -d.outerHeight() / 2\n            })`,\n        };\n        this.renderingAreaClipPath.attrs(attrs);\n        this.renderingArea.attrs(attrs);\n    };\n\n    private recenter() {\n        this.container.attrs({\n            transform: `translate(${this.config().dimension.outerWidth() / 2},${\n                this.config().dimension.outerHeight() / 2\n            })`,\n        });\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { GridConfig } from \"../../core/grid/config/grid-config\";\nimport { RadialGrid } from \"../../core/grid/radial-grid\";\n\nexport function radialGrid(): RadialGrid {\n    const gridConfig = new GridConfig();\n    gridConfig.interactive = false;\n    return new RadialGrid().config(gridConfig);\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { pie } from \"d3-shape\";\n\nimport { IRadialAccessors } from \"./accessors/radial-accessors\";\nimport { ChartAssist } from \"../../core/chart-assists/chart-assist\";\nimport { IChartAssistSeries, IChartSeries } from \"../../core/common/types\";\n\n/**\n * Pre-processing function for Pie and Donut chart renderers.\n *\n * @param {IChartSeries<IAccessors>[]} seriesSet incoming data series set\n * @param {(series: IChartSeries<IAccessors>) => boolean} isVisible visibility accessor function\n * @returns {IChartSeries<IAccessors>[]}\n */\nexport function radialPreprocessor(\n    seriesSet: IChartSeries<IRadialAccessors>[],\n    isVisible: (series: IChartSeries<IRadialAccessors>) => boolean\n): IChartSeries<IRadialAccessors>[] {\n    if (!seriesSet[0]) {\n        return seriesSet;\n    }\n\n    const pieGenerator = pie().sort(null);\n\n    const seriesNeededOnlyToKnowHowManyLayersDonutHas = seriesSet[0].data;\n\n    const rawArcDataForAllSeries =\n        seriesNeededOnlyToKnowHowManyLayersDonutHas.reduce(\n            (accumulator: any[], value) => {\n                accumulator.push(\n                    seriesSet.map((s: IChartSeries<IRadialAccessors>) =>\n                        isVisible(s) && !s.excludeFromArcCalculation\n                            ? s.accessors.data.value(\n                                  s.data[accumulator.length],\n                                  accumulator.length,\n                                  s.data,\n                                  s\n                              )\n                            : 0\n                    )\n                );\n                return accumulator;\n            },\n            []\n        );\n\n    const pieData = rawArcDataForAllSeries.map((rawArcData: any) =>\n        pieGenerator(rawArcData)\n    );\n\n    return seriesSet.map(\n        (s: IChartSeries<IRadialAccessors>, index: number) => ({\n            ...s,\n            data:\n                s.preprocess === false\n                    ? s.data\n                    : pieData.map((d: any) => ({\n                          ...d[index],\n                          data: s.data[0],\n                      })),\n        })\n    );\n}\n\nexport function radial(\n    this: ChartAssist,\n    chartSeriesSet: IChartAssistSeries<IRadialAccessors>[]\n): IChartSeries<IRadialAccessors>[] {\n    return radialPreprocessor(\n        chartSeriesSet,\n        (series: IChartSeries<IRadialAccessors>) =>\n            !this.isSeriesHidden(series.id)\n    );\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { LinearScale } from \"../../core/common/scales/linear-scale\";\nimport {\n    IRadialScales,\n    NORMALIZED_DOMAIN,\n} from \"../../core/common/scales/types\";\n\n/**\n * Generates scales definition to be used with radial charts\n */\nexport function radialScales(): IRadialScales {\n    return {\n        r: new LinearScale().fixDomain(NORMALIZED_DOMAIN),\n    };\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport isEmpty from \"lodash/isEmpty\";\nimport isUndefined from \"lodash/isUndefined\";\n\nimport {\n    DONUT_GAUGE_LABEL_CLEARANCE_DEFAULT,\n    GaugeMode,\n    GAUGE_QUANTITY_SERIES_ID,\n    GAUGE_REMAINDER_SERIES_ID,\n    GAUGE_THRESHOLD_MARKERS_SERIES_ID,\n    LINEAR_GAUGE_LABEL_CLEARANCE_DEFAULTS,\n    StandardGaugeColor,\n    StandardGaugeThresholdId,\n    StandardGaugeThresholdMarkerRadius,\n} from \"./constants\";\nimport {\n    IGaugeConfig,\n    IGaugeThresholdDatum,\n    IGaugeThresholdDef,\n    IGaugeThresholdsData,\n    IGaugeThresholdsConfig,\n} from \"./types\";\nimport { Chart } from \"../core/chart\";\nimport { ChartAssist } from \"../core/chart-assists/chart-assist\";\nimport { Renderer } from \"../core/common/renderer\";\nimport { IRadialScales, Scales } from \"../core/common/scales/types\";\nimport {\n    IAccessors,\n    IChartAssistSeries,\n    IDataSeries,\n    IGaugeThresholdsRendererConfig,\n} from \"../core/common/types\";\nimport { linearGaugeGridConfig } from \"../core/grid/config/linear-gauge-grid-config-fn\";\nimport { IAllAround } from \"../core/grid/types\";\nimport { XYGrid } from \"../core/grid/xy-grid\";\nimport { GAUGE_LABEL_FORMATTER_NAME_DEFAULT } from \"../core/plugins/gauge/constants\";\nimport { DonutGaugeLabelsPlugin } from \"../core/plugins/gauge/donut-gauge-labels-plugin\";\nimport { LinearGaugeLabelsPlugin } from \"../core/plugins/gauge/linear-gauge-labels-plugin\";\nimport { HorizontalBarAccessors } from \"../renderers/bar/accessors/horizontal-bar-accessors\";\nimport { VerticalBarAccessors } from \"../renderers/bar/accessors/vertical-bar-accessors\";\nimport { BarRenderer } from \"../renderers/bar/bar-renderer\";\nimport { barScales } from \"../renderers/bar/bar-scales\";\nimport { linearGaugeRendererConfig } from \"../renderers/bar/linear-gauge-renderer-config\";\nimport { LinearGaugeThresholdsRenderer } from \"../renderers/bar/linear-gauge-thresholds-renderer\";\nimport { stack } from \"../renderers/bar/stacked-preprocessor\";\nimport { RadialAccessors } from \"../renderers/radial/accessors/radial-accessors\";\nimport { donutGaugeRendererConfig } from \"../renderers/radial/gauge/donut-gauge-renderer-config\";\nimport { DonutGaugeThresholdsRenderer } from \"../renderers/radial/gauge/donut-gauge-thresholds-renderer\";\nimport { radialGrid } from \"../renderers/radial/radial-grid-fn\";\nimport { radial } from \"../renderers/radial/radial-preprocessor\";\nimport { RadialRenderer } from \"../renderers/radial/radial-renderer\";\nimport { radialScales } from \"../renderers/radial/radial-scales\";\n\n/**\n * @ignore\n * Attributes needed by a gauge\n */\nexport interface IGaugeRenderingAttributes {\n    /** Accessors for the gauge quantity segment */\n    quantityAccessors: IAccessors;\n    /** Accessors for the gauge remainder segment */\n    remainderAccessors: IAccessors;\n    /** Scales for the gauge */\n    scales: Scales;\n    /** Renderer for the primary gauge visualization */\n    mainRenderer: Renderer<IAccessors>;\n    /** Renderer for the gauge threshold visualization */\n    thresholdsRenderer: Renderer<IAccessors>;\n}\n\n/**\n * @ignore\n * Interface for an object that can be used to create the rendering attributes needed by a gauge\n */\nexport interface IGaugeRenderingTools {\n    /** Function for creating quantity accessors */\n    quantityAccessorFunction: () => IAccessors;\n    /** Function for creating remainder accessors */\n    remainderAccessorFunction: () => IAccessors;\n    /** Function for creating scales */\n    scaleFunction: () => Scales | IRadialScales;\n    /** Function for creating a main renderer */\n    mainRendererFunction: () => Renderer<IAccessors>;\n    /** Function for creating a thresholds renderer */\n    thresholdsRendererFunction: () => Renderer<IAccessors>;\n}\n\n/**\n * Convenience utility for simplifying gauge usage\n */\nexport class GaugeUtil {\n    /** Value used for unifying the linear-style gauge visualization into a single bar stack */\n    public static readonly DATA_CATEGORY = \"gauge\";\n\n    /**\n     * Creates a ChartAssist pre-configured based on the provided IGaugeConfig and GaugeMode\n     *\n     * @param gaugeConfig The gauge configuration\n     * @param mode The gauge mode\n     * @param labelsPlugin Optional labels plugin for direct control of label configuration. If not provided, a plugin will\n     *                     be generated automatically.\n     *\n     * @returns {ChartAssist} A pre-configured chart assist\n     */\n    public static createChartAssist(\n        gaugeConfig: IGaugeConfig,\n        mode: GaugeMode,\n        labelsPlugin?: DonutGaugeLabelsPlugin | LinearGaugeLabelsPlugin\n    ): ChartAssist {\n        const grid =\n            mode === GaugeMode.Donut\n                ? radialGrid()\n                : new XYGrid(\n                      linearGaugeGridConfig(mode, gaugeConfig.linearThickness)\n                  );\n        const gridConfig = grid.config();\n        const chart = new Chart(grid);\n        const enableLabels =\n            !isEmpty(gaugeConfig.thresholds?.definitions) &&\n            !gaugeConfig.thresholds?.disableMarkers;\n\n        if (mode === GaugeMode.Donut) {\n            if (enableLabels) {\n                chart.addPlugin(labelsPlugin ?? new DonutGaugeLabelsPlugin());\n                gridConfig.dimension.margin =\n                    GaugeUtil.getMarginForLabelClearance(\n                        gaugeConfig,\n                        mode,\n                        gridConfig.dimension.margin\n                    );\n            }\n\n            return new ChartAssist(chart, radial);\n        }\n\n        if (enableLabels) {\n            const flippedLabels = !!gaugeConfig.labels?.flipped;\n            chart.addPlugin(\n                labelsPlugin ?? new LinearGaugeLabelsPlugin({ flippedLabels })\n            );\n            gridConfig.dimension.margin = GaugeUtil.getMarginForLabelClearance(\n                gaugeConfig,\n                mode,\n                gridConfig.dimension.margin\n            );\n        }\n\n        return new ChartAssist(chart, stack);\n    }\n\n    /**\n     * Assembles a gauge series set with all of the standard scales, renderers, accessors, etc. needed for creating a gauge visualization\n     *\n     * @param gaugeConfig The configuration for the gauge\n     * @param mode The mode of the gauge (Donut, Horizontal, or Vertical)\n     *\n     * @returns {IChartAssistSeries<IAccessors>[]} The assembled series set\n     */\n    public static assembleSeriesSet(\n        gaugeConfig: IGaugeConfig,\n        mode: GaugeMode\n    ): IChartAssistSeries<IAccessors>[] {\n        gaugeConfig.value = gaugeConfig.value ?? 0;\n        gaugeConfig.max = gaugeConfig.max ?? 0;\n        const clampedConfig = GaugeUtil.clampConfigToRange(gaugeConfig);\n        const renderAttrs = GaugeUtil.generateRenderingAttributes(\n            clampedConfig,\n            mode\n        );\n        let thresholdsSeries: IChartAssistSeries<IAccessors<any>> | undefined;\n        let seriesSet: IChartAssistSeries<IAccessors>[] = [];\n\n        if (clampedConfig.thresholds) {\n            thresholdsSeries = GaugeUtil.generateThresholdSeries(\n                clampedConfig,\n                renderAttrs\n            );\n            seriesSet.push(thresholdsSeries);\n        }\n\n        const quantityAndRemainderSeriesSet =\n            GaugeUtil.generateQuantityAndRemainderSeriesSet(\n                clampedConfig,\n                renderAttrs,\n                thresholdsSeries?.activeThreshold\n            );\n\n        seriesSet = [\n            ...quantityAndRemainderSeriesSet,\n            ...seriesSet,\n        ] as IChartAssistSeries<IAccessors>[];\n\n        return seriesSet;\n    }\n\n    /**\n     * Updates the series set based on the provided configuration\n     *\n     * @param seriesSet The set of series to update\n     * @param gaugeConfig The configuration for the gauge\n     *\n     * @returns {IChartAssistSeries<IAccessors>[]} The updated series set\n     */\n    public static update(\n        seriesSet: IChartAssistSeries<IAccessors>[],\n        gaugeConfig: IGaugeConfig\n    ): IChartAssistSeries<IAccessors>[] {\n        gaugeConfig.value = gaugeConfig.value ?? 0;\n        gaugeConfig.max = gaugeConfig.max ?? 0;\n        const clampedConfig = GaugeUtil.clampConfigToRange(gaugeConfig);\n        const thresholdsData = GaugeUtil.generateThresholdsData(clampedConfig);\n\n        const updatedSeriesSet = seriesSet.map(\n            (series: IChartAssistSeries<IAccessors<any>>) => {\n                if (series.id === GAUGE_QUANTITY_SERIES_ID) {\n                    return {\n                        ...series,\n                        data: [\n                            {\n                                category: GaugeUtil.DATA_CATEGORY,\n                                value: clampedConfig.value,\n                            },\n                        ],\n                        activeThreshold: thresholdsData.activeThreshold,\n                        defaultColor:\n                            clampedConfig.defaultQuantityColor ||\n                            StandardGaugeColor.Ok,\n                    };\n                }\n\n                if (series.id === GAUGE_REMAINDER_SERIES_ID) {\n                    return {\n                        ...series,\n                        data: [\n                            {\n                                category: GaugeUtil.DATA_CATEGORY,\n                                value: clampedConfig.max - clampedConfig.value,\n                            },\n                        ],\n                    };\n                }\n\n                if (series.id === GAUGE_THRESHOLD_MARKERS_SERIES_ID) {\n                    (\n                        series.renderer.config as IGaugeThresholdsRendererConfig\n                    ).enabled = !clampedConfig.thresholds?.disableMarkers;\n                    (\n                        series.renderer.config as IGaugeThresholdsRendererConfig\n                    ).markerRadius =\n                        clampedConfig.thresholds?.markerRadius ??\n                        StandardGaugeThresholdMarkerRadius.Large;\n                    return { ...series, ...thresholdsData };\n                }\n\n                return series;\n            }\n        );\n\n        return updatedSeriesSet;\n    }\n\n    /**\n     * Convenience function for creating a standard standard set of threshold configs. Includes configurations for warning and error thresholds.\n     *\n     * @param warningVal Value for the warning threshold\n     * @param criticalVal Value for the critical threshold\n     *\n     * @returns {IGaugeThresholdsConfig} The thresholds configuration\n     */\n    public static createStandardThresholdsConfig(\n        warningVal: number,\n        criticalVal: number\n    ): IGaugeThresholdsConfig {\n        // assigning to variable to prevent \"Expression form not supported\" error\n        const config = {\n            definitions: {\n                [StandardGaugeThresholdId.Warning]: {\n                    id: StandardGaugeThresholdId.Warning,\n                    value: warningVal,\n                    enabled: true,\n                    color: StandardGaugeColor.Warning,\n                },\n                [StandardGaugeThresholdId.Critical]: {\n                    id: StandardGaugeThresholdId.Critical,\n                    value: criticalVal,\n                    enabled: true,\n                    color: StandardGaugeColor.Critical,\n                },\n            },\n            reversed: false,\n            disableMarkers: false,\n            markerRadius: StandardGaugeThresholdMarkerRadius.Large,\n        };\n\n        return config;\n    }\n\n    /**\n     * Gets a new instance of the provided grid margin with updated values (if needed) to accommodate the label clearance specified\n     * in the provided gauge configuration\n     *\n     * @param gaugeConfig The gauge's configuration\n     * @param mode The mode of the gauge\n     * @param margin The margin to update\n     *\n     * @returns {IAllAround<number>} The updated margin\n     */\n    public static getMarginForLabelClearance(\n        gaugeConfig: IGaugeConfig,\n        mode: GaugeMode,\n        margin: IAllAround<number>\n    ): IAllAround<number> {\n        if (mode === GaugeMode.Donut) {\n            const clearance =\n                gaugeConfig.labels?.clearance ??\n                DONUT_GAUGE_LABEL_CLEARANCE_DEFAULT;\n\n            // on the radial grid the maximum margin value is used for all margins, so we use the max value here\n            const marginValue = Math.max(...Object.values(margin), clearance);\n\n            return {\n                top: marginValue,\n                right: marginValue,\n                bottom: marginValue,\n                left: marginValue,\n            };\n        }\n\n        let marginToAdjust: keyof IAllAround<number>;\n        const flippedLabels = !!gaugeConfig.labels?.flipped;\n        if (mode === GaugeMode.Horizontal) {\n            marginToAdjust = flippedLabels ? \"top\" : \"bottom\";\n        } else {\n            marginToAdjust = flippedLabels ? \"left\" : \"right\";\n        }\n\n        const clearance =\n            gaugeConfig.labels?.clearance ??\n            LINEAR_GAUGE_LABEL_CLEARANCE_DEFAULTS[marginToAdjust];\n        const marginValue = Math.max(margin[marginToAdjust], clearance);\n        return { ...margin, [marginToAdjust]: marginValue };\n    }\n\n    /**\n     * Generates a set of chart series used for visualizing the gauge's quantity and remainder data\n     *\n     * @param gaugeConfig The configuration for the gauge\n     * @param renderingAttributes The attributes needed to visualized the thresholds\n     * @param activeThreshold The currently active threshold\n     *\n     * @returns {IChartAssistSeries<IAccessors<any>>[]} A set of chart series representing the quantity and remainder data\n     */\n    public static generateQuantityAndRemainderSeriesSet(\n        gaugeConfig: IGaugeConfig,\n        renderingAttributes: IGaugeRenderingAttributes,\n        activeThreshold?: IGaugeThresholdDatum\n    ): IChartAssistSeries<IAccessors<any>>[] {\n        // assigning to variable to prevent \"Lambda not supported\" error\n        const seriesSet = GaugeUtil.generateQuantityAndRemainderData(\n            gaugeConfig\n        ).map((series: Partial<IDataSeries<IAccessors>>) => {\n            const {\n                quantityAccessors,\n                remainderAccessors,\n                scales,\n                mainRenderer,\n            } = renderingAttributes;\n\n            if (quantityAccessors.data) {\n                quantityAccessors.data.color = (\n                    data: any,\n                    i: number,\n                    series: number[],\n                    dataSeries: IDataSeries<IAccessors>\n                ) =>\n                    dataSeries.activeThreshold\n                        ? dataSeries.activeThreshold.color\n                        : dataSeries.defaultColor;\n            }\n\n            if (remainderAccessors.data) {\n                remainderAccessors.data.color = () =>\n                    gaugeConfig.remainderColor || StandardGaugeColor.Remainder;\n            }\n\n            if (series.id === GAUGE_QUANTITY_SERIES_ID) {\n                series.activeThreshold = activeThreshold;\n                series.defaultColor =\n                    gaugeConfig.defaultQuantityColor || StandardGaugeColor.Ok;\n            }\n\n            return {\n                ...series,\n                accessors:\n                    series.id === GAUGE_QUANTITY_SERIES_ID\n                        ? quantityAccessors\n                        : remainderAccessors,\n                scales,\n                renderer: mainRenderer,\n            } as IChartAssistSeries<IAccessors<any>>;\n        });\n\n        return seriesSet;\n    }\n\n    /**\n     * Generates a series for visualizing the gauge's thresholds\n     *\n     * @param gaugeConfig The configuration for the gauge\n     * @param renderingAttributes The attributes needed to visualized the thresholds\n     *\n     * @returns {IChartAssistSeries<IAccessors>} The threshold series\n     */\n    public static generateThresholdSeries(\n        gaugeConfig: IGaugeConfig,\n        renderingAttributes: IGaugeRenderingAttributes\n    ): IChartAssistSeries<IAccessors> {\n        const { quantityAccessors, scales, thresholdsRenderer } =\n            renderingAttributes;\n        return {\n            ...GaugeUtil.generateThresholdsData(gaugeConfig),\n            accessors: quantityAccessors,\n            scales,\n            renderer: thresholdsRenderer,\n            // instruct the radial preprocessor to ignore the threshold series when calculating the donut arcs\n            excludeFromArcCalculation: true,\n            // instruct the stacked and radial preprocessors that the threshold data doesn't need to be mutated\n            preprocess: false,\n        } as IChartAssistSeries<IAccessors>;\n    }\n\n    /**\n     * Generates the attributes required to instantiate a standard gauge in the specified mode\n     *\n     * @param gaugeConfig The configuration for the gauge\n     * @param mode The mode of the gauge (Donut, Horizontal, or Vertical)\n     *\n     * @returns {IGaugeRenderingAttributes} The attributes required to instantiate a gauge\n     */\n    public static generateRenderingAttributes(\n        gaugeConfig: IGaugeConfig,\n        mode: GaugeMode\n    ): IGaugeRenderingAttributes {\n        const renderTools = GaugeUtil.generateRenderingTools(gaugeConfig, mode);\n        const renderAttrs: IGaugeRenderingAttributes = {\n            quantityAccessors: renderTools.quantityAccessorFunction(),\n            remainderAccessors: renderTools.remainderAccessorFunction(),\n            mainRenderer: renderTools.mainRendererFunction(),\n            thresholdsRenderer: renderTools.thresholdsRendererFunction(),\n            scales: renderTools.scaleFunction(),\n        };\n\n        return renderAttrs;\n    }\n\n    /**\n     * Generates rendering tools for standard gauge attributes\n     *\n     * @param gaugeConfig The configuration for the gauge\n     * @param mode The mode of the gauge (Donut, Horizontal, or Vertical)\n     *\n     * @returns {IGaugeRenderingTools} The rendering tools for standard gauge attributes\n     */\n    public static generateRenderingTools(\n        gaugeConfig: IGaugeConfig,\n        mode: GaugeMode\n    ): IGaugeRenderingTools {\n        const thresholdsRendererConfig: IGaugeThresholdsRendererConfig = {\n            enabled: !gaugeConfig.thresholds?.disableMarkers,\n            markerRadius: gaugeConfig.thresholds?.markerRadius,\n        };\n        const labelFormatter = gaugeConfig.labels?.formatter;\n\n        const renderingTools: Record<GaugeMode, IGaugeRenderingTools> = {\n            [GaugeMode.Donut]: {\n                mainRendererFunction: () =>\n                    new RadialRenderer(donutGaugeRendererConfig()),\n                thresholdsRendererFunction: () =>\n                    new DonutGaugeThresholdsRenderer(thresholdsRendererConfig),\n                quantityAccessorFunction: () => new RadialAccessors(),\n                remainderAccessorFunction: () => new RadialAccessors(),\n                scaleFunction: () => {\n                    const scales = radialScales();\n                    scales.r.formatters[GAUGE_LABEL_FORMATTER_NAME_DEFAULT] =\n                        labelFormatter;\n                    return scales;\n                },\n            },\n            [GaugeMode.Horizontal]: {\n                mainRendererFunction: () =>\n                    new BarRenderer(linearGaugeRendererConfig()),\n                thresholdsRendererFunction: () =>\n                    new LinearGaugeThresholdsRenderer(thresholdsRendererConfig),\n                quantityAccessorFunction: () => new HorizontalBarAccessors(),\n                remainderAccessorFunction: () => new HorizontalBarAccessors(),\n                scaleFunction: () => {\n                    const scales = barScales({ horizontal: true });\n                    scales.x.formatters[GAUGE_LABEL_FORMATTER_NAME_DEFAULT] =\n                        labelFormatter;\n                    return scales;\n                },\n            },\n            [GaugeMode.Vertical]: {\n                mainRendererFunction: () =>\n                    new BarRenderer(linearGaugeRendererConfig()),\n                thresholdsRendererFunction: () =>\n                    new LinearGaugeThresholdsRenderer(thresholdsRendererConfig),\n                quantityAccessorFunction: () => new VerticalBarAccessors(),\n                remainderAccessorFunction: () => new VerticalBarAccessors(),\n                scaleFunction: () => {\n                    const scales = barScales();\n                    scales.y.formatters[GAUGE_LABEL_FORMATTER_NAME_DEFAULT] =\n                        labelFormatter;\n                    return scales;\n                },\n            },\n        };\n\n        return renderingTools[mode];\n    }\n\n    /**\n     * Generates quantity and remainder data in the format needed by the gauge visualization\n     *\n     * @param gaugeConfig The configuration for the gauge\n     *\n     * @returns {Partial<IDataSeries<IAccessors>>[]} Array of partial IDataSeries objects including the 'id' and 'data' properties of the quantity and remainder\n     * series needed by the gauge visualization\n     */\n    public static generateQuantityAndRemainderData(\n        gaugeConfig: IGaugeConfig\n    ): Partial<IDataSeries<IAccessors>>[] {\n        return [\n            // category property is used for unifying the linear-style gauge visualization into a single bar stack\n            {\n                id: GAUGE_QUANTITY_SERIES_ID,\n                data: [\n                    {\n                        category: GaugeUtil.DATA_CATEGORY,\n                        value: gaugeConfig.value,\n                    },\n                ],\n            },\n            {\n                id: GAUGE_REMAINDER_SERIES_ID,\n                data: [\n                    {\n                        category: GaugeUtil.DATA_CATEGORY,\n                        value: gaugeConfig.max - gaugeConfig.value,\n                    },\n                ],\n            },\n        ];\n    }\n\n    /**\n     * Generates threshold data in the form needed by the gauge's thresholds visualization\n     *\n     * @param gaugeConfig The configuration for the gauge\n     *\n     * @returns {Partial<IDataSeries<IAccessors, IGaugeThresholdDatum>>} A partial IDataSeries object including the 'id' and 'data' properties of the thresholds\n     * series used for the the gauge's thresholds visualization\n     */\n    public static generateThresholdsData(\n        gaugeConfig: IGaugeConfig\n    ): Partial<IDataSeries<IAccessors, IGaugeThresholdDatum>> {\n        if (!gaugeConfig.thresholds) {\n            throw new Error(\n                \"Thresholds are not defined in the gauge config. Unable to generate threshold data.\"\n            );\n        }\n\n        const { thresholds, activeThreshold } =\n            GaugeUtil.prepareThresholdsData(gaugeConfig);\n\n        return {\n            id: GAUGE_THRESHOLD_MARKERS_SERIES_ID,\n            data: [\n                ...thresholds,\n                // tack the max value onto the end (this is used for donut arc calculation)\n                {\n                    id: \"max\",\n                    enabled: true,\n                    category: GaugeUtil.DATA_CATEGORY,\n                    value: gaugeConfig.max,\n                    color: \"\",\n                },\n            ],\n            activeThreshold,\n        };\n    }\n\n    /**\n     * Generates visualization-specific thresholds data based on the gauge's configuration\n     *\n     * @param gaugeConfig The gauge configuration\n     *\n     * @returns {IGaugeThresholdsData} Thresholds data modified for use by the gauge visualization\n     */\n    public static prepareThresholdsData(\n        gaugeConfig: IGaugeConfig\n    ): IGaugeThresholdsData {\n        const thresholds: IGaugeThresholdDatum[] = Object.values(\n            gaugeConfig.thresholds?.definitions || []\n        )\n            .filter((threshold: IGaugeThresholdDef) => threshold.enabled)\n            .map((threshold: IGaugeThresholdDef) => ({\n                ...threshold,\n                category: GaugeUtil.DATA_CATEGORY,\n                // threshold values are exclusive when in reversed mode, inclusive otherwise\n                hit: gaugeConfig.thresholds?.reversed\n                    ? threshold.value < gaugeConfig.value\n                    : threshold.value <= gaugeConfig.value,\n            }))\n            .sort((a, b) => a.value - b.value);\n\n        const activeThreshold: IGaugeThresholdDatum | undefined = gaugeConfig\n            .thresholds?.reversed\n            ? thresholds?.find(\n                  (threshold) => !isUndefined(threshold.hit) && !threshold.hit\n              )\n            : thresholds\n                  ?.slice()\n                  .reverse()\n                  .find((threshold) => threshold.hit);\n\n        return {\n            thresholds,\n            activeThreshold,\n        };\n    }\n\n    private static clampConfigToRange(gaugeConfig: IGaugeConfig): IGaugeConfig {\n        let value = gaugeConfig.value;\n        if (gaugeConfig.value > gaugeConfig.max) {\n            console.warn(\n                `Configured gauge value ${gaugeConfig.value} is greater` +\n                    `than configured max ${gaugeConfig.max}. Clamping value to ${gaugeConfig.max}.`\n            );\n            value = gaugeConfig.max;\n        }\n\n        if (gaugeConfig.value < 0) {\n            console.warn(\n                `Configured gauge value ${gaugeConfig.value} is less than 0. Clamping value to 0.`\n            );\n            value = 0;\n        }\n\n        const thresholdDefs = gaugeConfig.thresholds?.definitions || {};\n        Object.keys(thresholdDefs || {}).forEach((thresholdId) => {\n            const threshold = thresholdDefs[thresholdId];\n            if (threshold) {\n                if (threshold.value > gaugeConfig.max) {\n                    console.warn(\n                        `Configured threshold value ${threshold.value} for threshold ${thresholdId} is greater` +\n                            `than configured max ${gaugeConfig.max}. Clamping value to ${gaugeConfig.max}.`\n                    );\n                    threshold.value = gaugeConfig.max;\n                }\n\n                if (threshold.value < 0) {\n                    console.warn(\n                        `Configured threshold value ${threshold.value} is less than 0. Clamping value to 0.`\n                    );\n                    threshold.value = 0;\n                }\n            }\n        });\n\n        return {\n            ...gaugeConfig,\n            thresholds: {\n                ...gaugeConfig.thresholds,\n                definitions: thresholdDefs,\n            },\n            value,\n        };\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { Formatter } from \"../core/common/scales/types\";\n\n/**\n * Configuration for a gauge\n */\nexport interface IGaugeConfig {\n    /** The value of the gauge */\n    value: number;\n    /** The max value of the gauge */\n    max: number;\n    /** Optional threshold configuration */\n    thresholds?: IGaugeThresholdsConfig;\n    /** Optional configuration for value labels (currently only used for thresholds) */\n    labels?: IGaugeLabelsConfig;\n    /** The color to display for the quantity when no threshold is active */\n    defaultQuantityColor?: string;\n    /** The color to display for the unfilled segment */\n    remainderColor?: string;\n    /** Used for linear gauges; sets the thickness of the bar. */\n    linearThickness?: number;\n}\n\n/**\n * Configuration for a gauge's thresholds\n */\nexport interface IGaugeThresholdsConfig {\n    /** An array of the gauge's threshold definitions */\n    definitions: GaugeThresholdDefs;\n    /** Set to true to disable the threshold markers */\n    disableMarkers?: boolean;\n    /** The radius of the threshold marker dots */\n    markerRadius?: number;\n    /** Boolean indicating whether the threshold trigger direction should be reversed */\n    reversed?: boolean;\n}\n\n/**\n * Configuration for a gauge's value labels (currently only used for threshold markers)\n */\nexport interface IGaugeLabelsConfig {\n    /**\n     * Optional custom formatter for the value labels (currently only threshold labels are supported)\n     */\n    formatter?: Formatter<any>;\n    /**\n     * Amount of space (in pixels) to reserve on the side of the grid for the labels.\n     * For the donut gauge, the clearance is applied to all sides; for the linear gauge\n     * the clearance is applied only to the side on which the labels appear.\n     */\n    clearance?: number;\n    /**\n     * Currently only supported on linear gauges. Set this to true to change the side of the gauge\n     * that the labels appear on. When false, the default sides are right for vertical gauge\n     * and bottom for horizontal gauge.\n     */\n    flipped?: boolean;\n}\n\n/**\n * Map of threshold IDs to IGaugeThresholdDef objects\n */\nexport type GaugeThresholdDefs = Record<string, IGaugeThresholdDef>;\n\n/**\n * Configuration definition for a gauge threshold\n */\nexport interface IGaugeThresholdDef {\n    /** The ID of the threshold */\n    id: string;\n    /** The value of the threshold */\n    value: number;\n    /** Boolean indicating whether the threshold is enabled */\n    enabled: boolean;\n    /** String indicating the display color of the threshold */\n    color: string;\n}\n\n/**\n * Interface for a gauge threshold datum\n */\nexport interface IGaugeThresholdDatum extends IGaugeThresholdDef {\n    /** Boolean indicating whether the threshold is hit */\n    hit?: boolean;\n    /** Additional metadata as needed */\n    [key: string]: any;\n}\n\n/**\n * Data used for visualizing thresholds on a gauge\n */\nexport interface IGaugeThresholdsData {\n    /** A collection of thresholds */\n    thresholds: IGaugeThresholdDatum[];\n    /** The currently active threshold */\n    activeThreshold?: IGaugeThresholdDatum;\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nexport * from \"./constants\";\nexport * from \"./gauge-util\";\nexport * from \"./types\";\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nexport * from \"./chart-collection-id.directive\";\nexport * from \"./chart-collection.service\";\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { IValueProvider } from \"../types\";\n\n/**\n * This class matches the provided colors to given series.\n * It keeps track of already given colors to given entities to avoid conflicts.\n */\nexport class MappedValueProvider<T> implements IValueProvider<T> {\n    constructor(\n        private valueMap: { [key: string]: T },\n        private defaultValue?: T\n    ) {\n        this.reset();\n    }\n\n    public get = (entityId: string): T | undefined =>\n        this.valueMap[entityId] || this.defaultValue;\n\n    public reset(): void {}\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { IChartMarker } from \"../../types\";\n\n/**\n * This class creates a ChartMarker based on provided data for svg path\n */\nexport class PathMarker implements IChartMarker {\n    /** Resulting <path> HTMLElement */\n    public element: HTMLElement;\n    protected svg: string;\n\n    /**\n     * Creates an instance of PathMarker.\n     * @param {string} d value that has to be assigned to 'd' attribute of 'path' element in svg\n     * @memberof PathMarker\n     */\n    constructor(d: string) {\n        this.element = document.createElement(\"path\");\n\n        this.setAttributes({\n            class: \"nui-chart-element-marker nui-chart--path__outline\",\n            \"vector-effect\": \"non-scaling-stroke\",\n            d: d,\n        });\n    }\n\n    public setColor(color: string): void {\n        this.setAttributes({ fill: color });\n    }\n\n    private setAttributes(attrs: { [key: string]: string }) {\n        for (const attr of Object.keys(attrs)) {\n            this.element.setAttribute(attr, attrs[attr]);\n        }\n\n        this.updateSvg();\n    }\n\n    public getSvg(): string {\n        return this.svg;\n    }\n\n    protected updateSvg(): void {\n        this.svg = this.element.outerHTML;\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nexport * from \"./chart-palette\";\nexport * from \"./mapped-value-provider\";\nexport * from \"./palettes\";\nexport * from \"./processed-color-provider\";\nexport * from \"./sequential-chart-marker-provider\";\nexport * from \"./sequential-color-provider\";\nexport * from \"./sequential-value-provider\";\nexport * from \"./text-color-provider\";\nexport * from \"./markers/path-marker\";\nexport * from \"./markers/svg-marker\";\nexport * from \"./default-providers\";\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { IChartSeries } from \"../../types\";\nimport { DomainCalculator, IScale } from \"../types\";\n\n/**\n * Domain calculator that adds given series to the domain calculation\n *\n * @param additionalSeriesFn this function returns series to be added\n * @param domainCalculator\n */\nexport const domainWithAuxiliarySeries =\n    (\n        additionalSeriesFn: () => IChartSeries<any>[],\n        domainCalculator: DomainCalculator\n    ) =>\n    (\n        chartSeriesSet: IChartSeries<any>[],\n        scaleId: string,\n        scale: IScale<any>\n    ): any[] =>\n        domainCalculator(\n            additionalSeriesFn().concat(chartSeriesSet),\n            scaleId,\n            scale\n        );\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { bisect } from \"d3-array\";\nimport { scalePoint } from \"d3-scale\";\n\nimport { Scale } from \"./scale\";\nimport { IScale } from \"./types\";\n\n/** @ignore */\nexport class PointScale extends Scale<string> {\n    constructor(id?: string) {\n        super(id);\n\n        this.formatters.tick = (value) => value;\n    }\n\n    protected createD3Scale(): any {\n        return scalePoint();\n    }\n\n    public convert(value: string): number {\n        return this._d3Scale(value);\n    }\n\n    public invert(coordinate: number): string {\n        const domain = this._d3Scale.domain();\n        const rangeMidPoints = domain\n            .map(this._d3Scale)\n            .slice(0, -1)\n            .map((d: number) => d + this._d3Scale.step() / 2);\n        return domain[bisect(rangeMidPoints, coordinate)];\n    }\n\n    /**\n     * Gets the rounded setting for the scale\n     *\n     * @returns {boolean} The value indicating whether the scale is rounded\n     */\n    public round(): boolean;\n    /**\n     * Sets whether the scale should be rounded\n     * Rounding helps to have crisp edges https://github.com/d3/d3-scale#band_round\n     *\n     * @param {boolean} round The specified round setting\n     */\n    public round(round: boolean): IScale<string>;\n    public round(round?: boolean): any {\n        if (round) {\n            this._d3Scale.round(round);\n            return this;\n        } else {\n            return this._d3Scale.round();\n        }\n    }\n\n    /**\n     * A convenience method for setting the inner and outer padding.\n     * This differs from D3 implementation. We're setting the outer padding to half of the inner padding.\n     *\n     * @param padding Value in [0, 1] interval.\n     */\n    padding(padding: number): IScale<string> {\n        this._d3Scale.padding(padding);\n        return this;\n    }\n\n    /**\n     * Returns the current alignment which defaults to 0.5.\n     *\n     * @returns {number} The current alignment\n     */\n    align(): number;\n    /**\n     * Sets the alignment to the specified value which must be in the range [0, 1].\n     *\n     * The default is 0.5.\n     *\n     * The alignment determines how any leftover unused space in the range is distributed.\n     * A value of 0.5 indicates that the leftover space should be equally distributed before the first band and\n     * after the last band, i.e. the bands should be centered within the range. A value of 0 or 1 may be used to\n     * shift the bands to one side, say to position them adjacent to an axis.\n     *\n     * @param {number} align Value for alignment setting in [0, 1] interval.\n     */\n    align(align: number): this;\n    align(align?: number): any {\n        if (align) {\n            this._d3Scale.align(align);\n            return this;\n        } else {\n            return this._d3Scale.align();\n        }\n    }\n\n    /**\n     * Returns the width of each band\n     *\n     * @returns {number} The width of each band\n     */\n    public bandwidth(): number {\n        return this._d3Scale.bandwidth();\n    }\n\n    public isContinuous(): boolean {\n        return false;\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { timeDay, timeMinute, timeMonth, timeYear } from \"d3\";\nimport moment from \"moment/moment\";\n\nimport { Formatter } from \"../types\";\n\nconst intlFormat = (date: Date, options: Intl.DateTimeFormatOptions) =>\n    new Intl.DateTimeFormat(moment.locale(), options).format(date);\n\nconst formatSecond = (d: Date) =>\n    intlFormat(d, {\n        hour: \"numeric\",\n        minute: \"2-digit\",\n        second: \"2-digit\",\n    });\n\nconst formatMinute = (d: Date) =>\n    intlFormat(d, { hour: \"numeric\", minute: \"2-digit\" });\n\nconst formatWeek = (d: Date) =>\n    intlFormat(d, { month: \"short\", day: \"2-digit\" });\n\nconst formatMonth = (d: Date) => intlFormat(d, { month: \"short\" });\n\nconst formatYear = (d: Date) => intlFormat(d, { year: \"numeric\" });\n\n/**\n * Formatter for dates\n */\nexport const datetimeFormatter: Formatter<Date> = (date: Date): string => {\n    if (timeMinute(date) < date) {\n        return formatSecond(date);\n    }\n    if (timeDay(date) < date) {\n        return formatMinute(date);\n    }\n    if (timeMonth(date) < date) {\n        return formatWeek(date);\n    }\n    if (timeYear(date) < date) {\n        return formatMonth(date);\n    }\n    return formatYear(date);\n};\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { AxisScale } from \"d3-axis\";\nimport { scaleTime } from \"d3-scale\";\n\nimport { datetimeFormatter } from \"./formatters/datetime-formatter\";\nimport { Scale } from \"./scale\";\n\n/**\n * Nova wrapper around [D3's scaleTime](https://d3indepth.com/scales/#scaletime)\n */\nexport class TimeScale extends Scale<Date> {\n    constructor(id?: string) {\n        super(id);\n\n        this.formatters.tick = datetimeFormatter;\n    }\n\n    protected createD3Scale(): AxisScale<Date> {\n        return scaleTime();\n    }\n\n    public convert(value: Date): number {\n        return this._d3Scale(value);\n    }\n\n    public invert(coordinate: number): Date | undefined {\n        const date = this._d3Scale.invert(coordinate);\n        const result: Date | undefined = isNaN(date.getTime())\n            ? undefined\n            : date;\n        return result;\n    }\n\n    public isContinuous(): boolean {\n        return true;\n    }\n\n    public isDomainValid(): boolean {\n        return (\n            -1 === this.domain().findIndex((value) => isNaN(value.getTime()))\n        );\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { ScaleBand, scaleBand } from \"d3-scale\";\nimport isEqual from \"lodash/isEqual\";\nimport moment, { duration, Duration } from \"moment/moment\";\n\nimport { BAND_CENTER } from \"./constants\";\nimport { datetimeFormatter } from \"./formatters/datetime-formatter\";\nimport { TimeScale } from \"./time-scale\";\nimport { EMPTY_CONTINUOUS_DOMAIN, IBandScale } from \"./types\";\n\n// algorithm found here: https://stackoverflow.com/a/30280636/5108336\nexport function isDaylightSavingTime(d: Date): boolean {\n    const jan = new Date(d.getFullYear(), 0, 1).getTimezoneOffset();\n    const jul = new Date(d.getFullYear(), 6, 1).getTimezoneOffset();\n    return Math.max(jan, jul) !== d.getTimezoneOffset();\n}\n\n/**\n * Scale designed to support regular interval based data.\n */\nexport class TimeIntervalScale extends TimeScale implements IBandScale<Date> {\n    private _bandScale: ScaleBand<Date>;\n    private _interval: Duration;\n\n    constructor(interval: Duration, id?: string) {\n        super(id);\n\n        this.interval(interval);\n\n        this._bandScale = scaleBand<Date>();\n\n        this.formatters.title = this.defaultTitleFormatter;\n    }\n\n    public interval(): Duration;\n    public interval(value: Duration): TimeIntervalScale;\n    public interval(value?: Duration): Duration | TimeIntervalScale {\n        if (value) {\n            this._interval = value;\n            return this;\n        }\n        return this._interval;\n    }\n\n    public domain(domain?: Date[]): any {\n        if (domain) {\n            if (domain.length === 0 || domain.length % 2 !== 0) {\n                throw new Error(\n                    \"TimeIntervalScale domain has to be defined as a pair of [from, to] time values.\"\n                );\n            }\n\n            const isDomainEmpty = isEqual(domain, EMPTY_CONTINUOUS_DOMAIN);\n            const bands: Date[] = [];\n            // only try to determine bands if the domain is not empty\n            if (!isDomainEmpty) {\n                for (let i = 0; i + 1 < domain.length; i += 2) {\n                    bands.push(\n                        ...this.getBandsForInterval(domain[i], domain[i + 1])\n                    );\n                }\n            }\n            this._bandScale.domain(bands);\n\n            // maintain the same domain if it's empty\n            const d = isDomainEmpty\n                ? domain\n                : [domain[0], moment(domain[1]).add(this.interval()).toDate()];\n            return super.domain(d);\n        }\n        return super.domain();\n    }\n\n    public range(range?: [number, number]): any {\n        if (range) {\n            this._bandScale.range(range);\n        } else {\n            return super.range();\n        }\n        return super.range(range);\n    }\n\n    public getBands(): Date[] {\n        return this._bandScale.domain();\n    }\n\n    public convert(value: Date, position: number = BAND_CENTER): number {\n        const truncatedDate: Date | undefined = this.truncToInterval(\n            value,\n            this.interval()\n        );\n        if (!truncatedDate) {\n            throw new Error(\"Could not convert interval\");\n        }\n        const bandValue = this._bandScale(truncatedDate);\n        if (typeof bandValue === \"number\") {\n            return bandValue + position * this.bandwidth();\n        }\n        return super.convert(value);\n    }\n\n    /**\n     * Converts the specified coordinate into the value of the closest band data point\n     *\n     * @param {number} coordinate The coordinate to convert\n     * @returns {string} The value of the closest band data point\n     */\n    public invert(coordinate: number): Date | undefined {\n        const exactTime = super.invert(coordinate);\n        return this.truncToInterval(exactTime, this.interval());\n    }\n\n    public bandwidth(): number {\n        return this._bandScale.bandwidth();\n    }\n\n    public truncToInterval(\n        datetime: Date | undefined,\n        interval: Duration,\n        isDomainChange = false\n    ): Date | undefined {\n        if (!datetime) {\n            return datetime;\n        }\n\n        const isDst = isDaylightSavingTime(datetime);\n        const isDomainStartDst = isDomainChange\n            ? isDst\n            : isDaylightSavingTime(this.domain()[0]);\n\n        const isTransFromDst = isDomainStartDst && !isDst;\n        const isTransToDst = !isDomainStartDst && isDst;\n\n        const intervalDays = this.interval().asDays();\n        const transToDstAdjustment =\n            intervalDays >= 1 && isTransToDst\n                ? duration(1, \"hour\").asMilliseconds()\n                : 0;\n        const adjustedDt = new Date(datetime.getTime() + transToDstAdjustment);\n\n        let standardTimeOffsetMinutes = 0;\n        if (isTransFromDst || isTransToDst) {\n            standardTimeOffsetMinutes = isTransFromDst ? -60 : 60;\n        }\n\n        const timeZoneOffsetMs =\n            (adjustedDt.getTimezoneOffset() + standardTimeOffsetMinutes) *\n            60000;\n        const timestamp = adjustedDt.getTime() - timeZoneOffsetMs;\n        const intervalMs = interval.asMilliseconds();\n        const remainder = timestamp % intervalMs;\n\n        if (remainder === 0) {\n            return adjustedDt;\n        }\n\n        // round to interval\n        const truncatedTimestamp = timestamp - remainder;\n\n        return new Date(truncatedTimestamp + timeZoneOffsetMs);\n    }\n\n    public isContinuous(): boolean {\n        return true;\n    }\n\n    public defaultTitleFormatter = (inputDate: Date): string => {\n        const intervalDays = this.interval().asDays();\n        const isDst = isDaylightSavingTime(inputDate);\n        const isDomainStartDst = isDaylightSavingTime(this.domain()[0]);\n\n        const isTransFromDst = !isDst && isDomainStartDst;\n        const isTransToDst = isDst && !isDomainStartDst;\n\n        let standardTimeOffsetMs = 0;\n        if ((isTransFromDst || isTransToDst) && intervalDays >= 1) {\n            // if transitioning from/to daylight saving time and interval >= 1 day, add/subtract an hour to/from\n            // the time to format the day as \"mmm d\" instead of \"11:00pm\" or \"1:00am\" respectively\n            standardTimeOffsetMs = isTransFromDst ? 3600000 : -3600000;\n        }\n        const adjustedDate = new Date(\n            inputDate.getTime() + standardTimeOffsetMs\n        );\n        const endDate =\n            intervalDays >= 1\n                ? moment(adjustedDate).add(intervalDays, \"days\").toDate()\n                : moment(adjustedDate).add(this.interval()).toDate();\n        return (\n            datetimeFormatter(adjustedDate) + \" - \" + datetimeFormatter(endDate)\n        );\n    };\n\n    private getBandsForInterval(from: Date, to: Date): Date[] {\n        const bands: Date[] = [];\n        let bandDate = this.truncToInterval(from, this.interval(), true);\n        if (!bandDate) {\n            throw new Error(\"Could not get bands for interval\");\n        }\n\n        const intervalMs = this.interval().asMilliseconds();\n        const intervalDays = this.interval().asDays();\n        const isDomainStartDst = isDaylightSavingTime(from);\n        const isDomainEndDst = isDaylightSavingTime(to);\n\n        // Add one hour to the \"to\" date if:\n        // 1) we're transitioning to daylight saving time and 2) the interval is >= one day.\n        // This ensures that the last day in the domain, which starts an hour later, is included in the generated bands.\n        const dstAdjustment =\n            !isDomainStartDst && isDomainEndDst\n                ? duration(1, \"hour\").asMilliseconds()\n                : 0;\n        const adjustedToDate =\n            intervalDays >= 1 ? new Date(to.getTime() + dstAdjustment) : to;\n\n        while (bandDate <= adjustedToDate) {\n            bands.push(bandDate);\n            bandDate = new Date(bandDate.getTime() + intervalMs);\n        }\n        return bands;\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nexport * from \"./datetime-formatter\";\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { AxisScale } from \"d3-axis\";\n\nimport { IFormatters, IScale } from \"./types\";\n\nexport class NoopScale<T = string> implements IScale<T> {\n    public readonly id: string;\n    public formatters: IFormatters<T>;\n    public isDomainFixed: boolean;\n\n    constructor(id?: string) {}\n\n    public convert(): number {\n        // @ts-ignore\n        return;\n    }\n\n    public invert(): T {\n        // @ts-ignore\n        return;\n    }\n\n    public get d3Scale(): AxisScale<T> {\n        // @ts-ignore\n        return;\n    }\n\n    range(): [number, number];\n    range(range: [number, number]): this;\n    range(range?: [number, number]): [number, number] | this {\n        // @ts-ignore\n        return;\n    }\n\n    domain(): T[];\n    domain(domain: T[]): this;\n    domain(domain?: T[]): any {\n        // @ts-ignore\n        return;\n    }\n\n    public fixDomain(domain: any[]): null {\n        return null;\n    }\n\n    public isContinuous(): boolean {\n        return false;\n    }\n\n    public isDomainValid(): boolean {\n        return true;\n    }\n\n    public reverse(): this {\n        // @ts-ignore\n        return;\n    }\n\n    public reversed(): boolean;\n    public reversed(reversed: boolean): this;\n    public reversed(reversed?: boolean): boolean | this {\n        // @ts-ignore\n        return;\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nexport * from \"./domain-calculation/automatic-domain\";\nexport * from \"./domain-calculation/domain-with-ticks\";\nexport * from \"./domain-calculation/domain-with-auxiliary-series\";\nexport * from \"./domain-calculation/merge-domains\";\nexport * from \"./band-scale\";\nexport * from \"./point-scale\";\nexport * from \"./linear-scale\";\nexport * from \"./scale\";\nexport * from \"./time-scale\";\nexport * from \"./time-interval-scale\";\nexport * from \"./formatters/public-api\";\nexport * from \"./types\";\nexport * from \"./noop-scale\";\nexport * from \"./helpers/convert\";\nexport * from \"./helpers/invert\";\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { DataAccessor, IAccessors, IDataSeries, SeriesAccessor } from \"./types\";\n\nexport class DataSeries implements IDataSeries<IAccessors> {\n    public id: string;\n    public accessors: {\n        data?: Record<string, DataAccessor | undefined>;\n        series?: Record<string, SeriesAccessor | undefined>;\n    };\n    public data: any[];\n    public name: string;\n\n    constructor(dataSeries: IDataSeries<IAccessors>) {\n        this.id = dataSeries.id;\n        this.data = dataSeries.data;\n        this.name = dataSeries.name;\n        // TODO: here we can check if default accessors are valid and warn user\n        this.accessors = dataSeries.accessors || {\n            data: {\n                category: (d: any) => d.name,\n                value: (d: any) => d.value,\n            },\n            series: {},\n        };\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nexport * from \"./palette/public-api\";\nexport * from \"./scales/public-api\";\nexport * from \"./chart-plugin\";\nexport * from \"./data-manager\";\nexport * from \"./data-series\";\nexport * from \"./event-bus\";\nexport * from \"./types\";\nexport * from \"./lasagna\";\nexport * from \"./mouse-interactive-area\";\nexport * from \"./render-engine\";\nexport * from \"./renderer\";\nexport * from \"./utility.service\";\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { XYGridConfig } from \"./xy-grid-config\";\n\n/**\n * Pre-defined XYGridConfig for conforming an area chart to Nova UX standards\n */\nexport class AreaGridConfig extends XYGridConfig {\n    constructor() {\n        super();\n\n        this.dimension.padding.bottom = 2; // for shifting zero-line to bottom border\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { XYGridConfig } from \"./xy-grid-config\";\n\n/**\n * Pre-defined and conforming Nova UX standards configuration of XYGrid for bar chart\n */\nexport class BarGridConfig extends XYGridConfig {\n    constructor() {\n        super();\n\n        this.interactionPlugins = false;\n\n        this.axis.left.gridTicks = true;\n        this.axis.left.tickSize = 5;\n        this.axis.bottom.gridTicks = false;\n        this.axis.left.fit = true;\n        this.axis.bottom.tickSize = 5;\n        this.axis.left.tickSize = 0;\n        this.dimension.margin.right = 0;\n        this.dimension.padding.bottom = 2; // 2 for border\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { XYGridConfig } from \"./xy-grid-config\";\n\n/**\n * Pre-defined and conforming Nova UX standards configuration of XYGrid for horizontal bar chart\n */\nexport class BarHorizontalGridConfig extends XYGridConfig {\n    constructor() {\n        super();\n\n        this.interactionPlugins = false;\n\n        this.axis.left.gridTicks = false;\n        this.axis.left.tickSize = 0;\n        this.axis.bottom.gridTicks = true;\n        this.axis.left.fit = true;\n        this.axis.bottom.fit = true;\n        this.axis.bottom.tickSize = 0;\n        this.axis.left.tickSize = 5;\n        this.dimension.padding.left = 2; // 2 for border\n        this.borders.left.visible = true;\n        this.borders.bottom.visible = false;\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { XYGridConfig } from \"./xy-grid-config\";\n\nexport class BarStatusGridConfig extends XYGridConfig {\n    constructor(\n        config: { showBottomAxis: boolean } = { showBottomAxis: true }\n    ) {\n        super();\n\n        this.interactive = true;\n        this.interactionPlugins = false;\n        if (!config.showBottomAxis) {\n            this.axis.bottom.visible = false;\n            this.borders.bottom.visible = false;\n        }\n        this.axis.left.visible = false;\n        this.axis.left.gridTicks = false;\n        this.borders.left.visible = false;\n\n        this.dimension.autoHeight = false;\n        this.dimension.margin.top = 0;\n        if (!config.showBottomAxis) {\n            this.dimension.margin.bottom = 0;\n        }\n        this.dimension.height(30); // TODO: solve magic number together with spark chart\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { BorderConfig } from \"./border-config\";\nimport { XYGridConfig } from \"./xy-grid-config\";\n\n/**\n * Applies spark chart specific grid configuration\n *\n * @param c\n * @param showBottomAxis\n * @param showTopBorder\n */\nexport function sparkChartGridConfig(\n    c: XYGridConfig = new XYGridConfig(),\n    showBottomAxis: boolean = false,\n    showTopBorder: boolean = true\n): XYGridConfig {\n    c.interactionPlugins = false;\n\n    c.axis.left.visible = false;\n    c.axis.left.gridTicks = false;\n    c.dimension.margin.left = 5;\n    c.dimension.margin.right = 5;\n    c.dimension.margin.bottom = showBottomAxis ? c.dimension.margin.bottom : 0;\n    c.dimension.padding.top = 5;\n    c.dimension.padding.bottom = 5;\n    c.dimension.autoHeight = false;\n\n    // TODO: avoid magic number\n    // Hard-coded value stands for the height of rich legend tile when there are 2 rows of description.\n    // We need to figure out how to make a better layout that will not require magic numbers.\n    c.dimension.height(36);\n\n    if (showTopBorder) {\n        c.borders.top = new BorderConfig();\n    }\n    if (!showBottomAxis) {\n        c.borders.bottom.visible = false;\n    }\n\n    return c;\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nexport * from \"./axis-config\";\nexport * from \"./border-config\";\nexport * from \"./dimension-config\";\nexport * from \"./linear-gauge-grid-config-fn\";\nexport * from \"./grid-config\";\nexport * from \"./area-grid-config\";\nexport * from \"./bar-grid-config\";\nexport * from \"./bar-horizontal-grid-config\";\nexport * from \"./bar-status-grid-config\";\nexport * from \"./spark-chart-grid-config\";\nexport * from \"./xy-grid-config\";\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { BaseType } from \"d3\";\nimport { Axis } from \"d3-axis\";\nimport { Selection } from \"d3-selection\";\nimport { Subject } from \"rxjs\";\n\nimport { EventBus } from \"../common/event-bus\";\nimport { Lasagna } from \"../common/lasagna\";\nimport { ScalesIndex } from \"../common/scales/types\";\nimport {\n    D3Selection,\n    IChart,\n    IChartEvent,\n    IChartPlugin,\n} from \"../common/types\";\n\n/**\n * Interface for defining aspects of the top, right, bottom, and left sides of a grid\n */\nexport interface IAllAround<T> {\n    /** Object defining aspects of the top of an entity */\n    top: T;\n    /** Object defining aspects of the right side of an entity */\n    right: T;\n    /** Object defining aspects of the bottom of an entity */\n    bottom: T;\n    /** Object defining aspects of the left side of an entity */\n    left: T;\n}\n\n/**\n * The width and height of an grid\n */\nexport interface IDimensions {\n    width: number;\n    height: number;\n}\n\n/**\n * Configuration of grid dimensions\n */\nexport interface IDimensionConfig {\n    /** The top, right, bottom, and left margin sizes in pixels */\n    margin: IAllAround<number>;\n    /** The top, right, bottom, and left padding sizes in pixels */\n    padding: IAllAround<number>;\n    /** Sets whether the grid uses the chart's container to determine its width */\n    autoWidth: boolean;\n    /** Sets whether the grid uses the chart's container to determine its height */\n    autoHeight: boolean;\n    /** Set of booleans indicating whether a specific margin will be recalculated on chart dimension updates */\n    marginLocked?: IAllAround<boolean>;\n    /**\n     * Sets the grid's width. Note: 'autoWidth' must be set to false for this setting to have an effect.\n     *\n     * @param {number} value The new grid width\n     * @returns {IDimensionConfig} The resulting dimension config\n     */\n    width(value: number): IDimensionConfig;\n    /**\n     * Gets the grid's width -- excluding margins.\n     *\n     * @returns {number} The grid's width\n     */\n    width(): number;\n    /**\n     * Sets the grid's height. Note: 'autoHeight' must be set to false for this setting to have an effect.\n     *\n     * @param {number} value The new grid height\n     * @returns {IDimensionConfig} The resulting dimension config\n     */\n    height(value: number): IDimensionConfig;\n    /**\n     * Gets the grid's height -- excluding margins.\n     *\n     * @returns {number} The grid's height\n     */\n    height(): number;\n    /**\n     * Sets the grid's width by subtracting the grid's horizontal margins from the specified value.\n     * Note: 'autoWidth' must be set to false for this setting to have an effect.\n     *\n     * @param {number} value The new width plus the grid's horizontal margins\n     * @returns {IDimensionConfig} The resulting dimension config\n     */\n    outerWidth(value: number): IDimensionConfig;\n    /**\n     * Gets the grid's width -- including horizontal margins.\n     *\n     * @returns {number} The grid's width plus horizontal margins\n     */\n    outerWidth(): number;\n    /**\n     * Sets the grid's height by subtracting the grid's vertical margins from the specified value.\n     * Note: 'autoWidth' must be set to false for this setting to have an effect.\n     *\n     * @param {number} value The new height plus the grid's vertical margins     *\n     * @returns {IDimensionConfig} The resulting dimension config\n     */\n    outerHeight(value: number): IDimensionConfig;\n    /**\n     * Gets the grid's height -- including vertical margins.\n     *\n     * @returns {number} The grid's height plus vertical margins\n     */\n    outerHeight(): number;\n}\n\n/**\n * Interface for defining the SVGElements forming the top, right, bottom, and left borders of an entity\n */\nexport type IBorders = IAllAround<SVGElement>;\n\n/**\n * Configuration of grid borders\n */\nexport interface IBorderConfig {\n    /** The stroke color */\n    color?: string;\n    /** The thickness of the border */\n    width?: number;\n    /** The class name */\n    className?: string;\n    /** Boolean indicating whether the border should be visible */\n    visible?: boolean;\n}\n\nexport interface ITextOverflowArgs {\n    widthLimit: number;\n    horizontalPadding: number;\n    ellipsisWidth: number;\n}\n\n/** Type for tick overflow handler */\nexport type TextOverflowHandler = (\n    textSelection: Selection<BaseType, unknown, null, undefined>,\n    args: ITextOverflowArgs\n) => void;\n\n/** Interface representing the configuration for tick labels */\nexport interface ITickLabelConfig {\n    /**\n     * Padding for left and right sides of label used for calculating text overflow limits\n     * (number represents the padding on each side)\n     */\n    horizontalPadding: number;\n    /** Handler for text overflow. Set to 'undefined' to disable overflow handling */\n    overflowHandler?: TextOverflowHandler;\n    /**\n     * Setting this insures the label's width is smaller or equal to the provided number\n     */\n    maxWidth?: number;\n}\n\n/** Configuration of a grid axis */\nexport interface IAxisConfig {\n    /** Boolean indicating whether the axis should be visible */\n    visible: boolean;\n    /** The approximate number of ticks to display */\n    approximateTicks: number;\n    /** Boolean indicating whether grid ticks should be displayed */\n    gridTicks: boolean;\n    /** The length of the ticks in pixels */\n    tickSize: number;\n    /** Configuration for the tick labels */\n    tickLabel: ITickLabelConfig;\n    /** Sets whether to fit the grid margins to the axis labels */\n    fit: boolean;\n    /** Sets the axis padding */\n    padding: number;\n}\n\n/**\n * Basic grid configuration\n */\nexport interface IGridConfig {\n    /** Boolean indicating whether the grid will respond to mouse events */\n    interactive: boolean;\n    /** Configuration for the grid's dimensions */\n    dimension: IDimensionConfig;\n    /** Configuration for the grid's borders */\n    borders: IAllAround<IBorderConfig>;\n    /** String indicating the desired cursor style */\n    cursor: string;\n    /** Set to true to disable the render area height correction */\n    disableRenderAreaHeightCorrection?: boolean;\n    /** Set to true to disable the render area width correction */\n    disableRenderAreaWidthCorrection?: boolean;\n}\n\n/**\n * Configuration for an XYGrid\n */\nexport interface IXYGridConfig extends IGridConfig {\n    /** The IAllAround value for the grid's axis configurations */\n    axis: IAllAround<IAxisConfig>;\n\n    /**\n     * Add interaction line and label plugins automatically\n     * Note: This was added to prevent a breaking change. We should avoid this kind of option in future\n     * versions of IXYGridConfig because ideally all plugins should be added manually (NUI-3304).\n     */\n    interactionPlugins: boolean;\n}\n\n/**\n * The basic interface for a grid's dimensions, scaling, interaction, and borders\n *\n * @interface\n */\nexport interface IGrid {\n    /** The grid scales\n     *\n     * @type {ScalesIndex}\n     */\n    scales: ScalesIndex;\n\n    /**\n     * Subject for indicating that the chart's dimensions should be updated\n     */\n    updateChartDimensionsSubject?: Subject<void>;\n\n    /**\n     * Chart event bus\n     */\n    eventBus: EventBus<IChartEvent>;\n\n    /**\n     * Provides access to the grid's layering mechanism\n     *\n     * @returns {Lasagna} The grid's layering mechanism\n     */\n    getLasagna(): Lasagna;\n\n    /**\n     * Provides access to the grid's interactive area\n     *\n     * @returns {D3Selection} The grid's interactive area\n     */\n    getInteractiveArea(): D3Selection<SVGRectElement>;\n\n    /**\n     * getter for the grid's target d3 selection\n     *\n     * @returns {D3Selection} The grid's target d3 selection\n     */\n    target(): D3Selection<SVGSVGElement>;\n\n    /**\n     * setter for the grid's target d3 selection\n     *\n     * @param {D3Selection} [target] The grid's new target d3 selection\n     * @returns {IGrid} The grid instance\n     */\n    target(target: D3Selection<SVGSVGElement>): IGrid;\n    target(\n        target: D3Selection<SVGSVGElement>\n    ): D3Selection<SVGSVGElement> | IGrid;\n\n    /**\n     * getter for the grid configuration\n     *\n     * @returns {IGridConfig} The grid configuration\n     */\n    config(): IGridConfig;\n\n    /**\n     * setter for the grid configuration\n     *\n     * @param {IGridConfig} config The new grid configuration\n     * @returns {this} The grid instance\n     */\n    config(config: IGridConfig): this;\n\n    /**\n     * Builds the grid's rendered elements\n     *\n     * @returns {IGrid} The grid instance\n     */\n    build(): IGrid;\n\n    /**\n     * Updates the grid's rendered elements based on the current scales and configuration\n     *\n     * @returns {IGrid} The grid instance\n     */\n    update(): IGrid;\n\n    /**\n     * Updates the grid's dimensions as specified\n     *\n     * @param {Partial<IDimensions>} dimensions The new grid dimensions\n     * @returns {IGrid} The grid instance\n     */\n    updateDimensions(dimensions: Partial<IDimensions>): IGrid;\n\n    /**\n     * Updates the ranges on the grid's scales based on the grid's configured dimensions\n     *\n     * @returns {IGrid} The grid instance\n     */\n    updateRanges(): IGrid;\n\n    /**\n     * Builds the grid's plugins\n     *\n     * @returns {IChartPlugin[]} The set of generated plugins\n     */\n    buildPlugins(chart: IChart): IChartPlugin[];\n}\n\n/**\n * Interface for a d3 axis entity\n */\nexport interface IAxis {\n    /** The d3 group element for the axis label */\n    labelGroup: D3Selection<SVGGElement>;\n    /** The d3 group element for the axis ticks */\n    tickGroup: D3Selection<SVGGElement>;\n    /** The d3 group element for the axis */\n    group: D3Selection<SVGGElement>;\n    /** The d3 axis */\n    axis: Axis<any>;\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nexport * from \"./config/public-api\";\n\nexport * from \"./xy-grid\";\nexport * from \"./types\";\nexport * from \"./grid\";\nexport * from \"./radial-grid\";\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\n/**\n * Configuration for the gauge labels plugins\n */\nexport interface IGaugeLabelsPluginConfig {\n    /** Set the distance of the labels from the gauge (in pixels). */\n    padding?: number;\n    /** The name of the label formatter */\n    formatterName?: string;\n    /** Set whether labels should be disabled for the thresholds when the gauge is hovered. */\n    disableThresholdLabels?: boolean;\n    /**\n     * Currently only supported on linear gauges. Set this to true to change the side\n     * of the gauge that the labels appear on.\n     */\n    flippedLabels?: boolean;\n\n    // TODO: NUI-5815\n    /** Set whether labels should be displayed for each value interval when the gauge is hovered. */\n    // enableIntervalLabels?: boolean;\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nexport * from \"./donut-gauge-labels-plugin\";\nexport * from \"./linear-gauge-labels-plugin\";\nexport * from \"./constants\";\nexport * from \"./types\";\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nexport * from \"./interaction-label-plugin\";\nexport * from \"./interaction-line-plugin\";\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { ChartPopoverPlugin } from \"./chart-popover-plugin\";\nimport { IElementPosition } from \"./types\";\n\n/**\n * Extends ChartPopoverPlugin to handle popover positioning for radial charts.\n */\nexport class RadialPopoverPlugin extends ChartPopoverPlugin {\n    protected getAbsolutePosition(valArr: any[]): IElementPosition {\n        const chartElement: any = this.chart.target?.node()?.parentNode; // the one above svg\n\n        if (!chartElement) {\n            throw new Error(\"Chart parent node is not defined\");\n        }\n\n        const dataPointsLeft = Math.min(...valArr.map((d) => d.position.x));\n        const dataPointsTop = Math.min(...valArr.map((d) => d.position.y));\n        const left =\n            chartElement.offsetLeft +\n            this.chart.getGrid().config().dimension.margin.left +\n            dataPointsLeft +\n            this.chart.getGrid().config().dimension.width() / 2;\n        const top =\n            chartElement.offsetTop +\n            dataPointsTop +\n            this.chart.getGrid().config().dimension.height() / 2;\n        return {\n            top: top,\n            left: left,\n            height: 0,\n            width: 0,\n        };\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { ConnectedPosition } from \"@angular/cdk/overlay\";\nimport { DefaultArcObject } from \"d3-shape\";\n\nimport { ChartTooltipsPlugin, ITooltipPosition } from \"./chart-tooltips-plugin\";\nimport { RadialRenderer } from \"../../../renderers/radial/radial-renderer\";\nimport {\n    IAccessors,\n    IChartSeries,\n    IDataPoint,\n    IPosition,\n} from \"../../common/types\";\n\n/**\n * The circle is divided into 8 parts (E, SE, S, SW, ...), these values represent the connection points\n * on the source element for the tooltip position starting with EAST and going clockwise)\n */\nconst CONNECTION_POINTS: {\n    x: \"start\" | \"center\" | \"end\";\n    y: \"top\" | \"center\" | \"bottom\";\n}[] = [\n    { x: \"end\", y: \"center\" },\n    { x: \"end\", y: \"bottom\" },\n    { x: \"center\", y: \"bottom\" },\n    { x: \"start\", y: \"bottom\" },\n    { x: \"start\", y: \"center\" },\n    { x: \"start\", y: \"top\" },\n    { x: \"center\", y: \"top\" },\n    { x: \"end\", y: \"top\" },\n];\n\n/** This conversion map is used to calculate the opposite connection points for the tooltip element */\nconst OPPOSITE: { [key: string]: string } = {\n    start: \"end\",\n    end: \"start\",\n    top: \"bottom\",\n    bottom: \"top\",\n};\n\n/**\n * This radial tooltips plugin handles special tooltip positioning requirements for donut / pie charts.\n */\nexport class RadialTooltipsPlugin extends ChartTooltipsPlugin {\n    protected getTooltipPosition(\n        dataPoint: IDataPoint,\n        chartSeries: IChartSeries<IAccessors>\n    ): ITooltipPosition {\n        const pieArcData: DefaultArcObject = dataPoint.data;\n        const renderer = <RadialRenderer>chartSeries.renderer;\n        const rScale = chartSeries.scales.r;\n        // this calculation was taken from the radial renderer implementation\n        const outerRadius = renderer.getOuterRadius(\n            rScale.range(),\n            dataPoint.index\n        );\n\n        const r = outerRadius + this.tooltipPositionOffset;\n        // pie charts start on the top, so we need to subtract Math.PI / 2\n        const a =\n            (pieArcData.startAngle + pieArcData.endAngle) / 2 - Math.PI / 2;\n\n        return {\n            x: Math.cos(a) * r,\n            y: Math.sin(a) * r,\n            width: 0,\n            height: 0,\n            overlayPositions: [this.getOverlayPosition(a)],\n        };\n    }\n\n    protected getAbsolutePosition(\n        relativePosition: ITooltipPosition,\n        chartPosition: IPosition\n    ): ITooltipPosition {\n        const absolutePosition = super.getAbsolutePosition(\n            relativePosition,\n            chartPosition\n        );\n\n        // radial grid is shifted so that the origin is located in the middle of the rendering area,\n        // so we need to add it back when we're emitting absolute positions for the tooltips\n        absolutePosition.x +=\n            this.chart.getGrid().config().dimension.width() / 2;\n        absolutePosition.y +=\n            this.chart.getGrid().config().dimension.height() / 2;\n\n        return absolutePosition;\n    }\n\n    /**\n     * Calculate the position for the tooltip overlay based on the angle of the pie slice\n     *\n     * @param {number} angle in radians\n     */\n    private getOverlayPosition(angle: number): ConnectedPosition {\n        const sectionIndex = this.getSectionIndex(angle, 8);\n\n        return {\n            originX: CONNECTION_POINTS[sectionIndex].x,\n            originY: CONNECTION_POINTS[sectionIndex].y,\n            overlayX: this.opposite(CONNECTION_POINTS[sectionIndex].x),\n            overlayY: this.opposite(CONNECTION_POINTS[sectionIndex].y),\n        };\n    }\n\n    /**\n     * Calculates what section of the circle does the given angle belong to\n     *\n     * @param {number} angle in radians\n     * @param {number} sections The number of sections the circle is divided into\n     */\n    private getSectionIndex(angle: number, sections: number) {\n        let sectionIndex =\n            Math.round(angle / ((Math.PI * 2) / sections)) % sections;\n        while (sectionIndex < 0) {\n            sectionIndex += sections;\n        }\n        return sectionIndex;\n    }\n\n    private opposite(direction: string): any {\n        return OPPOSITE[direction] || direction;\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { ChartTooltipsPlugin } from \"./chart-tooltips-plugin\";\nimport { IBarChartConfig } from \"../../../renderers/bar/types\";\n\nexport class BarTooltipsPlugin extends ChartTooltipsPlugin {\n    constructor(config?: IBarChartConfig) {\n        super();\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nexport * from \"./chart-tooltips-plugin\";\nexport * from \"./radial-tooltips-plugin\";\nexport * from \"./bar-tooltips-plugin\";\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { ICoordinates, IInteractionPayload } from \"../common/types\";\n\n/**\n * Interface used for interaction values with scaleKey as key to a dictionary of scaleId to value. Typical scale keys are \"x\" and \"y\"\n */\nexport interface IInteractionValues {\n    [scaleKey: string]: { [scaleId: string]: any };\n}\n\n/**\n * Payload for an INTERACTION_VALUES_EVENT\n */\nexport interface IInteractionValuesPayload extends IInteractionPayload {\n    /** The values of the interaction */\n    values: IInteractionValues;\n}\n\n/**\n * Payload for an INTERACTION_COORDINATES_EVENT\n */\nexport interface IInteractionCoordinatesPayload extends IInteractionPayload {\n    /** The coordinates of an interaction */\n    coordinates: ICoordinates;\n}\n\n/** Interface for defining an element's position */\nexport interface IElementPosition {\n    top: number;\n    left: number;\n    width: number;\n    height: number;\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { BrushBehavior, BrushSelection, brushX } from \"d3-brush\";\nimport { event } from \"d3-selection\";\nimport defaultsDeep from \"lodash/defaultsDeep\";\nimport isEmpty from \"lodash/isEmpty\";\nimport isUndefined from \"lodash/isUndefined\";\nimport { Subject } from \"rxjs\";\nimport { takeUntil } from \"rxjs/operators\";\n\nimport { IInteractionCoordinatesPayload } from \"./types\";\nimport {\n    INTERACTION_COORDINATES_EVENT,\n    INTERACTION_VALUES_ACTIVE_EVENT,\n    SET_DOMAIN_EVENT,\n    STANDARD_RENDER_LAYERS,\n} from \"../../constants\";\nimport { RenderLayerName } from \"../../renderers/types\";\nimport { ChartPlugin } from \"../common/chart-plugin\";\nimport { IScale } from \"../common/scales/types\";\nimport {\n    D3Selection,\n    IChartEvent,\n    InteractionType,\n    ISetDomainEventPayload,\n} from \"../common/types\";\nimport { Grid } from \"../grid/grid\";\nimport { XYGrid } from \"../grid/xy-grid\";\n\nexport interface IZoomPluginConfiguration {\n    enableExternalEvents?: boolean;\n}\n\nexport class ZoomPlugin extends ChartPlugin {\n    // *Note:* This plugin manually moves the d3 brush across the screen to accommodate a known Firefox\n    // bug in which mouse events report an incorrect pointer position for svg children of an element\n    // transformed by a translate function: https://github.com/d3/d3-selection/issues/81\n\n    public static LAYER_NAME = \"zoom-brush\";\n    public static readonly DEFAULT_CONFIG: IZoomPluginConfiguration = {\n        enableExternalEvents: false,\n    };\n\n    private grid: XYGrid;\n    private brush: BrushBehavior<any>;\n    private zoomBrushLayer: D3Selection;\n    private brushElement: D3Selection<SVGGElement>;\n    private readonly destroy$ = new Subject<void>();\n    private brushStartX: number | undefined;\n    private interactionHandlerMap: Record<string, Function>;\n\n    constructor(public config: IZoomPluginConfiguration = {}) {\n        super();\n        this.config = defaultsDeep(this.config, ZoomPlugin.DEFAULT_CONFIG);\n        this.interactionHandlerMap = {\n            [InteractionType.MouseDown]: this.brushStart,\n            [InteractionType.MouseMove]: this.brushMove,\n            [InteractionType.MouseUp]: this.brushEnd,\n        };\n    }\n\n    public initialize(): void {\n        this.grid = this.chart.getGrid() as XYGrid;\n        this.zoomBrushLayer = this.grid.getLasagna().addLayer({\n            name: ZoomPlugin.LAYER_NAME,\n            // add 1 to the foreground layer's order to ensure the brush is rendered in front of it\n            order: STANDARD_RENDER_LAYERS[RenderLayerName.foreground].order + 1,\n            clipped: true,\n        });\n\n        this.chart\n            .getEventBus()\n            .getStream(INTERACTION_COORDINATES_EVENT)\n            .pipe(takeUntil(this.destroy$))\n            .subscribe((chartEvent: IChartEvent) => {\n                if (chartEvent.broadcast && !this.config.enableExternalEvents) {\n                    return;\n                }\n\n                const data: IInteractionCoordinatesPayload = chartEvent.data;\n                if (isEmpty(this.grid.scales) || isEmpty(data.coordinates)) {\n                    return;\n                }\n\n                if (this.interactionHandlerMap[data.interactionType]) {\n                    const xCoord = data.coordinates && data.coordinates.x;\n                    this.interactionHandlerMap[data.interactionType](xCoord);\n                }\n            });\n\n        this.brush = brushX();\n        this.brushElement = this.zoomBrushLayer\n            .append(\"g\")\n            .attr(\"class\", \"brush\");\n\n        // engage pointer capture to confine mouse events to the interactive area\n        // (in other words, if the 'mouseup' is physically triggered outside the interactive area,\n        // the pointer capture allows us to still zoom based on that event)\n        this.chart\n            .getGrid()\n            .getInteractiveArea()\n            .on(\"pointerdown\", () =>\n                event.target.setPointerCapture(event.pointerId)\n            )\n            .on(\"pointerup\", () =>\n                event.target.releasePointerCapture(event.pointerId)\n            );\n    }\n\n    public updateDimensions(): void {\n        const dimension = this.grid.config().dimension;\n\n        // set the brush area's dimensions\n        this.brush.extent([\n            [0, 0],\n            [dimension.width(), dimension.height()],\n        ]);\n\n        // render the brush area after we have dimensions\n        this.brush(this.zoomBrushLayer.select(\".brush\"));\n\n        // prevent the brush from handling its own pointer events\n        this.brushElement.select(\".overlay\").style(\"pointer-events\", \"none\");\n\n        // remove stroke per mockups\n        this.brushElement.select(\".selection\").attr(\"stroke\", null);\n    }\n\n    public destroy(): void {\n        this.grid.getLasagna().removeLayer(ZoomPlugin.LAYER_NAME);\n        this.destroy$.next();\n        this.destroy$.complete();\n    }\n\n    private brushStart = (xCoord: number) => {\n        if (!isUndefined(this.brushStartX)) {\n            return;\n        }\n\n        this.chart\n            .getEventBus()\n            .getStream(INTERACTION_VALUES_ACTIVE_EVENT)\n            .next({ data: false });\n        this.brushStartX = xCoord;\n    };\n\n    private brushMove = (xCoord: number) => {\n        if (isUndefined(this.brushStartX)) {\n            return;\n        }\n\n        const selection = [this.brushStartX, xCoord].sort((a, b) => a - b);\n        this.brush.move(this.brushElement, selection as BrushSelection);\n    };\n\n    private brushEnd = (xCoord: number) => {\n        if (isUndefined(this.brushStartX)) {\n            return;\n        }\n\n        const selection = [this.brushStartX, xCoord].sort((a, b) => a - b);\n        this.brushStartX = undefined;\n        this.chart\n            .getEventBus()\n            .getStream(INTERACTION_VALUES_ACTIVE_EVENT)\n            .next({ data: true });\n\n        // remove the brush\n        this.brush.move(this.brushElement, null);\n\n        const xScales = this.grid.scales.x.list;\n        if (!xScales || selection[0] === selection[1]) {\n            return;\n        }\n\n        let widthCorrection = 0;\n        const gridConfig = this.grid.config();\n        if (\n            !gridConfig.disableRenderAreaWidthCorrection &&\n            selection[1] ===\n                gridConfig.dimension.width() - Grid.RENDER_AREA_WIDTH_CORRECTION\n        ) {\n            // Width correction to accommodate similar adjustment in grid. This ensures that the right-most column of pixels on the chart is selectable.\n            widthCorrection = Grid.RENDER_AREA_WIDTH_CORRECTION;\n        }\n\n        const data: ISetDomainEventPayload = xScales.reduce(\n            (result, next: IScale<any>) => {\n                result[next.id] = [\n                    selection[0],\n                    (selection[1] as number) + widthCorrection,\n                ].map((x) => next.invert(x as number));\n                return result;\n            },\n            <ISetDomainEventPayload>{}\n        );\n\n        // zoom the chart\n        this.chart.getEventBus().getStream(SET_DOMAIN_EVENT).next({ data });\n    };\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { BrushBehavior, BrushSelection, brushX } from \"d3-brush\";\nimport { event } from \"d3-selection\";\nimport debounce from \"lodash/debounce\";\nimport defaultsDeep from \"lodash/defaultsDeep\";\nimport find from \"lodash/find\";\nimport isEmpty from \"lodash/isEmpty\";\nimport isUndefined from \"lodash/isUndefined\";\nimport moment from \"moment/moment\";\nimport { Subject } from \"rxjs\";\nimport { takeUntil } from \"rxjs/operators\";\n\nimport {\n    INTERACTION_COORDINATES_EVENT,\n    INTERACTION_VALUES_EVENT,\n    STANDARD_RENDER_LAYERS,\n} from \"../../constants\";\nimport { RenderLayerName } from \"../../renderers/types\";\nimport { ChartPlugin } from \"../common/chart-plugin\";\nimport { IScale } from \"../common/scales/types\";\nimport { D3Selection, IChartEvent, InteractionType } from \"../common/types\";\nimport { XYGrid } from \"../grid/xy-grid\";\nimport { UtilityService } from \"../public-api\";\nimport { TimeseriesZoomPluginsSyncService } from \"./timeseries-zoom-plugin-sync.service\";\nimport { IInteractionCoordinatesPayload } from \"./types\";\n\nexport interface ITimeseriesZoomPluginConfig {\n    collectionId?: string;\n    enableExternalEvents?: boolean;\n}\nexport interface ITimeseriesZoomPluginInspectionFrame {\n    startDate: moment.Moment | undefined;\n    endDate: moment.Moment | undefined;\n}\n\nexport class TimeseriesZoomPlugin extends ChartPlugin {\n    public static LAYER_NAME = \"timeseries-zoom-brush\";\n    public static readonly DEFAULT_CONFIG: ITimeseriesZoomPluginConfig = {\n        enableExternalEvents: true,\n        collectionId: \"\",\n    };\n    private grid: XYGrid;\n    private brush: BrushBehavior<any>;\n    private zoomBrushLayer: D3Selection;\n    private brushElement: D3Selection<SVGGElement>;\n    private destroy$ = new Subject<void>();\n    private interactionHandlerMap: Record<string, Function>;\n    private xScale: IScale<any>;\n\n    private brushStartXCoord?: number;\n    private brushEndXCoord?: number;\n    private brushStartXDate?: moment.Moment;\n    private brushEndXDate?: moment.Moment;\n\n    private isChartHoverd = false;\n    private isPopoverDisplayed = false;\n\n    private zoomLineLayer: D3Selection<SVGElement>;\n\n    private readonly openPopoverSubject = new Subject<number>();\n    public readonly openPopover$ = this.openPopoverSubject\n        .asObservable()\n        .pipe(takeUntil(this.destroy$));\n\n    private readonly closePopoverSubject = new Subject<void>();\n    public readonly closePopover$ = this.closePopoverSubject\n        .asObservable()\n        .pipe(takeUntil(this.destroy$));\n\n    private readonly zoomCreatedSubject = new Subject<void>();\n    public readonly zoomCreated$ = this.zoomCreatedSubject\n        .asObservable()\n        .pipe(takeUntil(this.destroy$));\n\n    private resizeHandler = debounce(() => {\n        if (\n            isUndefined(this.brushStartXDate) ||\n            isUndefined(this.brushEndXDate)\n        ) {\n            return;\n        }\n        // makes sure that popover is closed while resizing\n        this.moveBrushByDate(this.brushStartXDate, this.brushEndXDate);\n        this.closePopover();\n    }, 10);\n\n    constructor(\n        public config: ITimeseriesZoomPluginConfig = {},\n        private syncService?: TimeseriesZoomPluginsSyncService\n    ) {\n        super();\n        this.config = defaultsDeep(\n            this.config,\n            TimeseriesZoomPlugin.DEFAULT_CONFIG\n        );\n        // registers handlers\n        this.interactionHandlerMap = {\n            [InteractionType.MouseDown]: this.onBrushStart,\n            [InteractionType.MouseMove]: this.onBrushMove,\n            [InteractionType.MouseUp]: this.onBrushEnd,\n        };\n\n        if (this.config.collectionId) {\n            this.syncService?.registerPlugin(this.config.collectionId, this);\n        }\n    }\n\n    public initialize(): void {\n        this.grid = this.chart.getGrid() as XYGrid;\n        this.zoomBrushLayer = this.grid.getLasagna().addLayer({\n            name: TimeseriesZoomPlugin.LAYER_NAME,\n            // add 1 to the foreground layer's order to ensure the brush is rendered in front of it\n            order: STANDARD_RENDER_LAYERS[RenderLayerName.foreground].order + 1,\n            clipped: true,\n        });\n\n        this.zoomLineLayer = this.chart.getGrid().getLasagna().addLayer({\n            name: \"zoom-interaction-line\",\n            order: 900,\n            clipped: true,\n        });\n\n        this.chart\n            .getEventBus()\n            .getStream(INTERACTION_COORDINATES_EVENT)\n            .pipe(takeUntil(this.destroy$))\n            .subscribe((chartEvent: IChartEvent) => {\n                if (chartEvent.broadcast && !this.config.enableExternalEvents) {\n                    return;\n                }\n\n                const data: IInteractionCoordinatesPayload = chartEvent.data;\n                if (isEmpty(this.grid.scales) || isEmpty(data.coordinates)) {\n                    return;\n                }\n\n                if (this.interactionHandlerMap[data.interactionType]) {\n                    const xCoord = data.coordinates && data.coordinates.x;\n                    const yCoord = data.coordinates && data.coordinates.y;\n                    this.interactionHandlerMap[data.interactionType](\n                        xCoord,\n                        yCoord\n                    );\n                }\n            });\n\n        this.chart\n            .getEventBus()\n            .getStream(INTERACTION_VALUES_EVENT)\n            .pipe(takeUntil(this.destroy$))\n            .subscribe((event: IChartEvent) => {\n                // detects hovering on different charts and closes popover\n                if (event.data.values?.x) {\n                    const chartGrid = this.grid;\n                    const eventXAxisIds = Object.keys(event.data.values.x);\n                    const chartLeftXAxis = chartGrid.scales.x.list[0];\n                    // shows popover only for a chart that is currently being hovered\n                    if (\n                        chartLeftXAxis.isTimeseriesScale &&\n                        !eventXAxisIds.includes(chartLeftXAxis.id)\n                    ) {\n                        this.isChartHoverd = false;\n                        this.closePopover();\n                    } else {\n                        this.isChartHoverd = true;\n                    }\n                }\n            });\n\n        this.brush = brushX();\n        this.brushElement = this.zoomBrushLayer\n            .append(\"g\")\n            .attr(\"class\", \"brush\");\n\n        // engage pointer capture to confine mouse events to the interactive area\n        // (in other words, if the 'mouseup' is physically triggered outside the interactive area,\n        // the pointer capture allows us to still zoom based on that event)\n        this.chart\n            .getGrid()\n            .getInteractiveArea()\n            .on(\"pointerdown\", () =>\n                event.target.setPointerCapture(event.pointerId)\n            )\n            .on(\"pointerup\", () =>\n                event.target.releasePointerCapture(event.pointerId)\n            );\n    }\n\n    public updateDimensions(): void {\n        const dimension = this.grid?.config()?.dimension;\n        if (this.grid) {\n            this.xScale = find(this.grid.scales[\"x\"].index, {\n                id: this.grid.bottomScaleId,\n            }) as IScale<any>;\n        }\n\n        if (!dimension) {\n            return;\n        }\n\n        // set the brush area's dimensions\n        this.brush.extent([\n            [0, 0],\n            [dimension.width(), dimension.height()],\n        ]);\n\n        // render the brush area after we have dimensions\n        this.brush(this.zoomBrushLayer.select(\".brush\"));\n\n        // prevent the brush from handling its own pointer events\n        this.brushElement.select(\".overlay\").style(\"pointer-events\", \"none\");\n\n        // remove stroke per mockups\n        this.brushElement.select(\".selection\").attr(\"stroke\", null);\n\n        // makes sure that zoom brush gets correctly resized when chart's dimension changes\n        this.resizeHandler();\n    }\n\n    public destroy(): void {\n        if (this.config.collectionId) {\n            this.syncService?.removePlugin(this.config.collectionId, this);\n        }\n\n        this.clearBrush();\n\n        this.grid.getLasagna().removeLayer(TimeseriesZoomPlugin.LAYER_NAME);\n        this.destroy$.next();\n        this.destroy$.complete();\n    }\n\n    public showPopover(): void {\n        if (\n            !this.isChartHoverd ||\n            this.isPopoverDisplayed ||\n            isUndefined(this.brushStartXCoord) ||\n            isUndefined(this.brushEndXCoord)\n        ) {\n            return;\n        }\n        this.isPopoverDisplayed = true;\n        this.openPopoverSubject.next(this.brushEndXCoord);\n    }\n\n    public closePopover(): void {\n        if (!this.isPopoverDisplayed) {\n            return;\n        }\n        this.isPopoverDisplayed = false;\n        this.closePopoverSubject.next();\n    }\n\n    public moveBrushByDate(\n        startDate: moment.Moment,\n        endDate: moment.Moment\n    ): void {\n        const startXCoord = this.xScale.convert(startDate);\n        const endXCoord = this.xScale.convert(endDate);\n\n        // brush is already in the correct position\n        if (\n            this.brushStartXCoord === startXCoord &&\n            this.brushEndXCoord === endXCoord\n        ) {\n            return;\n        }\n\n        // in case brush doesn't exist yet\n        if (\n            isUndefined(this.brushStartXCoord) &&\n            isUndefined(this.brushStartXCoord)\n        ) {\n            this.createBrushWithoutDrag(startXCoord, endXCoord);\n            return;\n        }\n\n        this.moveBrush(startDate, endDate, startXCoord, endXCoord);\n    }\n\n    public moveBrushByCoord(\n        startX: number | undefined,\n        endX: number | undefined\n    ): void {\n        if (isUndefined(startX) || isUndefined(endX)) {\n            return;\n        }\n\n        // brush is already in the correct position\n        if (startX === this.brushStartXCoord && endX === this.brushEndXCoord) {\n            return;\n        }\n\n        // in case brush doesn't exist yet\n        if (\n            isUndefined(this.brushStartXCoord) &&\n            isUndefined(this.brushEndXCoord)\n        ) {\n            this.createBrushWithoutDrag(startX, endX);\n            return;\n        }\n\n        const startDate = this.getDateFromCoord(startX);\n        const endDate = this.getDateFromCoord(endX);\n\n        this.moveBrush(startDate, endDate, startX, endX);\n    }\n\n    public clearBrush(): void {\n        this.brush.move(this.brushElement, null);\n        this.zoomLineLayer\n            .selectAll(\".\" + TimeseriesZoomPlugin.LAYER_NAME)\n            .remove();\n\n        this.brushEndXCoord = undefined;\n        this.brushStartXCoord = undefined;\n        this.brushStartXDate = undefined;\n        this.brushEndXDate = undefined;\n\n        this.closePopover();\n    }\n\n    public getInspectionFrame(): ITimeseriesZoomPluginInspectionFrame {\n        return {\n            startDate: this.brushStartXDate,\n            endDate: this.brushEndXDate,\n        };\n    }\n\n    private getDateFromCoord(xCoord: number): moment.Moment {\n        const xScaleValue = UtilityService.getScaleValues(\n            [this.xScale],\n            xCoord\n        );\n        return moment(\n            UtilityService.getInteractionValues(xScaleValue, this.xScale.id)\n        );\n    }\n\n    private addZoomBoundaryLine(xDate: moment.Moment, xCoord: number): void {\n        const line = this.zoomLineLayer\n            .selectAll(TimeseriesZoomPlugin.LAYER_NAME)\n            .data([xDate]);\n\n        const attrs = {\n            class: TimeseriesZoomPlugin.LAYER_NAME,\n            x1: xCoord,\n            y1: 0,\n            x2: xCoord,\n            y2: this.chart.getGrid().config().dimension.height(),\n        };\n\n        line.enter()\n            .append(\"line\")\n            .merge(line as any)\n            .attrs(attrs);\n\n        line.exit().remove();\n    }\n\n    private onBrushStart = (xCoord: number) => {\n        if (!isUndefined(this.brushStartXCoord)) {\n            // brush already exist, clear first\n            this.clearBrush();\n        }\n\n        this.brushStartXCoord = xCoord;\n        this.brushStartXDate = this.getDateFromCoord(xCoord);\n        this.addZoomBoundaryLine(this.brushStartXDate, this.brushStartXCoord);\n    };\n\n    // event that is triggered when hovering over chart\n    private onBrushMove = (xCoord: number) => {\n        if (isUndefined(this.brushStartXCoord)) {\n            return;\n        }\n\n        if (isUndefined(this.brushEndXCoord)) {\n            const selection = [this.brushStartXCoord, xCoord].sort(\n                (a, b) => a - b\n            );\n            this.brush.move(this.brushElement, selection as BrushSelection);\n        }\n\n        // if the zoom brush is displayed, shows and hides the popover when hovering over zoom area\n        if (\n            !isUndefined(this.brushStartXCoord) &&\n            !isUndefined(this.brushEndXCoord)\n        ) {\n            if (\n                xCoord >= this.brushStartXCoord &&\n                xCoord <= this.brushEndXCoord\n            ) {\n                this.showPopover();\n            } else {\n                this.closePopover();\n            }\n        }\n    };\n\n    private onBrushEnd = (xCoord: number) => {\n        if (isUndefined(this.brushStartXCoord)) {\n            return;\n        }\n\n        const date = this.getDateFromCoord(xCoord);\n        this.addZoomBoundaryLine(date, xCoord);\n\n        if (this.brushStartXCoord > xCoord) {\n            // updates position incase dragging from right to left\n            this.brushEndXCoord = this.brushStartXCoord;\n            this.brushStartXCoord = xCoord;\n\n            this.brushEndXDate = this.brushStartXDate;\n            this.brushStartXDate = date;\n        } else {\n            this.brushEndXCoord = xCoord;\n            this.brushEndXDate = date;\n        }\n\n        if (this.isChartHoverd) {\n            this.zoomCreatedSubject.next();\n        }\n    };\n\n    // simulates creating brash with mouse dragging\n    private createBrushWithoutDrag(startX: number, endX: number): void {\n        this.brushStartXCoord = startX;\n        this.brushEndXCoord = endX;\n        this.brushStartXDate = this.getDateFromCoord(startX);\n        this.brushEndXDate = this.getDateFromCoord(endX);\n\n        this.brush.move(this.brushElement, [startX, endX]);\n        this.addZoomBoundaryLine(this.brushStartXDate, this.brushStartXCoord);\n        this.addZoomBoundaryLine(this.brushEndXDate, this.brushEndXCoord);\n    }\n\n    private moveBrush(\n        startDate: moment.Moment,\n        endDate: moment.Moment,\n        startXCoord: number,\n        endXCoord: number\n    ): void {\n        const nodes = this.zoomLineLayer\n            .selectAll(\".\" + TimeseriesZoomPlugin.LAYER_NAME)\n            .nodes() as Element[];\n        if (nodes.length !== 2) {\n            return;\n        }\n\n        // moves boundary lines\n        nodes[0].setAttribute(\"x1\", startXCoord.toString());\n        nodes[0].setAttribute(\"x2\", startXCoord.toString());\n        nodes[1].setAttribute(\"x1\", endXCoord.toString());\n        nodes[1].setAttribute(\"x2\", endXCoord.toString());\n\n        // moves brush\n        this.brush.move(this.brushElement, [\n            startXCoord,\n            endXCoord,\n        ] as BrushSelection);\n\n        this.brushStartXCoord = startXCoord;\n        this.brushStartXDate = startDate;\n        this.brushEndXCoord = endXCoord;\n        this.brushEndXDate = endDate;\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { Injectable } from \"@angular/core\";\nimport moment from \"moment/moment\";\n\nimport { TimeseriesZoomPlugin } from \"./timeseries-zoom-plugin\";\n\n@Injectable({ providedIn: \"root\" })\nexport class TimeseriesZoomPluginsSyncService {\n    private collections: { [key: string]: TimeseriesZoomPlugin[] } = {};\n\n    public registerPlugin(\n        collectionId: string,\n        plugin: TimeseriesZoomPlugin\n    ): void {\n        const collection = this.collections[collectionId];\n\n        if (!collection) {\n            this.collections[collectionId] = [plugin];\n        } else {\n            this.collections[collectionId].push(plugin);\n        }\n    }\n\n    public getPlugins(collectionId: string): TimeseriesZoomPlugin[] {\n        return this.collections[collectionId] ?? [];\n    }\n\n    public removePlugin(\n        collectionId: string,\n        plugin: TimeseriesZoomPlugin\n    ): void {\n        if (!this.collections[collectionId]) {\n            return;\n        }\n\n        const collection = [...this.collections[collectionId]];\n        const idx = collection.findIndex((p) => p === plugin);\n        if (idx === -1) {\n            return;\n        }\n\n        collection.splice(idx, 1);\n        this.collections[collectionId] = collection;\n    }\n\n    public syncPositionInsideCollection(\n        collectionId: string,\n        startDate: moment.Moment,\n        endDate: moment.Moment\n    ): void {\n        const collection = this.getPlugins(collectionId);\n\n        setTimeout(() => {\n            collection.forEach((plugin) => {\n                plugin.moveBrushByDate(startDate, endDate);\n            });\n        });\n    }\n\n    public clearZoomInsideCollection(collectionId: string): void {\n        const collection = this.getPlugins(collectionId);\n\n        collection.forEach((plugin) => {\n            plugin.clearBrush();\n        });\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nexport * from \"./chart-donut-content-plugin\";\nexport * from \"./chart-popover-plugin\";\nexport * from \"./gauge/public-api\";\nexport * from \"./interaction/public-api\";\nexport * from \"./mouse-interactive-area-plugin\";\nexport * from \"./radial-popover-plugin\";\nexport * from \"./render-engine-plugin\";\nexport * from \"./tooltips\";\nexport * from \"./types\";\nexport * from \"./zoom-plugin\";\nexport * from \"./timeseries-zoom-plugin\";\nexport * from \"./timeseries-zoom-plugin-sync.service\";\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport cloneDeep from \"lodash/cloneDeep\";\n\nimport {\n    INTERACTION_DATA_POINTS_EVENT,\n    MOUSE_ACTIVE_EVENT,\n} from \"../../constants\";\nimport { XYGridConfig } from \"../../core/grid/config/xy-grid-config\";\nimport { RenderState } from \"../../renderers/types\";\nimport { Chart } from \"../chart\";\nimport { ChartAssist } from \"./chart-assist\";\nimport { IChartAssist, ISpark } from \"./types\";\nimport { EventBus } from \"../common/event-bus\";\nimport { ChartPalette } from \"../common/palette/chart-palette\";\nimport { CHART_MARKERS, CHART_PALETTE_CS1 } from \"../common/palette/palettes\";\nimport { SequentialChartMarkerProvider } from \"../common/palette/sequential-chart-marker-provider\";\nimport {\n    IAccessors,\n    IChartAssistSeries,\n    IChartEvent,\n    IChartMarker,\n    IChartPalette,\n    IChartSeries,\n    IDataPointsPayload,\n    InteractionType,\n    IValueProvider,\n} from \"../common/types\";\nimport { UtilityService } from \"../common/utility.service\";\nimport { sparkChartGridConfig } from \"../grid/config/spark-chart-grid-config\";\nimport { XYGrid } from \"../grid/xy-grid\";\nimport { InteractionLabelPlugin } from \"../plugins/interaction/interaction-label-plugin\";\nimport { InteractionLinePlugin } from \"../plugins/interaction/interaction-line-plugin\";\n\n/**\n * Chart assist implementation to be used with spark charts\n */\nexport class SparkChartAssist implements IChartAssist {\n    /** Collection of ISpark objects */\n    public sparks: ISpark<IAccessors>[] = [];\n    /** Used for keeping tabs on the legend's active state */\n    public isLegendActive = false;\n    /** Grid config for all sparks except the last (bottom) one */\n    public readonly gridConfig: XYGridConfig;\n    /** Grid config for the last (bottom) spark */\n    public readonly lastGridConfig: XYGridConfig;\n\n    public highlightedDataPoints: IDataPointsPayload = {};\n\n    constructor(\n        public readonly showBottomAxis = true,\n        public readonly showTopBorder = true,\n        public palette: IChartPalette = new ChartPalette(CHART_PALETTE_CS1),\n        public markers: IValueProvider<IChartMarker> = new SequentialChartMarkerProvider(\n            CHART_MARKERS\n        )\n    ) {\n        this.gridConfig = sparkChartGridConfig(\n            new XYGridConfig(),\n            false,\n            showTopBorder\n        );\n        this.gridConfig.interactionPlugins = false;\n\n        this.lastGridConfig = sparkChartGridConfig(\n            new XYGridConfig(),\n            showBottomAxis,\n            showTopBorder\n        );\n        this.lastGridConfig.interactionPlugins = false;\n    }\n\n    /**\n     * Use this method to update the set of sparks if they all consist of only one series.\n     * If one or more sparks has multiple series use the updateSparks method instead.\n     *\n     * See {@link IChartAssist#update}\n     */\n    public update(inputSeriesSet: IChartAssistSeries<IAccessors>[]): void {\n        const sparks = inputSeriesSet.map((chartSeries) => ({\n            id: chartSeries.id,\n            chartSeriesSet: [chartSeries],\n        }));\n        this.updateSparks(sparks);\n    }\n\n    /**\n     * Use this method to update the set of sparks if any of them consist of more than one series.\n     *\n     * @param {ISpark<IAccessors>[]} sparks The collection of sparks to update\n     */\n    public updateSparks(sparks: ISpark<IAccessors>[]): void {\n        const inputSparks = cloneDeep(sparks);\n        this.sparks = inputSparks.map((spark, index): ISpark<IAccessors> => {\n            const lastSpark = index === inputSparks.length - 1;\n            const existingSparkIndex = spark.id\n                ? this.sparks.findIndex(\n                      (existingSpark) => existingSpark.id === spark.id\n                  )\n                : -1;\n            if (existingSparkIndex !== -1) {\n                spark.chart = this.reconfigureChart(\n                    this.sparks[existingSparkIndex].chart as Chart,\n                    lastSpark\n                );\n            } else {\n                spark.chart = spark.chart || this.createChart(lastSpark);\n                spark.id = spark.id || UtilityService.uuid();\n            }\n\n            spark.chart.update(spark.chartSeriesSet);\n\n            return spark;\n        });\n    }\n\n    /** See {@link IChartAssist#getHighlightedValue} */\n    public getHighlightedValue(\n        chartSeries: IChartSeries<IAccessors>,\n        scaleKey: string,\n        formatterName?: string\n    ): string | number {\n        return ChartAssist.getLabel(\n            chartSeries,\n            this.highlightedDataPoints[chartSeries.id],\n            scaleKey,\n            formatterName\n        );\n    }\n\n    /**\n     * To use the for-cycle trackBy, set the id value on each spark\n     * and assign this function to the ngFor trackBy property\n     */\n    public trackByFn(\n        _index: number,\n        spark: ISpark<IAccessors>\n    ): string | undefined {\n        return spark?.id;\n    }\n\n    public setRenderState(_seriesId: string, _state: RenderState): void {\n        // not used\n    }\n\n    public getVisibleSeriesWithLegend(): IChartAssistSeries<IAccessors>[] {\n        return [];\n    }\n\n    protected createChart(lastSpark: boolean): Chart {\n        const grid = new XYGrid(\n            lastSpark ? this.lastGridConfig : this.gridConfig\n        );\n        const chart = new Chart(grid);\n\n        if (this.showTopBorder || this.showBottomAxis) {\n            chart.addPlugin(new InteractionLinePlugin());\n        }\n        if (lastSpark && this.showBottomAxis) {\n            chart.addPlugin(new InteractionLabelPlugin());\n        }\n\n        this.configureEventSubscriptions(chart.getEventBus());\n\n        return chart;\n    }\n\n    private configureEventSubscriptions(eventBus: EventBus<IChartEvent>): void {\n        eventBus.getStream(INTERACTION_DATA_POINTS_EVENT).subscribe((event) => {\n            if (event.data.interactionType === InteractionType.MouseMove) {\n                const dataPoints = <IDataPointsPayload>event.data.dataPoints;\n                Object.keys(dataPoints).forEach((seriesId) => {\n                    this.highlightedDataPoints[seriesId] = Object.assign(\n                        {},\n                        dataPoints[seriesId]\n                    );\n                });\n            }\n        });\n        eventBus.getStream(MOUSE_ACTIVE_EVENT).subscribe((event) => {\n            this.isLegendActive = event.data;\n        });\n    }\n\n    private reconfigureChart(chart: Chart, lastSpark: boolean): Chart {\n        chart\n            .getGrid()\n            .config(lastSpark ? this.lastGridConfig : this.gridConfig);\n        chart.updateDimensions();\n\n        const hasInteractionLabel = chart.hasPlugin(InteractionLabelPlugin);\n        if (lastSpark && !hasInteractionLabel && this.showBottomAxis) {\n            const labelPlugin = new InteractionLabelPlugin();\n            chart.addPlugin(labelPlugin);\n            labelPlugin.initialize();\n        } else if (!lastSpark && hasInteractionLabel) {\n            chart.removePlugin(InteractionLabelPlugin);\n        }\n\n        return chart;\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nexport * from \"./chart-assist\";\nexport * from \"./spark-chart-assist\";\nexport * from \"./types\";\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nexport * from \"./common/public-api\";\nexport * from \"./grid/public-api\";\nexport * from \"./plugins/public-api\";\n\nexport * from \"./chart-collection\";\nexport * from \"./chart\";\n\nexport * from \"./chart-assists/public-api\";\nexport * from \"./types\";\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nexport * from \"./basic-legend-tile/basic-legend-tile.component\";\nexport * from \"./rich-legend-tile/rich-legend-tile.component\";\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nexport * from \"./legend-series/legend-series.component\";\nexport * from \"./legend-tile/public-api\";\nexport * from \"./legend.component\";\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { IAccessors } from \"../../core/common/types\";\n\nexport interface INoopAccessors extends IAccessors {\n    data: any;\n    /** Series level accessors - e.g. for colors, markers, etc. */\n    series: any;\n}\n\nexport class NoopAccessors implements INoopAccessors {\n    public series: any;\n    public data: any;\n\n    constructor() {\n        this.series = undefined;\n        this.data = undefined;\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nexport * from \"./xy-accessors\";\nexport * from \"./noop-accessors\";\nexport * from \"./rectangle-accessors\";\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { Subject } from \"rxjs\";\n\nimport { INoopAccessors } from \"./accessors/noop-accessors\";\nimport { IRenderSeries } from \"./types\";\nimport { Renderer } from \"../core/common/renderer\";\nimport { Scales } from \"../core/common/scales/types\";\nimport {\n    IDataSeries,\n    ILasagnaLayer,\n    IPosition,\n    IRendererEventPayload,\n} from \"../core/common/types\";\n\n/**\n * Renderer that is able to draw line chart\n */\nexport class NoopRenderer extends Renderer<INoopAccessors> {\n    /** See {@link Renderer#draw} */\n    public draw(\n        renderSeries: IRenderSeries<INoopAccessors>,\n        rendererSubject: Subject<IRendererEventPayload>\n    ): void {}\n\n    /** See {@link Renderer#highlightDataPoint} */\n    public highlightDataPoint(\n        renderSeries: IRenderSeries<INoopAccessors>,\n        dataPointIndex: number,\n        rendererSubject: Subject<IRendererEventPayload>\n    ): void {}\n\n    /** See {@link Renderer#getRequiredLayers} */\n    public getRequiredLayers(): ILasagnaLayer[] {\n        return [];\n    }\n\n    /** See {@link Renderer#getDataPointPosition} */\n    public getDataPointPosition(\n        dataSeries: IDataSeries<INoopAccessors>,\n        index: number,\n        scales: Scales\n    ): IPosition {\n        // @ts-ignore\n        return;\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { IBarChartConfig } from \"./types\";\nimport { BarGridConfig } from \"../../core/grid/config/bar-grid-config\";\nimport { BarHorizontalGridConfig } from \"../../core/grid/config/bar-horizontal-grid-config\";\nimport { XYGrid } from \"../../core/grid/xy-grid\";\n\n/**\n * Creates an {@link XYGrid} with predefined {@link BarGridConfig} or\n * {@link BarHorizontalGridConfig} using {@link IBarChartConfig#horizontal} horizontal property. Default orientation is **vertical**.\n *\n * @param {IBarChartConfig} [config] bar chart configuration for orientation definition.\n * @returns {XYGrid}\n */\nexport function barGrid(config?: IBarChartConfig): XYGrid {\n    const grid = new XYGrid();\n\n    grid.config(\n        config && config.horizontal\n            ? new BarHorizontalGridConfig()\n            : new BarGridConfig()\n    );\n\n    return grid;\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\n/**\n * Configuration for bar charts\n *\n * @interface IBarChartConfig\n */\nexport interface IBarChartConfig {\n    horizontal?: boolean;\n    grouped?: boolean;\n}\n\nexport interface IStackMetadata {\n    start: number;\n    end: number;\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { IChartMarker, IValueProvider } from \"../../../core/common/types\";\nimport { IBarChartConfig } from \"../types\";\nimport { IBarAccessors } from \"./bar-accessors\";\nimport { HorizontalBarAccessors } from \"./horizontal-bar-accessors\";\nimport { VerticalBarAccessors } from \"./vertical-bar-accessors\";\n\n/**\n * Creates {@link VerticalBarAccessors} or {@link VerticalBarAccessors}\n * using {@link IBarChartConfig#horizontal} horizontal property. Default orientation is **vertical**.\n *\n * @param {IBarChartConfig} [config]\n * @param {IValueProvider<string>} [colorProvider]\n * @param {IValueProvider<IChartMarker>} [markerProvider]\n * @returns {IBarAccessors}\n */\nexport function barAccessors(\n    config?: IBarChartConfig,\n    colorProvider?: IValueProvider<string>,\n    markerProvider?: IValueProvider<IChartMarker>\n): IBarAccessors {\n    return config && config.horizontal\n        ? new HorizontalBarAccessors(colorProvider, markerProvider)\n        : new VerticalBarAccessors(colorProvider, markerProvider);\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nexport * from \"./bar-accessors\";\nexport * from \"./bar-accessors-fn\";\nexport * from \"./horizontal-bar-accessors\";\nexport * from \"./vertical-bar-accessors\";\nexport * from \"./status-accessors\";\nexport * from \"./status-accessors-fn\";\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { select } from \"d3-selection\";\nimport findIndex from \"lodash/findIndex\";\nimport isArray from \"lodash/isArray\";\nimport isUndefined from \"lodash/isUndefined\";\nimport { Subject } from \"rxjs\";\n\nimport {\n    DATA_POINT_INTERACTION_RESET,\n    DATA_POINT_NOT_FOUND,\n} from \"../../../constants\";\nimport {\n    isBandScale,\n    IXYScales,\n    Scales,\n} from \"../../../core/common/scales/types\";\nimport { IDataSeries, IRendererEventPayload } from \"../../../core/common/types\";\nimport { UtilityService } from \"../../../core/common/utility.service\";\nimport { IRectangleAccessors } from \"../../accessors/rectangle-accessors\";\nimport {\n    IHighlightStrategy,\n    IRenderSeries,\n    RenderLayerName,\n    RenderState,\n} from \"../../types\";\nimport { BarRenderer } from \"../bar-renderer\";\n\nexport type SelectedDatPointIdxFn = (seriesId: string) => number;\n\nexport class BarHighlightStrategy\n    implements IHighlightStrategy<IRectangleAccessors, BarRenderer>\n{\n    /**\n     * @param scaleKey scale that will be used for searching for the data point that will be highlighted\n     * @param levels for band scales, how many levels deep do we go to compare values\n     */\n    constructor(\n        protected scaleKey: keyof IXYScales,\n        protected levels = 1,\n        protected selectedDataPointIdxFn?: SelectedDatPointIdxFn\n    ) {}\n\n    public getDataPointIndex(\n        renderer: BarRenderer,\n        series: IDataSeries<IRectangleAccessors>,\n        values: { [p: string]: any },\n        scales: Scales\n    ): number {\n        const value = values[this.scaleKey];\n        if (typeof value === \"undefined\") {\n            // if there is no value we're returning -2 (DATA_POINT_INTERACTION_RESET) which helps highlightDataPoint\n            // to understand that we need to emphasise things when we are moving outside of an interactive area\n            return DATA_POINT_INTERACTION_RESET;\n        }\n\n        return this.findDataPointByValue(series, value, this.scaleKey, scales);\n    }\n\n    public findDataPointByValue(\n        series: IDataSeries<IRectangleAccessors>,\n        value: any,\n        scaleKey: keyof IXYScales,\n        scales?: Scales\n    ): number {\n        const accessorSuffix = (scaleKey as string).toUpperCase();\n        const dataAccessors = series.accessors.data;\n\n        const startAccessor = dataAccessors[\"start\" + accessorSuffix];\n        const endAccessor = dataAccessors[\"end\" + accessorSuffix];\n\n        if (typeof value === \"string\") {\n            return findIndex(\n                series.data,\n                (d, i) => value === startAccessor?.(d, i, series.data, series)\n            );\n        }\n        if (isArray(value)) {\n            return findIndex(series.data, (d, i) => {\n                const start = startAccessor?.(d, i, series.data, series);\n                const lengthLimit = Math.min(\n                    this.levels,\n                    value.length,\n                    start.length\n                );\n                // diy efficient array comparison\n                for (let j = 0; j < lengthLimit; j++) {\n                    if (value[j] !== start[j]) {\n                        return false;\n                    }\n                }\n                return true;\n            });\n        }\n        if (value.valueOf) {\n            const valueOf = value.valueOf();\n            if (scales && scales[scaleKey]?.isContinuous()) {\n                let index = findIndex(\n                    series.data,\n                    (d, i) =>\n                        valueOf >=\n                            startAccessor?.(\n                                d,\n                                i,\n                                series.data,\n                                series\n                            ).valueOf() &&\n                        valueOf <=\n                            endAccessor?.(d, i, series.data, series).valueOf()\n                );\n                if (index === -1 && typeof endAccessor !== \"undefined\") {\n                    if (isBandScale(scales[scaleKey])) {\n                        const accessor = (d: any, i: any) =>\n                            startAccessor?.(d, i, series.data, series);\n                        const nearestIndex = UtilityService.findNearestIndex(\n                            series.data,\n                            value,\n                            accessor\n                        );\n                        index =\n                            nearestIndex >= series.data.length ||\n                            accessor(series.data[nearestIndex], nearestIndex) >\n                                valueOf\n                                ? -1\n                                : nearestIndex;\n                    } else {\n                        // @ts-ignore\n                        // Needs to catch -1 otherwise typescript errors\n                        index =\n                            UtilityService.getClosestIndex(\n                                series.data,\n                                (d, i) =>\n                                    endAccessor(d, i, series.data, series),\n                                value\n                            ) ?? -1;\n                    }\n                }\n                return index;\n            }\n            return findIndex(\n                series.data,\n                (d, i) =>\n                    valueOf >=\n                        startAccessor?.(d, i, series.data, series).valueOf() &&\n                    valueOf <=\n                        endAccessor?.(d, i, series.data, series).valueOf()\n            );\n        }\n\n        return DATA_POINT_INTERACTION_RESET;\n    }\n\n    public highlightDataPoint(\n        renderer: BarRenderer,\n        renderSeries: IRenderSeries<IRectangleAccessors>,\n        dataPointIndex: number,\n        rendererSubject: Subject<IRendererEventPayload>\n    ): void {\n        const target = renderSeries.containers[RenderLayerName.data];\n        const barStylesFn = renderer.getContainerStateStyles;\n        const selectedDataPointIdx = !isUndefined(this.selectedDataPointIdxFn)\n            ? this.selectedDataPointIdxFn(renderSeries.dataSeries.id)\n            : DATA_POINT_NOT_FOUND;\n\n        target\n            .selectAll(`g.${renderer.barContainerClass}`)\n            .each(function (d: any, index: number) {\n                let renderState: RenderState;\n                if (dataPointIndex === DATA_POINT_INTERACTION_RESET) {\n                    if (\n                        index === selectedDataPointIdx ||\n                        selectedDataPointIdx === DATA_POINT_NOT_FOUND\n                    ) {\n                        renderState = RenderState.default;\n                    } else {\n                        renderState = RenderState.deemphasized;\n                    }\n                } else if (\n                    dataPointIndex === index ||\n                    index === selectedDataPointIdx\n                ) {\n                    renderState = RenderState.emphasized;\n                } else {\n                    renderState = RenderState.deemphasized;\n                }\n                select(this).attrs(barStylesFn(renderState));\n            });\n\n        // rendererSubject.next({\n        //     eventName: HIGHLIGHT_SERIES_EVENT,\n        //     data: renderer.getDataPoint(renderSeries, renderSeries.dataSeries.data[dataPointIndex], dataPointIndex),\n        // });\n    }\n\n    public draw(\n        renderer: BarRenderer,\n        renderSeries: IRenderSeries<IRectangleAccessors>,\n        rendererSubject: Subject<IRendererEventPayload>\n    ): void {}\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { select } from \"d3-selection\";\nimport isUndefined from \"lodash/isUndefined\";\n\nimport { DATA_POINT_NOT_FOUND } from \"../../../constants\";\nimport { IXYScales } from \"../../../core/common/scales/types\";\nimport { D3Selection } from \"../../../core/common/types\";\nimport { IRectangleAccessors } from \"../../accessors/rectangle-accessors\";\nimport { IRenderSeries, RenderLayerName } from \"../../types\";\nimport { BarRenderer } from \"../bar-renderer\";\nimport {\n    BarHighlightStrategy,\n    SelectedDatPointIdxFn,\n} from \"./bar-highlight-strategy\";\n\n// creates an outline element that is used to highlight hovered parts of the chart\nexport class BarHighlightStrategyOutline extends BarHighlightStrategy {\n    private outlineAdd = 6;\n    private outlineElsMap = new Map<string, D3Selection<SVGRectElement>>();\n\n    /**\n     * @param scaleKey scale that will be used for searching for the data point that will be highlighted\n     * @param levels for band scales, how many levels deep do we go to compare values\n     */\n    constructor(\n        scaleKey: keyof IXYScales,\n        levels = 1,\n        selectedDataPointIdxFn?: SelectedDatPointIdxFn\n    ) {\n        super(scaleKey, levels, selectedDataPointIdxFn);\n    }\n\n    public highlightDataPoint(\n        renderer: BarRenderer,\n        renderSeries: IRenderSeries<IRectangleAccessors>,\n        dataPointIndex: number\n    ): void {\n        const target = renderSeries.containers[RenderLayerName.data];\n        const selectedDataPointIdx = !isUndefined(this.selectedDataPointIdxFn)\n            ? this.selectedDataPointIdxFn(renderSeries.dataSeries.id)\n            : DATA_POINT_NOT_FOUND;\n\n        const gNodes = target\n            .selectAll(`g.${renderer.barContainerClass}`)\n            .nodes();\n        const emphasizedNode =\n            gNodes[dataPointIndex] || gNodes[selectedDataPointIdx];\n\n        if (!renderSeries.parentContainer) {\n            return;\n        }\n\n        // needs to replace all '.' from  the serie id as the dot would be treated as a class name in the query selector\n        const outlineRectClass =\n            `${renderer.barContainerClass}-outline-${renderSeries.dataSeries.id}`\n                .split(\".\")\n                .join(\"-\");\n\n        if (!this.outlineElsMap.has(outlineRectClass)) {\n            // creates a rect element that will be used as a outline\n            const rect = renderSeries.parentContainer.append(\"rect\");\n            rect.classed(outlineRectClass, true);\n            this.outlineElsMap.set(outlineRectClass, rect);\n        }\n\n        const outlineRect = this.outlineElsMap.get(outlineRectClass);\n\n        const emphasizedDataValue =\n            renderSeries.dataSeries.data[dataPointIndex]?.y ||\n            renderSeries.dataSeries.data[dataPointIndex]?.value;\n\n        if (emphasizedDataValue && emphasizedNode && outlineRect) {\n            // position the outline element on the position of the emphasized element and updates its attributes\n            const emphasizedRect = select(emphasizedNode).select(\"rect\");\n\n            const x =\n                parseFloat(emphasizedRect.attr(\"x\")) - this.outlineAdd / 2;\n            const y =\n                parseFloat(emphasizedRect.attr(\"y\")) - this.outlineAdd / 2;\n            const width =\n                parseFloat(emphasizedRect.attr(\"width\")) + this.outlineAdd;\n            const height =\n                parseFloat(emphasizedRect.attr(\"height\")) + this.outlineAdd;\n\n            outlineRect.attr(\"x\", x);\n            outlineRect.attr(\"y\", y);\n            outlineRect.attr(\"width\", width);\n            outlineRect.attr(\"height\", height);\n            outlineRect.style(\"fill\", emphasizedRect.style(\"fill\"));\n            outlineRect.style(\"display\", \"inline\");\n        }\n\n        if (\n            (outlineRect && !emphasizedDataValue) ||\n            (outlineRect && !emphasizedNode)\n        ) {\n            // hides outline element when there is no emphasized element\n            outlineRect.style(\"display\", \"none\");\n        }\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport findIndex from \"lodash/findIndex\";\nimport isArray from \"lodash/isArray\";\nimport { Subject } from \"rxjs\";\n\nimport {\n    DATA_POINT_INTERACTION_RESET,\n    HIGHLIGHT_SERIES_EVENT,\n} from \"../../../constants\";\nimport { IXYScales, Scales } from \"../../../core/common/scales/types\";\nimport { IDataSeries, IRendererEventPayload } from \"../../../core/common/types\";\nimport { IRectangleAccessors } from \"../../accessors/rectangle-accessors\";\nimport { IHighlightStrategy, IRenderSeries } from \"../../types\";\nimport { BarRenderer } from \"../bar-renderer\";\n\nexport class BarSeriesHighlightStrategy\n    implements IHighlightStrategy<IRectangleAccessors, BarRenderer>\n{\n    /**\n     * @param scaleKey scale that will be used for searching for the datapoint that will be highlighted\n     * @param levels for band scales, how many levels deep do we go to compare values\n     */\n    constructor(private scaleKey: keyof IXYScales, private levels = 1) {}\n\n    public getDataPointIndex(\n        renderer: BarRenderer,\n        series: IDataSeries<IRectangleAccessors>,\n        values: { [p: string]: any },\n        scales: Scales\n    ): number {\n        const value = values[this.scaleKey];\n        if (typeof value === \"undefined\") {\n            // if there is no value we're returning -2 (DATA_POINT_INTERACTION_RESET) which helps highlightDataPoint\n            // to understand that we need to emphasise things when we are moving outside of an interactive area\n            return DATA_POINT_INTERACTION_RESET;\n        }\n\n        return this.findDataPointByValue(series, value, this.scaleKey);\n    }\n\n    public findDataPointByValue(\n        series: IDataSeries<IRectangleAccessors>,\n        value: any,\n        scaleKey: keyof IXYScales\n    ): number {\n        const accessorSuffix = (scaleKey as string).toUpperCase();\n        const dataAccessors = series.accessors.data;\n\n        const startAccessor = dataAccessors[\"start\" + accessorSuffix];\n        const endAccessor = dataAccessors[\"end\" + accessorSuffix];\n\n        if (typeof value === \"string\") {\n            return findIndex(\n                series.data,\n                (d, i) => value === startAccessor?.(d, i, series.data, series)\n            );\n        } else if (isArray(value)) {\n            return findIndex(series.data, (d, i) => {\n                const start = startAccessor?.(d, i, series.data, series);\n                const lengthLimit = Math.min(\n                    this.levels,\n                    value.length,\n                    start.length\n                );\n                // diy efficient array comparison\n                for (let j = 0; j < lengthLimit; j++) {\n                    if (value[j] !== start[j]) {\n                        return false;\n                    }\n                }\n                return true;\n            });\n        } else if (value.valueOf) {\n            const valueOf = value.valueOf();\n            return findIndex(\n                series.data,\n                (d, i) =>\n                    valueOf >=\n                        startAccessor?.(d, i, series.data, series).valueOf() &&\n                    valueOf <=\n                        endAccessor?.(d, i, series.data, series).valueOf()\n            );\n        }\n\n        return DATA_POINT_INTERACTION_RESET;\n    }\n\n    public highlightDataPoint(\n        renderer: BarRenderer,\n        renderSeries: IRenderSeries<IRectangleAccessors>,\n        dataPointIndex: number,\n        rendererSubject: Subject<IRendererEventPayload>\n    ): void {\n        if (\n            dataPointIndex >= 0 ||\n            dataPointIndex === DATA_POINT_INTERACTION_RESET\n        ) {\n            rendererSubject.next({\n                eventName: HIGHLIGHT_SERIES_EVENT,\n                data: renderer.getDataPoint(\n                    renderSeries,\n                    renderSeries.dataSeries.data[dataPointIndex],\n                    dataPointIndex\n                ),\n            });\n        }\n    }\n\n    public draw(\n        renderer: BarRenderer,\n        renderSeries: IRenderSeries<IRectangleAccessors>,\n        rendererSubject: Subject<IRendererEventPayload>\n    ): void {}\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nexport * from \"./bar-highlight-strategy\";\nexport * from \"./bar-highlight-strategy-outline\";\nexport * from \"./bar-series-highlight-strategy\";\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nexport * from \"./bar-renderer\";\nexport * from \"./stacked-preprocessor\";\nexport * from \"./bar-grid\";\nexport * from \"./bar-scales\";\nexport * from \"./types\";\nexport * from \"./accessors/public-api\";\nexport * from \"./highlight-strategies/public-api\";\nexport * from \"./linear-gauge-thresholds-renderer\";\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { Arc, DefaultArcObject } from \"d3-shape\";\n\nimport { RadialRenderer } from \"./radial-renderer\";\n\n/**\n * Renderer that is able to draw pie chart\n */\nexport class PieRenderer extends RadialRenderer {\n    protected getArc(\n        range: [number, number],\n        arc: Arc<any, DefaultArcObject>,\n        index: number\n    ): Arc<any, DefaultArcObject> {\n        return arc.outerRadius(range[1] - range[0]).innerRadius(0);\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nexport * from \"./radial-preprocessor\";\nexport * from \"./radial-renderer\";\nexport * from \"./gauge/donut-gauge-thresholds-renderer\";\nexport * from \"./gauge/donut-gauge-renderer-config\";\nexport * from \"./gauge/donut-gauge-rendering-util\";\nexport * from \"./pie-renderer\";\nexport * from \"./radial-grid-fn\";\nexport * from \"./radial-scales\";\nexport * from \"./accessors/radial-accessors\";\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { Duration } from \"moment/moment\";\n\nimport { TimeIntervalScale } from \"../../core/common/scales/time-interval-scale\";\nimport { IAccessors, IDataSeries } from \"../../core/common/types\";\n\n/**\n * This function adds data points indicating that there is an interruption in the data.\n *\n * @param dataSeries\n * @param accessorKey\n * @param interval\n */\nexport function calculateMissingData(\n    dataSeries: IDataSeries<IAccessors>,\n    accessorKey: string,\n    interval: Duration\n): any[] {\n    const dataAccessors = dataSeries.accessors.data;\n    const data = dataSeries.data;\n    const accessor = dataAccessors?.[accessorKey];\n    if (!accessor) {\n        throw new Error(\"Accessor \" + accessorKey + \" not defined!\");\n    }\n    const minValue = accessor(data[0], 0, data, dataSeries);\n    const maxValue = accessor(\n        data[data.length - 1],\n        data.length - 1,\n        data,\n        dataSeries\n    );\n    if (!minValue || !maxValue) {\n        throw new Error(\"First or last values not defined!\");\n    }\n\n    const scale = new TimeIntervalScale(interval);\n    scale.domain([\n        // @ts-ignore\n        scale.truncToInterval(minValue, scale.interval()),\n        // @ts-ignore\n        scale.truncToInterval(maxValue, scale.interval()),\n    ]);\n    const bands = scale.getBands();\n\n    const newData: any[] = [];\n    let b = 0; // band iterator index\n    for (let i = 0; i < data.length; i++) {\n        const value = accessor(data[i], i, data, dataSeries);\n        const truncD = scale.truncToInterval(value, scale.interval());\n        // if current data point value skipped a band, we'll insert missing data points and iterate bands to catch up\n        if (truncD && truncD > bands[b]) {\n            newData.push({ ...data[i - 1], defined: false });\n            newData.push({ ...data[i], defined: false });\n            while (bands[b] < value) {\n                b++;\n            }\n        }\n        newData.push(data[i]);\n        b++;\n    }\n\n    return newData;\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport isNil from \"lodash/isNil\";\nimport { Subject } from \"rxjs\";\n\nimport {\n    DATA_POINT_NOT_FOUND,\n    HIGHLIGHT_SERIES_EVENT,\n    INTERACTION_SERIES_EVENT,\n} from \"../../../constants\";\nimport { Scales } from \"../../../core/common/scales/types\";\nimport {\n    D3Selection,\n    IDataPoint,\n    IDataSeries,\n    InteractionType,\n    IRendererEventPayload,\n} from \"../../../core/common/types\";\nimport {\n    IHighlightStrategy,\n    IRenderSeries,\n    RenderLayerName,\n} from \"../../types\";\nimport { ILineAccessors } from \"../line-accessors\";\nimport { LineRenderer } from \"../line-renderer\";\n\nexport class LineSelectSeriesInteractionStrategy\n    implements IHighlightStrategy<ILineAccessors, LineRenderer>\n{\n    public readonly INTERACTION_MARGIN = 8;\n\n    public draw(\n        renderer: LineRenderer,\n        renderSeries: IRenderSeries<ILineAccessors>,\n        rendererSubject: Subject<IRendererEventPayload>\n    ): void {\n        const target = renderSeries.containers[RenderLayerName.data];\n\n        let interactionPath: D3Selection<SVGPathElement> =\n            target.select(\"path.interaction\");\n\n        if (isNil(renderer.config.strokeWidth)) {\n            throw new Error(\"renderer.config.strokeWidth is not defined\");\n        }\n\n        if (interactionPath.empty()) {\n            interactionPath = target\n                .append(\"path\")\n                .classed(\"interaction\", true)\n                .classed(`pointer-events pointer-events-click`, true)\n                .attrs({\n                    \"stroke-width\":\n                        renderer.config.strokeWidth +\n                        2 * this.INTERACTION_MARGIN,\n                    stroke: \"transparent\",\n                    fill: \"none\",\n                })\n                .on(\"mouseenter\", () => {\n                    const dataPoint: Omit<IDataPoint, \"position\"> = {\n                        seriesId: renderSeries.dataSeries.id,\n                        dataSeries: renderSeries.dataSeries,\n                        // TODO: doesn't work with empty data\n                        index: 0,\n                        data: renderSeries.dataSeries.data[0],\n                    };\n\n                    rendererSubject.next({\n                        eventName: HIGHLIGHT_SERIES_EVENT,\n                        data: dataPoint,\n                    });\n                })\n                .on(\"mouseleave\", () => {\n                    const dataPoint: Omit<IDataPoint, \"position\" | \"data\"> = {\n                        seriesId: renderSeries.dataSeries.id,\n                        dataSeries: renderSeries.dataSeries,\n                        index: DATA_POINT_NOT_FOUND,\n                    };\n\n                    rendererSubject.next({\n                        eventName: HIGHLIGHT_SERIES_EVENT,\n                        data: dataPoint,\n                    });\n                })\n                .on(\"click\", (d: any, i: number) => {\n                    this.emitEvent(\n                        renderer,\n                        INTERACTION_SERIES_EVENT,\n                        InteractionType.Click,\n                        renderSeries,\n                        d,\n                        i,\n                        rendererSubject\n                    );\n                });\n        }\n\n        renderer.drawLine(renderSeries, interactionPath);\n    }\n\n    // TODO: Get rid of this function or make it optional in interface\n    public getDataPointIndex(\n        renderer: LineRenderer,\n        series: IDataSeries<ILineAccessors>,\n        values: { [p: string]: any },\n        scales: Scales\n    ): number {\n        // @ts-ignore\n        return;\n    }\n\n    public highlightDataPoint(\n        renderer: LineRenderer,\n        renderSeries: IRenderSeries<ILineAccessors>,\n        dataPointIndex: number,\n        rendererSubject: Subject<IRendererEventPayload>\n    ): void {}\n\n    private emitEvent(\n        renderer: LineRenderer,\n        eventName: string,\n        interactionType: InteractionType,\n        renderSeries: IRenderSeries<ILineAccessors>,\n        data: any,\n        i: number,\n        rendererSubject: Subject<IRendererEventPayload>\n    ) {\n        const dataPoint: IDataPoint = {\n            seriesId: renderSeries.dataSeries.id,\n            dataSeries: renderSeries.dataSeries,\n            index: i,\n            data: data,\n            position: renderer.getDataPointPosition(\n                renderSeries.dataSeries,\n                i,\n                renderSeries.scales\n            ),\n        };\n        rendererSubject.next({\n            eventName: eventName,\n            data: {\n                interactionType: interactionType,\n                payload: dataPoint,\n            },\n        });\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nexport * from \"./line-select-series-interaction-strategy\";\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { ILineRendererConfig } from \"../types\";\nimport { LineRenderer } from \"./line-renderer\";\n\n/** Standard line renderer config for visualizing missing data */\nexport class MissingDataLineRendererConfig implements ILineRendererConfig {\n    public strokeWidth = 1;\n    public interactive = false;\n    public strokeStyle = LineRenderer.getStrokeStyleDashed(1);\n    public useEnhancedLineCaps = true;\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nexport * from \"./calculate-missing-data\";\nexport * from \"./interaction-strategies/public-api\";\nexport * from \"./line-accessors\";\nexport * from \"./line-renderer\";\nexport * from \"./missing-data-line-renderer-config\";\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { AreaGridConfig } from \"../../core/grid/config/area-grid-config\";\nimport { XYGrid } from \"../../core/grid/xy-grid\";\n\n/**\n * Creates an {@link XYGrid} with predefined {@link AreaGridConfig}\n *\n * @returns {XYGrid}\n */\nexport function areaGrid(): XYGrid {\n    const grid = new XYGrid();\n\n    grid.config(new AreaGridConfig());\n\n    return grid;\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { max, min } from \"d3-array\";\nimport { area, curveLinear } from \"d3-shape\";\nimport defaultsDeep from \"lodash/defaultsDeep\";\nimport { Subject } from \"rxjs\";\n\nimport { STANDARD_RENDER_LAYERS } from \"../../constants\";\nimport {\n    EMPTY_CONTINUOUS_DOMAIN,\n    IScale,\n    IXYScales,\n} from \"../../core/common/scales/types\";\nimport {\n    D3Selection,\n    IDataSeries,\n    ILasagnaLayer,\n    IRendererEventPayload,\n} from \"../../core/common/types\";\nimport { DEFAULT_MARKER_INTERACTION_CONFIG } from \"../constants\";\nimport { MarkerUtils } from \"../marker-utils\";\nimport { IAreaRendererConfig, IRenderSeries, RenderLayerName } from \"../types\";\nimport { XYRenderer } from \"../xy-renderer\";\nimport { IAreaAccessors } from \"./area-accessors\";\n\n/**\n * Renderer that is able to draw line chart\n */\nexport class AreaRenderer extends XYRenderer<IAreaAccessors> {\n    private DEFAULT_CONFIG: IAreaRendererConfig = {\n        curveType: curveLinear,\n        interactive: true,\n        areaClass: \"nui-chart-area\",\n        markerInteraction: DEFAULT_MARKER_INTERACTION_CONFIG,\n    };\n\n    /**\n     * Creates an instance of AreaRenderer.\n     * @param {IAreaRendererConfig} [config={}] Renderer configuration object\n     */\n    constructor(public config: IAreaRendererConfig = {}) {\n        super(config);\n        // setting default values to the properties that were not set by user\n        this.config = defaultsDeep(this.config, this.DEFAULT_CONFIG);\n    }\n\n    /** See {@link Renderer#draw} */\n    public draw(\n        renderSeries: IRenderSeries<IAreaAccessors>,\n        rendererSubject: Subject<IRendererEventPayload>\n    ): void {\n        const target = renderSeries.containers[RenderLayerName.data];\n\n        const accessors = renderSeries.dataSeries.accessors;\n        let path: D3Selection<SVGPathElement> = target.select(\n            `path.${this.config.areaClass}`\n        );\n\n        if (path.empty()) {\n            if (!this.config.areaClass) {\n                throw new Error(\"areaClass is not defined\");\n            }\n            path = target\n                .append(\"path\")\n                .classed(this.config.areaClass, true)\n                .attrs({\n                    fill: accessors.series.color?.(\n                        renderSeries.dataSeries.id,\n                        renderSeries.dataSeries\n                    ),\n                })\n                .style(\"stroke-width\", this.config.strokeWidth ?? 1);\n        }\n        this.drawArea(renderSeries, path);\n    }\n\n    /**\n     * Renders the line in prepared <path> element\n     *\n     * @param {IRenderSeries<IAreaAccessors>} renderSeries\n     * @param {D3Selection} path D3 Selection with <path> element pre-created and pre-styled\n     */\n    public drawArea(\n        renderSeries: IRenderSeries<IAreaAccessors>,\n        path: D3Selection<SVGPathElement>\n    ): void {\n        const dataSeries = renderSeries.dataSeries;\n        const accessors = dataSeries.accessors;\n\n        let warned = false;\n        const validatedData = dataSeries.data.filter((d, i) => {\n            const valid =\n                typeof accessors.data.absoluteX0?.(\n                    d,\n                    i,\n                    dataSeries.data,\n                    dataSeries\n                ) !== \"undefined\" &&\n                typeof accessors.data.absoluteX1?.(\n                    d,\n                    i,\n                    dataSeries.data,\n                    dataSeries\n                ) !== \"undefined\" &&\n                typeof accessors.data.absoluteY0?.(\n                    d,\n                    i,\n                    dataSeries.data,\n                    dataSeries\n                ) !== \"undefined\" &&\n                typeof accessors.data.absoluteY1?.(\n                    d,\n                    i,\n                    dataSeries.data,\n                    dataSeries\n                ) !== \"undefined\";\n            if (!valid && !warned) {\n                console.warn(\n                    \"Data point\",\n                    d,\n                    \"was skipped as accessors didn't manage to extract any data.\"\n                );\n                console.warn(\" -> accessors.data.x0:\", accessors.data.x0);\n                console.warn(\" -> accessors.data.y0:\", accessors.data.y0);\n                console.warn(\" -> accessors.data.x1:\", accessors.data.x1);\n                console.warn(\" -> accessors.data.y1:\", accessors.data.y1);\n                warned = true;\n            }\n            return valid;\n        });\n\n        if (!this.config.curveType) {\n            throw new Error(\"curveType is not defined\");\n        }\n\n        const areaFunc = area()\n            .x0((d: any, i: number) =>\n                this.safetyCheck(\n                    renderSeries.scales.x.convert(\n                        accessors.data.absoluteX0?.(\n                            d,\n                            i,\n                            dataSeries.data,\n                            dataSeries\n                        )\n                    )\n                )\n            )\n            .x1((d: any, i: number) =>\n                this.safetyCheck(\n                    renderSeries.scales.x.convert(\n                        accessors.data.absoluteX1?.(\n                            d,\n                            i,\n                            dataSeries.data,\n                            dataSeries\n                        )\n                    )\n                )\n            )\n            .y0((d: any, i: number) =>\n                this.safetyCheck(\n                    renderSeries.scales.y.convert(\n                        accessors.data.absoluteY0?.(\n                            d,\n                            i,\n                            dataSeries.data,\n                            dataSeries\n                        )\n                    )\n                )\n            )\n            .y1((d: any, i: number) =>\n                this.safetyCheck(\n                    renderSeries.scales.y.convert(\n                        accessors.data.absoluteY1?.(\n                            d,\n                            i,\n                            dataSeries.data,\n                            dataSeries\n                        )\n                    )\n                )\n            )\n            .curve(this.config.curveType);\n\n        path.attr(\"d\", areaFunc(validatedData) ?? \"\");\n    }\n\n    public getDomain(\n        data: any[],\n        dataSeries: IDataSeries<IAreaAccessors>,\n        scaleName: string,\n        scale: IScale<any>\n    ): any[] {\n        if (!data || data.length === 0) {\n            return EMPTY_CONTINUOUS_DOMAIN;\n        }\n        const dataAccessors = dataSeries.accessors.data;\n\n        if (scaleName !== \"x\" && scaleName !== \"y\") {\n            return [undefined, undefined];\n        }\n\n        const accessor0 = dataAccessors[`absolute${scaleName.toUpperCase()}0`];\n        const accessor1 = dataAccessors[`absolute${scaleName.toUpperCase()}1`];\n\n        return [\n            min(data, (datum, index, arr) =>\n                min([\n                    accessor0?.(datum, index, arr as any[], dataSeries),\n                    accessor1?.(datum, index, arr as any[], dataSeries),\n                ])\n            ),\n            max(data, (datum, index, arr) =>\n                max([\n                    accessor0?.(datum, index, arr as any[], dataSeries),\n                    accessor1?.(datum, index, arr as any[], dataSeries),\n                ])\n            ),\n        ];\n    }\n\n    /** See {@link Renderer#getRequiredLayers} */\n    public getRequiredLayers(): ILasagnaLayer[] {\n        return [\n            STANDARD_RENDER_LAYERS[RenderLayerName.data],\n            STANDARD_RENDER_LAYERS[RenderLayerName.foreground],\n        ];\n    }\n\n    /**\n     * Filters given dataset by domain of provided scale\n     *\n     * @param data\n     * @param dataSeries\n     * @param scaleName\n     * @param domain\n     */\n    public filterDataByDomain(\n        data: any[],\n        dataSeries: IDataSeries<IAreaAccessors>,\n        scaleName: string,\n        domain: any[]\n    ): any[] {\n        const accessor0 = dataSeries.accessors.data[scaleName + \"0\"];\n        const accessor1 = dataSeries.accessors.data[scaleName + \"1\"];\n\n        return data.filter((d, i) => {\n            const value0 = accessor0?.(d, i, data, dataSeries);\n            const value1 = accessor1?.(d, i, data, dataSeries);\n\n            return (\n                Math.max(value0, value1) >= domain[0] &&\n                Math.min(value0, value1) <= domain[1]\n            );\n        });\n    }\n\n    public highlightDataPoint(\n        renderSeries: IRenderSeries<IAreaAccessors>,\n        dataPointIndex: number,\n        rendererSubject: Subject<IRendererEventPayload>\n    ): void {\n        const dataSeries = renderSeries.dataSeries;\n        const accessors = dataSeries.accessors;\n        if (!accessors.series.marker || !this.config.interactive) {\n            return;\n        }\n\n        const container = renderSeries.containers[RenderLayerName.foreground];\n        MarkerUtils.manageMarker(\n            renderSeries.dataSeries,\n            renderSeries.scales as IXYScales,\n            dataPointIndex,\n            container,\n            rendererSubject,\n            this.config.markerInteraction\n        );\n    }\n\n    public safetyCheck(value: number | undefined): number {\n        return typeof value === \"undefined\" || isNaN(value) ? 0 : value;\n    }\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { IAreaAccessors } from \"./area-accessors\";\nimport { ChartAssist } from \"../../core/chart-assists/chart-assist\";\nimport { IChartAssistSeries, IChartSeries } from \"../../core/common/types\";\nimport { IStackMetadata } from \"../bar/types\";\n\nexport function stackedAreaPreprocessor(\n    chartSeriesSet: IChartAssistSeries<IAreaAccessors>[],\n    isVisible: (chartSeries: IChartSeries<IAreaAccessors>) => boolean\n): IChartSeries<IAreaAccessors>[] {\n    // No need to preprocess empty series.\n    if (chartSeriesSet.length === 0) {\n        return chartSeriesSet;\n    }\n\n    const domainValueStacks: Record<any, number> = {};\n\n    const baseAccessorKey = \"x\";\n    const valueAccessorKey = \"y\";\n\n    for (const chartSeries of chartSeriesSet) {\n        if (chartSeries.preprocess === false) {\n            continue;\n        }\n        const baseAccessor = chartSeries.accessors.data[baseAccessorKey];\n        const accessor0 = chartSeries.accessors.data[valueAccessorKey + \"0\"];\n        const accessor1 = chartSeries.accessors.data[valueAccessorKey + \"1\"];\n        const coef = isVisible(chartSeries) ? 1 : 0;\n\n        chartSeries.data.forEach((datum, index) => {\n            const base = baseAccessor(\n                datum,\n                index,\n                chartSeries.data,\n                chartSeries\n            );\n            const value0 = accessor0?.(\n                datum,\n                index,\n                chartSeries.data,\n                chartSeries\n            );\n            const value1 = accessor1?.(\n                datum,\n                index,\n                chartSeries.data,\n                chartSeries\n            );\n\n            const diff = (value1 - value0) * coef;\n\n            let start = domainValueStacks[base.valueOf()];\n            // initialize stack\n            if (typeof start === \"undefined\") {\n                start = 0;\n                domainValueStacks[base.valueOf()] = start;\n            }\n\n            const end = start + diff;\n            domainValueStacks[base.valueOf()] = end;\n\n            datum[\"__stack_\" + valueAccessorKey] = {\n                start,\n                end,\n            } as IStackMetadata;\n        });\n    }\n\n    return chartSeriesSet;\n}\n\nexport function stackedArea(\n    this: ChartAssist,\n    chartSeriesSet: IChartAssistSeries<IAreaAccessors>[]\n): IChartAssistSeries<IAreaAccessors>[] {\n    return stackedAreaPreprocessor(\n        chartSeriesSet,\n        (series: IChartSeries<IAreaAccessors>) =>\n            !this.isSeriesHidden(series.id)\n    );\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { IAreaAccessors } from \"./area-accessors\";\nimport { ChartAssist } from \"../../core/chart-assists/chart-assist\";\nimport { IChartAssistSeries, IChartSeries } from \"../../core/common/types\";\nimport { IStackMetadata } from \"../bar/types\";\n\nexport function stackedPercentageAreaPreprocessor(\n    chartSeriesSet: IChartSeries<IAreaAccessors>[],\n    isVisible: (chartSeries: IChartSeries<IAreaAccessors>) => boolean\n): IChartSeries<IAreaAccessors>[] {\n    // No need to preprocess empty series.\n    if (chartSeriesSet.length === 0) {\n        return chartSeriesSet;\n    }\n\n    const domainValueStacks: Record<any, number> = {};\n    const domainValueCombinedTotals: Record<any, number> = {};\n\n    const baseAccessorKey = \"x\";\n    const valueAccessorKey = \"y\";\n\n    for (const chartSeries of chartSeriesSet) {\n        calculateDomainValueCombinedTotals(\n            baseAccessorKey,\n            valueAccessorKey,\n            chartSeries,\n            isVisible,\n            domainValueCombinedTotals\n        );\n    }\n\n    for (const chartSeries of chartSeriesSet) {\n        applyStackMetadata(\n            baseAccessorKey,\n            valueAccessorKey,\n            chartSeries,\n            isVisible,\n            domainValueStacks,\n            domainValueCombinedTotals\n        );\n    }\n\n    return chartSeriesSet;\n}\n\nexport function stackedPercentageArea(\n    this: ChartAssist,\n    chartSeriesSet: IChartAssistSeries<IAreaAccessors>[]\n): IChartAssistSeries<IAreaAccessors>[] {\n    return stackedPercentageAreaPreprocessor(\n        chartSeriesSet,\n        (series: IChartSeries<IAreaAccessors>) =>\n            !this.isSeriesHidden(series.id)\n    );\n}\n\nexport function calculateDomainValueCombinedTotals(\n    baseAccessorKey: string,\n    valueAccessorKey: string,\n    chartSeries: IChartSeries<IAreaAccessors>,\n    isVisible: any,\n    domainValueCombinedTotals: Record<any, number>\n): void {\n    const baseAccessor = chartSeries.accessors.data[baseAccessorKey];\n    const accessor0 = chartSeries.accessors.data[valueAccessorKey + \"0\"];\n    const accessor1 = chartSeries.accessors.data[valueAccessorKey + \"1\"];\n    const coef = isVisible(chartSeries) ? 1 : 0;\n\n    chartSeries.data.forEach((datum, index) => {\n        // @ts-ignore\n        const base = baseAccessor(datum, index, chartSeries.data, chartSeries);\n        const value0 = accessor0?.(datum, index, chartSeries.data, chartSeries);\n        const value1 = accessor1?.(datum, index, chartSeries.data, chartSeries);\n\n        const diff = (value1 - value0) * coef;\n        let total = domainValueCombinedTotals[base.valueOf()];\n        // initialize stack\n        if (typeof total === \"undefined\") {\n            total = 0;\n            domainValueCombinedTotals[base.valueOf()] = total;\n        }\n        domainValueCombinedTotals[base.valueOf()] = total + diff;\n    });\n}\n\nexport function applyStackMetadata(\n    baseAccessorKey: string,\n    valueAccessorKey: string,\n    chartSeries: IChartSeries<IAreaAccessors>,\n    isVisible: any,\n    domainValueStacks: Record<any, number>,\n    domainValueCombinedTotals: Record<any, number>\n): void {\n    const baseAccessor = chartSeries.accessors.data[baseAccessorKey];\n    const accessor0 = chartSeries.accessors.data[valueAccessorKey + \"0\"];\n    const accessor1 = chartSeries.accessors.data[valueAccessorKey + \"1\"];\n    const coef = isVisible(chartSeries) ? 1 : 0;\n\n    chartSeries.data.forEach((datum, index) => {\n        // @ts-ignore\n        const base = baseAccessor(datum, index, chartSeries.data, chartSeries);\n        const value0 = accessor0?.(datum, index, chartSeries.data, chartSeries);\n        const value1 = accessor1?.(datum, index, chartSeries.data, chartSeries);\n\n        const diff = (value1 - value0) * coef;\n        let start = domainValueStacks[base.valueOf()];\n        // initialize stack\n        if (typeof start === \"undefined\") {\n            start = 0;\n            domainValueStacks[base.valueOf()] = start;\n        }\n        const diffPercent = diff / domainValueCombinedTotals[base.valueOf()];\n        const end = start + diffPercent * 100;\n        domainValueStacks[base.valueOf()] = end;\n\n        datum[\"__stack_\" + valueAccessorKey] = { start, end } as IStackMetadata;\n    });\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { AreaAccessors, IAreaAccessors } from \"./area-accessors\";\nimport { IChartMarker, IValueProvider } from \"../../core/common/types\";\n\nexport function stackedAreaAccessors(\n    colorProvider?: IValueProvider<string>,\n    markerProvider?: IValueProvider<IChartMarker>\n): IAreaAccessors {\n    const areaAccessors = new AreaAccessors(colorProvider, markerProvider);\n\n    areaAccessors.data.x = (d) => d.x;\n    areaAccessors.data.y = areaAccessors.data.absoluteY1;\n    areaAccessors.data.y0 = () => 0;\n    areaAccessors.data.y1 = (d) => d.y;\n\n    return areaAccessors;\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nexport * from \"./area-grid\";\nexport * from \"./area-accessors\";\nexport * from \"./area-renderer\";\nexport * from \"./stacked-area-preprocessor\";\nexport * from \"./stacked-percentage-area-preprocessor\";\nexport * from \"./stacked-area-accessors\";\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nexport * from \"./constants\";\nexport * from \"./types\";\nexport * from \"./xy-renderer\";\nexport * from \"./side-indicator-renderer\";\nexport * from \"./accessors/public-api\";\nexport * from \"./noop-renderer\";\nexport * from \"./bar/public-api\";\nexport * from \"./radial/public-api\";\nexport * from \"./line/public-api\";\nexport * from \"./area/public-api\";\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { XYGridConfig } from \"../core/grid/config/xy-grid-config\";\n\n/**\n * Applies grid configuration for summary thresholds section\n *\n * @param c\n */\nexport function thresholdsSummaryGridConfig(\n    c: XYGridConfig = new XYGridConfig()\n): XYGridConfig {\n    c.axis.left.visible = false;\n    c.axis.left.gridTicks = false;\n    c.dimension.padding.bottom = 5;\n    c.dimension.autoHeight = false;\n    c.dimension.height(20);\n\n    return c;\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport { XYGridConfig } from \"../core/grid/config/xy-grid-config\";\n\n/**\n * Applies grid configuration that is used for main chart (with a threshold summary section below it)\n *\n * @param c\n */\nexport function thresholdsTopGridConfig(\n    c: XYGridConfig = new XYGridConfig()\n): XYGridConfig {\n    c.axis.bottom.visible = false;\n    c.dimension.margin.bottom = 0;\n    c.dimension.padding.bottom = 5;\n\n    return c;\n}\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nexport * from \"./types\";\nexport * from \"./thresholds-service\";\nexport * from \"./thresholds-summary-grid-config\";\nexport * from \"./thresholds-top-grid-config\";\n","// © 2022 SolarWinds Worldwide, LLC. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to\n//  deal in the Software without restriction, including without limitation the\n//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n//  sell copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nexport { ChartTooltipDirective } from \"./chart-tooltips/chart-tooltip.directive\";\nexport { ChartTooltipComponent } from \"./chart-tooltips/chart-tooltip.component\";\nexport { ChartDonutContentComponent } from \"./chart-donut-content/chart-donut-content.component\";\nexport { ChartTooltipsComponent } from \"./chart-tooltips/chart-tooltips.component\";\nexport { ChartPopoverComponent } from \"./chart-popover/chart-popover.component\";\nexport { ChartMarkerComponent } from \"./chart-marker/chart-marker.component\";\n\nexport * from \"./charts.module\";\nexport * from \"./chart/chart.component\";\nexport * from \"./gauge/public-api\";\nexport * from \"./chart-collection/public-api\";\nexport * from \"./core/public-api\";\nexport * from \"./legend/public-api\";\nexport * from \"./renderers/public-api\";\nexport * from \"./constants\";\nexport * from \"./thresholds/public-api\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1","i2.ChartTooltipDirective","i2","i1.ChartCollectionService","_isEmpty","i1.LegendComponent","_isNil","i1.LegendSeriesComponent","i2.LegendComponent","i3","select","filter","min","max","bisect","scaleBand"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MA0Ba,qBAAqB,CAAA;AACrB,IAAA,QAAQ;wGADR,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAArB,qBAAqB,EAAA,YAAA,EAAA,KAAA,EAAA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CAAA,CAAuC,CACvF;AACD,oBAAA,SAAS,CAAC,KAAK,GAAG,CAAC;gBACvB;YACJ;AACJ,QAAA,CAAC,CAAC;QAEF,OAAO;AACH,YAAA,GAAG,WAAW;AACd,YAAA,UAAU,EAAE;gBACR,GAAG,WAAW,CAAC,UAAU;AACzB,gBAAA,WAAW,EAAE,aAAa;AAC7B,aAAA;YACD,KAAK;SACR;IACL;;;ACzrBJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;;;AAGG;MACU,mBAAmB,CAAA;AAEhB,IAAA,QAAA;AACA,IAAA,YAAA;IAFZ,WAAA,CACY,QAA8B,EAC9B,YAAgB,EAAA;QADhB,IAAA,CAAA,QAAQ,GAAR,QAAQ;QACR,IAAA,CAAA,YAAY,GAAZ,YAAY;QAEpB,IAAI,CAAC,KAAK,EAAE;IAChB;AAEO,IAAA,GAAG,GAAG,CAAC,QAAgB,KAC1B,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,YAAY;AAEzC,IAAA,KAAK,KAAU;AACzB;;ACtCD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;;AAEG;MACU,UAAU,CAAA;;AAEZ,IAAA,OAAO;AACJ,IAAA,GAAG;AAEb;;;;AAIG;AACH,IAAA,WAAA,CAAY,CAAS,EAAA;QACjB,IAAI,CAAC,OA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AAsB,CAAC;QACnE,IAAI,SAAS,IAAI,CAAC,mBAAmB,IAAI,IAAI,CAAC,cAAc,EAAE;AAC1D,YAAA,MAAM,WAAW,GAAG,IAAI,sBAAsB,EAAE;AAChD,YAAA,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC;YAC5B,WAAW,CAAC,UAAU,EAAE;QAC5B;AAAO,aAAA,IAAI,CAAC,SAAS,IAAI,mBAAmB,EAAE;AAC1C,YAAA,KAAK,CAAC,YAAY,CAAC,sBAAsB,CAAC;QAC9C;AAEA,QAAA,OAAO,KAAK;IAChB;AACH;;AC3ND;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MAUa,aAAa,CAAA;AACf,IAAA,MAAM;AACN,IAAA,IAAI;AAEX,IAAA,WAAA,GAAA;AACI,QAAA,IAAI,CAAC,MAAM,GAAG,SAAS;AACvB,QAAA,IAAI,CAAC,IAAI,GAAG,SAAS;IACzB;AACH;;ACpCD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAeA;;AAEG;AACG,MAAO,YAAa,SAAQ,QAAwB,CAAA;;AAE/C,IAAA,IAAI,CACP,YAA2C,EAC3C,eAA+C,IAC1C;;AAGF,IAAA,kBAAkB,CACrB,YAA2C,EAC3C,cAAsB,EACtB,eAA+C,IAC1C;;IAGF,iBAAiB,GAAA;AACpB,QAAA,OAAO,EAAE;IACb;;AAGO,IAAA,oBAAoB,CACvB,UAAuC,EACvC,KAAa,EACb,MAAc,EAAA;;QAGd;IACJ;AACH;;AChED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOA;;;;;;AAMG;AACG,SAAU,OAAO,CAAC,MAAwB,EAAA;AAC5C,IAAA,MAAM,IAAI,GAAG,IAAI,MAAM,EAAE;AAEzB,IAAA,IAAI,CAAC,MAAM,CACP,MAAM,IAAI,MAAM,CAAC;UACX,IAAI,uBAAuB;AAC7B,UAAE,IAAI,aAAa,EAAE,CAC5B;AAED,IAAA,OAAO,IAAI;AACf;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQA;;;;;;;;AAQG;SACa,YAAY,CACxB,MAAwB,EACxB,aAAsC,EACtC,cAA6C,EAAA;AAE7C,IAAA,OAAO,MAAM,IAAI,MAAM,CAAC;AACpB,UAAE,IAAI,sBAAsB,CAAC,aAAa,EAAE,cAAc;UACxD,IAAI,oBAAoB,CAAC,aAAa,EAAE,cAAc,CAAC;AACjE;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MA8Ba,oBAAoB,C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QACN;IACJ;AAEO,IAAA,IAAI,CACP,QAAqB,EACrB,YAAgD,EAChD,eAA+C,IAC1C;AACZ;;ACpID;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;;AAEG;AACG,MAAO,WAAY,SAAQ,cAAc,CAAA;AACjC,IAAA,MAAM,CACZ,KAAuB,EACvB,GAA+B,EAC/B,KAAa,EAAA;AAEb,QAAA,OAAO,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;IAC9D;AACH;;ACnCD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOA;;;;;;AAMG;SACa,oBAAoB,CAChC,UAAmC,EACnC,WAAmB,EACnB,QAAkB,EAAA;AAElB,IAAA,MAAM,aAAa,GAAG,UAAU,CAAC,SAAS,CAAC,IAAI;AAC/C,IAAA,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI;AAC5B,IAAA,MAAM,QAAQ,GAAG,aAAa,GAAG,WAAW,CAAC;IAC7C,IAAI,CAAC,QAAQ,EAAE;QACX,MAAM,IAAI,KAAK,CAAC,WAAW,GAAG,WAAW,GAAG,eAAe,CAAC;IAChE;AACA,IAAA,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAA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AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;;AAEG;;;;"}