/** * Chart components — BarChart, LineChart, AreaChart, PieChart, Sparkline, etc. */ import { Component } from '../../core/component.js'; import type { ComponentProps } from '../../core/component.js'; export interface ChartSeries { dataKey: string; label?: string; color?: string; /** Which Y-axis this series binds to: 'left' (default) or 'right'. */ yAxisId?: 'left' | 'right'; /** Pipe expression for this series' value in the tooltip (e.g. "currency:'EUR'"). Overrides yAxisFormat. */ tooltipFormat?: string; } export interface BaseChartProps extends ComponentProps { data: unknown[]; series: ChartSeries[]; xAxis?: string; /** Data key used for the tooltip category label instead of xAxis. */ tooltipXKey?: string; /** Pipe expression applied to x-axis tick labels (e.g. "date", "truncate:10"). */ xAxisFormat?: string; /** Pipe expression applied to the category label in tooltips (e.g. "datetime"). Defaults to raw value. */ tooltipXFormat?: string; height?: number; showLegend?: boolean; showTooltip?: boolean; showGrid?: boolean; showYAxis?: boolean; /** * Canonical pipe format for value-axis ticks and tooltip values * (e.g. "compact", "currency", "percent:1"). Matches upstream prefab's * `valueFormat` (PR #454). `"auto"` (the default) means no explicit format. */ valueFormat?: string; /** Left-axis format override for dual-axis charts (TS extension). Overrides `valueFormat`. */ yAxisFormat?: string; /** Show a secondary Y-axis on the right for series with yAxisId:'right'. */ showYAxisRight?: boolean; /** Right-axis format for dual-axis charts (TS extension). */ yAxisRightFormat?: string; animate?: boolean; } /** * Props for categorical charts that plot one numeric value per data row * (Pie, Radial). Matches upstream prefab's `dataKey` (value) + `nameKey` * (label) model. The legacy `series`/`xAxis` inputs are still accepted and * mapped onto `dataKey`/`nameKey`, so existing series-based code keeps working. */ export interface CategoricalChartProps extends ComponentProps { data: unknown[]; /** Numeric value field (upstream canonical). */ dataKey?: string; /** Slice/segment label field (upstream canonical). */ nameKey?: string; /** Legacy series-based input — `series[0].dataKey` becomes the value field. Prefer `dataKey`. */ series?: ChartSeries[]; /** Legacy label field. Prefer `nameKey`. */ xAxis?: string; /** Legacy label key. Prefer `nameKey`. */ tooltipXKey?: string; height?: number; showLegend?: boolean; showTooltip?: boolean; animate?: boolean; /** Value format pipe for tooltip values (e.g. "currency", "percent:1"). */ valueFormat?: string; } export interface BarChartProps extends BaseChartProps { stacked?: boolean; horizontal?: boolean; barRadius?: number; } export declare function BarChart(props: BarChartProps): Component; export declare function LineChart(props: BaseChartProps): Component; export declare function AreaChart(props: BaseChartProps): Component; export interface PieChartProps extends CategoricalChartProps { innerRadius?: number; showLabel?: boolean; paddingAngle?: number; } export declare function PieChart(props: PieChartProps): Component; export interface RadarChartProps extends BaseChartProps { /** Data key for angular axis (spoke) labels — upstream `axisKey`; falls back to `xAxis`. */ axisKey?: string; /** Fill the radar polygons (default true; set false for outline only). */ filled?: boolean; /** Show dots at polygon vertices. */ showDots?: boolean; } export declare function RadarChart(props: RadarChartProps): Component; export interface ScatterChartProps extends BaseChartProps { /** Data key for y-axis values (upstream). */ yAxis?: string; /** Data key for bubble size (upstream, optional). */ zAxis?: string; } export declare function ScatterChart(props: ScatterChartProps): Component; export interface SparklineProps extends ComponentProps { data: number[]; variant?: string; fill?: boolean; curve?: 'linear' | 'smooth' | 'step'; mode?: 'line' | 'bar'; } export declare function Sparkline(props: SparklineProps): Component; export interface RadialChartProps extends CategoricalChartProps { innerRadius?: number; startAngle?: number; endAngle?: number; } export declare function RadialChart(props: RadialChartProps): Component; export interface HistogramProps extends ComponentProps { data: number[]; bins?: number; color?: string; height?: number; showXAxis?: boolean; showYAxis?: boolean; } export declare function Histogram(props: HistogramProps): Component; //# sourceMappingURL=index.d.ts.map