mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
fix: Typing of labelMap (#21181)
* fix: Typing of labelMap * Adjusts val types
This commit is contained in:
committed by
GitHub
parent
5811262cf2
commit
1143e17742
@@ -18,7 +18,6 @@
|
||||
*/
|
||||
import {
|
||||
CategoricalColorNamespace,
|
||||
DataRecordValue,
|
||||
getColumnLabel,
|
||||
getMetricLabel,
|
||||
getNumberFormatter,
|
||||
@@ -156,21 +155,18 @@ export default function transformProps(
|
||||
)
|
||||
.flat(2);
|
||||
|
||||
const labelMap = data.reduce(
|
||||
(acc: Record<string, DataRecordValue[]>, datum) => {
|
||||
const label = extractGroupbyLabel({
|
||||
datum,
|
||||
groupby: groupbyLabels,
|
||||
coltypeMapping,
|
||||
timeFormatter: getTimeFormatter(dateFormat),
|
||||
});
|
||||
return {
|
||||
...acc,
|
||||
[label]: groupbyLabels.map(col => datum[col]),
|
||||
};
|
||||
},
|
||||
{},
|
||||
);
|
||||
const labelMap = data.reduce((acc: Record<string, string[]>, datum) => {
|
||||
const label = extractGroupbyLabel({
|
||||
datum,
|
||||
groupby: groupbyLabels,
|
||||
coltypeMapping,
|
||||
timeFormatter: getTimeFormatter(dateFormat),
|
||||
});
|
||||
return {
|
||||
...acc,
|
||||
[label]: groupbyLabels.map(col => datum[col] as string),
|
||||
};
|
||||
}, {});
|
||||
|
||||
const selectedValues = (filterState.selectedValues || []).reduce(
|
||||
(acc: Record<string, number>, selectedValue: string) => {
|
||||
|
||||
Reference in New Issue
Block a user