feat: per-layer bounding box tracking with removal support#2573
feat: per-layer bounding box tracking with removal support#2573rubenthoms wants to merge 1 commit intomasterfrom
Conversation
rubenthoms
commented
Jun 6, 2025
- Replaces global bounding box reducer with per-layer tracking
- Automatically recomputes unioned bounding box via useMemo
- Adds debounced cleanup effect to remove bounding boxes for unmounted layers
- Adds Storybook story to demonstrate dynamic camera adjustment on add/remove
- Replaces global bounding box reducer with per-layer tracking - Automatically recomputes unioned bounding box via useMemo - Adds debounced cleanup effect to remove bounding boxes for unmounted layers - Adds Storybook story to demonstrate dynamic camera adjustment on add/remove
|
The use case for us is that data is retrieved asynchronously per data type. Viewers component issues 2 GraphQL calls to retrieve faults and wells. This means for webviz, there are 3 rendering steps:
The current implementation was driven by the following rationale (but implementation could be poor/wrong ;)):
As you noticed, in case 1 does only grow the bounding box. This can be discussed (actually, I don't really mind, since our use case does only add data due to async fetching). Note: I did not yet review the PR to see its impact. I just wanted to explain the current behavior. |
@w1nklr Thanks for the detailed explanation. I see your point with case 2 and that makes total sense. Our use case is that we might change fields in between. Hence, the total bounding box is becoming very large, respecting irrelevant/outdated data. I think our main concern is that |