You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Once fetching from server is complete the props are replaced with the real props that contain real logs from several wells.
We sync scales between different controllers in SLV using onContentRescale callback from the component (usually this function is only called when use flattening and want to apply our own logic for track positioning):
const onContentRescale = React.useCallback(
(iView: number) => {
if (controllers.length <= iView) {
return;
}
// we want to mantain the same aspect ratio - thus we take the scale from the affected well and apply it to all the wells
const scale = controllers[iView].getContentScale();
if (!isFinite(scale)) {
return;
}
controllers.forEach(controller => {
if (controller == controllers[iView]) {
return; // skip controller which caused the onContentRescale
}
controller.setContentScale(scale);
});
},
[controllers]
);
The problem occurs when sometimes when calling controller.setContentScale we get the correct scale however the zoom itself is calculated according to the size of the overlay, in function getContentBaseScale () in WellLogView.ts (in Webviz codebase). When this function is called, the overlay has not yet become visible, its size not yet calculated and it contains a bogus height which causes it to give wrong results which leads to calculation of wrong zoom.
This is easily recreated in Viz storybook by mounting story "Two Wells Same Log" and after it is mounted correctly switch to story "Two Wells Different Log". Since this bug depends on timing and fetching data from server, to recreate the storybook must be reloaded from scratch to clear caches.
The text was updated successfully, but these errors were encountered:
While mounting the component we fetch data from server which takes some. while the data is being fetched we first pass an empty log in the props:
Once fetching from server is complete the props are replaced with the real props that contain real logs from several wells.
We sync scales between different controllers in SLV using onContentRescale callback from the component (usually this function is only called when use flattening and want to apply our own logic for track positioning):
The problem occurs when sometimes when calling controller.setContentScale we get the correct scale however the zoom itself is calculated according to the size of the overlay, in function getContentBaseScale () in WellLogView.ts (in Webviz codebase). When this function is called, the overlay has not yet become visible, its size not yet calculated and it contains a bogus height which causes it to give wrong results which leads to calculation of wrong zoom.
This is easily recreated in Viz storybook by mounting story "Two Wells Same Log" and after it is mounted correctly switch to story "Two Wells Different Log". Since this bug depends on timing and fetching data from server, to recreate the storybook must be reloaded from scratch to clear caches.
The text was updated successfully, but these errors were encountered: