Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.8k
Make rest of the examples responsive, add guide for setting sizes#6417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
…r responsive layouts
codecovbot commentedOct 5, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## main #6417 +/- ##==========================================+ Coverage 93.54% 93.83% +0.28%========================================== Files 412 414 +2 Lines 37976 38196 +220 Branches 4474 4470 -4 ==========================================+ Hits 35526 35840 +314+ Misses 2423 2339 -84+ Partials 27 17 -10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
codecovbot commentedOct 5, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Bundle ReportChanges will decrease total bundle size by 222 bytes (-0.01%) ⬇️. This is within theconfigured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: recharts/bundle-es6Assets Changed:
view changes for bundle: recharts/bundle-cjsAssets Changed:
view changes for bundle: recharts/bundle-umdAssets Changed:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
Adds responsive behavior to remaining chart examples and introduces a new “Chart sizes and layout” guide to document sizing strategies.
- Registers a new guide page (sizes) and updates navigation/localization.
- Refactors many examples to use the responsive prop and CSS sizing; removes an outdated Pie example and adds new Flexbox/Grid examples.
- Updates tests to cover new/modified examples and adjusts exports to named exports in example registries.
Reviewed Changes
Copilot reviewed 39 out of 86 changed files in this pull request and generated 13 comments.
Show a summary per file
File | Description |
---|---|
www/test/snapshots/navigation.spec.ts.snap | Updates snapshots for navigation to include the new sizes guide and example list changes. |
www/src/views/GuideView.tsx | Registers ChartSizing guide and exports allGuides for use in navigation. |
www/src/navigation.ts | Sources guides from GuideView’s exported allGuides instead of a hardcoded list. |
www/src/locale/zh-CN.ts | Adds localized label for the sizes guide. |
www/src/locale/en-US.ts | Adds English label for the sizes guide. |
www/src/docs/exampleComponents/index.ts | Switches to named exports for example groups consumed by navigation. |
www/src/docs/exampleComponents/TreeMap/index.ts | Converts to named export treeMapExamples. |
www/src/docs/exampleComponents/TreeMap/SimpleTreemap.tsx | Reworks to responsive-style sizing (removed ResponsiveContainer). |
www/src/docs/exampleComponents/TreeMap/CustomContentTreemap.tsx | Reworks to responsive-style sizing (removed ResponsiveContainer). |
www/src/docs/exampleComponents/Tooltip/index.ts | Converts to named export tooltipExamples. |
www/src/docs/exampleComponents/Tooltip/CustomContentOfTooltip.tsx | Makes BarChart responsive, exposes animation/tooltip index props, and adjusts margins. |
www/src/docs/exampleComponents/RadialBarChart/index.ts | Converts to named export radialBarChartExamples. |
www/src/docs/exampleComponents/RadialBarChart/SimpleRadialBarChart.tsx | Makes chart responsive and fixes “unknown” label typo. |
www/src/docs/exampleComponents/RadarChart/index.ts | Converts to named export radarChartExamples. |
www/src/docs/exampleComponents/RadarChart/SpecifiedDomainRadarChart.tsx | Makes chart responsive, removes ResponsiveContainer. |
www/src/docs/exampleComponents/RadarChart/SimpleRadarChart.tsx | Makes chart responsive and sets margins. |
www/src/docs/exampleComponents/PieChart/index.ts | Adds Flexbox/Grid examples, removes TwoSimplePieChart, renames display text, and converts to named export. |
www/src/docs/exampleComponents/PieChart/TwoSimplePieChart.tsx | Removes outdated example. |
www/src/docs/exampleComponents/PieChart/TwoLevelPieChart.tsx | Makes chart responsive and parameterizes animation. |
www/src/docs/exampleComponents/PieChart/StraightAnglePieChart.tsx | Makes chart responsive and parameterizes animation. |
www/src/docs/exampleComponents/PieChart/PieChartWithPaddingAngle.tsx | Simplifies to a single pie with gap and rounded corners, responsive sizing, and animation flag. |
www/src/docs/exampleComponents/PieChart/PieChartWithNeedle.tsx | Adjusts sizing/center and relies on per-slice fill in data; parameterizes animation. |
www/src/docs/exampleComponents/PieChart/PieChartWithCustomizedLabel.tsx | Type-safes label renderer and makes chart responsive. |
www/src/docs/exampleComponents/PieChart/PieChartInGrid.tsx | Adds new grid-based responsive example. |
www/src/docs/exampleComponents/PieChart/PieChartInFlexbox.tsx | Adds new flexbox-based responsive example. |
www/src/docs/exampleComponents/Legend/LegendEffectOpacity.tsx | Makes chart responsive and updates margins. |
www/src/components/analytics.ts | Updates GA measurement ID. |
www/src/components/Shared/TargetBlankLink.tsx | Switches stylesheet import from SCSS to CSS. |
www/src/components/GuideView/index.ts | Adjusts Customize to named export. |
www/src/components/GuideView/Customize.tsx | Converts to named export; adjusts CustomTooltip import to named export. |
www/src/components/GuideView/CustomTooltip.tsx | Switches stylesheet to CSS and converts to named export. |
www/src/components/GuideView/ChartSizing.tsx | Adds the new guide page detailing sizing, responsive prop, and ResponsiveContainer usage. |
test-vr/tests/www/TreemapApiExamples.spec-vr.tsx | Adds VR tests for SimpleTreemap and CustomContentTreemap. |
test-vr/tests/www/TooltipApiExamples.spec-vr.tsx | Adds VR test for CustomContentOfTooltip with animation disabled. |
test-vr/tests/www/RadialBarChartApiExamples.spec-vr.tsx | Adds VR test for SimpleRadialBarChart. |
test-vr/tests/www/RadarChartApiExamples.spec-vr.tsx | Adds VR tests for Radar examples. |
test-vr/tests/www/PieChartApiExamples.spec-vr.tsx | Adds VR tests for Pie examples, often with animations disabled. |
test-vr/tests/www/LegendApiExamples.spec-vr.tsx | Adds VR test for LegendEffectOpacity. |
Tip: Customize your code reviews with copilot-instructions.md.Create the file orlearn how to get started.
Uh oh!
There was an error while loading.Please reload this page.
> | ||
<CartesianGridstrokeDasharray="3 3"/> | ||
<XAxisdataKey="name"/> | ||
<YAxiswidth="auto"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
YAxis.width should be a number; 'auto' is not a valid value. Remove the width prop or provide a numeric width.
<YAxiswidth="auto"/> | |
<YAxis/> |
Copilot uses AI. Check for mistakes.
Uh oh!
There was an error while loading.Please reload this page.
<Treemap | ||
style={{width:'100%',maxWidth:'500px',maxHeight:'80vh',aspectRatio:4/3}} | ||
data={data} | ||
dataKey="size" | ||
stroke="#fff" | ||
fill="#8884d8" | ||
content={CustomizedContent} | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Treemap needs explicit sizing or a responsive mode to render. Add responsive to Treemap (if available) or specify width/height or use ResponsiveContainer.
Copilot uses AI. Check for mistakes.
<ResponsiveContainerwidth="100%"maxHeight={400}> | ||
<LineChartdata={data}> | ||
<LinedataKey="y"/> | ||
</LineChart> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
ResponsiveContainer does not support maxHeight. Use height with a sized parent (as you already set via the wrapper div) instead: height="100%".
Copilot uses AI. Check for mistakes.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
constlocale=useLocale(); | ||
return( | ||
<article> | ||
<h1>Chart size and layout</h1> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
[nitpick] Page title is singular ('size') while navigation/localization uses 'sizes'. For consistency with the new nav item, consider 'Chart sizes and layout'.
<h1>Chartsize and layout</h1> | |
<h1>Chartsizes and layout</h1> |
Copilot uses AI. Check for mistakes.
Visual Regression tests failed.
|
Hah the grid is wild |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
Copilot reviewed 45 out of 89 changed files in this pull request and generated 14 comments.
Tip: Customize your code reviews with copilot-instructions.md.Create the file orlearn how to get started.
}; | ||
constobserver=newResizeObserver(callback); | ||
observer.observe(node); | ||
if(observerRef.current!=null){ | ||
observerRef.current.disconnect(); | ||
} | ||
observerRef.current=observer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Disconnecting any previously registered ResizeObserver was removed; this can leak observers and keep observing stale nodes. Before assigning a new observer, disconnect the old one, e.g.: if (observerRef.current) observerRef.current.disconnect();
Copilot uses AI. Check for mistakes.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Description
Now all charts on the website should be responsive.