@mui/x-charts 8.22.1 → 8.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/BarChart/BarElement.js +1 -1
  2. package/BarChart/FocusedBar.js +1 -1
  3. package/BarChart/seriesConfig/bar/keyboardFocusHandler.d.ts +3 -0
  4. package/BarChart/seriesConfig/bar/keyboardFocusHandler.js +23 -0
  5. package/BarChart/seriesConfig/bar/seriesProcessor.js +2 -2
  6. package/BarChart/seriesConfig/index.js +3 -1
  7. package/CHANGELOG.md +101 -0
  8. package/LineChart/FocusedLineMark.js +1 -1
  9. package/LineChart/seriesConfig/index.js +3 -1
  10. package/LineChart/seriesConfig/keyboardFocusHandler.d.ts +3 -0
  11. package/LineChart/seriesConfig/keyboardFocusHandler.js +23 -0
  12. package/LineChart/seriesConfig/seriesProcessor.js +2 -2
  13. package/PieChart/FocusedPieArc.js +1 -1
  14. package/PieChart/dataTransform/useTransformData.js +1 -1
  15. package/PieChart/seriesConfig/index.js +3 -1
  16. package/PieChart/seriesConfig/keyboardFocusHandler.d.ts +3 -0
  17. package/PieChart/seriesConfig/keyboardFocusHandler.js +23 -0
  18. package/ScatterChart/FocusedScatterMark.js +1 -1
  19. package/ScatterChart/seriesConfig/index.js +3 -1
  20. package/ScatterChart/seriesConfig/keyboardFocusHandler.d.ts +3 -0
  21. package/ScatterChart/seriesConfig/keyboardFocusHandler.js +23 -0
  22. package/esm/BarChart/BarElement.js +1 -1
  23. package/esm/BarChart/FocusedBar.js +1 -1
  24. package/esm/BarChart/seriesConfig/bar/keyboardFocusHandler.d.ts +3 -0
  25. package/esm/BarChart/seriesConfig/bar/keyboardFocusHandler.js +17 -0
  26. package/esm/BarChart/seriesConfig/bar/seriesProcessor.js +1 -1
  27. package/esm/BarChart/seriesConfig/index.js +3 -1
  28. package/esm/LineChart/FocusedLineMark.js +1 -1
  29. package/esm/LineChart/seriesConfig/index.js +3 -1
  30. package/esm/LineChart/seriesConfig/keyboardFocusHandler.d.ts +3 -0
  31. package/esm/LineChart/seriesConfig/keyboardFocusHandler.js +17 -0
  32. package/esm/LineChart/seriesConfig/seriesProcessor.js +1 -1
  33. package/esm/PieChart/FocusedPieArc.js +1 -1
  34. package/esm/PieChart/dataTransform/useTransformData.js +1 -1
  35. package/esm/PieChart/seriesConfig/index.js +3 -1
  36. package/esm/PieChart/seriesConfig/keyboardFocusHandler.d.ts +3 -0
  37. package/esm/PieChart/seriesConfig/keyboardFocusHandler.js +17 -0
  38. package/esm/ScatterChart/FocusedScatterMark.js +1 -1
  39. package/esm/ScatterChart/seriesConfig/index.js +3 -1
  40. package/esm/ScatterChart/seriesConfig/keyboardFocusHandler.d.ts +3 -0
  41. package/esm/ScatterChart/seriesConfig/keyboardFocusHandler.js +17 -0
  42. package/esm/hooks/useFocusedItem.d.ts +1 -12
  43. package/esm/hooks/useFocusedItem.js +3 -10
  44. package/esm/hooks/useIsItemFocused.d.ts +4 -3
  45. package/esm/hooks/useIsItemFocused.js +1 -1
  46. package/esm/hooks/useIsItemFocusedGetter.d.ts +3 -2
  47. package/esm/hooks/useIsItemFocusedGetter.js +2 -1
  48. package/esm/index.js +1 -1
  49. package/esm/internals/commonNextFocusItem.d.ts +14 -0
  50. package/esm/internals/commonNextFocusItem.js +84 -0
  51. package/esm/internals/index.d.ts +1 -1
  52. package/esm/internals/index.js +1 -1
  53. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/keyboardFocusHandler.types.d.ts +13 -0
  54. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/keyboardFocusHandler.types.js +1 -0
  55. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.d.ts +2 -2
  56. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +12 -105
  57. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +5 -31
  58. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +9 -15
  59. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +6 -21
  60. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNextNonEmptySeries.d.ts +15 -0
  61. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNextNonEmptySeries.js +45 -0
  62. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getPreviousNonEmptySeries.d.ts +11 -0
  63. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getPreviousNonEmptySeries.js +40 -0
  64. package/esm/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.ts +1 -9
  65. package/esm/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.js +2 -2
  66. package/esm/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +2 -0
  67. package/esm/internals/plugins/models/seriesConfig/seriesProcessor.types.d.ts +1 -1
  68. package/esm/internals/seriesHasData.d.ts +4 -0
  69. package/esm/internals/seriesHasData.js +8 -0
  70. package/esm/internals/stacking/index.d.ts +1 -0
  71. package/esm/internals/stacking/index.js +1 -0
  72. package/esm/internals/stacking/offset/index.d.ts +1 -0
  73. package/esm/internals/stacking/offset/index.js +1 -0
  74. package/esm/internals/stacking/offset/offsetDiverging.d.ts +8 -0
  75. package/esm/internals/stacking/offset/offsetDiverging.js +47 -0
  76. package/esm/internals/{stackSeries.d.ts → stacking/stackSeries.d.ts} +8 -8
  77. package/esm/internals/{stackSeries.js → stacking/stackSeries.js} +8 -6
  78. package/esm/models/seriesType/index.d.ts +3 -1
  79. package/hooks/useFocusedItem.d.ts +1 -12
  80. package/hooks/useFocusedItem.js +1 -10
  81. package/hooks/useIsItemFocused.d.ts +4 -3
  82. package/hooks/useIsItemFocused.js +1 -1
  83. package/hooks/useIsItemFocusedGetter.d.ts +3 -2
  84. package/hooks/useIsItemFocusedGetter.js +2 -1
  85. package/index.js +1 -1
  86. package/internals/commonNextFocusItem.d.ts +14 -0
  87. package/internals/commonNextFocusItem.js +93 -0
  88. package/internals/index.d.ts +1 -1
  89. package/internals/index.js +4 -4
  90. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/keyboardFocusHandler.types.d.ts +13 -0
  91. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/keyboardFocusHandler.types.js +5 -0
  92. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.d.ts +2 -2
  93. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +11 -104
  94. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +5 -31
  95. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +10 -16
  96. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +6 -21
  97. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNextNonEmptySeries.d.ts +15 -0
  98. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNextNonEmptySeries.js +51 -0
  99. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getPreviousNonEmptySeries.d.ts +11 -0
  100. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getPreviousNonEmptySeries.js +46 -0
  101. package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.ts +1 -9
  102. package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.js +1 -1
  103. package/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +2 -0
  104. package/internals/plugins/models/seriesConfig/seriesProcessor.types.d.ts +1 -1
  105. package/internals/seriesHasData.d.ts +4 -0
  106. package/internals/seriesHasData.js +14 -0
  107. package/internals/stacking/index.d.ts +1 -0
  108. package/internals/stacking/index.js +16 -0
  109. package/internals/stacking/offset/index.d.ts +1 -0
  110. package/internals/stacking/offset/index.js +16 -0
  111. package/internals/stacking/offset/offsetDiverging.d.ts +8 -0
  112. package/internals/stacking/offset/offsetDiverging.js +53 -0
  113. package/internals/{stackSeries.d.ts → stacking/stackSeries.d.ts} +8 -8
  114. package/internals/{stackSeries.js → stacking/stackSeries.js} +3 -1
  115. package/models/seriesType/index.d.ts +3 -1
  116. package/package.json +4 -4
  117. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/isFocusableSeriesType.d.ts +0 -3
  118. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/isFocusableSeriesType.js +0 -4
  119. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.d.ts +0 -21
  120. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.js +0 -92
  121. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/isFocusableSeriesType.d.ts +0 -3
  122. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/isFocusableSeriesType.js +0 -10
  123. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.d.ts +0 -21
  124. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.js +0 -99
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Returns the previous series type and id that contains some data.
3
+ * Returns `null` if no other series have data.
4
+ */
5
+ export function getPreviousNonEmptySeries(series, availableSeriesTypes, type, seriesId) {
6
+ const seriesType = Object.keys(series);
7
+ const startingSeriesIndex = type !== undefined && seriesId !== undefined && series[type] && series[type].series[seriesId] ? series[type].seriesOrder.indexOf(seriesId) : 1;
8
+ const typesAvailable = seriesType.filter(t => availableSeriesTypes?.has(t));
9
+ const startingTypeIndex = type !== undefined && series[type] ? typesAvailable.indexOf(type) : 0;
10
+
11
+ // Loop over all series types starting with the current seriesType
12
+ for (let typeGap = 0; typeGap < typesAvailable.length; typeGap += 1) {
13
+ const typeIndex = (typesAvailable.length + startingTypeIndex - typeGap) % typesAvailable.length;
14
+ const seriesOfType = series[typesAvailable[typeIndex]];
15
+ const maxGap = typeGap === 0 ? startingSeriesIndex + 1 : seriesOfType.seriesOrder.length;
16
+ for (let seriesGap = 1; seriesGap < maxGap; seriesGap += 1) {
17
+ const seriesIndex = (seriesOfType.seriesOrder.length + startingSeriesIndex - seriesGap) % seriesOfType.seriesOrder.length;
18
+ if (seriesOfType.series[seriesOfType.seriesOrder[seriesIndex]].data.length > 0) {
19
+ return {
20
+ type: typesAvailable[typeIndex],
21
+ seriesId: seriesOfType.seriesOrder[seriesIndex]
22
+ };
23
+ }
24
+ }
25
+ }
26
+
27
+ // End looping on the initial type down to the initial series (excluded)
28
+ const typeIndex = startingTypeIndex;
29
+ const seriesOfType = series[typesAvailable[typeIndex]];
30
+ const availableSeriesIds = seriesOfType.seriesOrder;
31
+ for (let seriesIndex = availableSeriesIds.length - 1; seriesIndex > startingSeriesIndex; seriesIndex -= 1) {
32
+ if (seriesOfType.series[seriesOfType.seriesOrder[seriesIndex]].data.length > 0) {
33
+ return {
34
+ type: typesAvailable[typeIndex],
35
+ seriesId: seriesOfType.seriesOrder[seriesIndex]
36
+ };
37
+ }
38
+ }
39
+ return null;
40
+ }
@@ -6,15 +6,7 @@ export declare const selectorChartsTooltipPointerItemIsDefined: (args_0: import(
6
6
  }) => boolean;
7
7
  export declare const selectorChartsTooltipItem: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
8
8
  cacheKey: import("../../models/index.js").ChartStateCacheKey;
9
- }) => import("../../../../index.js").PieItemIdentifier | {
10
- type: "bar";
11
- seriesId: import("../../../index.js").SeriesId;
12
- dataIndex: number;
13
- } | {
14
- type: "scatter";
15
- seriesId: import("../../../index.js").SeriesId;
16
- dataIndex: number;
17
- } | import("../../../../index.js").LineItemIdentifier | import("../../../../index.js").RadarItemIdentifier | null;
9
+ }) => import("../../../../index.js").PieItemIdentifier | import("../../../../index.js").LineItemIdentifier | import("../../../../index.js").BarItemIdentifier | import("../../../../index.js").ScatterItemIdentifier | import("../../../../index.js").RadarItemIdentifier | null;
18
10
  export declare const selectorChartsTooltipItemIsDefined: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
19
11
  cacheKey: import("../../models/index.js").ChartStateCacheKey;
20
12
  }) => boolean;
@@ -1,7 +1,7 @@
1
1
  import { createSelector, createSelectorMemoized } from '@mui/x-internals/store';
2
2
  import { selectorChartSeriesConfig, selectorChartSeriesProcessed, selectorChartSeriesLayout } from "../../corePlugins/useChartSeries/index.js";
3
3
  import { selectorChartXAxis, selectorChartYAxis } from "../useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js";
4
- import { selectorChartsKeyboardItem, selectorChartsKeyboardItemIsDefined } from "../useChartKeyboardNavigation/index.js";
4
+ import { selectorChartsKeyboardItem, selectorChartsHasFocusedItem } from "../useChartKeyboardNavigation/index.js";
5
5
  import { selectorChartsLastInteraction } from "../useChartInteraction/useChartInteraction.selectors.js";
6
6
  import { selectorChartDrawingArea } from "../../corePlugins/useChartDimensions/useChartDimensions.selectors.js";
7
7
  import { isCartesianSeries } from "../../../isCartesian.js";
@@ -10,7 +10,7 @@ const selectTooltip = state => state.tooltip;
10
10
  export const selectorChartsTooltipPointerItem = createSelector(selectTooltip, tooltip => tooltip?.item ?? null);
11
11
  export const selectorChartsTooltipPointerItemIsDefined = createSelector(selectorChartsTooltipPointerItem, item => item !== null);
12
12
  export const selectorChartsTooltipItem = createSelector(selectorChartsLastInteraction, selectorChartsTooltipPointerItem, selectorChartsKeyboardItem, (lastInteraction, pointerItem, keyboardItem) => lastInteraction === 'keyboard' ? keyboardItem : pointerItem ?? null);
13
- export const selectorChartsTooltipItemIsDefined = createSelector(selectorChartsLastInteraction, selectorChartsTooltipPointerItemIsDefined, selectorChartsKeyboardItemIsDefined, (lastInteraction, pointerItemIsDefined, keyboardItemIsDefined) => lastInteraction === 'keyboard' ? keyboardItemIsDefined : pointerItemIsDefined);
13
+ export const selectorChartsTooltipItemIsDefined = createSelector(selectorChartsLastInteraction, selectorChartsTooltipPointerItemIsDefined, selectorChartsHasFocusedItem, (lastInteraction, pointerItemIsDefined, keyboardItemIsDefined) => lastInteraction === 'keyboard' ? keyboardItemIsDefined : pointerItemIsDefined);
14
14
  const selectorChartsTooltipAxisConfig = createSelectorMemoized(selectorChartsTooltipItem, selectorChartXAxis, selectorChartYAxis, selectorChartRotationAxis, selectorChartRadiusAxis, selectorChartSeriesProcessed, function selectorChartsTooltipAxisConfig(identifier, {
15
15
  axis: xAxis,
16
16
  axisIds: xAxisIds
@@ -8,6 +8,7 @@ import { type PolarExtremumGetter } from "./polarExtremumGetter.types.js";
8
8
  import { type GetSeriesWithDefaultValues } from "./getSeriesWithDefaultValues.types.js";
9
9
  import { type TooltipItemPositionGetter } from "./tooltipItemPositionGetter.types.js";
10
10
  import { type SeriesLayoutGetter } from "./seriesLayout.types.js";
11
+ import { type KeyboardFocusHandler } from "../../featurePlugins/useChartKeyboardNavigation/keyboardFocusHandler.types.js";
11
12
  export type ChartSeriesTypeConfig<TSeriesType extends ChartSeriesType> = {
12
13
  seriesProcessor: SeriesProcessor<TSeriesType>;
13
14
  /**
@@ -19,6 +20,7 @@ export type ChartSeriesTypeConfig<TSeriesType extends ChartSeriesType> = {
19
20
  tooltipGetter: TooltipGetter<TSeriesType>;
20
21
  tooltipItemPositionGetter?: TooltipItemPositionGetter<TSeriesType>;
21
22
  getSeriesWithDefaultValues: GetSeriesWithDefaultValues<TSeriesType>;
23
+ keyboardFocusHandler?: KeyboardFocusHandler<TSeriesType>;
22
24
  } & (TSeriesType extends CartesianChartSeriesType ? {
23
25
  xExtremumGetter: CartesianExtremumGetter<TSeriesType>;
24
26
  yExtremumGetter: CartesianExtremumGetter<TSeriesType>;
@@ -1,6 +1,6 @@
1
1
  import type { ChartSeriesDefaultized, ChartSeriesType, ChartsSeriesConfig, DatasetType } from "../../../../models/seriesType/config.js";
2
2
  import type { SeriesId } from "../../../../models/seriesType/common.js";
3
- import type { StackingGroupsType } from "../../../stackSeries.js";
3
+ import type { StackingGroupsType } from "../../../stacking/index.js";
4
4
  export type SeriesProcessorParams<TSeriesType extends ChartSeriesType> = {
5
5
  series: Record<SeriesId, ChartsSeriesConfig[TSeriesType]['seriesInput']>;
6
6
  seriesOrder: SeriesId[];
@@ -0,0 +1,4 @@
1
+ import type { SeriesId } from "../models/seriesType/common.js";
2
+ import type { ChartSeriesType, ChartsSeriesConfig } from "../models/seriesType/config.js";
3
+ import type { ProcessedSeries } from "./plugins/corePlugins/useChartSeries/index.js";
4
+ export declare function seriesHasData(series: ProcessedSeries<keyof ChartsSeriesConfig>, type: ChartSeriesType, seriesId: SeriesId): boolean;
@@ -0,0 +1,8 @@
1
+ export function seriesHasData(series, type, seriesId) {
2
+ // @ts-ignore sankey is not in MIT version
3
+ if (type === 'sankey') {
4
+ return false;
5
+ }
6
+ const data = series[type]?.series[seriesId]?.data;
7
+ return data != null && data.length > 0;
8
+ }
@@ -0,0 +1 @@
1
+ export * from "./stackSeries.js";
@@ -0,0 +1 @@
1
+ export * from "./stackSeries.js";
@@ -0,0 +1 @@
1
+ export * from "./offsetDiverging.js";
@@ -0,0 +1 @@
1
+ export * from "./offsetDiverging.js";
@@ -0,0 +1,8 @@
1
+ import type { Series } from '@mui/x-charts-vendor/d3-shape';
2
+ /**
3
+ * Positive values are stacked above zero, while negative values are stacked below zero.
4
+ *
5
+ * @param series A series generated by a stack generator.
6
+ * @param order An array of numeric indexes representing the stack order.
7
+ */
8
+ export declare function offsetDiverging(series: Series<any, any>[], order: Iterable<number>): void;
@@ -0,0 +1,47 @@
1
+ // Adapted from D3.js's offsetDiverging function https://github.com/d3/d3-shape/blob/main/src/offset/diverging.js
2
+ // Hidden series (with all zero values) affect the stacking in a different way in our implementation compared to the D3 behavior.
3
+ // The D3 stacking keep those values at the 0 "line", which creates issues when animating between hidden and visible states.
4
+ // In our modification, we stack them on top/below already stacked items according to the sign of their original value.
5
+ // A hidden negative value will be placed below all the already stacked negative values
6
+
7
+ /**
8
+ * Positive values are stacked above zero, while negative values are stacked below zero.
9
+ *
10
+ * @param series A series generated by a stack generator.
11
+ * @param order An array of numeric indexes representing the stack order.
12
+ */
13
+ export function offsetDiverging(series, order) {
14
+ if (series.length === 0) {
15
+ return;
16
+ }
17
+ const seriesCount = series.length;
18
+ const numericOrder = order;
19
+ const pointCount = series[numericOrder[0]].length;
20
+ for (let pointIndex = 0; pointIndex < pointCount; pointIndex += 1) {
21
+ let positiveSum = 0;
22
+ let negativeSum = 0;
23
+ for (let seriesIndex = 0; seriesIndex < seriesCount; seriesIndex += 1) {
24
+ const currentSeries = series[numericOrder[seriesIndex]];
25
+ const dataPoint = currentSeries[pointIndex];
26
+ const difference = dataPoint[1] - dataPoint[0];
27
+ if (difference > 0) {
28
+ dataPoint[0] = positiveSum;
29
+ positiveSum += difference;
30
+ dataPoint[1] = positiveSum;
31
+ } else if (difference < 0) {
32
+ dataPoint[1] = negativeSum;
33
+ negativeSum += difference;
34
+ dataPoint[0] = negativeSum;
35
+ } else if (dataPoint.data[currentSeries.key] > 0) {
36
+ dataPoint[0] = positiveSum;
37
+ dataPoint[1] = positiveSum;
38
+ } else if (dataPoint.data[currentSeries.key] < 0) {
39
+ dataPoint[1] = negativeSum;
40
+ dataPoint[0] = negativeSum;
41
+ } else {
42
+ dataPoint[0] = 0;
43
+ dataPoint[1] = 0;
44
+ }
45
+ }
46
+ }
47
+ }
@@ -1,6 +1,6 @@
1
- import { stackOrderAppearance as d3StackOrderAppearance, stackOrderAscending as d3StackOrderAscending, stackOrderDescending as d3StackOrderDescending, stackOrderInsideOut as d3StackOrderInsideOut, stackOrderNone as d3StackOrderNone, stackOrderReverse as d3StackOrderReverse, stackOffsetExpand as d3StackOffsetExpand, stackOffsetDiverging as d3StackOffsetDiverging, stackOffsetNone as d3StackOffsetNone, stackOffsetSilhouette as d3StackOffsetSilhouette, stackOffsetWiggle as d3StackOffsetWiggle, type Series } from '@mui/x-charts-vendor/d3-shape';
2
- import type { StackOffsetType, StackOrderType } from "../models/stacking.js";
3
- import { type SeriesId, type StackableSeriesType } from "../models/seriesType/common.js";
1
+ import { stackOrderNone as d3StackOrderNone, stackOrderReverse as d3StackOrderReverse, stackOrderAppearance as d3OrderAppearance, stackOrderAscending as d3OrderAscending, stackOrderDescending as d3OrderDescending, stackOrderInsideOut as d3OrderInsideOut, stackOffsetExpand as d3StackOffsetExpand, stackOffsetNone as d3StackOffsetNone, stackOffsetSilhouette as d3StackOffsetSilhouette, stackOffsetWiggle as d3StackOffsetWiggle, type Series } from '@mui/x-charts-vendor/d3-shape';
2
+ import type { StackOffsetType, StackOrderType } from "../../models/stacking.js";
3
+ import { type SeriesId, type StackableSeriesType } from "../../models/seriesType/common.js";
4
4
  type FormatterParams<T> = {
5
5
  series: Record<SeriesId, T>;
6
6
  seriesOrder: SeriesId[];
@@ -18,19 +18,19 @@ export declare const StackOrder: {
18
18
  /**
19
19
  * Series order such that the earliest series (according to the maximum value) is at the bottom.
20
20
  * */
21
- appearance: typeof d3StackOrderAppearance;
21
+ appearance: typeof d3OrderAppearance;
22
22
  /**
23
23
  * Series order such that the smallest series (according to the sum of values) is at the bottom.
24
24
  * */
25
- ascending: typeof d3StackOrderAscending;
25
+ ascending: typeof d3OrderAscending;
26
26
  /**
27
27
  * Series order such that the largest series (according to the sum of values) is at the bottom.
28
28
  */
29
- descending: typeof d3StackOrderDescending;
29
+ descending: typeof d3OrderDescending;
30
30
  /**
31
31
  * Series order such that the earliest series (according to the maximum value) are on the inside and the later series are on the outside. This order is recommended for streamgraphs in conjunction with the wiggle offset. See Stacked Graphs—Geometry & Aesthetics by Byron & Wattenberg for more information.
32
32
  */
33
- insideOut: typeof d3StackOrderInsideOut;
33
+ insideOut: typeof d3OrderInsideOut;
34
34
  /**
35
35
  * Given series order [0, 1, … n - 1] where n is the number of elements in series. Thus, the stack order is given by the key accessor.
36
36
  */
@@ -48,7 +48,7 @@ export declare const StackOffset: {
48
48
  /**
49
49
  * Positive values are stacked above zero, negative values are stacked below zero, and zero values are stacked at zero.
50
50
  * */
51
- diverging: typeof d3StackOffsetDiverging;
51
+ diverging: (series: Series<any, any>, order: Iterable<number>) => void;
52
52
  /**
53
53
  * Applies a zero baseline.
54
54
  * */
@@ -1,21 +1,22 @@
1
- import { stackOrderAppearance as d3StackOrderAppearance, stackOrderAscending as d3StackOrderAscending, stackOrderDescending as d3StackOrderDescending, stackOrderInsideOut as d3StackOrderInsideOut, stackOrderNone as d3StackOrderNone, stackOrderReverse as d3StackOrderReverse, stackOffsetExpand as d3StackOffsetExpand, stackOffsetDiverging as d3StackOffsetDiverging, stackOffsetNone as d3StackOffsetNone, stackOffsetSilhouette as d3StackOffsetSilhouette, stackOffsetWiggle as d3StackOffsetWiggle } from '@mui/x-charts-vendor/d3-shape';
1
+ import { stackOrderNone as d3StackOrderNone, stackOrderReverse as d3StackOrderReverse, stackOrderAppearance as d3OrderAppearance, stackOrderAscending as d3OrderAscending, stackOrderDescending as d3OrderDescending, stackOrderInsideOut as d3OrderInsideOut, stackOffsetExpand as d3StackOffsetExpand, stackOffsetNone as d3StackOffsetNone, stackOffsetSilhouette as d3StackOffsetSilhouette, stackOffsetWiggle as d3StackOffsetWiggle } from '@mui/x-charts-vendor/d3-shape';
2
+ import { offsetDiverging } from "./offset/index.js";
2
3
  export const StackOrder = {
3
4
  /**
4
5
  * Series order such that the earliest series (according to the maximum value) is at the bottom.
5
6
  * */
6
- appearance: d3StackOrderAppearance,
7
+ appearance: d3OrderAppearance,
7
8
  /**
8
9
  * Series order such that the smallest series (according to the sum of values) is at the bottom.
9
10
  * */
10
- ascending: d3StackOrderAscending,
11
+ ascending: d3OrderAscending,
11
12
  /**
12
13
  * Series order such that the largest series (according to the sum of values) is at the bottom.
13
14
  */
14
- descending: d3StackOrderDescending,
15
+ descending: d3OrderDescending,
15
16
  /**
16
17
  * Series order such that the earliest series (according to the maximum value) are on the inside and the later series are on the outside. This order is recommended for streamgraphs in conjunction with the wiggle offset. See Stacked Graphs—Geometry & Aesthetics by Byron & Wattenberg for more information.
17
18
  */
18
- insideOut: d3StackOrderInsideOut,
19
+ insideOut: d3OrderInsideOut,
19
20
  /**
20
21
  * Given series order [0, 1, … n - 1] where n is the number of elements in series. Thus, the stack order is given by the key accessor.
21
22
  */
@@ -33,7 +34,8 @@ export const StackOffset = {
33
34
  /**
34
35
  * Positive values are stacked above zero, negative values are stacked below zero, and zero values are stacked at zero.
35
36
  * */
36
- diverging: d3StackOffsetDiverging,
37
+ // @ts-expect-error, d3 types are wrong, our custom function implements the correct signature
38
+ diverging: offsetDiverging,
37
39
  /**
38
40
  * Applies a zero baseline.
39
41
  * */
@@ -1,4 +1,5 @@
1
- import { type BarSeriesType, type DefaultizedBarSeriesType } from "./bar.js";
1
+ import type { DefaultizedProps } from '@mui/x-internals/types';
2
+ import type { BarSeriesType, DefaultizedBarSeriesType } from "./bar.js";
2
3
  import { type CartesianChartSeriesType, type ChartSeriesType, type ChartsSeriesConfig, type StackableChartSeriesType } from "./config.js";
3
4
  type AllSeriesType<T extends ChartSeriesType = ChartSeriesType> = ChartsSeriesConfig[T]['seriesProp'];
4
5
  /**
@@ -19,6 +20,7 @@ type DefaultizedCartesianSeriesType = DefaultizedSeriesType<CartesianChartSeries
19
20
  type StackableSeriesType = DefaultizedSeriesType<StackableChartSeriesType>;
20
21
  export type SeriesItemIdentifier<T extends ChartSeriesType = ChartSeriesType> = ChartsSeriesConfig[T]['itemIdentifier'];
21
22
  export type SeriesItemIdentifierWithData<T extends ChartSeriesType = ChartSeriesType> = ChartsSeriesConfig[T]['itemIdentifierWithData'];
23
+ export type FocusedItemIdentifier<T extends ChartSeriesType = ChartSeriesType> = T extends 'line' ? DefaultizedProps<ChartsSeriesConfig[T]['itemIdentifier'], 'dataIndex'> : ChartsSeriesConfig[T]['itemIdentifier'];
22
24
  export { type SeriesId } from "./common.js";
23
25
  export * from "./line.js";
24
26
  export * from "./bar.js";
@@ -1,15 +1,4 @@
1
- import { type ChartSeriesType } from "../models/seriesType/config.js";
2
- import { type SeriesId } from "../models/seriesType/common.js";
3
- export type FocusedItemData = {
4
- seriesType: ChartSeriesType;
5
- seriesId: SeriesId;
6
- dataIndex: number;
7
- };
8
1
  /**
9
2
  * Get the focused item from keyboard navigation.
10
3
  */
11
- export declare function useFocusedItem(): {
12
- seriesType: "line" | "bar" | "scatter" | "pie";
13
- seriesId: SeriesId;
14
- dataIndex: number;
15
- } | null;
4
+ export declare function useFocusedItem(): import("../index.js").FocusedItemIdentifier<keyof import("../internals/index.js").ChartsSeriesConfig> | null;
@@ -1,12 +1,10 @@
1
1
  "use strict";
2
2
  'use client';
3
3
 
4
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.useFocusedItem = useFocusedItem;
9
- var React = _interopRequireWildcard(require("react"));
10
8
  var _useStore = require("../internals/store/useStore");
11
9
  var _useChartKeyboardNavigation = require("../internals/plugins/featurePlugins/useChartKeyboardNavigation");
12
10
  /**
@@ -14,12 +12,5 @@ var _useChartKeyboardNavigation = require("../internals/plugins/featurePlugins/u
14
12
  */
15
13
  function useFocusedItem() {
16
14
  const store = (0, _useStore.useStore)();
17
- const focusedSeriesType = store.use(_useChartKeyboardNavigation.selectorChartsFocusedSeriesType);
18
- const focusedSeriesId = store.use(_useChartKeyboardNavigation.selectorChartsFocusedSeriesId);
19
- const focusedDataIndex = store.use(_useChartKeyboardNavigation.selectorChartsFocusedDataIndex);
20
- return React.useMemo(() => focusedSeriesType === undefined || focusedSeriesId === undefined || focusedDataIndex === undefined ? null : {
21
- seriesType: focusedSeriesType,
22
- seriesId: focusedSeriesId,
23
- dataIndex: focusedDataIndex
24
- }, [focusedSeriesType, focusedSeriesId, focusedDataIndex]);
15
+ return store.use(_useChartKeyboardNavigation.selectorChartsFocusedItem);
25
16
  }
@@ -1,11 +1,12 @@
1
- import { type FocusedItemData } from "./useFocusedItem.js";
2
- type UseItemFocusedParams = FocusedItemData;
1
+ import type { ChartSeriesType } from "../models/seriesType/config.js";
2
+ import type { FocusedItemIdentifier } from "../models/seriesType/index.js";
3
+ type UseItemFocusedParams = FocusedItemIdentifier<ChartSeriesType>;
3
4
  /**
4
5
  * A hook to check if an item has the focus.
5
6
  *
6
7
  * If you need to process multiple points, use the `useIsItemFocusedGetter` hook instead.
7
8
  *
8
- * @param {FocusedItemData} item is the item to check
9
+ * @param {FocusedItemIdentifier} item is the item to check
9
10
  * @returns {boolean} the focus state
10
11
  */
11
12
  export declare function useIsItemFocused(item: UseItemFocusedParams): boolean;
@@ -12,7 +12,7 @@ var _useChartKeyboardNavigation = require("../internals/plugins/featurePlugins/u
12
12
  *
13
13
  * If you need to process multiple points, use the `useIsItemFocusedGetter` hook instead.
14
14
  *
15
- * @param {FocusedItemData} item is the item to check
15
+ * @param {FocusedItemIdentifier} item is the item to check
16
16
  * @returns {boolean} the focus state
17
17
  */
18
18
  function useIsItemFocused(item) {
@@ -1,8 +1,9 @@
1
- import { type FocusedItemData } from "./useFocusedItem.js";
1
+ import type { FocusedItemIdentifier } from "../models/seriesType/index.js";
2
+ import type { ChartSeriesType } from "../models/seriesType/config.js";
2
3
  /**
3
4
  * A hook to check focus state of multiple items.
4
5
  * If you're interested by a single one, consider using `useIsItemFocused`.
5
6
  *
6
7
  * @returns {(item: FocusedItemData) => boolean} callback to get the state of the item.
7
8
  */
8
- export declare function useIsItemFocusedGetter(): (item: FocusedItemData) => boolean;
9
+ export declare function useIsItemFocusedGetter(): (item: FocusedItemIdentifier<ChartSeriesType>) => boolean;
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.useIsItemFocusedGetter = useIsItemFocusedGetter;
8
+ var _fastObjectShallowCompare = require("@mui/x-internals/fastObjectShallowCompare");
8
9
  var _useFocusedItem = require("./useFocusedItem");
9
10
  /**
10
11
  * A hook to check focus state of multiple items.
@@ -14,5 +15,5 @@ var _useFocusedItem = require("./useFocusedItem");
14
15
  */
15
16
  function useIsItemFocusedGetter() {
16
17
  const focusedItem = (0, _useFocusedItem.useFocusedItem)();
17
- return item => focusedItem !== null && focusedItem.seriesType === item.seriesType && focusedItem.seriesId === item.seriesId && focusedItem.dataIndex === item.dataIndex;
18
+ return item => focusedItem !== null && (0, _fastObjectShallowCompare.fastObjectShallowCompare)(focusedItem, item);
18
19
  }
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts v8.22.1
2
+ * @mui/x-charts v8.23.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -0,0 +1,14 @@
1
+ import type { UseChartKeyboardNavigationSignature } from "./plugins/featurePlugins/useChartKeyboardNavigation/index.js";
2
+ import type { ChartState } from "./plugins/models/chart.js";
3
+ import type { ChartSeriesType } from "../models/seriesType/config.js";
4
+ import type { FocusedItemIdentifier, SeriesId, SeriesItemIdentifier } from "../models/seriesType/index.js";
5
+ type ReturnedItem<OutSeriesType extends ChartSeriesType> = {
6
+ type: OutSeriesType;
7
+ seriesId: SeriesId;
8
+ dataIndex: number;
9
+ } | null;
10
+ export declare function createGetNextIndexFocusedItem<InSeriesType extends Exclude<ChartSeriesType, 'sankey'>, OutSeriesType extends Exclude<ChartSeriesType, 'sankey'> = InSeriesType>(compatibleSeriesTypes: Set<OutSeriesType>): (currentItem: FocusedItemIdentifier<InSeriesType> | null, state: ChartState<[UseChartKeyboardNavigationSignature], []>) => ReturnedItem<OutSeriesType>;
11
+ export declare function createGetPreviousIndexFocusedItem<InSeriesType extends Exclude<ChartSeriesType, 'sankey'>, OutSeriesType extends Exclude<ChartSeriesType, 'sankey'> = InSeriesType>(compatibleSeriesTypes: Set<OutSeriesType>): (currentItem: SeriesItemIdentifier<InSeriesType> | null, state: ChartState<[UseChartKeyboardNavigationSignature], []>) => ReturnedItem<OutSeriesType>;
12
+ export declare function createGetNextSeriesFocusedItem<InSeriesType extends Exclude<ChartSeriesType, 'sankey'>, OutSeriesType extends Exclude<ChartSeriesType, 'sankey'> = InSeriesType>(compatibleSeriesTypes: Set<OutSeriesType>): (currentItem: SeriesItemIdentifier<InSeriesType> | null, state: ChartState<[UseChartKeyboardNavigationSignature], []>) => ReturnedItem<OutSeriesType>;
13
+ export declare function createGetPreviousSeriesFocusedItem<InSeriesType extends Exclude<ChartSeriesType, 'sankey'>, OutSeriesType extends Exclude<ChartSeriesType, 'sankey'> = InSeriesType>(compatibleSeriesTypes: Set<OutSeriesType>): (currentItem: SeriesItemIdentifier<InSeriesType> | null, state: ChartState<[UseChartKeyboardNavigationSignature], []>) => ReturnedItem<OutSeriesType>;
14
+ export {};
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createGetNextIndexFocusedItem = createGetNextIndexFocusedItem;
7
+ exports.createGetNextSeriesFocusedItem = createGetNextSeriesFocusedItem;
8
+ exports.createGetPreviousIndexFocusedItem = createGetPreviousIndexFocusedItem;
9
+ exports.createGetPreviousSeriesFocusedItem = createGetPreviousSeriesFocusedItem;
10
+ var _getPreviousNonEmptySeries = require("./plugins/featurePlugins/useChartKeyboardNavigation/utils/getPreviousNonEmptySeries");
11
+ var _useChartSeries = require("./plugins/corePlugins/useChartSeries");
12
+ var _getNextNonEmptySeries = require("./plugins/featurePlugins/useChartKeyboardNavigation/utils/getNextNonEmptySeries");
13
+ var _seriesHasData = require("./seriesHasData");
14
+ function createGetNextIndexFocusedItem(compatibleSeriesTypes) {
15
+ return function getNextIndexFocusedItem(currentItem, state) {
16
+ const processedSeries = (0, _useChartSeries.selectorChartSeriesProcessed)(state);
17
+ let seriesId = currentItem?.seriesId;
18
+ let type = currentItem?.type;
19
+ if (!type || seriesId == null || !(0, _seriesHasData.seriesHasData)(processedSeries, type, seriesId)) {
20
+ const nextSeries = (0, _getNextNonEmptySeries.getNextNonEmptySeries)(processedSeries, compatibleSeriesTypes, type, seriesId);
21
+ if (nextSeries === null) {
22
+ return null;
23
+ }
24
+ type = nextSeries.type;
25
+ seriesId = nextSeries.seriesId;
26
+ }
27
+ const dataLength = processedSeries[type].series[seriesId].data.length;
28
+ return {
29
+ type,
30
+ seriesId,
31
+ dataIndex: ((currentItem?.dataIndex ?? -1) + 1) % dataLength
32
+ };
33
+ };
34
+ }
35
+ function createGetPreviousIndexFocusedItem(compatibleSeriesTypes) {
36
+ return function getPreviousIndexFocusedItem(currentItem, state) {
37
+ const processedSeries = (0, _useChartSeries.selectorChartSeriesProcessed)(state);
38
+ let seriesId = currentItem?.seriesId;
39
+ let type = currentItem?.type;
40
+ if (!type || seriesId == null || !(0, _seriesHasData.seriesHasData)(processedSeries, type, seriesId)) {
41
+ const previousSeries = (0, _getPreviousNonEmptySeries.getPreviousNonEmptySeries)(processedSeries, compatibleSeriesTypes, type, seriesId);
42
+ if (previousSeries === null) {
43
+ return null;
44
+ }
45
+ type = previousSeries.type;
46
+ seriesId = previousSeries.seriesId;
47
+ }
48
+ const dataLength = processedSeries[type].series[seriesId].data.length;
49
+ return {
50
+ type,
51
+ seriesId,
52
+ dataIndex: (dataLength + (currentItem?.dataIndex ?? 1) - 1) % dataLength
53
+ };
54
+ };
55
+ }
56
+ function createGetNextSeriesFocusedItem(compatibleSeriesTypes) {
57
+ return function getNextSeriesFocusedItem(currentItem, state) {
58
+ const processedSeries = (0, _useChartSeries.selectorChartSeriesProcessed)(state);
59
+ let seriesId = currentItem?.seriesId;
60
+ let type = currentItem?.type;
61
+ const nextSeries = (0, _getNextNonEmptySeries.getNextNonEmptySeries)(processedSeries, compatibleSeriesTypes, type, seriesId);
62
+ if (nextSeries === null) {
63
+ return null; // No series to move the focus to.
64
+ }
65
+ type = nextSeries.type;
66
+ seriesId = nextSeries.seriesId;
67
+ const dataLength = processedSeries[type].series[seriesId].data.length;
68
+ return {
69
+ type,
70
+ seriesId,
71
+ dataIndex: Math.min(dataLength - 1, currentItem?.dataIndex ?? 0)
72
+ };
73
+ };
74
+ }
75
+ function createGetPreviousSeriesFocusedItem(compatibleSeriesTypes) {
76
+ return function getPreviousSeriesFocusedItem(currentItem, state) {
77
+ const processedSeries = (0, _useChartSeries.selectorChartSeriesProcessed)(state);
78
+ let seriesId = currentItem?.seriesId;
79
+ let type = currentItem?.type;
80
+ const previousSeries = (0, _getPreviousNonEmptySeries.getPreviousNonEmptySeries)(processedSeries, compatibleSeriesTypes, type, seriesId);
81
+ if (previousSeries === null) {
82
+ return null; // No series to move the focus to.
83
+ }
84
+ type = previousSeries.type;
85
+ seriesId = previousSeries.seriesId;
86
+ const dataLength = processedSeries[type].series[seriesId].data.length;
87
+ return {
88
+ type,
89
+ seriesId,
90
+ dataIndex: Math.min(dataLength - 1, currentItem?.dataIndex ?? 0)
91
+ };
92
+ };
93
+ }
@@ -47,7 +47,7 @@ export * from "./getLabel.js";
47
47
  export * from "./getSVGPoint.js";
48
48
  export * from "./isDefined.js";
49
49
  export * from "./getScale.js";
50
- export * from "./stackSeries.js";
50
+ export * from "./stacking/index.js";
51
51
  export * from "./getCurve.js";
52
52
  export * from "./consumeSlots.js";
53
53
  export * from "./consumeThemeProps.js";
@@ -554,15 +554,15 @@ Object.keys(_getScale).forEach(function (key) {
554
554
  }
555
555
  });
556
556
  });
557
- var _stackSeries = require("./stackSeries");
558
- Object.keys(_stackSeries).forEach(function (key) {
557
+ var _stacking = require("./stacking");
558
+ Object.keys(_stacking).forEach(function (key) {
559
559
  if (key === "default" || key === "__esModule") return;
560
560
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
561
- if (key in exports && exports[key] === _stackSeries[key]) return;
561
+ if (key in exports && exports[key] === _stacking[key]) return;
562
562
  Object.defineProperty(exports, key, {
563
563
  enumerable: true,
564
564
  get: function () {
565
- return _stackSeries[key];
565
+ return _stacking[key];
566
566
  }
567
567
  });
568
568
  });
@@ -0,0 +1,13 @@
1
+ import type { ChartSeriesType } from "../../../../models/seriesType/config.js";
2
+ import type { FocusedItemIdentifier } from "../../../../models/seriesType/index.js";
3
+ import type { UseChartKeyboardNavigationSignature } from "./useChartKeyboardNavigation.types.js";
4
+ import type { ChartState } from "../../models/chart.js";
5
+ export type FocusedItemUpdater<TSeriesType extends ChartSeriesType, OutputSeriesType extends ChartSeriesType = ChartSeriesType> = (currentItem: (TSeriesType extends any ? FocusedItemIdentifier<TSeriesType> : never) | null, state: ChartState<[UseChartKeyboardNavigationSignature], []>) => FocusedItemIdentifier<OutputSeriesType> | null;
6
+ /**
7
+ * Get the next focusable item in the chart.
8
+ * @param {SeriesItemIdentifier<TSeriesType> | null} currentItem The current focused item.
9
+ * @param {KeyboardEvent} event The keyboard event that triggered the navigation.
10
+ * @param {ChartState<[UseChartKeyboardNavigationSignature], []>} state The current chart state.
11
+ * @returns {SeriesItemIdentifier<ChartSeriesType> | null} The next focusable item or null if none found.
12
+ */
13
+ export type KeyboardFocusHandler<TSeriesType extends ChartSeriesType, OutputSeriesType extends ChartSeriesType = ChartSeriesType> = (event: KeyboardEvent) => FocusedItemUpdater<TSeriesType, OutputSeriesType> | null;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -1,3 +1,3 @@
1
- import { type ChartPlugin } from "../../models/index.js";
2
- import { type UseChartKeyboardNavigationSignature } from "./useChartKeyboardNavigation.types.js";
1
+ import type { ChartPlugin } from "../../models/index.js";
2
+ import type { UseChartKeyboardNavigationSignature } from "./useChartKeyboardNavigation.types.js";
3
3
  export declare const useChartKeyboardNavigation: ChartPlugin<UseChartKeyboardNavigationSignature>;