gabotorresruiz commented on code in PR #37208:
URL: https://github.com/apache/superset/pull/37208#discussion_r2698965233


##########
superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/transformProps.ts:
##########
@@ -278,6 +278,7 @@ export default function transformProps(
         const xValue = row[xAxisColumnName];
         const yValue = row[yAxisColumnName];
         const metricValue = row[metricLabel];
+        const rankValue = row['rank'];

Review Comment:
   Nit: Maybe extract `'rank'` to a constant? It would make the backend 
dependency clearer and easier to track if it ever changes



##########
superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/transformProps.ts:
##########
@@ -291,8 +292,13 @@ export default function transformProps(
           );
           return [];
         }
-        return [[xIndex, yIndex, metricValue] as [number, number, any]];
-      }),
+        // Include rank as 4th dimension when normalized is enabled
+        // This allows visualMap to use dimension: 3 to color by rank 
percentile
+        if (normalized) {

Review Comment:
   What happens if `rankValue` is undefined (e.g., backend didn't add the rank 
column for some reason)? Might be worth adding some defensive code here just in 
case:
   ```js
   if (normalized && rankValue !== undefined) {...}
   ```



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