@mantine/charts 7.13.3 → 7.13.5-alpha.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 (132) hide show
  1. package/package.json +7 -7
  2. package/styles.css +43 -0
  3. package/styles.layer.css +43 -0
  4. package/cjs/AreaChart/AreaChart.cjs +0 -388
  5. package/cjs/AreaChart/AreaChart.cjs.map +0 -1
  6. package/cjs/AreaChart/AreaGradient.cjs +0 -15
  7. package/cjs/AreaChart/AreaGradient.cjs.map +0 -1
  8. package/cjs/AreaChart/AreaSplit.cjs +0 -31
  9. package/cjs/AreaChart/AreaSplit.cjs.map +0 -1
  10. package/cjs/AreaChart/get-split-offset.cjs +0 -25
  11. package/cjs/AreaChart/get-split-offset.cjs.map +0 -1
  12. package/cjs/BarChart/BarChart.cjs +0 -374
  13. package/cjs/BarChart/BarChart.cjs.map +0 -1
  14. package/cjs/BubbleChart/BubbleChart.cjs +0 -148
  15. package/cjs/BubbleChart/BubbleChart.cjs.map +0 -1
  16. package/cjs/ChartLegend/ChartLegend.cjs +0 -97
  17. package/cjs/ChartLegend/ChartLegend.cjs.map +0 -1
  18. package/cjs/ChartLegend/ChartLegend.module.css.cjs +0 -7
  19. package/cjs/ChartLegend/ChartLegend.module.css.cjs.map +0 -1
  20. package/cjs/ChartTooltip/ChartTooltip.cjs +0 -124
  21. package/cjs/ChartTooltip/ChartTooltip.cjs.map +0 -1
  22. package/cjs/ChartTooltip/ChartTooltip.module.css.cjs +0 -7
  23. package/cjs/ChartTooltip/ChartTooltip.module.css.cjs.map +0 -1
  24. package/cjs/CompositeChart/CompositeChart.cjs +0 -393
  25. package/cjs/CompositeChart/CompositeChart.cjs.map +0 -1
  26. package/cjs/DonutChart/DonutChart.cjs +0 -149
  27. package/cjs/DonutChart/DonutChart.cjs.map +0 -1
  28. package/cjs/DonutChart/DonutChart.module.css.cjs +0 -7
  29. package/cjs/DonutChart/DonutChart.module.css.cjs.map +0 -1
  30. package/cjs/LineChart/LineChart.cjs +0 -353
  31. package/cjs/LineChart/LineChart.cjs.map +0 -1
  32. package/cjs/PieChart/PieChart.cjs +0 -175
  33. package/cjs/PieChart/PieChart.cjs.map +0 -1
  34. package/cjs/PieChart/PieChart.module.css.cjs +0 -7
  35. package/cjs/PieChart/PieChart.module.css.cjs.map +0 -1
  36. package/cjs/PointLabel/PointLabel.cjs +0 -23
  37. package/cjs/PointLabel/PointLabel.cjs.map +0 -1
  38. package/cjs/RadarChart/RadarChart.cjs +0 -113
  39. package/cjs/RadarChart/RadarChart.cjs.map +0 -1
  40. package/cjs/RadarChart/RadarChart.module.css.cjs +0 -7
  41. package/cjs/RadarChart/RadarChart.module.css.cjs.map +0 -1
  42. package/cjs/ScatterChart/ScatterChart.cjs +0 -287
  43. package/cjs/ScatterChart/ScatterChart.cjs.map +0 -1
  44. package/cjs/Sparkline/Sparkline.cjs +0 -103
  45. package/cjs/Sparkline/Sparkline.cjs.map +0 -1
  46. package/cjs/grid-chart.module.css.cjs +0 -7
  47. package/cjs/grid-chart.module.css.cjs.map +0 -1
  48. package/cjs/index.cjs +0 -36
  49. package/cjs/index.cjs.map +0 -1
  50. package/cjs/utils/get-series-labels/get-series-labels.cjs +0 -21
  51. package/cjs/utils/get-series-labels/get-series-labels.cjs.map +0 -1
  52. package/esm/AreaChart/AreaChart.mjs +0 -386
  53. package/esm/AreaChart/AreaChart.mjs.map +0 -1
  54. package/esm/AreaChart/AreaGradient.mjs +0 -13
  55. package/esm/AreaChart/AreaGradient.mjs.map +0 -1
  56. package/esm/AreaChart/AreaSplit.mjs +0 -29
  57. package/esm/AreaChart/AreaSplit.mjs.map +0 -1
  58. package/esm/AreaChart/get-split-offset.mjs +0 -22
  59. package/esm/AreaChart/get-split-offset.mjs.map +0 -1
  60. package/esm/BarChart/BarChart.mjs +0 -371
  61. package/esm/BarChart/BarChart.mjs.map +0 -1
  62. package/esm/BubbleChart/BubbleChart.mjs +0 -146
  63. package/esm/BubbleChart/BubbleChart.mjs.map +0 -1
  64. package/esm/ChartLegend/ChartLegend.mjs +0 -94
  65. package/esm/ChartLegend/ChartLegend.mjs.map +0 -1
  66. package/esm/ChartLegend/ChartLegend.module.css.mjs +0 -5
  67. package/esm/ChartLegend/ChartLegend.module.css.mjs.map +0 -1
  68. package/esm/ChartTooltip/ChartTooltip.mjs +0 -121
  69. package/esm/ChartTooltip/ChartTooltip.mjs.map +0 -1
  70. package/esm/ChartTooltip/ChartTooltip.module.css.mjs +0 -5
  71. package/esm/ChartTooltip/ChartTooltip.module.css.mjs.map +0 -1
  72. package/esm/CompositeChart/CompositeChart.mjs +0 -391
  73. package/esm/CompositeChart/CompositeChart.mjs.map +0 -1
  74. package/esm/DonutChart/DonutChart.mjs +0 -147
  75. package/esm/DonutChart/DonutChart.mjs.map +0 -1
  76. package/esm/DonutChart/DonutChart.module.css.mjs +0 -5
  77. package/esm/DonutChart/DonutChart.module.css.mjs.map +0 -1
  78. package/esm/LineChart/LineChart.mjs +0 -351
  79. package/esm/LineChart/LineChart.mjs.map +0 -1
  80. package/esm/PieChart/PieChart.mjs +0 -173
  81. package/esm/PieChart/PieChart.mjs.map +0 -1
  82. package/esm/PieChart/PieChart.module.css.mjs +0 -5
  83. package/esm/PieChart/PieChart.module.css.mjs.map +0 -1
  84. package/esm/PointLabel/PointLabel.mjs +0 -21
  85. package/esm/PointLabel/PointLabel.mjs.map +0 -1
  86. package/esm/RadarChart/RadarChart.mjs +0 -111
  87. package/esm/RadarChart/RadarChart.mjs.map +0 -1
  88. package/esm/RadarChart/RadarChart.module.css.mjs +0 -5
  89. package/esm/RadarChart/RadarChart.module.css.mjs.map +0 -1
  90. package/esm/ScatterChart/ScatterChart.mjs +0 -285
  91. package/esm/ScatterChart/ScatterChart.mjs.map +0 -1
  92. package/esm/Sparkline/Sparkline.mjs +0 -101
  93. package/esm/Sparkline/Sparkline.mjs.map +0 -1
  94. package/esm/grid-chart.module.css.mjs +0 -5
  95. package/esm/grid-chart.module.css.mjs.map +0 -1
  96. package/esm/index.mjs +0 -15
  97. package/esm/index.mjs.map +0 -1
  98. package/esm/utils/get-series-labels/get-series-labels.mjs +0 -19
  99. package/esm/utils/get-series-labels/get-series-labels.mjs.map +0 -1
  100. package/lib/AreaChart/AreaChart.d.ts +0 -61
  101. package/lib/AreaChart/AreaGradient.d.ts +0 -11
  102. package/lib/AreaChart/AreaSplit.d.ts +0 -12
  103. package/lib/AreaChart/get-split-offset.d.ts +0 -13
  104. package/lib/AreaChart/index.d.ts +0 -4
  105. package/lib/BarChart/BarChart.d.ts +0 -50
  106. package/lib/BarChart/index.d.ts +0 -2
  107. package/lib/BubbleChart/BubbleChart.d.ts +0 -53
  108. package/lib/BubbleChart/index.d.ts +0 -2
  109. package/lib/ChartLegend/ChartLegend.d.ts +0 -28
  110. package/lib/ChartLegend/index.d.ts +0 -2
  111. package/lib/ChartTooltip/ChartTooltip.d.ts +0 -32
  112. package/lib/ChartTooltip/index.d.ts +0 -2
  113. package/lib/CompositeChart/CompositeChart.d.ts +0 -62
  114. package/lib/CompositeChart/index.d.ts +0 -2
  115. package/lib/DonutChart/DonutChart.d.ts +0 -65
  116. package/lib/DonutChart/index.d.ts +0 -2
  117. package/lib/LineChart/LineChart.d.ts +0 -62
  118. package/lib/LineChart/index.d.ts +0 -2
  119. package/lib/PieChart/PieChart.d.ts +0 -66
  120. package/lib/PieChart/index.d.ts +0 -2
  121. package/lib/PointLabel/PointLabel.d.ts +0 -7
  122. package/lib/RadarChart/RadarChart.d.ts +0 -58
  123. package/lib/RadarChart/index.d.ts +0 -2
  124. package/lib/ScatterChart/ScatterChart.d.ts +0 -56
  125. package/lib/ScatterChart/index.d.ts +0 -2
  126. package/lib/Sparkline/Sparkline.d.ts +0 -44
  127. package/lib/Sparkline/index.d.ts +0 -2
  128. package/lib/index.d.mts +0 -13
  129. package/lib/index.d.ts +0 -13
  130. package/lib/types.d.ts +0 -69
  131. package/lib/utils/get-series-labels/get-series-labels.d.ts +0 -4
  132. package/lib/utils/index.d.ts +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mantine/charts",
3
- "version": "7.13.3",
3
+ "version": "7.13.5-alpha.0",
4
4
  "description": "Charts components built with recharts and Mantine",
5
5
  "homepage": "https://mantine.dev/",
6
6
  "license": "MIT",
@@ -35,15 +35,15 @@
35
35
  "directory": "packages/@mantine/charts"
36
36
  },
37
37
  "peerDependencies": {
38
- "@mantine/core": "7.13.3",
39
- "@mantine/hooks": "7.13.3",
38
+ "@mantine/core": "7.13.5-alpha.0",
39
+ "@mantine/hooks": "7.13.5-alpha.0",
40
40
  "react": "^18.2.0",
41
41
  "react-dom": "^18.2.0",
42
42
  "recharts": "^2.10.3"
43
43
  },
44
44
  "devDependencies": {
45
- "@mantine-tests/core": "1.1.0",
46
- "@mantine/core": "7.13.3",
47
- "@mantine/hooks": "7.13.3"
45
+ "@mantine-tests/core": "workspace:*",
46
+ "@mantine/core": "workspace:*",
47
+ "@mantine/hooks": "workspace:*"
48
48
  }
49
- }
49
+ }
package/styles.css CHANGED
@@ -29,6 +29,11 @@
29
29
  padding-top: var(--mantine-spacing-sm);
30
30
  }
31
31
 
32
+ .m_b30369b5 {
33
+ width: calc(0.75rem * var(--mantine-scale));
34
+ height: calc(0.75rem * var(--mantine-scale));
35
+ }
36
+
32
37
  .m_3de8964e {
33
38
  font-size: var(--mantine-font-size-sm);
34
39
  display: flex;
@@ -221,3 +226,41 @@
221
226
  height: 100%;
222
227
  width: 100%;
223
228
  }
229
+
230
+ :where([data-mantine-color-scheme='light']) .m_cd2bd9e5 {
231
+ --chart-empty-background: var(--mantine-color-gray-1);
232
+ --chart-cursor-color: var(--mantine-color-gray-4);
233
+ }
234
+ :where([data-mantine-color-scheme='dark']) .m_cd2bd9e5 {
235
+ --chart-empty-background: var(--mantine-color-dark-6);
236
+ --chart-cursor-color: var(--mantine-color-dark-4);
237
+ }
238
+
239
+ .m_6bcc3420 {
240
+ padding: var(--mantine-spacing-md);
241
+ box-shadow: var(--mantine-shadow-md);
242
+ min-width: calc(12.5rem * var(--mantine-scale));
243
+ font-size: var(--mantine-font-size-sm);
244
+ display: flex;
245
+ align-items: center;
246
+ justify-content: space-between;
247
+ }
248
+
249
+ :where([data-mantine-color-scheme='light']) .m_6bcc3420 {
250
+ border: 1px solid var(--mantine-color-gray-2);
251
+ }
252
+
253
+ :where([data-mantine-color-scheme='dark']) .m_6bcc3420 {
254
+ border: 1px solid var(--mantine-color-dark-4);
255
+ }
256
+
257
+ .m_80d531e7 {
258
+ min-height: var(--chart-size, auto);
259
+ height: var(--chart-size, auto);
260
+ width: var(--chart-size, auto);
261
+ min-width: var(--chart-size, auto);
262
+ }
263
+
264
+ .m_80d531e7 :where(*) {
265
+ outline: 0;
266
+ }
package/styles.layer.css CHANGED
@@ -29,6 +29,11 @@
29
29
  padding-top: var(--mantine-spacing-sm);
30
30
  }
31
31
 
32
+ .m_b30369b5 {
33
+ width: calc(0.75rem * var(--mantine-scale));
34
+ height: calc(0.75rem * var(--mantine-scale));
35
+ }
36
+
32
37
  .m_3de8964e {
33
38
  font-size: var(--mantine-font-size-sm);
34
39
  display: flex;
@@ -221,4 +226,42 @@
221
226
  height: 100%;
222
227
  width: 100%;
223
228
  }
229
+
230
+ :where([data-mantine-color-scheme='light']) .m_cd2bd9e5 {
231
+ --chart-empty-background: var(--mantine-color-gray-1);
232
+ --chart-cursor-color: var(--mantine-color-gray-4);
233
+ }
234
+ :where([data-mantine-color-scheme='dark']) .m_cd2bd9e5 {
235
+ --chart-empty-background: var(--mantine-color-dark-6);
236
+ --chart-cursor-color: var(--mantine-color-dark-4);
237
+ }
238
+
239
+ .m_6bcc3420 {
240
+ padding: var(--mantine-spacing-md);
241
+ box-shadow: var(--mantine-shadow-md);
242
+ min-width: calc(12.5rem * var(--mantine-scale));
243
+ font-size: var(--mantine-font-size-sm);
244
+ display: flex;
245
+ align-items: center;
246
+ justify-content: space-between;
247
+ }
248
+
249
+ :where([data-mantine-color-scheme='light']) .m_6bcc3420 {
250
+ border: 1px solid var(--mantine-color-gray-2);
251
+ }
252
+
253
+ :where([data-mantine-color-scheme='dark']) .m_6bcc3420 {
254
+ border: 1px solid var(--mantine-color-dark-4);
255
+ }
256
+
257
+ .m_80d531e7 {
258
+ min-height: var(--chart-size, auto);
259
+ height: var(--chart-size, auto);
260
+ width: var(--chart-size, auto);
261
+ min-width: var(--chart-size, auto);
262
+ }
263
+
264
+ .m_80d531e7 :where(*) {
265
+ outline: 0;
266
+ }
224
267
  }
@@ -1,388 +0,0 @@
1
- 'use client';
2
- 'use strict';
3
-
4
- var jsxRuntime = require('react/jsx-runtime');
5
- var react = require('react');
6
- var recharts = require('recharts');
7
- var core = require('@mantine/core');
8
- var ChartLegend = require('../ChartLegend/ChartLegend.cjs');
9
- var ChartTooltip = require('../ChartTooltip/ChartTooltip.cjs');
10
- var PointLabel = require('../PointLabel/PointLabel.cjs');
11
- var AreaGradient = require('./AreaGradient.cjs');
12
- var AreaSplit = require('./AreaSplit.cjs');
13
- var getSplitOffset = require('./get-split-offset.cjs');
14
- var gridChart_module = require('../grid-chart.module.css.cjs');
15
-
16
- function valueToPercent(value) {
17
- return `${(value * 100).toFixed(0)}%`;
18
- }
19
- const defaultProps = {
20
- withXAxis: true,
21
- withYAxis: true,
22
- withDots: true,
23
- withTooltip: true,
24
- connectNulls: true,
25
- strokeWidth: 2,
26
- tooltipAnimationDuration: 0,
27
- fillOpacity: 0.2,
28
- tickLine: "y",
29
- strokeDasharray: "5 5",
30
- curveType: "monotone",
31
- gridAxis: "x",
32
- type: "default",
33
- splitColors: ["green.7", "red.7"],
34
- orientation: "horizontal"
35
- };
36
- const varsResolver = core.createVarsResolver((theme, { textColor, gridColor }) => ({
37
- root: {
38
- "--chart-text-color": textColor ? core.getThemeColor(textColor, theme) : void 0,
39
- "--chart-grid-color": gridColor ? core.getThemeColor(gridColor, theme) : void 0
40
- }
41
- }));
42
- const AreaChart = core.factory((_props, ref) => {
43
- const props = core.useProps("AreaChart", defaultProps, _props);
44
- const {
45
- classNames,
46
- className,
47
- style,
48
- styles,
49
- unstyled,
50
- vars,
51
- data,
52
- series,
53
- withGradient,
54
- dataKey,
55
- withXAxis,
56
- withYAxis,
57
- curveType,
58
- gridProps,
59
- withDots,
60
- tickLine,
61
- strokeDasharray,
62
- gridAxis,
63
- unit,
64
- yAxisProps,
65
- xAxisProps,
66
- dotProps,
67
- activeDotProps,
68
- strokeWidth,
69
- tooltipAnimationDuration,
70
- type,
71
- legendProps,
72
- tooltipProps,
73
- withLegend,
74
- withTooltip,
75
- areaChartProps,
76
- fillOpacity,
77
- splitColors,
78
- splitOffset,
79
- connectNulls,
80
- onMouseLeave,
81
- orientation,
82
- referenceLines,
83
- dir,
84
- valueFormatter,
85
- children,
86
- areaProps,
87
- xAxisLabel,
88
- yAxisLabel,
89
- withRightYAxis,
90
- rightYAxisLabel,
91
- rightYAxisProps,
92
- withPointLabels,
93
- ...others
94
- } = props;
95
- const theme = core.useMantineTheme();
96
- const baseId = react.useId();
97
- const splitId = `${baseId}-split`;
98
- const withXTickLine = gridAxis !== "none" && (tickLine === "x" || tickLine === "xy");
99
- const withYTickLine = gridAxis !== "none" && (tickLine === "y" || tickLine === "xy");
100
- const isAnimationActive = (tooltipAnimationDuration || 0) > 0;
101
- const _withGradient = typeof withGradient === "boolean" ? withGradient : type === "default";
102
- const stacked = type === "stacked" || type === "percent";
103
- const [highlightedArea, setHighlightedArea] = react.useState(null);
104
- const shouldHighlight = highlightedArea !== null;
105
- const handleMouseLeave = (event) => {
106
- setHighlightedArea(null);
107
- onMouseLeave?.(event);
108
- };
109
- const { resolvedClassNames, resolvedStyles } = core.useResolvedStylesApi({
110
- classNames,
111
- styles,
112
- props
113
- });
114
- const getStyles = core.useStyles({
115
- name: "AreaChart",
116
- classes: gridChart_module,
117
- props,
118
- className,
119
- style,
120
- classNames,
121
- styles,
122
- unstyled,
123
- vars,
124
- varsResolver
125
- });
126
- const dotsAreas = series.map((item) => {
127
- const color = core.getThemeColor(item.color, theme);
128
- const dimmed = shouldHighlight && highlightedArea !== item.name;
129
- return /* @__PURE__ */ react.createElement(
130
- recharts.Area,
131
- {
132
- ...getStyles("area"),
133
- activeDot: { fill: theme.white, stroke: color, strokeWidth: 2, r: 4, ...activeDotProps },
134
- dot: { fill: color, fillOpacity: dimmed ? 0 : 1, strokeWidth: 2, r: 4, ...dotProps },
135
- key: item.name,
136
- name: item.name,
137
- type: curveType,
138
- dataKey: item.name,
139
- fill: "none",
140
- strokeWidth,
141
- stroke: "none",
142
- isAnimationActive: false,
143
- connectNulls,
144
- stackId: stacked ? "stack-dots" : void 0,
145
- yAxisId: item.yAxisId || "left",
146
- ...typeof areaProps === "function" ? areaProps(item) : areaProps
147
- }
148
- );
149
- });
150
- const areas = series.map((item) => {
151
- const id = `${baseId}-${item.color.replace(/[^a-zA-Z0-9]/g, "")}`;
152
- const color = core.getThemeColor(item.color, theme);
153
- const dimmed = shouldHighlight && highlightedArea !== item.name;
154
- return /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
155
- /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx(
156
- AreaGradient.AreaGradient,
157
- {
158
- color,
159
- withGradient: _withGradient,
160
- id,
161
- fillOpacity
162
- }
163
- ) }),
164
- /* @__PURE__ */ jsxRuntime.jsx(
165
- recharts.Area,
166
- {
167
- ...getStyles("area"),
168
- activeDot: false,
169
- dot: false,
170
- name: item.name,
171
- type: curveType,
172
- dataKey: item.name,
173
- fill: type === "split" ? `url(#${splitId})` : `url(#${id})`,
174
- strokeWidth,
175
- stroke: color,
176
- isAnimationActive: false,
177
- connectNulls,
178
- stackId: stacked ? "stack" : void 0,
179
- fillOpacity: dimmed ? 0 : 1,
180
- strokeOpacity: dimmed ? 0.5 : 1,
181
- strokeDasharray: item.strokeDasharray,
182
- yAxisId: item.yAxisId || "left",
183
- label: withPointLabels ? /* @__PURE__ */ jsxRuntime.jsx(PointLabel.PointLabel, {}) : void 0,
184
- ...typeof areaProps === "function" ? areaProps(item) : areaProps
185
- }
186
- )
187
- ] }, item.name);
188
- });
189
- const referenceLinesItems = referenceLines?.map((line, index) => {
190
- const color = core.getThemeColor(line.color, theme);
191
- return /* @__PURE__ */ jsxRuntime.jsx(
192
- recharts.ReferenceLine,
193
- {
194
- stroke: line.color ? color : "var(--chart-grid-color)",
195
- strokeWidth: 1,
196
- yAxisId: line.yAxisId || "left",
197
- ...line,
198
- label: {
199
- value: line.label,
200
- fill: line.color ? color : "currentColor",
201
- fontSize: 12,
202
- position: line.labelPosition ?? "insideBottomLeft"
203
- },
204
- ...getStyles("referenceLine")
205
- },
206
- index
207
- );
208
- });
209
- const tickFormatter = type === "percent" ? valueToPercent : valueFormatter;
210
- const sharedYAxisProps = {
211
- axisLine: false,
212
- ...orientation === "vertical" ? { dataKey, type: "category" } : { type: "number" },
213
- tickLine: withYTickLine ? { stroke: "currentColor" } : false,
214
- allowDecimals: true,
215
- unit,
216
- tickFormatter: orientation === "vertical" ? void 0 : tickFormatter,
217
- ...getStyles("axis")
218
- };
219
- return /* @__PURE__ */ jsxRuntime.jsx(
220
- core.Box,
221
- {
222
- ref,
223
- ...getStyles("root"),
224
- onMouseLeave: handleMouseLeave,
225
- dir: dir || "ltr",
226
- ...others,
227
- children: /* @__PURE__ */ jsxRuntime.jsx(recharts.ResponsiveContainer, { ...getStyles("container"), children: /* @__PURE__ */ jsxRuntime.jsxs(
228
- recharts.AreaChart,
229
- {
230
- data,
231
- stackOffset: type === "percent" ? "expand" : void 0,
232
- layout: orientation,
233
- margin: {
234
- bottom: xAxisLabel ? 30 : void 0,
235
- left: yAxisLabel ? 10 : void 0,
236
- right: yAxisLabel ? 5 : void 0
237
- },
238
- ...areaChartProps,
239
- children: [
240
- referenceLinesItems,
241
- withLegend && /* @__PURE__ */ jsxRuntime.jsx(
242
- recharts.Legend,
243
- {
244
- verticalAlign: "top",
245
- content: (payload) => /* @__PURE__ */ jsxRuntime.jsx(
246
- ChartLegend.ChartLegend,
247
- {
248
- payload: payload.payload,
249
- onHighlight: setHighlightedArea,
250
- legendPosition: legendProps?.verticalAlign || "top",
251
- classNames: resolvedClassNames,
252
- styles: resolvedStyles,
253
- series
254
- }
255
- ),
256
- ...legendProps
257
- }
258
- ),
259
- /* @__PURE__ */ jsxRuntime.jsx(
260
- recharts.CartesianGrid,
261
- {
262
- strokeDasharray,
263
- vertical: gridAxis === "y" || gridAxis === "xy",
264
- horizontal: gridAxis === "x" || gridAxis === "xy",
265
- ...getStyles("grid"),
266
- ...gridProps
267
- }
268
- ),
269
- /* @__PURE__ */ jsxRuntime.jsxs(
270
- recharts.XAxis,
271
- {
272
- hide: !withXAxis,
273
- ...orientation === "vertical" ? { type: "number" } : { dataKey },
274
- tick: { transform: "translate(0, 10)", fontSize: 12, fill: "currentColor" },
275
- stroke: "",
276
- interval: "preserveStartEnd",
277
- tickLine: withXTickLine ? { stroke: "currentColor" } : false,
278
- minTickGap: 5,
279
- tickFormatter: orientation === "vertical" ? tickFormatter : void 0,
280
- ...getStyles("axis"),
281
- ...xAxisProps,
282
- children: [
283
- xAxisLabel && /* @__PURE__ */ jsxRuntime.jsx(recharts.Label, { position: "insideBottom", offset: -20, fontSize: 12, ...getStyles("axisLabel"), children: xAxisLabel }),
284
- xAxisProps?.children
285
- ]
286
- }
287
- ),
288
- /* @__PURE__ */ jsxRuntime.jsxs(
289
- recharts.YAxis,
290
- {
291
- yAxisId: "left",
292
- orientation: "left",
293
- tick: { transform: "translate(-10, 0)", fontSize: 12, fill: "currentColor" },
294
- hide: !withYAxis,
295
- ...sharedYAxisProps,
296
- ...yAxisProps,
297
- children: [
298
- yAxisLabel && /* @__PURE__ */ jsxRuntime.jsx(
299
- recharts.Label,
300
- {
301
- position: "insideLeft",
302
- angle: -90,
303
- textAnchor: "middle",
304
- fontSize: 12,
305
- offset: -5,
306
- ...getStyles("axisLabel"),
307
- children: yAxisLabel
308
- }
309
- ),
310
- yAxisProps?.children
311
- ]
312
- }
313
- ),
314
- /* @__PURE__ */ jsxRuntime.jsxs(
315
- recharts.YAxis,
316
- {
317
- yAxisId: "right",
318
- orientation: "right",
319
- tick: { transform: "translate(10, 0)", fontSize: 12, fill: "currentColor" },
320
- hide: !withRightYAxis,
321
- ...sharedYAxisProps,
322
- ...rightYAxisProps,
323
- children: [
324
- rightYAxisLabel && /* @__PURE__ */ jsxRuntime.jsx(
325
- recharts.Label,
326
- {
327
- position: "insideRight",
328
- angle: 90,
329
- textAnchor: "middle",
330
- fontSize: 12,
331
- offset: -5,
332
- ...getStyles("axisLabel"),
333
- children: rightYAxisLabel
334
- }
335
- ),
336
- yAxisProps?.children
337
- ]
338
- }
339
- ),
340
- withTooltip && /* @__PURE__ */ jsxRuntime.jsx(
341
- recharts.Tooltip,
342
- {
343
- animationDuration: tooltipAnimationDuration,
344
- isAnimationActive,
345
- position: orientation === "vertical" ? {} : { y: 0 },
346
- cursor: {
347
- stroke: "var(--chart-grid-color)",
348
- strokeWidth: 1,
349
- strokeDasharray
350
- },
351
- content: ({ label, payload }) => /* @__PURE__ */ jsxRuntime.jsx(
352
- ChartTooltip.ChartTooltip,
353
- {
354
- label,
355
- payload,
356
- unit,
357
- classNames: resolvedClassNames,
358
- styles: resolvedStyles,
359
- series,
360
- valueFormatter
361
- }
362
- ),
363
- ...tooltipProps
364
- }
365
- ),
366
- type === "split" && /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx(
367
- AreaSplit.AreaSplit,
368
- {
369
- colors: splitColors,
370
- id: splitId,
371
- offset: splitOffset ?? getSplitOffset.getDefaultSplitOffset({ data, series }),
372
- fillOpacity
373
- }
374
- ) }),
375
- areas,
376
- withDots && dotsAreas,
377
- children
378
- ]
379
- }
380
- ) })
381
- }
382
- );
383
- });
384
- AreaChart.classes = gridChart_module;
385
- AreaChart.displayName = "@mantine/charts/AreaChart";
386
-
387
- exports.AreaChart = AreaChart;
388
- //# sourceMappingURL=AreaChart.cjs.map