@webviz/well-log-viewer 2.8.4 → 2.8.5

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 (59) hide show
  1. package/dist/SyncLogViewer.js +54 -58
  2. package/dist/SyncLogViewer.js.map +1 -1
  3. package/dist/WellLogViewer.js +22 -29
  4. package/dist/WellLogViewer.js.map +1 -1
  5. package/dist/components/CallbackManager.js +15 -2
  6. package/dist/components/CallbackManager.js.map +1 -1
  7. package/dist/components/CommonPropTypes.js +11 -2
  8. package/dist/components/CommonPropTypes.js.map +1 -1
  9. package/dist/components/DefaultSyncLogViewerLayout.js +3 -7
  10. package/dist/components/DefaultSyncLogViewerLayout.js.map +1 -1
  11. package/dist/components/DefaultWellLogViewerLayout.js +1 -2
  12. package/dist/components/DefaultWellLogViewerLayout.js.map +1 -1
  13. package/dist/components/InfoPanel.js +2 -2
  14. package/dist/components/InfoPanel.js.map +1 -1
  15. package/dist/components/LocalMenus.js +1 -2
  16. package/dist/components/LocalMenus.js.map +1 -1
  17. package/dist/components/PlotDialog.js +25 -22
  18. package/dist/components/PlotDialog.js.map +1 -1
  19. package/dist/components/ScaleSelector.js +1 -2
  20. package/dist/components/ScaleSelector.js.map +1 -1
  21. package/dist/components/Scroller.js +5 -2
  22. package/dist/components/Scroller.js.map +1 -1
  23. package/dist/components/TrackDialog.js +34 -17
  24. package/dist/components/TrackDialog.js.map +1 -1
  25. package/dist/components/WellLogAxesPanel.js +6 -7
  26. package/dist/components/WellLogAxesPanel.js.map +1 -1
  27. package/dist/components/WellLogInfoPanel.js +2 -0
  28. package/dist/components/WellLogInfoPanel.js.map +1 -1
  29. package/dist/components/WellLogScaleSelector.js +2 -2
  30. package/dist/components/WellLogScaleSelector.js.map +1 -1
  31. package/dist/components/WellLogSpacer.js +46 -54
  32. package/dist/components/WellLogSpacer.js.map +1 -1
  33. package/dist/components/WellLogView.js +90 -100
  34. package/dist/components/WellLogView.js.map +1 -1
  35. package/dist/components/WellLogViewWithScroller.js +12 -13
  36. package/dist/components/WellLogViewWithScroller.js.map +1 -1
  37. package/dist/components/WellLogZoomSlider.js +4 -5
  38. package/dist/components/WellLogZoomSlider.js.map +1 -1
  39. package/dist/components/ZoomSlider.js +1 -1
  40. package/dist/components/ZoomSlider.js.map +1 -1
  41. package/dist/utils/arrays.js +1 -2
  42. package/dist/utils/arrays.js.map +1 -1
  43. package/dist/utils/color-table.js +3 -4
  44. package/dist/utils/color-table.js.map +1 -1
  45. package/dist/utils/fill-info.js +3 -4
  46. package/dist/utils/fill-info.js.map +1 -1
  47. package/dist/utils/log-viewer.js +4 -8
  48. package/dist/utils/log-viewer.js.map +1 -1
  49. package/dist/utils/plots.js +67 -79
  50. package/dist/utils/plots.js.map +1 -1
  51. package/dist/utils/template.js +9 -8
  52. package/dist/utils/template.js.map +1 -1
  53. package/dist/utils/trackFactory.js +8 -2
  54. package/dist/utils/trackFactory.js.map +1 -1
  55. package/dist/utils/tracks.js +34 -29
  56. package/dist/utils/tracks.js.map +1 -1
  57. package/dist/utils/well-log.js +4 -7
  58. package/dist/utils/well-log.js.map +1 -1
  59. package/package.json +2 -2
@@ -104,9 +104,8 @@ function addReadoutOverlay(instance, parent) {
104
104
  const horizontal = parent.props.horizontal;
105
105
  const elm = instance.overlay.create("depth", {
106
106
  onClick: (event) => {
107
- var _a, _b;
108
- if (((_a = parent.props.options) === null || _a === void 0 ? void 0 : _a.hideCurrentPosition) ||
109
- ((_b = parent.props.options) === null || _b === void 0 ? void 0 : _b.hideSelectionInterval))
107
+ if (parent.props.options?.hideCurrentPosition ||
108
+ parent.props.options?.hideSelectionInterval)
110
109
  return;
111
110
  const { caller, x, y } = event;
112
111
  const value = caller.scale.invert(horizontal ? x : y);
@@ -174,7 +173,6 @@ function addPinnedValueOverlay(instance, parent) {
174
173
  const horizontal = parent.props.horizontal;
175
174
  const pinelm = instance.overlay.create("pinned", {
176
175
  onClick: (event) => {
177
- var _a;
178
176
  const v = horizontal ? event.x : event.y;
179
177
  const pinelm = event.target;
180
178
  if (pinelm) {
@@ -193,7 +191,7 @@ function addPinnedValueOverlay(instance, parent) {
193
191
  else {
194
192
  parent.selPinned = instance.scale.invert(v);
195
193
  if (parent.selCurrent === undefined &&
196
- !((_a = parent.props.options) === null || _a === void 0 ? void 0 : _a.hideCurrentPosition))
194
+ !parent.props.options?.hideCurrentPosition)
197
195
  parent.selCurrent = parent.selPinned;
198
196
  const rbelm = instance.overlay.elements["rubber-band"];
199
197
  if (rbelm && pinelm) {
@@ -279,7 +277,6 @@ function _getLogIndexByNames(curves, names) {
279
277
  return -1;
280
278
  }
281
279
  export function getWellPicks(wellLogView) {
282
- var _a;
283
280
  const wps = [];
284
281
  const wellpick = wellLogView.props.wellpick;
285
282
  if (!wellpick)
@@ -289,7 +286,7 @@ export function getWellPicks(wellLogView) {
289
286
  return wps;
290
287
  }
291
288
  const curves = wellpick.wellpick.curves;
292
- const mnemo = (_a = wellpick.md) !== null && _a !== void 0 ? _a : "MD";
289
+ const mnemo = wellpick.md ?? "MD";
293
290
  const md = _getLogIndexByNames(curves, [mnemo]);
294
291
  if (md < 0) {
295
292
  console.error("Depth log '" + mnemo + "' is not found for wellpicks");
@@ -310,8 +307,8 @@ export function getWellPicks(wellLogView) {
310
307
  if (horizon === null || horizon === undefined)
311
308
  continue;
312
309
  const vMD = d[md];
313
- const vPrimary = primaryAxis === "md" ? vMD : scaleInterpolator === null || scaleInterpolator === void 0 ? void 0 : scaleInterpolator.forward(vMD);
314
- const vSecondary = primaryAxis === "md" ? scaleInterpolator === null || scaleInterpolator === void 0 ? void 0 : scaleInterpolator.reverse(vMD) : vMD;
310
+ const vPrimary = primaryAxis === "md" ? vMD : scaleInterpolator?.forward(vMD);
311
+ const vSecondary = primaryAxis === "md" ? scaleInterpolator?.reverse(vMD) : vMD;
315
312
  const colormapFunction = wellpick.colorMapFunctions.find((colormapFunction) => colormapFunction.name === wellpick.colorMapFunctionName);
316
313
  const meta = getDiscreteMeta(wellpick.wellpick, wellpick.name);
317
314
  const { color } = getDiscreteColorAndName(d[c], colormapFunction, meta);
@@ -359,7 +356,6 @@ function posWellPickTitles(instance, parent) {
359
356
  }
360
357
  }
361
358
  function addWellPickOverlay(instance, parent) {
362
- var _a, _b;
363
359
  {
364
360
  /* clear old wellpicks */
365
361
  for (const elmName in instance.overlay.elements) {
@@ -376,12 +372,12 @@ function addWellPickOverlay(instance, parent) {
376
372
  return;
377
373
  //const primaryAxis = parent.props.primaryAxis;
378
374
  const horizontal = parent.props.horizontal;
379
- const wellpickColorFill = (_a = parent.props.options) === null || _a === void 0 ? void 0 : _a.wellpickColorFill;
375
+ const wellpickColorFill = parent.props.options?.wellpickColorFill;
380
376
  const patternsTable = parent.props.patternsTable;
381
377
  const patterns = parent.props.patterns;
382
- const wellpickPatternFill = patternsTable && patterns && ((_b = parent.props.options) === null || _b === void 0 ? void 0 : _b.wellpickPatternFill);
383
- const patternSize = patternsTable === null || patternsTable === void 0 ? void 0 : patternsTable.patternSize;
384
- const patternImages = patternsTable === null || patternsTable === void 0 ? void 0 : patternsTable.patternImages;
378
+ const wellpickPatternFill = patternsTable && patterns && parent.props.options?.wellpickPatternFill;
379
+ const patternSize = patternsTable?.patternSize;
380
+ const patternImages = patternsTable?.patternImages;
385
381
  for (const wp of wps) {
386
382
  const horizon = wp.horizon;
387
383
  const vPrimary = wp.vPrimary;
@@ -389,10 +385,10 @@ function addWellPickOverlay(instance, parent) {
389
385
  const color = wp.color;
390
386
  const txtPrimary = !Number.isFinite(vPrimary)
391
387
  ? ""
392
- : vPrimary === null || vPrimary === void 0 ? void 0 : vPrimary.toFixed(0);
388
+ : vPrimary?.toFixed(0);
393
389
  const txtSecondary = !Number.isFinite(vSecondary)
394
390
  ? ""
395
- : /*(primaryAxis === "md" ? "TVD:" : "MD:") +*/ vSecondary === null || vSecondary === void 0 ? void 0 : vSecondary.toFixed(0);
391
+ : /*(primaryAxis === "md" ? "TVD:" : "MD:") +*/ vSecondary?.toFixed(0);
396
392
  const elmName = "wp" + horizon;
397
393
  const pinelm = instance.overlay.create(elmName, {});
398
394
  const rgba = "rgba(" + color[0] + "," + color[1] + "," + color[2] + ",0.8)";
@@ -561,7 +557,6 @@ function addPlot(parent, wellLogView, track) {
561
557
  createRoot(el).render(React.createElement(PlotPropertiesDialog, { wellLogView: wellLogView, track: track, onOK: wellLogView.addTrackPlot.bind(wellLogView, track) }));
562
558
  }
563
559
  function fillPlotTemplate(templateTrack, plot) {
564
- var _a, _b, _c, _d;
565
560
  const options = plot.options;
566
561
  const optionsDifferential = plot.options; // DifferentialPlot - 2 series!
567
562
  const options1 = optionsDifferential.serie1;
@@ -570,7 +565,7 @@ function fillPlotTemplate(templateTrack, plot) {
570
565
  const legendDifferential = legend; // DifferentialPlot - 2 series!
571
566
  const legend1 = legendDifferential.serie1;
572
567
  const legend2 = legendDifferential.serie2;
573
- const scale = (templateTrack === null || templateTrack === void 0 ? void 0 : templateTrack.scale) !== options.scale ? options.scale : undefined;
568
+ const scale = templateTrack?.scale !== options.scale ? options.scale : undefined;
574
569
  return {
575
570
  style: undefined, // No style for this full Plot options.
576
571
  type: getPlotType(plot),
@@ -582,8 +577,8 @@ function fillPlotTemplate(templateTrack, plot) {
582
577
  inverseColor: options.inverseColor || "",
583
578
  fill: (options1 ? options1.fill : options.fill) || "",
584
579
  fill2: options2 ? options2.fill : "",
585
- colorMapFunctionName: (_b = (_a = options.colorMapFunction) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : "",
586
- inverseColorMapFunctionName: (_d = (_c = options.inverseColorMapFunction) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : "",
580
+ colorMapFunctionName: options.colorMapFunction?.name ?? "",
581
+ inverseColorMapFunctionName: options.inverseColorMapFunction?.name ?? "",
587
582
  colorScale: options.colorScale,
588
583
  inverseColorScale: options.inverseColorScale,
589
584
  };
@@ -615,8 +610,8 @@ export function getContentBaseScale(controller, horizontal) {
615
610
  const wellLogView = controller;
616
611
  const logController = wellLogView.logController;
617
612
  if (logController) {
618
- const overlay = logController === null || logController === void 0 ? void 0 : logController.overlay;
619
- const source = overlay === null || overlay === void 0 ? void 0 : overlay.elm.node();
613
+ const overlay = logController?.overlay;
614
+ const source = overlay?.elm.node();
620
615
  if (source) {
621
616
  const clientSize = horizontal
622
617
  ? source.clientWidth
@@ -688,7 +683,6 @@ export const argTypesWellLogViewProp = {
688
683
  // callbacks...
689
684
  };
690
685
  export function shouldUpdateWellLogView(props, nextProps) {
691
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
692
686
  // Props could contain some unknown object key:value so we should ignore they
693
687
  // so compare only known key:values
694
688
  if (props.horizontal !== nextProps.horizontal)
@@ -715,31 +709,44 @@ export function shouldUpdateWellLogView(props, nextProps) {
715
709
  return true;
716
710
  if (!isEqualRanges(props.selection, nextProps.selection))
717
711
  return true;
718
- if (((_a = props.options) === null || _a === void 0 ? void 0 : _a.hideTrackTitle) !== ((_b = nextProps.options) === null || _b === void 0 ? void 0 : _b.hideTrackTitle))
712
+ if (props.options?.hideTrackTitle !== nextProps.options?.hideTrackTitle)
719
713
  return true;
720
- if (((_c = props.options) === null || _c === void 0 ? void 0 : _c.hideTrackLegend) !== ((_d = nextProps.options) === null || _d === void 0 ? void 0 : _d.hideTrackLegend))
714
+ if (props.options?.hideTrackLegend !== nextProps.options?.hideTrackLegend)
721
715
  return true;
722
- if (((_e = props.options) === null || _e === void 0 ? void 0 : _e.maxVisibleTrackNum) !==
723
- ((_f = nextProps.options) === null || _f === void 0 ? void 0 : _f.maxVisibleTrackNum))
716
+ if (props.options?.maxVisibleTrackNum !==
717
+ nextProps.options?.maxVisibleTrackNum)
724
718
  return true;
725
- if (((_g = props.options) === null || _g === void 0 ? void 0 : _g.maxContentZoom) !== ((_h = nextProps.options) === null || _h === void 0 ? void 0 : _h.maxContentZoom))
719
+ if (props.options?.maxContentZoom !== nextProps.options?.maxContentZoom)
726
720
  return true;
727
- if (((_j = props.options) === null || _j === void 0 ? void 0 : _j.checkDatafileSchema) !==
728
- ((_k = nextProps.options) === null || _k === void 0 ? void 0 : _k.checkDatafileSchema))
721
+ if (props.options?.checkDatafileSchema !==
722
+ nextProps.options?.checkDatafileSchema)
729
723
  return true;
730
- if (((_l = props.options) === null || _l === void 0 ? void 0 : _l.wellpickColorFill) !==
731
- ((_m = nextProps.options) === null || _m === void 0 ? void 0 : _m.wellpickColorFill))
724
+ if (props.options?.wellpickColorFill !==
725
+ nextProps.options?.wellpickColorFill)
732
726
  return true;
733
- if (((_o = props.options) === null || _o === void 0 ? void 0 : _o.wellpickPatternFill) !==
734
- ((_p = nextProps.options) === null || _p === void 0 ? void 0 : _p.wellpickPatternFill))
727
+ if (props.options?.wellpickPatternFill !==
728
+ nextProps.options?.wellpickPatternFill)
735
729
  return true;
736
730
  // callbacks
737
731
  // ignore all?
738
732
  return false;
739
733
  }
740
734
  class WellLogView extends Component {
735
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
736
+ static propTypes;
737
+ wellLogSets;
738
+ container;
739
+ title;
740
+ resizeObserver;
741
+ logController;
742
+ selCurrent; // current mouse position
743
+ selPinned; // pinned position
744
+ selPersistent;
745
+ isDefZoom;
746
+ template;
747
+ scaleInterpolator;
748
+ _isMount;
741
749
  constructor(props) {
742
- var _a, _b;
743
750
  super(props);
744
751
  this.wellLogSets = getWellLogSetsFromProps(props);
745
752
  this.container = undefined;
@@ -775,7 +782,7 @@ class WellLogView extends Component {
775
782
  };
776
783
  this.onTrackMouseEvent = this.onTrackMouseEvent.bind(this);
777
784
  // set callback to component's caller
778
- (_b = (_a = this.props).onCreateController) === null || _b === void 0 ? void 0 : _b.call(_a, this);
785
+ this.props.onCreateController?.(this);
779
786
  this._isMount = false;
780
787
  }
781
788
  componentDidMount() {
@@ -799,23 +806,22 @@ class WellLogView extends Component {
799
806
  return false;
800
807
  }
801
808
  componentDidUpdate(prevProps, prevState) {
802
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
803
809
  // Typical usage (don't forget to compare props):
804
810
  if (this.props.onCreateController !== prevProps.onCreateController) {
805
811
  // update callback to component's caller
806
- (_b = (_a = this.props).onCreateController) === null || _b === void 0 ? void 0 : _b.call(_a, this);
812
+ this.props.onCreateController?.(this);
807
813
  }
808
814
  let selectedTrackIndices = []; // Indices to restore
809
815
  let selection = undefined; // content selection to restore
810
816
  let shouldSetTracks = false;
811
817
  let checkSchema = false;
812
818
  if (this.props.horizontal !== prevProps.horizontal ||
813
- ((_c = this.props.options) === null || _c === void 0 ? void 0 : _c.hideTrackTitle) !==
814
- ((_d = prevProps.options) === null || _d === void 0 ? void 0 : _d.hideTrackTitle) ||
815
- ((_e = this.props.options) === null || _e === void 0 ? void 0 : _e.hideTrackLegend) !==
816
- ((_f = prevProps.options) === null || _f === void 0 ? void 0 : _f.hideTrackLegend) ||
817
- ((_g = this.props.options) === null || _g === void 0 ? void 0 : _g.maxContentZoom) !==
818
- ((_h = prevProps.options) === null || _h === void 0 ? void 0 : _h.maxContentZoom)) {
819
+ this.props.options?.hideTrackTitle !==
820
+ prevProps.options?.hideTrackTitle ||
821
+ this.props.options?.hideTrackLegend !==
822
+ prevProps.options?.hideTrackLegend ||
823
+ this.props.options?.maxContentZoom !==
824
+ prevProps.options?.maxContentZoom) {
819
825
  selection = this.getContentSelection();
820
826
  selectedTrackIndices = this.getSelectedTrackIndices();
821
827
  this.createLogViewer();
@@ -823,8 +829,8 @@ class WellLogView extends Component {
823
829
  }
824
830
  if (this.props.welllog !== prevProps.welllog ||
825
831
  this.props.wellLogSets !== prevProps.wellLogSets ||
826
- ((_j = this.props.options) === null || _j === void 0 ? void 0 : _j.checkDatafileSchema) !==
827
- ((_k = prevProps.options) === null || _k === void 0 ? void 0 : _k.checkDatafileSchema)) {
832
+ this.props.options?.checkDatafileSchema !==
833
+ prevProps.options?.checkDatafileSchema) {
828
834
  selection = this.props.selection;
829
835
  selectedTrackIndices = this.getSelectedTrackIndices();
830
836
  shouldSetTracks = true;
@@ -853,10 +859,10 @@ class WellLogView extends Component {
853
859
  shouldSetTracks = true; //??
854
860
  }
855
861
  if (this.props.wellpick !== prevProps.wellpick ||
856
- ((_l = this.props.options) === null || _l === void 0 ? void 0 : _l.wellpickPatternFill) !==
857
- ((_m = prevProps.options) === null || _m === void 0 ? void 0 : _m.wellpickPatternFill) ||
858
- ((_o = this.props.options) === null || _o === void 0 ? void 0 : _o.wellpickColorFill) !==
859
- ((_p = prevProps.options) === null || _p === void 0 ? void 0 : _p.wellpickColorFill)) {
862
+ this.props.options?.wellpickPatternFill !==
863
+ prevProps.options?.wellpickPatternFill ||
864
+ this.props.options?.wellpickColorFill !==
865
+ prevProps.options?.wellpickColorFill) {
860
866
  if (this.logController) {
861
867
  addWellPickOverlay(this.logController, this);
862
868
  this.showSelection();
@@ -870,8 +876,8 @@ class WellLogView extends Component {
870
876
  this.selectContent(selection);
871
877
  }
872
878
  else if (this.state.scrollTrackPos !== prevState.scrollTrackPos ||
873
- ((_q = this.props.options) === null || _q === void 0 ? void 0 : _q.maxVisibleTrackNum) !==
874
- ((_r = prevProps.options) === null || _r === void 0 ? void 0 : _r.maxVisibleTrackNum)) {
879
+ this.props.options?.maxVisibleTrackNum !==
880
+ prevProps.options?.maxVisibleTrackNum) {
875
881
  this.onTrackScroll();
876
882
  this.onTrackSelection();
877
883
  this.updateInfo();
@@ -890,7 +896,6 @@ class WellLogView extends Component {
890
896
  }
891
897
  }
892
898
  createLogViewer() {
893
- var _a, _b, _c;
894
899
  this.selPersistent = undefined;
895
900
  if (this.logController) {
896
901
  // remove old LogViewer
@@ -903,9 +908,9 @@ class WellLogView extends Component {
903
908
  // create new LogViewer
904
909
  this.logController = new LogViewer({
905
910
  horizontal: this.props.horizontal,
906
- showTitles: !((_a = this.props.options) === null || _a === void 0 ? void 0 : _a.hideTrackTitle),
907
- showLegend: !((_b = this.props.options) === null || _b === void 0 ? void 0 : _b.hideTrackLegend),
908
- maxZoom: (_c = this.props.options) === null || _c === void 0 ? void 0 : _c.maxContentZoom,
911
+ showTitles: !this.props.options?.hideTrackTitle,
912
+ showLegend: !this.props.options?.hideTrackLegend,
913
+ maxZoom: this.props.options?.maxContentZoom,
909
914
  onTrackEnter: (elm, track) => addTrackMouseEventHandlers(elm, track, this.onTrackMouseEvent),
910
915
  });
911
916
  this.logController.init(this.container);
@@ -933,13 +938,12 @@ class WellLogView extends Component {
933
938
  };
934
939
  }
935
940
  setTracks(checkSchema) {
936
- var _a;
937
941
  this.selCurrent = this.selPinned = undefined; // clear old selection (primary scale could be changed)
938
942
  if (checkSchema) {
939
943
  //check against the json schema
940
944
  try {
941
945
  validateSchema(this.template, "WellLogTemplate");
942
- if ((_a = this.props.options) === null || _a === void 0 ? void 0 : _a.checkDatafileSchema) {
946
+ if (this.props.options?.checkDatafileSchema) {
943
947
  this.wellLogSets.forEach((wellLogSet) => validateSchema(wellLogSet, "WellLog"));
944
948
  }
945
949
  }
@@ -961,8 +965,7 @@ class WellLogView extends Component {
961
965
  this.updateInfo(); // Clear old track information
962
966
  }
963
967
  findTrackById(trackId) {
964
- var _a;
965
- return (_a = this.logController) === null || _a === void 0 ? void 0 : _a.tracks.find(function (track) {
968
+ return this.logController?.tracks.find(function (track) {
966
969
  return track.id === trackId;
967
970
  });
968
971
  }
@@ -985,16 +988,14 @@ class WellLogView extends Component {
985
988
  Display current state of track scrolling
986
989
  */
987
990
  onTrackScroll() {
988
- var _a, _b;
989
991
  const iFrom = this.getTrackScrollPos();
990
992
  const iTo = iFrom + this._maxVisibleTrackNum();
991
993
  if (this.logController)
992
994
  scrollTracksTo(this.logController, iFrom, iTo);
993
- (_b = (_a = this.props).onTrackScroll) === null || _b === void 0 ? void 0 : _b.call(_a);
995
+ this.props.onTrackScroll?.();
994
996
  }
995
997
  onTrackSelection() {
996
- var _a, _b;
997
- (_b = (_a = this.props).onTrackSelection) === null || _b === void 0 ? void 0 : _b.call(_a);
998
+ this.props.onTrackSelection?.();
998
999
  }
999
1000
  setInfo(x = Number.NaN) {
1000
1001
  if (!this.props.onInfo)
@@ -1008,28 +1009,23 @@ class WellLogView extends Component {
1008
1009
  this.props.onInfo(x, this.logController, iFrom, iTo);
1009
1010
  }
1010
1011
  onContentRescale() {
1011
- var _a, _b;
1012
1012
  this.showSelection();
1013
- (_b = (_a = this.props).onContentRescale) === null || _b === void 0 ? void 0 : _b.call(_a);
1013
+ this.props.onContentRescale?.();
1014
1014
  }
1015
1015
  onContentSelection() {
1016
- var _a, _b;
1017
1016
  this.showSelection();
1018
- (_b = (_a = this.props).onContentSelection) === null || _b === void 0 ? void 0 : _b.call(_a);
1017
+ this.props.onContentSelection?.();
1019
1018
  }
1020
1019
  onTrackMouseEvent(ev) {
1021
- var _a, _b;
1022
- (_b = (_a = this.props).onTrackMouseEvent) === null || _b === void 0 ? void 0 : _b.call(_a, this, ev);
1020
+ this.props.onTrackMouseEvent?.(this, ev);
1023
1021
  }
1024
1022
  onTrackMouseLeaveEvent() {
1025
- var _a, _b;
1026
- (_b = (_a = this.props).onTrackMouseLeaveEvent) === null || _b === void 0 ? void 0 : _b.call(_a);
1023
+ this.props.onTrackMouseLeaveEvent?.();
1027
1024
  }
1028
1025
  onTemplateChanged(noEmit) {
1029
- var _a, _b;
1030
1026
  this.updateInfo();
1031
1027
  if (!noEmit)
1032
- (_b = (_a = this.props).onTemplateChanged) === null || _b === void 0 ? void 0 : _b.call(_a);
1028
+ this.props.onTemplateChanged?.();
1033
1029
  }
1034
1030
  // content
1035
1031
  zoomContentTo(domain) {
@@ -1052,12 +1048,11 @@ class WellLogView extends Component {
1052
1048
  return zoomContent(this.logController, zoom);
1053
1049
  }
1054
1050
  showSelection() {
1055
- var _a, _b;
1056
1051
  if (!this.logController)
1057
1052
  return;
1058
- if ((_a = this.props.options) === null || _a === void 0 ? void 0 : _a.hideCurrentPosition)
1053
+ if (this.props.options?.hideCurrentPosition)
1059
1054
  this.selCurrent = undefined;
1060
- if ((_b = this.props.options) === null || _b === void 0 ? void 0 : _b.hideSelectionInterval)
1055
+ if (this.props.options?.hideSelectionInterval)
1061
1056
  this.selPinned = undefined;
1062
1057
  const horizontal = this.props.horizontal;
1063
1058
  const elements = this.logController.overlay.elements;
@@ -1089,7 +1084,7 @@ class WellLogView extends Component {
1089
1084
  const pinelm1 = elements[elmName1];
1090
1085
  if (pinelm1) {
1091
1086
  const wp2 = wps[i + 1];
1092
- const vPrimary2 = wp2 === null || wp2 === void 0 ? void 0 : wp2.vPrimary;
1087
+ const vPrimary2 = wp2?.vPrimary;
1093
1088
  fillWellPicks(pinelm1, vPrimary, vPrimary2, horizontal, this.logController);
1094
1089
  }
1095
1090
  }
@@ -1159,9 +1154,8 @@ class WellLogView extends Component {
1159
1154
  return newPos;
1160
1155
  }
1161
1156
  _maxVisibleTrackNum() {
1162
- var _a, _b;
1163
- if ((_a = this.props.options) === null || _a === void 0 ? void 0 : _a.maxVisibleTrackNum)
1164
- return (_b = this.props.options) === null || _b === void 0 ? void 0 : _b.maxVisibleTrackNum;
1157
+ if (this.props.options?.maxVisibleTrackNum)
1158
+ return this.props.options?.maxVisibleTrackNum;
1165
1159
  return this.props.horizontal ? 3 : 5 /*some default value*/;
1166
1160
  }
1167
1161
  _forceUpdateTitleTooltips() {
@@ -1175,9 +1169,8 @@ class WellLogView extends Component {
1175
1169
  }
1176
1170
  }
1177
1171
  _updateWellLogTitle() {
1178
- var _a, _b;
1179
1172
  if (this.title && this.props.viewTitle === true) {
1180
- this.title.textContent = (_b = (_a = this.wellLogSets[0]) === null || _a === void 0 ? void 0 : _a.header.well) !== null && _b !== void 0 ? _b : null;
1173
+ this.title.textContent = this.wellLogSets[0]?.header.well ?? null;
1181
1174
  }
1182
1175
  }
1183
1176
  scrollTrackBy(delta) {
@@ -1224,8 +1217,7 @@ class WellLogView extends Component {
1224
1217
  * @deprecated Use getWellLogSets instead
1225
1218
  */
1226
1219
  getWellLog() {
1227
- var _a;
1228
- return (_a = this.props.wellLogSets) !== null && _a !== void 0 ? _a : this.props.welllog;
1220
+ return this.props.wellLogSets ?? this.props.welllog;
1229
1221
  }
1230
1222
  getWellLogSets() {
1231
1223
  if (this.props.wellLogSets)
@@ -1240,7 +1232,11 @@ class WellLogView extends Component {
1240
1232
  return this.template;
1241
1233
  }
1242
1234
  getStyledTemplate() {
1243
- return Object.assign(Object.assign({}, this.template), { tracks: getStyledTemplateTracks(this.template), styles: [] });
1235
+ return {
1236
+ ...this.template,
1237
+ tracks: getStyledTemplateTracks(this.template),
1238
+ styles: [],
1239
+ };
1244
1240
  }
1245
1241
  setTemplate(template, noEmit) {
1246
1242
  const tNew = JSON.stringify(template);
@@ -1253,7 +1249,6 @@ class WellLogView extends Component {
1253
1249
  }
1254
1250
  }
1255
1251
  _recomputeTemplateFromController() {
1256
- var _a;
1257
1252
  const template = this.template;
1258
1253
  const tracks = [];
1259
1254
  if (this.logController) {
@@ -1270,7 +1265,7 @@ class WellLogView extends Component {
1270
1265
  name: template.name,
1271
1266
  scale: {
1272
1267
  primary: this.props.primaryAxis || "" /* no scale track */,
1273
- allowSecondary: ((_a = template.scale) === null || _a === void 0 ? void 0 : _a.allowSecondary) && axes.length > 1,
1268
+ allowSecondary: template.scale?.allowSecondary && axes.length > 1,
1274
1269
  },
1275
1270
  tracks: tracks,
1276
1271
  styles: template.styles,
@@ -1279,7 +1274,6 @@ class WellLogView extends Component {
1279
1274
  // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
1280
1275
  // Track management -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
1281
1276
  _addTrack(clickedTrack, templateTrack) {
1282
- var _a;
1283
1277
  if (!this.logController)
1284
1278
  return console.warn("Log controller not initialized");
1285
1279
  // User's track might be empty, but we should show it regardless
@@ -1287,7 +1281,7 @@ class WellLogView extends Component {
1287
1281
  const iClickedTrack = getTrackIndex(this.logController, clickedTrack);
1288
1282
  // Always add the new track to the right of the one that was clicked
1289
1283
  const iNewTrack = iClickedTrack + 1;
1290
- const newTrack = createNewViewTrack(this.logController, templateTrack, iNewTrack, this.getAxesInfo(), (_a = this.getWellLogSets()) !== null && _a !== void 0 ? _a : []);
1284
+ const newTrack = createNewViewTrack(this.logController, templateTrack, iNewTrack, this.getAxesInfo(), this.getWellLogSets() ?? []);
1291
1285
  if (!newTrack)
1292
1286
  return;
1293
1287
  this._recomputeTemplateFromController();
@@ -1297,13 +1291,12 @@ class WellLogView extends Component {
1297
1291
  this.onTrackScroll();
1298
1292
  }
1299
1293
  _editTrack(track, newTemplateTrack) {
1300
- var _a, _b, _c;
1301
1294
  if (!this.logController)
1302
1295
  return console.warn("Log controller not initialized");
1303
- const oldTitle = (_a = track.options.label) !== null && _a !== void 0 ? _a : "";
1304
- const newTitle = (_b = newTemplateTrack.title) !== null && _b !== void 0 ? _b : "";
1296
+ const oldTitle = track.options.label ?? "";
1297
+ const newTitle = newTemplateTrack.title ?? "";
1305
1298
  const titleChanged = !oldTitle.localeCompare(newTitle);
1306
- editViewTrack(this.logController, track, newTemplateTrack, this.getAxesInfo(), (_c = this.getWellLogSets()) !== null && _c !== void 0 ? _c : [], this.props.colorMapFunctions);
1299
+ editViewTrack(this.logController, track, newTemplateTrack, this.getAxesInfo(), this.getWellLogSets() ?? [], this.props.colorMapFunctions);
1307
1300
  if (titleChanged)
1308
1301
  // workaround to refresh tooltips in videx wellog component
1309
1302
  this._forceUpdateTitleTooltips();
@@ -1335,15 +1328,13 @@ class WellLogView extends Component {
1335
1328
  // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
1336
1329
  // Track plot management - --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
1337
1330
  addTrackPlot(track, templatePlot) {
1338
- var _a;
1339
1331
  if (!this.logController)
1340
1332
  return console.warn("Log controller not initialized");
1341
- addPlotToTrack(track, templatePlot, (_a = this.getWellLogSets()) !== null && _a !== void 0 ? _a : [], this.getAxesInfo(), this.props.colorMapFunctions);
1333
+ addPlotToTrack(track, templatePlot, this.getWellLogSets() ?? [], this.getAxesInfo(), this.props.colorMapFunctions);
1342
1334
  adjustControllerToModifiedTrack(this.logController, track);
1343
1335
  this._recomputeTemplateFromController();
1344
1336
  }
1345
1337
  _editTrackPlot(track, plot, templatePlot) {
1346
- var _a;
1347
1338
  if (!this.logController)
1348
1339
  return console.warn("Log controller not initialized");
1349
1340
  /* We have special option for track scale!
@@ -1351,7 +1342,7 @@ class WellLogView extends Component {
1351
1342
  if (templatePlot.scale === templateTrack.scale)
1352
1343
  templatePlot.scale = undefined;
1353
1344
  */
1354
- editTrackPlot(track, plot, templatePlot, (_a = this.getWellLogSets()) !== null && _a !== void 0 ? _a : [], this.getAxesInfo(), this.props.colorMapFunctions);
1345
+ editTrackPlot(track, plot, templatePlot, this.getWellLogSets() ?? [], this.getAxesInfo(), this.props.colorMapFunctions);
1355
1346
  adjustControllerToModifiedTrack(this.logController, track);
1356
1347
  this._recomputeTemplateFromController();
1357
1348
  }
@@ -1389,11 +1380,10 @@ class WellLogView extends Component {
1389
1380
  }
1390
1381
  createViewTitle(viewTitle //| undefined
1391
1382
  ) {
1392
- var _a;
1393
1383
  if (typeof viewTitle === "object" /*react element*/)
1394
1384
  return viewTitle;
1395
1385
  if (viewTitle === true)
1396
- return (_a = this.wellLogSets[0]) === null || _a === void 0 ? void 0 : _a.header.well;
1386
+ return this.wellLogSets[0]?.header.well;
1397
1387
  return viewTitle; // string
1398
1388
  }
1399
1389
  render() {