Skip to content

docs: clarify reference element label object props - #7919

Merged
PavelVanecek merged 1 commit into
recharts:mainfrom
valkiara:docs/reference-label-props
Oct 6, 2026
Merged

PavelVanecek merged 1 commit into
recharts:mainfrom
valkiara:docs/reference-label-props

Conversation

@valkiara

@valkiara valkiara commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Description

Correct the object-valued label documentation for ReferenceArea, ReferenceDot, and ReferenceLine: the object supplies props to a single Label, not LabelList. Add one example per component using value and position.

Related Issue

Related to #4438. This is a small API documentation correction, not a complete solution to that broader issue.

Motivation and Context

parseLabel spreads an object-valued label onto Label. The current description points users toward the wrong component's props. The correction lives in the source JSDoc so both the website and Storybook docs receive it.

How Has This Been Tested?

On Windows with Node.js 24.21.0:

  • npm run omnidoc; inspected the generated text and examples for all three components.
  • npm run test-omnidoc -- --maxWorkers=2: 1,099 tests passed.
  • Existing ReferenceArea, ReferenceDot, and ReferenceLine tests: 96 tests passed.
  • npm run check-types-lib: passed.
  • npm run lint: passed with 17 warnings in unchanged files.
  • Prettier and git diff --check: passed.

Screenshots (if appropriate):

Not applicable; JSDoc-only correction.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • I have added a storybook story or VR test, or extended an existing story or VR test to show my changes

No runtime behavior or public types change; existing tests and documentation generation cover this correction.

Summary by CodeRabbit

  • Documentation
    • Clarified that object values for reference area, dot, and line labels correspond to a single label’s props.
    • Added examples showing how to set a label’s value and position.

@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5d80da20-f905-4513-8a9c-5af49d63f16f
📥 Commits

Reviewing files that changed from the base of the PR and between 4b3484d and 1027b6e.

📒 Files selected for processing (3)
  • src/cartesian/ReferenceArea.tsx
  • src/cartesian/ReferenceDot.tsx
  • src/cartesian/ReferenceLine.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.


Walkthrough

The label documentation for ReferenceArea, ReferenceDot, and ReferenceLine now describes object values as props for a single Label component and includes usage examples.

Changes

Reference label documentation

Layer / File(s) Summary
Reference label prop documentation
src/cartesian/ReferenceArea.tsx, src/cartesian/ReferenceDot.tsx, src/cartesian/ReferenceLine.tsx
Each component’s label documentation now describes props for a single Label rather than LabelList. The docs include examples with label values and positions. ReferenceArea also includes a labeled-area example.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Suggested reviewers: pavelvanecek

Merge Risk: ⚪ Minimal · up to 1027b

This documentation-only change matches the implementation, and its examples use supported props; no actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: clarifying the label object props for reference elements.
Description check ✅ Passed The description explains the documentation correction, its motivation, related issue, testing, and change type. It also completes the relevant documentation checklist items.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@PavelVanecek

Copy link
Copy Markdown
Collaborator

Omnidoc is likely going to complain. Watch the builds please, if it fails it tells you what to do

@codecov

codecov Bot commented Oct 6, 2026

Copy link
Copy Markdown

Bundle Report

Bundle size has no change ✅

@codecov

codecov Bot commented Oct 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.96%. Comparing base (f79048e) to head (1027b6e).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7919      +/-   ##
==========================================
+ Coverage   88.92%   88.96%   +0.03%     
==========================================
  Files         647      647              
  Lines       15851    15852       +1     
  Branches     4159     4159              
==========================================
+ Hits        14096    14102       +6     
+ Misses       1561     1556       -5     
  Partials      194      194              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@PavelVanecek
PavelVanecek merged commit fd86bac into recharts:main Oct 6, 2026
65 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