Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
PavelVanecek wants to merge16 commits intomain
base:main
Choose a base branch
Loading
fromresponsive-cont

Conversation

PavelVanecek
Copy link
Collaborator

Description

Now all charts on the website should be responsive.

@codecovCodecov
Copy link

codecovbot commentedOct 5, 2025
edited
Loading

Codecov Report

❌ Patch coverage is79.36508% with104 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.83%. Comparing base (00edabb) to head (d156c67).

Files with missing linesPatch %Lines
www/src/components/GuideView/ChartSizing.tsx8.03%103 Missing⚠️
www/src/components/analytics.ts0.00%1 Missing⚠️
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.
📢 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.

@codecovCodecov
Copy link

codecovbot commentedOct 5, 2025
edited
Loading

Bundle Report

Changes will decrease total bundle size by 222 bytes (-0.01%) ⬇️. This is within theconfigured threshold ✅

Detailed changes
Bundle nameSizeChange
recharts/bundle-cjs1.07MB-91 bytes (-0.01%) ⬇️
recharts/bundle-es6923.23kB-91 bytes (-0.01%) ⬇️
recharts/bundle-umd492.05kB-40 bytes (-0.01%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: recharts/bundle-es6

Assets Changed:

Asset NameSize ChangeTotal SizeChange (%)
chart/RechartsWrapper.js-91 bytes12.42kB-0.73%
view changes for bundle: recharts/bundle-cjs

Assets Changed:

Asset NameSize ChangeTotal SizeChange (%)
chart/RechartsWrapper.js-91 bytes14.26kB-0.63%
view changes for bundle: recharts/bundle-umd

Assets Changed:

Asset NameSize ChangeTotal SizeChange (%)
Recharts.js-40 bytes492.05kB-0.01%

Copy link
Contributor

@CopilotCopilotAI left a 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
FileDescription
www/test/snapshots/navigation.spec.ts.snapUpdates snapshots for navigation to include the new sizes guide and example list changes.
www/src/views/GuideView.tsxRegisters ChartSizing guide and exports allGuides for use in navigation.
www/src/navigation.tsSources guides from GuideView’s exported allGuides instead of a hardcoded list.
www/src/locale/zh-CN.tsAdds localized label for the sizes guide.
www/src/locale/en-US.tsAdds English label for the sizes guide.
www/src/docs/exampleComponents/index.tsSwitches to named exports for example groups consumed by navigation.
www/src/docs/exampleComponents/TreeMap/index.tsConverts to named export treeMapExamples.
www/src/docs/exampleComponents/TreeMap/SimpleTreemap.tsxReworks to responsive-style sizing (removed ResponsiveContainer).
www/src/docs/exampleComponents/TreeMap/CustomContentTreemap.tsxReworks to responsive-style sizing (removed ResponsiveContainer).
www/src/docs/exampleComponents/Tooltip/index.tsConverts to named export tooltipExamples.
www/src/docs/exampleComponents/Tooltip/CustomContentOfTooltip.tsxMakes BarChart responsive, exposes animation/tooltip index props, and adjusts margins.
www/src/docs/exampleComponents/RadialBarChart/index.tsConverts to named export radialBarChartExamples.
www/src/docs/exampleComponents/RadialBarChart/SimpleRadialBarChart.tsxMakes chart responsive and fixes “unknown” label typo.
www/src/docs/exampleComponents/RadarChart/index.tsConverts to named export radarChartExamples.
www/src/docs/exampleComponents/RadarChart/SpecifiedDomainRadarChart.tsxMakes chart responsive, removes ResponsiveContainer.
www/src/docs/exampleComponents/RadarChart/SimpleRadarChart.tsxMakes chart responsive and sets margins.
www/src/docs/exampleComponents/PieChart/index.tsAdds Flexbox/Grid examples, removes TwoSimplePieChart, renames display text, and converts to named export.
www/src/docs/exampleComponents/PieChart/TwoSimplePieChart.tsxRemoves outdated example.
www/src/docs/exampleComponents/PieChart/TwoLevelPieChart.tsxMakes chart responsive and parameterizes animation.
www/src/docs/exampleComponents/PieChart/StraightAnglePieChart.tsxMakes chart responsive and parameterizes animation.
www/src/docs/exampleComponents/PieChart/PieChartWithPaddingAngle.tsxSimplifies to a single pie with gap and rounded corners, responsive sizing, and animation flag.
www/src/docs/exampleComponents/PieChart/PieChartWithNeedle.tsxAdjusts sizing/center and relies on per-slice fill in data; parameterizes animation.
www/src/docs/exampleComponents/PieChart/PieChartWithCustomizedLabel.tsxType-safes label renderer and makes chart responsive.
www/src/docs/exampleComponents/PieChart/PieChartInGrid.tsxAdds new grid-based responsive example.
www/src/docs/exampleComponents/PieChart/PieChartInFlexbox.tsxAdds new flexbox-based responsive example.
www/src/docs/exampleComponents/Legend/LegendEffectOpacity.tsxMakes chart responsive and updates margins.
www/src/components/analytics.tsUpdates GA measurement ID.
www/src/components/Shared/TargetBlankLink.tsxSwitches stylesheet import from SCSS to CSS.
www/src/components/GuideView/index.tsAdjusts Customize to named export.
www/src/components/GuideView/Customize.tsxConverts to named export; adjusts CustomTooltip import to named export.
www/src/components/GuideView/CustomTooltip.tsxSwitches stylesheet to CSS and converts to named export.
www/src/components/GuideView/ChartSizing.tsxAdds the new guide page detailing sizing, responsive prop, and ResponsiveContainer usage.
test-vr/tests/www/TreemapApiExamples.spec-vr.tsxAdds VR tests for SimpleTreemap and CustomContentTreemap.
test-vr/tests/www/TooltipApiExamples.spec-vr.tsxAdds VR test for CustomContentOfTooltip with animation disabled.
test-vr/tests/www/RadialBarChartApiExamples.spec-vr.tsxAdds VR test for SimpleRadialBarChart.
test-vr/tests/www/RadarChartApiExamples.spec-vr.tsxAdds VR tests for Radar examples.
test-vr/tests/www/PieChartApiExamples.spec-vr.tsxAdds VR tests for Pie examples, often with animations disabled.
test-vr/tests/www/LegendApiExamples.spec-vr.tsxAdds VR test for LegendEffectOpacity.

Tip: Customize your code reviews with copilot-instructions.md.Create the file orlearn how to get started.

>
<CartesianGridstrokeDasharray="3 3"/>
<XAxisdataKey="name"/>
<YAxiswidth="auto"/>
Copy link
Preview

CopilotAIOct 5, 2025

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.

Suggested change
<YAxiswidth="auto"/>
<YAxis/>

Copilot uses AI. Check for mistakes.

Comment on lines +172 to +179
<Treemap
style={{width:'100%',maxWidth:'500px',maxHeight:'80vh',aspectRatio:4/3}}
data={data}
dataKey="size"
stroke="#fff"
fill="#8884d8"
content={CustomizedContent}
/>
Copy link
Preview

CopilotAIOct 5, 2025

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.

Comment on lines +136 to +139
<ResponsiveContainerwidth="100%"maxHeight={400}>
<LineChartdata={data}>
<LinedataKey="y"/>
</LineChart>
Copy link
Preview

CopilotAIOct 5, 2025

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.

constlocale=useLocale();
return(
<article>
<h1>Chart size and layout</h1>
Copy link
Preview

CopilotAIOct 5, 2025

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'.

Suggested change
<h1>Chartsize and layout</h1>
<h1>Chartsizes and layout</h1>

Copilot uses AI. Check for mistakes.

@github-actionsGitHub Actions
Copy link

Visual Regression tests failed.

@PavelVanecek
Copy link
CollaboratorAuthor

Hah the grid is wild

Copy link
Contributor

@CopilotCopilotAI left a 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.

Comment on lines 114 to 117
};
constobserver=newResizeObserver(callback);
observer.observe(node);
if(observerRef.current!=null){
observerRef.current.disconnect();
}
observerRef.current=observer;
Copy link
Preview

CopilotAIOct 5, 2025

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.

@PavelVanecekPavelVanecek changed the titleMake rest of the examples responsive, add page on sizingMake rest of the examples responsive, add guide for setting sizesOct 5, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

@ckiferckiferAwaiting requested review from ckifer

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@PavelVanecek

[8]ページ先頭

©2009-2025 Movatter.jp