@yamada-ui/charts 1.4.0-dev-20240805133030 → 1.4.0-dev-20240805233134
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/bar-chart.d.mts +1 -0
- package/dist/bar-chart.d.ts +1 -0
- package/dist/bar-chart.js +61 -35
- package/dist/bar-chart.js.map +1 -1
- package/dist/bar-chart.mjs +2 -2
- package/dist/chart.types.js.map +1 -1
- package/dist/{chunk-DCILG4RR.mjs → chunk-6ICKO7GY.mjs} +40 -9
- package/dist/chunk-6ICKO7GY.mjs.map +1 -0
- package/dist/{chunk-OHTXO2ZF.mjs → chunk-QNX4DJVS.mjs} +5 -16
- package/dist/chunk-QNX4DJVS.mjs.map +1 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +158 -127
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -2
- package/dist/index.mjs.map +1 -1
- package/dist/use-bar-chart.d.mts +15 -2
- package/dist/use-bar-chart.d.ts +15 -2
- package/dist/use-bar-chart.js +38 -2
- package/dist/use-bar-chart.js.map +1 -1
- package/dist/use-bar-chart.mjs +1 -1
- package/package.json +2 -2
- package/dist/chunk-DCILG4RR.mjs.map +0 -1
- package/dist/chunk-OHTXO2ZF.mjs.map +0 -1
package/dist/index.js
CHANGED
@@ -23,6 +23,7 @@ var src_exports = {};
|
|
23
23
|
__export(src_exports, {
|
24
24
|
AreaChart: () => AreaChart,
|
25
25
|
BarChart: () => BarChart,
|
26
|
+
ChartCell: () => import_recharts8.Cell,
|
26
27
|
DonutChart: () => DonutChart,
|
27
28
|
LineChart: () => LineChart,
|
28
29
|
PieChart: () => PieChart,
|
@@ -1423,12 +1424,14 @@ var LineChart = (0, import_core10.forwardRef)((props, ref) => {
|
|
1423
1424
|
var import_core12 = require("@yamada-ui/core");
|
1424
1425
|
var import_utils13 = require("@yamada-ui/utils");
|
1425
1426
|
var import_react10 = require("react");
|
1426
|
-
var
|
1427
|
+
var import_recharts3 = require("recharts");
|
1427
1428
|
|
1428
|
-
// src/use-bar-chart.
|
1429
|
+
// src/use-bar-chart.tsx
|
1429
1430
|
var import_core11 = require("@yamada-ui/core");
|
1430
1431
|
var import_utils12 = require("@yamada-ui/utils");
|
1431
1432
|
var import_react9 = require("react");
|
1433
|
+
var import_recharts2 = require("recharts");
|
1434
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
1432
1435
|
var useBarChart = ({
|
1433
1436
|
data,
|
1434
1437
|
series,
|
@@ -1440,6 +1443,7 @@ var useBarChart = ({
|
|
1440
1443
|
xAxisLabel,
|
1441
1444
|
yAxisLabel,
|
1442
1445
|
styles,
|
1446
|
+
cell = defaultBarCell,
|
1443
1447
|
...rest
|
1444
1448
|
}) => {
|
1445
1449
|
var _a;
|
@@ -1596,6 +1600,22 @@ var useBarChart = ({
|
|
1596
1600
|
},
|
1597
1601
|
[barPropsList, stacked]
|
1598
1602
|
);
|
1603
|
+
const bars = (0, import_react9.useMemo)(() => {
|
1604
|
+
const hasStack = series.some((entry) => entry.stackId);
|
1605
|
+
return series.map((series2, index) => {
|
1606
|
+
const { dataKey } = series2;
|
1607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
1608
|
+
import_recharts2.Bar,
|
1609
|
+
{
|
1610
|
+
...getBarProps({ index, className: "ui-bar-chart__bar" }),
|
1611
|
+
children: data.map(
|
1612
|
+
(data2, index2) => (0, import_utils12.runIfFunc)(cell, { series: series2, data: data2, index: index2, hasStack })
|
1613
|
+
)
|
1614
|
+
},
|
1615
|
+
`bar-${dataKey}`
|
1616
|
+
);
|
1617
|
+
});
|
1618
|
+
}, [series, getBarProps, cell, data]);
|
1599
1619
|
const getBarChartProps = (0, import_react9.useCallback)(
|
1600
1620
|
({ className, ...props } = {}, ref = null) => ({
|
1601
1621
|
ref,
|
@@ -1624,15 +1644,32 @@ var useBarChart = ({
|
|
1624
1644
|
]
|
1625
1645
|
);
|
1626
1646
|
return {
|
1647
|
+
bars,
|
1627
1648
|
barVars,
|
1628
1649
|
getBarProps,
|
1629
1650
|
getBarChartProps,
|
1630
1651
|
setHighlightedArea
|
1631
1652
|
};
|
1632
1653
|
};
|
1654
|
+
var defaultBarCell = ({
|
1655
|
+
hasStack,
|
1656
|
+
series,
|
1657
|
+
data,
|
1658
|
+
index
|
1659
|
+
}) => {
|
1660
|
+
const { dataKey } = series;
|
1661
|
+
const key = `cell-${dataKey}-${index}`;
|
1662
|
+
if (!hasStack) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_recharts2.Cell, {}, key);
|
1663
|
+
const keys = Object.keys(data);
|
1664
|
+
const values = Object.values(data);
|
1665
|
+
const currentIndex = keys.findIndex((key2) => key2 === dataKey);
|
1666
|
+
const lastIndex = values.findLastIndex((value) => value !== 0);
|
1667
|
+
if (currentIndex === lastIndex) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_recharts2.Cell, {}, key);
|
1668
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_recharts2.Cell, { radius: 0 }, key);
|
1669
|
+
};
|
1633
1670
|
|
1634
1671
|
// src/bar-chart.tsx
|
1635
|
-
var
|
1672
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
1636
1673
|
var BarChart = (0, import_core12.forwardRef)((props, ref) => {
|
1637
1674
|
const [styles, mergedProps] = (0, import_core12.useMultiComponentStyle)("BarChart", props);
|
1638
1675
|
const {
|
@@ -1670,11 +1707,13 @@ var BarChart = (0, import_core12.forwardRef)((props, ref) => {
|
|
1670
1707
|
fillOpacity,
|
1671
1708
|
chartProps,
|
1672
1709
|
syncId,
|
1710
|
+
cell,
|
1673
1711
|
...rest
|
1674
1712
|
} = (0, import_core12.omitThemeProps)(mergedProps);
|
1675
|
-
const {
|
1713
|
+
const { bars, barVars, getBarChartProps, setHighlightedArea } = useBarChart({
|
1676
1714
|
data,
|
1677
1715
|
series,
|
1716
|
+
cell,
|
1678
1717
|
type,
|
1679
1718
|
layoutType,
|
1680
1719
|
chartProps,
|
@@ -1729,21 +1768,9 @@ var BarChart = (0, import_core12.forwardRef)((props, ref) => {
|
|
1729
1768
|
const { legendProps: computedLegendProps, getLegendProps } = useChartLegend({
|
1730
1769
|
legendProps
|
1731
1770
|
});
|
1732
|
-
const bars = (0, import_react10.useMemo)(
|
1733
|
-
() => series.map(({ dataKey: dataKey2 }, index) => {
|
1734
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
1735
|
-
import_recharts2.Bar,
|
1736
|
-
{
|
1737
|
-
...getBarProps({ index, className: "ui-bar-chart__bar" })
|
1738
|
-
},
|
1739
|
-
`bar-${dataKey2}`
|
1740
|
-
);
|
1741
|
-
}),
|
1742
|
-
[getBarProps, series]
|
1743
|
-
);
|
1744
1771
|
const referenceLinesItems = (0, import_react10.useMemo)(
|
1745
|
-
() => referenceLineProps.map((_, index) => /* @__PURE__ */ (0,
|
1746
|
-
|
1772
|
+
() => referenceLineProps.map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
1773
|
+
import_recharts3.ReferenceLine,
|
1747
1774
|
{
|
1748
1775
|
...getReferenceLineProps({
|
1749
1776
|
index,
|
@@ -1754,7 +1781,7 @@ var BarChart = (0, import_core12.forwardRef)((props, ref) => {
|
|
1754
1781
|
)),
|
1755
1782
|
[getReferenceLineProps, referenceLineProps]
|
1756
1783
|
);
|
1757
|
-
return /* @__PURE__ */ (0,
|
1784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ChartProvider, { value: { styles }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
1758
1785
|
import_core12.ui.div,
|
1759
1786
|
{
|
1760
1787
|
ref,
|
@@ -1762,41 +1789,41 @@ var BarChart = (0, import_core12.forwardRef)((props, ref) => {
|
|
1762
1789
|
var: barVars,
|
1763
1790
|
__css: { maxW: "full", ...styles.container },
|
1764
1791
|
...rest,
|
1765
|
-
children: /* @__PURE__ */ (0,
|
1766
|
-
|
1792
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
1793
|
+
import_recharts3.ResponsiveContainer,
|
1767
1794
|
{
|
1768
1795
|
...getContainerProps({ className: "ui-bar-chart__container" }),
|
1769
|
-
children: /* @__PURE__ */ (0,
|
1770
|
-
|
1796
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
1797
|
+
import_recharts3.BarChart,
|
1771
1798
|
{
|
1772
1799
|
...getBarChartProps({ className: "ui-bar-chart__chart" }),
|
1773
1800
|
children: [
|
1774
|
-
/* @__PURE__ */ (0,
|
1775
|
-
|
1801
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
1802
|
+
import_recharts3.CartesianGrid,
|
1776
1803
|
{
|
1777
1804
|
...getGridProps({ className: "ui-bar-chart__grid" })
|
1778
1805
|
}
|
1779
1806
|
),
|
1780
|
-
/* @__PURE__ */ (0,
|
1781
|
-
|
1807
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_recharts3.XAxis, { ...getXAxisProps({ className: "ui-bar-chart__x-axis" }), children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
1808
|
+
import_recharts3.Label,
|
1782
1809
|
{
|
1783
1810
|
...getXAxisLabelProps({
|
1784
1811
|
className: "ui-bar-chart__x-axis-label"
|
1785
1812
|
})
|
1786
1813
|
}
|
1787
1814
|
) }),
|
1788
|
-
/* @__PURE__ */ (0,
|
1789
|
-
|
1815
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_recharts3.YAxis, { ...getYAxisProps({ className: "ui-bar-chart__y-axis" }), children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
1816
|
+
import_recharts3.Label,
|
1790
1817
|
{
|
1791
1818
|
...getYAxisLabelProps({
|
1792
1819
|
className: "ui-bar-chart__y-axis-label"
|
1793
1820
|
})
|
1794
1821
|
}
|
1795
1822
|
) }),
|
1796
|
-
withLegend ? /* @__PURE__ */ (0,
|
1797
|
-
|
1823
|
+
withLegend ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
1824
|
+
import_recharts3.Legend,
|
1798
1825
|
{
|
1799
|
-
content: ({ payload }) => /* @__PURE__ */ (0,
|
1826
|
+
content: ({ payload }) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
1800
1827
|
ChartLegend,
|
1801
1828
|
{
|
1802
1829
|
className: "ui-bar-chart__legend",
|
@@ -1808,10 +1835,10 @@ var BarChart = (0, import_core12.forwardRef)((props, ref) => {
|
|
1808
1835
|
...getLegendProps()
|
1809
1836
|
}
|
1810
1837
|
) : null,
|
1811
|
-
withTooltip ? /* @__PURE__ */ (0,
|
1812
|
-
|
1838
|
+
withTooltip ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
1839
|
+
import_recharts3.Tooltip,
|
1813
1840
|
{
|
1814
|
-
content: ({ label, payload }) => /* @__PURE__ */ (0,
|
1841
|
+
content: ({ label, payload }) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
1815
1842
|
ChartTooltip,
|
1816
1843
|
{
|
1817
1844
|
className: "ui-bar-chart__tooltip",
|
@@ -1841,10 +1868,10 @@ var BarChart = (0, import_core12.forwardRef)((props, ref) => {
|
|
1841
1868
|
var import_core14 = require("@yamada-ui/core");
|
1842
1869
|
var import_utils15 = require("@yamada-ui/utils");
|
1843
1870
|
var import_react12 = require("react");
|
1844
|
-
var
|
1871
|
+
var import_recharts4 = require("recharts");
|
1845
1872
|
|
1846
1873
|
// src/area-chart-gradient.tsx
|
1847
|
-
var
|
1874
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
1848
1875
|
var AreaGradient = ({
|
1849
1876
|
color,
|
1850
1877
|
id,
|
@@ -1852,20 +1879,20 @@ var AreaGradient = ({
|
|
1852
1879
|
fillOpacity
|
1853
1880
|
}) => {
|
1854
1881
|
if (withGradient) {
|
1855
|
-
return /* @__PURE__ */ (0,
|
1856
|
-
/* @__PURE__ */ (0,
|
1857
|
-
/* @__PURE__ */ (0,
|
1882
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("linearGradient", { id, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
1883
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("stop", { offset: "0%", stopColor: color, stopOpacity: fillOpacity }),
|
1884
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("stop", { offset: "100%", stopColor: color, stopOpacity: 0.01 })
|
1858
1885
|
] });
|
1859
1886
|
} else {
|
1860
|
-
return /* @__PURE__ */ (0,
|
1887
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("linearGradient", { id, x1: "0", y1: "0", x2: "0", y2: "1", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("stop", { stopColor: color, stopOpacity: fillOpacity }) });
|
1861
1888
|
}
|
1862
1889
|
};
|
1863
1890
|
|
1864
1891
|
// src/area-chart-split.tsx
|
1865
|
-
var
|
1892
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
1866
1893
|
var AreaSplit = ({ offset, id, fillOpacity }) => {
|
1867
|
-
return /* @__PURE__ */ (0,
|
1868
|
-
/* @__PURE__ */ (0,
|
1894
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("linearGradient", { id, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
1895
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
1869
1896
|
"stop",
|
1870
1897
|
{
|
1871
1898
|
offset,
|
@@ -1873,7 +1900,7 @@ var AreaSplit = ({ offset, id, fillOpacity }) => {
|
|
1873
1900
|
stopOpacity: fillOpacity != null ? fillOpacity : 0.4
|
1874
1901
|
}
|
1875
1902
|
),
|
1876
|
-
/* @__PURE__ */ (0,
|
1903
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
1877
1904
|
"stop",
|
1878
1905
|
{
|
1879
1906
|
offset,
|
@@ -2211,7 +2238,7 @@ var useAreaChart = ({
|
|
2211
2238
|
};
|
2212
2239
|
|
2213
2240
|
// src/area-chart.tsx
|
2214
|
-
var
|
2241
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
2215
2242
|
var AreaChart = (0, import_core14.forwardRef)((props, ref) => {
|
2216
2243
|
const [styles, mergedProps] = (0, import_core14.useMultiComponentStyle)("AreaChart", props);
|
2217
2244
|
const {
|
@@ -2337,16 +2364,16 @@ var AreaChart = (0, import_core14.forwardRef)((props, ref) => {
|
|
2337
2364
|
index,
|
2338
2365
|
className: "ui-area-chart__area"
|
2339
2366
|
});
|
2340
|
-
return /* @__PURE__ */ (0,
|
2341
|
-
/* @__PURE__ */ (0,
|
2342
|
-
/* @__PURE__ */ (0,
|
2367
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react12.Fragment, { children: [
|
2368
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AreaGradient, { ...getAreaGradientProps({ id, color: stroke }) }) }),
|
2369
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_recharts4.Area, { id, stroke, ...rest2 })
|
2343
2370
|
] }, `area-${dataKey2}`);
|
2344
2371
|
}),
|
2345
2372
|
[getAreaGradientProps, getAreaProps, series]
|
2346
2373
|
);
|
2347
2374
|
const referenceLinesItems = (0, import_react12.useMemo)(
|
2348
|
-
() => referenceLineProps.map((_, index) => /* @__PURE__ */ (0,
|
2349
|
-
|
2375
|
+
() => referenceLineProps.map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
2376
|
+
import_recharts4.ReferenceLine,
|
2350
2377
|
{
|
2351
2378
|
...getReferenceLineProps({
|
2352
2379
|
index,
|
@@ -2357,7 +2384,7 @@ var AreaChart = (0, import_core14.forwardRef)((props, ref) => {
|
|
2357
2384
|
)),
|
2358
2385
|
[getReferenceLineProps, referenceLineProps]
|
2359
2386
|
);
|
2360
|
-
return /* @__PURE__ */ (0,
|
2387
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ChartProvider, { value: { styles }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
2361
2388
|
import_core14.ui.div,
|
2362
2389
|
{
|
2363
2390
|
ref,
|
@@ -2365,41 +2392,41 @@ var AreaChart = (0, import_core14.forwardRef)((props, ref) => {
|
|
2365
2392
|
var: areaVars,
|
2366
2393
|
__css: { maxW: "full", ...styles.container },
|
2367
2394
|
...rest,
|
2368
|
-
children: /* @__PURE__ */ (0,
|
2369
|
-
|
2395
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
2396
|
+
import_recharts4.ResponsiveContainer,
|
2370
2397
|
{
|
2371
2398
|
...getContainerProps({ className: "ui-area-chart__container" }),
|
2372
|
-
children: /* @__PURE__ */ (0,
|
2373
|
-
|
2399
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
2400
|
+
import_recharts4.AreaChart,
|
2374
2401
|
{
|
2375
2402
|
...getAreaChartProps({ className: "ui-area-chart__chart" }),
|
2376
2403
|
children: [
|
2377
|
-
/* @__PURE__ */ (0,
|
2378
|
-
|
2404
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
2405
|
+
import_recharts4.CartesianGrid,
|
2379
2406
|
{
|
2380
2407
|
...getGridProps({ className: "ui-area-chart__grid" })
|
2381
2408
|
}
|
2382
2409
|
),
|
2383
|
-
/* @__PURE__ */ (0,
|
2384
|
-
|
2410
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_recharts4.XAxis, { ...getXAxisProps({ className: "ui-area-chart__x-axis" }), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
2411
|
+
import_recharts4.Label,
|
2385
2412
|
{
|
2386
2413
|
...getXAxisLabelProps({
|
2387
2414
|
className: "ui-area-chart__x-axis-label"
|
2388
2415
|
})
|
2389
2416
|
}
|
2390
2417
|
) }),
|
2391
|
-
/* @__PURE__ */ (0,
|
2392
|
-
|
2418
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_recharts4.YAxis, { ...getYAxisProps({ className: "ui-area-chart__y-axis" }), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
2419
|
+
import_recharts4.Label,
|
2393
2420
|
{
|
2394
2421
|
...getYAxisLabelProps({
|
2395
2422
|
className: "ui-area-chart__y-axis-label"
|
2396
2423
|
})
|
2397
2424
|
}
|
2398
2425
|
) }),
|
2399
|
-
withLegend ? /* @__PURE__ */ (0,
|
2400
|
-
|
2426
|
+
withLegend ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
2427
|
+
import_recharts4.Legend,
|
2401
2428
|
{
|
2402
|
-
content: ({ payload }) => /* @__PURE__ */ (0,
|
2429
|
+
content: ({ payload }) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
2403
2430
|
ChartLegend,
|
2404
2431
|
{
|
2405
2432
|
className: "ui-area-chart__legend",
|
@@ -2411,10 +2438,10 @@ var AreaChart = (0, import_core14.forwardRef)((props, ref) => {
|
|
2411
2438
|
...getLegendProps()
|
2412
2439
|
}
|
2413
2440
|
) : null,
|
2414
|
-
withTooltip ? /* @__PURE__ */ (0,
|
2415
|
-
|
2441
|
+
withTooltip ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
2442
|
+
import_recharts4.Tooltip,
|
2416
2443
|
{
|
2417
|
-
content: ({ label, payload }) => /* @__PURE__ */ (0,
|
2444
|
+
content: ({ label, payload }) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
2418
2445
|
ChartTooltip,
|
2419
2446
|
{
|
2420
2447
|
className: "ui-area-chart__tooltip",
|
@@ -2429,7 +2456,7 @@ var AreaChart = (0, import_core14.forwardRef)((props, ref) => {
|
|
2429
2456
|
...getTooltipProps()
|
2430
2457
|
}
|
2431
2458
|
) : null,
|
2432
|
-
type === "split" ? /* @__PURE__ */ (0,
|
2459
|
+
type === "split" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AreaSplit, { ...getAreaSplitProps() }) }) : null,
|
2433
2460
|
areas,
|
2434
2461
|
referenceLinesItems
|
2435
2462
|
]
|
@@ -2445,7 +2472,7 @@ var AreaChart = (0, import_core14.forwardRef)((props, ref) => {
|
|
2445
2472
|
var import_core16 = require("@yamada-ui/core");
|
2446
2473
|
var import_utils17 = require("@yamada-ui/utils");
|
2447
2474
|
var import_react14 = require("react");
|
2448
|
-
var
|
2475
|
+
var import_recharts5 = require("recharts");
|
2449
2476
|
|
2450
2477
|
// src/use-radar-chart.ts
|
2451
2478
|
var import_core15 = require("@yamada-ui/core");
|
@@ -2775,7 +2802,7 @@ var useRadarChart = ({
|
|
2775
2802
|
};
|
2776
2803
|
|
2777
2804
|
// src/radar-chart.tsx
|
2778
|
-
var
|
2805
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
2779
2806
|
var RadarChart = (0, import_core16.forwardRef)((props, ref) => {
|
2780
2807
|
const [styles, mergedProps] = (0, import_core16.useMultiComponentStyle)("RadarChart", props);
|
2781
2808
|
const {
|
@@ -2848,8 +2875,8 @@ var RadarChart = (0, import_core16.forwardRef)((props, ref) => {
|
|
2848
2875
|
legendProps
|
2849
2876
|
});
|
2850
2877
|
const radars = (0, import_react14.useMemo)(
|
2851
|
-
() => series.map(({ dataKey: dataKey2 }, index) => /* @__PURE__ */ (0,
|
2852
|
-
|
2878
|
+
() => series.map(({ dataKey: dataKey2 }, index) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
2879
|
+
import_recharts5.Radar,
|
2853
2880
|
{
|
2854
2881
|
...getRadarProps({ index, className: "ui-radar-chart__radar" })
|
2855
2882
|
},
|
@@ -2857,7 +2884,7 @@ var RadarChart = (0, import_core16.forwardRef)((props, ref) => {
|
|
2857
2884
|
)),
|
2858
2885
|
[getRadarProps, series]
|
2859
2886
|
);
|
2860
|
-
return /* @__PURE__ */ (0,
|
2887
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ChartProvider, { value: { styles }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
2861
2888
|
import_core16.ui.div,
|
2862
2889
|
{
|
2863
2890
|
ref,
|
@@ -2865,43 +2892,43 @@ var RadarChart = (0, import_core16.forwardRef)((props, ref) => {
|
|
2865
2892
|
var: radarVars,
|
2866
2893
|
__css: { maxW: "full", ...styles.container },
|
2867
2894
|
...rest,
|
2868
|
-
children: /* @__PURE__ */ (0,
|
2869
|
-
|
2895
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
2896
|
+
import_recharts5.ResponsiveContainer,
|
2870
2897
|
{
|
2871
2898
|
...getContainerProps({ className: "ui-radar-chart__container" }),
|
2872
|
-
children: /* @__PURE__ */ (0,
|
2873
|
-
|
2899
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
2900
|
+
import_recharts5.RadarChart,
|
2874
2901
|
{
|
2875
2902
|
...getRadarChartProps({ className: "ui-radar-chart__chart" }),
|
2876
2903
|
children: [
|
2877
|
-
withPolarGrid ? /* @__PURE__ */ (0,
|
2878
|
-
|
2904
|
+
withPolarGrid ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
2905
|
+
import_recharts5.PolarGrid,
|
2879
2906
|
{
|
2880
2907
|
...getPolarGridProps({
|
2881
2908
|
className: "ui-radar-chart__polar-grid"
|
2882
2909
|
})
|
2883
2910
|
}
|
2884
2911
|
) : null,
|
2885
|
-
withPolarAngleAxis ? /* @__PURE__ */ (0,
|
2886
|
-
|
2912
|
+
withPolarAngleAxis ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
2913
|
+
import_recharts5.PolarAngleAxis,
|
2887
2914
|
{
|
2888
2915
|
...getPolarAngleAxisProps({
|
2889
2916
|
className: "ui-radar-chart__polar-angle-axis"
|
2890
2917
|
})
|
2891
2918
|
}
|
2892
2919
|
) : null,
|
2893
|
-
withPolarRadiusAxis ? /* @__PURE__ */ (0,
|
2894
|
-
|
2920
|
+
withPolarRadiusAxis ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
2921
|
+
import_recharts5.PolarRadiusAxis,
|
2895
2922
|
{
|
2896
2923
|
...getPolarRadiusAxisProps({
|
2897
2924
|
className: "ui-radar-chart__polar-radius-axis"
|
2898
2925
|
})
|
2899
2926
|
}
|
2900
2927
|
) : null,
|
2901
|
-
withLegend ? /* @__PURE__ */ (0,
|
2902
|
-
|
2928
|
+
withLegend ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
2929
|
+
import_recharts5.Legend,
|
2903
2930
|
{
|
2904
|
-
content: ({ payload }) => /* @__PURE__ */ (0,
|
2931
|
+
content: ({ payload }) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
2905
2932
|
ChartLegend,
|
2906
2933
|
{
|
2907
2934
|
className: "ui-area-chart__legend",
|
@@ -2913,10 +2940,10 @@ var RadarChart = (0, import_core16.forwardRef)((props, ref) => {
|
|
2913
2940
|
...getLegendProps()
|
2914
2941
|
}
|
2915
2942
|
) : null,
|
2916
|
-
withTooltip ? /* @__PURE__ */ (0,
|
2917
|
-
|
2943
|
+
withTooltip ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
2944
|
+
import_recharts5.Tooltip,
|
2918
2945
|
{
|
2919
|
-
content: ({ label, payload }) => /* @__PURE__ */ (0,
|
2946
|
+
content: ({ label, payload }) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
2920
2947
|
ChartTooltip,
|
2921
2948
|
{
|
2922
2949
|
className: "ui-line-chart__tooltip",
|
@@ -2944,7 +2971,7 @@ var RadarChart = (0, import_core16.forwardRef)((props, ref) => {
|
|
2944
2971
|
var import_core19 = require("@yamada-ui/core");
|
2945
2972
|
var import_utils20 = require("@yamada-ui/utils");
|
2946
2973
|
var import_react16 = require("react");
|
2947
|
-
var
|
2974
|
+
var import_recharts6 = require("recharts");
|
2948
2975
|
|
2949
2976
|
// src/use-pie-chart.ts
|
2950
2977
|
var import_core18 = require("@yamada-ui/core");
|
@@ -2954,7 +2981,7 @@ var import_react15 = require("react");
|
|
2954
2981
|
// src/pie-chart-label.tsx
|
2955
2982
|
var import_core17 = require("@yamada-ui/core");
|
2956
2983
|
var import_utils18 = require("@yamada-ui/utils");
|
2957
|
-
var
|
2984
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
2958
2985
|
var RADIAN = Math.PI / 180;
|
2959
2986
|
var DEFAULT_LABEL_OFFSET = 22;
|
2960
2987
|
var pieChartLabel = ({
|
@@ -2986,7 +3013,7 @@ var pieChartLabel = ({
|
|
2986
3013
|
return value;
|
2987
3014
|
}
|
2988
3015
|
};
|
2989
|
-
return /* @__PURE__ */ (0,
|
3016
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
2990
3017
|
import_core17.ui.text,
|
2991
3018
|
{
|
2992
3019
|
className: (0, import_utils18.cx)(cellClassName, "ui-chart__label"),
|
@@ -3017,7 +3044,7 @@ var pieChartLabelLine = ({
|
|
3017
3044
|
const x = cxProp + (middleRadius + labelOffset) * Math.cos(-midAngle * RADIAN);
|
3018
3045
|
const y = cyProp + (middleRadius + labelOffset) * Math.sin(-midAngle * RADIAN);
|
3019
3046
|
const d = `M ${points[0].x} ${points[0].y} L ${x} ${y}`;
|
3020
|
-
return /* @__PURE__ */ (0,
|
3047
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
3021
3048
|
import_core17.ui.path,
|
3022
3049
|
{
|
3023
3050
|
className: (0, import_utils18.cx)(cellClassName, "ui-chart__label-line"),
|
@@ -3239,7 +3266,7 @@ var usePieChart = ({
|
|
3239
3266
|
};
|
3240
3267
|
|
3241
3268
|
// src/donut-chart.tsx
|
3242
|
-
var
|
3269
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
3243
3270
|
var DonutChart = (0, import_core19.forwardRef)((props, ref) => {
|
3244
3271
|
const [styles, mergedProps] = (0, import_core19.useMultiComponentStyle)("DonutChart", props);
|
3245
3272
|
const {
|
@@ -3304,8 +3331,8 @@ var DonutChart = (0, import_core19.forwardRef)((props, ref) => {
|
|
3304
3331
|
legendProps
|
3305
3332
|
});
|
3306
3333
|
const cells = (0, import_react16.useMemo)(
|
3307
|
-
() => data.map(({ name }, index) => /* @__PURE__ */ (0,
|
3308
|
-
|
3334
|
+
() => data.map(({ name }, index) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
3335
|
+
import_recharts6.Cell,
|
3309
3336
|
{
|
3310
3337
|
...getCellProps({ index, className: "ui-donut-chart__cell" })
|
3311
3338
|
},
|
@@ -3313,7 +3340,7 @@ var DonutChart = (0, import_core19.forwardRef)((props, ref) => {
|
|
3313
3340
|
)),
|
3314
3341
|
[data, getCellProps]
|
3315
3342
|
);
|
3316
|
-
return /* @__PURE__ */ (0,
|
3343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ChartProvider, { value: { styles }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
3317
3344
|
import_core19.ui.div,
|
3318
3345
|
{
|
3319
3346
|
ref,
|
@@ -3321,17 +3348,17 @@ var DonutChart = (0, import_core19.forwardRef)((props, ref) => {
|
|
3321
3348
|
var: pieVars,
|
3322
3349
|
__css: { maxW: "full", ...styles.container },
|
3323
3350
|
...rest,
|
3324
|
-
children: /* @__PURE__ */ (0,
|
3325
|
-
|
3351
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
3352
|
+
import_recharts6.ResponsiveContainer,
|
3326
3353
|
{
|
3327
3354
|
...getContainerProps({ className: "ui-donut-chart__container" }),
|
3328
|
-
children: /* @__PURE__ */ (0,
|
3329
|
-
|
3355
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
3356
|
+
import_recharts6.PieChart,
|
3330
3357
|
{
|
3331
3358
|
...getPieChartProps({ className: "ui-donut-chart__chart" }),
|
3332
3359
|
children: [
|
3333
|
-
/* @__PURE__ */ (0,
|
3334
|
-
|
3360
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
3361
|
+
import_recharts6.Pie,
|
3335
3362
|
{
|
3336
3363
|
...getPieProps({
|
3337
3364
|
className: "ui-donut-chart__donut"
|
@@ -3339,10 +3366,10 @@ var DonutChart = (0, import_core19.forwardRef)((props, ref) => {
|
|
3339
3366
|
children: cells
|
3340
3367
|
}
|
3341
3368
|
),
|
3342
|
-
withLegend ? /* @__PURE__ */ (0,
|
3343
|
-
|
3369
|
+
withLegend ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
3370
|
+
import_recharts6.Legend,
|
3344
3371
|
{
|
3345
|
-
content: ({ payload }) => /* @__PURE__ */ (0,
|
3372
|
+
content: ({ payload }) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
3346
3373
|
ChartLegend,
|
3347
3374
|
{
|
3348
3375
|
className: "ui-donut-chart__legend",
|
@@ -3354,10 +3381,10 @@ var DonutChart = (0, import_core19.forwardRef)((props, ref) => {
|
|
3354
3381
|
...getLegendProps()
|
3355
3382
|
}
|
3356
3383
|
) : null,
|
3357
|
-
withTooltip ? /* @__PURE__ */ (0,
|
3358
|
-
|
3384
|
+
withTooltip ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
3385
|
+
import_recharts6.Tooltip,
|
3359
3386
|
{
|
3360
|
-
content: ({ label, payload }) => /* @__PURE__ */ (0,
|
3387
|
+
content: ({ label, payload }) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
3361
3388
|
ChartTooltip,
|
3362
3389
|
{
|
3363
3390
|
className: "ui-donut-chart__tooltip",
|
@@ -3384,8 +3411,8 @@ var DonutChart = (0, import_core19.forwardRef)((props, ref) => {
|
|
3384
3411
|
var import_core20 = require("@yamada-ui/core");
|
3385
3412
|
var import_utils21 = require("@yamada-ui/utils");
|
3386
3413
|
var import_react17 = require("react");
|
3387
|
-
var
|
3388
|
-
var
|
3414
|
+
var import_recharts7 = require("recharts");
|
3415
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
3389
3416
|
var PieChart = (0, import_core20.forwardRef)((props, ref) => {
|
3390
3417
|
const [styles, mergedProps] = (0, import_core20.useMultiComponentStyle)("PieChart", props);
|
3391
3418
|
const {
|
@@ -3450,8 +3477,8 @@ var PieChart = (0, import_core20.forwardRef)((props, ref) => {
|
|
3450
3477
|
legendProps
|
3451
3478
|
});
|
3452
3479
|
const cells = (0, import_react17.useMemo)(
|
3453
|
-
() => data.map(({ name }, index) => /* @__PURE__ */ (0,
|
3454
|
-
|
3480
|
+
() => data.map(({ name }, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
3481
|
+
import_recharts7.Cell,
|
3455
3482
|
{
|
3456
3483
|
...getCellProps({ index, className: "ui-pie-chart__cell" })
|
3457
3484
|
},
|
@@ -3459,7 +3486,7 @@ var PieChart = (0, import_core20.forwardRef)((props, ref) => {
|
|
3459
3486
|
)),
|
3460
3487
|
[data, getCellProps]
|
3461
3488
|
);
|
3462
|
-
return /* @__PURE__ */ (0,
|
3489
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ChartProvider, { value: { styles }, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
3463
3490
|
import_core20.ui.div,
|
3464
3491
|
{
|
3465
3492
|
ref,
|
@@ -3467,17 +3494,17 @@ var PieChart = (0, import_core20.forwardRef)((props, ref) => {
|
|
3467
3494
|
var: pieVars,
|
3468
3495
|
__css: { maxW: "full", ...styles.container },
|
3469
3496
|
...rest,
|
3470
|
-
children: /* @__PURE__ */ (0,
|
3471
|
-
|
3497
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
3498
|
+
import_recharts7.ResponsiveContainer,
|
3472
3499
|
{
|
3473
3500
|
...getContainerProps({ className: "ui-pie-chart__container" }),
|
3474
|
-
children: /* @__PURE__ */ (0,
|
3475
|
-
|
3501
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
3502
|
+
import_recharts7.PieChart,
|
3476
3503
|
{
|
3477
3504
|
...getPieChartProps({ className: "ui-pie-chart__chart" }),
|
3478
3505
|
children: [
|
3479
|
-
/* @__PURE__ */ (0,
|
3480
|
-
|
3506
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
3507
|
+
import_recharts7.Pie,
|
3481
3508
|
{
|
3482
3509
|
...getPieProps({
|
3483
3510
|
className: "ui-pie-chart__pie"
|
@@ -3485,10 +3512,10 @@ var PieChart = (0, import_core20.forwardRef)((props, ref) => {
|
|
3485
3512
|
children: cells
|
3486
3513
|
}
|
3487
3514
|
),
|
3488
|
-
withLegend ? /* @__PURE__ */ (0,
|
3489
|
-
|
3515
|
+
withLegend ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
3516
|
+
import_recharts7.Legend,
|
3490
3517
|
{
|
3491
|
-
content: ({ payload }) => /* @__PURE__ */ (0,
|
3518
|
+
content: ({ payload }) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
3492
3519
|
ChartLegend,
|
3493
3520
|
{
|
3494
3521
|
className: "ui-pie-chart__legend",
|
@@ -3500,10 +3527,10 @@ var PieChart = (0, import_core20.forwardRef)((props, ref) => {
|
|
3500
3527
|
...getLegendProps()
|
3501
3528
|
}
|
3502
3529
|
) : null,
|
3503
|
-
withTooltip ? /* @__PURE__ */ (0,
|
3504
|
-
|
3530
|
+
withTooltip ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
3531
|
+
import_recharts7.Tooltip,
|
3505
3532
|
{
|
3506
|
-
content: ({ label, payload }) => /* @__PURE__ */ (0,
|
3533
|
+
content: ({ label, payload }) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
3507
3534
|
ChartTooltip,
|
3508
3535
|
{
|
3509
3536
|
className: "ui-pie-chart__tooltip",
|
@@ -3525,10 +3552,14 @@ var PieChart = (0, import_core20.forwardRef)((props, ref) => {
|
|
3525
3552
|
}
|
3526
3553
|
) });
|
3527
3554
|
});
|
3555
|
+
|
3556
|
+
// src/index.ts
|
3557
|
+
var import_recharts8 = require("recharts");
|
3528
3558
|
// Annotate the CommonJS export names for ESM import in node:
|
3529
3559
|
0 && (module.exports = {
|
3530
3560
|
AreaChart,
|
3531
3561
|
BarChart,
|
3562
|
+
ChartCell,
|
3532
3563
|
DonutChart,
|
3533
3564
|
LineChart,
|
3534
3565
|
PieChart,
|