@yamada-ui/charts 2.0.0-next-20240908154823 → 2.0.0-next-20240923072418
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/area-chart-gradient.d.mts +4 -4
- package/dist/area-chart-gradient.d.ts +4 -4
- package/dist/area-chart-gradient.js.map +1 -1
- package/dist/area-chart-gradient.mjs +1 -1
- package/dist/area-chart-split.d.mts +4 -4
- package/dist/area-chart-split.d.ts +4 -4
- package/dist/area-chart-split.js.map +1 -1
- package/dist/area-chart-split.mjs +1 -1
- package/dist/area-chart.d.mts +4 -4
- package/dist/area-chart.d.ts +4 -4
- package/dist/area-chart.js +1 -1
- package/dist/area-chart.js.map +1 -1
- package/dist/area-chart.mjs +12 -12
- package/dist/bar-chart.d.mts +3 -3
- package/dist/bar-chart.d.ts +3 -3
- package/dist/bar-chart.js +1 -1
- package/dist/bar-chart.js.map +1 -1
- package/dist/bar-chart.mjs +10 -10
- package/dist/chart-legend.d.mts +4 -3
- package/dist/chart-legend.d.ts +4 -3
- package/dist/chart-legend.js.map +1 -1
- package/dist/chart-legend.mjs +2 -2
- package/dist/chart-tooltip.d.mts +2 -2
- package/dist/chart-tooltip.d.ts +2 -2
- package/dist/chart-tooltip.js.map +1 -1
- package/dist/chart-tooltip.mjs +2 -2
- package/dist/chart.types.d.mts +64 -46
- package/dist/chart.types.d.ts +64 -46
- package/dist/chart.types.js.map +1 -1
- package/dist/{chunk-PPBHLDVN.mjs → chunk-2GQHI23M.mjs} +1 -1
- package/dist/chunk-2GQHI23M.mjs.map +1 -0
- package/dist/{chunk-YNJ423BR.mjs → chunk-3EHZJFIA.mjs} +1 -1
- package/dist/chunk-3EHZJFIA.mjs.map +1 -0
- package/dist/{chunk-FPFCMFCJ.mjs → chunk-4TQ4VOYH.mjs} +2 -3
- package/dist/chunk-4TQ4VOYH.mjs.map +1 -0
- package/dist/{chunk-BYL7HWNN.mjs → chunk-5A6462N5.mjs} +12 -12
- package/dist/chunk-5A6462N5.mjs.map +1 -0
- package/dist/{chunk-3AOICU4Q.mjs → chunk-A3IWA366.mjs} +1 -1
- package/dist/chunk-A3IWA366.mjs.map +1 -0
- package/dist/{chunk-SWATR7CU.mjs → chunk-AZB43WEN.mjs} +14 -14
- package/dist/chunk-AZB43WEN.mjs.map +1 -0
- package/dist/{chunk-JTQ5QCML.mjs → chunk-FYAC4RRZ.mjs} +1 -1
- package/dist/chunk-FYAC4RRZ.mjs.map +1 -0
- package/dist/{chunk-5PSRSNGH.mjs → chunk-H3B6RJ63.mjs} +1 -1
- package/dist/chunk-H3B6RJ63.mjs.map +1 -0
- package/dist/{chunk-TCSYDMC7.mjs → chunk-IJRYXT4V.mjs} +1 -1
- package/dist/chunk-IJRYXT4V.mjs.map +1 -0
- package/dist/{chunk-EL2VTGFB.mjs → chunk-LLOU2WIV.mjs} +2 -2
- package/dist/chunk-LLOU2WIV.mjs.map +1 -0
- package/dist/{chunk-MGTMKKSH.mjs → chunk-MN7T76SY.mjs} +1 -1
- package/dist/chunk-MN7T76SY.mjs.map +1 -0
- package/dist/{chunk-D5IRVU4W.mjs → chunk-MSG3WFBO.mjs} +1 -1
- package/dist/chunk-MSG3WFBO.mjs.map +1 -0
- package/dist/{chunk-KVE6VXTJ.mjs → chunk-MVRWZTQ5.mjs} +1 -1
- package/dist/chunk-MVRWZTQ5.mjs.map +1 -0
- package/dist/{chunk-MSIOYYWR.mjs → chunk-NHHJ5XFF.mjs} +1 -1
- package/dist/chunk-NHHJ5XFF.mjs.map +1 -0
- package/dist/{chunk-TMHSYM3V.mjs → chunk-NR7N3R5C.mjs} +10 -10
- package/dist/chunk-NR7N3R5C.mjs.map +1 -0
- package/dist/{chunk-ZQWVMOT6.mjs → chunk-OFD66B3S.mjs} +3 -6
- package/dist/chunk-OFD66B3S.mjs.map +1 -0
- package/dist/{chunk-VMBRDEM2.mjs → chunk-OJ2MLZZ7.mjs} +1 -1
- package/dist/chunk-OJ2MLZZ7.mjs.map +1 -0
- package/dist/{chunk-XRF3TNSQ.mjs → chunk-QGVADS6Z.mjs} +1 -1
- package/dist/chunk-QGVADS6Z.mjs.map +1 -0
- package/dist/{chunk-3VKCTSPC.mjs → chunk-RMYXEG2O.mjs} +9 -9
- package/dist/chunk-RMYXEG2O.mjs.map +1 -0
- package/dist/{chunk-T5DNDBW6.mjs → chunk-UANITMH7.mjs} +2 -2
- package/dist/chunk-UANITMH7.mjs.map +1 -0
- package/dist/{chunk-4MW4FB2T.mjs → chunk-VEFEKDMH.mjs} +1 -1
- package/dist/chunk-VEFEKDMH.mjs.map +1 -0
- package/dist/{chunk-RKO6KM3T.mjs → chunk-VFDCEQYP.mjs} +12 -12
- package/dist/chunk-VFDCEQYP.mjs.map +1 -0
- package/dist/{chunk-X7XFG7TS.mjs → chunk-VQJ6VQ45.mjs} +1 -1
- package/dist/chunk-VQJ6VQ45.mjs.map +1 -0
- package/dist/{chunk-PG7ZV76C.mjs → chunk-VUTCH2CU.mjs} +1 -1
- package/dist/chunk-VUTCH2CU.mjs.map +1 -0
- package/dist/{chunk-WMG5U5AU.mjs → chunk-W7BIYCYH.mjs} +10 -10
- package/dist/chunk-W7BIYCYH.mjs.map +1 -0
- package/dist/{chunk-3HQ2UC3I.mjs → chunk-XYUYAHJX.mjs} +1 -1
- package/dist/chunk-XYUYAHJX.mjs.map +1 -0
- package/dist/{chunk-SBPKRYF2.mjs → chunk-ZGXEF3LO.mjs} +11 -11
- package/dist/chunk-ZGXEF3LO.mjs.map +1 -0
- package/dist/donut-chart.d.mts +4 -3
- package/dist/donut-chart.d.ts +4 -3
- package/dist/donut-chart.js +1 -1
- package/dist/donut-chart.js.map +1 -1
- package/dist/donut-chart.mjs +9 -9
- package/dist/index.js +8 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -27
- package/dist/line-chart.d.mts +4 -3
- package/dist/line-chart.d.ts +4 -3
- package/dist/line-chart.js +2 -3
- package/dist/line-chart.js.map +1 -1
- package/dist/line-chart.mjs +10 -10
- package/dist/pie-chart-label.d.mts +9 -8
- package/dist/pie-chart-label.d.ts +9 -8
- package/dist/pie-chart-label.js.map +1 -1
- package/dist/pie-chart-label.mjs +1 -1
- package/dist/pie-chart.d.mts +4 -3
- package/dist/pie-chart.d.ts +4 -3
- package/dist/pie-chart.js +1 -1
- package/dist/pie-chart.js.map +1 -1
- package/dist/pie-chart.mjs +8 -8
- package/dist/radar-chart.d.mts +4 -3
- package/dist/radar-chart.d.ts +4 -3
- package/dist/radar-chart.js +1 -1
- package/dist/radar-chart.js.map +1 -1
- package/dist/radar-chart.mjs +8 -8
- package/dist/radial-chart.d.mts +4 -3
- package/dist/radial-chart.d.ts +4 -3
- package/dist/radial-chart.js +1 -1
- package/dist/radial-chart.js.map +1 -1
- package/dist/radial-chart.mjs +9 -9
- package/dist/use-area-chart.d.mts +11 -12
- package/dist/use-area-chart.d.ts +11 -12
- package/dist/use-area-chart.js.map +1 -1
- package/dist/use-area-chart.mjs +1 -1
- package/dist/use-bar-chart.d.mts +10 -10
- package/dist/use-bar-chart.d.ts +10 -10
- package/dist/use-bar-chart.js.map +1 -1
- package/dist/use-bar-chart.mjs +1 -1
- package/dist/use-chart-axis.d.mts +10 -10
- package/dist/use-chart-axis.d.ts +10 -10
- package/dist/use-chart-axis.js.map +1 -1
- package/dist/use-chart-axis.mjs +1 -1
- package/dist/use-chart-grid.d.mts +7 -7
- package/dist/use-chart-grid.d.ts +7 -7
- package/dist/use-chart-grid.js.map +1 -1
- package/dist/use-chart-grid.mjs +1 -1
- package/dist/use-chart-label-list.d.mts +8 -8
- package/dist/use-chart-label-list.d.ts +8 -8
- package/dist/use-chart-label-list.js.map +1 -1
- package/dist/use-chart-label-list.mjs +1 -1
- package/dist/use-chart-label.d.mts +7 -7
- package/dist/use-chart-label.d.ts +7 -7
- package/dist/use-chart-label.js.map +1 -1
- package/dist/use-chart-label.mjs +1 -1
- package/dist/use-chart-legend.d.mts +6 -6
- package/dist/use-chart-legend.d.ts +6 -6
- package/dist/use-chart-legend.js.map +1 -1
- package/dist/use-chart-legend.mjs +1 -1
- package/dist/use-chart-reference-line.d.mts +7 -7
- package/dist/use-chart-reference-line.d.ts +7 -7
- package/dist/use-chart-reference-line.js.map +1 -1
- package/dist/use-chart-reference-line.mjs +1 -1
- package/dist/use-chart-tooltip.d.mts +8 -8
- package/dist/use-chart-tooltip.d.ts +8 -8
- package/dist/use-chart-tooltip.js.map +1 -1
- package/dist/use-chart-tooltip.mjs +1 -1
- package/dist/use-chart.d.mts +20 -12
- package/dist/use-chart.d.ts +20 -12
- package/dist/use-chart.js.map +1 -1
- package/dist/use-chart.mjs +1 -1
- package/dist/use-line-chart.d.mts +8 -8
- package/dist/use-line-chart.d.ts +8 -8
- package/dist/use-line-chart.js +1 -2
- package/dist/use-line-chart.js.map +1 -1
- package/dist/use-line-chart.mjs +1 -1
- package/dist/use-pie-chart.d.mts +10 -10
- package/dist/use-pie-chart.d.ts +10 -10
- package/dist/use-pie-chart.js.map +1 -1
- package/dist/use-pie-chart.mjs +2 -2
- package/dist/use-polar-grid.d.mts +7 -7
- package/dist/use-polar-grid.d.ts +7 -7
- package/dist/use-polar-grid.js.map +1 -1
- package/dist/use-polar-grid.mjs +1 -1
- package/dist/use-radar-chart.d.mts +10 -10
- package/dist/use-radar-chart.d.ts +10 -10
- package/dist/use-radar-chart.js.map +1 -1
- package/dist/use-radar-chart.mjs +1 -1
- package/dist/use-radial-chart.d.mts +8 -8
- package/dist/use-radial-chart.d.ts +8 -8
- package/dist/use-radial-chart.js.map +1 -1
- package/dist/use-radial-chart.mjs +1 -1
- package/package.json +3 -3
- package/dist/chunk-3AOICU4Q.mjs.map +0 -1
- package/dist/chunk-3HQ2UC3I.mjs.map +0 -1
- package/dist/chunk-3VKCTSPC.mjs.map +0 -1
- package/dist/chunk-4MW4FB2T.mjs.map +0 -1
- package/dist/chunk-5PSRSNGH.mjs.map +0 -1
- package/dist/chunk-BYL7HWNN.mjs.map +0 -1
- package/dist/chunk-D5IRVU4W.mjs.map +0 -1
- package/dist/chunk-EL2VTGFB.mjs.map +0 -1
- package/dist/chunk-FPFCMFCJ.mjs.map +0 -1
- package/dist/chunk-JTQ5QCML.mjs.map +0 -1
- package/dist/chunk-KVE6VXTJ.mjs.map +0 -1
- package/dist/chunk-MGTMKKSH.mjs.map +0 -1
- package/dist/chunk-MSIOYYWR.mjs.map +0 -1
- package/dist/chunk-PG7ZV76C.mjs.map +0 -1
- package/dist/chunk-PPBHLDVN.mjs.map +0 -1
- package/dist/chunk-RKO6KM3T.mjs.map +0 -1
- package/dist/chunk-SBPKRYF2.mjs.map +0 -1
- package/dist/chunk-SWATR7CU.mjs.map +0 -1
- package/dist/chunk-T5DNDBW6.mjs.map +0 -1
- package/dist/chunk-TCSYDMC7.mjs.map +0 -1
- package/dist/chunk-TMHSYM3V.mjs.map +0 -1
- package/dist/chunk-VMBRDEM2.mjs.map +0 -1
- package/dist/chunk-WMG5U5AU.mjs.map +0 -1
- package/dist/chunk-X7XFG7TS.mjs.map +0 -1
- package/dist/chunk-XRF3TNSQ.mjs.map +0 -1
- package/dist/chunk-YNJ423BR.mjs.map +0 -1
- package/dist/chunk-ZQWVMOT6.mjs.map +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/use-chart.ts"],"sourcesContent":["import { useTheme } from \"@yamada-ui/core\"\nimport type { CSSUIObject, PropGetter } from \"@yamada-ui/core\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport { createContext, cx } from \"@yamada-ui/utils\"\nimport { useCallback } from \"react\"\nimport type * as Recharts from \"recharts\"\nimport { getComponentProps } from \"./chart-utils\"\nimport type { ResponsiveContainerProps } from \"./chart.types\"\nimport { containerProperties } from \"./rechart-properties\"\n\ninterface ChartContext {\n styles: { [key: string]: CSSUIObject }\n}\n\nexport const [ChartProvider, useChartContext] = createContext<ChartContext>({\n name: \"ChartContext\",\n errorMessage: `useChartContext returned is 'undefined'. Seems you forgot to wrap the components in \"<LineChart />\" or \"<BarChart />\" etc.`,\n})\n\nexport interface UseChartProps {\n /**\n * Props passed down to recharts `ResponsiveContainer` component.\n */\n containerProps?: ResponsiveContainerProps\n}\n\nexport const useChart = ({ containerProps = {} }: UseChartProps) => {\n const { theme } = useTheme()\n const [reChartsProps, propClassName] = getComponentProps<Dict, string>([\n containerProps,\n containerProperties,\n ])(theme)\n\n const getContainerProps: PropGetter<\n Partial<Omit<Recharts.ResponsiveContainerProps, \"children\">>,\n Omit<Recharts.ResponsiveContainerProps, \"children\">\n > = useCallback(\n ({ className, ...props } = {}, ref = null) => ({\n ref,\n className: cx(\"ui-chart__container\", className as string, propClassName),\n ...props,\n ...reChartsProps,\n }),\n [propClassName, reChartsProps],\n )\n\n return {\n getContainerProps,\n }\n}\n\nexport type UseChartReturn = ReturnType<typeof useChart>\n\nexport interface UseLegendProps {}\n\nexport const useLegend = ({}: UseLegendProps = {}) => {\n const { styles } = useChartContext()\n return {\n styles,\n }\n}\nexport type UseLegendReturn = ReturnType<typeof useLegend>\n\nexport interface UseTooltipProps {}\n\nexport const useTooltip = ({}: UseTooltipProps = {}) => {\n const { styles } = useChartContext()\n return {\n styles,\n }\n}\nexport type UseTooltipReturn = ReturnType<typeof useTooltip>\n"],"mappings":";;;;;;;;;AAAA,SAAS,gBAAgB;AAGzB,SAAS,eAAe,UAAU;AAClC,SAAS,mBAAmB;AAUrB,IAAM,CAAC,eAAe,eAAe,IAAI,cAA4B;AAAA,EAC1E,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AASM,IAAM,WAAW,CAAC,EAAE,iBAAiB,CAAC,EAAE,MAAqB;AAClE,QAAM,EAAE,MAAM,IAAI,SAAS;AAC3B,QAAM,CAAC,eAAe,aAAa,IAAI,kBAAgC;AAAA,IACrE;AAAA,IACA;AAAA,EACF,CAAC,EAAE,KAAK;AAER,QAAM,oBAGF;AAAA,IACF,CAAC,EAAE,WAAW,GAAG,MAAM,IAAI,CAAC,GAAG,MAAM,UAAU;AAAA,MAC7C;AAAA,MACA,WAAW,GAAG,uBAAuB,WAAqB,aAAa;AAAA,MACvE,GAAG;AAAA,MACH,GAAG;AAAA,IACL;AAAA,IACA,CAAC,eAAe,aAAa;AAAA,EAC/B;AAEA,SAAO;AAAA,IACL;AAAA,EACF;AACF;AAMO,IAAM,YAAY,CAAC,CAAC,IAAoB,CAAC,MAAM;AACpD,QAAM,EAAE,OAAO,IAAI,gBAAgB;AACnC,SAAO;AAAA,IACL;AAAA,EACF;AACF;AAKO,IAAM,aAAa,CAAC,CAAC,IAAqB,CAAC,MAAM;AACtD,QAAM,EAAE,OAAO,IAAI,gBAAgB;AACnC,SAAO;AAAA,IACL;AAAA,EACF;AACF;","names":[]}
|
@@ -1,44 +1,44 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
useAreaChart
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-VQJ6VQ45.mjs";
|
5
5
|
import {
|
6
6
|
AreaGradient
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-NHHJ5XFF.mjs";
|
8
8
|
import {
|
9
9
|
AreaSplit
|
10
|
-
} from "./chunk-
|
10
|
+
} from "./chunk-MN7T76SY.mjs";
|
11
11
|
import {
|
12
12
|
useChartAxis
|
13
|
-
} from "./chunk-
|
13
|
+
} from "./chunk-3EHZJFIA.mjs";
|
14
14
|
import {
|
15
15
|
useChartGrid
|
16
|
-
} from "./chunk-
|
16
|
+
} from "./chunk-2GQHI23M.mjs";
|
17
17
|
import {
|
18
18
|
useChartReferenceLine
|
19
|
-
} from "./chunk-
|
19
|
+
} from "./chunk-FYAC4RRZ.mjs";
|
20
20
|
import {
|
21
21
|
useChartTooltip
|
22
|
-
} from "./chunk-
|
22
|
+
} from "./chunk-OJ2MLZZ7.mjs";
|
23
23
|
import {
|
24
24
|
useChartLegend
|
25
|
-
} from "./chunk-
|
25
|
+
} from "./chunk-IJRYXT4V.mjs";
|
26
26
|
import {
|
27
27
|
ChartLegend
|
28
|
-
} from "./chunk-
|
28
|
+
} from "./chunk-LLOU2WIV.mjs";
|
29
29
|
import {
|
30
30
|
ChartTooltip
|
31
|
-
} from "./chunk-
|
31
|
+
} from "./chunk-UANITMH7.mjs";
|
32
32
|
import {
|
33
33
|
ChartProvider,
|
34
34
|
useChart
|
35
|
-
} from "./chunk-
|
35
|
+
} from "./chunk-A3IWA366.mjs";
|
36
36
|
|
37
37
|
// src/area-chart.tsx
|
38
38
|
import {
|
39
39
|
ui,
|
40
40
|
forwardRef,
|
41
|
-
|
41
|
+
useComponentMultiStyle,
|
42
42
|
omitThemeProps
|
43
43
|
} from "@yamada-ui/core";
|
44
44
|
import { cx } from "@yamada-ui/utils";
|
@@ -57,7 +57,7 @@ import {
|
|
57
57
|
} from "recharts";
|
58
58
|
import { jsx, jsxs } from "react/jsx-runtime";
|
59
59
|
var AreaChart = forwardRef((props, ref) => {
|
60
|
-
const [styles, mergedProps] =
|
60
|
+
const [styles, mergedProps] = useComponentMultiStyle("AreaChart", props);
|
61
61
|
const {
|
62
62
|
className,
|
63
63
|
series,
|
@@ -287,4 +287,4 @@ var AreaChart = forwardRef((props, ref) => {
|
|
287
287
|
export {
|
288
288
|
AreaChart
|
289
289
|
};
|
290
|
-
//# sourceMappingURL=chunk-
|
290
|
+
//# sourceMappingURL=chunk-AZB43WEN.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/area-chart.tsx"],"sourcesContent":["import type { HTMLUIProps, ThemeProps } from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n useComponentMultiStyle,\n omitThemeProps,\n} from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { Fragment, useMemo } from \"react\"\nimport {\n CartesianGrid,\n Legend,\n AreaChart as ReChartsAreaChart,\n Area,\n ReferenceLine,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n Label,\n} from \"recharts\"\nimport { AreaGradient } from \"./area-chart-gradient\"\nimport { AreaSplit } from \"./area-chart-split\"\nimport { ChartLegend } from \"./chart-legend\"\nimport { ChartTooltip } from \"./chart-tooltip\"\nimport type { UseAreaChartOptions } from \"./use-area-chart\"\nimport { useAreaChart } from \"./use-area-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 type { UseChartGridOptions } from \"./use-chart-grid\"\nimport { useChartGrid } from \"./use-chart-grid\"\nimport type { UseChartLegendProps } from \"./use-chart-legend\"\nimport { useChartLegend } from \"./use-chart-legend\"\nimport type { UseChartReferenceLineOptions } from \"./use-chart-reference-line\"\nimport { useChartReferenceLine } from \"./use-chart-reference-line\"\nimport type { UseChartTooltipOptions } from \"./use-chart-tooltip\"\nimport { useChartTooltip } from \"./use-chart-tooltip\"\n\ninterface AreaChartOptions {\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 interface AreaChartProps\n extends Omit<HTMLUIProps, \"strokeWidth\" | \"fillOpacity\" | \"strokeDasharray\">,\n ThemeProps<\"AreaChart\">,\n AreaChartOptions,\n UseAreaChartOptions,\n UseChartProps,\n UseChartAxisOptions,\n UseChartReferenceLineOptions,\n UseChartGridOptions,\n UseChartTooltipOptions,\n UseChartLegendProps {}\n\n/**\n * `AreaChart` is a component for drawing area charts to compare multiple sets of data.\n *\n * @see Docs https://yamada-ui.com/components/data-display/area-chart\n */\nexport const AreaChart = forwardRef<AreaChartProps, \"div\">((props, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\"AreaChart\", props)\n const {\n className,\n series,\n dataKey,\n layoutType,\n tickLine,\n gridAxis,\n withXAxis,\n withYAxis,\n xAxisProps,\n yAxisProps,\n xAxisLabel,\n yAxisLabel,\n xAxisLabelProps,\n yAxisLabelProps,\n type = \"default\",\n withTooltip = true,\n withLegend = false,\n referenceLineProps = [],\n containerProps,\n unit,\n gridProps,\n strokeDasharray,\n yAxisTickFormatter,\n xAxisTickFormatter,\n valueFormatter,\n labelFormatter,\n tooltipProps,\n tooltipAnimationDuration,\n legendProps,\n data,\n chartProps,\n areaProps,\n withGradient,\n withDots,\n withActiveDots,\n curveType,\n strokeWidth,\n connectNulls,\n fillOpacity,\n splitColors,\n splitOffset,\n syncId,\n ...rest\n } = omitThemeProps(mergedProps)\n\n const {\n getAreaChartProps,\n getAreaSplitProps,\n getAreaProps,\n getAreaGradientProps,\n areaVars,\n setHighlightedArea,\n } = useAreaChart({\n layoutType,\n type,\n series,\n referenceLineProps,\n data,\n chartProps,\n areaProps,\n withGradient,\n withDots,\n withActiveDots,\n curveType,\n strokeWidth,\n connectNulls,\n fillOpacity,\n splitColors,\n splitOffset,\n syncId,\n xAxisLabel,\n yAxisLabel,\n styles,\n })\n const { getContainerProps } = useChart({ containerProps })\n const {\n getXAxisProps,\n getYAxisProps,\n getXAxisLabelProps,\n getYAxisLabelProps,\n } = useChartAxis({\n dataKey,\n type,\n layoutType,\n tickLine,\n gridAxis,\n withXAxis,\n withYAxis,\n xAxisProps,\n yAxisProps,\n xAxisLabel,\n yAxisLabel,\n xAxisLabelProps,\n yAxisLabelProps,\n unit,\n yAxisTickFormatter,\n xAxisTickFormatter,\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 areas = useMemo(\n () =>\n series.map(({ dataKey }, index) => {\n const { id, stroke, ...rest } = getAreaProps({\n index,\n className: \"ui-area-chart__area\",\n })\n\n return (\n <Fragment key={`area-${dataKey}`}>\n <defs>\n <AreaGradient {...getAreaGradientProps({ id, color: stroke })} />\n </defs>\n\n <Area id={id} stroke={stroke} {...rest} />\n </Fragment>\n )\n }),\n [getAreaGradientProps, getAreaProps, 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-area-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-area-chart\", className)}\n __css={{ maxW: \"full\", vars: areaVars, ...styles.container }}\n {...rest}\n >\n <ResponsiveContainer\n {...getContainerProps({ className: \"ui-area-chart__container\" })}\n >\n <ReChartsAreaChart\n {...getAreaChartProps({ className: \"ui-area-chart__chart\" })}\n >\n <CartesianGrid\n {...getGridProps({ className: \"ui-area-chart__grid\" })}\n />\n\n <XAxis {...getXAxisProps({ className: \"ui-area-chart__x-axis\" })}>\n <Label\n {...getXAxisLabelProps({\n className: \"ui-area-chart__x-axis-label\",\n })}\n />\n </XAxis>\n\n <YAxis {...getYAxisProps({ className: \"ui-area-chart__y-axis\" })}>\n <Label\n {...getYAxisLabelProps({\n className: \"ui-area-chart__y-axis-label\",\n })}\n />\n </YAxis>\n\n {withLegend ? (\n <Legend\n content={({ payload }) => (\n <ChartLegend\n className=\"ui-area-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-area-chart__tooltip\"\n label={label}\n payload={payload}\n valueFormatter={valueFormatter}\n labelFormatter={labelFormatter}\n unit={unit}\n {...computedTooltipProps}\n />\n )}\n {...getTooltipProps()}\n />\n ) : null}\n\n {type === \"split\" ? (\n <defs>\n <AreaSplit {...getAreaSplitProps()} />\n </defs>\n ) : null}\n\n {areas}\n {referenceLinesItems}\n </ReChartsAreaChart>\n </ResponsiveContainer>\n </ui.div>\n </ChartProvider>\n )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AAa;AAAA,wBACZ,GAAG;AAAA;AAAA,oBACN;AAAA,oBAED,GAAG,eAAe;AAAA;AAAA,gBACrB,IACE;AAAA,gBAEH,cACC;AAAA,kBAAC;AAAA;AAAA,oBACC,SAAS,CAAC,EAAE,OAAO,QAAQ,MACzB;AAAA,sBAAC;AAAA;AAAA,wBACC,WAAU;AAAA,wBACV;AAAA,wBACA;AAAA,wBACA;AAAA,wBACA;AAAA,wBACA;AAAA,wBACC,GAAG;AAAA;AAAA,oBACN;AAAA,oBAED,GAAG,gBAAgB;AAAA;AAAA,gBACtB,IACE;AAAA,gBAEH,SAAS,UACR,oBAAC,UACC,8BAAC,aAAW,GAAG,kBAAkB,GAAG,GACtC,IACE;AAAA,gBAEH;AAAA,gBACA;AAAA;AAAA;AAAA,UACH;AAAA;AAAA,MACF;AAAA;AAAA,EACF,GACF;AAEJ,CAAC;","names":["dataKey","rest"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/use-chart-reference-line.ts"],"sourcesContent":["import { getCSS, getVar, useTheme } from \"@yamada-ui/core\"\nimport type { CSSUIObject, RequiredPropGetter } from \"@yamada-ui/core\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport { isObject, cx } from \"@yamada-ui/utils\"\nimport { useCallback, useMemo } from \"react\"\nimport type * as Recharts from \"recharts\"\nimport { getComponentProps } from \"./chart-utils\"\nimport type { ReferenceLineProps } from \"./chart.types\"\nimport { referenceLineProperties } from \"./rechart-properties\"\n\nexport interface UseChartReferenceLineOptions {\n /**\n * Reference lines that should be displayed on the chart.\n */\n referenceLineProps?: ReferenceLineProps[]\n}\n\ninterface UseChartReferenceLineProps extends UseChartReferenceLineOptions {\n styles: Dict<CSSUIObject>\n}\n\nexport const useChartReferenceLine = ({\n referenceLineProps = [],\n styles,\n}: UseChartReferenceLineProps) => {\n const { theme } = useTheme()\n const styleClassName = getCSS(styles.referenceLine)(theme)\n const propList = useMemo(\n () =>\n referenceLineProps.map((props, index) => {\n const [{ label: labelProp, ...rest }, propClassName] =\n getComponentProps(\n [props, referenceLineProperties],\n styleClassName,\n )(theme)\n\n const color = getVar(`reference-line-${index}`)(theme)\n const label: Recharts.ReferenceLineProps[\"label\"] = {\n value: labelProp as string,\n fill: color,\n position: \"insideBottomLeft\",\n ...(isObject(labelProp) ? labelProp : {}),\n }\n\n return { propClassName, color, label, ...rest }\n }),\n [referenceLineProps, styleClassName, theme],\n )\n\n const getReferenceLineProps: RequiredPropGetter<\n Partial<Recharts.ReferenceLineProps> & { index: number },\n Omit<Recharts.ReferenceLineProps, \"ref\">\n > = useCallback(\n ({ index, className, ...props }, ref = null) => {\n const { propClassName, color, label, ...rest } = propList[index]\n\n return {\n ref,\n className: cx(className, propClassName),\n stroke: color,\n label,\n ...(props as Recharts.ReferenceLineProps),\n ...rest,\n }\n },\n [propList],\n )\n\n return { getReferenceLineProps }\n}\n"],"mappings":";;;;;;;;;AAAA,SAAS,QAAQ,QAAQ,gBAAgB;AAGzC,SAAS,UAAU,UAAU;AAC7B,SAAS,aAAa,eAAe;AAiB9B,IAAM,wBAAwB,CAAC;AAAA,EACpC,qBAAqB,CAAC;AAAA,EACtB;AACF,MAAkC;AAChC,QAAM,EAAE,MAAM,IAAI,SAAS;AAC3B,QAAM,iBAAiB,OAAO,OAAO,aAAa,EAAE,KAAK;AACzD,QAAM,WAAW;AAAA,IACf,MACE,mBAAmB,IAAI,CAAC,OAAO,UAAU;AACvC,YAAM,CAAC,EAAE,OAAO,WAAW,GAAG,KAAK,GAAG,aAAa,IACjD;AAAA,QACE,CAAC,OAAO,uBAAuB;AAAA,QAC/B;AAAA,MACF,EAAE,KAAK;AAET,YAAM,QAAQ,OAAO,kBAAkB,KAAK,EAAE,EAAE,KAAK;AACrD,YAAM,QAA8C;AAAA,QAClD,OAAO;AAAA,QACP,MAAM;AAAA,QACN,UAAU;AAAA,QACV,GAAI,SAAS,SAAS,IAAI,YAAY,CAAC;AAAA,MACzC;AAEA,aAAO,EAAE,eAAe,OAAO,OAAO,GAAG,KAAK;AAAA,IAChD,CAAC;AAAA,IACH,CAAC,oBAAoB,gBAAgB,KAAK;AAAA,EAC5C;AAEA,QAAM,wBAGF;AAAA,IACF,CAAC,EAAE,OAAO,WAAW,GAAG,MAAM,GAAG,MAAM,SAAS;AAC9C,YAAM,EAAE,eAAe,OAAO,OAAO,GAAG,KAAK,IAAI,SAAS,KAAK;AAE/D,aAAO;AAAA,QACL;AAAA,QACA,WAAW,GAAG,WAAW,aAAa;AAAA,QACtC,QAAQ;AAAA,QACR;AAAA,QACA,GAAI;AAAA,QACJ,GAAG;AAAA,MACL;AAAA,IACF;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AAEA,SAAO,EAAE,sBAAsB;AACjC;","names":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/use-bar-chart.tsx"],"sourcesContent":["import type {\n CSSUIObject,\n CSSUIProps,\n PropGetter,\n RequiredPropGetter,\n} from \"@yamada-ui/core\"\nimport { getVar, useTheme } from \"@yamada-ui/core\"\nimport { cx, runIfFunc } from \"@yamada-ui/utils\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport type { FC, ComponentPropsWithoutRef, ReactNode } from \"react\"\nimport { useCallback, useState, useId, useMemo } from \"react\"\nimport type * as Recharts from \"recharts\"\nimport { Bar, Cell } from \"recharts\"\nimport { getComponentProps } from \"./chart-utils\"\nimport type {\n BarProps,\n BarChartType,\n BarChartProps,\n ChartLayoutType,\n ReferenceLineProps,\n} from \"./chart.types\"\nimport { barProperties, barChartProperties } from \"./rechart-properties\"\n\nexport interface UseBarChartOptions {\n /**\n * Chart data.\n */\n data: Dict[]\n /**\n * An array of objects with `name` and `color` keys. Determines which data should be consumed from the `data` array.\n */\n series: BarProps[]\n /**\n * Props for the bars.\n */\n barProps?: Partial<BarProps>\n /**\n * Controls how chart bars are positioned relative to each other.\n *\n * @default `default`\n */\n type?: BarChartType\n /**\n * Chart orientation.\n *\n * @default 'horizontal'\n */\n layoutType?: ChartLayoutType\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 `BarChart` component.\n */\n chartProps?: BarChartProps\n /**\n * Reference lines that should be displayed on the chart.\n */\n referenceLineProps?: ReferenceLineProps[]\n /**\n * Controls fill opacity of all bars.\n *\n * @default 1\n */\n fillOpacity?: number | [number, number]\n /**\n * A label to display below the X axis.\n */\n xAxisLabel?: string\n /**\n * A label to display below the Y axis.\n */\n yAxisLabel?: string\n /**\n * A function that returns a component that renders the bar cells.\n */\n cell?: ReactNode | FC<BarCellProps>\n}\n\nexport interface UseBarChartProps extends UseBarChartOptions {\n styles: Dict<CSSUIObject>\n}\n\nexport const useBarChart = ({\n data,\n series,\n type = \"default\",\n layoutType = \"horizontal\",\n referenceLineProps = [],\n fillOpacity = 1,\n syncId,\n xAxisLabel,\n yAxisLabel,\n styles,\n cell = defaultBarCell,\n ...rest\n}: UseBarChartProps) => {\n const uuid = useId()\n const { theme } = useTheme()\n const [highlightedArea, setHighlightedArea] = useState<string | null>(null)\n const stacked = type === \"stacked\" || type === \"percent\"\n const shouldHighlight = highlightedArea !== null\n const {\n activeBar = {},\n background = {},\n dimBar = {},\n ...computedBarProps\n } = rest.barProps ?? {}\n\n const barColors: CSSUIProps[\"vars\"] = useMemo(\n () =>\n series.map(({ color }, index) => ({\n name: `bar-${index}`,\n token: \"colors\",\n value: color ?? \"transparent\",\n })),\n [series],\n )\n\n const referenceLineColors: CSSUIProps[\"vars\"] = useMemo(\n () =>\n referenceLineProps.map(({ color }, index) => ({\n name: `reference-line-${index}`,\n token: \"colors\",\n value: color ?? \"transparent\",\n })),\n [referenceLineProps],\n )\n\n const barVars: CSSUIProps[\"vars\"] = useMemo(() => {\n return [\n ...barColors,\n ...referenceLineColors,\n { name: \"fill-opacity\", value: fillOpacity },\n ]\n }, [barColors, fillOpacity, referenceLineColors])\n\n const [chartProps, barChartClassName] = useMemo(() => {\n const resolvedBarChartProps = { barGap: 8, ...rest.chartProps }\n\n return getComponentProps<Dict, string>(\n [resolvedBarChartProps, barChartProperties],\n styles.chart,\n )(theme)\n }, [rest.chartProps, styles.chart, theme])\n\n const [barProps, barClassName] = useMemo(() => {\n const resolvedBarProps = {\n fillOpacity: \"$fill-opacity\",\n strokeOpacity: 1,\n ...computedBarProps,\n }\n\n return getComponentProps<Dict, string>(\n [resolvedBarProps, barProperties],\n styles.bar,\n )(theme)\n }, [computedBarProps, styles.bar, theme])\n\n const [dimBarProps, dimBarClassName] = useMemo(\n () =>\n getComponentProps<Dict, string>(\n [dimBar, barProperties],\n styles.dimBar,\n )(theme),\n [dimBar, styles.dimBar, theme],\n )\n\n const [activeBarProps, activeBarClassName] = useMemo(\n () =>\n getComponentProps<Dict, string>(\n [activeBar, barProperties],\n styles.activeBar,\n )(theme),\n [activeBar, styles.activeBar, theme],\n )\n\n const [backgroundProps, backgroundClassName] = useMemo(\n () =>\n getComponentProps<Dict, string>(\n [background, barProperties],\n styles.background,\n )(theme),\n [background, styles.background, theme],\n )\n\n const barPropsList = useMemo(\n () =>\n series.map((props, index) => {\n const {\n dataKey,\n activeBar = {},\n background = {},\n dimBar = {},\n ...computedProps\n } = props\n const id = `${uuid}-${dataKey}`\n const color = getVar(`bar-${index}`)(theme)\n const dimmed = shouldHighlight && highlightedArea !== dataKey\n const computedDimBar = { ...dimBarProps, ...dimBar }\n const resolvedProps = {\n ...barProps,\n ...computedProps,\n ...(dimmed ? computedDimBar : {}),\n }\n\n const rest = getComponentProps<Dict, string>(\n [resolvedProps, barProperties],\n barClassName,\n dimmed ? dimBarClassName : undefined,\n )(theme, true)\n\n const computedActiveBar = { ...activeBarProps, ...activeBar }\n\n const resolvedActiveBar = getComponentProps<Dict, string>(\n [computedActiveBar, barProperties],\n activeBarClassName,\n )(theme, true)\n\n const computedBackground = { ...backgroundProps, ...background }\n\n const resolvedBackground = getComponentProps<Dict, string>(\n [computedBackground, barProperties],\n backgroundClassName,\n )(theme, true)\n\n return {\n ...rest,\n id,\n activeBar: resolvedActiveBar,\n background: resolvedBackground,\n color,\n dataKey,\n }\n }),\n [\n activeBarClassName,\n activeBarProps,\n backgroundClassName,\n backgroundProps,\n barClassName,\n barProps,\n dimBarClassName,\n dimBarProps,\n highlightedArea,\n series,\n shouldHighlight,\n theme,\n uuid,\n ],\n )\n\n const getBarProps: RequiredPropGetter<\n Partial<Recharts.BarProps> & { index: number },\n Omit<Recharts.BarProps, \"ref\">\n > = useCallback(\n ({ index, className: classNameProp, ...props }, ref = null) => {\n const { id, className, activeBar, background, color, dataKey, ...rest } =\n barPropsList[index]\n\n return {\n ref,\n className: cx(classNameProp, className),\n activeBar,\n background,\n id,\n name: dataKey as string,\n dataKey,\n fill: color,\n stroke: color,\n isAnimationActive: false,\n stackId: stacked ? \"stack\" : undefined,\n ...(props as Omit<Recharts.BarProps, \"dataKey\">),\n ...rest,\n } as Recharts.BarProps\n },\n [barPropsList, stacked],\n )\n\n const bars = useMemo(() => {\n const hasStack = series.some((entry) => entry.stackId)\n\n return series.map((series, index) => {\n const { dataKey } = series\n\n return (\n <Bar\n key={`bar-${dataKey}`}\n {...getBarProps({ index, className: \"ui-bar-chart__bar\" })}\n >\n {data.map((data, index) =>\n runIfFunc(cell, { series, data, index, hasStack }),\n )}\n </Bar>\n )\n })\n }, [series, getBarProps, cell, data])\n\n const getBarChartProps: PropGetter<\n ComponentPropsWithoutRef<typeof Recharts.BarChart>,\n ComponentPropsWithoutRef<typeof Recharts.BarChart>\n > = useCallback(\n ({ className, ...props } = {}, ref = null) => ({\n ref,\n className: cx(className, barChartClassName),\n data,\n stackOffset: type === \"percent\" ? \"expand\" : undefined,\n layout: layoutType,\n syncId,\n margin: {\n bottom: xAxisLabel ? 30 : undefined,\n left: yAxisLabel ? 10 : undefined,\n right: yAxisLabel ? 5 : undefined,\n },\n ...props,\n ...chartProps,\n }),\n [\n barChartClassName,\n data,\n type,\n layoutType,\n syncId,\n xAxisLabel,\n yAxisLabel,\n chartProps,\n ],\n )\n\n return {\n bars,\n barVars,\n getBarProps,\n getBarChartProps,\n setHighlightedArea,\n }\n}\n\nexport type UseBarChartReturn = ReturnType<typeof useBarChart>\n\nexport interface BarCellProps {\n hasStack: boolean\n series: BarProps\n data: Dict\n index: number\n}\n\nconst defaultBarCell: FC<BarCellProps> = ({\n hasStack,\n series,\n data,\n index,\n}) => {\n const { dataKey } = series\n const key = `cell-${dataKey}-${index}`\n\n if (!hasStack) return <Cell key={key} />\n\n const keys = Object.keys(data)\n const values = Object.values(data)\n\n const currentIndex = keys.findIndex((key) => key === dataKey)\n const lastIndex = values.findLastIndex((value) => value !== 0)\n\n if (currentIndex === lastIndex) return <Cell key={key} />\n\n return <Cell key={key} radius={0} />\n}\n"],"mappings":";;;;;;;;;;AAMA,SAAS,QAAQ,gBAAgB;AACjC,SAAS,IAAI,iBAAiB;AAG9B,SAAS,aAAa,UAAU,OAAO,eAAe;AAEtD,SAAS,KAAK,YAAY;AAoRlB;AA3MD,IAAM,cAAc,CAAC;AAAA,EAC1B;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,aAAa;AAAA,EACb,qBAAqB,CAAC;AAAA,EACtB,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,GAAG;AACL,MAAwB;AAlGxB;AAmGE,QAAM,OAAO,MAAM;AACnB,QAAM,EAAE,MAAM,IAAI,SAAS;AAC3B,QAAM,CAAC,iBAAiB,kBAAkB,IAAI,SAAwB,IAAI;AAC1E,QAAM,UAAU,SAAS,aAAa,SAAS;AAC/C,QAAM,kBAAkB,oBAAoB;AAC5C,QAAM;AAAA,IACJ,YAAY,CAAC;AAAA,IACb,aAAa,CAAC;AAAA,IACd,SAAS,CAAC;AAAA,IACV,GAAG;AAAA,EACL,KAAI,UAAK,aAAL,YAAiB,CAAC;AAEtB,QAAM,YAAgC;AAAA,IACpC,MACE,OAAO,IAAI,CAAC,E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GAAgB;AACpC;","names":["activeBar","background","dimBar","rest","series","data","index","key"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/use-chart-legend.ts"],"sourcesContent":["import type { PropGetter } from \"@yamada-ui/core\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport { splitObject } from \"@yamada-ui/utils\"\nimport { useCallback } from \"react\"\nimport type * as Recharts from \"recharts\"\nimport type { LegendProps } from \"./chart.types\"\nimport { legendProperties } from \"./rechart-properties\"\n\nexport interface UseChartLegendProps {\n /**\n * Props passed down to recharts 'Legend' component.\n */\n legendProps?: LegendProps\n}\n\nexport const useChartLegend = ({\n legendProps: _legendProps = {},\n}: UseChartLegendProps) => {\n const [rest, legendProps] = splitObject<Dict, string>(\n _legendProps,\n legendProperties,\n )\n\n const getLegendProps: PropGetter<\n Partial<Recharts.LegendProps>,\n Omit<Recharts.LegendProps, \"ref\">\n > = useCallback(\n (props, ref = null) => {\n return {\n ref,\n verticalAlign: \"top\",\n ...props,\n ...rest,\n }\n },\n [rest],\n )\n\n return { legendProps, getLegendProps }\n}\n"],"mappings":";;;;;;AAEA,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAYrB,IAAM,iBAAiB,CAAC;AAAA,EAC7B,aAAa,eAAe,CAAC;AAC/B,MAA2B;AACzB,QAAM,CAAC,MAAM,WAAW,IAAI;AAAA,IAC1B;AAAA,IACA;AAAA,EACF;AAEA,QAAM,iBAGF;AAAA,IACF,CAAC,OAAO,MAAM,SAAS;AACrB,aAAO;AAAA,QACL;AAAA,QACA,eAAe;AAAA,QACf,GAAG;AAAA,QACH,GAAG;AAAA,MACL;AAAA,IACF;AAAA,IACA,CAAC,IAAI;AAAA,EACP;AAEA,SAAO,EAAE,aAAa,eAAe;AACvC;","names":[]}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
useLegend
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-A3IWA366.mjs";
|
5
5
|
|
6
6
|
// src/chart-legend.tsx
|
7
7
|
import { forwardRef, ui } from "@yamada-ui/core";
|
@@ -50,4 +50,4 @@ var ChartLegend = forwardRef(
|
|
50
50
|
export {
|
51
51
|
ChartLegend
|
52
52
|
};
|
53
|
-
//# sourceMappingURL=chunk-
|
53
|
+
//# sourceMappingURL=chunk-LLOU2WIV.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/chart-legend.tsx"],"sourcesContent":["import type { HTMLUIProps } from \"@yamada-ui/core\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport { useLegend } from \"./use-chart\"\n\ninterface ChartLegendOptions {\n payload?: Dict[]\n onHighlight: (area: string | null) => void\n}\n\nexport interface ChartLegendProps extends HTMLUIProps, ChartLegendOptions {}\n\nexport const ChartLegend = forwardRef<ChartLegendProps, \"div\">(\n ({ className, payload = [], onHighlight, ...rest }, ref) => {\n const { styles } = useLegend()\n\n const items = payload.map(({ dataKey, value: valueProp, color }, index) => {\n const value = dataKey ?? valueProp\n\n return (\n <ui.div\n className=\"ui-chart__legend-item\"\n key={`legend-${index}`}\n onMouseEnter={() => onHighlight(value)}\n onMouseLeave={() => onHighlight(null)}\n __css={styles.legendItem}\n >\n <ui.div\n className=\"ui-chart__legend-swatch\"\n background={color}\n __css={styles.legendSwatch}\n />\n\n <ui.span className=\"ui-chart__legend-label\">{value}</ui.span>\n </ui.div>\n )\n })\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-chart__legend\", className)}\n __css={styles.legend}\n {...rest}\n >\n {items}\n </ui.div>\n )\n },\n)\n"],"mappings":";;;;;;AACA,SAAS,YAAY,UAAU;AAC/B,SAAS,UAAU;AAmBX,SAOE,KAPF;AARD,IAAM,cAAc;AAAA,EACzB,CAAC,EAAE,WAAW,UAAU,CAAC,GAAG,aAAa,GAAG,KAAK,GAAG,QAAQ;AAC1D,UAAM,EAAE,OAAO,IAAI,UAAU;AAE7B,UAAM,QAAQ,QAAQ,IAAI,CAAC,EAAE,SAAS,OAAO,WAAW,MAAM,GAAG,UAAU;AACzE,YAAM,QAAQ,4BAAW;AAEzB,aACE;AAAA,QAAC,GAAG;AAAA,QAAH;AAAA,UACC,WAAU;AAAA,UAEV,cAAc,MAAM,YAAY,KAAK;AAAA,UACrC,cAAc,MAAM,YAAY,IAAI;AAAA,UACpC,OAAO,OAAO;AAAA,UAEd;AAAA;AAAA,cAAC,GAAG;AAAA,cAAH;AAAA,gBACC,WAAU;AAAA,gBACV,YAAY;AAAA,gBACZ,OAAO,OAAO;AAAA;AAAA,YAChB;AAAA,YAEA,oBAAC,GAAG,MAAH,EAAQ,WAAU,0BAA0B,iBAAM;AAAA;AAAA;AAAA,QAX9C,UAAU,KAAK;AAAA,MAYtB;AAAA,IAEJ,CAAC;AAED,WACE;AAAA,MAAC,GAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,WAAW,GAAG,oBAAoB,SAAS;AAAA,QAC3C,OAAO,OAAO;AAAA,QACb,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;","names":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/area-chart-split.tsx"],"sourcesContent":["import { getVar, useTheme } from \"@yamada-ui/core\"\nimport type { FC } from \"react\"\n\nexport interface AreaSplitProps {\n offset: number\n id?: string\n fillOpacity: number | string | undefined\n}\n\nexport const AreaSplit: FC<AreaSplitProps> = ({ offset, id, fillOpacity }) => {\n const { theme } = useTheme()\n\n return (\n <linearGradient id={id} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop\n offset={offset}\n stopColor={getVar(`area-split-0`)(theme)}\n stopOpacity={fillOpacity ?? 0.4}\n />\n <stop\n offset={offset}\n stopColor={getVar(`area-split-1`)(theme)}\n stopOpacity={fillOpacity ?? 0.4}\n />\n </linearGradient>\n )\n}\n"],"mappings":";;;AAAA,SAAS,QAAQ,gBAAgB;AAa7B,SACE,KADF;AAJG,IAAM,YAAgC,CAAC,EAAE,QAAQ,IAAI,YAAY,MAAM;AAC5E,QAAM,EAAE,MAAM,IAAI,SAAS;AAE3B,SACE,qBAAC,oBAAe,IAAQ,IAAG,KAAI,IAAG,KAAI,IAAG,KAAI,IAAG,KAC9C;AAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW,OAAO,cAAc,EAAE,KAAK;AAAA,QACvC,aAAa,oCAAe;AAAA;AAAA,IAC9B;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW,OAAO,cAAc,EAAE,KAAK;AAAA,QACvC,aAAa,oCAAe;AAAA;AAAA,IAC9B;AAAA,KACF;AAEJ;","names":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/use-chart-label-list.ts"],"sourcesContent":["import { getCSS, useTheme } from \"@yamada-ui/core\"\nimport type { CSSUIObject, RequiredPropGetter } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport { useCallback, useMemo } from \"react\"\nimport type * as Recharts from \"recharts\"\nimport { getComponentProps } from \"./chart-utils\"\nimport type { LabelListProps } from \"./chart.types\"\nimport { labelListProperties } from \"./rechart-properties\"\n\nexport interface UseChartLabelListOptions {\n /**\n * Props passed down to recharts `LabelList` components.\n */\n labelListProps?: LabelListProps[]\n}\n\ninterface UseChartLabelListProps extends UseChartLabelListOptions {\n styles: Dict<CSSUIObject>\n}\n\nexport const useChartLabelList = ({\n labelListProps = [],\n styles,\n}: UseChartLabelListProps) => {\n const { theme } = useTheme()\n const styleClassName = getCSS(styles.labelList)(theme)\n\n const propList = useMemo(\n () =>\n labelListProps.map((props) =>\n getComponentProps<Dict, string>(\n [props, labelListProperties],\n styleClassName,\n )(theme, true),\n ),\n [labelListProps, styleClassName, theme],\n )\n\n const getLabelLineProps: RequiredPropGetter<\n Partial<Recharts.LabelListProps<Dict>> & { index: number },\n Omit<Recharts.LabelListProps<Dict>, \"ref\">\n > = useCallback(\n ({ index, className, ...props }, ref = null) => {\n const { className: propClassName, ...rest } = propList[index]\n\n return {\n ref,\n className: cx(className, propClassName),\n ...(props as Recharts.LabelListProps<Dict>),\n ...rest,\n }\n },\n [propList],\n )\n\n return { getLabelLineProps }\n}\n"],"mappings":";;;;;;;;;AAAA,SAAS,QAAQ,gBAAgB;AAEjC,SAAS,UAAU;AAEnB,SAAS,aAAa,eAAe;AAiB9B,IAAM,oBAAoB,CAAC;AAAA,EAChC,iBAAiB,CAAC;AAAA,EAClB;AACF,MAA8B;AAC5B,QAAM,EAAE,MAAM,IAAI,SAAS;AAC3B,QAAM,iBAAiB,OAAO,OAAO,SAAS,EAAE,KAAK;AAErD,QAAM,WAAW;AAAA,IACf,MACE,eAAe;AAAA,MAAI,CAAC,UAClB;AAAA,QACE,CAAC,OAAO,mBAAmB;AAAA,QAC3B;AAAA,MACF,EAAE,OAAO,IAAI;AAAA,IACf;AAAA,IACF,CAAC,gBAAgB,gBAAgB,KAAK;AAAA,EACxC;AAEA,QAAM,oBAGF;AAAA,IACF,CAAC,EAAE,OAAO,WAAW,GAAG,MAAM,GAAG,MAAM,SAAS;AAC9C,YAAM,EAAE,WAAW,eAAe,GAAG,KAAK,IAAI,SAAS,KAAK;AAE5D,aAAO;AAAA,QACL;AAAA,QACA,WAAW,GAAG,WAAW,aAAa;AAAA,QACtC,GAAI;AAAA,QACJ,GAAG;AAAA,MACL;AAAA,IACF;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AAEA,SAAO,EAAE,kBAAkB;AAC7B;","names":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/use-chart-label.ts"],"sourcesContent":["import { useTheme } from \"@yamada-ui/core\"\nimport type { CSSUIObject, PropGetter } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport { useCallback } from \"react\"\nimport type * as Recharts from \"recharts\"\nimport { getComponentProps } from \"./chart-utils\"\nimport type { LabelProps } from \"./chart.types\"\nimport { labelProperties } from \"./rechart-properties\"\n\nexport interface UseChartLabelOptions {\n /**\n * Props passed down to recharts 'Label' component.\n */\n labelProps?: LabelProps\n}\n\nexport interface UseChartLabelProps extends UseChartLabelOptions {\n styles: Dict<CSSUIObject>\n}\n\nexport const useChartLabel = ({ styles, ...rest }: UseChartLabelProps) => {\n const { theme } = useTheme()\n\n const [labelProps, labelClassName] = getComponentProps<Dict, string>(\n [rest.labelProps ?? {}, labelProperties],\n styles.label,\n )(theme)\n\n const getLabelProps: PropGetter<\n Omit<Recharts.LabelProps, \"ref\">,\n Omit<Recharts.LabelProps, \"ref\">\n > = useCallback(\n ({ className, ...props } = {}, ref = null) => {\n return {\n ref,\n className: cx(className, labelClassName),\n ...props,\n ...labelProps,\n }\n },\n [labelClassName, labelProps],\n )\n\n return { getLabelProps }\n}\n"],"mappings":";;;;;;;;;AAAA,SAAS,gBAAgB;AAEzB,SAAS,UAAU;AAEnB,SAAS,mBAAmB;AAiBrB,IAAM,gBAAgB,CAAC,EAAE,QAAQ,GAAG,KAAK,MAA0B;AArB1E;AAsBE,QAAM,EAAE,MAAM,IAAI,SAAS;AAE3B,QAAM,CAAC,YAAY,cAAc,IAAI;AAAA,IACnC,EAAC,UAAK,eAAL,YAAmB,CAAC,GAAG,eAAe;AAAA,IACvC,OAAO;AAAA,EACT,EAAE,KAAK;AAEP,QAAM,gBAGF;AAAA,IACF,CAAC,EAAE,WAAW,GAAG,MAAM,IAAI,CAAC,GAAG,MAAM,SAAS;AAC5C,aAAO;AAAA,QACL;AAAA,QACA,WAAW,GAAG,WAAW,cAAc;AAAA,QACvC,GAAG;AAAA,QACH,GAAG;AAAA,MACL;AAAA,IACF;AAAA,IACA,CAAC,gBAAgB,UAAU;AAAA,EAC7B;AAEA,SAAO,EAAE,cAAc;AACzB;","names":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/area-chart-gradient.tsx"],"sourcesContent":["import type { FC } from \"react\"\n\nexport interface AreaGradientProps {\n id?: string\n color?: string\n withGradient?: boolean\n fillOpacity: number | string\n}\n\nexport const AreaGradient: FC<AreaGradientProps> = ({\n color,\n id,\n withGradient,\n fillOpacity,\n}) => {\n if (withGradient) {\n return (\n <linearGradient id={id} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"0%\" stopColor={color} stopOpacity={fillOpacity} />\n <stop offset=\"100%\" stopColor={color} stopOpacity={0.01} />\n </linearGradient>\n )\n } else {\n return (\n <linearGradient id={id} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop stopColor={color} stopOpacity={fillOpacity} />\n </linearGradient>\n )\n }\n}\n"],"mappings":";;;AAiBM,SACE,KADF;AARC,IAAM,eAAsC,CAAC;AAAA,EAClD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,MAAI,cAAc;AAChB,WACE,qBAAC,oBAAe,IAAQ,IAAG,KAAI,IAAG,KAAI,IAAG,KAAI,IAAG,KAC9C;AAAA,0BAAC,UAAK,QAAO,MAAK,WAAW,OAAO,aAAa,aAAa;AAAA,MAC9D,oBAAC,UAAK,QAAO,QAAO,WAAW,OAAO,aAAa,MAAM;AAAA,OAC3D;AAAA,EAEJ,OAAO;AACL,WACE,oBAAC,oBAAe,IAAQ,IAAG,KAAI,IAAG,KAAI,IAAG,KAAI,IAAG,KAC9C,8BAAC,UAAK,WAAW,OAAO,aAAa,aAAa,GACpD;AAAA,EAEJ;AACF;","names":[]}
|
@@ -1,32 +1,32 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
useRadarChart
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-QGVADS6Z.mjs";
|
5
5
|
import {
|
6
6
|
usePolarGrid
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-XYUYAHJX.mjs";
|
8
8
|
import {
|
9
9
|
useChartTooltip
|
10
|
-
} from "./chunk-
|
10
|
+
} from "./chunk-OJ2MLZZ7.mjs";
|
11
11
|
import {
|
12
12
|
useChartLegend
|
13
|
-
} from "./chunk-
|
13
|
+
} from "./chunk-IJRYXT4V.mjs";
|
14
14
|
import {
|
15
15
|
ChartLegend
|
16
|
-
} from "./chunk-
|
16
|
+
} from "./chunk-LLOU2WIV.mjs";
|
17
17
|
import {
|
18
18
|
ChartTooltip
|
19
|
-
} from "./chunk-
|
19
|
+
} from "./chunk-UANITMH7.mjs";
|
20
20
|
import {
|
21
21
|
ChartProvider,
|
22
22
|
useChart
|
23
|
-
} from "./chunk-
|
23
|
+
} from "./chunk-A3IWA366.mjs";
|
24
24
|
|
25
25
|
// src/radar-chart.tsx
|
26
26
|
import {
|
27
27
|
ui,
|
28
28
|
forwardRef,
|
29
|
-
|
29
|
+
useComponentMultiStyle,
|
30
30
|
omitThemeProps
|
31
31
|
} from "@yamada-ui/core";
|
32
32
|
import { cx } from "@yamada-ui/utils";
|
@@ -43,7 +43,7 @@ import {
|
|
43
43
|
} from "recharts";
|
44
44
|
import { jsx, jsxs } from "react/jsx-runtime";
|
45
45
|
var RadarChart = forwardRef((props, ref) => {
|
46
|
-
const [styles, mergedProps] =
|
46
|
+
const [styles, mergedProps] = useComponentMultiStyle("RadarChart", props);
|
47
47
|
const {
|
48
48
|
className,
|
49
49
|
data,
|
@@ -210,4 +210,4 @@ var RadarChart = forwardRef((props, ref) => {
|
|
210
210
|
export {
|
211
211
|
RadarChart
|
212
212
|
};
|
213
|
-
//# sourceMappingURL=chunk-
|
213
|
+
//# sourceMappingURL=chunk-NR7N3R5C.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/radar-chart.tsx"],"sourcesContent":["import type { HTMLUIProps, ThemeProps } from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n useComponentMultiStyle,\n omitThemeProps,\n} from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useMemo } from \"react\"\nimport {\n ResponsiveContainer,\n RadarChart as ReChartsRadarChart,\n PolarGrid,\n PolarAngleAxis,\n PolarRadiusAxis,\n Radar,\n Tooltip,\n Legend,\n} from \"recharts\"\nimport { ChartLegend } from \"./chart-legend\"\nimport { ChartTooltip } from \"./chart-tooltip\"\nimport type { UseChartProps } from \"./use-chart\"\nimport { ChartProvider, useChart } from \"./use-chart\"\nimport type { UseChartLegendProps } from \"./use-chart-legend\"\nimport { useChartLegend } from \"./use-chart-legend\"\nimport type { UseChartTooltipOptions } from \"./use-chart-tooltip\"\nimport { useChartTooltip } from \"./use-chart-tooltip\"\nimport { usePolarGrid } from \"./use-polar-grid\"\nimport type { UsePolarGridOptions } from \"./use-polar-grid\"\nimport type { UseRadarChartOptions } from \"./use-radar-chart\"\nimport { useRadarChart } from \"./use-radar-chart\"\n\ninterface RadarChartOptions {\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 * Determines whether polarGrid should be displayed.\n *\n * @default true\n */\n withPolarGrid?: boolean\n /**\n * Determines whether polarAngleAxis should be displayed.\n *\n * @default true\n */\n withPolarAngleAxis?: boolean\n /**\n * Determines whether polarRadiusAxis should be displayed.\n *\n * @default false\n */\n withPolarRadiusAxis?: boolean\n /**\n * Unit displayed next to each tick in y-axis.\n */\n unit?: string\n}\n\nexport interface RadarChartProps\n extends Omit<HTMLUIProps, \"strokeWidth\" | \"fillOpacity\" | \"strokeDasharray\">,\n ThemeProps<\"RadarChart\">,\n RadarChartOptions,\n UseChartProps,\n Omit<UseChartTooltipOptions, \"labelFormatter\">,\n UseChartLegendProps,\n UsePolarGridOptions,\n UseRadarChartOptions {}\n\n/**\n * `RadarChart` is a component for drawing radar charts to compare multiple sets of data.\n *\n * @see Docs https://yamada-ui.com/components/data-display/radar-chart\n */\nexport const RadarChart = forwardRef<RadarChartProps, \"div\">((props, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\"RadarChart\", props)\n const {\n className,\n data,\n series,\n dataKey,\n radarProps,\n chartProps,\n polarGridProps,\n polarAngleAxisProps,\n polarAngleAxisTickProps,\n polarRadiusAxisProps,\n polarRadiusAxisTickProps,\n containerProps,\n tooltipProps,\n legendProps,\n tooltipAnimationDuration,\n unit,\n valueFormatter,\n polarAngleAxisTickFormatter,\n polarRadiusAxisTickFormatter,\n strokeDasharray,\n withDots,\n withActiveDots,\n strokeWidth,\n fillOpacity,\n withTooltip = true,\n withLegend = false,\n withPolarGrid = true,\n withPolarAngleAxis = true,\n withPolarRadiusAxis = false,\n ...rest\n } = omitThemeProps(mergedProps)\n\n const {\n getRadarProps,\n getRadarChartProps,\n getPolarAngleAxisProps,\n getPolarRadiusAxisProps,\n radarVars,\n setHighlightedArea,\n } = useRadarChart({\n data,\n series,\n dataKey,\n radarProps,\n chartProps,\n polarAngleAxisProps,\n polarAngleAxisTickProps,\n polarRadiusAxisProps,\n polarRadiusAxisTickProps,\n withDots,\n withActiveDots,\n strokeWidth,\n fillOpacity,\n polarAngleAxisTickFormatter,\n polarRadiusAxisTickFormatter,\n styles,\n })\n const { getContainerProps } = useChart({ containerProps })\n const { tooltipProps: computedTooltipProps, getTooltipProps } =\n useChartTooltip({\n tooltipProps,\n tooltipAnimationDuration,\n styles,\n })\n const { legendProps: computedLegendProps, getLegendProps } = useChartLegend({\n legendProps,\n })\n const { getPolarGridProps } = usePolarGrid({\n polarGridProps,\n strokeDasharray,\n styles,\n })\n\n const radars = useMemo(\n () =>\n series.map(({ dataKey }, index) => (\n <Radar\n key={`radar-${dataKey}`}\n {...getRadarProps({ index, className: \"ui-radar-chart__radar\" })}\n />\n )),\n [getRadarProps, series],\n )\n\n return (\n <ChartProvider value={{ styles }}>\n <ui.div\n ref={ref}\n className={cx(\"ui-radar-chart\", className)}\n __css={{ maxW: \"full\", vars: radarVars, ...styles.container }}\n {...rest}\n >\n <ResponsiveContainer\n {...getContainerProps({ className: \"ui-radar-chart__container\" })}\n >\n <ReChartsRadarChart\n {...getRadarChartProps({ className: \"ui-radar-chart__chart\" })}\n >\n {withPolarGrid ? (\n <PolarGrid\n {...getPolarGridProps({\n className: \"ui-radar-chart__polar-grid\",\n })}\n />\n ) : null}\n {withPolarAngleAxis ? (\n <PolarAngleAxis\n {...getPolarAngleAxisProps({\n className: \"ui-radar-chart__polar-angle-axis\",\n })}\n />\n ) : null}\n {withPolarRadiusAxis ? (\n <PolarRadiusAxis\n {...getPolarRadiusAxisProps({\n className: \"ui-radar-chart__polar-radius-axis\",\n })}\n />\n ) : null}\n\n {withLegend ? (\n <Legend\n content={({ payload }) => (\n <ChartLegend\n className=\"ui-area-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-line-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 {radars}\n </ReChartsRadarChart>\n </ResponsiveContainer>\n </ui.div>\n </ChartProvider>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,UAAU;AACnB,SAAS,eAAe;AACxB;AAAA,EACE;AAAA,EACA,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAiJC,cAmBE,YAnBF;AA/ED,IAAM,aAAa,WAAmC,CAAC,OAAO,QAAQ;AAC3E,QAAM,CAAC,QAAQ,WAAW,IAAI,uBAAuB,cAAc,KAAK;AACxE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,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BACtB,IACE;AAAA,gBAEH;AAAA;AAAA;AAAA,UACH;AAAA;AAAA,MACF;AAAA;AAAA,EACF,GACF;AAEJ,CAAC;","names":["dataKey"]}
|
@@ -2,7 +2,7 @@
|
|
2
2
|
import {
|
3
3
|
pieChartLabel,
|
4
4
|
pieChartLabelLine
|
5
|
-
} from "./chunk-
|
5
|
+
} from "./chunk-VEFEKDMH.mjs";
|
6
6
|
import {
|
7
7
|
pieChartProperties,
|
8
8
|
pieProperties
|
@@ -13,10 +13,7 @@ import {
|
|
13
13
|
} from "./chunk-QL3DB7OJ.mjs";
|
14
14
|
|
15
15
|
// src/use-pie-chart.ts
|
16
|
-
import {
|
17
|
-
getVar,
|
18
|
-
useTheme
|
19
|
-
} from "@yamada-ui/core";
|
16
|
+
import { getVar, useTheme } from "@yamada-ui/core";
|
20
17
|
import { cx } from "@yamada-ui/utils";
|
21
18
|
import { useCallback, useMemo, useState } from "react";
|
22
19
|
var usePieChart = ({
|
@@ -230,4 +227,4 @@ var usePieChart = ({
|
|
230
227
|
export {
|
231
228
|
usePieChart
|
232
229
|
};
|
233
|
-
//# sourceMappingURL=chunk-
|
230
|
+
//# sourceMappingURL=chunk-OFD66B3S.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/use-pie-chart.ts"],"sourcesContent":["import { getVar, useTheme } from \"@yamada-ui/core\"\nimport type {\n CSSUIObject,\n CSSUIProps,\n PropGetter,\n RequiredPropGetter,\n} 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 { getClassName, getComponentProps } from \"./chart-utils\"\nimport type { CellProps, PieChartProps, PieProps } from \"./chart.types\"\nimport { pieChartLabel, pieChartLabelLine } from \"./pie-chart-label\"\nimport { pieChartProperties, pieProperties } from \"./rechart-properties\"\n\nexport interface UsePieChartOptions {\n /**\n * Chart data.\n */\n data: CellProps[]\n /**\n * Props passed down to recharts `PieChart` component.\n */\n chartProps?: PieChartProps\n /**\n * Props for the pie.\n */\n pieProps?: Partial<PieProps>\n /**\n * Props for the cell.\n */\n cellProps?: Partial<CellProps>\n /**\n * Determines whether each segment should have associated label.\n *\n * @default false\n */\n withLabels?: boolean\n /**\n * Determines whether segments labels should have lines that connect the segment with the label.\n *\n * @default false\n */\n withLabelLines?: boolean\n /**\n * Distance between chart and label.\n */\n labelOffset?: number\n /**\n * Determines whether labels should be displayed as percentages.\n *\n * @default false\n */\n isPercent?: boolean\n /**\n * Controls innerRadius of the chart segments.\n * If it is a number, it is the width of the radius.\n * For example, `60` means the radius is `60px` and the diameter is `120px`.\n *\n * @default '0%'\n */\n innerRadius?: number | string\n /**\n * Controls thickness of the chart segments. If it is a number, it is calculated as px.\n * If it is a number, it is the width of the radius.\n * For example, `60` means the radius is `60px` and the diameter is `120px`.\n *\n * @default '80%'\n */\n outerRadius?: number | string\n /**\n * Controls padding between segments.\n *\n * @default 0\n */\n paddingAngle?: number\n /**\n * Stroke width for the chart pies.\n *\n * @default 1\n */\n strokeWidth?: number\n /**\n * Controls angle at which chart starts.\n *\n * @default 90\n */\n startAngle?: number\n /**\n * Controls angle at which chart ends.\n *\n * @default -270\n */\n endAngle?: number\n /**\n * Controls fill opacity of all pies.\n *\n * @default 1\n */\n fillOpacity?: number | [number, number]\n /**\n * A function to format labels.\n */\n labelFormatter?: (value: number) => string\n}\n\ninterface UsePieChartProps extends UsePieChartOptions {\n styles: Dict<CSSUIObject>\n}\n\nexport const usePieChart = ({\n data,\n withLabels = false,\n withLabelLines = false,\n labelOffset,\n isPercent = false,\n strokeWidth = 1,\n fillOpacity = 1,\n innerRadius = \"0%\",\n outerRadius = withLabels ? \"80%\" : \"100%\",\n paddingAngle = 0,\n startAngle = 90,\n endAngle = -270,\n labelFormatter,\n styles,\n ...rest\n}: UsePieChartProps) => {\n const { theme } = useTheme()\n const [highlightedArea, setHighlightedArea] = useState<string | null>(null)\n const shouldHighlight = highlightedArea !== null\n const { dimCell, ...computedCellProps } = rest.cellProps ?? {}\n const {\n activeShape = {},\n inactiveShape = {},\n label: labelProps,\n labelLine: labelLineProps,\n ...computedPieProps\n } = rest.pieProps ?? {}\n\n const cellColors: CSSUIProps[\"vars\"] = useMemo(\n () =>\n data.map(({ color }, index) => ({\n name: `cell-${index}`,\n token: \"colors\",\n value: color ?? \"transparent\",\n })),\n [data],\n )\n\n const pieVars: CSSUIProps[\"vars\"] = useMemo(\n () =>\n [\n ...cellColors,\n { name: \"fill-opacity\", value: fillOpacity },\n ] as Required<CSSUIProps>[\"vars\"],\n [fillOpacity, cellColors],\n )\n\n const [chartProps, chartClassName] = useMemo(\n () =>\n getComponentProps<Dict, string>(\n [rest.chartProps ?? {}, pieChartProperties],\n styles.chart,\n )(theme),\n [rest.chartProps, styles.chart, theme],\n )\n\n const [pieProps, pieClassName] = useMemo(\n () =>\n getComponentProps<Dict, string>(\n [computedPieProps, pieProperties],\n styles.pie,\n )(theme),\n [computedPieProps, styles.pie, theme],\n )\n\n const cellClassName = useMemo(() => {\n const resolvedCellProps = {\n fillOpacity: \"$fill-opacity\",\n ...styles.cell,\n ...computedCellProps,\n }\n\n return getClassName(resolvedCellProps)(theme)\n }, [computedCellProps, styles.cell, theme])\n\n const dimCellClassName = useMemo(() => {\n const resolvedDimCell = { ...styles.dimCell, ...dimCell }\n\n return getClassName(resolvedDimCell)(theme)\n }, [dimCell, styles.dimCell, theme])\n\n const activeShapeProps = useMemo(\n () =>\n getComponentProps<Dict, string>(\n [activeShape, pieProperties],\n styles.activeShape,\n )(theme, true),\n [activeShape, styles.activeShape, theme],\n )\n\n const inactiveShapeProps = useMemo(\n () =>\n getComponentProps<Dict, string>(\n [inactiveShape, pieProperties],\n styles.inactiveShape,\n )(theme, true),\n [inactiveShape, styles.inactiveShape, theme],\n )\n\n const label: Recharts.PieLabel = useCallback(\n (props: any) =>\n pieChartLabel({\n labelOffset,\n isPercent,\n labelProps,\n labelFormatter,\n styles: styles.label,\n ...props,\n }),\n [isPercent, labelOffset, labelProps, styles.label, labelFormatter],\n )\n\n const labelLine = useCallback(\n (props: any) => {\n return pieChartLabelLine({\n labelOffset,\n labelLineProps,\n styles: styles.labelLine,\n ...props,\n })\n },\n [labelLineProps, labelOffset, styles.labelLine],\n )\n\n const cellPropList = useMemo(\n () =>\n data.map((props, index) => {\n const { name, dimCell = {}, ...computedProps } = props\n const color = getVar(`cell-${index}`)(theme)\n const dimmed = shouldHighlight && highlightedArea !== name\n const resolvedProps = {\n ...computedProps,\n ...(dimmed ? dimCell : {}),\n }\n\n const className = getClassName(\n {\n cellClassName,\n ...resolvedProps,\n },\n dimmed ? dimCellClassName : undefined,\n )(theme)\n\n return {\n color,\n className,\n }\n }),\n [\n cellClassName,\n data,\n dimCellClassName,\n highlightedArea,\n shouldHighlight,\n theme,\n ],\n )\n\n const getPieChartProps: PropGetter<\n ComponentPropsWithoutRef<typeof Recharts.PieChart>,\n ComponentPropsWithoutRef<typeof Recharts.PieChart>\n > = useCallback(\n ({ className, ...props } = {}, ref = null) => ({\n ref,\n className: cx(className, chartClassName),\n ...props,\n ...chartProps,\n }),\n [chartProps, chartClassName],\n )\n\n const getPieProps: RequiredPropGetter<\n Partial<Recharts.PieProps>,\n Omit<Recharts.PieProps, \"ref\">\n > = useCallback(\n ({ className, ...props }, ref = null) => ({\n ref,\n className: cx(className, pieClassName),\n dataKey: \"value\",\n data,\n rootTabIndex: -1,\n outerRadius,\n innerRadius,\n paddingAngle,\n startAngle,\n endAngle,\n isAnimationActive: false,\n label: withLabels ? label : false,\n labelLine: withLabelLines ? labelLine : false,\n activeShape: activeShapeProps,\n inactiveShape: inactiveShapeProps,\n ...(props as Omit<Recharts.PieProps, \"dataKey\">),\n ...pieProps,\n }),\n [\n pieClassName,\n data,\n outerRadius,\n innerRadius,\n paddingAngle,\n startAngle,\n endAngle,\n withLabels,\n label,\n withLabelLines,\n labelLine,\n activeShapeProps,\n inactiveShapeProps,\n pieProps,\n ],\n )\n\n const getCellProps: RequiredPropGetter<\n Omit<Recharts.CellProps, \"ref\"> & { index: number },\n Recharts.CellProps\n > = useCallback(\n ({ index, className: classNameProp, ...props }, ref = null) => {\n const { className, color } = cellPropList[index]\n\n return {\n ref,\n className: cx(classNameProp, className),\n fill: color,\n stroke: color,\n strokeWidth,\n ...(props as Recharts.CellProps),\n }\n },\n [cellPropList, strokeWidth],\n )\n\n return {\n pieVars,\n getPieProps,\n getPieChartProps,\n getCellProps,\n setHighlightedArea,\n }\n}\n\nexport type UsePieChartReturn = ReturnType<typeof usePieChart>\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,QAAQ,gBAAgB;AAOjC,SAAS,UAAU;AAGnB,SAAS,aAAa,SAAS,gBAAgB;AAsGxC,IAAM,cAAc,CAAC;AAAA,EAC1B;AAAA,EACA,aAAa;AAAA,EACb,iBAAiB;AAAA,EACjB;AAAA,EACA,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,cAAc;AAAA,EACd,cAAc;AAAA,EACd,cAAc,aAAa,QAAQ;AAAA,EACnC,eAAe;AAAA,EACf,aAAa;AAAA,EACb,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAwB;AAhIxB;AAiIE,QAAM,EAAE,MAAM,IAAI,SAAS;AAC3B,QAAM,CAAC,iBAAiB,kBAAkB,IAAI,SAAwB,IAAI;AAC1E,QAAM,kBAAkB,oBAAoB;AAC5C,QAAM,EAAE,SAAS,GAAG,kBAAkB,KAAI,UAAK,cAAL,YAAkB,CAAC;AAC7D,QAAM;AAAA,IACJ,cAAc,CAAC;AAAA,IACf,gBAAgB,CAAC;AAAA,IACjB,OAAO;AAAA,IACP,WAAW;AAAA,IACX,GAAG;AAAA,EACL,KAAI,UAAK,aAAL,YAAiB,CAAC;AAEtB,QAAM,aAAiC;AAAA,IACrC,MACE,KAAK,IAAI,CAAC,EAAE,MAAM,GA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"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/use-chart-tooltip.ts"],"sourcesContent":["import { useTheme } from \"@yamada-ui/core\"\nimport type { CSSUIObject, PropGetter } from \"@yamada-ui/core\"\nimport { splitObject, cx } from \"@yamada-ui/utils\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport { useCallback, useMemo } from \"react\"\nimport type * as Recharts from \"recharts\"\nimport { getClassName } from \"./chart-utils\"\nimport type { TooltipProps } from \"./chart.types\"\nimport { tooltipProperties } from \"./rechart-properties\"\n\nexport interface UseChartTooltipOptions {\n /**\n * Props passed down to recharts 'Tooltip' component.\n */\n tooltipProps?: TooltipProps\n /**\n * Specifies the duration of animation, the unit of this option is ms.\n *\n * @default 0\n */\n tooltipAnimationDuration?: number\n /**\n * A function to format values on inside the tooltip.\n */\n valueFormatter?: (value: any) => string\n /**\n * A function to format labels on inside the tooltip.\n */\n labelFormatter?: (label: string) => string\n}\n\ninterface UseChartTooltipProps extends UseChartTooltipOptions {\n styles: Dict<CSSUIObject>\n}\n\nexport const useChartTooltip = ({\n tooltipProps: _tooltipProps = {},\n tooltipAnimationDuration = 0,\n styles,\n}: UseChartTooltipProps) => {\n const { theme } = useTheme()\n const { cursor, ...rest } = _tooltipProps\n const cursorClassName = useMemo(\n () => getClassName({ ...styles.cursor, ...cursor })(theme),\n [cursor, styles.cursor, theme],\n )\n\n const [tooltipProps, tooltipUIProps] = splitObject<Dict, string>(\n rest,\n tooltipProperties,\n )\n\n const getTooltipProps: PropGetter<\n Partial<Recharts.TooltipProps<any, any>>,\n Recharts.TooltipProps<any, any>\n > = useCallback(\n (props, ref = null) => ({\n ref,\n animationDuration: tooltipAnimationDuration,\n isAnimationActive: (tooltipAnimationDuration || 0) > 0,\n cursor: {\n className: cx(\"ui-chart__cursor\", cursorClassName),\n },\n ...props,\n ...tooltipProps,\n }),\n [cursorClassName, tooltipAnimationDuration, tooltipProps],\n )\n\n return { tooltipProps: tooltipUIProps, getTooltipProps }\n}\n"],"mappings":";;;;;;;;;AAAA,SAAS,gBAAgB;AAEzB,SAAS,aAAa,UAAU;AAEhC,SAAS,aAAa,eAAe;AA+B9B,IAAM,kBAAkB,CAAC;AAAA,EAC9B,cAAc,gBAAgB,CAAC;AAAA,EAC/B,2BAA2B;AAAA,EAC3B;AACF,MAA4B;AAC1B,QAAM,EAAE,MAAM,IAAI,SAAS;AAC3B,QAAM,EAAE,QAAQ,GAAG,KAAK,IAAI;AAC5B,QAAM,kBAAkB;AAAA,IACtB,MAAM,aAAa,EAAE,GAAG,OAAO,QAAQ,GAAG,OAAO,CAAC,EAAE,KAAK;AAAA,IACzD,CAAC,QAAQ,OAAO,QAAQ,KAAK;AAAA,EAC/B;AAEA,QAAM,CAAC,cAAc,cAAc,IAAI;AAAA,IACrC;AAAA,IACA;AAAA,EACF;AAEA,QAAM,kBAGF;AAAA,IACF,CAAC,OAAO,MAAM,UAAU;AAAA,MACtB;AAAA,MACA,mBAAmB;AAAA,MACnB,oBAAoB,4BAA4B,KAAK;AAAA,MACrD,QAAQ;AAAA,QACN,WAAW,GAAG,oBAAoB,eAAe;AAAA,MACnD;AAAA,MACA,GAAG;AAAA,MACH,GAAG;AAAA,IACL;AAAA,IACA,CAAC,iBAAiB,0BAA0B,YAAY;AAAA,EAC1D;AAEA,SAAO,EAAE,cAAc,gBAAgB,gBAAgB;AACzD;","names":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/use-radar-chart.ts"],"sourcesContent":["import { getVar, useTheme } from \"@yamada-ui/core\"\nimport type {\n CSSUIObject,\n CSSUIProps,\n PropGetter,\n RequiredPropGetter,\n} 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 { getClassName, getComponentProps } from \"./chart-utils\"\nimport type {\n PolarAngleAxisProps,\n PolarRadiusAxisProps,\n RadarChartProps,\n RadarProps,\n} from \"./chart.types\"\nimport {\n dotProperties,\n polarAngleAxisProperties,\n polarRadiusAxisProperties,\n radarChartProperties,\n radarProperties,\n} from \"./rechart-properties\"\n\nexport interface UseRadarChartOptions {\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: RadarProps[]\n /**\n * The key of a group of data which should be unique in an chart.\n */\n dataKey: string\n /**\n * Props for the radar.\n */\n radarProps?: Partial<RadarProps>\n /**\n * Props passed down to recharts `RadarChart` component.\n */\n chartProps?: RadarChartProps\n /**\n * Props passed down to recharts `PolarAngleAxis` component.\n */\n polarAngleAxisProps?: PolarAngleAxisProps\n /**\n * Props passed down to recharts `tick` of `PolarAngleAxis` component.\n */\n polarAngleAxisTickProps?: CSSUIProps\n /**\n * Props passed down to recharts `PolarRadiusAxis` component.\n */\n polarRadiusAxisProps?: PolarRadiusAxisProps\n /**\n * Props passed down to recharts `tick` of `PolarRadiusAxis` component.\n */\n polarRadiusAxisTickProps?: CSSUIProps\n /**\n * Determines whether dots should be displayed.\n *\n * @default false\n */\n withDots?: boolean\n /**\n * Determines whether activeDots should be displayed.\n *\n * @default true\n */\n withActiveDots?: boolean\n /**\n * Stroke width for the chart radars.\n *\n * @default 2\n */\n strokeWidth?: number\n /**\n * Controls fill opacity of all radars.\n *\n * @default 1\n */\n fillOpacity?: number | [number, number]\n /**\n * A function to format Y axis tick.\n */\n polarAngleAxisTickFormatter?: (value: number) => string\n /**\n * A function to format X axis tick.\n */\n polarRadiusAxisTickFormatter?: (value: number) => string\n}\n\ninterface UseRadarChartProps extends UseRadarChartOptions {\n styles: Dict<CSSUIObject>\n}\n\nexport const useRadarChart = ({\n data,\n series,\n dataKey,\n withDots = false,\n withActiveDots = false,\n strokeWidth = 2,\n fillOpacity = 0.4,\n polarAngleAxisTickFormatter,\n polarRadiusAxisTickFormatter,\n styles,\n ...rest\n}: UseRadarChartProps) => {\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 dimRadar = {},\n ...computedRadarProps\n } = rest.radarProps ?? {}\n\n const radarColors: CSSUIProps[\"vars\"] = useMemo(\n () =>\n series.map(({ color }, index) => ({\n name: `radar-${index}`,\n token: \"colors\",\n value: color ?? \"transparent\",\n })),\n [series],\n )\n\n const radarVars: CSSUIProps[\"vars\"] = useMemo(\n () =>\n [\n ...radarColors,\n { name: \"fill-opacity\", value: fillOpacity },\n ] as Required<CSSUIProps>[\"vars\"],\n [fillOpacity, radarColors],\n )\n\n const [chartProps, radarChartClassName] = useMemo(\n () =>\n getComponentProps<Dict, string>(\n [rest.chartProps ?? {}, radarChartProperties],\n styles.chart,\n )(theme),\n [rest.chartProps, styles.chart, theme],\n )\n\n const [polarAngleAxisProps, polarAngleAxisClassName] = useMemo(\n () =>\n getComponentProps<Dict, string>(\n [rest.polarAngleAxisProps ?? {}, polarAngleAxisProperties],\n styles.polarAngleAxis,\n )(theme),\n [rest.polarAngleAxisProps, styles.polarAngleAxis, theme],\n )\n\n const polarAngleAxisTickClassName = useMemo(\n () =>\n getClassName({\n ...styles.polarAngleAxisTick,\n ...rest.polarAngleAxisTickProps,\n })(theme),\n [rest.polarAngleAxisTickProps, styles.polarAngleAxisTick, theme],\n )\n\n const [polarRadiusAxisProps, polarRadiusAxisClassName] = useMemo(\n () =>\n getComponentProps<Dict, string>(\n [rest.polarRadiusAxisProps ?? {}, polarRadiusAxisProperties],\n styles.polarRadiusAxis,\n )(theme),\n [rest.polarRadiusAxisProps, styles.polarRadiusAxis, theme],\n )\n\n const polarRadiusAxisTickClassName = useMemo(\n () =>\n getClassName({\n ...styles.polarRadiusAxisTick,\n ...rest.polarRadiusAxisTickProps,\n })(theme),\n [rest.polarRadiusAxisTickProps, styles.polarRadiusAxisTick, theme],\n )\n\n const [radarProps, radarClassName] = useMemo(() => {\n const resolvedRadarProps = {\n fillOpacity: \"$fill-opacity\",\n ...computedRadarProps,\n }\n\n return getComponentProps<Dict, string>(\n [resolvedRadarProps, radarProperties],\n styles.radar,\n )(theme)\n }, [computedRadarProps, styles.radar, theme])\n\n const [dimRadarProps, dimRadarClassName] = useMemo(\n () =>\n getComponentProps<Dict, string>(\n [dimRadar, radarProperties],\n styles.dimRadar,\n )(theme),\n [dimRadar, styles.dimRadar, theme],\n )\n\n const [dotProps, dotClassName] = useMemo(\n () =>\n getComponentProps<Dict, string>([dot, dotProperties], styles.dot)(theme),\n [dot, styles.dot, theme],\n )\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 () =>\n getComponentProps<Dict, string>(\n [dimDot, dotProperties],\n styles.dimDot,\n )(theme),\n [dimDot, styles.dimDot, theme],\n )\n\n const radarPropList = useMemo(\n () =>\n series.map((props, index) => {\n const {\n dataKey,\n dot = {},\n activeDot = {},\n dimDot = {},\n dimRadar = {},\n ...computedProps\n } = props\n const color = getVar(`radar-${index}`)(theme)\n const dimmed = shouldHighlight && highlightedArea !== dataKey\n const computedDimRadar = { ...dimRadarProps, ...dimRadar }\n\n const resolvedProps = {\n ...radarProps,\n ...computedProps,\n ...(dimmed ? computedDimRadar : {}),\n }\n const rest = getComponentProps<Dict, string>(\n [resolvedProps, radarProperties],\n radarClassName,\n dimmed ? dimRadarClassName : undefined,\n )(theme, true)\n\n let resolvedActiveDot: Recharts.DotProps | boolean\n\n if (withActiveDots) {\n const computedActiveDot = {\n ...activeDotProps,\n ...activeDot,\n }\n\n const [rest, className] = getComponentProps<Dict, string>(\n [computedActiveDot, dotProperties],\n activeDotClassName,\n )(theme)\n\n resolvedActiveDot = {\n className: cx(\n \"ui-radar-chart__dot\",\n \"ui-radar-chart__dot--active\",\n className,\n ),\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-radar-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 color,\n dataKey,\n dot: resolvedDot,\n activeDot: resolvedActiveDot,\n }\n }),\n [\n activeDotClassName,\n activeDotProps,\n dimDotClassName,\n dimDotProps,\n dimRadarClassName,\n dimRadarProps,\n dotClassName,\n dotProps,\n highlightedArea,\n radarClassName,\n radarProps,\n series,\n shouldHighlight,\n theme,\n withActiveDots,\n withDots,\n ],\n )\n\n const getRadarChartProps: PropGetter<\n ComponentPropsWithoutRef<typeof Recharts.RadarChart>,\n ComponentPropsWithoutRef<typeof Recharts.RadarChart>\n > = useCallback(\n ({ className, ...props } = {}, ref = null) => ({\n ref,\n className: cx(className, radarChartClassName),\n data,\n ...props,\n ...chartProps,\n }),\n [data, radarChartClassName, chartProps],\n )\n\n const getRadarProps: RequiredPropGetter<\n Partial<Recharts.RadarProps> & { index: number },\n Omit<Recharts.RadarProps, \"ref\">\n > = useCallback(\n ({ index, className: classNameProp, ...props }, ref = null) => {\n const { color, className, dataKey, activeDot, dot, ...rest } =\n radarPropList[index]\n\n return {\n ref,\n className: cx(classNameProp, className),\n activeDot,\n dot,\n name: dataKey as string,\n dataKey,\n fill: color,\n strokeWidth,\n stroke: color,\n isAnimationActive: false,\n ...(props as Omit<Recharts.RadarProps, \"dataKey\">),\n ...rest,\n }\n },\n [radarPropList, strokeWidth],\n )\n\n const getPolarAngleAxisProps: PropGetter<\n Recharts.PolarAngleAxisProps,\n Omit<Recharts.PolarAngleAxisProps, \"ref\">\n > = useCallback(\n ({ className, ...props } = {}, ref = null) => ({\n ref,\n className: cx(className, polarAngleAxisClassName),\n dataKey,\n tick: {\n className: cx(\n \"ui-radar-chart__polar-angle-axis-tick\",\n polarAngleAxisTickClassName,\n ),\n },\n tickFormatter: polarAngleAxisTickFormatter,\n tickSize: 16,\n ...props,\n ...polarAngleAxisProps,\n }),\n [\n dataKey,\n polarAngleAxisClassName,\n polarAngleAxisProps,\n polarAngleAxisTickClassName,\n polarAngleAxisTickFormatter,\n ],\n )\n\n const getPolarRadiusAxisProps: PropGetter<\n Recharts.PolarRadiusAxisProps,\n Omit<Recharts.PolarRadiusAxisProps, \"ref\">\n > = useCallback(\n ({ className, ...props } = {}, ref = null) => ({\n ref,\n className: cx(className, polarRadiusAxisClassName),\n tick: {\n className: cx(\n \"ui-radar-chart__polar-radius-axis-tick\",\n polarRadiusAxisTickClassName,\n ),\n },\n tickFormatter: polarRadiusAxisTickFormatter,\n ...props,\n ...polarRadiusAxisProps,\n }),\n [\n polarRadiusAxisClassName,\n polarRadiusAxisProps,\n polarRadiusAxisTickClassName,\n polarRadiusAxisTickFormatter,\n ],\n )\n\n return {\n radarVars,\n getRadarChartProps,\n getRadarProps,\n getPolarAngleAxisProps,\n getPolarRadiusAxisProps,\n setHighlightedArea,\n }\n}\n\nexport type UseRadarChartReturn = ReturnType<typeof useRadarChart>\n"],"mappings":";;;;;;;;;;;;;;AAAA,SAAS,QAAQ,gBAAgB;AAOjC,SAAS,UAAU;AAGnB,SAAS,aAAa,SAAS,gBAAgB;AA4FxC,IAAM,gBAAgB,CAAC;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAA0B;A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ACF;AACF;","names":["_a","dataKey","dot","activeDot","dimDot","dimRadar","rest"]}
|
@@ -1,30 +1,30 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
usePieChart
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-OFD66B3S.mjs";
|
5
5
|
import {
|
6
6
|
useChartTooltip
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-OJ2MLZZ7.mjs";
|
8
8
|
import {
|
9
9
|
useChartLegend
|
10
|
-
} from "./chunk-
|
10
|
+
} from "./chunk-IJRYXT4V.mjs";
|
11
11
|
import {
|
12
12
|
ChartLegend
|
13
|
-
} from "./chunk-
|
13
|
+
} from "./chunk-LLOU2WIV.mjs";
|
14
14
|
import {
|
15
15
|
ChartTooltip
|
16
|
-
} from "./chunk-
|
16
|
+
} from "./chunk-UANITMH7.mjs";
|
17
17
|
import {
|
18
18
|
ChartProvider,
|
19
19
|
useChart
|
20
|
-
} from "./chunk-
|
20
|
+
} from "./chunk-A3IWA366.mjs";
|
21
21
|
|
22
22
|
// src/pie-chart.tsx
|
23
23
|
import {
|
24
24
|
forwardRef,
|
25
25
|
omitThemeProps,
|
26
26
|
ui,
|
27
|
-
|
27
|
+
useComponentMultiStyle
|
28
28
|
} from "@yamada-ui/core";
|
29
29
|
import { cx } from "@yamada-ui/utils";
|
30
30
|
import { useMemo } from "react";
|
@@ -38,7 +38,7 @@ import {
|
|
38
38
|
} from "recharts";
|
39
39
|
import { jsx, jsxs } from "react/jsx-runtime";
|
40
40
|
var PieChart = forwardRef((props, ref) => {
|
41
|
-
const [styles, mergedProps] =
|
41
|
+
const [styles, mergedProps] = useComponentMultiStyle("PieChart", props);
|
42
42
|
const {
|
43
43
|
className,
|
44
44
|
data,
|
@@ -179,4 +179,4 @@ var PieChart = forwardRef((props, ref) => {
|
|
179
179
|
export {
|
180
180
|
PieChart
|
181
181
|
};
|
182
|
-
//# sourceMappingURL=chunk-
|
182
|
+
//# sourceMappingURL=chunk-RMYXEG2O.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/pie-chart.tsx"],"sourcesContent":["import type { HTMLUIProps, ThemeProps } from \"@yamada-ui/core\"\nimport {\n forwardRef,\n omitThemeProps,\n ui,\n useComponentMultiStyle,\n} from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useMemo } from \"react\"\nimport {\n Cell,\n Legend,\n Pie,\n PieChart as RechartsPieChart,\n ResponsiveContainer,\n Tooltip,\n} from \"recharts\"\nimport { ChartLegend } from \"./chart-legend\"\nimport { ChartTooltip } from \"./chart-tooltip\"\nimport type { TooltipDataSourceType } from \"./chart.types\"\nimport type { UseChartProps } from \"./use-chart\"\nimport { ChartProvider, useChart } from \"./use-chart\"\nimport type { UseChartLegendProps } from \"./use-chart-legend\"\nimport { useChartLegend } from \"./use-chart-legend\"\nimport { useChartTooltip } from \"./use-chart-tooltip\"\nimport type { UseChartTooltipOptions } from \"./use-chart-tooltip\"\nimport type { UsePieChartOptions } from \"./use-pie-chart\"\nimport { usePieChart } from \"./use-pie-chart\"\n\ninterface PieChartOptions {\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 * Determines which data is displayed in the tooltip.\n *\n * @default 'all'\n */\n tooltipDataSource?: TooltipDataSourceType\n /**\n * Unit displayed next to each value in tooltip.\n */\n unit?: string\n}\n\nexport interface PieChartProps\n extends Omit<HTMLUIProps, \"strokeWidth\" | \"fillOpacity\">,\n ThemeProps<\"pieChart\">,\n PieChartOptions,\n UsePieChartOptions,\n Omit<UseChartTooltipOptions, \"labelFormatter\">,\n UseChartLegendProps,\n UseChartProps {}\n\n/**\n * `PieChart` is a component for drawing pie charts to compare multiple sets of data.\n *\n * @see Docs https://yamada-ui.com/components/data-display/pie-chart\n */\nexport const PieChart = forwardRef<PieChartProps, \"div\">((props, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\"PieChart\", props)\n const {\n className,\n data,\n pieProps,\n chartProps,\n cellProps,\n containerProps,\n withTooltip = true,\n withLegend = false,\n tooltipProps,\n tooltipAnimationDuration,\n tooltipDataSource = \"all\",\n valueFormatter,\n labelFormatter,\n unit,\n innerRadius,\n outerRadius,\n paddingAngle,\n startAngle,\n endAngle,\n withLabels,\n withLabelLines,\n labelOffset,\n isPercent,\n strokeWidth,\n legendProps,\n ...rest\n } = omitThemeProps(mergedProps)\n\n const {\n pieVars,\n getPieProps,\n getPieChartProps,\n getCellProps,\n setHighlightedArea,\n } = usePieChart({\n data,\n pieProps,\n chartProps,\n cellProps,\n innerRadius,\n outerRadius,\n paddingAngle,\n startAngle,\n endAngle,\n strokeWidth,\n withLabels,\n withLabelLines,\n labelOffset,\n isPercent,\n labelFormatter,\n styles,\n })\n const { getContainerProps } = useChart({ containerProps })\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 cells = useMemo(\n () =>\n data.map(({ name }, index) => (\n <Cell\n key={`pie-cell-${name}`}\n {...getCellProps({ index, className: \"ui-pie-chart__cell\" })}\n />\n )),\n [data, getCellProps],\n )\n\n return (\n <ChartProvider value={{ styles }}>\n <ui.div\n ref={ref}\n className={cx(\"ui-pie-chart\", className)}\n __css={{ maxW: \"full\", vars: pieVars, ...styles.container }}\n {...rest}\n >\n <ResponsiveContainer\n {...getContainerProps({ className: \"ui-pie-chart__container\" })}\n >\n <RechartsPieChart\n {...getPieChartProps({ className: \"ui-pie-chart__chart\" })}\n >\n <Pie\n {...getPieProps({\n className: \"ui-pie-chart__pie\",\n })}\n >\n {cells}\n </Pie>\n\n {withLegend ? (\n <Legend\n content={({ payload }) => (\n <ChartLegend\n className=\"ui-pie-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-pie-chart__tooltip\"\n label={label}\n payload={tooltipDataSource === \"segment\" ? payload : data}\n valueFormatter={valueFormatter}\n unit={unit}\n {...computedTooltipProps}\n />\n )}\n {...getTooltipProps()}\n />\n ) : null}\n </RechartsPieChart>\n </ResponsiveContainer>\n </ui.div>\n </ChartProvider>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,UAAU;AACnB,SAAS,eAAe;AACxB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,OACK;AAyHC,cAmBE,YAnBF;AArED,IAAM,WAAW,WAAiC,CAAC,OAAO,QAAQ;AACvE,QAAM,CAAC,QAAQ,WAAW,IAAI,uBAAuB,YAAY,KAAK;AACtE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd,aAAa;AAAA,IACb;AAAA,IACA;AAAA,IACA,oBAAoB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI,eAAe,WAAW;AAE9B,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,YAAY;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA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e;AAAA;AAAA,gBACrB,IACE;AAAA,gBAEH,cACC;AAAA,kBAAC;AAAA;AAAA,oBACC,SAAS,CAAC,EAAE,OAAO,QAAQ,MACzB;AAAA,sBAAC;AAAA;AAAA,wBACC,WAAU;AAAA,wBACV;AAAA,wBACA,SAAS,sBAAsB,YAAY,UAAU;AAAA,wBACrD;AAAA,wBACA;AAAA,wBACC,GAAG;AAAA;AAAA,oBACN;AAAA,oBAED,GAAG,gBAAgB;AAAA;AAAA,gBACtB,IACE;AAAA;AAAA;AAAA,UACN;AAAA;AAAA,MACF;AAAA;AAAA,EACF,GACF;AAEJ,CAAC;","names":[]}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
useTooltip
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-A3IWA366.mjs";
|
5
5
|
|
6
6
|
// src/chart-tooltip.tsx
|
7
7
|
import { forwardRef, ui } from "@yamada-ui/core";
|
@@ -98,4 +98,4 @@ var ChartTooltip = forwardRef(
|
|
98
98
|
export {
|
99
99
|
ChartTooltip
|
100
100
|
};
|
101
|
-
//# sourceMappingURL=chunk-
|
101
|
+
//# sourceMappingURL=chunk-UANITMH7.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/chart-tooltip.tsx"],"sourcesContent":["import { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx, isArray } from \"@yamada-ui/utils\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport { useTooltip } from \"./use-chart\"\n\nexport interface ChartTooltipProps {\n label?: string\n dataKey?: string\n payload: Dict[] | undefined\n valueFormatter?: (value: any) => string\n labelFormatter?: (label: string) => string\n unit?: string\n isRadialChart?: boolean\n}\n\nexport const ChartTooltip = forwardRef<ChartTooltipProps, \"div\">(\n (\n {\n label,\n dataKey = \"value\",\n className,\n payload = [],\n valueFormatter,\n labelFormatter,\n unit,\n isRadialChart,\n ...rest\n },\n ref,\n ) => {\n const { styles } = useTooltip()\n\n const items = payload.map(\n (\n {\n color: colorProp,\n name: nameProp,\n [dataKey]: valueProp,\n payload,\n } = {},\n index,\n ) => {\n const name = isRadialChart ? payload?.name : nameProp\n const color = colorProp ?? payload?.color\n let value: string\n\n if (isArray(valueProp)) {\n value = valueProp\n .map((value) => {\n return `${valueFormatter?.(value) ?? value}`\n })\n .join(\" - \")\n } else {\n value = valueFormatter?.(valueProp) ?? valueProp\n }\n\n return (\n <ui.div\n className=\"ui-chart__tooltip-item\"\n key={`tooltip-payload-${index}`}\n __css={styles.tooltipItem}\n >\n <ui.div\n className=\"ui-chart__tooltip-swatch\"\n background={color}\n __css={styles.tooltipSwatch}\n />\n\n <ui.span\n className=\"ui-chart__tooltip-label\"\n __css={styles.tooltipLabel}\n >\n {name}\n </ui.span>\n\n <ui.span\n className=\"ui-chart__tooltip-value\"\n __css={styles.tooltipValue}\n >\n {value}\n {unit ? unit : \"\"}\n </ui.span>\n </ui.div>\n )\n },\n )\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-chart__tooltip\", className)}\n __css={styles.tooltip}\n {...rest}\n >\n {label ? (\n <ui.p className=\"ui-chart__tooltip-title\" __css={styles.tooltipTitle}>\n {labelFormatter?.(label) ?? label}\n </ui.p>\n ) : null}\n\n <ui.div className=\"ui-chart__tooltip-list\" __css={styles.tooltipList}>\n {items}\n </ui.div>\n </ui.div>\n )\n },\n)\n"],"mappings":";;;;;;AAAA,SAAS,YAAY,UAAU;AAC/B,SAAS,IAAI,eAAe;AA6DhB,cAaA,YAbA;AA/CL,IAAM,eAAe;AAAA,EAC1B,CACE;AAAA,IACE;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA,UAAU,CAAC;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GACA,QACG;AA7BP;AA8BI,UAAM,EAAE,OAAO,IAAI,WAAW;AAE9B,UAAM,QAAQ,QAAQ;AAAA,MACpB,CACE;AAAA,QACE,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AAK,WAAU,2BAA0B,OAAO,OAAO,cACrD,iEAAiB,WAAjB,YAA2B,OAC9B,IACE;AAAA,UAEJ,oBAAC,GAAG,KAAH,EAAO,WAAU,0BAAyB,OAAO,OAAO,aACtD,iBACH;AAAA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;","names":["payload","_a","value"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/pie-chart-label.tsx"],"sourcesContent":["import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport { ui } from \"@yamada-ui/core\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport { cx, isUndefined } from \"@yamada-ui/utils\"\nimport type { ReactNode } from \"react\"\n\nconst RADIAN = Math.PI / 180\nconst DEFAULT_LABEL_OFFSET = 22\n\nexport interface PieChartLabelProps {\n className?: string\n cx?: number\n cy?: number\n midAngle?: number\n innerRadius?: number\n outerRadius?: number\n middleRadius?: number\n percent?: number\n value?: number\n labelOffset?: number\n isPercent?: boolean\n labelProps?: HTMLUIProps<\"text\">\n labelFormatter?: (value: number) => string\n styles: Dict<CSSUIObject>\n}\n\nexport const pieChartLabel: (props: PieChartLabelProps) => ReactNode = ({\n className: cellClassName,\n cx: cxProp = 0,\n cy: cyProp = 0,\n midAngle = 0,\n innerRadius = 0,\n outerRadius = 0,\n middleRadius = 0,\n percent = 0,\n value = 0,\n labelOffset: labelOffsetProp,\n isPercent,\n labelProps,\n labelFormatter,\n styles,\n}) => {\n const labelOffset =\n labelOffsetProp ?? (outerRadius - innerRadius) * 0.5 + DEFAULT_LABEL_OFFSET\n\n const x = cxProp + (middleRadius + labelOffset) * Math.cos(-midAngle * RADIAN)\n const y = cyProp + (middleRadius + labelOffset) * Math.sin(-midAngle * RADIAN)\n\n const textAnchor = x > cxProp ? \"start\" : x < cxProp ? \"end\" : \"middle\"\n const displayLabel = () => {\n if (isPercent) {\n return (\n parseFloat((percent * 100).toFixed(0)) > 0 &&\n `${(percent * 100).toFixed(0)}%`\n )\n } else if (!isUndefined(labelFormatter)) {\n return labelFormatter(value)\n } else {\n return value\n }\n }\n\n return (\n <ui.text\n className={cx(cellClassName, \"ui-chart__label\")}\n x={x}\n y={y}\n textAnchor={textAnchor}\n dominantBaseline=\"central\"\n __css={styles}\n {...labelProps}\n >\n {displayLabel()}\n </ui.text>\n )\n}\n\ninterface Point {\n x: number\n y: number\n}\n\nexport interface PieChartLabelLineProps {\n className?: string\n cx?: number\n cy?: number\n innerRadius?: number\n midAngle?: number\n middleRadius?: number\n outerRadius?: number\n points?: Point[]\n labelOffset?: number\n labelLineProps?: HTMLUIProps<\"path\">\n styles: Dict<CSSUIObject>\n}\n\nexport const pieChartLabelLine: (\n props: PieChartLabelLineProps,\n) => React.ReactElement<SVGElement> = ({\n className: cellClassName,\n cx: cxProp = 0,\n cy: cyProp = 0,\n innerRadius = 0,\n midAngle = 0,\n middleRadius = 0,\n outerRadius = 0,\n points = [{ x: 0, y: 0 }],\n labelOffset: labelOffsetProp,\n labelLineProps,\n styles,\n}) => {\n const labelOffset =\n labelOffsetProp ?? (outerRadius - innerRadius) * 0.5 + DEFAULT_LABEL_OFFSET\n\n const x = cxProp + (middleRadius + labelOffset) * Math.cos(-midAngle * RADIAN)\n const y = cyProp + (middleRadius + labelOffset) * Math.sin(-midAngle * RADIAN)\n\n const d: string = `M ${points[0].x} ${points[0].y} L ${x} ${y}`\n\n return (\n <ui.path\n className={cx(cellClassName, \"ui-chart__label-line\")}\n d={d}\n __css={styles}\n {...labelLineProps}\n />\n )\n}\n"],"mappings":";;;AACA,SAAS,UAAU;AAEnB,SAAS,IAAI,mBAAmB;AA4D5B;AAzDJ,IAAM,SAAS,KAAK,KAAK;AACzB,IAAM,uBAAuB;AAmBtB,IAAM,gBAA0D,CAAC;AAAA,EACtE,WAAW;AAAA,EACX,IAAI,SAAS;AAAA,EACb,IAAI,SAAS;AAAA,EACb,WAAW;AAAA,EACX,cAAc;AAAA,EACd,cAAc;AAAA,EACd,eAAe;AAAA,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