Skip to content

fix: shape component fixes (Cross, Trapezoid, null guards)#16

Closed
muhammadrashid4587 wants to merge 1 commit into
wook95:mainfrom
muhammadrashid4587:fix/shapes-and-polar-angle
Closed

fix: shape component fixes (Cross, Trapezoid, null guards)#16
muhammadrashid4587 wants to merge 1 commit into
wook95:mainfrom
muhammadrashid4587:fix/shapes-and-polar-angle

Conversation

@muhammadrashid4587

Copy link
Copy Markdown

Summary

  • Cross: Replaced thick 12-point polygon path with thin crosshair (M{x},{top}v{height}M{left},{y}h{width}) matching recharts original
  • Trapezoid: Fixed alignment from center-aligned to top-aligned to match recharts FunnelChart behavior
  • Rectangle: Added null guards for zero/NaN width/height
  • Sector: Added null guard for outerRadius < innerRadius
  • Dot: Added null guard for non-numeric cx/cy/r

Closes #8

Test plan

  • Cross renders as thin crosshair lines, not thick polygon
  • Trapezoid in FunnelChart aligns correctly (wider side at bottom)
  • Rectangle skips rendering for zero/NaN dimensions
  • Sector skips rendering when outerRadius < innerRadius
  • Dot skips rendering for non-numeric coordinates

🤖 Generated with Claude Code

- Cross: replace thick polygon with thin crosshair matching recharts
- Trapezoid: fix alignment to top-aligned (matching recharts FunnelChart)
- Rectangle/Sector/Dot: add null guards for invalid values
- polar-utils: unify polarToCartesian to use 12-o'clock = 0° convention

Closes wook95#8, closes wook95#14

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@wook95

wook95 commented Mar 10, 2026

Copy link
Copy Markdown
Owner

Hey, thanks for the work on this!
Just a heads up—another PR (#15) came in about an hour earlier covering the same ground, so I'm going to go with that one first.

That said, your fix for polar-utils is a nice catch. If #15 doesn't cover it, would you be open to splitting that out into a separate PR for #14? Thanks!

@wook95

wook95 commented Mar 10, 2026

Copy link
Copy Markdown
Owner

Update: #15 ended up covering the polar-utils fix too, so that's all merged now. Closing this — thanks again for jumping in!

@wook95 wook95 closed this Mar 10, 2026
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.

Shape component fixes: Cross, Trapezoid, null guards

3 participants