@mui/x-charts 9.0.4 → 9.2.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 (195) hide show
  1. package/BarChart/BarChart.d.mts +1 -2
  2. package/BarChart/BarChart.d.ts +1 -2
  3. package/BarChart/BarChart.js +2 -913
  4. package/BarChart/BarChart.mjs +2 -913
  5. package/BarChart/seriesConfig/bar/seriesProcessor.js +2 -0
  6. package/BarChart/seriesConfig/bar/seriesProcessor.mjs +2 -0
  7. package/CHANGELOG.md +236 -0
  8. package/ChartsAxisHighlightValue/ChartsAxisHighlightValue.d.mts +55 -0
  9. package/ChartsAxisHighlightValue/ChartsAxisHighlightValue.d.ts +55 -0
  10. package/ChartsAxisHighlightValue/ChartsAxisHighlightValue.js +94 -0
  11. package/ChartsAxisHighlightValue/ChartsAxisHighlightValue.mjs +88 -0
  12. package/ChartsAxisHighlightValue/ChartsAxisHighlightValueItem.d.mts +13 -0
  13. package/ChartsAxisHighlightValue/ChartsAxisHighlightValueItem.d.ts +13 -0
  14. package/ChartsAxisHighlightValue/ChartsAxisHighlightValueItem.js +86 -0
  15. package/ChartsAxisHighlightValue/ChartsAxisHighlightValueItem.mjs +80 -0
  16. package/ChartsAxisHighlightValue/chartsAxisHighlightValueClasses.d.mts +18 -0
  17. package/ChartsAxisHighlightValue/chartsAxisHighlightValueClasses.d.ts +18 -0
  18. package/ChartsAxisHighlightValue/chartsAxisHighlightValueClasses.js +26 -0
  19. package/ChartsAxisHighlightValue/chartsAxisHighlightValueClasses.mjs +16 -0
  20. package/ChartsAxisHighlightValue/index.d.mts +1 -0
  21. package/ChartsAxisHighlightValue/index.d.ts +1 -0
  22. package/ChartsAxisHighlightValue/index.js +16 -0
  23. package/ChartsAxisHighlightValue/index.mjs +1 -0
  24. package/ChartsAxisHighlightValue/useAxisHighlightValue.d.mts +14 -0
  25. package/ChartsAxisHighlightValue/useAxisHighlightValue.d.ts +14 -0
  26. package/ChartsAxisHighlightValue/useAxisHighlightValue.js +130 -0
  27. package/ChartsAxisHighlightValue/useAxisHighlightValue.mjs +124 -0
  28. package/ChartsContainer/ChartsContainer.js +4 -1431
  29. package/ChartsContainer/ChartsContainer.mjs +4 -1431
  30. package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.d.mts +15 -0
  31. package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.d.ts +15 -0
  32. package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.js +56 -0
  33. package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.mjs +50 -0
  34. package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.types.d.mts +6 -0
  35. package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.types.d.ts +6 -0
  36. package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.types.js +5 -0
  37. package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.types.mjs +1 -0
  38. package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlightPath.d.mts +11 -0
  39. package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlightPath.d.ts +11 -0
  40. package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlightPath.js +70 -0
  41. package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlightPath.mjs +64 -0
  42. package/ChartsRadialAxisHighlight/ChartsRadiusAxisHighlight.d.mts +9 -0
  43. package/ChartsRadialAxisHighlight/ChartsRadiusAxisHighlight.d.ts +9 -0
  44. package/ChartsRadialAxisHighlight/ChartsRadiusAxisHighlight.js +104 -0
  45. package/ChartsRadialAxisHighlight/ChartsRadiusAxisHighlight.mjs +98 -0
  46. package/ChartsRadialAxisHighlight/ChartsRotationAxisHighlight.d.mts +9 -0
  47. package/ChartsRadialAxisHighlight/ChartsRotationAxisHighlight.d.ts +9 -0
  48. package/ChartsRadialAxisHighlight/ChartsRotationAxisHighlight.js +98 -0
  49. package/ChartsRadialAxisHighlight/ChartsRotationAxisHighlight.mjs +92 -0
  50. package/ChartsRadialAxisHighlight/chartsRadialAxisHighlightClasses.d.mts +7 -0
  51. package/ChartsRadialAxisHighlight/chartsRadialAxisHighlightClasses.d.ts +7 -0
  52. package/ChartsRadialAxisHighlight/chartsRadialAxisHighlightClasses.js +14 -0
  53. package/ChartsRadialAxisHighlight/chartsRadialAxisHighlightClasses.mjs +6 -0
  54. package/ChartsRadialAxisHighlight/index.d.mts +5 -0
  55. package/ChartsRadialAxisHighlight/index.d.ts +5 -0
  56. package/ChartsRadialAxisHighlight/index.js +47 -0
  57. package/ChartsRadialAxisHighlight/index.mjs +4 -0
  58. package/ChartsRadiusAxis/ChartsRadiusAxis.d.mts +1 -47
  59. package/ChartsRadiusAxis/ChartsRadiusAxis.d.ts +1 -47
  60. package/ChartsRadiusAxis/ChartsRadiusAxis.js +20 -16
  61. package/ChartsRadiusAxis/ChartsRadiusAxis.mjs +21 -15
  62. package/ChartsRadiusAxis/index.d.mts +3 -2
  63. package/ChartsRadiusAxis/index.d.ts +3 -2
  64. package/ChartsRadiusAxis/index.mjs +3 -1
  65. package/ChartsRotationAxis/ChartsRotationAxis.d.mts +1 -47
  66. package/ChartsRotationAxis/ChartsRotationAxis.d.ts +1 -47
  67. package/ChartsRotationAxis/ChartsRotationAxis.js +16 -19
  68. package/ChartsRotationAxis/ChartsRotationAxis.mjs +17 -18
  69. package/ChartsRotationAxis/index.d.mts +3 -2
  70. package/ChartsRotationAxis/index.d.ts +3 -2
  71. package/ChartsRotationAxis/index.mjs +3 -1
  72. package/ChartsTooltip/useAxesTooltip.d.mts +1 -1
  73. package/ChartsTooltip/useAxesTooltip.d.ts +1 -1
  74. package/ChartsTooltip/useAxesTooltip.js +11 -2
  75. package/ChartsTooltip/useAxesTooltip.mjs +12 -3
  76. package/ChartsXAxis/useAxisTicksProps.d.mts +162 -81
  77. package/ChartsXAxis/useAxisTicksProps.d.ts +162 -81
  78. package/ChartsYAxis/useAxisTicksProps.d.mts +162 -81
  79. package/ChartsYAxis/useAxisTicksProps.d.ts +162 -81
  80. package/LICENSE +2 -0
  81. package/LineChart/LineChart.js +2 -913
  82. package/LineChart/LineChart.mjs +2 -913
  83. package/LineChart/seriesConfig/curveEvaluation.d.mts +19 -1
  84. package/LineChart/seriesConfig/curveEvaluation.d.ts +19 -1
  85. package/LineChart/seriesConfig/curveEvaluation.js +132 -0
  86. package/LineChart/seriesConfig/curveEvaluation.mjs +131 -0
  87. package/LineChart/seriesConfig/getSeriesWithDefaultValues.js +2 -1
  88. package/LineChart/seriesConfig/getSeriesWithDefaultValues.mjs +2 -1
  89. package/LineChart/seriesConfig/seriesProcessor.js +4 -0
  90. package/LineChart/seriesConfig/seriesProcessor.mjs +4 -0
  91. package/LineChart/useAreaPlotData.js +4 -0
  92. package/LineChart/useAreaPlotData.mjs +4 -0
  93. package/LineChart/useLinePlotData.js +2 -0
  94. package/LineChart/useLinePlotData.mjs +2 -0
  95. package/LineChart/useMarkPlotData.js +2 -0
  96. package/LineChart/useMarkPlotData.mjs +2 -0
  97. package/RadarChart/RadarGrid/CircularRadarStripes.js +2 -3
  98. package/RadarChart/RadarGrid/CircularRadarStripes.mjs +2 -3
  99. package/RadarChart/RadarSeriesPlot/useRadarRotationIndex.js +1 -1
  100. package/RadarChart/RadarSeriesPlot/useRadarRotationIndex.mjs +2 -2
  101. package/ScatterChart/FocusedScatterMark.js +10 -24
  102. package/ScatterChart/FocusedScatterMark.mjs +10 -24
  103. package/ScatterChart/HighlightedScatterMark.d.mts +11 -0
  104. package/ScatterChart/HighlightedScatterMark.d.ts +11 -0
  105. package/ScatterChart/HighlightedScatterMark.js +68 -0
  106. package/ScatterChart/HighlightedScatterMark.mjs +62 -0
  107. package/ScatterChart/ScatterChart.d.mts +1 -2
  108. package/ScatterChart/ScatterChart.d.ts +1 -2
  109. package/ScatterChart/ScatterChart.js +2 -913
  110. package/ScatterChart/ScatterChart.mjs +2 -913
  111. package/ScatterChart/index.d.mts +1 -0
  112. package/ScatterChart/index.d.ts +1 -0
  113. package/ScatterChart/index.js +12 -0
  114. package/ScatterChart/index.mjs +1 -0
  115. package/ScatterChart/scatterClasses.d.mts +3 -1
  116. package/ScatterChart/scatterClasses.d.ts +3 -1
  117. package/ScatterChart/scatterClasses.js +3 -2
  118. package/ScatterChart/scatterClasses.mjs +3 -2
  119. package/ScatterChart/useScatterChartProps.js +3 -1
  120. package/ScatterChart/useScatterChartProps.mjs +3 -1
  121. package/ScatterChart/useScatterItemPosition.d.mts +16 -0
  122. package/ScatterChart/useScatterItemPosition.d.ts +16 -0
  123. package/ScatterChart/useScatterItemPosition.js +47 -0
  124. package/ScatterChart/useScatterItemPosition.mjs +41 -0
  125. package/SparkLineChart/SparkLineChart.js +2 -913
  126. package/SparkLineChart/SparkLineChart.mjs +2 -913
  127. package/hooks/useAxis.d.mts +3 -3
  128. package/hooks/useAxis.d.ts +3 -3
  129. package/hooks/useAxisSystem.d.mts +1 -1
  130. package/hooks/useAxisSystem.d.ts +1 -1
  131. package/hooks/useAxisSystem.js +1 -1
  132. package/hooks/useAxisSystem.mjs +1 -1
  133. package/index.d.mts +2 -0
  134. package/index.d.ts +2 -0
  135. package/index.js +25 -1
  136. package/index.mjs +3 -1
  137. package/internals/getRingPath.d.mts +16 -0
  138. package/internals/getRingPath.d.ts +16 -0
  139. package/internals/getRingPath.js +39 -0
  140. package/internals/getRingPath.mjs +33 -0
  141. package/internals/index.d.mts +8 -1
  142. package/internals/index.d.ts +8 -1
  143. package/internals/index.js +67 -0
  144. package/internals/index.mjs +7 -1
  145. package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +4 -2
  146. package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.mjs +4 -2
  147. package/internals/plugins/corePlugins/useChartSeriesConfig/types/polarExtremumGetter.types.d.mts +2 -2
  148. package/internals/plugins/corePlugins/useChartSeriesConfig/types/polarExtremumGetter.types.d.ts +2 -2
  149. package/internals/plugins/featurePlugins/useChartCartesianAxis/createZoomLookup.d.mts +3 -3
  150. package/internals/plugins/featurePlugins/useChartCartesianAxis/createZoomLookup.d.ts +3 -3
  151. package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.mts +1 -0
  152. package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +1 -0
  153. package/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +8 -0
  154. package/internals/plugins/featurePlugins/useChartCartesianAxis/index.mjs +1 -0
  155. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPosition.selectors.d.mts +6 -1
  156. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPosition.selectors.d.ts +6 -1
  157. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPosition.selectors.js +48 -36
  158. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPosition.selectors.mjs +47 -36
  159. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.mts +77 -3
  160. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +77 -3
  161. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.mts +152 -2
  162. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +152 -2
  163. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.mts +2 -2
  164. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +2 -2
  165. package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.d.mts +4 -7
  166. package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.d.ts +4 -7
  167. package/internals/plugins/featurePlugins/useChartPolarAxis/defaultizeAxis.d.mts +3 -2
  168. package/internals/plugins/featurePlugins/useChartPolarAxis/defaultizeAxis.d.ts +3 -2
  169. package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisExtremum.d.mts +2 -2
  170. package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisExtremum.d.ts +2 -2
  171. package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex.d.mts +7 -2
  172. package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex.d.ts +7 -2
  173. package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex.js +56 -6
  174. package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex.mjs +54 -5
  175. package/internals/plugins/featurePlugins/useChartPolarAxis/index.d.mts +2 -1
  176. package/internals/plugins/featurePlugins/useChartPolarAxis/index.d.ts +2 -1
  177. package/internals/plugins/featurePlugins/useChartPolarAxis/index.js +12 -0
  178. package/internals/plugins/featurePlugins/useChartPolarAxis/index.mjs +2 -1
  179. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +1 -1
  180. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.mjs +2 -2
  181. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.mts +4 -4
  182. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +4 -4
  183. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.d.mts +3 -3
  184. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.d.ts +3 -3
  185. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.mts +23 -3
  186. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +23 -3
  187. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.js +73 -12
  188. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.mjs +74 -12
  189. package/models/axis.d.mts +79 -31
  190. package/models/axis.d.ts +79 -31
  191. package/models/axis.js +5 -1
  192. package/models/axis.mjs +5 -1
  193. package/models/seriesType/line.d.mts +6 -6
  194. package/models/seriesType/line.d.ts +6 -6
  195. package/package.json +32 -4
@@ -0,0 +1,92 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import { isOrdinalScale } from "../internals/scaleGuards.mjs";
5
+ import { useStore } from "../internals/store/useStore.mjs";
6
+ import { selectorChartPolarCenter, selectorChartRadiusAxis, selectorChartRotationAxis } from "../internals/plugins/featurePlugins/useChartPolarAxis/index.mjs";
7
+ import { selectorChartsInteractionRotationAxisIndex, selectorChartsInteractionRotationAxisValue } from "../internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.mjs";
8
+ import { ChartsRadialAxisHighlightPath } from "./ChartsRadialAxisHighlightPath.mjs";
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
+ function polarToSvg(cx, cy, radius, angle) {
11
+ return [cx + radius * Math.sin(angle), cy - radius * Math.cos(angle)];
12
+ }
13
+
14
+ /**
15
+ * @ignore - internal component.
16
+ */
17
+ export default function ChartsRotationAxisHighlight(props) {
18
+ const {
19
+ type,
20
+ classes
21
+ } = props;
22
+ const store = useStore();
23
+ const {
24
+ cx,
25
+ cy
26
+ } = store.use(selectorChartPolarCenter);
27
+ const {
28
+ axis: rotationAxes,
29
+ axisIds: rotationAxisIds
30
+ } = store.use(selectorChartRotationAxis);
31
+ const {
32
+ axis: radiusAxes,
33
+ axisIds: radiusAxisIds
34
+ } = store.use(selectorChartRadiusAxis);
35
+ const rotationIndex = store.use(selectorChartsInteractionRotationAxisIndex);
36
+ const rotationValue = store.use(selectorChartsInteractionRotationAxisValue);
37
+ if (rotationIndex === null || rotationIndex === -1) {
38
+ return null;
39
+ }
40
+ const rotationAxisId = rotationAxisIds[0];
41
+ const radiusAxisId = radiusAxisIds[0];
42
+ if (rotationAxisId === undefined || radiusAxisId === undefined) {
43
+ return null;
44
+ }
45
+ const rotationAxis = rotationAxes[rotationAxisId];
46
+ const radiusAxis = radiusAxes[radiusAxisId];
47
+ const rotationScale = rotationAxis.scale;
48
+ const radiusScale = radiusAxis.scale;
49
+ const innerRadius = radiusScale.range()[0];
50
+ const outerRadius = radiusScale.range()[1];
51
+ const angle = rotationScale(rotationValue);
52
+ if (angle === undefined) {
53
+ return null;
54
+ }
55
+ if (type === 'band') {
56
+ if (!isOrdinalScale(rotationScale)) {
57
+ return null;
58
+ }
59
+ const step = rotationScale.step();
60
+ const bandwidth = rotationScale.bandwidth();
61
+ // For point scale: bandwidth = 0, the band is centered on the value.
62
+ // For band scale: scale(value) returns the band start, the band size is bandwidth.
63
+ const startAngle = angle - (step - bandwidth) / 2;
64
+ const endAngle = startAngle + step;
65
+ const [x1Outer, y1Outer] = polarToSvg(cx, cy, outerRadius, startAngle);
66
+ const [x2Outer, y2Outer] = polarToSvg(cx, cy, outerRadius, endAngle);
67
+ const [x1Inner, y1Inner] = polarToSvg(cx, cy, innerRadius, startAngle);
68
+ const [x2Inner, y2Inner] = polarToSvg(cx, cy, innerRadius, endAngle);
69
+ const isLargeArc = Math.abs(endAngle - startAngle) >= Math.PI;
70
+ const innerArc = innerRadius > 0 ? `L ${x2Inner} ${y2Inner} A ${innerRadius} ${innerRadius} 0 ${isLargeArc ? 1 : 0} 0 ${x1Inner} ${y1Inner}` : `L ${cx} ${cy}`;
71
+ return /*#__PURE__*/_jsx(ChartsRadialAxisHighlightPath, {
72
+ d: `M ${x1Outer} ${y1Outer} A ${outerRadius} ${outerRadius} 0 ${isLargeArc ? 1 : 0} 1 ${x2Outer} ${y2Outer} ${innerArc} Z`,
73
+ className: classes.root,
74
+ ownerState: {
75
+ axisHighlight: 'band'
76
+ }
77
+ });
78
+ }
79
+ if (type === 'line') {
80
+ const lineAngle = isOrdinalScale(rotationScale) ? angle + rotationScale.bandwidth() / 2 : angle;
81
+ const [x1, y1] = polarToSvg(cx, cy, innerRadius, lineAngle);
82
+ const [x2, y2] = polarToSvg(cx, cy, outerRadius, lineAngle);
83
+ return /*#__PURE__*/_jsx(ChartsRadialAxisHighlightPath, {
84
+ d: `M ${x1} ${y1} L ${x2} ${y2}`,
85
+ className: classes.root,
86
+ ownerState: {
87
+ axisHighlight: 'line'
88
+ }
89
+ });
90
+ }
91
+ return null;
92
+ }
@@ -0,0 +1,7 @@
1
+ export interface ChartsRadialAxisHighlightClasses {
2
+ /** Styles applied to the root element. */
3
+ root: string;
4
+ }
5
+ export type ChartsRadialAxisHighlightClassKey = keyof ChartsRadialAxisHighlightClasses;
6
+ export declare function getRadialAxisHighlightUtilityClass(slot: string): string;
7
+ export declare const chartsRadialAxisHighlightClasses: ChartsRadialAxisHighlightClasses;
@@ -0,0 +1,7 @@
1
+ export interface ChartsRadialAxisHighlightClasses {
2
+ /** Styles applied to the root element. */
3
+ root: string;
4
+ }
5
+ export type ChartsRadialAxisHighlightClassKey = keyof ChartsRadialAxisHighlightClasses;
6
+ export declare function getRadialAxisHighlightUtilityClass(slot: string): string;
7
+ export declare const chartsRadialAxisHighlightClasses: ChartsRadialAxisHighlightClasses;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.chartsRadialAxisHighlightClasses = void 0;
8
+ exports.getRadialAxisHighlightUtilityClass = getRadialAxisHighlightUtilityClass;
9
+ var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateUtilityClass"));
10
+ var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generateUtilityClasses"));
11
+ function getRadialAxisHighlightUtilityClass(slot) {
12
+ return (0, _generateUtilityClass.default)('MuiChartsRadialAxisHighlight', slot);
13
+ }
14
+ const chartsRadialAxisHighlightClasses = exports.chartsRadialAxisHighlightClasses = (0, _generateUtilityClasses.default)('MuiChartsRadialAxisHighlight', ['root']);
@@ -0,0 +1,6 @@
1
+ import generateUtilityClass from '@mui/utils/generateUtilityClass';
2
+ import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
3
+ export function getRadialAxisHighlightUtilityClass(slot) {
4
+ return generateUtilityClass('MuiChartsRadialAxisHighlight', slot);
5
+ }
6
+ export const chartsRadialAxisHighlightClasses = generateUtilityClasses('MuiChartsRadialAxisHighlight', ['root']);
@@ -0,0 +1,5 @@
1
+ export { ChartsRadialAxisHighlight as Unstable_ChartsRadialAxisHighlight } from "./ChartsRadialAxisHighlight.mjs";
2
+ export { chartsRadialAxisHighlightClasses } from "./chartsRadialAxisHighlightClasses.mjs";
3
+ export type { ChartsRadialAxisHighlightClasses, ChartsRadialAxisHighlightClassKey } from "./chartsRadialAxisHighlightClasses.mjs";
4
+ export * from "./ChartsRadialAxisHighlight.types.mjs";
5
+ export * from "./ChartsRadialAxisHighlightPath.mjs";
@@ -0,0 +1,5 @@
1
+ export { ChartsRadialAxisHighlight as Unstable_ChartsRadialAxisHighlight } from "./ChartsRadialAxisHighlight.js";
2
+ export { chartsRadialAxisHighlightClasses } from "./chartsRadialAxisHighlightClasses.js";
3
+ export type { ChartsRadialAxisHighlightClasses, ChartsRadialAxisHighlightClassKey } from "./chartsRadialAxisHighlightClasses.js";
4
+ export * from "./ChartsRadialAxisHighlight.types.js";
5
+ export * from "./ChartsRadialAxisHighlightPath.js";
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _exportNames = {
7
+ Unstable_ChartsRadialAxisHighlight: true,
8
+ chartsRadialAxisHighlightClasses: true
9
+ };
10
+ Object.defineProperty(exports, "Unstable_ChartsRadialAxisHighlight", {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _ChartsRadialAxisHighlight.ChartsRadialAxisHighlight;
14
+ }
15
+ });
16
+ Object.defineProperty(exports, "chartsRadialAxisHighlightClasses", {
17
+ enumerable: true,
18
+ get: function () {
19
+ return _chartsRadialAxisHighlightClasses.chartsRadialAxisHighlightClasses;
20
+ }
21
+ });
22
+ var _ChartsRadialAxisHighlight = require("./ChartsRadialAxisHighlight");
23
+ var _chartsRadialAxisHighlightClasses = require("./chartsRadialAxisHighlightClasses");
24
+ var _ChartsRadialAxisHighlight2 = require("./ChartsRadialAxisHighlight.types");
25
+ Object.keys(_ChartsRadialAxisHighlight2).forEach(function (key) {
26
+ if (key === "default" || key === "__esModule") return;
27
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
28
+ if (key in exports && exports[key] === _ChartsRadialAxisHighlight2[key]) return;
29
+ Object.defineProperty(exports, key, {
30
+ enumerable: true,
31
+ get: function () {
32
+ return _ChartsRadialAxisHighlight2[key];
33
+ }
34
+ });
35
+ });
36
+ var _ChartsRadialAxisHighlightPath = require("./ChartsRadialAxisHighlightPath");
37
+ Object.keys(_ChartsRadialAxisHighlightPath).forEach(function (key) {
38
+ if (key === "default" || key === "__esModule") return;
39
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
40
+ if (key in exports && exports[key] === _ChartsRadialAxisHighlightPath[key]) return;
41
+ Object.defineProperty(exports, key, {
42
+ enumerable: true,
43
+ get: function () {
44
+ return _ChartsRadialAxisHighlightPath[key];
45
+ }
46
+ });
47
+ });
@@ -0,0 +1,4 @@
1
+ export { ChartsRadialAxisHighlight as Unstable_ChartsRadialAxisHighlight } from "./ChartsRadialAxisHighlight.mjs";
2
+ export { chartsRadialAxisHighlightClasses } from "./chartsRadialAxisHighlightClasses.mjs";
3
+ export * from "./ChartsRadialAxisHighlight.types.mjs";
4
+ export * from "./ChartsRadialAxisHighlightPath.mjs";
@@ -1,48 +1,2 @@
1
- import type { AxisId } from "../models/axis.mjs";
2
- import { type ChartsRadialAxisClasses } from "./chartsRadiusAxisClasses.mjs";
3
- export interface ChartsRadiusAxisProps {
4
- /**
5
- * Id of the radius axis to render.
6
- * If not provided, it will use the first defined radius axis.
7
- */
8
- axisId?: AxisId;
9
- /**
10
- * The position of the axis in polar coordinates.
11
- * It can be 'start', 'end', or a specific angle in degrees.
12
- * @default 'start'
13
- */
14
- position?: 'start' | 'end' | number;
15
- /**
16
- * If `true`, the axis line is not rendered.
17
- * @default false
18
- */
19
- disableLine?: boolean;
20
- /**
21
- * If `true`, the ticks are not rendered.
22
- * @default false
23
- */
24
- disableTicks?: boolean;
25
- /**
26
- * The size (in pixels) of the tick marks.
27
- * @default 6
28
- */
29
- tickSize?: number;
30
- /**
31
- * Set the position of the tick labels relative to the axis line.
32
- * The before/after is defined based on clockwise direction.
33
- * @default 'after'
34
- */
35
- tickLabelPosition?: 'center' | 'after' | 'before';
36
- /**
37
- * Set the position of the tick relative to the axis line.
38
- * The before/after is defined based on clockwise direction.
39
- * @default 'after'
40
- */
41
- tickPosition?: 'after' | 'before';
42
- /**
43
- * A CSS class name applied to the root element.
44
- */
45
- className?: string;
46
- classes?: Partial<ChartsRadialAxisClasses>;
47
- }
1
+ import type { ChartsRadiusAxisProps } from "../models/axis.mjs";
48
2
  export declare function ChartsRadiusAxis(props: ChartsRadiusAxisProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,48 +1,2 @@
1
- import type { AxisId } from "../models/axis.js";
2
- import { type ChartsRadialAxisClasses } from "./chartsRadiusAxisClasses.js";
3
- export interface ChartsRadiusAxisProps {
4
- /**
5
- * Id of the radius axis to render.
6
- * If not provided, it will use the first defined radius axis.
7
- */
8
- axisId?: AxisId;
9
- /**
10
- * The position of the axis in polar coordinates.
11
- * It can be 'start', 'end', or a specific angle in degrees.
12
- * @default 'start'
13
- */
14
- position?: 'start' | 'end' | number;
15
- /**
16
- * If `true`, the axis line is not rendered.
17
- * @default false
18
- */
19
- disableLine?: boolean;
20
- /**
21
- * If `true`, the ticks are not rendered.
22
- * @default false
23
- */
24
- disableTicks?: boolean;
25
- /**
26
- * The size (in pixels) of the tick marks.
27
- * @default 6
28
- */
29
- tickSize?: number;
30
- /**
31
- * Set the position of the tick labels relative to the axis line.
32
- * The before/after is defined based on clockwise direction.
33
- * @default 'after'
34
- */
35
- tickLabelPosition?: 'center' | 'after' | 'before';
36
- /**
37
- * Set the position of the tick relative to the axis line.
38
- * The before/after is defined based on clockwise direction.
39
- * @default 'after'
40
- */
41
- tickPosition?: 'after' | 'before';
42
- /**
43
- * A CSS class name applied to the root element.
44
- */
45
- className?: string;
46
- classes?: Partial<ChartsRadialAxisClasses>;
47
- }
1
+ import type { ChartsRadiusAxisProps } from "../models/axis.js";
48
2
  export declare function ChartsRadiusAxis(props: ChartsRadiusAxisProps): import("react/jsx-runtime").JSX.Element | null;
@@ -17,8 +17,7 @@ var _chartsRadiusAxisClasses = require("./chartsRadiusAxisClasses");
17
17
  var _createGetLabelTextAnchors = require("./createGetLabelTextAnchors");
18
18
  var _getLabelTransform = require("./getLabelTransform");
19
19
  var _jsxRuntime = require("react/jsx-runtime");
20
- /* Gap between a tick and its label. */
21
- const TICK_LABEL_GAP = 3;
20
+ /* Gap between a tick and its label. */const TICK_LABEL_GAP = 3;
22
21
  const getLabelTextAnchors = (0, _createGetLabelTextAnchors.createGetLabelTextAnchors)(_getLabelTransform.getLabelTransform);
23
22
 
24
23
  /**
@@ -40,17 +39,22 @@ function getAxisAngleInRadians(position, rotationAxis) {
40
39
  return 0;
41
40
  }
42
41
  function ChartsRadiusAxis(props) {
42
+ const radiusAxis = (0, _useAxis.useRadiusAxis)(props.axisId);
43
+ const settings = (0, _extends2.default)({}, radiusAxis, props);
43
44
  const {
44
- axisId,
45
45
  position = 'start',
46
46
  disableLine,
47
47
  disableTicks,
48
- tickLabelPosition = 'after',
49
- tickPosition = 'after',
48
+ tickLabelPosition: tickLabelPositionProp = 'auto',
49
+ tickPosition = position === 'start' ? 'before' : 'after',
50
50
  tickSize = 6,
51
51
  className,
52
52
  classes: classesProp
53
- } = props;
53
+ } = settings;
54
+ let tickLabelPosition = tickLabelPositionProp;
55
+ if (tickLabelPosition === 'auto') {
56
+ tickLabelPosition = position === 'start' ? 'before' : 'after';
57
+ }
54
58
  const isCentered = tickLabelPosition === 'center';
55
59
  const classes = (0, _chartsRadiusAxisClasses.useUtilityClasses)({
56
60
  classes: classesProp,
@@ -64,7 +68,6 @@ function ChartsRadiusAxis(props) {
64
68
  cx,
65
69
  cy
66
70
  } = store.use(_useChartPolarAxis.selectorChartPolarCenter);
67
- const radiusAxis = (0, _useAxis.useRadiusAxis)(axisId);
68
71
  const rotationAxis = (0, _useAxis.useRotationAxis)();
69
72
  const ticks = (0, _useTicks.useTicks)({
70
73
  scale: radiusAxis.scale,
@@ -74,7 +77,7 @@ function ChartsRadiusAxis(props) {
74
77
  valueFormatter: radiusAxis?.valueFormatter,
75
78
  direction: 'radius'
76
79
  });
77
- if (!radiusAxis) {
80
+ if (!radiusAxis || settings.position === 'none') {
78
81
  return null;
79
82
  }
80
83
  const angle = getAxisAngleInRadians(position, rotationAxis);
@@ -102,17 +105,18 @@ function ChartsRadiusAxis(props) {
102
105
  className: classes.line
103
106
  }), ticks.map(({
104
107
  offset: radius,
108
+ labelOffset,
105
109
  formattedValue
106
110
  }, index) => {
107
111
  if (!formattedValue) {
108
112
  return null;
109
113
  }
110
- const tx = cx + dx * radius;
111
- const ty = cy + dy * radius;
114
+ const tickX = cx + dx * radius;
115
+ const tickY = cy + dy * radius;
112
116
 
113
117
  // Compute the label position.
114
- let labelX = tx;
115
- let labelY = ty;
118
+ let labelX = cx + dx * (radius + labelOffset);
119
+ let labelY = cy + dy * (radius + labelOffset);
116
120
  if (tickLabelGap !== 0) {
117
121
  labelX += tickLabelGapDx;
118
122
  labelY += tickLabelGapDy;
@@ -125,10 +129,10 @@ function ChartsRadiusAxis(props) {
125
129
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("g", {
126
130
  className: classes.tickContainer,
127
131
  children: [!disableTicks && /*#__PURE__*/(0, _jsxRuntime.jsx)("line", {
128
- x1: tx,
129
- y1: ty,
130
- x2: tx + tickDx,
131
- y2: ty + tickDy,
132
+ x1: tickX,
133
+ y1: tickY,
134
+ x2: tickX + tickDx,
135
+ y2: tickY + tickDy,
132
136
  stroke: stroke,
133
137
  className: classes.tick
134
138
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("text", (0, _extends2.default)({
@@ -10,8 +10,9 @@ import { selectorChartPolarCenter } from "../internals/plugins/featurePlugins/us
10
10
  import { useUtilityClasses } from "./chartsRadiusAxisClasses.mjs";
11
11
  import { createGetLabelTextAnchors } from "./createGetLabelTextAnchors.mjs";
12
12
  import { getLabelTransform } from "./getLabelTransform.mjs";
13
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+
14
14
  /* Gap between a tick and its label. */
15
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
16
  const TICK_LABEL_GAP = 3;
16
17
  const getLabelTextAnchors = createGetLabelTextAnchors(getLabelTransform);
17
18
 
@@ -34,17 +35,22 @@ function getAxisAngleInRadians(position, rotationAxis) {
34
35
  return 0;
35
36
  }
36
37
  export function ChartsRadiusAxis(props) {
38
+ const radiusAxis = useRadiusAxis(props.axisId);
39
+ const settings = _extends({}, radiusAxis, props);
37
40
  const {
38
- axisId,
39
41
  position = 'start',
40
42
  disableLine,
41
43
  disableTicks,
42
- tickLabelPosition = 'after',
43
- tickPosition = 'after',
44
+ tickLabelPosition: tickLabelPositionProp = 'auto',
45
+ tickPosition = position === 'start' ? 'before' : 'after',
44
46
  tickSize = 6,
45
47
  className,
46
48
  classes: classesProp
47
- } = props;
49
+ } = settings;
50
+ let tickLabelPosition = tickLabelPositionProp;
51
+ if (tickLabelPosition === 'auto') {
52
+ tickLabelPosition = position === 'start' ? 'before' : 'after';
53
+ }
48
54
  const isCentered = tickLabelPosition === 'center';
49
55
  const classes = useUtilityClasses({
50
56
  classes: classesProp,
@@ -58,7 +64,6 @@ export function ChartsRadiusAxis(props) {
58
64
  cx,
59
65
  cy
60
66
  } = store.use(selectorChartPolarCenter);
61
- const radiusAxis = useRadiusAxis(axisId);
62
67
  const rotationAxis = useRotationAxis();
63
68
  const ticks = useTicks({
64
69
  scale: radiusAxis.scale,
@@ -68,7 +73,7 @@ export function ChartsRadiusAxis(props) {
68
73
  valueFormatter: radiusAxis?.valueFormatter,
69
74
  direction: 'radius'
70
75
  });
71
- if (!radiusAxis) {
76
+ if (!radiusAxis || settings.position === 'none') {
72
77
  return null;
73
78
  }
74
79
  const angle = getAxisAngleInRadians(position, rotationAxis);
@@ -96,17 +101,18 @@ export function ChartsRadiusAxis(props) {
96
101
  className: classes.line
97
102
  }), ticks.map(({
98
103
  offset: radius,
104
+ labelOffset,
99
105
  formattedValue
100
106
  }, index) => {
101
107
  if (!formattedValue) {
102
108
  return null;
103
109
  }
104
- const tx = cx + dx * radius;
105
- const ty = cy + dy * radius;
110
+ const tickX = cx + dx * radius;
111
+ const tickY = cy + dy * radius;
106
112
 
107
113
  // Compute the label position.
108
- let labelX = tx;
109
- let labelY = ty;
114
+ let labelX = cx + dx * (radius + labelOffset);
115
+ let labelY = cy + dy * (radius + labelOffset);
110
116
  if (tickLabelGap !== 0) {
111
117
  labelX += tickLabelGapDx;
112
118
  labelY += tickLabelGapDy;
@@ -119,10 +125,10 @@ export function ChartsRadiusAxis(props) {
119
125
  return /*#__PURE__*/_jsxs("g", {
120
126
  className: classes.tickContainer,
121
127
  children: [!disableTicks && /*#__PURE__*/_jsx("line", {
122
- x1: tx,
123
- y1: ty,
124
- x2: tx + tickDx,
125
- y2: ty + tickDy,
128
+ x1: tickX,
129
+ y1: tickY,
130
+ x2: tickX + tickDx,
131
+ y2: tickY + tickDy,
126
132
  stroke: stroke,
127
133
  className: classes.tick
128
134
  }), /*#__PURE__*/_jsx("text", _extends({
@@ -1,3 +1,4 @@
1
- export { type ChartsRadiusAxisProps, ChartsRadiusAxis as Unstable_ChartsRadiusAxis } from "./ChartsRadiusAxis.mjs";
1
+ export { ChartsRadiusAxis as Unstable_ChartsRadiusAxis } from "./ChartsRadiusAxis.mjs";
2
2
  export { chartsRadialAxisClasses } from "./chartsRadiusAxisClasses.mjs";
3
- export type { ChartsRadialAxisClasses, ChartsRadialAxisClassKey } from "./chartsRadiusAxisClasses.mjs";
3
+ export type { ChartsRadialAxisClasses, ChartsRadialAxisClassKey } from "./chartsRadiusAxisClasses.mjs";
4
+ export { type ChartsRadiusAxisProps } from "../models/axis.mjs";
@@ -1,3 +1,4 @@
1
- export { type ChartsRadiusAxisProps, ChartsRadiusAxis as Unstable_ChartsRadiusAxis } from "./ChartsRadiusAxis.js";
1
+ export { ChartsRadiusAxis as Unstable_ChartsRadiusAxis } from "./ChartsRadiusAxis.js";
2
2
  export { chartsRadialAxisClasses } from "./chartsRadiusAxisClasses.js";
3
- export type { ChartsRadialAxisClasses, ChartsRadialAxisClassKey } from "./chartsRadiusAxisClasses.js";
3
+ export type { ChartsRadialAxisClasses, ChartsRadialAxisClassKey } from "./chartsRadiusAxisClasses.js";
4
+ export { type ChartsRadiusAxisProps } from "../models/axis.js";
@@ -1,2 +1,4 @@
1
1
  export { ChartsRadiusAxis as Unstable_ChartsRadiusAxis } from "./ChartsRadiusAxis.mjs";
2
- export { chartsRadialAxisClasses } from "./chartsRadiusAxisClasses.mjs";
2
+ export { chartsRadialAxisClasses } from "./chartsRadiusAxisClasses.mjs";
3
+
4
+ // Re-export types
@@ -1,48 +1,2 @@
1
- import type { AxisId } from "../models/axis.mjs";
2
- import { type ChartsRadialAxisClasses } from "./chartsRotationAxisClasses.mjs";
3
- export interface ChartsRotationAxisProps {
4
- /**
5
- * Id of the rotation axis to render.
6
- * If not provided, it will use the first defined rotation axis.
7
- */
8
- axisId?: AxisId;
9
- /**
10
- * If `true`, the axis line is not rendered.
11
- * @default false
12
- */
13
- disableLine?: boolean;
14
- /**
15
- * If `true`, the ticks are not rendered.
16
- * @default false
17
- */
18
- disableTicks?: boolean;
19
- /**
20
- * The position of the rotation axis.
21
- * It can be 'inside' or 'outside'.
22
- * @default 'outside'
23
- */
24
- position?: 'inside' | 'outside';
25
- /**
26
- * The size (in pixels) of the tick marks.
27
- * @default 6
28
- */
29
- tickSize?: number;
30
- /**
31
- * Set the position of the tick labels relative to the axis line.
32
- * `'after'` places them outside the arc, `'before'` inside.
33
- * @default position === 'outside' ? 'after' : 'before'
34
- */
35
- tickLabelPosition?: 'after' | 'before';
36
- /**
37
- * Set the position of the tick relative to the axis line.
38
- * `'after'` places them outside the arc, `'before'` inside.
39
- * @default position === 'outside' ? 'after' : 'before'
40
- */
41
- tickPosition?: 'after' | 'before';
42
- /**
43
- * A CSS class name applied to the root element.
44
- */
45
- className?: string;
46
- classes?: Partial<ChartsRadialAxisClasses>;
47
- }
1
+ import type { ChartsRotationAxisProps } from "../models/axis.mjs";
48
2
  export declare function ChartsRotationAxis(props: ChartsRotationAxisProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,48 +1,2 @@
1
- import type { AxisId } from "../models/axis.js";
2
- import { type ChartsRadialAxisClasses } from "./chartsRotationAxisClasses.js";
3
- export interface ChartsRotationAxisProps {
4
- /**
5
- * Id of the rotation axis to render.
6
- * If not provided, it will use the first defined rotation axis.
7
- */
8
- axisId?: AxisId;
9
- /**
10
- * If `true`, the axis line is not rendered.
11
- * @default false
12
- */
13
- disableLine?: boolean;
14
- /**
15
- * If `true`, the ticks are not rendered.
16
- * @default false
17
- */
18
- disableTicks?: boolean;
19
- /**
20
- * The position of the rotation axis.
21
- * It can be 'inside' or 'outside'.
22
- * @default 'outside'
23
- */
24
- position?: 'inside' | 'outside';
25
- /**
26
- * The size (in pixels) of the tick marks.
27
- * @default 6
28
- */
29
- tickSize?: number;
30
- /**
31
- * Set the position of the tick labels relative to the axis line.
32
- * `'after'` places them outside the arc, `'before'` inside.
33
- * @default position === 'outside' ? 'after' : 'before'
34
- */
35
- tickLabelPosition?: 'after' | 'before';
36
- /**
37
- * Set the position of the tick relative to the axis line.
38
- * `'after'` places them outside the arc, `'before'` inside.
39
- * @default position === 'outside' ? 'after' : 'before'
40
- */
41
- tickPosition?: 'after' | 'before';
42
- /**
43
- * A CSS class name applied to the root element.
44
- */
45
- className?: string;
46
- classes?: Partial<ChartsRadialAxisClasses>;
47
- }
1
+ import type { ChartsRotationAxisProps } from "../models/axis.js";
48
2
  export declare function ChartsRotationAxis(props: ChartsRotationAxisProps): import("react/jsx-runtime").JSX.Element | null;