{"version":3,"file":"swimlane-ngx-charts.mjs","sources":["../../../../projects/swimlane/ngx-charts/src/lib/utils/throttle.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/tooltip/position/placement-type.enum.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/tooltip/position/position.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/tooltip/tooltip.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/tooltip/injection-registery.service.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/tooltip/injection.service.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/tooltip/tooltip.service.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/types/legend.model.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/types/scale-type.enum.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/legend/scale-legend.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/label.helper.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/legend/legend-entry.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/legend/legend.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/charts/chart.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/utils/visibility-observer.ts","../../../../projects/swimlane/ngx-charts/src/lib/utils/types.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/base-chart.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/types/orientation.enum.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/axes/axis-label.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/trim-label.helper.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/axes/ticks.helper.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/types/text-anchor.enum.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/axes/x-axis-ticks.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/axes/x-axis.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/shape.helper.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/axes/y-axis-ticks.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/axes/y-axis.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/axes/axes.module.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/tooltip/style.type.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/tooltip/show.type.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/tooltip/tooltip.directive.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/tooltip/tooltip.module.ts","../../../../projects/swimlane/ngx-charts/src/lib/utils/id.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/types/bar-orientation.enum.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/svg-linear-gradient.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/circle.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/circle-series.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/grid-panel.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/grid-panel-series.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/svg-radial-gradient.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/area.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/count/count.helper.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/count/count.directive.ts","../../../../projects/swimlane/ngx-charts/src/lib/events.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/tooltip-area.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/timeline/timeline.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/legend/advanced-legend.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/chart-common.module.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/view-dimensions.helper.ts","../../../../projects/swimlane/ngx-charts/src/lib/utils/color-sets.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/color.helper.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/domain.helper.ts","../../../../projects/swimlane/ngx-charts/src/lib/utils/sort.ts","../../../../projects/swimlane/ngx-charts/src/lib/area-chart/area-series.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/area-chart/area-chart.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/area-chart/area-chart-normalized.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/area-chart/area-chart-stacked.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/area-chart/area-chart.module.ts","../../../../projects/swimlane/ngx-charts/src/lib/bar-chart/bar.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/bar-chart/types/bar-chart-type.enum.ts","../../../../projects/swimlane/ngx-charts/src/lib/bar-chart/types/d0-type.enum.ts","../../../../projects/swimlane/ngx-charts/src/lib/bar-chart/bar-label.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/bar-chart/series-horizontal.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/bar-chart/bar-horizontal.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/bar-chart/bar-horizontal-2d.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/bar-chart/bar-horizontal-normalized.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/bar-chart/bar-horizontal-stacked.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/bar-chart/series-vertical.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/bar-chart/bar-vertical.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/bar-chart/bar-vertical-2d.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/bar-chart/bar-vertical-normalized.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/bar-chart/bar-vertical-stacked.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/bar-chart/bar-chart.module.ts","../../../../projects/swimlane/ngx-charts/src/lib/box-chart/box.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/box-chart/box-series.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/box-chart/box-chart.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/box-chart/box-chart.module.ts","../../../../projects/swimlane/ngx-charts/src/lib/bubble-chart/bubble-chart.utils.ts","../../../../projects/swimlane/ngx-charts/src/lib/bubble-chart/bubble-series.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/bubble-chart/bubble-chart.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/bubble-chart/bubble-chart.module.ts","../../../../projects/swimlane/ngx-charts/src/lib/heat-map/heat-map-cell.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/heat-map/heat-map-cell-series.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/heat-map/heat-map.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/heat-map/heat-map.module.ts","../../../../projects/swimlane/ngx-charts/src/lib/line-chart/line.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/line-chart/line-series.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/line-chart/line-chart.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/line-chart/line-chart.module.ts","../../../../projects/swimlane/ngx-charts/src/lib/pie-chart/pie-label.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/polar-chart/polar-series.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/polar-chart/polar-chart.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/pie-chart/pie-arc.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/pie-chart/pie-series.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/pie-chart/advanced-pie-chart.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/pie-chart/pie-chart.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/grid-layout.helper.ts","../../../../projects/swimlane/ngx-charts/src/lib/pie-chart/pie-grid-series.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/pie-chart/pie-grid.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/pie-chart/pie-chart.module.ts","../../../../projects/swimlane/ngx-charts/src/lib/polar-chart/polar-chart.module.ts","../../../../projects/swimlane/ngx-charts/src/lib/utils/calculate-width.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/constants/font-widths.ts","../../../../projects/swimlane/ngx-charts/src/lib/number-card/card.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/utils/color-utils.ts","../../../../projects/swimlane/ngx-charts/src/lib/number-card/card-series.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/number-card/number-card.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/number-card/number-card.module.ts","../../../../projects/swimlane/ngx-charts/src/lib/tree-map/tree-map-cell.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/tree-map/tree-map-cell-series.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/tree-map/tree-map.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/tree-map/tree-map.module.ts","../../../../projects/swimlane/ngx-charts/src/lib/gauge/linear-gauge.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/gauge/gauge-arc.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/gauge/gauge-axis.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/gauge/gauge.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/gauge/gauge.module.ts","../../../../projects/swimlane/ngx-charts/src/lib/polyfills.ts","../../../../projects/swimlane/ngx-charts/src/lib/sankey/sankey.component.ts","../../../../projects/swimlane/ngx-charts/src/lib/sankey/sankey.module.ts","../../../../projects/swimlane/ngx-charts/src/lib/ngx-charts.module.ts","../../../../projects/swimlane/ngx-charts/src/lib/common/tick-format.helper.ts","../../../../projects/swimlane/ngx-charts/src/public-api.ts","../../../../projects/swimlane/ngx-charts/src/swimlane-ngx-charts.ts"],"sourcesContent":["/**\n * Throttle a function\n *\n */\nexport function throttle(func: any, wait: number, options?: any) {\n options = options || {};\n let context;\n let args;\n let result;\n let timeout = null;\n let previous = 0;\n\n function later() {\n previous = options.leading === false ? 0 : +new Date();\n timeout = null;\n result = func.apply(context, args);\n }\n\n return function () {\n const now = +new Date();\n\n if (!previous && options.leading === false) {\n previous = now;\n }\n\n const remaining = wait - (now - previous);\n context = this;\n // eslint-disable-next-line prefer-rest-params\n args = arguments;\n\n if (remaining <= 0) {\n clearTimeout(timeout);\n timeout = null;\n previous = now;\n result = func.apply(context, args);\n } else if (!timeout && options.trailing !== false) {\n timeout = setTimeout(later, remaining);\n }\n\n return result;\n };\n}\n\n/**\n * Throttle decorator\n *\n * class MyClass {\n * throttleable(10)\n * myFn() { ... }\n * }\n */\nexport function throttleable(duration: number, options?: any) {\n return function innerDecorator(target, key, descriptor) {\n return {\n configurable: true,\n enumerable: descriptor.enumerable,\n get: function getter() {\n Object.defineProperty(this, key, {\n configurable: true,\n enumerable: descriptor.enumerable,\n value: throttle(descriptor.value, duration, options)\n });\n\n return this[key];\n }\n };\n };\n}\n","export enum PlacementTypes {\n Top = 'top',\n Bottom = 'bottom',\n Left = 'left',\n Right = 'right',\n Center = 'center'\n}\n","import { PlacementTypes } from './placement-type.enum';\n\nconst caretOffset = 7;\n\nfunction verticalPosition(elDimensions: DOMRect, popoverDimensions: DOMRect, alignment: PlacementTypes): number {\n if (alignment === PlacementTypes.Top) {\n return elDimensions.top - caretOffset;\n }\n\n if (alignment === PlacementTypes.Bottom) {\n return elDimensions.top + elDimensions.height - popoverDimensions.height + caretOffset;\n }\n\n if (alignment === PlacementTypes.Center) {\n return elDimensions.top + elDimensions.height / 2 - popoverDimensions.height / 2;\n }\n\n return undefined;\n}\n\nfunction horizontalPosition(elDimensions: DOMRect, popoverDimensions: DOMRect, alignment: PlacementTypes): number {\n if (alignment === PlacementTypes.Left) {\n return elDimensions.left - caretOffset;\n }\n\n if (alignment === PlacementTypes.Right) {\n return elDimensions.left + elDimensions.width - popoverDimensions.width + caretOffset;\n }\n\n if (alignment === PlacementTypes.Center) {\n return elDimensions.left + elDimensions.width / 2 - popoverDimensions.width / 2;\n }\n\n return undefined;\n}\n\n/**\n * Position helper for the popover directive.\n *\n * @export\n */\nexport class PositionHelper {\n /**\n * Calculate vertical alignment position\n *\n * @memberOf PositionHelper\n */\n static calculateVerticalAlignment(\n elDimensions: DOMRect,\n popoverDimensions: DOMRect,\n alignment: PlacementTypes\n ): number {\n let result = verticalPosition(elDimensions, popoverDimensions, alignment);\n\n if (result + popoverDimensions.height > window.innerHeight) {\n result = window.innerHeight - popoverDimensions.height;\n }\n\n return result;\n }\n\n /**\n * Calculate vertical caret position\n *\n * @memberOf PositionHelper\n */\n static calculateVerticalCaret(\n elDimensions: DOMRect,\n popoverDimensions: DOMRect,\n caretDimensions: DOMRect,\n alignment: PlacementTypes\n ): number {\n let result;\n\n if (alignment === PlacementTypes.Top) {\n result = elDimensions.height / 2 - caretDimensions.height / 2 + caretOffset;\n }\n\n if (alignment === PlacementTypes.Bottom) {\n result = popoverDimensions.height - elDimensions.height / 2 - caretDimensions.height / 2 - caretOffset;\n }\n\n if (alignment === PlacementTypes.Center) {\n result = popoverDimensions.height / 2 - caretDimensions.height / 2;\n }\n\n const popoverPosition = verticalPosition(elDimensions, popoverDimensions, alignment);\n if (popoverPosition + popoverDimensions.height > window.innerHeight) {\n result += popoverPosition + popoverDimensions.height - window.innerHeight;\n }\n\n return result;\n }\n\n /**\n * Calculate horz alignment position\n *\n * @memberOf PositionHelper\n */\n static calculateHorizontalAlignment(\n elDimensions: DOMRect,\n popoverDimensions: DOMRect,\n alignment: PlacementTypes\n ): number {\n let result = horizontalPosition(elDimensions, popoverDimensions, alignment);\n\n if (result + popoverDimensions.width > window.innerWidth) {\n result = window.innerWidth - popoverDimensions.width;\n }\n\n return result;\n }\n\n /**\n * Calculate horz caret position\n *\n * @memberOf PositionHelper\n */\n static calculateHorizontalCaret(\n elDimensions: DOMRect,\n popoverDimensions: DOMRect,\n caretDimensions: DOMRect,\n alignment: PlacementTypes\n ): number {\n let result;\n\n if (alignment === PlacementTypes.Left) {\n result = elDimensions.width / 2 - caretDimensions.width / 2 + caretOffset;\n }\n\n if (alignment === PlacementTypes.Right) {\n result = popoverDimensions.width - elDimensions.width / 2 - caretDimensions.width / 2 - caretOffset;\n }\n\n if (alignment === PlacementTypes.Center) {\n result = popoverDimensions.width / 2 - caretDimensions.width / 2;\n }\n\n const popoverPosition = horizontalPosition(elDimensions, popoverDimensions, alignment);\n if (popoverPosition + popoverDimensions.width > window.innerWidth) {\n result += popoverPosition + popoverDimensions.width - window.innerWidth;\n }\n\n return result;\n }\n\n /**\n * Checks if the element's position should be flipped\n *\n * @memberOf PositionHelper\n */\n static shouldFlip(\n elDimensions: DOMRect,\n popoverDimensions: DOMRect,\n placement: PlacementTypes,\n spacing: number\n ): boolean {\n let flip = false;\n\n if (placement === PlacementTypes.Right) {\n if (elDimensions.left + elDimensions.width + popoverDimensions.width + spacing > window.innerWidth) {\n flip = true;\n }\n }\n\n if (placement === PlacementTypes.Left) {\n if (elDimensions.left - popoverDimensions.width - spacing < 0) {\n flip = true;\n }\n }\n\n if (placement === PlacementTypes.Top) {\n if (elDimensions.top - popoverDimensions.height - spacing < 0) {\n flip = true;\n }\n }\n\n if (placement === PlacementTypes.Bottom) {\n if (elDimensions.top + elDimensions.height + popoverDimensions.height + spacing > window.innerHeight) {\n flip = true;\n }\n }\n\n return flip;\n }\n\n /**\n * Position caret\n *\n * @memberOf PositionHelper\n */\n static positionCaret(placement, elmDim, hostDim, caretDimensions, alignment: PlacementTypes): any {\n let top = 0;\n let left = 0;\n\n if (placement === PlacementTypes.Right) {\n left = -7;\n top = PositionHelper.calculateVerticalCaret(hostDim, elmDim, caretDimensions, alignment);\n } else if (placement === PlacementTypes.Left) {\n left = elmDim.width;\n top = PositionHelper.calculateVerticalCaret(hostDim, elmDim, caretDimensions, alignment);\n } else if (placement === PlacementTypes.Top) {\n top = elmDim.height;\n left = PositionHelper.calculateHorizontalCaret(hostDim, elmDim, caretDimensions, alignment);\n } else if (placement === PlacementTypes.Bottom) {\n top = -7;\n left = PositionHelper.calculateHorizontalCaret(hostDim, elmDim, caretDimensions, alignment);\n }\n\n return { top, left };\n }\n\n /**\n * Position content\n *\n * @memberOf PositionHelper\n */\n static positionContent(placement, elmDim, hostDim, spacing, alignment): any {\n let top = 0;\n let left = 0;\n\n if (placement === PlacementTypes.Right) {\n left = hostDim.left + hostDim.width + spacing;\n top = PositionHelper.calculateVerticalAlignment(hostDim, elmDim, alignment);\n } else if (placement === PlacementTypes.Left) {\n left = hostDim.left - elmDim.width - spacing;\n top = PositionHelper.calculateVerticalAlignment(hostDim, elmDim, alignment);\n } else if (placement === PlacementTypes.Top) {\n top = hostDim.top - elmDim.height - spacing;\n left = PositionHelper.calculateHorizontalAlignment(hostDim, elmDim, alignment);\n } else if (placement === PlacementTypes.Bottom) {\n top = hostDim.top + hostDim.height + spacing;\n left = PositionHelper.calculateHorizontalAlignment(hostDim, elmDim, alignment);\n }\n\n return { top, left };\n }\n\n /**\n * Determine placement based on flip\n *\n * @memberOf PositionHelper\n */\n static determinePlacement(placement: PlacementTypes, elmDim: DOMRect, hostDim: DOMRect, spacing: number): any {\n const shouldFlip = PositionHelper.shouldFlip(hostDim, elmDim, placement, spacing);\n\n if (shouldFlip) {\n if (placement === PlacementTypes.Right) {\n return PlacementTypes.Left;\n } else if (placement === PlacementTypes.Left) {\n return PlacementTypes.Right;\n } else if (placement === PlacementTypes.Top) {\n return PlacementTypes.Bottom;\n } else if (placement === PlacementTypes.Bottom) {\n return PlacementTypes.Top;\n }\n }\n\n return placement;\n }\n}\n","import {\n Input,\n Component,\n ElementRef,\n AfterViewInit,\n ViewEncapsulation,\n HostListener,\n ViewChild,\n HostBinding,\n Renderer2,\n PLATFORM_ID,\n Inject,\n TemplateRef\n} from '@angular/core';\n\nimport { throttleable } from '../../utils/throttle';\nimport { PositionHelper, PlacementTypes } from './position';\n\nimport { StyleTypes } from './style.type';\nimport { isPlatformBrowser } from '@angular/common';\n\n@Component({\n selector: 'ngx-tooltip-content',\n template: `\n