-
Notifications
You must be signed in to change notification settings - Fork 69
[IMP] cf: add top10 conditional formatting operator #7559
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
| const evaluator = criterionEvaluatorRegistry.get(cf.rule.operator); | ||
| const criterion = { ...cf.rule, type: cf.rule.operator }; | ||
| const ranges = cf.ranges.map((xc) => this.getters.getRangeFromSheetXC(sheetId, xc)); | ||
| const preComputedCriterion = evaluator.preComputeCriterion?.( | ||
| criterion, | ||
| ranges, | ||
| this.getters | ||
| ); |
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.
Not a huge fan, but top10 do a sort to get the top X values, and we really don't wanna sort the range once for every cell of the range, it will explode on big ranges. Even if we use a better algorithm than sorting the range to find the top 10, the best case is still O(n²) ...
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.
The name preComputeCriterion/preComputedCriterion also kinda sucks, I'm open to propositions
fdamhaut
left a comment
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.
Small functional nitpick, I don't have a better idea for the name of the preComputed Value
d41f50a to
7e1c6a3
Compare
This commits adds the "top10" conditional formatting operator, which highlights the top or bottom N values in a selected range. Task: 5367065
7e1c6a3 to
efdc84e
Compare

Description
This commits adds the "top10" conditional formatting operator, which highlights the top or bottom N values in a selected range.
Task: 5367065
review checklist