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

feat(pie): optimize spider #6357

Merged
merged 4 commits into from
Jul 16, 2024
Merged

feat(pie): optimize spider #6357

merged 4 commits into from
Jul 16, 2024

Conversation

pearmini
Copy link
Member

@pearmini pearmini commented Jul 12, 2024

Spider

close: #6264

image

案例

Before After
image image
export function mockPieSpider(): G2Spec {
  return {
    type: 'interval',
    data: [
      { type: '微博', value: 93.33 },
      { type: '其他', value: 6.67 },
      { type: '论坛', value: 4.77 },
      { type: '网站', value: 1.44 },
      { type: '微信', value: 1.12 },
      { type: '客户端', value: 1.05 },
      { type: '新闻', value: 0.81 },
      { type: '视频', value: 0.39 },
      { type: '博客', value: 0.37 },
      { type: '报刊', value: 0.17 },
    ],
    encode: {
      y: 'value',
      color: 'type',
    },
    labels: [
      {
        position: 'spider',
        text: (obj) => `${obj.type} (${obj.value})`,
      },
    ],
    transform: [{ type: 'stackY' }],
    coordinate: { type: 'theta' },
  };
}

TODO

  • code
  • test
  • example

@coveralls
Copy link

coveralls commented Jul 12, 2024

Pull Request Test Coverage Report for Build 9953439864

Details

  • 98 of 101 (97.03%) changed or added relevant lines in 4 files are covered.
  • 4 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.02%) to 86.604%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/shape/text/advance.ts 35 38 92.11%
Files with Coverage Reduction New Missed Lines %
src/shape/text/advance.ts 4 89.63%
Totals Coverage Status
Change from base Build 9902373963: 0.02%
Covered Lines: 10518
Relevant Lines: 11764

💛 - Coveralls

@pearmini pearmini requested a review from visiky July 15, 2024 09:54
@pearmini pearmini marked this pull request as ready for review July 16, 2024 08:31
@pearmini pearmini requested a review from hustcc July 16, 2024 08:31
@pearmini pearmini merged commit d07be48 into v5 Jul 16, 2024
2 checks passed
@pearmini pearmini deleted the pie-spider branch July 16, 2024 09:24
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.

饼图的 labelTransform 需要同时处理重合和超出视口的情况
3 participants