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