@mui/x-charts 8.22.0 → 8.22.1

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 (130) hide show
  1. package/BarChart/BarLabel/BarLabel.types.d.ts +3 -3
  2. package/BarChart/BarLabel/BarLabelItem.d.ts +1 -1
  3. package/BarChart/BarLabel/BarLabelPlot.d.ts +9 -9
  4. package/BarChart/BarLabel/getBarLabel.d.ts +3 -3
  5. package/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.ts +18 -1
  6. package/CHANGELOG.md +101 -0
  7. package/ChartsAxisHighlight/ChartsXAxisHighlight.js +2 -3
  8. package/ChartsAxisHighlight/ChartsYAxisHighlight.js +2 -3
  9. package/ChartsBrushOverlay/ChartsBrushOverlay.js +6 -7
  10. package/ChartsSurface/ChartsSurface.js +7 -8
  11. package/ChartsTooltip/ChartsTooltipContainer.js +4 -5
  12. package/ChartsTooltip/useAxisTooltip.js +3 -4
  13. package/ChartsTooltip/useItemTooltip.js +2 -3
  14. package/ChartsWrapper/ChartsWrapper.js +2 -3
  15. package/LineChart/LineHighlightPlot.js +1 -2
  16. package/LineChart/MarkPlot.js +1 -2
  17. package/PieChart/FocusedPieArc.d.ts +2 -0
  18. package/PieChart/FocusedPieArc.js +58 -0
  19. package/PieChart/PieArcPlot.js +3 -31
  20. package/PieChart/PieChart.js +2 -1
  21. package/PieChart/dataTransform/getModifiedArcProperties.d.ts +11 -0
  22. package/PieChart/dataTransform/getModifiedArcProperties.js +42 -0
  23. package/PieChart/dataTransform/useTransformData.js +15 -20
  24. package/PieChart/seriesConfig/tooltipPosition.js +11 -20
  25. package/RadarChart/RadarAxis/useRadarAxis.js +1 -2
  26. package/RadarChart/RadarAxisHighlight/useRadarAxisHighlight.js +3 -4
  27. package/RadarChart/RadarGrid/useRadarGridData.js +1 -2
  28. package/RadarChart/RadarSeriesPlot/useRadarRotationIndex.js +1 -2
  29. package/ScatterChart/BatchScatter.js +4 -5
  30. package/ScatterChart/Scatter.js +1 -2
  31. package/esm/BarChart/BarLabel/BarLabel.types.d.ts +3 -3
  32. package/esm/BarChart/BarLabel/BarLabelItem.d.ts +1 -1
  33. package/esm/BarChart/BarLabel/BarLabelPlot.d.ts +9 -9
  34. package/esm/BarChart/BarLabel/getBarLabel.d.ts +3 -3
  35. package/esm/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.ts +18 -1
  36. package/esm/ChartsAxisHighlight/ChartsXAxisHighlight.js +2 -3
  37. package/esm/ChartsAxisHighlight/ChartsYAxisHighlight.js +2 -3
  38. package/esm/ChartsBrushOverlay/ChartsBrushOverlay.js +6 -7
  39. package/esm/ChartsSurface/ChartsSurface.js +7 -8
  40. package/esm/ChartsTooltip/ChartsTooltipContainer.js +4 -5
  41. package/esm/ChartsTooltip/useAxisTooltip.js +3 -4
  42. package/esm/ChartsTooltip/useItemTooltip.js +2 -3
  43. package/esm/ChartsWrapper/ChartsWrapper.js +2 -3
  44. package/esm/LineChart/LineHighlightPlot.js +1 -2
  45. package/esm/LineChart/MarkPlot.js +1 -2
  46. package/esm/PieChart/FocusedPieArc.d.ts +2 -0
  47. package/esm/PieChart/FocusedPieArc.js +51 -0
  48. package/esm/PieChart/PieArcPlot.js +5 -33
  49. package/esm/PieChart/PieChart.js +2 -1
  50. package/esm/PieChart/dataTransform/getModifiedArcProperties.d.ts +11 -0
  51. package/esm/PieChart/dataTransform/getModifiedArcProperties.js +36 -0
  52. package/esm/PieChart/dataTransform/useTransformData.js +15 -20
  53. package/esm/PieChart/seriesConfig/tooltipPosition.js +11 -20
  54. package/esm/RadarChart/RadarAxis/useRadarAxis.js +1 -2
  55. package/esm/RadarChart/RadarAxisHighlight/useRadarAxisHighlight.js +3 -4
  56. package/esm/RadarChart/RadarGrid/useRadarGridData.js +1 -2
  57. package/esm/RadarChart/RadarSeriesPlot/useRadarRotationIndex.js +1 -2
  58. package/esm/ScatterChart/BatchScatter.js +4 -5
  59. package/esm/ScatterChart/Scatter.js +1 -2
  60. package/esm/hooks/useAxis.js +8 -9
  61. package/esm/hooks/useAxisSystem.js +2 -3
  62. package/esm/hooks/useBrush.js +1 -2
  63. package/esm/hooks/useChartId.js +1 -2
  64. package/esm/hooks/useDataset.js +1 -2
  65. package/esm/hooks/useDrawingArea.js +1 -2
  66. package/esm/hooks/useFocusedItem.js +3 -4
  67. package/esm/hooks/useInteractionItemProps.d.ts +3 -2
  68. package/esm/hooks/useInteractionItemProps.js +13 -2
  69. package/esm/hooks/useIsItemFocused.js +1 -2
  70. package/esm/hooks/useItemHighlighted.js +2 -3
  71. package/esm/hooks/useItemHighlightedGetter.js +2 -3
  72. package/esm/hooks/useLegend.js +1 -2
  73. package/esm/hooks/usePieSeries.js +1 -2
  74. package/esm/hooks/useSeries.js +1 -2
  75. package/esm/hooks/useSkipAnimation.js +1 -2
  76. package/esm/hooks/useZAxis.js +1 -2
  77. package/esm/index.js +1 -1
  78. package/esm/internals/index.d.ts +0 -1
  79. package/esm/internals/index.js +0 -1
  80. package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +1 -2
  81. package/esm/internals/plugins/corePlugins/useChartSeries/useColorProcessor.js +1 -2
  82. package/esm/internals/plugins/featurePlugins/useChartBrush/useChartBrush.js +1 -2
  83. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +5 -6
  84. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useInternalIsZoomInteracting.js +1 -2
  85. package/esm/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.js +5 -6
  86. package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +4 -1
  87. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +6 -7
  88. package/esm/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.types.d.ts +7 -6
  89. package/esm/internals/plugins/models/seriesConfig/tooltipGetter.types.d.ts +4 -3
  90. package/esm/internals/plugins/models/seriesConfig/tooltipItemPositionGetter.types.d.ts +3 -2
  91. package/esm/internals/seriesSelectorOfType.js +2 -3
  92. package/esm/models/seriesType/config.d.ts +0 -2
  93. package/hooks/useAxis.js +8 -9
  94. package/hooks/useAxisSystem.js +2 -3
  95. package/hooks/useBrush.js +1 -2
  96. package/hooks/useChartId.js +1 -2
  97. package/hooks/useDataset.js +1 -2
  98. package/hooks/useDrawingArea.js +1 -2
  99. package/hooks/useFocusedItem.js +3 -4
  100. package/hooks/useInteractionItemProps.d.ts +3 -2
  101. package/hooks/useInteractionItemProps.js +13 -2
  102. package/hooks/useIsItemFocused.js +1 -2
  103. package/hooks/useItemHighlighted.js +2 -3
  104. package/hooks/useItemHighlightedGetter.js +2 -3
  105. package/hooks/useLegend.js +1 -2
  106. package/hooks/usePieSeries.js +1 -2
  107. package/hooks/useSeries.js +1 -2
  108. package/hooks/useSkipAnimation.js +1 -2
  109. package/hooks/useZAxis.js +1 -2
  110. package/index.js +1 -1
  111. package/internals/index.d.ts +0 -1
  112. package/internals/index.js +0 -12
  113. package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +1 -2
  114. package/internals/plugins/corePlugins/useChartSeries/useColorProcessor.js +1 -2
  115. package/internals/plugins/featurePlugins/useChartBrush/useChartBrush.js +1 -2
  116. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +5 -6
  117. package/internals/plugins/featurePlugins/useChartCartesianAxis/useInternalIsZoomInteracting.js +1 -2
  118. package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.js +5 -6
  119. package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +4 -1
  120. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +6 -7
  121. package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.types.d.ts +7 -6
  122. package/internals/plugins/models/seriesConfig/tooltipGetter.types.d.ts +4 -3
  123. package/internals/plugins/models/seriesConfig/tooltipItemPositionGetter.types.d.ts +3 -2
  124. package/internals/seriesSelectorOfType.js +2 -3
  125. package/models/seriesType/config.d.ts +0 -2
  126. package/package.json +1 -1
  127. package/esm/internals/store/useSelector.d.ts +0 -2
  128. package/esm/internals/store/useSelector.js +0 -2
  129. package/internals/store/useSelector.d.ts +0 -2
  130. package/internals/store/useSelector.js +0 -8
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.getModifiedArcProperties = getModifiedArcProperties;
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+ var _angleConversion = require("../../internals/angleConversion");
10
+ /**
11
+ * Function that returns arc properties after applying transformation from highlight/fade states.
12
+ */
13
+ function getModifiedArcProperties(seriesDef, seriesLayout, isHighlighted, isFaded) {
14
+ const {
15
+ faded,
16
+ highlighted,
17
+ paddingAngle: basePaddingAngle = 0,
18
+ cornerRadius: baseCornerRadius = 0
19
+ } = seriesDef;
20
+ const {
21
+ radius: {
22
+ inner: baseInnerRadius = 0,
23
+ label: baseArcLabelRadius,
24
+ outer: baseOuterRadius
25
+ }
26
+ } = seriesLayout;
27
+ const attributesOverride = (0, _extends2.default)({
28
+ additionalRadius: 0
29
+ }, isFaded && faded || isHighlighted && highlighted || {});
30
+ const paddingAngle = Math.max(0, (0, _angleConversion.deg2rad)(attributesOverride.paddingAngle ?? basePaddingAngle));
31
+ const innerRadius = Math.max(0, attributesOverride.innerRadius ?? baseInnerRadius);
32
+ const outerRadius = Math.max(0, attributesOverride.outerRadius ?? baseOuterRadius + attributesOverride.additionalRadius);
33
+ const cornerRadius = attributesOverride.cornerRadius ?? baseCornerRadius;
34
+ const arcLabelRadius = attributesOverride.arcLabelRadius ?? baseArcLabelRadius ?? (innerRadius + outerRadius) / 2;
35
+ return {
36
+ paddingAngle,
37
+ innerRadius,
38
+ outerRadius,
39
+ cornerRadius,
40
+ arcLabelRadius
41
+ };
42
+ }
@@ -11,18 +11,13 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
11
11
  var React = _interopRequireWildcard(require("react"));
12
12
  var _useItemHighlightedGetter = require("../../hooks/useItemHighlightedGetter");
13
13
  var _useIsItemFocusedGetter = require("../../hooks/useIsItemFocusedGetter");
14
- var _angleConversion = require("../../internals/angleConversion");
14
+ var _getModifiedArcProperties = require("./getModifiedArcProperties");
15
15
  function useTransformData(series) {
16
16
  const {
17
17
  id: seriesId,
18
18
  data,
19
19
  faded,
20
- highlighted,
21
- paddingAngle: basePaddingAngle = 0,
22
- innerRadius: baseInnerRadius = 0,
23
- arcLabelRadius: baseArcLabelRadius,
24
- outerRadius: baseOuterRadius,
25
- cornerRadius: baseCornerRadius = 0
20
+ highlighted
26
21
  } = series;
27
22
  const {
28
23
  isFaded: isItemFaded,
@@ -41,25 +36,25 @@ function useTransformData(series) {
41
36
  seriesId,
42
37
  dataIndex: itemIndex
43
38
  });
39
+
40
+ // TODO v9: Replace the second argument with the result of useSeriesLayout
41
+ const arcSizes = (0, _getModifiedArcProperties.getModifiedArcProperties)(series, {
42
+ radius: {
43
+ inner: series.innerRadius ?? 0,
44
+ outer: series.outerRadius,
45
+ label: series.arcLabelRadius ?? 0,
46
+ available: 0
47
+ }
48
+ }, isHighlighted, isFaded);
44
49
  const attributesOverride = (0, _extends2.default)({
45
50
  additionalRadius: 0
46
51
  }, isFaded && faded || isHighlighted && highlighted || {});
47
- const paddingAngle = Math.max(0, (0, _angleConversion.deg2rad)(attributesOverride.paddingAngle ?? basePaddingAngle));
48
- const innerRadius = Math.max(0, attributesOverride.innerRadius ?? baseInnerRadius);
49
- const outerRadius = Math.max(0, attributesOverride.outerRadius ?? baseOuterRadius + attributesOverride.additionalRadius);
50
- const cornerRadius = attributesOverride.cornerRadius ?? baseCornerRadius;
51
- const arcLabelRadius = attributesOverride.arcLabelRadius ?? baseArcLabelRadius ?? (innerRadius + outerRadius) / 2;
52
52
  return (0, _extends2.default)({}, item, attributesOverride, {
53
53
  dataIndex: itemIndex,
54
54
  isFaded,
55
55
  isHighlighted,
56
- isFocused,
57
- paddingAngle,
58
- innerRadius,
59
- outerRadius,
60
- cornerRadius,
61
- arcLabelRadius
62
- });
63
- }), [baseCornerRadius, baseInnerRadius, baseOuterRadius, basePaddingAngle, baseArcLabelRadius, data, faded, highlighted, isItemFaded, isItemHighlighted, isItemFocused, seriesId]);
56
+ isFocused
57
+ }, arcSizes);
58
+ }), [data, seriesId, isItemHighlighted, isItemFaded, isItemFocused, series, faded, highlighted]);
64
59
  return dataWithHighlight;
65
60
  }
@@ -5,46 +5,37 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _findMinMax = require("../../internals/findMinMax");
8
- var _getPercentageValue = require("../../internals/getPercentageValue");
9
- var _getPieCoordinates = require("../getPieCoordinates");
10
8
  const tooltipItemPositionGetter = params => {
11
9
  const {
12
10
  series,
13
- drawingArea,
14
11
  identifier,
15
- placement
12
+ placement,
13
+ seriesLayout
16
14
  } = params;
17
15
  if (!identifier || identifier.dataIndex === undefined) {
18
16
  return null;
19
17
  }
20
18
  const itemSeries = series.pie?.series[identifier.seriesId];
21
- if (itemSeries == null) {
19
+ const layout = seriesLayout.pie?.[identifier.seriesId];
20
+ if (itemSeries == null || layout == null) {
22
21
  return null;
23
22
  }
24
23
  const {
25
- cx,
26
- cy,
27
- availableRadius
28
- } = (0, _getPieCoordinates.getPieCoordinates)({
29
- cx: itemSeries.cx,
30
- cy: itemSeries.cy
31
- }, drawingArea);
24
+ center,
25
+ radius
26
+ } = layout;
32
27
  const {
33
- data,
34
- innerRadius: baseInnerRadius = 0,
35
- outerRadius: baseOuterRadius
28
+ data
36
29
  } = itemSeries;
37
- const innerRadius = Math.max(0, (0, _getPercentageValue.getPercentageValue)(baseInnerRadius ?? 0, availableRadius));
38
- const outerRadius = Math.max(0, (0, _getPercentageValue.getPercentageValue)(baseOuterRadius ?? availableRadius, availableRadius));
39
30
  const dataItem = data[identifier.dataIndex];
40
31
  if (!dataItem) {
41
32
  return null;
42
33
  }
43
34
 
44
35
  // Compute the 4 corner points of the arc to get the bounding box.
45
- const points = [[innerRadius, dataItem.startAngle], [innerRadius, dataItem.endAngle], [outerRadius, dataItem.startAngle], [outerRadius, dataItem.endAngle]].map(([radius, angle]) => ({
46
- x: cx + radius * Math.sin(angle),
47
- y: cy - radius * Math.cos(angle)
36
+ const points = [[radius.inner, dataItem.startAngle], [radius.inner, dataItem.endAngle], [radius.outer, dataItem.startAngle], [radius.outer, dataItem.endAngle]].map(([r, angle]) => ({
37
+ x: center.x + r * Math.sin(angle),
38
+ y: center.y - r * Math.cos(angle)
48
39
  }));
49
40
  const [x0, x1] = (0, _findMinMax.findMinMax)(points.map(p => p.x));
50
41
  const [y0, y1] = (0, _findMinMax.findMinMax)(points.map(p => p.y));
@@ -12,7 +12,6 @@ var _useChartPolarAxis = require("../../internals/plugins/featurePlugins/useChar
12
12
  var _scaleGuards = require("../../internals/scaleGuards");
13
13
  var _degToRad = require("../../internals/degToRad");
14
14
  var _clampAngle = require("../../internals/clampAngle");
15
- var _useSelector = require("../../internals/store/useSelector");
16
15
  var _angleConversion = require("../../internals/angleConversion");
17
16
  /**
18
17
  * Returns an array with on item par metrics with the different point to label.
@@ -34,7 +33,7 @@ function useRadarAxis(params) {
34
33
  const {
35
34
  cx,
36
35
  cy
37
- } = (0, _useSelector.useSelector)(store, _useChartPolarAxis.selectorChartPolarCenter);
36
+ } = store.use(_useChartPolarAxis.selectorChartPolarCenter);
38
37
  if (metric === undefined || !rotationScale || rotationScale.domain().length === 0) {
39
38
  return null;
40
39
  }
@@ -7,7 +7,6 @@ exports.useRadarAxisHighlight = useRadarAxisHighlight;
7
7
  var _useAxis = require("../../hooks/useAxis");
8
8
  var _useRadarSeries = require("../../hooks/useRadarSeries");
9
9
  var _useScale = require("../../hooks/useScale");
10
- var _useSelector = require("../../internals/store/useSelector");
11
10
  var _useStore = require("../../internals/store/useStore");
12
11
  var _useChartContext = require("../../context/ChartProvider/useChartContext");
13
12
  var _useChartPolarAxis = require("../../internals/plugins/featurePlugins/useChartPolarAxis");
@@ -23,9 +22,9 @@ function useRadarAxisHighlight() {
23
22
  instance
24
23
  } = (0, _useChartContext.useChartContext)();
25
24
  const store = (0, _useStore.useStore)();
26
- const rotationAxisIndex = (0, _useSelector.useSelector)(store, _useChartPolarInteraction.selectorChartsInteractionRotationAxisIndex);
27
- const rotationAxisValue = (0, _useSelector.useSelector)(store, _useChartPolarInteraction.selectorChartsInteractionRotationAxisValue);
28
- const center = (0, _useSelector.useSelector)(store, _useChartPolarAxis.selectorChartPolarCenter);
25
+ const rotationAxisIndex = store.use(_useChartPolarInteraction.selectorChartsInteractionRotationAxisIndex);
26
+ const rotationAxisValue = store.use(_useChartPolarInteraction.selectorChartsInteractionRotationAxisValue);
27
+ const center = store.use(_useChartPolarAxis.selectorChartPolarCenter);
29
28
  const highlightedIndex = rotationAxisIndex;
30
29
  if (!rotationScale) {
31
30
  return null;
@@ -8,7 +8,6 @@ var _useScale = require("../../hooks/useScale");
8
8
  var _hooks = require("../../hooks");
9
9
  var _useChartPolarAxis = require("../../internals/plugins/featurePlugins/useChartPolarAxis");
10
10
  var _useChartContext = require("../../context/ChartProvider/useChartContext");
11
- var _useSelector = require("../../internals/store/useSelector");
12
11
  function useRadarGridData() {
13
12
  const {
14
13
  instance,
@@ -21,7 +20,7 @@ function useRadarGridData() {
21
20
  const {
22
21
  cx,
23
22
  cy
24
- } = (0, _useSelector.useSelector)(store, _useChartPolarAxis.selectorChartPolarCenter);
23
+ } = store.use(_useChartPolarAxis.selectorChartPolarCenter);
25
24
  if (!rotationScale || rotationScale.domain().length === 0) {
26
25
  return null;
27
26
  }
@@ -9,7 +9,6 @@ var React = _interopRequireWildcard(require("react"));
9
9
  var _useChartPolarAxis = require("../../internals/plugins/featurePlugins/useChartPolarAxis");
10
10
  var _getSVGPoint = require("../../internals/getSVGPoint");
11
11
  var _coordinateTransformation = require("../../internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation");
12
- var _useSelector = require("../../internals/store/useSelector");
13
12
  var _getAxisIndex = require("../../internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex");
14
13
  var _useStore = require("../../internals/store/useStore");
15
14
  var _useSvgRef = require("../../hooks/useSvgRef");
@@ -22,7 +21,7 @@ function useRadarRotationIndex() {
22
21
  const svgRef = (0, _useSvgRef.useSvgRef)();
23
22
  const store = (0, _useStore.useStore)();
24
23
  const rotationAxis = (0, _useAxis.useRotationAxis)();
25
- const center = (0, _useSelector.useSelector)(store, _useChartPolarAxis.selectorChartPolarCenter);
24
+ const center = store.use(_useChartPolarAxis.selectorChartPolarCenter);
26
25
  const rotationIndexGetter = React.useCallback(function rotationIndexGetter(event) {
27
26
  const element = svgRef.current;
28
27
  if (!element || !rotationAxis) {
@@ -11,7 +11,6 @@ var _styles = require("@mui/material/styles");
11
11
  var _scatterClasses = require("./scatterClasses");
12
12
  var _ChartProvider = require("../context/ChartProvider");
13
13
  var _useScale = require("../hooks/useScale");
14
- var _useSelector = require("../internals/store/useSelector");
15
14
  var _useChartHighlight = require("../internals/plugins/featurePlugins/useChartHighlight");
16
15
  var _jsxRuntime = require("react/jsx-runtime");
17
16
  const MAX_POINTS_PER_PATH = 1000;
@@ -125,10 +124,10 @@ function BatchScatter(props) {
125
124
  const {
126
125
  store
127
126
  } = (0, _ChartProvider.useChartContext)();
128
- const isSeriesHighlighted = (0, _useSelector.useSelector)(store, _useChartHighlight.selectorChartIsSeriesHighlighted, series.id);
129
- const isSeriesFaded = (0, _useSelector.useSelector)(store, _useChartHighlight.selectorChartIsSeriesFaded, series.id);
130
- const seriesHighlightedItem = (0, _useSelector.useSelector)(store, _useChartHighlight.selectorChartSeriesHighlightedItem, series.id);
131
- const seriesUnfadedItem = (0, _useSelector.useSelector)(store, _useChartHighlight.selectorChartSeriesUnfadedItem, series.id);
127
+ const isSeriesHighlighted = store.use(_useChartHighlight.selectorChartIsSeriesHighlighted, series.id);
128
+ const isSeriesFaded = store.use(_useChartHighlight.selectorChartIsSeriesFaded, series.id);
129
+ const seriesHighlightedItem = store.use(_useChartHighlight.selectorChartSeriesHighlightedItem, series.id);
130
+ const seriesUnfadedItem = store.use(_useChartHighlight.selectorChartSeriesUnfadedItem, series.id);
132
131
  const highlightedModifier = 1.2;
133
132
  const markerSize = series.markerSize * (isSeriesHighlighted ? highlightedModifier : 1);
134
133
  const classes = (0, _scatterClasses.useUtilityClasses)(inClasses);
@@ -14,7 +14,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
14
14
  var _useSlotProps2 = _interopRequireDefault(require("@mui/utils/useSlotProps"));
15
15
  var _useInteractionItemProps = require("../hooks/useInteractionItemProps");
16
16
  var _useStore = require("../internals/store/useStore");
17
- var _useSelector = require("../internals/store/useSelector");
18
17
  var _useItemHighlightedGetter = require("../hooks/useItemHighlightedGetter");
19
18
  var _useChartClosestPoint = require("../internals/plugins/featurePlugins/useChartClosestPoint");
20
19
  var _ScatterMarker = require("./ScatterMarker");
@@ -48,7 +47,7 @@ function Scatter(props) {
48
47
  instance
49
48
  } = (0, _ChartProvider.useChartContext)();
50
49
  const store = (0, _useStore.useStore)();
51
- const isVoronoiEnabled = (0, _useSelector.useSelector)(store, _useChartClosestPoint.selectorChartsIsVoronoiEnabled);
50
+ const isVoronoiEnabled = store.use(_useChartClosestPoint.selectorChartsIsVoronoiEnabled);
52
51
  const skipInteractionHandlers = isVoronoiEnabled || series.disableHover;
53
52
  const {
54
53
  isFaded,
@@ -11,7 +11,7 @@ export interface BarLabelOwnerState {
11
11
  layout: 'vertical' | 'horizontal';
12
12
  classes?: Partial<BarLabelClasses>;
13
13
  }
14
- export type BarItem<V extends BarValueType | null = BarValueType | null> = {
14
+ export type BarItem = {
15
15
  /**
16
16
  * The series id of the bar.
17
17
  */
@@ -23,7 +23,7 @@ export type BarItem<V extends BarValueType | null = BarValueType | null> = {
23
23
  /**
24
24
  * The value of the data point.
25
25
  */
26
- value: V;
26
+ value: BarValueType | null;
27
27
  };
28
28
  export type BarLabelContext = {
29
29
  bar: {
@@ -39,4 +39,4 @@ export type BarLabelContext = {
39
39
  width: number;
40
40
  };
41
41
  };
42
- export type BarLabelFunction<V extends BarValueType | null = BarValueType | null> = (item: BarItem<V>, context: BarLabelContext) => string | null | undefined;
42
+ export type BarLabelFunction = (item: BarItem, context: BarLabelContext) => string | null | undefined;
@@ -67,7 +67,7 @@ export type BarLabelItemProps<V extends BarValueType | null> = Omit<BarLabelOwne
67
67
  * @param {BarLabelContext} context data about the bar.
68
68
  * @returns {string} The formatted label.
69
69
  */
70
- barLabel?: 'value' | ((item: BarItem<V>, context: BarLabelContext) => string | null | undefined);
70
+ barLabel?: 'value' | ((item: BarItem, context: BarLabelContext) => string | null | undefined);
71
71
  /**
72
72
  * The placement of the bar label.
73
73
  * It controls whether the label is rendered in the center or outside the bar.
@@ -3,29 +3,29 @@ import { type BarLabelItemProps } from "./BarLabelItem.js";
3
3
  import type { SeriesId } from "../../models/seriesType/common.js";
4
4
  import { type BarSeriesType, type BarValueType } from "../../models/seriesType/bar.js";
5
5
  import { type BarLabelFunction } from "./BarLabel.types.js";
6
- interface BarLabelPlotProps<V extends BarValueType | null = BarValueType | null> {
7
- processedSeries: ProcessedBarLabelSeriesData<V>;
6
+ interface BarLabelPlotProps {
7
+ processedSeries: ProcessedBarLabelSeriesData;
8
8
  className: string;
9
9
  skipAnimation?: boolean;
10
- barLabel?: BarLabelItemProps<V | null>['barLabel'];
10
+ barLabel?: BarLabelItemProps<BarValueType | null>['barLabel'];
11
11
  }
12
- export interface ProcessedBarLabelSeriesData<V extends BarValueType | null> {
12
+ export interface ProcessedBarLabelSeriesData {
13
13
  seriesId: SeriesId;
14
- data: ProcessedBarLabelData<V>[];
15
- barLabel?: 'value' | BarLabelFunction<V>;
14
+ data: ProcessedBarLabelData[];
15
+ barLabel?: 'value' | BarLabelFunction;
16
16
  barLabelPlacement?: BarSeriesType['barLabelPlacement'];
17
17
  layout?: 'vertical' | 'horizontal';
18
18
  xOrigin: number;
19
19
  yOrigin: number;
20
20
  }
21
- export interface ProcessedBarLabelData<V extends BarValueType | null> extends AnimationData {
21
+ export interface ProcessedBarLabelData extends AnimationData {
22
22
  seriesId: SeriesId;
23
23
  dataIndex: number;
24
24
  color: string;
25
- value: V;
25
+ value: BarValueType | null;
26
26
  }
27
27
  /**
28
28
  * @ignore - internal component.
29
29
  */
30
- declare function BarLabelPlot<V extends BarValueType | null = BarValueType | null>(props: BarLabelPlotProps<V>): import("react/jsx-runtime").JSX.Element | null;
30
+ declare function BarLabelPlot(props: BarLabelPlotProps): import("react/jsx-runtime").JSX.Element | null;
31
31
  export { BarLabelPlot };
@@ -1,9 +1,9 @@
1
1
  import { type SeriesId } from "../../models/seriesType/common.js";
2
2
  import { type BarLabelFunction } from "./BarLabel.types.js";
3
3
  import { type BarValueType } from "../../models/seriesType/bar.js";
4
- export declare function getBarLabel<V extends BarValueType | null = BarValueType | null>(options: {
5
- barLabel: 'value' | BarLabelFunction<V>;
6
- value: V;
4
+ export declare function getBarLabel(options: {
5
+ barLabel: 'value' | BarLabelFunction;
6
+ value: BarValueType | null;
7
7
  dataIndex: number;
8
8
  seriesId: SeriesId;
9
9
  height: number;
@@ -1,5 +1,22 @@
1
1
  import { type AllSeriesType } from "../../../models/seriesType/index.js";
2
- export declare function getSeriesWithDefaultValues<T extends 'bar'>(seriesData: AllSeriesType<T>, seriesIndex: number, colors: readonly string[]): AllSeriesType<T> & {
2
+ export declare function getSeriesWithDefaultValues(seriesData: AllSeriesType<'bar'>, seriesIndex: number, colors: readonly string[]): {
3
3
  id: import("../../../index.js").SeriesId;
4
4
  color: string;
5
+ type: "bar";
6
+ data?: ReadonlyArray<import("../../../index.js").BarValueType | null>;
7
+ dataKey?: string;
8
+ label?: string | ((location: "tooltip" | "legend") => string);
9
+ layout?: "horizontal" | "vertical";
10
+ stackOffset?: import("../../../index.js").StackOffsetType;
11
+ minBarSize?: number;
12
+ barLabel?: "value" | ((item: import("../../index.js").BarItem, context: import("../../index.js").BarLabelContext) => string | null | undefined);
13
+ barLabelPlacement?: "center" | "outside";
14
+ valueFormatter?: import("../../../internals/index.js").SeriesValueFormatter<number | null> | undefined;
15
+ highlightScope?: import("../../../index.js").HighlightScope;
16
+ labelMarkType?: import("../../../internals/index.js").ChartsLabelMarkType;
17
+ colorGetter?: ((data: import("../../../internals/index.js").ColorCallbackValue<number | null>) => string) | undefined;
18
+ xAxisId?: import("../../../internals/index.js").AxisId;
19
+ yAxisId?: import("../../../internals/index.js").AxisId;
20
+ stack?: string;
21
+ stackOrder?: import("../../../index.js").StackOrderType;
5
22
  };
@@ -3,7 +3,6 @@
3
3
  import * as React from 'react';
4
4
  import { getValueToPositionMapper } from "../hooks/useScale.js";
5
5
  import { isOrdinalScale } from "../internals/scaleGuards.js";
6
- import { useSelector } from "../internals/store/useSelector.js";
7
6
  import { useStore } from "../internals/store/useStore.js";
8
7
  import { selectorChartsHighlightXAxisValue, selectorChartXAxis } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
9
8
  import { useDrawingArea } from "../hooks/index.js";
@@ -22,8 +21,8 @@ export default function ChartsXHighlight(props) {
22
21
  height
23
22
  } = useDrawingArea();
24
23
  const store = useStore();
25
- const axisXValues = useSelector(store, selectorChartsHighlightXAxisValue);
26
- const xAxes = useSelector(store, selectorChartXAxis);
24
+ const axisXValues = store.use(selectorChartsHighlightXAxisValue);
25
+ const xAxes = store.use(selectorChartXAxis);
27
26
  if (axisXValues.length === 0) {
28
27
  return null;
29
28
  }
@@ -3,7 +3,6 @@
3
3
  import * as React from 'react';
4
4
  import { getValueToPositionMapper } from "../hooks/useScale.js";
5
5
  import { isOrdinalScale } from "../internals/scaleGuards.js";
6
- import { useSelector } from "../internals/store/useSelector.js";
7
6
  import { useStore } from "../internals/store/useStore.js";
8
7
  import { selectorChartsHighlightYAxisValue, selectorChartYAxis } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
9
8
  import { useDrawingArea } from "../hooks/index.js";
@@ -22,8 +21,8 @@ export default function ChartsYHighlight(props) {
22
21
  width
23
22
  } = useDrawingArea();
24
23
  const store = useStore();
25
- const axisYValues = useSelector(store, selectorChartsHighlightYAxisValue);
26
- const yAxes = useSelector(store, selectorChartYAxis);
24
+ const axisYValues = store.use(selectorChartsHighlightYAxisValue);
25
+ const yAxes = store.use(selectorChartYAxis);
27
26
  if (axisYValues.length === 0) {
28
27
  return null;
29
28
  }
@@ -7,7 +7,6 @@ import { useTheme } from '@mui/material/styles';
7
7
  import { brushOverlayClasses } from "./ChartsBrushOverlay.classes.js";
8
8
  import { selectorChartDrawingArea } from "../internals/plugins/corePlugins/useChartDimensions/index.js";
9
9
  import { selectorBrushStartX, selectorBrushStartY, selectorBrushCurrentX, selectorBrushCurrentY, selectorBrushConfig } from "../internals/plugins/featurePlugins/useChartBrush/index.js";
10
- import { useSelector } from "../internals/store/useSelector.js";
11
10
  import { useStore } from "../internals/store/useStore.js";
12
11
  import { jsx as _jsx } from "react/jsx-runtime";
13
12
  function BrushRect(props) {
@@ -23,13 +22,13 @@ function BrushRect(props) {
23
22
  */
24
23
  export function ChartsBrushOverlay(props) {
25
24
  const store = useStore();
26
- const drawingArea = useSelector(store, selectorChartDrawingArea);
25
+ const drawingArea = store.use(selectorChartDrawingArea);
27
26
  const theme = useTheme();
28
- const brushStartX = useSelector(store, selectorBrushStartX);
29
- const brushStartY = useSelector(store, selectorBrushStartY);
30
- const brushCurrentX = useSelector(store, selectorBrushCurrentX);
31
- const brushCurrentY = useSelector(store, selectorBrushCurrentY);
32
- const brushConfig = useSelector(store, selectorBrushConfig);
27
+ const brushStartX = store.use(selectorBrushStartX);
28
+ const brushStartY = store.use(selectorBrushStartY);
29
+ const brushCurrentX = store.use(selectorBrushCurrentX);
30
+ const brushCurrentY = store.use(selectorBrushCurrentY);
31
+ const brushConfig = store.use(selectorBrushConfig);
33
32
  if (brushStartX === null || brushStartY === null || brushCurrentX === null || brushCurrentY === null) {
34
33
  return null;
35
34
  }
@@ -10,7 +10,6 @@ import useForkRef from '@mui/utils/useForkRef';
10
10
  import clsx from 'clsx';
11
11
  import { ChartsAxesGradients } from "../internals/components/ChartsAxesGradients/index.js";
12
12
  import { useSvgRef } from "../hooks/useSvgRef.js";
13
- import { useSelector } from "../internals/store/useSelector.js";
14
13
  import { useStore } from "../internals/store/useStore.js";
15
14
  import { selectorChartPropsHeight, selectorChartPropsWidth, selectorChartSvgWidth, selectorChartSvgHeight } from "../internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js";
16
15
  import { selectorChartsHasFocusedItem, selectorChartsIsKeyboardNavigationEnabled } from "../internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js";
@@ -57,13 +56,13 @@ const ChartsSurfaceStyles = styled('svg', {
57
56
  */
58
57
  const ChartsSurface = /*#__PURE__*/React.forwardRef(function ChartsSurface(inProps, ref) {
59
58
  const store = useStore();
60
- const svgWidth = useSelector(store, selectorChartSvgWidth);
61
- const svgHeight = useSelector(store, selectorChartSvgHeight);
62
- const propsWidth = useSelector(store, selectorChartPropsWidth);
63
- const propsHeight = useSelector(store, selectorChartPropsHeight);
64
- const isKeyboardNavigationEnabled = useSelector(store, selectorChartsIsKeyboardNavigationEnabled);
65
- const hasFocusedItem = useSelector(store, selectorChartsHasFocusedItem);
66
- const hasZoom = useSelector(store, selectorChartHasZoom);
59
+ const svgWidth = store.use(selectorChartSvgWidth);
60
+ const svgHeight = store.use(selectorChartSvgHeight);
61
+ const propsWidth = store.use(selectorChartPropsWidth);
62
+ const propsHeight = store.use(selectorChartPropsHeight);
63
+ const isKeyboardNavigationEnabled = store.use(selectorChartsIsKeyboardNavigationEnabled);
64
+ const hasFocusedItem = store.use(selectorChartsHasFocusedItem);
65
+ const hasZoom = store.use(selectorChartHasZoom);
67
66
  const svgRef = useSvgRef();
68
67
  const handleRef = useForkRef(svgRef, ref);
69
68
  const themeProps = useThemeProps({
@@ -13,7 +13,6 @@ import NoSsr from '@mui/material/NoSsr';
13
13
  import { rafThrottle } from '@mui/x-internals/rafThrottle';
14
14
  import { useIsFineMainPointer, usePointerType } from "./utils.js";
15
15
  import { useUtilityClasses } from "./chartsTooltipClasses.js";
16
- import { useSelector } from "../internals/store/useSelector.js";
17
16
  import { useStore } from "../internals/store/useStore.js";
18
17
  import { selectorChartsLastInteraction } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
19
18
  import { selectorChartsTooltipItemIsDefined, selectorChartsTooltipItemPosition } from "../internals/plugins/featurePlugins/useChartTooltip/index.js";
@@ -83,11 +82,11 @@ function ChartsTooltipContainer(inProps) {
83
82
  }));
84
83
  const axisSystem = useAxisSystem();
85
84
  const store = useStore();
86
- const shouldPreventBecauseOfBrush = useSelector(store, selectorBrushShouldPreventTooltip);
87
- const isOpen = useSelector(store, getIsOpenSelector(trigger, axisSystem, shouldPreventBecauseOfBrush));
88
- const lastInteraction = useSelector(store, selectorChartsLastInteraction);
85
+ const shouldPreventBecauseOfBrush = store.use(selectorBrushShouldPreventTooltip);
86
+ const isOpen = store.use(getIsOpenSelector(trigger, axisSystem, shouldPreventBecauseOfBrush));
87
+ const lastInteraction = store.use(selectorChartsLastInteraction);
89
88
  const computedAnchor = lastInteraction === 'keyboard' ? 'node' : anchor;
90
- const itemPosition = useSelector(store, trigger === 'item' && computedAnchor === 'node' ? selectorChartsTooltipItemPosition : selectorReturnNull, position);
89
+ const itemPosition = store.use(trigger === 'item' && computedAnchor === 'node' ? selectorChartsTooltipItemPosition : selectorReturnNull, position);
91
90
  React.useEffect(() => {
92
91
  const svgElement = svgRef.current;
93
92
  if (svgElement === null) {
@@ -3,7 +3,6 @@
3
3
  import { useSeries } from "../hooks/useSeries.js";
4
4
  import { useColorProcessor } from "../internals/plugins/corePlugins/useChartSeries/useColorProcessor.js";
5
5
  import { useStore } from "../internals/store/useStore.js";
6
- import { useSelector } from "../internals/store/useSelector.js";
7
6
  import { getLabel } from "../internals/getLabel.js";
8
7
  import { isCartesianSeriesType } from "../internals/isCartesian.js";
9
8
  import { utcFormatter } from "./utils.js";
@@ -43,9 +42,9 @@ export function useAxisTooltip(params = {}) {
43
42
  const defaultYAxis = useYAxis();
44
43
  const defaultRotationAxis = useRotationAxis();
45
44
  const store = useStore();
46
- const tooltipXAxes = useSelector(store, selectorChartsInteractionTooltipXAxes);
47
- const tooltipYAxes = useSelector(store, selectorChartsInteractionTooltipYAxes);
48
- const tooltipRotationAxes = useSelector(store, selectorChartsInteractionTooltipRotationAxes);
45
+ const tooltipXAxes = store.use(selectorChartsInteractionTooltipXAxes);
46
+ const tooltipYAxes = store.use(selectorChartsInteractionTooltipYAxes);
47
+ const tooltipRotationAxes = store.use(selectorChartsInteractionTooltipRotationAxes);
49
48
  const series = useSeries();
50
49
  const {
51
50
  xAxis
@@ -2,7 +2,6 @@
2
2
 
3
3
  import { useSeries } from "../hooks/useSeries.js";
4
4
  import { selectorChartsTooltipItem } from "../internals/plugins/featurePlugins/useChartTooltip/index.js";
5
- import { useSelector } from "../internals/store/useSelector.js";
6
5
  import { useStore } from "../internals/store/useStore.js";
7
6
  import { useRotationAxes, useXAxes, useYAxes } from "../hooks/useAxis.js";
8
7
  import { useZAxes } from "../hooks/useZAxis.js";
@@ -10,8 +9,8 @@ import { selectorChartSeriesConfig } from "../internals/plugins/corePlugins/useC
10
9
  import { isCartesianSeries } from "../internals/isCartesian.js";
11
10
  export function useInternalItemTooltip() {
12
11
  const store = useStore();
13
- const identifier = useSelector(store, selectorChartsTooltipItem);
14
- const seriesConfig = useSelector(store, selectorChartSeriesConfig);
12
+ const identifier = store.use(selectorChartsTooltipItem);
13
+ const seriesConfig = store.use(selectorChartSeriesConfig);
15
14
  const series = useSeries();
16
15
  const {
17
16
  xAxis,
@@ -4,7 +4,6 @@ import { styled } from '@mui/material/styles';
4
4
  import { shouldForwardProp } from '@mui/system/createStyled';
5
5
  import { useChartRootRef } from "../hooks/useChartRootRef.js";
6
6
  import { useStore } from "../internals/store/useStore.js";
7
- import { useSelector } from "../internals/store/useSelector.js";
8
7
  import { selectorChartPropsHeight, selectorChartPropsWidth } from "../internals/plugins/corePlugins/useChartDimensions/index.js";
9
8
  import { chartsToolbarClasses } from "../Toolbar/index.js";
10
9
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -117,8 +116,8 @@ function ChartsWrapper(props) {
117
116
  } = props;
118
117
  const chartRootRef = useChartRootRef();
119
118
  const store = useStore();
120
- const propsWidth = useSelector(store, selectorChartPropsWidth);
121
- const propsHeight = useSelector(store, selectorChartPropsHeight);
119
+ const propsWidth = store.use(selectorChartPropsWidth);
120
+ const propsHeight = store.use(selectorChartPropsHeight);
122
121
  return /*#__PURE__*/_jsx(Root, {
123
122
  ref: chartRootRef,
124
123
  ownerState: props,
@@ -6,7 +6,6 @@ const _excluded = ["slots", "slotProps"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import { useStore } from "../internals/store/useStore.js";
9
- import { useSelector } from "../internals/store/useSelector.js";
10
9
  import { LineHighlightElement } from "./LineHighlightElement.js";
11
10
  import { getValueToPositionMapper } from "../hooks/useScale.js";
12
11
  import { DEFAULT_X_AXIS_KEY } from "../constants/index.js";
@@ -45,7 +44,7 @@ function LineHighlightPlot(props) {
45
44
  instance
46
45
  } = useChartContext();
47
46
  const store = useStore();
48
- const highlightedIndexes = useSelector(store, selectorChartsHighlightXAxisIndex);
47
+ const highlightedIndexes = store.use(selectorChartsHighlightXAxisIndex);
49
48
  if (highlightedIndexes.length === 0) {
50
49
  return null;
51
50
  }
@@ -11,7 +11,6 @@ import { MarkElement } from "./MarkElement.js";
11
11
  import { useItemHighlightedGetter, useXAxes, useYAxes } from "../hooks/index.js";
12
12
  import { useInternalIsZoomInteracting } from "../internals/plugins/featurePlugins/useChartCartesianAxis/useInternalIsZoomInteracting.js";
13
13
  import { selectorChartsHighlightXAxisIndex } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
14
- import { useSelector } from "../internals/store/useSelector.js";
15
14
  import { useChartContext } from "../context/ChartProvider/index.js";
16
15
  import { useMarkPlotData } from "./useMarkPlotData.js";
17
16
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -48,7 +47,7 @@ function MarkPlot(props) {
48
47
  isFaded,
49
48
  isHighlighted
50
49
  } = useItemHighlightedGetter();
51
- const xAxisHighlightIndexes = useSelector(store, selectorChartsHighlightXAxisIndex);
50
+ const xAxisHighlightIndexes = store.use(selectorChartsHighlightXAxisIndex);
52
51
  const highlightedItems = React.useMemo(() => {
53
52
  const rep = {};
54
53
  for (const {
@@ -0,0 +1,2 @@
1
+ import { type PieArcProps } from "./PieArc.js";
2
+ export declare function FocusedPieArc(props: Partial<Omit<PieArcProps, 'startAngle' | 'endAngle' | 'id' | 'dataIndex' | 'isFaded' | 'isHighlighted' | 'isFocused'>>): import("react/jsx-runtime").JSX.Element | null;