dashboard opt
This commit is contained in:
@@ -31,6 +31,16 @@ export function InlineVisualizationCard({ viz }: InlineVisualizationCardProps) {
|
||||
const columns = objectRows.length > 0 ? Object.keys(objectRows[0]) : [];
|
||||
|
||||
const buildPendingChart = (): Omit<ChartConfig, 'layout'> => {
|
||||
if (view === "table") {
|
||||
return {
|
||||
id: Date.now().toString(),
|
||||
title: viz.chartSpec?.title || "Generated Analysis",
|
||||
type: "table",
|
||||
data: objectRows,
|
||||
sql: viz.sql,
|
||||
chartSpec: null,
|
||||
};
|
||||
}
|
||||
const mark = viz.chartSpec?.mark;
|
||||
const markType = typeof mark === "string" ? mark : mark?.type;
|
||||
const dashboardType = markType === "line" ? "line" : "bar";
|
||||
|
||||
@@ -20,6 +20,16 @@ export function VisualizationPanel() {
|
||||
|
||||
const buildPendingChart = (): Omit<ChartConfig, 'layout'> | null => {
|
||||
if (!currentData || !currentSQL) return null;
|
||||
if (view === "table") {
|
||||
return {
|
||||
id: Date.now().toString(),
|
||||
title: currentChartSpec?.title || 'Generated Analysis',
|
||||
type: "table",
|
||||
data: currentData,
|
||||
sql: currentSQL,
|
||||
chartSpec: null,
|
||||
};
|
||||
}
|
||||
const mark = currentChartSpec?.mark;
|
||||
const markType = typeof mark === "string" ? mark : mark?.type;
|
||||
const dashboardType = markType === "line" ? "line" : "bar";
|
||||
|
||||
Reference in New Issue
Block a user