rusackas commented on code in PR #37625:
URL: https://github.com/apache/superset/pull/37625#discussion_r2770059216


##########
superset-frontend/plugins/legacy-plugin-chart-horizon/src/HorizonChart.tsx:
##########
@@ -113,7 +118,7 @@ class HorizonChart extends PureComponent {
         >
           {data.map(row => (
             <HorizonRow
-              key={row.key}
+              key={row.key as unknown as string}

Review Comment:
   Addressed — thanks for the review!



##########
superset-frontend/plugins/legacy-plugin-chart-map-box/src/MapBox.tsx:
##########
@@ -109,15 +132,15 @@ class MapBox extends Component {
     // to an area outside of the original bounds, no additional queries are 
made to the backend to
     // retrieve additional data.
     // add this variable to widen the visible area
-    const offsetHorizontal = (width * 0.5) / 100;
-    const offsetVertical = (height * 0.5) / 100;
+    const offsetHorizontal = ((width ?? 400) * 0.5) / 100;
+    const offsetVertical = ((height ?? 400) * 0.5) / 100;
     const bbox = [
-      bounds[0][0] - offsetHorizontal,
-      bounds[0][1] - offsetVertical,
-      bounds[1][0] + offsetHorizontal,
-      bounds[1][1] + offsetVertical,
+      bounds![0][0] - offsetHorizontal,
+      bounds![0][1] - offsetVertical,
+      bounds![1][0] + offsetHorizontal,
+      bounds![1][1] + offsetVertical,

Review Comment:
   Addressed — thanks for the review!



##########
superset-frontend/plugins/legacy-plugin-chart-map-box/src/ScatterPlotGlowOverlay.tsx:
##########
@@ -186,7 +235,7 @@ class ScatterPlotGlowOverlay extends PureComponent {
           if (location.properties.cluster) {
             let clusterLabel = clusterLabelMap[i];
             const scaledRadius = roundDecimal(
-              (clusterLabel / maxLabel) ** 0.5 * radius,
+              ((clusterLabel as number) / safeMaxLabel) ** 0.5 * radius,

Review Comment:
   Addressed — thanks for the review!



##########
superset-frontend/plugins/legacy-plugin-chart-map-box/src/ScatterPlotGlowOverlay.tsx:
##########
@@ -218,11 +272,11 @@ class ScatterPlotGlowOverlay extends PureComponent {
             ctx.fillStyle = gradient;
             ctx.fill();
 
-            if (Number.isFinite(parseFloat(clusterLabel))) {
-              if (clusterLabel >= 10000) {
-                clusterLabel = `${Math.round(clusterLabel / 1000)}k`;
-              } else if (clusterLabel >= 1000) {
-                clusterLabel = `${Math.round(clusterLabel / 100) / 10}k`;
+            if (Number.isFinite(parseFloat(String(clusterLabel)))) {
+              if ((clusterLabel as number) >= 10000) {
+                clusterLabel = `${Math.round((clusterLabel as number) / 
1000)}k`;
+              } else if ((clusterLabel as number) >= 1000) {
+                clusterLabel = `${Math.round((clusterLabel as number) / 100) / 
10}k`;

Review Comment:
   Addressed — thanks for the review!



##########
superset-frontend/plugins/legacy-plugin-chart-map-box/src/ScatterPlotGlowOverlay.tsx:
##########
@@ -234,23 +288,32 @@ class ScatterPlotGlowOverlay extends PureComponent {
             }
           } else {
             const defaultRadius = radius / 6;
-            const radiusProperty = location.properties.radius;
-            const pointMetric = location.properties.metric;
-            let pointRadius =
-              radiusProperty === null ? defaultRadius : radiusProperty;
-            let pointLabel;
-
-            if (radiusProperty !== null) {
-              const pointLatitude = lngLatAccessor(location)[1];
+            const radiusProperty = location.properties.radius as
+              | number
+              | null
+              | undefined;
+            const pointMetric = location.properties.metric as
+              | number
+              | string
+              | null;
+            // Handle both null and undefined as "missing" - use default radius
+            let pointRadius: number =
+              radiusProperty == null
+                ? defaultRadius
+                : (radiusProperty as number);

Review Comment:
   Addressed — thanks for the review!



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