@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,644 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { styled } from "@mui/material/styles";
|
|
3
|
-
import SubsurfaceViewer from "../SubsurfaceViewer";
|
|
4
|
-
import exampleData from "../../../../demo/example-data/deckgl-map.json";
|
|
5
|
-
import { default as MapLayer } from "../layers/map/mapLayer";
|
|
6
|
-
import { default as Axes2DLayer } from "../layers/axes2d/axes2DLayer";
|
|
7
|
-
|
|
8
|
-
const PREFIX = "Default";
|
|
9
|
-
|
|
10
|
-
const classes = {
|
|
11
|
-
main: `${PREFIX}-main`,
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const Root = styled("div")({
|
|
15
|
-
[`& .${classes.main}`]: {
|
|
16
|
-
width: 500,
|
|
17
|
-
height: 500,
|
|
18
|
-
top: "50%",
|
|
19
|
-
left: "50%",
|
|
20
|
-
transform: "translate(-50%, -50%)",
|
|
21
|
-
border: "1px solid black",
|
|
22
|
-
background: "azure",
|
|
23
|
-
position: "absolute",
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
export default {
|
|
28
|
-
component: SubsurfaceViewer,
|
|
29
|
-
title: "SubsurfaceViewer",
|
|
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/dist/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
|
-
};
|
|
123
|
-
|
|
124
|
-
// Template for when edited data needs to be captured.
|
|
125
|
-
const EditDataTemplate = (args) => {
|
|
126
|
-
const [editedData, setEditedData] = React.useState(args.editedData);
|
|
127
|
-
React.useEffect(() => {
|
|
128
|
-
setEditedData(args.editedData);
|
|
129
|
-
}, [args.editedData]);
|
|
130
|
-
return (
|
|
131
|
-
<SubsurfaceViewer
|
|
132
|
-
{...args}
|
|
133
|
-
editedData={editedData}
|
|
134
|
-
setProps={(updatedProps) => {
|
|
135
|
-
setEditedData(updatedProps.editedData);
|
|
136
|
-
}}
|
|
137
|
-
/>
|
|
138
|
-
);
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
// Blank template.
|
|
142
|
-
const MinimalTemplate = (args) => {
|
|
143
|
-
return <SubsurfaceViewer {...args} />;
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
// Data for custome geojson layer with polyline data
|
|
147
|
-
const customLayerWithPolylineData = {
|
|
148
|
-
"@@type": "GeoJsonLayer",
|
|
149
|
-
id: "geojson-line-layer",
|
|
150
|
-
name: "Line",
|
|
151
|
-
data: {
|
|
152
|
-
type: "FeatureCollection",
|
|
153
|
-
features: [
|
|
154
|
-
{
|
|
155
|
-
type: "Feature",
|
|
156
|
-
properties: {},
|
|
157
|
-
geometry: {
|
|
158
|
-
type: "LineString",
|
|
159
|
-
coordinates: [
|
|
160
|
-
[434000, 6477500],
|
|
161
|
-
[435500, 6477500],
|
|
162
|
-
],
|
|
163
|
-
},
|
|
164
|
-
},
|
|
165
|
-
],
|
|
166
|
-
},
|
|
167
|
-
getLineWidth: 20,
|
|
168
|
-
lineWidthMinPixels: 2,
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
// Data for custom geojson layer with polygon data
|
|
172
|
-
const customLayerWithPolygonData = {
|
|
173
|
-
"@@type": "GeoJsonLayer",
|
|
174
|
-
id: "geojson-layer",
|
|
175
|
-
name: "Polygon",
|
|
176
|
-
data: {
|
|
177
|
-
type: "Feature",
|
|
178
|
-
properties: {},
|
|
179
|
-
geometry: {
|
|
180
|
-
type: "Polygon",
|
|
181
|
-
coordinates: [
|
|
182
|
-
[
|
|
183
|
-
[434562, 6477595],
|
|
184
|
-
[434562, 6478595],
|
|
185
|
-
[435062, 6478595],
|
|
186
|
-
[435062, 6477595],
|
|
187
|
-
[434562, 6477595],
|
|
188
|
-
],
|
|
189
|
-
],
|
|
190
|
-
},
|
|
191
|
-
},
|
|
192
|
-
getLineWidth: 20,
|
|
193
|
-
lineWidthMinPixels: 2,
|
|
194
|
-
getLineColor: [0, 255, 255],
|
|
195
|
-
getFillColor: [0, 255, 0],
|
|
196
|
-
opacity: 0.3,
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
// Data for custom text layer
|
|
200
|
-
const customLayerWithTextData = {
|
|
201
|
-
"@@type": "TextLayer",
|
|
202
|
-
id: "text-layer",
|
|
203
|
-
name: "Text",
|
|
204
|
-
data: [
|
|
205
|
-
{
|
|
206
|
-
name: "Custom GeoJson layer",
|
|
207
|
-
coordinates: [434800, 6478695],
|
|
208
|
-
},
|
|
209
|
-
],
|
|
210
|
-
pickable: true,
|
|
211
|
-
getPosition: (d) => d.coordinates,
|
|
212
|
-
getText: (d) => d.name,
|
|
213
|
-
getColor: [255, 0, 0],
|
|
214
|
-
getSize: 16,
|
|
215
|
-
getAngle: 0,
|
|
216
|
-
getTextAnchor: "middle",
|
|
217
|
-
getAlignmentBaseline: "center",
|
|
218
|
-
};
|
|
219
|
-
|
|
220
|
-
// Layers data for storybook example 1
|
|
221
|
-
const layersData1 = [
|
|
222
|
-
customLayerWithPolylineData,
|
|
223
|
-
customLayerWithPolygonData,
|
|
224
|
-
customLayerWithTextData,
|
|
225
|
-
];
|
|
226
|
-
|
|
227
|
-
// Layers data for storybook example 2
|
|
228
|
-
const colormapLayer = exampleData[0].layers[0];
|
|
229
|
-
const layersData2 = [
|
|
230
|
-
colormapLayer,
|
|
231
|
-
customLayerWithPolylineData,
|
|
232
|
-
customLayerWithPolygonData,
|
|
233
|
-
customLayerWithTextData,
|
|
234
|
-
];
|
|
235
|
-
|
|
236
|
-
const hillshadingLayer = exampleData[0].layers[1];
|
|
237
|
-
|
|
238
|
-
// Storybook example 1
|
|
239
|
-
export const Default = EditDataTemplate.bind({});
|
|
240
|
-
Default.args = {
|
|
241
|
-
...exampleData[0],
|
|
242
|
-
};
|
|
243
|
-
|
|
244
|
-
// Minimal map example.
|
|
245
|
-
export const Minimal = () => (
|
|
246
|
-
<SubsurfaceViewer id={"deckgl-map"} bounds={[0, 0, 1, 1]} />
|
|
247
|
-
);
|
|
248
|
-
Minimal.parameters = {
|
|
249
|
-
docs: {
|
|
250
|
-
description: {
|
|
251
|
-
story: "An example showing the minimal required arguments, which will give an empty map viewer.",
|
|
252
|
-
},
|
|
253
|
-
},
|
|
254
|
-
};
|
|
255
|
-
|
|
256
|
-
// Volve kh netmap data, flat surface
|
|
257
|
-
export const KhMapFlat = MinimalTemplate.bind({});
|
|
258
|
-
KhMapFlat.args = {
|
|
259
|
-
id: "kh-map-flat",
|
|
260
|
-
resources: {
|
|
261
|
-
propertyMap: "./volve_property_normalized.png",
|
|
262
|
-
depthMap: "./volve_hugin_depth_normalized.png",
|
|
263
|
-
},
|
|
264
|
-
bounds: [432150, 6475800, 439400, 6481500],
|
|
265
|
-
layers: [
|
|
266
|
-
{
|
|
267
|
-
"@@type": "ColormapLayer",
|
|
268
|
-
id: "property_map",
|
|
269
|
-
valueRange: [-3071, 41048],
|
|
270
|
-
bounds: [432150, 6475800, 439400, 6481500],
|
|
271
|
-
image: "@@#resources.propertyMap",
|
|
272
|
-
},
|
|
273
|
-
{
|
|
274
|
-
...hillshadingLayer,
|
|
275
|
-
valueRange: [2725, 3397],
|
|
276
|
-
bounds: [432150, 6475800, 439400, 6481500],
|
|
277
|
-
opacity: 0.6,
|
|
278
|
-
},
|
|
279
|
-
],
|
|
280
|
-
};
|
|
281
|
-
KhMapFlat.parameters = {
|
|
282
|
-
docs: {
|
|
283
|
-
description: {
|
|
284
|
-
story: "An example showing a kh property layer and a depth map hillshading layer.",
|
|
285
|
-
},
|
|
286
|
-
inlineStories: false,
|
|
287
|
-
iframeHeight: 500,
|
|
288
|
-
},
|
|
289
|
-
};
|
|
290
|
-
|
|
291
|
-
// Map3DLayer. Properties encoded in RGB.
|
|
292
|
-
const meshMapLayer = {
|
|
293
|
-
"@@type": "Map3DLayer",
|
|
294
|
-
id: "mesh-layer",
|
|
295
|
-
mesh: "hugin_depth_25_m_normalized_margin.png",
|
|
296
|
-
meshValueRange: [2782, 3513],
|
|
297
|
-
frame: {
|
|
298
|
-
origin: [432205, 6475078],
|
|
299
|
-
count: [229, 291],
|
|
300
|
-
increment: [25, 25],
|
|
301
|
-
rotDeg: 0,
|
|
302
|
-
},
|
|
303
|
-
propertyTexture: "kh_netmap_25_m_normalized_margin.png",
|
|
304
|
-
propertyValueRange: [-3071, 41048],
|
|
305
|
-
contours: [0, 100.0],
|
|
306
|
-
isContoursDepth: true,
|
|
307
|
-
colorMapName: "Physics",
|
|
308
|
-
};
|
|
309
|
-
|
|
310
|
-
const meshMapLayerPng = new MapLayer({
|
|
311
|
-
id: "mesh-layer-png",
|
|
312
|
-
meshUrl: "hugin_depth_25_m.png",
|
|
313
|
-
frame: {
|
|
314
|
-
origin: [432150, 6475800],
|
|
315
|
-
count: [291, 229],
|
|
316
|
-
increment: [25, 25],
|
|
317
|
-
rotDeg: 0,
|
|
318
|
-
},
|
|
319
|
-
propertiesUrl: "kh_netmap_25_m.png",
|
|
320
|
-
contours: [0, 100],
|
|
321
|
-
isContoursDepth: true,
|
|
322
|
-
gridLines: false,
|
|
323
|
-
material: true,
|
|
324
|
-
smoothShading: true,
|
|
325
|
-
colorMapName: "Physics",
|
|
326
|
-
});
|
|
327
|
-
|
|
328
|
-
const axes2D = new Axes2DLayer({
|
|
329
|
-
id: "axes-layer",
|
|
330
|
-
marginH: 80, // Horizontal margin (in pixels)
|
|
331
|
-
marginV: 30, // Vertical margin (in pixels)
|
|
332
|
-
isLeftRuler: true,
|
|
333
|
-
isRightRuler: false,
|
|
334
|
-
isBottomRuler: true,
|
|
335
|
-
isTopRuler: false,
|
|
336
|
-
backgroundColor: [155, 155, 155, 255],
|
|
337
|
-
});
|
|
338
|
-
|
|
339
|
-
export const KhMapMesh = MinimalTemplate.bind({});
|
|
340
|
-
KhMapMesh.args = {
|
|
341
|
-
id: "kh-mesh-map",
|
|
342
|
-
layers: [
|
|
343
|
-
{
|
|
344
|
-
...meshMapLayer,
|
|
345
|
-
},
|
|
346
|
-
],
|
|
347
|
-
toolbar: {
|
|
348
|
-
visible: false,
|
|
349
|
-
},
|
|
350
|
-
bounds: [432150, 6475800, 439400, 6481500],
|
|
351
|
-
views: {
|
|
352
|
-
layout: [1, 1],
|
|
353
|
-
viewports: [
|
|
354
|
-
{
|
|
355
|
-
id: "view_1",
|
|
356
|
-
show3D: true,
|
|
357
|
-
layerIds: [],
|
|
358
|
-
},
|
|
359
|
-
],
|
|
360
|
-
},
|
|
361
|
-
};
|
|
362
|
-
|
|
363
|
-
//Material property may take these values:
|
|
364
|
-
// true = default material. See deck.gl documentation for what that is. This is default property value.
|
|
365
|
-
// false = no material.
|
|
366
|
-
// Full spec:
|
|
367
|
-
// {
|
|
368
|
-
// ambient: 0.35,
|
|
369
|
-
// diffuse: 0.6,
|
|
370
|
-
// shininess: 32,
|
|
371
|
-
// specularColor: [255, 255, 255],
|
|
372
|
-
// }
|
|
373
|
-
const material = {
|
|
374
|
-
ambient: 0.35,
|
|
375
|
-
diffuse: 0.6,
|
|
376
|
-
shininess: 32,
|
|
377
|
-
specularColor: [255, 255, 255],
|
|
378
|
-
};
|
|
379
|
-
export const MapMaterial = MinimalTemplate.bind({});
|
|
380
|
-
MapMaterial.args = {
|
|
381
|
-
id: "material",
|
|
382
|
-
layers: [{ ...meshMapLayer, material }],
|
|
383
|
-
bounds: [432150, 6475800, 439400, 6481500],
|
|
384
|
-
views: {
|
|
385
|
-
layout: [1, 1],
|
|
386
|
-
viewports: [
|
|
387
|
-
{
|
|
388
|
-
id: "view_1",
|
|
389
|
-
show3D: false,
|
|
390
|
-
layerIds: [],
|
|
391
|
-
},
|
|
392
|
-
],
|
|
393
|
-
},
|
|
394
|
-
};
|
|
395
|
-
MapMaterial.parameters = {
|
|
396
|
-
docs: {
|
|
397
|
-
description: {
|
|
398
|
-
story: "An example showing example usage of Map3D material property.",
|
|
399
|
-
},
|
|
400
|
-
inlineStories: false,
|
|
401
|
-
iframeHeight: 500,
|
|
402
|
-
},
|
|
403
|
-
};
|
|
404
|
-
|
|
405
|
-
// Exapmple of using "colorMapClampColor" property.
|
|
406
|
-
// Clamps colormap to this color at ends.
|
|
407
|
-
// Given as array of three values (r,g,b) e.g: [255, 0, 0]
|
|
408
|
-
// If not set (undefined) or set to true, it will clamp to color map min and max values.
|
|
409
|
-
// If set to false the clamp color will be completely transparent.
|
|
410
|
-
const propertyValueRange = [2782, 3513];
|
|
411
|
-
const colorMapRange = [3000, 3513];
|
|
412
|
-
const colorMapClampColor = [0, 255, 0]; // a color e.g. [0, 255, 0], false, true or undefined.
|
|
413
|
-
|
|
414
|
-
export const MapClampColor = MinimalTemplate.bind({});
|
|
415
|
-
MapClampColor.args = {
|
|
416
|
-
id: "clampcolor",
|
|
417
|
-
layers: [
|
|
418
|
-
{
|
|
419
|
-
...meshMapLayer,
|
|
420
|
-
propertyValueRange,
|
|
421
|
-
colorMapRange,
|
|
422
|
-
colorMapClampColor,
|
|
423
|
-
},
|
|
424
|
-
],
|
|
425
|
-
bounds: [432150, 6475800, 439400, 6481500],
|
|
426
|
-
views: {
|
|
427
|
-
layout: [1, 1],
|
|
428
|
-
viewports: [
|
|
429
|
-
{
|
|
430
|
-
id: "view_1",
|
|
431
|
-
show3D: false,
|
|
432
|
-
layerIds: [],
|
|
433
|
-
},
|
|
434
|
-
],
|
|
435
|
-
},
|
|
436
|
-
};
|
|
437
|
-
MapClampColor.parameters = {
|
|
438
|
-
docs: {
|
|
439
|
-
description: {
|
|
440
|
-
story: 'An example usage of map property `"colorMapClampColor"',
|
|
441
|
-
},
|
|
442
|
-
inlineStories: false,
|
|
443
|
-
iframeHeight: 500,
|
|
444
|
-
},
|
|
445
|
-
};
|
|
446
|
-
|
|
447
|
-
// Example using "colorMapFunction" property.
|
|
448
|
-
const layer = {
|
|
449
|
-
...meshMapLayer,
|
|
450
|
-
isContoursDepth: true,
|
|
451
|
-
colorMapFunction: (x) => [255 - x * 100, 255 - x * 100, 255 * x], // If defined this function will override the colormap.
|
|
452
|
-
};
|
|
453
|
-
export const colorMapFunction = MinimalTemplate.bind({});
|
|
454
|
-
colorMapFunction.args = {
|
|
455
|
-
id: "colorMapFunction",
|
|
456
|
-
layers: [
|
|
457
|
-
// map layer
|
|
458
|
-
layer,
|
|
459
|
-
// colormap layer
|
|
460
|
-
{
|
|
461
|
-
...colormapLayer,
|
|
462
|
-
image: "https://raw.githubusercontent.com/equinor/webviz-subsurface-components/master/react/src/demo/example-data/propertyMap.png",
|
|
463
|
-
colorMapFunction: (x) => [255 - x * 100, 255 - x * 100, 255 * x], // If defined this function will override the colormap.
|
|
464
|
-
},
|
|
465
|
-
],
|
|
466
|
-
bounds: [432150, 6475800, 439400, 6481500],
|
|
467
|
-
views: {
|
|
468
|
-
layout: [1, 1],
|
|
469
|
-
viewports: [
|
|
470
|
-
{
|
|
471
|
-
id: "view_1",
|
|
472
|
-
show3D: true,
|
|
473
|
-
layerIds: [],
|
|
474
|
-
},
|
|
475
|
-
],
|
|
476
|
-
},
|
|
477
|
-
};
|
|
478
|
-
|
|
479
|
-
// custom layer example
|
|
480
|
-
export const UserDefinedLayer1 = EditDataTemplate.bind({});
|
|
481
|
-
UserDefinedLayer1.args = {
|
|
482
|
-
id: exampleData[0].id,
|
|
483
|
-
bounds: exampleData[0].bounds,
|
|
484
|
-
layers: layersData1,
|
|
485
|
-
};
|
|
486
|
-
|
|
487
|
-
// custom layer with colormap
|
|
488
|
-
export const UserDefinedLayer2 = EditDataTemplate.bind({});
|
|
489
|
-
UserDefinedLayer2.args = {
|
|
490
|
-
id: exampleData[0].id,
|
|
491
|
-
resources: exampleData[0].resources,
|
|
492
|
-
bounds: exampleData[0].bounds,
|
|
493
|
-
layers: layersData2,
|
|
494
|
-
};
|
|
495
|
-
|
|
496
|
-
// multiple synced view
|
|
497
|
-
export const MultiView = EditDataTemplate.bind({});
|
|
498
|
-
MultiView.args = {
|
|
499
|
-
...exampleData[0],
|
|
500
|
-
legend: {
|
|
501
|
-
visible: false,
|
|
502
|
-
},
|
|
503
|
-
layers: [
|
|
504
|
-
...exampleData[0].layers,
|
|
505
|
-
customLayerWithPolylineData,
|
|
506
|
-
customLayerWithPolygonData,
|
|
507
|
-
customLayerWithTextData,
|
|
508
|
-
],
|
|
509
|
-
views: {
|
|
510
|
-
layout: [2, 2],
|
|
511
|
-
showLabel: true,
|
|
512
|
-
viewports: [
|
|
513
|
-
{
|
|
514
|
-
id: "view_1",
|
|
515
|
-
name: "Colormap layer",
|
|
516
|
-
show3D: false,
|
|
517
|
-
layerIds: ["colormap-layer"],
|
|
518
|
-
zoom: -5,
|
|
519
|
-
isSync: true,
|
|
520
|
-
},
|
|
521
|
-
{
|
|
522
|
-
id: "view_2",
|
|
523
|
-
name: "Hill-shading layer",
|
|
524
|
-
show3D: false,
|
|
525
|
-
layerIds: ["hillshading-layer"],
|
|
526
|
-
zoom: -5,
|
|
527
|
-
isSync: true,
|
|
528
|
-
},
|
|
529
|
-
{
|
|
530
|
-
id: "view_3",
|
|
531
|
-
name: "All layers",
|
|
532
|
-
show3D: false,
|
|
533
|
-
layerIds: [],
|
|
534
|
-
zoom: -5,
|
|
535
|
-
isSync: false,
|
|
536
|
-
},
|
|
537
|
-
{
|
|
538
|
-
id: "view_4",
|
|
539
|
-
name: "Custom layer",
|
|
540
|
-
show3D: false,
|
|
541
|
-
layerIds: ["geojson-line-layer", "geojson-layer", "text-layer"],
|
|
542
|
-
zoom: -5,
|
|
543
|
-
isSync: false,
|
|
544
|
-
},
|
|
545
|
-
],
|
|
546
|
-
},
|
|
547
|
-
};
|
|
548
|
-
|
|
549
|
-
// ---------Selectable GeoJson Layer example--------------- //
|
|
550
|
-
export const SelectableFeatureExample = (args) => {
|
|
551
|
-
const [editedData, setEditedData] = React.useState(args.editedData);
|
|
552
|
-
React.useEffect(() => {
|
|
553
|
-
setEditedData(args.editedData);
|
|
554
|
-
}, [args.editedData]);
|
|
555
|
-
return (
|
|
556
|
-
<div>
|
|
557
|
-
<SubsurfaceViewer
|
|
558
|
-
{...args}
|
|
559
|
-
editedData={editedData}
|
|
560
|
-
setProps={(updatedProps) => {
|
|
561
|
-
setEditedData(updatedProps.editedData);
|
|
562
|
-
}}
|
|
563
|
-
/>
|
|
564
|
-
<pre>{JSON.stringify(editedData, null, 2)}</pre>
|
|
565
|
-
</div>
|
|
566
|
-
);
|
|
567
|
-
};
|
|
568
|
-
|
|
569
|
-
SelectableFeatureExample.parameters = {
|
|
570
|
-
docs: {
|
|
571
|
-
description: {
|
|
572
|
-
story: "An example showing selectable feature example from the map.",
|
|
573
|
-
},
|
|
574
|
-
},
|
|
575
|
-
};
|
|
576
|
-
|
|
577
|
-
const polylineUsingSelectableGeoJsonLayer = {
|
|
578
|
-
...customLayerWithPolylineData,
|
|
579
|
-
"@@type": "SelectableGeoJsonLayer",
|
|
580
|
-
};
|
|
581
|
-
|
|
582
|
-
const polygonUsingSelectableGeoJsonLayer = {
|
|
583
|
-
...customLayerWithPolygonData,
|
|
584
|
-
"@@type": "SelectableGeoJsonLayer",
|
|
585
|
-
};
|
|
586
|
-
|
|
587
|
-
SelectableFeatureExample.args = {
|
|
588
|
-
id: "DeckGL-Map",
|
|
589
|
-
bounds: [432205, 6475078, 437720, 6481113],
|
|
590
|
-
layers: [
|
|
591
|
-
polylineUsingSelectableGeoJsonLayer,
|
|
592
|
-
polygonUsingSelectableGeoJsonLayer,
|
|
593
|
-
],
|
|
594
|
-
};
|
|
595
|
-
|
|
596
|
-
export const MapInContainer = (args) => {
|
|
597
|
-
return (
|
|
598
|
-
<Root className={classes.main}>
|
|
599
|
-
<SubsurfaceViewer {...args} />
|
|
600
|
-
</Root>
|
|
601
|
-
);
|
|
602
|
-
};
|
|
603
|
-
|
|
604
|
-
MapInContainer.args = {
|
|
605
|
-
...exampleData[0],
|
|
606
|
-
};
|
|
607
|
-
|
|
608
|
-
export const ViewMatrixMargin = EditDataTemplate.bind({});
|
|
609
|
-
ViewMatrixMargin.args = {
|
|
610
|
-
id: "DeckGL-Map",
|
|
611
|
-
layers: [meshMapLayerPng, axes2D],
|
|
612
|
-
bounds: [432150, 6475800, 439400, 6481501],
|
|
613
|
-
views: {
|
|
614
|
-
layout: [2, 2],
|
|
615
|
-
marginPixels: 10,
|
|
616
|
-
showLabel: true,
|
|
617
|
-
viewports: [
|
|
618
|
-
{
|
|
619
|
-
id: "view_1",
|
|
620
|
-
show3D: false,
|
|
621
|
-
layerIds: ["mesh-layer-png", "axes-layer"],
|
|
622
|
-
isSync: true,
|
|
623
|
-
},
|
|
624
|
-
{
|
|
625
|
-
id: "view_2",
|
|
626
|
-
show3D: false,
|
|
627
|
-
layerIds: ["mesh-layer-png", "axes-layer"],
|
|
628
|
-
isSync: true,
|
|
629
|
-
},
|
|
630
|
-
{
|
|
631
|
-
id: "view_3",
|
|
632
|
-
show3D: false,
|
|
633
|
-
layerIds: ["mesh-layer-png", "axes-layer"],
|
|
634
|
-
isSync: false,
|
|
635
|
-
},
|
|
636
|
-
{
|
|
637
|
-
id: "view_4",
|
|
638
|
-
show3D: false,
|
|
639
|
-
layerIds: ["mesh-layer-png", "axes-layer"],
|
|
640
|
-
isSync: false,
|
|
641
|
-
},
|
|
642
|
-
],
|
|
643
|
-
},
|
|
644
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import InfoCard from "../../components/InfoCard";
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
component: InfoCard,
|
|
6
|
-
title: "SubsurfaceViewer/Components/InfoCard",
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
const Template = (args) => <InfoCard {...args} />;
|
|
10
|
-
|
|
11
|
-
export const SingleProperty = Template.bind({});
|
|
12
|
-
SingleProperty.args = {
|
|
13
|
-
pickInfos: [
|
|
14
|
-
{
|
|
15
|
-
x: 152,
|
|
16
|
-
y: 254,
|
|
17
|
-
radius: 1,
|
|
18
|
-
depth: 638,
|
|
19
|
-
coordinate: [111, 222],
|
|
20
|
-
},
|
|
21
|
-
],
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export const MutipleProperties = Template.bind({});
|
|
25
|
-
MutipleProperties.args = {
|
|
26
|
-
pickInfos: [
|
|
27
|
-
{
|
|
28
|
-
x: 152,
|
|
29
|
-
y: 254,
|
|
30
|
-
radius: 1,
|
|
31
|
-
depth: 638,
|
|
32
|
-
coordinate: [111, 222],
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
layer: { id: "wells-layer" },
|
|
36
|
-
property: { name: "Poro WellA", value: 123 },
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { ContinuousLegend, colorTables } from "@emerson-eps/color-tables";
|
|
3
|
-
export default {
|
|
4
|
-
component: ContinuousLegend,
|
|
5
|
-
title: "SubsurfaceViewer/Components/ColorLegends/ContinuousLegend",
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
const min = 0;
|
|
9
|
-
const max = 0.35;
|
|
10
|
-
const dataObjectName = "Wells / PORO";
|
|
11
|
-
const position = [16, 10];
|
|
12
|
-
const name = "PORO";
|
|
13
|
-
const horizontal = false;
|
|
14
|
-
const colorName = "Rainbow";
|
|
15
|
-
const reverseRange = false;
|
|
16
|
-
|
|
17
|
-
const Template = (args) => {
|
|
18
|
-
return <ContinuousLegend {...args} />;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export const ContinuousTemplate = Template.bind({});
|
|
22
|
-
ContinuousTemplate.args = {
|
|
23
|
-
min,
|
|
24
|
-
max,
|
|
25
|
-
dataObjectName,
|
|
26
|
-
position,
|
|
27
|
-
name,
|
|
28
|
-
colorName,
|
|
29
|
-
colorTables,
|
|
30
|
-
horizontal,
|
|
31
|
-
reverseRange,
|
|
32
|
-
};
|