@yamada-ui/charts 1.1.2-dev-20240430063353 → 1.1.2-dev-20240501174240
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/package.json +5 -5
- package/dist/area-chart-gradient.d.mts +0 -11
- package/dist/area-chart-gradient.d.ts +0 -11
- package/dist/area-chart-gradient.js +0 -47
- package/dist/area-chart-gradient.js.map +0 -1
- package/dist/area-chart-gradient.mjs +0 -8
- package/dist/area-chart-gradient.mjs.map +0 -1
- package/dist/area-chart-split.d.mts +0 -10
- package/dist/area-chart-split.d.ts +0 -10
- package/dist/area-chart-split.js +0 -52
- package/dist/area-chart-split.js.map +0 -1
- package/dist/area-chart-split.mjs +0 -8
- package/dist/area-chart-split.mjs.map +0 -1
- package/dist/area-chart.d.mts +0 -41
- package/dist/area-chart.d.ts +0 -41
- package/dist/area-chart.js +0 -1223
- package/dist/area-chart.js.map +0 -1
- package/dist/area-chart.mjs +0 -21
- package/dist/area-chart.mjs.map +0 -1
- package/dist/bar-chart.d.mts +0 -38
- package/dist/bar-chart.d.ts +0 -38
- package/dist/bar-chart.js +0 -1027
- package/dist/bar-chart.js.map +0 -1
- package/dist/bar-chart.mjs +0 -19
- package/dist/bar-chart.mjs.map +0 -1
- package/dist/chart-legend.d.mts +0 -12
- package/dist/chart-legend.d.ts +0 -12
- package/dist/chart-legend.js +0 -90
- package/dist/chart-legend.js.map +0 -1
- package/dist/chart-legend.mjs +0 -11
- package/dist/chart-legend.mjs.map +0 -1
- package/dist/chart-tooltip.d.mts +0 -12
- package/dist/chart-tooltip.d.ts +0 -12
- package/dist/chart-tooltip.js +0 -121
- package/dist/chart-tooltip.js.map +0 -1
- package/dist/chart-tooltip.mjs +0 -11
- package/dist/chart-tooltip.mjs.map +0 -1
- package/dist/chart-utils.d.mts +0 -9
- package/dist/chart-utils.d.ts +0 -9
- package/dist/chart-utils.js +0 -45
- package/dist/chart-utils.js.map +0 -1
- package/dist/chart-utils.mjs +0 -10
- package/dist/chart-utils.mjs.map +0 -1
- package/dist/chart.types.d.mts +0 -78
- package/dist/chart.types.d.ts +0 -78
- package/dist/chart.types.js +0 -20
- package/dist/chart.types.js.map +0 -1
- package/dist/chart.types.mjs +0 -2
- package/dist/chart.types.mjs.map +0 -1
- package/dist/chunk-4WX5YS7M.mjs +0 -179
- package/dist/chunk-4WX5YS7M.mjs.map +0 -1
- package/dist/chunk-5TVYPA64.mjs +0 -256
- package/dist/chunk-5TVYPA64.mjs.map +0 -1
- package/dist/chunk-BPR7YL3O.mjs +0 -179
- package/dist/chunk-BPR7YL3O.mjs.map +0 -1
- package/dist/chunk-E2I2XAZ6.mjs +0 -232
- package/dist/chunk-E2I2XAZ6.mjs.map +0 -1
- package/dist/chunk-HDOYOHLA.mjs +0 -326
- package/dist/chunk-HDOYOHLA.mjs.map +0 -1
- package/dist/chunk-KNAADLWO.mjs +0 -225
- package/dist/chunk-KNAADLWO.mjs.map +0 -1
- package/dist/chunk-KT4YOMM4.mjs +0 -344
- package/dist/chunk-KT4YOMM4.mjs.map +0 -1
- package/dist/chunk-LBC2B6UX.mjs +0 -84
- package/dist/chunk-LBC2B6UX.mjs.map +0 -1
- package/dist/chunk-LGMALZCN.mjs +0 -42
- package/dist/chunk-LGMALZCN.mjs.map +0 -1
- package/dist/chunk-LHI57S6P.mjs +0 -215
- package/dist/chunk-LHI57S6P.mjs.map +0 -1
- package/dist/chunk-LM2DQK2P.mjs +0 -33
- package/dist/chunk-LM2DQK2P.mjs.map +0 -1
- package/dist/chunk-MSIOYYWR.mjs +0 -24
- package/dist/chunk-MSIOYYWR.mjs.map +0 -1
- package/dist/chunk-MWPICUEW.mjs +0 -56
- package/dist/chunk-MWPICUEW.mjs.map +0 -1
- package/dist/chunk-NEGDEVRX.mjs +0 -53
- package/dist/chunk-NEGDEVRX.mjs.map +0 -1
- package/dist/chunk-OSNFBRHL.mjs +0 -474
- package/dist/chunk-OSNFBRHL.mjs.map +0 -1
- package/dist/chunk-OW7SOTEF.mjs +0 -206
- package/dist/chunk-OW7SOTEF.mjs.map +0 -1
- package/dist/chunk-P7AFSM5W.mjs +0 -114
- package/dist/chunk-P7AFSM5W.mjs.map +0 -1
- package/dist/chunk-PNE3JG54.mjs +0 -29
- package/dist/chunk-PNE3JG54.mjs.map +0 -1
- package/dist/chunk-QL3DB7OJ.mjs +0 -21
- package/dist/chunk-QL3DB7OJ.mjs.map +0 -1
- package/dist/chunk-QZ5OXZ6Z.mjs +0 -251
- package/dist/chunk-QZ5OXZ6Z.mjs.map +0 -1
- package/dist/chunk-RN6PXJAD.mjs +0 -47
- package/dist/chunk-RN6PXJAD.mjs.map +0 -1
- package/dist/chunk-STBYRLC5.mjs +0 -208
- package/dist/chunk-STBYRLC5.mjs.map +0 -1
- package/dist/chunk-XIFDRM7J.mjs +0 -56
- package/dist/chunk-XIFDRM7J.mjs.map +0 -1
- package/dist/donut-chart.d.mts +0 -31
- package/dist/donut-chart.d.ts +0 -31
- package/dist/donut-chart.js +0 -702
- package/dist/donut-chart.js.map +0 -1
- package/dist/donut-chart.mjs +0 -16
- package/dist/donut-chart.mjs.map +0 -1
- package/dist/index.d.mts +0 -26
- package/dist/index.d.ts +0 -26
- package/dist/index.js +0 -3228
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -45
- package/dist/index.mjs.map +0 -1
- package/dist/line-chart.d.mts +0 -38
- package/dist/line-chart.d.ts +0 -38
- package/dist/line-chart.js +0 -1088
- package/dist/line-chart.js.map +0 -1
- package/dist/line-chart.mjs +0 -19
- package/dist/line-chart.mjs.map +0 -1
- package/dist/pie-chart.d.mts +0 -49
- package/dist/pie-chart.d.ts +0 -49
- package/dist/pie-chart.js +0 -702
- package/dist/pie-chart.js.map +0 -1
- package/dist/pie-chart.mjs +0 -16
- package/dist/pie-chart.mjs.map +0 -1
- package/dist/radar-chart.d.mts +0 -57
- package/dist/radar-chart.d.ts +0 -57
- package/dist/radar-chart.js +0 -918
- package/dist/radar-chart.js.map +0 -1
- package/dist/radar-chart.mjs +0 -16
- package/dist/radar-chart.mjs.map +0 -1
- package/dist/rechart-properties.d.mts +0 -26
- package/dist/rechart-properties.d.ts +0 -26
- package/dist/rechart-properties.js +0 -517
- package/dist/rechart-properties.js.map +0 -1
- package/dist/rechart-properties.mjs +0 -48
- package/dist/rechart-properties.mjs.map +0 -1
- package/dist/use-area-chart.d.mts +0 -123
- package/dist/use-area-chart.d.ts +0 -123
- package/dist/use-area-chart.js +0 -420
- package/dist/use-area-chart.js.map +0 -1
- package/dist/use-area-chart.mjs +0 -10
- package/dist/use-area-chart.mjs.map +0 -1
- package/dist/use-bar-chart.d.mts +0 -73
- package/dist/use-bar-chart.d.ts +0 -73
- package/dist/use-bar-chart.js +0 -290
- package/dist/use-bar-chart.js.map +0 -1
- package/dist/use-bar-chart.mjs +0 -10
- package/dist/use-bar-chart.mjs.map +0 -1
- package/dist/use-chart-axis.d.mts +0 -73
- package/dist/use-chart-axis.d.ts +0 -73
- package/dist/use-chart-axis.js +0 -227
- package/dist/use-chart-axis.js.map +0 -1
- package/dist/use-chart-axis.mjs +0 -10
- package/dist/use-chart-axis.mjs.map +0 -1
- package/dist/use-chart-grid.d.mts +0 -32
- package/dist/use-chart-grid.d.ts +0 -32
- package/dist/use-chart-grid.js +0 -92
- package/dist/use-chart-grid.js.map +0 -1
- package/dist/use-chart-grid.mjs +0 -10
- package/dist/use-chart-grid.mjs.map +0 -1
- package/dist/use-chart-legend.d.mts +0 -18
- package/dist/use-chart-legend.d.ts +0 -18
- package/dist/use-chart-legend.js +0 -81
- package/dist/use-chart-legend.js.map +0 -1
- package/dist/use-chart-legend.mjs +0 -9
- package/dist/use-chart-legend.mjs.map +0 -1
- package/dist/use-chart-reference-line.d.mts +0 -22
- package/dist/use-chart-reference-line.d.ts +0 -22
- package/dist/use-chart-reference-line.js +0 -105
- package/dist/use-chart-reference-line.js.map +0 -1
- package/dist/use-chart-reference-line.mjs +0 -10
- package/dist/use-chart-reference-line.mjs.map +0 -1
- package/dist/use-chart-tooltip.d.mts +0 -27
- package/dist/use-chart-tooltip.d.ts +0 -27
- package/dist/use-chart-tooltip.js +0 -100
- package/dist/use-chart-tooltip.js.map +0 -1
- package/dist/use-chart-tooltip.mjs +0 -10
- package/dist/use-chart-tooltip.mjs.map +0 -1
- package/dist/use-chart.d.mts +0 -33
- package/dist/use-chart.d.ts +0 -33
- package/dist/use-chart.js +0 -104
- package/dist/use-chart.js.map +0 -1
- package/dist/use-chart.mjs +0 -18
- package/dist/use-chart.mjs.map +0 -1
- package/dist/use-line-chart.d.mts +0 -97
- package/dist/use-line-chart.d.ts +0 -97
- package/dist/use-line-chart.js +0 -344
- package/dist/use-line-chart.js.map +0 -1
- package/dist/use-line-chart.mjs +0 -10
- package/dist/use-line-chart.mjs.map +0 -1
- package/dist/use-pie-chart.d.mts +0 -112
- package/dist/use-pie-chart.d.ts +0 -112
- package/dist/use-pie-chart.js +0 -282
- package/dist/use-pie-chart.js.map +0 -1
- package/dist/use-pie-chart.mjs +0 -10
- package/dist/use-pie-chart.mjs.map +0 -1
- package/dist/use-radar-chart.d.mts +0 -105
- package/dist/use-radar-chart.d.ts +0 -105
- package/dist/use-radar-chart.js +0 -473
- package/dist/use-radar-chart.js.map +0 -1
- package/dist/use-radar-chart.mjs +0 -10
- package/dist/use-radar-chart.mjs.map +0 -1
package/dist/use-line-chart.js
DELETED
@@ -1,344 +0,0 @@
|
|
1
|
-
"use client"
|
2
|
-
"use strict";
|
3
|
-
var __defProp = Object.defineProperty;
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
-
var __export = (target, all) => {
|
8
|
-
for (var name in all)
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
10
|
-
};
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
13
|
-
for (let key of __getOwnPropNames(from))
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
16
|
-
}
|
17
|
-
return to;
|
18
|
-
};
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
20
|
-
|
21
|
-
// src/use-line-chart.ts
|
22
|
-
var use_line_chart_exports = {};
|
23
|
-
__export(use_line_chart_exports, {
|
24
|
-
useLineChart: () => useLineChart
|
25
|
-
});
|
26
|
-
module.exports = __toCommonJS(use_line_chart_exports);
|
27
|
-
var import_core2 = require("@yamada-ui/core");
|
28
|
-
var import_utils2 = require("@yamada-ui/utils");
|
29
|
-
var import_react = require("react");
|
30
|
-
|
31
|
-
// src/chart-utils.ts
|
32
|
-
var import_core = require("@yamada-ui/core");
|
33
|
-
var import_utils = require("@yamada-ui/utils");
|
34
|
-
var getClassName = (...styles) => (theme) => (0, import_utils.cx)(
|
35
|
-
...styles.map(
|
36
|
-
(style) => (0, import_utils.isString)(style) ? style : (0, import_core.getCSS)(style)(theme)
|
37
|
-
)
|
38
|
-
);
|
39
|
-
var getComponentProps = ([obj, keys], ...props) => (theme, isContain) => {
|
40
|
-
const [pickedProps, omittedProps] = (0, import_utils.splitObject)(obj, keys);
|
41
|
-
const className = getClassName(...props, omittedProps)(theme);
|
42
|
-
return !isContain ? [pickedProps, className] : { ...pickedProps, className };
|
43
|
-
};
|
44
|
-
|
45
|
-
// src/rechart-properties.ts
|
46
|
-
var lineChartProperties = [
|
47
|
-
"layout",
|
48
|
-
"syncId",
|
49
|
-
"syncMethod",
|
50
|
-
"width",
|
51
|
-
"height",
|
52
|
-
"data",
|
53
|
-
"margin",
|
54
|
-
"onClick",
|
55
|
-
"onMouseEnter",
|
56
|
-
"onMouseMove",
|
57
|
-
"onMouseLeave"
|
58
|
-
];
|
59
|
-
var lineProperties = [
|
60
|
-
"type",
|
61
|
-
"dataKey",
|
62
|
-
"xAxisId",
|
63
|
-
"yAxisId",
|
64
|
-
"legendType",
|
65
|
-
"dot",
|
66
|
-
"activeDot",
|
67
|
-
"label",
|
68
|
-
"hide",
|
69
|
-
"points",
|
70
|
-
"stroke",
|
71
|
-
"strokeWidth",
|
72
|
-
"layout",
|
73
|
-
"connectNulls",
|
74
|
-
"unit",
|
75
|
-
"name",
|
76
|
-
"isAnimationActive",
|
77
|
-
"animationBegin",
|
78
|
-
"animationDuration",
|
79
|
-
"animationEasing",
|
80
|
-
"id",
|
81
|
-
"onAnimationStart",
|
82
|
-
"onAnimationEnd",
|
83
|
-
"onClick",
|
84
|
-
"onMouseDown",
|
85
|
-
"onMouseUp",
|
86
|
-
"onMouseMove",
|
87
|
-
"onMouseOver",
|
88
|
-
"onMouseOut",
|
89
|
-
"onMouseEnter",
|
90
|
-
"onMouseLeave",
|
91
|
-
"strokeDasharray"
|
92
|
-
];
|
93
|
-
var dotProperties = [
|
94
|
-
"cx",
|
95
|
-
"cy",
|
96
|
-
"r",
|
97
|
-
"onClick",
|
98
|
-
"onMouseDown",
|
99
|
-
"onMouseUp",
|
100
|
-
"onMouseMove",
|
101
|
-
"onMouseOver",
|
102
|
-
"onMouseOut",
|
103
|
-
"onMouseEnter",
|
104
|
-
"onMouseLeave"
|
105
|
-
];
|
106
|
-
|
107
|
-
// src/use-line-chart.ts
|
108
|
-
var useLineChart = ({
|
109
|
-
data,
|
110
|
-
series,
|
111
|
-
layoutType = "horizontal",
|
112
|
-
withDots = true,
|
113
|
-
withActiveDots = true,
|
114
|
-
curveType = "monotone",
|
115
|
-
strokeWidth = 2,
|
116
|
-
connectNulls = true,
|
117
|
-
referenceLineProps,
|
118
|
-
fillOpacity = 1,
|
119
|
-
syncId,
|
120
|
-
styles,
|
121
|
-
...rest
|
122
|
-
}) => {
|
123
|
-
var _a;
|
124
|
-
const { theme } = (0, import_core2.useTheme)();
|
125
|
-
const [highlightedArea, setHighlightedArea] = (0, import_react.useState)(null);
|
126
|
-
const shouldHighlight = highlightedArea !== null;
|
127
|
-
const {
|
128
|
-
dot = {},
|
129
|
-
activeDot = {},
|
130
|
-
dimDot,
|
131
|
-
dimLine,
|
132
|
-
...computedLineProps
|
133
|
-
} = (_a = rest.lineProps) != null ? _a : {};
|
134
|
-
const lineColors = (0, import_react.useMemo)(
|
135
|
-
() => series.map(({ color }, index) => ({
|
136
|
-
__prefix: "ui",
|
137
|
-
name: `line-${index}`,
|
138
|
-
token: "colors",
|
139
|
-
value: color != null ? color : "transparent"
|
140
|
-
})),
|
141
|
-
[series]
|
142
|
-
);
|
143
|
-
const referenceLineColors = (0, import_react.useMemo)(
|
144
|
-
() => referenceLineProps ? referenceLineProps.map(({ color }, index) => ({
|
145
|
-
__prefix: "ui",
|
146
|
-
name: `reference-line-${index}`,
|
147
|
-
token: "colors",
|
148
|
-
value: color != null ? color : "transparent"
|
149
|
-
})) : [],
|
150
|
-
[referenceLineProps]
|
151
|
-
);
|
152
|
-
const lineVars = (0, import_react.useMemo)(
|
153
|
-
() => [
|
154
|
-
...lineColors,
|
155
|
-
...referenceLineColors,
|
156
|
-
{ __prefix: "ui", name: "fill-opacity", value: fillOpacity }
|
157
|
-
],
|
158
|
-
[fillOpacity, lineColors, referenceLineColors]
|
159
|
-
);
|
160
|
-
const [chartProps, lineChartClassName] = (0, import_react.useMemo)(
|
161
|
-
() => {
|
162
|
-
var _a2;
|
163
|
-
return getComponentProps(
|
164
|
-
[(_a2 = rest.chartProps) != null ? _a2 : {}, lineChartProperties],
|
165
|
-
styles.chart
|
166
|
-
)(theme);
|
167
|
-
},
|
168
|
-
[rest.chartProps, styles.chart, theme]
|
169
|
-
);
|
170
|
-
const [lineProps, lineClassName] = (0, import_react.useMemo)(() => {
|
171
|
-
const resolvedLineProps = {
|
172
|
-
fillOpacity: "var(--ui-fill-opacity)",
|
173
|
-
strokeOpacity: "var(--ui-fill-opacity)",
|
174
|
-
...computedLineProps
|
175
|
-
};
|
176
|
-
return getComponentProps(
|
177
|
-
[resolvedLineProps, lineProperties],
|
178
|
-
styles.line
|
179
|
-
)(theme);
|
180
|
-
}, [computedLineProps, styles.line, theme]);
|
181
|
-
const [dimLineProps, dimLineClassName] = (0, import_react.useMemo)(() => {
|
182
|
-
const resolvedDimLine = { fillOpacity: 0, strokeOpacity: 0.3, ...dimLine };
|
183
|
-
return getComponentProps([resolvedDimLine, lineProperties])(
|
184
|
-
theme
|
185
|
-
);
|
186
|
-
}, [dimLine, theme]);
|
187
|
-
const [dotProps, dotClassName] = (0, import_react.useMemo)(() => {
|
188
|
-
const resolvedDot = { fillOpacity: 1, strokeOpacity: 1, ...dot };
|
189
|
-
return getComponentProps(
|
190
|
-
[resolvedDot, dotProperties],
|
191
|
-
styles.dot
|
192
|
-
)(theme);
|
193
|
-
}, [dot, styles.dot, theme]);
|
194
|
-
const [activeDotProps, activeDotClassName] = (0, import_react.useMemo)(
|
195
|
-
() => getComponentProps(
|
196
|
-
[activeDot, dotProperties],
|
197
|
-
styles.activeDot
|
198
|
-
)(theme),
|
199
|
-
[activeDot, styles.activeDot, theme]
|
200
|
-
);
|
201
|
-
const [dimDotProps, dimDotClassName] = (0, import_react.useMemo)(() => {
|
202
|
-
const resolvedDimDot = {
|
203
|
-
fillOpacity: 0,
|
204
|
-
strokeOpacity: 0,
|
205
|
-
...dimDot
|
206
|
-
};
|
207
|
-
return getComponentProps([resolvedDimDot, dotProperties])(
|
208
|
-
theme
|
209
|
-
);
|
210
|
-
}, [dimDot, theme]);
|
211
|
-
const linePropList = (0, import_react.useMemo)(
|
212
|
-
() => series.map((props, index) => {
|
213
|
-
const {
|
214
|
-
dataKey,
|
215
|
-
dot: dot2 = {},
|
216
|
-
activeDot: activeDot2 = {},
|
217
|
-
dimDot: dimDot2 = {},
|
218
|
-
dimLine: dimLine2 = {},
|
219
|
-
...computedProps
|
220
|
-
} = props;
|
221
|
-
const color = `var(--ui-line-${index})`;
|
222
|
-
const dimmed = shouldHighlight && highlightedArea !== dataKey;
|
223
|
-
const computedDimLine = { ...dimLineProps, ...dimLine2 };
|
224
|
-
const resolvedProps = {
|
225
|
-
...lineProps,
|
226
|
-
...computedProps,
|
227
|
-
...dimmed ? computedDimLine : {}
|
228
|
-
};
|
229
|
-
const rest2 = getComponentProps(
|
230
|
-
[resolvedProps, lineProperties],
|
231
|
-
lineClassName,
|
232
|
-
dimmed ? dimLineClassName : void 0
|
233
|
-
)(theme, true);
|
234
|
-
let resolvedActiveDot;
|
235
|
-
if (withActiveDots) {
|
236
|
-
const computedActiveDot = { ...activeDotProps, ...activeDot2 };
|
237
|
-
const [rest3, className] = getComponentProps(
|
238
|
-
[computedActiveDot, dotProperties],
|
239
|
-
activeDotClassName
|
240
|
-
)(theme);
|
241
|
-
resolvedActiveDot = {
|
242
|
-
className: (0, import_utils2.cx)("ui-line-chart__active-dot", className),
|
243
|
-
fill: color,
|
244
|
-
stroke: color,
|
245
|
-
r: 4,
|
246
|
-
...rest3
|
247
|
-
};
|
248
|
-
} else {
|
249
|
-
resolvedActiveDot = false;
|
250
|
-
}
|
251
|
-
let resolvedDot;
|
252
|
-
if (withDots) {
|
253
|
-
const computedDimDot = { ...dimDotProps, ...dimDot2 };
|
254
|
-
const computedDot = {
|
255
|
-
...dotProps,
|
256
|
-
...dot2,
|
257
|
-
...dimmed ? computedDimDot : {}
|
258
|
-
};
|
259
|
-
const [rest3, className] = getComponentProps(
|
260
|
-
[computedDot, dotProperties],
|
261
|
-
dotClassName,
|
262
|
-
dimmed ? dimDotClassName : void 0
|
263
|
-
)(theme);
|
264
|
-
resolvedDot = {
|
265
|
-
className: (0, import_utils2.cx)("ui-line-chart__dot", className),
|
266
|
-
fill: color,
|
267
|
-
...rest3
|
268
|
-
};
|
269
|
-
} else {
|
270
|
-
resolvedDot = false;
|
271
|
-
}
|
272
|
-
return {
|
273
|
-
...rest2,
|
274
|
-
color,
|
275
|
-
dataKey,
|
276
|
-
activeDot: resolvedActiveDot,
|
277
|
-
dot: resolvedDot
|
278
|
-
};
|
279
|
-
}),
|
280
|
-
[
|
281
|
-
series,
|
282
|
-
shouldHighlight,
|
283
|
-
highlightedArea,
|
284
|
-
dimLineProps,
|
285
|
-
lineProps,
|
286
|
-
lineClassName,
|
287
|
-
dimLineClassName,
|
288
|
-
theme,
|
289
|
-
withActiveDots,
|
290
|
-
withDots,
|
291
|
-
activeDotProps,
|
292
|
-
activeDotClassName,
|
293
|
-
dimDotProps,
|
294
|
-
dotProps,
|
295
|
-
dotClassName,
|
296
|
-
dimDotClassName
|
297
|
-
]
|
298
|
-
);
|
299
|
-
const getLineChartProps = (0, import_react.useCallback)(
|
300
|
-
({ className, ...props } = {}, ref = null) => ({
|
301
|
-
ref,
|
302
|
-
className: (0, import_utils2.cx)(className, lineChartClassName),
|
303
|
-
data,
|
304
|
-
layout: layoutType,
|
305
|
-
syncId,
|
306
|
-
...props,
|
307
|
-
...chartProps
|
308
|
-
}),
|
309
|
-
[data, layoutType, syncId, lineChartClassName, chartProps]
|
310
|
-
);
|
311
|
-
const getLineProps = (0, import_react.useCallback)(
|
312
|
-
({ index, className: classNameProp, ...props }, ref = null) => {
|
313
|
-
const { color, className, dataKey, activeDot: activeDot2, dot: dot2, ...rest2 } = linePropList[index];
|
314
|
-
return {
|
315
|
-
ref,
|
316
|
-
className: (0, import_utils2.cx)(classNameProp, className),
|
317
|
-
activeDot: activeDot2,
|
318
|
-
dot: dot2,
|
319
|
-
name: dataKey,
|
320
|
-
type: curveType,
|
321
|
-
dataKey,
|
322
|
-
fill: color,
|
323
|
-
strokeWidth,
|
324
|
-
stroke: color,
|
325
|
-
isAnimationActive: false,
|
326
|
-
connectNulls,
|
327
|
-
...props,
|
328
|
-
...rest2
|
329
|
-
};
|
330
|
-
},
|
331
|
-
[connectNulls, curveType, linePropList, strokeWidth]
|
332
|
-
);
|
333
|
-
return {
|
334
|
-
getLineProps,
|
335
|
-
getLineChartProps,
|
336
|
-
lineVars,
|
337
|
-
setHighlightedArea
|
338
|
-
};
|
339
|
-
};
|
340
|
-
// Annotate the CommonJS export names for ESM import in node:
|
341
|
-
0 && (module.exports = {
|
342
|
-
useLineChart
|
343
|
-
});
|
344
|
-
//# sourceMappingURL=use-line-chart.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../src/use-line-chart.ts","../src/chart-utils.ts","../src/rechart-properties.ts"],"sourcesContent":["import { useTheme } from \"@yamada-ui/core\"\nimport type { CSSUIObject, CSSUIProps } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport type { ComponentPropsWithoutRef } from \"react\"\nimport { useCallback, useMemo, useState } from \"react\"\nimport type * as Recharts from \"recharts\"\nimport { getComponentProps } from \"./chart-utils\"\nimport type {\n ChartLayoutType,\n LineProps,\n LineChartProps,\n ReferenceLineProps,\n ChartPropGetter,\n ChartCurveType,\n RequiredChartPropGetter,\n} from \"./chart.types\"\nimport {\n dotProperties,\n lineChartProperties,\n lineProperties,\n} from \"./rechart-properties\"\n\nexport type UseLineChartOptions = {\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: LineProps[]\n /**\n * Props for the lines.\n */\n lineProps?: Partial<LineProps>\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 * Props passed down to recharts `LineChart` component.\n */\n chartProps?: LineChartProps\n /**\n * Chart orientation.\n *\n * @default 'horizontal'\n */\n layoutType?: ChartLayoutType\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 lines.\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 * Reference lines that should be displayed on the chart.\n */\n referenceLineProps?: ReferenceLineProps[]\n /**\n * Controls fill opacity of all lines.\n *\n * @default 1\n */\n fillOpacity?: number | [number, number]\n}\n\ntype UseLineChartProps = UseLineChartOptions & {\n styles: Dict<CSSUIObject>\n}\n\nexport const useLineChart = ({\n data,\n series,\n layoutType = \"horizontal\",\n withDots = true,\n withActiveDots = true,\n curveType = \"monotone\",\n strokeWidth = 2,\n connectNulls = true,\n referenceLineProps,\n fillOpacity = 1,\n syncId,\n styles,\n ...rest\n}: UseLineChartProps) => {\n const { theme } = useTheme()\n const [highlightedArea, setHighlightedArea] = useState<string | null>(null)\n const shouldHighlight = highlightedArea !== null\n const {\n dot = {},\n activeDot = {},\n dimDot,\n dimLine,\n ...computedLineProps\n } = rest.lineProps ?? {}\n\n const lineColors: CSSUIProps[\"var\"] = useMemo(\n () =>\n series.map(({ color }, index) => ({\n __prefix: \"ui\",\n name: `line-${index}`,\n token: \"colors\",\n value: color ?? \"transparent\",\n })),\n [series],\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 lineVars: CSSUIProps[\"var\"] = useMemo(\n () => [\n ...lineColors,\n ...referenceLineColors,\n { __prefix: \"ui\", name: \"fill-opacity\", value: fillOpacity },\n ],\n [fillOpacity, lineColors, referenceLineColors],\n )\n\n const [chartProps, lineChartClassName] = useMemo(\n () =>\n getComponentProps<Dict, string>(\n [rest.chartProps ?? {}, lineChartProperties],\n styles.chart,\n )(theme),\n [rest.chartProps, styles.chart, theme],\n )\n\n const [lineProps, lineClassName] = useMemo(() => {\n const resolvedLineProps = {\n fillOpacity: \"var(--ui-fill-opacity)\",\n strokeOpacity: \"var(--ui-fill-opacity)\",\n ...computedLineProps,\n }\n\n return getComponentProps<Dict, string>(\n [resolvedLineProps, lineProperties],\n styles.line,\n )(theme)\n }, [computedLineProps, styles.line, theme])\n\n const [dimLineProps, dimLineClassName] = useMemo(() => {\n const resolvedDimLine = { fillOpacity: 0, strokeOpacity: 0.3, ...dimLine }\n\n return getComponentProps<Dict, string>([resolvedDimLine, lineProperties])(\n theme,\n )\n }, [dimLine, theme])\n\n const [dotProps, dotClassName] = useMemo(() => {\n const resolvedDot = { fillOpacity: 1, strokeOpacity: 1, ...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 = {\n fillOpacity: 0,\n strokeOpacity: 0,\n ...dimDot,\n }\n\n return getComponentProps<Dict, string>([resolvedDimDot, dotProperties])(\n theme,\n )\n }, [dimDot, theme])\n\n const linePropList = useMemo(\n () =>\n series.map((props, index) => {\n const {\n dataKey,\n dot = {},\n activeDot = {},\n dimDot = {},\n dimLine = {},\n ...computedProps\n } = props\n const color = `var(--ui-line-${index})`\n const dimmed = shouldHighlight && highlightedArea !== dataKey\n const computedDimLine = { ...dimLineProps, ...dimLine }\n const resolvedProps = {\n ...lineProps,\n ...computedProps,\n ...(dimmed ? computedDimLine : {}),\n }\n\n const rest = getComponentProps<Dict, string>(\n [resolvedProps, lineProperties],\n lineClassName,\n dimmed ? dimLineClassName : 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-line-chart__active-dot\", className),\n fill: color,\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-line-chart__dot\", className),\n fill: color,\n ...rest,\n } as Recharts.DotProps\n } else {\n resolvedDot = false\n }\n\n return {\n ...rest,\n color,\n dataKey,\n activeDot: resolvedActiveDot,\n dot: resolvedDot,\n }\n }),\n [\n series,\n shouldHighlight,\n highlightedArea,\n dimLineProps,\n lineProps,\n lineClassName,\n dimLineClassName,\n theme,\n withActiveDots,\n withDots,\n activeDotProps,\n activeDotClassName,\n dimDotProps,\n dotProps,\n dotClassName,\n dimDotClassName,\n ],\n )\n\n const getLineChartProps: ChartPropGetter<\n \"div\",\n ComponentPropsWithoutRef<typeof Recharts.LineChart>,\n ComponentPropsWithoutRef<typeof Recharts.LineChart>\n > = useCallback(\n ({ className, ...props } = {}, ref = null) => ({\n ref,\n className: cx(className, lineChartClassName),\n data,\n layout: layoutType,\n syncId,\n ...props,\n ...chartProps,\n }),\n [data, layoutType, syncId, lineChartClassName, chartProps],\n )\n\n const getLineProps: RequiredChartPropGetter<\n \"div\",\n {\n index: number\n },\n Omit<Recharts.LineProps, \"ref\">\n > = useCallback(\n ({ index, className: classNameProp, ...props }, ref = null) => {\n const { color, className, dataKey, activeDot, dot, ...rest } =\n linePropList[index]\n\n return {\n ref,\n className: cx(classNameProp, className),\n activeDot,\n dot,\n name: dataKey as string,\n type: curveType,\n dataKey,\n fill: color,\n strokeWidth,\n stroke: color,\n isAnimationActive: false,\n connectNulls,\n ...(props as Omit<Recharts.LineProps, \"dataKey\">),\n ...rest,\n }\n },\n [connectNulls, curveType, linePropList, strokeWidth],\n )\n\n return {\n getLineProps,\n getLineChartProps,\n lineVars,\n setHighlightedArea,\n }\n}\n\nexport type UseLineChartReturn = ReturnType<typeof useLineChart>\n","import type { StyledTheme } from \"@yamada-ui/core\"\nimport { getCSS } from \"@yamada-ui/core\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport { cx, isString, splitObject } from \"@yamada-ui/utils\"\n\nexport const getClassName =\n (...styles: (Dict | string | undefined)[]) =>\n (theme: StyledTheme) =>\n cx(\n ...styles.map((style) =>\n isString(style) ? style : getCSS(style)(theme),\n ),\n )\n\nexport const getComponentProps =\n <T extends Dict, K extends keyof T>(\n [obj, keys]: [T, K[]],\n ...props: (Dict | string | undefined)[]\n ) =>\n <P extends boolean = false>(theme: StyledTheme, isContain?: P) => {\n const [pickedProps, omittedProps] = splitObject<T, K>(obj, keys)\n const className = getClassName(...props, omittedProps)(theme)\n\n return (\n !isContain ? [pickedProps, className] : { ...pickedProps, className }\n ) as P extends false\n ? [{ [P in K]: T[P] }, string]\n : { [P in K]: T[P] } & { className: string }\n }\n","import type { ComponentPropsWithoutRef } from \"react\"\nimport type * as Recharts from \"recharts\"\n\nexport const areaChartProperties: (keyof ComponentPropsWithoutRef<\n typeof Recharts.AreaChart\n>)[] = [\n \"layout\",\n \"syncId\",\n \"syncMethod\",\n \"width\",\n \"height\",\n \"data\",\n \"margin\",\n \"stackOffset\",\n \"onClick\",\n \"onMouseEnter\",\n \"onMouseMove\",\n \"onMouseLeave\",\n]\n\nexport const barChartProperties: (keyof ComponentPropsWithoutRef<\n typeof Recharts.BarChart\n>)[] = [\n \"layout\",\n \"syncId\",\n \"syncMethod\",\n \"width\",\n \"height\",\n \"data\",\n \"margin\",\n \"barCategoryGap\",\n \"barGap\",\n \"barSize\",\n \"maxBarSize\",\n \"stackOffset\",\n \"reverseStackOrder\",\n \"onClick\",\n \"onMouseEnter\",\n \"onMouseMove\",\n \"onMouseLeave\",\n]\n\nexport const lineChartProperties: (keyof ComponentPropsWithoutRef<\n typeof Recharts.LineChart\n>)[] = [\n \"layout\",\n \"syncId\",\n \"syncMethod\",\n \"width\",\n \"height\",\n \"data\",\n \"margin\",\n \"onClick\",\n \"onMouseEnter\",\n \"onMouseMove\",\n \"onMouseLeave\",\n]\n\nexport const radarChartProperties: (keyof ComponentPropsWithoutRef<\n typeof Recharts.RadarChart\n>)[] = [\n \"width\",\n \"height\",\n \"data\",\n \"cx\",\n \"cy\",\n \"startAngle\",\n \"endAngle\",\n \"innerRadius\",\n \"outerRadius\",\n \"margin\",\n \"onMouseEnter\",\n \"onClick\",\n]\n\nexport const pieChartProperties: (keyof ComponentPropsWithoutRef<\n typeof Recharts.PieChart\n>)[] = [\"width\", \"height\", \"margin\", \"onClick\", \"onMouseEnter\", \"onMouseLeave\"]\n\nexport const referenceLineProperties: (keyof Recharts.ReferenceLineProps)[] = [\n \"xAxisId\",\n \"yAxisId\",\n \"x\",\n \"y\",\n \"ifOverflow\",\n \"viewBox\",\n \"xAxis\",\n \"yAxis\",\n \"label\",\n \"isFront\",\n \"strokeWidth\",\n \"segment\",\n]\n\nexport const containerProperties: (keyof Omit<\n Recharts.ResponsiveContainerProps,\n \"children\"\n>)[] = [\n \"aspect\",\n \"width\",\n \"height\",\n \"minWidth\",\n \"minHeight\",\n \"debounce\",\n \"onResize\",\n]\n\nexport const gridProperties: (keyof Recharts.CartesianGridProps)[] = [\n \"x\",\n \"y\",\n \"width\",\n \"height\",\n \"horizontal\",\n \"vertical\",\n \"horizontalPoints\",\n \"horizontalCoordinatesGenerator\",\n \"verticalPoints\",\n \"verticalCoordinatesGenerator\",\n \"fill\",\n \"fillOpacity\",\n \"strokeDasharray\",\n]\n\nexport const xAxisProperties: (keyof Recharts.XAxisProps)[] = [\n \"hide\",\n \"dataKey\",\n \"xAxisId\",\n \"width\",\n \"height\",\n \"orientation\",\n \"type\",\n \"allowDecimals\",\n \"allowDataOverflow\",\n \"allowDuplicatedCategory\",\n \"angle\",\n \"tickCount\",\n \"domain\",\n \"includeHidden\",\n \"interval\",\n \"padding\",\n \"minTickGap\",\n \"axisLine\",\n \"tickLine\",\n \"tickSize\",\n \"tickFormatter\",\n \"ticks\",\n \"tick\",\n \"mirror\",\n \"reversed\",\n \"label\",\n \"scale\",\n \"unit\",\n \"name\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n \"tickMargin\",\n]\n\nexport const yAxisProperties: (keyof Recharts.YAxisProps)[] = [\n \"hide\",\n \"dataKey\",\n \"yAxisId\",\n \"width\",\n \"height\",\n \"orientation\",\n \"type\",\n \"tickCount\",\n \"domain\",\n \"includeHidden\",\n \"interval\",\n \"padding\",\n \"minTickGap\",\n \"allowDecimals\",\n \"allowDataOverflow\",\n \"allowDuplicatedCategory\",\n \"axisLine\",\n \"tickLine\",\n \"tickSize\",\n \"tickFormatter\",\n \"ticks\",\n \"tick\",\n \"mirror\",\n \"reversed\",\n \"label\",\n \"scale\",\n \"unit\",\n \"name\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n \"tickMargin\",\n]\n\nexport const legendProperties: (keyof Omit<Recharts.LegendProps, \"ref\">)[] = [\n \"width\",\n \"height\",\n \"layout\",\n \"align\",\n \"verticalAlign\",\n \"iconSize\",\n \"iconType\",\n \"payload\",\n \"chartWidth\",\n \"chartHeight\",\n \"margin\",\n \"content\",\n \"formatter\",\n \"wrapperStyle\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n]\n\nexport const tooltipProperties: (keyof Recharts.TooltipProps<any, any>)[] = [\n \"offset\",\n \"filterNull\",\n \"itemStyle\",\n \"wrapperStyle\",\n \"contentStyle\",\n \"labelStyle\",\n \"cursor\",\n \"viewBox\",\n \"allowEscapeViewBox\",\n \"active\",\n \"position\",\n \"coordinate\",\n \"payload\",\n \"label\",\n \"content\",\n \"formatter\",\n \"labelFormatter\",\n \"itemSorter\",\n \"isAnimationActive\",\n \"animationDuration\",\n \"animationEasing\",\n]\n\nexport const areaProperties: (keyof Omit<Recharts.AreaProps, \"ref\">)[] = [\n \"type\",\n \"dataKey\",\n \"xAxisId\",\n \"yAxisId\",\n \"legendType\",\n \"dot\",\n \"activeDot\",\n \"label\",\n \"stroke\",\n \"strokeWidth\",\n \"layout\",\n \"baseLine\",\n \"points\",\n \"stackId\",\n \"connectNulls\",\n \"unit\",\n \"name\",\n \"isAnimationActive\",\n \"animationBegin\",\n \"animationDuration\",\n \"animationEasing\",\n \"id\",\n \"onAnimationStart\",\n \"onAnimationEnd\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n]\n\nexport const barProperties: (keyof Omit<Recharts.BarProps, \"ref\">)[] = [\n \"layout\",\n \"dataKey\",\n \"xAxisId\",\n \"yAxisId\",\n \"legendType\",\n \"label\",\n \"data\",\n \"barSize\",\n \"maxBarSize\",\n \"minPointSize\",\n \"background\",\n \"shape\",\n \"activeBar\",\n \"stackId\",\n \"unit\",\n \"name\",\n \"isAnimationActive\",\n \"animationBegin\",\n \"animationDuration\",\n \"animationEasing\",\n \"id\",\n \"onAnimationStart\",\n \"onAnimationEnd\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n \"radius\",\n]\n\nexport const radarProperties: (keyof Omit<Recharts.RadarProps, \"ref\">)[] = [\n \"dataKey\",\n \"points\",\n \"shape\",\n \"dot\",\n \"activeDot\",\n \"legendType\",\n \"label\",\n \"isAnimationActive\",\n \"animationBegin\",\n \"animationDuration\",\n \"animationEasing\",\n \"onAnimationStart\",\n \"onAnimationEnd\",\n]\n\nexport const lineProperties: (keyof Omit<Recharts.LineProps, \"ref\">)[] = [\n \"type\",\n \"dataKey\",\n \"xAxisId\",\n \"yAxisId\",\n \"legendType\",\n \"dot\",\n \"activeDot\",\n \"label\",\n \"hide\",\n \"points\",\n \"stroke\",\n \"strokeWidth\",\n \"layout\",\n \"connectNulls\",\n \"unit\",\n \"name\",\n \"isAnimationActive\",\n \"animationBegin\",\n \"animationDuration\",\n \"animationEasing\",\n \"id\",\n \"onAnimationStart\",\n \"onAnimationEnd\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n \"strokeDasharray\",\n]\n\nexport const pieProperties: (keyof Omit<Recharts.PieProps, \"ref\">)[] = [\n \"cx\",\n \"cy\",\n \"innerRadius\",\n \"outerRadius\",\n \"startAngle\",\n \"endAngle\",\n \"minAngle\",\n \"paddingAngle\",\n \"nameKey\",\n \"dataKey\",\n \"legendType\",\n \"label\",\n \"labelLine\",\n \"data\",\n \"activeIndex\",\n \"activeShape\",\n \"inactiveShape\",\n \"isAnimationActive\",\n \"animationBegin\",\n \"animationDuration\",\n \"animationEasing\",\n \"onAnimationStart\",\n \"onAnimationEnd\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n]\n\nexport const dotProperties: (keyof Omit<Recharts.DotProps, \"ref\">)[] = [\n \"cx\",\n \"cy\",\n \"r\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n]\n\nexport const polarGridProperties: (keyof Recharts.PolarGridProps)[] = [\n \"cx\",\n \"cy\",\n \"innerRadius\",\n \"outerRadius\",\n \"polarAngles\",\n \"polarRadius\",\n \"gridType\",\n]\n\nexport const polarAngleAxisProperties: (keyof Recharts.PolarAngleAxisProps)[] =\n [\n \"dataKey\",\n \"cx\",\n \"cy\",\n \"radius\",\n \"axisLine\",\n \"axisLineType\",\n \"tickLine\",\n \"tickSize\",\n \"tick\",\n \"ticks\",\n \"orient\",\n \"tickFormatter\",\n \"type\",\n \"allowDuplicatedCategory\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n ]\nexport const polarRadiusAxisProperties: (keyof Recharts.PolarRadiusAxisProps)[] =\n [\n \"angle\",\n \"type\",\n \"allowDuplicatedCategory\",\n \"cx\",\n \"cy\",\n \"domain\",\n \"reversed\",\n \"label\",\n \"orientation\",\n \"axisLine\",\n \"tick\",\n \"tickSize\",\n \"tickFormatter\",\n \"tickCount\",\n \"scale\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n ]\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,eAAyB;AAEzB,IAAAC,gBAAmB;AAGnB,mBAA+C;;;ACJ/C,kBAAuB;AAEvB,mBAA0C;AAEnC,IAAM,eACX,IAAI,WACJ,CAAC,cACC;AAAA,EACE,GAAG,OAAO;AAAA,IAAI,CAAC,cACb,uBAAS,KAAK,IAAI,YAAQ,oBAAO,KAAK,EAAE,KAAK;AAAA,EAC/C;AACF;AAEG,IAAM,oBACX,CACE,CAAC,KAAK,IAAI,MACP,UAEL,CAA4B,OAAoB,cAAkB;AAChE,QAAM,CAAC,aAAa,YAAY,QAAI,0BAAkB,KAAK,IAAI;AAC/D,Q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F,CAAC;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,QAAM,wBAIF;AAAA,IACF,CAAC,EAAE,WAAW,GAAG,MAAM,IAAI,CAAC,GAAG,MAAM,UAAU;AAAA,MAC7C;AAAA,MACA,eAAW,kBAAG,WAAW,kBAAkB;AAAA,MAC3C;AAAA,MACA,QAAQ;AAAA,MACR;AAAA,MACA,GAAG;AAAA,MACH,GAAG;AAAA,IACL;AAAA,IACA,CAAC,MAAM,YAAY,QAAQ,oBAAoB,UAAU;AAAA,EAC3D;AAEA,QAAM,mBAMF;AAAA,IACF,CAAC,EAAE,OAAO,WAAW,eAAe,GAAG,MAAM,GAAG,MAAM,SAAS;AAC7D,YAAM,EAAE,OAAO,WAAW,SAAS,WAAAH,YAAW,KAAAD,MAAK,GAAGI,MAAK,IACzD,aAAa,KAAK;AAEpB,aAAO;AAAA,QACL;AAAA,QACA,eAAW,kBAAG,eAAe,SAAS;AAAA,QACtC,WAAAH;AAAA,QACA,KAAAD;AAAA,QACA,MAAM;AAAA,QACN,MAAM;AAAA,QACN;AAAA,QACA,MAAM;AAAA,QACN;AAAA,QACA,QAAQ;AAAA,QACR,mBAAmB;AAAA,QACnB;AAAA,QACA,GAAI;AAAA,QACJ,GAAGI;AAAA,MACL;AAAA,IACF;AAAA,IACA,CAAC,cAAc,WAAW,cAAc,WAAW;AAAA,EACrD;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["import_core","import_utils","_a","dot","activeDot","dimDot","dimLine","rest"]}
|
package/dist/use-line-chart.mjs
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/use-pie-chart.d.mts
DELETED
@@ -1,112 +0,0 @@
|
|
1
|
-
import * as react from 'react';
|
2
|
-
import * as recharts_types_chart_generateCategoricalChart from 'recharts/types/chart/generateCategoricalChart';
|
3
|
-
import * as _yamada_ui_core from '@yamada-ui/core';
|
4
|
-
import { CSSUIObject } from '@yamada-ui/core';
|
5
|
-
import * as _yamada_ui_utils from '@yamada-ui/utils';
|
6
|
-
import { Dict } from '@yamada-ui/utils';
|
7
|
-
import * as Recharts from 'recharts';
|
8
|
-
import { CellProps, PieChartProps, PieProps, RequiredChartPropGetter, ChartPropGetter } from './chart.types.mjs';
|
9
|
-
|
10
|
-
type UsePieChartOptions = {
|
11
|
-
/**
|
12
|
-
* Chart data.
|
13
|
-
*/
|
14
|
-
data: CellProps[];
|
15
|
-
/**
|
16
|
-
* Props passed down to recharts `PieChart` component.
|
17
|
-
*/
|
18
|
-
chartProps?: PieChartProps;
|
19
|
-
/**
|
20
|
-
* Props for the pie.
|
21
|
-
*/
|
22
|
-
pieProps?: Partial<PieProps>;
|
23
|
-
/**
|
24
|
-
* Props for the cell.
|
25
|
-
*/
|
26
|
-
cellProps?: Partial<CellProps>;
|
27
|
-
/**
|
28
|
-
* Determines whether each segment should have associated label.
|
29
|
-
*
|
30
|
-
* @default false
|
31
|
-
*/
|
32
|
-
withLabels?: boolean;
|
33
|
-
/**
|
34
|
-
* Determines whether segments labels should have lines that connect the segment with the label.
|
35
|
-
*
|
36
|
-
* @default false
|
37
|
-
*/
|
38
|
-
withLabelLines?: boolean;
|
39
|
-
/**
|
40
|
-
* Controls innerRadius of the chart segments.
|
41
|
-
* If it is a number, it is the width of the radius.
|
42
|
-
* For example, `60` means the radius is `60px` and the diameter is `120px`.
|
43
|
-
*
|
44
|
-
* @default '0%'
|
45
|
-
*/
|
46
|
-
innerRadius?: number | string;
|
47
|
-
/**
|
48
|
-
* Controls thickness of the chart segments. If it is a number, it is calculated as px.
|
49
|
-
* If it is a number, it is the width of the radius.
|
50
|
-
* For example, `60` means the radius is `60px` and the diameter is `120px`.
|
51
|
-
*
|
52
|
-
* @default '80%'
|
53
|
-
*/
|
54
|
-
outerRadius?: number | string;
|
55
|
-
/**
|
56
|
-
* Controls padding between segments.
|
57
|
-
*
|
58
|
-
* @default 0
|
59
|
-
*/
|
60
|
-
paddingAngle?: number;
|
61
|
-
/**
|
62
|
-
* Stroke width for the chart pies.
|
63
|
-
*
|
64
|
-
* @default 1
|
65
|
-
*/
|
66
|
-
strokeWidth?: number;
|
67
|
-
/**
|
68
|
-
* Controls angle at which chart starts.
|
69
|
-
*
|
70
|
-
* @default 90
|
71
|
-
*/
|
72
|
-
startAngle?: number;
|
73
|
-
/**
|
74
|
-
* Controls angle at which chart ends.
|
75
|
-
*
|
76
|
-
* @default -270
|
77
|
-
*/
|
78
|
-
endAngle?: number;
|
79
|
-
/**
|
80
|
-
* Controls fill opacity of all pies.
|
81
|
-
*
|
82
|
-
* @default 1
|
83
|
-
*/
|
84
|
-
fillOpacity?: number | [number, number];
|
85
|
-
/**
|
86
|
-
* A function to format values inside the tooltip.
|
87
|
-
*/
|
88
|
-
valueFormatter?: (value: number) => string;
|
89
|
-
};
|
90
|
-
type UsePieChartProps = UsePieChartOptions & {
|
91
|
-
styles: Dict<CSSUIObject>;
|
92
|
-
};
|
93
|
-
declare const usePieChart: ({ data, withLabels, withLabelLines, strokeWidth, fillOpacity, innerRadius, outerRadius, paddingAngle, startAngle, endAngle, styles, ...rest }: UsePieChartProps) => {
|
94
|
-
pieVars: {
|
95
|
-
__prefix?: string | undefined;
|
96
|
-
name: string;
|
97
|
-
token?: "colors" | "transitionDuration" | "transitionProperty" | "animations" | "blurs" | "borders" | "breakpoints" | "fonts" | "fontSizes" | "fontWeights" | "gradients" | "layerStyles" | "letterSpacings" | "lineHeights" | "radii" | "shadows" | "sizes" | "spaces" | "textStyles" | "transitionEasing" | "zIndices" | undefined;
|
98
|
-
value?: (number | _yamada_ui_utils.StringLiteral | _yamada_ui_core.ResponsiveObject<number | _yamada_ui_utils.StringLiteral> | _yamada_ui_core.ColorModeArray<number | _yamada_ui_utils.StringLiteral>) | undefined;
|
99
|
-
}[];
|
100
|
-
getPieProps: RequiredChartPropGetter<"div", Partial<Recharts.PieProps> & {
|
101
|
-
labelClassName: string;
|
102
|
-
labelLineClassName: string;
|
103
|
-
}, Omit<Recharts.PieProps, "ref">>;
|
104
|
-
getPieChartProps: ChartPropGetter<"div", recharts_types_chart_generateCategoricalChart.CategoricalChartProps, recharts_types_chart_generateCategoricalChart.CategoricalChartProps>;
|
105
|
-
getCellProps: RequiredChartPropGetter<"div", Omit<Recharts.CellProps, "ref"> & {
|
106
|
-
index: number;
|
107
|
-
}, Omit<Recharts.CellProps, "ref">>;
|
108
|
-
setHighlightedArea: react.Dispatch<react.SetStateAction<string | null>>;
|
109
|
-
};
|
110
|
-
type UsePieChartReturn = ReturnType<typeof usePieChart>;
|
111
|
-
|
112
|
-
export { type UsePieChartOptions, type UsePieChartReturn, usePieChart };
|
package/dist/use-pie-chart.d.ts
DELETED
@@ -1,112 +0,0 @@
|
|
1
|
-
import * as react from 'react';
|
2
|
-
import * as recharts_types_chart_generateCategoricalChart from 'recharts/types/chart/generateCategoricalChart';
|
3
|
-
import * as _yamada_ui_core from '@yamada-ui/core';
|
4
|
-
import { CSSUIObject } from '@yamada-ui/core';
|
5
|
-
import * as _yamada_ui_utils from '@yamada-ui/utils';
|
6
|
-
import { Dict } from '@yamada-ui/utils';
|
7
|
-
import * as Recharts from 'recharts';
|
8
|
-
import { CellProps, PieChartProps, PieProps, RequiredChartPropGetter, ChartPropGetter } from './chart.types.js';
|
9
|
-
|
10
|
-
type UsePieChartOptions = {
|
11
|
-
/**
|
12
|
-
* Chart data.
|
13
|
-
*/
|
14
|
-
data: CellProps[];
|
15
|
-
/**
|
16
|
-
* Props passed down to recharts `PieChart` component.
|
17
|
-
*/
|
18
|
-
chartProps?: PieChartProps;
|
19
|
-
/**
|
20
|
-
* Props for the pie.
|
21
|
-
*/
|
22
|
-
pieProps?: Partial<PieProps>;
|
23
|
-
/**
|
24
|
-
* Props for the cell.
|
25
|
-
*/
|
26
|
-
cellProps?: Partial<CellProps>;
|
27
|
-
/**
|
28
|
-
* Determines whether each segment should have associated label.
|
29
|
-
*
|
30
|
-
* @default false
|
31
|
-
*/
|
32
|
-
withLabels?: boolean;
|
33
|
-
/**
|
34
|
-
* Determines whether segments labels should have lines that connect the segment with the label.
|
35
|
-
*
|
36
|
-
* @default false
|
37
|
-
*/
|
38
|
-
withLabelLines?: boolean;
|
39
|
-
/**
|
40
|
-
* Controls innerRadius of the chart segments.
|
41
|
-
* If it is a number, it is the width of the radius.
|
42
|
-
* For example, `60` means the radius is `60px` and the diameter is `120px`.
|
43
|
-
*
|
44
|
-
* @default '0%'
|
45
|
-
*/
|
46
|
-
innerRadius?: number | string;
|
47
|
-
/**
|
48
|
-
* Controls thickness of the chart segments. If it is a number, it is calculated as px.
|
49
|
-
* If it is a number, it is the width of the radius.
|
50
|
-
* For example, `60` means the radius is `60px` and the diameter is `120px`.
|
51
|
-
*
|
52
|
-
* @default '80%'
|
53
|
-
*/
|
54
|
-
outerRadius?: number | string;
|
55
|
-
/**
|
56
|
-
* Controls padding between segments.
|
57
|
-
*
|
58
|
-
* @default 0
|
59
|
-
*/
|
60
|
-
paddingAngle?: number;
|
61
|
-
/**
|
62
|
-
* Stroke width for the chart pies.
|
63
|
-
*
|
64
|
-
* @default 1
|
65
|
-
*/
|
66
|
-
strokeWidth?: number;
|
67
|
-
/**
|
68
|
-
* Controls angle at which chart starts.
|
69
|
-
*
|
70
|
-
* @default 90
|
71
|
-
*/
|
72
|
-
startAngle?: number;
|
73
|
-
/**
|
74
|
-
* Controls angle at which chart ends.
|
75
|
-
*
|
76
|
-
* @default -270
|
77
|
-
*/
|
78
|
-
endAngle?: number;
|
79
|
-
/**
|
80
|
-
* Controls fill opacity of all pies.
|
81
|
-
*
|
82
|
-
* @default 1
|
83
|
-
*/
|
84
|
-
fillOpacity?: number | [number, number];
|
85
|
-
/**
|
86
|
-
* A function to format values inside the tooltip.
|
87
|
-
*/
|
88
|
-
valueFormatter?: (value: number) => string;
|
89
|
-
};
|
90
|
-
type UsePieChartProps = UsePieChartOptions & {
|
91
|
-
styles: Dict<CSSUIObject>;
|
92
|
-
};
|
93
|
-
declare const usePieChart: ({ data, withLabels, withLabelLines, strokeWidth, fillOpacity, innerRadius, outerRadius, paddingAngle, startAngle, endAngle, styles, ...rest }: UsePieChartProps) => {
|
94
|
-
pieVars: {
|
95
|
-
__prefix?: string | undefined;
|
96
|
-
name: string;
|
97
|
-
token?: "colors" | "transitionDuration" | "transitionProperty" | "animations" | "blurs" | "borders" | "breakpoints" | "fonts" | "fontSizes" | "fontWeights" | "gradients" | "layerStyles" | "letterSpacings" | "lineHeights" | "radii" | "shadows" | "sizes" | "spaces" | "textStyles" | "transitionEasing" | "zIndices" | undefined;
|
98
|
-
value?: (number | _yamada_ui_utils.StringLiteral | _yamada_ui_core.ResponsiveObject<number | _yamada_ui_utils.StringLiteral> | _yamada_ui_core.ColorModeArray<number | _yamada_ui_utils.StringLiteral>) | undefined;
|
99
|
-
}[];
|
100
|
-
getPieProps: RequiredChartPropGetter<"div", Partial<Recharts.PieProps> & {
|
101
|
-
labelClassName: string;
|
102
|
-
labelLineClassName: string;
|
103
|
-
}, Omit<Recharts.PieProps, "ref">>;
|
104
|
-
getPieChartProps: ChartPropGetter<"div", recharts_types_chart_generateCategoricalChart.CategoricalChartProps, recharts_types_chart_generateCategoricalChart.CategoricalChartProps>;
|
105
|
-
getCellProps: RequiredChartPropGetter<"div", Omit<Recharts.CellProps, "ref"> & {
|
106
|
-
index: number;
|
107
|
-
}, Omit<Recharts.CellProps, "ref">>;
|
108
|
-
setHighlightedArea: react.Dispatch<react.SetStateAction<string | null>>;
|
109
|
-
};
|
110
|
-
type UsePieChartReturn = ReturnType<typeof usePieChart>;
|
111
|
-
|
112
|
-
export { type UsePieChartOptions, type UsePieChartReturn, usePieChart };
|