Skip to content

fix(axis): 修复旋转标签采样角度单位不一致 - #4690

Merged
xile611 merged 1 commit into
developfrom
codex/fix-axis-sampling-angle
Sep 18, 2026
Merged

xile611 merged 1 commit into
developfrom
codex/fix-axis-sampling-angle

Conversation

@xile611

@xile611 xile611 commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

旋转坐标轴标签使用 angle: 90 时,绘制路径转换为弧度,采样路径却把 90 当作弧度,导致标签被过度抽样。本次在公共采样入口复用 transformToGraphic,使采样和绘制使用一致的角度单位,同时保留原始 spec。

🤔 这个分支是...

  • Bug fix
  • 测试 case 更新

🐞 Bugserver 用例 id

646745e9cb5fa8011f4e0344 — axis-lable style

💡 问题的背景&解决方案

transformToGraphic 改为返回新对象后,采样路径不能再依赖绘制时原地转换角度的副作用。AxisComponent._tickTransformOption() 现在通过同一个工具转换 labelStyle,生产代码只改一行。原 style 不会被修改,重复更新也不会对已转换的角度再次转换。

新增真实图表回归测试,覆盖正负 90° 下长短标签采样一致、更新为 0° 后恢复原角度,以及输入和轴内部 spec 角度保持不变。补充中文 patch 记录及验证文档。

📝 Changelog

Language Changelog
English Fix excessive axis tick sampling caused by inconsistent angle units for rotated labels.
Chinese 修复坐标轴旋转标签的采样角度单位与绘制不一致,导致标签过度抽样的问题。

☑️ 自测

  • 文档提供了,或者更新,或者不需要
  • Demo 提供了,或者更新,或者不需要
  • Ts 类型定义提供了,或者更新,或者不需要
  • Changelog 提供了,或者不需要

验证:

  • 修改前,正负 90° 两个回归用例均在采样结果断言失败;修复后通过。
  • 相关轴组件和 update-spec 测试:8 个套件、77 个测试通过。
  • 分支基于最新 developa6c1e7f48),新增的 2 个回归测试再次通过。
  • TypeScript、定向 ESLint、git diff --check 通过。
  • 两次默认 pre-push 并行运行分别在 poptip/simple-register.test.tsanimation/manual-ticker.test.tsCompiler.initView 初始化处出现 defaultLayer === null;失败套件在另一轮可通过,poptip 单独重跑也通过。
  • 改用 jest --runInBand 执行完整 VChart 测试:89 个套件、507 个测试全部通过;vutils-extension 的 1 个测试也通过,其余包未定义测试。
  • 完成上述等价串行验证后,仅本次推送使用临时 hook 跳过重复的默认并行测试,保留 Git LFS pre-push 检查;未修改仓库测试配置或永久 hook。
  • 原 case 的本地源码对照:底部标签从 10 个增加至 21 个,绘制角度和轴布局保持一致。数量受本地字体环境影响;未运行远端 Bug Server 全量回归或更新标准图。

🚀 Summary

copilot:summary

🔍 Walkthrough

copilot:walkthrough

@xile611
xile611 merged commit a1e9316 into develop Sep 18, 2026
11 of 13 checks passed
@xile611
xile611 deleted the codex/fix-axis-sampling-angle branch September 18, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants