Skip to content
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

Formula value calculation before render #499

Open
sanchit3008 opened this issue Jan 10, 2024 · 2 comments
Open

Formula value calculation before render #499

sanchit3008 opened this issue Jan 10, 2024 · 2 comments

Comments

@sanchit3008
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
Suppose I have a list of formulae for each cell, there should be a way for the sheet to calculate values for these cells without providing it manually for the first render.

Describe alternatives you've considered
ref.current.setCellValue works fine for small sheets but for 10000+ formulae it runs into issues as the state updates after every call to setCellValue which causes the sheet to rerender the same number of times- leading to the state being updated while the sheet is being rerendered resulting in a warning.

Please let me know if this is not an issue and there is a workaround. Thanks.

image
@sanchit3008
Copy link
Collaborator Author

This problem boils down to how to set values for multiple cells but render only once

@sanchit3008
Copy link
Collaborator Author

I have a suggestion for this - a dependency graph of cells can be made, and then a memoized recursive function can be written to calculate the value for each cell based on what has already been calculated / is a static value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant