@cloudscape-design/chart-components 1.0.158 → 1.0.159

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.
@@ -48,12 +48,13 @@ function computeDerivedState(chart) {
48
48
  for (const s of getChartSeries(chart)) {
49
49
  const seriesPoints = new Array();
50
50
  if (s.visible) {
51
+ const isWithinXExtremes = getXExtremesFilter(s);
51
52
  for (const d of getSeriesData(s)) {
52
53
  // Points with y=null represent the absence of value, there is no need to include them and those
53
54
  // should have no impact on computed rects or navigation.
54
55
  // Although "d" can't be undefined according to Highcharts API, it does become undefined for chart containing more datapoints
55
56
  // than the cropThreshold for that series (specific cases of re-rendering the chart with updated options listening to setExteme updates)
56
- if (d.visible && d.y !== null) {
57
+ if (d.visible && d.y !== null && isWithinXExtremes(d.x)) {
57
58
  seriesPoints.push(d);
58
59
  allXSet.add(d.x);
59
60
  addPoint(d);
@@ -91,6 +92,17 @@ function computeDerivedState(chart) {
91
92
  })),
92
93
  };
93
94
  }
95
+ // Highcharts only crops series points to the x extremes once a series exceeds its cropThreshold, so smaller
96
+ // series keep points that are off screen. Navigation and the tooltip must not reach those points.
97
+ function getXExtremesFilter(series) {
98
+ var _a;
99
+ const extremes = (_a = series.xAxis) === null || _a === void 0 ? void 0 : _a.getExtremes();
100
+ if (!extremes) {
101
+ return () => true;
102
+ }
103
+ const { min, max } = extremes;
104
+ return (x) => (typeof min !== "number" || x >= min) && (typeof max !== "number" || x <= max);
105
+ }
94
106
  // The points are sorted to ensure consistent navigation, including inverted chart orientation.
95
107
  // The order of series in grouped column charts is kept, while stacked series are sorted by their
96
108
  // respective positions in the plot.
@@ -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,aAAa,EAAyB,MAAM,iCAAiC,CAAC;AAGvG,OAA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E,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;SAClC,CAAC,CAAC;KACJ,CAAC;AACJ,CAAC;AAED,+FAA+F;AAC/F,iGAAiG;AACjG,oCAAoC;AACpC,SAAS,UAAU,CAAC,KAAyB;;IAC3C,MAAM,QAAQ,GAAG,CAAC,CAAC,CAAA,MAAA,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, getSeriesData, SafeChart, SafeSeries } from \"../../internal/utils/highcharts\";\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 | SafeChart;\n chart: () => SafeChart;\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: SafeSeries) => 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: SafeChart) {\n context.chart = () => chart;\n context.chartOrNull = chart;\n context.derived = computeDerivedState(chart);\n}\n\nfunction computeDerivedState(chart: SafeChart): ChartExtraContext.DerivedState {\n const allXSet = new Set<number>();\n const allPointsInSeries = new WeakMap<SafeSeries, Highcharts.Point[]>();\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)) {\n const seriesPoints = new Array<Highcharts.Point>();\n if (s.visible) {\n for (const d of getSeriesData(s)) {\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 seriesPoints.push(d);\n allXSet.add(d.x);\n addPoint(d);\n }\n }\n }\n allPointsInSeries.set(s, seriesPoints);\n }\n for (const [, points] of pointsByX) {\n sortPoints(points);\n }\n const allX = Array.from(allXSet).sort(compareX);\n\n const seriesPointsMap = new WeakMap<SafeSeries, Highcharts.Point[]>();\n for (const s of getChartSeries(chart)) {\n const allSeriesPoints = (allPointsInSeries.get(s) ?? []).sort(({ x: x1 }, { x: x2 }) => compareX(x1, x2));\n const usedXSet = new Set<number>();\n const navigableSeriesPoints = new Array<Highcharts.Point>();\n for (const point of allSeriesPoints) {\n if (!usedXSet.has(point.x)) {\n navigableSeriesPoints.push(point);\n usedXSet.add(point.x); // We ignore points that share X coordinate.\n }\n }\n seriesPointsMap.set(s, navigableSeriesPoints);\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,aAAa,EAAyB,MAAM,iCAAiC,CAAC;AAGvG,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,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CAAC,CAAC,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;AAC/F,CAAC;AAED,+FAA+F;AAC/F,iGAAiG;AACjG,oCAAoC;AACpC,SAAS,UAAU,CAAC,KAAyB;;IAC3C,MAAM,QAAQ,GAAG,CAAC,CAAC,CAAA,MAAA,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, getSeriesData, SafeChart, SafeSeries } from \"../../internal/utils/highcharts\";\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 | SafeChart;\n chart: () => SafeChart;\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: SafeSeries) => 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: SafeChart) {\n context.chart = () => chart;\n context.chartOrNull = chart;\n context.derived = computeDerivedState(chart);\n}\n\nfunction computeDerivedState(chart: SafeChart): ChartExtraContext.DerivedState {\n const allXSet = new Set<number>();\n const allPointsInSeries = new WeakMap<SafeSeries, Highcharts.Point[]>();\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)) {\n const seriesPoints = new Array<Highcharts.Point>();\n if (s.visible) {\n const isWithinXExtremes = getXExtremesFilter(s);\n for (const d of getSeriesData(s)) {\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 && isWithinXExtremes(d.x)) {\n seriesPoints.push(d);\n allXSet.add(d.x);\n addPoint(d);\n }\n }\n }\n allPointsInSeries.set(s, seriesPoints);\n }\n for (const [, points] of pointsByX) {\n sortPoints(points);\n }\n const allX = Array.from(allXSet).sort(compareX);\n\n const seriesPointsMap = new WeakMap<SafeSeries, Highcharts.Point[]>();\n for (const s of getChartSeries(chart)) {\n const allSeriesPoints = (allPointsInSeries.get(s) ?? []).sort(({ x: x1 }, { x: x2 }) => compareX(x1, x2));\n const usedXSet = new Set<number>();\n const navigableSeriesPoints = new Array<Highcharts.Point>();\n for (const point of allSeriesPoints) {\n if (!usedXSet.has(point.x)) {\n navigableSeriesPoints.push(point);\n usedXSet.add(point.x); // We ignore points that share X coordinate.\n }\n }\n seriesPointsMap.set(s, navigableSeriesPoints);\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// Highcharts only crops series points to the x extremes once a series exceeds its cropThreshold, so smaller\n// series keep points that are off screen. Navigation and the tooltip must not reach those points.\nfunction getXExtremesFilter(series: SafeSeries): (x: number) => boolean {\n const extremes = series.xAxis?.getExtremes();\n if (!extremes) {\n return () => true;\n }\n const { min, max } = extremes;\n return (x) => (typeof min !== \"number\" || x >= min) && (typeof max !== \"number\" || x <= max);\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"]}
@@ -68,6 +68,7 @@ export declare class ChartExtraNavigation {
68
68
  private get allX();
69
69
  private getSeriesPoints;
70
70
  private getPointsByX;
71
+ private isNavigable;
71
72
  private findMatchingGroup;
72
73
  private findFirstGroup;
73
74
  private findLastGroup;
@@ -152,6 +152,9 @@ export class ChartExtraNavigation {
152
152
  this.getPointsByX = (x) => {
153
153
  return this.context.derived.getPointsByX(x);
154
154
  };
155
+ this.isNavigable = (point) => {
156
+ return this.getPointsByX(point.x).includes(point);
157
+ };
155
158
  this.findMatchingGroup = (point) => {
156
159
  return this.getPointsByX(point.x);
157
160
  };
@@ -384,9 +387,9 @@ export class ChartExtraNavigation {
384
387
  focusGroup(group) {
385
388
  var _a;
386
389
  // When the chart is re-focused, the group that was focused before might no longer be valid if its
387
- // points are no longer visible or were destroyed by Highcharts. In that case we focus the chart as
388
- // a fallback.
389
- const visiblePoints = group.filter(isPointVisible);
390
+ // points are no longer visible, are outside the x-axis extremes, or were destroyed by Highcharts. In that
391
+ // case we focus the chart as a fallback.
392
+ const visiblePoints = group.filter((point) => isPointVisible(point) && this.isNavigable(point));
390
393
  if (visiblePoints.length === 0) {
391
394
  this.focusChart();
392
395
  }
@@ -404,8 +407,9 @@ export class ChartExtraNavigation {
404
407
  }
405
408
  focusPoint(point, group) {
406
409
  // When the chart is re-focused, the point that was focused before might no longer be valid it became
407
- // hidden or was destroyed by Highcharts. In that case we focus the point's parent group as a fallback.
408
- if (!point || !isPointVisible(point)) {
410
+ // hidden, moved outside the x-axis extremes, or was destroyed by Highcharts. In that case we focus the
411
+ // point's parent group as a fallback.
412
+ if (!point || !isPointVisible(point) || !this.isNavigable(point)) {
409
413
  this.focusGroup(group);
410
414
  }
411
415
  // When focusing a point we draw the focus outline around its corresponding rect, but with different offsets,
@@ -1 +1 @@
1
- {"version":3,"file":"chart-extra-navigation.js","sourceRoot":"","sources":["../../../../src/core/chart-api/chart-extra-navigation.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAItC,OAAO,EACL,WAAW,EACX,QAAQ,EACR,SAAS,IAAI,gBAAgB,EAC7B,OAAO,GACR,MAAM,+CAA+C,CAAC;AAEvD,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,cAAc,EAAc,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEtE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGpE,0FAA0F;AAC1F,qEAAqE;AACr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AO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,GAAG,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC;AACvH,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 {\n circleIndex,\n getIsRtl,\n handleKey as toolkitHandleKey,\n KeyCode,\n} from \"@cloudscape-design/component-toolkit/internal\";\n\nimport * as Styles from \"../../internal/chart-styles\";\nimport { isPointVisible, SafeSeries } from \"../../internal/utils/highcharts\";\nimport { SVGRendererPool } from \"../../internal/utils/renderer-utils\";\nimport { Rect } from \"../interfaces\";\nimport { getGroupRect, getPointRect, isXThreshold } from \"../utils\";\nimport { ChartExtraContext } from \"./chart-extra-context\";\n\n// In charts with many data points one can navigate faster by using Page Down/Up keys that\n// navigate PAGE_SIZE_PERCENTAGE of the points forwards or backwards.\nconst PAGE_SIZE_PERCENTAGE = 0.05;\n\nexport interface ChartExtraNavigationHandlers {\n onFocusChart(): void;\n onFocusPoint(point: Highcharts.Point, group: readonly Highcharts.Point[]): void;\n onFocusGroup(group: readonly Highcharts.Point[]): void;\n onBlur(): void;\n onActivatePoint(point: Highcharts.Point, group: readonly Highcharts.Point[]): void;\n onActivateGroup(group: readonly Highcharts.Point[]): void;\n // Returns true if a tooltip was dismissed, false otherwise.\n // Used by ESC handlers to decide whether to also navigate.\n onDismissHoverTooltip(): boolean;\n}\n\nexport type FocusedState = FocusedStateChart | FocusedStateGroup | FocusedStatePoint;\n\ninterface FocusedStateChart {\n type: \"chart\";\n}\ninterface FocusedStateGroup {\n type: \"group\";\n group: readonly Highcharts.Point[];\n}\ninterface FocusedStatePoint {\n type: \"point\";\n point: Highcharts.Point;\n group: readonly Highcharts.Point[];\n}\n\n// Navigation controller handles focus behavior and keyboard navigation for all charts.\n// When the chart is first focused, the focus lands on the chart plot. Once navigation is engaged,\n// the focus can land either on the group of points matched by X value, or on a specific point.\n// The focused X value and point are stored so that navigating back to the chart will focus the previously\n// focused point. If the stored point no longer belongs to the chart the focus falls back to the chart plot.\nexport class ChartExtraNavigation {\n private context: ChartExtraContext;\n private handlers: ChartExtraNavigationHandlers;\n private focusOutline: FocusOutline;\n // The application element is a dom element with role=\"application\", rendered right before the chart plot.\n // When the application element is in focus, the keyboard navigation is possible. Upon using navigation commands,\n // we bring the visible focus state to the chart elements, such as points and groups of points. The last visible\n // focus state is persisted.\n private applicationElement: null | HTMLElement = null;\n private focusedState: null | FocusedState = null;\n private ignoreFocus = false;\n\n constructor(context: ChartExtraContext, handlers: ChartExtraNavigationHandlers) {\n this.context = context;\n this.handlers = handlers;\n this.focusOutline = new FocusOutline(context);\n }\n\n public onChartDestroy() {\n this.focusOutline.destroy();\n }\n\n // This function is used as React ref on the application element, positioned right before the chart plot in the DOM.\n // Once the element reference is obtained, we assign the required event listeners directly to the element.\n // That is done for simplicity to avoid passing React event handlers down to the element.\n public setApplication = (element: null | HTMLElement) => {\n if (this.applicationElement) {\n this.applicationElement.removeEventListener(\"focus\", this.onFocus);\n this.applicationElement.removeEventListener(\"blur\", this.onBlur);\n this.applicationElement.removeEventListener(\"keydown\", this.onKeyDown);\n }\n\n if (this.context.settings.keyboardNavigationEnabled || !element) {\n this.applicationElement = element;\n }\n\n if (this.applicationElement) {\n this.applicationElement.addEventListener(\"focus\", this.onFocus);\n this.applicationElement.addEventListener(\"blur\", this.onBlur);\n this.applicationElement.addEventListener(\"keydown\", this.onKeyDown);\n }\n };\n\n // Casting focus to the application element brings the visible focus state to the chart or last focused\n // chart point or group of points. This is used to restore focus after the tooltip is dismissed.\n public focusApplication(point: null | Highcharts.Point, group: readonly Highcharts.Point[]) {\n if (this.context.settings.keyboardNavigationEnabled) {\n this.focusedState = point ? { type: \"point\", point, group } : { type: \"group\", group };\n this.applicationElement?.focus();\n }\n }\n\n public announceChart(ariaLabel: string) {\n this.announce({ role: \"application\", \"aria-label\": ariaLabel });\n }\n\n public announceElement(ariaLabel: string, pinned: boolean) {\n this.announce({ role: \"button\", \"aria-label\": ariaLabel, \"aria-haspopup\": true, \"aria-expanded\": pinned });\n }\n\n // Every time the chart focus is obtained or a navigation action is performed, this needs to be announced\n // to screen-readers. The announcement is made by updating the application element with the attributes of\n // the visually focused element (chart, point, or group), and re-focusing it.\n private announce(elementAttributes: React.ButtonHTMLAttributes<unknown>) {\n if (this.applicationElement) {\n // Remove prev attributes.\n for (const attributeName of this.applicationElement.getAttributeNames()) {\n if (attributeName === \"role\" || attributeName.slice(0, 4) === \"aria\") {\n this.applicationElement.removeAttribute(attributeName);\n }\n }\n // Copy new attributes.\n for (const [attributeName, attributeValue] of Object.entries(elementAttributes)) {\n this.applicationElement.setAttribute(attributeName, `${attributeValue}`);\n }\n // Temporarily disable focus/blur event handlers to not respond to the next programmatically\n // cast focus event, which has the only purpose of making the application element announced to\n // the assistive software.\n this.ignoreFocus = true;\n // Re-attach and re-focus application element to trigger a screen-reader announcement.\n const container = this.applicationElement.parentElement!;\n container.removeChild(this.applicationElement);\n container.appendChild(this.applicationElement);\n this.applicationElement.focus({ preventScroll: true });\n // Remove focus lock. The blur and focus events should have already occurred at this point.\n setTimeout(() => (this.ignoreFocus = false), 0);\n }\n }\n\n // Upon obtaining focus, we show the visible focus state and announce the previously focused element\n // (chart, point, or group). If the previously focused point or group is no longer available, the focus\n // is shown for their respective parent.\n private onFocus = () => {\n if (!this.ignoreFocus) {\n if (!this.focusedState || this.focusedState.type === \"chart\") {\n this.focusChart();\n } else if (this.focusedState.type === \"group\") {\n this.focusGroup(this.focusedState.group);\n } else {\n this.focusPoint(this.focusedState.point, this.focusedState.group);\n }\n }\n };\n\n private onBlur = () => {\n if (!this.ignoreFocus) {\n this.focusOutline.hide();\n this.handlers.onBlur();\n }\n };\n\n private onKeyDown = (event: KeyboardEvent) => {\n // The `handleKey` helper we use does not prevent the default keys behavior, so we do it here for\n // all used keyboard commands. We also stop propagation to prevent the global escape handler in\n // chart-core.tsx from interfering with navigation - when keyboard navigation is active, this\n // handler is the authoritative one for all navigation keys.\n if (\n [\n KeyCode.up,\n KeyCode.down,\n KeyCode.left,\n KeyCode.right,\n KeyCode.enter,\n KeyCode.escape,\n KeyCode.pageUp,\n KeyCode.pageDown,\n KeyCode.home,\n KeyCode.end,\n ].includes(event.keyCode)\n ) {\n event.preventDefault();\n event.stopPropagation();\n }\n // We execute different actions depending on the current focus target (chart, group, or point).\n // It is expected, that the focused element is still available in the chart.\n if (this.focusedState && this.focusedState.type === \"group\") {\n this.onKeyDownGroup(event, this.focusedState.group);\n } else if (this.focusedState && this.focusedState.type === \"point\") {\n this.onKeyDownPoint(event, this.focusedState.point, this.focusedState.group);\n } else {\n this.onKeyDownChart(event);\n }\n };\n\n private onKeyDownChart = (event: KeyboardEvent) => {\n handleKey(event, {\n onActivate: () => this.moveToFirstGroup(),\n onEscape: () => this.handlers.onDismissHoverTooltip(),\n onInlineStart: () => this.moveToLastGroup(),\n onInlineEnd: () => this.moveToFirstGroup(),\n onBlockStart: () => this.moveToLastGroup(),\n onBlockEnd: () => this.moveToFirstGroup(),\n onHome: () => this.moveToFirstGroup(),\n onEnd: () => this.moveToLastGroup(),\n });\n };\n\n private onKeyDownGroup = (event: KeyboardEvent, group: readonly Highcharts.Point[]) => {\n const i = !!this.context.chart().inverted;\n handleKey(event, {\n onActivate: () => this.activateGroup(group),\n onEscape: () => {\n if (!this.handlers.onDismissHoverTooltip()) {\n this.moveToChart();\n }\n },\n onInlineStart: () => (i ? this.moveToFirstInGroup(group) : this.moveToPrevGroup(group)),\n onInlineEnd: () => (i ? this.moveToLastInGroup(group) : this.moveToNextGroup(group)),\n onBlockStart: () => (i ? this.moveToPrevGroup(group) : this.moveToLastInGroup(group)),\n onBlockEnd: () => (i ? this.moveToNextGroup(group) : this.moveToFirstInGroup(group)),\n onPageDown: () => this.moveToNextPageGroup(group),\n onPageUp: () => this.moveToPrevPageGroup(group),\n onHome: () => this.moveToFirstGroup(),\n onEnd: () => this.moveToLastGroup(),\n });\n };\n\n private onKeyDownPoint = (event: KeyboardEvent, point: Highcharts.Point, group: readonly Highcharts.Point[]) => {\n const i = !!this.context.chart().inverted;\n handleKey(event, {\n onActivate: () => this.activatePoint(point, group),\n onEscape: () => {\n if (!this.handlers.onDismissHoverTooltip()) {\n this.moveToParentGroup(point);\n }\n },\n onInlineEnd: () => (i ? this.moveToPrevInGroup(point) : this.moveToNextInSeries(point)),\n onInlineStart: () => (i ? this.moveToNextInGroup(point) : this.moveToPrevInSeries(point)),\n onBlockEnd: () => (i ? this.moveToNextInSeries(point) : this.moveToNextInGroup(point)),\n onBlockStart: () => (i ? this.moveToPrevInSeries(point) : this.moveToPrevInGroup(point)),\n onPageDown: () => this.moveToNextPageInSeries(point),\n onPageUp: () => this.moveToPrevPageInSeries(point),\n onHome: () => this.moveToFirstInSeries(point),\n onEnd: () => this.moveToLastInSeries(point),\n });\n };\n\n private moveToFirstGroup() {\n this.focusGroup(this.findFirstGroup());\n }\n\n private moveToLastGroup() {\n this.focusGroup(this.findLastGroup());\n }\n\n private moveToNextGroup(group: readonly Highcharts.Point[]) {\n const nextGroup = group[0] ? this.findNextGroup(group[0]) : [];\n this.focusGroup(nextGroup);\n }\n\n private moveToPrevGroup(group: readonly Highcharts.Point[]) {\n const prevGroup = group[0] ? this.findPrevGroup(group[0]) : [];\n this.focusGroup(prevGroup);\n }\n\n private moveToParentGroup(point: Highcharts.Point) {\n const group = this.findMatchingGroup(point);\n if (group.length > 0 && group[0].series.type !== \"pie\") {\n this.focusGroup(group);\n } else {\n this.focusChart();\n }\n }\n\n private moveToChart() {\n this.focusChart();\n }\n\n private moveToFirstInGroup(group: readonly Highcharts.Point[]) {\n const points = group.filter((p) => !isXThreshold(p.series));\n this.focusPoint(points[0], group);\n }\n\n private moveToLastInGroup(group: readonly Highcharts.Point[]) {\n const points = group.filter((p) => !isXThreshold(p.series));\n this.focusPoint(points[points.length - 1], group);\n }\n\n private moveToPrevInGroup(point: Highcharts.Point) {\n const points = this.findMatchingGroup(point).filter((p) => !isXThreshold(p.series));\n const pointIndex = points.indexOf(point);\n this.focusPoint(points[circleIndex(pointIndex - 1, [0, points.length - 1])], points);\n }\n\n private moveToNextInGroup(point: Highcharts.Point) {\n const points = this.findMatchingGroup(point).filter((p) => !isXThreshold(p.series));\n const pointIndex = points.indexOf(point);\n this.focusPoint(points[circleIndex(pointIndex + 1, [0, points.length - 1])], points);\n }\n\n private moveToFirstInSeries(point: Highcharts.Point) {\n const firstPoint = this.findFirstPointInSeries(point);\n if (firstPoint) {\n this.focusPoint(firstPoint, this.findMatchingGroup(firstPoint));\n } else {\n this.focusChart();\n }\n }\n\n private moveToLastInSeries(point: Highcharts.Point) {\n const lastPoint = this.findLastPointInSeries(point);\n if (lastPoint) {\n this.focusPoint(lastPoint, this.findMatchingGroup(lastPoint));\n } else {\n this.focusChart();\n }\n }\n\n private moveToNextInSeries(point: Highcharts.Point) {\n const nextPoint = this.findNextPointInSeries(point);\n if (nextPoint) {\n this.focusPoint(nextPoint, this.findMatchingGroup(nextPoint));\n } else {\n this.focusChart();\n }\n }\n\n private moveToPrevInSeries(point: Highcharts.Point) {\n const prevPoint = this.findPrevPointInSeries(point);\n if (prevPoint) {\n this.focusPoint(prevPoint, this.findMatchingGroup(prevPoint));\n } else {\n this.focusChart();\n }\n }\n\n private moveToNextPageGroup(group: readonly Highcharts.Point[]) {\n const nextPageGroup = group[0] ? this.findNextPageGroup(group[0]) : [];\n this.focusGroup(nextPageGroup);\n }\n\n private moveToPrevPageGroup(group: readonly Highcharts.Point[]) {\n const prevPageGroup = group[0] ? this.findPrevPageGroup(group[0]) : [];\n this.focusGroup(prevPageGroup);\n }\n\n private moveToNextPageInSeries(point: Highcharts.Point) {\n const nextPagePoint = this.findNextPagePointInSeries(point);\n if (nextPagePoint) {\n this.focusPoint(nextPagePoint, this.findMatchingGroup(nextPagePoint));\n } else {\n this.focusChart();\n }\n }\n\n private moveToPrevPageInSeries(point: Highcharts.Point) {\n const prevPagePoint = this.findPrevPagePointInSeries(point);\n if (prevPagePoint) {\n this.focusPoint(prevPagePoint, this.findMatchingGroup(prevPagePoint));\n } else {\n this.focusChart();\n }\n }\n\n private activateGroup(group: readonly Highcharts.Point[]) {\n this.handlers.onActivateGroup(group);\n }\n\n private activatePoint(point: Highcharts.Point, group: readonly Highcharts.Point[]) {\n this.handlers.onActivatePoint(point, group);\n }\n\n private focusChart = () => {\n this.focusedState = { type: \"chart\" };\n this.focusOutline.chart();\n this.handlers.onFocusChart();\n };\n\n private focusGroup(group: readonly Highcharts.Point[]) {\n // When the chart is re-focused, the group that was focused before might no longer be valid if its\n // points are no longer visible or were destroyed by Highcharts. In that case we focus the chart as\n // a fallback.\n const visiblePoints = group.filter(isPointVisible);\n if (visiblePoints.length === 0) {\n this.focusChart();\n }\n // In pie charts we only focus points, so moving focus to points and groups is equivalent.\n else if (visiblePoints[0].series.type === \"pie\") {\n this.focusPoint(visiblePoints[0] ?? null, group);\n }\n // When focusing a group we draw the focus outline around the corresponding group rect, including\n // all points of that group.\n else {\n this.focusedState = { type: \"group\", group: visiblePoints };\n this.focusOutline.group(getGroupRect(visiblePoints));\n this.handlers.onFocusGroup(visiblePoints);\n }\n }\n\n private focusPoint(point: null | Highcharts.Point, group: readonly Highcharts.Point[]) {\n // When the chart is re-focused, the point that was focused before might no longer be valid it became\n // hidden or was destroyed by Highcharts. In that case we focus the point's parent group as a fallback.\n if (!point || !isPointVisible(point)) {\n this.focusGroup(group);\n }\n // When focusing a point we draw the focus outline around its corresponding rect, but with different offsets,\n // depending on the point's series type.\n else {\n this.focusedState = { type: \"point\", point, group };\n this.focusOutline.point(getPointRect(point), point);\n this.handlers.onFocusPoint(point, group);\n }\n }\n\n private get allX(): number[] {\n return this.context.derived.allX;\n }\n\n // Returns all series data points to navigate by. When a series is linked with other series - the method returns\n // all points from the linked series.\n private getSeriesPoints(series: SafeSeries): Highcharts.Point[] {\n return this.context.derived.getSeriesPoints(series);\n }\n\n private getPointsByX = (x: number): Highcharts.Point[] => {\n return this.context.derived.getPointsByX(x);\n };\n\n private findMatchingGroup = (point: Highcharts.Point): Highcharts.Point[] => {\n return this.getPointsByX(point.x);\n };\n\n private findFirstGroup = (): Highcharts.Point[] => {\n return this.getPointsByX(this.allX[0]);\n };\n\n private findLastGroup = (): Highcharts.Point[] => {\n return this.getPointsByX(this.allX[this.allX.length - 1]);\n };\n\n private findNextGroup = (point: Highcharts.Point): Highcharts.Point[] => {\n const nextIndex = getNextIndex(this.allX, this.allX.indexOf(point.x), 1);\n return this.getPointsByX(this.allX[nextIndex]);\n };\n\n private findPrevGroup = (point: Highcharts.Point): Highcharts.Point[] => {\n const nextIndex = getNextIndex(this.allX, this.allX.indexOf(point.x), -1);\n return this.getPointsByX(this.allX[nextIndex]);\n };\n\n private findNextPageGroup = (point: Highcharts.Point): Highcharts.Point[] => {\n const nextIndex = getNextPageIndex(this.allX, this.allX.indexOf(point.x), 1);\n return this.getPointsByX(this.allX[nextIndex]);\n };\n\n private findPrevPageGroup = (point: Highcharts.Point): Highcharts.Point[] => {\n const nextIndex = getNextPageIndex(this.allX, this.allX.indexOf(point.x), -1);\n return this.getPointsByX(this.allX[nextIndex]);\n };\n\n private findFirstPointInSeries = (point: Highcharts.Point): null | Highcharts.Point => {\n const seriesPoints = this.getSeriesPoints(point.series);\n return seriesPoints[0] ?? null;\n };\n\n private findLastPointInSeries = (point: Highcharts.Point): null | Highcharts.Point => {\n const seriesPoints = this.getSeriesPoints(point.series);\n return seriesPoints[seriesPoints.length - 1] ?? null;\n };\n\n private findNextPointInSeries = (point: Highcharts.Point): null | Highcharts.Point => {\n const seriesPoints = this.getSeriesPoints(point.series);\n const delta = !shouldInvertPointsDirection(point) ? 1 : -1;\n const pointIndex = seriesPoints.indexOf(point);\n const nextIndex = getNextIndex(seriesPoints, pointIndex, delta);\n return seriesPoints[nextIndex] ?? null;\n };\n\n private findPrevPointInSeries = (point: Highcharts.Point): null | Highcharts.Point => {\n const seriesPoints = this.getSeriesPoints(point.series);\n const delta = !shouldInvertPointsDirection(point) ? -1 : 1;\n const pointIndex = seriesPoints.indexOf(point);\n const nextIndex = getNextIndex(seriesPoints, pointIndex, delta);\n return seriesPoints[nextIndex] ?? null;\n };\n\n private findNextPagePointInSeries = (point: Highcharts.Point): null | Highcharts.Point => {\n const seriesPoints = this.getSeriesPoints(point.series);\n const delta = !shouldInvertPointsDirection(point) ? 1 : -1;\n const pointIndex = seriesPoints.indexOf(point);\n const nextIndex = getNextPageIndex(seriesPoints, pointIndex, delta);\n return seriesPoints[nextIndex] ?? null;\n };\n\n private findPrevPagePointInSeries = (point: Highcharts.Point): null | Highcharts.Point => {\n const seriesPoints = this.getSeriesPoints(point.series);\n const delta = !shouldInvertPointsDirection(point) ? -1 : 1;\n const pointIndex = seriesPoints.indexOf(point);\n const nextIndex = getNextPageIndex(seriesPoints, pointIndex, delta);\n return seriesPoints[nextIndex] ?? null;\n };\n}\n\nfunction handleKey(\n event: KeyboardEvent,\n handlers: {\n onActivate?: () => void;\n onBlockEnd?: () => void;\n onBlockStart?: () => void;\n onDefault?: () => void;\n onEnd?: () => void;\n onEscape?: () => void;\n onHome?: () => void;\n onInlineEnd?: () => void;\n onInlineStart?: () => void;\n onPageDown?: () => void;\n onPageUp?: () => void;\n },\n) {\n if (!event.currentTarget) {\n return;\n }\n if (!(event.currentTarget instanceof HTMLElement) && !(event.currentTarget instanceof SVGElement)) {\n return;\n }\n toolkitHandleKey({ keyCode: event.keyCode, currentTarget: event.currentTarget }, handlers);\n}\n\n// A helper class to draw the focus outline around given chart elements.\nclass FocusOutline {\n private context: ChartExtraContext;\n private elementsPool = new SVGRendererPool();\n\n constructor(context: ChartExtraContext) {\n this.context = context;\n }\n\n public chart = () => {\n const [x, y, width, height] = [\n this.context.chart().plotLeft,\n this.context.chart().plotTop,\n this.context.chart().plotWidth,\n this.context.chart().plotHeight,\n ];\n this.rect({ x, y, width, height }, Styles.focusOutlineOffsets.chart);\n };\n\n public group = (rect: Rect) => {\n this.rect(rect, Styles.focusOutlineOffsets.group);\n };\n\n public point = (rect: Rect, point: Highcharts.Point) => {\n const offsetByType = Styles.focusOutlineOffsets.pointByType[point.series.type];\n const offset = offsetByType ?? Styles.focusOutlineOffsets.point;\n this.rect(rect, offset);\n };\n\n public hide() {\n this.elementsPool.hideAll();\n }\n\n public destroy() {\n this.elementsPool.destroyAll();\n }\n\n private rect = ({ x, y, width, height }: Rect, offset: number) => {\n this.elementsPool.hideAll();\n this.elementsPool.rect(this.context.chart().renderer, {\n x: x - offset,\n y: y - offset,\n width: width + offset * 2,\n height: height + offset * 2,\n ...Styles.navigationFocusOutline,\n });\n };\n}\n\n// We do not invert the direction of pie segments when RTL, but swap the left/right keys.\n// To offset for that, the prev/next points direction is swapped, too.\nfunction shouldInvertPointsDirection(point: Highcharts.Point) {\n const isRTL = getIsRtl(point.series.chart.container.parentElement);\n return point.series.type === \"pie\" && isRTL;\n}\n\nfunction getNextIndex(array: unknown[], pointIndex: number, delta: -1 | 1): number {\n return circleIndex(pointIndex + delta, [0, array.length - 1]);\n}\n\nfunction getNextPageIndex(array: unknown[], pointIndex: number, delta: -1 | 1): number {\n return Math.min(array.length - 1, Math.max(0, pointIndex + delta * Math.round(array.length * PAGE_SIZE_PERCENTAGE)));\n}\n"]}
1
+ {"version":3,"file":"chart-extra-navigation.js","sourceRoot":"","sources":["../../../../src/core/chart-api/chart-extra-navigation.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAItC,OAAO,EACL,WAAW,EACX,QAAQ,EACR,SAAS,IAAI,gBAAgB,EAC7B,OAAO,GACR,MAAM,+CAA+C,CAAC;AAEvD,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,cAAc,EAAc,MAAM,iCAAiC,CAAC;AAC7E,OAAO,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AAS,2BAA2B,CAAC,KAAuB;IAC1D,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;IACnE,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,KAAK,IAAI,KAAK,CAAC;AAC9C,CAAC;AAED,SAAS,YAAY,CAAC,KAAgB,EAAE,UAAkB,EAAE,KAAa;IACvE,OAAO,WAAW,CAAC,UAAU,GAAG,KAAK,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;AAChE,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAgB,EAAE,UAAkB,EAAE,KAAa;IAC3E,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,GAAG,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC;AACvH,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 {\n circleIndex,\n getIsRtl,\n handleKey as toolkitHandleKey,\n KeyCode,\n} from \"@cloudscape-design/component-toolkit/internal\";\n\nimport * as Styles from \"../../internal/chart-styles\";\nimport { isPointVisible, SafeSeries } from \"../../internal/utils/highcharts\";\nimport { SVGRendererPool } from \"../../internal/utils/renderer-utils\";\nimport { Rect } from \"../interfaces\";\nimport { getGroupRect, getPointRect, isXThreshold } from \"../utils\";\nimport { ChartExtraContext } from \"./chart-extra-context\";\n\n// In charts with many data points one can navigate faster by using Page Down/Up keys that\n// navigate PAGE_SIZE_PERCENTAGE of the points forwards or backwards.\nconst PAGE_SIZE_PERCENTAGE = 0.05;\n\nexport interface ChartExtraNavigationHandlers {\n onFocusChart(): void;\n onFocusPoint(point: Highcharts.Point, group: readonly Highcharts.Point[]): void;\n onFocusGroup(group: readonly Highcharts.Point[]): void;\n onBlur(): void;\n onActivatePoint(point: Highcharts.Point, group: readonly Highcharts.Point[]): void;\n onActivateGroup(group: readonly Highcharts.Point[]): void;\n // Returns true if a tooltip was dismissed, false otherwise.\n // Used by ESC handlers to decide whether to also navigate.\n onDismissHoverTooltip(): boolean;\n}\n\nexport type FocusedState = FocusedStateChart | FocusedStateGroup | FocusedStatePoint;\n\ninterface FocusedStateChart {\n type: \"chart\";\n}\ninterface FocusedStateGroup {\n type: \"group\";\n group: readonly Highcharts.Point[];\n}\ninterface FocusedStatePoint {\n type: \"point\";\n point: Highcharts.Point;\n group: readonly Highcharts.Point[];\n}\n\n// Navigation controller handles focus behavior and keyboard navigation for all charts.\n// When the chart is first focused, the focus lands on the chart plot. Once navigation is engaged,\n// the focus can land either on the group of points matched by X value, or on a specific point.\n// The focused X value and point are stored so that navigating back to the chart will focus the previously\n// focused point. If the stored point no longer belongs to the chart the focus falls back to the chart plot.\nexport class ChartExtraNavigation {\n private context: ChartExtraContext;\n private handlers: ChartExtraNavigationHandlers;\n private focusOutline: FocusOutline;\n // The application element is a dom element with role=\"application\", rendered right before the chart plot.\n // When the application element is in focus, the keyboard navigation is possible. Upon using navigation commands,\n // we bring the visible focus state to the chart elements, such as points and groups of points. The last visible\n // focus state is persisted.\n private applicationElement: null | HTMLElement = null;\n private focusedState: null | FocusedState = null;\n private ignoreFocus = false;\n\n constructor(context: ChartExtraContext, handlers: ChartExtraNavigationHandlers) {\n this.context = context;\n this.handlers = handlers;\n this.focusOutline = new FocusOutline(context);\n }\n\n public onChartDestroy() {\n this.focusOutline.destroy();\n }\n\n // This function is used as React ref on the application element, positioned right before the chart plot in the DOM.\n // Once the element reference is obtained, we assign the required event listeners directly to the element.\n // That is done for simplicity to avoid passing React event handlers down to the element.\n public setApplication = (element: null | HTMLElement) => {\n if (this.applicationElement) {\n this.applicationElement.removeEventListener(\"focus\", this.onFocus);\n this.applicationElement.removeEventListener(\"blur\", this.onBlur);\n this.applicationElement.removeEventListener(\"keydown\", this.onKeyDown);\n }\n\n if (this.context.settings.keyboardNavigationEnabled || !element) {\n this.applicationElement = element;\n }\n\n if (this.applicationElement) {\n this.applicationElement.addEventListener(\"focus\", this.onFocus);\n this.applicationElement.addEventListener(\"blur\", this.onBlur);\n this.applicationElement.addEventListener(\"keydown\", this.onKeyDown);\n }\n };\n\n // Casting focus to the application element brings the visible focus state to the chart or last focused\n // chart point or group of points. This is used to restore focus after the tooltip is dismissed.\n public focusApplication(point: null | Highcharts.Point, group: readonly Highcharts.Point[]) {\n if (this.context.settings.keyboardNavigationEnabled) {\n this.focusedState = point ? { type: \"point\", point, group } : { type: \"group\", group };\n this.applicationElement?.focus();\n }\n }\n\n public announceChart(ariaLabel: string) {\n this.announce({ role: \"application\", \"aria-label\": ariaLabel });\n }\n\n public announceElement(ariaLabel: string, pinned: boolean) {\n this.announce({ role: \"button\", \"aria-label\": ariaLabel, \"aria-haspopup\": true, \"aria-expanded\": pinned });\n }\n\n // Every time the chart focus is obtained or a navigation action is performed, this needs to be announced\n // to screen-readers. The announcement is made by updating the application element with the attributes of\n // the visually focused element (chart, point, or group), and re-focusing it.\n private announce(elementAttributes: React.ButtonHTMLAttributes<unknown>) {\n if (this.applicationElement) {\n // Remove prev attributes.\n for (const attributeName of this.applicationElement.getAttributeNames()) {\n if (attributeName === \"role\" || attributeName.slice(0, 4) === \"aria\") {\n this.applicationElement.removeAttribute(attributeName);\n }\n }\n // Copy new attributes.\n for (const [attributeName, attributeValue] of Object.entries(elementAttributes)) {\n this.applicationElement.setAttribute(attributeName, `${attributeValue}`);\n }\n // Temporarily disable focus/blur event handlers to not respond to the next programmatically\n // cast focus event, which has the only purpose of making the application element announced to\n // the assistive software.\n this.ignoreFocus = true;\n // Re-attach and re-focus application element to trigger a screen-reader announcement.\n const container = this.applicationElement.parentElement!;\n container.removeChild(this.applicationElement);\n container.appendChild(this.applicationElement);\n this.applicationElement.focus({ preventScroll: true });\n // Remove focus lock. The blur and focus events should have already occurred at this point.\n setTimeout(() => (this.ignoreFocus = false), 0);\n }\n }\n\n // Upon obtaining focus, we show the visible focus state and announce the previously focused element\n // (chart, point, or group). If the previously focused point or group is no longer available, the focus\n // is shown for their respective parent.\n private onFocus = () => {\n if (!this.ignoreFocus) {\n if (!this.focusedState || this.focusedState.type === \"chart\") {\n this.focusChart();\n } else if (this.focusedState.type === \"group\") {\n this.focusGroup(this.focusedState.group);\n } else {\n this.focusPoint(this.focusedState.point, this.focusedState.group);\n }\n }\n };\n\n private onBlur = () => {\n if (!this.ignoreFocus) {\n this.focusOutline.hide();\n this.handlers.onBlur();\n }\n };\n\n private onKeyDown = (event: KeyboardEvent) => {\n // The `handleKey` helper we use does not prevent the default keys behavior, so we do it here for\n // all used keyboard commands. We also stop propagation to prevent the global escape handler in\n // chart-core.tsx from interfering with navigation - when keyboard navigation is active, this\n // handler is the authoritative one for all navigation keys.\n if (\n [\n KeyCode.up,\n KeyCode.down,\n KeyCode.left,\n KeyCode.right,\n KeyCode.enter,\n KeyCode.escape,\n KeyCode.pageUp,\n KeyCode.pageDown,\n KeyCode.home,\n KeyCode.end,\n ].includes(event.keyCode)\n ) {\n event.preventDefault();\n event.stopPropagation();\n }\n // We execute different actions depending on the current focus target (chart, group, or point).\n // It is expected, that the focused element is still available in the chart.\n if (this.focusedState && this.focusedState.type === \"group\") {\n this.onKeyDownGroup(event, this.focusedState.group);\n } else if (this.focusedState && this.focusedState.type === \"point\") {\n this.onKeyDownPoint(event, this.focusedState.point, this.focusedState.group);\n } else {\n this.onKeyDownChart(event);\n }\n };\n\n private onKeyDownChart = (event: KeyboardEvent) => {\n handleKey(event, {\n onActivate: () => this.moveToFirstGroup(),\n onEscape: () => this.handlers.onDismissHoverTooltip(),\n onInlineStart: () => this.moveToLastGroup(),\n onInlineEnd: () => this.moveToFirstGroup(),\n onBlockStart: () => this.moveToLastGroup(),\n onBlockEnd: () => this.moveToFirstGroup(),\n onHome: () => this.moveToFirstGroup(),\n onEnd: () => this.moveToLastGroup(),\n });\n };\n\n private onKeyDownGroup = (event: KeyboardEvent, group: readonly Highcharts.Point[]) => {\n const i = !!this.context.chart().inverted;\n handleKey(event, {\n onActivate: () => this.activateGroup(group),\n onEscape: () => {\n if (!this.handlers.onDismissHoverTooltip()) {\n this.moveToChart();\n }\n },\n onInlineStart: () => (i ? this.moveToFirstInGroup(group) : this.moveToPrevGroup(group)),\n onInlineEnd: () => (i ? this.moveToLastInGroup(group) : this.moveToNextGroup(group)),\n onBlockStart: () => (i ? this.moveToPrevGroup(group) : this.moveToLastInGroup(group)),\n onBlockEnd: () => (i ? this.moveToNextGroup(group) : this.moveToFirstInGroup(group)),\n onPageDown: () => this.moveToNextPageGroup(group),\n onPageUp: () => this.moveToPrevPageGroup(group),\n onHome: () => this.moveToFirstGroup(),\n onEnd: () => this.moveToLastGroup(),\n });\n };\n\n private onKeyDownPoint = (event: KeyboardEvent, point: Highcharts.Point, group: readonly Highcharts.Point[]) => {\n const i = !!this.context.chart().inverted;\n handleKey(event, {\n onActivate: () => this.activatePoint(point, group),\n onEscape: () => {\n if (!this.handlers.onDismissHoverTooltip()) {\n this.moveToParentGroup(point);\n }\n },\n onInlineEnd: () => (i ? this.moveToPrevInGroup(point) : this.moveToNextInSeries(point)),\n onInlineStart: () => (i ? this.moveToNextInGroup(point) : this.moveToPrevInSeries(point)),\n onBlockEnd: () => (i ? this.moveToNextInSeries(point) : this.moveToNextInGroup(point)),\n onBlockStart: () => (i ? this.moveToPrevInSeries(point) : this.moveToPrevInGroup(point)),\n onPageDown: () => this.moveToNextPageInSeries(point),\n onPageUp: () => this.moveToPrevPageInSeries(point),\n onHome: () => this.moveToFirstInSeries(point),\n onEnd: () => this.moveToLastInSeries(point),\n });\n };\n\n private moveToFirstGroup() {\n this.focusGroup(this.findFirstGroup());\n }\n\n private moveToLastGroup() {\n this.focusGroup(this.findLastGroup());\n }\n\n private moveToNextGroup(group: readonly Highcharts.Point[]) {\n const nextGroup = group[0] ? this.findNextGroup(group[0]) : [];\n this.focusGroup(nextGroup);\n }\n\n private moveToPrevGroup(group: readonly Highcharts.Point[]) {\n const prevGroup = group[0] ? this.findPrevGroup(group[0]) : [];\n this.focusGroup(prevGroup);\n }\n\n private moveToParentGroup(point: Highcharts.Point) {\n const group = this.findMatchingGroup(point);\n if (group.length > 0 && group[0].series.type !== \"pie\") {\n this.focusGroup(group);\n } else {\n this.focusChart();\n }\n }\n\n private moveToChart() {\n this.focusChart();\n }\n\n private moveToFirstInGroup(group: readonly Highcharts.Point[]) {\n const points = group.filter((p) => !isXThreshold(p.series));\n this.focusPoint(points[0], group);\n }\n\n private moveToLastInGroup(group: readonly Highcharts.Point[]) {\n const points = group.filter((p) => !isXThreshold(p.series));\n this.focusPoint(points[points.length - 1], group);\n }\n\n private moveToPrevInGroup(point: Highcharts.Point) {\n const points = this.findMatchingGroup(point).filter((p) => !isXThreshold(p.series));\n const pointIndex = points.indexOf(point);\n this.focusPoint(points[circleIndex(pointIndex - 1, [0, points.length - 1])], points);\n }\n\n private moveToNextInGroup(point: Highcharts.Point) {\n const points = this.findMatchingGroup(point).filter((p) => !isXThreshold(p.series));\n const pointIndex = points.indexOf(point);\n this.focusPoint(points[circleIndex(pointIndex + 1, [0, points.length - 1])], points);\n }\n\n private moveToFirstInSeries(point: Highcharts.Point) {\n const firstPoint = this.findFirstPointInSeries(point);\n if (firstPoint) {\n this.focusPoint(firstPoint, this.findMatchingGroup(firstPoint));\n } else {\n this.focusChart();\n }\n }\n\n private moveToLastInSeries(point: Highcharts.Point) {\n const lastPoint = this.findLastPointInSeries(point);\n if (lastPoint) {\n this.focusPoint(lastPoint, this.findMatchingGroup(lastPoint));\n } else {\n this.focusChart();\n }\n }\n\n private moveToNextInSeries(point: Highcharts.Point) {\n const nextPoint = this.findNextPointInSeries(point);\n if (nextPoint) {\n this.focusPoint(nextPoint, this.findMatchingGroup(nextPoint));\n } else {\n this.focusChart();\n }\n }\n\n private moveToPrevInSeries(point: Highcharts.Point) {\n const prevPoint = this.findPrevPointInSeries(point);\n if (prevPoint) {\n this.focusPoint(prevPoint, this.findMatchingGroup(prevPoint));\n } else {\n this.focusChart();\n }\n }\n\n private moveToNextPageGroup(group: readonly Highcharts.Point[]) {\n const nextPageGroup = group[0] ? this.findNextPageGroup(group[0]) : [];\n this.focusGroup(nextPageGroup);\n }\n\n private moveToPrevPageGroup(group: readonly Highcharts.Point[]) {\n const prevPageGroup = group[0] ? this.findPrevPageGroup(group[0]) : [];\n this.focusGroup(prevPageGroup);\n }\n\n private moveToNextPageInSeries(point: Highcharts.Point) {\n const nextPagePoint = this.findNextPagePointInSeries(point);\n if (nextPagePoint) {\n this.focusPoint(nextPagePoint, this.findMatchingGroup(nextPagePoint));\n } else {\n this.focusChart();\n }\n }\n\n private moveToPrevPageInSeries(point: Highcharts.Point) {\n const prevPagePoint = this.findPrevPagePointInSeries(point);\n if (prevPagePoint) {\n this.focusPoint(prevPagePoint, this.findMatchingGroup(prevPagePoint));\n } else {\n this.focusChart();\n }\n }\n\n private activateGroup(group: readonly Highcharts.Point[]) {\n this.handlers.onActivateGroup(group);\n }\n\n private activatePoint(point: Highcharts.Point, group: readonly Highcharts.Point[]) {\n this.handlers.onActivatePoint(point, group);\n }\n\n private focusChart = () => {\n this.focusedState = { type: \"chart\" };\n this.focusOutline.chart();\n this.handlers.onFocusChart();\n };\n\n private focusGroup(group: readonly Highcharts.Point[]) {\n // When the chart is re-focused, the group that was focused before might no longer be valid if its\n // points are no longer visible, are outside the x-axis extremes, or were destroyed by Highcharts. In that\n // case we focus the chart as a fallback.\n const visiblePoints = group.filter((point) => isPointVisible(point) && this.isNavigable(point));\n if (visiblePoints.length === 0) {\n this.focusChart();\n }\n // In pie charts we only focus points, so moving focus to points and groups is equivalent.\n else if (visiblePoints[0].series.type === \"pie\") {\n this.focusPoint(visiblePoints[0] ?? null, group);\n }\n // When focusing a group we draw the focus outline around the corresponding group rect, including\n // all points of that group.\n else {\n this.focusedState = { type: \"group\", group: visiblePoints };\n this.focusOutline.group(getGroupRect(visiblePoints));\n this.handlers.onFocusGroup(visiblePoints);\n }\n }\n\n private focusPoint(point: null | Highcharts.Point, group: readonly Highcharts.Point[]) {\n // When the chart is re-focused, the point that was focused before might no longer be valid it became\n // hidden, moved outside the x-axis extremes, or was destroyed by Highcharts. In that case we focus the\n // point's parent group as a fallback.\n if (!point || !isPointVisible(point) || !this.isNavigable(point)) {\n this.focusGroup(group);\n }\n // When focusing a point we draw the focus outline around its corresponding rect, but with different offsets,\n // depending on the point's series type.\n else {\n this.focusedState = { type: \"point\", point, group };\n this.focusOutline.point(getPointRect(point), point);\n this.handlers.onFocusPoint(point, group);\n }\n }\n\n private get allX(): number[] {\n return this.context.derived.allX;\n }\n\n // Returns all series data points to navigate by. When a series is linked with other series - the method returns\n // all points from the linked series.\n private getSeriesPoints(series: SafeSeries): Highcharts.Point[] {\n return this.context.derived.getSeriesPoints(series);\n }\n\n private getPointsByX = (x: number): Highcharts.Point[] => {\n return this.context.derived.getPointsByX(x);\n };\n\n private isNavigable = (point: Highcharts.Point): boolean => {\n return this.getPointsByX(point.x).includes(point);\n };\n\n private findMatchingGroup = (point: Highcharts.Point): Highcharts.Point[] => {\n return this.getPointsByX(point.x);\n };\n\n private findFirstGroup = (): Highcharts.Point[] => {\n return this.getPointsByX(this.allX[0]);\n };\n\n private findLastGroup = (): Highcharts.Point[] => {\n return this.getPointsByX(this.allX[this.allX.length - 1]);\n };\n\n private findNextGroup = (point: Highcharts.Point): Highcharts.Point[] => {\n const nextIndex = getNextIndex(this.allX, this.allX.indexOf(point.x), 1);\n return this.getPointsByX(this.allX[nextIndex]);\n };\n\n private findPrevGroup = (point: Highcharts.Point): Highcharts.Point[] => {\n const nextIndex = getNextIndex(this.allX, this.allX.indexOf(point.x), -1);\n return this.getPointsByX(this.allX[nextIndex]);\n };\n\n private findNextPageGroup = (point: Highcharts.Point): Highcharts.Point[] => {\n const nextIndex = getNextPageIndex(this.allX, this.allX.indexOf(point.x), 1);\n return this.getPointsByX(this.allX[nextIndex]);\n };\n\n private findPrevPageGroup = (point: Highcharts.Point): Highcharts.Point[] => {\n const nextIndex = getNextPageIndex(this.allX, this.allX.indexOf(point.x), -1);\n return this.getPointsByX(this.allX[nextIndex]);\n };\n\n private findFirstPointInSeries = (point: Highcharts.Point): null | Highcharts.Point => {\n const seriesPoints = this.getSeriesPoints(point.series);\n return seriesPoints[0] ?? null;\n };\n\n private findLastPointInSeries = (point: Highcharts.Point): null | Highcharts.Point => {\n const seriesPoints = this.getSeriesPoints(point.series);\n return seriesPoints[seriesPoints.length - 1] ?? null;\n };\n\n private findNextPointInSeries = (point: Highcharts.Point): null | Highcharts.Point => {\n const seriesPoints = this.getSeriesPoints(point.series);\n const delta = !shouldInvertPointsDirection(point) ? 1 : -1;\n const pointIndex = seriesPoints.indexOf(point);\n const nextIndex = getNextIndex(seriesPoints, pointIndex, delta);\n return seriesPoints[nextIndex] ?? null;\n };\n\n private findPrevPointInSeries = (point: Highcharts.Point): null | Highcharts.Point => {\n const seriesPoints = this.getSeriesPoints(point.series);\n const delta = !shouldInvertPointsDirection(point) ? -1 : 1;\n const pointIndex = seriesPoints.indexOf(point);\n const nextIndex = getNextIndex(seriesPoints, pointIndex, delta);\n return seriesPoints[nextIndex] ?? null;\n };\n\n private findNextPagePointInSeries = (point: Highcharts.Point): null | Highcharts.Point => {\n const seriesPoints = this.getSeriesPoints(point.series);\n const delta = !shouldInvertPointsDirection(point) ? 1 : -1;\n const pointIndex = seriesPoints.indexOf(point);\n const nextIndex = getNextPageIndex(seriesPoints, pointIndex, delta);\n return seriesPoints[nextIndex] ?? null;\n };\n\n private findPrevPagePointInSeries = (point: Highcharts.Point): null | Highcharts.Point => {\n const seriesPoints = this.getSeriesPoints(point.series);\n const delta = !shouldInvertPointsDirection(point) ? -1 : 1;\n const pointIndex = seriesPoints.indexOf(point);\n const nextIndex = getNextPageIndex(seriesPoints, pointIndex, delta);\n return seriesPoints[nextIndex] ?? null;\n };\n}\n\nfunction handleKey(\n event: KeyboardEvent,\n handlers: {\n onActivate?: () => void;\n onBlockEnd?: () => void;\n onBlockStart?: () => void;\n onDefault?: () => void;\n onEnd?: () => void;\n onEscape?: () => void;\n onHome?: () => void;\n onInlineEnd?: () => void;\n onInlineStart?: () => void;\n onPageDown?: () => void;\n onPageUp?: () => void;\n },\n) {\n if (!event.currentTarget) {\n return;\n }\n if (!(event.currentTarget instanceof HTMLElement) && !(event.currentTarget instanceof SVGElement)) {\n return;\n }\n toolkitHandleKey({ keyCode: event.keyCode, currentTarget: event.currentTarget }, handlers);\n}\n\n// A helper class to draw the focus outline around given chart elements.\nclass FocusOutline {\n private context: ChartExtraContext;\n private elementsPool = new SVGRendererPool();\n\n constructor(context: ChartExtraContext) {\n this.context = context;\n }\n\n public chart = () => {\n const [x, y, width, height] = [\n this.context.chart().plotLeft,\n this.context.chart().plotTop,\n this.context.chart().plotWidth,\n this.context.chart().plotHeight,\n ];\n this.rect({ x, y, width, height }, Styles.focusOutlineOffsets.chart);\n };\n\n public group = (rect: Rect) => {\n this.rect(rect, Styles.focusOutlineOffsets.group);\n };\n\n public point = (rect: Rect, point: Highcharts.Point) => {\n const offsetByType = Styles.focusOutlineOffsets.pointByType[point.series.type];\n const offset = offsetByType ?? Styles.focusOutlineOffsets.point;\n this.rect(rect, offset);\n };\n\n public hide() {\n this.elementsPool.hideAll();\n }\n\n public destroy() {\n this.elementsPool.destroyAll();\n }\n\n private rect = ({ x, y, width, height }: Rect, offset: number) => {\n this.elementsPool.hideAll();\n this.elementsPool.rect(this.context.chart().renderer, {\n x: x - offset,\n y: y - offset,\n width: width + offset * 2,\n height: height + offset * 2,\n ...Styles.navigationFocusOutline,\n });\n };\n}\n\n// We do not invert the direction of pie segments when RTL, but swap the left/right keys.\n// To offset for that, the prev/next points direction is swapped, too.\nfunction shouldInvertPointsDirection(point: Highcharts.Point) {\n const isRTL = getIsRtl(point.series.chart.container.parentElement);\n return point.series.type === \"pie\" && isRTL;\n}\n\nfunction getNextIndex(array: unknown[], pointIndex: number, delta: -1 | 1): number {\n return circleIndex(pointIndex + delta, [0, array.length - 1]);\n}\n\nfunction getNextPageIndex(array: unknown[], pointIndex: number, delta: -1 | 1): number {\n return Math.min(array.length - 1, Math.max(0, pointIndex + delta * Math.round(array.length * PAGE_SIZE_PERCENTAGE)));\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  export var PACKAGE_SOURCE = "chart-components";
2
- export var PACKAGE_VERSION = "1.0.0 (ba518338)";
2
+ export var PACKAGE_VERSION = "1.0.0 (4642b924)";
3
3
  export var THEME = "open-source-visual-refresh";
4
4
  export var ALWAYS_VISUAL_REFRESH = true;
5
5
  export var SYSTEM = "core";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "PACKAGE_SOURCE": "chart-components",
3
- "PACKAGE_VERSION": "1.0.0 (ba518338)",
3
+ "PACKAGE_VERSION": "1.0.0 (4642b924)",
4
4
  "THEME": "open-source-visual-refresh",
5
5
  "ALWAYS_VISUAL_REFRESH": true,
6
6
  "SYSTEM": "core"
@@ -887,7 +887,7 @@ export const borderControlInvalidFocusRingShadowSpread: string;
887
887
  export const borderDividerListWidth: string;
888
888
  export const borderDividerSectionWidth: string;
889
889
  export const borderDropdownVirtualOffsetWidth: string;
890
- export const borderInvalidWidth: string;
890
+ export const borderWidthFieldStatusInlineStart: string;
891
891
  export const borderItemWidth: string;
892
892
  export const borderLineChartDashArray: string;
893
893
  export const borderLineChartLineJoin: string;
@@ -887,7 +887,7 @@ export var borderControlInvalidFocusRingShadowSpread = "var(--border-control-inv
887
887
  export var borderDividerListWidth = "var(--border-divider-list-width-q8ujlb, 1px)";
888
888
  export var borderDividerSectionWidth = "var(--border-divider-section-width-ljhehl, 1px)";
889
889
  export var borderDropdownVirtualOffsetWidth = "var(--border-dropdown-virtual-offset-width-0ajc6u, 2px)";
890
- export var borderInvalidWidth = "var(--border-invalid-width-gifxpw, 8px)";
890
+ export var borderWidthFieldStatusInlineStart = "var(--border-width-field-status-inline-start-wzl8ge, 8px)";
891
891
  export var borderItemWidth = "var(--border-item-width-0d09z3, 2px)";
892
892
  export var borderLineChartDashArray = "var(--border-line-chart-dash-array-povfsq, 3 5)";
893
893
  export var borderLineChartLineJoin = "var(--border-line-chart-line-join-u9jt7d, round)";
@@ -3340,7 +3340,7 @@ module.exports.preset = {
3340
3340
  "borderDividerListWidth": "1px",
3341
3341
  "borderDividerSectionWidth": "1px",
3342
3342
  "borderDropdownVirtualOffsetWidth": "2px",
3343
- "borderInvalidWidth": "8px",
3343
+ "borderWidthFieldStatusInlineStart": "8px",
3344
3344
  "borderItemWidth": "2px",
3345
3345
  "borderLineChartDashArray": "3 5",
3346
3346
  "borderLineChartLineJoin": "round",
@@ -17102,6 +17102,7 @@ module.exports.preset = {
17102
17102
  "lineHeightHeadingXs",
17103
17103
  "lineHeightKeyValuePairsLabel",
17104
17104
  "lineHeightTabs",
17105
+ "borderWidthFieldStatusInlineStart",
17105
17106
  "borderRadiusActionCardDefault",
17106
17107
  "borderRadiusActionCardEmbedded",
17107
17108
  "borderRadiusAlert",
@@ -17650,6 +17651,7 @@ module.exports.preset = {
17650
17651
  "lineHeightHeadingXl",
17651
17652
  "lineHeightHeadingXs",
17652
17653
  "lineHeightTabs",
17654
+ "borderWidthFieldStatusInlineStart",
17653
17655
  "borderRadiusActionCardDefault",
17654
17656
  "borderRadiusActionCardEmbedded",
17655
17657
  "borderRadiusAlert",
@@ -18651,7 +18653,7 @@ module.exports.preset = {
18651
18653
  "borderDividerListWidth": "border-divider-list-width",
18652
18654
  "borderDividerSectionWidth": "border-divider-section-width",
18653
18655
  "borderDropdownVirtualOffsetWidth": "border-dropdown-virtual-offset-width",
18654
- "borderInvalidWidth": "border-invalid-width",
18656
+ "borderWidthFieldStatusInlineStart": "border-width-field-status-inline-start",
18655
18657
  "borderItemWidth": "border-item-width",
18656
18658
  "borderLineChartDashArray": "border-line-chart-dash-array",
18657
18659
  "borderLineChartLineJoin": "border-line-chart-line-join",
@@ -19825,7 +19827,7 @@ module.exports.preset = {
19825
19827
  "borderDividerListWidth": "--border-divider-list-width-q8ujlb",
19826
19828
  "borderDividerSectionWidth": "--border-divider-section-width-ljhehl",
19827
19829
  "borderDropdownVirtualOffsetWidth": "--border-dropdown-virtual-offset-width-0ajc6u",
19828
- "borderInvalidWidth": "--border-invalid-width-gifxpw",
19830
+ "borderWidthFieldStatusInlineStart": "--border-width-field-status-inline-start-wzl8ge",
19829
19831
  "borderItemWidth": "--border-item-width-0d09z3",
19830
19832
  "borderLineChartDashArray": "--border-line-chart-dash-array-povfsq",
19831
19833
  "borderLineChartLineJoin": "--border-line-chart-line-join-u9jt7d",
@@ -392,6 +392,7 @@ export declare interface TypedOverride {
392
392
  lineHeightHeadingXs?: GlobalValue;
393
393
  lineHeightKeyValuePairsLabel?: GlobalValue;
394
394
  lineHeightTabs?: GlobalValue;
395
+ borderWidthFieldStatusInlineStart?: GlobalValue;
395
396
  borderRadiusActionCardDefault?: GlobalValue;
396
397
  borderRadiusActionCardEmbedded?: GlobalValue;
397
398
  borderRadiusAlert?: GlobalValue;
@@ -871,6 +872,7 @@ export declare interface TypedOverride {
871
872
  lineHeightHeadingXs?: GlobalValue;
872
873
  lineHeightKeyValuePairsLabel?: GlobalValue;
873
874
  lineHeightTabs?: GlobalValue;
875
+ borderWidthFieldStatusInlineStart?: GlobalValue;
874
876
  borderRadiusActionCardDefault?: GlobalValue;
875
877
  borderRadiusActionCardEmbedded?: GlobalValue;
876
878
  borderRadiusAlert?: GlobalValue;
@@ -1350,6 +1352,7 @@ export declare interface TypedOverride {
1350
1352
  lineHeightHeadingXs?: GlobalValue;
1351
1353
  lineHeightKeyValuePairsLabel?: GlobalValue;
1352
1354
  lineHeightTabs?: GlobalValue;
1355
+ borderWidthFieldStatusInlineStart?: GlobalValue;
1353
1356
  borderRadiusActionCardDefault?: GlobalValue;
1354
1357
  borderRadiusActionCardEmbedded?: GlobalValue;
1355
1358
  borderRadiusAlert?: GlobalValue;
@@ -1829,6 +1832,7 @@ export declare interface TypedOverride {
1829
1832
  lineHeightHeadingXs?: GlobalValue;
1830
1833
  lineHeightKeyValuePairsLabel?: GlobalValue;
1831
1834
  lineHeightTabs?: GlobalValue;
1835
+ borderWidthFieldStatusInlineStart?: GlobalValue;
1832
1836
  borderRadiusActionCardDefault?: GlobalValue;
1833
1837
  borderRadiusActionCardEmbedded?: GlobalValue;
1834
1838
  borderRadiusAlert?: GlobalValue;
@@ -2308,6 +2312,7 @@ export declare interface TypedOverride {
2308
2312
  lineHeightHeadingXs?: GlobalValue;
2309
2313
  lineHeightKeyValuePairsLabel?: GlobalValue;
2310
2314
  lineHeightTabs?: GlobalValue;
2315
+ borderWidthFieldStatusInlineStart?: GlobalValue;
2311
2316
  borderRadiusActionCardDefault?: GlobalValue;
2312
2317
  borderRadiusActionCardEmbedded?: GlobalValue;
2313
2318
  borderRadiusAlert?: GlobalValue;
@@ -2787,6 +2792,7 @@ export declare interface TypedOverride {
2787
2792
  lineHeightHeadingXs?: GlobalValue;
2788
2793
  lineHeightKeyValuePairsLabel?: GlobalValue;
2789
2794
  lineHeightTabs?: GlobalValue;
2795
+ borderWidthFieldStatusInlineStart?: GlobalValue;
2790
2796
  borderRadiusActionCardDefault?: GlobalValue;
2791
2797
  borderRadiusActionCardEmbedded?: GlobalValue;
2792
2798
  borderRadiusAlert?: GlobalValue;
@@ -3266,6 +3272,7 @@ export declare interface TypedOverride {
3266
3272
  lineHeightHeadingXs?: GlobalValue;
3267
3273
  lineHeightKeyValuePairsLabel?: GlobalValue;
3268
3274
  lineHeightTabs?: GlobalValue;
3275
+ borderWidthFieldStatusInlineStart?: GlobalValue;
3269
3276
  borderRadiusActionCardDefault?: GlobalValue;
3270
3277
  borderRadiusActionCardEmbedded?: GlobalValue;
3271
3278
  borderRadiusAlert?: GlobalValue;
@@ -3745,6 +3752,7 @@ export declare interface TypedOverride {
3745
3752
  lineHeightHeadingXs?: GlobalValue;
3746
3753
  lineHeightKeyValuePairsLabel?: GlobalValue;
3747
3754
  lineHeightTabs?: GlobalValue;
3755
+ borderWidthFieldStatusInlineStart?: GlobalValue;
3748
3756
  borderRadiusActionCardDefault?: GlobalValue;
3749
3757
  borderRadiusActionCardEmbedded?: GlobalValue;
3750
3758
  borderRadiusAlert?: GlobalValue;
@@ -4224,6 +4232,7 @@ export declare interface TypedOverride {
4224
4232
  lineHeightHeadingXs?: GlobalValue;
4225
4233
  lineHeightKeyValuePairsLabel?: GlobalValue;
4226
4234
  lineHeightTabs?: GlobalValue;
4235
+ borderWidthFieldStatusInlineStart?: GlobalValue;
4227
4236
  borderRadiusActionCardDefault?: GlobalValue;
4228
4237
  borderRadiusActionCardEmbedded?: GlobalValue;
4229
4238
  borderRadiusAlert?: GlobalValue;
@@ -392,6 +392,7 @@ export declare interface TypedOverride {
392
392
  lineHeightHeadingXs?: GlobalValue;
393
393
  lineHeightKeyValuePairsLabel?: GlobalValue;
394
394
  lineHeightTabs?: GlobalValue;
395
+ borderWidthFieldStatusInlineStart?: GlobalValue;
395
396
  borderRadiusActionCardDefault?: GlobalValue;
396
397
  borderRadiusActionCardEmbedded?: GlobalValue;
397
398
  borderRadiusAlert?: GlobalValue;
@@ -871,6 +872,7 @@ export declare interface TypedOverride {
871
872
  lineHeightHeadingXs?: GlobalValue;
872
873
  lineHeightKeyValuePairsLabel?: GlobalValue;
873
874
  lineHeightTabs?: GlobalValue;
875
+ borderWidthFieldStatusInlineStart?: GlobalValue;
874
876
  borderRadiusActionCardDefault?: GlobalValue;
875
877
  borderRadiusActionCardEmbedded?: GlobalValue;
876
878
  borderRadiusAlert?: GlobalValue;
@@ -1350,6 +1352,7 @@ export declare interface TypedOverride {
1350
1352
  lineHeightHeadingXs?: GlobalValue;
1351
1353
  lineHeightKeyValuePairsLabel?: GlobalValue;
1352
1354
  lineHeightTabs?: GlobalValue;
1355
+ borderWidthFieldStatusInlineStart?: GlobalValue;
1353
1356
  borderRadiusActionCardDefault?: GlobalValue;
1354
1357
  borderRadiusActionCardEmbedded?: GlobalValue;
1355
1358
  borderRadiusAlert?: GlobalValue;
@@ -1829,6 +1832,7 @@ export declare interface TypedOverride {
1829
1832
  lineHeightHeadingXs?: GlobalValue;
1830
1833
  lineHeightKeyValuePairsLabel?: GlobalValue;
1831
1834
  lineHeightTabs?: GlobalValue;
1835
+ borderWidthFieldStatusInlineStart?: GlobalValue;
1832
1836
  borderRadiusActionCardDefault?: GlobalValue;
1833
1837
  borderRadiusActionCardEmbedded?: GlobalValue;
1834
1838
  borderRadiusAlert?: GlobalValue;
@@ -2308,6 +2312,7 @@ export declare interface TypedOverride {
2308
2312
  lineHeightHeadingXs?: GlobalValue;
2309
2313
  lineHeightKeyValuePairsLabel?: GlobalValue;
2310
2314
  lineHeightTabs?: GlobalValue;
2315
+ borderWidthFieldStatusInlineStart?: GlobalValue;
2311
2316
  borderRadiusActionCardDefault?: GlobalValue;
2312
2317
  borderRadiusActionCardEmbedded?: GlobalValue;
2313
2318
  borderRadiusAlert?: GlobalValue;
@@ -2787,6 +2792,7 @@ export declare interface TypedOverride {
2787
2792
  lineHeightHeadingXs?: GlobalValue;
2788
2793
  lineHeightKeyValuePairsLabel?: GlobalValue;
2789
2794
  lineHeightTabs?: GlobalValue;
2795
+ borderWidthFieldStatusInlineStart?: GlobalValue;
2790
2796
  borderRadiusActionCardDefault?: GlobalValue;
2791
2797
  borderRadiusActionCardEmbedded?: GlobalValue;
2792
2798
  borderRadiusAlert?: GlobalValue;
@@ -3266,6 +3272,7 @@ export declare interface TypedOverride {
3266
3272
  lineHeightHeadingXs?: GlobalValue;
3267
3273
  lineHeightKeyValuePairsLabel?: GlobalValue;
3268
3274
  lineHeightTabs?: GlobalValue;
3275
+ borderWidthFieldStatusInlineStart?: GlobalValue;
3269
3276
  borderRadiusActionCardDefault?: GlobalValue;
3270
3277
  borderRadiusActionCardEmbedded?: GlobalValue;
3271
3278
  borderRadiusAlert?: GlobalValue;
@@ -3745,6 +3752,7 @@ export declare interface TypedOverride {
3745
3752
  lineHeightHeadingXs?: GlobalValue;
3746
3753
  lineHeightKeyValuePairsLabel?: GlobalValue;
3747
3754
  lineHeightTabs?: GlobalValue;
3755
+ borderWidthFieldStatusInlineStart?: GlobalValue;
3748
3756
  borderRadiusActionCardDefault?: GlobalValue;
3749
3757
  borderRadiusActionCardEmbedded?: GlobalValue;
3750
3758
  borderRadiusAlert?: GlobalValue;
@@ -4224,6 +4232,7 @@ export declare interface TypedOverride {
4224
4232
  lineHeightHeadingXs?: GlobalValue;
4225
4233
  lineHeightKeyValuePairsLabel?: GlobalValue;
4226
4234
  lineHeightTabs?: GlobalValue;
4235
+ borderWidthFieldStatusInlineStart?: GlobalValue;
4227
4236
  borderRadiusActionCardDefault?: GlobalValue;
4228
4237
  borderRadiusActionCardEmbedded?: GlobalValue;
4229
4238
  borderRadiusAlert?: GlobalValue;
@@ -3340,7 +3340,7 @@ export var preset = {
3340
3340
  "borderDividerListWidth": "1px",
3341
3341
  "borderDividerSectionWidth": "1px",
3342
3342
  "borderDropdownVirtualOffsetWidth": "2px",
3343
- "borderInvalidWidth": "8px",
3343
+ "borderWidthFieldStatusInlineStart": "8px",
3344
3344
  "borderItemWidth": "2px",
3345
3345
  "borderLineChartDashArray": "3 5",
3346
3346
  "borderLineChartLineJoin": "round",
@@ -17102,6 +17102,7 @@ export var preset = {
17102
17102
  "lineHeightHeadingXs",
17103
17103
  "lineHeightKeyValuePairsLabel",
17104
17104
  "lineHeightTabs",
17105
+ "borderWidthFieldStatusInlineStart",
17105
17106
  "borderRadiusActionCardDefault",
17106
17107
  "borderRadiusActionCardEmbedded",
17107
17108
  "borderRadiusAlert",
@@ -17650,6 +17651,7 @@ export var preset = {
17650
17651
  "lineHeightHeadingXl",
17651
17652
  "lineHeightHeadingXs",
17652
17653
  "lineHeightTabs",
17654
+ "borderWidthFieldStatusInlineStart",
17653
17655
  "borderRadiusActionCardDefault",
17654
17656
  "borderRadiusActionCardEmbedded",
17655
17657
  "borderRadiusAlert",
@@ -18651,7 +18653,7 @@ export var preset = {
18651
18653
  "borderDividerListWidth": "border-divider-list-width",
18652
18654
  "borderDividerSectionWidth": "border-divider-section-width",
18653
18655
  "borderDropdownVirtualOffsetWidth": "border-dropdown-virtual-offset-width",
18654
- "borderInvalidWidth": "border-invalid-width",
18656
+ "borderWidthFieldStatusInlineStart": "border-width-field-status-inline-start",
18655
18657
  "borderItemWidth": "border-item-width",
18656
18658
  "borderLineChartDashArray": "border-line-chart-dash-array",
18657
18659
  "borderLineChartLineJoin": "border-line-chart-line-join",
@@ -19825,7 +19827,7 @@ export var preset = {
19825
19827
  "borderDividerListWidth": "--border-divider-list-width-q8ujlb",
19826
19828
  "borderDividerSectionWidth": "--border-divider-section-width-ljhehl",
19827
19829
  "borderDropdownVirtualOffsetWidth": "--border-dropdown-virtual-offset-width-0ajc6u",
19828
- "borderInvalidWidth": "--border-invalid-width-gifxpw",
19830
+ "borderWidthFieldStatusInlineStart": "--border-width-field-status-inline-start-wzl8ge",
19829
19831
  "borderItemWidth": "--border-item-width-0d09z3",
19830
19832
  "borderLineChartDashArray": "--border-line-chart-dash-array-povfsq",
19831
19833
  "borderLineChartLineJoin": "--border-line-chart-line-join-u9jt7d",
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "ba51833878c29037533788b21fe442cad59d78c9"
2
+ "commit": "4642b924ed4b54d84b1e64672681cdbab0213f9b"
3
3
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudscape-design/chart-components",
3
- "version": "1.0.158",
3
+ "version": "1.0.159",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/cloudscape-design/chart-components.git"