@yamada-ui/charts 1.1.2 → 1.1.3
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/dist/area-chart-gradient.d.mts +11 -0
- package/dist/area-chart-gradient.d.ts +11 -0
- package/dist/area-chart-gradient.js +47 -0
- package/dist/area-chart-gradient.js.map +1 -0
- package/dist/area-chart-gradient.mjs +8 -0
- package/dist/area-chart-gradient.mjs.map +1 -0
- package/dist/area-chart-split.d.mts +10 -0
- package/dist/area-chart-split.d.ts +10 -0
- package/dist/area-chart-split.js +52 -0
- package/dist/area-chart-split.js.map +1 -0
- package/dist/area-chart-split.mjs +8 -0
- package/dist/area-chart-split.mjs.map +1 -0
- package/dist/area-chart.d.mts +41 -0
- package/dist/area-chart.d.ts +41 -0
- package/dist/area-chart.js +1223 -0
- package/dist/area-chart.js.map +1 -0
- package/dist/area-chart.mjs +21 -0
- package/dist/area-chart.mjs.map +1 -0
- package/dist/bar-chart.d.mts +38 -0
- package/dist/bar-chart.d.ts +38 -0
- package/dist/bar-chart.js +1027 -0
- package/dist/bar-chart.js.map +1 -0
- package/dist/bar-chart.mjs +19 -0
- package/dist/bar-chart.mjs.map +1 -0
- package/dist/chart-legend.d.mts +12 -0
- package/dist/chart-legend.d.ts +12 -0
- package/dist/chart-legend.js +90 -0
- package/dist/chart-legend.js.map +1 -0
- package/dist/chart-legend.mjs +11 -0
- package/dist/chart-legend.mjs.map +1 -0
- package/dist/chart-tooltip.d.mts +12 -0
- package/dist/chart-tooltip.d.ts +12 -0
- package/dist/chart-tooltip.js +121 -0
- package/dist/chart-tooltip.js.map +1 -0
- package/dist/chart-tooltip.mjs +11 -0
- package/dist/chart-tooltip.mjs.map +1 -0
- package/dist/chart-utils.d.mts +9 -0
- package/dist/chart-utils.d.ts +9 -0
- package/dist/chart-utils.js +45 -0
- package/dist/chart-utils.js.map +1 -0
- package/dist/chart-utils.mjs +10 -0
- package/dist/chart-utils.mjs.map +1 -0
- package/dist/chart.types.d.mts +78 -0
- package/dist/chart.types.d.ts +78 -0
- package/dist/chart.types.js +20 -0
- package/dist/chart.types.js.map +1 -0
- package/dist/chart.types.mjs +2 -0
- package/dist/chart.types.mjs.map +1 -0
- package/dist/chunk-4WX5YS7M.mjs +179 -0
- package/dist/chunk-4WX5YS7M.mjs.map +1 -0
- package/dist/chunk-5TVYPA64.mjs +256 -0
- package/dist/chunk-5TVYPA64.mjs.map +1 -0
- package/dist/chunk-BPR7YL3O.mjs +179 -0
- package/dist/chunk-BPR7YL3O.mjs.map +1 -0
- package/dist/chunk-E2I2XAZ6.mjs +232 -0
- package/dist/chunk-E2I2XAZ6.mjs.map +1 -0
- package/dist/chunk-HDOYOHLA.mjs +326 -0
- package/dist/chunk-HDOYOHLA.mjs.map +1 -0
- package/dist/chunk-KNAADLWO.mjs +225 -0
- package/dist/chunk-KNAADLWO.mjs.map +1 -0
- package/dist/chunk-KT4YOMM4.mjs +344 -0
- package/dist/chunk-KT4YOMM4.mjs.map +1 -0
- package/dist/chunk-LBC2B6UX.mjs +84 -0
- package/dist/chunk-LBC2B6UX.mjs.map +1 -0
- package/dist/chunk-LGMALZCN.mjs +42 -0
- package/dist/chunk-LGMALZCN.mjs.map +1 -0
- package/dist/chunk-LHI57S6P.mjs +215 -0
- package/dist/chunk-LHI57S6P.mjs.map +1 -0
- package/dist/chunk-LM2DQK2P.mjs +33 -0
- package/dist/chunk-LM2DQK2P.mjs.map +1 -0
- package/dist/chunk-MSIOYYWR.mjs +24 -0
- package/dist/chunk-MSIOYYWR.mjs.map +1 -0
- package/dist/chunk-MWPICUEW.mjs +56 -0
- package/dist/chunk-MWPICUEW.mjs.map +1 -0
- package/dist/chunk-NEGDEVRX.mjs +53 -0
- package/dist/chunk-NEGDEVRX.mjs.map +1 -0
- package/dist/chunk-OSNFBRHL.mjs +474 -0
- package/dist/chunk-OSNFBRHL.mjs.map +1 -0
- package/dist/chunk-OW7SOTEF.mjs +206 -0
- package/dist/chunk-OW7SOTEF.mjs.map +1 -0
- package/dist/chunk-P7AFSM5W.mjs +114 -0
- package/dist/chunk-P7AFSM5W.mjs.map +1 -0
- package/dist/chunk-PNE3JG54.mjs +29 -0
- package/dist/chunk-PNE3JG54.mjs.map +1 -0
- package/dist/chunk-QL3DB7OJ.mjs +21 -0
- package/dist/chunk-QL3DB7OJ.mjs.map +1 -0
- package/dist/chunk-QZ5OXZ6Z.mjs +251 -0
- package/dist/chunk-QZ5OXZ6Z.mjs.map +1 -0
- package/dist/chunk-RN6PXJAD.mjs +47 -0
- package/dist/chunk-RN6PXJAD.mjs.map +1 -0
- package/dist/chunk-STBYRLC5.mjs +208 -0
- package/dist/chunk-STBYRLC5.mjs.map +1 -0
- package/dist/chunk-XIFDRM7J.mjs +56 -0
- package/dist/chunk-XIFDRM7J.mjs.map +1 -0
- package/dist/donut-chart.d.mts +31 -0
- package/dist/donut-chart.d.ts +31 -0
- package/dist/donut-chart.js +702 -0
- package/dist/donut-chart.js.map +1 -0
- package/dist/donut-chart.mjs +16 -0
- package/dist/donut-chart.mjs.map +1 -0
- package/dist/index.d.mts +26 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +3228 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +45 -0
- package/dist/index.mjs.map +1 -0
- package/dist/line-chart.d.mts +38 -0
- package/dist/line-chart.d.ts +38 -0
- package/dist/line-chart.js +1088 -0
- package/dist/line-chart.js.map +1 -0
- package/dist/line-chart.mjs +19 -0
- package/dist/line-chart.mjs.map +1 -0
- package/dist/pie-chart.d.mts +49 -0
- package/dist/pie-chart.d.ts +49 -0
- package/dist/pie-chart.js +702 -0
- package/dist/pie-chart.js.map +1 -0
- package/dist/pie-chart.mjs +16 -0
- package/dist/pie-chart.mjs.map +1 -0
- package/dist/radar-chart.d.mts +57 -0
- package/dist/radar-chart.d.ts +57 -0
- package/dist/radar-chart.js +918 -0
- package/dist/radar-chart.js.map +1 -0
- package/dist/radar-chart.mjs +16 -0
- package/dist/radar-chart.mjs.map +1 -0
- package/dist/rechart-properties.d.mts +26 -0
- package/dist/rechart-properties.d.ts +26 -0
- package/dist/rechart-properties.js +517 -0
- package/dist/rechart-properties.js.map +1 -0
- package/dist/rechart-properties.mjs +48 -0
- package/dist/rechart-properties.mjs.map +1 -0
- package/dist/use-area-chart.d.mts +123 -0
- package/dist/use-area-chart.d.ts +123 -0
- package/dist/use-area-chart.js +420 -0
- package/dist/use-area-chart.js.map +1 -0
- package/dist/use-area-chart.mjs +10 -0
- package/dist/use-area-chart.mjs.map +1 -0
- package/dist/use-bar-chart.d.mts +73 -0
- package/dist/use-bar-chart.d.ts +73 -0
- package/dist/use-bar-chart.js +290 -0
- package/dist/use-bar-chart.js.map +1 -0
- package/dist/use-bar-chart.mjs +10 -0
- package/dist/use-bar-chart.mjs.map +1 -0
- package/dist/use-chart-axis.d.mts +73 -0
- package/dist/use-chart-axis.d.ts +73 -0
- package/dist/use-chart-axis.js +227 -0
- package/dist/use-chart-axis.js.map +1 -0
- package/dist/use-chart-axis.mjs +10 -0
- package/dist/use-chart-axis.mjs.map +1 -0
- package/dist/use-chart-grid.d.mts +32 -0
- package/dist/use-chart-grid.d.ts +32 -0
- package/dist/use-chart-grid.js +92 -0
- package/dist/use-chart-grid.js.map +1 -0
- package/dist/use-chart-grid.mjs +10 -0
- package/dist/use-chart-grid.mjs.map +1 -0
- package/dist/use-chart-legend.d.mts +18 -0
- package/dist/use-chart-legend.d.ts +18 -0
- package/dist/use-chart-legend.js +81 -0
- package/dist/use-chart-legend.js.map +1 -0
- package/dist/use-chart-legend.mjs +9 -0
- package/dist/use-chart-legend.mjs.map +1 -0
- package/dist/use-chart-reference-line.d.mts +22 -0
- package/dist/use-chart-reference-line.d.ts +22 -0
- package/dist/use-chart-reference-line.js +105 -0
- package/dist/use-chart-reference-line.js.map +1 -0
- package/dist/use-chart-reference-line.mjs +10 -0
- package/dist/use-chart-reference-line.mjs.map +1 -0
- package/dist/use-chart-tooltip.d.mts +27 -0
- package/dist/use-chart-tooltip.d.ts +27 -0
- package/dist/use-chart-tooltip.js +100 -0
- package/dist/use-chart-tooltip.js.map +1 -0
- package/dist/use-chart-tooltip.mjs +10 -0
- package/dist/use-chart-tooltip.mjs.map +1 -0
- package/dist/use-chart.d.mts +33 -0
- package/dist/use-chart.d.ts +33 -0
- package/dist/use-chart.js +104 -0
- package/dist/use-chart.js.map +1 -0
- package/dist/use-chart.mjs +18 -0
- package/dist/use-chart.mjs.map +1 -0
- package/dist/use-line-chart.d.mts +97 -0
- package/dist/use-line-chart.d.ts +97 -0
- package/dist/use-line-chart.js +344 -0
- package/dist/use-line-chart.js.map +1 -0
- package/dist/use-line-chart.mjs +10 -0
- package/dist/use-line-chart.mjs.map +1 -0
- package/dist/use-pie-chart.d.mts +112 -0
- package/dist/use-pie-chart.d.ts +112 -0
- package/dist/use-pie-chart.js +282 -0
- package/dist/use-pie-chart.js.map +1 -0
- package/dist/use-pie-chart.mjs +10 -0
- package/dist/use-pie-chart.mjs.map +1 -0
- package/dist/use-radar-chart.d.mts +105 -0
- package/dist/use-radar-chart.d.ts +105 -0
- package/dist/use-radar-chart.js +473 -0
- package/dist/use-radar-chart.js.map +1 -0
- package/dist/use-radar-chart.mjs +10 -0
- package/dist/use-radar-chart.mjs.map +1 -0
- package/package.json +1 -1
@@ -0,0 +1,326 @@
|
|
1
|
+
"use client"
|
2
|
+
import {
|
3
|
+
areaChartProperties,
|
4
|
+
areaProperties,
|
5
|
+
dotProperties
|
6
|
+
} from "./chunk-OSNFBRHL.mjs";
|
7
|
+
import {
|
8
|
+
getComponentProps
|
9
|
+
} from "./chunk-QL3DB7OJ.mjs";
|
10
|
+
|
11
|
+
// src/use-area-chart.ts
|
12
|
+
import { useTheme } from "@yamada-ui/core";
|
13
|
+
import { cx } from "@yamada-ui/utils";
|
14
|
+
import { useCallback, useId, useMemo, useState } from "react";
|
15
|
+
var useAreaChart = ({
|
16
|
+
data,
|
17
|
+
series,
|
18
|
+
type,
|
19
|
+
layoutType = "horizontal",
|
20
|
+
withGradient: withGradientProp,
|
21
|
+
withDots = true,
|
22
|
+
withActiveDots = true,
|
23
|
+
curveType = "monotone",
|
24
|
+
strokeWidth = 2,
|
25
|
+
connectNulls = true,
|
26
|
+
fillOpacity = 0.4,
|
27
|
+
splitColors = ["#ee6a5d", "#5fce7d"],
|
28
|
+
splitOffset,
|
29
|
+
referenceLineProps,
|
30
|
+
syncId,
|
31
|
+
styles,
|
32
|
+
...rest
|
33
|
+
}) => {
|
34
|
+
var _a;
|
35
|
+
const uuid = useId();
|
36
|
+
const { theme } = useTheme();
|
37
|
+
const [highlightedArea, setHighlightedArea] = useState(null);
|
38
|
+
const splitId = `${uuid}-split`;
|
39
|
+
const stacked = type === "stacked" || type === "percent";
|
40
|
+
const withGradient = typeof withGradientProp === "boolean" ? withGradientProp : type === "default";
|
41
|
+
const shouldHighlight = highlightedArea !== null;
|
42
|
+
const {
|
43
|
+
dot = {},
|
44
|
+
activeDot = {},
|
45
|
+
dimDot,
|
46
|
+
dimArea,
|
47
|
+
...computedAreaProps
|
48
|
+
} = (_a = rest.areaProps) != null ? _a : {};
|
49
|
+
const areaColors = useMemo(
|
50
|
+
() => series.map(({ color }, index) => ({
|
51
|
+
__prefix: "ui",
|
52
|
+
name: `area-${index}`,
|
53
|
+
token: "colors",
|
54
|
+
value: color != null ? color : "transparent"
|
55
|
+
})),
|
56
|
+
[series]
|
57
|
+
);
|
58
|
+
const areaSplitColors = useMemo(
|
59
|
+
() => splitColors.map((color, index) => ({
|
60
|
+
__prefix: "ui",
|
61
|
+
name: `area-split-${index}`,
|
62
|
+
token: "colors",
|
63
|
+
value: color != null ? color : "transparent"
|
64
|
+
})),
|
65
|
+
[splitColors]
|
66
|
+
);
|
67
|
+
const referenceLineColors = useMemo(
|
68
|
+
() => referenceLineProps ? referenceLineProps.map(({ color }, index) => ({
|
69
|
+
__prefix: "ui",
|
70
|
+
name: `reference-line-${index}`,
|
71
|
+
token: "colors",
|
72
|
+
value: color != null ? color : "transparent"
|
73
|
+
})) : [],
|
74
|
+
[referenceLineProps]
|
75
|
+
);
|
76
|
+
const areaVars = useMemo(() => {
|
77
|
+
return [
|
78
|
+
...areaColors,
|
79
|
+
...areaSplitColors,
|
80
|
+
...referenceLineColors,
|
81
|
+
{ __prefix: "ui", name: "fill-opacity", value: fillOpacity }
|
82
|
+
];
|
83
|
+
}, [areaColors, areaSplitColors, referenceLineColors, fillOpacity]);
|
84
|
+
const [chartProps, areaChartClassName] = useMemo(
|
85
|
+
() => {
|
86
|
+
var _a2;
|
87
|
+
return getComponentProps(
|
88
|
+
[(_a2 = rest.chartProps) != null ? _a2 : {}, areaChartProperties],
|
89
|
+
styles.chart
|
90
|
+
)(theme);
|
91
|
+
},
|
92
|
+
[rest.chartProps, styles.chart, theme]
|
93
|
+
);
|
94
|
+
const [areaProps, areaClassName] = useMemo(() => {
|
95
|
+
const resolvedAreaProps = {
|
96
|
+
fillOpacity: 1,
|
97
|
+
strokeOpacity: 1,
|
98
|
+
...computedAreaProps
|
99
|
+
};
|
100
|
+
return getComponentProps(
|
101
|
+
[resolvedAreaProps, areaProperties],
|
102
|
+
styles.area
|
103
|
+
)(theme);
|
104
|
+
}, [computedAreaProps, styles.area, theme]);
|
105
|
+
const [dimAreaProps, dimAreaClassName] = useMemo(() => {
|
106
|
+
const resolvedDimArea = {
|
107
|
+
fillOpacity: 0,
|
108
|
+
strokeOpacity: 0.3,
|
109
|
+
...dimArea
|
110
|
+
};
|
111
|
+
return getComponentProps([resolvedDimArea, areaProperties])(
|
112
|
+
theme
|
113
|
+
);
|
114
|
+
}, [dimArea, theme]);
|
115
|
+
const [dotProps, dotClassName] = useMemo(() => {
|
116
|
+
const resolvedDot = { fillOpacity: 1, strokeWidth: 2, ...dot };
|
117
|
+
return getComponentProps(
|
118
|
+
[resolvedDot, dotProperties],
|
119
|
+
styles.dot
|
120
|
+
)(theme);
|
121
|
+
}, [dot, styles.dot, theme]);
|
122
|
+
const [activeDotProps, activeDotClassName] = useMemo(
|
123
|
+
() => getComponentProps(
|
124
|
+
[activeDot, dotProperties],
|
125
|
+
styles.activeDot
|
126
|
+
)(theme),
|
127
|
+
[activeDot, styles.activeDot, theme]
|
128
|
+
);
|
129
|
+
const [dimDotProps, dimDotClassName] = useMemo(() => {
|
130
|
+
const resolvedDimDot = { fillOpacity: 0, strokeOpacity: 0, ...dimDot };
|
131
|
+
return getComponentProps([resolvedDimDot, dotProperties])(
|
132
|
+
theme
|
133
|
+
);
|
134
|
+
}, [dimDot, theme]);
|
135
|
+
const defaultSplitOffset = useMemo(() => {
|
136
|
+
if (series.length === 1) {
|
137
|
+
const dataKey = series[0].dataKey;
|
138
|
+
const dataMax = Math.max(...data.map((item) => item[dataKey]));
|
139
|
+
const dataMin = Math.min(...data.map((item) => item[dataKey]));
|
140
|
+
if (dataMax <= 0)
|
141
|
+
return 0;
|
142
|
+
if (dataMin >= 0)
|
143
|
+
return 1;
|
144
|
+
return dataMax / (dataMax - dataMin);
|
145
|
+
}
|
146
|
+
return 0.5;
|
147
|
+
}, [data, series]);
|
148
|
+
const areaPropsList = useMemo(
|
149
|
+
() => series.map((props, index) => {
|
150
|
+
const {
|
151
|
+
dataKey,
|
152
|
+
dot: dot2 = {},
|
153
|
+
activeDot: activeDot2 = {},
|
154
|
+
dimDot: dimDot2 = {},
|
155
|
+
dimArea: dimArea2 = {},
|
156
|
+
strokeDasharray,
|
157
|
+
...computedProps
|
158
|
+
} = props;
|
159
|
+
const id = `${uuid}-${dataKey}`;
|
160
|
+
const color = `var(--ui-area-${index})`;
|
161
|
+
const dimmed = shouldHighlight && highlightedArea !== dataKey;
|
162
|
+
const computedDimArea = { ...dimAreaProps, ...dimArea2 };
|
163
|
+
const resolvedProps = {
|
164
|
+
...areaProps,
|
165
|
+
...computedProps,
|
166
|
+
...dimmed ? computedDimArea : {}
|
167
|
+
};
|
168
|
+
const rest2 = getComponentProps(
|
169
|
+
[resolvedProps, areaProperties],
|
170
|
+
areaClassName,
|
171
|
+
dimmed ? dimAreaClassName : void 0
|
172
|
+
)(theme, true);
|
173
|
+
let resolvedActiveDot;
|
174
|
+
if (withActiveDots) {
|
175
|
+
const computedActiveDot = { ...activeDotProps, ...activeDot2 };
|
176
|
+
const [rest3, className] = getComponentProps(
|
177
|
+
[computedActiveDot, dotProperties],
|
178
|
+
activeDotClassName
|
179
|
+
)(theme);
|
180
|
+
resolvedActiveDot = {
|
181
|
+
className: cx("ui-area-chart__active-dot", className),
|
182
|
+
stroke: color,
|
183
|
+
r: 4,
|
184
|
+
...rest3
|
185
|
+
};
|
186
|
+
} else {
|
187
|
+
resolvedActiveDot = false;
|
188
|
+
}
|
189
|
+
let resolvedDot;
|
190
|
+
if (withDots) {
|
191
|
+
const computedDimDot = { ...dimDotProps, ...dimDot2 };
|
192
|
+
const computedDot = {
|
193
|
+
...dotProps,
|
194
|
+
...dot2,
|
195
|
+
...dimmed ? computedDimDot : {}
|
196
|
+
};
|
197
|
+
const [rest3, className] = getComponentProps(
|
198
|
+
[computedDot, dotProperties],
|
199
|
+
dotClassName,
|
200
|
+
dimmed ? dimDotClassName : void 0
|
201
|
+
)(theme);
|
202
|
+
resolvedDot = {
|
203
|
+
className: cx("ui-area-chart__dot", className),
|
204
|
+
fill: color,
|
205
|
+
r: 4,
|
206
|
+
...rest3
|
207
|
+
};
|
208
|
+
} else {
|
209
|
+
resolvedDot = false;
|
210
|
+
}
|
211
|
+
return {
|
212
|
+
...rest2,
|
213
|
+
id,
|
214
|
+
color,
|
215
|
+
strokeDasharray,
|
216
|
+
dataKey,
|
217
|
+
activeDot: resolvedActiveDot,
|
218
|
+
dot: resolvedDot
|
219
|
+
};
|
220
|
+
}),
|
221
|
+
[
|
222
|
+
series,
|
223
|
+
uuid,
|
224
|
+
shouldHighlight,
|
225
|
+
highlightedArea,
|
226
|
+
dimAreaProps,
|
227
|
+
dimDotProps,
|
228
|
+
areaProps,
|
229
|
+
areaClassName,
|
230
|
+
dimAreaClassName,
|
231
|
+
theme,
|
232
|
+
withActiveDots,
|
233
|
+
withDots,
|
234
|
+
activeDotProps,
|
235
|
+
activeDotClassName,
|
236
|
+
dotProps,
|
237
|
+
dotClassName,
|
238
|
+
dimDotClassName
|
239
|
+
]
|
240
|
+
);
|
241
|
+
const getAreaChartProps = useCallback(
|
242
|
+
({ className, ...props } = {}, ref = null) => ({
|
243
|
+
ref,
|
244
|
+
className: cx(className, areaChartClassName),
|
245
|
+
data,
|
246
|
+
stackOffset: type === "percent" ? "expand" : void 0,
|
247
|
+
layout: layoutType,
|
248
|
+
syncId,
|
249
|
+
...props,
|
250
|
+
...chartProps
|
251
|
+
}),
|
252
|
+
[areaChartClassName, data, type, layoutType, syncId, chartProps]
|
253
|
+
);
|
254
|
+
const getAreaSplitProps = useCallback(
|
255
|
+
(props = {}) => ({
|
256
|
+
id: splitId,
|
257
|
+
offset: splitOffset != null ? splitOffset : defaultSplitOffset,
|
258
|
+
fillOpacity: "var(--ui-fill-opacity)",
|
259
|
+
...props
|
260
|
+
}),
|
261
|
+
[defaultSplitOffset, splitId, splitOffset]
|
262
|
+
);
|
263
|
+
const getAreaProps = useCallback(
|
264
|
+
({ index, className: classNameProp, ...props }, ref = null) => {
|
265
|
+
const {
|
266
|
+
id,
|
267
|
+
color,
|
268
|
+
className,
|
269
|
+
dataKey,
|
270
|
+
strokeDasharray,
|
271
|
+
activeDot: activeDot2,
|
272
|
+
dot: dot2,
|
273
|
+
...rest2
|
274
|
+
} = areaPropsList[index];
|
275
|
+
return {
|
276
|
+
ref,
|
277
|
+
className: cx(classNameProp, className),
|
278
|
+
id,
|
279
|
+
activeDot: activeDot2,
|
280
|
+
dot: dot2,
|
281
|
+
name: dataKey,
|
282
|
+
type: curveType,
|
283
|
+
dataKey,
|
284
|
+
fill: type === "split" ? `url(#${splitId})` : `url(#${id})`,
|
285
|
+
strokeWidth,
|
286
|
+
stroke: color,
|
287
|
+
isAnimationActive: false,
|
288
|
+
connectNulls,
|
289
|
+
stackId: stacked ? "stack" : void 0,
|
290
|
+
strokeDasharray,
|
291
|
+
...props,
|
292
|
+
...rest2
|
293
|
+
};
|
294
|
+
},
|
295
|
+
[
|
296
|
+
areaPropsList,
|
297
|
+
connectNulls,
|
298
|
+
curveType,
|
299
|
+
splitId,
|
300
|
+
stacked,
|
301
|
+
strokeWidth,
|
302
|
+
type
|
303
|
+
]
|
304
|
+
);
|
305
|
+
const getAreaGradientProps = useCallback(
|
306
|
+
(props = {}) => ({
|
307
|
+
withGradient,
|
308
|
+
fillOpacity: "var(--ui-fill-opacity)",
|
309
|
+
...props
|
310
|
+
}),
|
311
|
+
[withGradient]
|
312
|
+
);
|
313
|
+
return {
|
314
|
+
getAreaChartProps,
|
315
|
+
getAreaSplitProps,
|
316
|
+
getAreaProps,
|
317
|
+
getAreaGradientProps,
|
318
|
+
areaVars,
|
319
|
+
setHighlightedArea
|
320
|
+
};
|
321
|
+
};
|
322
|
+
|
323
|
+
export {
|
324
|
+
useAreaChart
|
325
|
+
};
|
326
|
+
//# sourceMappingURL=chunk-HDOYOHLA.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/use-area-chart.ts"],"sourcesContent":["import type { CSSUIObject, CSSUIProps } from \"@yamada-ui/core\"\nimport { useTheme } from \"@yamada-ui/core\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport { cx } from \"@yamada-ui/utils\"\nimport type { ComponentPropsWithoutRef } from \"react\"\nimport { useCallback, useId, useMemo, useState } from \"react\"\nimport type * as Recharts from \"recharts\"\nimport type { AreaGradientProps } from \"./area-chart-gradient\"\nimport type { AreaSplitProps } from \"./area-chart-split\"\nimport { getComponentProps } from \"./chart-utils\"\nimport type {\n ChartCurveType,\n AreaProps,\n AreaChartType,\n AreaChartProps,\n ChartPropGetter,\n ChartLayoutType,\n ReferenceLineProps,\n RequiredChartPropGetter,\n} from \"./chart.types\"\nimport {\n areaChartProperties,\n dotProperties,\n areaProperties,\n} from \"./rechart-properties\"\n\nexport type UseAreaChartOptions = {\n /**\n * Chart data.\n */\n data: Dict[]\n /**\n * An array of objects with `dataKey` and `color` keys. Determines which data should be consumed from the `data` array.\n */\n series: AreaProps[]\n /**\n * Props for the areas.\n */\n areaProps?: Partial<AreaProps>\n /**\n * Controls how chart areas are positioned relative to each other.\n *\n * @default `default`\n */\n type?: AreaChartType\n /**\n * Props passed down to recharts `AreaChart` component.\n */\n chartProps?: AreaChartProps\n /**\n * If any two categorical charts have the same syncId,\n * these two charts can sync the position tooltip, and the startIndex, endIndex of Brush.\n */\n syncId?: number | string\n /**\n * Chart orientation.\n *\n * @default 'horizontal'\n */\n layoutType?: ChartLayoutType\n /**\n * Determines whether the chart area should be represented with a gradient instead of the solid color.\n */\n withGradient?: boolean\n /**\n * Determines whether dots should be displayed.\n *\n * @default true\n */\n withDots?: boolean\n /**\n * Determines whether activeDots should be displayed.\n *\n * @default true\n */\n withActiveDots?: boolean\n /**\n * Type of the curve.\n *\n * @default `monotone`\n */\n curveType?: ChartCurveType\n /**\n * Stroke width for the chart areas.\n *\n * @default 2\n */\n strokeWidth?: number\n /**\n * Determines whether points with `null` values should be connected.\n *\n * @default true\n */\n connectNulls?: boolean\n /**\n * A tuple of colors used when `type=\"split\"` is set, ignored in all other cases.\n *\n * @default '[\"red.400\", \"green.400\"]'\n */\n splitColors?: [string, string]\n /**\n * Offset for the split gradient. By default, value is inferred from `data` and `series` if possible.\n * Must be generated from the data array with `getSplitOffset` function.\n */\n splitOffset?: number\n /**\n * Reference lines that should be displayed on the chart.\n */\n referenceLineProps?: ReferenceLineProps[]\n /**\n * Controls fill opacity of all areas.\n *\n * @default 0.4\n */\n fillOpacity?: number | [number, number]\n}\n\nexport type UseAreaChartProps = UseAreaChartOptions & {\n styles: Dict<CSSUIObject>\n}\n\nexport const useAreaChart = ({\n data,\n series,\n type,\n layoutType = \"horizontal\",\n withGradient: withGradientProp,\n withDots = true,\n withActiveDots = true,\n curveType = \"monotone\",\n strokeWidth = 2,\n connectNulls = true,\n fillOpacity = 0.4,\n splitColors = [\"#ee6a5d\", \"#5fce7d\"],\n splitOffset,\n referenceLineProps,\n syncId,\n styles,\n ...rest\n}: UseAreaChartProps) => {\n const uuid = useId()\n const { theme } = useTheme()\n const [highlightedArea, setHighlightedArea] = useState<string | null>(null)\n const splitId = `${uuid}-split`\n const stacked = type === \"stacked\" || type === \"percent\"\n const withGradient =\n typeof withGradientProp === \"boolean\"\n ? withGradientProp\n : type === \"default\"\n const shouldHighlight = highlightedArea !== null\n const {\n dot = {},\n activeDot = {},\n dimDot,\n dimArea,\n ...computedAreaProps\n } = rest.areaProps ?? {}\n\n const areaColors: CSSUIProps[\"var\"] = useMemo(\n () =>\n series.map(({ color }, index) => ({\n __prefix: \"ui\",\n name: `area-${index}`,\n token: \"colors\",\n value: color ?? \"transparent\",\n })),\n [series],\n )\n\n const areaSplitColors: CSSUIProps[\"var\"] = useMemo(\n () =>\n splitColors.map((color, index) => ({\n __prefix: \"ui\",\n name: `area-split-${index}`,\n token: \"colors\",\n value: color ?? \"transparent\",\n })),\n [splitColors],\n )\n\n const referenceLineColors: CSSUIProps[\"var\"] = useMemo(\n () =>\n referenceLineProps\n ? referenceLineProps.map(({ color }, index) => ({\n __prefix: \"ui\",\n name: `reference-line-${index}`,\n token: \"colors\",\n value: color ?? \"transparent\",\n }))\n : [],\n [referenceLineProps],\n )\n\n const areaVars: CSSUIProps[\"var\"] = useMemo(() => {\n return [\n ...areaColors,\n ...areaSplitColors,\n ...referenceLineColors,\n { __prefix: \"ui\", name: \"fill-opacity\", value: fillOpacity },\n ]\n }, [areaColors, areaSplitColors, referenceLineColors, fillOpacity])\n\n const [chartProps, areaChartClassName] = useMemo(\n () =>\n getComponentProps<Dict, string>(\n [rest.chartProps ?? {}, areaChartProperties],\n styles.chart,\n )(theme),\n [rest.chartProps, styles.chart, theme],\n )\n\n const [areaProps, areaClassName] = useMemo(() => {\n const resolvedAreaProps = {\n fillOpacity: 1,\n strokeOpacity: 1,\n ...computedAreaProps,\n }\n\n return getComponentProps<Dict, string>(\n [resolvedAreaProps, areaProperties],\n styles.area,\n )(theme)\n }, [computedAreaProps, styles.area, theme])\n\n const [dimAreaProps, dimAreaClassName] = useMemo(() => {\n const resolvedDimArea = {\n fillOpacity: 0,\n strokeOpacity: 0.3,\n ...dimArea,\n }\n\n return getComponentProps<Dict, string>([resolvedDimArea, areaProperties])(\n theme,\n )\n }, [dimArea, theme])\n\n const [dotProps, dotClassName] = useMemo(() => {\n const resolvedDot = { fillOpacity: 1, strokeWidth: 2, ...dot }\n\n return getComponentProps<Dict, string>(\n [resolvedDot, dotProperties],\n styles.dot,\n )(theme)\n }, [dot, styles.dot, theme])\n\n const [activeDotProps, activeDotClassName] = useMemo(\n () =>\n getComponentProps<Dict, string>(\n [activeDot, dotProperties],\n styles.activeDot,\n )(theme),\n [activeDot, styles.activeDot, theme],\n )\n\n const [dimDotProps, dimDotClassName] = useMemo(() => {\n const resolvedDimDot = { fillOpacity: 0, strokeOpacity: 0, ...dimDot }\n return getComponentProps<Dict, string>([resolvedDimDot, dotProperties])(\n theme,\n )\n }, [dimDot, theme])\n\n const defaultSplitOffset = useMemo(() => {\n if (series.length === 1) {\n const dataKey = series[0].dataKey as string\n\n const dataMax = Math.max(...data.map((item) => item[dataKey]))\n const dataMin = Math.min(...data.map((item) => item[dataKey]))\n\n if (dataMax <= 0) return 0\n if (dataMin >= 0) return 1\n\n return dataMax / (dataMax - dataMin)\n }\n\n return 0.5\n }, [data, series])\n\n const areaPropsList = useMemo(\n () =>\n series.map((props, index) => {\n const {\n dataKey,\n dot = {},\n activeDot = {},\n dimDot = {},\n dimArea = {},\n strokeDasharray,\n ...computedProps\n } = props\n const id = `${uuid}-${dataKey}`\n const color = `var(--ui-area-${index})`\n const dimmed = shouldHighlight && highlightedArea !== dataKey\n const computedDimArea = { ...dimAreaProps, ...dimArea }\n\n const resolvedProps = {\n ...areaProps,\n ...computedProps,\n ...(dimmed ? computedDimArea : {}),\n }\n const rest = getComponentProps<Dict, string>(\n [resolvedProps, areaProperties],\n areaClassName,\n dimmed ? dimAreaClassName : undefined,\n )(theme, true)\n\n let resolvedActiveDot: Recharts.DotProps | boolean\n\n if (withActiveDots) {\n const computedActiveDot = { ...activeDotProps, ...activeDot }\n\n const [rest, className] = getComponentProps(\n [computedActiveDot, dotProperties],\n activeDotClassName,\n )(theme)\n\n resolvedActiveDot = {\n className: cx(\"ui-area-chart__active-dot\", className),\n stroke: color,\n r: 4,\n ...rest,\n } as Recharts.DotProps\n } else {\n resolvedActiveDot = false\n }\n\n let resolvedDot: Recharts.DotProps | boolean\n\n if (withDots) {\n const computedDimDot = { ...dimDotProps, ...dimDot }\n const computedDot = {\n ...dotProps,\n ...dot,\n ...(dimmed ? computedDimDot : {}),\n }\n\n const [rest, className] = getComponentProps(\n [computedDot, dotProperties],\n dotClassName,\n dimmed ? dimDotClassName : undefined,\n )(theme)\n\n resolvedDot = {\n className: cx(\"ui-area-chart__dot\", className),\n fill: color,\n r: 4,\n ...rest,\n } as Recharts.DotProps\n } else {\n resolvedDot = false\n }\n\n return {\n ...rest,\n id,\n color,\n strokeDasharray,\n dataKey,\n activeDot: resolvedActiveDot,\n dot: resolvedDot,\n }\n }),\n [\n series,\n uuid,\n shouldHighlight,\n highlightedArea,\n dimAreaProps,\n dimDotProps,\n areaProps,\n areaClassName,\n dimAreaClassName,\n theme,\n withActiveDots,\n withDots,\n activeDotProps,\n activeDotClassName,\n dotProps,\n dotClassName,\n dimDotClassName,\n ],\n )\n\n const getAreaChartProps: ChartPropGetter<\n \"div\",\n ComponentPropsWithoutRef<typeof Recharts.AreaChart>,\n ComponentPropsWithoutRef<typeof Recharts.AreaChart>\n > = useCallback(\n ({ className, ...props } = {}, ref = null) => ({\n ref,\n className: cx(className, areaChartClassName),\n data,\n stackOffset: type === \"percent\" ? \"expand\" : undefined,\n layout: layoutType,\n syncId,\n ...props,\n ...chartProps,\n }),\n [areaChartClassName, data, type, layoutType, syncId, chartProps],\n )\n\n const getAreaSplitProps: ChartPropGetter<\n \"div\",\n Partial<AreaSplitProps>,\n AreaSplitProps\n > = useCallback(\n (props = {}) => ({\n id: splitId,\n offset: splitOffset ?? defaultSplitOffset,\n fillOpacity: \"var(--ui-fill-opacity)\",\n ...props,\n }),\n [defaultSplitOffset, splitId, splitOffset],\n )\n\n const getAreaProps: RequiredChartPropGetter<\n \"div\",\n {\n index: number\n },\n Omit<Recharts.AreaProps, \"ref\">\n > = useCallback(\n ({ index, className: classNameProp, ...props }, ref = null) => {\n const {\n id,\n color,\n className,\n dataKey,\n strokeDasharray,\n activeDot,\n dot,\n ...rest\n } = areaPropsList[index]\n\n return {\n ref,\n className: cx(classNameProp, className),\n id,\n activeDot,\n dot,\n name: dataKey as string,\n type: curveType,\n dataKey,\n fill: type === \"split\" ? `url(#${splitId})` : `url(#${id})`,\n strokeWidth,\n stroke: color,\n isAnimationActive: false,\n connectNulls,\n stackId: stacked ? \"stack\" : undefined,\n strokeDasharray,\n ...(props as Omit<Recharts.AreaProps, \"dataKey\">),\n ...rest,\n }\n },\n [\n areaPropsList,\n connectNulls,\n curveType,\n splitId,\n stacked,\n strokeWidth,\n type,\n ],\n )\n\n const getAreaGradientProps: ChartPropGetter<\n \"div\",\n Partial<AreaGradientProps>,\n AreaGradientProps\n > = useCallback(\n (props = {}) => ({\n withGradient,\n fillOpacity: \"var(--ui-fill-opacity)\",\n ...props,\n }),\n [withGradient],\n )\n\n return {\n getAreaChartProps,\n getAreaSplitProps,\n getAreaProps,\n getAreaGradientProps,\n areaVars,\n setHighlightedArea,\n }\n}\n\nexport type UseAreaChartReturn = ReturnType<typeof useAreaChart>\n"],"mappings":";;;;;;;;;;;AACA,SAAS,gBAAgB;AAEzB,SAAS,UAAU;AAEnB,SAAS,aAAa,OAAO,SAAS,gBAAgB;AAoH/C,IAAM,eAAe,CAAC;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb,cAAc;AAAA,EACd,WAAW;AAAA,EACX,iBAAiB;AAAA,EACj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,QACA,QAAQ;AAAA,QACR,mBAAmB;AAAA,QACnB;AAAA,QACA,SAAS,UAAU,UAAU;AAAA,QAC7B;AAAA,QACA,GAAI;AAAA,QACJ,GAAGI;AAAA,MACL;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,QAAM,uBAIF;AAAA,IACF,CAAC,QAAQ,CAAC,OAAO;AAAA,MACf;AAAA,MACA,aAAa;AAAA,MACb,GAAG;AAAA,IACL;AAAA,IACA,CAAC,YAAY;AAAA,EACf;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["_a","dot","activeDot","dimDot","dimArea","rest"]}
|
@@ -0,0 +1,225 @@
|
|
1
|
+
"use client"
|
2
|
+
import {
|
3
|
+
useBarChart
|
4
|
+
} from "./chunk-STBYRLC5.mjs";
|
5
|
+
import {
|
6
|
+
useChartAxis
|
7
|
+
} from "./chunk-P7AFSM5W.mjs";
|
8
|
+
import {
|
9
|
+
useChartGrid
|
10
|
+
} from "./chunk-LGMALZCN.mjs";
|
11
|
+
import {
|
12
|
+
useChartReferenceLine
|
13
|
+
} from "./chunk-MWPICUEW.mjs";
|
14
|
+
import {
|
15
|
+
useChartLegend
|
16
|
+
} from "./chunk-LM2DQK2P.mjs";
|
17
|
+
import {
|
18
|
+
useChartTooltip
|
19
|
+
} from "./chunk-RN6PXJAD.mjs";
|
20
|
+
import {
|
21
|
+
ChartLegend
|
22
|
+
} from "./chunk-NEGDEVRX.mjs";
|
23
|
+
import {
|
24
|
+
ChartTooltip
|
25
|
+
} from "./chunk-LBC2B6UX.mjs";
|
26
|
+
import {
|
27
|
+
ChartProvider,
|
28
|
+
useChart
|
29
|
+
} from "./chunk-XIFDRM7J.mjs";
|
30
|
+
|
31
|
+
// src/bar-chart.tsx
|
32
|
+
import {
|
33
|
+
ui,
|
34
|
+
forwardRef,
|
35
|
+
useMultiComponentStyle,
|
36
|
+
omitThemeProps
|
37
|
+
} from "@yamada-ui/core";
|
38
|
+
import { cx } from "@yamada-ui/utils";
|
39
|
+
import { useMemo } from "react";
|
40
|
+
import {
|
41
|
+
Legend,
|
42
|
+
BarChart as ReChartsBarChart,
|
43
|
+
Bar,
|
44
|
+
CartesianGrid,
|
45
|
+
Tooltip,
|
46
|
+
XAxis,
|
47
|
+
YAxis,
|
48
|
+
ResponsiveContainer,
|
49
|
+
ReferenceLine
|
50
|
+
} from "recharts";
|
51
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
52
|
+
var BarChart = forwardRef((props, ref) => {
|
53
|
+
const [styles, mergedProps] = useMultiComponentStyle("BarChart", props);
|
54
|
+
const {
|
55
|
+
className,
|
56
|
+
series,
|
57
|
+
dataKey,
|
58
|
+
layoutType,
|
59
|
+
tickLine,
|
60
|
+
gridAxis,
|
61
|
+
withXAxis,
|
62
|
+
withYAxis,
|
63
|
+
barProps,
|
64
|
+
xAxisProps,
|
65
|
+
yAxisProps,
|
66
|
+
type = "default",
|
67
|
+
withTooltip = true,
|
68
|
+
withLegend = false,
|
69
|
+
containerProps,
|
70
|
+
unit,
|
71
|
+
valueFormatter,
|
72
|
+
tooltipProps,
|
73
|
+
tooltipAnimationDuration,
|
74
|
+
legendProps,
|
75
|
+
data,
|
76
|
+
referenceLineProps = [],
|
77
|
+
gridProps,
|
78
|
+
strokeDasharray,
|
79
|
+
fillOpacity,
|
80
|
+
chartProps,
|
81
|
+
syncId,
|
82
|
+
...rest
|
83
|
+
} = omitThemeProps(mergedProps);
|
84
|
+
const { getBarChartProps, getBarProps, barVars, setHighlightedArea } = useBarChart({
|
85
|
+
data,
|
86
|
+
series,
|
87
|
+
type,
|
88
|
+
layoutType,
|
89
|
+
chartProps,
|
90
|
+
barProps,
|
91
|
+
referenceLineProps,
|
92
|
+
fillOpacity,
|
93
|
+
syncId,
|
94
|
+
styles
|
95
|
+
});
|
96
|
+
const { getContainerProps } = useChart({ containerProps });
|
97
|
+
const { getXAxisProps, getYAxisProps } = useChartAxis({
|
98
|
+
dataKey,
|
99
|
+
type,
|
100
|
+
layoutType,
|
101
|
+
tickLine,
|
102
|
+
gridAxis,
|
103
|
+
withXAxis,
|
104
|
+
withYAxis,
|
105
|
+
xAxisProps,
|
106
|
+
yAxisProps,
|
107
|
+
unit,
|
108
|
+
valueFormatter,
|
109
|
+
styles
|
110
|
+
});
|
111
|
+
const { getReferenceLineProps } = useChartReferenceLine({
|
112
|
+
referenceLineProps,
|
113
|
+
styles
|
114
|
+
});
|
115
|
+
const { getGridProps } = useChartGrid({
|
116
|
+
gridProps,
|
117
|
+
gridAxis,
|
118
|
+
strokeDasharray,
|
119
|
+
styles
|
120
|
+
});
|
121
|
+
const { tooltipProps: computedTooltipProps, getTooltipProps } = useChartTooltip({
|
122
|
+
tooltipProps,
|
123
|
+
tooltipAnimationDuration,
|
124
|
+
styles
|
125
|
+
});
|
126
|
+
const { legendProps: computedLegendProps, getLegendProps } = useChartLegend({
|
127
|
+
legendProps
|
128
|
+
});
|
129
|
+
const bars = useMemo(
|
130
|
+
() => series.map(({ dataKey: dataKey2 }, index) => {
|
131
|
+
return /* @__PURE__ */ jsx(
|
132
|
+
Bar,
|
133
|
+
{
|
134
|
+
...getBarProps({ index, className: "ui-bar-chart__bar" })
|
135
|
+
},
|
136
|
+
`bar-${dataKey2}`
|
137
|
+
);
|
138
|
+
}),
|
139
|
+
[getBarProps, series]
|
140
|
+
);
|
141
|
+
const referenceLinesItems = useMemo(
|
142
|
+
() => referenceLineProps.map((_, index) => /* @__PURE__ */ jsx(
|
143
|
+
ReferenceLine,
|
144
|
+
{
|
145
|
+
...getReferenceLineProps({
|
146
|
+
index,
|
147
|
+
className: "ui-bar-chart__reference-line"
|
148
|
+
})
|
149
|
+
},
|
150
|
+
`referenceLine-${index}`
|
151
|
+
)),
|
152
|
+
[getReferenceLineProps, referenceLineProps]
|
153
|
+
);
|
154
|
+
return /* @__PURE__ */ jsx(ChartProvider, { value: { styles }, children: /* @__PURE__ */ jsx(
|
155
|
+
ui.div,
|
156
|
+
{
|
157
|
+
ref,
|
158
|
+
className: cx("ui-bar-chart", className),
|
159
|
+
var: barVars,
|
160
|
+
__css: { maxW: "full", ...styles.container },
|
161
|
+
...rest,
|
162
|
+
children: /* @__PURE__ */ jsx(
|
163
|
+
ResponsiveContainer,
|
164
|
+
{
|
165
|
+
...getContainerProps({ className: "ui-bar-chart__container" }),
|
166
|
+
children: /* @__PURE__ */ jsxs(
|
167
|
+
ReChartsBarChart,
|
168
|
+
{
|
169
|
+
...getBarChartProps({ className: "ui-bar-chart__chart" }),
|
170
|
+
children: [
|
171
|
+
/* @__PURE__ */ jsx(
|
172
|
+
CartesianGrid,
|
173
|
+
{
|
174
|
+
...getGridProps({ className: "ui-bar-chart__grid" })
|
175
|
+
}
|
176
|
+
),
|
177
|
+
/* @__PURE__ */ jsx(XAxis, { ...getXAxisProps({ className: "ui-bar-chart__x-axis" }) }),
|
178
|
+
/* @__PURE__ */ jsx(YAxis, { ...getYAxisProps({ className: "ui-bar-chart__y-axis" }) }),
|
179
|
+
withLegend ? /* @__PURE__ */ jsx(
|
180
|
+
Legend,
|
181
|
+
{
|
182
|
+
content: ({ payload }) => /* @__PURE__ */ jsx(
|
183
|
+
ChartLegend,
|
184
|
+
{
|
185
|
+
className: "ui-bar-chart__legend",
|
186
|
+
payload,
|
187
|
+
onHighlight: setHighlightedArea,
|
188
|
+
...computedLegendProps
|
189
|
+
}
|
190
|
+
),
|
191
|
+
...getLegendProps()
|
192
|
+
}
|
193
|
+
) : null,
|
194
|
+
withTooltip ? /* @__PURE__ */ jsx(
|
195
|
+
Tooltip,
|
196
|
+
{
|
197
|
+
content: ({ label, payload }) => /* @__PURE__ */ jsx(
|
198
|
+
ChartTooltip,
|
199
|
+
{
|
200
|
+
className: "ui-bar-chart__tooltip",
|
201
|
+
label,
|
202
|
+
payload,
|
203
|
+
valueFormatter,
|
204
|
+
unit,
|
205
|
+
...computedTooltipProps
|
206
|
+
}
|
207
|
+
),
|
208
|
+
...getTooltipProps()
|
209
|
+
}
|
210
|
+
) : null,
|
211
|
+
bars,
|
212
|
+
referenceLinesItems
|
213
|
+
]
|
214
|
+
}
|
215
|
+
)
|
216
|
+
}
|
217
|
+
)
|
218
|
+
}
|
219
|
+
) });
|
220
|
+
});
|
221
|
+
|
222
|
+
export {
|
223
|
+
BarChart
|
224
|
+
};
|
225
|
+
//# sourceMappingURL=chunk-KNAADLWO.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/bar-chart.tsx"],"sourcesContent":["import type { HTMLUIProps, ThemeProps } from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n useMultiComponentStyle,\n omitThemeProps,\n} from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useMemo } from \"react\"\nimport {\n Legend,\n BarChart as ReChartsBarChart,\n Bar,\n CartesianGrid,\n Tooltip,\n XAxis,\n YAxis,\n ResponsiveContainer,\n ReferenceLine,\n} from \"recharts\"\nimport { ChartLegend } from \"./chart-legend\"\nimport { ChartTooltip } from \"./chart-tooltip\"\nimport { useBarChart } from \"./use-bar-chart\"\nimport type { UseBarChartOptions } from \"./use-bar-chart\"\nimport type { UseChartProps } from \"./use-chart\"\nimport { ChartProvider, useChart } from \"./use-chart\"\nimport type { UseChartAxisOptions } from \"./use-chart-axis\"\nimport { useChartAxis } from \"./use-chart-axis\"\nimport { useChartGrid, type UseChartGridOptions } from \"./use-chart-grid\"\nimport type { UseChartLegendProps } from \"./use-chart-legend\"\nimport { useChartLegend } from \"./use-chart-legend\"\nimport {\n useChartReferenceLine,\n type UseChartReferenceLineOptions,\n} from \"./use-chart-reference-line\"\nimport type { UseChartTooltipOptions } from \"./use-chart-tooltip\"\nimport { useChartTooltip } from \"./use-chart-tooltip\"\n\ntype BarChartOptions = {\n /**\n * If `true`, tooltip is visible.\n *\n * @default true\n */\n withTooltip?: boolean\n /**\n * If `true`, legend is visible.\n *\n * @default false\n */\n withLegend?: boolean\n}\n\nexport type BarChartProps = HTMLUIProps<\"div\"> &\n ThemeProps<\"BarChart\"> &\n BarChartOptions &\n UseBarChartOptions &\n UseChartProps &\n UseChartAxisOptions &\n UseChartReferenceLineOptions &\n UseChartGridOptions &\n UseChartTooltipOptions &\n UseChartLegendProps\n\n/**\n * `BarChart` is a component for drawing bar charts to compare multiple sets of data.\n *\n * @see Docs https://yamada-ui.com/components/feedback/bar-chart\n */\nexport const BarChart = forwardRef<BarChartProps, \"div\">((props, ref) => {\n const [styles, mergedProps] = useMultiComponentStyle(\"BarChart\", props)\n const {\n className,\n series,\n dataKey,\n layoutType,\n tickLine,\n gridAxis,\n withXAxis,\n withYAxis,\n barProps,\n xAxisProps,\n yAxisProps,\n type = \"default\",\n withTooltip = true,\n withLegend = false,\n containerProps,\n unit,\n valueFormatter,\n tooltipProps,\n tooltipAnimationDuration,\n legendProps,\n data,\n referenceLineProps = [],\n gridProps,\n strokeDasharray,\n fillOpacity,\n chartProps,\n syncId,\n ...rest\n } = omitThemeProps(mergedProps)\n\n const { getBarChartProps, getBarProps, barVars, setHighlightedArea } =\n useBarChart({\n data,\n series,\n type,\n layoutType,\n chartProps,\n barProps,\n referenceLineProps,\n fillOpacity,\n syncId,\n styles,\n })\n const { getContainerProps } = useChart({ containerProps })\n const { getXAxisProps, getYAxisProps } = useChartAxis({\n dataKey,\n type,\n layoutType,\n tickLine,\n gridAxis,\n withXAxis,\n withYAxis,\n xAxisProps,\n yAxisProps,\n unit,\n valueFormatter,\n styles,\n })\n const { getReferenceLineProps } = useChartReferenceLine({\n referenceLineProps,\n styles,\n })\n const { getGridProps } = useChartGrid({\n gridProps,\n gridAxis,\n strokeDasharray,\n styles,\n })\n const { tooltipProps: computedTooltipProps, getTooltipProps } =\n useChartTooltip({\n tooltipProps,\n tooltipAnimationDuration,\n styles,\n })\n const { legendProps: computedLegendProps, getLegendProps } = useChartLegend({\n legendProps,\n })\n\n const bars = useMemo(\n () =>\n series.map(({ dataKey }, index) => {\n return (\n <Bar\n key={`bar-${dataKey}`}\n {...getBarProps({ index, className: \"ui-bar-chart__bar\" })}\n />\n )\n }),\n [getBarProps, series],\n )\n\n const referenceLinesItems = useMemo(\n () =>\n referenceLineProps.map((_, index) => (\n <ReferenceLine\n key={`referenceLine-${index}`}\n {...getReferenceLineProps({\n index,\n className: \"ui-bar-chart__reference-line\",\n })}\n />\n )),\n [getReferenceLineProps, referenceLineProps],\n )\n\n return (\n <ChartProvider value={{ styles }}>\n <ui.div\n ref={ref}\n className={cx(\"ui-bar-chart\", className)}\n var={barVars}\n __css={{ maxW: \"full\", ...styles.container }}\n {...rest}\n >\n <ResponsiveContainer\n {...getContainerProps({ className: \"ui-bar-chart__container\" })}\n >\n <ReChartsBarChart\n {...getBarChartProps({ className: \"ui-bar-chart__chart\" })}\n >\n <CartesianGrid\n {...getGridProps({ className: \"ui-bar-chart__grid\" })}\n />\n <XAxis {...getXAxisProps({ className: \"ui-bar-chart__x-axis\" })} />\n <YAxis {...getYAxisProps({ className: \"ui-bar-chart__y-axis\" })} />\n\n {withLegend ? (\n <Legend\n content={({ payload }) => (\n <ChartLegend\n className=\"ui-bar-chart__legend\"\n payload={payload}\n onHighlight={setHighlightedArea}\n {...computedLegendProps}\n />\n )}\n {...getLegendProps()}\n />\n ) : null}\n\n {withTooltip ? (\n <Tooltip\n content={({ label, payload }) => (\n <ChartTooltip\n className=\"ui-bar-chart__tooltip\"\n label={label}\n payload={payload}\n valueFormatter={valueFormatter}\n unit={unit}\n {...computedTooltipProps}\n />\n )}\n {...getTooltipProps()}\n />\n ) : null}\n\n {bars}\n {referenceLinesItems}\n </ReChartsBarChart>\n </ResponsiveContainer>\n </ui.div>\n </ChartProvider>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AA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