EnxDev commented on code in PR #35459:
URL: https://github.com/apache/superset/pull/35459#discussion_r3596742271
##########
superset-frontend/plugins/plugin-chart-echarts/src/Pie/transformProps.ts:
##########
@@ -73,52 +76,84 @@ export function parseParams({
return [name, formattedValue, formattedPercent];
}
-function getTotalValuePadding({
+const HALF_DONUT_SWEEP_LIMIT = 180;
+
+const HALF_DONUT_LAYOUT: Record<
+ HalfDonut,
+ { centerOffset: number; totalTopBase: number }
+> = {
+ top: { centerOffset: 20, totalTopBase: 68.5 },
+ bottom: { centerOffset: -20, totalTopBase: 30 },
+ none: { centerOffset: 0, totalTopBase: 50 },
+};
+
+export const getHalfDonut = (
+ startAngle: number,
+ sweptAngle: number,
+): HalfDonut => {
+ if (sweptAngle > HALF_DONUT_SWEEP_LIMIT) return 'none';
Review Comment:
`getHalfDonut` only recognizes top (startAngle % 360 === 180) and bottom
(=== 0) halves. A lateral half-donut startAngle=90 or 270 with sweptAngle=180,
fully reachable via the new controls gets 'none', so center stays ['50%',
'50%'] (transformProps.ts:451) and the arc renders pushed into one lateral half
of the canvas with the other half blank.
Same for any typed start angle that isn't exactly 0/180/360. Worth either
adding left/right layouts with a horizontal centerOffset, or documenting
top/bottom-only in the control description.
--
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]