import { CSSProperties, ReactElement, ReactNode } from 'react'; import { ChartLoadingStyle, ChartEmptyState, ChartMotion, ChartPalette, ChartStyle, ChartSurface, CardLegend, ChartLegendSwatch } from '../types'; import { CardRange, CardSeries } from './cartesian-card'; import { NumericKey, TextKey } from './keys'; import { AnimatedNumberVariant } from '../motion/animated-number'; /** How the resting headline sums up the first series across dimensions. */ export type RadarAggregate = 'mean' | 'sum' | 'max'; export interface RadarChartCardProps> { /** Optional visible title. Use aria-label to name an embedded chart. */ title?: string; /** Show the header, including headline and period controls. Defaults to true. */ header?: boolean; /** Accessible name, independent of the visible title. */ 'aria-label'?: string; /** One row per dimension, in the order to draw them clockwise from the top. */ data?: readonly Row[]; /** Text field that names each dimension. Names must be unique. */ category: TextKey; /** * Profiles to compare, one numeric field each. Dashed series, such as a target, draw as an * outline without a fill and stay out of the headline. */ series: readonly CardSeries[]; /** Values at the center and the outer ring. Defaults to zero through a round maximum. */ domain?: readonly [number, number]; /** How the resting headline sums up the first series: `mean` (default), `sum`, or `max`. */ aggregate?: RadarAggregate; /** `polygon` (default) rings follow the spokes; `circle` rings are round. */ grid?: 'polygon' | 'circle'; /** Plot height in pixels. Defaults to 300. */ height?: number; /** Resting headline. Defaults to the `aggregate` of the first series. */ headline?: number; /** Fractional change shown as a chip, e.g. 0.052 → +5.2%. */ delta?: number; deltaTone?: 'default' | 'inverse' | 'neutral'; /** Static period label, e.g. "Q3". */ range?: string; /** Period select. Each range replaces data, delta, and headline; profiles ease to their shape. */ ranges?: readonly CardRange[]; defaultRange?: string; /** * How the legend lays out: value `tiles` (default), compact `inline` labels, `list` rows, tinted * `pills`, or `bars` that also draw each value against the largest. * False removes the legend without changing the data or marks. */ legend?: CardLegend | false; /** The mark beside each legend label: `square` (default), `dot`, or `line`. */ legendSwatch?: ChartLegendSwatch; valueFormat?: Intl.NumberFormatOptions; locale?: string; formatValue?: (value: number) => string; surface?: ChartSurface; /** A glass tab tucked behind the card's top edge, e.g. a caption, a command, or actions. */ badge?: ReactNode; /** Headline motion: `count` (default), `pop`, `slide`, `roll`, `flow`, or `scramble`. */ numberStyle?: AnimatedNumberVariant; palette?: ChartPalette; loading?: boolean; loadingStyle?: ChartLoadingStyle; /** * What the card shows when the period has no data: `dots` (default), the chart's own `shape`, * your own element such as `No visits yet`, or `null` for nothing. */ empty?: ChartEmptyState; /** `none` turns off decorative motion; reduced-motion users get this automatically. */ motion?: ChartMotion; className?: string; style?: CSSProperties | ChartStyle; } interface Dimension { name: string; /** One reading per series; `null` when missing. */ values: (number | null)[]; } /** A label that doesn't fit its room breaks at the space nearest its middle. */ export declare function labelLines(text: string, room: number): string[]; /** Rows to dimensions, with the domain and any problem stated plainly. */ export declare function radarDimensions({ data, category, series, domain: suppliedDomain, }: { data: readonly Row[]; category: string; series: readonly string[]; domain?: readonly [number, number]; }): { dimensions: Dimension[]; domain: readonly [number, number]; error: string | null; }; /** * A point on spoke `index` of `count`, `fraction` of the way out; spoke 0 points straight up. * Rounded to hundredths of a pixel: server and browser trig can differ in the last digit, which * would otherwise mismatch on hydration. */ export declare function spokePoint(index: number, count: number, fraction: number, radius: number): { x: number; y: number; }; /** * The outline of a profile. A missing value breaks the outline there and drops the fill, so a gap * never reads as a low score. */ export declare function profilePath(fractions: readonly (number | null)[], radius: number): { path: string; complete: boolean; }; /** * A radar card: several dimensions on spokes around a center, one outline per profile, so the * shape of strengths and gaps reads at a glance. Hovering or stepping around the spokes reads * every profile at that dimension. */ export declare function RadarChartCard>({ title, header, 'aria-label': ariaLabel, data: suppliedData, category, series, domain: suppliedDomain, aggregate, grid, height, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, valueFormat, legend, legendSwatch, locale, formatValue: suppliedFormatValue, surface, badge, numberStyle, palette, loading, loadingStyle, empty: emptyState, motion: motionMode, className, style, }: RadarChartCardProps): ReactElement; export {};