dashboard opt

This commit is contained in:
qixinbo
2026-03-17 11:47:30 +08:00
parent 4bbecabc20
commit 4b7d8b7b9c
4 changed files with 77 additions and 5 deletions
@@ -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";