richardfogaca commented on code in PR #38675:
URL: https://github.com/apache/superset/pull/38675#discussion_r2982435379


##########
superset-frontend/plugins/plugin-chart-echarts/src/Bubble/transformProps.ts:
##########
@@ -172,6 +176,22 @@ export default function transformProps(chartProps: 
EchartsBubbleChartProps) {
   const xAxisFormatter = getNumberFormatter(xAxisFormat);
   const yAxisFormatter = getNumberFormatter(yAxisFormat);
   const tooltipSizeFormatter = getNumberFormatter(tooltipSizeFormat);
+  const legendData = Array.from(legends).sort((a: string, b: string) => {
+    if (!legendSort) return 0;
+    return legendSort === 'asc' ? a.localeCompare(b) : b.localeCompare(a);
+  });
+  const legendLayout = getLegendLayoutResult({
+    chartHeight: height,
+    chartWidth: width,
+    legendItems: legendData,
+    legendMargin,
+    orientation: legendOrientation,
+    show: showLegend,
+    theme,
+    type: legendType,
+  });
+  const effectiveLegendMargin = legendLayout.effectiveMargin ?? legendMargin;

Review Comment:
   effectiveMargin is optional by design here. getLegendLayoutResult() only 
returns it when a plain legend stays plain; hidden/non-plain cases and scroll 
fallback return only effectiveType. So the `?? legendMargin` fallback is 
intentional rather than dead code



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