-
Notifications
You must be signed in to change notification settings - Fork 122
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
refactor: remove default small multiples value #977
Conversation
Codecov Report
@@ Coverage Diff @@
## master #977 +/- ##
==========================================
+ Coverage 70.87% 70.95% +0.07%
==========================================
Files 344 360 +16
Lines 10971 10597 -374
Branches 2309 2168 -141
==========================================
- Hits 7776 7519 -257
+ Misses 3181 2989 -192
- Partials 14 89 +75
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
I see this as a simplified version of the real solution. |
Yeah I think that could be nicer. You are saying like set the value to |
@markov00 Let me know what you think about these changes |
@@ -68,6 +64,6 @@ export const computeSmallMultipleScalesSelector = createCachedSelector( | |||
|
|||
function getScale(domain: Domain, maxRange: number, padding = DEFAULT_SM_PANEL_PADDING) { | |||
const singlePanelSmallMultiple = domain.length <= 1; | |||
const defaultDomain = domain.length === 0 ? [DEFAULT_SINGLE_PANEL_SM_VALUE] : domain; | |||
const defaultDomain = domain.length === 0 ? [null] : domain; |
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.
@markov00 I'm not sure of the implications of doing this. It seems to work fine.
I thought of just returning a null
but that would require a lot of type guards elsewhere.
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.
In the series identifier the smHorizontalAccessorValue
is already an optional param, can we just use undefined instead of null?
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.
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.
All looks good, thanks for taking the time for that change.
🎉 This PR is included in version 24.5.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
Currently, the only way to determine if the value of the small multiple exists is to compare it to the
DEFAULT_SINGLE_PANEL_SM_VALUE
string which is not exported from the library. This pr removes this default value in place ofnull
.Checklist
src/index.ts
(and stories only import from../src
except for test data & storybook)