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


##########
superset-frontend/plugins/plugin-chart-echarts/src/Radar/transformProps.ts:
##########
@@ -111,11 +124,36 @@ export default function transformProps(
   const { setDataMask = () => {}, onContextMenu } = hooks;
   const colorFn = CategoricalColorNamespace.getScale(colorScheme as string);
   const numberFormatter = getNumberFormatter(numberFormat);
+  const denormalizedSeriesValues: SeriesNormalizedMap = {};
+
+  const getDenormalisedSeriesValue = (
+    seriesName: string,
+    normalisedValue: string,
+  ): number => {
+    if (
+      Object.prototype.hasOwnProperty.call(
+        denormalizedSeriesValues,
+        seriesName,
+      ) &&
+      Object.prototype.hasOwnProperty.call(
+        denormalizedSeriesValues[seriesName],
+        normalisedValue,
+      )
+    ) {
+      return denormalizedSeriesValues[seriesName][normalisedValue];
+    }
+
+    // Fallback: return the normalised value itself as a number
+    return Number(normalisedValue);
+  };

Review Comment:
   The  getDenormalisedSeriesValue is getter function for safely getting the 
denormalised value , if we dont find the value we fallback to normalised value, 
this shouldnt happen but we do this to prevent crashes & unexpected errors 
which can crash the user experience



-- 
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]

Reply via email to