@mui/x-charts-premium 9.1.0 → 9.3.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 (110) hide show
  1. package/BarChartPremium/BarChartPremium.d.mts +4 -1
  2. package/BarChartPremium/BarChartPremium.d.ts +4 -1
  3. package/BarChartPremium/BarChartPremium.js +51 -38
  4. package/BarChartPremium/BarChartPremium.mjs +52 -39
  5. package/BarChartPremium/BarPlotPremium.d.mts +37 -0
  6. package/BarChartPremium/BarPlotPremium.d.ts +37 -0
  7. package/BarChartPremium/BarPlotPremium.js +78 -0
  8. package/BarChartPremium/BarPlotPremium.mjs +72 -0
  9. package/BarChartPremium/RangeBar/useUtilityClasses.d.mts +1 -1
  10. package/BarChartPremium/RangeBar/useUtilityClasses.d.ts +1 -1
  11. package/BarChartPremium/index.d.mts +1 -0
  12. package/BarChartPremium/index.d.ts +1 -0
  13. package/BarChartPremium/index.js +12 -0
  14. package/BarChartPremium/index.mjs +1 -0
  15. package/BarChartPremium/useBarChartPremiumProps.d.mts +2 -1
  16. package/BarChartPremium/useBarChartPremiumProps.d.ts +2 -1
  17. package/BarChartPremium/useBarChartPremiumProps.js +39 -5
  18. package/BarChartPremium/useBarChartPremiumProps.mjs +39 -5
  19. package/BarChartPremium/webgl/BarWebGLPlot.d.mts +10 -0
  20. package/BarChartPremium/webgl/BarWebGLPlot.d.ts +10 -0
  21. package/BarChartPremium/webgl/BarWebGLPlot.js +81 -0
  22. package/BarChartPremium/webgl/BarWebGLPlot.mjs +75 -0
  23. package/BarChartPremium/webgl/BarWebGLProgram.d.mts +19 -0
  24. package/BarChartPremium/webgl/BarWebGLProgram.d.ts +19 -0
  25. package/BarChartPremium/webgl/BarWebGLProgram.js +107 -0
  26. package/BarChartPremium/webgl/BarWebGLProgram.mjs +100 -0
  27. package/BarChartPremium/webgl/shaders.d.mts +2 -0
  28. package/BarChartPremium/webgl/shaders.d.ts +2 -0
  29. package/BarChartPremium/webgl/shaders.js +69 -0
  30. package/BarChartPremium/webgl/shaders.mjs +63 -0
  31. package/BarChartPremium/webgl/useBarWebGLPlotData.d.mts +10 -0
  32. package/BarChartPremium/webgl/useBarWebGLPlotData.d.ts +10 -0
  33. package/BarChartPremium/webgl/useBarWebGLPlotData.js +160 -0
  34. package/BarChartPremium/webgl/useBarWebGLPlotData.mjs +154 -0
  35. package/CHANGELOG.md +221 -0
  36. package/CandlestickChart/CandlestickChart.js +25 -25
  37. package/CandlestickChart/CandlestickChart.mjs +25 -25
  38. package/ChartsDataProviderPremium/ChartsDataProviderPremium.js +2 -2
  39. package/ChartsDataProviderPremium/ChartsDataProviderPremium.mjs +2 -2
  40. package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.js +9 -3
  41. package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.mjs +9 -3
  42. package/HeatmapPremium/HeatmapPremium.js +20 -20
  43. package/HeatmapPremium/HeatmapPremium.mjs +20 -20
  44. package/RadialBarChart/RadialBarChart.d.mts +7 -0
  45. package/RadialBarChart/RadialBarChart.d.ts +7 -0
  46. package/RadialBarChart/RadialBarChart.js +25 -12
  47. package/RadialBarChart/RadialBarChart.mjs +25 -12
  48. package/RadialBarChart/RadialBarElement.js +15 -1
  49. package/RadialBarChart/RadialBarElement.mjs +15 -1
  50. package/RadialBarChart/radialBarClasses.d.mts +1 -1
  51. package/RadialBarChart/radialBarClasses.d.ts +1 -1
  52. package/RadialBarChart/seriesConfig/axisTooltipGetter.js +5 -2
  53. package/RadialBarChart/seriesConfig/axisTooltipGetter.mjs +5 -2
  54. package/RadialBarChart/seriesConfig/getColor.js +7 -51
  55. package/RadialBarChart/seriesConfig/getColor.mjs +8 -52
  56. package/RadialBarChart/seriesConfig/getItemAtPosition.d.mts +6 -0
  57. package/RadialBarChart/seriesConfig/getItemAtPosition.d.ts +6 -0
  58. package/RadialBarChart/seriesConfig/getItemAtPosition.js +69 -0
  59. package/RadialBarChart/seriesConfig/getItemAtPosition.mjs +63 -0
  60. package/RadialBarChart/seriesConfig/index.js +2 -1
  61. package/RadialBarChart/seriesConfig/index.mjs +2 -1
  62. package/RadialBarChart/seriesConfig/tooltip.js +3 -26
  63. package/RadialBarChart/seriesConfig/tooltip.mjs +4 -27
  64. package/RadialBarChart/useRadialBarChartProps.d.mts +2 -0
  65. package/RadialBarChart/useRadialBarChartProps.d.ts +2 -0
  66. package/RadialBarChart/useRadialBarChartProps.js +10 -2
  67. package/RadialBarChart/useRadialBarChartProps.mjs +10 -2
  68. package/RadialLineChart/RadialArea.d.mts +2 -11
  69. package/RadialLineChart/RadialArea.d.ts +2 -11
  70. package/RadialLineChart/RadialArea.js +4 -3
  71. package/RadialLineChart/RadialArea.mjs +4 -3
  72. package/RadialLineChart/RadialAreaPlot.js +3 -1
  73. package/RadialLineChart/RadialAreaPlot.mjs +3 -1
  74. package/RadialLineChart/RadialLine.d.mts +4 -3
  75. package/RadialLineChart/RadialLine.d.ts +4 -3
  76. package/RadialLineChart/RadialLine.js +4 -3
  77. package/RadialLineChart/RadialLine.mjs +4 -3
  78. package/RadialLineChart/RadialLineChart.d.mts +7 -5
  79. package/RadialLineChart/RadialLineChart.d.ts +7 -5
  80. package/RadialLineChart/RadialLineChart.js +15 -13
  81. package/RadialLineChart/RadialLineChart.mjs +15 -13
  82. package/RadialLineChart/RadialLineChart.plugins.d.mts +1 -1
  83. package/RadialLineChart/RadialLineChart.plugins.d.ts +1 -1
  84. package/RadialLineChart/RadialLineChart.plugins.js +1 -1
  85. package/RadialLineChart/RadialLineChart.plugins.mjs +1 -1
  86. package/RadialLineChart/RadialLinePlot.js +3 -1
  87. package/RadialLineChart/RadialLinePlot.mjs +3 -1
  88. package/RadialLineChart/seriesConfig/getColor.js +6 -53
  89. package/RadialLineChart/seriesConfig/getColor.mjs +7 -54
  90. package/RadialLineChart/seriesConfig/getItemAtPosition.js +3 -3
  91. package/RadialLineChart/seriesConfig/getItemAtPosition.mjs +4 -4
  92. package/RadialLineChart/seriesConfig/seriesProcessor.d.mts +2 -2
  93. package/RadialLineChart/seriesConfig/seriesProcessor.d.ts +2 -2
  94. package/RadialLineChart/seriesConfig/seriesProcessor.js +1 -138
  95. package/RadialLineChart/seriesConfig/seriesProcessor.mjs +2 -138
  96. package/RadialLineChart/seriesConfig/tooltip.js +3 -24
  97. package/RadialLineChart/seriesConfig/tooltip.mjs +4 -25
  98. package/RadialLineChart/useRadialLinePlotData.d.mts +1 -0
  99. package/RadialLineChart/useRadialLinePlotData.d.ts +1 -0
  100. package/RadialLineChart/useRadialLinePlotData.js +3 -1
  101. package/RadialLineChart/useRadialLinePlotData.mjs +3 -1
  102. package/ScatterChartPremium/ScatterChartPremium.js +30 -30
  103. package/ScatterChartPremium/ScatterChartPremium.mjs +30 -30
  104. package/index.js +1 -1
  105. package/index.mjs +1 -1
  106. package/models/seriesType/radialBar.d.mts +1 -1
  107. package/models/seriesType/radialBar.d.ts +1 -1
  108. package/models/seriesType/radialLine.d.mts +4 -0
  109. package/models/seriesType/radialLine.d.ts +4 -0
  110. package/package.json +126 -126
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = getItemAtPosition;
7
+ var _internals = require("@mui/x-charts/internals");
8
+ function getItemAtPosition(state, point) {
9
+ const {
10
+ axis: rotationAxes,
11
+ axisIds: rotationAxisIds
12
+ } = (0, _internals.selectorChartRotationAxis)(state);
13
+ const {
14
+ axis: radiusAxes,
15
+ axisIds: radiusAxisIds
16
+ } = (0, _internals.selectorChartRadiusAxis)(state);
17
+ const center = (0, _internals.selectorChartPolarCenter)(state);
18
+ const seriesState = (0, _internals.selectorAllSeriesOfType)(state, 'radialBar');
19
+ if (!seriesState || seriesState.seriesOrder.length === 0) {
20
+ return undefined;
21
+ }
22
+ const defaultRotationAxisId = rotationAxisIds[0];
23
+ const defaultRadiusAxisId = radiusAxisIds[0];
24
+ const polarCoordinate = {
25
+ rotation: (0, _internals.generateSvg2rotation)(center)(point.x, point.y),
26
+ radius: Math.sqrt((point.x - center.cx) ** 2 + (point.y - center.cy) ** 2)
27
+ };
28
+ for (let stackIndex = 0; stackIndex < seriesState.stackingGroups.length; stackIndex += 1) {
29
+ const group = seriesState.stackingGroups[stackIndex];
30
+ const seriesIds = group.ids;
31
+ for (const seriesId of seriesIds) {
32
+ const series = (seriesState.series ?? {})[seriesId];
33
+ const rotationAxisId = series.rotationAxisId ?? defaultRotationAxisId;
34
+ const radiusAxisId = series.radiusAxisId ?? defaultRadiusAxisId;
35
+ const rotationAxis = rotationAxes[rotationAxisId];
36
+ const radiusAxis = radiusAxes[radiusAxisId];
37
+ const bandAxis = series.layout === 'horizontal' ? radiusAxis : rotationAxis;
38
+ const continuousAxis = series.layout === 'horizontal' ? rotationAxis : radiusAxis;
39
+ const clampedAngle = rotationAxis.scale.range()[0] + (0, _internals.clampAngleRad)(polarCoordinate.rotation - rotationAxis.scale.range()[0]);
40
+ const bandCoordinate = series.layout === 'horizontal' ? polarCoordinate.radius : clampedAngle;
41
+ const valueCoordinate = series.layout === 'horizontal' ? clampedAngle : polarCoordinate.radius;
42
+ const dataIndex = (0, _internals.getBandIndex)(bandAxis, {
43
+ groupNumber: seriesState.stackingGroups.length,
44
+ groupIndex: stackIndex
45
+ }, bandCoordinate);
46
+ if (dataIndex === -1) {
47
+ continue;
48
+ }
49
+
50
+ // The point is inside the band for this series
51
+ const bar = series.visibleStackedData[dataIndex];
52
+ const start = continuousAxis.scale(bar[0]);
53
+ const end = continuousAxis.scale(bar[1]);
54
+ if (start == null || end == null) {
55
+ continue;
56
+ }
57
+ const continuousMin = Math.min(start, end);
58
+ const continuousMax = Math.max(start, end);
59
+ if (valueCoordinate >= continuousMin && valueCoordinate <= continuousMax) {
60
+ return {
61
+ type: 'radialBar',
62
+ seriesId,
63
+ dataIndex
64
+ };
65
+ }
66
+ }
67
+ }
68
+ return undefined;
69
+ }
@@ -0,0 +1,63 @@
1
+ import { selectorAllSeriesOfType, selectorChartPolarCenter, selectorChartRadiusAxis, selectorChartRotationAxis, getBandIndex, clampAngleRad, generateSvg2rotation } from '@mui/x-charts/internals';
2
+ export default function getItemAtPosition(state, point) {
3
+ const {
4
+ axis: rotationAxes,
5
+ axisIds: rotationAxisIds
6
+ } = selectorChartRotationAxis(state);
7
+ const {
8
+ axis: radiusAxes,
9
+ axisIds: radiusAxisIds
10
+ } = selectorChartRadiusAxis(state);
11
+ const center = selectorChartPolarCenter(state);
12
+ const seriesState = selectorAllSeriesOfType(state, 'radialBar');
13
+ if (!seriesState || seriesState.seriesOrder.length === 0) {
14
+ return undefined;
15
+ }
16
+ const defaultRotationAxisId = rotationAxisIds[0];
17
+ const defaultRadiusAxisId = radiusAxisIds[0];
18
+ const polarCoordinate = {
19
+ rotation: generateSvg2rotation(center)(point.x, point.y),
20
+ radius: Math.sqrt((point.x - center.cx) ** 2 + (point.y - center.cy) ** 2)
21
+ };
22
+ for (let stackIndex = 0; stackIndex < seriesState.stackingGroups.length; stackIndex += 1) {
23
+ const group = seriesState.stackingGroups[stackIndex];
24
+ const seriesIds = group.ids;
25
+ for (const seriesId of seriesIds) {
26
+ const series = (seriesState.series ?? {})[seriesId];
27
+ const rotationAxisId = series.rotationAxisId ?? defaultRotationAxisId;
28
+ const radiusAxisId = series.radiusAxisId ?? defaultRadiusAxisId;
29
+ const rotationAxis = rotationAxes[rotationAxisId];
30
+ const radiusAxis = radiusAxes[radiusAxisId];
31
+ const bandAxis = series.layout === 'horizontal' ? radiusAxis : rotationAxis;
32
+ const continuousAxis = series.layout === 'horizontal' ? rotationAxis : radiusAxis;
33
+ const clampedAngle = rotationAxis.scale.range()[0] + clampAngleRad(polarCoordinate.rotation - rotationAxis.scale.range()[0]);
34
+ const bandCoordinate = series.layout === 'horizontal' ? polarCoordinate.radius : clampedAngle;
35
+ const valueCoordinate = series.layout === 'horizontal' ? clampedAngle : polarCoordinate.radius;
36
+ const dataIndex = getBandIndex(bandAxis, {
37
+ groupNumber: seriesState.stackingGroups.length,
38
+ groupIndex: stackIndex
39
+ }, bandCoordinate);
40
+ if (dataIndex === -1) {
41
+ continue;
42
+ }
43
+
44
+ // The point is inside the band for this series
45
+ const bar = series.visibleStackedData[dataIndex];
46
+ const start = continuousAxis.scale(bar[0]);
47
+ const end = continuousAxis.scale(bar[1]);
48
+ if (start == null || end == null) {
49
+ continue;
50
+ }
51
+ const continuousMin = Math.min(start, end);
52
+ const continuousMax = Math.max(start, end);
53
+ if (valueCoordinate >= continuousMin && valueCoordinate <= continuousMax) {
54
+ return {
55
+ type: 'radialBar',
56
+ seriesId,
57
+ dataIndex
58
+ };
59
+ }
60
+ }
61
+ }
62
+ return undefined;
63
+ }
@@ -14,6 +14,7 @@ var _getColor = _interopRequireDefault(require("./getColor"));
14
14
  var _seriesProcessor = _interopRequireDefault(require("./seriesProcessor"));
15
15
  var _getSeriesWithDefaultValues = _interopRequireDefault(require("./getSeriesWithDefaultValues"));
16
16
  var _descriptionGetter = _interopRequireDefault(require("./descriptionGetter"));
17
+ var _getItemAtPosition = _interopRequireDefault(require("./getItemAtPosition"));
17
18
  var _extremums = require("./extremums");
18
19
  var _tooltip = _interopRequireDefault(require("./tooltip"));
19
20
  _internals.polarSeriesTypes.addType('radialBar');
@@ -27,7 +28,7 @@ const radialBarSeriesConfig = exports.radialBarSeriesConfig = {
27
28
  rotationExtremumGetter: _extremums.rotationExtremumGetter,
28
29
  radiusExtremumGetter: _extremums.radiusExtremumGetter,
29
30
  getSeriesWithDefaultValues: _getSeriesWithDefaultValues.default,
30
- // getItemAtPosition,
31
+ getItemAtPosition: _getItemAtPosition.default,
31
32
  keyboardFocusHandler: _keyboardFocusHandler.default,
32
33
  identifierSerializer: _internals.identifierSerializerSeriesIdDataIndex,
33
34
  identifierCleaner: _internals.identifierCleanerSeriesIdDataIndex,
@@ -7,6 +7,7 @@ import colorProcessor from "./getColor.mjs";
7
7
  import seriesProcessor from "./seriesProcessor.mjs";
8
8
  import getSeriesWithDefaultValues from "./getSeriesWithDefaultValues.mjs";
9
9
  import descriptionGetter from "./descriptionGetter.mjs";
10
+ import getItemAtPosition from "./getItemAtPosition.mjs";
10
11
  import { radiusExtremumGetter, rotationExtremumGetter } from "./extremums.mjs";
11
12
  import tooltipGetter from "./tooltip.mjs";
12
13
  polarSeriesTypes.addType('radialBar');
@@ -20,7 +21,7 @@ export const radialBarSeriesConfig = {
20
21
  rotationExtremumGetter,
21
22
  radiusExtremumGetter,
22
23
  getSeriesWithDefaultValues,
23
- // getItemAtPosition,
24
+ getItemAtPosition,
24
25
  keyboardFocusHandler,
25
26
  identifierSerializer: identifierSerializerSeriesIdDataIndex,
26
27
  identifierCleaner: identifierCleanerSeriesIdDataIndex,
@@ -5,30 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _internals = require("@mui/x-charts/internals");
8
- const tooltipGetter = params => {
9
- const {
10
- series,
11
- getColor,
12
- identifier
13
- } = params;
14
- if (!identifier || identifier.dataIndex === undefined) {
15
- return null;
16
- }
17
- const label = (0, _internals.getLabel)(series.label, 'tooltip');
18
- const value = series.data[identifier.dataIndex];
19
- if (value == null) {
20
- return null;
21
- }
22
- const formattedValue = series.valueFormatter(value, {
23
- dataIndex: identifier.dataIndex
24
- });
25
- return {
26
- identifier,
27
- color: getColor(identifier.dataIndex),
28
- label,
29
- value,
30
- formattedValue,
31
- markType: series.labelMarkType
32
- };
33
- };
8
+ const tooltipGetter = params => (0, _internals.getLineLikeTooltip)(params, {
9
+ skipNullValues: true
10
+ });
34
11
  var _default = exports.default = tooltipGetter;
@@ -1,28 +1,5 @@
1
- import { getLabel } from '@mui/x-charts/internals';
2
- const tooltipGetter = params => {
3
- const {
4
- series,
5
- getColor,
6
- identifier
7
- } = params;
8
- if (!identifier || identifier.dataIndex === undefined) {
9
- return null;
10
- }
11
- const label = getLabel(series.label, 'tooltip');
12
- const value = series.data[identifier.dataIndex];
13
- if (value == null) {
14
- return null;
15
- }
16
- const formattedValue = series.valueFormatter(value, {
17
- dataIndex: identifier.dataIndex
18
- });
19
- return {
20
- identifier,
21
- color: getColor(identifier.dataIndex),
22
- label,
23
- value,
24
- formattedValue,
25
- markType: series.labelMarkType
26
- };
27
- };
1
+ import { getLineLikeTooltip } from '@mui/x-charts/internals';
2
+ const tooltipGetter = params => getLineLikeTooltip(params, {
3
+ skipNullValues: true
4
+ });
28
5
  export default tooltipGetter;
@@ -6,6 +6,7 @@ import { type ChartsOverlayProps } from "../ChartsOverlay/index.mjs";
6
6
  import { type ChartsRadialDataProviderProps } from "../ChartsRadialDataProvider/index.mjs";
7
7
  import type { RadialBarChartProps } from "./RadialBarChart.mjs";
8
8
  import type { ChartsWrapperProps } from "../ChartsWrapper/index.mjs";
9
+ import type { ChartsRadialAxisHighlightProps } from "../ChartsRadialAxisHighlight/index.mjs";
9
10
  import { type RadialBarChartPluginSignatures } from "./RadialBarChart.plugins.mjs";
10
11
  /**
11
12
  * A helper function that extracts RadialBarChartProps from the input props
@@ -24,5 +25,6 @@ export declare const useRadialBarChartProps: (props: RadialBarChartProps) => {
24
25
  };
25
26
  overlayProps: ChartsOverlayProps;
26
27
  legendProps: ChartsLegendSlotExtension;
28
+ axisHighlightProps: ChartsRadialAxisHighlightProps;
27
29
  children: React.ReactNode;
28
30
  };
@@ -6,6 +6,7 @@ import { type ChartsOverlayProps } from "../ChartsOverlay/index.js";
6
6
  import { type ChartsRadialDataProviderProps } from "../ChartsRadialDataProvider/index.js";
7
7
  import type { RadialBarChartProps } from "./RadialBarChart.js";
8
8
  import type { ChartsWrapperProps } from "../ChartsWrapper/index.js";
9
+ import type { ChartsRadialAxisHighlightProps } from "../ChartsRadialAxisHighlight/index.js";
9
10
  import { type RadialBarChartPluginSignatures } from "./RadialBarChart.plugins.js";
10
11
  /**
11
12
  * A helper function that extracts RadialBarChartProps from the input props
@@ -24,5 +25,6 @@ export declare const useRadialBarChartProps: (props: RadialBarChartProps) => {
24
25
  };
25
26
  overlayProps: ChartsOverlayProps;
26
27
  legendProps: ChartsLegendSlotExtension;
28
+ axisHighlightProps: ChartsRadialAxisHighlightProps;
27
29
  children: React.ReactNode;
28
30
  };
@@ -13,7 +13,7 @@ var React = _interopRequireWildcard(require("react"));
13
13
  var _useId = _interopRequireDefault(require("@mui/utils/useId"));
14
14
  var _RadialBarChart = require("./RadialBarChart.plugins");
15
15
  var _constants = require("../constants");
16
- const _excluded = ["rotationAxis", "radiusAxis", "series", "width", "height", "margin", "colors", "dataset", "hideLegend", "grid", "children", "slots", "slotProps", "skipAnimation", "loading", "showToolbar"];
16
+ const _excluded = ["rotationAxis", "radiusAxis", "series", "width", "height", "margin", "colors", "dataset", "hideLegend", "grid", "children", "slots", "slotProps", "skipAnimation", "loading", "showToolbar", "axisHighlight"];
17
17
  /**
18
18
  * A helper function that extracts RadialBarChartProps from the input props
19
19
  * and returns an object with props for the children components of RadialBarChart.
@@ -36,7 +36,8 @@ const useRadialBarChartProps = props => {
36
36
  slots,
37
37
  slotProps,
38
38
  skipAnimation,
39
- loading
39
+ loading,
40
+ axisHighlight
40
41
  } = props,
41
42
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
42
43
  const id = (0, _useId.default)();
@@ -65,6 +66,12 @@ const useRadialBarChartProps = props => {
65
66
  skipAnimation,
66
67
  plugins: _RadialBarChart.RADIAL_BAR_CHART_PLUGINS
67
68
  });
69
+ const isHorizontal = series.some(s => s.layout === 'horizontal');
70
+ const axisHighlightProps = (0, _extends2.default)({}, isHorizontal ? {
71
+ radius: 'band'
72
+ } : {
73
+ rotation: 'band'
74
+ }, axisHighlight);
68
75
  const gridProps = grid;
69
76
  const clipPathGroupProps = {
70
77
  clipPath: `url(#${clipPathId})`
@@ -94,6 +101,7 @@ const useRadialBarChartProps = props => {
94
101
  clipPathGroupProps,
95
102
  overlayProps,
96
103
  legendProps,
104
+ axisHighlightProps,
97
105
  children
98
106
  };
99
107
  };
@@ -2,7 +2,7 @@
2
2
 
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
- const _excluded = ["rotationAxis", "radiusAxis", "series", "width", "height", "margin", "colors", "dataset", "hideLegend", "grid", "children", "slots", "slotProps", "skipAnimation", "loading", "showToolbar"];
5
+ const _excluded = ["rotationAxis", "radiusAxis", "series", "width", "height", "margin", "colors", "dataset", "hideLegend", "grid", "children", "slots", "slotProps", "skipAnimation", "loading", "showToolbar", "axisHighlight"];
6
6
  import * as React from 'react';
7
7
  import useId from '@mui/utils/useId';
8
8
  import { RADIAL_BAR_CHART_PLUGINS } from "./RadialBarChart.plugins.mjs";
@@ -30,7 +30,8 @@ export const useRadialBarChartProps = props => {
30
30
  slots,
31
31
  slotProps,
32
32
  skipAnimation,
33
- loading
33
+ loading,
34
+ axisHighlight
34
35
  } = props,
35
36
  other = _objectWithoutPropertiesLoose(props, _excluded);
36
37
  const id = useId();
@@ -59,6 +60,12 @@ export const useRadialBarChartProps = props => {
59
60
  skipAnimation,
60
61
  plugins: RADIAL_BAR_CHART_PLUGINS
61
62
  });
63
+ const isHorizontal = series.some(s => s.layout === 'horizontal');
64
+ const axisHighlightProps = _extends({}, isHorizontal ? {
65
+ radius: 'band'
66
+ } : {
67
+ rotation: 'band'
68
+ }, axisHighlight);
62
69
  const gridProps = grid;
63
70
  const clipPathGroupProps = {
64
71
  clipPath: `url(#${clipPathId})`
@@ -88,6 +95,7 @@ export const useRadialBarChartProps = props => {
88
95
  clipPathGroupProps,
89
96
  overlayProps,
90
97
  legendProps,
98
+ axisHighlightProps,
91
99
  children
92
100
  };
93
101
  };
@@ -1,12 +1,3 @@
1
- import * as React from 'react';
2
- import type { CurveType, SeriesId } from '@mui/x-charts/models';
3
- import { type RadialLinePoint } from "./useRadialLinePlotData.mjs";
4
- export interface RadialAreaProps extends Omit<React.SVGProps<SVGPathElement>, 'ref' | 'points'> {
5
- seriesId: SeriesId;
6
- color: string;
7
- hidden?: boolean;
8
- curve?: CurveType;
9
- points: RadialLinePoint[];
10
- }
11
- declare function RadialArea(props: RadialAreaProps): import("react/jsx-runtime").JSX.Element;
1
+ import { type RadialLineOrAreaProps } from "./RadialLine.mjs";
2
+ declare function RadialArea(props: RadialLineOrAreaProps): import("react/jsx-runtime").JSX.Element;
12
3
  export { RadialArea };
@@ -1,12 +1,3 @@
1
- import * as React from 'react';
2
- import type { CurveType, SeriesId } from '@mui/x-charts/models';
3
- import { type RadialLinePoint } from "./useRadialLinePlotData.js";
4
- export interface RadialAreaProps extends Omit<React.SVGProps<SVGPathElement>, 'ref' | 'points'> {
5
- seriesId: SeriesId;
6
- color: string;
7
- hidden?: boolean;
8
- curve?: CurveType;
9
- points: RadialLinePoint[];
10
- }
11
- declare function RadialArea(props: RadialAreaProps): import("react/jsx-runtime").JSX.Element;
1
+ import { type RadialLineOrAreaProps } from "./RadialLine.js";
2
+ declare function RadialArea(props: RadialLineOrAreaProps): import("react/jsx-runtime").JSX.Element;
12
3
  export { RadialArea };
@@ -13,14 +13,15 @@ var _d3Shape = require("@mui/x-charts-vendor/d3-shape");
13
13
  var _internals = require("@mui/x-charts/internals");
14
14
  var _hooks = require("../hooks");
15
15
  var _jsxRuntime = require("react/jsx-runtime");
16
- const _excluded = ["seriesId", "color", "hidden", "curve", "points"];
16
+ const _excluded = ["seriesId", "color", "hidden", "curve", "points", "closePath"];
17
17
  function RadialArea(props) {
18
18
  const {
19
19
  seriesId,
20
20
  color,
21
21
  hidden,
22
22
  curve,
23
- points
23
+ points,
24
+ closePath
24
25
  } = props,
25
26
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
26
27
  const identifier = React.useMemo(() => ({
@@ -30,7 +31,7 @@ function RadialArea(props) {
30
31
  const highlightState = (0, _hooks.useItemHighlightState)(identifier);
31
32
  const isHighlighted = highlightState === 'highlighted';
32
33
  const isFaded = highlightState === 'faded';
33
- const d = (0, _d3Shape.areaRadial)().angle(p => p.angle).innerRadius(p => p.baseRadius).outerRadius(p => p.radius).curve((0, _internals.getCurveFactory)(curve))(points) || '';
34
+ const d = (0, _d3Shape.areaRadial)().angle(p => p.angle).innerRadius(p => p.baseRadius).outerRadius(p => p.radius).curve((0, _internals.getCurveFactory)(curve))(closePath ? [...points, points[0]] : points) || '';
34
35
  const fadedOpacity = isFaded ? 0.3 : 1;
35
36
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("path", (0, _extends2.default)({
36
37
  "data-series": seriesId,
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["seriesId", "color", "hidden", "curve", "points"];
3
+ const _excluded = ["seriesId", "color", "hidden", "curve", "points", "closePath"];
4
4
  import * as React from 'react';
5
5
  import { areaRadial as d3AreaRadial } from '@mui/x-charts-vendor/d3-shape';
6
6
  import { getCurveFactory } from '@mui/x-charts/internals';
@@ -12,7 +12,8 @@ function RadialArea(props) {
12
12
  color,
13
13
  hidden,
14
14
  curve,
15
- points
15
+ points,
16
+ closePath
16
17
  } = props,
17
18
  other = _objectWithoutPropertiesLoose(props, _excluded);
18
19
  const identifier = React.useMemo(() => ({
@@ -22,7 +23,7 @@ function RadialArea(props) {
22
23
  const highlightState = useItemHighlightState(identifier);
23
24
  const isHighlighted = highlightState === 'highlighted';
24
25
  const isFaded = highlightState === 'faded';
25
- const d = d3AreaRadial().angle(p => p.angle).innerRadius(p => p.baseRadius).outerRadius(p => p.radius).curve(getCurveFactory(curve))(points) || '';
26
+ const d = d3AreaRadial().angle(p => p.angle).innerRadius(p => p.baseRadius).outerRadius(p => p.radius).curve(getCurveFactory(curve))(closePath ? [...points, points[0]] : points) || '';
26
27
  const fadedOpacity = isFaded ? 0.3 : 1;
27
28
  return /*#__PURE__*/_jsx("path", _extends({
28
29
  "data-series": seriesId,
@@ -38,13 +38,15 @@ function RadialAreaPlot(props) {
38
38
  hidden,
39
39
  area,
40
40
  curve,
41
- points
41
+ points,
42
+ closePath
42
43
  }) => area && /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadialArea.RadialArea, {
43
44
  seriesId: seriesId,
44
45
  color: color,
45
46
  hidden: hidden,
46
47
  curve: curve,
47
48
  points: points,
49
+ closePath: closePath,
48
50
  className: classes.area
49
51
  }, seriesId))
50
52
  });
@@ -32,13 +32,15 @@ export function RadialAreaPlot(props) {
32
32
  hidden,
33
33
  area,
34
34
  curve,
35
- points
35
+ points,
36
+ closePath
36
37
  }) => area && /*#__PURE__*/_jsx(RadialArea, {
37
38
  seriesId: seriesId,
38
39
  color: color,
39
40
  hidden: hidden,
40
41
  curve: curve,
41
42
  points: points,
43
+ closePath: closePath,
42
44
  className: classes.area
43
45
  }, seriesId))
44
46
  });
@@ -1,12 +1,13 @@
1
1
  import * as React from 'react';
2
2
  import { type CurveType, type SeriesId } from '@mui/x-charts/models';
3
3
  import { type RadialLinePoint } from "./useRadialLinePlotData.mjs";
4
- export interface RadialLineProps extends Omit<React.SVGProps<SVGPathElement>, 'ref' | 'points'> {
4
+ export interface RadialLineOrAreaProps extends Omit<React.SVGProps<SVGPathElement>, 'ref' | 'points'> {
5
5
  seriesId: SeriesId;
6
6
  color: string;
7
7
  hidden?: boolean;
8
- points: RadialLinePoint[];
9
8
  curve?: CurveType;
9
+ points: RadialLinePoint[];
10
+ closePath?: boolean;
10
11
  }
11
- declare function RadialLine(props: RadialLineProps): import("react/jsx-runtime").JSX.Element;
12
+ declare function RadialLine(props: RadialLineOrAreaProps): import("react/jsx-runtime").JSX.Element;
12
13
  export { RadialLine };
@@ -1,12 +1,13 @@
1
1
  import * as React from 'react';
2
2
  import { type CurveType, type SeriesId } from '@mui/x-charts/models';
3
3
  import { type RadialLinePoint } from "./useRadialLinePlotData.js";
4
- export interface RadialLineProps extends Omit<React.SVGProps<SVGPathElement>, 'ref' | 'points'> {
4
+ export interface RadialLineOrAreaProps extends Omit<React.SVGProps<SVGPathElement>, 'ref' | 'points'> {
5
5
  seriesId: SeriesId;
6
6
  color: string;
7
7
  hidden?: boolean;
8
- points: RadialLinePoint[];
9
8
  curve?: CurveType;
9
+ points: RadialLinePoint[];
10
+ closePath?: boolean;
10
11
  }
11
- declare function RadialLine(props: RadialLineProps): import("react/jsx-runtime").JSX.Element;
12
+ declare function RadialLine(props: RadialLineOrAreaProps): import("react/jsx-runtime").JSX.Element;
12
13
  export { RadialLine };
@@ -13,14 +13,15 @@ var _d3Shape = require("@mui/x-charts-vendor/d3-shape");
13
13
  var _internals = require("@mui/x-charts/internals");
14
14
  var _hooks = require("../hooks");
15
15
  var _jsxRuntime = require("react/jsx-runtime");
16
- const _excluded = ["seriesId", "color", "hidden", "points", "curve"];
16
+ const _excluded = ["seriesId", "color", "hidden", "points", "curve", "closePath"];
17
17
  function RadialLine(props) {
18
18
  const {
19
19
  seriesId,
20
20
  color,
21
21
  hidden,
22
22
  points,
23
- curve
23
+ curve,
24
+ closePath
24
25
  } = props,
25
26
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
26
27
  const identifier = React.useMemo(() => ({
@@ -30,7 +31,7 @@ function RadialLine(props) {
30
31
  const highlightState = (0, _hooks.useItemHighlightState)(identifier);
31
32
  const isHighlighted = highlightState === 'highlighted';
32
33
  const isFaded = highlightState === 'faded';
33
- const d = (0, _d3Shape.lineRadial)().angle(p => p.angle).radius(p => p.radius).curve((0, _internals.getCurveFactory)(curve))(points) || '';
34
+ const d = (0, _d3Shape.lineRadial)().angle(p => p.angle).radius(p => p.radius).curve((0, _internals.getCurveFactory)(curve))(closePath ? [...points, points[0]] : points) || '';
34
35
  const fadedOpacity = isFaded ? 0.3 : 1;
35
36
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("path", (0, _extends2.default)({
36
37
  "data-series": seriesId,
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["seriesId", "color", "hidden", "points", "curve"];
3
+ const _excluded = ["seriesId", "color", "hidden", "points", "curve", "closePath"];
4
4
  import * as React from 'react';
5
5
  import { lineRadial as d3LineRadial } from '@mui/x-charts-vendor/d3-shape';
6
6
  import { getCurveFactory } from '@mui/x-charts/internals';
@@ -12,7 +12,8 @@ function RadialLine(props) {
12
12
  color,
13
13
  hidden,
14
14
  points,
15
- curve
15
+ curve,
16
+ closePath
16
17
  } = props,
17
18
  other = _objectWithoutPropertiesLoose(props, _excluded);
18
19
  const identifier = React.useMemo(() => ({
@@ -22,7 +23,7 @@ function RadialLine(props) {
22
23
  const highlightState = useItemHighlightState(identifier);
23
24
  const isHighlighted = highlightState === 'highlighted';
24
25
  const isFaded = highlightState === 'faded';
25
- const d = d3LineRadial().angle(p => p.angle).radius(p => p.radius).curve(getCurveFactory(curve))(points) || '';
26
+ const d = d3LineRadial().angle(p => p.angle).radius(p => p.radius).curve(getCurveFactory(curve))(closePath ? [...points, points[0]] : points) || '';
26
27
  const fadedOpacity = isFaded ? 0.3 : 1;
27
28
  return /*#__PURE__*/_jsx("path", _extends({
28
29
  "data-series": seriesId,
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import type { MakeOptional } from '@mui/x-internals/types';
2
3
  import { type ChartsSlots, type ChartsSlotProps } from '@mui/x-charts/internals';
3
4
  import { type ChartsRadialGridProps } from '@mui/x-charts/ChartsRadialGrid';
4
5
  import { type ChartsRadialAxisHighlightProps } from '@mui/x-charts/ChartsRadialAxisHighlight';
@@ -6,18 +7,19 @@ import { type ChartsLegendSlots, type ChartsLegendSlotProps } from "../ChartsLeg
6
7
  import { type ChartsTooltipSlots, type ChartsTooltipSlotProps } from "../ChartsTooltip/index.mjs";
7
8
  import { type RadialLineChartPluginSignatures } from "./RadialLineChart.plugins.mjs";
8
9
  import { type ChartsOverlayProps, type ChartsOverlaySlots, type ChartsOverlaySlotProps } from "../ChartsOverlay/index.mjs";
9
- import type { LinePlotSlots, LinePlotSlotProps, LineSeries } from "../LineChart/index.mjs";
10
10
  import { type ChartsToolbarSlots, type ChartsToolbarSlotProps } from "../Toolbar/index.mjs";
11
11
  import { type RadialLineHighlightPlotSlots, type RadialLineHighlightPlotSlotProps } from "./RadialLineHighlightPlot.mjs";
12
12
  import { type ChartsRadialDataProviderPremiumProps } from "../ChartsRadialDataProviderPremium/index.mjs";
13
- export interface RadialLineChartSlots extends LinePlotSlots, RadialLineHighlightPlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
14
- export interface RadialLineChartSlotProps extends LinePlotSlotProps, RadialLineHighlightPlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, ChartsTooltipSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
13
+ import type { RadialLineSeriesType } from "../models/seriesType/radialLine.mjs";
14
+ export interface RadialLineChartSlots extends RadialLineHighlightPlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
15
+ export interface RadialLineChartSlotProps extends RadialLineHighlightPlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, ChartsTooltipSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
16
+ export type RadialLineSeries = MakeOptional<RadialLineSeriesType, 'type'>;
15
17
  export interface RadialLineChartProps extends Omit<ChartsRadialDataProviderPremiumProps<'radialLine', RadialLineChartPluginSignatures>, 'series' | 'plugins' | 'zAxis' | 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
16
18
  /**
17
19
  * The series to display in the line chart.
18
- * An array of [[LineSeries]] objects.
20
+ * An array of [[RadialLineSeries]] objects.
19
21
  */
20
- series: Readonly<LineSeries[]>;
22
+ series: Readonly<RadialLineSeries[]>;
21
23
  /**
22
24
  * Option to display a radial grid in the background.
23
25
  */
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import type { MakeOptional } from '@mui/x-internals/types';
2
3
  import { type ChartsSlots, type ChartsSlotProps } from '@mui/x-charts/internals';
3
4
  import { type ChartsRadialGridProps } from '@mui/x-charts/ChartsRadialGrid';
4
5
  import { type ChartsRadialAxisHighlightProps } from '@mui/x-charts/ChartsRadialAxisHighlight';
@@ -6,18 +7,19 @@ import { type ChartsLegendSlots, type ChartsLegendSlotProps } from "../ChartsLeg
6
7
  import { type ChartsTooltipSlots, type ChartsTooltipSlotProps } from "../ChartsTooltip/index.js";
7
8
  import { type RadialLineChartPluginSignatures } from "./RadialLineChart.plugins.js";
8
9
  import { type ChartsOverlayProps, type ChartsOverlaySlots, type ChartsOverlaySlotProps } from "../ChartsOverlay/index.js";
9
- import type { LinePlotSlots, LinePlotSlotProps, LineSeries } from "../LineChart/index.js";
10
10
  import { type ChartsToolbarSlots, type ChartsToolbarSlotProps } from "../Toolbar/index.js";
11
11
  import { type RadialLineHighlightPlotSlots, type RadialLineHighlightPlotSlotProps } from "./RadialLineHighlightPlot.js";
12
12
  import { type ChartsRadialDataProviderPremiumProps } from "../ChartsRadialDataProviderPremium/index.js";
13
- export interface RadialLineChartSlots extends LinePlotSlots, RadialLineHighlightPlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
14
- export interface RadialLineChartSlotProps extends LinePlotSlotProps, RadialLineHighlightPlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, ChartsTooltipSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
13
+ import type { RadialLineSeriesType } from "../models/seriesType/radialLine.js";
14
+ export interface RadialLineChartSlots extends RadialLineHighlightPlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
15
+ export interface RadialLineChartSlotProps extends RadialLineHighlightPlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, ChartsTooltipSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
16
+ export type RadialLineSeries = MakeOptional<RadialLineSeriesType, 'type'>;
15
17
  export interface RadialLineChartProps extends Omit<ChartsRadialDataProviderPremiumProps<'radialLine', RadialLineChartPluginSignatures>, 'series' | 'plugins' | 'zAxis' | 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
16
18
  /**
17
19
  * The series to display in the line chart.
18
- * An array of [[LineSeries]] objects.
20
+ * An array of [[RadialLineSeries]] objects.
19
21
  */
20
- series: Readonly<LineSeries[]>;
22
+ series: Readonly<RadialLineSeries[]>;
21
23
  /**
22
24
  * Option to display a radial grid in the background.
23
25
  */