Animation guide#7179
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughAdds a new EasingInput type (publicly exported, deprecating AnimationTiming), updates many components to use it, adds an animations guide with example and controls, creates site wiring (routes, locale, guide registration), introduces guide table styles, and documents example/VR test authoring. Changes
Sequence Diagram(s)sequenceDiagram
participant Controls as AnimationsControls
participant Editor as CodeEditorWithPreview
participant Preview as AnimationsExample
participant Devtools as RechartsDevtools
Controls->>Editor: provide Controls component + ?raw source
Editor->>Preview: mount Preview with initial props
Controls->>Preview: onChange(updatedProps)
Preview->>Preview: apply props, update key to replay animation
Preview->>Devtools: render (Devtools injected)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #7179 +/- ##
==========================================
- Coverage 89.68% 89.06% -0.62%
==========================================
Files 537 539 +2
Lines 40674 41011 +337
Branches 5547 5553 +6
==========================================
+ Hits 36477 36527 +50
- Misses 4189 4476 +287
Partials 8 8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/skills/example/SKILL.md:
- Line 13: Typo in the guideline sentence: replace "It most not import any
internal Recharts components or utilities, but only use the public API of
Recharts. Meaning: only imports directly from `recharts` package are allowed."
with the corrected wording using "must" instead of "most" (e.g., "It must not
import any internal Recharts components or utilities...") to fix the spelling
error in SKILL.md.
- Around line 24-37: The description and code example use inconsistent function
names: the text mentions generateRandomData while the example imports and uses
generateMockData; choose one name and make both match. Update either the
human-readable list item to mention generateMockData (if that is the real API)
or change the import and usage in the example to generateRandomData so the
symbol names align; ensure the referenced function name (generateRandomData or
generateMockData) appears identically in both the description and in the
import/usage within the example component.
In `@www/src/components/GuideView/Animations/AnimationsExample.tsx`:
- Around line 19-24: The ControlsType currently forces isAnimationActive to
boolean, which prevents the example from representing the documented boolean |
'auto' API; change the isAnimationActive property in ControlsType to "boolean |
'auto'", update the AnimationsExample component's initial controls/default state
to use 'auto' (not true) as the default, and update any UI controls/handlers in
AnimationsExample that set or toggle isAnimationActive to accept and preserve
the 'auto' value so the demo correctly passes boolean | 'auto' through to the
animated components (search for ControlsType, isAnimationActive, and any
setControls or onChange handlers to apply these changes).
In `@www/src/components/GuideView/Animations/index.tsx`:
- Around line 74-77: Update the docstring for the animation prop in Animations
(index.tsx) so the description of 'auto' no longer implies SSR is currently
supported: state that SSR rendering for charts is not yet supported and the
SSR-related behavior is preparatory, and emphasize that in practice 'auto'
primarily respects the user's reduced-motion preference while 'true' forces
animation (ignoring reduced-motion). Reference the 'auto' value and the file's
Animations description text to locate and replace the existing paragraph.
- Around line 155-161: Update the explanatory text about cubic-bezier in the
GuideView Animations component to remove the strict "between 0 and 1" statement
and instead state that control points are typically in the 0–1 range but may
exceed those bounds (e.g., cubic-bezier(.32,1.75,0,.94) uses y1 > 1) so the
example is consistent with the guidance; modify the paragraph that currently
mentions "<code>x1</code>, <code>y1</code>, <code>x2</code> and <code>y2</code>
are numbers between 0 and 1" to the relaxed wording and keep the existing
example and link intact.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6202e276-99bc-4606-bdbd-885daccde3e4
📒 Files selected for processing (27)
.github/skills/example/SKILL.md.github/skills/guide/SKILL.md.github/skills/vr-test/SKILL.mdomnidoc/verifyExamples.spec.tssrc/animation/easing.tssrc/cartesian/Area.tsxsrc/cartesian/ErrorBar.tsxsrc/cartesian/Funnel.tsxsrc/cartesian/Line.tsxsrc/cartesian/Scatter.tsxsrc/chart/Treemap.tsxsrc/component/Tooltip.tsxsrc/component/TooltipBoundingBox.tsxsrc/index.tssrc/polar/Pie.tsxsrc/polar/Radar.tsxsrc/polar/RadialBar.tsxsrc/shape/Trapezoid.tsxsrc/util/types.tswww/src/components/GuideView/Animations/AnimationsExample.tsxwww/src/components/GuideView/Animations/index.tsxwww/src/components/GuideView/CoordinateSystems/index.tsxwww/src/components/GuideView/guideTable.module.csswww/src/locale/en-US.tswww/src/locale/zh-CN.tswww/src/navigation.data.tswww/src/views/GuideView.tsx
Bundle ReportChanges will increase total bundle size by 1.07kB (0.02%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: recharts/bundle-treeshaking-cartesianAssets Changed:
view changes for bundle: recharts/bundle-cjsAssets Changed:
view changes for bundle: recharts/bundle-treeshaking-sankeyAssets Changed:
view changes for bundle: recharts/bundle-treeshaking-polarAssets Changed:
view changes for bundle: recharts/bundle-umdAssets Changed:
view changes for bundle: recharts/bundle-treeshaking-treemapAssets Changed:
view changes for bundle: recharts/bundle-es6Assets Changed:
|
|
Staging Deployment Details
These deployments will remain available for 30 days. To update snapshots: Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
www/src/components/GuideView/Animations/index.tsx (1)
157-161:⚠️ Potential issue | 🟡 MinorRelax the strict 0–1 cubic-bezier statement to match the guide’s own example.
Line 157 says all control points are between 0 and 1, but Line 160 and the example value in
www/src/components/GuideView/Animations/AnimationsExample.tsx(Line 66,y1 = 1.75) explicitly use out-of-range values for overshoot.✏️ Suggested wording fix
- where <code>x1</code>, <code>y1</code>, <code>x2</code> and <code>y2</code> are numbers between 0 and 1 that - define the shape of the easing curve. You can use{' '} + where <code>x1</code>, <code>y1</code>, <code>x2</code> and <code>y2</code> are numeric control-point values + that define the shape of the easing curve. You can use{' '}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@www/src/components/GuideView/Animations/index.tsx` around lines 157 - 161, Update the explanatory text in the Animations guide where it currently states that x1, y1, x2 and y2 "are numbers between 0 and 1" to reflect that control points are typically in the 0–1 range but may be less than 0 or greater than 1 to produce overshooting curves (as shown by the example in AnimationsExample.tsx where y1 = 1.75); change the sentence in the paragraph around the cubic-bezier explanation to mention that out-of-range values create overshoot and keep the cubic-bezier.com link intact so readers can experiment visually.
🧹 Nitpick comments (1)
www/src/components/GuideView/Animations/AnimationsExample.tsx (1)
92-92: Avoid broad a11y lint suppression for the whole controls block.The blanket disable can mask future unlabeled-control regressions; prefer removing it and only suppressing specific lines if truly necessary.
♿ Minimal cleanup
- /* eslint-disable jsx-a11y/control-has-associated-label */ return (Based on learnings: Ensure accessibility is important in Recharts components and implementation.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@www/src/components/GuideView/Animations/AnimationsExample.tsx` at line 92, Remove the blanket "/* eslint-disable jsx-a11y/control-has-associated-label */" at the top of AnimationsExample and address accessibility per-control: locate the AnimationsExample component and for each control element (buttons, icon buttons, inputs) add an appropriate aria-label or aria-labelledby attribute or wrap with a <label>, or if you must suppress a rule do a focused eslint-disable-next-line directly on the specific JSX line (e.g., on the IconButton or <button> element) instead of disabling the rule globally.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/skills/example/SKILL.md:
- Line 8: Update the prose in the SKILL.md guide to fix the awkward phrasing:
change "Example is a JSX component that renders a chart." to "The Example
component is a JSX component that renders a chart." remove any stray ".:"
characters, change "and couple..." to "and a couple..." and add the missing
article in "accept object..." to "accept an object..."; search for those exact
phrases ("Example is a JSX component that renders a chart.", ".:", "and couple",
"accept object") and apply these small wording/grammar edits consistently at the
other occurrences mentioned.
---
Duplicate comments:
In `@www/src/components/GuideView/Animations/index.tsx`:
- Around line 157-161: Update the explanatory text in the Animations guide where
it currently states that x1, y1, x2 and y2 "are numbers between 0 and 1" to
reflect that control points are typically in the 0–1 range but may be less than
0 or greater than 1 to produce overshooting curves (as shown by the example in
AnimationsExample.tsx where y1 = 1.75); change the sentence in the paragraph
around the cubic-bezier explanation to mention that out-of-range values create
overshoot and keep the cubic-bezier.com link intact so readers can experiment
visually.
---
Nitpick comments:
In `@www/src/components/GuideView/Animations/AnimationsExample.tsx`:
- Line 92: Remove the blanket "/* eslint-disable
jsx-a11y/control-has-associated-label */" at the top of AnimationsExample and
address accessibility per-control: locate the AnimationsExample component and
for each control element (buttons, icon buttons, inputs) add an appropriate
aria-label or aria-labelledby attribute or wrap with a <label>, or if you must
suppress a rule do a focused eslint-disable-next-line directly on the specific
JSX line (e.g., on the IconButton or <button> element) instead of disabling the
rule globally.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d7aeced9-c19c-4c6d-aee8-b43021a5004b
📒 Files selected for processing (3)
.github/skills/example/SKILL.mdwww/src/components/GuideView/Animations/AnimationsExample.tsxwww/src/components/GuideView/Animations/index.tsx
|
|
||
| # What is an example? | ||
|
|
||
| Example is a JSX component that renders a chart. It is used in guides and API documentation to demonstrate how to use Recharts features. |
There was a problem hiding this comment.
Tighten a few wording/grammar spots for clarity in the guide text.
There are a few small phrasing issues that can confuse contributors ("Example is...", extra .:, "and couple...", and missing article in "accept object...").
📝 Suggested copy edits
-Example is a JSX component that renders a chart.
+An example is a JSX component that renders a chart.
-Here is an example of a valid example file. Real example will use more Recharts components and features, but this is just to show the structure of the file and how to use the injected dependencies.:
+Here is an example of a valid example file. A real example will use more Recharts components and features, but this is just to show the structure of the file and how to use the injected dependencies.
-A typical use is to provide the example as a prop to `CodeEditorWithPreview` component. This standardized editor handles rendering the example, showing the source code, and couple other things.
+A typical use is to provide the example as a prop to the `CodeEditorWithPreview` component. This standardized editor handles rendering the example, showing the source code, and a couple of other things.
-... It is expected that the example will accept object that was provided as the first argument of `onChange` as props.
+... It is expected that the example will accept the object provided as the first argument of `onChange` as props.Also applies to: 29-29, 53-53, 73-73
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/skills/example/SKILL.md at line 8, Update the prose in the SKILL.md
guide to fix the awkward phrasing: change "Example is a JSX component that
renders a chart." to "The Example component is a JSX component that renders a
chart." remove any stray ".:" characters, change "and couple..." to "and a
couple..." and add the missing article in "accept object..." to "accept an
object..."; search for those exact phrases ("Example is a JSX component that
renders a chart.", ".:", "and couple", "accept object") and apply these small
wording/grammar edits consistently at the other occurrences mentioned.
|
Staging Deployment Details
These deployments will remain available for 30 days. To update snapshots: Comment |
|
Staging Deployment Details
These deployments will remain available for 30 days. To update snapshots: Comment |
I want to work on #6973 next so first I wanted to have some place where we document animations so I wrote one.
While in there I noticed that our public animation type does not allow
springand custom curves even though the actual implementation does so I fixed the type too.Also includes some copilot skills because the AI is now quite capable of writing the website examples and it may save some time.
Summary by CodeRabbit
New Features
Documentation