@cloudscape-design/chart-components 1.0.45 → 1.0.47
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.
- package/cartesian-chart/chart-cartesian-internal.js.map +1 -1
- package/cartesian-chart/chart-series-cartesian.js +6 -2
- package/cartesian-chart/chart-series-cartesian.js.map +1 -1
- package/cartesian-chart/index.js.map +1 -1
- package/cartesian-chart/interfaces.js.map +1 -1
- package/core/chart-api/chart-extra-axis-titles.js.map +1 -1
- package/core/chart-api/chart-extra-context.js.map +1 -1
- package/core/chart-api/chart-extra-highlight.js.map +1 -1
- package/core/chart-api/chart-extra-legend.js.map +1 -1
- package/core/chart-api/chart-extra-navigation.js.map +1 -1
- package/core/chart-api/chart-extra-nodata.js.map +1 -1
- package/core/chart-api/chart-extra-pointer.js.map +1 -1
- package/core/chart-api/chart-extra-tooltip.d.ts +2 -2
- package/core/chart-api/chart-extra-tooltip.js.map +1 -1
- package/core/chart-api/index.d.ts +7 -7
- package/core/chart-api/index.js.map +1 -1
- package/core/chart-core.js.map +1 -1
- package/core/components/core-legend.js.map +1 -1
- package/core/components/core-no-data.js.map +1 -1
- package/core/components/core-tooltip.js.map +1 -1
- package/core/components/core-vertical-axis-title.js.map +1 -1
- package/core/formatters.js.map +1 -1
- package/core/i18n-utils.js.map +1 -1
- package/core/interfaces.js.map +1 -1
- package/core/utils.js +3 -0
- package/core/utils.js.map +1 -1
- package/internal/api-docs/components/cartesian-chart.js +2 -2
- package/internal/api-docs/components/pie-chart.js +2 -2
- package/internal/base-component/get-data-attributes.js.map +1 -1
- package/internal/components/chart-legend/index.js.map +1 -1
- package/internal/components/series-details/index.js.map +1 -1
- package/internal/components/series-marker/render-marker.js.map +1 -1
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/events/index.js.map +1 -1
- package/internal/manifest.json +1 -1
- package/internal/utils/async-store.js.map +1 -1
- package/internal/utils/dom.js.map +1 -1
- package/internal/utils/renderer-utils.js.map +1 -1
- package/internal/utils/use-debounced-value.js.map +1 -1
- package/internal/utils/utils.js.map +1 -1
- package/internal-do-not-use/core-legend/index.js.map +1 -1
- package/package.json +4 -4
- package/pie-chart/chart-inner-area.js.map +1 -1
- package/pie-chart/chart-pie-internal.js.map +1 -1
- package/pie-chart/index.js.map +1 -1
- package/test-utils/dom/cartesian-chart/index.js +1 -1
- package/test-utils/dom/cartesian-chart/index.js.map +1 -1
- package/test-utils/dom/index.js +1 -1
- package/test-utils/dom/index.js.map +1 -1
- package/test-utils/dom/internal/base.js +1 -1
- package/test-utils/dom/internal/base.js.map +1 -1
- package/test-utils/dom/pie-chart/index.js +1 -1
- package/test-utils/dom/pie-chart/index.js.map +1 -1
- package/test-utils/selectors/cartesian-chart/index.js +1 -1
- package/test-utils/selectors/cartesian-chart/index.js.map +1 -1
- package/test-utils/selectors/index.js +1 -1
- package/test-utils/selectors/index.js.map +1 -1
- package/test-utils/selectors/internal/base.js +1 -1
- package/test-utils/selectors/internal/base.js.map +1 -1
- package/test-utils/selectors/pie-chart/index.js +1 -1
- package/test-utils/selectors/pie-chart/index.js.map +1 -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;AAEjE,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,kB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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 {\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[]) =>\n this.chartExtraLegend.onItemVisibilityChange(items, { isApiCall: false });\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[], { isApiCall }: { isApiCall: boolean }) => {\n this.chartExtraLegend.onItemVisibilityChange(visibleItemsIds, { isApiCall });\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, { isApiCall: true }),\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 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,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEjE,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,EAC7B,6BAA6B,EAC7B,YAAY,GACb,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,oBAAoB,EAA2B,MAAM,2B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CAAC,KAAK,EAAE,mBAAmB,CAAC,CAAC;YACxE,CAAC;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 {\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[]) =>\n this.chartExtraLegend.onItemVisibilityChange(items, { isApiCall: false });\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[], { isApiCall }: { isApiCall: boolean }) => {\n this.chartExtraLegend.onItemVisibilityChange(visibleItemsIds, { isApiCall });\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, { isApiCall: true }),\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 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"]}
|
package/core/chart-core.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-core.js","sourceRoot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,CAAC,eAAe,CAAC;AACtB,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 clsx from \"clsx\";\nimport type Highcharts from \"highcharts\";\nimport HighchartsReact from \"highcharts-react-official\";\n\nimport {\n getIsRtl,\n isDevelopment,\n KeyCode,\n useMergeRefs,\n useUniqueId,\n} from \"@cloudscape-design/component-toolkit/internal\";\nimport Spinner from \"@cloudscape-design/components/spinner\";\n\nimport { getDataAttributes } from \"../internal/base-component/get-data-attributes\";\nimport { InternalBaseComponentProps } from \"../internal/base-component/use-base-component\";\nimport * as Styles from \"../internal/chart-styles\";\nimport { castArray } from \"../internal/utils/utils\";\nimport { useChartAPI } from \"./chart-api\";\nimport { ChartExtraContext } from \"./chart-api/chart-extra-context\";\nimport { ChartContainer } from \"./chart-container\";\nimport { ChartApplication } from \"./components/core-application\";\nimport { ChartFilters } from \"./components/core-filters\";\nimport { ChartLegend } from \"./components/core-legend\";\nimport { ChartNoData } from \"./components/core-no-data\";\nimport { ChartFooter, ChartHeader } from \"./components/core-slots\";\nimport { ChartTooltip } from \"./components/core-tooltip\";\nimport { VerticalAxisTitle } from \"./components/core-vertical-axis-title\";\nimport { getFormatter } from \"./formatters\";\nimport { useChartI18n } from \"./i18n-utils\";\nimport { CoreChartProps } from \"./interfaces\";\nimport { getLegendsProps, getPointAccessibleDescription } from \"./utils\";\n\nimport styles from \"./styles.css.js\";\nimport testClasses from \"./test-classes/styles.css.js\";\n\n/**\n * CoreChart is the core internal abstraction that accepts the entire set of Highcharts options along\n * with Cloudscape props to define custom tooltip, no-data, formatters, items visibility, and more.\n */\nexport function InternalCoreChart({\n options,\n ariaLabel,\n ariaDescription,\n fitHeight,\n chartHeight,\n chartMinHeight,\n chartMinWidth,\n tooltip: tooltipOptions,\n noData: noDataOptions,\n navigator,\n legend: legendOptions,\n fallback = <Spinner />,\n callback,\n emphasizeBaseline = true,\n verticalAxisTitlePlacement = \"side\",\n i18nStrings,\n className,\n header,\n footer,\n filter,\n keyboardNavigation = true,\n onHighlight,\n onLegendItemHighlight,\n onClearHighlight,\n onVisibleItemsChange,\n visibleItems,\n __internalRootRef,\n getItemOptions,\n ...rest\n}: CoreChartProps & InternalBaseComponentProps) {\n const highcharts = rest.highcharts as null | typeof Highcharts;\n const labels = useChartI18n({ ariaLabel, ariaDescription, i18nStrings });\n const context: ChartExtraContext[\"settings\"] = {\n chartId: useUniqueId(),\n noDataEnabled: !!noDataOptions,\n legendEnabled: legendOptions?.enabled !== false,\n tooltipEnabled: tooltipOptions?.enabled !== false,\n keyboardNavigationEnabled: keyboardNavigation,\n labels,\n getItemOptions: getItemOptions ?? (() => ({})),\n };\n const handlers = { onHighlight, onClearHighlight, onVisibleItemsChange };\n const state = { visibleItems };\n const api = useChartAPI(context, handlers, state);\n\n const rootClassName = clsx(testClasses.root, styles.root, fitHeight && styles[\"root-fit-height\"], className);\n const rootRef = useRef<HTMLDivElement>(null);\n const mergedRootRef = useMergeRefs(rootRef, __internalRootRef);\n const rootProps = { ref: mergedRootRef, className: rootClassName, ...getDataAttributes(rest) };\n const legendPosition = legendOptions?.position ?? \"bottom\";\n const commonLegendProps = {\n api: api,\n i18nStrings,\n onItemHighlight: onLegendItemHighlight,\n getLegendTooltipContent: rest.getLegendTooltipContent,\n };\n const containerProps = {\n fitHeight,\n chartHeight,\n chartMinHeight,\n chartMinWidth,\n legendPosition,\n verticalAxisTitlePlacement,\n legendBottomMaxHeight: legendOptions?.bottomMaxHeight,\n };\n\n // AWSUI-61678\n // Add global Escape key listener to dismiss hover tooltips for WCAG Content on Hover/Focus compliance\n // Only enabled when keyboard navigation is disabled; when enabled, navigation handles Escape\n useEffect(() => {\n if (!context.keyboardNavigationEnabled) {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.keyCode === KeyCode.escape && context.tooltipEnabled) {\n const tooltipState = api.tooltipStore.get();\n if (tooltipState.visible && !tooltipState.pinned) {\n api.hideTooltip();\n }\n }\n };\n\n document.addEventListener(\"keydown\", handleKeyDown);\n return () => {\n document.removeEventListener(\"keydown\", handleKeyDown);\n };\n }\n }, [api, context.tooltipEnabled, context.keyboardNavigationEnabled]);\n\n // Render fallback using the same root and container props as for the chart to ensure consistent\n // size, test classes, and data-attributes assignment.\n if (!highcharts) {\n return (\n <div {...rootProps}>\n <ChartContainer\n {...containerProps}\n chart={(minHeight) => (\n <div className={testClasses.fallback} style={{ minHeight }}>\n {fallback}\n </div>\n )}\n />\n </div>\n );\n }\n\n const apiOptions = api.getOptions();\n const inverted = !!options.chart?.inverted;\n const isRtl = getIsRtl(rootRef?.current);\n\n // The Highcharts options takes all provided Highcharts options and custom properties and merges them together, so that\n // the Cloudscape features and custom Highcharts extensions co-exist.\n // For certain options we provide Cloudscape styling, but in all cases this can be explicitly overridden.\n options = {\n ...options,\n // Hide credits by default.\n credits: options.credits ?? { enabled: false },\n // Hide chart title by default.\n title: options.title ?? { text: \"\" },\n // Use Cloudscape color palette by default.\n // This cannot be reset to Highcharts' default from the outside, but it is possible to provide custom palette.\n colors: options.colors ?? Styles.colors,\n chart: {\n // Animations are disabled by default.\n // This is done for UX and a11y reasons as Highcharts animations do not match our animation timings, and do\n // not respect disabled motion settings. These issues can likely be resolved or we can provide custom animations\n // instead, but this is not a priority.\n animation: false,\n ...Styles.chart,\n ...options.chart,\n className: clsx(testClasses[\"chart-plot\"], options.chart?.className),\n // The debug errors are enabled by default in development mode, but this only works\n // if the Highcharts debugger module is loaded.\n displayErrors: options.chart?.displayErrors ?? isDevelopment,\n style: { ...Styles.chartPlotCss, ...options.chart?.style },\n },\n series: options.series,\n // Highcharts legend is disabled by default in favour of the custom Cloudscape legend.\n legend: options.legend ?? { enabled: false },\n lang: {\n ...options.lang,\n accessibility: {\n // The default chart title is disabled by default to prevent the default \"Chart\" in the screen-reader detail.\n defaultChartTitle: \"\",\n chartContainerLabel: labels.chartLabel,\n svgContainerLabel: labels.chartContainerLabel,\n // We used {names[0]} to inject the axis title, see: https://api.highcharts.com/highcharts/lang.accessibility.axis.xAxisDescriptionSingular.\n axis: {\n xAxisDescriptionSingular: labels.chartXAxisLabel ? `${labels.chartXAxisLabel}, {names[0]}` : undefined,\n yAxisDescriptionSingular: labels.chartYAxisLabel ? `${labels.chartYAxisLabel}, {names[0]}` : undefined,\n },\n ...options.lang?.accessibility,\n },\n },\n accessibility: {\n description: labels.chartDescription,\n screenReaderSection: {\n // We use custom before-message to remove detail that are currently not supported with our i18n.\n // See: https://api.highcharts.com/highcharts/accessibility.screenReaderSection.beforeChartFormat.\n beforeChartFormat: \"<div>{xAxisDescription}</div><div>{yAxisDescription}</div>\",\n // We hide after message as it is currently not supported with our i18n.\n afterChartFormat: \"\",\n },\n ...options.accessibility,\n // Highcharts keyboard navigation is disabled by default in favour of the custom Cloudscape navigation.\n keyboardNavigation: options.accessibility?.keyboardNavigation ?? { enabled: !keyboardNavigation },\n point: {\n // Point description formatter is overridden to respect custom axes value formatters.\n descriptionFormatter: (point) => getPointAccessibleDescription(point, labels),\n ...options.accessibility?.point,\n },\n },\n // We use the rtl adjusted axes (instead of the original options.xAxis/yAxis) to ensure the chart renders\n // with the correct axis orientation for RTL layouts, matching what was used for legend positioning above.\n xAxis: castArray(options.xAxis)?.map((xAxisOptions) => ({\n ...Styles.xAxisOptions,\n ...xAxisOptions,\n // Depending on the chart.inverted the x-axis can be rendered as vertical, and needs to respect page direction.\n reversed: !inverted && isRtl ? !xAxisOptions.reversed : xAxisOptions.reversed,\n opposite: inverted && isRtl ? !xAxisOptions.opposite : xAxisOptions.opposite,\n className: xAxisClassName(inverted, xAxisOptions.className),\n title: axisTitle(xAxisOptions.title ?? {}, !inverted || verticalAxisTitlePlacement === \"side\"),\n labels: axisLabels(xAxisOptions.labels ?? {}),\n })),\n yAxis: castArray(options.yAxis)?.map((yAxisOptions) => ({\n ...Styles.yAxisOptions,\n ...yAxisOptions,\n // Depending on the chart.inverted the y-axis can be rendered as vertical, and needs to respect page direction.\n reversed: inverted && isRtl ? !yAxisOptions.reversed : yAxisOptions.reversed,\n opposite: !inverted && isRtl ? !yAxisOptions.opposite : yAxisOptions.opposite,\n className: yAxisClassName(inverted, yAxisOptions.className),\n title: axisTitle(yAxisOptions.title ?? {}, inverted || verticalAxisTitlePlacement === \"side\"),\n labels: axisLabels(yAxisOptions.labels ?? {}),\n plotLines: yAxisPlotLines(yAxisOptions.plotLines, emphasizeBaseline),\n // We use reversed stack by default so that the order of points in the tooltip and series in the legend\n // correspond the order of stacks.\n reversedStacks: yAxisOptions.reversedStacks ?? true,\n })),\n plotOptions: {\n ...options.plotOptions,\n series: {\n // Animations are disabled by default, same as in the options.chart.\n animation: false,\n // Sticky tracking is disabled by default due to sub-optimal UX in dense charts.\n stickyTracking: false,\n borderColor: Styles.seriesBorderColor,\n ...options.plotOptions?.series,\n dataLabels: { style: Styles.seriesDataLabelsCss, ...options.plotOptions?.series?.dataLabels },\n states: {\n ...options.plotOptions?.series?.states,\n inactive: { opacity: Styles.seriesOpacityInactive, ...options.plotOptions?.series?.states?.inactive },\n },\n },\n area: { ...Styles.areaSeries, ...options.plotOptions?.area },\n areaspline: { ...Styles.areaSeries, ...options.plotOptions?.areaspline },\n arearange: { ...Styles.areaSeries, ...options.plotOptions?.arearange },\n areasplinerange: { ...Styles.areaSeries, ...options.plotOptions?.areasplinerange },\n line: { ...Styles.lineSeries, ...options.plotOptions?.line },\n spline: { ...Styles.lineSeries, ...options.plotOptions?.spline },\n column: { ...Styles.columnSeries, ...options.plotOptions?.column },\n errorbar: { ...Styles.errorbarSeries, ...options.plotOptions?.errorbar },\n // Pie chart is shown in legend by default, that is required for standalone pie charts.\n pie: {\n showInLegend: true,\n ...Styles.pieSeries,\n ...options.plotOptions?.pie,\n dataLabels: { ...Styles.pieSeriesDataLabels, ...options.plotOptions?.pie?.dataLabels },\n },\n },\n // We don't use Highcharts tooltip, but certain tooltip options such as tooltip.snap or tooltip.shared\n // affect the hovering behavior of Highcharts. That is only the case when the tooltip is not disabled,\n // so we render it, but hide with styles.\n tooltip: options.tooltip ?? { enabled: true, snap: Styles.tooltipSnap, style: { opacity: 0 } },\n };\n\n const legendProps = getLegendsProps(options, legendOptions);\n\n return (\n <div {...rootProps}>\n <ChartContainer\n {...containerProps}\n chart={(height) => {\n // We declare event handlers here to ensure that no event fires until the chart is initialized.\n const highchartsOptions: Highcharts.Options = {\n ...options,\n chart: {\n ...options.chart,\n // Use height computed from chartHeight, chartMinHeight, and fitHeight settings by default.\n // It is possible to override it by explicitly providing chart.height, but this will not be\n // compatible with any of the above settings.\n height: options.chart?.height ?? height,\n // We override certain chart events to inject additional behaviors, but it is still possible to define\n // custom callbacks. The Cloudscape behaviors can be disabled or altered via components API. For instance,\n // if no-data props are not provided - the related on-render computations will be skipped.\n events: {\n ...options.chart?.events,\n load(event) {\n apiOptions.onChartLoad.call(this, event);\n return options.chart?.events?.load?.call(this, event);\n },\n render(event) {\n apiOptions.onChartRender.call(this, event);\n return options.chart?.events?.render?.call(this, event);\n },\n click(event) {\n apiOptions.onChartClick.call(this, event);\n return options.chart?.events?.click?.call(this, event);\n },\n },\n },\n plotOptions: {\n ...options.plotOptions,\n series: {\n ...options.plotOptions?.series,\n // We override certain point events to inject additional behaviors, but it is still possible to define\n // custom callbacks. The Cloudscape behaviors can be disabled or altered via components API.\n point: {\n ...options.plotOptions?.series?.point,\n events: {\n ...options.plotOptions?.series?.point?.events,\n mouseOver(event) {\n apiOptions.onSeriesPointMouseOver.call(this, event);\n return options.plotOptions?.series?.point?.events?.mouseOver?.call(this, event);\n },\n mouseOut(event) {\n apiOptions.onSeriesPointMouseOut.call(this, event);\n return options.plotOptions?.series?.point?.events?.mouseOut?.call(this, event);\n },\n click(event) {\n apiOptions.onSeriesPointClick.call(this, event);\n return options.plotOptions?.series?.point?.events?.click?.call(this, event);\n },\n },\n },\n },\n },\n };\n return (\n <>\n <ChartApplication api={api} keyboardNavigation={keyboardNavigation} ariaLabel={ariaLabel} />\n <HighchartsReact\n highcharts={highcharts}\n options={highchartsOptions}\n callback={(chart: Highcharts.Chart) =>\n callback?.({ chart, highcharts: highcharts as typeof Highcharts, ...api.publicApi })\n }\n />\n </>\n );\n }}\n navigator={navigator}\n primaryLegend={\n context.legendEnabled && legendProps.primary ? (\n <ChartLegend {...commonLegendProps} {...legendProps.primary} className={testClasses[\"legend-primary\"]} />\n ) : null\n }\n secondaryLegend={\n context.legendEnabled && legendProps.secondary ? (\n <ChartLegend\n {...commonLegendProps}\n {...legendProps.secondary}\n className={testClasses[\"legend-secondary\"]}\n />\n ) : null\n }\n verticalAxisTitle={\n verticalAxisTitlePlacement === \"top\" ? <VerticalAxisTitle api={api} inverted={!!inverted} /> : null\n }\n header={header?.content ? <ChartHeader>{header.content}</ChartHeader> : null}\n footer={footer?.content ? <ChartFooter>{footer.content}</ChartFooter> : null}\n filter={\n filter?.seriesFilter || filter?.additionalFilters ? (\n <ChartFilters\n api={api}\n seriesFilter={filter?.seriesFilter}\n additionalFilters={filter?.additionalFilters}\n i18nStrings={i18nStrings}\n />\n ) : null\n }\n noData={context.noDataEnabled && <ChartNoData {...noDataOptions} i18nStrings={i18nStrings} api={api} />}\n />\n\n {context.tooltipEnabled && (\n <ChartTooltip\n {...tooltipOptions}\n i18nStrings={i18nStrings}\n getTooltipContent={rest.getTooltipContent}\n api={api}\n />\n )}\n </div>\n );\n}\n\nfunction xAxisClassName(inverted: boolean, customClassName?: string) {\n return clsx(\n testClasses[\"axis-x\"],\n inverted ? testClasses[\"axis-vertical\"] : testClasses[\"axis-horizontal\"],\n customClassName,\n );\n}\n\nfunction yAxisClassName(inverted: boolean, customClassName?: string) {\n return clsx(\n testClasses[\"axis-y\"],\n inverted ? testClasses[\"axis-horizontal\"] : testClasses[\"axis-vertical\"],\n customClassName,\n );\n}\n\n// When placing vertical axis title in the chart's top, the actual axis title rendered by Highcharts\n// needs to be visually hidden (it is still accessible by screen-readers). We then set title's\n// opacity to 0, and use reserveSpace=false, so that Highcharts stretches the plot area to all available\n// container width.\nfunction axisTitle<O extends Highcharts.XAxisTitleOptions | Highcharts.YAxisTitleOptions>(\n options: O,\n visible: boolean,\n): O {\n return {\n style: { ...Styles.axisTitleCss, opacity: visible ? undefined : 0 },\n reserveSpace: visible ? undefined : false,\n ...options,\n };\n}\n\n// We use custom formatters instead of Highcharts defaults to ensure consistent formatting\n// between axis ticks and tooltip contents.\nfunction axisLabels<O extends Highcharts.XAxisLabelsOptions | Highcharts.YAxisLabelsOptions>(options: O): O {\n return {\n style: Styles.axisLabelsCss,\n formatter: function () {\n const formattedValue = getFormatter(this.axis)(this.value);\n return formattedValue.replace(/\\n/g, \"<br />\");\n },\n ...options,\n };\n}\n\nfunction yAxisPlotLines(\n plotLineOptions: Highcharts.YAxisPlotLinesOptions[] = [],\n emphasizeBaseline: boolean,\n): Highcharts.YAxisPlotLinesOptions[] {\n return emphasizeBaseline\n ? [{ value: 0, ...Styles.chatPlotBaseline, className: testClasses[\"emphasized-baseline\"] }, ...plotLineOptions]\n : plotLineOptions;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"chart-core.js","sourceRoot":"","sources":["../../../src/core/chart-core.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,eAAe,MAAM,2BAA2B,CAAC;AAExD,OAAO,EACL,QAAQ,EACR,aAAa,EACb,OAAO,EACP,YAAY,EACZ,WAAW,GACZ,MAAM,+CAA+C,CAAC;AACvD,OAAO,OAAO,MAAM,uCAAuC,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AAEnF,OAAO,KAAK,MAAM,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;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AAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE;QACnE,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK;QACzC,GAAG,OAAO;KACX,CAAC;AACJ,CAAC;AAED,0FAA0F;AAC1F,2CAA2C;AAC3C,SAAS,UAAU,CAA0E,OAAU;IACrG,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,aAAa;QAC3B,SAAS,EAAE;YACT,MAAM,cAAc,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC3D,OAAO,cAAc,CAAC,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QACjD,CAAC;QACD,GAAG,OAAO;KACX,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CACrB,kBAAsD,EAAE,EACxD,iBAA0B;IAE1B,OAAO,iBAAiB;QACtB,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC,gBAAgB,EAAE,SAAS,EAAE,WAAW,CAAC,qBAAqB,CAAC,EAAE,EAAE,GAAG,eAAe,CAAC;QAC/G,CAAC,CAAC,eAAe,CAAC;AACtB,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 clsx from \"clsx\";\nimport type Highcharts from \"highcharts\";\nimport HighchartsReact from \"highcharts-react-official\";\n\nimport {\n getIsRtl,\n isDevelopment,\n KeyCode,\n useMergeRefs,\n useUniqueId,\n} from \"@cloudscape-design/component-toolkit/internal\";\nimport Spinner from \"@cloudscape-design/components/spinner\";\n\nimport { getDataAttributes } from \"../internal/base-component/get-data-attributes\";\nimport { InternalBaseComponentProps } from \"../internal/base-component/use-base-component\";\nimport * as Styles from \"../internal/chart-styles\";\nimport { castArray } from \"../internal/utils/utils\";\nimport { useChartAPI } from \"./chart-api\";\nimport { ChartExtraContext } from \"./chart-api/chart-extra-context\";\nimport { ChartContainer } from \"./chart-container\";\nimport { ChartApplication } from \"./components/core-application\";\nimport { ChartFilters } from \"./components/core-filters\";\nimport { ChartLegend } from \"./components/core-legend\";\nimport { ChartNoData } from \"./components/core-no-data\";\nimport { ChartFooter, ChartHeader } from \"./components/core-slots\";\nimport { ChartTooltip } from \"./components/core-tooltip\";\nimport { VerticalAxisTitle } from \"./components/core-vertical-axis-title\";\nimport { getFormatter } from \"./formatters\";\nimport { useChartI18n } from \"./i18n-utils\";\nimport { CoreChartProps } from \"./interfaces\";\nimport { getLegendsProps, getPointAccessibleDescription } from \"./utils\";\n\nimport styles from \"./styles.css.js\";\nimport testClasses from \"./test-classes/styles.css.js\";\n\n/**\n * CoreChart is the core internal abstraction that accepts the entire set of Highcharts options along\n * with Cloudscape props to define custom tooltip, no-data, formatters, items visibility, and more.\n */\nexport function InternalCoreChart({\n options,\n ariaLabel,\n ariaDescription,\n fitHeight,\n chartHeight,\n chartMinHeight,\n chartMinWidth,\n tooltip: tooltipOptions,\n noData: noDataOptions,\n navigator,\n legend: legendOptions,\n fallback = <Spinner />,\n callback,\n emphasizeBaseline = true,\n verticalAxisTitlePlacement = \"side\",\n i18nStrings,\n className,\n header,\n footer,\n filter,\n keyboardNavigation = true,\n onHighlight,\n onLegendItemHighlight,\n onClearHighlight,\n onVisibleItemsChange,\n visibleItems,\n __internalRootRef,\n getItemOptions,\n ...rest\n}: CoreChartProps & InternalBaseComponentProps) {\n const highcharts = rest.highcharts as null | typeof Highcharts;\n const labels = useChartI18n({ ariaLabel, ariaDescription, i18nStrings });\n const context: ChartExtraContext[\"settings\"] = {\n chartId: useUniqueId(),\n noDataEnabled: !!noDataOptions,\n legendEnabled: legendOptions?.enabled !== false,\n tooltipEnabled: tooltipOptions?.enabled !== false,\n keyboardNavigationEnabled: keyboardNavigation,\n labels,\n getItemOptions: getItemOptions ?? (() => ({})),\n };\n const handlers = { onHighlight, onClearHighlight, onVisibleItemsChange };\n const state = { visibleItems };\n const api = useChartAPI(context, handlers, state);\n\n const rootClassName = clsx(testClasses.root, styles.root, fitHeight && styles[\"root-fit-height\"], className);\n const rootRef = useRef<HTMLDivElement>(null);\n const mergedRootRef = useMergeRefs(rootRef, __internalRootRef);\n const rootProps = { ref: mergedRootRef, className: rootClassName, ...getDataAttributes(rest) };\n const legendPosition = legendOptions?.position ?? \"bottom\";\n const commonLegendProps = {\n api: api,\n i18nStrings,\n onItemHighlight: onLegendItemHighlight,\n getLegendTooltipContent: rest.getLegendTooltipContent,\n };\n const containerProps = {\n fitHeight,\n chartHeight,\n chartMinHeight,\n chartMinWidth,\n legendPosition,\n verticalAxisTitlePlacement,\n legendBottomMaxHeight: legendOptions?.bottomMaxHeight,\n };\n\n // AWSUI-61678\n // Add global Escape key listener to dismiss hover tooltips for WCAG Content on Hover/Focus compliance\n // Only enabled when keyboard navigation is disabled; when enabled, navigation handles Escape\n useEffect(() => {\n if (!context.keyboardNavigationEnabled) {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.keyCode === KeyCode.escape && context.tooltipEnabled) {\n const tooltipState = api.tooltipStore.get();\n if (tooltipState.visible && !tooltipState.pinned) {\n api.hideTooltip();\n }\n }\n };\n\n document.addEventListener(\"keydown\", handleKeyDown);\n return () => {\n document.removeEventListener(\"keydown\", handleKeyDown);\n };\n }\n }, [api, context.tooltipEnabled, context.keyboardNavigationEnabled]);\n\n // Render fallback using the same root and container props as for the chart to ensure consistent\n // size, test classes, and data-attributes assignment.\n if (!highcharts) {\n return (\n <div {...rootProps}>\n <ChartContainer\n {...containerProps}\n chart={(minHeight) => (\n <div className={testClasses.fallback} style={{ minHeight }}>\n {fallback}\n </div>\n )}\n />\n </div>\n );\n }\n\n const apiOptions = api.getOptions();\n const inverted = !!options.chart?.inverted;\n const isRtl = getIsRtl(rootRef?.current);\n\n // The Highcharts options takes all provided Highcharts options and custom properties and merges them together, so that\n // the Cloudscape features and custom Highcharts extensions co-exist.\n // For certain options we provide Cloudscape styling, but in all cases this can be explicitly overridden.\n options = {\n ...options,\n // Hide credits by default.\n credits: options.credits ?? { enabled: false },\n // Hide chart title by default.\n title: options.title ?? { text: \"\" },\n // Use Cloudscape color palette by default.\n // This cannot be reset to Highcharts' default from the outside, but it is possible to provide custom palette.\n colors: options.colors ?? Styles.colors,\n chart: {\n // Animations are disabled by default.\n // This is done for UX and a11y reasons as Highcharts animations do not match our animation timings, and do\n // not respect disabled motion settings. These issues can likely be resolved or we can provide custom animations\n // instead, but this is not a priority.\n animation: false,\n ...Styles.chart,\n ...options.chart,\n className: clsx(testClasses[\"chart-plot\"], options.chart?.className),\n // The debug errors are enabled by default in development mode, but this only works\n // if the Highcharts debugger module is loaded.\n displayErrors: options.chart?.displayErrors ?? isDevelopment,\n style: { ...Styles.chartPlotCss, ...options.chart?.style },\n },\n series: options.series,\n // Highcharts legend is disabled by default in favour of the custom Cloudscape legend.\n legend: options.legend ?? { enabled: false },\n lang: {\n ...options.lang,\n accessibility: {\n // The default chart title is disabled by default to prevent the default \"Chart\" in the screen-reader detail.\n defaultChartTitle: \"\",\n chartContainerLabel: labels.chartLabel,\n svgContainerLabel: labels.chartContainerLabel,\n // We used {names[0]} to inject the axis title, see: https://api.highcharts.com/highcharts/lang.accessibility.axis.xAxisDescriptionSingular.\n axis: {\n xAxisDescriptionSingular: labels.chartXAxisLabel ? `${labels.chartXAxisLabel}, {names[0]}` : undefined,\n yAxisDescriptionSingular: labels.chartYAxisLabel ? `${labels.chartYAxisLabel}, {names[0]}` : undefined,\n },\n ...options.lang?.accessibility,\n },\n },\n accessibility: {\n description: labels.chartDescription,\n screenReaderSection: {\n // We use custom before-message to remove detail that are currently not supported with our i18n.\n // See: https://api.highcharts.com/highcharts/accessibility.screenReaderSection.beforeChartFormat.\n beforeChartFormat: \"<div>{xAxisDescription}</div><div>{yAxisDescription}</div>\",\n // We hide after message as it is currently not supported with our i18n.\n afterChartFormat: \"\",\n },\n ...options.accessibility,\n // Highcharts keyboard navigation is disabled by default in favour of the custom Cloudscape navigation.\n keyboardNavigation: options.accessibility?.keyboardNavigation ?? { enabled: !keyboardNavigation },\n point: {\n // Point description formatter is overridden to respect custom axes value formatters.\n descriptionFormatter: (point) => getPointAccessibleDescription(point, labels),\n ...options.accessibility?.point,\n },\n },\n // We use the rtl adjusted axes (instead of the original options.xAxis/yAxis) to ensure the chart renders\n // with the correct axis orientation for RTL layouts, matching what was used for legend positioning above.\n xAxis: castArray(options.xAxis)?.map((xAxisOptions) => ({\n ...Styles.xAxisOptions,\n ...xAxisOptions,\n // Depending on the chart.inverted the x-axis can be rendered as vertical, and needs to respect page direction.\n reversed: !inverted && isRtl ? !xAxisOptions.reversed : xAxisOptions.reversed,\n opposite: inverted && isRtl ? !xAxisOptions.opposite : xAxisOptions.opposite,\n className: xAxisClassName(inverted, xAxisOptions.className),\n title: axisTitle(xAxisOptions.title ?? {}, !inverted || verticalAxisTitlePlacement === \"side\"),\n labels: axisLabels(xAxisOptions.labels ?? {}),\n })),\n yAxis: castArray(options.yAxis)?.map((yAxisOptions) => ({\n ...Styles.yAxisOptions,\n ...yAxisOptions,\n // Depending on the chart.inverted the y-axis can be rendered as vertical, and needs to respect page direction.\n reversed: inverted && isRtl ? !yAxisOptions.reversed : yAxisOptions.reversed,\n opposite: !inverted && isRtl ? !yAxisOptions.opposite : yAxisOptions.opposite,\n className: yAxisClassName(inverted, yAxisOptions.className),\n title: axisTitle(yAxisOptions.title ?? {}, inverted || verticalAxisTitlePlacement === \"side\"),\n labels: axisLabels(yAxisOptions.labels ?? {}),\n plotLines: yAxisPlotLines(yAxisOptions.plotLines, emphasizeBaseline),\n // We use reversed stack by default so that the order of points in the tooltip and series in the legend\n // correspond the order of stacks.\n reversedStacks: yAxisOptions.reversedStacks ?? true,\n })),\n plotOptions: {\n ...options.plotOptions,\n series: {\n // Animations are disabled by default, same as in the options.chart.\n animation: false,\n // Sticky tracking is disabled by default due to sub-optimal UX in dense charts.\n stickyTracking: false,\n borderColor: Styles.seriesBorderColor,\n ...options.plotOptions?.series,\n dataLabels: { style: Styles.seriesDataLabelsCss, ...options.plotOptions?.series?.dataLabels },\n states: {\n ...options.plotOptions?.series?.states,\n inactive: { opacity: Styles.seriesOpacityInactive, ...options.plotOptions?.series?.states?.inactive },\n },\n },\n area: { ...Styles.areaSeries, ...options.plotOptions?.area },\n areaspline: { ...Styles.areaSeries, ...options.plotOptions?.areaspline },\n arearange: { ...Styles.areaSeries, ...options.plotOptions?.arearange },\n areasplinerange: { ...Styles.areaSeries, ...options.plotOptions?.areasplinerange },\n line: { ...Styles.lineSeries, ...options.plotOptions?.line },\n spline: { ...Styles.lineSeries, ...options.plotOptions?.spline },\n column: { ...Styles.columnSeries, ...options.plotOptions?.column },\n errorbar: { ...Styles.errorbarSeries, ...options.plotOptions?.errorbar },\n // Pie chart is shown in legend by default, that is required for standalone pie charts.\n pie: {\n showInLegend: true,\n ...Styles.pieSeries,\n ...options.plotOptions?.pie,\n dataLabels: { ...Styles.pieSeriesDataLabels, ...options.plotOptions?.pie?.dataLabels },\n },\n },\n // We don't use Highcharts tooltip, but certain tooltip options such as tooltip.snap or tooltip.shared\n // affect the hovering behavior of Highcharts. That is only the case when the tooltip is not disabled,\n // so we render it, but hide with styles.\n tooltip: options.tooltip ?? { enabled: true, snap: Styles.tooltipSnap, style: { opacity: 0 } },\n };\n\n const legendProps = getLegendsProps(options, legendOptions);\n\n return (\n <div {...rootProps}>\n <ChartContainer\n {...containerProps}\n chart={(height) => {\n // We declare event handlers here to ensure that no event fires until the chart is initialized.\n const highchartsOptions: Highcharts.Options = {\n ...options,\n chart: {\n ...options.chart,\n // Use height computed from chartHeight, chartMinHeight, and fitHeight settings by default.\n // It is possible to override it by explicitly providing chart.height, but this will not be\n // compatible with any of the above settings.\n height: options.chart?.height ?? height,\n // We override certain chart events to inject additional behaviors, but it is still possible to define\n // custom callbacks. The Cloudscape behaviors can be disabled or altered via components API. For instance,\n // if no-data props are not provided - the related on-render computations will be skipped.\n events: {\n ...options.chart?.events,\n load(event) {\n apiOptions.onChartLoad.call(this, event);\n return options.chart?.events?.load?.call(this, event);\n },\n render(event) {\n apiOptions.onChartRender.call(this, event);\n return options.chart?.events?.render?.call(this, event);\n },\n click(event) {\n apiOptions.onChartClick.call(this, event);\n return options.chart?.events?.click?.call(this, event);\n },\n },\n },\n plotOptions: {\n ...options.plotOptions,\n series: {\n ...options.plotOptions?.series,\n // We override certain point events to inject additional behaviors, but it is still possible to define\n // custom callbacks. The Cloudscape behaviors can be disabled or altered via components API.\n point: {\n ...options.plotOptions?.series?.point,\n events: {\n ...options.plotOptions?.series?.point?.events,\n mouseOver(event) {\n apiOptions.onSeriesPointMouseOver.call(this, event);\n return options.plotOptions?.series?.point?.events?.mouseOver?.call(this, event);\n },\n mouseOut(event) {\n apiOptions.onSeriesPointMouseOut.call(this, event);\n return options.plotOptions?.series?.point?.events?.mouseOut?.call(this, event);\n },\n click(event) {\n apiOptions.onSeriesPointClick.call(this, event);\n return options.plotOptions?.series?.point?.events?.click?.call(this, event);\n },\n },\n },\n },\n },\n };\n return (\n <>\n <ChartApplication api={api} keyboardNavigation={keyboardNavigation} ariaLabel={ariaLabel} />\n <HighchartsReact\n highcharts={highcharts}\n options={highchartsOptions}\n callback={(chart: Highcharts.Chart) =>\n callback?.({ chart, highcharts: highcharts as typeof Highcharts, ...api.publicApi })\n }\n />\n </>\n );\n }}\n navigator={navigator}\n primaryLegend={\n context.legendEnabled && legendProps.primary ? (\n <ChartLegend {...commonLegendProps} {...legendProps.primary} className={testClasses[\"legend-primary\"]} />\n ) : null\n }\n secondaryLegend={\n context.legendEnabled && legendProps.secondary ? (\n <ChartLegend\n {...commonLegendProps}\n {...legendProps.secondary}\n className={testClasses[\"legend-secondary\"]}\n />\n ) : null\n }\n verticalAxisTitle={\n verticalAxisTitlePlacement === \"top\" ? <VerticalAxisTitle api={api} inverted={!!inverted} /> : null\n }\n header={header?.content ? <ChartHeader>{header.content}</ChartHeader> : null}\n footer={footer?.content ? <ChartFooter>{footer.content}</ChartFooter> : null}\n filter={\n filter?.seriesFilter || filter?.additionalFilters ? (\n <ChartFilters\n api={api}\n seriesFilter={filter?.seriesFilter}\n additionalFilters={filter?.additionalFilters}\n i18nStrings={i18nStrings}\n />\n ) : null\n }\n noData={context.noDataEnabled && <ChartNoData {...noDataOptions} i18nStrings={i18nStrings} api={api} />}\n />\n\n {context.tooltipEnabled && (\n <ChartTooltip\n {...tooltipOptions}\n i18nStrings={i18nStrings}\n getTooltipContent={rest.getTooltipContent}\n api={api}\n />\n )}\n </div>\n );\n}\n\nfunction xAxisClassName(inverted: boolean, customClassName?: string) {\n return clsx(\n testClasses[\"axis-x\"],\n inverted ? testClasses[\"axis-vertical\"] : testClasses[\"axis-horizontal\"],\n customClassName,\n );\n}\n\nfunction yAxisClassName(inverted: boolean, customClassName?: string) {\n return clsx(\n testClasses[\"axis-y\"],\n inverted ? testClasses[\"axis-horizontal\"] : testClasses[\"axis-vertical\"],\n customClassName,\n );\n}\n\n// When placing vertical axis title in the chart's top, the actual axis title rendered by Highcharts\n// needs to be visually hidden (it is still accessible by screen-readers). We then set title's\n// opacity to 0, and use reserveSpace=false, so that Highcharts stretches the plot area to all available\n// container width.\nfunction axisTitle<O extends Highcharts.XAxisTitleOptions | Highcharts.YAxisTitleOptions>(\n options: O,\n visible: boolean,\n): O {\n return {\n style: { ...Styles.axisTitleCss, opacity: visible ? undefined : 0 },\n reserveSpace: visible ? undefined : false,\n ...options,\n };\n}\n\n// We use custom formatters instead of Highcharts defaults to ensure consistent formatting\n// between axis ticks and tooltip contents.\nfunction axisLabels<O extends Highcharts.XAxisLabelsOptions | Highcharts.YAxisLabelsOptions>(options: O): O {\n return {\n style: Styles.axisLabelsCss,\n formatter: function () {\n const formattedValue = getFormatter(this.axis)(this.value);\n return formattedValue.replace(/\\n/g, \"<br />\");\n },\n ...options,\n };\n}\n\nfunction yAxisPlotLines(\n plotLineOptions: Highcharts.YAxisPlotLinesOptions[] = [],\n emphasizeBaseline: boolean,\n): Highcharts.YAxisPlotLinesOptions[] {\n return emphasizeBaseline\n ? [{ value: 0, ...Styles.chatPlotBaseline, className: testClasses[\"emphasized-baseline\"] }, ...plotLineOptions]\n : plotLineOptions;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-legend.js","sourceRoot":"","sources":["../../../../src/core/components/core-legend.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,eAAe,EAAE,MAAM,wDAAwD,CAAC;AAEzF,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC7F,OAAO,EAAE,sBAAsB,EAA6B,MAAM,uBAAuB,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAI/D,MAAM,UAAU,WAAW,CAAC,EAC1B,GAAG,EACH,KAAK,EACL,OAAO,EACP,SAAS,EACT,SAAS,EACT,WAAW,EACX,WAAW,EACX,eAAe,EACf,uBAAuB,EACvB,mBAAmB,GAAG,OAAO,GAY9B;IACC,MAAM,IAAI,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC;IACzC,MAAM,eAAe,GAAG,IAAI,CAAC,6BAA6B,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,eAAe,CAAC,CAAC;IAC1F,+DAA+D;IAC/D,0DAA0D;IAC1D,MAAM,wBAAwB,GAAG,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,wBAAwB,CAAC;IACvE,MAAM,SAAS,GAAG,WAAW,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,eAAe,CAAC;IAE3E,MAAM,WAAW,GAAG,WAAW,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACjE,MAAM,eAAe,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,IAAI,EA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,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,mBAAmB,EAAE,GAAG,CAAC,0BAA0B,EACnD,oBAAoB,EAAE,CAAC,IAAI,EAAE,EAAE;YAC7B,GAAG,CAAC,qBAAqB,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;YACrC,sBAAsB,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;QACpD,CAAC,EACD,iBAAiB,EAAE,CAAC,KAAK,EAAE,EAAE;;YAC3B,IAAI,oBAAoB,EAAE,CAAC;gBACzB,OAAO,IAAI,CAAC;YACd,CAAC;YACD,OAAO,MAAA,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAG,KAAK,CAAC,mCAAI,IAAI,CAAC;QAClD,CAAC,GACD,CACH,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useInternalI18n } from \"@cloudscape-design/components/internal/do-not-use/i18n\";\n\nimport { ChartLegend as ChartLegendComponent } from \"../../internal/components/chart-legend\";\nimport { fireNonCancelableEvent, NonCancelableEventHandler } from \"../../internal/events\";\nimport { useSelector } from \"../../internal/utils/async-store\";\nimport { ChartAPI } from \"../chart-api\";\nimport { CoreChartProps, CoreI18nStrings } from \"../interfaces\";\n\nexport function ChartLegend({\n api,\n title,\n actions,\n alignment,\n className,\n isSecondary,\n i18nStrings,\n onItemHighlight,\n getLegendTooltipContent,\n horizontalAlignment = \"start\",\n}: {\n api: ChartAPI;\n title?: string;\n className?: string;\n isSecondary: boolean;\n actions?: React.ReactNode;\n alignment: \"horizontal\" | \"vertical\";\n horizontalAlignment?: \"start\" | \"center\" | \"end\";\n i18nStrings?: CoreI18nStrings;\n onItemHighlight?: NonCancelableEventHandler<CoreChartProps.LegendItemHighlightDetail>;\n getLegendTooltipContent?: CoreChartProps.GetLegendTooltipContent;\n}) {\n const i18n = useInternalI18n(\"[charts]\");\n const legendAriaLabel = i18n(\"i18nStrings.legendAriaLabel\", i18nStrings?.legendAriaLabel);\n // There's currently no builtin property for the secondary ARIA\n // label, it must be explicitly provided by the consumers.\n const secondaryLegendAriaLabel = i18nStrings?.secondaryLegendAriaLabel;\n const ariaLabel = isSecondary ? secondaryLegendAriaLabel : legendAriaLabel;\n\n const legendItems = useSelector(api.legendStore, (s) => s.items);\n const someHighlighted = legendItems.some((item) => item.highlighted);\n const isChartTooltipPinned = useSelector(api.tooltipStore, (s) => s.pinned);\n const filteredItems = isSecondary\n ? legendItems.filter((item) => item.isSecondary)\n : legendItems.filter((item) => !item.isSecondary);\n\n const onToggleItem = (itemId: string) => {\n const visibleItems = legendItems.filter((i) => i.visible).map((i) => i.id);\n if (visibleItems.includes(itemId)) {\n api.onItemVisibilityChange(visibleItems.filter((visibleItemId) => visibleItemId !== itemId));\n } else {\n api.onItemVisibilityChange([...visibleItems, itemId]);\n }\n // Needed for touch devices.\n api.onClearChartItemsHighlight();\n };\n\n const onSelectItem = (itemId: string) => {\n const visibleItems = legendItems.filter((i) => i.visible).map((i) => i.id);\n if (visibleItems.length === 1 && visibleItems[0] === itemId) {\n api.onItemVisibilityChange(legendItems.map((i) => i.id));\n } else {\n api.onItemVisibilityChange([itemId]);\n }\n // Needed for touch devices.\n api.onClearChartItemsHighlight();\n };\n\n if (filteredItems.length === 0) {\n return null;\n }\n return (\n <ChartLegendComponent\n ariaLabel={ariaLabel}\n className={className}\n legendTitle={title}\n items={filteredItems}\n someHighlighted={someHighlighted}\n horizontalAlignment={horizontalAlignment}\n actions={actions}\n alignment={alignment}\n onToggleItem={onToggleItem}\n onSelectItem={onSelectItem}\n onItemHighlightExit={api.onClearChartItemsHighlight}\n onItemHighlightEnter={(item) => {\n api.onHighlightChartItems([item.id]);\n fireNonCancelableEvent(onItemHighlight, { item });\n }}\n getTooltipContent={(props) => {\n if (isChartTooltipPinned) {\n return null;\n }\n return getLegendTooltipContent?.(props) ?? null;\n }}\n />\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-no-data.js","sourceRoot":"","sources":["../../../../src/core/components/core-no-data.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,MAAM,MAAM,sCAAsC,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,wDAAwD,CAAC;AACzF,OAAO,UAAU,MAAM,2CAA2C,CAAC;AACnE,OAAO,YAAY,MAAM,6CAA6C,CAAC;AACvE,OAAO,eAAe,MAAM,gDAAgD,CAAC;AAE7E,OAAO,EAAE,sBAAsB,EAA6B,MAAM,uBAAuB,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAI/D,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,WAAW,MAAM,+BAA+B,CAAC;AAExD,MAAM,UAAU,WAAW,CAAC,EAC1B,UAAU,GAAG,UAAU,EACvB,OAAO,EACP,KAAK,EACL,KAAK,EACL,OAAO,EACP,eAAe,EACf,GAAG,EACH,WAAW,GAIZ;IACC,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IACrD,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE;
|
|
1
|
+
{"version":3,"file":"core-no-data.js","sourceRoot":"","sources":["../../../../src/core/components/core-no-data.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,MAAM,MAAM,sCAAsC,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,wDAAwD,CAAC;AACzF,OAAO,UAAU,MAAM,2CAA2C,CAAC;AACnE,OAAO,YAAY,MAAM,6CAA6C,CAAC;AACvE,OAAO,eAAe,MAAM,gDAAgD,CAAC;A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WAAW,uBAAX,WAAW,CAAE,YAAY,CAAC,CAAC;IACrE,OAAO,CACL,MAAC,YAAY,IAAC,SAAS,EAAC,YAAY,EAAC,IAAI,EAAC,KAAK,EAAC,SAAS,EAAE,WAAW,CAAC,eAAe,CAAC,aACrF,KAAC,eAAe,IAAC,IAAI,EAAC,OAAO,EAAC,QAAQ,EAAE,IAAI,YACzC,SAAS,GACM,EACjB,YAAY,IAAI,eAAe,CAAC,CAAC,CAAC,CACjC,KAAC,MAAM,IACL,OAAO,EAAE,CAAC,KAAkB,EAAE,EAAE;oBAC9B,KAAK,CAAC,cAAc,EAAE,CAAC;oBACvB,sBAAsB,CAAC,eAAe,CAAC,CAAC;gBAC1C,CAAC,EACD,OAAO,EAAC,aAAa,EACrB,SAAS,EAAE,WAAW,CAAC,eAAe,CAAC,YAEtC,YAAY,GACN,CACV,CAAC,CAAC,CAAC,IAAI,IACK,CAChB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport clsx from \"clsx\";\n\nimport Button from \"@cloudscape-design/components/button\";\nimport { useInternalI18n } from \"@cloudscape-design/components/internal/do-not-use/i18n\";\nimport LiveRegion from \"@cloudscape-design/components/live-region\";\nimport SpaceBetween from \"@cloudscape-design/components/space-between\";\nimport StatusIndicator from \"@cloudscape-design/components/status-indicator\";\n\nimport { fireNonCancelableEvent, NonCancelableEventHandler } from \"../../internal/events\";\nimport { useSelector } from \"../../internal/utils/async-store\";\nimport { ChartAPI } from \"../chart-api\";\nimport { BaseI18nStrings, BaseNoDataOptions } from \"../interfaces\";\n\nimport styles from \"../styles.css.js\";\nimport testClasses from \"../test-classes/styles.css.js\";\n\nexport function ChartNoData({\n statusType = \"finished\",\n loading,\n empty,\n error,\n noMatch,\n onRecoveryClick,\n api,\n i18nStrings,\n}: BaseNoDataOptions & {\n api: ChartAPI;\n i18nStrings?: BaseI18nStrings;\n}) {\n const state = useSelector(api.nodataStore, (s) => s);\n if (!state.visible) {\n return null;\n }\n let content = null;\n if (statusType === \"loading\") {\n content = loading ? (\n <div className={testClasses[\"no-data-loading\"]}>{loading}</div>\n ) : (\n <DefaultLoadingMessage i18nStrings={i18nStrings} />\n );\n } else if (statusType === \"error\") {\n content = error ? (\n <div className={testClasses[\"no-data-error\"]}>{error}</div>\n ) : (\n <DefaultErrorMessage onRecoveryClick={onRecoveryClick} i18nStrings={i18nStrings} />\n );\n } else if (state.noMatch && noMatch) {\n content = <div className={clsx(testClasses[\"no-data-no-match\"], styles[\"no-data-empty\"])}>{noMatch}</div>;\n } else if (!state.noMatch && empty) {\n content = <div className={clsx(testClasses[\"no-data-empty\"], styles[\"no-data-empty\"])}>{empty}</div>;\n }\n return (\n content && (\n <div className={styles[\"no-data-container\"]} style={state.style}>\n <div className={styles[\"no-data-wrapper\"]}>\n <div className={clsx(testClasses[\"no-data\"], styles[\"no-data\"])}>\n <LiveRegion>{content}</LiveRegion>\n </div>\n </div>\n </div>\n )\n );\n}\n\nfunction DefaultLoadingMessage({ i18nStrings }: { i18nStrings?: BaseI18nStrings }) {\n const i18n = useInternalI18n(\"[charts]\");\n const loadingText = i18n(\"loadingText\", i18nStrings?.loadingText);\n return (\n <StatusIndicator type=\"loading\" className={testClasses[\"no-data-loading\"]} wrapText={true}>\n {loadingText}\n </StatusIndicator>\n );\n}\n\nfunction DefaultErrorMessage({\n onRecoveryClick,\n i18nStrings,\n}: {\n onRecoveryClick?: NonCancelableEventHandler;\n i18nStrings?: BaseI18nStrings;\n}) {\n const i18n = useInternalI18n(\"[charts]\");\n const errorText = i18n(\"errorText\", i18nStrings?.errorText);\n const recoveryText = i18n(\"recoveryText\", i18nStrings?.recoveryText);\n return (\n <SpaceBetween direction=\"horizontal\" size=\"xxs\" className={testClasses[\"no-data-error\"]}>\n <StatusIndicator type=\"error\" wrapText={true}>\n {errorText}\n </StatusIndicator>\n {recoveryText && onRecoveryClick ? (\n <Button\n onClick={(event: CustomEvent) => {\n event.preventDefault();\n fireNonCancelableEvent(onRecoveryClick);\n }}\n variant=\"inline-link\"\n className={testClasses[\"no-data-retry\"]}\n >\n {recoveryText}\n </Button>\n ) : null}\n </SpaceBetween>\n );\n}\n"]}
|
|
@@ -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,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAE7E,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAErH,OAAO,MAAM,MAAM,kBAAkB,CAAC;AAEtC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AACnC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAoB7B,MAAM,UAAU,YAAY,CAAC,EAC3B,SAAS,GAAG,QAAQ,EACpB,IAAI,EACJ,iBAAiB,EAAE,0BAA0B,EAC7C,GAAG,EACH,WAAW,EACX,QAAQ,GAAG,KAAK,EAChB,aAAa,GAAG,UAAU,GAK3B;;IACC,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ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,CAAC,CAAC,GAAG,CAAC,MAAA,EAAE,CAAC,KAAK,CAAC,CAAC,mCAAI,CAAC,CAAC,CAAC;SAC9C;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 { useDebouncedValue } from \"../../internal/utils/use-debounced-value\";\nimport { ChartAPI } from \"../chart-api\";\nimport { getFormatter } from \"../formatters\";\nimport { BaseI18nStrings, CoreChartProps } from \"../interfaces\";\nimport { getPointColor, getPointId, getSeriesColor, getSeriesId, getSeriesMarkerType, isXThreshold } 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}: CoreChartProps.TooltipOptions & {\n i18nStrings?: BaseI18nStrings;\n getTooltipContent?: CoreChartProps.GetTooltipContent;\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 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 } & 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 }: CoreChartProps.GetTooltipContentProps & {\n renderers?: CoreChartProps.TooltipContentRenderer;\n hideTooltip: () => void;\n seriesSorting: NonNullable<CoreChartProps.TooltipOptions[\"seriesSorting\"]>;\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 customContent = renderers.point\n ? renderers.point({\n item,\n hideTooltip,\n })\n : undefined;\n return {\n key: customContent?.key ?? item.point.series.name,\n value: customContent?.value ?? valueFormatter(itemY),\n marker: getSeriesMarker(item.point.series),\n subItems: customContent?.subItems,\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 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 // 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-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,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAE7E,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAErH,OAAO,MAAM,MAAM,kBAAkB,CAAC;AAEtC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AACnC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAoB7B,MAAM,UAAU,YAAY,CAAC,EAC3B,SAAS,GAAG,QAAQ,EACpB,IAAI,EACJ,iBAAiB,EAAE,0BAA0B,EAC7C,GAAG,EACH,WAAW,EACX,QAAQ,GAAG,KAAK,EAChB,aAAa,GAAG,UAAU,GAK3B;;IACC,MAAM,CAAC,cA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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 { useDebouncedValue } from \"../../internal/utils/use-debounced-value\";\nimport { ChartAPI } from \"../chart-api\";\nimport { getFormatter } from \"../formatters\";\nimport { BaseI18nStrings, CoreChartProps } from \"../interfaces\";\nimport { getPointColor, getPointId, getSeriesColor, getSeriesId, getSeriesMarkerType, isXThreshold } 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}: CoreChartProps.TooltipOptions & {\n i18nStrings?: BaseI18nStrings;\n getTooltipContent?: CoreChartProps.GetTooltipContent;\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 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 } & 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 }: CoreChartProps.GetTooltipContentProps & {\n renderers?: CoreChartProps.TooltipContentRenderer;\n hideTooltip: () => void;\n seriesSorting: NonNullable<CoreChartProps.TooltipOptions[\"seriesSorting\"]>;\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 customContent = renderers.point\n ? renderers.point({\n item,\n hideTooltip,\n })\n : undefined;\n return {\n key: customContent?.key ?? item.point.series.name,\n value: customContent?.value ?? valueFormatter(itemY),\n marker: getSeriesMarker(item.point.series),\n subItems: customContent?.subItems,\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 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 // 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-vertical-axis-title.js","sourceRoot":"","sources":["../../../../src/core/components/core-vertical-axis-title.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAG/D,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,WAAW,MAAM,+BAA+B,CAAC;AAExD,MAAM,UAAU,iBAAiB,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAwC;IACvF,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,eAAe,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC7F,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"core-vertical-axis-title.js","sourceRoot":"","sources":["../../../../src/core/components/core-vertical-axis-title.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAG/D,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,WAAW,MAAM,+BAA+B,CAAC;AAExD,MAAM,UAAU,iBAAiB,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAwC;IACvF,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,eAAe,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC7F,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CACL,cACE,SAAS,EAAE,IAAI,CACb,WAAW,CAAC,qBAAqB,CAAC,EAClC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,cAAc,CAAC,EACpE,MAAM,CAAC,qBAAqB,CAAC,CAC9B,iBAGY,IAAI,YAEhB,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAC3B,eAAkB,SAAS,EAAE,MAAM,CAAC,0BAA0B,CAAC,YAC5D,IAAI,IADI,KAAK,CAET,CACR,CAAC,GACE,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport clsx from \"clsx\";\n\nimport { useSelector } from \"../../internal/utils/async-store\";\nimport { ChartAPI } from \"../chart-api\";\n\nimport styles from \"../styles.css.js\";\nimport testClasses from \"../test-classes/styles.css.js\";\n\nexport function VerticalAxisTitle({ api, inverted }: { api: ChartAPI; inverted: boolean }) {\n const titles = useSelector(api.axisTitlesStore, (s) => s.verticalAxesTitles).filter(Boolean);\n if (titles.length === 0) {\n return null;\n }\n return (\n <div\n className={clsx(\n testClasses[\"axis-vertical-title\"],\n inverted ? testClasses[\"axis-x-title\"] : testClasses[\"axis-y-title\"],\n styles[\"axis-vertical-title\"],\n )}\n // The vertical axis label is still rendered by Highcharts and accessible by screen-readers, yet\n // not visible on the screen. We make this one ARIA-hidden to avoid duplication.\n aria-hidden={true}\n >\n {titles.map((text, index) => (\n <span key={index} className={styles[\"axis-vertical-title-item\"]}>\n {text}\n </span>\n ))}\n </div>\n );\n}\n"]}
|