antvis/G2

[v5]点击 Legend 过滤后,再点击恢复时,漏斗图取nextPoints错误 #4877

shield2018 posted onGitHub

代码位置:

https://github.com/antvis/G2/blob/f2a53a97e9d7cd739562ccc40a91997a17b480fd/src/runtime/plot.ts#L1192-L1221

1214行 const value = { ...v, shape, mark: markType, defaultShape, index };

value的index被设置为外层index。恢复过滤时,index为0。

出现以下问题: funnel 漏斗图,计算四边形位置时,会使用index获取nextpoint,如下:

https://github.com/antvis/G2/blob/f2a53a97e9d7cd739562ccc40a91997a17b480fd/src/shape/interval/funnel.ts#L38-L50

const { index } = value;
const nextPoints = point2d[index + 1];

导致取到的下一个点坐标错误


关注一下

posted by shield2018 almost 2 years ago

这两天就解决

posted by pearmini almost 2 years ago

Fund this Issue

$0.00
Funded

Pull requests