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


##########
superset-frontend/plugins/preset-chart-deckgl/src/layers/Geojson/Geojson.tsx:
##########
@@ -328,7 +335,11 @@ export const getLayer: GetLayerType<GeoJsonLayer> = 
function ({
       getFillColor(feature, filterState?.value),
     getLineColor,
     getLineWidth: fd.line_width || 1,
-    pointRadiusScale: fd.point_radius_scale,
+    // Use deck.gl defaults as fallbacks for backward compatibility with 
existing charts.
+    // New charts will get control panel defaults (point_radius=10, 
units='pixels', scale=1).
+    getPointRadius: toNumber(fd.point_radius, 1),
+    pointRadiusUnits: fd.point_radius_units ?? 'meters',

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Inconsistent default unit value</b></div>
   <div id="fix">
   
   The fallback for `pointRadiusUnits` is `'meters'` but the comment on lines 
338-339 explicitly states new charts should get `units='pixels'` as the 
default. The control panel also defines `default: 'pixels'` 
(controlPanel.ts:400). Align the fallback with the documented intent.
   </div>
   
   
   <details>
   <summary>
   <b>Code suggestion</b>
   </summary>
   <blockquote>Check the AI-generated fix before applying</blockquote>
   <div id="code">
   
   
   ```
    --- 
a/superset-frontend/plugins/preset-chart-deckgl/src/layers/Geojson/Geojson.tsx
    +++ 
b/superset-frontend/plugins/preset-chart-deckgl/src/layers/Geojson/Geojson.tsx
    @@ -338,7 +338,7 @@ export const getLayer: GetLayerType<GeoJsonLayer> = 
function ({
         // Use deck.gl defaults as fallbacks for backward compatibility with 
existing charts.
         // New charts will get control panel defaults (point_radius=10, 
units='pixels', scale=1).
         getPointRadius: toNumber(fd.point_radius, 1),
    -    pointRadiusUnits: fd.point_radius_units ?? 'meters',
    +    pointRadiusUnits: fd.point_radius_units ?? 'pixels',
         pointRadiusScale: toNumber(fd.point_radius_scale, 1),
         lineWidthUnits: fd.line_width_unit,
         pointType,
   ```
   
   </div>
   </details>
   
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #4931d3</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