-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[charts-pro] Add zoom to heatmap #20708
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
base: master
Are you sure you want to change the base?
Conversation
fd37907 to
8a1aa0c
Compare
|
Deploy preview: https://deploy-preview-20708--material-ui-x.netlify.app/ Updated pages: Bundle size report
|
CodSpeed Performance ReportMerging #20708 will not alter performanceComparing Summary
Footnotes |
7b39ace to
70586a2
Compare
70586a2 to
d118441
Compare
|
|
||
| const seriesData: HeatmapValueType[] = []; | ||
|
|
||
| let max = 0; |
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.
Nitpick
| let max = 0; | |
| let maxContribution = 0; |
| function HeatmapCell({ | ||
| ownerState, | ||
| x, | ||
| y, | ||
| width, | ||
| height, | ||
| ...props | ||
| }: HeatmapCellProps) { | ||
| return ( | ||
| <rect | ||
| x={x + 1} | ||
| y={y + 1} | ||
| width={width - 2} | ||
| height={height - 2} | ||
| {...props} | ||
| rx={4} | ||
| ry={4} | ||
| fill={ownerState.color} | ||
| /> | ||
| ); | ||
| } |
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 this is used to improve performances by removing highlight hooks
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.
No, it was just so we could have rounded corners and some padding 😅
| useChartCartesianAxis, | ||
| useChartHighlight, | ||
| useChartProExport, | ||
| useChartBrush, |
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.
Are the brush necessary?
If yes, we should also add the <ChartsBrushOverlay />
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.
Yes, it's necessary because the zoom plugin has a dependency on it. I can add checks and make it optional, but wouldn't it be better to add the brush overlay instead?
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.
Added 👍
Fixes #20622.
Screen.Recording.2025-12-19.at.15.11.16.mov