[charts] Support axis with single value#14191
Merged
alexfauquette merged 5 commits intomui:masterfrom Aug 14, 2024
Merged
Conversation
|
Deploy preview: https://deploy-preview-14191--material-ui-x.netlify.app/ |
alexfauquette
commented
Aug 13, 2024
| } | ||
|
|
||
| if (scale.domain().length === 0 || scale.domain()[0] === scale.domain()[1]) { | ||
| if (scale.domain().length === 0 || !scale.domain().every(Number.isFinite)) { |
Member
Author
There was a problem hiding this comment.
Here you removed the second condition. I keep the check on infinite to avoid plotting the grid if the axis has an inifinit domain. For example the y-axis of a line chart without data
Member
There was a problem hiding this comment.
IIRC this will cause issues when axis is band/point
Member
Author
There was a problem hiding this comment.
Looks like it's time that causes issue. Because the Number.isFinite() returns false for dates. So the code was doing a confusion between Infinity and Date(...)
Member
There was a problem hiding this comment.
Gotta push that new isInfinity function though 🤣
JCQuintas
approved these changes
Aug 14, 2024
This was referenced Sep 19, 2024
This was referenced Sep 20, 2024
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.
I extracted from #14121 your modification that solves #13973 and simplify extremum getters