Skip to content

Animation guide#7179

Merged
PavelVanecek merged 8 commits into
mainfrom
animation-guide
Mar 29, 2026
Merged

Animation guide#7179
PavelVanecek merged 8 commits into
mainfrom
animation-guide

Conversation

@PavelVanecek

@PavelVanecek PavelVanecek commented Mar 28, 2026

Copy link
Copy Markdown
Collaborator

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 spring and 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

    • Added a comprehensive "Animations" guide with interactive example and controls; introduced a new easing input type and widened animation-easing support across chart components to accept more easing formats while preserving existing defaults.
  • Documentation

    • Added contributor guides for examples, guide pages, and visual-regression (VR) test authoring and workflows; localized and registered the new Animations guide in the site navigation.

@coderabbitai

coderabbitai Bot commented Mar 28, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fa35b17f-bd6a-4883-a64a-f7578442da58

📥 Commits

Reviewing files that changed from the base of the PR and between 8577823 and 42bd875.

📒 Files selected for processing (1)
  • www/src/components/GuideView/Animations/index.tsx

Walkthrough

Adds 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

Cohort / File(s) Summary
Docs / Skills
\.github/skills/example/SKILL.md, \.github/skills/guide/SKILL.md, \.github/skills/vr-test/SKILL.md
New guidance for authoring examples, guide pages, and Playwright visual-regression tests.
Types & Exports
src/animation/easing.ts, src/util/types.ts, src/index.ts, omnidoc/verifyExamples.spec.ts
Add EasingInput (JSDoc @inline), re-export it, mark AnimationTiming deprecated alias, update test exclusion list and re-export in index.
Cartesian & Polar Components
src/cartesian/Area.tsx, src/cartesian/ErrorBar.tsx, src/cartesian/Funnel.tsx, src/cartesian/Line.tsx, src/cartesian/Scatter.tsx, src/polar/Pie.tsx, src/polar/Radar.tsx, src/polar/RadialBar.tsx
Replace AnimationTiming with EasingInput for animationEasing prop types (type-only changes across listed components).
Tooltip / Chart / Shape
src/component/Tooltip.tsx, src/component/TooltipBoundingBox.tsx, src/chart/Treemap.tsx, src/shape/Trapezoid.tsx
Prop type changes to EasingInput; some places normalize easing when passing into CSS/transition APIs (conditional string check).
Site: Animations Guide
www/src/components/GuideView/Animations/index.tsx, www/src/components/GuideView/Animations/AnimationsExample.tsx
Add AnimationsGuide page, interactive AnimationsExample (default export) and AnimationsControls (named export), embedded via CodeEditorWithPreview with raw source and RechartsDevtools.
Guide Styling & CoordinateSystems
www/src/components/GuideView/guideTable.module.css, www/src/components/GuideView/CoordinateSystems/index.tsx
New CSS module for guide tables; replaced inline table styles with class-based styles and updated coordinate systems tables.
Navigation & Locale
www/src/navigation.data.ts, www/src/views/GuideView.tsx, www/src/locale/en-US.ts, www/src/locale/zh-CN.ts
Register animations guide route, import/register AnimationsGuide, and add English/Chinese translations.

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)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • ckifer
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Animation guide' directly and clearly describes the main objective of the PR—adding a new animation documentation guide to the site.
Description check ✅ Passed The PR description provides clear context about the purpose (documenting animations prior to continuing on PR #6973), the type improvements made (widening animation types to match implementation), and mentions copilot skills for example creation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch animation-guide

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 and usage tips.

@codecov

codecov Bot commented Mar 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 13.85870% with 317 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.06%. Comparing base (ad7e3f3) to head (42bd875).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
www/src/components/GuideView/Animations/index.tsx 3.42% 169 Missing ⚠️
...ponents/GuideView/Animations/AnimationsExample.tsx 20.27% 118 Missing ⚠️
...c/components/GuideView/CoordinateSystems/index.tsx 3.22% 30 Missing ⚠️
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.
📢 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 39d0f27 and 29806f1.

📒 Files selected for processing (27)
  • .github/skills/example/SKILL.md
  • .github/skills/guide/SKILL.md
  • .github/skills/vr-test/SKILL.md
  • omnidoc/verifyExamples.spec.ts
  • src/animation/easing.ts
  • src/cartesian/Area.tsx
  • src/cartesian/ErrorBar.tsx
  • src/cartesian/Funnel.tsx
  • src/cartesian/Line.tsx
  • src/cartesian/Scatter.tsx
  • src/chart/Treemap.tsx
  • src/component/Tooltip.tsx
  • src/component/TooltipBoundingBox.tsx
  • src/index.ts
  • src/polar/Pie.tsx
  • src/polar/Radar.tsx
  • src/polar/RadialBar.tsx
  • src/shape/Trapezoid.tsx
  • src/util/types.ts
  • www/src/components/GuideView/Animations/AnimationsExample.tsx
  • www/src/components/GuideView/Animations/index.tsx
  • www/src/components/GuideView/CoordinateSystems/index.tsx
  • www/src/components/GuideView/guideTable.module.css
  • www/src/locale/en-US.ts
  • www/src/locale/zh-CN.ts
  • www/src/navigation.data.ts
  • www/src/views/GuideView.tsx

Comment thread .github/skills/example/SKILL.md Outdated
Comment thread .github/skills/example/SKILL.md Outdated
Comment thread www/src/components/GuideView/Animations/AnimationsExample.tsx
Comment thread www/src/components/GuideView/Animations/index.tsx Outdated
Comment thread www/src/components/GuideView/Animations/index.tsx Outdated
@codecov

codecov Bot commented Mar 28, 2026

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 1.07kB (0.02%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
recharts/bundle-cjs 1.3MB 289 bytes (0.02%) ⬆️
recharts/bundle-treeshaking-sankey 346.28kB 21 bytes (0.01%) ⬆️
recharts/bundle-es6 1.13MB 289 bytes (0.03%) ⬆️
recharts/bundle-umd 547.89kB 125 bytes (0.02%) ⬆️
recharts/bundle-treeshaking-cartesian 643.8kB 162 bytes (0.03%) ⬆️
recharts/bundle-treeshaking-polar 448.18kB 112 bytes (0.02%) ⬆️
recharts/bundle-treeshaking-treemap 357.07kB 71 bytes (0.02%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: recharts/bundle-treeshaking-cartesian

Assets Changed:

Asset Name Size Change Total Size Change (%)
bundle.js 162 bytes 643.8kB 0.03%
view changes for bundle: recharts/bundle-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
chart/Treemap.js 50 bytes 32.42kB 0.15%
cartesian/ErrorBar.js 50 bytes 11.23kB 0.45%
util/types.js 44 bytes 9.68kB 0.46%
shape/Trapezoid.js 47 bytes 7.92kB 0.6%
component/TooltipBoundingBox.js 77 bytes 6.45kB 1.21%
animation/easing.js 21 bytes 4.33kB 0.49%
view changes for bundle: recharts/bundle-treeshaking-sankey

Assets Changed:

Asset Name Size Change Total Size Change (%)
bundle.js 21 bytes 346.28kB 0.01%
view changes for bundle: recharts/bundle-treeshaking-polar

Assets Changed:

Asset Name Size Change Total Size Change (%)
bundle.js 112 bytes 448.18kB 0.02%
view changes for bundle: recharts/bundle-umd

Assets Changed:

Asset Name Size Change Total Size Change (%)
Recharts.js 125 bytes 547.89kB 0.02%
view changes for bundle: recharts/bundle-treeshaking-treemap

Assets Changed:

Asset Name Size Change Total Size Change (%)
bundle.js 71 bytes 357.07kB 0.02%
view changes for bundle: recharts/bundle-es6

Assets Changed:

Asset Name Size Change Total Size Change (%)
chart/Treemap.js 50 bytes 30.7kB 0.16%
cartesian/ErrorBar.js 50 bytes 10.22kB 0.49%
util/types.js 44 bytes 9.26kB 0.48%
shape/Trapezoid.js 47 bytes 6.75kB 0.7%
component/TooltipBoundingBox.js 77 bytes 5.6kB 1.39%
animation/easing.js 21 bytes 4.08kB 0.52%

@github-actions

Copy link
Copy Markdown
Contributor

Staging Deployment Details

These deployments will remain available for 30 days.

To update snapshots: Comment /update-snapshots on this PR to automatically update the baseline screenshots.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
www/src/components/GuideView/Animations/index.tsx (1)

157-161: ⚠️ Potential issue | 🟡 Minor

Relax 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

📥 Commits

Reviewing files that changed from the base of the PR and between 29806f1 and 8577823.

📒 Files selected for processing (3)
  • .github/skills/example/SKILL.md
  • www/src/components/GuideView/Animations/AnimationsExample.tsx
  • www/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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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.

@github-actions

Copy link
Copy Markdown
Contributor

Staging Deployment Details

These deployments will remain available for 30 days.

To update snapshots: Comment /update-snapshots on this PR to automatically update the baseline screenshots.

@github-actions

Copy link
Copy Markdown
Contributor

Staging Deployment Details

These deployments will remain available for 30 days.

To update snapshots: Comment /update-snapshots on this PR to automatically update the baseline screenshots.

@PavelVanecek
PavelVanecek merged commit 2879b07 into main Mar 29, 2026
56 of 59 checks passed
@PavelVanecek
PavelVanecek deleted the animation-guide branch March 29, 2026 13:55
@coderabbitai coderabbitai Bot mentioned this pull request Apr 4, 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.

1 participant