@webviz/well-log-viewer 2.8.3 → 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.
- package/dist/SyncLogViewer.js +54 -58
- package/dist/SyncLogViewer.js.map +1 -1
- package/dist/WellLogViewer.js +22 -29
- package/dist/WellLogViewer.js.map +1 -1
- package/dist/components/CallbackManager.js +15 -2
- package/dist/components/CallbackManager.js.map +1 -1
- package/dist/components/CommonPropTypes.js +11 -2
- package/dist/components/CommonPropTypes.js.map +1 -1
- package/dist/components/DefaultSyncLogViewerLayout.js +3 -7
- package/dist/components/DefaultSyncLogViewerLayout.js.map +1 -1
- package/dist/components/DefaultWellLogViewerLayout.js +1 -2
- package/dist/components/DefaultWellLogViewerLayout.js.map +1 -1
- package/dist/components/InfoPanel.js +2 -2
- package/dist/components/InfoPanel.js.map +1 -1
- package/dist/components/LocalMenus.js +1 -2
- package/dist/components/LocalMenus.js.map +1 -1
- package/dist/components/PlotDialog.js +25 -22
- package/dist/components/PlotDialog.js.map +1 -1
- package/dist/components/ScaleSelector.js +1 -2
- package/dist/components/ScaleSelector.js.map +1 -1
- package/dist/components/Scroller.js +5 -2
- package/dist/components/Scroller.js.map +1 -1
- package/dist/components/TrackDialog.js +34 -17
- package/dist/components/TrackDialog.js.map +1 -1
- package/dist/components/WellLogAxesPanel.js +6 -7
- package/dist/components/WellLogAxesPanel.js.map +1 -1
- package/dist/components/WellLogInfoPanel.js +2 -0
- package/dist/components/WellLogInfoPanel.js.map +1 -1
- package/dist/components/WellLogScaleSelector.js +2 -2
- package/dist/components/WellLogScaleSelector.js.map +1 -1
- package/dist/components/WellLogSpacer.js +46 -54
- package/dist/components/WellLogSpacer.js.map +1 -1
- package/dist/components/WellLogView.js +90 -100
- package/dist/components/WellLogView.js.map +1 -1
- package/dist/components/WellLogViewWithScroller.js +12 -13
- package/dist/components/WellLogViewWithScroller.js.map +1 -1
- package/dist/components/WellLogZoomSlider.js +4 -5
- package/dist/components/WellLogZoomSlider.js.map +1 -1
- package/dist/components/ZoomSlider.js +1 -1
- package/dist/components/ZoomSlider.js.map +1 -1
- package/dist/utils/arrays.js +1 -2
- package/dist/utils/arrays.js.map +1 -1
- package/dist/utils/color-table.js +3 -4
- package/dist/utils/color-table.js.map +1 -1
- package/dist/utils/fill-info.js +3 -4
- package/dist/utils/fill-info.js.map +1 -1
- package/dist/utils/log-viewer.js +4 -8
- package/dist/utils/log-viewer.js.map +1 -1
- package/dist/utils/plots.js +67 -79
- package/dist/utils/plots.js.map +1 -1
- package/dist/utils/template.js +9 -8
- package/dist/utils/template.js.map +1 -1
- package/dist/utils/trackFactory.js +8 -2
- package/dist/utils/trackFactory.js.map +1 -1
- package/dist/utils/tracks.js +34 -29
- package/dist/utils/tracks.js.map +1 -1
- package/dist/utils/well-log.js +4 -7
- package/dist/utils/well-log.js.map +1 -1
- package/package.json +5 -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
|
-
|
|
108
|
-
|
|
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
|
-
!
|
|
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 =
|
|
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
|
|
314
|
-
const vSecondary = primaryAxis === "md" ? scaleInterpolator
|
|
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 =
|
|
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 &&
|
|
383
|
-
const patternSize = patternsTable
|
|
384
|
-
const patternImages = patternsTable
|
|
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
|
|
388
|
+
: vPrimary?.toFixed(0);
|
|
393
389
|
const txtSecondary = !Number.isFinite(vSecondary)
|
|
394
390
|
? ""
|
|
395
|
-
: /*(primaryAxis === "md" ? "TVD:" : "MD:") +*/ vSecondary
|
|
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 =
|
|
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:
|
|
586
|
-
inverseColorMapFunctionName:
|
|
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
|
|
619
|
-
const source = overlay
|
|
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 (
|
|
712
|
+
if (props.options?.hideTrackTitle !== nextProps.options?.hideTrackTitle)
|
|
719
713
|
return true;
|
|
720
|
-
if (
|
|
714
|
+
if (props.options?.hideTrackLegend !== nextProps.options?.hideTrackLegend)
|
|
721
715
|
return true;
|
|
722
|
-
if (
|
|
723
|
-
|
|
716
|
+
if (props.options?.maxVisibleTrackNum !==
|
|
717
|
+
nextProps.options?.maxVisibleTrackNum)
|
|
724
718
|
return true;
|
|
725
|
-
if (
|
|
719
|
+
if (props.options?.maxContentZoom !== nextProps.options?.maxContentZoom)
|
|
726
720
|
return true;
|
|
727
|
-
if (
|
|
728
|
-
|
|
721
|
+
if (props.options?.checkDatafileSchema !==
|
|
722
|
+
nextProps.options?.checkDatafileSchema)
|
|
729
723
|
return true;
|
|
730
|
-
if (
|
|
731
|
-
|
|
724
|
+
if (props.options?.wellpickColorFill !==
|
|
725
|
+
nextProps.options?.wellpickColorFill)
|
|
732
726
|
return true;
|
|
733
|
-
if (
|
|
734
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
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
|
-
|
|
827
|
-
|
|
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
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
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
|
-
|
|
874
|
-
|
|
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: !
|
|
907
|
-
showLegend: !
|
|
908
|
-
maxZoom:
|
|
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 (
|
|
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
|
-
|
|
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
|
-
|
|
995
|
+
this.props.onTrackScroll?.();
|
|
994
996
|
}
|
|
995
997
|
onTrackSelection() {
|
|
996
|
-
|
|
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
|
-
|
|
1013
|
+
this.props.onContentRescale?.();
|
|
1014
1014
|
}
|
|
1015
1015
|
onContentSelection() {
|
|
1016
|
-
var _a, _b;
|
|
1017
1016
|
this.showSelection();
|
|
1018
|
-
|
|
1017
|
+
this.props.onContentSelection?.();
|
|
1019
1018
|
}
|
|
1020
1019
|
onTrackMouseEvent(ev) {
|
|
1021
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 (
|
|
1053
|
+
if (this.props.options?.hideCurrentPosition)
|
|
1059
1054
|
this.selCurrent = undefined;
|
|
1060
|
-
if (
|
|
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
|
|
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
|
-
|
|
1163
|
-
|
|
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 =
|
|
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
|
-
|
|
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
|
|
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:
|
|
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(),
|
|
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 =
|
|
1304
|
-
const newTitle =
|
|
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(),
|
|
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,
|
|
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,
|
|
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
|
|
1386
|
+
return this.wellLogSets[0]?.header.well;
|
|
1397
1387
|
return viewTitle; // string
|
|
1398
1388
|
}
|
|
1399
1389
|
render() {
|