-
Notifications
You must be signed in to change notification settings - Fork 41
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
feat: map refactoring #1837
Merged
Merged
feat: map refactoring #1837
Conversation
This file contains 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
Main motivation is to fix wrong view state computed when first rendering is done with hidden flag. First reproduced by application with tabbed layout where all the tabs are rendered using hidden flag. This use case has been added to the storybook to demonstrate the issue, along with a 'triggerHome' control (in a previous PR). The current PR brings: - onResize() function to handle resizing - use a React reducer to handle Z scaling Add support for PageUp/PageDown and Shift modifier - use a React reducer to compute the global 3D bounding box from the reportBoundingBox callback of the layers - introduce a ViewController class to generate the DeckGL views and viewState This brings all the computations in one place/one step by providing state change allowing to fine-tune the computations - use bounding box from the 'cameraPosition' (if set as zoom field) instead of the data bounding box Fixes: - initial viewState is correct, even when rendered with 'hidden' flag set to true - triggerHome now respects current zScale In the end, the final implementation drops down to 6 React useEffect, from the 16 initial ones !
Update story
nilscb
approved these changes
Dec 18, 2023
Add script to debug jest tests
🎉 This issue has been resolved in version subsurface-viewer@0.12.0 🎉 The release is available on GitHub release |
w1nklr
added a commit
that referenced
this pull request
Dec 19, 2023
Fix regression in viewport size introduced in PR #1837
w1nklr
added a commit
that referenced
this pull request
Jan 9, 2024
Fix missing dependency to recompute camera state Fix wrong Z range for non mesh grids Optimize bounding box update when the bounding box is not changing Some camera computation issues where introduced in PR #1837
w1nklr
added a commit
that referenced
this pull request
Jan 10, 2024
Fix regression introduced in #1837. Revert to use initial precedence to compute camera in 2D: - camera if provided, - 2D bounds if provided, - default computation otherwise Add story to demonstrate how to sync 2 SubSurfaceViewer.
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.
Refactor Map component to remove numerous useEffect
Main motivation is to fix wrong view state computed when first rendering is done with hidden flag.
First reproduced by application with tabbed layout where all the tabs are rendered using hidden flag.
This use case has been added to the storybook to demonstrate the issue, along with a 'triggerHome' control (in a previous PR).
The current PR brings:
Add support for PageUp/PageDown and Shift modifier
This brings all the computations in one place/one step by providing state change allowing to fine-tune the computations
Fixes:
In the end, the final implementation drops down to 6 React useEffect, from the 16 initial ones !
Fix for #1820