import type { CSSProperties, ReactNode, RefObject } from 'react'; import { cx } from '../../utils/cx.js'; import type { SxProp } from '../Layout/sx.js'; /** Props shared by the extra chart components. */ export interface ChartBaseProps { /** Accessible label for the chart (svg `aria-label` + hidden table caption). */ label?: string; /** Entrance + hover animation. Always off under `prefers-reduced-motion`. Default `true`. */ animate?: boolean; /** Show a loading placeholder instead of the chart. */ loading?: boolean; /** Content shown instead of the chart when there is no data. Default "No data". */ empty?: ReactNode; className?: string; style?: CSSProperties; /** One-off CSS, same as `Box`'s `sx`. Applied to the chart's outer container. */ sx?: SxProp; } /** * Hover index with a short leave delay. Moving between marks crosses a gap where * `mouseleave` fires before the next `mouseenter`; without the delay the tooltip and * the dim-others emphasis blink off and on at every crossing. */ export declare function useHover(delay?: number): [number | null, (i: number | null) => void]; /** True when the user prefers reduced motion (live-updating). */ export declare function usePrefersReducedMotion(): boolean; /** Effective animation flag: the `animate` prop AND no reduced-motion preference. */ export declare function useAnimate(animate?: boolean): boolean; /** Counts from 0 to `target` (ease-out) while `enabled`; otherwise returns `target` as-is. */ export declare function useCountUp(target: number, enabled: boolean, duration?: number): number; /** Outer container shared by the extra charts: sx, animation class, loading + empty states. */ export declare function ChartShell({ rootRef, animate, loading, isEmpty, empty, height, className, style, sx, children, }: { rootRef?: RefObject; /** Resolved animation flag (see `useAnimate`). */ animate: boolean; loading?: boolean; isEmpty?: boolean; empty?: ReactNode; height?: number; className?: string; style?: CSSProperties; sx?: SxProp; children: ReactNode; }): import("react/jsx-runtime").JSX.Element; /** * Floating tooltip box (positioned in px relative to the chart container). It is measured * after layout and flipped/shifted (`clampTooltip`) so it never leaves the container. */ export declare function ChartTip({ x, y, children }: { x: number; y: number; children: ReactNode; }): import("react/jsx-runtime").JSX.Element; export declare const idx: (i: number, step?: number) => CSSProperties; /** Polar -> cartesian, angle in radians, 0 at 12 o'clock, clockwise. */ export declare function polar(cx0: number, cy0: number, r: number, a: number): [number, number]; /** Open stroke arc (for gauges / rings). */ export declare function arcStroke(cx0: number, cy0: number, r: number, a0: number, a1: number): string; /** Nice [lo, hi] range + ticks that covers [min, max] (negatives, equal, tiny/huge, inverted, non-finite safe). */ export declare function niceRange(min: number, max: number, count?: number): { lo: number; hi: number; ticks: number[]; }; /** Rounds an in-flight count-up value to the precision of its target. */ export declare const roundLike: (v: number, target: number) => number; export declare const fmt: (n: number) => string; export { cx }; /** * Skip entrance animation when there are too many marks (thousands of CSS-animated * nodes jank). Combine with `useAnimate`: `useAnimate(animate) && useAnimateBudget(n)`. */ export declare function useAnimateBudget(count: number, limit?: number): boolean; /** * ONE rAF-throttled pointermove handler for a whole svg (instead of N per-mark listeners). * `resolve(x, y, rect)` gets pointer coords relative to the element and returns the hovered * index (e.g. via `nearestIndexByX`) or null. Spread `handlers` on the svg. */ export declare function usePointerHover(resolve: (x: number, y: number, rect: DOMRect) => number | null, leaveDelay?: number): { hover: number | null; setHover: (i: number | null) => void; handlers: { onPointerMove: (e: { clientX: number; clientY: number; currentTarget: Element; }) => void; onPointerLeave: () => void; }; };