Skip to content

@sqlrooms/vega / VegaLiteChart

Variable: VegaLiteChart

const VegaLiteChart: FC<Omit<VegaLiteArrowChartProps, "arrowTable"> & object> & object

Composable Vega-Lite chart component with editing capabilities.

Type Declaration

NameTypeDefault value
SqlChartFC<Omit<VegaLiteArrowChartProps, "arrowTable"> & object>VegaLiteSqlChart
ArrowChartFC<VegaLiteArrowChartProps> & objectVegaLiteArrowChart
ContainerFC<VegaChartContainerProps>VegaChartContainer
ChartFC<VegaChartDisplayProps>VegaChartDisplay
SpecEditorFC<VegaSpecEditorPanelProps>VegaSpecEditorPanel
SqlEditorFC<VegaSqlEditorPanelProps>VegaSqlEditorPanel
ActionsFC<VegaChartEditorActionsProps>VegaChartEditorActions

Example

tsx
// Compound component pattern
<VegaLiteChart.Container
  spec={mySpec}
  sqlQuery={myQuery}
  editable={true}
  onSpecChange={(spec) => saveSpec(spec)}
>
  <VegaLiteChart.Chart />
  <VegaLiteChart.SpecEditor />
  <VegaLiteChart.SqlEditor />
  <VegaLiteChart.Actions />
</VegaLiteChart.Container>

// Simple usage (legacy)
<VegaLiteChart spec={mySpec} sqlQuery={myQuery} />