@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,147 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
import { MapAndWellLogViewer } from "./MapAndWellLogViewer";
|
|
4
|
-
|
|
5
|
-
import exampleData from "../../../../example-data/deckgl-map.json";
|
|
6
|
-
import { colorTables } from "@emerson-eps/color-tables";
|
|
7
|
-
|
|
8
|
-
const drawing_layer = exampleData[0].layers.find(
|
|
9
|
-
(item) => item["@@type"] === "DrawingLayer"
|
|
10
|
-
);
|
|
11
|
-
if (drawing_layer) drawing_layer.visible = false;
|
|
12
|
-
|
|
13
|
-
const wells_layer = exampleData[0].layers.find(
|
|
14
|
-
(item) => item["@@type"] === "WellsLayer"
|
|
15
|
-
);
|
|
16
|
-
if (wells_layer) {
|
|
17
|
-
/*
|
|
18
|
-
"logData": "@@#resources.logData",
|
|
19
|
-
"logrunName": "BLOCKING",
|
|
20
|
-
"logName": "ZONELOG",
|
|
21
|
-
"logColor": "Stratigraphy"
|
|
22
|
-
*/
|
|
23
|
-
wells_layer.logName = "ZONE_MAIN"; //
|
|
24
|
-
wells_layer.logColor = "Stratigraphy"; //"Stratigraphy";
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export default {
|
|
28
|
-
component: MapAndWellLogViewer,
|
|
29
|
-
title: "WellLogViewer/Demo/MapAndWellLogViewer",
|
|
30
|
-
argTypes: {
|
|
31
|
-
id: {
|
|
32
|
-
description:
|
|
33
|
-
"The ID of this component, used to identify dash components in callbacks. The ID needs to be unique across all of the components in an app.",
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
resources: {
|
|
37
|
-
description:
|
|
38
|
-
"Resource dictionary made available in the DeckGL specification as an enum. \
|
|
39
|
-
The values can be accessed like this: `@@#resources.resourceId`, where \
|
|
40
|
-
`resourceId` is the key in the `resources` dict. For more information, \
|
|
41
|
-
see the DeckGL documentation on enums in the json spec: \
|
|
42
|
-
https://deck.gl/docs/api-reference/json/conversion-reference#enumerations-and-using-the--prefix",
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
layers: {
|
|
46
|
-
description:
|
|
47
|
-
"List of JSON object containing layer specific data. \
|
|
48
|
-
Each JSON object will consist of layer type with key as `@@type` and layer specific data, if any.",
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
bounds: {
|
|
52
|
-
description:
|
|
53
|
-
"Coordinate boundary for the view defined as [left, bottom, right, top].",
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
zoom: {
|
|
57
|
-
description: "Zoom level for the view",
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
views: {
|
|
61
|
-
description:
|
|
62
|
-
"Views configuration for map. If not specified, all the layers will be displayed in a single 2D viewport.<br/>" +
|
|
63
|
-
"Options:<br/>" +
|
|
64
|
-
"layout: [number, number] — Layout for viewport in specified as [row, column],<br/>" +
|
|
65
|
-
"viewports: [`ViewportType`] — Layers configuration for multiple viewport,<br/><br/>" +
|
|
66
|
-
"`ViewportType` options: <br/>" +
|
|
67
|
-
"id: string — Viewport id <br>" +
|
|
68
|
-
"name: string — Viewport name <br>" +
|
|
69
|
-
"show3D: boolean — Toggle 3D view <br>" +
|
|
70
|
-
"layerIds: [string] — Layer ids to be displayed on viewport.",
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
coords: {
|
|
74
|
-
description:
|
|
75
|
-
"Options for readout panel.<br/>" +
|
|
76
|
-
"visible: boolean — Show/hide readout,<br/>" +
|
|
77
|
-
"multipicking: boolean — Enable or disable multi picking,<br/>" +
|
|
78
|
-
"pickDepth: number — Number of objects to pick.",
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
scale: {
|
|
82
|
-
description:
|
|
83
|
-
"Options for distance scale component.<br/>" +
|
|
84
|
-
"visible: boolean — Show/hide scale bar,<br/>" +
|
|
85
|
-
"incrementValue: number — Increment value for the scale,<br/>" +
|
|
86
|
-
"widthPerUnit: number — Scale bar width in pixels per unit value,<br/>" +
|
|
87
|
-
"position: [number, number] — Scale bar position in pixels.",
|
|
88
|
-
},
|
|
89
|
-
|
|
90
|
-
coordinateUnit: {
|
|
91
|
-
description: "Unit for the scale ruler",
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
legend: {
|
|
95
|
-
description:
|
|
96
|
-
"Options for color legend.<br/>" +
|
|
97
|
-
"visible: boolean — Show/hide color legend,<br/>" +
|
|
98
|
-
"position: [number, number] — Legend position in pixels,<br/>" +
|
|
99
|
-
"horizontal: boolean — Orientation of color legend.",
|
|
100
|
-
},
|
|
101
|
-
|
|
102
|
-
colorTables: {
|
|
103
|
-
description:
|
|
104
|
-
"Prop containing color table data." +
|
|
105
|
-
"See colorTables repo for reference:<br/>" +
|
|
106
|
-
"https://github.com/emerson-eps/color-tables/blob/main/react-app/src/component/color-tables.json",
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
editedData: {
|
|
110
|
-
description:
|
|
111
|
-
"Map data returned via editedData prop.<br/>" +
|
|
112
|
-
"selectedWell: string — Selected well name,<br/>" +
|
|
113
|
-
"selectedPie: object — Selected pie chart data,<br/>" +
|
|
114
|
-
"selectedFeatureIndexes: [number] — Drawing layer data index,<br/>" +
|
|
115
|
-
"data: object — Drawing layer data, indexed from selectedFeatureIndexes.",
|
|
116
|
-
},
|
|
117
|
-
|
|
118
|
-
setProps: {
|
|
119
|
-
description: "For reacting to prop changes",
|
|
120
|
-
},
|
|
121
|
-
|
|
122
|
-
welllogOptions: {
|
|
123
|
-
description:
|
|
124
|
-
"Options for well log view:<br/>" +
|
|
125
|
-
"maxContentZoom: The maximum zoom value (default 256)<br/>" +
|
|
126
|
-
"maxVisibleTrackNum: The maximum number of visible tracks<br/>" +
|
|
127
|
-
"checkDatafileSchema: Validate JSON datafile against schema<br/>" +
|
|
128
|
-
"hideTrackTitle: Hide titles on the tracks<br/>" +
|
|
129
|
-
"hideLegend: Hide legends on the tracks.",
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
const Template = (args) => {
|
|
135
|
-
return (
|
|
136
|
-
<div style={{ height: "94vh", width: "100%", display: "flex" }}>
|
|
137
|
-
<MapAndWellLogViewer {...args} />
|
|
138
|
-
</div>
|
|
139
|
-
);
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
export const Default = Template.bind({});
|
|
143
|
-
Default.args = {
|
|
144
|
-
...exampleData[0],
|
|
145
|
-
colorTables: colorTables,
|
|
146
|
-
id: "MapAndWellLog", // redefine id from exampleData[0]
|
|
147
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
|
-
import "@testing-library/jest-dom/extend-expect";
|
|
3
|
-
import { render } from "@testing-library/react";
|
|
4
|
-
import "jest-styled-components";
|
|
5
|
-
import React from "react";
|
|
6
|
-
import { MapAndWellLogViewer } from "./MapAndWellLogViewer";
|
|
7
|
-
|
|
8
|
-
window.ResizeObserver =
|
|
9
|
-
window.ResizeObserver ||
|
|
10
|
-
jest.fn().mockImplementation(() => ({
|
|
11
|
-
disconnect: jest.fn(),
|
|
12
|
-
observe: jest.fn(),
|
|
13
|
-
unobserve: jest.fn(),
|
|
14
|
-
}));
|
|
15
|
-
|
|
16
|
-
describe("Map and Well Log Viewer", () => {
|
|
17
|
-
it("snapshot test", () => {
|
|
18
|
-
const { container } = render(
|
|
19
|
-
<MapAndWellLogViewer
|
|
20
|
-
id={""}
|
|
21
|
-
bounds={[432205, 6475078, 437720, 6481113]}
|
|
22
|
-
/>
|
|
23
|
-
);
|
|
24
|
-
expect(container.firstChild).toMatchSnapshot();
|
|
25
|
-
});
|
|
26
|
-
});
|
|
@@ -1,473 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
|
-
|
|
3
|
-
import React from "react";
|
|
4
|
-
import PropTypes from "prop-types";
|
|
5
|
-
|
|
6
|
-
import { WeakValidationMap } from "react";
|
|
7
|
-
import SubsurfaceViewer from "@webviz/subsurface-viewer";
|
|
8
|
-
import { SubsurfaceViewerProps } from "@webviz/subsurface-viewer";
|
|
9
|
-
import { Color } from "@deck.gl/core/typed";
|
|
10
|
-
|
|
11
|
-
import { WellsLayer } from "@webviz/subsurface-viewer/dist/layers";
|
|
12
|
-
import {
|
|
13
|
-
Template,
|
|
14
|
-
TemplateTrack,
|
|
15
|
-
TemplatePlot,
|
|
16
|
-
TemplatePlotTypes,
|
|
17
|
-
} from "./components/WellLogTemplateTypes";
|
|
18
|
-
|
|
19
|
-
import { WellLog } from "./components/WellLogTypes";
|
|
20
|
-
import welllogsJson from "./demo/example-data/volve_logs.json";
|
|
21
|
-
const welllogs = welllogsJson as unknown as WellLog[];
|
|
22
|
-
|
|
23
|
-
import templateJson from "./demo/example-data/welllog_template_2.json";
|
|
24
|
-
const template = templateJson as unknown as Template;
|
|
25
|
-
|
|
26
|
-
import { ColorTable } from "./components/ColorTableTypes";
|
|
27
|
-
|
|
28
|
-
import { WellLogController } from "./components/WellLogView";
|
|
29
|
-
import { LogViewer } from "@equinor/videx-wellog";
|
|
30
|
-
import { Info } from "./components/InfoTypes";
|
|
31
|
-
import { MapMouseEvent } from "@webviz/subsurface-viewer/dist/components/Map";
|
|
32
|
-
|
|
33
|
-
import InfoPanel from "./components/InfoPanel";
|
|
34
|
-
import WellLogViewWithScroller from "./components/WellLogViewWithScroller";
|
|
35
|
-
import { axisTitles, axisMnemos } from "./utils/axes";
|
|
36
|
-
import { fillInfos } from "./utils/fill-info";
|
|
37
|
-
import { getDiscreteMeta, indexOfElementByName } from "./utils/tracks";
|
|
38
|
-
import { deepCopy } from "./utils/deepcopy";
|
|
39
|
-
|
|
40
|
-
import { WellLogViewOptions } from "./components/WellLogView";
|
|
41
|
-
import { isEqualRanges } from "./components/WellLogView";
|
|
42
|
-
|
|
43
|
-
import wellPicks from "./demo/example-data/wellpicks.json";
|
|
44
|
-
import colorTables from "./demo/example-data/wellpick_colors.json";
|
|
45
|
-
|
|
46
|
-
function getTemplatePlotColorTable(
|
|
47
|
-
template: Template,
|
|
48
|
-
templatePlot: TemplatePlot
|
|
49
|
-
) {
|
|
50
|
-
let colorTable = templatePlot.colorTable;
|
|
51
|
-
if (!colorTable && templatePlot.style) {
|
|
52
|
-
const templateStyles = template.styles;
|
|
53
|
-
if (templateStyles) {
|
|
54
|
-
const iStyle = indexOfElementByName(
|
|
55
|
-
templateStyles,
|
|
56
|
-
templatePlot.style
|
|
57
|
-
);
|
|
58
|
-
if (iStyle >= 0) {
|
|
59
|
-
const style = templateStyles[iStyle];
|
|
60
|
-
colorTable = style.colorTable;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
return colorTable;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
interface Props extends SubsurfaceViewerProps {
|
|
68
|
-
/**
|
|
69
|
-
* Options for well log view
|
|
70
|
-
*/
|
|
71
|
-
welllogOptions?: WellLogViewOptions;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
interface State {
|
|
75
|
-
wellIndex: number | undefined;
|
|
76
|
-
infos: Info[];
|
|
77
|
-
controller?: WellLogController;
|
|
78
|
-
editedData?: Record<string, unknown>;
|
|
79
|
-
|
|
80
|
-
layers?: Record<string, unknown>[];
|
|
81
|
-
|
|
82
|
-
wellName?: string;
|
|
83
|
-
selection?: [number | undefined, number | undefined];
|
|
84
|
-
selPersistent?: boolean;
|
|
85
|
-
wellColor?: Color; // well color
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function findWellsLayer(event: MapMouseEvent) {
|
|
89
|
-
const info = event.infos.find((info) => info.layer?.id === "wells-layer");
|
|
90
|
-
return info?.layer as WellsLayer;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function findWellLogIndex(welllogs: WellLog[], wellName: string): number {
|
|
94
|
-
return welllogs.findIndex((welllog) => welllog.header.well === wellName);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
function findLog(template: Template, logName: string): number {
|
|
98
|
-
return template.tracks.findIndex(
|
|
99
|
-
(track) => track.plots[0]?.name === logName
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function detectType(welllog: WellLog, logName: string): TemplatePlotTypes {
|
|
104
|
-
if (welllog) {
|
|
105
|
-
const meta = getDiscreteMeta(welllog, logName); // non-standard extention of WellLog JSON file
|
|
106
|
-
if (meta) return "stacked";
|
|
107
|
-
}
|
|
108
|
-
return "line";
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
function addTemplateTrack(
|
|
112
|
-
template: Template,
|
|
113
|
-
welllog: WellLog,
|
|
114
|
-
logName: string
|
|
115
|
-
): Template {
|
|
116
|
-
// add missed TemplateTrack for the given logName
|
|
117
|
-
const type: TemplatePlotTypes = detectType(welllog, logName);
|
|
118
|
-
const templateNew = deepCopy(template);
|
|
119
|
-
const templateTrack: TemplateTrack = {
|
|
120
|
-
title: logName,
|
|
121
|
-
required: true, // force to show on all wells
|
|
122
|
-
plots: [{ name: logName, type: type, color: "red" }],
|
|
123
|
-
};
|
|
124
|
-
templateNew.tracks.push(templateTrack);
|
|
125
|
-
return templateNew;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
const wellpick = {
|
|
129
|
-
wellpick: wellPicks[0],
|
|
130
|
-
name: "HORIZON",
|
|
131
|
-
colorTables: colorTables,
|
|
132
|
-
color: "Stratigraphy",
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
export class MapAndWellLogViewer extends React.Component<Props, State> {
|
|
136
|
-
public static propTypes?: WeakValidationMap<Props> | undefined;
|
|
137
|
-
constructor(props: Props, state: State) {
|
|
138
|
-
super(props, state);
|
|
139
|
-
this.state = {
|
|
140
|
-
wellIndex: undefined,
|
|
141
|
-
infos: [],
|
|
142
|
-
editedData: props.editedData,
|
|
143
|
-
layers: props.layers as Record<string, unknown>[],
|
|
144
|
-
};
|
|
145
|
-
this.onInfo = this.onInfo.bind(this);
|
|
146
|
-
this.onCreateController = this.onCreateController.bind(this);
|
|
147
|
-
this.onContentSelection = this.onContentSelection.bind(this);
|
|
148
|
-
this.onTrackScroll = this.onTrackScroll.bind(this);
|
|
149
|
-
|
|
150
|
-
this.onMouseEvent = this.onMouseEvent.bind(this);
|
|
151
|
-
}
|
|
152
|
-
componentDidUpdate(prevProps: Props, prevState: State): void {
|
|
153
|
-
if (this.props.editedData !== prevProps.editedData) {
|
|
154
|
-
this.setState({ editedData: this.props.editedData });
|
|
155
|
-
0;
|
|
156
|
-
}
|
|
157
|
-
if (!isEqualRanges(this.state.selection, prevState.selection)) {
|
|
158
|
-
const controller = this.state.controller;
|
|
159
|
-
if (controller && this.state.selection) {
|
|
160
|
-
controller.selectContent([
|
|
161
|
-
this.state.selection[0],
|
|
162
|
-
this.state.selection[1],
|
|
163
|
-
]);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
onInfo(
|
|
168
|
-
x: number,
|
|
169
|
-
logController: LogViewer,
|
|
170
|
-
iFrom: number,
|
|
171
|
-
iTo: number
|
|
172
|
-
): void {
|
|
173
|
-
const infos = fillInfos(
|
|
174
|
-
x,
|
|
175
|
-
logController,
|
|
176
|
-
iFrom,
|
|
177
|
-
iTo,
|
|
178
|
-
[] //this.collapsedTrackIds,
|
|
179
|
-
//this.props.readoutOptions
|
|
180
|
-
);
|
|
181
|
-
|
|
182
|
-
this.setState({ infos: infos });
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
onCreateController(controller: WellLogController): void {
|
|
186
|
-
this.setState({ controller: controller });
|
|
187
|
-
}
|
|
188
|
-
onContentSelection(): void {
|
|
189
|
-
const controller = this.state.controller;
|
|
190
|
-
if (!controller) return;
|
|
191
|
-
const selection = controller.getContentSelection();
|
|
192
|
-
|
|
193
|
-
// synchronize selection only from the current well
|
|
194
|
-
/*if (?? === this.state.wellName)*/ {
|
|
195
|
-
this.setState({
|
|
196
|
-
selection: selection,
|
|
197
|
-
selPersistent: selection[1] !== undefined,
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
onTrackScroll(): void {
|
|
202
|
-
const controller = this.state.controller;
|
|
203
|
-
if (!controller) return;
|
|
204
|
-
const iTrack = controller.getTrackScrollPos();
|
|
205
|
-
if (iTrack >= 0) {
|
|
206
|
-
const template = controller.getTemplate();
|
|
207
|
-
const track = template.tracks[iTrack];
|
|
208
|
-
if (track) {
|
|
209
|
-
const templatePlot = track.plots[0];
|
|
210
|
-
if (templatePlot) {
|
|
211
|
-
const wells_layer = (
|
|
212
|
-
this.props.layers as Record<string, unknown>[]
|
|
213
|
-
)?.find(
|
|
214
|
-
(item: Record<string, unknown>) =>
|
|
215
|
-
item["@@type"] === "WellsLayer"
|
|
216
|
-
);
|
|
217
|
-
if (
|
|
218
|
-
wells_layer &&
|
|
219
|
-
wells_layer["logName"] !== templatePlot.name
|
|
220
|
-
) {
|
|
221
|
-
wells_layer["logName"] = templatePlot.name;
|
|
222
|
-
const colorTable = getTemplatePlotColorTable(
|
|
223
|
-
template,
|
|
224
|
-
templatePlot
|
|
225
|
-
);
|
|
226
|
-
if (colorTable) wells_layer["logColor"] = colorTable;
|
|
227
|
-
//(wells_layer.context as DeckGLLayerContext).userData.colorTables=colorTables;
|
|
228
|
-
|
|
229
|
-
const layers = deepCopy(this.props.layers);
|
|
230
|
-
this.setState({
|
|
231
|
-
layers: layers as Record<string, unknown>[],
|
|
232
|
-
});
|
|
233
|
-
|
|
234
|
-
// Force to rerender ColorLegend after
|
|
235
|
-
setTimeout(() => {
|
|
236
|
-
const layers = deepCopy(this.props.layers);
|
|
237
|
-
this.setState({
|
|
238
|
-
layers: layers as Record<string, unknown>[],
|
|
239
|
-
});
|
|
240
|
-
}, 200);
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
onMouseEvent(event: MapMouseEvent): void {
|
|
248
|
-
if (event.wellname !== undefined) {
|
|
249
|
-
if (event.type == "click") {
|
|
250
|
-
const iWell = findWellLogIndex(welllogs, event.wellname);
|
|
251
|
-
this.setState((state: Readonly<State>) => {
|
|
252
|
-
//if (state.wellIndex === iWell) return null;
|
|
253
|
-
|
|
254
|
-
let selection:
|
|
255
|
-
| [number | undefined, number | undefined]
|
|
256
|
-
| undefined = undefined;
|
|
257
|
-
let selPersistent: boolean | undefined = undefined;
|
|
258
|
-
if (
|
|
259
|
-
state.wellIndex !== iWell ||
|
|
260
|
-
!state.selection ||
|
|
261
|
-
state.selPersistent
|
|
262
|
-
) {
|
|
263
|
-
selection = [event.md, undefined];
|
|
264
|
-
selPersistent = false;
|
|
265
|
-
} else {
|
|
266
|
-
if (state.selection[1] !== undefined) {
|
|
267
|
-
// have something pinned
|
|
268
|
-
selection = [event.md, state.selection[1]];
|
|
269
|
-
selPersistent = true;
|
|
270
|
-
} else {
|
|
271
|
-
// no pinned yet
|
|
272
|
-
selection = [event.md, state.selection[0]]; // copy current to pinned
|
|
273
|
-
selPersistent = false;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
return {
|
|
278
|
-
wellIndex: iWell,
|
|
279
|
-
wellName: event.wellname,
|
|
280
|
-
wellColor: event.wellcolor,
|
|
281
|
-
selection: selection,
|
|
282
|
-
selPersistent: selPersistent,
|
|
283
|
-
};
|
|
284
|
-
});
|
|
285
|
-
|
|
286
|
-
const controller = this.state.controller;
|
|
287
|
-
if (controller) {
|
|
288
|
-
const wellsLayer = findWellsLayer(event);
|
|
289
|
-
if (wellsLayer) {
|
|
290
|
-
const template = controller.getTemplate();
|
|
291
|
-
const logName = wellsLayer.props?.logName;
|
|
292
|
-
let iTrack = findLog(template, logName);
|
|
293
|
-
if (iTrack < 0) {
|
|
294
|
-
//const welllog = info.object is Feature or WellLog;
|
|
295
|
-
const welllog = welllogs[iWell];
|
|
296
|
-
const templateNew = addTemplateTrack(
|
|
297
|
-
template,
|
|
298
|
-
welllog,
|
|
299
|
-
logName
|
|
300
|
-
);
|
|
301
|
-
controller.setTemplate(templateNew);
|
|
302
|
-
|
|
303
|
-
iTrack = findLog(template, logName);
|
|
304
|
-
}
|
|
305
|
-
controller.scrollTrackTo(iTrack);
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
if (event.wellname === this.state.wellName) {
|
|
310
|
-
// synchronize selection only from the current well
|
|
311
|
-
if (event.md !== undefined) {
|
|
312
|
-
this.setState((state: Readonly<State>) => {
|
|
313
|
-
if (state.selPersistent) return null;
|
|
314
|
-
if (event.md === state.selection?.[0]) return null;
|
|
315
|
-
|
|
316
|
-
return {
|
|
317
|
-
selection: [event.md, state.selection?.[1]],
|
|
318
|
-
};
|
|
319
|
-
});
|
|
320
|
-
|
|
321
|
-
//if (wellsLayer)
|
|
322
|
-
// wellsLayer.setSelection(event.wellname, [event.md, undefined]);
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
render(): JSX.Element {
|
|
329
|
-
const wellName = this.state.wellName;
|
|
330
|
-
const wellColor = this.state.wellColor;
|
|
331
|
-
const wellIndex = this.state.wellIndex;
|
|
332
|
-
const viewTitle = (
|
|
333
|
-
<div style={{ fontSize: "16px" }}>
|
|
334
|
-
{wellColor && (
|
|
335
|
-
<span
|
|
336
|
-
style={{
|
|
337
|
-
color: wellColor
|
|
338
|
-
? "rgb(" +
|
|
339
|
-
wellColor[0] +
|
|
340
|
-
"," +
|
|
341
|
-
wellColor[1] +
|
|
342
|
-
"," +
|
|
343
|
-
wellColor[2] +
|
|
344
|
-
")"
|
|
345
|
-
: undefined,
|
|
346
|
-
fontSize: "small",
|
|
347
|
-
}}
|
|
348
|
-
>
|
|
349
|
-
{"\u2B24 " /*big circle*/}
|
|
350
|
-
</span>
|
|
351
|
-
)}
|
|
352
|
-
{wellName || "Select a well by clicking on the map"}
|
|
353
|
-
{wellIndex === -1 && (
|
|
354
|
-
<div className="welllogview-error">
|
|
355
|
-
No well logs found for the well
|
|
356
|
-
</div>
|
|
357
|
-
)}
|
|
358
|
-
</div>
|
|
359
|
-
);
|
|
360
|
-
|
|
361
|
-
return (
|
|
362
|
-
<div style={{ height: "100%", width: "100%", display: "flex" }}>
|
|
363
|
-
<div
|
|
364
|
-
style={{
|
|
365
|
-
height: "100%",
|
|
366
|
-
width: "70%",
|
|
367
|
-
position: "relative",
|
|
368
|
-
}}
|
|
369
|
-
>
|
|
370
|
-
<div>
|
|
371
|
-
<SubsurfaceViewer
|
|
372
|
-
{...this.props}
|
|
373
|
-
layers={this.state.layers}
|
|
374
|
-
editedData={this.state.editedData}
|
|
375
|
-
onMouseEvent={this.onMouseEvent}
|
|
376
|
-
selection={{
|
|
377
|
-
well: wellName,
|
|
378
|
-
selection: this.state.selection,
|
|
379
|
-
}}
|
|
380
|
-
/>
|
|
381
|
-
</div>
|
|
382
|
-
</div>
|
|
383
|
-
<div
|
|
384
|
-
style={{
|
|
385
|
-
height: "85%",
|
|
386
|
-
width: "30%",
|
|
387
|
-
display: "flex",
|
|
388
|
-
flexDirection: "column",
|
|
389
|
-
}}
|
|
390
|
-
>
|
|
391
|
-
<div
|
|
392
|
-
style={{
|
|
393
|
-
flex: "1 1",
|
|
394
|
-
height: "90%",
|
|
395
|
-
minWidth: "25px",
|
|
396
|
-
width: "100%",
|
|
397
|
-
}}
|
|
398
|
-
>
|
|
399
|
-
<WellLogViewWithScroller
|
|
400
|
-
welllog={
|
|
401
|
-
wellIndex !== undefined
|
|
402
|
-
? welllogs[wellIndex]
|
|
403
|
-
: undefined
|
|
404
|
-
}
|
|
405
|
-
template={template}
|
|
406
|
-
colorTables={this.props.colorTables as ColorTable[]}
|
|
407
|
-
// @aspentech: This issue needs to get sorted out, there seems to be a compatibility issue with the JSON file and the prop type
|
|
408
|
-
// @ts-ignore
|
|
409
|
-
wellpick={wellpick}
|
|
410
|
-
primaryAxis={"md"}
|
|
411
|
-
axisTitles={axisTitles}
|
|
412
|
-
axisMnemos={axisMnemos}
|
|
413
|
-
viewTitle={viewTitle}
|
|
414
|
-
options={{
|
|
415
|
-
checkDatafileSchema:
|
|
416
|
-
this.props.checkDatafileSchema,
|
|
417
|
-
maxVisibleTrackNum: 1,
|
|
418
|
-
}}
|
|
419
|
-
onInfo={this.onInfo}
|
|
420
|
-
onCreateController={this.onCreateController}
|
|
421
|
-
onContentSelection={this.onContentSelection}
|
|
422
|
-
onTrackScroll={this.onTrackScroll}
|
|
423
|
-
/>
|
|
424
|
-
</div>
|
|
425
|
-
<div
|
|
426
|
-
style={{
|
|
427
|
-
flex: "0 0",
|
|
428
|
-
display: "flex",
|
|
429
|
-
flexDirection: "column",
|
|
430
|
-
height: "100%",
|
|
431
|
-
width: "100%",
|
|
432
|
-
}}
|
|
433
|
-
>
|
|
434
|
-
<InfoPanel header="Readout" infos={this.state.infos} />
|
|
435
|
-
</div>
|
|
436
|
-
</div>
|
|
437
|
-
</div>
|
|
438
|
-
);
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
const WellLogViewOptions_propTypes = PropTypes.shape({
|
|
443
|
-
/**
|
|
444
|
-
* The maximum zoom value
|
|
445
|
-
*/
|
|
446
|
-
maxContentZoom: PropTypes.number,
|
|
447
|
-
/**
|
|
448
|
-
* The maximum number of visible tracks
|
|
449
|
-
*/
|
|
450
|
-
maxVisibleTrackNum: PropTypes.number,
|
|
451
|
-
/**
|
|
452
|
-
* Validate JSON datafile against schema
|
|
453
|
-
*/
|
|
454
|
-
checkDatafileSchema: PropTypes.bool,
|
|
455
|
-
/**
|
|
456
|
-
* Hide titles of the track. Default is false
|
|
457
|
-
*/
|
|
458
|
-
hideTrackTitle: PropTypes.bool,
|
|
459
|
-
/**
|
|
460
|
-
* Hide legends of the track. Default is false
|
|
461
|
-
*/
|
|
462
|
-
hideTrackLegend: PropTypes.bool,
|
|
463
|
-
});
|
|
464
|
-
|
|
465
|
-
MapAndWellLogViewer.propTypes = {
|
|
466
|
-
...SubsurfaceViewer.propTypes,
|
|
467
|
-
|
|
468
|
-
/**
|
|
469
|
-
* WellLogView additional options
|
|
470
|
-
*/
|
|
471
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
472
|
-
welllogOptions: WellLogViewOptions_propTypes as any /*PropTypes.object,*/,
|
|
473
|
-
};
|