Conversation
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (6)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the WalkthroughThe PR fixes textAnchor validation in Label components and restructures Label storybook stories. It adds a type guard for validating textAnchor values, implements fallback logic to use computed positioning when invalid, and replaces multi-position iteration with single dynamically-positioned labels in storybook examples. Changes
Sequence DiagramsequenceDiagram
participant User as User/Chart
participant Label as Label Component
participant Text as Text Component
participant Validation as isValidTextAnchor()
User->>Label: Pass textAnchor value
Label->>Validation: Validate textAnchor
alt Valid textAnchor
Validation-->>Label: true
Label->>Text: Use provided textAnchor
else Invalid textAnchor
Validation-->>Label: false
Label->>Label: Use computed positionAttrs.textAnchor
Label->>Text: Use fallback textAnchor
end
Text-->>User: Render with textAnchor
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6547 +/- ##
=======================================
Coverage 91.62% 91.62%
=======================================
Files 483 483
Lines 40267 40271 +4
Branches 4568 4570 +2
=======================================
+ Hits 36896 36900 +4
Misses 3355 3355
Partials 16 16 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Bundle ReportChanges will increase total bundle size by 939 bytes (0.04%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: recharts/bundle-umdAssets Changed:
view changes for bundle: recharts/bundle-cjsAssets Changed:
view changes for bundle: recharts/bundle-es6Assets Changed:
|
|
Visual Regression tests failed.
To update snapshots: Comment |
|
Both of those failed tests have an explicit |
|
Okay I merged #6548 let's try this again. /update-snapshots |
|
✅ Visual regression snapshots have been updated and committed to this PR. |
|
It worked!!! |
|
Sweet |
Description
textAnchor is calculated internally based on the
positionbut sometimes one may want to set a customtextAnchorso let's do that.Related Issue
Fixes #6545
Fixes #6345 - now we have the storybook for playing around with the props, and www/api/Label for gallery of all possible options. I added a link.
Types of changes
Is this a bugfix? Or a new feature? Dunno. Text had the same prop since forever. It was coming to Label via
SVGProps<SVGTextElement>.Checklist:
Summary by CodeRabbit
Release Notes
New Features
zIndex,angle,textAnchor, andtextBreakAll.Documentation
Bug Fixes