Skip to content

fix(waterfall): connect horizontal leader lines at facing bar edges - #4697

Merged
xile611 merged 2 commits into
developfrom
codex/fix-horizontal-waterfall-leader-line
Sep 20, 2026
Merged

xile611 merged 2 commits into
developfrom
codex/fix-horizontal-waterfall-leader-line

Conversation

@xile611

@xile611 xile611 commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

🤔 这个分支是...

  • Bug fix
  • 测试 case 更新

🐞 Bugserver 用例 id

649d7f2452a1e9eec95f9f1c

💡 问题的背景&解决方案

横向瀑布图的连接线错误地连接两根柱的外侧边缘,虚线覆盖柱体边缘。原始用例中,14 条连接线都由应有的 10px 延长成 40px。

14c5e3e6f 为修复 #4580 引入了根据 axis inverse 翻转端点的逻辑,但横向 Y 轴默认 inverse=true 才表示分类从上往下排列,不能与 X 轴使用相同的方向判断。本次按屏幕分类方向归一化 Y 轴 inverse,保留纵向反向轴及两种累计模式的正确端点选择。私有方法改名为 _isCategoryAxisReversed,明确其表示屏幕方向;未增加每图元分配。

将原先直接断言私有方法布尔值的测试替换为真实图表几何测试:从渲染柱体独立计算相邻边界,再检查连接线端点,覆盖横向/纵向、inverse 未指定/false/true、increase/decrease,以及配置更新。

同一本地源码构建、同一原始 spec,左图仅代入修复前的方向判断,右图使用本次实际实现。修复后所有柱的几何属性不变,14 条连接线均恢复为 10px。

连接线修复前后

📝 Changelog

Language Changelog
🇨🇳 中文 修复横向瀑布图连接线覆盖柱体边缘的问题,保持反向轴及反向累计模式下的正确连接。
🇺🇸 English Fix horizontal waterfall leader lines extending across bar edges while preserving reversed axes and calculation modes.

☑️ 自测

  • 修复前新增测试在 6 组横向配置及 1 项更新用例的端点断言处失败。
  • 瀑布图、柱图、瀑布图数据转换:3 个套件、23 项测试通过。
  • pre-push 全量验证通过:VChart 90 个套件、521 项测试;vutils-extension 1 项测试。
  • TypeScript tsc --noEmit、定向 ESLint、Prettier、git diff --check 通过。
  • 本地源码浏览器构建重跑原始 case,连接线 40px → 10px,柱体几何一致。
  • 文档与 Demo 无需更新,附验证对照图。
  • 公共类型无需修改。
  • 已添加中文 patch changelog。

🚀 Summary

copilot:summary

🔍 Walkthrough

copilot:walkthrough

@skie1997 skie1997 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review 完成,复核结论已评论到方向判断对应代码行。本地定向验证 3 个测试文件、23 项通过(复用本机已有依赖)。

验证边界:远端 TEST CI 通过,但 Bug Server CI 最终为 photo test status: pending、totalCount=0,因此尚无截图回归结论;size 报 2.43 MB,超过 2 MB 限制 425.46 kB。上述 CI 结果不能证明是本次方向判断改动引入的新缺陷,未据此提交缺陷结论。

Comment thread packages/vchart/src/series/waterfall/waterfall.ts
@xile611
xile611 merged commit 67400f3 into develop Sep 20, 2026
11 of 13 checks passed
@xile611
xile611 deleted the codex/fix-horizontal-waterfall-leader-line branch September 20, 2026 06:16
@xile611 xile611 added this to the 2.1.8 milestone Sep 20, 2026
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