New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
element/index.js中syncShapeStyle方法在点击图例更新图表时出错 #3275
Comments
我尝试用API文档里的方法,给chart先off后on去监听了legend:click或者是legend:mouseup,但是都不能覆盖掉原有的监听事件 |
@Break-2020 更新到最新的 4.1.x 版本试试看~之前有做过这部分的 issue。 |
4.1.4 版本之后还是有这个问题吗? |
有,我用4.1.10试的 |
给一个稳定复现 demo? |
暂时可能抽不出时间,后面抽空我搞一个 |
https://stackblitz.com/edit/react-xdoev8?file=src/index.js 这个链接应该可以用的吧,点击图例触发shape显示隐藏就会出问题 问题应该是出在第一次点击,shape消失的这个过程 |
Reproduction link
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完以后
点击一个图例让其中一条折线消失(正在做动画,应该是你们预设的)
做完动画两条都消失了,我想应该是syncShapeStyle的问题
再次点击第一个图例时报错
The text was updated successfully, but these errors were encountered: