@cloudscape-design/chart-components 1.0.88 → 1.0.90

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/core/chart-api/chart-extra-axis-titles.js +2 -2
  2. package/core/chart-api/chart-extra-axis-titles.js.map +1 -1
  3. package/core/chart-api/chart-extra-context.d.ts +5 -4
  4. package/core/chart-api/chart-extra-context.js +5 -6
  5. package/core/chart-api/chart-extra-context.js.map +1 -1
  6. package/core/chart-api/chart-extra-highlight.js +14 -16
  7. package/core/chart-api/chart-extra-highlight.js.map +1 -1
  8. package/core/chart-api/chart-extra-legend.js +3 -3
  9. package/core/chart-api/chart-extra-legend.js.map +1 -1
  10. package/core/chart-api/chart-extra-navigation.js +1 -1
  11. package/core/chart-api/chart-extra-navigation.js.map +1 -1
  12. package/core/chart-api/chart-extra-nodata.js +3 -3
  13. package/core/chart-api/chart-extra-nodata.js.map +1 -1
  14. package/core/chart-api/chart-extra-pointer.d.ts +2 -1
  15. package/core/chart-api/chart-extra-pointer.js +2 -3
  16. package/core/chart-api/chart-extra-pointer.js.map +1 -1
  17. package/core/chart-api/chart-extra-tooltip.js +6 -5
  18. package/core/chart-api/chart-extra-tooltip.js.map +1 -1
  19. package/core/chart-api/index.js +4 -5
  20. package/core/chart-api/index.js.map +1 -1
  21. package/core/components/core-tooltip.js +3 -4
  22. package/core/components/core-tooltip.js.map +1 -1
  23. package/core/utils.d.ts +11 -10
  24. package/core/utils.js +3 -3
  25. package/core/utils.js.map +1 -1
  26. package/internal/components/series-marker/render-marker.d.ts +2 -1
  27. package/internal/components/series-marker/render-marker.js.map +1 -1
  28. package/internal/environment.js +1 -1
  29. package/internal/environment.json +1 -1
  30. package/internal/generated/styles/tokens.d.ts +4 -0
  31. package/internal/generated/styles/tokens.js +4 -0
  32. package/internal/generated/theming/index.cjs +132 -0
  33. package/internal/generated/theming/index.cjs.d.ts +36 -0
  34. package/internal/generated/theming/index.d.ts +36 -0
  35. package/internal/generated/theming/index.js +132 -0
  36. package/internal/manifest.json +1 -1
  37. package/internal/utils/highcharts.d.ts +40 -0
  38. package/internal/utils/highcharts.js +55 -0
  39. package/internal/utils/highcharts.js.map +1 -0
  40. package/package.json +1 -1
  41. package/pie-chart/chart-inner-area.js +5 -5
  42. package/pie-chart/chart-inner-area.js.map +1 -1
  43. package/internal/utils/chart-series.d.ts +0 -16
  44. package/internal/utils/chart-series.js +0 -27
  45. package/internal/utils/chart-series.js.map +0 -1
  46. package/internal/utils/series-data.d.ts +0 -3
  47. package/internal/utils/series-data.js +0 -18
  48. package/internal/utils/series-data.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/chart-api/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAGjE,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,EAC7B,6BAA6B,EAC7B,YAAY,GACb,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,oBAAoB,EAA2B,MAAM,2BAA2B,CAAC;AAC1F,OAAO,EAAqB,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAClG,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAuB,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAgC,MAAM,0BAA0B,CAAC;AAC9F,OAAO,EAAE,gBAAgB,EAAuB,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAA6B,MAAM,uBAAuB,CAAC;AACrF,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AC;YAED,wDAAwD;YACxD,sBAAsB,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QACzF,CAAC;IACH,CAAC;IAgBD,IAAY,eAAe;QACzB,OAAO,IAAI,CAAC,iBAAiB,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;IAC7C,CAAC;CACF;AAED,SAAS,sBAAsB,CAAC,OAA0B,EAAE,IAAuB;IACjF,OAAO,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,CAAC,OAAK,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,CAAC,CAAA,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,CAAC,OAAK,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,CAAC,CAAA,CAAC;AAC1D,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useEffect, useRef } from \"react\";\nimport type Highcharts from \"highcharts\";\n\nimport { fireNonCancelableEvent } from \"../../internal/events\";\nimport { ReadonlyAsyncStore } from \"../../internal/utils/async-store\";\nimport { getChartSeries } from \"../../internal/utils/chart-series\";\nimport { getSeriesData } from \"../../internal/utils/series-data\";\nimport { Writeable } from \"../../internal/utils/utils\";\nimport { CoreChartProps } from \"../interfaces\";\nimport {\n getChartAccessibleDescription,\n getGroupAccessibleDescription,\n getPointAccessibleDescription,\n isXThreshold,\n} from \"../utils\";\nimport { ChartExtraAxisTitles, ReactiveAxisTitlesState } from \"./chart-extra-axis-titles\";\nimport { ChartExtraContext, createChartContext, updateChartContext } from \"./chart-extra-context\";\nimport { ChartExtraHighlight } from \"./chart-extra-highlight\";\nimport { ChartExtraLegend, ReactiveLegendState } from \"./chart-extra-legend\";\nimport { ChartExtraNavigation, ChartExtraNavigationHandlers } from \"./chart-extra-navigation\";\nimport { ChartExtraNodata, ReactiveNodataState } from \"./chart-extra-nodata\";\nimport { ChartExtraPointer, ChartExtraPointerHandlers } from \"./chart-extra-pointer\";\nimport { ChartExtraTooltip, ReactiveTooltipState } from \"./chart-extra-tooltip\";\n\n// The API helper injects Cloudscape custom behaviors, and returns the API instance that comes with\n// reactive state and handlers to be assigned as Highcharts options, used by Cloudscape components\n// (tooltip, legend, and other), or exposed as public core chart API.\nexport function useChartAPI(\n settings: ChartExtraContext.Settings,\n handlers: ChartExtraContext.Handlers,\n state: ChartExtraContext.State,\n) {\n // The API helper instance defines many pieces of internal state with different lifecycles, most\n // of which are not be invalidated when the hook re-renders, or properties change. That is why we\n // create the instance once, when the component is mounted.\n const api = useRef(new ChartAPI(settings, handlers, state)).current;\n // The consumer-defined properties can still change during the component lifecycle. We propagate the\n // changes by updating the helper's context directly. That is fine for most of the properties, as those\n // are only used in event-based callbacks, and require nothing to recompute when there is a change.\n useEffect(() => {\n api.context.settings = settings;\n api.context.handlers = handlers;\n api.context.state = state;\n });\n\n // The only property that does require notifying the helper when it changes, is the visible items state.\n // We stringify the visible items array so that it is compared by value, and the effect is only fired when\n // there is an actual change to the visible items, including items order.\n const visibleItemsIndex = state.visibleItems ? state.visibleItems.join(\"::\") : null;\n useEffect(() => {\n // When visibleItemsIndex === null, it means the visible items state is managed internally inside the helper,\n // so no need to call the API method.\n // The api.updateItemsVisibility() can only be used once the chart is initialized, so we check for api.ready.\n // The initialization happens after the first React render, so the chart is expected to not be ready when the\n // effect is called for the first time. This is fine, as the initial visibility state is handled by the helper.\n // The code below is needed to notify the helper any time the visible items state changes.\n if (api.ready && visibleItemsIndex !== null) {\n api.updateItemsVisibility();\n }\n }, [api, visibleItemsIndex]);\n\n // Run cleanup code when the component unmounts.\n useEffect(() => () => api.onChartDestroy(), [api]);\n\n return api;\n}\n\n// The main chart helper that provides customizations to Highcharts, including tooltip, legend, keyboard navigation, and more.\n// It is split into multiple dedicated (chart-extra) helpers (highlight, tooltip, navigation, and other), most of which define\n// internal state, and have a lifecycle based on Highcharts render event.\n// The helper code has a shared context, which includes the consumer settings, visible items state, and derived state, computed\n// from Highcharts.Chart on each render, and reused for downstream computations for better efficiency.\nexport class ChartAPI {\n public context = createChartContext();\n private chartExtraHighlight = new ChartExtraHighlight(this.context);\n private chartExtraTooltip = new ChartExtraTooltip(this.context);\n private chartExtraNavigation = new ChartExtraNavigation(this.context, this.navigationHandlers);\n private chartExtraPointer = new ChartExtraPointer(this.context, this.pointerHandlers);\n private chartExtraLegend = new ChartExtraLegend(this.context);\n private chartExtraNodata = new ChartExtraNodata(this.context);\n private chartExtraAxisTitles = new ChartExtraAxisTitles(this.context);\n\n constructor(\n settings: ChartExtraContext.Settings,\n handlers: ChartExtraContext.Handlers,\n state: ChartExtraContext.State,\n ) {\n this.context.settings = settings;\n this.context.handlers = handlers;\n this.context.state = state;\n }\n\n // The ready() returns true if the chart is initialized and helper methods are safe to use (after Highcharts triggers onChartRender).\n // Using any of the helper methods before the chart is initialized will result in an exception.\n public get ready() {\n return !!this.context.chartOrNull;\n }\n\n // The Highcharts options to be merged with the rest of the configuration defined in the chart-core.\n public getOptions() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const chartAPI = this;\n const onChartLoad: Highcharts.ChartLoadCallbackFunction = function (this) {\n chartAPI.chartExtraPointer.onChartLoad(this);\n };\n const onChartRender: Highcharts.ChartRenderCallbackFunction = function (this) {\n updateChartContext(chartAPI.context, this);\n chartAPI.chartExtraHighlight.onChartRender();\n chartAPI.chartExtraLegend.onChartRender();\n chartAPI.chartExtraNodata.onChartRender();\n chartAPI.chartExtraAxisTitles.onChartRender();\n chartAPI.chartExtraTooltip.onChartRender();\n chartAPI.handleDestroyedPoints();\n chartAPI.resetColorCounter();\n chartAPI.showMarkersForIsolatedPoints();\n };\n const onChartClick: Highcharts.ChartClickCallbackFunction = function () {\n chartAPI.chartExtraPointer.onChartClick(this.hoverPoint);\n };\n const onSeriesPointMouseOver: Highcharts.PointMouseOverCallbackFunction = function () {\n chartAPI.chartExtraPointer.onSeriesPointMouseOver(this);\n };\n const onSeriesPointMouseOut: Highcharts.PointMouseOutCallbackFunction = function () {\n chartAPI.chartExtraPointer.onSeriesPointMouseOut();\n };\n const onSeriesPointClick: Highcharts.PointClickCallbackFunction = function () {\n chartAPI.chartExtraPointer.onSeriesPointClick(this);\n };\n return {\n onChartLoad,\n onChartRender,\n onChartClick,\n onSeriesPointMouseOver,\n onSeriesPointMouseOut,\n onSeriesPointClick,\n };\n }\n\n // There is no cleanup or destroy event in Highcharts options, so we define a custom one\n // to be used when the React component unmounts.\n public onChartDestroy = () => {\n this.chartExtraNavigation.onChartDestroy();\n this.chartExtraPointer.onChartDestroy();\n this.chartExtraTooltip.onChartDestroy();\n };\n\n // Reactive state stores.\n public get tooltipStore() {\n return this.chartExtraTooltip as ReadonlyAsyncStore<ReactiveTooltipState>;\n }\n public get legendStore() {\n return this.chartExtraLegend as ReadonlyAsyncStore<ReactiveLegendState>;\n }\n public get nodataStore() {\n return this.chartExtraNodata as ReadonlyAsyncStore<ReactiveNodataState>;\n }\n public get axisTitlesStore() {\n return this.chartExtraAxisTitles as ReadonlyAsyncStore<ReactiveAxisTitlesState>;\n }\n\n // References to SVG elements used for tooltip placement.\n public getTargetTrack = this.chartExtraTooltip.getTargetTrack.bind(this.chartExtraTooltip);\n public getGroupTrack = this.chartExtraTooltip.getGroupTrack.bind(this.chartExtraTooltip);\n\n // Legend marker renderer.\n public renderMarker = this.chartExtraLegend.renderMarker.bind(this.chartExtraLegend);\n\n // Callbacks assigned to the tooltip.\n public onMouseEnterTooltip = this.chartExtraPointer.onMouseEnterTooltip.bind(this.chartExtraPointer);\n public onMouseLeaveTooltip = this.chartExtraPointer.onMouseLeaveTooltip.bind(this.chartExtraPointer);\n public onDismissTooltip = (outsideClick?: boolean) => {\n const { pinned, point, group } = this.chartExtraTooltip.get();\n if (pinned) {\n this.chartExtraTooltip.hideTooltip();\n // The chart highlight is preserved while the tooltip is pinned. We need to clear it manually here, for the case\n // when the pointer lands outside the chart after the tooltip is dismissed, so that the mouse-out event won't fire.\n this.clearChartHighlight({ isApiCall: false });\n // If the tooltip was not dismissed by clicking outside, we bring focus to the point or group, that was\n // associated with the tooltip, so that we user can continue keyboard navigation from that spot.\n if (!outsideClick) {\n this.chartExtraNavigation.focusApplication(point, group);\n }\n }\n };\n\n // Hide the tooltip from an action initiated by the tooltip's content\n public hideTooltip = () => {\n this.chartExtraTooltip.hideTooltip();\n // The chart highlight is preserved while the tooltip is pinned. We need to clear it manually here, for the case\n // when the pointer lands outside the chart after the tooltip is dismissed, so that the mouse-out event won't fire.\n this.clearChartHighlight({ isApiCall: false });\n };\n\n // Reference to the role=\"application\" element used for navigation.\n public setApplication = this.chartExtraNavigation.setApplication.bind(this.chartExtraNavigation);\n\n // A callback to notify the helper when items visibility state changes.\n public updateItemsVisibility = this.chartExtraLegend.updateItemsVisibility.bind(this.chartExtraLegend);\n\n // A callback used by the legend and filter components when series/segments visibility changes.\n public onItemVisibilityChange = (items: readonly string[], detail: CoreChartProps.InteractionKind) =>\n this.chartExtraLegend.onItemVisibilityChange(items, detail);\n\n // Callbacks used by the legend component when items highlight state changes.\n public onHighlightChartItems = (itemIds: readonly string[]) => {\n if (!this.isTooltipPinned) {\n this.chartExtraHighlight.highlightChartItems(itemIds);\n this.chartExtraLegend.onHighlightItems(itemIds);\n }\n };\n public onClearChartItemsHighlight = () => {\n if (!this.isTooltipPinned) {\n this.chartExtraHighlight.clearChartItemsHighlight();\n this.chartExtraLegend.onClearHighlight();\n\n // Notify the consumer that a clear-highlight action was made.\n fireNonCancelableEvent(this.context.handlers.onClearHighlight, { isApiCall: false });\n }\n };\n\n // Callbacks used for hover and keyboard navigation, and also exposed to the public API to give the ability\n // to highlight and show tooltip for the given point or group manually.\n public highlightChartItems = (itemIds: readonly string[]) => {\n if (!this.isTooltipPinned) {\n this.chartExtraHighlight.highlightChartItems(itemIds);\n this.chartExtraLegend.onHighlightItems(itemIds);\n }\n };\n public setItemsVisible = (visibleItemsIds: readonly string[]) => {\n this.chartExtraLegend.onItemVisibilityChange(visibleItemsIds, { interactionType: \"api\" });\n };\n public highlightChartPoint = (point: Highcharts.Point, { isApiCall }: { isApiCall: boolean }) => {\n if (!this.isTooltipPinned) {\n this.highlightActions(point, { isApiCall });\n }\n };\n public highlightChartGroup = (group: readonly Highcharts.Point[], { isApiCall }: { isApiCall: boolean }) => {\n if (!this.isTooltipPinned) {\n this.highlightActions(group as Writeable<Highcharts.Point[]>, { isApiCall });\n }\n };\n public clearChartHighlight = ({ isApiCall }: { isApiCall: boolean }) => {\n if (!this.isTooltipPinned) {\n this.clearHighlightActions({ isApiCall });\n }\n };\n public get publicApi() {\n return {\n highlightItems: (itemIds: readonly string[]) => this.highlightChartItems(itemIds),\n setItemsVisible: (visibleItemIds: readonly string[]) => this.setItemsVisible(visibleItemIds),\n highlightChartPoint: (point: Highcharts.Point) => this.highlightChartPoint(point, { isApiCall: true }),\n highlightChartGroup: (group: readonly Highcharts.Point[]) => this.highlightChartGroup(group, { isApiCall: true }),\n clearChartHighlight: () => this.clearChartHighlight({ isApiCall: true }),\n };\n }\n\n // A set of callbacks required for keyboard navigation.\n private get navigationHandlers(): ChartExtraNavigationHandlers {\n return {\n onFocusChart: () => {\n this.clearChartHighlight({ isApiCall: false });\n this.chartExtraNavigation.announceChart(getChartAccessibleDescription(this.context.chart()));\n },\n onDismissHoverTooltip: () => {\n // Dismiss any visible non-pinned tooltip when ESC is pressed.\n // Returns true if a tooltip was dismissed, false otherwise.\n // Used by ESC handlers at group/point level to decide whether to also navigate.\n const tooltipState = this.chartExtraTooltip.get();\n if (tooltipState.visible && !tooltipState.pinned) {\n this.clearChartHighlight({ isApiCall: false });\n return true;\n }\n return false;\n },\n onFocusGroup: (group: Highcharts.Point[]) => {\n this.highlightActions(group, { isApiCall: false, overrideTooltipLock: true });\n this.chartExtraNavigation.announceElement(getGroupAccessibleDescription(group), false);\n },\n onFocusPoint: (point: Highcharts.Point) => {\n const labels = this.context.settings.labels;\n this.highlightActions(point, { isApiCall: false, overrideTooltipLock: true });\n this.chartExtraNavigation.announceElement(getPointAccessibleDescription(point, labels), false);\n },\n onBlur: () => this.clearChartHighlight({ isApiCall: false }),\n onActivateGroup: () => {\n const current = this.chartExtraTooltip.get();\n if (current.group.length > 0) {\n this.chartExtraTooltip.pinTooltip();\n this.chartExtraNavigation.announceElement(getGroupAccessibleDescription(current.group), true);\n }\n },\n onActivatePoint: () => {\n const current = this.chartExtraTooltip.get();\n if (current.point) {\n const labels = this.context.settings.labels;\n this.chartExtraTooltip.pinTooltip();\n this.chartExtraNavigation.announceElement(getPointAccessibleDescription(current.point, labels), true);\n }\n },\n };\n }\n\n // A set of callbacks required for pointer navigation.\n private get pointerHandlers(): ChartExtraPointerHandlers {\n return {\n onPointHover: (point) => {\n this.highlightChartPoint(point, { isApiCall: false });\n },\n onGroupHover: (group) => {\n this.highlightChartGroup(group, { isApiCall: false });\n },\n onHoverLost: () => {\n this.clearChartHighlight({ isApiCall: false });\n },\n onPointClick: (point) => {\n this.pinTooltipOnPoint(point);\n },\n onGroupClick: (group) => {\n this.pinTooltipOnGroup(group);\n },\n };\n }\n\n // Area- or line series can be defined with just a single point, or include missing data (y=null) in such\n // a way, that certain points become isolated. As we prefer the markers to not be shown for area- and line\n // series by default, those points become invisible, unless hovered. To fix this, we use the function below,\n // that finds isolates points and overrides the marker.enabled configuration for those.\n // See: https://github.com/highcharts/highcharts/issues/1210.\n private showMarkersForIsolatedPoints() {\n let shouldRedraw = false;\n for (const s of this.context.chart().series) {\n const seriesData = getSeriesData(s.data);\n for (let i = 0; i < seriesData.length; i++) {\n const isEligibleSeries = !isXThreshold(s) && s.type !== \"scatter\" && !seriesData[i].options.marker?.enabled;\n if (\n isEligibleSeries &&\n (seriesData[i - 1]?.y === undefined || seriesData[i - 1]?.y === null) &&\n (seriesData[i + 1]?.y === undefined || seriesData[i + 1]?.y === null)\n ) {\n seriesData[i].update({ marker: { enabled: true } }, false);\n shouldRedraw = true;\n }\n }\n }\n if (shouldRedraw) {\n this.context.chart().redraw();\n }\n }\n\n // Highcharts sometimes destroys points upon re-rendering. As result, the already stored points can get\n // replaced by `{ destroyed: true }`. This can affect the tooltip state, making the component crash when\n // obtaining data from points, or making it hidden yet pinned, so not visible on hover until a click is made.\n // To prevent these issues, on each render we check for destroyed points in the tooltip state, and proactively\n // hide the tooltip if found. The behavior is only observed during the initial chart loading, and is not expected\n // to cause UX issues with the tooltip being closed unexpectedly.\n // See: https://github.com/highcharts/highcharts/issues/23175.\n private handleDestroyedPoints() {\n const tooltipState = this.chartExtraTooltip.get();\n if (tooltipState.group.some((p) => !p.series)) {\n this.chartExtraTooltip.hideTooltip();\n }\n }\n\n // We reset color counter so that when a series is removed and then added back - it will\n // have the same color as before, not the next one in the color sequence.\n // See: https://github.com/highcharts/highcharts/issues/23077.\n private resetColorCounter() {\n const chart = this.context.chart();\n if (\"colorCounter\" in chart && typeof chart.colorCounter === \"number\") {\n chart.colorCounter = getChartSeries(chart.series).length;\n }\n }\n\n private pinTooltipOnPoint = (point: Highcharts.Point) => {\n const currentPoint = this.chartExtraTooltip.get().point;\n const currentGroup = this.chartExtraTooltip.get().group;\n const positionsMatch = isPointsPositionsEqual(currentPoint ?? currentGroup[0], point);\n\n // If the previously hovered and now clicked positions match, and the the tooltip wasn't\n // dismissed just a moment ago, we make the tooltip pinned in this position.\n if (positionsMatch && !this.chartExtraTooltip.tooltipLock) {\n this.highlightActions(point, { isApiCall: false });\n this.chartExtraTooltip.pinTooltip();\n }\n // If the tooltip was just dismissed, it means this happened by clicking somewhere in the plot area.\n // If the clicked position differs from the one that was pinned - we show tooltip in the new position.\n else if (!positionsMatch && this.chartExtraTooltip.tooltipLock) {\n this.highlightActions(point, { isApiCall: false, overrideTooltipLock: true });\n }\n };\n\n private pinTooltipOnGroup = (group: Highcharts.Point[]) => {\n const currentPoint = this.chartExtraTooltip.get().point;\n const currentGroup = this.chartExtraTooltip.get().group;\n const positionsMatch = isPointsPositionsEqual(currentPoint ?? currentGroup[0], group[0]);\n\n // If the previously hovered and now clicked positions match, and the the tooltip wasn't\n // dismissed just a moment ago, we make the tooltip pinned in this position.\n if (positionsMatch && !this.chartExtraTooltip.tooltipLock) {\n this.highlightActions(group, { isApiCall: false });\n this.chartExtraTooltip.pinTooltip();\n }\n // If the tooltip was just dismissed, it means this happened by clicking somewhere in the plot area.\n // If the clicked position differs from the one that was pinned - we show tooltip in the new position.\n else if (!positionsMatch && this.chartExtraTooltip.tooltipLock) {\n this.highlightActions(group, { isApiCall: false, overrideTooltipLock: true });\n }\n };\n\n private highlightActions(\n target: Highcharts.Point | Highcharts.Point[],\n { isApiCall, overrideTooltipLock }: { isApiCall: boolean; overrideTooltipLock?: boolean },\n ) {\n const point = Array.isArray(target) ? null : target;\n const group = Array.isArray(target) ? target : this.context.derived.getPointsByX(target.x);\n\n if (!this.isTooltipPinned) {\n // Update Highcharts elements state.\n if (point) {\n this.chartExtraHighlight.highlightChartPoint(point);\n } else {\n this.chartExtraHighlight.highlightChartGroup(group);\n }\n\n // Update tooltip and legend state.\n if (point) {\n this.chartExtraLegend.onHighlightPoint(point);\n this.chartExtraTooltip.showTooltipOnPoint(point, group, overrideTooltipLock);\n } else {\n this.chartExtraLegend.onHighlightGroup(group);\n this.chartExtraTooltip.showTooltipOnGroup(group, overrideTooltipLock);\n }\n\n // Notify the consumer that a highlight action was made.\n fireNonCancelableEvent(this.context.handlers.onHighlight, { point, group, isApiCall });\n }\n }\n\n private clearHighlightActions = ({ isApiCall }: { isApiCall: boolean }) => {\n if (!this.isTooltipPinned) {\n // Update Highcharts elements state.\n this.chartExtraHighlight.clearChartItemsHighlight();\n\n // Update tooltip and legend state.\n this.chartExtraTooltip.hideTooltip();\n this.chartExtraLegend.onClearHighlight();\n\n // Notify the consumer that a clear-highlight action was made.\n fireNonCancelableEvent(this.context.handlers.onClearHighlight, { isApiCall });\n }\n };\n\n private get isTooltipPinned() {\n return this.chartExtraTooltip.get().pinned;\n }\n}\n\nfunction isPointsPositionsEqual(current?: Highcharts.Point, next?: Highcharts.Point) {\n return current?.x === next?.x && current?.y === next?.y;\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/chart-api/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAGhF,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,EAC7B,6BAA6B,EAC7B,YAAY,GACb,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,oBAAoB,EAA2B,MAAM,2BAA2B,CAAC;AAC1F,OAAO,EAAqB,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAClG,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAuB,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAgC,MAAM,0BAA0B,CAAC;AAC9F,OAAO,EAAE,gBAAgB,EAAuB,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAA6B,MAAM,uBAAuB,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAwB,MAAM,uBAAuB,CAAC;AAEhF,mGAAmG;AACnG,kGAAkG;AAClG,qEAAqE;AACrE,MAAM,UAAU,WAAW,CACzB,QAAoC,EACpC,QAAoC,EACpC,KAA8B;IAE9B,gGAAgG;IAChG,iGAAiG;IACjG,2DAA2D;IAC3D,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC;IACpE,oGAAoG;IACpG,uGAAuG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E,CAAC,OAAK,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,CAAC,CAAA,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,CAAC,OAAK,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,CAAC,CAAA,CAAC;AAC1D,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useEffect, useRef } from \"react\";\nimport type Highcharts from \"highcharts\";\n\nimport { fireNonCancelableEvent } from \"../../internal/events\";\nimport { ReadonlyAsyncStore } from \"../../internal/utils/async-store\";\nimport { getChartSeries, getSeriesData } from \"../../internal/utils/highcharts\";\nimport { Writeable } from \"../../internal/utils/utils\";\nimport { CoreChartProps } from \"../interfaces\";\nimport {\n getChartAccessibleDescription,\n getGroupAccessibleDescription,\n getPointAccessibleDescription,\n isXThreshold,\n} from \"../utils\";\nimport { ChartExtraAxisTitles, ReactiveAxisTitlesState } from \"./chart-extra-axis-titles\";\nimport { ChartExtraContext, createChartContext, updateChartContext } from \"./chart-extra-context\";\nimport { ChartExtraHighlight } from \"./chart-extra-highlight\";\nimport { ChartExtraLegend, ReactiveLegendState } from \"./chart-extra-legend\";\nimport { ChartExtraNavigation, ChartExtraNavigationHandlers } from \"./chart-extra-navigation\";\nimport { ChartExtraNodata, ReactiveNodataState } from \"./chart-extra-nodata\";\nimport { ChartExtraPointer, ChartExtraPointerHandlers } from \"./chart-extra-pointer\";\nimport { ChartExtraTooltip, ReactiveTooltipState } from \"./chart-extra-tooltip\";\n\n// The API helper injects Cloudscape custom behaviors, and returns the API instance that comes with\n// reactive state and handlers to be assigned as Highcharts options, used by Cloudscape components\n// (tooltip, legend, and other), or exposed as public core chart API.\nexport function useChartAPI(\n settings: ChartExtraContext.Settings,\n handlers: ChartExtraContext.Handlers,\n state: ChartExtraContext.State,\n) {\n // The API helper instance defines many pieces of internal state with different lifecycles, most\n // of which are not be invalidated when the hook re-renders, or properties change. That is why we\n // create the instance once, when the component is mounted.\n const api = useRef(new ChartAPI(settings, handlers, state)).current;\n // The consumer-defined properties can still change during the component lifecycle. We propagate the\n // changes by updating the helper's context directly. That is fine for most of the properties, as those\n // are only used in event-based callbacks, and require nothing to recompute when there is a change.\n useEffect(() => {\n api.context.settings = settings;\n api.context.handlers = handlers;\n api.context.state = state;\n });\n\n // The only property that does require notifying the helper when it changes, is the visible items state.\n // We stringify the visible items array so that it is compared by value, and the effect is only fired when\n // there is an actual change to the visible items, including items order.\n const visibleItemsIndex = state.visibleItems ? state.visibleItems.join(\"::\") : null;\n useEffect(() => {\n // When visibleItemsIndex === null, it means the visible items state is managed internally inside the helper,\n // so no need to call the API method.\n // The api.updateItemsVisibility() can only be used once the chart is initialized, so we check for api.ready.\n // The initialization happens after the first React render, so the chart is expected to not be ready when the\n // effect is called for the first time. This is fine, as the initial visibility state is handled by the helper.\n // The code below is needed to notify the helper any time the visible items state changes.\n if (api.ready && visibleItemsIndex !== null) {\n api.updateItemsVisibility();\n }\n }, [api, visibleItemsIndex]);\n\n // Run cleanup code when the component unmounts.\n useEffect(() => () => api.onChartDestroy(), [api]);\n\n return api;\n}\n\n// The main chart helper that provides customizations to Highcharts, including tooltip, legend, keyboard navigation, and more.\n// It is split into multiple dedicated (chart-extra) helpers (highlight, tooltip, navigation, and other), most of which define\n// internal state, and have a lifecycle based on Highcharts render event.\n// The helper code has a shared context, which includes the consumer settings, visible items state, and derived state, computed\n// from Highcharts.Chart on each render, and reused for downstream computations for better efficiency.\nexport class ChartAPI {\n public context = createChartContext();\n private chartExtraHighlight = new ChartExtraHighlight(this.context);\n private chartExtraTooltip = new ChartExtraTooltip(this.context);\n private chartExtraNavigation = new ChartExtraNavigation(this.context, this.navigationHandlers);\n private chartExtraPointer = new ChartExtraPointer(this.context, this.pointerHandlers);\n private chartExtraLegend = new ChartExtraLegend(this.context);\n private chartExtraNodata = new ChartExtraNodata(this.context);\n private chartExtraAxisTitles = new ChartExtraAxisTitles(this.context);\n\n constructor(\n settings: ChartExtraContext.Settings,\n handlers: ChartExtraContext.Handlers,\n state: ChartExtraContext.State,\n ) {\n this.context.settings = settings;\n this.context.handlers = handlers;\n this.context.state = state;\n }\n\n // The ready() returns true if the chart is initialized and helper methods are safe to use (after Highcharts triggers onChartRender).\n // Using any of the helper methods before the chart is initialized will result in an exception.\n public get ready() {\n return !!this.context.chartOrNull;\n }\n\n // The Highcharts options to be merged with the rest of the configuration defined in the chart-core.\n public getOptions() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const chartAPI = this;\n const onChartLoad: Highcharts.ChartLoadCallbackFunction = function (this) {\n chartAPI.chartExtraPointer.onChartLoad(this);\n };\n const onChartRender: Highcharts.ChartRenderCallbackFunction = function (this) {\n updateChartContext(chartAPI.context, this);\n chartAPI.chartExtraHighlight.onChartRender();\n chartAPI.chartExtraLegend.onChartRender();\n chartAPI.chartExtraNodata.onChartRender();\n chartAPI.chartExtraAxisTitles.onChartRender();\n chartAPI.chartExtraTooltip.onChartRender();\n chartAPI.handleDestroyedPoints();\n chartAPI.resetColorCounter();\n chartAPI.showMarkersForIsolatedPoints();\n };\n const onChartClick: Highcharts.ChartClickCallbackFunction = function () {\n chartAPI.chartExtraPointer.onChartClick(this.hoverPoint);\n };\n const onSeriesPointMouseOver: Highcharts.PointMouseOverCallbackFunction = function () {\n chartAPI.chartExtraPointer.onSeriesPointMouseOver(this);\n };\n const onSeriesPointMouseOut: Highcharts.PointMouseOutCallbackFunction = function () {\n chartAPI.chartExtraPointer.onSeriesPointMouseOut();\n };\n const onSeriesPointClick: Highcharts.PointClickCallbackFunction = function () {\n chartAPI.chartExtraPointer.onSeriesPointClick(this);\n };\n return {\n onChartLoad,\n onChartRender,\n onChartClick,\n onSeriesPointMouseOver,\n onSeriesPointMouseOut,\n onSeriesPointClick,\n };\n }\n\n // There is no cleanup or destroy event in Highcharts options, so we define a custom one\n // to be used when the React component unmounts.\n public onChartDestroy = () => {\n this.chartExtraNavigation.onChartDestroy();\n this.chartExtraPointer.onChartDestroy();\n this.chartExtraTooltip.onChartDestroy();\n };\n\n // Reactive state stores.\n public get tooltipStore() {\n return this.chartExtraTooltip as ReadonlyAsyncStore<ReactiveTooltipState>;\n }\n public get legendStore() {\n return this.chartExtraLegend as ReadonlyAsyncStore<ReactiveLegendState>;\n }\n public get nodataStore() {\n return this.chartExtraNodata as ReadonlyAsyncStore<ReactiveNodataState>;\n }\n public get axisTitlesStore() {\n return this.chartExtraAxisTitles as ReadonlyAsyncStore<ReactiveAxisTitlesState>;\n }\n\n // References to SVG elements used for tooltip placement.\n public getTargetTrack = this.chartExtraTooltip.getTargetTrack.bind(this.chartExtraTooltip);\n public getGroupTrack = this.chartExtraTooltip.getGroupTrack.bind(this.chartExtraTooltip);\n\n // Legend marker renderer.\n public renderMarker = this.chartExtraLegend.renderMarker.bind(this.chartExtraLegend);\n\n // Callbacks assigned to the tooltip.\n public onMouseEnterTooltip = this.chartExtraPointer.onMouseEnterTooltip.bind(this.chartExtraPointer);\n public onMouseLeaveTooltip = this.chartExtraPointer.onMouseLeaveTooltip.bind(this.chartExtraPointer);\n public onDismissTooltip = (outsideClick?: boolean) => {\n const { pinned, point, group } = this.chartExtraTooltip.get();\n if (pinned) {\n this.chartExtraTooltip.hideTooltip();\n // The chart highlight is preserved while the tooltip is pinned. We need to clear it manually here, for the case\n // when the pointer lands outside the chart after the tooltip is dismissed, so that the mouse-out event won't fire.\n this.clearChartHighlight({ isApiCall: false });\n // If the tooltip was not dismissed by clicking outside, we bring focus to the point or group, that was\n // associated with the tooltip, so that we user can continue keyboard navigation from that spot.\n if (!outsideClick) {\n this.chartExtraNavigation.focusApplication(point, group);\n }\n }\n };\n\n // Hide the tooltip from an action initiated by the tooltip's content\n public hideTooltip = () => {\n this.chartExtraTooltip.hideTooltip();\n // The chart highlight is preserved while the tooltip is pinned. We need to clear it manually here, for the case\n // when the pointer lands outside the chart after the tooltip is dismissed, so that the mouse-out event won't fire.\n this.clearChartHighlight({ isApiCall: false });\n };\n\n // Reference to the role=\"application\" element used for navigation.\n public setApplication = this.chartExtraNavigation.setApplication.bind(this.chartExtraNavigation);\n\n // A callback to notify the helper when items visibility state changes.\n public updateItemsVisibility = this.chartExtraLegend.updateItemsVisibility.bind(this.chartExtraLegend);\n\n // A callback used by the legend and filter components when series/segments visibility changes.\n public onItemVisibilityChange = (items: readonly string[], detail: CoreChartProps.InteractionKind) =>\n this.chartExtraLegend.onItemVisibilityChange(items, detail);\n\n // Callbacks used by the legend component when items highlight state changes.\n public onHighlightChartItems = (itemIds: readonly string[]) => {\n if (!this.isTooltipPinned) {\n this.chartExtraHighlight.highlightChartItems(itemIds);\n this.chartExtraLegend.onHighlightItems(itemIds);\n }\n };\n public onClearChartItemsHighlight = () => {\n if (!this.isTooltipPinned) {\n this.chartExtraHighlight.clearChartItemsHighlight();\n this.chartExtraLegend.onClearHighlight();\n\n // Notify the consumer that a clear-highlight action was made.\n fireNonCancelableEvent(this.context.handlers.onClearHighlight, { isApiCall: false });\n }\n };\n\n // Callbacks used for hover and keyboard navigation, and also exposed to the public API to give the ability\n // to highlight and show tooltip for the given point or group manually.\n public highlightChartItems = (itemIds: readonly string[]) => {\n if (!this.isTooltipPinned) {\n this.chartExtraHighlight.highlightChartItems(itemIds);\n this.chartExtraLegend.onHighlightItems(itemIds);\n }\n };\n public setItemsVisible = (visibleItemsIds: readonly string[]) => {\n this.chartExtraLegend.onItemVisibilityChange(visibleItemsIds, { interactionType: \"api\" });\n };\n public highlightChartPoint = (point: Highcharts.Point, { isApiCall }: { isApiCall: boolean }) => {\n if (!this.isTooltipPinned) {\n this.highlightActions(point, { isApiCall });\n }\n };\n public highlightChartGroup = (group: readonly Highcharts.Point[], { isApiCall }: { isApiCall: boolean }) => {\n if (!this.isTooltipPinned) {\n this.highlightActions(group as Writeable<Highcharts.Point[]>, { isApiCall });\n }\n };\n public clearChartHighlight = ({ isApiCall }: { isApiCall: boolean }) => {\n if (!this.isTooltipPinned) {\n this.clearHighlightActions({ isApiCall });\n }\n };\n public get publicApi() {\n return {\n highlightItems: (itemIds: readonly string[]) => this.highlightChartItems(itemIds),\n setItemsVisible: (visibleItemIds: readonly string[]) => this.setItemsVisible(visibleItemIds),\n highlightChartPoint: (point: Highcharts.Point) => this.highlightChartPoint(point, { isApiCall: true }),\n highlightChartGroup: (group: readonly Highcharts.Point[]) => this.highlightChartGroup(group, { isApiCall: true }),\n clearChartHighlight: () => this.clearChartHighlight({ isApiCall: true }),\n };\n }\n\n // A set of callbacks required for keyboard navigation.\n private get navigationHandlers(): ChartExtraNavigationHandlers {\n return {\n onFocusChart: () => {\n this.clearChartHighlight({ isApiCall: false });\n this.chartExtraNavigation.announceChart(getChartAccessibleDescription(this.context.chart()));\n },\n onDismissHoverTooltip: () => {\n // Dismiss any visible non-pinned tooltip when ESC is pressed.\n // Returns true if a tooltip was dismissed, false otherwise.\n // Used by ESC handlers at group/point level to decide whether to also navigate.\n const tooltipState = this.chartExtraTooltip.get();\n if (tooltipState.visible && !tooltipState.pinned) {\n this.clearChartHighlight({ isApiCall: false });\n return true;\n }\n return false;\n },\n onFocusGroup: (group: Highcharts.Point[]) => {\n this.highlightActions(group, { isApiCall: false, overrideTooltipLock: true });\n this.chartExtraNavigation.announceElement(getGroupAccessibleDescription(group), false);\n },\n onFocusPoint: (point: Highcharts.Point) => {\n const labels = this.context.settings.labels;\n this.highlightActions(point, { isApiCall: false, overrideTooltipLock: true });\n this.chartExtraNavigation.announceElement(getPointAccessibleDescription(point, labels), false);\n },\n onBlur: () => this.clearChartHighlight({ isApiCall: false }),\n onActivateGroup: () => {\n const current = this.chartExtraTooltip.get();\n if (current.group.length > 0) {\n this.chartExtraTooltip.pinTooltip();\n this.chartExtraNavigation.announceElement(getGroupAccessibleDescription(current.group), true);\n }\n },\n onActivatePoint: () => {\n const current = this.chartExtraTooltip.get();\n if (current.point) {\n const labels = this.context.settings.labels;\n this.chartExtraTooltip.pinTooltip();\n this.chartExtraNavigation.announceElement(getPointAccessibleDescription(current.point, labels), true);\n }\n },\n };\n }\n\n // A set of callbacks required for pointer navigation.\n private get pointerHandlers(): ChartExtraPointerHandlers {\n return {\n onPointHover: (point) => {\n this.highlightChartPoint(point, { isApiCall: false });\n },\n onGroupHover: (group) => {\n this.highlightChartGroup(group, { isApiCall: false });\n },\n onHoverLost: () => {\n this.clearChartHighlight({ isApiCall: false });\n },\n onPointClick: (point) => {\n this.pinTooltipOnPoint(point);\n },\n onGroupClick: (group) => {\n this.pinTooltipOnGroup(group);\n },\n };\n }\n\n // Area- or line series can be defined with just a single point, or include missing data (y=null) in such\n // a way, that certain points become isolated. As we prefer the markers to not be shown for area- and line\n // series by default, those points become invisible, unless hovered. To fix this, we use the function below,\n // that finds isolates points and overrides the marker.enabled configuration for those.\n // See: https://github.com/highcharts/highcharts/issues/1210.\n private showMarkersForIsolatedPoints() {\n let shouldRedraw = false;\n for (const s of getChartSeries(this.context.chart())) {\n const seriesData = getSeriesData(s);\n for (let i = 0; i < seriesData.length; i++) {\n const isEligibleSeries = !isXThreshold(s) && s.type !== \"scatter\" && !seriesData[i].options.marker?.enabled;\n if (\n isEligibleSeries &&\n (seriesData[i - 1]?.y === undefined || seriesData[i - 1]?.y === null) &&\n (seriesData[i + 1]?.y === undefined || seriesData[i + 1]?.y === null)\n ) {\n seriesData[i].update({ marker: { enabled: true } }, false);\n shouldRedraw = true;\n }\n }\n }\n if (shouldRedraw) {\n this.context.chart().redraw();\n }\n }\n\n // Highcharts sometimes destroys points upon re-rendering. As result, the already stored points can get\n // replaced by `{ destroyed: true }`. This can affect the tooltip state, making the component crash when\n // obtaining data from points, or making it hidden yet pinned, so not visible on hover until a click is made.\n // To prevent these issues, on each render we check for destroyed points in the tooltip state, and proactively\n // hide the tooltip if found. The behavior is only observed during the initial chart loading, and is not expected\n // to cause UX issues with the tooltip being closed unexpectedly.\n // See: https://github.com/highcharts/highcharts/issues/23175.\n private handleDestroyedPoints() {\n const tooltipState = this.chartExtraTooltip.get();\n if (tooltipState.group.some((p) => !p.series)) {\n this.chartExtraTooltip.hideTooltip();\n }\n }\n\n // We reset color counter so that when a series is removed and then added back - it will\n // have the same color as before, not the next one in the color sequence.\n // See: https://github.com/highcharts/highcharts/issues/23077.\n private resetColorCounter() {\n const chart = this.context.chart();\n if (\"colorCounter\" in chart && typeof chart.colorCounter === \"number\") {\n chart.colorCounter = getChartSeries(chart).length;\n }\n }\n\n private pinTooltipOnPoint = (point: Highcharts.Point) => {\n const currentPoint = this.chartExtraTooltip.get().point;\n const currentGroup = this.chartExtraTooltip.get().group;\n const positionsMatch = isPointsPositionsEqual(currentPoint ?? currentGroup[0], point);\n\n // If the previously hovered and now clicked positions match, and the the tooltip wasn't\n // dismissed just a moment ago, we make the tooltip pinned in this position.\n if (positionsMatch && !this.chartExtraTooltip.tooltipLock) {\n this.highlightActions(point, { isApiCall: false });\n this.chartExtraTooltip.pinTooltip();\n }\n // If the tooltip was just dismissed, it means this happened by clicking somewhere in the plot area.\n // If the clicked position differs from the one that was pinned - we show tooltip in the new position.\n else if (!positionsMatch && this.chartExtraTooltip.tooltipLock) {\n this.highlightActions(point, { isApiCall: false, overrideTooltipLock: true });\n }\n };\n\n private pinTooltipOnGroup = (group: Highcharts.Point[]) => {\n const currentPoint = this.chartExtraTooltip.get().point;\n const currentGroup = this.chartExtraTooltip.get().group;\n const positionsMatch = isPointsPositionsEqual(currentPoint ?? currentGroup[0], group[0]);\n\n // If the previously hovered and now clicked positions match, and the the tooltip wasn't\n // dismissed just a moment ago, we make the tooltip pinned in this position.\n if (positionsMatch && !this.chartExtraTooltip.tooltipLock) {\n this.highlightActions(group, { isApiCall: false });\n this.chartExtraTooltip.pinTooltip();\n }\n // If the tooltip was just dismissed, it means this happened by clicking somewhere in the plot area.\n // If the clicked position differs from the one that was pinned - we show tooltip in the new position.\n else if (!positionsMatch && this.chartExtraTooltip.tooltipLock) {\n this.highlightActions(group, { isApiCall: false, overrideTooltipLock: true });\n }\n };\n\n private highlightActions(\n target: Highcharts.Point | Highcharts.Point[],\n { isApiCall, overrideTooltipLock }: { isApiCall: boolean; overrideTooltipLock?: boolean },\n ) {\n const point = Array.isArray(target) ? null : target;\n const group = Array.isArray(target) ? target : this.context.derived.getPointsByX(target.x);\n\n if (!this.isTooltipPinned) {\n // Update Highcharts elements state.\n if (point) {\n this.chartExtraHighlight.highlightChartPoint(point);\n } else {\n this.chartExtraHighlight.highlightChartGroup(group);\n }\n\n // Update tooltip and legend state.\n if (point) {\n this.chartExtraLegend.onHighlightPoint(point);\n this.chartExtraTooltip.showTooltipOnPoint(point, group, overrideTooltipLock);\n } else {\n this.chartExtraLegend.onHighlightGroup(group);\n this.chartExtraTooltip.showTooltipOnGroup(group, overrideTooltipLock);\n }\n\n // Notify the consumer that a highlight action was made.\n fireNonCancelableEvent(this.context.handlers.onHighlight, { point, group, isApiCall });\n }\n }\n\n private clearHighlightActions = ({ isApiCall }: { isApiCall: boolean }) => {\n if (!this.isTooltipPinned) {\n // Update Highcharts elements state.\n this.chartExtraHighlight.clearChartItemsHighlight();\n\n // Update tooltip and legend state.\n this.chartExtraTooltip.hideTooltip();\n this.chartExtraLegend.onClearHighlight();\n\n // Notify the consumer that a clear-highlight action was made.\n fireNonCancelableEvent(this.context.handlers.onClearHighlight, { isApiCall });\n }\n };\n\n private get isTooltipPinned() {\n return this.chartExtraTooltip.get().pinned;\n }\n}\n\nfunction isPointsPositionsEqual(current?: Highcharts.Point, next?: Highcharts.Point) {\n return current?.x === next?.x && current?.y === next?.y;\n}\n"]}
@@ -8,8 +8,7 @@ import { InternalChartTooltip } from "@cloudscape-design/components/internal/do-
8
8
  import LiveRegion from "@cloudscape-design/components/live-region";
9
9
  import ChartSeriesDetails from "../../internal/components/series-details";
10
10
  import { useSelector } from "../../internal/utils/async-store";
11
- import { getChartSeries } from "../../internal/utils/chart-series";
12
- import { isPointVisible } from "../../internal/utils/series-data";
11
+ import { getChartSeries, getSeriesData, isPointVisible } from "../../internal/utils/highcharts";
13
12
  import { useDebouncedValue } from "../../internal/utils/use-debounced-value";
14
13
  import { getFormatter } from "../formatters";
15
14
  import { getPointColor, getPointId, getSeriesColor, getSeriesId, getSeriesMarkerType, isXThreshold, matchSizeAxis, } from "../utils";
@@ -93,7 +92,7 @@ function getTooltipContentCartesian(api, { point, group, expandedSeries, rendere
93
92
  ariaLabel: (_d = (_c = api.context.settings.labels).itemMarkerLabel) === null || _d === void 0 ? void 0 : _d.call(_c, itemOptions === null || itemOptions === void 0 ? void 0 : itemOptions.status),
94
93
  });
95
94
  };
96
- const matchedItems = findTooltipSeriesItems(getChartSeries(chart.series), group, seriesSorting);
95
+ const matchedItems = findTooltipSeriesItems(getChartSeries(chart), group, seriesSorting);
97
96
  const detailItems = matchedItems.map((item) => {
98
97
  var _a, _b, _c, _d;
99
98
  const valueFormatter = getFormatter(item.point.series.yAxis);
@@ -229,7 +228,7 @@ function findTooltipSeriesItems(series, group, seriesSorting) {
229
228
  matchedItems.push({ point, errorRanges: [] });
230
229
  }
231
230
  else {
232
- point.series.data
231
+ getSeriesData(point.series)
233
232
  .filter((d) => d.x === point.x)
234
233
  .sort((a, b) => { var _a, _b; return ((_a = a.y) !== null && _a !== void 0 ? _a : 0) - ((_b = b.y) !== null && _b !== void 0 ? _b : 0); })
235
234
  .forEach((point) => matchedItems.push({ point, errorRanges: [] }));
@@ -1 +1 @@
1
- {"version":3,"file":"core-tooltip.js","sourceRoot":"","sources":["../../../../src/core/components/core-tooltip.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AACzE,OAAO,GAAG,MAAM,mCAAmC,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iEAAiE,CAAC;AACvG,OAAO,UAAU,MAAM,2CAA2C,CAAC;AAEnE,OAAO,kBAA6C,MAAM,0CAA0C,CAAC;AACrG,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,OAAO,CAAC,MAAA,EAAE,CAAC,KAAK,CAAC,CAAC,mCAAI,CAAC,CAAC,GAAG,CAAC,MAAA,EAAE,CAAC,KAAK,CAAC,CAAC,mCAAI,CAAC,CAAC,CAAC;QAC/C,CAAC;QACD,4HAA4H;QAC5H,MAAM,EAAE,GAAG,cAAc,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,cAAc,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC7E,OAAO,EAAE,IAAI,CAAC,MAAA,EAAE,CAAC,KAAK,CAAC,CAAC,mCAAI,CAAC,CAAC,GAAG,CAAC,MAAA,EAAE,CAAC,KAAK,CAAC,CAAC,mCAAI,CAAC,CAAC,CAAC;IACrD,CAAC,CAAC;QACF,8FAA8F;SAC7F,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;;QACZ,MAAM,WAAW,GAAG,MAAA,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,mCAAI,EAAE,CAAC;QAC3E,MAAM,iBAAiB,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,cAAc,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;QAC9G,OAAO,EAAE,GAAG,IAAI,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACrD,CAAC,CAAC,CACL,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useState } from \"react\";\n\nimport { warnOnce } from \"@cloudscape-design/component-toolkit/internal\";\nimport Box from \"@cloudscape-design/components/box\";\nimport { InternalChartTooltip } from \"@cloudscape-design/components/internal/do-not-use/chart-tooltip\";\nimport LiveRegion from \"@cloudscape-design/components/live-region\";\n\nimport ChartSeriesDetails, { ChartSeriesDetailItem } from \"../../internal/components/series-details\";\nimport { useSelector } from \"../../internal/utils/async-store\";\nimport { getChartSeries } from \"../../internal/utils/chart-series\";\nimport { isPointVisible } from \"../../internal/utils/series-data\";\nimport { useDebouncedValue } from \"../../internal/utils/use-debounced-value\";\nimport { ChartAPI } from \"../chart-api\";\nimport { getFormatter } from \"../formatters\";\nimport { BaseI18nStrings, CoreChartProps } from \"../interfaces\";\nimport {\n getPointColor,\n getPointId,\n getSeriesColor,\n getSeriesId,\n getSeriesMarkerType,\n isXThreshold,\n matchSizeAxis,\n} from \"../utils\";\n\nimport styles from \"../styles.css.js\";\n\nconst MIN_VISIBLE_BLOCK_SIZE = 200;\nconst DEFAULT_DEBOUNCE = 200;\n\ntype ExpandedSeriesState = Record<string, Set<string>>;\n\ninterface ExpandedSeriesStateProps {\n expandedSeries: ExpandedSeriesState;\n setExpandedSeries: (cb: (state: ExpandedSeriesState) => ExpandedSeriesState) => void;\n}\n\ninterface RenderedTooltipContent {\n header: React.ReactNode;\n body: React.ReactNode;\n footer: React.ReactNode;\n}\n\ninterface MatchedItem {\n point: Highcharts.Point;\n errorRanges: Highcharts.Point[];\n}\n\nexport function ChartTooltip({\n placement = \"target\",\n size,\n getTooltipContent: getTooltipContentOverrides,\n api,\n i18nStrings,\n debounce = false,\n seriesSorting = \"as-added\",\n sizeAxis,\n}: CoreChartProps.TooltipOptions & {\n i18nStrings?: BaseI18nStrings;\n getTooltipContent?: CoreChartProps.GetTooltipContent;\n sizeAxis?: readonly CoreChartProps.SizeAxisOptions[];\n api: ChartAPI;\n}) {\n const [expandedSeries, setExpandedSeries] = useState<ExpandedSeriesState>({});\n const tooltip = useSelector(api.tooltipStore, (s) => s);\n const debouncedTooltip = useDebouncedValue(tooltip, debounce === true ? DEFAULT_DEBOUNCE : debounce || 0);\n\n if (\n !debouncedTooltip ||\n !debouncedTooltip.visible ||\n debouncedTooltip.group.length === 0 ||\n debouncedTooltip.group[0].series === undefined\n ) {\n return null;\n }\n\n const chart = debouncedTooltip.group[0]?.series.chart;\n const renderers = getTooltipContentOverrides?.({ point: debouncedTooltip.point, group: debouncedTooltip.group });\n const getTrack = placement === \"target\" ? api.getTargetTrack : api.getGroupTrack;\n const position = (() => {\n if (placement === \"target\" || placement === \"middle\") {\n return !chart.inverted ? \"right\" : \"bottom\";\n } else {\n return !chart.inverted ? \"bottom\" : \"right\";\n }\n })();\n const content = getTooltipContent(api, {\n renderers,\n point: debouncedTooltip.point,\n group: debouncedTooltip.group,\n expandedSeries,\n setExpandedSeries,\n seriesSorting,\n sizeAxis,\n hideTooltip: () => {\n api.hideTooltip();\n },\n });\n if (!content) {\n return null;\n }\n return (\n <InternalChartTooltip\n getTrack={getTrack}\n trackKey={getTrackKey(debouncedTooltip.point, debouncedTooltip.group)}\n container={null}\n dismissButton={debouncedTooltip.pinned}\n dismissAriaLabel={i18nStrings?.detailPopoverDismissAriaLabel}\n onDismiss={api.onDismissTooltip}\n onMouseEnter={api.onMouseEnterTooltip}\n onMouseLeave={api.onMouseLeaveTooltip}\n title={content.header}\n footer={\n content.footer ? (\n <>\n <hr aria-hidden={true} />\n {content.footer}\n </>\n ) : null\n }\n size={size}\n position={position}\n minVisibleBlockSize={MIN_VISIBLE_BLOCK_SIZE}\n >\n <LiveRegion>{content.body}</LiveRegion>\n </InternalChartTooltip>\n );\n}\n\nfunction getTrackKey(point: null | Highcharts.Point, group: readonly Highcharts.Point[]) {\n const pointId = point && (point.options.id || point.options.name);\n if (point && pointId) {\n return `p-${pointId}-${point.x}-${point.y}`;\n }\n if (point) {\n return `p-${point.x}-${point.y}`;\n }\n return `g_${group.length}_${group[0].x}`;\n}\n\nfunction getTooltipContent(\n api: ChartAPI,\n props: CoreChartProps.GetTooltipContentProps & {\n renderers?: CoreChartProps.TooltipContentRenderer;\n hideTooltip: () => void;\n seriesSorting: NonNullable<CoreChartProps.TooltipOptions[\"seriesSorting\"]>;\n sizeAxis?: readonly CoreChartProps.SizeAxisOptions[];\n } & ExpandedSeriesStateProps,\n): null | RenderedTooltipContent {\n if (props.point && props.point.series.type === \"pie\") {\n return getTooltipContentPie(api, { ...props, point: props.point });\n } else if (props.group.length > 0 && props.group[0].series.type !== \"pie\") {\n return getTooltipContentCartesian(api, props);\n } else {\n return null;\n }\n}\n\nfunction getTooltipContentCartesian(\n api: ChartAPI,\n {\n point,\n group,\n expandedSeries,\n renderers = {},\n setExpandedSeries,\n hideTooltip,\n seriesSorting,\n sizeAxis,\n }: CoreChartProps.GetTooltipContentProps & {\n renderers?: CoreChartProps.TooltipContentRenderer;\n hideTooltip: () => void;\n seriesSorting: NonNullable<CoreChartProps.TooltipOptions[\"seriesSorting\"]>;\n sizeAxis?: readonly CoreChartProps.SizeAxisOptions[];\n } & ExpandedSeriesStateProps,\n): RenderedTooltipContent {\n // The cartesian tooltip might or might not have a selected point, but it always has a non-empty group.\n // By design, every point of the group has the same x value.\n const x = group[0].x;\n const chart = group[0].series.chart;\n const getSeriesMarker = (series: Highcharts.Series) => {\n const itemOptions = api.context.settings.getItemOptions?.(getSeriesId(series));\n return api.renderMarker({\n type: getSeriesMarkerType(series),\n color: getSeriesColor(series),\n visible: true,\n status: itemOptions?.status,\n ariaLabel: api.context.settings.labels.itemMarkerLabel?.(itemOptions?.status),\n });\n };\n const matchedItems = findTooltipSeriesItems(getChartSeries(chart.series), group, seriesSorting);\n const detailItems: ChartSeriesDetailItem[] = matchedItems.map((item) => {\n const valueFormatter = getFormatter(item.point.series.yAxis);\n const itemY = isXThreshold(item.point.series) ? null : (item.point.y ?? null);\n const bubbleSubItems = item.point.series.type === \"bubble\" ? getBubblePointDetails(item, sizeAxis) : undefined;\n const customContent = renderers.point\n ? renderers.point({\n item,\n hideTooltip,\n })\n : undefined;\n const defaultValue = bubbleSubItems ? null : valueFormatter(itemY);\n return {\n key: customContent?.key ?? item.point.series.name,\n value: customContent?.value ?? defaultValue,\n marker: getSeriesMarker(item.point.series),\n subItems: customContent?.subItems ?? bubbleSubItems,\n expandableId: customContent?.expandable ? item.point.series.name : undefined,\n highlighted: item.point.x === point?.x && item.point.y === point?.y,\n description:\n customContent?.description === undefined && item.errorRanges.length ? (\n <>\n {item.errorRanges.map((errorBarPoint, index) => (\n <div key={index} className={styles[\"error-range\"]}>\n <span>{errorBarPoint.series.userOptions.name ? errorBarPoint.series.userOptions.name : \"\"}</span>\n <span>\n {valueFormatter(errorBarPoint.options.low ?? 0)} - {valueFormatter(errorBarPoint.options.high ?? 0)}\n </span>\n </div>\n ))}\n </>\n ) : (\n customContent?.description\n ),\n };\n });\n // We only support cartesian charts with a single x axis.\n const titleFormatter = getFormatter(chart.xAxis[0]);\n const slotRenderProps: CoreChartProps.TooltipSlotProps = {\n x,\n items: matchedItems,\n hideTooltip: hideTooltip,\n };\n return {\n header: renderers.header?.(slotRenderProps) ?? titleFormatter(x),\n body: renderers.body?.(slotRenderProps) ?? (\n <ChartSeriesDetails\n details={detailItems}\n expandedSeries={expandedSeries[x]}\n setExpandedState={(id, isExpanded) => {\n setExpandedSeries((oldState) => {\n const expandedSeriesInCurrentCoordinate = new Set(oldState[x]);\n if (isExpanded) {\n expandedSeriesInCurrentCoordinate.add(id);\n } else {\n expandedSeriesInCurrentCoordinate.delete(id);\n }\n return { ...oldState, [x]: expandedSeriesInCurrentCoordinate };\n });\n }}\n />\n ),\n footer: renderers.footer?.(slotRenderProps),\n };\n}\n\nfunction getTooltipContentPie(\n api: ChartAPI,\n {\n point,\n renderers = {},\n hideTooltip,\n }: { point: Highcharts.Point } & { renderers?: CoreChartProps.TooltipContentRenderer; hideTooltip: () => void },\n): RenderedTooltipContent {\n const tooltipDetails: CoreChartProps.TooltipSlotProps = {\n x: point.x,\n items: [{ point, errorRanges: [] }],\n hideTooltip,\n };\n\n const itemOptions = api.context.settings.getItemOptions?.(getPointId(point));\n const markerAriaLabel = api.context.settings.labels.itemMarkerLabel?.(itemOptions?.status);\n\n return {\n header: renderers.header?.(tooltipDetails) ?? (\n <div className={styles[\"tooltip-default-header\"]}>\n {api.renderMarker({\n type: getSeriesMarkerType(point.series),\n color: getPointColor(point),\n visible: true,\n status: itemOptions?.status,\n ariaLabel: markerAriaLabel,\n })}\n <Box variant=\"span\" fontWeight=\"bold\">\n {point.name}\n </Box>\n </div>\n ),\n body:\n renderers.body?.(tooltipDetails) ??\n (renderers.details ? (\n <ChartSeriesDetails\n details={renderers.details({\n point,\n hideTooltip,\n })}\n compactList={true}\n />\n ) : (\n // We expect all pie chart segments to have defined y values. We use y=0 as fallback\n // because the property is optional in Highcharts types.\n <ChartSeriesDetails details={[{ key: point.series.name, value: point.y ?? 0 }]} />\n )),\n footer: renderers.footer?.(tooltipDetails),\n };\n}\n\nfunction getBubblePointDetails(item: MatchedItem, sizeAxis: readonly CoreChartProps.SizeAxisOptions[] = []) {\n const subItems: { key: React.ReactNode; value: React.ReactNode }[] = [];\n\n const y = item.point.y;\n const yAxisTitle = item.point.series.yAxis?.options?.title?.text;\n const yFormatter = item.point.series.yAxis ? getFormatter(item.point.series.yAxis) : (v: unknown) => String(v);\n subItems.push({ key: yAxisTitle, value: yFormatter(y) });\n\n // Size axis is a custom abstraction built to support bubble series title and formatter for z (size) values.\n // We match size axes by ID if provided, or take the first defined axis instead.\n const matchedSizeAxis = matchSizeAxis(sizeAxis, item.point.series);\n if (matchedSizeAxis) {\n // Highcharts bubble size is represented by point.z value, which is however not present in the internal point type -\n // so we take it from point's options instead.\n const size = item.point.options.z ?? null;\n const sizeAxisTitle = matchedSizeAxis.title;\n const sizeFormatter = getFormatter(matchedSizeAxis);\n subItems.push({ key: sizeAxisTitle, value: sizeFormatter(size) });\n }\n\n return subItems;\n}\n\nfunction findTooltipSeriesItems(\n series: readonly Highcharts.Series[],\n group: readonly Highcharts.Point[],\n seriesSorting: NonNullable<CoreChartProps.TooltipOptions[\"seriesSorting\"]>,\n): MatchedItem[] {\n const seriesOrder = series.reduce((d, s, i) => d.set(s, i), new Map<Highcharts.Series, number>());\n const getSeriesIndex = (s: Highcharts.Series) => seriesOrder.get(s) ?? -1;\n const seriesErrors = new Map<string, Highcharts.Point[]>();\n const matchedSeries = new Set<Highcharts.Series>();\n const matchedItems: MatchedItem[] = [];\n for (const point of group) {\n if (!isPointVisible(point)) {\n continue;\n }\n // We only support errorbar series that are linked to other series. In tooltip content we add\n // linked error bars to series detail slot.\n if (point.series.type === \"errorbar\") {\n if (point.series.linkedParent) {\n addError(getSeriesId(point.series.linkedParent), point);\n } else {\n warnOnce(\n \"chart-components\",\n 'The `linkedTo` property of \"errorbar\" series is missing, or points to a series that does not exist.',\n );\n }\n } else {\n addMatchedPoints(point);\n }\n }\n function addError(seriesId: string, errorPoint: Highcharts.Point) {\n if (errorPoint.options.low !== undefined && errorPoint.options.high !== undefined) {\n const errorRanges = seriesErrors.get(seriesId) ?? [];\n errorRanges.push(errorPoint);\n seriesErrors.set(seriesId, errorRanges);\n }\n }\n function addMatchedPoints(point: Highcharts.Point) {\n if (!matchedSeries.has(point.series)) {\n matchedSeries.add(point.series);\n if (isXThreshold(point.series)) {\n matchedItems.push({ point, errorRanges: [] });\n } else {\n point.series.data\n .filter((d) => d.x === point.x)\n .sort((a, b) => (a.y ?? 0) - (b.y ?? 0))\n .forEach((point) => matchedItems.push({ point, errorRanges: [] }));\n }\n }\n }\n return (\n matchedItems\n .sort((i1, i2) => {\n if (seriesSorting === \"by-value-desc\") {\n return (i2.point.y ?? 0) - (i1.point.y ?? 0);\n }\n // We sort matched items by series order. If there are multiple items that belong to the same series, we sort them by value.\n const s1 = getSeriesIndex(i1.point.series) - getSeriesIndex(i2.point.series);\n return s1 || (i1.point.y ?? 0) - (i2.point.y ?? 0);\n })\n // For each series item we add linked error ranges, sorted by their respective series indices.\n .map((item) => {\n const errorRanges = seriesErrors.get(getSeriesId(item.point.series)) ?? [];\n const sortedErrorRanges = errorRanges.sort((i1, i2) => getSeriesIndex(i1.series) - getSeriesIndex(i2.series));\n return { ...item, errorRanges: sortedErrorRanges };\n })\n );\n}\n"]}
1
+ {"version":3,"file":"core-t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AAW,EAAE,iBAAiB,EAAE,CAAC;IACrD,CAAC,CAAC,CACL,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useState } from \"react\";\n\nimport { warnOnce } from \"@cloudscape-design/component-toolkit/internal\";\nimport Box from \"@cloudscape-design/components/box\";\nimport { InternalChartTooltip } from \"@cloudscape-design/components/internal/do-not-use/chart-tooltip\";\nimport LiveRegion from \"@cloudscape-design/components/live-region\";\n\nimport ChartSeriesDetails, { ChartSeriesDetailItem } from \"../../internal/components/series-details\";\nimport { useSelector } from \"../../internal/utils/async-store\";\nimport { getChartSeries, getSeriesData, isPointVisible, SafeSeries } from \"../../internal/utils/highcharts\";\nimport { useDebouncedValue } from \"../../internal/utils/use-debounced-value\";\nimport { ChartAPI } from \"../chart-api\";\nimport { getFormatter } from \"../formatters\";\nimport { BaseI18nStrings, CoreChartProps } from \"../interfaces\";\nimport {\n getPointColor,\n getPointId,\n getSeriesColor,\n getSeriesId,\n getSeriesMarkerType,\n isXThreshold,\n matchSizeAxis,\n} from \"../utils\";\n\nimport styles from \"../styles.css.js\";\n\nconst MIN_VISIBLE_BLOCK_SIZE = 200;\nconst DEFAULT_DEBOUNCE = 200;\n\ntype ExpandedSeriesState = Record<string, Set<string>>;\n\ninterface ExpandedSeriesStateProps {\n expandedSeries: ExpandedSeriesState;\n setExpandedSeries: (cb: (state: ExpandedSeriesState) => ExpandedSeriesState) => void;\n}\n\ninterface RenderedTooltipContent {\n header: React.ReactNode;\n body: React.ReactNode;\n footer: React.ReactNode;\n}\n\ninterface MatchedItem {\n point: Highcharts.Point;\n errorRanges: Highcharts.Point[];\n}\n\nexport function ChartTooltip({\n placement = \"target\",\n size,\n getTooltipContent: getTooltipContentOverrides,\n api,\n i18nStrings,\n debounce = false,\n seriesSorting = \"as-added\",\n sizeAxis,\n}: CoreChartProps.TooltipOptions & {\n i18nStrings?: BaseI18nStrings;\n getTooltipContent?: CoreChartProps.GetTooltipContent;\n sizeAxis?: readonly CoreChartProps.SizeAxisOptions[];\n api: ChartAPI;\n}) {\n const [expandedSeries, setExpandedSeries] = useState<ExpandedSeriesState>({});\n const tooltip = useSelector(api.tooltipStore, (s) => s);\n const debouncedTooltip = useDebouncedValue(tooltip, debounce === true ? DEFAULT_DEBOUNCE : debounce || 0);\n\n if (\n !debouncedTooltip ||\n !debouncedTooltip.visible ||\n debouncedTooltip.group.length === 0 ||\n debouncedTooltip.group[0].series === undefined\n ) {\n return null;\n }\n\n const chart = debouncedTooltip.group[0]?.series.chart;\n const renderers = getTooltipContentOverrides?.({ point: debouncedTooltip.point, group: debouncedTooltip.group });\n const getTrack = placement === \"target\" ? api.getTargetTrack : api.getGroupTrack;\n const position = (() => {\n if (placement === \"target\" || placement === \"middle\") {\n return !chart.inverted ? \"right\" : \"bottom\";\n } else {\n return !chart.inverted ? \"bottom\" : \"right\";\n }\n })();\n const content = getTooltipContent(api, {\n renderers,\n point: debouncedTooltip.point,\n group: debouncedTooltip.group,\n expandedSeries,\n setExpandedSeries,\n seriesSorting,\n sizeAxis,\n hideTooltip: () => {\n api.hideTooltip();\n },\n });\n if (!content) {\n return null;\n }\n return (\n <InternalChartTooltip\n getTrack={getTrack}\n trackKey={getTrackKey(debouncedTooltip.point, debouncedTooltip.group)}\n container={null}\n dismissButton={debouncedTooltip.pinned}\n dismissAriaLabel={i18nStrings?.detailPopoverDismissAriaLabel}\n onDismiss={api.onDismissTooltip}\n onMouseEnter={api.onMouseEnterTooltip}\n onMouseLeave={api.onMouseLeaveTooltip}\n title={content.header}\n footer={\n content.footer ? (\n <>\n <hr aria-hidden={true} />\n {content.footer}\n </>\n ) : null\n }\n size={size}\n position={position}\n minVisibleBlockSize={MIN_VISIBLE_BLOCK_SIZE}\n >\n <LiveRegion>{content.body}</LiveRegion>\n </InternalChartTooltip>\n );\n}\n\nfunction getTrackKey(point: null | Highcharts.Point, group: readonly Highcharts.Point[]) {\n const pointId = point && (point.options.id || point.options.name);\n if (point && pointId) {\n return `p-${pointId}-${point.x}-${point.y}`;\n }\n if (point) {\n return `p-${point.x}-${point.y}`;\n }\n return `g_${group.length}_${group[0].x}`;\n}\n\nfunction getTooltipContent(\n api: ChartAPI,\n props: CoreChartProps.GetTooltipContentProps & {\n renderers?: CoreChartProps.TooltipContentRenderer;\n hideTooltip: () => void;\n seriesSorting: NonNullable<CoreChartProps.TooltipOptions[\"seriesSorting\"]>;\n sizeAxis?: readonly CoreChartProps.SizeAxisOptions[];\n } & ExpandedSeriesStateProps,\n): null | RenderedTooltipContent {\n if (props.point && props.point.series.type === \"pie\") {\n return getTooltipContentPie(api, { ...props, point: props.point });\n } else if (props.group.length > 0 && props.group[0].series.type !== \"pie\") {\n return getTooltipContentCartesian(api, props);\n } else {\n return null;\n }\n}\n\nfunction getTooltipContentCartesian(\n api: ChartAPI,\n {\n point,\n group,\n expandedSeries,\n renderers = {},\n setExpandedSeries,\n hideTooltip,\n seriesSorting,\n sizeAxis,\n }: CoreChartProps.GetTooltipContentProps & {\n renderers?: CoreChartProps.TooltipContentRenderer;\n hideTooltip: () => void;\n seriesSorting: NonNullable<CoreChartProps.TooltipOptions[\"seriesSorting\"]>;\n sizeAxis?: readonly CoreChartProps.SizeAxisOptions[];\n } & ExpandedSeriesStateProps,\n): RenderedTooltipContent {\n // The cartesian tooltip might or might not have a selected point, but it always has a non-empty group.\n // By design, every point of the group has the same x value.\n const x = group[0].x;\n const chart = group[0].series.chart;\n const getSeriesMarker = (series: SafeSeries) => {\n const itemOptions = api.context.settings.getItemOptions?.(getSeriesId(series));\n return api.renderMarker({\n type: getSeriesMarkerType(series),\n color: getSeriesColor(series),\n visible: true,\n status: itemOptions?.status,\n ariaLabel: api.context.settings.labels.itemMarkerLabel?.(itemOptions?.status),\n });\n };\n const matchedItems = findTooltipSeriesItems(getChartSeries(chart), group, seriesSorting);\n const detailItems: ChartSeriesDetailItem[] = matchedItems.map((item) => {\n const valueFormatter = getFormatter(item.point.series.yAxis);\n const itemY = isXThreshold(item.point.series) ? null : (item.point.y ?? null);\n const bubbleSubItems = item.point.series.type === \"bubble\" ? getBubblePointDetails(item, sizeAxis) : undefined;\n const customContent = renderers.point\n ? renderers.point({\n item,\n hideTooltip,\n })\n : undefined;\n const defaultValue = bubbleSubItems ? null : valueFormatter(itemY);\n return {\n key: customContent?.key ?? item.point.series.name,\n value: customContent?.value ?? defaultValue,\n marker: getSeriesMarker(item.point.series),\n subItems: customContent?.subItems ?? bubbleSubItems,\n expandableId: customContent?.expandable ? item.point.series.name : undefined,\n highlighted: item.point.x === point?.x && item.point.y === point?.y,\n description:\n customContent?.description === undefined && item.errorRanges.length ? (\n <>\n {item.errorRanges.map((errorBarPoint, index) => (\n <div key={index} className={styles[\"error-range\"]}>\n <span>{errorBarPoint.series.userOptions.name ? errorBarPoint.series.userOptions.name : \"\"}</span>\n <span>\n {valueFormatter(errorBarPoint.options.low ?? 0)} - {valueFormatter(errorBarPoint.options.high ?? 0)}\n </span>\n </div>\n ))}\n </>\n ) : (\n customContent?.description\n ),\n };\n });\n // We only support cartesian charts with a single x axis.\n const titleFormatter = getFormatter(chart.xAxis[0]);\n const slotRenderProps: CoreChartProps.TooltipSlotProps = {\n x,\n items: matchedItems,\n hideTooltip: hideTooltip,\n };\n return {\n header: renderers.header?.(slotRenderProps) ?? titleFormatter(x),\n body: renderers.body?.(slotRenderProps) ?? (\n <ChartSeriesDetails\n details={detailItems}\n expandedSeries={expandedSeries[x]}\n setExpandedState={(id, isExpanded) => {\n setExpandedSeries((oldState) => {\n const expandedSeriesInCurrentCoordinate = new Set(oldState[x]);\n if (isExpanded) {\n expandedSeriesInCurrentCoordinate.add(id);\n } else {\n expandedSeriesInCurrentCoordinate.delete(id);\n }\n return { ...oldState, [x]: expandedSeriesInCurrentCoordinate };\n });\n }}\n />\n ),\n footer: renderers.footer?.(slotRenderProps),\n };\n}\n\nfunction getTooltipContentPie(\n api: ChartAPI,\n {\n point,\n renderers = {},\n hideTooltip,\n }: { point: Highcharts.Point } & { renderers?: CoreChartProps.TooltipContentRenderer; hideTooltip: () => void },\n): RenderedTooltipContent {\n const tooltipDetails: CoreChartProps.TooltipSlotProps = {\n x: point.x,\n items: [{ point, errorRanges: [] }],\n hideTooltip,\n };\n\n const itemOptions = api.context.settings.getItemOptions?.(getPointId(point));\n const markerAriaLabel = api.context.settings.labels.itemMarkerLabel?.(itemOptions?.status);\n\n return {\n header: renderers.header?.(tooltipDetails) ?? (\n <div className={styles[\"tooltip-default-header\"]}>\n {api.renderMarker({\n type: getSeriesMarkerType(point.series),\n color: getPointColor(point),\n visible: true,\n status: itemOptions?.status,\n ariaLabel: markerAriaLabel,\n })}\n <Box variant=\"span\" fontWeight=\"bold\">\n {point.name}\n </Box>\n </div>\n ),\n body:\n renderers.body?.(tooltipDetails) ??\n (renderers.details ? (\n <ChartSeriesDetails\n details={renderers.details({\n point,\n hideTooltip,\n })}\n compactList={true}\n />\n ) : (\n // We expect all pie chart segments to have defined y values. We use y=0 as fallback\n // because the property is optional in Highcharts types.\n <ChartSeriesDetails details={[{ key: point.series.name, value: point.y ?? 0 }]} />\n )),\n footer: renderers.footer?.(tooltipDetails),\n };\n}\n\nfunction getBubblePointDetails(item: MatchedItem, sizeAxis: readonly CoreChartProps.SizeAxisOptions[] = []) {\n const subItems: { key: React.ReactNode; value: React.ReactNode }[] = [];\n\n const y = item.point.y;\n const yAxisTitle = item.point.series.yAxis?.options?.title?.text;\n const yFormatter = item.point.series.yAxis ? getFormatter(item.point.series.yAxis) : (v: unknown) => String(v);\n subItems.push({ key: yAxisTitle, value: yFormatter(y) });\n\n // Size axis is a custom abstraction built to support bubble series title and formatter for z (size) values.\n // We match size axes by ID if provided, or take the first defined axis instead.\n const matchedSizeAxis = matchSizeAxis(sizeAxis, item.point.series);\n if (matchedSizeAxis) {\n // Highcharts bubble size is represented by point.z value, which is however not present in the internal point type -\n // so we take it from point's options instead.\n const size = item.point.options.z ?? null;\n const sizeAxisTitle = matchedSizeAxis.title;\n const sizeFormatter = getFormatter(matchedSizeAxis);\n subItems.push({ key: sizeAxisTitle, value: sizeFormatter(size) });\n }\n\n return subItems;\n}\n\nfunction findTooltipSeriesItems(\n series: readonly SafeSeries[],\n group: readonly Highcharts.Point[],\n seriesSorting: NonNullable<CoreChartProps.TooltipOptions[\"seriesSorting\"]>,\n): MatchedItem[] {\n const seriesOrder = series.reduce((d, s, i) => d.set(s, i), new Map<SafeSeries, number>());\n const getSeriesIndex = (s: SafeSeries) => seriesOrder.get(s) ?? -1;\n const seriesErrors = new Map<string, Highcharts.Point[]>();\n const matchedSeries = new Set<SafeSeries>();\n const matchedItems: MatchedItem[] = [];\n for (const point of group) {\n if (!isPointVisible(point)) {\n continue;\n }\n // We only support errorbar series that are linked to other series. In tooltip content we add\n // linked error bars to series detail slot.\n if (point.series.type === \"errorbar\") {\n if (point.series.linkedParent) {\n addError(getSeriesId(point.series.linkedParent), point);\n } else {\n warnOnce(\n \"chart-components\",\n 'The `linkedTo` property of \"errorbar\" series is missing, or points to a series that does not exist.',\n );\n }\n } else {\n addMatchedPoints(point);\n }\n }\n function addError(seriesId: string, errorPoint: Highcharts.Point) {\n if (errorPoint.options.low !== undefined && errorPoint.options.high !== undefined) {\n const errorRanges = seriesErrors.get(seriesId) ?? [];\n errorRanges.push(errorPoint);\n seriesErrors.set(seriesId, errorRanges);\n }\n }\n function addMatchedPoints(point: Highcharts.Point) {\n if (!matchedSeries.has(point.series)) {\n matchedSeries.add(point.series);\n if (isXThreshold(point.series)) {\n matchedItems.push({ point, errorRanges: [] });\n } else {\n getSeriesData(point.series)\n .filter((d) => d.x === point.x)\n .sort((a, b) => (a.y ?? 0) - (b.y ?? 0))\n .forEach((point) => matchedItems.push({ point, errorRanges: [] }));\n }\n }\n }\n return (\n matchedItems\n .sort((i1, i2) => {\n if (seriesSorting === \"by-value-desc\") {\n return (i2.point.y ?? 0) - (i1.point.y ?? 0);\n }\n // We sort matched items by series order. If there are multiple items that belong to the same series, we sort them by value.\n const s1 = getSeriesIndex(i1.point.series) - getSeriesIndex(i2.point.series);\n return s1 || (i1.point.y ?? 0) - (i2.point.y ?? 0);\n })\n // For each series item we add linked error ranges, sorted by their respective series indices.\n .map((item) => {\n const errorRanges = seriesErrors.get(getSeriesId(item.point.series)) ?? [];\n const sortedErrorRanges = errorRanges.sort((i1, i2) => getSeriesIndex(i1.series) - getSeriesIndex(i2.series));\n return { ...item, errorRanges: sortedErrorRanges };\n })\n );\n}\n"]}
package/core/utils.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type Highcharts from "highcharts";
2
2
  import { ChartSeriesMarkerType } from "../internal/components/series-marker";
3
3
  import { ChartSeriesMarkerStatus } from "../internal/components/series-marker/interfaces";
4
+ import { SafeChart, SafeSeries } from "../internal/utils/highcharts";
4
5
  import { ChartLabels } from "./i18n-utils";
5
6
  import { CoreChartProps, Rect } from "./interfaces";
6
7
  export interface LegendItemSpec {
@@ -13,13 +14,13 @@ export interface LegendItemSpec {
13
14
  status?: ChartSeriesMarkerStatus;
14
15
  markerAriaLabel?: string;
15
16
  }
16
- export declare function getSeriesId(series: Highcharts.Series): string;
17
+ export declare function getSeriesId(series: SafeSeries): string;
17
18
  export declare function getPointId(point: Highcharts.Point): string;
18
19
  export declare function getOptionsId(options: {
19
20
  id?: string;
20
21
  name?: string;
21
22
  }): string;
22
- export declare function isSeriesStacked(series: Highcharts.Series): boolean;
23
+ export declare function isSeriesStacked(series: SafeSeries): boolean;
23
24
  interface ThresholdOptions<T extends "x-threshold" | "y-threshold"> {
24
25
  custom: {
25
26
  awsui: {
@@ -29,10 +30,10 @@ interface ThresholdOptions<T extends "x-threshold" | "y-threshold"> {
29
30
  };
30
31
  }
31
32
  export declare function createThresholdMetadata<T extends "x-threshold" | "y-threshold">(type: T, value: number): ThresholdOptions<T>;
32
- export declare function isXThreshold(s: Highcharts.Series): s is Highcharts.Series & {
33
+ export declare function isXThreshold(s: SafeSeries): s is SafeSeries & {
33
34
  options: ThresholdOptions<"x-threshold">;
34
35
  };
35
- export declare function isYThreshold(s: Highcharts.Series): s is Highcharts.Series & {
36
+ export declare function isYThreshold(s: SafeSeries): s is SafeSeries & {
36
37
  options: ThresholdOptions<"y-threshold">;
37
38
  };
38
39
  export interface BubbleOptions {
@@ -45,12 +46,12 @@ export interface BubbleOptions {
45
46
  export declare function createBubbleMetadata(options: {
46
47
  sizeAxis?: string;
47
48
  }): BubbleOptions;
48
- export declare function getBubbleSeriesSizeAxis(series: Highcharts.Series): undefined | string;
49
- export declare function getSeriesMarkerType(series?: Highcharts.Series): ChartSeriesMarkerType;
50
- export declare function getSeriesColor(series?: Highcharts.Series): string;
49
+ export declare function getBubbleSeriesSizeAxis(series: SafeSeries): undefined | string;
50
+ export declare function getSeriesMarkerType(series?: SafeSeries): ChartSeriesMarkerType;
51
+ export declare function getSeriesColor(series?: SafeSeries): string;
51
52
  export declare function getPointColor(point?: Highcharts.Point): string;
52
53
  export declare function getChartLegendItems({ chart, getItemOptions, itemMarkerStatusAriaLabel, }: {
53
- chart: Highcharts.Chart;
54
+ chart: SafeChart;
54
55
  getItemOptions?: CoreChartProps.GetItemOptions;
55
56
  itemMarkerStatusAriaLabel?: ChartLabels["itemMarkerLabel"];
56
57
  }): readonly LegendItemSpec[];
@@ -84,8 +85,8 @@ export declare function getLegendsProps(options: CoreChartProps.ChartOptions, le
84
85
  export declare function getPointRect(point: Highcharts.Point): Rect;
85
86
  export declare function getGroupRect(points: readonly Highcharts.Point[]): Rect;
86
87
  export declare function safeRect(rect: Rect): Rect;
87
- export declare function getChartAccessibleDescription(chart: Highcharts.Chart): string;
88
- export declare function matchSizeAxis(sizeAxis: readonly CoreChartProps.SizeAxisOptions[], series: Highcharts.Series): CoreChartProps.SizeAxisOptions;
88
+ export declare function getChartAccessibleDescription(chart: SafeChart): string;
89
+ export declare function matchSizeAxis(sizeAxis: readonly CoreChartProps.SizeAxisOptions[], series: SafeSeries): CoreChartProps.SizeAxisOptions;
89
90
  export declare function getPointAccessibleDescription(point: Highcharts.Point, labels: ChartLabels, additionalProps?: {
90
91
  sizeAxis?: readonly CoreChartProps.SizeAxisOptions[];
91
92
  }): string;
package/core/utils.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- import { getChartSeries } from "../internal/utils/chart-series";
3
+ import { getChartSeries, getSeriesData } from "../internal/utils/highcharts";
4
4
  import { castArray } from "../internal/utils/utils";
5
5
  import { getFormatter } from "./formatters";
6
6
  // The below functions extract unique identifier from series, point, or options. The identifier can be item's ID or name.
@@ -144,11 +144,11 @@ export function getChartLegendItems({ chart, getItemOptions = () => ({}), itemMa
144
144
  });
145
145
  }
146
146
  };
147
- for (const s of getChartSeries(chart.series)) {
147
+ for (const s of getChartSeries(chart)) {
148
148
  const valueAxis = isInverted ? s.xAxis : s.yAxis;
149
149
  const isSecondary = (_c = (_b = valueAxis === null || valueAxis === void 0 ? void 0 : valueAxis.options) === null || _b === void 0 ? void 0 : _b.opposite) !== null && _c !== void 0 ? _c : false;
150
150
  addSeriesItem(s, isSecondary);
151
- s.data.forEach((p) => addPointItem(p, isSecondary));
151
+ getSeriesData(s, { includeHiddenPoints: true }).forEach((p) => addPointItem(p, isSecondary));
152
152
  }
153
153
  return legendItems;
154
154
  }
package/core/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/core/utils.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAMtC,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAe5C,yHAAyH;AACzH,6HAA6H;AAC7H,gFAAgF;AAChF,MAAM,UAAU,WAAW,CAAC,MAAyB;IACnD,OAAO,YAAY,CAAC,MA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harts\";\n\nimport { ChartSeriesMarkerType } from \"../internal/components/series-marker\";\nimport { ChartSeriesMarkerStatus } from \"../internal/components/series-marker/interfaces\";\nimport { getChartSeries } from \"../internal/utils/chart-series\";\nimport { castArray } from \"../internal/utils/utils\";\nimport { getFormatter } from \"./formatters\";\nimport { ChartLabels } from \"./i18n-utils\";\nimport { CoreChartProps, Rect } from \"./interfaces\";\n\nexport interface LegendItemSpec {\n id: string;\n name: string;\n markerType: ChartSeriesMarkerType;\n color: string;\n visible: boolean;\n isSecondary: boolean;\n status?: ChartSeriesMarkerStatus;\n markerAriaLabel?: string;\n}\n\n// The below functions extract unique identifier from series, point, or options. The identifier can be item's ID or name.\n// We expect that items requiring referencing (e.g. in order to control their visibility) have the unique identifier defined.\n// Otherwise, we return a randomized id that is to ensure no accidental matches.\nexport function getSeriesId(series: Highcharts.Series): string {\n return getOptionsId(series.options);\n}\nexport function getPointId(point: Highcharts.Point): string {\n return getOptionsId(point.options);\n}\nexport function getOptionsId(options: { id?: string; name?: string }): string {\n return options.id ?? options.name ?? noIdPlaceholder();\n}\nfunction noIdPlaceholder(): string {\n const rand = (Math.random() * 1_000_000).toFixed(0).padStart(6, \"0\");\n return \"awsui-no-id-placeholder-\" + rand;\n}\n\n// There are more possible values that series.stacking can take, but we only explicitly support \"normal\".\nexport function isSeriesStacked(series: Highcharts.Series) {\n return (series.options as any).stacking === \"normal\";\n}\n\n// The threshold series are custom series, implemented as a combination of line series, and plot lines.\n// As Highcharts does not support custom series declaration, we annotate threshold series by using the\n// series.custom property. This is then used in our utilities to recognize threshold series, and retrieve\n// the associated threshold value.\ninterface ThresholdOptions<T extends \"x-threshold\" | \"y-threshold\"> {\n custom: {\n awsui: {\n type: T;\n threshold: number;\n };\n };\n}\nexport function createThresholdMetadata<T extends \"x-threshold\" | \"y-threshold\">(\n type: T,\n value: number,\n): ThresholdOptions<T> {\n return { custom: { awsui: { type, threshold: value } } };\n}\nexport function isXThreshold(\n s: Highcharts.Series,\n): s is Highcharts.Series & { options: ThresholdOptions<\"x-threshold\"> } {\n return typeof s.options.custom === \"object\" && s.options.custom.awsui?.type === \"x-threshold\";\n}\nexport function isYThreshold(\n s: Highcharts.Series,\n): s is Highcharts.Series & { options: ThresholdOptions<\"y-threshold\"> } {\n return typeof s.options.custom === \"object\" && s.options.custom.awsui?.type === \"y-threshold\";\n}\n\n// We extend bubble series by introducing sizeAxis - which is used to define title and formatter for bubble series size values.\n// In case there are multiple such axes - the bubble series can target a specific one by setting sizeAxis to the respective size\n// axis id. As there is no such prop in Highcharts series type - we pass it using the custom options object.\nexport interface BubbleOptions {\n custom: {\n awsui: {\n sizeAxis?: string;\n };\n };\n}\nexport function createBubbleMetadata(options: { sizeAxis?: string }): BubbleOptions {\n return { custom: { awsui: options } };\n}\nexport function getBubbleSeriesSizeAxis(series: Highcharts.Series): undefined | string {\n const { custom } = series.options as Highcharts.SeriesOptionsType & BubbleOptions;\n return custom?.awsui?.sizeAxis;\n}\n\nexport function getSeriesMarkerType(series?: Highcharts.Series): ChartSeriesMarkerType {\n if (!series) {\n return \"large-square\";\n }\n const seriesSymbol = \"symbol\" in series && typeof series.symbol === \"string\" ? series.symbol : \"circle\";\n // In Highcharts, dashStyle supports different types of dashes: https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-dashstyle-all/\n // Return a dashed legend symbol for all of these dashes, excluding the default \"Solid\" option\n if (\"dashStyle\" in series.options && series.options.dashStyle && series.options.dashStyle !== \"Solid\") {\n return \"dashed\";\n }\n switch (series.type) {\n case \"area\":\n case \"areaspline\":\n return \"hollow-square\";\n case \"line\":\n case \"spline\":\n return \"line\";\n case \"scatter\":\n switch (seriesSymbol) {\n case \"square\":\n return \"square\";\n case \"diamond\":\n return \"diamond\";\n case \"triangle\":\n return \"triangle\";\n case \"triangle-down\":\n return \"triangle-down\";\n case \"circle\":\n default:\n return \"circle\";\n }\n case \"column\":\n case \"pie\":\n return \"large-square\";\n case \"bubble\":\n return \"circle\";\n case \"errorbar\":\n default:\n return \"large-square\";\n }\n}\n\n// Highcharts supports color objects to represent gradients and more, but we only support string\n// colors in our markers. In case a non-string color is defined, we use black color as as fallback.\nexport function getSeriesColor(series?: Highcharts.Series): string {\n return typeof series?.color === \"string\" ? series.color : \"black\";\n}\nexport function getPointColor(point?: Highcharts.Point): string {\n return typeof point?.color === \"string\" ? point.color : \"black\";\n}\n\n// The custom legend implementation does not rely on the Highcharts legend. When Highcharts legend is disabled,\n// the chart object does not include information on legend items. Instead, we collect series and pie segments\n// using this custom function, respecting Highcharts' showInLegend flag (defined for series only).\n\n// There exists a Highcharts APIs to access legend items, but it is unfortunately not available, when\n// Highcharts legend is disabled. Instead, we use this custom method to collect legend items from the chart.\nexport function getChartLegendItems({\n chart,\n getItemOptions = () => ({}),\n itemMarkerStatusAriaLabel,\n}: {\n chart: Highcharts.Chart;\n getItemOptions?: CoreChartProps.GetItemOptions;\n itemMarkerStatusAriaLabel?: ChartLabels[\"itemMarkerLabel\"];\n}): readonly LegendItemSpec[] {\n const legendItems: LegendItemSpec[] = [];\n const isInverted = chart.inverted ?? false;\n const addSeriesItem = (series: Highcharts.Series, isSecondary: boolean) => {\n // The pie series is not shown in the legend. Instead, we show pie segments.\n if (series.type === \"pie\") {\n return;\n }\n // We only support errorbar series that are linked to other series. Those are not represented separately\n // in the legend, but can be controlled from the outside, using controllable items visibility API.\n if (series.type === \"errorbar\") {\n return;\n }\n // We respect Highcharts showInLegend option to allow hiding certain series from the legend.\n // The same is not supported for pie chart segments.\n if (series.options.showInLegend !== false) {\n const seriesId = getSeriesId(series);\n const itemProps = getItemOptions(seriesId);\n const status = itemProps.status;\n legendItems.push({\n id: seriesId,\n name: series.name,\n markerType: getSeriesMarkerType(series),\n color: getSeriesColor(series),\n visible: series.visible,\n isSecondary,\n status: status,\n markerAriaLabel: itemMarkerStatusAriaLabel?.(status),\n });\n }\n };\n const addPointItem = (point: Highcharts.Point, isSecondary: boolean) => {\n if (point?.series?.type === \"pie\") {\n const pointId = getPointId(point);\n legendItems.push({\n id: pointId,\n name: point.name,\n markerType: getSeriesMarkerType(point.series),\n color: getPointColor(point),\n visible: point.visible,\n status: getItemOptions(pointId).status,\n isSecondary,\n });\n }\n };\n for (const s of getChartSeries(chart.series)) {\n const valueAxis = isInverted ? s.xAxis : s.yAxis;\n const isSecondary = valueAxis?.options?.opposite ?? false;\n addSeriesItem(s, isSecondary);\n s.data.forEach((p) => addPointItem(p, isSecondary));\n }\n return legendItems;\n}\n\nexport type LegendItemOptions = Highcharts.SeriesOptionsType | Highcharts.PointOptionsType;\n\nexport function getVisibleLegendItems(options: Highcharts.Options) {\n const isInverted = options.chart?.inverted ?? false;\n const valueAxes = (isInverted ? castArray(options.xAxis) : castArray(options.yAxis)) ?? [];\n const defaultOpposite = valueAxes.length > 0 ? (valueAxes[0].opposite ?? false) : false;\n\n const primaryAxis = valueAxes.find((a) => !(a.opposite ?? false));\n const secondaryAxis = valueAxes.find((a) => a.opposite === true);\n\n const primaryItems: LegendItemOptions[] = [];\n const secondaryItems: LegendItemOptions[] = [];\n const addLegendItem = (item: LegendItemOptions) => {\n if (isSecondaryLegendItem(item, isInverted, defaultOpposite, valueAxes)) {\n secondaryItems.push(item);\n } else {\n primaryItems.push(item);\n }\n };\n\n options.series?.forEach((series) => {\n if (!(\"type\" in series)) {\n return;\n }\n\n // The pie series is not shown in the legend. Instead, we show pie segments (points).\n if (series.type === \"pie\") {\n if (Array.isArray(series.data)) {\n series.data.forEach((point) => addLegendItem(point));\n }\n return;\n }\n // We only support errorbar series that are linked to other series. Those are not represented separately\n // in the legend, but can be controlled from the outside, using controllable items visibility API.\n if (series.type === \"errorbar\") {\n return;\n }\n if (series.showInLegend !== false) {\n addLegendItem(series);\n }\n });\n\n return { primaryItems, secondaryItems, primaryAxisId: primaryAxis?.id, secondaryAxisId: secondaryAxis?.id };\n}\n\nfunction isSecondaryLegendItem(\n item: LegendItemOptions,\n isInverted: boolean,\n defaultOpposite: boolean,\n valueAxes: Array<{ id?: string; opposite?: boolean }>,\n): boolean {\n // Only items that have an associated axis can be considered secondary\n if (item && typeof item === \"object\" && (\"xAxis\" in item || \"yAxis\" in item)) {\n const axisRef = isInverted ? (item.xAxis ?? 0) : (item.yAxis ?? 0);\n // An axis reference can be an index into the axes array or an explicitly passed id\n const valueAxis = typeof axisRef === \"number\" ? valueAxes[axisRef] : valueAxes.find((a) => a.id === axisRef);\n return valueAxis?.opposite ?? false;\n }\n return defaultOpposite;\n}\n\nexport function getLegendsProps(\n options: CoreChartProps.ChartOptions,\n legendOptions: CoreChartProps.LegendOptions | undefined,\n) {\n // While Highcharts supports more than two axes, this\n // implementation supports at most two, in which case one\n // of them must be set as opposite (secondary).\n const { primaryItems, secondaryItems, primaryAxisId, secondaryAxisId } = getVisibleLegendItems(options);\n return {\n primary:\n primaryItems.length === 0\n ? undefined\n : ({\n isSecondary: false,\n axisId: primaryAxisId,\n title: legendOptions?.title,\n actions: legendOptions?.actions,\n alignment: legendOptions?.position === \"side\" ? \"vertical\" : \"horizontal\",\n horizontalAlignment: secondaryItems.length === 0 ? legendOptions?.horizontalAlignment : \"start\",\n enableHorizontalScroll: legendOptions?.enableHorizontalScroll,\n } as const),\n secondary:\n secondaryItems.length === 0\n ? undefined\n : ({\n isSecondary: true,\n axisId: secondaryAxisId,\n title: legendOptions?.secondaryLegendTitle,\n actions: legendOptions?.secondaryLegendActions,\n alignment: legendOptions?.position === \"side\" ? \"vertical\" : \"horizontal\",\n horizontalAlignment: \"end\",\n enableHorizontalScroll: legendOptions?.enableHorizontalScroll,\n } as const),\n };\n}\n\n// This function returns coordinates of a rectangle, including the target point.\n// There are differences in how the rectangle is computed, but in all cases it is supposed to\n// enclose the point's visual representation in the chart, with no extra offsets.\nexport function getPointRect(point: Highcharts.Point): Rect {\n if (!point.series) {\n return { x: 0, y: 0, width: 0, height: 0 };\n }\n\n switch (point.series.type) {\n case \"column\":\n return getColumnPointRect(point);\n case \"errorbar\":\n return getErrorBarPointRect(point);\n default:\n return getDefaultPointRect(point);\n }\n}\n\n// The group rect is only used for cartesian charts. It returns coordinates of a rectangle,\n// which includes all given points, but also stretched vertically or horizontally (in inverted charts)\n// to the entire chart's height or width.\nexport function getGroupRect(points: readonly Highcharts.Point[]): Rect {\n if (points.length === 0 || !points[0].series) {\n return { x: 0, y: 0, width: 0, height: 0 };\n }\n const chart = points[0].series.chart;\n const rects = points.map(getPointRect);\n const [first, ...rest] = rects;\n let minX = first.x,\n minY = first.y,\n maxX = first.x + first.width,\n maxY = first.y + first.height;\n for (const r of rest) {\n minX = Math.min(minX, r.x);\n minY = Math.min(minY, r.y);\n maxX = Math.max(maxX, r.x + r.width);\n maxY = Math.max(maxY, r.y + r.height);\n }\n return safeRect(\n chart.inverted\n ? { x: chart.plotLeft, y: minY, width: chart.plotWidth, height: maxY - minY }\n : { x: minX, y: chart.plotTop, width: maxX - minX, height: chart.plotHeight },\n );\n}\n\n// We ensure rect width and height are non-zero to ensure its position is calculated correctly in Firefox.\nexport function safeRect(rect: Rect): Rect {\n return { ...rect, width: Math.max(0.1, rect.width), height: Math.max(0.1, rect.height) };\n}\n\nexport function getChartAccessibleDescription(chart: Highcharts.Chart) {\n return chart.options.lang?.accessibility?.chartContainerLabel ?? \"\";\n}\n\nexport function matchSizeAxis(sizeAxis: readonly CoreChartProps.SizeAxisOptions[], series: Highcharts.Series) {\n return sizeAxis.find((a) => a.id === getBubbleSeriesSizeAxis(series)) ?? sizeAxis[0];\n}\n\nexport function getPointAccessibleDescription(\n point: Highcharts.Point,\n labels: ChartLabels,\n additionalProps?: {\n sizeAxis?: readonly CoreChartProps.SizeAxisOptions[];\n },\n) {\n if (point.series.xAxis && point.series.yAxis) {\n const formattedX = getFormatter(point.series.xAxis)(point.x);\n const formattedY = getFormatter(point.series.yAxis)(point.y);\n let formattedSize = \"\";\n if (additionalProps?.sizeAxis && point.series.type === \"bubble\") {\n const matchedSizeAxis = matchSizeAxis(additionalProps.sizeAxis, point.series);\n const size = point.options.z ?? null;\n const sizeFormatter = getFormatter(matchedSizeAxis);\n formattedSize = sizeFormatter(size);\n }\n return `${formattedX} ${formattedY}${formattedSize ? \" \" + formattedSize : \"\"}, ${point.series.name}`;\n } else if (point.series.type === \"pie\") {\n const segmentLabel = labels.chartSegmentLabel ? `${labels.chartSegmentLabel} ` : \"\";\n return `${segmentLabel}${point.name}, ${point.y}. ${point.series.name}`;\n } else {\n return \"\";\n }\n}\n\nexport function getGroupAccessibleDescription(group: readonly Highcharts.Point[]) {\n const firstPoint = group[0];\n return getFormatter(firstPoint.series.xAxis)(firstPoint.x);\n}\n\n// The area-, line-, or scatter series markers are rendered as single graphic elements,\n// and we can use their respective b-boxes to compute rects.\nfunction getDefaultPointRect(point: Highcharts.Point): Rect {\n const chart = point.series.chart;\n if (point.graphic) {\n const box = point.graphic.getBBox();\n return getChartRect(box, chart, false);\n }\n return getPointRectFromCoordinates(point);\n}\n\n// The column series graphic elements are rectangles, and they are inverted if the chart is inverted,\n// so that rect's width becomes height and vice-versa.\nfunction getColumnPointRect(point: Highcharts.Point): Rect {\n const chart = point.series.chart;\n if (point.graphic) {\n return getChartRect(point.graphic.getBBox(), chart, true);\n }\n return getPointRectFromCoordinates(point);\n}\n\n// The errorbar series point rect cannot be computed from the respective graphic element (it gives wrong position).\n// Instead, we have to rely on the internal \"whiskers\" element b-box, which can be inverted, too.\nfunction getErrorBarPointRect(point: Highcharts.Point): Rect {\n const chart = point.series.chart;\n if (\"whiskers\" in point) {\n return getChartRect((point.whiskers as Highcharts.SVGElement).getBBox(), chart, true);\n }\n return getPointRectFromCoordinates(point);\n}\n\n// The point graphic is not present in large charts to optimize performance.\n// In that case we compute point rects from their coordinates. We also assume the point\n// size is small, and thereby give it 0 width and height, which is alright as there is a\n// small offset that we use for focus outline anyways.\n// See: https://www.highcharts.com/blog/news/175-highcharts-performance-boost/\nfunction getPointRectFromCoordinates(point: Highcharts.Point) {\n const chart = point.series.chart;\n const plotX = point.plotX ?? 0;\n const plotY = point.plotY ?? 0;\n return getChartRect({ x: plotX, y: plotY, width: 0, height: 0 }, chart, true);\n}\n\nfunction getChartRect(rect: Rect, chart: Highcharts.Chart, canBeInverted: boolean): Rect {\n return canBeInverted && chart.inverted\n ? {\n x: chart.plotWidth + chart.plotLeft - (rect.y + rect.height),\n y: chart.plotHeight + chart.plotTop - (rect.x + rect.width),\n width: rect.height,\n height: rect.width,\n }\n : {\n x: chart.plotLeft + rect.x,\n y: chart.plotTop + rect.y,\n width: rect.width,\n height: rect.height,\n };\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/core/utils.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAMtC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAyB,MAAM,8BAA8B,CAAC;AACpG,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAe5C,yHAAyH;AACzH,6HAA6H;AAC7H,gFAAgF;AAChF,MAAM,UAAU,WAAW,CAAC,MAAkB;IAC5C,OAAO,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACtC,CAAC;AACD,MAAM,UAAU,UAAU,CAAC,KAAuB;IAChD,OAAO,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AACrC,CAAC;AACD,MAAM,UAAU,YAAY,CAAC,OAAuC;;IAClE,OAAO,MAAA,MAAA,OAAO,CAAC,EAAE,mCAAI,OAAO,CAAC,IAAI,mCAAI,eAAe,EAAE,CAAC;AACzD,CAAC;AACD,SAAS,eAAe;IACtB,MAAM,IAAI,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,OAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACrE,OAAO,0BAA0B,GAAG,IAAI,CAAC;AAC3C,CAAC;AAED,yGAAyG;AACzG,MAAM,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EAAE,aAAsB;IACxE,OAAO,aAAa,IAAI,KAAK,CAAC,QAAQ;QACpC,CAAC,CAAC;YACE,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;YAC5D,CAAC,EAAE,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC;YAC3D,KAAK,EAAE,IAAI,CAAC,MAAM;YAClB,MAAM,EAAE,IAAI,CAAC,KAAK;SACnB;QACH,CAAC,CAAC;YACE,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;YAC1B,CAAC,EAAE,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;YACzB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC;AACR,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type Highcharts from \"highcharts\";\n\nimport { ChartSeriesMarkerType } from \"../internal/components/series-marker\";\nimport { ChartSeriesMarkerStatus } from \"../internal/components/series-marker/interfaces\";\nimport { getChartSeries, getSeriesData, SafeChart, SafeSeries } from \"../internal/utils/highcharts\";\nimport { castArray } from \"../internal/utils/utils\";\nimport { getFormatter } from \"./formatters\";\nimport { ChartLabels } from \"./i18n-utils\";\nimport { CoreChartProps, Rect } from \"./interfaces\";\n\nexport interface LegendItemSpec {\n id: string;\n name: string;\n markerType: ChartSeriesMarkerType;\n color: string;\n visible: boolean;\n isSecondary: boolean;\n status?: ChartSeriesMarkerStatus;\n markerAriaLabel?: string;\n}\n\n// The below functions extract unique identifier from series, point, or options. The identifier can be item's ID or name.\n// We expect that items requiring referencing (e.g. in order to control their visibility) have the unique identifier defined.\n// Otherwise, we return a randomized id that is to ensure no accidental matches.\nexport function getSeriesId(series: SafeSeries): string {\n return getOptionsId(series.options);\n}\nexport function getPointId(point: Highcharts.Point): string {\n return getOptionsId(point.options);\n}\nexport function getOptionsId(options: { id?: string; name?: string }): string {\n return options.id ?? options.name ?? noIdPlaceholder();\n}\nfunction noIdPlaceholder(): string {\n const rand = (Math.random() * 1_000_000).toFixed(0).padStart(6, \"0\");\n return \"awsui-no-id-placeholder-\" + rand;\n}\n\n// There are more possible values that series.stacking can take, but we only explicitly support \"normal\".\nexport function isSeriesStacked(series: SafeSeries) {\n return (series.options as any).stacking === \"normal\";\n}\n\n// The threshold series are custom series, implemented as a combination of line series, and plot lines.\n// As Highcharts does not support custom series declaration, we annotate threshold series by using the\n// series.custom property. This is then used in our utilities to recognize threshold series, and retrieve\n// the associated threshold value.\ninterface ThresholdOptions<T extends \"x-threshold\" | \"y-threshold\"> {\n custom: {\n awsui: {\n type: T;\n threshold: number;\n };\n };\n}\nexport function createThresholdMetadata<T extends \"x-threshold\" | \"y-threshold\">(\n type: T,\n value: number,\n): ThresholdOptions<T> {\n return { custom: { awsui: { type, threshold: value } } };\n}\nexport function isXThreshold(s: SafeSeries): s is SafeSeries & { options: ThresholdOptions<\"x-threshold\"> } {\n return typeof s.options.custom === \"object\" && s.options.custom.awsui?.type === \"x-threshold\";\n}\nexport function isYThreshold(s: SafeSeries): s is SafeSeries & { options: ThresholdOptions<\"y-threshold\"> } {\n return typeof s.options.custom === \"object\" && s.options.custom.awsui?.type === \"y-threshold\";\n}\n\n// We extend bubble series by introducing sizeAxis - which is used to define title and formatter for bubble series size values.\n// In case there are multiple such axes - the bubble series can target a specific one by setting sizeAxis to the respective size\n// axis id. As there is no such prop in Highcharts series type - we pass it using the custom options object.\nexport interface BubbleOptions {\n custom: {\n awsui: {\n sizeAxis?: string;\n };\n };\n}\nexport function createBubbleMetadata(options: { sizeAxis?: string }): BubbleOptions {\n return { custom: { awsui: options } };\n}\nexport function getBubbleSeriesSizeAxis(series: SafeSeries): undefined | string {\n const { custom } = series.options as Highcharts.SeriesOptionsType & BubbleOptions;\n return custom?.awsui?.sizeAxis;\n}\n\nexport function getSeriesMarkerType(series?: SafeSeries): ChartSeriesMarkerType {\n if (!series) {\n return \"large-square\";\n }\n const seriesSymbol = \"symbol\" in series && typeof series.symbol === \"string\" ? series.symbol : \"circle\";\n // In Highcharts, dashStyle supports different types of dashes: https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-dashstyle-all/\n // Return a dashed legend symbol for all of these dashes, excluding the default \"Solid\" option\n if (\"dashStyle\" in series.options && series.options.dashStyle && series.options.dashStyle !== \"Solid\") {\n return \"dashed\";\n }\n switch (series.type) {\n case \"area\":\n case \"areaspline\":\n return \"hollow-square\";\n case \"line\":\n case \"spline\":\n return \"line\";\n case \"scatter\":\n switch (seriesSymbol) {\n case \"square\":\n return \"square\";\n case \"diamond\":\n return \"diamond\";\n case \"triangle\":\n return \"triangle\";\n case \"triangle-down\":\n return \"triangle-down\";\n case \"circle\":\n default:\n return \"circle\";\n }\n case \"column\":\n case \"pie\":\n return \"large-square\";\n case \"bubble\":\n return \"circle\";\n case \"errorbar\":\n default:\n return \"large-square\";\n }\n}\n\n// Highcharts supports color objects to represent gradients and more, but we only support string\n// colors in our markers. In case a non-string color is defined, we use black color as as fallback.\nexport function getSeriesColor(series?: SafeSeries): string {\n return typeof series?.color === \"string\" ? series.color : \"black\";\n}\nexport function getPointColor(point?: Highcharts.Point): string {\n return typeof point?.color === \"string\" ? point.color : \"black\";\n}\n\n// The custom legend implementation does not rely on the Highcharts legend. When Highcharts legend is disabled,\n// the chart object does not include information on legend items. Instead, we collect series and pie segments\n// using this custom function, respecting Highcharts' showInLegend flag (defined for series only).\n\n// There exists a Highcharts APIs to access legend items, but it is unfortunately not available, when\n// Highcharts legend is disabled. Instead, we use this custom method to collect legend items from the chart.\nexport function getChartLegendItems({\n chart,\n getItemOptions = () => ({}),\n itemMarkerStatusAriaLabel,\n}: {\n chart: SafeChart;\n getItemOptions?: CoreChartProps.GetItemOptions;\n itemMarkerStatusAriaLabel?: ChartLabels[\"itemMarkerLabel\"];\n}): readonly LegendItemSpec[] {\n const legendItems: LegendItemSpec[] = [];\n const isInverted = chart.inverted ?? false;\n const addSeriesItem = (series: SafeSeries, isSecondary: boolean) => {\n // The pie series is not shown in the legend. Instead, we show pie segments.\n if (series.type === \"pie\") {\n return;\n }\n // We only support errorbar series that are linked to other series. Those are not represented separately\n // in the legend, but can be controlled from the outside, using controllable items visibility API.\n if (series.type === \"errorbar\") {\n return;\n }\n // We respect Highcharts showInLegend option to allow hiding certain series from the legend.\n // The same is not supported for pie chart segments.\n if (series.options.showInLegend !== false) {\n const seriesId = getSeriesId(series);\n const itemProps = getItemOptions(seriesId);\n const status = itemProps.status;\n legendItems.push({\n id: seriesId,\n name: series.name,\n markerType: getSeriesMarkerType(series),\n color: getSeriesColor(series),\n visible: series.visible,\n isSecondary,\n status: status,\n markerAriaLabel: itemMarkerStatusAriaLabel?.(status),\n });\n }\n };\n const addPointItem = (point: Highcharts.Point, isSecondary: boolean) => {\n if (point?.series?.type === \"pie\") {\n const pointId = getPointId(point);\n legendItems.push({\n id: pointId,\n name: point.name,\n markerType: getSeriesMarkerType(point.series),\n color: getPointColor(point),\n visible: point.visible,\n status: getItemOptions(pointId).status,\n isSecondary,\n });\n }\n };\n for (const s of getChartSeries(chart)) {\n const valueAxis = isInverted ? s.xAxis : s.yAxis;\n const isSecondary = valueAxis?.options?.opposite ?? false;\n addSeriesItem(s, isSecondary);\n getSeriesData(s, { includeHiddenPoints: true }).forEach((p) => addPointItem(p, isSecondary));\n }\n return legendItems;\n}\n\nexport type LegendItemOptions = Highcharts.SeriesOptionsType | Highcharts.PointOptionsType;\n\nexport function getVisibleLegendItems(options: Highcharts.Options) {\n const isInverted = options.chart?.inverted ?? false;\n const valueAxes = (isInverted ? castArray(options.xAxis) : castArray(options.yAxis)) ?? [];\n const defaultOpposite = valueAxes.length > 0 ? (valueAxes[0].opposite ?? false) : false;\n\n const primaryAxis = valueAxes.find((a) => !(a.opposite ?? false));\n const secondaryAxis = valueAxes.find((a) => a.opposite === true);\n\n const primaryItems: LegendItemOptions[] = [];\n const secondaryItems: LegendItemOptions[] = [];\n const addLegendItem = (item: LegendItemOptions) => {\n if (isSecondaryLegendItem(item, isInverted, defaultOpposite, valueAxes)) {\n secondaryItems.push(item);\n } else {\n primaryItems.push(item);\n }\n };\n\n options.series?.forEach((series) => {\n if (!(\"type\" in series)) {\n return;\n }\n\n // The pie series is not shown in the legend. Instead, we show pie segments (points).\n if (series.type === \"pie\") {\n if (Array.isArray(series.data)) {\n series.data.forEach((point) => addLegendItem(point));\n }\n return;\n }\n // We only support errorbar series that are linked to other series. Those are not represented separately\n // in the legend, but can be controlled from the outside, using controllable items visibility API.\n if (series.type === \"errorbar\") {\n return;\n }\n if (series.showInLegend !== false) {\n addLegendItem(series);\n }\n });\n\n return { primaryItems, secondaryItems, primaryAxisId: primaryAxis?.id, secondaryAxisId: secondaryAxis?.id };\n}\n\nfunction isSecondaryLegendItem(\n item: LegendItemOptions,\n isInverted: boolean,\n defaultOpposite: boolean,\n valueAxes: Array<{ id?: string; opposite?: boolean }>,\n): boolean {\n // Only items that have an associated axis can be considered secondary\n if (item && typeof item === \"object\" && (\"xAxis\" in item || \"yAxis\" in item)) {\n const axisRef = isInverted ? (item.xAxis ?? 0) : (item.yAxis ?? 0);\n // An axis reference can be an index into the axes array or an explicitly passed id\n const valueAxis = typeof axisRef === \"number\" ? valueAxes[axisRef] : valueAxes.find((a) => a.id === axisRef);\n return valueAxis?.opposite ?? false;\n }\n return defaultOpposite;\n}\n\nexport function getLegendsProps(\n options: CoreChartProps.ChartOptions,\n legendOptions: CoreChartProps.LegendOptions | undefined,\n) {\n // While Highcharts supports more than two axes, this\n // implementation supports at most two, in which case one\n // of them must be set as opposite (secondary).\n const { primaryItems, secondaryItems, primaryAxisId, secondaryAxisId } = getVisibleLegendItems(options);\n return {\n primary:\n primaryItems.length === 0\n ? undefined\n : ({\n isSecondary: false,\n axisId: primaryAxisId,\n title: legendOptions?.title,\n actions: legendOptions?.actions,\n alignment: legendOptions?.position === \"side\" ? \"vertical\" : \"horizontal\",\n horizontalAlignment: secondaryItems.length === 0 ? legendOptions?.horizontalAlignment : \"start\",\n enableHorizontalScroll: legendOptions?.enableHorizontalScroll,\n } as const),\n secondary:\n secondaryItems.length === 0\n ? undefined\n : ({\n isSecondary: true,\n axisId: secondaryAxisId,\n title: legendOptions?.secondaryLegendTitle,\n actions: legendOptions?.secondaryLegendActions,\n alignment: legendOptions?.position === \"side\" ? \"vertical\" : \"horizontal\",\n horizontalAlignment: \"end\",\n enableHorizontalScroll: legendOptions?.enableHorizontalScroll,\n } as const),\n };\n}\n\n// This function returns coordinates of a rectangle, including the target point.\n// There are differences in how the rectangle is computed, but in all cases it is supposed to\n// enclose the point's visual representation in the chart, with no extra offsets.\nexport function getPointRect(point: Highcharts.Point): Rect {\n if (!point.series) {\n return { x: 0, y: 0, width: 0, height: 0 };\n }\n\n switch (point.series.type) {\n case \"column\":\n return getColumnPointRect(point);\n case \"errorbar\":\n return getErrorBarPointRect(point);\n default:\n return getDefaultPointRect(point);\n }\n}\n\n// The group rect is only used for cartesian charts. It returns coordinates of a rectangle,\n// which includes all given points, but also stretched vertically or horizontally (in inverted charts)\n// to the entire chart's height or width.\nexport function getGroupRect(points: readonly Highcharts.Point[]): Rect {\n if (points.length === 0 || !points[0].series) {\n return { x: 0, y: 0, width: 0, height: 0 };\n }\n const chart = points[0].series.chart;\n const rects = points.map(getPointRect);\n const [first, ...rest] = rects;\n let minX = first.x,\n minY = first.y,\n maxX = first.x + first.width,\n maxY = first.y + first.height;\n for (const r of rest) {\n minX = Math.min(minX, r.x);\n minY = Math.min(minY, r.y);\n maxX = Math.max(maxX, r.x + r.width);\n maxY = Math.max(maxY, r.y + r.height);\n }\n return safeRect(\n chart.inverted\n ? { x: chart.plotLeft, y: minY, width: chart.plotWidth, height: maxY - minY }\n : { x: minX, y: chart.plotTop, width: maxX - minX, height: chart.plotHeight },\n );\n}\n\n// We ensure rect width and height are non-zero to ensure its position is calculated correctly in Firefox.\nexport function safeRect(rect: Rect): Rect {\n return { ...rect, width: Math.max(0.1, rect.width), height: Math.max(0.1, rect.height) };\n}\n\nexport function getChartAccessibleDescription(chart: SafeChart) {\n return chart.options.lang?.accessibility?.chartContainerLabel ?? \"\";\n}\n\nexport function matchSizeAxis(sizeAxis: readonly CoreChartProps.SizeAxisOptions[], series: SafeSeries) {\n return sizeAxis.find((a) => a.id === getBubbleSeriesSizeAxis(series)) ?? sizeAxis[0];\n}\n\nexport function getPointAccessibleDescription(\n point: Highcharts.Point,\n labels: ChartLabels,\n additionalProps?: {\n sizeAxis?: readonly CoreChartProps.SizeAxisOptions[];\n },\n) {\n if (point.series.xAxis && point.series.yAxis) {\n const formattedX = getFormatter(point.series.xAxis)(point.x);\n const formattedY = getFormatter(point.series.yAxis)(point.y);\n let formattedSize = \"\";\n if (additionalProps?.sizeAxis && point.series.type === \"bubble\") {\n const matchedSizeAxis = matchSizeAxis(additionalProps.sizeAxis, point.series);\n const size = point.options.z ?? null;\n const sizeFormatter = getFormatter(matchedSizeAxis);\n formattedSize = sizeFormatter(size);\n }\n return `${formattedX} ${formattedY}${formattedSize ? \" \" + formattedSize : \"\"}, ${point.series.name}`;\n } else if (point.series.type === \"pie\") {\n const segmentLabel = labels.chartSegmentLabel ? `${labels.chartSegmentLabel} ` : \"\";\n return `${segmentLabel}${point.name}, ${point.y}. ${point.series.name}`;\n } else {\n return \"\";\n }\n}\n\nexport function getGroupAccessibleDescription(group: readonly Highcharts.Point[]) {\n const firstPoint = group[0];\n return getFormatter(firstPoint.series.xAxis)(firstPoint.x);\n}\n\n// The area-, line-, or scatter series markers are rendered as single graphic elements,\n// and we can use their respective b-boxes to compute rects.\nfunction getDefaultPointRect(point: Highcharts.Point): Rect {\n const chart = point.series.chart;\n if (point.graphic) {\n const box = point.graphic.getBBox();\n return getChartRect(box, chart, false);\n }\n return getPointRectFromCoordinates(point);\n}\n\n// The column series graphic elements are rectangles, and they are inverted if the chart is inverted,\n// so that rect's width becomes height and vice-versa.\nfunction getColumnPointRect(point: Highcharts.Point): Rect {\n const chart = point.series.chart;\n if (point.graphic) {\n return getChartRect(point.graphic.getBBox(), chart, true);\n }\n return getPointRectFromCoordinates(point);\n}\n\n// The errorbar series point rect cannot be computed from the respective graphic element (it gives wrong position).\n// Instead, we have to rely on the internal \"whiskers\" element b-box, which can be inverted, too.\nfunction getErrorBarPointRect(point: Highcharts.Point): Rect {\n const chart = point.series.chart;\n if (\"whiskers\" in point) {\n return getChartRect((point.whiskers as Highcharts.SVGElement).getBBox(), chart, true);\n }\n return getPointRectFromCoordinates(point);\n}\n\n// The point graphic is not present in large charts to optimize performance.\n// In that case we compute point rects from their coordinates. We also assume the point\n// size is small, and thereby give it 0 width and height, which is alright as there is a\n// small offset that we use for focus outline anyways.\n// See: https://www.highcharts.com/blog/news/175-highcharts-performance-boost/\nfunction getPointRectFromCoordinates(point: Highcharts.Point) {\n const chart = point.series.chart;\n const plotX = point.plotX ?? 0;\n const plotY = point.plotY ?? 0;\n return getChartRect({ x: plotX, y: plotY, width: 0, height: 0 }, chart, true);\n}\n\nfunction getChartRect(rect: Rect, chart: SafeChart, canBeInverted: boolean): Rect {\n return canBeInverted && chart.inverted\n ? {\n x: chart.plotWidth + chart.plotLeft - (rect.y + rect.height),\n y: chart.plotHeight + chart.plotTop - (rect.x + rect.width),\n width: rect.height,\n height: rect.width,\n }\n : {\n x: chart.plotLeft + rect.x,\n y: chart.plotTop + rect.y,\n width: rect.width,\n height: rect.height,\n };\n}\n"]}