A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.
Python artificial-intelligencedagdata-sciencedata-visualizationdataflowdeveloper-toolsmachine-learningnotebookspipelinepythonreactivesqlweb-app
fix: table charts should update when underlying data updates (#6809)
Shahmir Varqhaa35648cede90
diff --git a/frontend/src/components/data-table/charts/charts.tsx b/frontend/src/components/data-table/charts/charts.tsxindex 64de07ce03..2caa6f12b9 100644--- a/frontend/src/components/data-table/charts/charts.tsx+++ b/frontend/src/components/data-table/charts/charts.tsx@@ -48,6 +48,7 @@ const CHART_HEIGHT = 290;export interface TablePanelProps {cellId: CellId | null;+ data: unknown[];dataTable: JSX.Element;displayHeader: boolean;getDataUrl?: GetDataUrl;@@ -56,6 +57,7 @@ export interface TablePanelProps {export const TablePanel: React.FC<TablePanelProps> = ({cellId,+ data,dataTable,getDataUrl,fieldTypes,@@ -211,6 +213,7 @@ export const TablePanel: React.FC<TablePanelProps> = ({return (<TabsContent key={idx} value={tab.tabName} className="h-[400px] mt-1"><ChartPanel+ tableData={data}chartConfig={tab.config}chartType={tab.chartType}saveChart={saveChart}@@ -228,6 +231,7 @@ export const TablePanel: React.FC<TablePanelProps> = ({const CHART_PLACEHOLDER_CODE = "X and Y columns are not set";export const ChartPanel: React.FC<{+ tableData: unknown[];chartConfig: ChartSchemaType | null;chartType: ChartType;saveChart: (formValues: ChartSchemaType) => void;@@ -235,6 +239,7 @@ export const ChartPanel: React.FC<{getDataUrl?: GetDataUrl;fieldTypes?: FieldTypesWithExternalType | null;}> = ({+ tableData,chartConfig,chartType,saveChart,@@ -255,7 +260,7 @@ export const ChartPanel: React.FC<{const { ref: chartContainerRef } = useResizeObserver();const { data, isPending, error } = useAsyncData(async () => {- if (!getDataUrl) {+ if (!getDataUrl || tableData.length === 0) {return [];}@@ -276,7 +281,8 @@ export const ChartPanel: React.FC<{},);return chartData;- }, []);+ // Re-run when the data table changes+ }, [tableData]);const formValues = form.watch();diff --git a/frontend/src/plugins/impl/DataTablePlugin.tsx b/frontend/src/plugins/impl/DataTablePlugin.tsxindex fae3d027ad..607008665f 100644--- a/frontend/src/plugins/impl/DataTablePlugin.tsx+++ b/frontend/src/plugins/impl/DataTablePlugin.tsx@@ -691,6 +691,7 @@ export const LoadingDataTableComponent = memo({props.showChartBuilder ? (<TablePaneldisplayHeader={displayHeader}+ data={data?.rows || []}dataTable={dataTable}getDataUrl={props.get_data_url}fieldTypes={props.fieldTypes}