Variable: chartPlanSchema
constchartPlanSchema:ZodObject<{categories:ZodDefault<ZodNullable<ZodArray<ZodString>>>;chartType:ZodUnion<readonly [ZodLiteral<"bar">,ZodLiteral<"horizontalBar">,ZodLiteral<"line">,ZodLiteral<"area">,ZodLiteral<"combo">,ZodLiteral<"waterfall">,ZodLiteral<"scatter">,ZodLiteral<"heatmap">,ZodLiteral<"radar">,ZodLiteral<"pie">,ZodLiteral<"funnel">,ZodLiteral<"treemap">,ZodLiteral<"custom">]>;option:ZodDefault<ZodNullable<ZodString>>;series:ZodDefault<ZodArray<ZodObject<{data:ZodArray<ZodCatch<ZodPipe<ZodTransform<… | … | … | …,unknown>,ZodUnion<readonly […, …, …, …]>>>>;name:ZodString;type:ZodDefault<ZodNullable<ZodUnion<readonly [ZodLiteral<…>,ZodLiteral<…>,ZodLiteral<…>]>>>;yAxisIndex:ZodDefault<ZodNullable<ZodUnion<readonly [ZodLiteral<…>,ZodLiteral<…>]>>>; },$strip>>>;title:ZodDefault<ZodNullable<ZodString>>;xAxisLabel:ZodDefault<ZodNullable<ZodString>>;yAxisLabel:ZodDefault<ZodNullable<ZodString>>;yCategories:ZodDefault<ZodNullable<ZodArray<ZodString>>>; },$strip>
Compact, model-friendly representation of an Echarts spec. The
planner agent emits this; planToEchartsOption expands it
into a real EChartsOption JSON. Two layers because letting the
model fill in a fully-typed EChartsOption is brittle (hundreds
of optional fields, deep unions, version-dependent shapes). A
small “chart plan” schema is much more reliable for a fast model
and keeps animation / tooltip / styling defaults consistent
across charts.
chartPlan fields
Section titled “chartPlan fields”chartType: The chart shape that best matches the data and intent.title(optional): Short title shown above the chart. Use null to fall back to thetitleargument the caller passed in.xAxisLabel(optional): Axis label for the primary (usually bottom / value) axis. Used for bar / horizontalBar / line / area / combo / waterfall / scatter / heatmap; use null for pie / funnel / treemap / radar.yAxisLabel(optional): Axis label for the secondary (usually left) axis. Used for bar / horizontalBar / line / area / combo / waterfall / scatter / heatmap; use null for pie / funnel / treemap / radar.categories(optional): Primary category labels. Forbar/horizontalBar/line/area/combo/waterfall: one label per data point. Forheatmap: x-axis categories. Forradar: indicator names. Use null forscatter([x, y]tuples) and slice charts (pie/funnel/treemap, each slice carries its ownname).yCategories(optional): Y-axis (row) labels forheatmap. Use null when the row labels come from the series names, which is the preferred way to build a heatmap. Use null for every other chart type.series(optional): One or more series to plot. Required for every chart type exceptcustom, which carries its series insideoption. Slice charts (pie/funnel/treemap) andwaterfall/heatmapuse exactly one series;bar/line/area/combo/radar/scattercan carry multiple series.option(optional): Required forcustom; use null for every other chart type. A COMPLETE Echarts option, as a JSON object encoded in a string:series(each with its owntypeand that series’ own data shape) plus whatever else the chart needs - a coordinate system,visualMap, axes. Plain JSON values only, never a JavaScript function. A centered title is filled in when the object omits one.