[DataGridPremium] Formula support#22807
Draft
MBilalShafi wants to merge 6 commits into
Draft
Conversation
First iteration of the Excel-like formula feature: a standalone engine with zero React/grid imports under hooks/features/formula/engine/. - Tokenizer, recursive-descent parser (Excel operator precedence, special forms REF/COLUMN/ROW/COLUMN_POSITION/ROW_POSITION/FIELD/RANGE/COLUMN_VALUES with literal-only arguments), and canonical serializer with a round-trip guarantee - Dependency extraction (static) and position-context binding with interval-record range dependencies (never exploded per-cell edges) - Evaluator with spreadsheet error taxonomy (#REF!, #DIV/0!, #CYCLE!, #NAME?, #VALUE!, #ERROR!), strict left-to-right error propagation, lazy IF/AND/OR, IFERROR/ISBLANK error observers, and a never-throws contract backed by parser depth/height bounds - Function registry with replacement semantics and 23 built-ins (+ CONCATENATE alias); reserved and unreachable names rejected - Kahn-based recompute ordering with built-in cycle detection (iterative, stack-safe) - Ranges and positional references parse but evaluate to #REF! until the position-context iteration; AST and resolver types are now frozen - Design doc with the locked decisions in docsTech/data-grid-formula-feature.md Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Ships the usable computed-column feature on top of the I1 engine: cells whose row-data value starts with `=` in `allowFormulas` columns evaluate through a membership-masking value overlay (rendering, sorting, filtering, aggregation, clipboard, export), with reference-diff invalidation, data-loss-protected editing (source seeding, valueSetter equality guard, type-`=`-to-start-a-formula), `GridFormulaApi`, guards for dataSource/pivoting/disableFormulas, 61 integration tests, and a minimal docs page. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…pport I3) Position context (sorted+filtered data rows × visible data columns, utility columns and autogenerated rows excluded) with one-shot rebind passes on sortedRowsSet/filteredRowsSet/columnVisibilityModelChange/columnsChange; RANGE/COLUMN_VALUES evaluation with the interval dependents tier (range graph edges expand to formula cells inside bounds in both directions); row grouping keys and row spanning comparisons now use evaluated values, re-triggered after formula passes (one community addition: private resetRowSpanningState API); #REF! hardening regression pins; SUM(COLUMN_VALUES) 100k benchmark (~71ms full pass, ~45ms single-edit diff). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Deploy previewBundle size
Check out the code infra dashboard for more information about this PR. |
Contributor
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Member
|
I suggest spending time on improving the description to explain the scope of this feature so we are aligned on what to expect from the feature. |
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.

Preview
https://deploy-preview-22807--material-ui-x.netlify.app/x/react-data-grid/formulas/
In Progress