Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Improves how the waffle chart computes filled nodes in dynamic-denominator mode when the denominator is fractional, aligning the filled-dot rounding with the raw numerator/denominator ratio and adding coverage for key edge cases.
Changes:
- Update dynamic-denominator fill calculation to round based on
(numerator / denominator) * roundedDenominator, with clamping. - Ensure dynamic-denominator mode is only used when
numerator <= denominator, otherwise fall back to the fixed 100-node mode. - Add/adjust unit tests and Storybook editor assertions for fractional denominator rounding behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/waffle-chart/src/CdcWaffleChart.tsx | Adjusts dynamic-denominator eligibility and computes filled nodes via raw ratio-based rounding with clamping. |
| packages/waffle-chart/src/test/CdcWaffleChart.test.jsx | Adds tests verifying ratio-based rounding, text preservation, and fallback when numerator exceeds denominator. |
| packages/waffle-chart/src/_stories/WaffleChart.Editor.stories.tsx | Updates editor test expectations to match the new rounding behavior (e.g., 17/20 instead of 18/20). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Mgetz10
approved these changes
Apr 8, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Improves waffle rounding in dynamic-denominator mode when denominator is fractional.