@cloudscape-design/chart-components 1.0.70 → 1.0.72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"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;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,O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AC,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 // This listener handles Escape when using mouse hover. When keyboard navigation is active (application\n // element is focused), the navigation handler deals with Escape, so we skip to avoid conflicts.\n useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n // Skip if keyboard navigation is handling this (event originated from application element)\n const target = event.target as Element;\n if (context.keyboardNavigationEnabled && target?.closest('[role=\"application\"]')) {\n return;\n }\n\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 }, [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,sCAA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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 // This listener handles Escape when using mouse hover. When keyboard navigation is active (application\n // element is focused), the navigation handler deals with Escape, so we skip to avoid conflicts.\n useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n // Skip if keyboard navigation is handling this (event originated from application element)\n const target = event.target as Element;\n if (context.keyboardNavigationEnabled && target?.closest('[role=\"application\"]')) {\n return;\n }\n\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 }, [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 sizeAxis={castArray(rest.sizeAxis as CoreChartProps.SizeAxisOptions[])}\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,7 +1,8 @@
1
1
  import { ChartAPI } from "../chart-api";
2
2
  import { BaseI18nStrings, CoreChartProps } from "../interfaces";
3
- export declare function ChartTooltip({ placement, size, getTooltipContent: getTooltipContentOverrides, api, i18nStrings, debounce, seriesSorting, }: CoreChartProps.TooltipOptions & {
3
+ export declare function ChartTooltip({ placement, size, getTooltipContent: getTooltipContentOverrides, api, i18nStrings, debounce, seriesSorting, sizeAxis, }: CoreChartProps.TooltipOptions & {
4
4
  i18nStrings?: BaseI18nStrings;
5
5
  getTooltipContent?: CoreChartProps.GetTooltipContent;
6
+ sizeAxis?: readonly CoreChartProps.SizeAxisOptions[];
6
7
  api: ChartAPI;
7
8
  }): import("react/jsx-runtime").JSX.Element | null;
@@ -11,11 +11,11 @@ import { useSelector } from "../../internal/utils/async-store";
11
11
  import { getChartSeries } from "../../internal/utils/chart-series";
12
12
  import { useDebouncedValue } from "../../internal/utils/use-debounced-value";
13
13
  import { getFormatter } from "../formatters";
14
- import { getPointColor, getPointId, getSeriesColor, getSeriesId, getSeriesMarkerType, isPointVisible, isXThreshold, } from "../utils";
14
+ import { getBubbleSeriesSizeAxis, getPointColor, getPointId, getSeriesColor, getSeriesId, getSeriesMarkerType, isPointVisible, isXThreshold, } from "../utils";
15
15
  import styles from "../styles.css.js";
16
16
  const MIN_VISIBLE_BLOCK_SIZE = 200;
17
17
  const DEFAULT_DEBOUNCE = 200;
18
- export function ChartTooltip({ placement = "target", size, getTooltipContent: getTooltipContentOverrides, api, i18nStrings, debounce = false, seriesSorting = "as-added", }) {
18
+ export function ChartTooltip({ placement = "target", size, getTooltipContent: getTooltipContentOverrides, api, i18nStrings, debounce = false, seriesSorting = "as-added", sizeAxis, }) {
19
19
  var _a;
20
20
  const [expandedSeries, setExpandedSeries] = useState({});
21
21
  const tooltip = useSelector(api.tooltipStore, (s) => s);
@@ -44,6 +44,7 @@ export function ChartTooltip({ placement = "target", size, getTooltipContent: ge
44
44
  expandedSeries,
45
45
  setExpandedSeries,
46
46
  seriesSorting,
47
+ sizeAxis,
47
48
  hideTooltip: () => {
48
49
  api.hideTooltip();
49
50
  },
@@ -74,7 +75,7 @@ function getTooltipContent(api, props) {
74
75
  return null;
75
76
  }
76
77
  }
77
- function getTooltipContentCartesian(api, { point, group, expandedSeries, renderers = {}, setExpandedSeries, hideTooltip, seriesSorting, }) {
78
+ function getTooltipContentCartesian(api, { point, group, expandedSeries, renderers = {}, setExpandedSeries, hideTooltip, seriesSorting, sizeAxis, }) {
78
79
  var _a, _b, _c, _d, _e;
79
80
  // The cartesian tooltip might or might not have a selected point, but it always has a non-empty group.
80
81
  // By design, every point of the group has the same x value.
@@ -93,20 +94,22 @@ function getTooltipContentCartesian(api, { point, group, expandedSeries, rendere
93
94
  };
94
95
  const matchedItems = findTooltipSeriesItems(getChartSeries(chart.series), group, seriesSorting);
95
96
  const detailItems = matchedItems.map((item) => {
96
- var _a, _b, _c;
97
+ var _a, _b, _c, _d;
97
98
  const valueFormatter = getFormatter(item.point.series.yAxis);
98
99
  const itemY = isXThreshold(item.point.series) ? null : ((_a = item.point.y) !== null && _a !== void 0 ? _a : null);
100
+ const bubbleSubItems = item.point.series.type === "bubble" ? getBubblePointDetails(item, sizeAxis) : undefined;
99
101
  const customContent = renderers.point
100
102
  ? renderers.point({
101
103
  item,
102
104
  hideTooltip,
103
105
  })
104
106
  : undefined;
107
+ const defaultValue = bubbleSubItems ? null : valueFormatter(itemY);
105
108
  return {
106
109
  key: (_b = customContent === null || customContent === void 0 ? void 0 : customContent.key) !== null && _b !== void 0 ? _b : item.point.series.name,
107
- value: (_c = customContent === null || customContent === void 0 ? void 0 : customContent.value) !== null && _c !== void 0 ? _c : valueFormatter(itemY),
110
+ value: (_c = customContent === null || customContent === void 0 ? void 0 : customContent.value) !== null && _c !== void 0 ? _c : defaultValue,
108
111
  marker: getSeriesMarker(item.point.series),
109
- subItems: customContent === null || customContent === void 0 ? void 0 : customContent.subItems,
112
+ subItems: (_d = customContent === null || customContent === void 0 ? void 0 : customContent.subItems) !== null && _d !== void 0 ? _d : bubbleSubItems,
110
113
  expandableId: (customContent === null || customContent === void 0 ? void 0 : customContent.expandable) ? item.point.series.name : undefined,
111
114
  highlighted: item.point.x === (point === null || point === void 0 ? void 0 : point.x) && item.point.y === (point === null || point === void 0 ? void 0 : point.y),
112
115
  description: (customContent === null || customContent === void 0 ? void 0 : customContent.description) === undefined && item.errorRanges.length ? (_jsx(_Fragment, { children: item.errorRanges.map((errorBarPoint, index) => {
@@ -166,6 +169,26 @@ function getTooltipContentPie(api, { point, renderers = {}, hideTooltip, }) {
166
169
  footer: (_k = renderers.footer) === null || _k === void 0 ? void 0 : _k.call(renderers, tooltipDetails),
167
170
  };
168
171
  }
172
+ function getBubblePointDetails(item, sizeAxis = []) {
173
+ var _a, _b, _c, _d, _e;
174
+ const subItems = [];
175
+ const y = item.point.y;
176
+ const yAxisTitle = (_c = (_b = (_a = item.point.series.yAxis) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.title) === null || _c === void 0 ? void 0 : _c.text;
177
+ const yFormatter = item.point.series.yAxis ? getFormatter(item.point.series.yAxis) : (v) => String(v);
178
+ subItems.push({ key: yAxisTitle, value: yFormatter(y) });
179
+ // Size axis is a custom abstraction built to support bubble series title and formatter for z (size) values.
180
+ // We match size axes by ID if provided, or take the first defined axis instead.
181
+ const matchedSizeAxis = (_d = sizeAxis.find((a) => a.id === getBubbleSeriesSizeAxis(item.point.series))) !== null && _d !== void 0 ? _d : sizeAxis[0];
182
+ if (matchedSizeAxis) {
183
+ // Highcharts bubble size is represented by point.z value, which is however not present in the internal point type -
184
+ // so we take it from point's options instead.
185
+ const size = (_e = item.point.options.z) !== null && _e !== void 0 ? _e : null;
186
+ const sizeAxisTitle = matchedSizeAxis.title;
187
+ const sizeFormatter = getFormatter(matchedSizeAxis);
188
+ subItems.push({ key: sizeAxisTitle, value: sizeFormatter(size) });
189
+ }
190
+ return subItems;
191
+ }
169
192
  function findTooltipSeriesItems(series, group, seriesSorting) {
170
193
  const seriesOrder = series.reduce((d, s, i) => d.set(s, i), new Map());
171
194
  const getSeriesIndex = (s) => { var _a; return (_a = seriesOrder.get(s)) !== null && _a !== void 0 ? _a : -1; };
@@ -1 +1 @@
1
- {"version":3,"file":"core-tooltip.js","sourceRoot":"","sources":["../../../../src/core/components/core-tooltip.tsx"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,KAAK,eAAe,EAAE,CAAC;YACtC,OAAO,CAAC,MAAA,EAAE,CAAC,KAAK,CAAC,CAAC,mCAAI,CAAC,CAAC,GAAG,CAAC,MAAA,EAAE,CAAC,KAAK,CAAC,CAAC,mCAAI,CAAC,CAAC,CAAC;QAC/C,CAAC;QACD,4HAA4H;QAC5H,MAAM,EAAE,GAAG,cAAc,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,cAAc,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC7E,OAAO,EAAE,IAAI,CAAC,MAAA,EAAE,CAAC,KAAK,CAAC,CAAC,mCAAI,CAAC,CAAC,GAAG,CAAC,MAAA,EAAE,CAAC,KAAK,CAAC,CAAC,mCAAI,CAAC,CAAC,CAAC;IACrD,CAAC,CAAC;QACF,8FAA8F;SAC7F,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;;QACZ,MAAM,WAAW,GAAG,MAAA,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,mCAAI,EAAE,CAAC;QAC3E,MAAM,iBAAiB,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,cAAc,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;QAC9G,OAAO,EAAE,GAAG,IAAI,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACrD,CAAC,CAAC,CACL,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useState } from \"react\";\n\nimport { warnOnce } from \"@cloudscape-design/component-toolkit/internal\";\nimport Box from \"@cloudscape-design/components/box\";\nimport { InternalChartTooltip } from \"@cloudscape-design/components/internal/do-not-use/chart-tooltip\";\nimport LiveRegion from \"@cloudscape-design/components/live-region\";\n\nimport ChartSeriesDetails, { ChartSeriesDetailItem } from \"../../internal/components/series-details\";\nimport { useSelector } from \"../../internal/utils/async-store\";\nimport { getChartSeries } from \"../../internal/utils/chart-series\";\nimport { useDebouncedValue } from \"../../internal/utils/use-debounced-value\";\nimport { ChartAPI } from \"../chart-api\";\nimport { getFormatter } from \"../formatters\";\nimport { BaseI18nStrings, CoreChartProps } from \"../interfaces\";\nimport {\n getPointColor,\n getPointId,\n getSeriesColor,\n getSeriesId,\n getSeriesMarkerType,\n isPointVisible,\n isXThreshold,\n} from \"../utils\";\n\nimport styles from \"../styles.css.js\";\n\nconst MIN_VISIBLE_BLOCK_SIZE = 200;\nconst DEFAULT_DEBOUNCE = 200;\n\ntype ExpandedSeriesState = Record<string, Set<string>>;\n\ninterface ExpandedSeriesStateProps {\n expandedSeries: ExpandedSeriesState;\n setExpandedSeries: (cb: (state: ExpandedSeriesState) => ExpandedSeriesState) => void;\n}\n\ninterface RenderedTooltipContent {\n header: React.ReactNode;\n body: React.ReactNode;\n footer: React.ReactNode;\n}\n\ninterface MatchedItem {\n point: Highcharts.Point;\n errorRanges: Highcharts.Point[];\n}\n\nexport function ChartTooltip({\n placement = \"target\",\n size,\n getTooltipContent: getTooltipContentOverrides,\n api,\n i18nStrings,\n debounce = false,\n seriesSorting = \"as-added\",\n}: 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 if (!isPointVisible(point)) {\n continue;\n }\n // We only support errorbar series that are linked to other series. In tooltip content we add\n // linked error bars to series detail slot.\n if (point.series.type === \"errorbar\") {\n if (point.series.linkedParent) {\n addError(getSeriesId(point.series.linkedParent), point);\n } else {\n warnOnce(\n \"chart-components\",\n 'The `linkedTo` property of \"errorbar\" series is missing, or points to a series that does not exist.',\n );\n }\n } else {\n addMatchedPoints(point);\n }\n }\n function addError(seriesId: string, errorPoint: Highcharts.Point) {\n if (errorPoint.options.low !== undefined && errorPoint.options.high !== undefined) {\n const errorRanges = seriesErrors.get(seriesId) ?? [];\n errorRanges.push(errorPoint);\n seriesErrors.set(seriesId, errorRanges);\n }\n }\n function addMatchedPoints(point: Highcharts.Point) {\n if (!matchedSeries.has(point.series)) {\n matchedSeries.add(point.series);\n if (isXThreshold(point.series)) {\n matchedItems.push({ point, errorRanges: [] });\n } else {\n point.series.data\n .filter((d) => d.x === point.x)\n .sort((a, b) => (a.y ?? 0) - (b.y ?? 0))\n .forEach((point) => matchedItems.push({ point, errorRanges: [] }));\n }\n }\n }\n return (\n matchedItems\n .sort((i1, i2) => {\n if (seriesSorting === \"by-value-desc\") {\n return (i2.point.y ?? 0) - (i1.point.y ?? 0);\n }\n // We sort matched items by series order. If there are multiple items that belong to the same series, we sort them by value.\n const s1 = getSeriesIndex(i1.point.series) - getSeriesIndex(i2.point.series);\n return s1 || (i1.point.y ?? 0) - (i2.point.y ?? 0);\n })\n // For each series item we add linked error ranges, sorted by their respective series indices.\n .map((item) => {\n const errorRanges = seriesErrors.get(getSeriesId(item.point.series)) ?? [];\n const sortedErrorRanges = errorRanges.sort((i1, i2) => getSeriesIndex(i1.series) - getSeriesIndex(i2.series));\n return { ...item, errorRanges: sortedErrorRanges };\n })\n );\n}\n"]}
1
+ {"version":3,"file":"core-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,EACL,uBAAuB,EACvB,aAAa,EACb,UAAU,EACV,cAAc,EACd,WAAW,EACX,mBAAmB,EACnB,cAAc,EACd,YAAY,GACb,MAAM,UAAU,CAAC;AAElB,OAAO,MAAM,MAAM,kBAAkB,CAAC;AAEtC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AACnC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAoB7B,MAAM,UAAU,YAAY,CAAC,EAC3B,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AE,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 {\n getBubbleSeriesSizeAxis,\n getPointColor,\n getPointId,\n getSeriesColor,\n getSeriesId,\n getSeriesMarkerType,\n isPointVisible,\n isXThreshold,\n} from \"../utils\";\n\nimport styles from \"../styles.css.js\";\n\nconst MIN_VISIBLE_BLOCK_SIZE = 200;\nconst DEFAULT_DEBOUNCE = 200;\n\ntype ExpandedSeriesState = Record<string, Set<string>>;\n\ninterface ExpandedSeriesStateProps {\n expandedSeries: ExpandedSeriesState;\n setExpandedSeries: (cb: (state: ExpandedSeriesState) => ExpandedSeriesState) => void;\n}\n\ninterface RenderedTooltipContent {\n header: React.ReactNode;\n body: React.ReactNode;\n footer: React.ReactNode;\n}\n\ninterface MatchedItem {\n point: Highcharts.Point;\n errorRanges: Highcharts.Point[];\n}\n\nexport function ChartTooltip({\n placement = \"target\",\n size,\n getTooltipContent: getTooltipContentOverrides,\n api,\n i18nStrings,\n debounce = false,\n seriesSorting = \"as-added\",\n sizeAxis,\n}: CoreChartProps.TooltipOptions & {\n i18nStrings?: BaseI18nStrings;\n getTooltipContent?: CoreChartProps.GetTooltipContent;\n sizeAxis?: readonly CoreChartProps.SizeAxisOptions[];\n api: ChartAPI;\n}) {\n const [expandedSeries, setExpandedSeries] = useState<ExpandedSeriesState>({});\n const tooltip = useSelector(api.tooltipStore, (s) => s);\n const debouncedTooltip = useDebouncedValue(tooltip, debounce === true ? DEFAULT_DEBOUNCE : debounce || 0);\n\n if (\n !debouncedTooltip ||\n !debouncedTooltip.visible ||\n debouncedTooltip.group.length === 0 ||\n debouncedTooltip.group[0].series === undefined\n ) {\n return null;\n }\n\n const chart = debouncedTooltip.group[0]?.series.chart;\n const renderers = getTooltipContentOverrides?.({ point: debouncedTooltip.point, group: debouncedTooltip.group });\n const getTrack = placement === \"target\" ? api.getTargetTrack : api.getGroupTrack;\n const position = (() => {\n if (placement === \"target\" || placement === \"middle\") {\n return !chart.inverted ? \"right\" : \"bottom\";\n } else {\n return !chart.inverted ? \"bottom\" : \"right\";\n }\n })();\n const content = getTooltipContent(api, {\n renderers,\n point: debouncedTooltip.point,\n group: debouncedTooltip.group,\n expandedSeries,\n setExpandedSeries,\n seriesSorting,\n sizeAxis,\n hideTooltip: () => {\n api.hideTooltip();\n },\n });\n if (!content) {\n return null;\n }\n return (\n <InternalChartTooltip\n getTrack={getTrack}\n trackKey={getTrackKey(debouncedTooltip.point, debouncedTooltip.group)}\n container={null}\n dismissButton={debouncedTooltip.pinned}\n dismissAriaLabel={i18nStrings?.detailPopoverDismissAriaLabel}\n onDismiss={api.onDismissTooltip}\n onMouseEnter={api.onMouseEnterTooltip}\n onMouseLeave={api.onMouseLeaveTooltip}\n title={content.header}\n footer={\n content.footer ? (\n <>\n <hr aria-hidden={true} />\n {content.footer}\n </>\n ) : null\n }\n size={size}\n position={position}\n minVisibleBlockSize={MIN_VISIBLE_BLOCK_SIZE}\n >\n <LiveRegion>{content.body}</LiveRegion>\n </InternalChartTooltip>\n );\n}\n\nfunction getTrackKey(point: null | Highcharts.Point, group: readonly Highcharts.Point[]) {\n const pointId = point && (point.options.id || point.options.name);\n if (point && pointId) {\n return `p-${pointId}-${point.x}-${point.y}`;\n }\n if (point) {\n return `p-${point.x}-${point.y}`;\n }\n return `g_${group.length}_${group[0].x}`;\n}\n\nfunction getTooltipContent(\n api: ChartAPI,\n props: CoreChartProps.GetTooltipContentProps & {\n renderers?: CoreChartProps.TooltipContentRenderer;\n hideTooltip: () => void;\n seriesSorting: NonNullable<CoreChartProps.TooltipOptions[\"seriesSorting\"]>;\n sizeAxis?: readonly CoreChartProps.SizeAxisOptions[];\n } & ExpandedSeriesStateProps,\n): null | RenderedTooltipContent {\n if (props.point && props.point.series.type === \"pie\") {\n return getTooltipContentPie(api, { ...props, point: props.point });\n } else if (props.group.length > 0 && props.group[0].series.type !== \"pie\") {\n return getTooltipContentCartesian(api, props);\n } else {\n return null;\n }\n}\n\nfunction getTooltipContentCartesian(\n api: ChartAPI,\n {\n point,\n group,\n expandedSeries,\n renderers = {},\n setExpandedSeries,\n hideTooltip,\n seriesSorting,\n sizeAxis,\n }: CoreChartProps.GetTooltipContentProps & {\n renderers?: CoreChartProps.TooltipContentRenderer;\n hideTooltip: () => void;\n seriesSorting: NonNullable<CoreChartProps.TooltipOptions[\"seriesSorting\"]>;\n sizeAxis?: readonly CoreChartProps.SizeAxisOptions[];\n } & ExpandedSeriesStateProps,\n): RenderedTooltipContent {\n // The cartesian tooltip might or might not have a selected point, but it always has a non-empty group.\n // By design, every point of the group has the same x value.\n const x = group[0].x;\n const chart = group[0].series.chart;\n const getSeriesMarker = (series: Highcharts.Series) => {\n const itemOptions = api.context.settings.getItemOptions?.(getSeriesId(series));\n return api.renderMarker({\n type: getSeriesMarkerType(series),\n color: getSeriesColor(series),\n visible: true,\n status: itemOptions?.status,\n ariaLabel: api.context.settings.labels.itemMarkerLabel?.(itemOptions?.status),\n });\n };\n const matchedItems = findTooltipSeriesItems(getChartSeries(chart.series), group, seriesSorting);\n const detailItems: ChartSeriesDetailItem[] = matchedItems.map((item) => {\n const valueFormatter = getFormatter(item.point.series.yAxis);\n const itemY = isXThreshold(item.point.series) ? null : (item.point.y ?? null);\n const bubbleSubItems = item.point.series.type === \"bubble\" ? getBubblePointDetails(item, sizeAxis) : undefined;\n const customContent = renderers.point\n ? renderers.point({\n item,\n hideTooltip,\n })\n : undefined;\n const defaultValue = bubbleSubItems ? null : valueFormatter(itemY);\n return {\n key: customContent?.key ?? item.point.series.name,\n value: customContent?.value ?? defaultValue,\n marker: getSeriesMarker(item.point.series),\n subItems: customContent?.subItems ?? bubbleSubItems,\n expandableId: customContent?.expandable ? item.point.series.name : undefined,\n highlighted: item.point.x === point?.x && item.point.y === point?.y,\n description:\n customContent?.description === undefined && item.errorRanges.length ? (\n <>\n {item.errorRanges.map((errorBarPoint, index) => (\n <div key={index} className={styles[\"error-range\"]}>\n <span>{errorBarPoint.series.userOptions.name ? errorBarPoint.series.userOptions.name : \"\"}</span>\n <span>\n {valueFormatter(errorBarPoint.options.low ?? 0)} - {valueFormatter(errorBarPoint.options.high ?? 0)}\n </span>\n </div>\n ))}\n </>\n ) : (\n customContent?.description\n ),\n };\n });\n // We only support cartesian charts with a single x axis.\n const titleFormatter = getFormatter(chart.xAxis[0]);\n const slotRenderProps: CoreChartProps.TooltipSlotProps = {\n x,\n items: matchedItems,\n hideTooltip: hideTooltip,\n };\n return {\n header: renderers.header?.(slotRenderProps) ?? titleFormatter(x),\n body: renderers.body?.(slotRenderProps) ?? (\n <ChartSeriesDetails\n details={detailItems}\n expandedSeries={expandedSeries[x]}\n setExpandedState={(id, isExpanded) => {\n setExpandedSeries((oldState) => {\n const expandedSeriesInCurrentCoordinate = new Set(oldState[x]);\n if (isExpanded) {\n expandedSeriesInCurrentCoordinate.add(id);\n } else {\n expandedSeriesInCurrentCoordinate.delete(id);\n }\n return { ...oldState, [x]: expandedSeriesInCurrentCoordinate };\n });\n }}\n />\n ),\n footer: renderers.footer?.(slotRenderProps),\n };\n}\n\nfunction getTooltipContentPie(\n api: ChartAPI,\n {\n point,\n renderers = {},\n hideTooltip,\n }: { point: Highcharts.Point } & { renderers?: CoreChartProps.TooltipContentRenderer; hideTooltip: () => void },\n): RenderedTooltipContent {\n const tooltipDetails: CoreChartProps.TooltipSlotProps = {\n x: point.x,\n items: [{ point, errorRanges: [] }],\n hideTooltip,\n };\n\n const itemOptions = api.context.settings.getItemOptions?.(getPointId(point));\n const markerAriaLabel = api.context.settings.labels.itemMarkerLabel?.(itemOptions?.status);\n\n return {\n header: renderers.header?.(tooltipDetails) ?? (\n <div className={styles[\"tooltip-default-header\"]}>\n {api.renderMarker({\n type: getSeriesMarkerType(point.series),\n color: getPointColor(point),\n visible: true,\n status: itemOptions?.status,\n ariaLabel: markerAriaLabel,\n })}\n <Box variant=\"span\" fontWeight=\"bold\">\n {point.name}\n </Box>\n </div>\n ),\n body:\n renderers.body?.(tooltipDetails) ??\n (renderers.details ? (\n <ChartSeriesDetails\n details={renderers.details({\n point,\n hideTooltip,\n })}\n compactList={true}\n />\n ) : (\n // We expect all pie chart segments to have defined y values. We use y=0 as fallback\n // because the property is optional in Highcharts types.\n <ChartSeriesDetails details={[{ key: point.series.name, value: point.y ?? 0 }]} />\n )),\n footer: renderers.footer?.(tooltipDetails),\n };\n}\n\nfunction getBubblePointDetails(item: MatchedItem, sizeAxis: readonly CoreChartProps.SizeAxisOptions[] = []) {\n const subItems: { key: React.ReactNode; value: React.ReactNode }[] = [];\n\n const y = item.point.y;\n const yAxisTitle = item.point.series.yAxis?.options?.title?.text;\n const yFormatter = item.point.series.yAxis ? getFormatter(item.point.series.yAxis) : (v: unknown) => String(v);\n subItems.push({ key: yAxisTitle, value: yFormatter(y) });\n\n // Size axis is a custom abstraction built to support bubble series title and formatter for z (size) values.\n // We match size axes by ID if provided, or take the first defined axis instead.\n const matchedSizeAxis = sizeAxis.find((a) => a.id === getBubbleSeriesSizeAxis(item.point.series)) ?? sizeAxis[0];\n if (matchedSizeAxis) {\n // Highcharts bubble size is represented by point.z value, which is however not present in the internal point type -\n // so we take it from point's options instead.\n const size = item.point.options.z ?? null;\n const sizeAxisTitle = matchedSizeAxis.title;\n const sizeFormatter = getFormatter(matchedSizeAxis);\n subItems.push({ key: sizeAxisTitle, value: sizeFormatter(size) });\n }\n\n return subItems;\n}\n\nfunction findTooltipSeriesItems(\n series: readonly Highcharts.Series[],\n group: readonly Highcharts.Point[],\n seriesSorting: NonNullable<CoreChartProps.TooltipOptions[\"seriesSorting\"]>,\n): MatchedItem[] {\n const seriesOrder = series.reduce((d, s, i) => d.set(s, i), new Map<Highcharts.Series, number>());\n const getSeriesIndex = (s: Highcharts.Series) => seriesOrder.get(s) ?? -1;\n const seriesErrors = new Map<string, Highcharts.Point[]>();\n const matchedSeries = new Set<Highcharts.Series>();\n const matchedItems: MatchedItem[] = [];\n for (const point of group) {\n if (!isPointVisible(point)) {\n continue;\n }\n // We only support errorbar series that are linked to other series. In tooltip content we add\n // linked error bars to series detail slot.\n if (point.series.type === \"errorbar\") {\n if (point.series.linkedParent) {\n addError(getSeriesId(point.series.linkedParent), point);\n } else {\n warnOnce(\n \"chart-components\",\n 'The `linkedTo` property of \"errorbar\" series is missing, or points to a series that does not exist.',\n );\n }\n } else {\n addMatchedPoints(point);\n }\n }\n function addError(seriesId: string, errorPoint: Highcharts.Point) {\n if (errorPoint.options.low !== undefined && errorPoint.options.high !== undefined) {\n const errorRanges = seriesErrors.get(seriesId) ?? [];\n errorRanges.push(errorPoint);\n seriesErrors.set(seriesId, errorRanges);\n }\n }\n function addMatchedPoints(point: Highcharts.Point) {\n if (!matchedSeries.has(point.series)) {\n matchedSeries.add(point.series);\n if (isXThreshold(point.series)) {\n matchedItems.push({ point, errorRanges: [] });\n } else {\n point.series.data\n .filter((d) => d.x === point.x)\n .sort((a, b) => (a.y ?? 0) - (b.y ?? 0))\n .forEach((point) => matchedItems.push({ point, errorRanges: [] }));\n }\n }\n }\n return (\n matchedItems\n .sort((i1, i2) => {\n if (seriesSorting === \"by-value-desc\") {\n return (i2.point.y ?? 0) - (i1.point.y ?? 0);\n }\n // We sort matched items by series order. If there are multiple items that belong to the same series, we sort them by value.\n const s1 = getSeriesIndex(i1.point.series) - getSeriesIndex(i2.point.series);\n return s1 || (i1.point.y ?? 0) - (i2.point.y ?? 0);\n })\n // For each series item we add linked error ranges, sorted by their respective series indices.\n .map((item) => {\n const errorRanges = seriesErrors.get(getSeriesId(item.point.series)) ?? [];\n const sortedErrorRanges = errorRanges.sort((i1, i2) => getSeriesIndex(i1.series) - getSeriesIndex(i2.series));\n return { ...item, errorRanges: sortedErrorRanges };\n })\n );\n}\n"]}
@@ -1,2 +1,3 @@
1
1
  import type Highcharts from "highcharts";
2
- export declare function getFormatter(axis?: Highcharts.Axis): (value: unknown) => string;
2
+ import { CoreChartProps } from "./interfaces";
3
+ export declare function getFormatter(axis?: Highcharts.Axis | CoreChartProps.SizeAxisOptions): (value: unknown) => string;
@@ -4,7 +4,7 @@
4
4
  // or provides a default formatter for numeric and datetime values.
5
5
  export function getFormatter(axis) {
6
6
  return (value) => {
7
- var _a, _b;
7
+ var _a, _b, _c;
8
8
  if (typeof value === "string") {
9
9
  return value;
10
10
  }
@@ -14,8 +14,12 @@ export function getFormatter(axis) {
14
14
  if (!axis) {
15
15
  return `${value}`;
16
16
  }
17
+ // Handle non-Highcharts size axes.
18
+ if (!("options" in axis)) {
19
+ return ((_a = axis.valueFormatter) !== null && _a !== void 0 ? _a : numberFormatter)(value);
20
+ }
17
21
  if (axis.options.type === "category") {
18
- return (_b = (_a = axis.categories) === null || _a === void 0 ? void 0 : _a[value]) !== null && _b !== void 0 ? _b : value.toString();
22
+ return (_c = (_b = axis.categories) === null || _b === void 0 ? void 0 : _b[value]) !== null && _c !== void 0 ? _c : value.toString();
19
23
  }
20
24
  const axisOptions = axis.userOptions;
21
25
  if (axisOptions.valueFormatter) {
@@ -1 +1 @@
1
- {"version":3,"file":"formatters.js","sourceRoot":"","sources":["../../../src/core/formatters.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAMtC,4HAA4H;AAC5H,mEAAmE;AACnE,MAAM,UAAU,YAAY,CAAC,IAAsB;IACjD,OAAO,CAAC,KAAc,EAAU,EAAE;;QAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,GAAG,KAAK,EAAE,CAAC;QACpB,CAAC;QACD,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YACrC,OAAO,MAAA,MAAA,IAAI,CAAC,UAAU,0CAAG,KAAK,CAAC,mCAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;QACtD,CAAC;QACD,MAAM,WAAW,GAAG,IAAI,CAAC,WAAwE,CAAC;QAClG,IAAI,WAAW,CAAC,cAAc,EAAE,CAAC;YAC/B,OAAO,WAAW,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAC3C,CAAC;QACD,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YACr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,MAAM,MAAM,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,6BAA6B;IAEpG,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAEjC,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;QACnB,OAAO,GAAG,CAAC;IACb,CAAC;IAED,IAAI,QAAQ,GAAG,IAAI,EAAE,CAAC;QACpB,OAAO,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAChC,CAAC;IAED,IAAI,QAAQ,IAAI,GAAG,EAAE,CAAC;QACpB,OAAO,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;IACnC,CAAC;IAED,IAAI,QAAQ,IAAI,GAAG,EAAE,CAAC;QACpB,OAAO,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;IACnC,CAAC;IAED,IAAI,QAAQ,IAAI,GAAG,EAAE,CAAC;QACpB,OAAO,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;IACnC,CAAC;IAED,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type Highcharts from \"highcharts\";\n\nimport { CoreChartProps } from \"./interfaces\";\n\n// Takes value formatter from the axis options (InternalXAxisOptions.valueFormatter or InternalYAxisOptions.valueFormatter),\n// or provides a default formatter for numeric and datetime values.\nexport function getFormatter(axis?: Highcharts.Axis) {\n return (value: unknown): string => {\n if (typeof value === \"string\") {\n return value;\n }\n if (typeof value !== \"number\") {\n return \"\";\n }\n if (!axis) {\n return `${value}`;\n }\n if (axis.options.type === \"category\") {\n return axis.categories?.[value] ?? value.toString();\n }\n const axisOptions = axis.userOptions as CoreChartProps.XAxisOptions | CoreChartProps.YAxisOptions;\n if (axisOptions.valueFormatter) {\n return axisOptions.valueFormatter(value);\n }\n if (axis.options.type === \"datetime\") {\n const extremes = axis.getExtremes();\n const formatter = getDefaultDatetimeFormatter([extremes.dataMin, extremes.dataMax]);\n return formatter(value);\n }\n return numberFormatter(value);\n };\n}\n\nfunction getDefaultDatetimeFormatter(extremes: [number, number]): (value: number) => string {\n const second = 1000;\n const minute = 60 * second;\n const hour = 60 * minute;\n const day = 24 * hour;\n const month = 30 * day;\n const year = 365 * day;\n if (extremes[1] - extremes[0] > 5 * year) {\n return yearFormatter;\n }\n if (extremes[1] - extremes[0] > 2 * month) {\n return monthFormatter;\n }\n if (extremes[1] - extremes[0] > 3 * day) {\n return dayFormatter;\n }\n if (extremes[1] - extremes[0] > 12 * hour) {\n return hourFormatter;\n }\n if (extremes[1] - extremes[0] > 3 * hour) {\n return minuteFormatter;\n }\n return secondFormatter;\n}\n\nfunction yearFormatter(value: number) {\n return new Date(value).toLocaleDateString(\"en-US\", {\n year: \"numeric\",\n });\n}\n\nfunction monthFormatter(value: number) {\n return new Date(value).toLocaleDateString(\"en-US\", {\n year: \"numeric\",\n month: \"short\",\n });\n}\n\nfunction dayFormatter(value: number) {\n return new Date(value).toLocaleDateString(\"en-US\", {\n month: \"short\",\n day: \"numeric\",\n });\n}\n\nfunction hourFormatter(value: number) {\n return new Date(value).toLocaleDateString(\"en-US\", {\n month: \"short\",\n day: \"numeric\",\n hour: \"numeric\",\n });\n}\n\nfunction minuteFormatter(value: number) {\n return new Date(value).toLocaleDateString(\"en-US\", {\n hour: \"numeric\",\n minute: \"numeric\",\n });\n}\n\nfunction secondFormatter(value: number) {\n return new Date(value).toLocaleDateString(\"en-US\", {\n hour: \"numeric\",\n minute: \"numeric\",\n second: \"numeric\",\n });\n}\n\nfunction numberFormatter(value: number): string {\n const format = (num: number) => parseFloat(num.toFixed(2)).toString(); // trims unnecessary decimals\n\n const absValue = Math.abs(value);\n\n if (absValue === 0) {\n return \"0\";\n }\n\n if (absValue < 0.01) {\n return value.toExponential(0);\n }\n\n if (absValue >= 1e9) {\n return format(value / 1e9) + \"G\";\n }\n\n if (absValue >= 1e6) {\n return format(value / 1e6) + \"M\";\n }\n\n if (absValue >= 1e3) {\n return format(value / 1e3) + \"K\";\n }\n\n return format(value);\n}\n"]}
1
+ {"version":3,"file":"formatters.js","sourceRoot":"","sources":["../../../src/core/formatters.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAMtC,4HAA4H;AAC5H,mEAAmE;AACnE,MAAM,UAAU,YAAY,CAAC,IAAuD;IAClF,OAAO,CAAC,KAAc,EAAU,EAAE;;QAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,GAAG,KAAK,EAAE,CAAC;QACpB,CAAC;QACD,mCAAmC;QACnC,IAAI,CAAC,CAAC,SAAS,IAAI,IAAI,CAAC,EAAE,CAAC;YACzB,OAAO,CAAC,MAAA,IAAI,CAAC,cAAc,mCAAI,eAAe,CAAC,CAAC,KAAK,CAAC,CAAC;QACzD,CAAC;QACD,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YACrC,OAAO,MAAA,MAAA,IAAI,CAAC,UAAU,0CAAG,KAAK,CAAC,mCAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;QACtD,CAAC;QACD,MAAM,WAAW,GAAG,IAAI,CAAC,WAAwE,CAAC;QAClG,IAAI,WAAW,CAAC,cAAc,EAAE,CAAC;YAC/B,OAAO,WAAW,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAC3C,CAAC;QACD,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,KA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S,eAAe,CAAC,KAAa;IACpC,MAAM,MAAM,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,6BAA6B;IAEpG,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAEjC,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;QACnB,OAAO,GAAG,CAAC;IACb,CAAC;IAED,IAAI,QAAQ,GAAG,IAAI,EAAE,CAAC;QACpB,OAAO,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAChC,CAAC;IAED,IAAI,QAAQ,IAAI,GAAG,EAAE,CAAC;QACpB,OAAO,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;IACnC,CAAC;IAED,IAAI,QAAQ,IAAI,GAAG,EAAE,CAAC;QACpB,OAAO,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;IACnC,CAAC;IAED,IAAI,QAAQ,IAAI,GAAG,EAAE,CAAC;QACpB,OAAO,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;IACnC,CAAC;IAED,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type Highcharts from \"highcharts\";\n\nimport { CoreChartProps } from \"./interfaces\";\n\n// Takes value formatter from the axis options (InternalXAxisOptions.valueFormatter or InternalYAxisOptions.valueFormatter),\n// or provides a default formatter for numeric and datetime values.\nexport function getFormatter(axis?: Highcharts.Axis | CoreChartProps.SizeAxisOptions) {\n return (value: unknown): string => {\n if (typeof value === \"string\") {\n return value;\n }\n if (typeof value !== \"number\") {\n return \"\";\n }\n if (!axis) {\n return `${value}`;\n }\n // Handle non-Highcharts size axes.\n if (!(\"options\" in axis)) {\n return (axis.valueFormatter ?? numberFormatter)(value);\n }\n if (axis.options.type === \"category\") {\n return axis.categories?.[value] ?? value.toString();\n }\n const axisOptions = axis.userOptions as CoreChartProps.XAxisOptions | CoreChartProps.YAxisOptions;\n if (axisOptions.valueFormatter) {\n return axisOptions.valueFormatter(value);\n }\n if (axis.options.type === \"datetime\") {\n const extremes = axis.getExtremes();\n const formatter = getDefaultDatetimeFormatter([extremes.dataMin, extremes.dataMax]);\n return formatter(value);\n }\n return numberFormatter(value);\n };\n}\n\nfunction getDefaultDatetimeFormatter(extremes: [number, number]): (value: number) => string {\n const second = 1000;\n const minute = 60 * second;\n const hour = 60 * minute;\n const day = 24 * hour;\n const month = 30 * day;\n const year = 365 * day;\n if (extremes[1] - extremes[0] > 5 * year) {\n return yearFormatter;\n }\n if (extremes[1] - extremes[0] > 2 * month) {\n return monthFormatter;\n }\n if (extremes[1] - extremes[0] > 3 * day) {\n return dayFormatter;\n }\n if (extremes[1] - extremes[0] > 12 * hour) {\n return hourFormatter;\n }\n if (extremes[1] - extremes[0] > 3 * hour) {\n return minuteFormatter;\n }\n return secondFormatter;\n}\n\nfunction yearFormatter(value: number) {\n return new Date(value).toLocaleDateString(\"en-US\", {\n year: \"numeric\",\n });\n}\n\nfunction monthFormatter(value: number) {\n return new Date(value).toLocaleDateString(\"en-US\", {\n year: \"numeric\",\n month: \"short\",\n });\n}\n\nfunction dayFormatter(value: number) {\n return new Date(value).toLocaleDateString(\"en-US\", {\n month: \"short\",\n day: \"numeric\",\n });\n}\n\nfunction hourFormatter(value: number) {\n return new Date(value).toLocaleDateString(\"en-US\", {\n month: \"short\",\n day: \"numeric\",\n hour: \"numeric\",\n });\n}\n\nfunction minuteFormatter(value: number) {\n return new Date(value).toLocaleDateString(\"en-US\", {\n hour: \"numeric\",\n minute: \"numeric\",\n });\n}\n\nfunction secondFormatter(value: number) {\n return new Date(value).toLocaleDateString(\"en-US\", {\n hour: \"numeric\",\n minute: \"numeric\",\n second: \"numeric\",\n });\n}\n\nfunction numberFormatter(value: number): string {\n const format = (num: number) => parseFloat(num.toFixed(2)).toString(); // trims unnecessary decimals\n\n const absValue = Math.abs(value);\n\n if (absValue === 0) {\n return \"0\";\n }\n\n if (absValue < 0.01) {\n return value.toExponential(0);\n }\n\n if (absValue >= 1e9) {\n return format(value / 1e9) + \"G\";\n }\n\n if (absValue >= 1e6) {\n return format(value / 1e6) + \"M\";\n }\n\n if (absValue >= 1e3) {\n return format(value / 1e3) + \"K\";\n }\n\n return format(value);\n}\n"]}
@@ -202,6 +202,11 @@ export interface ScatterSeriesOptions extends BaseCartesianSeriesOptions, Linkab
202
202
  data: readonly PointDataItemType[];
203
203
  marker?: PointMarkerOptions;
204
204
  }
205
+ export interface BubbleSeriesOptions extends BaseCartesianSeriesOptions, LinkableSeries {
206
+ type: "bubble";
207
+ sizeAxis?: string;
208
+ data: readonly SizePointDataItemOptions[];
209
+ }
205
210
  export interface ErrorBarSeriesOptions extends Omit<BaseCartesianSeriesOptions, "name"> {
206
211
  type: "errorbar";
207
212
  name?: string;
@@ -235,6 +240,11 @@ export interface PointDataItemOptions {
235
240
  x?: number;
236
241
  y: number | null;
237
242
  }
243
+ export interface SizePointDataItemOptions {
244
+ x?: number;
245
+ y: number | null;
246
+ size: number;
247
+ }
238
248
  export interface RangeDataItemOptions {
239
249
  x?: number;
240
250
  low: number;
@@ -354,6 +364,7 @@ export interface CoreChartProps extends Pick<BaseChartOptions, "highcharts" | "f
354
364
  * Specifies the options for each item in the chart.
355
365
  */
356
366
  getItemOptions?: CoreChartProps.GetItemOptions;
367
+ sizeAxis?: CoreChartProps.SizeAxisOptions | readonly CoreChartProps.SizeAxisOptions[];
357
368
  }
358
369
  export declare namespace CoreChartProps {
359
370
  interface ChartAPI {
@@ -379,6 +390,11 @@ export declare namespace CoreChartProps {
379
390
  type YAxisOptions = Highcharts.YAxisOptions & {
380
391
  valueFormatter?: (value: null | number) => string;
381
392
  };
393
+ interface SizeAxisOptions {
394
+ id?: string;
395
+ title: string;
396
+ valueFormatter?: (value: null | number) => string;
397
+ }
382
398
  interface ChartItemOptions {
383
399
  /**
384
400
  * If specified, specifies the status of an item.