@webviz/subsurface-viewer 0.0.1-alpha.1 → 0.0.2-alpha.2
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/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/package.json +5 -2
- package/package.json +6 -3
- package/dist/DashSubsurfaceViewer.d.ts +0 -56
- package/dist/DashSubsurfaceViewer.js +0 -160
- package/dist/DashSubsurfaceViewer.js.map +0 -1
- package/src/DashSubsurfaceViewer.tsx +0 -270
- package/src/SubsurfaceViewer.stories.tsx +0 -449
- package/src/SubsurfaceViewer.test.tsx +0 -98
- package/src/SubsurfaceViewer.tsx +0 -356
- package/src/__snapshots__/SubsurfaceViewer.test.tsx.snap +0 -178
- package/src/assets/glTF/north_arrow/scene.bin +0 -0
- package/src/assets/glTF/north_arrow/scene.gltf +0 -315
- package/src/assets/glTF/north_arrow/textures/Arrow5_baseColor.png +0 -0
- package/src/assets/glTF/north_arrow/textures/Arrow5_metallicRoughness.png +0 -0
- package/src/assets/glTF/north_arrow/textures/Arrow5_normal.png +0 -0
- package/src/components/ColorLegend.test.tsx +0 -32
- package/src/components/ColorLegend.tsx +0 -80
- package/src/components/ColorLegends.test.tsx +0 -97
- package/src/components/ColorLegends.tsx +0 -46
- package/src/components/DistanceScale.stories.tsx +0 -28
- package/src/components/DistanceScale.test.tsx +0 -36
- package/src/components/DistanceScale.tsx +0 -84
- package/src/components/InfoCard.test.tsx +0 -110
- package/src/components/InfoCard.tsx +0 -263
- package/src/components/Map.test.tsx +0 -142
- package/src/components/Map.tsx +0 -1435
- package/src/components/StatusIndicator.test.tsx +0 -14
- package/src/components/StatusIndicator.tsx +0 -38
- package/src/components/ViewAnnotation.tsx +0 -16
- package/src/components/ViewFooter.test.tsx +0 -12
- package/src/components/ViewFooter.tsx +0 -30
- package/src/components/__snapshots__/ColorLegends.test.tsx.snap +0 -15
- package/src/components/__snapshots__/DistanceScale.test.tsx.snap +0 -33
- package/src/components/__snapshots__/InfoCard.test.tsx.snap +0 -561
- package/src/components/__snapshots__/Map.test.tsx.snap +0 -119
- package/src/components/__snapshots__/StatusIndicator.test.tsx.snap +0 -3
- package/src/components/__snapshots__/ViewFooter.test.tsx.snap +0 -7
- package/src/components/settings/DrawModeSelector.test.tsx +0 -45
- package/src/components/settings/DrawModeSelector.tsx +0 -58
- package/src/components/settings/DrawModeSelector_performance.test.tsx +0 -35
- package/src/components/settings/LayerProperty.test.tsx +0 -35
- package/src/components/settings/LayerProperty.tsx +0 -153
- package/src/components/settings/LayerProperty_performance.test.tsx +0 -39
- package/src/components/settings/LayerSettingsButton.test.tsx +0 -133
- package/src/components/settings/LayerSettingsButton.tsx +0 -95
- package/src/components/settings/LayersButton.test.tsx +0 -102
- package/src/components/settings/LayersButton.tsx +0 -97
- package/src/components/settings/NumericInput.test.tsx +0 -25
- package/src/components/settings/NumericInput.tsx +0 -67
- package/src/components/settings/Settings.tsx +0 -71
- package/src/components/settings/SliderInput.test.tsx +0 -28
- package/src/components/settings/SliderInput.tsx +0 -71
- package/src/components/settings/ToggleButton.test.tsx +0 -25
- package/src/components/settings/ToggleButton.tsx +0 -53
- package/src/components/settings/__snapshots__/DrawModeSelector.test.tsx.snap +0 -124
- package/src/components/settings/__snapshots__/LayerProperty.test.tsx.snap +0 -124
- package/src/components/settings/__snapshots__/LayerSettingsButton.test.tsx.snap +0 -36
- package/src/components/settings/__snapshots__/LayersButton.test.tsx.snap +0 -83
- package/src/components/settings/__snapshots__/NumericInput.test.tsx.snap +0 -123
- package/src/components/settings/__snapshots__/SliderInput.test.tsx.snap +0 -244
- package/src/components/settings/__snapshots__/ToggleButton.test.tsx.snap +0 -182
- package/src/custom.d.ts +0 -9
- package/src/index.ts +0 -5
- package/src/inputSchema/ColorTables.json +0 -51
- package/src/inputSchema/FaultPolygons.json +0 -80
- package/src/inputSchema/Grid.json +0 -39
- package/src/inputSchema/PieChart.json +0 -72
- package/src/inputSchema/WellLog.json +0 -126
- package/src/inputSchema/WellLogTemplate.json +0 -136
- package/src/inputSchema/WellLogs.json +0 -5
- package/src/inputSchema/Wells.json +0 -106
- package/src/inputSchema/schemaValidationUtil.tsx +0 -55
- package/src/inputSchema/validator.tsx +0 -72
- package/src/inputSchema/wellCompletions.json +0 -108
- package/src/layers/BoxSelectionLayer/boxSelectionLayer.stories.tsx +0 -172
- package/src/layers/BoxSelectionLayer/boxSelectionLayer.tsx +0 -136
- package/src/layers/axes/axes-fragment.glsl.ts +0 -15
- package/src/layers/axes/axesLayer.stories.tsx +0 -87
- package/src/layers/axes/axesLayer.ts +0 -692
- package/src/layers/axes/boxLayer.ts +0 -71
- package/src/layers/axes/grid-vertex.glsl.ts +0 -14
- package/src/layers/axes2d/axes2DLayer.stories.tsx +0 -150
- package/src/layers/axes2d/axes2DLayer.ts +0 -841
- package/src/layers/axes2d/font-atlas.png +0 -0
- package/src/layers/axes2d/label-fragment.glsl.js +0 -37
- package/src/layers/axes2d/label-vertex.glsl.js +0 -20
- package/src/layers/axes2d/line-fragment.glsl.js +0 -14
- package/src/layers/axes2d/line-vertex.glsl.js +0 -13
- package/src/layers/colormap/colormap.fs.glsl.ts +0 -42
- package/src/layers/colormap/colormapLayer.ts +0 -247
- package/src/layers/drawing/drawingLayer.tsx +0 -256
- package/src/layers/fault_polygons/faultPolygonsLayer.ts +0 -54
- package/src/layers/grid3d/fragment.fs.glsl.ts +0 -109
- package/src/layers/grid3d/fragment_lines.glsl.ts +0 -21
- package/src/layers/grid3d/grid3dLayer.stories.tsx +0 -172
- package/src/layers/grid3d/grid3dLayer.ts +0 -248
- package/src/layers/grid3d/privateLayer.ts +0 -292
- package/src/layers/grid3d/vertex.glsl.ts +0 -43
- package/src/layers/grid3d/vertex_lines.glsl.ts +0 -15
- package/src/layers/grid3d/webworker.ts +0 -173
- package/src/layers/hillshading2d/hillshading2d.fs.glsl.ts +0 -62
- package/src/layers/hillshading2d/hillshading2dLayer.ts +0 -172
- package/src/layers/index.ts +0 -35
- package/src/layers/intersection/intersectionView.stories.tsx +0 -294
- package/src/layers/intersection/unfoldedGeoJsonLayer.ts +0 -92
- package/src/layers/map/fragment.fs.glsl.ts +0 -127
- package/src/layers/map/fragment_lines.glsl.ts +0 -21
- package/src/layers/map/mapLayer.stories.tsx +0 -1369
- package/src/layers/map/mapLayer.ts +0 -470
- package/src/layers/map/privateMapLayer.ts +0 -317
- package/src/layers/map/vertex.glsl.ts +0 -45
- package/src/layers/map/vertex_lines.glsl.ts +0 -15
- package/src/layers/map/webworker.ts +0 -479
- package/src/layers/northarrow/northArrow.stories.tsx +0 -108
- package/src/layers/northarrow/northArrow3DLayer.ts +0 -204
- package/src/layers/northarrow/northarrow-fragment.glsl.js +0 -14
- package/src/layers/northarrow/northarrow-vertex.glsl.js +0 -13
- package/src/layers/piechart/fragment.glsl.js +0 -42
- package/src/layers/piechart/pieChartLayer.ts +0 -246
- package/src/layers/piechart/vertex.glsl.js +0 -42
- package/src/layers/points/pointsLayer.stories.tsx +0 -141
- package/src/layers/points/pointsLayer.ts +0 -143
- package/src/layers/polylines/polylinesLayer.stories.tsx +0 -144
- package/src/layers/polylines/polylinesLayer.ts +0 -263
- package/src/layers/selectable_geojson/selectableGeoJsonLayer.ts +0 -25
- package/src/layers/shader_modules/decoder.fs.glsl.ts +0 -41
- package/src/layers/shader_modules/decoder.ts +0 -46
- package/src/layers/shader_modules/index.ts +0 -1
- package/src/layers/terrain/map3DLayer.stories.tsx +0 -340
- package/src/layers/terrain/map3DLayer.ts +0 -556
- package/src/layers/terrain/terrainMapLayer.ts +0 -334
- package/src/layers/terrain/terrainmap.fs.glsl.ts +0 -134
- package/src/layers/triangle/fragment.fs.glsl.ts +0 -126
- package/src/layers/triangle/fragment_lines.glsl.ts +0 -21
- package/src/layers/triangle/privateTriangleLayer.ts +0 -203
- package/src/layers/triangle/test_data/surfacePoints.ts +0 -4344
- package/src/layers/triangle/test_data/surfaceTriangles.ts +0 -7392
- package/src/layers/triangle/triangleLayer.stories.tsx +0 -191
- package/src/layers/triangle/triangleLayer.ts +0 -273
- package/src/layers/triangle/vertex.glsl.ts +0 -35
- package/src/layers/triangle/vertex_lines.glsl.ts +0 -15
- package/src/layers/triangle/webworker.ts +0 -165
- package/src/layers/utils/glsl.d.ts +0 -4
- package/src/layers/utils/layerTools.ts +0 -182
- package/src/layers/utils/propertyMapTools.ts +0 -43
- package/src/layers/wells/utils/spline.ts +0 -318
- package/src/layers/wells/wellsLayer.stories.tsx +0 -625
- package/src/layers/wells/wellsLayer.ts +0 -1377
- package/src/redux/actions.ts +0 -8
- package/src/redux/reducer.ts +0 -43
- package/src/redux/store.ts +0 -15
- package/src/redux/types.ts +0 -114
- package/src/storybook/SubsurfaceViewer.stories.jsx +0 -644
- package/src/storybook/components/InfoCard.stories.jsx +0 -39
- package/src/storybook/components/colorLegends/ContinuousLegend.stories.jsx +0 -32
- package/src/storybook/components/colorLegends/DiscreteLegend.stories.jsx +0 -33
- package/src/storybook/components/colorLegends/IndividualScaleForMap.stories.jsx +0 -99
- package/src/storybook/components/colorLegends/SingleScaleForMap.stories.jsx +0 -120
- package/src/storybook/components/settings/LayerSettingsButton.stories.jsx +0 -34
- package/src/storybook/components/settings/NumericInput.stories.jsx +0 -17
- package/src/storybook/components/settings/ToggleButton.stories.jsx +0 -16
- package/src/storybook/schemaValidation/sampleData.js +0 -177
- package/src/storybook/schemaValidation/schemaValidation.stories.jsx +0 -91
- package/src/test/TestWrapper.tsx +0 -13
- package/src/utils/configuration.ts +0 -61
- package/src/utils/fit-bounds.js +0 -85
- package/src/utils/measurement.ts +0 -61
- package/src/utils/northArrow.ts +0 -4
- package/src/utils/specExtractor.ts +0 -36
- package/src/viewports/index.js +0 -1
- package/src/viewports/intersectionViewport.ts +0 -137
- package/src/views/index.js +0 -1
- package/src/views/intersectionView.ts +0 -38
- package/tsconfig.json +0 -7
|
@@ -1,625 +0,0 @@
|
|
|
1
|
-
/* eslint-disable react-hooks/exhaustive-deps */ // remove when ready to fix these.
|
|
2
|
-
|
|
3
|
-
import React, { useState } from "react";
|
|
4
|
-
import { styled } from "@mui/material/styles";
|
|
5
|
-
import SubsurfaceViewer from "../../SubsurfaceViewer";
|
|
6
|
-
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
7
|
-
import { NativeSelect } from "@equinor/eds-core-react";
|
|
8
|
-
import {
|
|
9
|
-
createColorMapFunction,
|
|
10
|
-
ColorLegend,
|
|
11
|
-
colorTables,
|
|
12
|
-
} from "@emerson-eps/color-tables";
|
|
13
|
-
import { MapMouseEvent } from "../../components/Map";
|
|
14
|
-
const PREFIX = "VolveWells";
|
|
15
|
-
|
|
16
|
-
const classes = {
|
|
17
|
-
main: `${PREFIX}-main`,
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const Root = styled("div")({
|
|
21
|
-
[`& .${classes.main}`]: {
|
|
22
|
-
height: 500,
|
|
23
|
-
border: "1px solid black",
|
|
24
|
-
position: "relative",
|
|
25
|
-
},
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
export default {
|
|
29
|
-
component: SubsurfaceViewer,
|
|
30
|
-
title: "SubsurfaceViewer / Wells Layer",
|
|
31
|
-
} as ComponentMeta<typeof SubsurfaceViewer>;
|
|
32
|
-
|
|
33
|
-
const Template: ComponentStory<typeof SubsurfaceViewer> = (args) => (
|
|
34
|
-
<SubsurfaceViewer {...args} />
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
const defaultProps = {
|
|
38
|
-
id: "volve-wells",
|
|
39
|
-
resources: {
|
|
40
|
-
wellsData: "./volve_wells.json",
|
|
41
|
-
},
|
|
42
|
-
bounds: [432150, 6475800, 439400, 6481500] as [
|
|
43
|
-
number,
|
|
44
|
-
number,
|
|
45
|
-
number,
|
|
46
|
-
number
|
|
47
|
-
],
|
|
48
|
-
layers: [
|
|
49
|
-
{
|
|
50
|
-
"@@type": "WellsLayer",
|
|
51
|
-
data: "@@#resources.wellsData",
|
|
52
|
-
},
|
|
53
|
-
],
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const continuousLogsLayer = {
|
|
57
|
-
...defaultProps.layers[0],
|
|
58
|
-
refine: false,
|
|
59
|
-
outline: false,
|
|
60
|
-
logData: "./volve_logs.json",
|
|
61
|
-
logrunName: "BLOCKING",
|
|
62
|
-
logName: "PORO",
|
|
63
|
-
logColor: "Physics",
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
// Volve wells default example.
|
|
67
|
-
export const VolveWells = Template.bind({});
|
|
68
|
-
VolveWells.args = defaultProps;
|
|
69
|
-
VolveWells.parameters = {
|
|
70
|
-
docs: {
|
|
71
|
-
description: {
|
|
72
|
-
story: "Volve wells example",
|
|
73
|
-
},
|
|
74
|
-
inlineStories: false,
|
|
75
|
-
iframeHeight: 500,
|
|
76
|
-
},
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
// Volve wells with mouseCallback function without logs
|
|
80
|
-
const VolveWellsWithMouseCallback: ComponentStory<typeof SubsurfaceViewer> = (
|
|
81
|
-
args
|
|
82
|
-
) => {
|
|
83
|
-
const onMouseEvent = React.useCallback((event: MapMouseEvent) => {
|
|
84
|
-
console.log(event);
|
|
85
|
-
}, []);
|
|
86
|
-
return (
|
|
87
|
-
<>
|
|
88
|
-
<SubsurfaceViewer {...args} onMouseEvent={onMouseEvent} />
|
|
89
|
-
<div
|
|
90
|
-
style={{
|
|
91
|
-
position: "absolute",
|
|
92
|
-
marginLeft: 200,
|
|
93
|
-
}}
|
|
94
|
-
></div>
|
|
95
|
-
</>
|
|
96
|
-
);
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
export const volveWells2 = VolveWellsWithMouseCallback.bind({});
|
|
100
|
-
|
|
101
|
-
volveWells2.args = {
|
|
102
|
-
id: "volve-wells",
|
|
103
|
-
resources: {
|
|
104
|
-
wellsData: "./volve_wells.json",
|
|
105
|
-
},
|
|
106
|
-
bounds: [432150, 6475800, 439400, 6481500] as [
|
|
107
|
-
number,
|
|
108
|
-
number,
|
|
109
|
-
number,
|
|
110
|
-
number
|
|
111
|
-
],
|
|
112
|
-
layers: [
|
|
113
|
-
{
|
|
114
|
-
"@@type": "WellsLayer",
|
|
115
|
-
data: "@@#resources.wellsData",
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
"@@type": "Axes2DLayer",
|
|
119
|
-
id: "axes-layer2D",
|
|
120
|
-
axisColor: [100, 100, 255],
|
|
121
|
-
marginH: 100, // Horizontal margin (in pixels)
|
|
122
|
-
marginV: 40, // Vertical margin (in pixels)
|
|
123
|
-
},
|
|
124
|
-
],
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
// Volve wells with logs.
|
|
128
|
-
//
|
|
129
|
-
export const DiscreteWellLogs = Template.bind({});
|
|
130
|
-
DiscreteWellLogs.args = {
|
|
131
|
-
...defaultProps,
|
|
132
|
-
layers: [
|
|
133
|
-
{
|
|
134
|
-
...defaultProps.layers[0],
|
|
135
|
-
refine: false,
|
|
136
|
-
outline: false,
|
|
137
|
-
logData: "volve_blocking_zonelog_logs.json",
|
|
138
|
-
logrunName: "BLOCKING",
|
|
139
|
-
logName: "ZONELOG",
|
|
140
|
-
logColor: "Stratigraphy",
|
|
141
|
-
},
|
|
142
|
-
],
|
|
143
|
-
};
|
|
144
|
-
DiscreteWellLogs.parameters = {
|
|
145
|
-
docs: {
|
|
146
|
-
description: {
|
|
147
|
-
story: "Volve wells example with well logs.",
|
|
148
|
-
},
|
|
149
|
-
inlineStories: false,
|
|
150
|
-
iframeHeight: 500,
|
|
151
|
-
},
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
export const ContinuousWellLogs = Template.bind({});
|
|
155
|
-
ContinuousWellLogs.args = {
|
|
156
|
-
...defaultProps,
|
|
157
|
-
layers: [continuousLogsLayer],
|
|
158
|
-
};
|
|
159
|
-
ContinuousWellLogs.parameters = {
|
|
160
|
-
docs: {
|
|
161
|
-
description: {
|
|
162
|
-
story: "Volve wells example with well logs.",
|
|
163
|
-
},
|
|
164
|
-
inlineStories: false,
|
|
165
|
-
iframeHeight: 500,
|
|
166
|
-
},
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
export const DashedWells = Template.bind({});
|
|
170
|
-
DashedWells.args = {
|
|
171
|
-
...defaultProps,
|
|
172
|
-
layers: [
|
|
173
|
-
{
|
|
174
|
-
...defaultProps.layers[0],
|
|
175
|
-
lineStyle: { dash: true },
|
|
176
|
-
refine: false,
|
|
177
|
-
outline: false,
|
|
178
|
-
},
|
|
179
|
-
],
|
|
180
|
-
};
|
|
181
|
-
DashedWells.parameters = {
|
|
182
|
-
docs: {
|
|
183
|
-
description: {
|
|
184
|
-
story: "Volve wells example with default dashed well trajectories.",
|
|
185
|
-
},
|
|
186
|
-
inlineStories: false,
|
|
187
|
-
iframeHeight: 500,
|
|
188
|
-
},
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
// Volve wells default example.
|
|
192
|
-
export const MultipleVolveWells = Template.bind({});
|
|
193
|
-
MultipleVolveWells.args = {
|
|
194
|
-
id: "volve-wells",
|
|
195
|
-
resources: {
|
|
196
|
-
wellsData: "./volve_wells_1.json",
|
|
197
|
-
wellsData2: "./volve_wells_2.json",
|
|
198
|
-
},
|
|
199
|
-
bounds: [432150, 6475800, 439400, 6481500] as [
|
|
200
|
-
number,
|
|
201
|
-
number,
|
|
202
|
-
number,
|
|
203
|
-
number
|
|
204
|
-
],
|
|
205
|
-
layers: [
|
|
206
|
-
{
|
|
207
|
-
"@@type": "WellsLayer",
|
|
208
|
-
data: "@@#resources.wellsData",
|
|
209
|
-
id: "id1",
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
"@@type": "WellsLayer",
|
|
213
|
-
data: "@@#resources.wellsData2",
|
|
214
|
-
id: "id2",
|
|
215
|
-
},
|
|
216
|
-
],
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
MultipleVolveWells.parameters = {
|
|
220
|
-
docs: {
|
|
221
|
-
description: {
|
|
222
|
-
story: "Multiple Volve wells example",
|
|
223
|
-
},
|
|
224
|
-
inlineStories: false,
|
|
225
|
-
iframeHeight: 500,
|
|
226
|
-
},
|
|
227
|
-
};
|
|
228
|
-
|
|
229
|
-
export const CustomColoredWells = Template.bind({});
|
|
230
|
-
CustomColoredWells.args = {
|
|
231
|
-
...defaultProps,
|
|
232
|
-
layers: [
|
|
233
|
-
{
|
|
234
|
-
...defaultProps.layers[0],
|
|
235
|
-
lineStyle: { color: [255, 0, 0, 255], dash: [10, 3] },
|
|
236
|
-
wellHeadStyle: { color: [255, 0, 0, 255] },
|
|
237
|
-
refine: false,
|
|
238
|
-
outline: false,
|
|
239
|
-
},
|
|
240
|
-
],
|
|
241
|
-
};
|
|
242
|
-
|
|
243
|
-
CustomColoredWells.parameters = {
|
|
244
|
-
docs: {
|
|
245
|
-
description: {
|
|
246
|
-
story: "Volve wells example with dashed style and red trajectories, with custom style.",
|
|
247
|
-
},
|
|
248
|
-
inlineStories: false,
|
|
249
|
-
iframeHeight: 500,
|
|
250
|
-
},
|
|
251
|
-
};
|
|
252
|
-
|
|
253
|
-
export const CustomWidthWells = Template.bind({});
|
|
254
|
-
CustomWidthWells.args = {
|
|
255
|
-
...defaultProps,
|
|
256
|
-
layers: [
|
|
257
|
-
{
|
|
258
|
-
...defaultProps.layers[0],
|
|
259
|
-
lineStyle: { width: 10 },
|
|
260
|
-
refine: false,
|
|
261
|
-
outline: false,
|
|
262
|
-
},
|
|
263
|
-
],
|
|
264
|
-
};
|
|
265
|
-
|
|
266
|
-
export const VolveWellsWithResetButton: ComponentStory<
|
|
267
|
-
typeof SubsurfaceViewer
|
|
268
|
-
> = (args) => {
|
|
269
|
-
const [editedData, setEditedData] = React.useState(args.editedData);
|
|
270
|
-
const [triggerResetMultipleWells, setTriggerResetMultipleWells] =
|
|
271
|
-
React.useState<number>(0);
|
|
272
|
-
const handleChange1 = () => {
|
|
273
|
-
setTriggerResetMultipleWells(triggerResetMultipleWells + 1);
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
React.useEffect(() => {
|
|
277
|
-
setEditedData(args.editedData);
|
|
278
|
-
}, [args.editedData]);
|
|
279
|
-
|
|
280
|
-
return (
|
|
281
|
-
<Root>
|
|
282
|
-
<div className={classes.main}>
|
|
283
|
-
<SubsurfaceViewer
|
|
284
|
-
{...args}
|
|
285
|
-
editedData={editedData}
|
|
286
|
-
setProps={(updatedProps) => {
|
|
287
|
-
setEditedData(updatedProps);
|
|
288
|
-
}}
|
|
289
|
-
triggerResetMultipleWells={triggerResetMultipleWells}
|
|
290
|
-
/>
|
|
291
|
-
</div>
|
|
292
|
-
<button onClick={handleChange1}> Reset Multiple Wells </button>
|
|
293
|
-
</Root>
|
|
294
|
-
);
|
|
295
|
-
};
|
|
296
|
-
|
|
297
|
-
VolveWellsWithResetButton.args = {
|
|
298
|
-
id: "volve-wells",
|
|
299
|
-
resources: {
|
|
300
|
-
wellsData: "./volve_wells.json",
|
|
301
|
-
},
|
|
302
|
-
bounds: [432150, 6475800, 439400, 6481500] as [
|
|
303
|
-
number,
|
|
304
|
-
number,
|
|
305
|
-
number,
|
|
306
|
-
number
|
|
307
|
-
],
|
|
308
|
-
layers: [
|
|
309
|
-
{
|
|
310
|
-
"@@type": "WellsLayer",
|
|
311
|
-
data: "@@#resources.wellsData",
|
|
312
|
-
},
|
|
313
|
-
],
|
|
314
|
-
};
|
|
315
|
-
|
|
316
|
-
function wellheadSizeCallback(object: Record<string, Record<string, unknown>>) {
|
|
317
|
-
if ((object["properties"]["name"] as string).match("15/9-19")) return 0;
|
|
318
|
-
else return 8;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
function colorCallback(object: Record<string, Record<string, unknown>>) {
|
|
322
|
-
if ((object["properties"]["name"] as string).match("15/9-F-10"))
|
|
323
|
-
return [0, 0, 0, 0];
|
|
324
|
-
else return object["properties"]["color"];
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
function dashCallback(object: Record<string, Record<string, unknown>>) {
|
|
328
|
-
if ((object["properties"]["name"] as string).match("15/9-19"))
|
|
329
|
-
return [1.5, 1.5];
|
|
330
|
-
else if (object["properties"]["name"] === "15/9-F-15") return true;
|
|
331
|
-
else return false;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
function widthCallback(object: Record<string, Record<string, unknown>>) {
|
|
335
|
-
if ((object["properties"]["name"] as string).match("15/9-F-1")) return 3;
|
|
336
|
-
else if (object["properties"]["name"] === "15/9-F-4") return 8;
|
|
337
|
-
else return 5;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
export const CallbackStyledWells = Template.bind({});
|
|
341
|
-
CallbackStyledWells.args = {
|
|
342
|
-
...defaultProps,
|
|
343
|
-
layers: [
|
|
344
|
-
{
|
|
345
|
-
...defaultProps.layers[0],
|
|
346
|
-
lineStyle: {
|
|
347
|
-
color: colorCallback,
|
|
348
|
-
dash: dashCallback,
|
|
349
|
-
width: widthCallback,
|
|
350
|
-
},
|
|
351
|
-
wellHeadStyle: {
|
|
352
|
-
size: wellheadSizeCallback,
|
|
353
|
-
},
|
|
354
|
-
refine: false,
|
|
355
|
-
outline: false,
|
|
356
|
-
},
|
|
357
|
-
],
|
|
358
|
-
};
|
|
359
|
-
CallbackStyledWells.parameters = {
|
|
360
|
-
docs: {
|
|
361
|
-
description: {
|
|
362
|
-
story: "Volve wells example with trajectory color, width and dash style supplied as callback.",
|
|
363
|
-
},
|
|
364
|
-
inlineStories: false,
|
|
365
|
-
iframeHeight: 500,
|
|
366
|
-
},
|
|
367
|
-
};
|
|
368
|
-
|
|
369
|
-
export const AllTrajectoryHidden = Template.bind({});
|
|
370
|
-
AllTrajectoryHidden.args = {
|
|
371
|
-
...defaultProps,
|
|
372
|
-
layers: [
|
|
373
|
-
{
|
|
374
|
-
...defaultProps.layers[0],
|
|
375
|
-
lineStyle: { color: [0, 0, 0, 0] },
|
|
376
|
-
refine: false,
|
|
377
|
-
outline: false,
|
|
378
|
-
},
|
|
379
|
-
],
|
|
380
|
-
};
|
|
381
|
-
|
|
382
|
-
AllTrajectoryHidden.parameters = {
|
|
383
|
-
docs: {
|
|
384
|
-
description: {
|
|
385
|
-
story: "Volve wells example with all trajectory hidden.",
|
|
386
|
-
},
|
|
387
|
-
inlineStories: false,
|
|
388
|
-
iframeHeight: 500,
|
|
389
|
-
},
|
|
390
|
-
};
|
|
391
|
-
|
|
392
|
-
export const AllWellHeadsHidden = Template.bind({});
|
|
393
|
-
AllWellHeadsHidden.args = {
|
|
394
|
-
...defaultProps,
|
|
395
|
-
layers: [
|
|
396
|
-
{
|
|
397
|
-
...defaultProps.layers[0],
|
|
398
|
-
wellHeadStyle: { size: 0 },
|
|
399
|
-
refine: false,
|
|
400
|
-
outline: false,
|
|
401
|
-
},
|
|
402
|
-
],
|
|
403
|
-
};
|
|
404
|
-
AllWellHeadsHidden.parameters = {
|
|
405
|
-
docs: {
|
|
406
|
-
description: {
|
|
407
|
-
story: "Volve wells example with all well heads hidden.",
|
|
408
|
-
},
|
|
409
|
-
inlineStories: false,
|
|
410
|
-
iframeHeight: 500,
|
|
411
|
-
},
|
|
412
|
-
};
|
|
413
|
-
|
|
414
|
-
export const Wells3d = Template.bind({});
|
|
415
|
-
Wells3d.args = {
|
|
416
|
-
...defaultProps,
|
|
417
|
-
views: {
|
|
418
|
-
layout: [1, 1],
|
|
419
|
-
viewports: [
|
|
420
|
-
{
|
|
421
|
-
id: "a",
|
|
422
|
-
show3D: true,
|
|
423
|
-
},
|
|
424
|
-
],
|
|
425
|
-
},
|
|
426
|
-
};
|
|
427
|
-
Wells3d.parameters = {
|
|
428
|
-
docs: {
|
|
429
|
-
description: {
|
|
430
|
-
story: "3D wells example",
|
|
431
|
-
},
|
|
432
|
-
inlineStories: false,
|
|
433
|
-
iframeHeight: 500,
|
|
434
|
-
},
|
|
435
|
-
};
|
|
436
|
-
|
|
437
|
-
export const Wells3dDashed = Template.bind({});
|
|
438
|
-
Wells3dDashed.args = {
|
|
439
|
-
...defaultProps,
|
|
440
|
-
layers: [
|
|
441
|
-
{
|
|
442
|
-
...defaultProps.layers[0],
|
|
443
|
-
lineStyle: { dash: true },
|
|
444
|
-
refine: false,
|
|
445
|
-
outline: false,
|
|
446
|
-
},
|
|
447
|
-
],
|
|
448
|
-
views: {
|
|
449
|
-
layout: [1, 1],
|
|
450
|
-
viewports: [
|
|
451
|
-
{
|
|
452
|
-
id: "a",
|
|
453
|
-
show3D: true,
|
|
454
|
-
},
|
|
455
|
-
],
|
|
456
|
-
},
|
|
457
|
-
};
|
|
458
|
-
Wells3dDashed.parameters = {
|
|
459
|
-
docs: {
|
|
460
|
-
description: {
|
|
461
|
-
story: "3D dashed wells example",
|
|
462
|
-
},
|
|
463
|
-
inlineStories: false,
|
|
464
|
-
iframeHeight: 500,
|
|
465
|
-
},
|
|
466
|
-
};
|
|
467
|
-
|
|
468
|
-
export const ContinuousColorTable: React.FC = () => {
|
|
469
|
-
const [colorTable, setColorTable] = useState("Physics");
|
|
470
|
-
|
|
471
|
-
const mapProps = React.useMemo(() => {
|
|
472
|
-
return {
|
|
473
|
-
...defaultProps,
|
|
474
|
-
layers: [
|
|
475
|
-
{
|
|
476
|
-
...continuousLogsLayer,
|
|
477
|
-
logColor: colorTable,
|
|
478
|
-
},
|
|
479
|
-
],
|
|
480
|
-
};
|
|
481
|
-
}, [colorTable]);
|
|
482
|
-
|
|
483
|
-
const handleOnChange = (event: React.FormEvent) => {
|
|
484
|
-
setColorTable((event.target as HTMLInputElement)?.value);
|
|
485
|
-
};
|
|
486
|
-
return (
|
|
487
|
-
<>
|
|
488
|
-
<NativeSelect
|
|
489
|
-
id={"test"}
|
|
490
|
-
label={"Color table"}
|
|
491
|
-
value={colorTable}
|
|
492
|
-
onChange={handleOnChange}
|
|
493
|
-
>
|
|
494
|
-
<option key={"Physics"}>{"Physics"}</option>
|
|
495
|
-
<option key={"Rainbow"}>{"Rainbow"}</option>
|
|
496
|
-
</NativeSelect>
|
|
497
|
-
{
|
|
498
|
-
<div style={{ height: "80vh", position: "relative" }}>
|
|
499
|
-
<SubsurfaceViewer {...mapProps} />
|
|
500
|
-
</div>
|
|
501
|
-
}
|
|
502
|
-
</>
|
|
503
|
-
);
|
|
504
|
-
};
|
|
505
|
-
|
|
506
|
-
// colorselector for welllayer
|
|
507
|
-
const wellLayers = [
|
|
508
|
-
{
|
|
509
|
-
...defaultProps.layers[0],
|
|
510
|
-
refine: false,
|
|
511
|
-
outline: false,
|
|
512
|
-
logData: "./volve_logs.json",
|
|
513
|
-
logrunName: "BLOCKING",
|
|
514
|
-
logName: "ZONELOG",
|
|
515
|
-
logColor: "Stratigraphy",
|
|
516
|
-
colorMappingFunction: createColorMapFunction("Stratigraphy"),
|
|
517
|
-
},
|
|
518
|
-
];
|
|
519
|
-
|
|
520
|
-
// prop for legend
|
|
521
|
-
const min = 0;
|
|
522
|
-
const max = 0.35;
|
|
523
|
-
const dataObjectName = "ZONELOG";
|
|
524
|
-
const position = [16, 10];
|
|
525
|
-
const horizontal = true;
|
|
526
|
-
const discreteData = {
|
|
527
|
-
Above_BCU: [[], 0],
|
|
528
|
-
ABOVE: [[], 1],
|
|
529
|
-
H12: [[], 2],
|
|
530
|
-
H11: [[], 3],
|
|
531
|
-
H10: [[], 4],
|
|
532
|
-
H9: [[], 5],
|
|
533
|
-
H8: [[], 6],
|
|
534
|
-
H7: [[], 7],
|
|
535
|
-
H6: [[], 8],
|
|
536
|
-
H5: [[], 9],
|
|
537
|
-
H4: [[], 10],
|
|
538
|
-
H3: [[], 11],
|
|
539
|
-
H2: [[], 12],
|
|
540
|
-
H1: [[], 13],
|
|
541
|
-
BELOW: [[], 14],
|
|
542
|
-
};
|
|
543
|
-
const reverseRange = false;
|
|
544
|
-
|
|
545
|
-
//eslint-disable-next-line
|
|
546
|
-
const wellLayerTemplate = (args: any) => {
|
|
547
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
548
|
-
const [getColorName, setColorName] = React.useState("Rainbow");
|
|
549
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
550
|
-
const [isLog, setIsLog] = React.useState(false);
|
|
551
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
552
|
-
const wellLayerData = React.useCallback(
|
|
553
|
-
(data: React.SetStateAction<string>) => {
|
|
554
|
-
setColorName(data);
|
|
555
|
-
},
|
|
556
|
-
[]
|
|
557
|
-
);
|
|
558
|
-
|
|
559
|
-
// interpolation method
|
|
560
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
561
|
-
const getInterpolateMethod = React.useCallback(
|
|
562
|
-
(data: { isLog: boolean | ((prevState: boolean) => boolean) }) => {
|
|
563
|
-
setIsLog(data.isLog);
|
|
564
|
-
},
|
|
565
|
-
[]
|
|
566
|
-
);
|
|
567
|
-
|
|
568
|
-
const layers = [
|
|
569
|
-
{
|
|
570
|
-
...args.wellLayers[0],
|
|
571
|
-
colorMappingFunction: createColorMapFunction(getColorName),
|
|
572
|
-
logColor: getColorName ? getColorName : wellLayers[0].logColor,
|
|
573
|
-
isLog: isLog,
|
|
574
|
-
},
|
|
575
|
-
];
|
|
576
|
-
return (
|
|
577
|
-
<div>
|
|
578
|
-
<div
|
|
579
|
-
style={{
|
|
580
|
-
float: "right",
|
|
581
|
-
zIndex: 999,
|
|
582
|
-
opacity: 1,
|
|
583
|
-
position: "relative",
|
|
584
|
-
}}
|
|
585
|
-
>
|
|
586
|
-
<ColorLegend
|
|
587
|
-
{...args}
|
|
588
|
-
getColorName={wellLayerData}
|
|
589
|
-
getInterpolateMethod={getInterpolateMethod}
|
|
590
|
-
/>
|
|
591
|
-
</div>
|
|
592
|
-
<SubsurfaceViewer {...args} layers={layers} />
|
|
593
|
-
</div>
|
|
594
|
-
);
|
|
595
|
-
};
|
|
596
|
-
|
|
597
|
-
//eslint-disable-next-line
|
|
598
|
-
export const LegendWithColorSelector: any = wellLayerTemplate.bind({});
|
|
599
|
-
|
|
600
|
-
LegendWithColorSelector.args = {
|
|
601
|
-
min,
|
|
602
|
-
max,
|
|
603
|
-
dataObjectName,
|
|
604
|
-
position,
|
|
605
|
-
horizontal,
|
|
606
|
-
colorTables,
|
|
607
|
-
discreteData,
|
|
608
|
-
...defaultProps,
|
|
609
|
-
id: defaultProps.id,
|
|
610
|
-
wellLayers,
|
|
611
|
-
legend: {
|
|
612
|
-
visible: false,
|
|
613
|
-
},
|
|
614
|
-
reverseRange,
|
|
615
|
-
};
|
|
616
|
-
|
|
617
|
-
LegendWithColorSelector.parameters = {
|
|
618
|
-
docs: {
|
|
619
|
-
description: {
|
|
620
|
-
story: "Clicking on legend opens(toggle) the color selector component and then click on the color scale to update the layer.",
|
|
621
|
-
},
|
|
622
|
-
inlineStories: false,
|
|
623
|
-
iframeHeight: 500,
|
|
624
|
-
},
|
|
625
|
-
};
|