bito-code-review[bot] commented on code in PR #38458:
URL: https://github.com/apache/superset/pull/38458#discussion_r2921799858


##########
superset-frontend/plugins/legacy-plugin-chart-map-box/src/ScatterPlotGlowOverlay.tsx:
##########
@@ -239,8 +245,10 @@ class ScatterPlotGlowOverlay extends 
PureComponent<ScatterPlotGlowOverlayProps>
             const safeNumericLabel = Number.isFinite(numericLabel)
               ? numericLabel
               : 0;
+            const minClusterRadius = radius * MIN_CLUSTER_RADIUS_RATIO;
+            const ratio = Math.abs(safeNumericLabel) / safeMaxAbsLabel;
             const scaledRadius = roundDecimal(
-              (safeNumericLabel / safeMaxLabel) ** 0.5 * radius,
+              minClusterRadius + ratio ** 0.5 * (radius - minClusterRadius),
               1,
             );

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Incorrect refactoring changed cluster radius 
scaling</b></div>
   <div id="fix">
   
   The refactoring altered the mathematical operation due to operator 
precedence. Originally, it computed `Math.abs(safeNumericLabel) / 
(safeMaxAbsLabel ** 0.5)`, but now it computes `(Math.abs(safeNumericLabel) / 
safeMaxAbsLabel) ** 0.5`, which changes how cluster radii scale with label 
values and could lead to incorrect visual sizing in map clusters.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #f66536</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



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