sadpandajoe commented on code in PR #36101:
URL: https://github.com/apache/superset/pull/36101#discussion_r2525118514
##########
superset-frontend/packages/superset-ui-chart-controls/src/utils/getColorFormatters.ts:
##########
@@ -38,20 +38,20 @@ export const getOpacity = (
minOpacity = MIN_OPACITY_BOUNDED,
maxOpacity = MAX_OPACITY,
) => {
- if (
- extremeValue === cutoffPoint ||
- typeof cutoffPoint !== 'number' ||
- typeof extremeValue !== 'number' ||
- typeof value !== 'number'
- ) {
+ if (extremeValue === cutoffPoint || typeof value !== 'number') {
return maxOpacity;
}
+ const numCutoffPoint =
+ typeof cutoffPoint === 'string' ? parseFloat(cutoffPoint) : cutoffPoint;
+ const numExtremeValue =
+ typeof extremeValue === 'string' ? parseFloat(extremeValue) : extremeValue;
Review Comment:
Should we guard in case if `numCutoffPoint` or `numExtremeValue` doesn't
return a number? I see we check for a string but what about `NaN`
--
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]