@cloudscape-design/chart-components 1.0.76 → 1.0.78
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/core/chart-api/chart-extra-context.js +2 -2
- package/core/chart-api/chart-extra-context.js.map +1 -1
- package/core/chart-core.js +3 -1
- package/core/chart-core.js.map +1 -1
- package/core/components/core-tooltip.js +4 -4
- package/core/components/core-tooltip.js.map +1 -1
- package/core/utils.d.ts +4 -1
- package/core/utils.js +14 -2
- package/core/utils.js.map +1 -1
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/manifest.json +1 -1
- package/package.json +3 -3
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import { getChartSeries } from "../../internal/utils/chart-series";
|
|
4
4
|
import { getSeriesData } from "../../internal/utils/series-data";
|
|
5
|
-
import { getGroupRect,
|
|
5
|
+
import { getGroupRect, isSeriesStacked } from "../utils";
|
|
6
6
|
// The context is created when the chart component is rendered for the first time.
|
|
7
7
|
// On every subsequent render the settings and state are updated directly in the context object.
|
|
8
8
|
export function createChartContext() {
|
|
@@ -81,7 +81,7 @@ function computeDerivedState(chart) {
|
|
|
81
81
|
const familyPoints = [];
|
|
82
82
|
for (const x of Array.from(familyXSet).sort(compareX)) {
|
|
83
83
|
for (const member of family) {
|
|
84
|
-
const point = member.data.find((d) => d.x === x &&
|
|
84
|
+
const point = getSeriesData(member.data).find((d) => d.x === x && d.y !== null);
|
|
85
85
|
if (point && familyXSet.has(x)) {
|
|
86
86
|
familyPoints.push(point);
|
|
87
87
|
familyXSet.delete(x); // We ignore points that share X coordinate.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-extra-context.js","sourceRoot":"","sources":["../../../../src/core/chart-api/chart-extra-context.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAKtC,OAAO,EAAE,cAAc,EAAE,MAAM,mCAA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AC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAC7G,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,KAAK,SAAS,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAC7G,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,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 { NonCancelableEventHandler } from \"../../internal/events\";\nimport { getChartSeries } from \"../../internal/utils/chart-series\";\nimport { getSeriesData } from \"../../internal/utils/series-data\";\nimport { ChartLabels } from \"../i18n-utils\";\nimport { CoreChartProps, Rect } from \"../interfaces\";\nimport { getGroupRect, isPointVisible, isSeriesStacked } from \"../utils\";\n\n// Chart API context is used for dependency injection for chart utilities.\n// It is initialized on chart render, and includes the chart instance, consumer\n// settings and state, and derived state, which is computed from the chart instance\n// on each render, and reused across utilities to avoid duplicate work.\n\nexport interface ChartExtraContext {\n settings: ChartExtraContext.Settings;\n handlers: ChartExtraContext.Handlers;\n state: ChartExtraContext.State;\n derived: ChartExtraContext.DerivedState;\n chartOrNull: null | Highcharts.Chart;\n chart: () => Highcharts.Chart;\n}\n\nexport namespace ChartExtraContext {\n export interface Settings {\n chartId: string;\n noDataEnabled: boolean;\n legendEnabled: boolean;\n tooltipEnabled: boolean;\n keyboardNavigationEnabled: boolean;\n labels: ChartLabels;\n getItemOptions?: CoreChartProps.GetItemOptions;\n }\n\n export interface Handlers {\n onHighlight?: NonCancelableEventHandler<CoreChartProps.HighlightChangeDetail>;\n onClearHighlight?: NonCancelableEventHandler<CoreChartProps.HighlightClearDetail>;\n onVisibleItemsChange?: NonCancelableEventHandler<CoreChartProps.VisibleItemsChangeDetail>;\n }\n\n export interface State {\n visibleItems?: readonly string[];\n }\n\n export interface DerivedState {\n allX: number[];\n getPointsByX: (x: number) => Highcharts.Point[];\n getSeriesPoints: (series: Highcharts.Series) => Highcharts.Point[];\n groupRects: { group: Highcharts.Point[]; rect: Rect }[];\n }\n}\n\n// The context is created when the chart component is rendered for the first time.\n// On every subsequent render the settings and state are updated directly in the context object.\nexport function createChartContext(): ChartExtraContext {\n return {\n settings: {\n chartId: \"\",\n noDataEnabled: false,\n legendEnabled: false,\n tooltipEnabled: false,\n keyboardNavigationEnabled: false,\n labels: {},\n },\n handlers: {},\n state: {},\n chart: () => {\n // Before the first chart render there is no chart instance, which is required for most of the utilities.\n // Instead of doing null checks in each utility, an attempt to access the chart instance before it is ready\n // will cause an exception, indicating an logical error in the code.\n throw new Error(\"Invariant violation: using chart API before initialization.\");\n },\n chartOrNull: null,\n derived: { allX: [], getPointsByX: () => [], getSeriesPoints: () => [], groupRects: [] },\n };\n}\n\n// The update method is called on every chart render, before any other initialization code.\n// This ensures the context state is up to date and can be used for subsequent computations.\nexport function updateChartContext(context: ChartExtraContext, chart: Highcharts.Chart) {\n context.chart = () => chart;\n context.chartOrNull = chart;\n context.derived = computeDerivedState(chart);\n}\n\nfunction computeDerivedState(chart: Highcharts.Chart): ChartExtraContext.DerivedState {\n const allXSet = new Set<number>();\n const allXInSeries = new WeakMap<Highcharts.Series, number[]>();\n const pointsByX = new Map<number, Highcharts.Point[]>();\n const getXPoints = (x: number) => pointsByX.get(x) ?? [];\n const addPoint = (point: Highcharts.Point) => {\n const xPoints = getXPoints(point.x);\n xPoints.push(point);\n pointsByX.set(point.x, xPoints);\n };\n const compareX = (a: number, b: number) => a - b;\n\n for (const s of getChartSeries(chart.series)) {\n const seriesX = new Set<number>();\n if (s.visible) {\n for (const d of getSeriesData(s.data)) {\n // Points with y=null represent the absence of value, there is no need to include them and those\n // should have no impact on computed rects or navigation.\n\n // Although \"d\" can't be undefined according to Highcharts API, it does become undefined for chart containing more datapoints\n // than the cropThreshold for that series (specific cases of re-rendering the chart with updated options listening to setExteme updates)\n if (d.visible && d.y !== null) {\n seriesX.add(d.x);\n allXSet.add(d.x);\n addPoint(d);\n }\n }\n }\n allXInSeries.set(s, Array.from(seriesX));\n }\n for (const [, points] of pointsByX) {\n sortPoints(points);\n }\n const allX = Array.from(allXSet).sort(compareX);\n\n // For each series, compute the ordered list of points to navigate through. For a linked family\n // (primary + its linked children), all members share the same flat list: points sorted by X,\n // with family members interleaved in series order within the same X value.\n const seriesPointsMap = new WeakMap<Highcharts.Series, Highcharts.Point[]>();\n for (const s of getChartSeries(chart.series)) {\n if (seriesPointsMap.has(s)) {\n continue; // Already computed as part of a family.\n }\n const master = s.linkedParent ?? s;\n const family = [master, ...master.linkedSeries];\n const familyXSet = new Set(family.flatMap((m) => allXInSeries.get(m) ?? []));\n const familyPoints: Highcharts.Point[] = [];\n for (const x of Array.from(familyXSet).sort(compareX)) {\n for (const member of family) {\n const point = member.data.find((d) => d.x === x && isPointVisible(d) && d.y !== null);\n if (point && familyXSet.has(x)) {\n familyPoints.push(point);\n familyXSet.delete(x); // We ignore points that share X coordinate.\n }\n }\n }\n for (const member of family) {\n seriesPointsMap.set(member, familyPoints);\n }\n }\n return {\n allX,\n getPointsByX: (x) => pointsByX.get(x) ?? [],\n getSeriesPoints: (s) => seriesPointsMap.get(s) ?? [],\n // Group rects are computed for every available x coordinate, each including at least one point with matching x value.\n // They enclose all matching points of the group and are used to match hover position and place the tooltip or focus outline.\n groupRects: allX.map((x) => ({\n group: getXPoints(x),\n rect: getGroupRect(getXPoints(x)),\n })),\n };\n}\n\n// The points are sorted to ensure consistent navigation, including inverted chart orientation.\n// The order of series in grouped column charts is kept, while stacked series are sorted by their\n// respective positions in the plot.\nfunction sortPoints(group: Highcharts.Point[]) {\n const reversed = !!group[0]?.series.yAxis?.reversed;\n group.sort((a, b) => {\n const ay = a.plotY === undefined || (a.series.type === \"column\" && !isSeriesStacked(a.series)) ? 0 : a.plotY;\n const by = b.plotY === undefined || (b.series.type === \"column\" && !isSeriesStacked(b.series)) ? 0 : b.plotY;\n return !reversed ? ay - by : by - ay;\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"chart-extra-context.js","sourceRoot":"","sources":["../../../../src/core/chart-api/chart-extra-context.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAKtC,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAGjE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AA6CzD,kFAAkF;AAClF,gGAAgG;AAChG,MAAM,UAAU,kBAAkB;IAChC,OAAO;QACL,QAAQ,EAAE;YACR,OAAO,EAAE,EAAE;YACX,aAAa,EAAE,KAAK;YACpB,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,KAAK;YACrB,yBAAyB,EAAE,KAAK;YAChC,MAAM,EAAE,EAAE;SACX;QACD,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,EAAE;QACT,KAAK,EAAE,GAAG,EAAE;YACV,yGAAyG;YACzG,2GAA2G;YAC3G,oEAAoE;YACpE,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;QACjF,CAAC;QACD,WAAW,EAAE,IAAI;QACjB,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,YAAY,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,eAAe,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE;KACzF,CAAC;AACJ,CAAC;AAED,2FAA2F;AAC3F,4FAA4F;AAC5F,MAAM,UAAU,kBAAkB,CAAC,OAA0B,EAAE,KAAuB;IACpF,OAAO,CAAC,KAAK,GAAG,GAAG,EA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AA,MAAA,KAAK,CAAC,CAAC,CAAC,0CAAE,MAAM,CAAC,KAAK,0CAAE,QAAQ,CAAA,CAAC;IACpD,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAClB,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,KAAK,SAAS,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAC7G,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,KAAK,SAAS,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAC7G,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,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 { NonCancelableEventHandler } from \"../../internal/events\";\nimport { getChartSeries } from \"../../internal/utils/chart-series\";\nimport { getSeriesData } from \"../../internal/utils/series-data\";\nimport { ChartLabels } from \"../i18n-utils\";\nimport { CoreChartProps, Rect } from \"../interfaces\";\nimport { getGroupRect, isSeriesStacked } from \"../utils\";\n\n// Chart API context is used for dependency injection for chart utilities.\n// It is initialized on chart render, and includes the chart instance, consumer\n// settings and state, and derived state, which is computed from the chart instance\n// on each render, and reused across utilities to avoid duplicate work.\n\nexport interface ChartExtraContext {\n settings: ChartExtraContext.Settings;\n handlers: ChartExtraContext.Handlers;\n state: ChartExtraContext.State;\n derived: ChartExtraContext.DerivedState;\n chartOrNull: null | Highcharts.Chart;\n chart: () => Highcharts.Chart;\n}\n\nexport namespace ChartExtraContext {\n export interface Settings {\n chartId: string;\n noDataEnabled: boolean;\n legendEnabled: boolean;\n tooltipEnabled: boolean;\n keyboardNavigationEnabled: boolean;\n labels: ChartLabels;\n getItemOptions?: CoreChartProps.GetItemOptions;\n }\n\n export interface Handlers {\n onHighlight?: NonCancelableEventHandler<CoreChartProps.HighlightChangeDetail>;\n onClearHighlight?: NonCancelableEventHandler<CoreChartProps.HighlightClearDetail>;\n onVisibleItemsChange?: NonCancelableEventHandler<CoreChartProps.VisibleItemsChangeDetail>;\n }\n\n export interface State {\n visibleItems?: readonly string[];\n }\n\n export interface DerivedState {\n allX: number[];\n getPointsByX: (x: number) => Highcharts.Point[];\n getSeriesPoints: (series: Highcharts.Series) => Highcharts.Point[];\n groupRects: { group: Highcharts.Point[]; rect: Rect }[];\n }\n}\n\n// The context is created when the chart component is rendered for the first time.\n// On every subsequent render the settings and state are updated directly in the context object.\nexport function createChartContext(): ChartExtraContext {\n return {\n settings: {\n chartId: \"\",\n noDataEnabled: false,\n legendEnabled: false,\n tooltipEnabled: false,\n keyboardNavigationEnabled: false,\n labels: {},\n },\n handlers: {},\n state: {},\n chart: () => {\n // Before the first chart render there is no chart instance, which is required for most of the utilities.\n // Instead of doing null checks in each utility, an attempt to access the chart instance before it is ready\n // will cause an exception, indicating an logical error in the code.\n throw new Error(\"Invariant violation: using chart API before initialization.\");\n },\n chartOrNull: null,\n derived: { allX: [], getPointsByX: () => [], getSeriesPoints: () => [], groupRects: [] },\n };\n}\n\n// The update method is called on every chart render, before any other initialization code.\n// This ensures the context state is up to date and can be used for subsequent computations.\nexport function updateChartContext(context: ChartExtraContext, chart: Highcharts.Chart) {\n context.chart = () => chart;\n context.chartOrNull = chart;\n context.derived = computeDerivedState(chart);\n}\n\nfunction computeDerivedState(chart: Highcharts.Chart): ChartExtraContext.DerivedState {\n const allXSet = new Set<number>();\n const allXInSeries = new WeakMap<Highcharts.Series, number[]>();\n const pointsByX = new Map<number, Highcharts.Point[]>();\n const getXPoints = (x: number) => pointsByX.get(x) ?? [];\n const addPoint = (point: Highcharts.Point) => {\n const xPoints = getXPoints(point.x);\n xPoints.push(point);\n pointsByX.set(point.x, xPoints);\n };\n const compareX = (a: number, b: number) => a - b;\n\n for (const s of getChartSeries(chart.series)) {\n const seriesX = new Set<number>();\n if (s.visible) {\n for (const d of getSeriesData(s.data)) {\n // Points with y=null represent the absence of value, there is no need to include them and those\n // should have no impact on computed rects or navigation.\n\n // Although \"d\" can't be undefined according to Highcharts API, it does become undefined for chart containing more datapoints\n // than the cropThreshold for that series (specific cases of re-rendering the chart with updated options listening to setExteme updates)\n if (d.visible && d.y !== null) {\n seriesX.add(d.x);\n allXSet.add(d.x);\n addPoint(d);\n }\n }\n }\n allXInSeries.set(s, Array.from(seriesX));\n }\n for (const [, points] of pointsByX) {\n sortPoints(points);\n }\n const allX = Array.from(allXSet).sort(compareX);\n\n // For each series, compute the ordered list of points to navigate through. For a linked family\n // (primary + its linked children), all members share the same flat list: points sorted by X,\n // with family members interleaved in series order within the same X value.\n const seriesPointsMap = new WeakMap<Highcharts.Series, Highcharts.Point[]>();\n for (const s of getChartSeries(chart.series)) {\n if (seriesPointsMap.has(s)) {\n continue; // Already computed as part of a family.\n }\n const master = s.linkedParent ?? s;\n const family = [master, ...master.linkedSeries];\n const familyXSet = new Set(family.flatMap((m) => allXInSeries.get(m) ?? []));\n const familyPoints: Highcharts.Point[] = [];\n for (const x of Array.from(familyXSet).sort(compareX)) {\n for (const member of family) {\n const point = getSeriesData(member.data).find((d) => d.x === x && d.y !== null);\n if (point && familyXSet.has(x)) {\n familyPoints.push(point);\n familyXSet.delete(x); // We ignore points that share X coordinate.\n }\n }\n }\n for (const member of family) {\n seriesPointsMap.set(member, familyPoints);\n }\n }\n return {\n allX,\n getPointsByX: (x) => pointsByX.get(x) ?? [],\n getSeriesPoints: (s) => seriesPointsMap.get(s) ?? [],\n // Group rects are computed for every available x coordinate, each including at least one point with matching x value.\n // They enclose all matching points of the group and are used to match hover position and place the tooltip or focus outline.\n groupRects: allX.map((x) => ({\n group: getXPoints(x),\n rect: getGroupRect(getXPoints(x)),\n })),\n };\n}\n\n// The points are sorted to ensure consistent navigation, including inverted chart orientation.\n// The order of series in grouped column charts is kept, while stacked series are sorted by their\n// respective positions in the plot.\nfunction sortPoints(group: Highcharts.Point[]) {\n const reversed = !!group[0]?.series.yAxis?.reversed;\n group.sort((a, b) => {\n const ay = a.plotY === undefined || (a.series.type === \"column\" && !isSeriesStacked(a.series)) ? 0 : a.plotY;\n const by = b.plotY === undefined || (b.series.type === \"column\" && !isSeriesStacked(b.series)) ? 0 : b.plotY;\n return !reversed ? ay - by : by - ay;\n });\n}\n"]}
|
package/core/chart-core.js
CHANGED
|
@@ -152,7 +152,9 @@ export function InternalCoreChart({ options, ariaLabel, ariaDescription, fitHeig
|
|
|
152
152
|
keyboardNavigation: (_o = (_m = options.accessibility) === null || _m === void 0 ? void 0 : _m.keyboardNavigation) !== null && _o !== void 0 ? _o : { enabled: !keyboardNavigation },
|
|
153
153
|
point: {
|
|
154
154
|
// Point description formatter is overridden to respect custom axes value formatters.
|
|
155
|
-
descriptionFormatter: (point) => getPointAccessibleDescription(point, labels
|
|
155
|
+
descriptionFormatter: (point) => getPointAccessibleDescription(point, labels, {
|
|
156
|
+
sizeAxis: castArray(rest.sizeAxis),
|
|
157
|
+
}),
|
|
156
158
|
...(_p = options.accessibility) === null || _p === void 0 ? void 0 : _p.point,
|
|
157
159
|
},
|
|
158
160
|
},
|
package/core/chart-core.js.map
CHANGED
|
@@ -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,OA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sD,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, yAxisOptions.id),\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, axisId?: string) {\n return clsx(\n testClasses[\"axis-y\"],\n inverted ? testClasses[\"axis-horizontal\"] : testClasses[\"axis-vertical\"],\n customClassName,\n axisId && `awsui-axis-${axisId}`,\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,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,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) =>\n getPointAccessibleDescription(point, labels, {\n sizeAxis: castArray(rest.sizeAxis as CoreChartProps.SizeAxisOptions[]),\n }),\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, yAxisOptions.id),\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, axisId?: string) {\n return clsx(\n testClasses[\"axis-y\"],\n inverted ? testClasses[\"axis-horizontal\"] : testClasses[\"axis-vertical\"],\n customClassName,\n axisId && `awsui-axis-${axisId}`,\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"]}
|
|
@@ -11,7 +11,7 @@ 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 {
|
|
14
|
+
import { getPointColor, getPointId, getSeriesColor, getSeriesId, getSeriesMarkerType, isPointVisible, isXThreshold, matchSizeAxis, } from "../utils";
|
|
15
15
|
import styles from "../styles.css.js";
|
|
16
16
|
const MIN_VISIBLE_BLOCK_SIZE = 200;
|
|
17
17
|
const DEFAULT_DEBOUNCE = 200;
|
|
@@ -170,7 +170,7 @@ function getTooltipContentPie(api, { point, renderers = {}, hideTooltip, }) {
|
|
|
170
170
|
};
|
|
171
171
|
}
|
|
172
172
|
function getBubblePointDetails(item, sizeAxis = []) {
|
|
173
|
-
var _a, _b, _c, _d
|
|
173
|
+
var _a, _b, _c, _d;
|
|
174
174
|
const subItems = [];
|
|
175
175
|
const y = item.point.y;
|
|
176
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;
|
|
@@ -178,11 +178,11 @@ function getBubblePointDetails(item, sizeAxis = []) {
|
|
|
178
178
|
subItems.push({ key: yAxisTitle, value: yFormatter(y) });
|
|
179
179
|
// Size axis is a custom abstraction built to support bubble series title and formatter for z (size) values.
|
|
180
180
|
// We match size axes by ID if provided, or take the first defined axis instead.
|
|
181
|
-
const matchedSizeAxis = (
|
|
181
|
+
const matchedSizeAxis = matchSizeAxis(sizeAxis, item.point.series);
|
|
182
182
|
if (matchedSizeAxis) {
|
|
183
183
|
// Highcharts bubble size is represented by point.z value, which is however not present in the internal point type -
|
|
184
184
|
// so we take it from point's options instead.
|
|
185
|
-
const size = (
|
|
185
|
+
const size = (_d = item.point.options.z) !== null && _d !== void 0 ? _d : null;
|
|
186
186
|
const sizeAxisTitle = matchedSizeAxis.title;
|
|
187
187
|
const sizeFormatter = getFormatter(matchedSizeAxis);
|
|
188
188
|
subItems.push({ key: sizeAxisTitle, value: sizeFormatter(size) });
|
|
@@ -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,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,SAAS,GAAG,QAAQ,EACpB,IAAI,EACJ,iBAAiB,EAAE,0BAA0B,EAC7C,GAAG,EACH,WAAW,EACX,QAAQ,GAAG,KAAK,EAChB,aAAa,GAAG,UAAU,EAC1B,QAAQ,GAMT;;IACC,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAsB,EAA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AM,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
|
+
{"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,aAAa,EACb,UA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C,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 matchSizeAxis,\n} from \"../utils\";\n\nimport styles from \"../styles.css.js\";\n\nconst MIN_VISIBLE_BLOCK_SIZE = 200;\nconst DEFAULT_DEBOUNCE = 200;\n\ntype ExpandedSeriesState = Record<string, Set<string>>;\n\ninterface ExpandedSeriesStateProps {\n expandedSeries: ExpandedSeriesState;\n setExpandedSeries: (cb: (state: ExpandedSeriesState) => ExpandedSeriesState) => void;\n}\n\ninterface RenderedTooltipContent {\n header: React.ReactNode;\n body: React.ReactNode;\n footer: React.ReactNode;\n}\n\ninterface MatchedItem {\n point: Highcharts.Point;\n errorRanges: Highcharts.Point[];\n}\n\nexport function ChartTooltip({\n placement = \"target\",\n size,\n getTooltipContent: getTooltipContentOverrides,\n api,\n i18nStrings,\n debounce = false,\n seriesSorting = \"as-added\",\n sizeAxis,\n}: CoreChartProps.TooltipOptions & {\n i18nStrings?: BaseI18nStrings;\n getTooltipContent?: CoreChartProps.GetTooltipContent;\n sizeAxis?: readonly CoreChartProps.SizeAxisOptions[];\n api: ChartAPI;\n}) {\n const [expandedSeries, setExpandedSeries] = useState<ExpandedSeriesState>({});\n const tooltip = useSelector(api.tooltipStore, (s) => s);\n const debouncedTooltip = useDebouncedValue(tooltip, debounce === true ? DEFAULT_DEBOUNCE : debounce || 0);\n\n if (\n !debouncedTooltip ||\n !debouncedTooltip.visible ||\n debouncedTooltip.group.length === 0 ||\n debouncedTooltip.group[0].series === undefined\n ) {\n return null;\n }\n\n const chart = debouncedTooltip.group[0]?.series.chart;\n const renderers = getTooltipContentOverrides?.({ point: debouncedTooltip.point, group: debouncedTooltip.group });\n const getTrack = placement === \"target\" ? api.getTargetTrack : api.getGroupTrack;\n const position = (() => {\n if (placement === \"target\" || placement === \"middle\") {\n return !chart.inverted ? \"right\" : \"bottom\";\n } else {\n return !chart.inverted ? \"bottom\" : \"right\";\n }\n })();\n const content = getTooltipContent(api, {\n renderers,\n point: debouncedTooltip.point,\n group: debouncedTooltip.group,\n expandedSeries,\n setExpandedSeries,\n seriesSorting,\n sizeAxis,\n hideTooltip: () => {\n api.hideTooltip();\n },\n });\n if (!content) {\n return null;\n }\n return (\n <InternalChartTooltip\n getTrack={getTrack}\n trackKey={getTrackKey(debouncedTooltip.point, debouncedTooltip.group)}\n container={null}\n dismissButton={debouncedTooltip.pinned}\n dismissAriaLabel={i18nStrings?.detailPopoverDismissAriaLabel}\n onDismiss={api.onDismissTooltip}\n onMouseEnter={api.onMouseEnterTooltip}\n onMouseLeave={api.onMouseLeaveTooltip}\n title={content.header}\n footer={\n content.footer ? (\n <>\n <hr aria-hidden={true} />\n {content.footer}\n </>\n ) : null\n }\n size={size}\n position={position}\n minVisibleBlockSize={MIN_VISIBLE_BLOCK_SIZE}\n >\n <LiveRegion>{content.body}</LiveRegion>\n </InternalChartTooltip>\n );\n}\n\nfunction getTrackKey(point: null | Highcharts.Point, group: readonly Highcharts.Point[]) {\n const pointId = point && (point.options.id || point.options.name);\n if (point && pointId) {\n return `p-${pointId}-${point.x}-${point.y}`;\n }\n if (point) {\n return `p-${point.x}-${point.y}`;\n }\n return `g_${group.length}_${group[0].x}`;\n}\n\nfunction getTooltipContent(\n api: ChartAPI,\n props: CoreChartProps.GetTooltipContentProps & {\n renderers?: CoreChartProps.TooltipContentRenderer;\n hideTooltip: () => void;\n seriesSorting: NonNullable<CoreChartProps.TooltipOptions[\"seriesSorting\"]>;\n sizeAxis?: readonly CoreChartProps.SizeAxisOptions[];\n } & ExpandedSeriesStateProps,\n): null | RenderedTooltipContent {\n if (props.point && props.point.series.type === \"pie\") {\n return getTooltipContentPie(api, { ...props, point: props.point });\n } else if (props.group.length > 0 && props.group[0].series.type !== \"pie\") {\n return getTooltipContentCartesian(api, props);\n } else {\n return null;\n }\n}\n\nfunction getTooltipContentCartesian(\n api: ChartAPI,\n {\n point,\n group,\n expandedSeries,\n renderers = {},\n setExpandedSeries,\n hideTooltip,\n seriesSorting,\n sizeAxis,\n }: CoreChartProps.GetTooltipContentProps & {\n renderers?: CoreChartProps.TooltipContentRenderer;\n hideTooltip: () => void;\n seriesSorting: NonNullable<CoreChartProps.TooltipOptions[\"seriesSorting\"]>;\n sizeAxis?: readonly CoreChartProps.SizeAxisOptions[];\n } & ExpandedSeriesStateProps,\n): RenderedTooltipContent {\n // The cartesian tooltip might or might not have a selected point, but it always has a non-empty group.\n // By design, every point of the group has the same x value.\n const x = group[0].x;\n const chart = group[0].series.chart;\n const getSeriesMarker = (series: Highcharts.Series) => {\n const itemOptions = api.context.settings.getItemOptions?.(getSeriesId(series));\n return api.renderMarker({\n type: getSeriesMarkerType(series),\n color: getSeriesColor(series),\n visible: true,\n status: itemOptions?.status,\n ariaLabel: api.context.settings.labels.itemMarkerLabel?.(itemOptions?.status),\n });\n };\n const matchedItems = findTooltipSeriesItems(getChartSeries(chart.series), group, seriesSorting);\n const detailItems: ChartSeriesDetailItem[] = matchedItems.map((item) => {\n const valueFormatter = getFormatter(item.point.series.yAxis);\n const itemY = isXThreshold(item.point.series) ? null : (item.point.y ?? null);\n const bubbleSubItems = item.point.series.type === \"bubble\" ? getBubblePointDetails(item, sizeAxis) : undefined;\n const customContent = renderers.point\n ? renderers.point({\n item,\n hideTooltip,\n })\n : undefined;\n const defaultValue = bubbleSubItems ? null : valueFormatter(itemY);\n return {\n key: customContent?.key ?? item.point.series.name,\n value: customContent?.value ?? defaultValue,\n marker: getSeriesMarker(item.point.series),\n subItems: customContent?.subItems ?? bubbleSubItems,\n expandableId: customContent?.expandable ? item.point.series.name : undefined,\n highlighted: item.point.x === point?.x && item.point.y === point?.y,\n description:\n customContent?.description === undefined && item.errorRanges.length ? (\n <>\n {item.errorRanges.map((errorBarPoint, index) => (\n <div key={index} className={styles[\"error-range\"]}>\n <span>{errorBarPoint.series.userOptions.name ? errorBarPoint.series.userOptions.name : \"\"}</span>\n <span>\n {valueFormatter(errorBarPoint.options.low ?? 0)} - {valueFormatter(errorBarPoint.options.high ?? 0)}\n </span>\n </div>\n ))}\n </>\n ) : (\n customContent?.description\n ),\n };\n });\n // We only support cartesian charts with a single x axis.\n const titleFormatter = getFormatter(chart.xAxis[0]);\n const slotRenderProps: CoreChartProps.TooltipSlotProps = {\n x,\n items: matchedItems,\n hideTooltip: hideTooltip,\n };\n return {\n header: renderers.header?.(slotRenderProps) ?? titleFormatter(x),\n body: renderers.body?.(slotRenderProps) ?? (\n <ChartSeriesDetails\n details={detailItems}\n expandedSeries={expandedSeries[x]}\n setExpandedState={(id, isExpanded) => {\n setExpandedSeries((oldState) => {\n const expandedSeriesInCurrentCoordinate = new Set(oldState[x]);\n if (isExpanded) {\n expandedSeriesInCurrentCoordinate.add(id);\n } else {\n expandedSeriesInCurrentCoordinate.delete(id);\n }\n return { ...oldState, [x]: expandedSeriesInCurrentCoordinate };\n });\n }}\n />\n ),\n footer: renderers.footer?.(slotRenderProps),\n };\n}\n\nfunction getTooltipContentPie(\n api: ChartAPI,\n {\n point,\n renderers = {},\n hideTooltip,\n }: { point: Highcharts.Point } & { renderers?: CoreChartProps.TooltipContentRenderer; hideTooltip: () => void },\n): RenderedTooltipContent {\n const tooltipDetails: CoreChartProps.TooltipSlotProps = {\n x: point.x,\n items: [{ point, errorRanges: [] }],\n hideTooltip,\n };\n\n const itemOptions = api.context.settings.getItemOptions?.(getPointId(point));\n const markerAriaLabel = api.context.settings.labels.itemMarkerLabel?.(itemOptions?.status);\n\n return {\n header: renderers.header?.(tooltipDetails) ?? (\n <div className={styles[\"tooltip-default-header\"]}>\n {api.renderMarker({\n type: getSeriesMarkerType(point.series),\n color: getPointColor(point),\n visible: true,\n status: itemOptions?.status,\n ariaLabel: markerAriaLabel,\n })}\n <Box variant=\"span\" fontWeight=\"bold\">\n {point.name}\n </Box>\n </div>\n ),\n body:\n renderers.body?.(tooltipDetails) ??\n (renderers.details ? (\n <ChartSeriesDetails\n details={renderers.details({\n point,\n hideTooltip,\n })}\n compactList={true}\n />\n ) : (\n // We expect all pie chart segments to have defined y values. We use y=0 as fallback\n // because the property is optional in Highcharts types.\n <ChartSeriesDetails details={[{ key: point.series.name, value: point.y ?? 0 }]} />\n )),\n footer: renderers.footer?.(tooltipDetails),\n };\n}\n\nfunction getBubblePointDetails(item: MatchedItem, sizeAxis: readonly CoreChartProps.SizeAxisOptions[] = []) {\n const subItems: { key: React.ReactNode; value: React.ReactNode }[] = [];\n\n const y = item.point.y;\n const yAxisTitle = item.point.series.yAxis?.options?.title?.text;\n const yFormatter = item.point.series.yAxis ? getFormatter(item.point.series.yAxis) : (v: unknown) => String(v);\n subItems.push({ key: yAxisTitle, value: yFormatter(y) });\n\n // Size axis is a custom abstraction built to support bubble series title and formatter for z (size) values.\n // We match size axes by ID if provided, or take the first defined axis instead.\n const matchedSizeAxis = matchSizeAxis(sizeAxis, item.point.series);\n if (matchedSizeAxis) {\n // Highcharts bubble size is represented by point.z value, which is however not present in the internal point type -\n // so we take it from point's options instead.\n const size = item.point.options.z ?? null;\n const sizeAxisTitle = matchedSizeAxis.title;\n const sizeFormatter = getFormatter(matchedSizeAxis);\n subItems.push({ key: sizeAxisTitle, value: sizeFormatter(size) });\n }\n\n return subItems;\n}\n\nfunction findTooltipSeriesItems(\n series: readonly Highcharts.Series[],\n group: readonly Highcharts.Point[],\n seriesSorting: NonNullable<CoreChartProps.TooltipOptions[\"seriesSorting\"]>,\n): MatchedItem[] {\n const seriesOrder = series.reduce((d, s, i) => d.set(s, i), new Map<Highcharts.Series, number>());\n const getSeriesIndex = (s: Highcharts.Series) => seriesOrder.get(s) ?? -1;\n const seriesErrors = new Map<string, Highcharts.Point[]>();\n const matchedSeries = new Set<Highcharts.Series>();\n const matchedItems: MatchedItem[] = [];\n for (const point of group) {\n if (!isPointVisible(point)) {\n continue;\n }\n // We only support errorbar series that are linked to other series. In tooltip content we add\n // linked error bars to series detail slot.\n if (point.series.type === \"errorbar\") {\n if (point.series.linkedParent) {\n addError(getSeriesId(point.series.linkedParent), point);\n } else {\n warnOnce(\n \"chart-components\",\n 'The `linkedTo` property of \"errorbar\" series is missing, or points to a series that does not exist.',\n );\n }\n } else {\n addMatchedPoints(point);\n }\n }\n function addError(seriesId: string, errorPoint: Highcharts.Point) {\n if (errorPoint.options.low !== undefined && errorPoint.options.high !== undefined) {\n const errorRanges = seriesErrors.get(seriesId) ?? [];\n errorRanges.push(errorPoint);\n seriesErrors.set(seriesId, errorRanges);\n }\n }\n function addMatchedPoints(point: Highcharts.Point) {\n if (!matchedSeries.has(point.series)) {\n matchedSeries.add(point.series);\n if (isXThreshold(point.series)) {\n matchedItems.push({ point, errorRanges: [] });\n } else {\n point.series.data\n .filter((d) => d.x === point.x)\n .sort((a, b) => (a.y ?? 0) - (b.y ?? 0))\n .forEach((point) => matchedItems.push({ point, errorRanges: [] }));\n }\n }\n }\n return (\n matchedItems\n .sort((i1, i2) => {\n if (seriesSorting === \"by-value-desc\") {\n return (i2.point.y ?? 0) - (i1.point.y ?? 0);\n }\n // We sort matched items by series order. If there are multiple items that belong to the same series, we sort them by value.\n const s1 = getSeriesIndex(i1.point.series) - getSeriesIndex(i2.point.series);\n return s1 || (i1.point.y ?? 0) - (i2.point.y ?? 0);\n })\n // For each series item we add linked error ranges, sorted by their respective series indices.\n .map((item) => {\n const errorRanges = seriesErrors.get(getSeriesId(item.point.series)) ?? [];\n const sortedErrorRanges = errorRanges.sort((i1, i2) => getSeriesIndex(i1.series) - getSeriesIndex(i2.series));\n return { ...item, errorRanges: sortedErrorRanges };\n })\n );\n}\n"]}
|
package/core/utils.d.ts
CHANGED
|
@@ -86,6 +86,9 @@ export declare function getPointRect(point: Highcharts.Point): Rect;
|
|
|
86
86
|
export declare function getGroupRect(points: readonly Highcharts.Point[]): Rect;
|
|
87
87
|
export declare function safeRect(rect: Rect): Rect;
|
|
88
88
|
export declare function getChartAccessibleDescription(chart: Highcharts.Chart): string;
|
|
89
|
-
export declare function
|
|
89
|
+
export declare function matchSizeAxis(sizeAxis: readonly CoreChartProps.SizeAxisOptions[], series: Highcharts.Series): CoreChartProps.SizeAxisOptions;
|
|
90
|
+
export declare function getPointAccessibleDescription(point: Highcharts.Point, labels: ChartLabels, additionalProps?: {
|
|
91
|
+
sizeAxis?: readonly CoreChartProps.SizeAxisOptions[];
|
|
92
|
+
}): string;
|
|
90
93
|
export declare function getGroupAccessibleDescription(group: readonly Highcharts.Point[]): string;
|
|
91
94
|
export {};
|
package/core/utils.js
CHANGED
|
@@ -283,11 +283,23 @@ export function getChartAccessibleDescription(chart) {
|
|
|
283
283
|
var _a, _b, _c;
|
|
284
284
|
return (_c = (_b = (_a = chart.options.lang) === null || _a === void 0 ? void 0 : _a.accessibility) === null || _b === void 0 ? void 0 : _b.chartContainerLabel) !== null && _c !== void 0 ? _c : "";
|
|
285
285
|
}
|
|
286
|
-
export function
|
|
286
|
+
export function matchSizeAxis(sizeAxis, series) {
|
|
287
|
+
var _a;
|
|
288
|
+
return (_a = sizeAxis.find((a) => a.id === getBubbleSeriesSizeAxis(series))) !== null && _a !== void 0 ? _a : sizeAxis[0];
|
|
289
|
+
}
|
|
290
|
+
export function getPointAccessibleDescription(point, labels, additionalProps) {
|
|
291
|
+
var _a;
|
|
287
292
|
if (point.series.xAxis && point.series.yAxis) {
|
|
288
293
|
const formattedX = getFormatter(point.series.xAxis)(point.x);
|
|
289
294
|
const formattedY = getFormatter(point.series.yAxis)(point.y);
|
|
290
|
-
|
|
295
|
+
let formattedSize = "";
|
|
296
|
+
if ((additionalProps === null || additionalProps === void 0 ? void 0 : additionalProps.sizeAxis) && point.series.type === "bubble") {
|
|
297
|
+
const matchedSizeAxis = matchSizeAxis(additionalProps.sizeAxis, point.series);
|
|
298
|
+
const size = (_a = point.options.z) !== null && _a !== void 0 ? _a : null;
|
|
299
|
+
const sizeFormatter = getFormatter(matchedSizeAxis);
|
|
300
|
+
formattedSize = sizeFormatter(size);
|
|
301
|
+
}
|
|
302
|
+
return `${formattedX} ${formattedY}${formattedSize ? " " + formattedSize : ""}, ${point.series.name}`;
|
|
291
303
|
}
|
|
292
304
|
else if (point.series.type === "pie") {
|
|
293
305
|
const segmentLabel = labels.chartSegmentLabel ? `${labels.chartSegmentLabel} ` : "";
|
package/core/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/core/utils.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAMtC,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAe5C,yHAAyH;AACzH,6HAA6H;AAC7H,gFAAgF;AAChF,MAAM,UAAU,WAAW,CAAC,MAAyB;IACnD,OAAO,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACtC,CAAC;AACD,MAAM,UAAU,UAAU,CAAC,KAAuB;IAChD,OAAO,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AACrC,CAAC;AACD,MAAM,UAAU,YAAY,CAAC,OAAuC;;IAClE,OAAO,MAAA,MAAA,OAAO,CAAC,EAAE,mCAAI,OAAO,CAAC,IAAI,mCAAI,eAAe,EAAE,CAAC;AACzD,CAAC;AACD,SAAS,eAAe;IACtB,MAAM,IAAI,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,OAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACrE,OAAO,0BAA0B,GAAG,IAAI,CAAC;AAC3C,CAAC;AAED,yGAAyG;AACzG,MAAM,UAAU,eAAe,CAAC,MAAyB;IACvD,OAAQ,MAAM,CAAC,OAAe,CAAC,QAAQ,KAAK,QAAQ,CAAC;AACvD,CAAC;AAcD,MAAM,UAAU,uBAAuB,CACrC,IAAO,EACP,KAAa;IAEb,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,I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2B,CAAC,KAAuB;;IAC1D,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;IACjC,MAAM,KAAK,GAAG,MAAA,KAAK,CAAC,KAAK,mCAAI,CAAC,CAAC;IAC/B,MAAM,KAAK,GAAG,MAAA,KAAK,CAAC,KAAK,mCAAI,CAAC,CAAC;IAC/B,OAAO,YAAY,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;AAChF,CAAC;AAED,SAAS,YAAY,CAAC,IAAU,EAAE,KAAuB,EAAE,aAAsB;IAC/E,OAAO,aAAa,IAAI,KAAK,CAAC,QAAQ;QACpC,CAAC,CAAC;YACE,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;YAC5D,CAAC,EAAE,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC;YAC3D,KAAK,EAAE,IAAI,CAAC,MAAM;YAClB,MAAM,EAAE,IAAI,CAAC,KAAK;SACnB;QACH,CAAC,CAAC;YACE,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;YAC1B,CAAC,EAAE,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;YACzB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC;AACR,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type Highcharts from \"highcharts\";\n\nimport { ChartSeriesMarkerType } from \"../internal/components/series-marker\";\nimport { ChartSeriesMarkerStatus } from \"../internal/components/series-marker/interfaces\";\nimport { getChartSeries } from \"../internal/utils/chart-series\";\nimport { castArray } from \"../internal/utils/utils\";\nimport { getFormatter } from \"./formatters\";\nimport { ChartLabels } from \"./i18n-utils\";\nimport { CoreChartProps, Rect } from \"./interfaces\";\n\nexport interface LegendItemSpec {\n id: string;\n name: string;\n markerType: ChartSeriesMarkerType;\n color: string;\n visible: boolean;\n isSecondary: boolean;\n status?: ChartSeriesMarkerStatus;\n markerAriaLabel?: string;\n}\n\n// The below functions extract unique identifier from series, point, or options. The identifier can be item's ID or name.\n// We expect that items requiring referencing (e.g. in order to control their visibility) have the unique identifier defined.\n// Otherwise, we return a randomized id that is to ensure no accidental matches.\nexport function getSeriesId(series: Highcharts.Series): string {\n return getOptionsId(series.options);\n}\nexport function getPointId(point: Highcharts.Point): string {\n return getOptionsId(point.options);\n}\nexport function getOptionsId(options: { id?: string; name?: string }): string {\n return options.id ?? options.name ?? noIdPlaceholder();\n}\nfunction noIdPlaceholder(): string {\n const rand = (Math.random() * 1_000_000).toFixed(0).padStart(6, \"0\");\n return \"awsui-no-id-placeholder-\" + rand;\n}\n\n// There are more possible values that series.stacking can take, but we only explicitly support \"normal\".\nexport function isSeriesStacked(series: Highcharts.Series) {\n return (series.options as any).stacking === \"normal\";\n}\n\n// The threshold series are custom series, implemented as a combination of line series, and plot lines.\n// As Highcharts does not support custom series declaration, we annotate threshold series by using the\n// series.custom property. This is then used in our utilities to recognize threshold series, and retrieve\n// the associated threshold value.\ninterface ThresholdOptions<T extends \"x-threshold\" | \"y-threshold\"> {\n custom: {\n awsui: {\n type: T;\n threshold: number;\n };\n };\n}\nexport function createThresholdMetadata<T extends \"x-threshold\" | \"y-threshold\">(\n type: T,\n value: number,\n): ThresholdOptions<T> {\n return { custom: { awsui: { type, threshold: value } } };\n}\nexport function isXThreshold(\n s: Highcharts.Series,\n): s is Highcharts.Series & { options: ThresholdOptions<\"x-threshold\"> } {\n return typeof s.options.custom === \"object\" && s.options.custom.awsui?.type === \"x-threshold\";\n}\nexport function isYThreshold(\n s: Highcharts.Series,\n): s is Highcharts.Series & { options: ThresholdOptions<\"y-threshold\"> } {\n return typeof s.options.custom === \"object\" && s.options.custom.awsui?.type === \"y-threshold\";\n}\n\n// We extend bubble series by introducing sizeAxis - which is used to define title and formatter for bubble series size values.\n// In case there are multiple such axes - the bubble series can target a specific one by setting sizeAxis to the respective size\n// axis id. As there is no such prop in Highcharts series type - we pass it using the custom options object.\nexport interface BubbleOptions {\n custom: {\n awsui: {\n sizeAxis?: string;\n };\n };\n}\nexport function createBubbleMetadata(options: { sizeAxis?: string }): BubbleOptions {\n return { custom: { awsui: options } };\n}\nexport function getBubbleSeriesSizeAxis(series: Highcharts.Series): undefined | string {\n const { custom } = series.options as Highcharts.SeriesOptionsType & BubbleOptions;\n return custom?.awsui?.sizeAxis;\n}\n\n// We check point.series explicitly because Highcharts can destroy point objects, replacing the\n// contents with { destroyed: true }, violating the point's TS contract.\n// See: https://github.com/highcharts/highcharts/issues/23175.\nexport function isPointVisible(point: Highcharts.Point) {\n return point.visible && point.series && point.series.visible;\n}\n\nexport function getSeriesMarkerType(series?: Highcharts.Series): ChartSeriesMarkerType {\n if (!series) {\n return \"large-square\";\n }\n const seriesSymbol = \"symbol\" in series && typeof series.symbol === \"string\" ? series.symbol : \"circle\";\n // In Highcharts, dashStyle supports different types of dashes: https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-dashstyle-all/\n // Return a dashed legend symbol for all of these dashes, excluding the default \"Solid\" option\n if (\"dashStyle\" in series.options && series.options.dashStyle && series.options.dashStyle !== \"Solid\") {\n return \"dashed\";\n }\n switch (series.type) {\n case \"area\":\n case \"areaspline\":\n return \"hollow-square\";\n case \"line\":\n case \"spline\":\n return \"line\";\n case \"scatter\":\n switch (seriesSymbol) {\n case \"square\":\n return \"square\";\n case \"diamond\":\n return \"diamond\";\n case \"triangle\":\n return \"triangle\";\n case \"triangle-down\":\n return \"triangle-down\";\n case \"circle\":\n default:\n return \"circle\";\n }\n case \"column\":\n case \"pie\":\n return \"large-square\";\n case \"bubble\":\n return \"circle\";\n case \"errorbar\":\n default:\n return \"large-square\";\n }\n}\n\n// Highcharts supports color objects to represent gradients and more, but we only support string\n// colors in our markers. In case a non-string color is defined, we use black color as as fallback.\nexport function getSeriesColor(series?: Highcharts.Series): string {\n return typeof series?.color === \"string\" ? series.color : \"black\";\n}\nexport function getPointColor(point?: Highcharts.Point): string {\n return typeof point?.color === \"string\" ? point.color : \"black\";\n}\n\n// The custom legend implementation does not rely on the Highcharts legend. When Highcharts legend is disabled,\n// the chart object does not include information on legend items. Instead, we collect series and pie segments\n// using this custom function, respecting Highcharts' showInLegend flag (defined for series only).\n\n// There exists a Highcharts APIs to access legend items, but it is unfortunately not available, when\n// Highcharts legend is disabled. Instead, we use this custom method to collect legend items from the chart.\nexport function getChartLegendItems({\n chart,\n getItemOptions = () => ({}),\n itemMarkerStatusAriaLabel,\n}: {\n chart: Highcharts.Chart;\n getItemOptions?: CoreChartProps.GetItemOptions;\n itemMarkerStatusAriaLabel?: ChartLabels[\"itemMarkerLabel\"];\n}): readonly LegendItemSpec[] {\n const legendItems: LegendItemSpec[] = [];\n const isInverted = chart.inverted ?? false;\n const addSeriesItem = (series: Highcharts.Series, isSecondary: boolean) => {\n // The pie series is not shown in the legend. Instead, we show pie segments.\n if (series.type === \"pie\") {\n return;\n }\n // We only support errorbar series that are linked to other series. Those are not represented separately\n // in the legend, but can be controlled from the outside, using controllable items visibility API.\n if (series.type === \"errorbar\") {\n return;\n }\n // We respect Highcharts showInLegend option to allow hiding certain series from the legend.\n // The same is not supported for pie chart segments.\n if (series.options.showInLegend !== false) {\n const seriesId = getSeriesId(series);\n const itemProps = getItemOptions(seriesId);\n const status = itemProps.status;\n legendItems.push({\n id: seriesId,\n name: series.name,\n markerType: getSeriesMarkerType(series),\n color: getSeriesColor(series),\n visible: series.visible,\n isSecondary,\n status: status,\n markerAriaLabel: itemMarkerStatusAriaLabel?.(status),\n });\n }\n };\n const addPointItem = (point: Highcharts.Point, isSecondary: boolean) => {\n if (point?.series?.type === \"pie\") {\n const pointId = getPointId(point);\n legendItems.push({\n id: pointId,\n name: point.name,\n markerType: getSeriesMarkerType(point.series),\n color: getPointColor(point),\n visible: point.visible,\n status: getItemOptions(pointId).status,\n isSecondary,\n });\n }\n };\n for (const s of getChartSeries(chart.series)) {\n const valueAxis = isInverted ? s.xAxis : s.yAxis;\n const isSecondary = valueAxis?.options?.opposite ?? false;\n addSeriesItem(s, isSecondary);\n s.data.forEach((p) => addPointItem(p, isSecondary));\n }\n return legendItems;\n}\n\nexport type LegendItemOptions = Highcharts.SeriesOptionsType | Highcharts.PointOptionsType;\n\nexport function getVisibleLegendItems(options: Highcharts.Options) {\n const isInverted = options.chart?.inverted ?? false;\n const valueAxes = (isInverted ? castArray(options.xAxis) : castArray(options.yAxis)) ?? [];\n const defaultOpposite = valueAxes.length > 0 ? (valueAxes[0].opposite ?? false) : false;\n\n const primaryAxis = valueAxes.find((a) => !(a.opposite ?? false));\n const secondaryAxis = valueAxes.find((a) => a.opposite === true);\n\n const primaryItems: LegendItemOptions[] = [];\n const secondaryItems: LegendItemOptions[] = [];\n const addLegendItem = (item: LegendItemOptions) => {\n if (isSecondaryLegendItem(item, isInverted, defaultOpposite, valueAxes)) {\n secondaryItems.push(item);\n } else {\n primaryItems.push(item);\n }\n };\n\n options.series?.forEach((series) => {\n if (!(\"type\" in series)) {\n return;\n }\n\n // The pie series is not shown in the legend. Instead, we show pie segments (points).\n if (series.type === \"pie\") {\n if (Array.isArray(series.data)) {\n series.data.forEach((point) => addLegendItem(point));\n }\n return;\n }\n // We only support errorbar series that are linked to other series. Those are not represented separately\n // in the legend, but can be controlled from the outside, using controllable items visibility API.\n if (series.type === \"errorbar\") {\n return;\n }\n if (series.showInLegend !== false) {\n addLegendItem(series);\n }\n });\n\n return { primaryItems, secondaryItems, primaryAxisId: primaryAxis?.id, secondaryAxisId: secondaryAxis?.id };\n}\n\nfunction isSecondaryLegendItem(\n item: LegendItemOptions,\n isInverted: boolean,\n defaultOpposite: boolean,\n valueAxes: Array<{ id?: string; opposite?: boolean }>,\n): boolean {\n // Only items that have an associated axis can be considered secondary\n if (item && typeof item === \"object\" && (\"xAxis\" in item || \"yAxis\" in item)) {\n const axisRef = isInverted ? (item.xAxis ?? 0) : (item.yAxis ?? 0);\n // An axis reference can be an index into the axes array or an explicitly passed id\n const valueAxis = typeof axisRef === \"number\" ? valueAxes[axisRef] : valueAxes.find((a) => a.id === axisRef);\n return valueAxis?.opposite ?? false;\n }\n return defaultOpposite;\n}\n\nexport function getLegendsProps(\n options: CoreChartProps.ChartOptions,\n legendOptions: CoreChartProps.LegendOptions | undefined,\n) {\n // While Highcharts supports more than two axes, this\n // implementation supports at most two, in which case one\n // of them must be set as opposite (secondary).\n const { primaryItems, secondaryItems, primaryAxisId, secondaryAxisId } = getVisibleLegendItems(options);\n return {\n primary:\n primaryItems.length === 0\n ? undefined\n : ({\n isSecondary: false,\n axisId: primaryAxisId,\n title: legendOptions?.title,\n actions: legendOptions?.actions,\n alignment: legendOptions?.position === \"side\" ? \"vertical\" : \"horizontal\",\n horizontalAlignment: secondaryItems.length === 0 ? legendOptions?.horizontalAlignment : \"start\",\n enableHorizontalScroll: legendOptions?.enableHorizontalScroll,\n } as const),\n secondary:\n secondaryItems.length === 0\n ? undefined\n : ({\n isSecondary: true,\n axisId: secondaryAxisId,\n title: legendOptions?.secondaryLegendTitle,\n actions: legendOptions?.secondaryLegendActions,\n alignment: legendOptions?.position === \"side\" ? \"vertical\" : \"horizontal\",\n horizontalAlignment: \"end\",\n enableHorizontalScroll: legendOptions?.enableHorizontalScroll,\n } as const),\n };\n}\n\n// This function returns coordinates of a rectangle, including the target point.\n// There are differences in how the rectangle is computed, but in all cases it is supposed to\n// enclose the point's visual representation in the chart, with no extra offsets.\nexport function getPointRect(point: Highcharts.Point): Rect {\n if (!point.series) {\n return { x: 0, y: 0, width: 0, height: 0 };\n }\n\n switch (point.series.type) {\n case \"column\":\n return getColumnPointRect(point);\n case \"errorbar\":\n return getErrorBarPointRect(point);\n default:\n return getDefaultPointRect(point);\n }\n}\n\n// The group rect is only used for cartesian charts. It returns coordinates of a rectangle,\n// which includes all given points, but also stretched vertically or horizontally (in inverted charts)\n// to the entire chart's height or width.\nexport function getGroupRect(points: readonly Highcharts.Point[]): Rect {\n if (points.length === 0 || !points[0].series) {\n return { x: 0, y: 0, width: 0, height: 0 };\n }\n const chart = points[0].series.chart;\n const rects = points.map(getPointRect);\n const [first, ...rest] = rects;\n let minX = first.x,\n minY = first.y,\n maxX = first.x + first.width,\n maxY = first.y + first.height;\n for (const r of rest) {\n minX = Math.min(minX, r.x);\n minY = Math.min(minY, r.y);\n maxX = Math.max(maxX, r.x + r.width);\n maxY = Math.max(maxY, r.y + r.height);\n }\n return safeRect(\n chart.inverted\n ? { x: chart.plotLeft, y: minY, width: chart.plotWidth, height: maxY - minY }\n : { x: minX, y: chart.plotTop, width: maxX - minX, height: chart.plotHeight },\n );\n}\n\n// We ensure rect width and height are non-zero to ensure its position is calculated correctly in Firefox.\nexport function safeRect(rect: Rect): Rect {\n return { ...rect, width: Math.max(0.1, rect.width), height: Math.max(0.1, rect.height) };\n}\n\nexport function getChartAccessibleDescription(chart: Highcharts.Chart) {\n return chart.options.lang?.accessibility?.chartContainerLabel ?? \"\";\n}\n\nexport function getPointAccessibleDescription(point: Highcharts.Point, labels: ChartLabels) {\n if (point.series.xAxis && point.series.yAxis) {\n const formattedX = getFormatter(point.series.xAxis)(point.x);\n const formattedY = getFormatter(point.series.yAxis)(point.y);\n return `${formattedX} ${formattedY}, ${point.series.name}`;\n } else if (point.series.type === \"pie\") {\n const segmentLabel = labels.chartSegmentLabel ? `${labels.chartSegmentLabel} ` : \"\";\n return `${segmentLabel}${point.name}, ${point.y}. ${point.series.name}`;\n } else {\n return \"\";\n }\n}\n\nexport function getGroupAccessibleDescription(group: readonly Highcharts.Point[]) {\n const firstPoint = group[0];\n return getFormatter(firstPoint.series.xAxis)(firstPoint.x);\n}\n\n// The area-, line-, or scatter series markers are rendered as single graphic elements,\n// and we can use their respective b-boxes to compute rects.\nfunction getDefaultPointRect(point: Highcharts.Point): Rect {\n const chart = point.series.chart;\n if (point.graphic) {\n const box = point.graphic.getBBox();\n return getChartRect(box, chart, false);\n }\n return getPointRectFromCoordinates(point);\n}\n\n// The column series graphic elements are rectangles, and they are inverted if the chart is inverted,\n// so that rect's width becomes height and vice-versa.\nfunction getColumnPointRect(point: Highcharts.Point): Rect {\n const chart = point.series.chart;\n if (point.graphic) {\n return getChartRect(point.graphic.getBBox(), chart, true);\n }\n return getPointRectFromCoordinates(point);\n}\n\n// The errorbar series point rect cannot be computed from the respective graphic element (it gives wrong position).\n// Instead, we have to rely on the internal \"whiskers\" element b-box, which can be inverted, too.\nfunction getErrorBarPointRect(point: Highcharts.Point): Rect {\n const chart = point.series.chart;\n if (\"whiskers\" in point) {\n return getChartRect((point.whiskers as Highcharts.SVGElement).getBBox(), chart, true);\n }\n return getPointRectFromCoordinates(point);\n}\n\n// The point graphic is not present in large charts to optimize performance.\n// In that case we compute point rects from their coordinates. We also assume the point\n// size is small, and thereby give it 0 width and height, which is alright as there is a\n// small offset that we use for focus outline anyways.\n// See: https://www.highcharts.com/blog/news/175-highcharts-performance-boost/\nfunction getPointRectFromCoordinates(point: Highcharts.Point) {\n const chart = point.series.chart;\n const plotX = point.plotX ?? 0;\n const plotY = point.plotY ?? 0;\n return getChartRect({ x: plotX, y: plotY, width: 0, height: 0 }, chart, true);\n}\n\nfunction getChartRect(rect: Rect, chart: Highcharts.Chart, canBeInverted: boolean): Rect {\n return canBeInverted && chart.inverted\n ? {\n x: chart.plotWidth + chart.plotLeft - (rect.y + rect.height),\n y: chart.plotHeight + chart.plotTop - (rect.x + rect.width),\n width: rect.height,\n height: rect.width,\n }\n : {\n x: chart.plotLeft + rect.x,\n y: chart.plotTop + rect.y,\n width: rect.width,\n height: rect.height,\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AC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;YAC5D,CAAC,EAAE,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC;YAC3D,KAAK,EAAE,IAAI,CAAC,MAAM;YAClB,MAAM,EAAE,IAAI,CAAC,KAAK;SACnB;QACH,CAAC,CAAC;YACE,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;YAC1B,CAAC,EAAE,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;YACzB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC;AACR,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type Highcharts from \"highcharts\";\n\nimport { ChartSeriesMarkerType } from \"../internal/components/series-marker\";\nimport { ChartSeriesMarkerStatus } from \"../internal/components/series-marker/interfaces\";\nimport { getChartSeries } from \"../internal/utils/chart-series\";\nimport { castArray } from \"../internal/utils/utils\";\nimport { getFormatter } from \"./formatters\";\nimport { ChartLabels } from \"./i18n-utils\";\nimport { CoreChartProps, Rect } from \"./interfaces\";\n\nexport interface LegendItemSpec {\n id: string;\n name: string;\n markerType: ChartSeriesMarkerType;\n color: string;\n visible: boolean;\n isSecondary: boolean;\n status?: ChartSeriesMarkerStatus;\n markerAriaLabel?: string;\n}\n\n// The below functions extract unique identifier from series, point, or options. The identifier can be item's ID or name.\n// We expect that items requiring referencing (e.g. in order to control their visibility) have the unique identifier defined.\n// Otherwise, we return a randomized id that is to ensure no accidental matches.\nexport function getSeriesId(series: Highcharts.Series): string {\n return getOptionsId(series.options);\n}\nexport function getPointId(point: Highcharts.Point): string {\n return getOptionsId(point.options);\n}\nexport function getOptionsId(options: { id?: string; name?: string }): string {\n return options.id ?? options.name ?? noIdPlaceholder();\n}\nfunction noIdPlaceholder(): string {\n const rand = (Math.random() * 1_000_000).toFixed(0).padStart(6, \"0\");\n return \"awsui-no-id-placeholder-\" + rand;\n}\n\n// There are more possible values that series.stacking can take, but we only explicitly support \"normal\".\nexport function isSeriesStacked(series: Highcharts.Series) {\n return (series.options as any).stacking === \"normal\";\n}\n\n// The threshold series are custom series, implemented as a combination of line series, and plot lines.\n// As Highcharts does not support custom series declaration, we annotate threshold series by using the\n// series.custom property. This is then used in our utilities to recognize threshold series, and retrieve\n// the associated threshold value.\ninterface ThresholdOptions<T extends \"x-threshold\" | \"y-threshold\"> {\n custom: {\n awsui: {\n type: T;\n threshold: number;\n };\n };\n}\nexport function createThresholdMetadata<T extends \"x-threshold\" | \"y-threshold\">(\n type: T,\n value: number,\n): ThresholdOptions<T> {\n return { custom: { awsui: { type, threshold: value } } };\n}\nexport function isXThreshold(\n s: Highcharts.Series,\n): s is Highcharts.Series & { options: ThresholdOptions<\"x-threshold\"> } {\n return typeof s.options.custom === \"object\" && s.options.custom.awsui?.type === \"x-threshold\";\n}\nexport function isYThreshold(\n s: Highcharts.Series,\n): s is Highcharts.Series & { options: ThresholdOptions<\"y-threshold\"> } {\n return typeof s.options.custom === \"object\" && s.options.custom.awsui?.type === \"y-threshold\";\n}\n\n// We extend bubble series by introducing sizeAxis - which is used to define title and formatter for bubble series size values.\n// In case there are multiple such axes - the bubble series can target a specific one by setting sizeAxis to the respective size\n// axis id. As there is no such prop in Highcharts series type - we pass it using the custom options object.\nexport interface BubbleOptions {\n custom: {\n awsui: {\n sizeAxis?: string;\n };\n };\n}\nexport function createBubbleMetadata(options: { sizeAxis?: string }): BubbleOptions {\n return { custom: { awsui: options } };\n}\nexport function getBubbleSeriesSizeAxis(series: Highcharts.Series): undefined | string {\n const { custom } = series.options as Highcharts.SeriesOptionsType & BubbleOptions;\n return custom?.awsui?.sizeAxis;\n}\n\n// We check point.series explicitly because Highcharts can destroy point objects, replacing the\n// contents with { destroyed: true }, violating the point's TS contract.\n// See: https://github.com/highcharts/highcharts/issues/23175.\nexport function isPointVisible(point: Highcharts.Point) {\n return point.visible && point.series && point.series.visible;\n}\n\nexport function getSeriesMarkerType(series?: Highcharts.Series): ChartSeriesMarkerType {\n if (!series) {\n return \"large-square\";\n }\n const seriesSymbol = \"symbol\" in series && typeof series.symbol === \"string\" ? series.symbol : \"circle\";\n // In Highcharts, dashStyle supports different types of dashes: https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-dashstyle-all/\n // Return a dashed legend symbol for all of these dashes, excluding the default \"Solid\" option\n if (\"dashStyle\" in series.options && series.options.dashStyle && series.options.dashStyle !== \"Solid\") {\n return \"dashed\";\n }\n switch (series.type) {\n case \"area\":\n case \"areaspline\":\n return \"hollow-square\";\n case \"line\":\n case \"spline\":\n return \"line\";\n case \"scatter\":\n switch (seriesSymbol) {\n case \"square\":\n return \"square\";\n case \"diamond\":\n return \"diamond\";\n case \"triangle\":\n return \"triangle\";\n case \"triangle-down\":\n return \"triangle-down\";\n case \"circle\":\n default:\n return \"circle\";\n }\n case \"column\":\n case \"pie\":\n return \"large-square\";\n case \"bubble\":\n return \"circle\";\n case \"errorbar\":\n default:\n return \"large-square\";\n }\n}\n\n// Highcharts supports color objects to represent gradients and more, but we only support string\n// colors in our markers. In case a non-string color is defined, we use black color as as fallback.\nexport function getSeriesColor(series?: Highcharts.Series): string {\n return typeof series?.color === \"string\" ? series.color : \"black\";\n}\nexport function getPointColor(point?: Highcharts.Point): string {\n return typeof point?.color === \"string\" ? point.color : \"black\";\n}\n\n// The custom legend implementation does not rely on the Highcharts legend. When Highcharts legend is disabled,\n// the chart object does not include information on legend items. Instead, we collect series and pie segments\n// using this custom function, respecting Highcharts' showInLegend flag (defined for series only).\n\n// There exists a Highcharts APIs to access legend items, but it is unfortunately not available, when\n// Highcharts legend is disabled. Instead, we use this custom method to collect legend items from the chart.\nexport function getChartLegendItems({\n chart,\n getItemOptions = () => ({}),\n itemMarkerStatusAriaLabel,\n}: {\n chart: Highcharts.Chart;\n getItemOptions?: CoreChartProps.GetItemOptions;\n itemMarkerStatusAriaLabel?: ChartLabels[\"itemMarkerLabel\"];\n}): readonly LegendItemSpec[] {\n const legendItems: LegendItemSpec[] = [];\n const isInverted = chart.inverted ?? false;\n const addSeriesItem = (series: Highcharts.Series, isSecondary: boolean) => {\n // The pie series is not shown in the legend. Instead, we show pie segments.\n if (series.type === \"pie\") {\n return;\n }\n // We only support errorbar series that are linked to other series. Those are not represented separately\n // in the legend, but can be controlled from the outside, using controllable items visibility API.\n if (series.type === \"errorbar\") {\n return;\n }\n // We respect Highcharts showInLegend option to allow hiding certain series from the legend.\n // The same is not supported for pie chart segments.\n if (series.options.showInLegend !== false) {\n const seriesId = getSeriesId(series);\n const itemProps = getItemOptions(seriesId);\n const status = itemProps.status;\n legendItems.push({\n id: seriesId,\n name: series.name,\n markerType: getSeriesMarkerType(series),\n color: getSeriesColor(series),\n visible: series.visible,\n isSecondary,\n status: status,\n markerAriaLabel: itemMarkerStatusAriaLabel?.(status),\n });\n }\n };\n const addPointItem = (point: Highcharts.Point, isSecondary: boolean) => {\n if (point?.series?.type === \"pie\") {\n const pointId = getPointId(point);\n legendItems.push({\n id: pointId,\n name: point.name,\n markerType: getSeriesMarkerType(point.series),\n color: getPointColor(point),\n visible: point.visible,\n status: getItemOptions(pointId).status,\n isSecondary,\n });\n }\n };\n for (const s of getChartSeries(chart.series)) {\n const valueAxis = isInverted ? s.xAxis : s.yAxis;\n const isSecondary = valueAxis?.options?.opposite ?? false;\n addSeriesItem(s, isSecondary);\n s.data.forEach((p) => addPointItem(p, isSecondary));\n }\n return legendItems;\n}\n\nexport type LegendItemOptions = Highcharts.SeriesOptionsType | Highcharts.PointOptionsType;\n\nexport function getVisibleLegendItems(options: Highcharts.Options) {\n const isInverted = options.chart?.inverted ?? false;\n const valueAxes = (isInverted ? castArray(options.xAxis) : castArray(options.yAxis)) ?? [];\n const defaultOpposite = valueAxes.length > 0 ? (valueAxes[0].opposite ?? false) : false;\n\n const primaryAxis = valueAxes.find((a) => !(a.opposite ?? false));\n const secondaryAxis = valueAxes.find((a) => a.opposite === true);\n\n const primaryItems: LegendItemOptions[] = [];\n const secondaryItems: LegendItemOptions[] = [];\n const addLegendItem = (item: LegendItemOptions) => {\n if (isSecondaryLegendItem(item, isInverted, defaultOpposite, valueAxes)) {\n secondaryItems.push(item);\n } else {\n primaryItems.push(item);\n }\n };\n\n options.series?.forEach((series) => {\n if (!(\"type\" in series)) {\n return;\n }\n\n // The pie series is not shown in the legend. Instead, we show pie segments (points).\n if (series.type === \"pie\") {\n if (Array.isArray(series.data)) {\n series.data.forEach((point) => addLegendItem(point));\n }\n return;\n }\n // We only support errorbar series that are linked to other series. Those are not represented separately\n // in the legend, but can be controlled from the outside, using controllable items visibility API.\n if (series.type === \"errorbar\") {\n return;\n }\n if (series.showInLegend !== false) {\n addLegendItem(series);\n }\n });\n\n return { primaryItems, secondaryItems, primaryAxisId: primaryAxis?.id, secondaryAxisId: secondaryAxis?.id };\n}\n\nfunction isSecondaryLegendItem(\n item: LegendItemOptions,\n isInverted: boolean,\n defaultOpposite: boolean,\n valueAxes: Array<{ id?: string; opposite?: boolean }>,\n): boolean {\n // Only items that have an associated axis can be considered secondary\n if (item && typeof item === \"object\" && (\"xAxis\" in item || \"yAxis\" in item)) {\n const axisRef = isInverted ? (item.xAxis ?? 0) : (item.yAxis ?? 0);\n // An axis reference can be an index into the axes array or an explicitly passed id\n const valueAxis = typeof axisRef === \"number\" ? valueAxes[axisRef] : valueAxes.find((a) => a.id === axisRef);\n return valueAxis?.opposite ?? false;\n }\n return defaultOpposite;\n}\n\nexport function getLegendsProps(\n options: CoreChartProps.ChartOptions,\n legendOptions: CoreChartProps.LegendOptions | undefined,\n) {\n // While Highcharts supports more than two axes, this\n // implementation supports at most two, in which case one\n // of them must be set as opposite (secondary).\n const { primaryItems, secondaryItems, primaryAxisId, secondaryAxisId } = getVisibleLegendItems(options);\n return {\n primary:\n primaryItems.length === 0\n ? undefined\n : ({\n isSecondary: false,\n axisId: primaryAxisId,\n title: legendOptions?.title,\n actions: legendOptions?.actions,\n alignment: legendOptions?.position === \"side\" ? \"vertical\" : \"horizontal\",\n horizontalAlignment: secondaryItems.length === 0 ? legendOptions?.horizontalAlignment : \"start\",\n enableHorizontalScroll: legendOptions?.enableHorizontalScroll,\n } as const),\n secondary:\n secondaryItems.length === 0\n ? undefined\n : ({\n isSecondary: true,\n axisId: secondaryAxisId,\n title: legendOptions?.secondaryLegendTitle,\n actions: legendOptions?.secondaryLegendActions,\n alignment: legendOptions?.position === \"side\" ? \"vertical\" : \"horizontal\",\n horizontalAlignment: \"end\",\n enableHorizontalScroll: legendOptions?.enableHorizontalScroll,\n } as const),\n };\n}\n\n// This function returns coordinates of a rectangle, including the target point.\n// There are differences in how the rectangle is computed, but in all cases it is supposed to\n// enclose the point's visual representation in the chart, with no extra offsets.\nexport function getPointRect(point: Highcharts.Point): Rect {\n if (!point.series) {\n return { x: 0, y: 0, width: 0, height: 0 };\n }\n\n switch (point.series.type) {\n case \"column\":\n return getColumnPointRect(point);\n case \"errorbar\":\n return getErrorBarPointRect(point);\n default:\n return getDefaultPointRect(point);\n }\n}\n\n// The group rect is only used for cartesian charts. It returns coordinates of a rectangle,\n// which includes all given points, but also stretched vertically or horizontally (in inverted charts)\n// to the entire chart's height or width.\nexport function getGroupRect(points: readonly Highcharts.Point[]): Rect {\n if (points.length === 0 || !points[0].series) {\n return { x: 0, y: 0, width: 0, height: 0 };\n }\n const chart = points[0].series.chart;\n const rects = points.map(getPointRect);\n const [first, ...rest] = rects;\n let minX = first.x,\n minY = first.y,\n maxX = first.x + first.width,\n maxY = first.y + first.height;\n for (const r of rest) {\n minX = Math.min(minX, r.x);\n minY = Math.min(minY, r.y);\n maxX = Math.max(maxX, r.x + r.width);\n maxY = Math.max(maxY, r.y + r.height);\n }\n return safeRect(\n chart.inverted\n ? { x: chart.plotLeft, y: minY, width: chart.plotWidth, height: maxY - minY }\n : { x: minX, y: chart.plotTop, width: maxX - minX, height: chart.plotHeight },\n );\n}\n\n// We ensure rect width and height are non-zero to ensure its position is calculated correctly in Firefox.\nexport function safeRect(rect: Rect): Rect {\n return { ...rect, width: Math.max(0.1, rect.width), height: Math.max(0.1, rect.height) };\n}\n\nexport function getChartAccessibleDescription(chart: Highcharts.Chart) {\n return chart.options.lang?.accessibility?.chartContainerLabel ?? \"\";\n}\n\nexport function matchSizeAxis(sizeAxis: readonly CoreChartProps.SizeAxisOptions[], series: Highcharts.Series) {\n return sizeAxis.find((a) => a.id === getBubbleSeriesSizeAxis(series)) ?? sizeAxis[0];\n}\n\nexport function getPointAccessibleDescription(\n point: Highcharts.Point,\n labels: ChartLabels,\n additionalProps?: {\n sizeAxis?: readonly CoreChartProps.SizeAxisOptions[];\n },\n) {\n if (point.series.xAxis && point.series.yAxis) {\n const formattedX = getFormatter(point.series.xAxis)(point.x);\n const formattedY = getFormatter(point.series.yAxis)(point.y);\n let formattedSize = \"\";\n if (additionalProps?.sizeAxis && point.series.type === \"bubble\") {\n const matchedSizeAxis = matchSizeAxis(additionalProps.sizeAxis, point.series);\n const size = point.options.z ?? null;\n const sizeFormatter = getFormatter(matchedSizeAxis);\n formattedSize = sizeFormatter(size);\n }\n return `${formattedX} ${formattedY}${formattedSize ? \" \" + formattedSize : \"\"}, ${point.series.name}`;\n } else if (point.series.type === \"pie\") {\n const segmentLabel = labels.chartSegmentLabel ? `${labels.chartSegmentLabel} ` : \"\";\n return `${segmentLabel}${point.name}, ${point.y}. ${point.series.name}`;\n } else {\n return \"\";\n }\n}\n\nexport function getGroupAccessibleDescription(group: readonly Highcharts.Point[]) {\n const firstPoint = group[0];\n return getFormatter(firstPoint.series.xAxis)(firstPoint.x);\n}\n\n// The area-, line-, or scatter series markers are rendered as single graphic elements,\n// and we can use their respective b-boxes to compute rects.\nfunction getDefaultPointRect(point: Highcharts.Point): Rect {\n const chart = point.series.chart;\n if (point.graphic) {\n const box = point.graphic.getBBox();\n return getChartRect(box, chart, false);\n }\n return getPointRectFromCoordinates(point);\n}\n\n// The column series graphic elements are rectangles, and they are inverted if the chart is inverted,\n// so that rect's width becomes height and vice-versa.\nfunction getColumnPointRect(point: Highcharts.Point): Rect {\n const chart = point.series.chart;\n if (point.graphic) {\n return getChartRect(point.graphic.getBBox(), chart, true);\n }\n return getPointRectFromCoordinates(point);\n}\n\n// The errorbar series point rect cannot be computed from the respective graphic element (it gives wrong position).\n// Instead, we have to rely on the internal \"whiskers\" element b-box, which can be inverted, too.\nfunction getErrorBarPointRect(point: Highcharts.Point): Rect {\n const chart = point.series.chart;\n if (\"whiskers\" in point) {\n return getChartRect((point.whiskers as Highcharts.SVGElement).getBBox(), chart, true);\n }\n return getPointRectFromCoordinates(point);\n}\n\n// The point graphic is not present in large charts to optimize performance.\n// In that case we compute point rects from their coordinates. We also assume the point\n// size is small, and thereby give it 0 width and height, which is alright as there is a\n// small offset that we use for focus outline anyways.\n// See: https://www.highcharts.com/blog/news/175-highcharts-performance-boost/\nfunction getPointRectFromCoordinates(point: Highcharts.Point) {\n const chart = point.series.chart;\n const plotX = point.plotX ?? 0;\n const plotY = point.plotY ?? 0;\n return getChartRect({ x: plotX, y: plotY, width: 0, height: 0 }, chart, true);\n}\n\nfunction getChartRect(rect: Rect, chart: Highcharts.Chart, canBeInverted: boolean): Rect {\n return canBeInverted && chart.inverted\n ? {\n x: chart.plotWidth + chart.plotLeft - (rect.y + rect.height),\n y: chart.plotHeight + chart.plotTop - (rect.x + rect.width),\n width: rect.height,\n height: rect.width,\n }\n : {\n x: chart.plotLeft + rect.x,\n y: chart.plotTop + rect.y,\n width: rect.width,\n height: rect.height,\n };\n}\n"]}
|
package/internal/environment.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export var PACKAGE_SOURCE = "chart-components";
|
|
2
|
-
export var PACKAGE_VERSION = "1.0.0 (
|
|
2
|
+
export var PACKAGE_VERSION = "1.0.0 (63438b35)";
|
|
3
3
|
export var THEME = "open-source-visual-refresh";
|
|
4
4
|
export var ALWAYS_VISUAL_REFRESH = true;
|
|
5
5
|
export var SYSTEM = "core";
|
package/internal/manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudscape-design/chart-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.78",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cloudscape-design/chart-components.git"
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"@cloudscape-design/theming-build": "^1",
|
|
44
44
|
"@testing-library/jest-dom": "^5.16.5",
|
|
45
45
|
"@testing-library/react": "^15.0.7",
|
|
46
|
+
"@tony.ganchev/eslint-plugin-header": "^3.3.1",
|
|
46
47
|
"@types/jest-image-snapshot": "^6.1.0",
|
|
47
48
|
"@types/lodash": "^4.17.16",
|
|
48
49
|
"@types/node": "^18.19.4",
|
|
@@ -58,7 +59,6 @@
|
|
|
58
59
|
"delay-cli": "^2.0.0",
|
|
59
60
|
"eslint": "^8.57.0",
|
|
60
61
|
"eslint-config-prettier": "^9.1.0",
|
|
61
|
-
"eslint-plugin-header": "^3.1.1",
|
|
62
62
|
"eslint-plugin-import": "^2.26.0",
|
|
63
63
|
"eslint-plugin-no-unsanitized": "^4.0.2",
|
|
64
64
|
"eslint-plugin-prettier": "^5.1.3",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"stylelint-config-recommended-scss": "^14.1.0",
|
|
86
86
|
"stylelint-prettier": "^5.0.2",
|
|
87
87
|
"typescript": "^5.9.2",
|
|
88
|
-
"vite": "^6.4.
|
|
88
|
+
"vite": "^6.4.2",
|
|
89
89
|
"vitest": "^3.0.7"
|
|
90
90
|
},
|
|
91
91
|
"//": "ensure that typedoc uses latest typescript. It prints a warning, but works",
|