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