antvis/G2

BUG: 自定义轴标签在缩放页面时消失 #5826

lxfu1 posted onGitHub

AntV Open Source Contribution Plan(可选)

  • 我同意将这个 Issue 参与 OSCP 计划

Issue 类型

  • 中级任务

任务介绍

正常如下 image

缩放后 image

参考说明

  1. 访问官网示例 https://g2.antv.antgroup.com/examples/component/axis/#axis
  2. 缩放页面调整画布大小

【BENcorry 认领】

posted by BENcorry over 1 year ago

Issue 类型 补充一下哈

posted by BENcorry over 1 year ago

@BENcorry 已经补充!

posted by pearmini over 1 year ago

问题定位到是https://github.com/antvis/component/blob/48b2d5a9f0ce2e473289e6c9e937ff5ec3dabb0b/src/ui/axis/axis.ts#L77C5-L79C6 使用离屏渲染优化导致group hide的问题,这里看起来是一个实验性的优化,除了axis label之外其他的渲染不会再更新的时候做这个操作。

有点纠结是不是要删除这块代码还是用其他方式去优化这个问题。 @pearmini

posted by BENcorry over 1 year ago

@BENcorry 我还是不是很清楚出现这个问题的原因。hide 之后不能设置回可见吗?

posted by pearmini over 1 year ago

offscreenGroup导致hide的原因还不是很确定,目前可以确认的是:

  1. offscreenGroup的overlap逻辑是没有触发的,因为目前没有配置overlap,所以在processOverlap过程中不会触发offscreenGroup的逻辑。
  2. 比较神奇的是,在处理selection update的逻辑中,preLabel在offscreenGroup有时候会存在querySelector为空的情况,但是吃了一个晚饭,这个case就没复现了,我下午存在一直重复复现。把preLabel为null的时候return一个空的transitions会正常。
  3. 在transitionShape函数中,注释掉afterTransition中的destroy逻辑也会正常。
posted by BENcorry over 1 year ago
posted by pearmini over 1 year ago

Fund this Issue

$0.00
Funded

Pull requests