msyavuz commented on code in PR #33559:
URL: https://github.com/apache/superset/pull/33559#discussion_r2107611747


##########
superset-frontend/plugins/plugin-chart-echarts/src/Radar/transformProps.ts:
##########
@@ -111,20 +128,46 @@ export default function transformProps(
   const { setDataMask = () => {}, onContextMenu } = hooks;
   const colorFn = CategoricalColorNamespace.getScale(colorScheme as string);
   const numberFormatter = getNumberFormatter(numberFormat);
+  const denormalizedSeriesValues: SeriesNormalizedMap = {};
+
+  const getDenormalizedSeriesValue = (
+    seriesName: string,
+    normalizedValue: string,
+  ): number =>
+    denormalizedSeriesValues?.[seriesName]?.[normalizedValue] ??
+    Number(normalizedValue);
+
+  const metricLabels = metrics.map(getMetricLabel);
+
   const formatter = (params: CallbackDataParams) =>
     formatLabel({
       params,
       numberFormatter,
       labelType,
+      getDenormalizedSeriesValue,
+      metricsWithCustomBounds,
+      metricLabels,
     });
 
-  const metricLabels = metrics.map(getMetricLabel);
   const groupbyLabels = groupby.map(getColumnLabel);
 
+  const metricsWithCustomBounds = new Set(
+    metricLabels.filter(metricLabel => {
+      const config = columnConfig?.[metricLabel];
+      const hasMax =
+        !isNull(config?.radarMetricMaxValue) &&
+        !isUndefined(config?.radarMetricMaxValue);
+      const hasMin =
+        !isUndefined(config?.radarMetricMinValue) &&
+        config?.radarMetricMinValue !== 0;
+      return hasMax || hasMin;
+    }),
+  );
+
   const metricLabelAndMaxValueMap = new Map<string, number>();
   const metricLabelAndMinValueMap = new Map<string, number>();
   const columnsLabelMap = new Map<string, string[]>();
-  const transformedData: RadarSeriesDataItemOption[] = [];
+  let transformedData: RadarSeriesDataItemOption[] = [];

Review Comment:
   Is this necessary? Can't we create a new array when this is reassigned and 
use it?



-- 
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: notifications-unsubscr...@superset.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to