kgabryje commented on code in PR #24517:
URL: https://github.com/apache/superset/pull/24517#discussion_r1243567703
##########
superset-frontend/plugins/plugin-chart-echarts/src/Treemap/transformProps.ts:
##########
@@ -141,7 +148,17 @@ export default function transformProps(
};
const refs: Refs = {};
const colorFn = CategoricalColorNamespace.getScale(colorScheme as string);
- const numberFormatter = getNumberFormatter(numberFormat);
+ const numberFormatter =
+ getCustomFormatter(
+ buildCustomFormatters(
+ metric,
+ currencyFormats,
+ columnFormats,
+ numberFormat,
+ ),
+ metric,
+ ) ?? getNumberFormatter(numberFormat);
Review Comment:
💯
##########
superset-frontend/plugins/plugin-chart-echarts/src/utils/buildCustomFormatters.ts:
##########
@@ -0,0 +1,74 @@
+import {
+ Currency,
+ CurrencyFormatter,
+ ensureIsArray,
+ getNumberFormatter,
+ isDefined,
+ isSavedMetric,
+ NumberFormatter,
+ QueryFormMetric,
+} from '@superset-ui/core';
+
+export const buildCustomFormatters = (
+ metrics: QueryFormMetric | QueryFormMetric[] | undefined,
+ currencyFormats: Record<string, Currency>,
+ columnFormats: Record<string, string>,
+ d3Format: string | undefined,
+ labelMap: Record<string, string[]> = {},
+ seriesNames: string[] = [],
+) => {
Review Comment:
Good point
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]