Skip to content

Add PieChart component with donut support#21

Merged
islubee merged 1 commit intomainfrom
claude/explore-repo-overview-aYE7G
Apr 19, 2026
Merged

Add PieChart component with donut support#21
islubee merged 1 commit intomainfrom
claude/explore-repo-overview-aYE7G

Conversation

@islubee
Copy link
Copy Markdown
Owner

@islubee islubee commented Apr 19, 2026

Summary

  • New PieChart component for part-to-whole comparisons
  • Supports full pie and donut mode via innerRadius (0–1 fraction)
  • Automatic color assignment from d3.schemeSet2 or a custom colors array
  • Slice labels via labelAccessor, auto-hidden on slices narrower than ~20° to prevent overlap
  • padAngle to control gaps between slices
  • 9 tests covering rendering, slice count, labels, donut mode, and empty data

Screenshot

PieChart

Test plan

  • Pie chart renders with correct number of slices
  • innerRadius={0.5} produces a donut hole
  • showLabels={false} hides all labels
  • Small slices (< ~20°) have no label
  • colors prop overrides the default palette
  • Empty data renders nothing

- PieChart renders pie/donut charts using d3.pie() and d3.arc()
- Props: valueAccessor, labelAccessor, colors, innerRadius (0–1 fraction
  for donut hole), padAngle, showLabels
- Labels auto-hidden on slices narrower than ~20° to prevent overlap
- 9 tests covering rendering, slices, labels, donut mode, and empty data
- Added piechart.png screenshot and README section with prop table

https://claude.ai/code/session_01Bf9veNX9mqfMqrCEGnujAo
@islubee islubee merged commit 7261c83 into main Apr 19, 2026
6 checks passed
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.

2 participants