[Payment due @situchan] [No QA] Victory Chart: Support VictoryGroup#91550
Conversation
| {barChildren.map((child) => { | ||
| const yKey = getYKey(child); | ||
| const {nodeStyles} = parseStyles(child); | ||
| return ( | ||
| <BarGroup.Bar | ||
| key={`${child.tagName ?? 'node'}-${yKey}`} | ||
| color={nodeStyles.fill ?? DEFAULT_CHART_COLOR} | ||
| points={points[yKey]} | ||
| /> | ||
| ); | ||
| })} |
There was a problem hiding this comment.
FWIW, I tried wrapping this a separate component but it failed because BarGroup only renders children of type BarGroup.Bar
| const BAR_BETWEEN_GROUP_PADDING = 2 / 3; | ||
| const BAR_WITHIN_GROUP_PADDING = BAR_INNER_PADDING; |
There was a problem hiding this comment.
I may change these values when adding horizontal charts. VN uses % values for the padding, unlike VC offset param which is in pixels.
I chose 2/3 as that what appeared closest to https://virtual-cfo-charts.netlify.app/ (after removing horizontal attribute)
|
@marufsharifi Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid.movAndroid: mWeb ChromeiOS: HybridAppios.moviOS: mWeb Safarimsafari.movMacOS: Chrome / Safariweb.mov |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5d710c6e01
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| betweenGroupPadding={BAR_BETWEEN_GROUP_PADDING} | ||
| withinGroupPadding={BAR_WITHIN_GROUP_PADDING} |
There was a problem hiding this comment.
Parse VictoryGroup offset when computing bar spacing
VictoryChartBarGroup hard-codes betweenGroupPadding/withinGroupPadding and never reads tnode.attributes.offset, so grouped charts that rely on different <victorygroup offset="..."> values will render with incorrect spacing. This commit adds support for victorygroup, but without mapping offset the layout is only correct for one fixed spacing profile and diverges from the source chart markup.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Yeah I noted this here #91550 (comment) I don't know yet how to get % spacing from the offset. NAB. I will work on the horizontal support and see what can be done for this if any
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
| ); | ||
| } | ||
|
|
||
| VictoryCharBarGroup.displayName = 'VictoryCharBarGroup'; |
There was a problem hiding this comment.
Hmm yeah, all Victory Chart components have this and need to be updated. NAB though
|
Here's the expected behavior on resize: |
| contentModel: HTMLContentModel.block, | ||
| }), | ||
| victorygroup: HTMLElementModel.fromCustomModel({ | ||
| tagName: 'victorygroup', |
There was a problem hiding this comment.
I suggest we be more specific, in case Victory adds more group types:
| tagName: 'victorygroup', | |
| tagName: 'victorybargroup', |
There was a problem hiding this comment.
The tag name is from Victory Chart HTML, it's always victorygroup (from <VictoryGroup />)
There was a problem hiding this comment.
Don’t we define the victory chart HTML ourselves?
There was a problem hiding this comment.
Hmm? No? AFAIK we only define the html tags to be processed by the html render engine
|
@s77rt this is not handled in this PR right?
|
situchan
left a comment
There was a problem hiding this comment.
Style issues on narrow width are being fixed separately. Out of scope.
|
🎯 @situchan, thanks for reviewing and testing this PR! 🎉 A payment issue will be created for your review once this PR is deployed to production. If payment is not needed (e.g., regression PR review fix etc), react with 👎 to this comment to prevent the payment issue from being created. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 @luacmartins has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.3.83-0 🚀
Bundle Size Analysis (Sentry): |
|
I reviewed the changes in this PR. It adds internal support for No help site changes are required. This is a purely internal/technical change to the chart rendering pipeline. It does not introduce, modify, or remove any user-facing feature, workflow, setting, or UI element that would be documented on the help site. @s77rt, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR |
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.3.83-3 🚀
|
|
🤖 Payment issue created: #91867 |

Explanation of Change
Added support to
<VictoryGroup />Fixed Issues
https://github.com/Expensify/Expensify/issues/636601
PROPOSAL:
Tests
Offline tests
n/a
QA Steps
n/a
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari