antvis/G2

自定义shape的path中包含三次贝塞尔曲线时,切换动画报错 #3213

gongtiexin posted onGitHub

  • I have searched the issues of this repository and believe that this is not a duplicate.

Edit on CodeSandbox

Steps to reproduce

点击任意legend报错,因为我用了'C',而饼图更新动画中没有考虑'C'的情况

Environment Info
g2 4.1.7
System -
Browser -

需求是自定义一个圆角的饼环图,画圆角时采用'A'或者'C'

'A'在切换的时候动画会有问题

'C'在切换的时候由于下面代码报错

function getArcStartPoint(path: PathCommand) { let startPoint; if (path[0] === 'M' || path[0] === 'L') { startPoint = [path[1], path[2]]; } else if (path[0] === 'a' || path[0] === 'A') { // path[0] === 'c' || path[0] === 'C' startPoint = [path[path.length - 2], path[path.length - 1]]; } return startPoint; } 希望在这个函数中兼容'C','c'

<!-- generated by antv-issue-helper. DO NOT REMOVE -->


Fund this Issue

$0.00
Funded

Pull requests