antvis/G2

element/index.js中syncShapeStyle方法在点击图例更新图表时出错 #3275

Break-2020 posted onGitHub

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

https://antv-g2.gitee.io/zh/examples/line/basic#curved

Steps to reproduce

syncShapeStyle这个方法在4.1.2里面存在一个问题,当sourceShape和targetShape都为group时,如果前面的shape数量多,在递归的时候newChildren[i]会是undefined,之后递归里面调用get('clipShape')会直接报错。

这个问题我看到你们后面有修复,是直接在前面加了一个 if (!sourceShape || !targetShape) return的判断。然后我更新到了最新的版本,但是还是会有问题。

我用到的是折线图,shape是自己注册的,在点击图例进行filter的时候,原本只隐藏一条数据的折线,但实际上两条折线都做着动画然后淡出消失了,第二次点图例的时候,g-base\lib\abstract\container.js就会报错,具体位置是Container.prototype.add里children.push(element),提示children是undefined。

这是正常render完以后 image

点击一个图例让其中一条折线消失(正在做动画,应该是你们预设的) image

做完动画两条都消失了,我想应该是syncShapeStyle的问题 image

再次点击第一个图例时报错 image

Environment Info
g2 4.1.10
System -
Browser chrome

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


Fund this Issue

$0.00
Funded

Pull requests