rusackas commented on code in PR #35459:
URL: https://github.com/apache/superset/pull/35459#discussion_r3606770458
##########
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:
Left/right layouts have landed since this comment, and I've updated the
control descriptions to match the behavior. Fully geometric recentering for
arbitrary angles can come in a follow-up PR. Thanks @EnxDev!
--
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]