import * as recharts_types_util_types from 'recharts/types/util/types'; import * as recharts_types_chart_types from 'recharts/types/chart/types'; import * as lodash from 'lodash'; import * as recharts_types_chart_AccessibilityManager from 'recharts/types/chart/AccessibilityManager'; import * as recharts_types_chart_generateCategoricalChart from 'recharts/types/chart/generateCategoricalChart'; import * as react from 'react'; import * as _yamada_ui_utils from '@yamada-ui/utils'; import { Dict } from '@yamada-ui/utils'; import * as _yamada_ui_core from '@yamada-ui/core'; import { CSSUIObject, RequiredPropGetter, PropGetter } from '@yamada-ui/core'; import * as Recharts from 'recharts'; import { CellProps, PieChartProps, PieProps } from './chart.types.mjs'; interface UsePieChartOptions { /** * Chart data. */ data: CellProps[]; /** * Controls angle at which chart ends. * * @default -270 */ endAngle?: number; /** * Controls fill opacity of all pies. * * @default 1 */ fillOpacity?: [number, number] | number; /** * Controls innerRadius of the chart segments. * If it is a number, it is the width of the radius. * For example, `60` means the radius is `60px` and the diameter is `120px`. * * @default '0%' */ innerRadius?: number | string; /** * Determines whether labels should be displayed as percentages. * * @default false * * @deprecated Use `percent` instead. */ isPercent?: boolean; /** * A function to format labels. */ labelFormatter?: (value: number) => string; /** * Distance between chart and label. */ labelOffset?: number; /** * Controls thickness of the chart segments. If it is a number, it is calculated as px. * If it is a number, it is the width of the radius. * For example, `60` means the radius is `60px` and the diameter is `120px`. * * @default '80%' */ outerRadius?: number | string; /** * Controls padding between segments. * * @default 0 */ paddingAngle?: number; /** * Determines whether labels should be displayed as percentages. * * @default false */ percent?: boolean; /** * Controls angle at which chart starts. * * @default 90 */ startAngle?: number; /** * Stroke width for the chart pies. * * @default 1 */ strokeWidth?: number; /** * Determines whether segments labels should have lines that connect the segment with the label. * * @default false */ withLabelLines?: boolean; /** * Determines whether each segment should have associated label. * * @default false */ withLabels?: boolean; /** * Props for the cell. */ cellProps?: Partial; /** * Props passed down to recharts `PieChart` component. */ chartProps?: PieChartProps; /** * Props for the pie. */ pieProps?: Partial; } interface UsePieChartProps extends UsePieChartOptions { styles: Dict; } declare const usePieChart: ({ data, endAngle, fillOpacity, innerRadius, isPercent, labelFormatter, labelOffset, withLabels, outerRadius, paddingAngle, percent, startAngle, strokeWidth, styles, withLabelLines, ...rest }: UsePieChartProps) => { pieVars: { name: string; token?: _yamada_ui_core.ThemeToken; value?: _yamada_ui_core.Token; __prefix?: string; }[]; setHighlightedArea: react.Dispatch>; getCellProps: RequiredPropGetter<{ index: number; } & Omit, Recharts.CellProps>; getPieChartProps: PropGetter any>; container?: HTMLElement; componentDidMount(): void; displayDefaultTooltip(): void; getSnapshotBeforeUpdate(prevProps: Readonly, prevState: Readonly): null; componentDidUpdate(prevProps: recharts_types_chart_generateCategoricalChart.CategoricalChartProps): void; componentWillUnmount(): void; getTooltipEventType(): recharts_types_util_types.TooltipEventType; getMouseInfo(event: recharts_types_chart_generateCategoricalChart.MousePointer): { xValue: any; yValue: any; chartX: number; chartY: number; } | { activeTooltipIndex: number; activeLabel: any; activePayload: any[]; activeCoordinate: recharts_types_util_types.ChartCoordinate; chartX: number; chartY: number; }; inRange(x: number, y: number, scale?: number): any; parseEventsOfWrapper(): any; addListener(): void; removeListener(): void; handleLegendBBoxUpdate: (box: DOMRect) => void; handleReceiveSyncEvent: (cId: string | number, data: recharts_types_chart_types.CategoricalChartState, emitter: Symbol) => void; handleBrushChange: ({ startIndex, endIndex }: { startIndex: number; endIndex: number; }) => void; handleMouseEnter: (e: react.MouseEvent) => void; triggeredAfterMouseMove: (e: recharts_types_chart_generateCategoricalChart.MousePointer) => any; handleItemMouseEnter: (el: any) => void; handleItemMouseLeave: () => void; handleMouseMove: (e: recharts_types_chart_generateCategoricalChart.MousePointer & Partial, keyof recharts_types_chart_generateCategoricalChart.MousePointer>>) => void; handleMouseLeave: (e: any) => void; handleOuterEvent: (e: react.MouseEvent | react.TouchEvent) => void; handleClick: (e: react.MouseEvent) => void; handleMouseDown: (e: react.MouseEvent | react.Touch) => void; handleMouseUp: (e: react.MouseEvent | react.Touch) => void; handleTouchMove: (e: react.TouchEvent) => void; handleTouchStart: (e: react.TouchEvent) => void; handleTouchEnd: (e: react.TouchEvent) => void; handleDoubleClick: (e: react.MouseEvent) => void; handleContextMenu: (e: react.MouseEvent) => void; triggerSyncEvent: (data: recharts_types_chart_types.CategoricalChartState) => void; applySyncEvent: (data: recharts_types_chart_types.CategoricalChartState) => void; filterFormatItem(item: any, displayName: any, childIndex: any): any; renderCursor: (element: react.ReactElement>) => react.JSX.Element; renderPolarAxis: (element: react.ReactElement>, displayName: string, index: number) => react.ReactElement>; renderPolarGrid: (element: react.ReactElement>) => react.ReactElement>; renderLegend: () => react.ReactElement>; renderTooltip: () => react.ReactElement>; renderBrush: (element: react.ReactElement>) => react.ReactElement>; renderReferenceElement: (element: react.ReactElement>, displayName: string, index: number) => react.ReactElement>; renderActivePoints: ({ item, activePoint, basePoint, childIndex, isRange }: any) => react.ReactElement>[]; renderGraphicChild: (element: react.ReactElement>, displayName: string, index: number) => any[]; renderCustomized: (element: react.ReactElement>, displayName: string, index: number) => react.ReactElement>; renderClipPath(): react.JSX.Element; getXScales(): { [x: string]: Function | recharts_types_util_types.ScaleType; }; getYScales(): { [x: string]: Function | recharts_types_util_types.ScaleType; }; getXScaleByAxisId(axisId: string): Function | recharts_types_util_types.ScaleType; getYScaleByAxisId(axisId: string): Function | recharts_types_util_types.ScaleType; getItemByXY(chartXY: { x: number; y: number; }): { graphicalItem: any; payload: any; }; renderMap: { CartesianGrid: { handler: (element: react.ReactElement>) => react.ReactElement>; once: boolean; }; ReferenceArea: { handler: (element: react.ReactElement>, displayName: string, index: number) => react.ReactElement>; }; ReferenceLine: { handler: (element: react.ReactElement>) => react.ReactElement>; }; ReferenceDot: { handler: (element: react.ReactElement>, displayName: string, index: number) => react.ReactElement>; }; XAxis: { handler: (element: react.ReactElement>) => react.ReactElement>; }; YAxis: { handler: (element: react.ReactElement>) => react.ReactElement>; }; Brush: { handler: (element: react.ReactElement>) => react.ReactElement>; once: boolean; }; Bar: { handler: (element: react.ReactElement>, displayName: string, index: number) => any[]; }; Line: { handler: (element: react.ReactElement>, displayName: string, index: number) => any[]; }; Area: { handler: (element: react.ReactElement>, displayName: string, index: number) => any[]; }; Radar: { handler: (element: react.ReactElement>, displayName: string, index: number) => any[]; }; RadialBar: { handler: (element: react.ReactElement>, displayName: string, index: number) => any[]; }; Scatter: { handler: (element: react.ReactElement>, displayName: string, index: number) => any[]; }; Pie: { handler: (element: react.ReactElement>, displayName: string, index: number) => any[]; }; Funnel: { handler: (element: react.ReactElement>, displayName: string, index: number) => any[]; }; Tooltip: { handler: (element: react.ReactElement>) => react.JSX.Element; once: boolean; }; PolarGrid: { handler: (element: react.ReactElement>) => react.ReactElement>; once: boolean; }; PolarAngleAxis: { handler: (element: react.ReactElement>, displayName: string, index: number) => react.ReactElement>; }; PolarRadiusAxis: { handler: (element: react.ReactElement>, displayName: string, index: number) => react.ReactElement>; }; Customized: { handler: (element: react.ReactElement>, displayName: string, index: number) => react.ReactElement>; }; }; render(): react.JSX.Element; context: unknown; setState(state: recharts_types_chart_types.CategoricalChartState | ((prevState: Readonly, props: Readonly) => recharts_types_chart_types.CategoricalChartState | Pick) | Pick, callback?: () => void): void; forceUpdate(callback?: () => void): void; readonly props: Readonly; state: Readonly; refs: { [key: string]: react.ReactInstance; }; shouldComponentUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): boolean; componentDidCatch?(error: Error, errorInfo: react.ErrorInfo): void; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void; componentWillUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): void; }>, "ref">, Omit any>; container?: HTMLElement; componentDidMount(): void; displayDefaultTooltip(): void; getSnapshotBeforeUpdate(prevProps: Readonly, prevState: Readonly): null; componentDidUpdate(prevProps: recharts_types_chart_generateCategoricalChart.CategoricalChartProps): void; componentWillUnmount(): void; getTooltipEventType(): recharts_types_util_types.TooltipEventType; getMouseInfo(event: recharts_types_chart_generateCategoricalChart.MousePointer): { xValue: any; yValue: any; chartX: number; chartY: number; } | { activeTooltipIndex: number; activeLabel: any; activePayload: any[]; activeCoordinate: recharts_types_util_types.ChartCoordinate; chartX: number; chartY: number; }; inRange(x: number, y: number, scale?: number): any; parseEventsOfWrapper(): any; addListener(): void; removeListener(): void; handleLegendBBoxUpdate: (box: DOMRect) => void; handleReceiveSyncEvent: (cId: string | number, data: recharts_types_chart_types.CategoricalChartState, emitter: Symbol) => void; handleBrushChange: ({ startIndex, endIndex }: { startIndex: number; endIndex: number; }) => void; handleMouseEnter: (e: react.MouseEvent) => void; triggeredAfterMouseMove: (e: recharts_types_chart_generateCategoricalChart.MousePointer) => any; handleItemMouseEnter: (el: any) => void; handleItemMouseLeave: () => void; handleMouseMove: (e: recharts_types_chart_generateCategoricalChart.MousePointer & Partial, keyof recharts_types_chart_generateCategoricalChart.MousePointer>>) => void; handleMouseLeave: (e: any) => void; handleOuterEvent: (e: react.MouseEvent | react.TouchEvent) => void; handleClick: (e: react.MouseEvent) => void; handleMouseDown: (e: react.MouseEvent | react.Touch) => void; handleMouseUp: (e: react.MouseEvent | react.Touch) => void; handleTouchMove: (e: react.TouchEvent) => void; handleTouchStart: (e: react.TouchEvent) => void; handleTouchEnd: (e: react.TouchEvent) => void; handleDoubleClick: (e: react.MouseEvent) => void; handleContextMenu: (e: react.MouseEvent) => void; triggerSyncEvent: (data: recharts_types_chart_types.CategoricalChartState) => void; applySyncEvent: (data: recharts_types_chart_types.CategoricalChartState) => void; filterFormatItem(item: any, displayName: any, childIndex: any): any; renderCursor: (element: react.ReactElement>) => react.JSX.Element; renderPolarAxis: (element: react.ReactElement>, displayName: string, index: number) => react.ReactElement>; renderPolarGrid: (element: react.ReactElement>) => react.ReactElement>; renderLegend: () => react.ReactElement>; renderTooltip: () => react.ReactElement>; renderBrush: (element: react.ReactElement>) => react.ReactElement>; renderReferenceElement: (element: react.ReactElement>, displayName: string, index: number) => react.ReactElement>; renderActivePoints: ({ item, activePoint, basePoint, childIndex, isRange }: any) => react.ReactElement>[]; renderGraphicChild: (element: react.ReactElement>, displayName: string, index: number) => any[]; renderCustomized: (element: react.ReactElement>, displayName: string, index: number) => react.ReactElement>; renderClipPath(): react.JSX.Element; getXScales(): { [x: string]: Function | recharts_types_util_types.ScaleType; }; getYScales(): { [x: string]: Function | recharts_types_util_types.ScaleType; }; getXScaleByAxisId(axisId: string): Function | recharts_types_util_types.ScaleType; getYScaleByAxisId(axisId: string): Function | recharts_types_util_types.ScaleType; getItemByXY(chartXY: { x: number; y: number; }): { graphicalItem: any; payload: any; }; renderMap: { CartesianGrid: { handler: (element: react.ReactElement>) => react.ReactElement>; once: boolean; }; ReferenceArea: { handler: (element: react.ReactElement>, displayName: string, index: number) => react.ReactElement>; }; ReferenceLine: { handler: (element: react.ReactElement>) => react.ReactElement>; }; ReferenceDot: { handler: (element: react.ReactElement>, displayName: string, index: number) => react.ReactElement>; }; XAxis: { handler: (element: react.ReactElement>) => react.ReactElement>; }; YAxis: { handler: (element: react.ReactElement>) => react.ReactElement>; }; Brush: { handler: (element: react.ReactElement>) => react.ReactElement>; once: boolean; }; Bar: { handler: (element: react.ReactElement>, displayName: string, index: number) => any[]; }; Line: { handler: (element: react.ReactElement>, displayName: string, index: number) => any[]; }; Area: { handler: (element: react.ReactElement>, displayName: string, index: number) => any[]; }; Radar: { handler: (element: react.ReactElement>, displayName: string, index: number) => any[]; }; RadialBar: { handler: (element: react.ReactElement>, displayName: string, index: number) => any[]; }; Scatter: { handler: (element: react.ReactElement>, displayName: string, index: number) => any[]; }; Pie: { handler: (element: react.ReactElement>, displayName: string, index: number) => any[]; }; Funnel: { handler: (element: react.ReactElement>, displayName: string, index: number) => any[]; }; Tooltip: { handler: (element: react.ReactElement>) => react.JSX.Element; once: boolean; }; PolarGrid: { handler: (element: react.ReactElement>) => react.ReactElement>; once: boolean; }; PolarAngleAxis: { handler: (element: react.ReactElement>, displayName: string, index: number) => react.ReactElement>; }; PolarRadiusAxis: { handler: (element: react.ReactElement>, displayName: string, index: number) => react.ReactElement>; }; Customized: { handler: (element: react.ReactElement>, displayName: string, index: number) => react.ReactElement>; }; }; render(): react.JSX.Element; context: unknown; setState(state: recharts_types_chart_types.CategoricalChartState | ((prevState: Readonly, props: Readonly) => recharts_types_chart_types.CategoricalChartState | Pick) | Pick, callback?: () => void): void; forceUpdate(callback?: () => void): void; readonly props: Readonly; state: Readonly; refs: { [key: string]: react.ReactInstance; }; shouldComponentUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): boolean; componentDidCatch?(error: Error, errorInfo: react.ErrorInfo): void; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void; componentWillUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): void; }>, "ref">>; getPieProps: RequiredPropGetter, Omit>; }; type UsePieChartReturn = ReturnType; export { type UsePieChartOptions, type UsePieChartReturn, usePieChart };