Skip to content

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.

fix: show at most two decimal points in column summary axes (#4251)

Akshay Agrawalb76d11bfd758
diff --git a/frontend/src/components/data-table/__tests__/__snapshots__/chart-spec-model.test.ts.snap b/frontend/src/components/data-table/__tests__/__snapshots__/chart-spec-model.test.ts.snap
index 2d22240074..afaa4de6d9 100644
--- a/frontend/src/components/data-table/__tests__/__snapshots__/chart-spec-model.test.ts.snap
+++ b/frontend/src/components/data-table/__tests__/__snapshots__/chart-spec-model.test.ts.snap
@@ -57,8 +57,9 @@ exports[`ColumnChartSpecModel > snapshot > array 1`] = `
],
"x": {
"axis": {
- "labelExpr": "(datum.value >= 10000 || datum.value <= -10000) ? format(datum.value, '.2e') : datum.value",
- "labelFontSize": 8,
+ "labelExpr": "(datum.value >= 10000 || datum.value <= -10000) ? format(datum.value, '.2e') : format(datum.value, '.2~f')",
+ "labelFontSize": 8.5,
+ "labelOpacity": 0.5,
"title": null,
},
"bin": true,
@@ -144,8 +145,9 @@ exports[`ColumnChartSpecModel > snapshot > csv data 1`] = `
],
"x": {
"axis": {
- "labelExpr": "(datum.value >= 10000 || datum.value <= -10000) ? format(datum.value, '.2e') : datum.value",
- "labelFontSize": 8,
+ "labelExpr": "(datum.value >= 10000 || datum.value <= -10000) ? format(datum.value, '.2e') : format(datum.value, '.2~f')",
+ "labelFontSize": 8.5,
+ "labelOpacity": 0.5,
"title": null,
},
"bin": true,
@@ -231,8 +233,9 @@ exports[`ColumnChartSpecModel > snapshot > csv string 1`] = `
],
"x": {
"axis": {
- "labelExpr": "(datum.value >= 10000 || datum.value <= -10000) ? format(datum.value, '.2e') : datum.value",
- "labelFontSize": 8,
+ "labelExpr": "(datum.value >= 10000 || datum.value <= -10000) ? format(datum.value, '.2e') : format(datum.value, '.2~f')",
+ "labelFontSize": 8.5,
+ "labelOpacity": 0.5,
"title": null,
},
"bin": true,
diff --git a/frontend/src/components/data-table/chart-spec-model.tsx b/frontend/src/components/data-table/chart-spec-model.tsx
index b1ece4cfd2..a2d2da167c 100644
--- a/frontend/src/components/data-table/chart-spec-model.tsx
+++ b/frontend/src/components/data-table/chart-spec-model.tsx
@@ -232,9 +232,10 @@ export class ColumnChartSpecModel<T> {
bin: true,
axis: {
title: null,
- labelFontSize: 8,
+ labelFontSize: 8.5,
+ labelOpacity: 0.5,
labelExpr:
- "(datum.value >= 10000 || datum.value <= -10000) ? format(datum.value, '.2e') : datum.value",
+ "(datum.value >= 10000 || datum.value <= -10000) ? format(datum.value, '.2e') : format(datum.value, '.2~f')",
},
},
y: {
diff --git a/frontend/src/components/data-table/column-header.tsx b/frontend/src/components/data-table/column-header.tsx
index 8f84c64611..cbd760ac6a 100644
--- a/frontend/src/components/data-table/column-header.tsx
+++ b/frontend/src/components/data-table/column-header.tsx
@@ -278,7 +278,7 @@ export const DataTableColumnHeaderWithSummary = <TData, TValue>({
return (
<div
className={cn(
- "flex flex-col h-full py-0.5 justify-between items-start",
+ "flex flex-col h-full pt-0.5 pb-3 justify-between items-start",
className,
)}
>