@webviz/subsurface-viewer 0.0.1-alpha.1 → 0.0.2-alpha.1
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/package.json +5 -2
- package/package.json +6 -3
- 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,315 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"accessors": [
|
|
3
|
-
{
|
|
4
|
-
"bufferView": 2,
|
|
5
|
-
"componentType": 5126,
|
|
6
|
-
"count": 108,
|
|
7
|
-
"max": [
|
|
8
|
-
6.058886528015137,
|
|
9
|
-
0.5000003576278687,
|
|
10
|
-
2.348930835723877
|
|
11
|
-
],
|
|
12
|
-
"min": [
|
|
13
|
-
-6.058886528015137,
|
|
14
|
-
-0.5000004172325134,
|
|
15
|
-
-2.348930835723877
|
|
16
|
-
],
|
|
17
|
-
"type": "VEC3"
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
"bufferView": 2,
|
|
21
|
-
"byteOffset": 1296,
|
|
22
|
-
"componentType": 5126,
|
|
23
|
-
"count": 108,
|
|
24
|
-
"max": [
|
|
25
|
-
0.9308037757873535,
|
|
26
|
-
1.0,
|
|
27
|
-
0.9998587369918823
|
|
28
|
-
],
|
|
29
|
-
"min": [
|
|
30
|
-
-1.0,
|
|
31
|
-
-1.0,
|
|
32
|
-
-0.9998587369918823
|
|
33
|
-
],
|
|
34
|
-
"type": "VEC3"
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"bufferView": 3,
|
|
38
|
-
"componentType": 5126,
|
|
39
|
-
"count": 108,
|
|
40
|
-
"max": [
|
|
41
|
-
1.0,
|
|
42
|
-
3.387607421245775e-07,
|
|
43
|
-
1.0,
|
|
44
|
-
1.0
|
|
45
|
-
],
|
|
46
|
-
"min": [
|
|
47
|
-
-1.0,
|
|
48
|
-
-4.178712970315246e-06,
|
|
49
|
-
-0.9308037757873535,
|
|
50
|
-
1.0
|
|
51
|
-
],
|
|
52
|
-
"type": "VEC4"
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"bufferView": 1,
|
|
56
|
-
"componentType": 5126,
|
|
57
|
-
"count": 108,
|
|
58
|
-
"max": [
|
|
59
|
-
0.9870268106460571,
|
|
60
|
-
0.9908186793327332
|
|
61
|
-
],
|
|
62
|
-
"min": [
|
|
63
|
-
0.006224204320460558,
|
|
64
|
-
0.010728782042860985
|
|
65
|
-
],
|
|
66
|
-
"type": "VEC2"
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
"bufferView": 1,
|
|
70
|
-
"byteOffset": 864,
|
|
71
|
-
"componentType": 5126,
|
|
72
|
-
"count": 108,
|
|
73
|
-
"max": [
|
|
74
|
-
0.9870268106460571,
|
|
75
|
-
0.9908186793327332
|
|
76
|
-
],
|
|
77
|
-
"min": [
|
|
78
|
-
0.006224204320460558,
|
|
79
|
-
0.010728782042860985
|
|
80
|
-
],
|
|
81
|
-
"type": "VEC2"
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
"bufferView": 1,
|
|
85
|
-
"byteOffset": 1728,
|
|
86
|
-
"componentType": 5126,
|
|
87
|
-
"count": 108,
|
|
88
|
-
"max": [
|
|
89
|
-
0.9870268106460571,
|
|
90
|
-
0.9908186793327332
|
|
91
|
-
],
|
|
92
|
-
"min": [
|
|
93
|
-
0.006224204320460558,
|
|
94
|
-
0.010728782042860985
|
|
95
|
-
],
|
|
96
|
-
"type": "VEC2"
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
"bufferView": 0,
|
|
100
|
-
"componentType": 5125,
|
|
101
|
-
"count": 324,
|
|
102
|
-
"type": "SCALAR"
|
|
103
|
-
}
|
|
104
|
-
],
|
|
105
|
-
"asset": {
|
|
106
|
-
"extras": {
|
|
107
|
-
"author": "plaggy (https://sketchfab.com/plaggy)",
|
|
108
|
-
"license": "CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/)",
|
|
109
|
-
"source": "https://sketchfab.com/3d-models/cc0-arrow-5-f38febed165240b9aea5289c215c6b65",
|
|
110
|
-
"title": "CC0 - Arrow 5"
|
|
111
|
-
},
|
|
112
|
-
"generator": "Sketchfab-10.50.0",
|
|
113
|
-
"version": "2.0"
|
|
114
|
-
},
|
|
115
|
-
"bufferViews": [
|
|
116
|
-
{
|
|
117
|
-
"buffer": 0,
|
|
118
|
-
"byteLength": 1296,
|
|
119
|
-
"name": "floatBufferViews",
|
|
120
|
-
"target": 34963
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
"buffer": 0,
|
|
124
|
-
"byteLength": 2592,
|
|
125
|
-
"byteOffset": 1296,
|
|
126
|
-
"byteStride": 8,
|
|
127
|
-
"name": "floatBufferViews",
|
|
128
|
-
"target": 34962
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
"buffer": 0,
|
|
132
|
-
"byteLength": 2592,
|
|
133
|
-
"byteOffset": 3888,
|
|
134
|
-
"byteStride": 12,
|
|
135
|
-
"name": "floatBufferViews",
|
|
136
|
-
"target": 34962
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
"buffer": 0,
|
|
140
|
-
"byteLength": 1728,
|
|
141
|
-
"byteOffset": 6480,
|
|
142
|
-
"byteStride": 16,
|
|
143
|
-
"name": "floatBufferViews",
|
|
144
|
-
"target": 34962
|
|
145
|
-
}
|
|
146
|
-
],
|
|
147
|
-
"buffers": [
|
|
148
|
-
{
|
|
149
|
-
"byteLength": 8208,
|
|
150
|
-
"uri": "scene.bin"
|
|
151
|
-
}
|
|
152
|
-
],
|
|
153
|
-
"images": [
|
|
154
|
-
{
|
|
155
|
-
"uri": "textures/Arrow5_baseColor.png"
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
"uri": "textures/Arrow5_metallicRoughness.png"
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
"uri": "textures/Arrow5_normal.png"
|
|
162
|
-
}
|
|
163
|
-
],
|
|
164
|
-
"materials": [
|
|
165
|
-
{
|
|
166
|
-
"name": "Arrow5",
|
|
167
|
-
"normalTexture": {
|
|
168
|
-
"index": 2
|
|
169
|
-
},
|
|
170
|
-
"pbrMetallicRoughness": {
|
|
171
|
-
"baseColorTexture": {
|
|
172
|
-
"index": 0
|
|
173
|
-
},
|
|
174
|
-
"metallicRoughnessTexture": {
|
|
175
|
-
"index": 1
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
],
|
|
180
|
-
"meshes": [
|
|
181
|
-
{
|
|
182
|
-
"name": "Arrow5_Arrow5_0",
|
|
183
|
-
"primitives": [
|
|
184
|
-
{
|
|
185
|
-
"attributes": {
|
|
186
|
-
"NORMAL": 1,
|
|
187
|
-
"POSITION": 0,
|
|
188
|
-
"TANGENT": 2,
|
|
189
|
-
"TEXCOORD_0": 3,
|
|
190
|
-
"TEXCOORD_1": 4,
|
|
191
|
-
"TEXCOORD_2": 5
|
|
192
|
-
},
|
|
193
|
-
"indices": 6,
|
|
194
|
-
"material": 0,
|
|
195
|
-
"mode": 4
|
|
196
|
-
}
|
|
197
|
-
]
|
|
198
|
-
}
|
|
199
|
-
],
|
|
200
|
-
"nodes": [
|
|
201
|
-
{
|
|
202
|
-
"children": [
|
|
203
|
-
1
|
|
204
|
-
],
|
|
205
|
-
"matrix": [
|
|
206
|
-
1.0,
|
|
207
|
-
0.0,
|
|
208
|
-
0.0,
|
|
209
|
-
0.0,
|
|
210
|
-
0.0,
|
|
211
|
-
2.220446049250313e-16,
|
|
212
|
-
-1.0,
|
|
213
|
-
0.0,
|
|
214
|
-
0.0,
|
|
215
|
-
1.0,
|
|
216
|
-
2.220446049250313e-16,
|
|
217
|
-
0.0,
|
|
218
|
-
0.0,
|
|
219
|
-
0.0,
|
|
220
|
-
0.0,
|
|
221
|
-
1.0
|
|
222
|
-
],
|
|
223
|
-
"name": "Sketchfab_model"
|
|
224
|
-
},
|
|
225
|
-
{
|
|
226
|
-
"children": [
|
|
227
|
-
2
|
|
228
|
-
],
|
|
229
|
-
"matrix": [
|
|
230
|
-
1.0,
|
|
231
|
-
0.0,
|
|
232
|
-
0.0,
|
|
233
|
-
0.0,
|
|
234
|
-
0.0,
|
|
235
|
-
0.0,
|
|
236
|
-
1.0,
|
|
237
|
-
0.0,
|
|
238
|
-
0.0,
|
|
239
|
-
-1.0,
|
|
240
|
-
0.0,
|
|
241
|
-
0.0,
|
|
242
|
-
0.0,
|
|
243
|
-
0.0,
|
|
244
|
-
0.0,
|
|
245
|
-
1.0
|
|
246
|
-
],
|
|
247
|
-
"name": "1095acfb6b0747db8a7aadff5b388720.fbx"
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
"children": [
|
|
251
|
-
3
|
|
252
|
-
],
|
|
253
|
-
"name": "RootNode"
|
|
254
|
-
},
|
|
255
|
-
{
|
|
256
|
-
"children": [
|
|
257
|
-
4
|
|
258
|
-
],
|
|
259
|
-
"matrix": [
|
|
260
|
-
0.02539999969303608,
|
|
261
|
-
0.0,
|
|
262
|
-
0.0,
|
|
263
|
-
0.0,
|
|
264
|
-
0.0,
|
|
265
|
-
5.639932896936113e-18,
|
|
266
|
-
-0.02539999969303608,
|
|
267
|
-
0.0,
|
|
268
|
-
0.0,
|
|
269
|
-
0.02539999969303608,
|
|
270
|
-
5.639932896936113e-18,
|
|
271
|
-
0.0,
|
|
272
|
-
0.0,
|
|
273
|
-
0.0,
|
|
274
|
-
0.0,
|
|
275
|
-
1.0
|
|
276
|
-
],
|
|
277
|
-
"name": "Arrow5"
|
|
278
|
-
},
|
|
279
|
-
{
|
|
280
|
-
"mesh": 0,
|
|
281
|
-
"name": "Arrow5_Arrow5_0"
|
|
282
|
-
}
|
|
283
|
-
],
|
|
284
|
-
"samplers": [
|
|
285
|
-
{
|
|
286
|
-
"magFilter": 9729,
|
|
287
|
-
"minFilter": 9987,
|
|
288
|
-
"wrapS": 10497,
|
|
289
|
-
"wrapT": 10497
|
|
290
|
-
}
|
|
291
|
-
],
|
|
292
|
-
"scene": 0,
|
|
293
|
-
"scenes": [
|
|
294
|
-
{
|
|
295
|
-
"name": "Sketchfab_Scene",
|
|
296
|
-
"nodes": [
|
|
297
|
-
0
|
|
298
|
-
]
|
|
299
|
-
}
|
|
300
|
-
],
|
|
301
|
-
"textures": [
|
|
302
|
-
{
|
|
303
|
-
"sampler": 0,
|
|
304
|
-
"source": 0
|
|
305
|
-
},
|
|
306
|
-
{
|
|
307
|
-
"sampler": 0,
|
|
308
|
-
"source": 1
|
|
309
|
-
},
|
|
310
|
-
{
|
|
311
|
-
"sampler": 0,
|
|
312
|
-
"source": 2
|
|
313
|
-
}
|
|
314
|
-
]
|
|
315
|
-
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
|
-
import { render } from "@testing-library/react";
|
|
3
|
-
import "jest-styled-components";
|
|
4
|
-
import "@testing-library/jest-dom";
|
|
5
|
-
import React from "react";
|
|
6
|
-
import ColorLegend from "./ColorLegend";
|
|
7
|
-
import { ExtendedLayer } from "../layers/utils/layerTools";
|
|
8
|
-
import { colorTables } from "@emerson-eps/color-tables";
|
|
9
|
-
|
|
10
|
-
describe("Test Color Legend component", () => {
|
|
11
|
-
xit("snapshot test", () => {
|
|
12
|
-
const { container } = render(
|
|
13
|
-
<ColorLegend
|
|
14
|
-
layer={
|
|
15
|
-
{
|
|
16
|
-
"@@type": "ColormapLayer",
|
|
17
|
-
image: "@@#resources.propertyMap",
|
|
18
|
-
rotDeg: 0,
|
|
19
|
-
bounds: [432205, 6475078, 437720, 6481113],
|
|
20
|
-
colorMapName: "Rainbow",
|
|
21
|
-
valueRange: [2782, 3513],
|
|
22
|
-
colorMapRange: [2782, 3513],
|
|
23
|
-
} as unknown as ExtendedLayer<unknown>
|
|
24
|
-
}
|
|
25
|
-
colorTables={colorTables}
|
|
26
|
-
horizontal={false}
|
|
27
|
-
reverseRange={false}
|
|
28
|
-
/>
|
|
29
|
-
);
|
|
30
|
-
expect(container.firstChild).toMatchSnapshot();
|
|
31
|
-
});
|
|
32
|
-
});
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/* eslint-disable react-hooks/exhaustive-deps */ // remove when ready to fix these.
|
|
2
|
-
|
|
3
|
-
import React from "react";
|
|
4
|
-
import {
|
|
5
|
-
DiscreteColorLegend,
|
|
6
|
-
ContinuousLegend,
|
|
7
|
-
} from "@emerson-eps/color-tables";
|
|
8
|
-
import { ExtendedLayer } from "../layers/utils/layerTools";
|
|
9
|
-
import { Color } from "@deck.gl/core/typed";
|
|
10
|
-
import { colorTablesArray } from "@emerson-eps/color-tables/";
|
|
11
|
-
import { colorMapFunctionType } from "../layers/utils/layerTools";
|
|
12
|
-
|
|
13
|
-
interface LegendBaseData {
|
|
14
|
-
title: string;
|
|
15
|
-
colorName: string;
|
|
16
|
-
discrete: boolean;
|
|
17
|
-
colorMapFunction?: colorMapFunctionType;
|
|
18
|
-
}
|
|
19
|
-
export interface DiscreteLegendDataType extends LegendBaseData {
|
|
20
|
-
metadata: Record<string, [Color, number]>;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface ContinuousLegendDataType extends LegendBaseData {
|
|
24
|
-
valueRange: [number, number];
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
interface ColorLegendProps {
|
|
28
|
-
horizontal?: boolean | null;
|
|
29
|
-
layer: ExtendedLayer<unknown>;
|
|
30
|
-
colorTables: colorTablesArray | string | undefined;
|
|
31
|
-
reverseRange?: boolean;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const ColorLegend: React.FC<ColorLegendProps> = ({
|
|
35
|
-
horizontal,
|
|
36
|
-
layer,
|
|
37
|
-
colorTables,
|
|
38
|
-
reverseRange,
|
|
39
|
-
}: ColorLegendProps) => {
|
|
40
|
-
const [legendData, setLegendData] = React.useState<
|
|
41
|
-
DiscreteLegendDataType | ContinuousLegendDataType
|
|
42
|
-
>();
|
|
43
|
-
React.useEffect(() => {
|
|
44
|
-
const legend_data = layer.getLegendData?.() ?? layer.state?.["legend"];
|
|
45
|
-
setLegendData(legend_data);
|
|
46
|
-
}, [layer.props, layer.state?.["legend"]]);
|
|
47
|
-
|
|
48
|
-
if (!legendData || !layer.props.visible) return null;
|
|
49
|
-
|
|
50
|
-
return (
|
|
51
|
-
<div style={{ marginTop: 30 }}>
|
|
52
|
-
{legendData.discrete && (
|
|
53
|
-
<DiscreteColorLegend
|
|
54
|
-
discreteData={
|
|
55
|
-
(legendData as DiscreteLegendDataType).metadata
|
|
56
|
-
}
|
|
57
|
-
dataObjectName={legendData.title}
|
|
58
|
-
colorName={legendData.colorName}
|
|
59
|
-
horizontal={horizontal}
|
|
60
|
-
colorTables={colorTables}
|
|
61
|
-
/>
|
|
62
|
-
)}
|
|
63
|
-
{!legendData.discrete && (
|
|
64
|
-
<ContinuousLegend
|
|
65
|
-
min={(legendData as ContinuousLegendDataType).valueRange[0]}
|
|
66
|
-
max={(legendData as ContinuousLegendDataType).valueRange[1]}
|
|
67
|
-
dataObjectName={legendData.title}
|
|
68
|
-
colorName={legendData.colorName}
|
|
69
|
-
horizontal={horizontal}
|
|
70
|
-
id={layer.props.id}
|
|
71
|
-
colorTables={colorTables}
|
|
72
|
-
colorMapFunction={legendData.colorMapFunction}
|
|
73
|
-
reverseRange={reverseRange}
|
|
74
|
-
/>
|
|
75
|
-
)}
|
|
76
|
-
</div>
|
|
77
|
-
);
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
export default ColorLegend;
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
|
-
import { render } from "@testing-library/react";
|
|
3
|
-
import "jest-styled-components";
|
|
4
|
-
import "@testing-library/jest-dom";
|
|
5
|
-
import React from "react";
|
|
6
|
-
import ColorLegends from "./ColorLegends";
|
|
7
|
-
import { Layer } from "@deck.gl/core/typed";
|
|
8
|
-
import { getLayersInViewport } from "../layers/utils/layerTools";
|
|
9
|
-
|
|
10
|
-
import { colorTables } from "@emerson-eps/color-tables";
|
|
11
|
-
|
|
12
|
-
const colormapLayer = {
|
|
13
|
-
"@@type": "ColormapLayer",
|
|
14
|
-
name: "Property map",
|
|
15
|
-
id: "colormap-layer",
|
|
16
|
-
pickable: true,
|
|
17
|
-
visible: true,
|
|
18
|
-
valueRange: { type: "array", value: [0, 1] },
|
|
19
|
-
colorMapRange: { type: "array" },
|
|
20
|
-
valueDecoder: {
|
|
21
|
-
rgbScaler: [1, 1, 1],
|
|
22
|
-
// By default, scale the [0, 256*256*256-1] decoded values to [0, 1]
|
|
23
|
-
floatScaler: 1.0 / (256.0 * 256.0 * 256.0 - 1.0),
|
|
24
|
-
offset: 0,
|
|
25
|
-
step: 0,
|
|
26
|
-
},
|
|
27
|
-
rotDeg: 0,
|
|
28
|
-
colorMapName: "Rainbow",
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const wellsLayer = {
|
|
32
|
-
"@@type": "WellsLayer",
|
|
33
|
-
name: "Wells",
|
|
34
|
-
id: "wells-layer",
|
|
35
|
-
autoHighlight: true,
|
|
36
|
-
opacity: 1,
|
|
37
|
-
lineWidthScale: 1,
|
|
38
|
-
pointRadiusScale: 1,
|
|
39
|
-
lineStyle: { dash: false },
|
|
40
|
-
outline: true,
|
|
41
|
-
logRadius: 10,
|
|
42
|
-
logCurves: true,
|
|
43
|
-
refine: true,
|
|
44
|
-
visible: true,
|
|
45
|
-
wellNameVisible: false,
|
|
46
|
-
wellNameAtTop: false,
|
|
47
|
-
wellNameSize: 14,
|
|
48
|
-
wellNameColor: [0, 0, 0, 255],
|
|
49
|
-
selectedWell: "@@#editedData.selectedWells", // used to get data from deckgl layer
|
|
50
|
-
depthTest: true,
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const layers = [colormapLayer, wellsLayer];
|
|
54
|
-
|
|
55
|
-
describe("Test Color Legend", () => {
|
|
56
|
-
it("snapshot test", () => {
|
|
57
|
-
const { container } = render(
|
|
58
|
-
<ColorLegends
|
|
59
|
-
layers={
|
|
60
|
-
getLayersInViewport(layers, [
|
|
61
|
-
"colormap-layer",
|
|
62
|
-
"wells-layer",
|
|
63
|
-
]) as Layer<unknown>[]
|
|
64
|
-
}
|
|
65
|
-
colorTables={colorTables}
|
|
66
|
-
/>
|
|
67
|
-
);
|
|
68
|
-
expect(container.firstChild).toMatchSnapshot();
|
|
69
|
-
});
|
|
70
|
-
it("snapshot test with props", () => {
|
|
71
|
-
const { container } = render(
|
|
72
|
-
<ColorLegends
|
|
73
|
-
layers={
|
|
74
|
-
getLayersInViewport(layers, [
|
|
75
|
-
"colormap-layer",
|
|
76
|
-
"wells-layer",
|
|
77
|
-
]) as Layer<unknown>[]
|
|
78
|
-
}
|
|
79
|
-
horizontal={true}
|
|
80
|
-
colorTables={colorTables}
|
|
81
|
-
reverseRange={true}
|
|
82
|
-
/>
|
|
83
|
-
);
|
|
84
|
-
expect(container.firstChild).toMatchSnapshot();
|
|
85
|
-
});
|
|
86
|
-
it("snapshot test if layers=0", () => {
|
|
87
|
-
const { container } = render(
|
|
88
|
-
<ColorLegends
|
|
89
|
-
layers={[]}
|
|
90
|
-
horizontal={true}
|
|
91
|
-
colorTables={colorTables}
|
|
92
|
-
reverseRange={true}
|
|
93
|
-
/>
|
|
94
|
-
);
|
|
95
|
-
expect(container.firstChild).toMatchSnapshot();
|
|
96
|
-
});
|
|
97
|
-
});
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { ExtendedLayer } from "../layers/utils/layerTools";
|
|
3
|
-
import ColorLegend from "./ColorLegend";
|
|
4
|
-
import { colorTablesArray } from "@emerson-eps/color-tables/";
|
|
5
|
-
|
|
6
|
-
interface ColorLegendsProps {
|
|
7
|
-
// Pass additional css style to the parent color legend container
|
|
8
|
-
cssStyle?: Record<string, unknown> | null;
|
|
9
|
-
horizontal?: boolean | null;
|
|
10
|
-
layers: ExtendedLayer<unknown>[];
|
|
11
|
-
colorTables: colorTablesArray | string | undefined;
|
|
12
|
-
reverseRange?: boolean;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
// Todo: Adapt it for other layers too
|
|
16
|
-
const ColorLegends: React.FC<ColorLegendsProps> = ({
|
|
17
|
-
cssStyle,
|
|
18
|
-
horizontal,
|
|
19
|
-
layers,
|
|
20
|
-
colorTables,
|
|
21
|
-
reverseRange,
|
|
22
|
-
}: ColorLegendsProps) => {
|
|
23
|
-
if (layers.length == 0) return null;
|
|
24
|
-
return (
|
|
25
|
-
<div
|
|
26
|
-
style={{
|
|
27
|
-
position: "absolute",
|
|
28
|
-
display: "flex",
|
|
29
|
-
zIndex: 999,
|
|
30
|
-
...cssStyle,
|
|
31
|
-
}}
|
|
32
|
-
>
|
|
33
|
-
{layers.map((layer, index) => (
|
|
34
|
-
<ColorLegend
|
|
35
|
-
layer={layer}
|
|
36
|
-
horizontal={horizontal}
|
|
37
|
-
key={index}
|
|
38
|
-
colorTables={colorTables}
|
|
39
|
-
reverseRange={reverseRange}
|
|
40
|
-
/>
|
|
41
|
-
))}
|
|
42
|
-
</div>
|
|
43
|
-
);
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export default ColorLegends;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
-
import DistanceScale from "./DistanceScale";
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
component: DistanceScale,
|
|
7
|
-
title: "SubsurfaceViewer / Components / DistanceScale",
|
|
8
|
-
} as ComponentMeta<typeof DistanceScale>;
|
|
9
|
-
|
|
10
|
-
const darkModeStyle = {
|
|
11
|
-
color: "white",
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const Template: ComponentStory<typeof DistanceScale> = (args) => (
|
|
15
|
-
<DistanceScale {...args} />
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
export const Baseline = Template.bind({});
|
|
19
|
-
|
|
20
|
-
export const DarkMode = Template.bind({});
|
|
21
|
-
|
|
22
|
-
DarkMode.args = {
|
|
23
|
-
style: darkModeStyle,
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
DarkMode.parameters = {
|
|
27
|
-
backgrounds: { default: "dark" },
|
|
28
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { render } from "@testing-library/react";
|
|
2
|
-
import "jest-styled-components";
|
|
3
|
-
import "@testing-library/jest-dom";
|
|
4
|
-
import React from "react";
|
|
5
|
-
import DistanceScale from "./DistanceScale";
|
|
6
|
-
|
|
7
|
-
describe("Test Color Legend", () => {
|
|
8
|
-
it("snapshot test with default props", () => {
|
|
9
|
-
const { container } = render(<DistanceScale />);
|
|
10
|
-
expect(container.firstChild).toMatchSnapshot();
|
|
11
|
-
});
|
|
12
|
-
it("snapshot test with invalid props", () => {
|
|
13
|
-
const { container } = render(
|
|
14
|
-
<DistanceScale
|
|
15
|
-
zoom={0}
|
|
16
|
-
incrementValue={0}
|
|
17
|
-
widthPerUnit={0}
|
|
18
|
-
style={{ top: 0, left: 0 }}
|
|
19
|
-
scaleUnit="m"
|
|
20
|
-
/>
|
|
21
|
-
);
|
|
22
|
-
expect(container.firstChild).toMatchSnapshot();
|
|
23
|
-
});
|
|
24
|
-
it("snapshot test with higher zoom", () => {
|
|
25
|
-
const { container } = render(
|
|
26
|
-
<DistanceScale
|
|
27
|
-
zoom={1}
|
|
28
|
-
incrementValue={100}
|
|
29
|
-
widthPerUnit={100}
|
|
30
|
-
style={{ top: 10, left: 10 }}
|
|
31
|
-
scaleUnit="m"
|
|
32
|
-
/>
|
|
33
|
-
);
|
|
34
|
-
expect(container.firstChild).toMatchSnapshot();
|
|
35
|
-
});
|
|
36
|
-
});
|