mirror of
https://github.com/vercel-labs/natural-language-postgres.git
synced 2026-11-04 08:10:38 +00:00
refactor: change schema fields from optional to nullable
This commit is contained in:
1 parent
7ff5fbfabe
commit
567a2ee463
1 file changed
+20
-5
+20
-5
@@ -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");
|
||||
|
||||
Reference in new issue
Block a user