fix(datazoom): skip previews with degenerate scales - #4684
Merged
Merged
Conversation
skie1997
approved these changes
Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤔 这个分支是...
🔗 相关 issue 链接
#4186:本次保留数据更新后的 domain 刷新,并补充纯 VChart 回归测试。
🔗 相关的 PR 链接
#4527
🐞 Bugserver 用例 id
6503dac997ee1ad37a86235a — lock-domain
💡 问题的背景&解决方案
分类 X 轴、数值 Y 轴图表的竖向 DataZoom 会多显示一条预览线:该预览的 value domain 为
[0, 0],所有点映射到滑轨中间。#4527 中的2533b828e删除了预览比例尺有效性检查,导致这类退化预览也被绘制。恢复
_isScaleValid(xScale) && _isScaleValid(yScale),同时保留_handleDataCollectionChange中的_initAfterLayout()。更新时先刷新 domain/range,再判断预览是否可绘制;单条数据更新为多条后,预览和缩放过滤仍能正常恢复。底部正常预览保持一致。预期效果(原 case 的标准图,本地修复后已完成视觉核对):
🧪 回归验证
updateSpecSync/updateDataSync从单条更新为多条后恢复预览和完整数据范围。784a405c3f49734a6e通过版本的图元数据和几何位置均与静态参考图一致。
本地检查通过(在
packages/vchart执行):定向检查:4 个测试套件、145 个测试通过。更新至最新
develop后,推送钩子执行rush test --only tag:package:VChart 82 个测试套件、448 个测试通过,vutils-extension 的 1 个测试通过。提交钩子的 ESLint、Prettier、commitlint 均通过。完整验证记录见docs/superpowers/plans/2026-09-15-datazoom-preview-regression.md。📝 Changelog
☑️ 自测
🚀 Summary
copilot:summary
🔍 Walkthrough
copilot:walkthrough