mistercrunch commented on code in PR #30349:
URL: https://github.com/apache/superset/pull/30349#discussion_r1769356950


##########
superset-frontend/plugins/plugin-chart-echarts/src/Radar/transformProps.ts:
##########
@@ -199,16 +199,20 @@ export default function transformProps(
 
   const indicator = metricLabels.map(metricLabel => {
     const maxValueInControl = columnConfig?.[metricLabel]?.radarMetricMaxValue;
+    const minValueInControl = columnConfig?.[metricLabel]?.radarMetricMinValue;
+
     // Ensure that 0 is at the center of the polar coordinates
     const metricValueAsMax =
       metricLabelAndMaxValueMap.get(metricLabel) === 0
         ? Number.MAX_SAFE_INTEGER
         : metricLabelAndMaxValueMap.get(metricLabel);
     const max =
       maxValueInControl === null ? metricValueAsMax : maxValueInControl;
+    const min = minValueInControl === null ? 0 : minValueInControl;

Review Comment:
   Oh, you wrote: 
   
   > actually, undefined or 0 should result in the same behavior according to 
the [docs](https://echarts.apache.org/en/option.html#radar.indicator.min)
   
   Which was misleading at first to me assuming their default was, or should 
be, "the min in the data, even if sub-zero". Given that wrong assumption I 
thought "but what if you don't want the `ACTUAL MIN` (assuming actual in was 
the default) and want zero instead?"
   
   So if you want "zero" you can leave it empty or set it to zero. But what if 
you want "the min value in the data" which perhaps **would be a better 
default** for them (or us) to use ... (?) Say for your use case, you probably 
want "whatever is the min in the data", which happens to be -4, and it might 
work to set a hard value in the chart if the data isn't dynamic. Seems that if 
their default was "the min data from the dataset" you woudn't have had to dig 
this rabbit hole... 
   
   If you felt fancy, you could do look to see if min is `undefined` on our 
side, if so you dig in the dataset for the `min` value and dynamically use that 
to pass to their library. Essentially if superset's min is `undefined` we find 
the min and use that.



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