diff --git a/lib/types.ts b/lib/types.ts index 764a9a6..2cdca4f 100644 --- a/lib/types.ts +++ b/lib/types.ts @@ -34,16 +34,31 @@ export const configSchema = z title: z.string(), xKey: z.string().describe("Key for x-axis or category"), yKeys: z.array(z.string()).describe("Key(s) for y-axis values this is typically the quantitative column"), - multipleLines: z.boolean().describe("For line charts only: whether the chart is comparing groups of data.").optional(), - measurementColumn: z.string().describe("For line charts only: key for quantitative y-axis column to measure against (eg. values, counts etc.)").optional(), - lineCategories: z.array(z.string()).describe("For line charts only: Categories used to compare different lines or data series. Each category represents a distinct line in the chart.").optional(), + multipleLines: z + .boolean() + .nullable() + .describe( + "For line charts only: whether the chart is comparing groups of data.", + ), + measurementColumn: z + .string() + .nullable() + .describe( + "For line charts only: key for quantitative y-axis column to measure against (eg. values, counts etc.)", + ), + lineCategories: z + .array(z.string()) + .nullable() + .describe( + "For line charts only: Categories used to compare different lines or data series. Each category represents a distinct line in the chart.", + ), colors: z .record( z.string().describe("Any of the yKeys"), z.string().describe("Color value in CSS format (e.g., hex, rgb, hsl)"), ) - .describe("Mapping of data keys to color values for chart elements") - .optional(), + .nullable() + .describe("Mapping of data keys to color values for chart elements"), legend: z.boolean().describe("Whether to show legend"), }) .describe("Chart configuration object");