/**
* Schemas for the type:"chart" PI tool route (v0.2 slice 3).
*
* Four chart types ship in slice 3 — they cover ~90% of typical chart
* requests. The other 5 (area, scatter, radar, funnel, bubble) land as
* patch-series extensions; new entries plug into ChartContent's
* discriminated union.
*
* The TS schema mirrors the existing JSON schemas in
* skills/lumen-chart/schemas/ (used as LLM-authoring guidance for the
* non-PI path) but stays narrow to what each renderer actually consumes.
*
* Style matches src/templates/diagram/schemas.ts (Reflect.get + manual
* guards, asArray narrows items to object).
*/
export interface DataPoint {
label: string;
value: number;
/** Optional inline tooltip (rendered on the SVG mark via
). */
tip?: string;
}
export interface BarSeries {
name: string;
data: DataPoint[];
/** 6-digit hex color override (#RRGGBB) for bars in this series. */
color?: string;
}
export interface BarContent {
chart: "bar";
series: BarSeries[];
subtitle?: string;
/** "grouped" (bars side-by-side) or "stacked" (cumulative). Default "grouped". */
variant?: "grouped" | "stacked";
xAxisLabel?: string;
yAxisLabel?: string;
/** Skip the legend entirely. Default false. */
hideLegend?: boolean;
}
export interface PieSlice {
label: string;
value: number;
/** 6-digit hex color override (#RRGGBB). */
color?: string;
}
export interface PieContent {
chart: "pie";
slices: PieSlice[];
subtitle?: string;
/** Donut variant inner radius as fraction of outer (0.5–0.65 recommended). 0 = full pie. */
innerRadius?: number;
}
export interface LineSeries {
name: string;
data: DataPoint[];
color?: string;
}
export interface LineContent {
chart: "line";
series: LineSeries[];
subtitle?: string;
/** Curve type. Default "linear". */
curve?: "linear" | "smooth";
/** Show point markers. Default true. */
showMarks?: boolean;
xAxisLabel?: string;
yAxisLabel?: string;
hideLegend?: boolean;
}
export interface TableColumn {
key: string;
label: string;
/** Cell type — drives alignment + formatting. */
type?: "text" | "number" | "verdict";
/** Highlight the min/max numeric cell in this column. Default false. */
highlight?: boolean;
}
export type TableRow = Record;
export interface TableContent {
chart: "table";
subtitle?: string;
columns: TableColumn[];
rows: TableRow[];
}
/** Interactive bar chart rendered via Chart.js (HTML/Canvas, not SVG). */
export interface InteractiveBarContent {
chart: "interactive-bar";
series: BarSeries[];
subtitle?: string;
/** "grouped" (bars side-by-side) or "stacked" (cumulative). Default "grouped". */
variant?: "grouped" | "stacked";
xAxisLabel?: string;
yAxisLabel?: string;
/** Skip the legend entirely. Default false. */
hideLegend?: boolean;
}
/** Interactive line chart rendered via Chart.js (HTML/Canvas, not SVG). */
export interface InteractiveLineContent {
chart: "interactive-line";
series: LineSeries[];
subtitle?: string;
/** Curve type. Default "linear". */
curve?: "linear" | "smooth";
/** Show point markers. Default true. */
showMarks?: boolean;
xAxisLabel?: string;
yAxisLabel?: string;
/** Skip the legend entirely. Default false. */
hideLegend?: boolean;
}
export type ChartContent = BarContent | PieContent | LineContent | TableContent | InteractiveBarContent | InteractiveLineContent;
export declare const SUPPORTED_CHARTS: readonly ["bar", "pie", "line", "table", "interactive-bar", "interactive-line"];
export type SupportedChart = (typeof SUPPORTED_CHARTS)[number];
/**
* Validate + normalize an untrusted `content` object from the PI tool param.
* Throws Error with a precise path on any structural problem.
*/
export declare function parseChartContent(raw: unknown): ChartContent;
//# sourceMappingURL=schemas.d.ts.map