@webviz/subsurface-viewer 1.18.1 → 1.18.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/dist/DashSubsurfaceViewer.js +2 -13
  2. package/dist/DashSubsurfaceViewer.js.map +1 -1
  3. package/dist/SubsurfaceViewer.js +10 -16
  4. package/dist/SubsurfaceViewer.js.map +1 -1
  5. package/dist/components/ColorLegend.js +3 -4
  6. package/dist/components/ColorLegend.js.map +1 -1
  7. package/dist/components/ColorLegends.js +6 -1
  8. package/dist/components/ColorLegends.js.map +1 -1
  9. package/dist/components/DistanceScale.js +5 -2
  10. package/dist/components/DistanceScale.js.map +1 -1
  11. package/dist/components/InfoCard.js +9 -13
  12. package/dist/components/InfoCard.js.map +1 -1
  13. package/dist/components/Map.js +182 -151
  14. package/dist/components/Map.js.map +1 -1
  15. package/dist/components/settings/DrawModeSelector.js +2 -2
  16. package/dist/components/settings/DrawModeSelector.js.map +1 -1
  17. package/dist/components/settings/NumericInput.js +1 -5
  18. package/dist/components/settings/NumericInput.js.map +1 -1
  19. package/dist/components/settings/Settings.js +1 -1
  20. package/dist/components/settings/Settings.js.map +1 -1
  21. package/dist/extensions/side-projection-extension.js +2 -2
  22. package/dist/extensions/side-projection-extension.js.map +1 -1
  23. package/dist/hooks/useMultiViewCursorTracking/useMultiViewCursorTracking.js +11 -6
  24. package/dist/hooks/useMultiViewCursorTracking/useMultiViewCursorTracking.js.map +1 -1
  25. package/dist/hooks/useMultiViewPicking/MultiViewPickingInfoAssembler.js +83 -97
  26. package/dist/hooks/useMultiViewPicking/MultiViewPickingInfoAssembler.js.map +1 -1
  27. package/dist/hooks/useMultiViewPicking/useMultiViewPicking.js +4 -1
  28. package/dist/hooks/useMultiViewPicking/useMultiViewPicking.js.map +1 -1
  29. package/dist/layers/BoxSelectionLayer/boxSelectionLayer.js +2 -3
  30. package/dist/layers/BoxSelectionLayer/boxSelectionLayer.js.map +1 -1
  31. package/dist/layers/axes/axesLayer.js +11 -4
  32. package/dist/layers/axes/axesLayer.js.map +1 -1
  33. package/dist/layers/axes/boxLayer.js +17 -10
  34. package/dist/layers/axes/boxLayer.js.map +1 -1
  35. package/dist/layers/axes2d/axes2DLayer.js +56 -32
  36. package/dist/layers/axes2d/axes2DLayer.js.map +1 -1
  37. package/dist/layers/colormap/colormapLayer.js +33 -34
  38. package/dist/layers/colormap/colormapLayer.js.map +1 -1
  39. package/dist/layers/crosshair/crosshairLayer.js +2 -2
  40. package/dist/layers/crosshair/crosshairLayer.js.map +1 -1
  41. package/dist/layers/drawing/drawingLayer.js +6 -4
  42. package/dist/layers/drawing/drawingLayer.js.map +1 -1
  43. package/dist/layers/fault_polygons/faultPolygonsLayer.js +5 -6
  44. package/dist/layers/fault_polygons/faultPolygonsLayer.js.map +1 -1
  45. package/dist/layers/gpglLayers/gpglValueMappedSurfaceLayer.js +195 -169
  46. package/dist/layers/gpglLayers/gpglValueMappedSurfaceLayer.js.map +1 -1
  47. package/dist/layers/grid3d/grid3dLayer.js +46 -53
  48. package/dist/layers/grid3d/grid3dLayer.js.map +1 -1
  49. package/dist/layers/grid3d/privateGrid3dLayer.js +73 -48
  50. package/dist/layers/grid3d/privateGrid3dLayer.js.map +1 -1
  51. package/dist/layers/grid3d/webworker.js +17 -6
  52. package/dist/layers/grid3d/webworker.js.map +1 -1
  53. package/dist/layers/hillshading2d/hillshading2dLayer.js +15 -9
  54. package/dist/layers/hillshading2d/hillshading2dLayer.js.map +1 -1
  55. package/dist/layers/map/mapLayer.js +49 -50
  56. package/dist/layers/map/mapLayer.js.map +1 -1
  57. package/dist/layers/map/privateMapLayer.js +52 -28
  58. package/dist/layers/map/privateMapLayer.js.map +1 -1
  59. package/dist/layers/map/webworker.js +1 -1
  60. package/dist/layers/map/webworker.js.map +1 -1
  61. package/dist/layers/northarrow/northArrow3DLayer.js +17 -10
  62. package/dist/layers/northarrow/northArrow3DLayer.js.map +1 -1
  63. package/dist/layers/piechart/pieChartLayer.js +26 -21
  64. package/dist/layers/piechart/pieChartLayer.js.map +1 -1
  65. package/dist/layers/points/pointsLayer.js +5 -3
  66. package/dist/layers/points/pointsLayer.js.map +1 -1
  67. package/dist/layers/points/privatePointsLayer.js +1 -2
  68. package/dist/layers/points/privatePointsLayer.js.map +1 -1
  69. package/dist/layers/polyline_group/polylineGroupLayer.js +84 -58
  70. package/dist/layers/polyline_group/polylineGroupLayer.js.map +1 -1
  71. package/dist/layers/polylines/polylinesLayer.js +5 -3
  72. package/dist/layers/polylines/polylinesLayer.js.map +1 -1
  73. package/dist/layers/polylines/privatePolylinesLayer.js +1 -2
  74. package/dist/layers/polylines/privatePolylinesLayer.js.map +1 -1
  75. package/dist/layers/seismic/seismicLayer.js +28 -23
  76. package/dist/layers/seismic/seismicLayer.js.map +1 -1
  77. package/dist/layers/shader_modules/phong-lighting/phong-material.js +2 -2
  78. package/dist/layers/shader_modules/phong-lighting/phong-material.js.map +1 -1
  79. package/dist/layers/shader_modules/test-precision/precisionForTests-shaders-glsl.js +4 -3
  80. package/dist/layers/shader_modules/test-precision/precisionForTests-shaders-glsl.js.map +1 -1
  81. package/dist/layers/triangle/privateTriangleLayer.js +66 -40
  82. package/dist/layers/triangle/privateTriangleLayer.js.map +1 -1
  83. package/dist/layers/triangle/triangleLayer.js +66 -66
  84. package/dist/layers/triangle/triangleLayer.js.map +1 -1
  85. package/dist/layers/utils/colormapTools.js +16 -3
  86. package/dist/layers/utils/colormapTools.js.map +1 -1
  87. package/dist/layers/utils/layerTools.js +5 -7
  88. package/dist/layers/utils/layerTools.js.map +1 -1
  89. package/dist/layers/well_markers/wellMarkersLayer.js +41 -16
  90. package/dist/layers/well_markers/wellMarkersLayer.js.map +1 -1
  91. package/dist/layers/wells/layers/dashedSectionsPathLayer.js +60 -31
  92. package/dist/layers/wells/layers/dashedSectionsPathLayer.js.map +1 -1
  93. package/dist/layers/wells/layers/flatWellMarkersLayer.js +79 -33
  94. package/dist/layers/wells/layers/flatWellMarkersLayer.js.map +1 -1
  95. package/dist/layers/wells/layers/logCurveLayer.js +80 -69
  96. package/dist/layers/wells/layers/logCurveLayer.js.map +1 -1
  97. package/dist/layers/wells/layers/mergedTextLayer.js +18 -12
  98. package/dist/layers/wells/layers/mergedTextLayer.js.map +1 -1
  99. package/dist/layers/wells/layers/wellLabelLayer.js +20 -13
  100. package/dist/layers/wells/layers/wellLabelLayer.js.map +1 -1
  101. package/dist/layers/wells/utils/abscissaTransform.js +10 -4
  102. package/dist/layers/wells/utils/abscissaTransform.js.map +1 -1
  103. package/dist/layers/wells/utils/features.js +2 -4
  104. package/dist/layers/wells/utils/features.js.map +1 -1
  105. package/dist/layers/wells/utils/log.js +11 -11
  106. package/dist/layers/wells/utils/log.js.map +1 -1
  107. package/dist/layers/wells/utils/readout.js +2 -4
  108. package/dist/layers/wells/utils/readout.js.map +1 -1
  109. package/dist/layers/wells/utils/spline.js +19 -25
  110. package/dist/layers/wells/utils/spline.js.map +1 -1
  111. package/dist/layers/wells/utils/trajectory.js +28 -22
  112. package/dist/layers/wells/utils/trajectory.js.map +1 -1
  113. package/dist/layers/wells/utils/wells.js +3 -4
  114. package/dist/layers/wells/utils/wells.js.map +1 -1
  115. package/dist/layers/wells/wellsLayer.js +232 -138
  116. package/dist/layers/wells/wellsLayer.js.map +1 -1
  117. package/dist/utils/BoundingBox2D.js +2 -2
  118. package/dist/utils/BoundingBox2D.js.map +1 -1
  119. package/dist/utils/BoundingBox3D.js +2 -2
  120. package/dist/utils/BoundingBox3D.js.map +1 -1
  121. package/dist/utils/Color.js +2 -3
  122. package/dist/utils/Color.js.map +1 -1
  123. package/dist/utils/camera.js +3 -5
  124. package/dist/utils/camera.js.map +1 -1
  125. package/dist/utils/configuration.d.ts +5 -5
  126. package/dist/utils/configuration.js +7 -2
  127. package/dist/utils/configuration.js.map +1 -1
  128. package/dist/utils/event.js +7 -7
  129. package/dist/utils/event.js.map +1 -1
  130. package/dist/utils/serialize.js +52 -68
  131. package/dist/utils/serialize.js.map +1 -1
  132. package/dist/utils/specExtractor.js +1 -1
  133. package/dist/utils/specExtractor.js.map +1 -1
  134. package/dist/views/sectionView.js +1 -1
  135. package/dist/views/sectionView.js.map +1 -1
  136. package/dist/views/viewport.d.ts +1 -0
  137. package/dist/views/viewport.js +10 -4
  138. package/dist/views/viewport.js.map +1 -1
  139. package/package.json +12 -16
@@ -168,16 +168,14 @@ export default class WellsLayer extends CompositeLayer {
168
168
  });
169
169
  }
170
170
  getLogLayer() {
171
- var _a, _b;
172
- const sub_layers = (_a = this.internalState) === null || _a === void 0 ? void 0 : _a.subLayers;
171
+ const sub_layers = this.internalState?.subLayers;
173
172
  const log_layers = getLayersById(sub_layers, "wells-layer-log_curve");
174
- return (_b = log_layers === null || log_layers === void 0 ? void 0 : log_layers[0]) === null || _b === void 0 ? void 0 : _b.getCurveLayer();
173
+ return log_layers?.[0]?.getCurveLayer();
175
174
  }
176
175
  getSelectionLayer() {
177
- var _a, _b;
178
- const sub_layers = (_a = this.internalState) === null || _a === void 0 ? void 0 : _a.subLayers;
176
+ const sub_layers = this.internalState?.subLayers;
179
177
  const log_layer = getLayersById(sub_layers, "wells-layer-log_curve");
180
- return (_b = log_layer === null || log_layer === void 0 ? void 0 : log_layer[0]) === null || _b === void 0 ? void 0 : _b.getSelectionLayer();
178
+ return log_layer?.[0]?.getSelectionLayer();
181
179
  }
182
180
  getLogCurveData() {
183
181
  return this.state.logData;
@@ -188,8 +186,7 @@ export default class WellsLayer extends CompositeLayer {
188
186
  this.setLegend(data);
189
187
  }
190
188
  getWellLabelPosition() {
191
- var _a;
192
- if ((_a = this.props.wellLabel) === null || _a === void 0 ? void 0 : _a.getPositionAlongPath) {
189
+ if (this.props.wellLabel?.getPositionAlongPath) {
193
190
  return this.props.wellLabel.getPositionAlongPath;
194
191
  }
195
192
  else if (!_.isUndefined(this.props.wellNameAtTop)) {
@@ -208,7 +205,6 @@ export default class WellsLayer extends CompositeLayer {
208
205
  return 0;
209
206
  }
210
207
  createWellLabelLayer(data) {
211
- var _a, _b, _c, _d, _e;
212
208
  if (!this.props.wellLabel && !this.props.wellNameVisible) {
213
209
  return null;
214
210
  }
@@ -217,19 +213,30 @@ export default class WellsLayer extends CompositeLayer {
217
213
  [GL.POLYGON_OFFSET_FILL]: true,
218
214
  };
219
215
  const fastDrawing = this.props.simplifiedRendering;
220
- const wellLabelProps = this.getSubLayerProps(Object.assign(Object.assign({}, this.props.wellLabel), { id: SubLayerId.LABELS, data, pickable: true,
216
+ const wellLabelProps = this.getSubLayerProps({
217
+ ...this.props.wellLabel,
218
+ id: SubLayerId.LABELS,
219
+ data,
220
+ pickable: true,
221
221
  // Z is always increasing upwards at this stage
222
- zIncreasingDownwards: false, getPositionAlongPath: this.getWellLabelPosition(), getColor: (_b = (_a = this.props.wellLabel) === null || _a === void 0 ? void 0 : _a.getColor) !== null && _b !== void 0 ? _b : this.props.wellNameColor, getAnchor: "start", getSize: (_d = (_c = this.props.wellLabel) === null || _c === void 0 ? void 0 : _c.getSize) !== null && _d !== void 0 ? _d : this.props.wellNameSize, parameters, visible: !fastDrawing, background: ((_e = this.props.wellLabel) === null || _e === void 0 ? void 0 : _e.background) ||
223
- this.props.hideOverlappingWellNames }));
222
+ zIncreasingDownwards: false,
223
+ getPositionAlongPath: this.getWellLabelPosition(),
224
+ getColor: this.props.wellLabel?.getColor ?? this.props.wellNameColor,
225
+ getAnchor: "start",
226
+ getSize: this.props.wellLabel?.getSize ?? this.props.wellNameSize,
227
+ parameters,
228
+ visible: !fastDrawing,
229
+ background: this.props.wellLabel?.background ||
230
+ this.props.hideOverlappingWellNames,
231
+ });
224
232
  return new WellLabelLayer(wellLabelProps);
225
233
  }
226
234
  renderLayers() {
227
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14;
228
235
  const data = this.getWellDataState();
229
- const isDashed = !!((_a = this.props.lineStyle) === null || _a === void 0 ? void 0 : _a.dash);
236
+ const isDashed = !!this.props.lineStyle?.dash;
230
237
  // To support outlines for the dashed section, we will manage it's default dash size here
231
- const screenDashAccessor = (_c = (_b = this.props.markers) === null || _b === void 0 ? void 0 : _b.getScreenDashArray) !== null && _c !== void 0 ? _c : DEFAULT_SCREEN_DASH;
232
- if (!data || !(data === null || data === void 0 ? void 0 : data.features.length)) {
238
+ const screenDashAccessor = this.props.markers?.getScreenDashArray ?? DEFAULT_SCREEN_DASH;
239
+ if (!data || !data?.features.length) {
233
240
  return [];
234
241
  }
235
242
  const extensions = [
@@ -248,13 +255,13 @@ export default class WellsLayer extends CompositeLayer {
248
255
  data,
249
256
  pickable: false,
250
257
  stroked: false,
251
- positionFormat: (_d = this.props.positionFormat) !== null && _d !== void 0 ? _d : "XYZ",
258
+ positionFormat: this.props.positionFormat ?? "XYZ",
252
259
  pointRadiusUnits: "pixels",
253
260
  lineWidthUnits: "pixels",
254
261
  pointRadiusScale: this.props.pointRadiusScale,
255
262
  lineWidthScale: this.props.lineWidthScale,
256
- getLineWidth: getSize(LINE, (_e = this.props.lineStyle) === null || _e === void 0 ? void 0 : _e.width, -1),
257
- getPointRadius: getSize(POINT, (_f = this.props.wellHeadStyle) === null || _f === void 0 ? void 0 : _f.size, -1),
263
+ getLineWidth: getSize(LINE, this.props.lineStyle?.width, -1),
264
+ getPointRadius: getSize(POINT, this.props.wellHeadStyle?.size, -1),
258
265
  lineBillboard: true,
259
266
  pointBillboard: true,
260
267
  parameters,
@@ -262,114 +269,176 @@ export default class WellsLayer extends CompositeLayer {
262
269
  filterEnabled: false,
263
270
  };
264
271
  // Map GeoJsonLayer properties to match PathLayerProps
265
- const colorsLayerProps = this.getSubLayerProps(Object.assign(Object.assign({}, defaultLayerProps), {
272
+ const colorsLayerProps = this.getSubLayerProps({
273
+ ...defaultLayerProps,
266
274
  // Whenever _subLayerProps.linestrings.type changes, we need to ensure an entirely new
267
275
  // layer instance is created to avoid state errors, which is why we modify the ID.
268
- id: ((_g = this.props.markers) === null || _g === void 0 ? void 0 : _g.showScreenTrajectoryAsDash)
276
+ id: this.props.markers?.showScreenTrajectoryAsDash
269
277
  ? SubLayerId.SCREEN_TRAJECTORY
270
- : SubLayerId.COLORS, pickable: true, extensions: [
278
+ : SubLayerId.COLORS,
279
+ pickable: true,
280
+ extensions: [
271
281
  ...extensions,
272
282
  new DataFilterExtension({
273
283
  filterSize: 1,
274
284
  }),
275
- ], getDashArray: getDashFactor((_h = this.props.lineStyle) === null || _h === void 0 ? void 0 : _h.dash, getSize(LINE, (_j = this.props.lineStyle) === null || _j === void 0 ? void 0 : _j.width), -1), visible: !fastDrawing, getLineColor: getColor((_k = this.props.lineStyle) === null || _k === void 0 ? void 0 : _k.color), getFillColor: getColor((_l = this.props.wellHeadStyle) === null || _l === void 0 ? void 0 : _l.color), filterEnabled: this.props.enableFilters,
285
+ ],
286
+ getDashArray: getDashFactor(this.props.lineStyle?.dash, getSize(LINE, this.props.lineStyle?.width), -1),
287
+ visible: !fastDrawing,
288
+ getLineColor: getColor(this.props.lineStyle?.color),
289
+ getFillColor: getColor(this.props.wellHeadStyle?.color),
290
+ filterEnabled: this.props.enableFilters,
276
291
  // ? I should be able to use filterCategories: [1] and `getFilterCategory`, but it's not working for path section filtering
277
- filterRange: [1, 1], getFilterValue: (d, ctx) => getTrajectoryFilterCategory(d, this.props.mdFilterRange, this.props.formationFilter, this.props.wellNameFilter, ctx), updateTriggers: {
292
+ filterRange: [1, 1],
293
+ getFilterValue: (d, ctx) => getTrajectoryFilterCategory(d, this.props.mdFilterRange, this.props.formationFilter, this.props.wellNameFilter, ctx),
294
+ updateTriggers: {
278
295
  getFilterValue: [
279
296
  this.props.wellNameFilter,
280
- ...((_m = this.props.updateTriggers["mdFilterRange"]) !== null && _m !== void 0 ? _m : []),
281
- ...((_o = this.props.updateTriggers["formationFilter"]) !== null && _o !== void 0 ? _o : []),
297
+ ...(this.props.updateTriggers["mdFilterRange"] ?? []),
298
+ ...(this.props.updateTriggers["formationFilter"] ?? []),
282
299
  ],
283
- },
300
+ },
284
301
  // Override path layer to use opt-in screen dashes
285
302
  _subLayerProps: {
286
303
  linestrings: {
287
- type: ((_p = this.props.markers) === null || _p === void 0 ? void 0 : _p.showScreenTrajectoryAsDash)
304
+ type: this.props.markers?.showScreenTrajectoryAsDash
288
305
  ? DashedSectionsPathLayer
289
306
  : PathLayer,
290
- getSectionDashArray: getDashFactor(screenDashAccessor, getSize(LINE, (_q = this.props.lineStyle) === null || _q === void 0 ? void 0 : _q.width), -1),
307
+ getSectionDashArray: getDashFactor(screenDashAccessor, getSize(LINE, this.props.lineStyle?.width), -1),
291
308
  getCumulativePathDistance: (d) => d.__source.object.properties.md[0],
292
309
  getDashedSectionsAlongPath: (d) => {
293
- var _a, _b;
294
310
  const feature = d.__source.object;
295
- const maxMd = (_a = feature.properties.md[0]) === null || _a === void 0 ? void 0 : _a.at(-1);
311
+ const maxMd = feature.properties.md[0]?.at(-1);
296
312
  if (maxMd === undefined)
297
313
  return undefined;
298
- return (_b = feature.properties.screens) === null || _b === void 0 ? void 0 : _b.map((screen) => [
314
+ return feature.properties.screens?.map((screen) => [
299
315
  screen.mdStart / maxMd,
300
316
  screen.mdEnd / maxMd,
301
317
  ]);
302
318
  },
303
319
  },
304
- } }));
305
- const fastLayerProps = this.getSubLayerProps(Object.assign(Object.assign({}, defaultLayerProps), { id: SubLayerId.SIMPLE, getLineColor: getColor((_r = this.props.lineStyle) === null || _r === void 0 ? void 0 : _r.color), getFillColor: getColor((_s = this.props.wellHeadStyle) === null || _s === void 0 ? void 0 : _s.color) }));
306
- const filterGhostLayerProps = this.getSubLayerProps(Object.assign(Object.assign({}, defaultLayerProps), { extensions: [
320
+ },
321
+ });
322
+ const fastLayerProps = this.getSubLayerProps({
323
+ ...defaultLayerProps,
324
+ id: SubLayerId.SIMPLE,
325
+ getLineColor: getColor(this.props.lineStyle?.color),
326
+ getFillColor: getColor(this.props.wellHeadStyle?.color),
327
+ });
328
+ const filterGhostLayerProps = this.getSubLayerProps({
329
+ ...defaultLayerProps,
330
+ extensions: [
307
331
  new DataFilterExtension({
308
332
  filterSize: 1,
309
333
  }),
310
- ], id: SubLayerId.TRAJECTORY_FILTER_GHOST, filterEnabled: this.props.enableFilters, getFillColor: Array.isArray(this.props.showFilterTrajectoryGhost)
334
+ ],
335
+ id: SubLayerId.TRAJECTORY_FILTER_GHOST,
336
+ filterEnabled: this.props.enableFilters,
337
+ getFillColor: Array.isArray(this.props.showFilterTrajectoryGhost)
311
338
  ? this.props.showFilterTrajectoryGhost
312
- : [225, 225, 225], getLineColor: Array.isArray(this.props.showFilterTrajectoryGhost)
339
+ : [225, 225, 225],
340
+ getLineColor: Array.isArray(this.props.showFilterTrajectoryGhost)
313
341
  ? this.props.showFilterTrajectoryGhost
314
- : [225, 225, 225],
342
+ : [225, 225, 225],
315
343
  // ? I should be able to use filterCategories: [1] and `getFilterCategory`, but it's not working for path section filtering
316
- filterRange: [1, 1], getFilterValue: (d, ctx) => {
344
+ filterRange: [1, 1],
345
+ getFilterValue: (d, ctx) => {
317
346
  const includeFilter = getTrajectoryFilterCategory(d, this.props.mdFilterRange, this.props.formationFilter, this.props.wellNameFilter, ctx);
318
347
  if (!Array.isArray(includeFilter))
319
348
  return 1 - includeFilter;
320
349
  return includeFilter.map((n) => 1 - n);
321
- }, getDashArray: getDashFactor((_t = this.props.lineStyle) === null || _t === void 0 ? void 0 : _t.dash), visible: !fastDrawing &&
350
+ },
351
+ getDashArray: getDashFactor(this.props.lineStyle?.dash),
352
+ visible: !fastDrawing &&
322
353
  this.props.enableFilters &&
323
- this.props.showFilterTrajectoryGhost, parameters: Object.assign(Object.assign({}, parameters), { [GL.POLYGON_OFFSET_FACTOR]: 1, [GL.POLYGON_OFFSET_UNITS]: 1 }), updateTriggers: {
354
+ this.props.showFilterTrajectoryGhost,
355
+ parameters: {
356
+ ...parameters,
357
+ [GL.POLYGON_OFFSET_FACTOR]: 1,
358
+ [GL.POLYGON_OFFSET_UNITS]: 1,
359
+ },
360
+ updateTriggers: {
324
361
  getFilterValue: [
325
362
  this.props.wellNameFilter,
326
- ...((_u = this.props.updateTriggers["mdFilterRange"]) !== null && _u !== void 0 ? _u : []),
327
- ...((_v = this.props.updateTriggers["formationFilter"]) !== null && _v !== void 0 ? _v : []),
363
+ ...(this.props.updateTriggers["mdFilterRange"] ?? []),
364
+ ...(this.props.updateTriggers["formationFilter"] ?? []),
328
365
  ],
329
- } }));
330
- const outlineLayerProps = this.getSubLayerProps(Object.assign(Object.assign({}, defaultLayerProps), {
366
+ },
367
+ });
368
+ const outlineLayerProps = this.getSubLayerProps({
369
+ ...defaultLayerProps,
331
370
  // Whenever _subLayerProps.linestrings.type changes, we need to ensure an entirely new
332
371
  // layer instance is created to avoid state errors, which is why we modify the ID.
333
- id: ((_w = this.props.markers) === null || _w === void 0 ? void 0 : _w.showScreenTrajectoryAsDash)
372
+ id: this.props.markers?.showScreenTrajectoryAsDash
334
373
  ? SubLayerId.SCREEN_TRAJECTORY_OUTLINE
335
- : SubLayerId.OUTLINE, getLineWidth: getSize(LINE, (_x = this.props.lineStyle) === null || _x === void 0 ? void 0 : _x.width), getPointRadius: getSize(POINT, (_y = this.props.wellHeadStyle) === null || _y === void 0 ? void 0 : _y.size), extensions: [
374
+ : SubLayerId.OUTLINE,
375
+ getLineWidth: getSize(LINE, this.props.lineStyle?.width),
376
+ getPointRadius: getSize(POINT, this.props.wellHeadStyle?.size),
377
+ extensions: [
336
378
  ...extensions,
337
379
  new DataFilterExtension({
338
380
  filterSize: 1,
339
381
  }),
340
- ], filterEnabled: this.props.enableFilters,
382
+ ],
383
+ filterEnabled: this.props.enableFilters,
341
384
  // ? I should be able to use filterCategories: [1] and `getFilterCategory`, but it's not working for path section filtering
342
- filterRange: [1, 1], getFilterValue: (d, ctx) => getTrajectoryFilterCategory(d, this.props.mdFilterRange, this.props.formationFilter, this.props.wellNameFilter, ctx), getDashArray: getDashFactor((_z = this.props.lineStyle) === null || _z === void 0 ? void 0 : _z.dash), visible: this.props.outline && !fastDrawing, parameters: Object.assign(Object.assign({}, parameters), { [GL.POLYGON_OFFSET_FACTOR]: 1, [GL.POLYGON_OFFSET_UNITS]: 1 }), updateTriggers: {
385
+ filterRange: [1, 1],
386
+ getFilterValue: (d, ctx) => getTrajectoryFilterCategory(d, this.props.mdFilterRange, this.props.formationFilter, this.props.wellNameFilter, ctx),
387
+ getDashArray: getDashFactor(this.props.lineStyle?.dash),
388
+ visible: this.props.outline && !fastDrawing,
389
+ parameters: {
390
+ ...parameters,
391
+ [GL.POLYGON_OFFSET_FACTOR]: 1,
392
+ [GL.POLYGON_OFFSET_UNITS]: 1,
393
+ },
394
+ updateTriggers: {
343
395
  getFilterValue: [
344
396
  this.props.wellNameFilter,
345
- ...((_0 = this.props.updateTriggers["mdFilterRange"]) !== null && _0 !== void 0 ? _0 : []),
346
- ...((_1 = this.props.updateTriggers["formationFilter"]) !== null && _1 !== void 0 ? _1 : []),
397
+ ...(this.props.updateTriggers["mdFilterRange"] ?? []),
398
+ ...(this.props.updateTriggers["formationFilter"] ?? []),
347
399
  ],
348
- },
400
+ },
349
401
  // Override path layer to use opt-in screen dashes
350
402
  _subLayerProps: {
351
403
  linestrings: {
352
- type: ((_2 = this.props.markers) === null || _2 === void 0 ? void 0 : _2.showScreenTrajectoryAsDash)
404
+ type: this.props.markers?.showScreenTrajectoryAsDash
353
405
  ? DashedSectionsPathLayer
354
406
  : PathLayer,
355
407
  // Props for DashedSectionsPathLayer
356
- getSectionDashArray: getDashFactor(screenDashAccessor, getSize(LINE, (_3 = this.props.lineStyle) === null || _3 === void 0 ? void 0 : _3.width)),
408
+ getSectionDashArray: getDashFactor(screenDashAccessor, getSize(LINE, this.props.lineStyle?.width)),
357
409
  getCumulativePathDistance: (d) => d.__source.object.properties.md[0],
358
410
  getDashedSectionsAlongPath: (d) => {
359
- var _a, _b;
360
411
  const feature = d.__source.object;
361
- const maxMd = (_a = feature.properties.md[0]) === null || _a === void 0 ? void 0 : _a.at(-1);
412
+ const maxMd = feature.properties.md[0]?.at(-1);
362
413
  if (maxMd === undefined)
363
414
  return undefined;
364
- return (_b = feature.properties.screens) === null || _b === void 0 ? void 0 : _b.map((screen) => [
415
+ return feature.properties.screens?.map((screen) => [
365
416
  screen.mdStart / maxMd,
366
417
  screen.mdEnd / maxMd,
367
418
  ]);
368
419
  },
369
420
  },
370
- } }));
371
- const highlightLayerProps = this.getSubLayerProps(Object.assign(Object.assign({}, defaultLayerProps), { id: SubLayerId.HIGHLIGHT, data: getWellObjectByName(data.features, this.props.selectedWell), getLineWidth: getSize(LINE, (_4 = this.props.lineStyle) === null || _4 === void 0 ? void 0 : _4.width, 2), getPointRadius: getSize(POINT, (_5 = this.props.wellHeadStyle) === null || _5 === void 0 ? void 0 : _5.size, 2), getLineColor: getColor((_6 = this.props.lineStyle) === null || _6 === void 0 ? void 0 : _6.color), getFillColor: getColor((_7 = this.props.wellHeadStyle) === null || _7 === void 0 ? void 0 : _7.color), visible: this.props.logCurves && !fastDrawing }));
372
- const highlightMultiWellsLayerProps = this.getSubLayerProps(Object.assign(Object.assign({}, defaultLayerProps), { id: SubLayerId.HIGHLIGHT_2, data: getWellObjectsByName(data.features, this.state.selectedMultiWells), getPointRadius: getSize(POINT, (_8 = this.props.wellHeadStyle) === null || _8 === void 0 ? void 0 : _8.size, 2), getFillColor: [255, 140, 0], getLineColor: [255, 140, 0], visible: this.props.logCurves && !fastDrawing }));
421
+ },
422
+ });
423
+ const highlightLayerProps = this.getSubLayerProps({
424
+ ...defaultLayerProps,
425
+ id: SubLayerId.HIGHLIGHT,
426
+ data: getWellObjectByName(data.features, this.props.selectedWell),
427
+ getLineWidth: getSize(LINE, this.props.lineStyle?.width, 2),
428
+ getPointRadius: getSize(POINT, this.props.wellHeadStyle?.size, 2),
429
+ getLineColor: getColor(this.props.lineStyle?.color),
430
+ getFillColor: getColor(this.props.wellHeadStyle?.color),
431
+ visible: this.props.logCurves && !fastDrawing,
432
+ });
433
+ const highlightMultiWellsLayerProps = this.getSubLayerProps({
434
+ ...defaultLayerProps,
435
+ id: SubLayerId.HIGHLIGHT_2,
436
+ data: getWellObjectsByName(data.features, this.state.selectedMultiWells),
437
+ getPointRadius: getSize(POINT, this.props.wellHeadStyle?.size, 2),
438
+ getFillColor: [255, 140, 0],
439
+ getLineColor: [255, 140, 0],
440
+ visible: this.props.logCurves && !fastDrawing,
441
+ });
373
442
  const fastLayer = new GeoJsonLayer(fastLayerProps);
374
443
  const outlineLayer = new GeoJsonLayer(outlineLayerProps);
375
444
  const colorsLayer = new GeoJsonLayer(colorsLayerProps);
@@ -378,58 +447,74 @@ export default class WellsLayer extends CompositeLayer {
378
447
  const highlightLayer = new GeoJsonLayer(highlightLayerProps);
379
448
  // Highlight the multi selected wells.
380
449
  const highlightMultiWellsLayer = new GeoJsonLayer(highlightMultiWellsLayerProps);
381
- const logLayer = new LogCurveLayer(Object.assign({}, this.getSubLayerProps({
382
- id: SubLayerId.LOG_CURVE,
383
- visible: this.props.logCurves && !fastDrawing,
450
+ const logLayer = new LogCurveLayer({
451
+ ...this.getSubLayerProps({
452
+ id: SubLayerId.LOG_CURVE,
453
+ visible: this.props.logCurves && !fastDrawing,
454
+ pickable: true,
455
+ parameters,
456
+ positionFormat: this.props.positionFormat,
457
+ data: this.props.logData,
458
+ trajectoryData: data,
459
+ domainSelection: this.state.logDomainSelection,
460
+ logWidth: this.props.logRadius || "value",
461
+ activeLog: {
462
+ logRun: this.props.logrunName,
463
+ curveName: this.props.logName,
464
+ },
465
+ colorScale: {
466
+ name: this.props.logColor,
467
+ isLogarithmic: this.props.isLog,
468
+ colorTables: this.context.userData
469
+ .colorTables,
470
+ mappingFunction: this.props.colorMappingFunction,
471
+ },
472
+ getWellMds: getWellMds,
473
+ getTrajectoryPath: (d) => getTrajectory(d, this.props.lineStyle?.color),
474
+ onLogDataComputed: (value) => {
475
+ this.setState({ logData: value });
476
+ this.setLegend(value);
477
+ },
478
+ updateTriggers: {
479
+ getTrajectoryPath: [this.props.lineStyle],
480
+ },
481
+ }),
482
+ });
483
+ const markerLayer = new FlatWellMarkersLayer(this.getSubLayerProps({
484
+ ...defaultLayerProps,
485
+ visible: !fastDrawing,
384
486
  pickable: true,
385
- parameters,
386
- positionFormat: this.props.positionFormat,
387
- data: this.props.logData,
388
- trajectoryData: data,
389
- domainSelection: this.state.logDomainSelection,
390
- logWidth: this.props.logRadius || "value",
391
- activeLog: {
392
- logRun: this.props.logrunName,
393
- curveName: this.props.logName,
394
- },
395
- colorScale: {
396
- name: this.props.logColor,
397
- isLogarithmic: this.props.isLog,
398
- colorTables: this.context.userData
399
- .colorTables,
400
- mappingFunction: this.props.colorMappingFunction,
401
- },
402
- getWellMds: getWellMds,
403
- getTrajectoryPath: (d) => { var _a; return getTrajectory(d, (_a = this.props.lineStyle) === null || _a === void 0 ? void 0 : _a.color); },
404
- onLogDataComputed: (value) => {
405
- this.setState({ logData: value });
406
- this.setLegend(value);
407
- },
408
- updateTriggers: {
409
- getTrajectoryPath: [this.props.lineStyle],
410
- },
411
- })));
412
- const markerLayer = new FlatWellMarkersLayer(this.getSubLayerProps(Object.assign(Object.assign({}, defaultLayerProps), { visible: !fastDrawing, pickable: true, id: SubLayerId.MARKERS, data: data.features, outline: this.props.outline, getLineColor: getColor((_9 = this.props.lineStyle) === null || _9 === void 0 ? void 0 : _9.color),
487
+ id: SubLayerId.MARKERS,
488
+ data: data.features,
489
+ outline: this.props.outline,
490
+ getLineColor: getColor(this.props.lineStyle?.color),
413
491
  // We can also specify the color per marker
414
492
  // getMarkerColor: (marker: TrajectoryMarker) => ...
415
493
  updateTriggers: {
416
494
  getMarkers: [
417
- (_10 = this.props.markers) === null || _10 === void 0 ? void 0 : _10.showScreens,
418
- (_11 = this.props.markers) === null || _11 === void 0 ? void 0 : _11.showPerforations,
495
+ this.props.markers?.showScreens,
496
+ this.props.markers?.showPerforations,
419
497
  ],
420
498
  getFilterValue: [
421
499
  this.props.wellNameFilter,
422
- ...((_12 = this.props.updateTriggers["mdFilterRange"]) !== null && _12 !== void 0 ? _12 : []),
423
- ...((_13 = this.props.updateTriggers["formationFilter"]) !== null && _13 !== void 0 ? _13 : []),
500
+ ...(this.props.updateTriggers["mdFilterRange"] ?? []),
501
+ ...(this.props.updateTriggers["formationFilter"] ?? []),
424
502
  ],
425
- }, extensions: [new DataFilterExtension({ filterSize: 1 })], filterEnabled: this.props.enableFilters, filterRange: [1, 1], getFilterValue: (d, ctx) => getTrajectoryFilterCategory(d, this.props.mdFilterRange, this.props.formationFilter, this.props.wellNameFilter, ctx), getCumulativePathDistance: (d) => d.properties.md[0], getTrajectoryPath: (d) => { var _a; return getTrajectory(d, (_a = this.props.lineStyle) === null || _a === void 0 ? void 0 : _a.color); }, getMarkerColor: (_14 = this.props.markers) === null || _14 === void 0 ? void 0 : _14.getMarkerColor, getMarkers: (d) => {
426
- var _a, _b, _c;
427
- const maxMd = (_a = d.properties.md[0]) === null || _a === void 0 ? void 0 : _a.at(-1);
503
+ },
504
+ extensions: [new DataFilterExtension({ filterSize: 1 })],
505
+ filterEnabled: this.props.enableFilters,
506
+ filterRange: [1, 1],
507
+ getFilterValue: (d, ctx) => getTrajectoryFilterCategory(d, this.props.mdFilterRange, this.props.formationFilter, this.props.wellNameFilter, ctx),
508
+ getCumulativePathDistance: (d) => d.properties.md[0],
509
+ getTrajectoryPath: (d) => getTrajectory(d, this.props.lineStyle?.color),
510
+ getMarkerColor: this.props.markers?.getMarkerColor,
511
+ getMarkers: (d) => {
512
+ const maxMd = d.properties.md[0]?.at(-1);
428
513
  const { perforations = [], screens = [] } = d.properties;
429
514
  if (maxMd === undefined || maxMd === 0)
430
515
  return [];
431
516
  const markers = [];
432
- if ((_b = this.props.markers) === null || _b === void 0 ? void 0 : _b.showScreens) {
517
+ if (this.props.markers?.showScreens) {
433
518
  markers.push(...screens.flatMap((s) => [
434
519
  {
435
520
  type: "screen-start",
@@ -443,7 +528,7 @@ export default class WellsLayer extends CompositeLayer {
443
528
  },
444
529
  ]));
445
530
  }
446
- if ((_c = this.props.markers) === null || _c === void 0 ? void 0 : _c.showPerforations) {
531
+ if (this.props.markers?.showPerforations) {
447
532
  markers.push(...perforations.map((p) => ({
448
533
  type: "perforation",
449
534
  positionAlongPath: p.md / maxMd,
@@ -451,7 +536,8 @@ export default class WellsLayer extends CompositeLayer {
451
536
  })));
452
537
  }
453
538
  return markers;
454
- } })));
539
+ },
540
+ }));
455
541
  const namesLayer = this.createWellLabelLayer(data.features);
456
542
  const layers = [
457
543
  outlineLayer,
@@ -475,15 +561,14 @@ export default class WellsLayer extends CompositeLayer {
475
561
  return this.getSubLayers().find((l) => l.id === this.getSubLayerId(id));
476
562
  }
477
563
  getPickingInfo({ info }) {
478
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
479
564
  const noLog = {
480
565
  properties: [],
481
566
  logName: "",
482
567
  };
483
- if (!info.object || ((_a = info.sourceLayer) === null || _a === void 0 ? void 0 : _a.constructor) === WellLabelLayer) {
484
- return Object.assign(Object.assign({}, info), noLog);
568
+ if (!info.object || info.sourceLayer?.constructor === WellLabelLayer) {
569
+ return { ...info, ...noLog };
485
570
  }
486
- const features = (_c = (_b = this.getWellDataState()) === null || _b === void 0 ? void 0 : _b.features) !== null && _c !== void 0 ? _c : [];
571
+ const features = this.getWellDataState()?.features ?? [];
487
572
  let coordinate = info.coordinate || [0, 0, 0];
488
573
  const zScale = this.props.modelMatrix ? this.props.modelMatrix[10] : 1;
489
574
  if (coordinate[2] !== undefined) {
@@ -495,58 +580,61 @@ export default class WellsLayer extends CompositeLayer {
495
580
  let log_property = null;
496
581
  let screen_property = null;
497
582
  let perforation_property = null;
498
- if (((_d = info.sourceLayer) === null || _d === void 0 ? void 0 : _d.id) ===
583
+ if (info.sourceLayer?.id ===
499
584
  this.getSubLayerId(SubLayerId.SCREEN_TRAJECTORY)) {
500
585
  const screenIndex = info
501
586
  .dashedSectionIndex;
502
587
  const data = info.object;
503
588
  if (screenIndex !== undefined && screenIndex !== -1) {
504
- const hoveredScreen = (_f = (_e = data.properties) === null || _e === void 0 ? void 0 : _e.screens) === null || _f === void 0 ? void 0 : _f.at(screenIndex);
589
+ const hoveredScreen = data.properties?.screens?.at(screenIndex);
505
590
  screen_property = createScreenReadout(hoveredScreen, data);
506
591
  }
507
592
  }
508
- if (((_g = info.sourceLayer) === null || _g === void 0 ? void 0 : _g.id) === this.getSubLayerId(SubLayerId.MARKERS)) {
593
+ if (info.sourceLayer?.id === this.getSubLayerId(SubLayerId.MARKERS)) {
509
594
  const markerData = info.object;
510
- const wellData = (_h = info.object) === null || _h === void 0 ? void 0 : _h.sourceObject;
595
+ const wellData = info.object?.sourceObject;
511
596
  const sourceIndex = markerData.sourceIndex;
512
597
  // Re-compute index and color to make autohighlight apply to the *trajectory*, instead of the individual marker
513
598
  info.index = sourceIndex;
514
599
  info.color = new Uint8Array(this.getSubLayerById(SubLayerId.SCREEN_TRAJECTORY).encodePickingColor(markerData.sourceIndex));
515
600
  if (markerData.type === "perforation") {
516
601
  const properties = markerData.properties;
517
- wellName = (_j = wellData.properties) === null || _j === void 0 ? void 0 : _j.name;
602
+ wellName = wellData.properties?.name;
518
603
  perforation_property = createPerforationReadout(properties, wellData);
519
604
  // We also include the MD readout here, based on the marker position
520
605
  coordinate = markerData.position;
521
606
  if (coordinate[2] !== undefined) {
522
607
  coordinate[2] /= Math.max(0.001, zScale);
523
608
  }
524
- md_property = getMdProperty(coordinate, wellData, (_k = this.props.lineStyle) === null || _k === void 0 ? void 0 : _k.color, "lines");
525
- tvd_property = getTvdProperty(coordinate, wellData, (_l = this.props.lineStyle) === null || _l === void 0 ? void 0 : _l.color, "lines");
609
+ md_property = getMdProperty(coordinate, wellData, this.props.lineStyle?.color, "lines");
610
+ tvd_property = getTvdProperty(coordinate, wellData, this.props.lineStyle?.color, "lines");
526
611
  }
527
612
  }
528
613
  // ! This needs to be updated if we ever change the sub-layer id!
529
- if (((_m = info.sourceLayer) === null || _m === void 0 ? void 0 : _m.id) === `${this.props.id}-${SubLayerId.LOG_CURVE}`) {
614
+ if (info.sourceLayer?.id === `${this.props.id}-${SubLayerId.LOG_CURVE}`) {
530
615
  // The user is hovering a well log entry
531
616
  const logPick = info;
532
- wellName = (_p = (_o = logPick.object) === null || _o === void 0 ? void 0 : _o.header) === null || _p === void 0 ? void 0 : _p.well;
617
+ wellName = logPick.object?.header?.well;
533
618
  md_property = getLogProperty(coordinate, features, logPick.object, this.props.logrunName, "MD");
534
619
  tvd_property = getLogProperty(coordinate, features, logPick.object, this.props.logrunName, "TVD");
535
620
  log_property = getLogProperty(coordinate, features, info.object, this.props.logrunName, this.props.logName);
536
621
  }
537
- else if (((_q = info.sourceLayer) === null || _q === void 0 ? void 0 : _q.id) ===
622
+ else if (info.sourceLayer?.id ===
538
623
  this.getSubLayerProps({ id: SubLayerId.COLORS }).id ||
539
- ((_r = info.sourceLayer) === null || _r === void 0 ? void 0 : _r.id) ===
624
+ info.sourceLayer?.id ===
540
625
  this.getSubLayerProps({ id: SubLayerId.SCREEN_TRAJECTORY }).id) {
541
626
  // User is hovering a wellbore path
542
627
  const wellpickInfo = info;
543
- wellName = (_t = (_s = wellpickInfo.object) === null || _s === void 0 ? void 0 : _s.properties) === null || _t === void 0 ? void 0 : _t.name;
544
- md_property = getMdProperty(coordinate, wellpickInfo.object, (_u = this.props.lineStyle) === null || _u === void 0 ? void 0 : _u.color, info.featureType);
545
- tvd_property = getTvdProperty(coordinate, info.object, (_v = this.props.lineStyle) === null || _v === void 0 ? void 0 : _v.color, info.featureType);
628
+ wellName = wellpickInfo.object?.properties?.name;
629
+ md_property = getMdProperty(coordinate, wellpickInfo.object, this.props.lineStyle?.color, info.featureType);
630
+ tvd_property = getTvdProperty(coordinate, info.object, this.props.lineStyle?.color, info.featureType);
546
631
  }
547
632
  // Patch for inverting tvd readout to fix issue #830,
548
633
  // should make proper fix when handling z increase direction - issue #842
549
- const inverted_tvd_property = tvd_property && Object.assign(Object.assign({}, tvd_property), { value: (tvd_property === null || tvd_property === void 0 ? void 0 : tvd_property.value) * -1 });
634
+ const inverted_tvd_property = tvd_property && {
635
+ ...tvd_property,
636
+ value: tvd_property?.value * -1,
637
+ };
550
638
  const layer_properties = [];
551
639
  if (md_property)
552
640
  layer_properties.push(md_property);
@@ -558,11 +646,19 @@ export default class WellsLayer extends CompositeLayer {
558
646
  layer_properties.push(screen_property);
559
647
  if (perforation_property)
560
648
  layer_properties.push(perforation_property);
561
- return Object.assign(Object.assign({}, info), { properties: layer_properties, logName: log_property === null || log_property === void 0 ? void 0 : log_property.name, wellName: wellName });
649
+ return {
650
+ ...info,
651
+ properties: layer_properties,
652
+ logName: log_property?.name,
653
+ wellName: wellName,
654
+ };
562
655
  }
563
656
  }
564
657
  WellsLayer.layerName = "WellsLayer";
565
- WellsLayer.defaultProps = Object.assign(Object.assign({}, defaultProps), { onDataLoad: (data, context) => onDataLoad(data, context) });
658
+ WellsLayer.defaultProps = {
659
+ ...defaultProps,
660
+ onDataLoad: (data, context) => onDataLoad(data, context),
661
+ };
566
662
  //================= Local help functions. ==================
567
663
  function onDataLoad(data, context) {
568
664
  const bbox = GetBoundingBox(data);
@@ -573,9 +669,8 @@ function onDataLoad(data, context) {
573
669
  // Create a dash accessor function that scales
574
670
  function getDashFactor(accessor, widthAccessor, offset = 0) {
575
671
  return (object, ctx) => {
576
- var _a;
577
672
  const dashValue = getFromAccessor(accessor, object, ctx);
578
- const width = (_a = getFromAccessor(widthAccessor, object, ctx)) !== null && _a !== void 0 ? _a : DEFAULT_LINE_WIDTH;
673
+ const width = getFromAccessor(widthAccessor, object, ctx) ?? DEFAULT_LINE_WIDTH;
579
674
  const factor = width / (width + offset);
580
675
  let dashArray = [0, 0];
581
676
  if (dashValue && Array.isArray(dashValue)) {
@@ -592,33 +687,32 @@ function dataIsReady(layerData) {
592
687
  return !!layerData && !isEmpty(layerData);
593
688
  }
594
689
  function getMdProperty(coord, feature, accessor, featureType) {
595
- var _a, _b;
596
690
  if (featureType === "points") {
597
691
  return null;
598
692
  }
599
693
  const md = getMd(coord, feature, accessor);
600
694
  if (md != null) {
601
- const prop_name = "MD " + ((_a = feature.properties) === null || _a === void 0 ? void 0 : _a["name"]);
602
- return createPropertyData(prop_name, md, (_b = feature.properties) === null || _b === void 0 ? void 0 : _b["color"]);
695
+ const prop_name = "MD " + feature.properties?.["name"];
696
+ return createPropertyData(prop_name, md, feature.properties?.["color"]);
603
697
  }
604
698
  return null;
605
699
  }
606
700
  function getTvdProperty(coord, feature, accessor, featureType) {
607
- var _a, _b;
608
701
  if (featureType === "points") {
609
702
  return null;
610
703
  }
611
704
  const tvd = getTvd(coord, feature, accessor);
612
705
  if (tvd != null) {
613
- const prop_name = "TVD " + ((_a = feature.properties) === null || _a === void 0 ? void 0 : _a["name"]);
614
- return createPropertyData(prop_name, tvd, (_b = feature.properties) === null || _b === void 0 ? void 0 : _b["color"]);
706
+ const prop_name = "TVD " + feature.properties?.["name"];
707
+ return createPropertyData(prop_name, tvd, feature.properties?.["color"]);
615
708
  }
616
709
  return null;
617
710
  }
618
711
  // Injects MD points that will be required for cutting trajectories at the correct points
619
712
  function injectMdPointsForFilter(data, mdFilterRange) {
620
- return Object.assign(Object.assign({}, data), { features: data.features.map((feature, index) => {
621
- var _a;
713
+ return {
714
+ ...data,
715
+ features: data.features.map((feature, index) => {
622
716
  const { formations } = feature.properties;
623
717
  const itemInfo = {
624
718
  data: data.features,
@@ -628,14 +722,15 @@ function injectMdPointsForFilter(data, mdFilterRange) {
628
722
  const rangeMds = getFromAccessor(mdFilterRange, feature, itemInfo)
629
723
  .flat()
630
724
  .filter((i) => i !== -1);
631
- const formationMds = (_a = formations === null || formations === void 0 ? void 0 : formations.flatMap((f) => [f.mdEnter, f.mdExit])) !== null && _a !== void 0 ? _a : [];
725
+ const formationMds = formations?.flatMap((f) => [f.mdEnter, f.mdExit]) ?? [];
632
726
  const allRequiredMds = _.chain([...formationMds, ...rangeMds])
633
727
  .sort((a, b) => a - b)
634
728
  .uniq()
635
729
  .value();
636
730
  const newFeature = injectMdPoints(feature, ...allRequiredMds);
637
731
  return newFeature;
638
- }) });
732
+ }),
733
+ };
639
734
  }
640
735
  function getTrajectoryFilterCategory(feature, mdFilterRangeAccessor, formationFilterAccessor, wellNameFilter, itemInfo) {
641
736
  const mdFilterRange = getFromAccessor(mdFilterRangeAccessor, feature, itemInfo);
@@ -654,7 +749,6 @@ function getTrajectoryFilterCategory(feature, mdFilterRangeAccessor, formationFi
654
749
  if (!formationFilter.length && !sanitizedMdFilterBands.length)
655
750
  return 1;
656
751
  return mdArr.map((md) => {
657
- var _a;
658
752
  const mdIsValid = !sanitizedMdFilterBands.length ||
659
753
  sanitizedMdFilterBands.some((band) => {
660
754
  if (isClose(md, band[0]))
@@ -663,9 +757,9 @@ function getTrajectoryFilterCategory(feature, mdFilterRangeAccessor, formationFi
663
757
  return false;
664
758
  return md >= band[0] && md < band[1];
665
759
  });
666
- const formation = formations === null || formations === void 0 ? void 0 : formations.find((seg) => seg.mdEnter <= md && seg.mdExit > md);
667
- const formationIsValid = !(formationFilter === null || formationFilter === void 0 ? void 0 : formationFilter.length) ||
668
- formationFilter.includes((_a = formation === null || formation === void 0 ? void 0 : formation.name) !== null && _a !== void 0 ? _a : "");
760
+ const formation = formations?.find((seg) => seg.mdEnter <= md && seg.mdExit > md);
761
+ const formationIsValid = !formationFilter?.length ||
762
+ formationFilter.includes(formation?.name ?? "");
669
763
  return Number(mdIsValid && formationIsValid);
670
764
  });
671
765
  }