-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[charts] Filter item outside the drawing area for perf #14281
base: master
Are you sure you want to change the base?
Conversation
Deploy preview: https://deploy-preview-14281--material-ui-x.netlify.app/ |
CodSpeed Performance ReportMerging #14281 will improve performances by 70.56%Comparing Summary
Benchmarks breakdown
|
@@ -1,5 +1,7 @@ | |||
import * as React from 'react'; | |||
import PropTypes from 'prop-types'; | |||
|
|||
import type {} from '../typeOverloads'; |
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.
Otherwise TS was not understading that pro component have zoom options
if ( | ||
result.x > xMax || | ||
result.x + result.width < xMin || | ||
result.y > yMax || | ||
result.y + result.height < yMin | ||
) { | ||
return 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.
That, plus the line .filter((rectangle) => rectangle !== null);
ar the only modification. in this function. The rest is an indentation diff leading to some prettier modification
7f8dbdc
to
0c28f3f
Compare
@@ -24,7 +24,7 @@ describe('ScatterChart', () => { | |||
async () => { | |||
const { findByText } = render( | |||
<ScatterChart | |||
xAxis={[{ data: xData }]} | |||
xAxis={[{ data: xData, valueFormatter: (v) => v.toLocaleString('en-US') }]} |
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 don't know why but I had an issue on my computer. The default locale of .toLocaleString
was not the same in the test and in the render (1 000
vs 1,000
)
I noticed that zooming on 5% of the data takes as much time to render than a full zoom out. The more we zoom the faster it should render since less elements are to plot
For Bar charts, zoning on 5% of a 1,000 bars (only shows 50 bars out of the 1,000) makes the rendering time move from 100ms to 28ms