File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
typescript/packages/well-log-viewer/src/utils Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -198,6 +198,28 @@ export function createWellLogTracks(
198
198
}
199
199
}
200
200
201
+ // If no bounds have been defined (for example, if no tracks were added),
202
+ // we default to using the axis curve's min/max as bounds
203
+ if ( ! isFinite ( info . minmaxPrimaryAxis [ 0 ] ) ) {
204
+ const curves = wellLog [ 0 ] . curves ;
205
+ const data = wellLog [ 0 ] . data ;
206
+ const { primary } = getAxisIndices ( curves , axes ) ;
207
+
208
+ const firstAxisValue = data [ 0 ] ?. [ primary ] ;
209
+ if ( typeof firstAxisValue === "number" )
210
+ info . minmaxPrimaryAxis [ 0 ] = firstAxisValue ;
211
+ }
212
+
213
+ if ( ! isFinite ( info . minmaxPrimaryAxis [ 1 ] ) ) {
214
+ const curves = wellLog [ 0 ] . curves ;
215
+ const data = wellLog [ 0 ] . data ;
216
+ const { primary } = getAxisIndices ( curves , axes ) ;
217
+
218
+ const lastAxisValue = data [ data . length - 1 ] ?. [ primary ] ;
219
+ if ( typeof lastAxisValue === "number" )
220
+ info . minmaxPrimaryAxis [ 1 ] = lastAxisValue ;
221
+ }
222
+
201
223
return info ;
202
224
}
203
225
You can’t perform that action at this time.
0 commit comments