You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2022/01/04 04:40:43 UTC

[GitHub] [echarts] pissang commented on a change in pull request #16298: feat(pie/sunburst): supports configuring any one border radius.

pissang commented on a change in pull request #16298:
URL: https://github.com/apache/echarts/pull/16298#discussion_r777821672



##########
File path: src/chart/helper/pieHelper.ts
##########
@@ -18,24 +18,16 @@
 */
 
 import Model from '../../model/Model';
-import Sector from 'zrender/src/graphic/shape/Sector';
-import { isArray } from 'zrender/src/core/util';
-import { parsePercent } from 'zrender/src/contain/text';
 
 export function getSectorCornerRadius(
     model: Model<{ borderRadius?: string | number | (string | number)[] }>,
-    shape: Pick<Sector['shape'], 'r0' | 'r'>,
     zeroIfNull?: boolean
 ) {
-    let cornerRadius = model.get('borderRadius');
+    const cornerRadius = model.get('borderRadius');
     if (cornerRadius == null) {
-        return zeroIfNull ? {innerCornerRadius: 0, cornerRadius: 0} : null;
-    }
-    if (!isArray(cornerRadius)) {
-        cornerRadius = [cornerRadius, cornerRadius];
+        return zeroIfNull ? { cornerRadius: 0 } : null;
     }
     return {
-        innerCornerRadius: parsePercent(cornerRadius[0], shape.r0),
-        cornerRadius: parsePercent(cornerRadius[1], shape.r)
+        cornerRadius: cornerRadius as number | number[]

Review comment:
       Is it not necessary converting the type to `number | number[]`?




-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org