feat: conditional formatting improvements in tables (#34330)

This commit is contained in:
SBIN2010
2025-08-19 01:13:16 +03:00
committed by GitHub
parent 1f482b42eb
commit 852adaa6cc
12 changed files with 571 additions and 76 deletions

View File

@@ -726,7 +726,6 @@ export default function TableChart<D extends DataRecord = DataRecord>(
const {
key,
label: originalLabel,
isNumeric,
dataType,
isMetric,
isPercentMetric,
@@ -771,7 +770,6 @@ export default function TableChart<D extends DataRecord = DataRecord>(
const { truncateLongCells } = config;
const hasColumnColorFormatters =
isNumeric &&
Array.isArray(columnColorFormatters) &&
columnColorFormatters.length > 0;

View File

@@ -772,17 +772,22 @@ const config: ControlPanelConfig = {
chart?.queriesResponse?.[0] ?? {};
const numericColumns =
Array.isArray(colnames) && Array.isArray(coltypes)
? colnames
.filter(
(colname: string, index: number) =>
coltypes[index] === GenericDataType.Numeric,
)
.map((colname: string) => ({
value: colname,
label: Array.isArray(verboseMap)
? colname
: (verboseMap[colname] ?? colname),
}))
? colnames.reduce((acc, colname, index) => {
if (
coltypes[index] === GenericDataType.Numeric ||
(!explore?.controls?.time_compare?.value &&
coltypes[index] === GenericDataType.String)
) {
acc.push({
value: colname,
label: Array.isArray(verboseMap)
? colname
: (verboseMap[colname] ?? colname),
dataType: coltypes[index],
});
}
return acc;
}, [])
: [];
const columnOptions = explore?.controls?.time_compare?.value
? processComparisonColumns(