-
Notifications
You must be signed in to change notification settings - Fork 862
Charts: Extract shared ChartLayout component for chart+legend layout #47554
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
adamwoodnz
merged 37 commits into
trunk
from
charts-181-extract-shared-chartlayout-component-for-chart-legend-layout
Mar 17, 2026
+1,046
−744
Merged
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
f5a9293
Charts: Add ChartLayout component for shared chart+legend layout
adamwoodnz e621a42
Charts: Export ChartLayoutProps type from barrel
adamwoodnz 38db8be
Charts: Migrate LineChart to use ChartLayout
adamwoodnz 8b757a7
Charts: Migrate BarChart to use ChartLayout
adamwoodnz 6125f8b
Charts: Migrate PieChart to use ChartLayout
adamwoodnz db08da8
Charts: Migrate PieSemiCircleChart to use ChartLayout
adamwoodnz 8bda08e
Charts: Migrate LeaderboardChart to use ChartLayout
adamwoodnz 51d2eab
Charts: Restore responsive/loading classes in LeaderboardChart empty …
adamwoodnz 504ea45
Charts: PieChart uses ChartLayout render prop for measurement
adamwoodnz 6c4915e
Charts: Add render prop and measurement support to ChartLayout
adamwoodnz 85f1a86
Charts: Fix PieChart SingleChartContext.Provider placement
adamwoodnz 6b97bbb
Charts: Migrate LineChart, BarChart, PieSemiCircleChart to ChartLayou…
adamwoodnz 216809c
Add changelog entries.
2956ebb
test(charts): Simplify ChartLayout DOM order assertions
adamwoodnz ee9b6f3
Charts: Extract shared CSS into ChartLayout, use Stack for pie centering
adamwoodnz 9496b45
refactor(charts): Remove redundant flex and inline styles from pie ch…
adamwoodnz 4710952
chore(charts): Remove superpowers plan from tracked files
adamwoodnz 70d5c01
refactor(charts): Move ChartLayout to charts/private
adamwoodnz 883efdf
fix(charts): Pass measured chart height to SingleChartContext in Line…
adamwoodnz 4b3f3f3
fix(charts): Add full dimensions to pie chart centering Stack
adamwoodnz a1ab6d0
docs(charts): Fix misleading isMeasured docstring in ChartLayout
adamwoodnz d670ffc
test(charts): Add ChartLayout render-prop and waitForMeasurement tests
adamwoodnz 30e07f9
refactor(charts): Remove legacy isWaitingForMeasurement prop from Cha…
adamwoodnz 1003cc6
fix(charts): Use useEffect callback instead of setState during render
adamwoodnz f2a538b
docs(charts): Document waitForMeasurement render-prop requirement
adamwoodnz fb0cb6e
refactor(charts): Remove unused chartWidth/chartHeight from pie and l…
adamwoodnz 11ce567
fix(charts): Pass measured chart height to SingleChartContext in BarC…
adamwoodnz e9cc9a3
refactor(charts): Auto-hide ChartLayout during measurement for render…
adamwoodnz e242b7d
refactor(charts): Simplify measurement gating, mock element size in t…
adamwoodnz 92201ce
refactor(charts): Remove redundant visx tooltip mock
adamwoodnz d1e3fe9
style(charts): Move pie chart centering styles to CSS modules
adamwoodnz 79a6a3f
fix(charts): Fix 6 test failures from element size mock
adamwoodnz 65fea82
fix(charts): Guard onContentHeightChange for render-prop mode
adamwoodnz 595bbae
test(charts): Wrap mock override in try/finally
adamwoodnz 3539809
Only call onContentHeightChange if measured
adamwoodnz 5cb7e25
fix(charts): Enhance early return condition in LineChartAnnotationsOv…
adamwoodnz 745349a
fix(charts): Pass args through in composition legend stories
adamwoodnz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Significance: minor | ||
| Type: added | ||
|
|
||
| ChartLayout: Add component for shared chart and legend layout. |
5 changes: 0 additions & 5 deletions
5
projects/js-packages/charts/src/charts/bar-chart/bar-chart.module.scss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What happens if both passed?
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.
Both will be rendered. This can be tested in storybook using the
showLegendcontrol on one of the Composition Legend stories.Seems odd but I think it's valid configuration. Maybe a consumer could need two; tall chart, separate items, ...?
Not sure if I see the point in blocking it.