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:41:44 UTC
[GitHub] [echarts] plainheart commented on a change in pull request #16298: feat(pie/sunburst): supports configuring any one border radius.
plainheart commented on a change in pull request #16298:
URL: https://github.com/apache/echarts/pull/16298#discussion_r777821924
##########
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:
Yes. It's legacy code. Will remove it.
--
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