import { type LayoutStyle } from "../../style/index.js"; import { type Tone } from "../shared/charts.styles.js"; import { type CartesianLayout } from "../shared/chart-frame.js"; import { type ChartSeries, type ChartSkin } from "../shared/types.js"; export interface ChartDatum { /** * Stable identity for this datum, used as the React key when present. Supply * it when the data can reorder or when labels are not unique; otherwise the * array index is used. */ id?: string | number; /** Bucket label shown under (vertical) or beside (horizontal) the bar. */ label: string; /** The bar's magnitude. Compared against `max` to size the bar. */ value: number; } export interface ChartProps { /** The bars to render, in order (single-series mode). */ data?: ChartDatum[]; /** Category labels along the x axis (grouped mode, with `series`). */ labels?: string[]; /** Multiple series rendered as grouped columns per category, colored by the chart-1..8 tokens (or a series' own `success`/`destructive` tone). */ series?: ChartSeries[]; /** Stack the grouped series within one column per category (composition) instead of clustering them side by side. */ stacked?: boolean; /** Optional heading shown above the plot. */ title?: string; /** Axis maximum. Defaults to the largest value in the data (the largest category TOTAL when `stacked`). */ max?: number; success?: boolean; destructive?: boolean; horizontal?: boolean; compact?: boolean; /** Strip the card surface for nesting inside an existing card (mirrors Stats). */ plain?: boolean; /** Hide the series legend (grouped mode shows one by default). */ hideLegend?: boolean; /** Press-to-inspect: the selected category index (controlled). Pass null for none. Vertical charts only. */ selected?: number | null; /** Press-to-inspect: the initially selected category (uncontrolled). */ defaultSelected?: number; /** Fired when a press selects a category (or clears it with null). */ onSelect?: (index: number | null) => void; /** Formats the value axis, the inspected value and the accessible values (data formatting, not styling). */ formatValue?: (v: number) => string; /** E2E hook forwarded to the root element. */ testID?: string; /** Composition within a parent only, never a restyle hook and never a width: the parent layout container provides the bounds. */ style?: LayoutStyle; } export declare function toneOf(p: ChartProps): Tone; /** One column's bars in data units: each series' [from, to] on the value axis (stacked accumulates). */ export declare function columnSpans(series: ChartSeries[], i: number, stacked: boolean): [number, number][]; export interface BarRect { category: number; series: number; x: number; y: number; width: number; height: number; } /** * The hand-off's column geometry on a measured frame: one rect per non-empty bar, a * single or stacked column centered in its band, a cluster's bars side by side. A bar * above the axis top (a caller's `max` under the data) is cut at the top. */ export declare function barRects(series: ChartSeries[], count: number, stacked: boolean, layout: CartesianLayout): BarRect[]; export declare function createChart(skin: ChartSkin): (props: ChartProps) => import("react").JSX.Element; //# sourceMappingURL=chart.shared.d.ts.map