qf-jonathan commented on code in PR #37208:
URL: https://github.com/apache/superset/pull/37208#discussion_r2700140041


##########
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:
   @gabotorresruiz I don't think adding defensive code here is a good idea. If 
`rankValue` is missing, we'd also need to change `colorColumn` and 
`visualMap.dimension` to avoid the rendering issue, which would remove the 
rank-based color encoding and result in an inaccurate visualization. That would 
be bad for the product.
   
   I think it's preferable to fail loudly if the rank column is missing rather 
than silently degrading the chart and hiding a backend issue. Instead, I added 
unit tests in `Heatmap/buildQuery.test.ts` to ensure the UI always requests 
rank processing, regardless of the `Normalized` setting, let me know what you 
think.



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