Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 处理自定义mini图显示柱状图时,全为正值&全为零值 展示异常问题 #2826

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

duganlx
Copy link
Contributor

@duganlx duganlx commented Jul 20, 2024

👀 PR includes

✨ Feature

  • New feature

🎨 Enhance

  • Code style optimization
  • Refactoring
  • Change the UI
  • Improve the performance
  • Type optimization

🐛 Bugfix

🔧 Chore

  • Test case
  • Docs / demos update
  • CI / workflow
  • Release version
  • Other ()

📝 Description

这次改动主要是处理用使用 mini画柱状图时,在数据全为正值和全为零值时,柱状图展示异常问题。在单元格内绘制 mini 柱状图时,计算每个坐标转换的函数有点问题,如下图所示。
image

上图框起来的部分需要分情况分别考虑 barHeight 和 positionY:1. 数据全为正、2. 数据全为零、3. 数据全为负,修改如下图所示。
image

🖼️ Screenshot

改版前后的对比图如下所示。覆盖了以下常见都没有问题了。

  1. 数据全为正
  2. 数据全为负
  3. 数据全为零
  4. 数据有正有负
  5. 数据有正有负有零

image

Before After

🔗 Related issue link

🔍 Self-Check before the merge

  • Add or update relevant docs.
  • Add or update relevant demos.
  • Add or update test case.
  • Add or update relevant TypeScript definitions.

Copy link

vercel bot commented Jul 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
antvis-s2 ❌ Failed (Inspect) Jul 20, 2024 0:58am

@github-actions github-actions bot added the pr(fix) bug fix label Jul 20, 2024
@github-actions github-actions bot added the next 2.0-next 版本的问题 label Jul 20, 2024
@lijinke666
Copy link
Member

感谢贡献, 单测挂了, 请修复并完善下相关单测.

@duganlx
Copy link
Contributor Author

duganlx commented Jul 22, 2024

感谢贡献, 单测挂了, 请修复并完善下相关单测.

我在本地按照readme文件中说明运行单测时,始终会卡在那里,如下图所示。我尝试了 pnpm testpnpm core:testpnpm test:ci-coverage 都会卡住,我不太清楚如何处理。
image

没有进行其他额外的操作,复现方式就是

  1. git clone [email protected]:duganlx/S2.git 并切换到 fix-minichart分支
  2. pnpm install
  3. pnpm build
  4. pnpm test (此时就卡住了)

我的运行环境是在 docker的一个 ubuntu 容器

@lijinke666
Copy link
Member

lijinke666 commented Jul 23, 2024

我的运行环境是在 docker的一个 ubuntu 容器

jest-electron 应该不支持, 所以卡住了, 那合并后我来处理下单测吧, 感谢你的贡献.

@lijinke666 lijinke666 merged commit 81def62 into antvis:next Jul 23, 2024
11 of 13 checks passed
@duganlx
Copy link
Contributor Author

duganlx commented Jul 23, 2024

jest-electron 应该不支持, 所以卡住了, 那合并后我来处理下单测吧, 感谢你的贡献.

ok,谢谢您 ^_^

@duganlx duganlx deleted the fix-minichart branch July 24, 2024 08:22
@lijinke666
Copy link
Member

🎉 This PR is included in version @antv/s2-v2.0.0-next.26 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next 2.0-next 版本的问题 pr(fix) bug fix released on @next
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants