import type { AxisScaleConfig, ScaleName } from "../models/axis.js"; /** * Provides access to the geometry of a polar chart. * * It can be used to position custom elements and convert between polar and Cartesian coordinates. * * @example * ```tsx * const geo = usePolarGeometry(); * * const [x, y] = geo.point(100, Math.PI / 2); * * return * ``` * * @returns The polar geometry helpers, or `null` if the chart scales are not ready. */ export declare function usePolarGeometry(): PolarGeometry | null; export interface PolarGeometry { /** * The X coordinate of the chart center within the SVG. */ cx: number; /** * The Y coordinate of the chart center within the SVG. */ cy: number; /** * The scale that maps rotation axis values to angles in radians. */ angleScale: AxisScaleConfig[AngleScale]['scale']; /** * The scale that maps data values to radii (distance from the chart center). */ radiusScale: AxisScaleConfig[RadiusScale]['scale']; /** * Converts polar coordinates to Cartesian offsets relative to the chart center. * @param {number} radius - Distance from the center. * @param {number} angle - Angle in radians, measured clockwise from the top (12 o'clock). * @returns {[number, number]} `[x, y]` offset from `[cx, cy]`. */ point: (radius: number, angle: number) => [number, number]; /** * Converts Cartesian offsets (relative to the chart center) back to polar coordinates. * The inverse of `point`. * @param {number} x - Horizontal offset from `cx`. * @param {number} y - Vertical offset from `cy`. * @returns {[number, number]} `[radius, angle]` where angle is in radians within `[-π, π]`. */ pointInverse: (x: number, y: number) => [number, number]; }