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(spider): work with exceedAdjust #6365

Merged
merged 1 commit into from
Jul 17, 2024
Merged

fix(spider): work with exceedAdjust #6365

merged 1 commit into from
Jul 17, 2024

Conversation

pearmini
Copy link
Member

@pearmini pearmini commented Jul 17, 2024

Related: #6264

Before After
image image
import { G2Spec } from '../../../src';

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

@coveralls
Copy link

Pull Request Test Coverage Report for Build 9967827857

Details

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 86.622%

Totals Coverage Status
Change from base Build 9954217449: 0.02%
Covered Lines: 10522
Relevant Lines: 11767

💛 - Coveralls

@pearmini pearmini merged commit 14283dd into v5 Jul 17, 2024
2 checks passed
@pearmini pearmini deleted the spider-exceed-adjust branch July 17, 2024 03:59
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.

3 participants