-
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
Well Log Viewer: Expose computed track info values #2196
Comments
I remember vaguely some discussions about a callback for readout values, do you remember @mirisb? |
@hkfb yes, there is a callback in WLV controller that can be used to get selection (MD) and use it to generate readout (or do whatever you want with it). onContentSelection works very good for us: since we have all information about the logs (that we compile and send to the internal component) we can use the selected MD to find the log values in all tracks and wells. We generate ourselves nearly identical values to the generated internal info values and can choose whether to display them or do something else with it |
Yeah, I was planning on using |
I think it would make sense to return the curve data itself like @Anders2303 suggests. It's more consistent with eg. the subsurface-viewer component, and it would ensure consistency when reading an interpolated well trajectory or curve. @Anders2303 would you be interested in creating a patch? |
@hkfb Sure! Can probably find time for that sometime next week |
Just to make sure we're on the same page, @hkfb, should I make it so the existing |
... well actually, thinking about it; I probably shouldn't change the emitted properties on |
I wouldn't necessarily consider extending |
No that's a fair point, it could just be a simple extension. I was just overthinking it... I was picturing something like this setInfo(x: number = Number.NaN): void {
// ...
// ...
const iFrom = this.getTrackScrollPos();
const iTo = iFrom + this._maxVisibleTrackNum();
const curveInfo = /* Get data from fillInfo utility */
this.props.onInfo(curveInfo);
} but as you said, it only needs to be a simple extension, so we can just do something like this: setInfo(x: number = Number.NaN): void {
// ...
// ...
const iFrom = this.getTrackScrollPos();
const iTo = iFrom + this._maxVisibleTrackNum();
const curveInfo = /* Get data from fillInfo utility */
this.props.onInfo(x, this.logController, iFrom, iTo, curveInfo);
} Sidenote; The actual computation of the curve data currently happens inside the |
It could be a heavy calculation given many tracks and curves, so it would be preferable to avoid the computation if it's not needed. Perhaps your initial suggestion to add a new callback is better? @Vladimir-Kokin any thoughts? |
Check out 395c128 I implemented the new event approach here, to experiment a little. I added a new event to the callback manager, called "onInfoFilled", and then moved the old fill-info logic from the I think this is a clean solution, and should make it easier for people to make their own info-panels going forward. What do ya'll think? If you give the go-ahead, apply the same changes to SyncLogViewer, and throw up a PR |
LGTM. Please also make a simple Storybook example that demonstrates the usage. |
Not really sure to what extent I can make a valuable storybook example? I've just reorganized a little to expose a new event... Should it be a storybook example showing a custom made information panel? |
Yes, a simple custom panel that demonstrates the readout. |
PR for patch is up! #2205 |
Thanks, will take a look. |
Solves #2196 1. Moved the "fillInfo" computation from the `WellLogInfoPanel` component up to the WellLogViewer and SyncLogViewer core components 2. Added a `onInfoFilled` event to the `CallbackManager`, and made the info-panel listen to that instead 3. Made the viewer-components emit a `onInfoFilled` event, to expose the interpolated data to external components 1. Story-book example at `/story/welllogviewer-demo-welllogviewer--on-info-filled-event` --------- Co-authored-by: Håvard Bjerke <havard.bjerke@aspentech.com>
@Anders2303 , @hkfb |
@mirisb |
## [1.12.7](https://github.com/equinor/webviz-subsurface-components/compare/well-log-viewer@1.12.6...well-log-viewer@1.12.7) (2024-09-03) ### Bug Fixes * Well Log Viewer - Moved callback subscription to well-log-viewer mounted hook ([#2217](#2217)) ([c0e5c97](c0e5c97)), closes [#2216](#2216) [#2196](#2196)
For the Webviz project, we're using the Well Log Viewer component, but we want to create our own track info panel (as the included one doesnt fit our layout approach). W are
Currently, we're using the main
WellLogViewer
(which is believe is wrapping theWellLogViewerWithScroller
) component. Unforunately the availableonInfo
callback does not fire, as the component instead redirects that event to the internalcallbackManager
. However, even if I DID get the onInfo callback, it only provides the generic x-cordinate (as opposed to the actual MD value), and I still need to manually compute each track value, and so on.All of this is already being calculated inside the component logic, could you introduce a way to access the computed track info? Either via a callback, or a getter function in
WellLogController.
?The text was updated successfully, but these errors were encountered: