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

refactor word cloud mark #6180

Merged
merged 5 commits into from Apr 19, 2024
Merged

refactor word cloud mark #6180

merged 5 commits into from Apr 19, 2024

Conversation

hustcc
Copy link
Member

@hustcc hustcc commented Apr 19, 2024

  • refactor word cloud mark
  • test case
  • demo

image

image

Copy link
Member

@pearmini pearmini left a comment

Choose a reason for hiding this comment

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

需要生成基准图片?

__tests__/plots/static/words-wordCloud-basic.ts Outdated Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Apr 19, 2024

Pull Request Test Coverage Report for Build 8749775624

Details

  • 11 of 22 (50.0%) changed or added relevant lines in 5 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.06%) to 86.371%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/data/wordCloud.ts 3 5 60.0%
src/mark/wordCloud.ts 1 3 33.33%
src/shape/text/tag.ts 5 12 41.67%
Files with Coverage Reduction New Missed Lines %
src/data/wordCloud.ts 1 12.9%
Totals Coverage Status
Change from base Build 8611256665: -0.06%
Covered Lines: 10293
Relevant Lines: 11544

💛 - Coveralls

@hustcc
Copy link
Member Author

hustcc commented Apr 19, 2024

试过,也生成不出来,因为他用到 canvas 去计算词云布局的,使用了 mock canvas,导致计算出来的位置不正确。

@pearmini
Copy link
Member

试过,也生成不出来,因为他用到 canvas 去计算词云布局的,使用了 mock canvas,导致计算出来的位置不正确。

哦,对,词云没有去测试,因为是随机的。

@hustcc hustcc merged commit 4982b46 into v5 Apr 19, 2024
2 checks passed
@hustcc hustcc deleted the refactor-wordcloud branch April 19, 2024 07:41
@hustcc
Copy link
Member Author

hustcc commented Apr 19, 2024

以前词云图为什么出来就是不好看,或者会有一些遮挡,核心问题是布局结果和绘图配置不一致,主要有:

  • textAlign
  • textBaseline
  • rotate
  • x y 坐标系方向

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants