@sqlrooms/mosaic / ChartTypeDefinition
Interface: ChartTypeDefinition<TSettings>
Shared chart-type definition used by both the chart-builder UI and assistant-driven chart creation.
Type Parameters
| Type Parameter | Default type |
|---|---|
TSettings | any |
Properties
id
id:
"heatmap"|"histogram"|"count-plot"|"line-chart"|"bubble-chart"|"box-plot"|"custom-spec"
Unique identifier
label?
optionallabel:string
Short human-friendly name used in chart-type grids and prompts
description
description:
string
Short description of what this builder creates
schema
schema:
ZodType<TSettings>
Zod schema for runtime validation of settings
createSpec()
createSpec: (
tableName,values) =>Spec
Generate a Mosaic spec from table name and selected field values
Parameters
| Parameter | Type |
|---|---|
tableName | string |
values | TSettings |
Returns
Spec
createTool()?
optionalcreateTool: (deps) =>Tool
Create an AI tool for this chart type
Parameters
| Parameter | Type |
|---|---|
deps | ChartToolDeps |
Returns
Tool
buildTitle()?
optionalbuildTitle: (fieldValues) =>string
Generate a chart title from selected field values
Parameters
| Parameter | Type |
|---|---|
fieldValues | Record<string, unknown> |
Returns
string
isAvailable()?
optionalisAvailable: (columns) =>boolean
Optional availability override for a given table schema
Parameters
| Parameter | Type |
|---|---|
columns | ChartBuilderColumn[] |
Returns
boolean
aiDescription?
optionalaiDescription:string
Optional extra assistant-facing description
settingsComponent
settingsComponent:
ComponentType
Explicit settings component for this chart type
icon
icon:
ComponentType<{className?:string; }>
Optional icon component for chart-type grids
