-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[charts] Improve axis tooltip performances #17398
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
alexfauquette
merged 5 commits into
mui:master
from
alexfauquette:fix-axis-tooltip-pref
Apr 23, 2025
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c2d831b
[charts] Improve axis tooltip performances
alexfauquette d589525
TS
alexfauquette caf7a4d
Merge remote-tracking branch 'upstream/master' into fix-axis-tooltip-…
alexfauquette 189dbeb
feedback
alexfauquette 58d748a
Merge branch 'master' into fix-axis-tooltip-pref
alexfauquette 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
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
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.
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.
Would it make sense to use
isDeepEqual
instead?Otherwise, it's easy to forget to update
compareTooltipAxes
if we add more properties.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.
I assume TS should prevent use from that issue. I updated the selector definition to make sure the type is enfoced on both side.
My issue with
isDeepEqual
is the ease of use. It would be tempting to put that every where.I prefer a custom funciton, used only on simple usecases when necessary.
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.
I agree with that feeling, but I feel the risk of forgetting to add a prop to
compareTooltipAxes
is greater than usingisDeepEqual
. It's a matter of personal opinion, so it isn't a blocker.If we want to avoid using
isDeepEqual
everywhere we can add a comment explaining why it's ok to use it in this case, and require an explanation from now on whenever we need to use it. Do you think that would be acceptable?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.
That would be a solution. I let the PR open for the week-end to discuss with @JCQuintas if he think about another solution to memorize this selector
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.
Maybe we can pass the function to the third argument of
createSelector
asto prevent exporting the func? This would also be advantageous as we wouldn't need to remember to add it when using the selector itself.
Other than that I don't have much preference to which we use, but I do agree
isDeepEqual
is more complete.