/** * Sparkline geometry. Pure functions that turn an array of numbers into the * SVG primitives a tiny in-cell chart needs - no DOM, so it is trivially * unit-testable and the `` render component just paints the result. * * Four chart types, mirroring the de-facto enterprise-grid set: * - `line` a single polyline * - `area` a polyline plus a filled area down to the baseline * - `bar` one column per value, scaled from the dataset min..max * - `winloss` fixed-height up/down bars (sign only), e.g. W/L streaks */ export type SparklineType = 'line' | 'area' | 'bar' | 'winloss'; export type SparklineConfig = { type?: SparklineType; /** Stroke (line/area) or positive fill (bar/winloss). */ color?: string; /** Fill for negative bars / losses. Defaults to a red. */ negativeColor?: string; width?: number; height?: number; /** Fix the value scale instead of deriving it from the row's own data. */ min?: number; max?: number; lineWidth?: number; /** Draw a dot on the last point (line/area). Default true. */ lastPoint?: boolean; }; export type SparklineBar = { x: number; y: number; w: number; h: number; negative: boolean; }; export type SparklineGeometry = { width: number; height: number; type: SparklineType; color: string; negativeColor: string; lineWidth: number; /** `line` / `area`: the polyline through every point. */ linePath: string; /** `area`: closed path filled down to the baseline. */ areaPath: string; /** `bar` / `winloss`: one rect per value. */ bars: SparklineBar[]; /** `line` / `area`: the final point, for the end-cap dot. */ lastPoint: { x: number; y: number; } | null; }; /** Coerce loose cell values (arrays, comma strings) into a number array. */ export declare function toSparklineValues(value: unknown): number[]; export declare function buildSparkline(values: number[], cfg?: SparklineConfig): SparklineGeometry | null;