@webviz/well-log-viewer 0.0.1-alpha.1 → 0.0.1-alpha.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.
- package/dist/SyncLogViewer.js +3 -4
- package/dist/SyncLogViewer.js.map +1 -1
- package/dist/components/WellLogView.js +5 -5
- package/dist/components/WellLogView.js.map +1 -1
- package/dist/demo/example-data/welllog_template_2.json +167 -167
- package/dist/demo/example-data/wellpick_colors.json +1 -1
- package/dist/demo/example-data/wellpicks.json +179 -179
- package/package.json +32 -5
- package/dist/Intro.stories.mdx +0 -59
- package/dist/package.json +0 -21
- package/src/Intro.stories.mdx +0 -59
- package/src/MapAndWellLogViewer.stories.jsx +0 -147
- package/src/MapAndWellLogViewer.test.tsx +0 -26
- package/src/MapAndWellLogViewer.tsx +0 -473
- package/src/SyncLogViewer.stories.jsx +0 -361
- package/src/SyncLogViewer.test.tsx +0 -41
- package/src/SyncLogViewer.tsx +0 -1188
- package/src/WellLogViewer.png +0 -0
- package/src/WellLogViewer.stories.jsx +0 -169
- package/src/WellLogViewer.test.tsx +0 -53
- package/src/WellLogViewer.tsx +0 -439
- package/src/WellLogViewer_performance.test.tsx +0 -78
- package/src/__snapshots__/MapAndWellLogViewer.test.tsx.snap +0 -365
- package/src/__snapshots__/SyncLogViewer.test.tsx.snap +0 -510
- package/src/__snapshots__/WellLogViewer.test.tsx.snap +0 -552
- package/src/components/AxisSelector.test.tsx +0 -50
- package/src/components/AxisSelector.tsx +0 -49
- package/src/components/ColorTableTypes.ts +0 -9
- package/src/components/InfoPanel.test.tsx +0 -58
- package/src/components/InfoPanel.tsx +0 -144
- package/src/components/InfoTypes.ts +0 -17
- package/src/components/LocalMenus.tsx +0 -336
- package/src/components/PlotDialog.tsx +0 -419
- package/src/components/Scroller.stories.jsx +0 -80
- package/src/components/Scroller.test.tsx +0 -22
- package/src/components/Scroller.tsx +0 -173
- package/src/components/TrackDialog.tsx +0 -217
- package/src/components/WellLogSpacer.tsx +0 -483
- package/src/components/WellLogTemplateTypes.ts +0 -65
- package/src/components/WellLogTypes.ts +0 -53
- package/src/components/WellLogView.stories.jsx +0 -84
- package/src/components/WellLogView.test.tsx +0 -52
- package/src/components/WellLogView.tsx +0 -2063
- package/src/components/WellLogViewWithScroller.stories.jsx +0 -69
- package/src/components/WellLogViewWithScroller.test.tsx +0 -47
- package/src/components/WellLogViewWithScroller.tsx +0 -179
- package/src/components/ZoomSlider.stories.jsx +0 -52
- package/src/components/ZoomSlider.test.tsx +0 -28
- package/src/components/ZoomSlider.tsx +0 -86
- package/src/components/__snapshots__/AxisSelector.test.tsx.snap +0 -28
- package/src/components/__snapshots__/InfoPanel.test.tsx.snap +0 -103
- package/src/components/__snapshots__/Scroller.test.tsx.snap +0 -13
- package/src/components/__snapshots__/WellLogView.test.tsx.snap +0 -54
- package/src/components/__snapshots__/WellLogViewWithScroller.test.tsx.snap +0 -270
- package/src/components/__snapshots__/ZoomSlider.test.tsx.snap +0 -50
- package/src/components/styles.scss +0 -106
- package/src/custom.d.ts +0 -13
- package/src/demo/example-data/volve_logs.json +0 -689617
- package/src/demo/example-data/welllog_template_2.json +0 -196
- package/src/demo/example-data/wellpick_colors.json +0 -156
- package/src/demo/example-data/wellpicks.json +0 -186
- package/src/index.ts +0 -8
- package/src/utils/axes.ts +0 -26
- package/src/utils/color-table.ts +0 -153
- package/src/utils/deepcopy.ts +0 -3
- package/src/utils/edit-track.tsx +0 -40
- package/src/utils/fill-info.ts +0 -224
- package/src/utils/gradientfill-plot-legend.ts +0 -177
- package/src/utils/gradientfill-plot.ts +0 -203
- package/src/utils/graph/factory.ts +0 -15
- package/src/utils/legend/common.ts +0 -153
- package/src/utils/log-viewer.ts +0 -209
- package/src/utils/minmax.ts +0 -126
- package/src/utils/pattern.tsx +0 -50
- package/src/utils/stack/stack-legend.ts +0 -100
- package/src/utils/tracks.ts +0 -1559
- package/tsconfig.json +0 -8
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
import React, { Component, ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
import { TemplateTrack, TemplatePlot } from "./WellLogTemplateTypes";
|
|
4
|
-
|
|
5
|
-
import WellLogView from "./WellLogView";
|
|
6
|
-
|
|
7
|
-
// material ui
|
|
8
|
-
import {
|
|
9
|
-
Dialog,
|
|
10
|
-
DialogTitle,
|
|
11
|
-
DialogContent,
|
|
12
|
-
DialogActions,
|
|
13
|
-
Button,
|
|
14
|
-
TextField,
|
|
15
|
-
} from "@mui/material";
|
|
16
|
-
|
|
17
|
-
import { FormControl, InputLabel, NativeSelect } from "@mui/material";
|
|
18
|
-
|
|
19
|
-
import { createDataItems, dataNames } from "./PlotDialog";
|
|
20
|
-
import { createScaleItems } from "./PlotDialog";
|
|
21
|
-
import { _createItems } from "./PlotDialog";
|
|
22
|
-
|
|
23
|
-
const noneValue = "-";
|
|
24
|
-
|
|
25
|
-
interface Props {
|
|
26
|
-
templateTrack?: TemplateTrack; // input for editting
|
|
27
|
-
onOK: (templateTrack: TemplateTrack) => void;
|
|
28
|
-
wellLogView: WellLogView;
|
|
29
|
-
}
|
|
30
|
-
interface State extends TemplateTrack {
|
|
31
|
-
stacked: string;
|
|
32
|
-
stackedName: string; // data name
|
|
33
|
-
open: boolean;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export class TrackPropertiesDialog extends Component<Props, State> {
|
|
37
|
-
bStacked: boolean | undefined;
|
|
38
|
-
constructor(props: Props) {
|
|
39
|
-
super(props);
|
|
40
|
-
let name = "";
|
|
41
|
-
const names = dataNames(
|
|
42
|
-
this.props.wellLogView.props.welllog,
|
|
43
|
-
null,
|
|
44
|
-
true
|
|
45
|
-
);
|
|
46
|
-
if (names[0]) name = names[0];
|
|
47
|
-
|
|
48
|
-
const templateTrack = this.props.templateTrack;
|
|
49
|
-
this.bStacked =
|
|
50
|
-
templateTrack &&
|
|
51
|
-
templateTrack.plots &&
|
|
52
|
-
templateTrack.plots[0] &&
|
|
53
|
-
templateTrack.plots[0].type === "stacked";
|
|
54
|
-
this.state = templateTrack
|
|
55
|
-
? {
|
|
56
|
-
...templateTrack,
|
|
57
|
-
|
|
58
|
-
stacked: this.bStacked ? "1" : "0",
|
|
59
|
-
stackedName: templateTrack.plots[0]?.name,
|
|
60
|
-
open: true,
|
|
61
|
-
}
|
|
62
|
-
: {
|
|
63
|
-
// we should fill every posible state to allow this.setState() to set it
|
|
64
|
-
title: "New Track",
|
|
65
|
-
scale: undefined,
|
|
66
|
-
domain: undefined,
|
|
67
|
-
|
|
68
|
-
plots: [],
|
|
69
|
-
|
|
70
|
-
stacked: "0",
|
|
71
|
-
stackedName: name,
|
|
72
|
-
open: true,
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
this.closeDialog = this.closeDialog.bind(this);
|
|
76
|
-
this.onOK = this.onOK.bind(this);
|
|
77
|
-
this.onChange = this.onChange.bind(this);
|
|
78
|
-
this.onChangeChecked = this.onChangeChecked.bind(this);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
onOK(): void {
|
|
82
|
-
if (parseInt(this.state.stacked)) {
|
|
83
|
-
this.state.plots.splice(0, this.state.plots.length); // clear array
|
|
84
|
-
const plot: TemplatePlot = {
|
|
85
|
-
type: "stacked",
|
|
86
|
-
name: this.state.stackedName,
|
|
87
|
-
color: "not used", // not used in stacked
|
|
88
|
-
};
|
|
89
|
-
this.state.plots.push(plot);
|
|
90
|
-
}
|
|
91
|
-
this.props.onOK(this.state);
|
|
92
|
-
this.closeDialog();
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
onChange(e: React.ChangeEvent<HTMLInputElement>): void {
|
|
96
|
-
this.setState({ [e.target.id]: e.target.value } as unknown as State);
|
|
97
|
-
}
|
|
98
|
-
onChangeChecked(e: React.ChangeEvent<HTMLInputElement>): void {
|
|
99
|
-
this.setState({ [e.target.id]: e.target.checked } as unknown as State);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
closeDialog(): void {
|
|
103
|
-
this.setState({ open: false });
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
createSelectControl(
|
|
107
|
-
valueName: string, // use it as "a pointer to member" of an object
|
|
108
|
-
label: string,
|
|
109
|
-
nodes: ReactNode[],
|
|
110
|
-
insertEmpty?: boolean
|
|
111
|
-
): ReactNode {
|
|
112
|
-
let value = (this.state as unknown as Record<string, string>)[
|
|
113
|
-
valueName
|
|
114
|
-
];
|
|
115
|
-
if (insertEmpty) {
|
|
116
|
-
if (!value) value = noneValue;
|
|
117
|
-
// insert at the beginning
|
|
118
|
-
nodes.unshift(
|
|
119
|
-
<option key={noneValue} value={noneValue}>
|
|
120
|
-
{"\u2014"}
|
|
121
|
-
</option>
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
return (
|
|
125
|
-
<FormControl fullWidth>
|
|
126
|
-
<InputLabel>{label}</InputLabel>
|
|
127
|
-
<NativeSelect
|
|
128
|
-
value={value}
|
|
129
|
-
onChange={(event) => {
|
|
130
|
-
const value =
|
|
131
|
-
event.currentTarget.value === noneValue
|
|
132
|
-
? ""
|
|
133
|
-
: event.currentTarget.value;
|
|
134
|
-
|
|
135
|
-
const values = new Object() as Record<string, string>;
|
|
136
|
-
values[valueName] = value;
|
|
137
|
-
this.setState(values as unknown as State);
|
|
138
|
-
}}
|
|
139
|
-
>
|
|
140
|
-
{nodes}
|
|
141
|
-
</NativeSelect>
|
|
142
|
-
</FormControl>
|
|
143
|
-
);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
render(): JSX.Element {
|
|
147
|
-
const templateTrack = this.props.templateTrack;
|
|
148
|
-
const title = templateTrack ? "Edit track" : "Add New Track";
|
|
149
|
-
return (
|
|
150
|
-
<Dialog
|
|
151
|
-
open={this.state.open}
|
|
152
|
-
maxWidth="sm"
|
|
153
|
-
fullWidth
|
|
154
|
-
onClose={() => this.setState({ open: false })}
|
|
155
|
-
>
|
|
156
|
-
<DialogTitle>{title}</DialogTitle>
|
|
157
|
-
<DialogContent
|
|
158
|
-
style={{
|
|
159
|
-
display: "grid",
|
|
160
|
-
gridTemplateColumns: "1fr 1fr 1fr",
|
|
161
|
-
}}
|
|
162
|
-
>
|
|
163
|
-
<TextField
|
|
164
|
-
id="title"
|
|
165
|
-
label="Title"
|
|
166
|
-
value={this.state.title}
|
|
167
|
-
onChange={this.onChange}
|
|
168
|
-
></TextField>
|
|
169
|
-
|
|
170
|
-
{templateTrack ? (
|
|
171
|
-
<></>
|
|
172
|
-
) : (
|
|
173
|
-
this.createSelectControl(
|
|
174
|
-
"stacked",
|
|
175
|
-
"Type",
|
|
176
|
-
_createItems({ "0": "Graph", "1": "Stacked" }),
|
|
177
|
-
false
|
|
178
|
-
)
|
|
179
|
-
)}
|
|
180
|
-
|
|
181
|
-
{parseInt(this.state.stacked)
|
|
182
|
-
? this.createSelectControl(
|
|
183
|
-
"stackedName", // data
|
|
184
|
-
"Data",
|
|
185
|
-
createDataItems(
|
|
186
|
-
this.props.wellLogView.props.welllog,
|
|
187
|
-
null,
|
|
188
|
-
true
|
|
189
|
-
)
|
|
190
|
-
)
|
|
191
|
-
: this.createSelectControl(
|
|
192
|
-
"scale",
|
|
193
|
-
"Scale",
|
|
194
|
-
createScaleItems(),
|
|
195
|
-
true
|
|
196
|
-
)}
|
|
197
|
-
</DialogContent>
|
|
198
|
-
<DialogActions>
|
|
199
|
-
<Button
|
|
200
|
-
color="secondary"
|
|
201
|
-
variant="contained"
|
|
202
|
-
onClick={this.closeDialog}
|
|
203
|
-
>
|
|
204
|
-
Cancel
|
|
205
|
-
</Button>
|
|
206
|
-
<Button
|
|
207
|
-
color="primary"
|
|
208
|
-
variant="contained"
|
|
209
|
-
onClick={this.onOK}
|
|
210
|
-
>
|
|
211
|
-
OK
|
|
212
|
-
</Button>
|
|
213
|
-
</DialogActions>
|
|
214
|
-
</Dialog>
|
|
215
|
-
);
|
|
216
|
-
}
|
|
217
|
-
}
|
|
@@ -1,483 +0,0 @@
|
|
|
1
|
-
import React, { Component, ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
import "./styles.scss";
|
|
4
|
-
|
|
5
|
-
import { WellLogController, WellPickProps, getWellPicks } from "./WellLogView";
|
|
6
|
-
import WellLogView from "./WellLogView";
|
|
7
|
-
|
|
8
|
-
import { ColorTable } from "./ColorTableTypes";
|
|
9
|
-
import { PatternsTable, createDefs, patternId } from "../utils/pattern";
|
|
10
|
-
|
|
11
|
-
export interface WellLogSpacerOptions {
|
|
12
|
-
/**
|
|
13
|
-
* Fill with color between well picks
|
|
14
|
-
*/
|
|
15
|
-
wellpickColorFill?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Fill with pattern between well picks
|
|
18
|
-
*/
|
|
19
|
-
wellpickPatternFill?: boolean;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
interface Props {
|
|
23
|
-
width?: number;
|
|
24
|
-
|
|
25
|
-
controllers: (WellLogController | null)[];
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Prop containing color table data.
|
|
29
|
-
*/
|
|
30
|
-
colorTables: ColorTable[];
|
|
31
|
-
/**
|
|
32
|
-
* Well Picks data
|
|
33
|
-
*/
|
|
34
|
-
wellpicks?: WellPickProps[];
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Patterns table
|
|
38
|
-
*/
|
|
39
|
-
patternsTable?: PatternsTable;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Horizon to pattern index map
|
|
43
|
-
*/
|
|
44
|
-
patterns?: [string, number][];
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Distanse between wells to show on the spacer
|
|
48
|
-
*/
|
|
49
|
-
distance?: {
|
|
50
|
-
units: string;
|
|
51
|
-
value: number | undefined;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Orientation of the track plots on the screen.
|
|
56
|
-
*/
|
|
57
|
-
horizontal?: boolean;
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Additional options
|
|
61
|
-
*/
|
|
62
|
-
options?: WellLogSpacerOptions;
|
|
63
|
-
|
|
64
|
-
onCreateSpacer?: (spacer: WellLogSpacer) => void;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
//interface State {}
|
|
68
|
-
|
|
69
|
-
// see also colors in Overlays in WellLogView.ts
|
|
70
|
-
const selColor = "rgba(0, 0, 0, 0.1)";
|
|
71
|
-
const curColor = "rgba(255, 0, 0, 0.1)";
|
|
72
|
-
const pinColor = "rgba(0, 255, 0, 0.1)";
|
|
73
|
-
|
|
74
|
-
let count = 0;
|
|
75
|
-
|
|
76
|
-
class WellLogSpacer extends Component<Props /*, State*/> {
|
|
77
|
-
container: HTMLElement | undefined = undefined;
|
|
78
|
-
|
|
79
|
-
uid: number = count++; // generate some unique id prefix for pattern ids in SVGs
|
|
80
|
-
|
|
81
|
-
defs: ReactNode;
|
|
82
|
-
|
|
83
|
-
constructor(props: Props) {
|
|
84
|
-
super(props);
|
|
85
|
-
this.defs =
|
|
86
|
-
this.props.options?.wellpickPatternFill &&
|
|
87
|
-
this.props.patterns &&
|
|
88
|
-
createDefs(this.uid, this.props.patternsTable);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
update(): void {
|
|
92
|
-
this.forceUpdate();
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
componentDidUpdate(prevProps: Props /*, prevState: State*/): void {
|
|
96
|
-
// called after render()!?
|
|
97
|
-
if (this.props.onCreateSpacer !== prevProps.onCreateSpacer) {
|
|
98
|
-
// update callback to component's caller
|
|
99
|
-
if (this.props.onCreateSpacer) this.props.onCreateSpacer(this);
|
|
100
|
-
}
|
|
101
|
-
if (
|
|
102
|
-
this.props.patternsTable !== prevProps.patternsTable ||
|
|
103
|
-
this.props.patterns !== prevProps.patterns ||
|
|
104
|
-
this.props.options?.wellpickPatternFill !==
|
|
105
|
-
prevProps.options?.wellpickPatternFill
|
|
106
|
-
) {
|
|
107
|
-
this.defs =
|
|
108
|
-
this.props.options?.wellpickPatternFill &&
|
|
109
|
-
this.props.patterns &&
|
|
110
|
-
createDefs(this.uid, this.props.patternsTable);
|
|
111
|
-
|
|
112
|
-
this.forceUpdate(); // force to show pattern fill with new this.defs
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
shouldComponentUpdate(nextProps: Props /*, nextState: State*/): boolean {
|
|
117
|
-
if (this.props.colorTables !== nextProps.colorTables) {
|
|
118
|
-
return true;
|
|
119
|
-
}
|
|
120
|
-
if (this.props.controllers !== nextProps.controllers) {
|
|
121
|
-
return true;
|
|
122
|
-
}
|
|
123
|
-
if (this.props.wellpicks !== nextProps.wellpicks) {
|
|
124
|
-
return true;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
if (
|
|
128
|
-
this.props.options?.wellpickColorFill !==
|
|
129
|
-
nextProps.options?.wellpickColorFill
|
|
130
|
-
)
|
|
131
|
-
return true;
|
|
132
|
-
if (
|
|
133
|
-
this.props.options?.wellpickPatternFill !==
|
|
134
|
-
nextProps.options?.wellpickPatternFill
|
|
135
|
-
) {
|
|
136
|
-
return true;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
return false;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
render(): JSX.Element {
|
|
143
|
-
const horizontal = this.props.horizontal;
|
|
144
|
-
|
|
145
|
-
let ymax = 0;
|
|
146
|
-
const picks: {
|
|
147
|
-
color: string;
|
|
148
|
-
pattern: string;
|
|
149
|
-
from: number;
|
|
150
|
-
to: number;
|
|
151
|
-
}[] = [];
|
|
152
|
-
|
|
153
|
-
let offsetTop = 3000; // try to draw initially out of screen
|
|
154
|
-
let offsetLeft = 3000;
|
|
155
|
-
let height = 1;
|
|
156
|
-
let width = 1;
|
|
157
|
-
const controller = this.props.controllers[0] as WellLogView;
|
|
158
|
-
const logViewer = controller?.logController;
|
|
159
|
-
const controller2 = this.props.controllers[1] as WellLogView;
|
|
160
|
-
const logViewer2 = controller2?.logController;
|
|
161
|
-
const wps = controller ? getWellPicks(controller) : null;
|
|
162
|
-
const wps2 = controller2 ? getWellPicks(controller2) : null;
|
|
163
|
-
if (wps && wps2 && logViewer) {
|
|
164
|
-
const overlay = logViewer?.overlay;
|
|
165
|
-
const source = overlay?.elm.node();
|
|
166
|
-
if (source) {
|
|
167
|
-
offsetTop = source.offsetTop;
|
|
168
|
-
offsetLeft = source.offsetLeft;
|
|
169
|
-
if (source.offsetParent) {
|
|
170
|
-
if (!horizontal) offsetTop += source.offsetParent.offsetTop;
|
|
171
|
-
else offsetLeft += source.offsetParent.offsetLeft;
|
|
172
|
-
}
|
|
173
|
-
height = source.clientHeight;
|
|
174
|
-
width = source.clientWidth;
|
|
175
|
-
}
|
|
176
|
-
if (horizontal)
|
|
177
|
-
height = this.container ? this.container.clientHeight : 10;
|
|
178
|
-
else width = this.container ? this.container.clientWidth : 10;
|
|
179
|
-
|
|
180
|
-
//const wpSize = 3; //9;
|
|
181
|
-
//const offset = wpSize / 2;
|
|
182
|
-
|
|
183
|
-
const patterns =
|
|
184
|
-
this.props.options?.wellpickPatternFill &&
|
|
185
|
-
this.props.patternsTable &&
|
|
186
|
-
this.props.patterns;
|
|
187
|
-
|
|
188
|
-
for (const wp of wps) {
|
|
189
|
-
const horizon = wp.horizon;
|
|
190
|
-
const vPrimary = wp.vPrimary;
|
|
191
|
-
const color = wp.color;
|
|
192
|
-
|
|
193
|
-
const rgba =
|
|
194
|
-
"rgba(" +
|
|
195
|
-
color[0] +
|
|
196
|
-
"," +
|
|
197
|
-
color[1] +
|
|
198
|
-
"," +
|
|
199
|
-
color[2] +
|
|
200
|
-
",0.8)"; /*TODO: get from CSS ???*/
|
|
201
|
-
|
|
202
|
-
let pattern = "";
|
|
203
|
-
if (patterns) {
|
|
204
|
-
const p = patterns.find((val) => val[0] === horizon);
|
|
205
|
-
if (p) pattern = "url(#" + patternId(this.uid, p[1]) + ")";
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
const vCur = vPrimary;
|
|
209
|
-
if (vCur === undefined) continue;
|
|
210
|
-
const v = logViewer?.scale(vCur);
|
|
211
|
-
if (!Number.isFinite(v) || v === undefined) continue;
|
|
212
|
-
|
|
213
|
-
for (const wp2 of wps2) {
|
|
214
|
-
const horizon2 = wp2.horizon;
|
|
215
|
-
if (horizon === horizon2) {
|
|
216
|
-
const vPrimary2 = wp2.vPrimary;
|
|
217
|
-
|
|
218
|
-
const vCur2 = vPrimary2;
|
|
219
|
-
if (vCur2 === undefined) continue;
|
|
220
|
-
const v2 = logViewer2?.scale(vCur2);
|
|
221
|
-
if (!Number.isFinite(v2) || v2 === undefined) continue;
|
|
222
|
-
if (ymax < v) ymax = v;
|
|
223
|
-
if (ymax < v2) ymax = v2;
|
|
224
|
-
|
|
225
|
-
picks.push({
|
|
226
|
-
from: v,
|
|
227
|
-
to: v2,
|
|
228
|
-
color: rgba,
|
|
229
|
-
pattern: pattern,
|
|
230
|
-
});
|
|
231
|
-
|
|
232
|
-
break;
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
const _selection = controller?.getContentSelection();
|
|
239
|
-
const _selection2 = controller2?.getContentSelection();
|
|
240
|
-
|
|
241
|
-
const selection: {
|
|
242
|
-
from: number | undefined;
|
|
243
|
-
to: number | undefined;
|
|
244
|
-
}[] = [
|
|
245
|
-
{
|
|
246
|
-
from:
|
|
247
|
-
_selection?.[0] === undefined
|
|
248
|
-
? undefined
|
|
249
|
-
: logViewer?.scale(_selection?.[0]),
|
|
250
|
-
to:
|
|
251
|
-
_selection2?.[0] === undefined
|
|
252
|
-
? undefined
|
|
253
|
-
: logViewer2?.scale(_selection2?.[0]),
|
|
254
|
-
},
|
|
255
|
-
{
|
|
256
|
-
from:
|
|
257
|
-
_selection?.[1] === undefined
|
|
258
|
-
? undefined
|
|
259
|
-
: logViewer?.scale(_selection?.[1]),
|
|
260
|
-
to:
|
|
261
|
-
_selection2?.[1] === undefined
|
|
262
|
-
? undefined
|
|
263
|
-
: logViewer2?.scale(_selection2?.[1]),
|
|
264
|
-
},
|
|
265
|
-
];
|
|
266
|
-
|
|
267
|
-
if (
|
|
268
|
-
selection[0].from !== undefined &&
|
|
269
|
-
selection[1].from !== undefined &&
|
|
270
|
-
selection[0].to !== undefined &&
|
|
271
|
-
selection[1].to !== undefined
|
|
272
|
-
)
|
|
273
|
-
if (
|
|
274
|
-
selection[0].from < selection[1].from !==
|
|
275
|
-
selection[0].to < selection[1].to
|
|
276
|
-
) {
|
|
277
|
-
const tmp = selection[0].to;
|
|
278
|
-
selection[0].to = selection[1].to;
|
|
279
|
-
selection[1].to = tmp;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
const from0 = selection[0]?.from?.toFixed(1);
|
|
283
|
-
const to0 = selection[0]?.to?.toFixed(1);
|
|
284
|
-
const from1 = selection[1]?.from?.toFixed(1);
|
|
285
|
-
const to1 = selection[1]?.to?.toFixed(1);
|
|
286
|
-
|
|
287
|
-
const hasSelection0 = from0 !== undefined && to0 !== undefined;
|
|
288
|
-
const hasSelection1 = from1 !== undefined && to1 !== undefined;
|
|
289
|
-
const hasSelection = hasSelection0 && hasSelection1;
|
|
290
|
-
|
|
291
|
-
let selectionPoints = "";
|
|
292
|
-
let d1 = "";
|
|
293
|
-
let d0 = "";
|
|
294
|
-
if (hasSelection0) {
|
|
295
|
-
d0 = horizontal
|
|
296
|
-
? "M " + from0 + " 0 L " + to0 + " " + height
|
|
297
|
-
: "M 0 " + from0 + " L " + width + " " + to0;
|
|
298
|
-
}
|
|
299
|
-
if (hasSelection1) {
|
|
300
|
-
d1 = horizontal
|
|
301
|
-
? "M " + from1 + " 0 L " + to1 + " " + height
|
|
302
|
-
: "M 0 " + from1 + " L " + width + " " + to1;
|
|
303
|
-
}
|
|
304
|
-
if (hasSelection) {
|
|
305
|
-
selectionPoints = horizontal
|
|
306
|
-
? from0 +
|
|
307
|
-
" 0 " +
|
|
308
|
-
to0 +
|
|
309
|
-
" " +
|
|
310
|
-
height +
|
|
311
|
-
" " +
|
|
312
|
-
to1 +
|
|
313
|
-
(" " + height + " " + from1 + " 0")
|
|
314
|
-
: "0 " +
|
|
315
|
-
from0 +
|
|
316
|
-
" " +
|
|
317
|
-
width +
|
|
318
|
-
" " +
|
|
319
|
-
to0 +
|
|
320
|
-
(" " + width + " " + to1 + " 0 " + from1);
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
const fillPoints: string[] = [];
|
|
324
|
-
picks.map((value, index) => {
|
|
325
|
-
if (index + 1 >= picks.length) return;
|
|
326
|
-
const value1 = picks[index + 1];
|
|
327
|
-
fillPoints.push(
|
|
328
|
-
horizontal
|
|
329
|
-
? value.from.toFixed(1) +
|
|
330
|
-
" 0 " +
|
|
331
|
-
value.to.toFixed(1) +
|
|
332
|
-
" " +
|
|
333
|
-
height +
|
|
334
|
-
" " +
|
|
335
|
-
(value1.to.toFixed(1) +
|
|
336
|
-
" " +
|
|
337
|
-
height +
|
|
338
|
-
" " +
|
|
339
|
-
value1.from.toFixed(1) +
|
|
340
|
-
" 0")
|
|
341
|
-
: "0 " +
|
|
342
|
-
value.from.toFixed(1) +
|
|
343
|
-
" " +
|
|
344
|
-
width +
|
|
345
|
-
" " +
|
|
346
|
-
value.to.toFixed(1) +
|
|
347
|
-
" " +
|
|
348
|
-
(width +
|
|
349
|
-
" " +
|
|
350
|
-
value1.to.toFixed(1) +
|
|
351
|
-
" 0 " +
|
|
352
|
-
value1.from.toFixed(1))
|
|
353
|
-
);
|
|
354
|
-
});
|
|
355
|
-
|
|
356
|
-
const distance = this.props.distance;
|
|
357
|
-
|
|
358
|
-
return (
|
|
359
|
-
<div
|
|
360
|
-
className="welllogspacer"
|
|
361
|
-
style={{
|
|
362
|
-
width: "100%",
|
|
363
|
-
height: "100%",
|
|
364
|
-
display: "flex",
|
|
365
|
-
flexDirection: horizontal ? "row" : "column",
|
|
366
|
-
}}
|
|
367
|
-
ref={(el) => (this.container = el as HTMLElement)}
|
|
368
|
-
>
|
|
369
|
-
<div
|
|
370
|
-
style={
|
|
371
|
-
horizontal
|
|
372
|
-
? {
|
|
373
|
-
writingMode: horizontal
|
|
374
|
-
? "vertical-lr"
|
|
375
|
-
: undefined,
|
|
376
|
-
transform: horizontal
|
|
377
|
-
? "rotate(180deg)"
|
|
378
|
-
: undefined,
|
|
379
|
-
width: offsetLeft + "px",
|
|
380
|
-
height: height + "px",
|
|
381
|
-
}
|
|
382
|
-
: { height: offsetTop + "px", width: width + "px" }
|
|
383
|
-
}
|
|
384
|
-
>
|
|
385
|
-
{!controller?.props.options?.hideTrackTitle ? <br /> : null}
|
|
386
|
-
{!controller?.props.options?.hideTrackLegend &&
|
|
387
|
-
distance !== undefined &&
|
|
388
|
-
distance.value !== undefined ? (
|
|
389
|
-
<div style={{ fontSize: 12, textAlign: "center" }}>
|
|
390
|
-
{"←" +
|
|
391
|
-
distance.value.toFixed(0) +
|
|
392
|
-
distance.units +
|
|
393
|
-
"→"}
|
|
394
|
-
</div>
|
|
395
|
-
) : null}
|
|
396
|
-
</div>
|
|
397
|
-
<div
|
|
398
|
-
className="wellpick" // for CSS customization
|
|
399
|
-
style={
|
|
400
|
-
horizontal
|
|
401
|
-
? { height: height + "px" }
|
|
402
|
-
: { width: width + "px" }
|
|
403
|
-
}
|
|
404
|
-
>
|
|
405
|
-
<svg
|
|
406
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
407
|
-
viewBox={"0 0 " + width + " " + height}
|
|
408
|
-
width={width}
|
|
409
|
-
height={height}
|
|
410
|
-
stroke="currentColor"
|
|
411
|
-
strokeWidth={3}
|
|
412
|
-
>
|
|
413
|
-
{this.defs}
|
|
414
|
-
{picks.map(
|
|
415
|
-
(value, index) =>
|
|
416
|
-
index + 1 < picks.length && [
|
|
417
|
-
this.props.options?.wellpickColorFill &&
|
|
418
|
-
value.color && (
|
|
419
|
-
<polygon
|
|
420
|
-
key={index}
|
|
421
|
-
fill={value.color}
|
|
422
|
-
className="wellpick-fill" // for CSS customization
|
|
423
|
-
stroke="none"
|
|
424
|
-
points={fillPoints[index]}
|
|
425
|
-
/>
|
|
426
|
-
),
|
|
427
|
-
value.pattern && (
|
|
428
|
-
<polygon
|
|
429
|
-
key={"p" + index}
|
|
430
|
-
fill={value.pattern}
|
|
431
|
-
className="wellpick-pattern" // for CSS customization
|
|
432
|
-
stroke="none"
|
|
433
|
-
points={fillPoints[index]}
|
|
434
|
-
/>
|
|
435
|
-
),
|
|
436
|
-
]
|
|
437
|
-
)}
|
|
438
|
-
{picks.map((value, index) => (
|
|
439
|
-
<path
|
|
440
|
-
key={index}
|
|
441
|
-
fill="none"
|
|
442
|
-
stroke={value.color}
|
|
443
|
-
d={
|
|
444
|
-
horizontal
|
|
445
|
-
? "M " +
|
|
446
|
-
value.from.toFixed(1) +
|
|
447
|
-
"0 L " +
|
|
448
|
-
value.to.toFixed(1) +
|
|
449
|
-
" " +
|
|
450
|
-
height
|
|
451
|
-
: "M 0 " +
|
|
452
|
-
value.from.toFixed(1) +
|
|
453
|
-
" L " +
|
|
454
|
-
width +
|
|
455
|
-
" " +
|
|
456
|
-
value.to.toFixed(1)
|
|
457
|
-
}
|
|
458
|
-
/>
|
|
459
|
-
))}
|
|
460
|
-
|
|
461
|
-
{hasSelection && (
|
|
462
|
-
<polygon
|
|
463
|
-
fill={selColor}
|
|
464
|
-
stroke="none"
|
|
465
|
-
points={selectionPoints}
|
|
466
|
-
/>
|
|
467
|
-
)}
|
|
468
|
-
|
|
469
|
-
{hasSelection0 && (
|
|
470
|
-
<path fill="none" stroke={curColor} d={d0} />
|
|
471
|
-
)}
|
|
472
|
-
|
|
473
|
-
{hasSelection1 && (
|
|
474
|
-
<path fill="none" stroke={pinColor} d={d1} />
|
|
475
|
-
)}
|
|
476
|
-
</svg>
|
|
477
|
-
</div>
|
|
478
|
-
</div>
|
|
479
|
-
);
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
export default WellLogSpacer;
|