@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
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAyB,MAAM,oBAAoB,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAyB,MAAM,oBAAoB,CAAC"}
|
package/dist/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@webviz/subsurface-viewer",
|
|
3
3
|
"version": "0.0.0",
|
|
4
4
|
"description": "",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"transpile": "tsc --project ./tsconfig.json",
|
|
8
8
|
"copy-files": "copyfiles package.json dist && copyfiles README.md dist && copyfiles --exclude **/*.{tsx,jsx,js,ts,snap} --up 1 \"src/**/*\" dist/",
|
|
@@ -31,5 +31,8 @@
|
|
|
31
31
|
"lodash": "^4.17.21",
|
|
32
32
|
"mathjs": "^9.4.2",
|
|
33
33
|
"react-redux": "^7.2.6"
|
|
34
|
-
}
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"/dist"
|
|
37
|
+
]
|
|
35
38
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webviz/subsurface-viewer",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2-alpha.2",
|
|
4
4
|
"description": "",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"transpile": "tsc --project ./tsconfig.json",
|
|
8
8
|
"copy-files": "copyfiles package.json dist && copyfiles README.md dist && copyfiles --exclude **/*.{tsx,jsx,js,ts,snap} --up 1 \"src/**/*\" dist/",
|
|
@@ -31,5 +31,8 @@
|
|
|
31
31
|
"lodash": "^4.17.21",
|
|
32
32
|
"mathjs": "^9.4.2",
|
|
33
33
|
"react-redux": "^7.2.6"
|
|
34
|
-
}
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"/dist"
|
|
37
|
+
]
|
|
35
38
|
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { colorTablesArray } from "@emerson-eps/color-tables/";
|
|
3
|
-
import { ViewsType, TooltipCallback, ViewStateType, BoundsAccessor } from "./components/Map";
|
|
4
|
-
import { MapMouseEvent } from "./components/Map";
|
|
5
|
-
import { Unit } from "convert-units";
|
|
6
|
-
export interface DashSubsurfaceViewerProps {
|
|
7
|
-
id: string;
|
|
8
|
-
resources?: Record<string, unknown>;
|
|
9
|
-
layers?: Record<string, unknown>[];
|
|
10
|
-
bounds?: [number, number, number, number] | BoundsAccessor;
|
|
11
|
-
views?: ViewsType;
|
|
12
|
-
coords?: {
|
|
13
|
-
visible?: boolean | null;
|
|
14
|
-
multiPicking?: boolean | null;
|
|
15
|
-
pickDepth?: number | null;
|
|
16
|
-
};
|
|
17
|
-
scale?: {
|
|
18
|
-
visible?: boolean | null;
|
|
19
|
-
incrementValue?: number | null;
|
|
20
|
-
widthPerUnit?: number | null;
|
|
21
|
-
cssStyle?: Record<string, unknown> | null;
|
|
22
|
-
};
|
|
23
|
-
coordinateUnit?: Unit;
|
|
24
|
-
colorTables?: colorTablesArray;
|
|
25
|
-
editedData?: Record<string, unknown>;
|
|
26
|
-
setProps?: (data: Record<string, unknown>) => void;
|
|
27
|
-
/**
|
|
28
|
-
* Validate JSON datafile against schema
|
|
29
|
-
*/
|
|
30
|
-
checkDatafileSchema?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* For get mouse events
|
|
33
|
-
*/
|
|
34
|
-
onMouseEvent?: (event: MapMouseEvent) => void;
|
|
35
|
-
getCameraPosition?: (input: ViewStateType) => void;
|
|
36
|
-
/**
|
|
37
|
-
* If changed will reset camera to default position.
|
|
38
|
-
*/
|
|
39
|
-
triggerHome?: number;
|
|
40
|
-
triggerResetMultipleWells?: number;
|
|
41
|
-
/**
|
|
42
|
-
* Range selection of the current well
|
|
43
|
-
*/
|
|
44
|
-
selection?: {
|
|
45
|
-
well: string | undefined;
|
|
46
|
-
selection: [number | undefined, number | undefined] | undefined;
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* Override default tooltip with a callback.
|
|
50
|
-
*/
|
|
51
|
-
getTooltip?: TooltipCallback;
|
|
52
|
-
cameraPosition?: ViewStateType | undefined;
|
|
53
|
-
children?: React.ReactNode;
|
|
54
|
-
}
|
|
55
|
-
declare const DashSubsurfaceViewer: React.FC<DashSubsurfaceViewerProps>;
|
|
56
|
-
export default DashSubsurfaceViewer;
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
|
-
import { View } from "@deck.gl/core/typed";
|
|
4
|
-
import SubsurfaceViewer from "./SubsurfaceViewer";
|
|
5
|
-
import convert from "convert-units";
|
|
6
|
-
function mapAnnotation(annotationContainers) {
|
|
7
|
-
return React.Children.map(annotationContainers, (annotationContainer) => {
|
|
8
|
-
const viewId = annotationContainer.key;
|
|
9
|
-
return (
|
|
10
|
-
// @ts-expect-error This is demonstrated to work with js, but with ts it gives error
|
|
11
|
-
React.createElement(View, { key: viewId, id: viewId }, annotationContainer));
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
const DashSubsurfaceViewer = ({ id, resources, layers, bounds, views, coords, scale, coordinateUnit, colorTables, editedData, setProps, checkDatafileSchema, onMouseEvent, selection, getTooltip, cameraPosition, getCameraPosition, triggerHome, triggerResetMultipleWells, children, }) => {
|
|
15
|
-
const mapArgs = {
|
|
16
|
-
id: id,
|
|
17
|
-
resources: resources,
|
|
18
|
-
layers: layers,
|
|
19
|
-
bounds: bounds,
|
|
20
|
-
views: views,
|
|
21
|
-
coords: coords,
|
|
22
|
-
scale: scale,
|
|
23
|
-
coordinateUnit: coordinateUnit,
|
|
24
|
-
colorTables: colorTables,
|
|
25
|
-
editedData: editedData,
|
|
26
|
-
setProps: setProps,
|
|
27
|
-
checkDatafileSchema: checkDatafileSchema,
|
|
28
|
-
onMouseEvent: onMouseEvent,
|
|
29
|
-
selection: selection,
|
|
30
|
-
getTooltip: getTooltip,
|
|
31
|
-
cameraPosition: cameraPosition,
|
|
32
|
-
getCameraPosition: getCameraPosition,
|
|
33
|
-
triggerHome: triggerHome,
|
|
34
|
-
triggerResetMultipleWells: triggerResetMultipleWells,
|
|
35
|
-
children: children,
|
|
36
|
-
};
|
|
37
|
-
return (React.createElement(SubsurfaceViewer, Object.assign({}, mapArgs), mapAnnotation(children)));
|
|
38
|
-
};
|
|
39
|
-
DashSubsurfaceViewer.defaultProps = {
|
|
40
|
-
views: {
|
|
41
|
-
layout: [1, 1],
|
|
42
|
-
showLabel: false,
|
|
43
|
-
viewports: [{ id: "main-view", show3D: false, layerIds: [] }],
|
|
44
|
-
},
|
|
45
|
-
checkDatafileSchema: false,
|
|
46
|
-
};
|
|
47
|
-
DashSubsurfaceViewer.propTypes = {
|
|
48
|
-
/**
|
|
49
|
-
* The ID of this component, used to identify dash components
|
|
50
|
-
* in callbacks. The ID needs to be unique across all of the
|
|
51
|
-
* components in an app.
|
|
52
|
-
*/
|
|
53
|
-
id: PropTypes.string.isRequired,
|
|
54
|
-
/**
|
|
55
|
-
* Resource dictionary made available in the DeckGL specification as an enum.
|
|
56
|
-
* The values can be accessed like this: `"@@#resources.resourceId"`, where
|
|
57
|
-
* `resourceId` is the key in the `resources` dict. For more information,
|
|
58
|
-
* see the DeckGL documentation on enums in the json spec:
|
|
59
|
-
* https://deck.gl/docs/api-reference/json/conversion-reference#enumerations-and-using-the--prefix
|
|
60
|
-
*/
|
|
61
|
-
resources: PropTypes.objectOf(PropTypes.any),
|
|
62
|
-
/* List of JSON object containing layer specific data.
|
|
63
|
-
* Each JSON object will consist of layer type with key as "@@type" and
|
|
64
|
-
* layer specific data, if any.
|
|
65
|
-
*/
|
|
66
|
-
layers: PropTypes.arrayOf(PropTypes.objectOf(PropTypes.any).isRequired),
|
|
67
|
-
/**
|
|
68
|
-
* Coordinate boundary for the view defined as [left, bottom, right, top].
|
|
69
|
-
* It can be either an array or a callback returning [number, number, number, number].
|
|
70
|
-
*/
|
|
71
|
-
bounds: PropTypes.any,
|
|
72
|
-
/**
|
|
73
|
-
* Views configuration for map. If not specified, all the layers will be
|
|
74
|
-
* displayed in a single 2D viewport.
|
|
75
|
-
* Example:
|
|
76
|
-
* views = {
|
|
77
|
-
* "layout": [1, 1],
|
|
78
|
-
* "showLabel": false,
|
|
79
|
-
* "viewports": [
|
|
80
|
-
* {
|
|
81
|
-
* "id": "view_1",
|
|
82
|
-
* "name"?: "View 1"
|
|
83
|
-
* "show3D"?: false,
|
|
84
|
-
* "layerIds": ["layer-ids"],
|
|
85
|
-
* "isSync?": true,
|
|
86
|
-
* }
|
|
87
|
-
* ]
|
|
88
|
-
* }
|
|
89
|
-
*/
|
|
90
|
-
// TODO - define proper type for views prop
|
|
91
|
-
views: PropTypes.any,
|
|
92
|
-
/**
|
|
93
|
-
* Parameters for the InfoCard component
|
|
94
|
-
*/
|
|
95
|
-
coords: PropTypes.shape({
|
|
96
|
-
/**
|
|
97
|
-
* Toggle component visibility.
|
|
98
|
-
*/
|
|
99
|
-
visible: PropTypes.bool,
|
|
100
|
-
/**
|
|
101
|
-
* Enable or disable multi picking. Might have a performance penalty.
|
|
102
|
-
* See https://deck.gl/docs/api-reference/core/deck#pickmultipleobjects
|
|
103
|
-
*/
|
|
104
|
-
multiPicking: PropTypes.bool,
|
|
105
|
-
/**
|
|
106
|
-
* Number of objects to pick. The more objects picked, the more picking operations will be done.
|
|
107
|
-
* See https://deck.gl/docs/api-reference/core/deck#pickmultipleobjects
|
|
108
|
-
*/
|
|
109
|
-
pickDepth: PropTypes.number,
|
|
110
|
-
}),
|
|
111
|
-
/**
|
|
112
|
-
* Parameters for the Distance Scale component
|
|
113
|
-
*/
|
|
114
|
-
scale: PropTypes.shape({
|
|
115
|
-
/**
|
|
116
|
-
* Toggle component visibility.
|
|
117
|
-
*/
|
|
118
|
-
visible: PropTypes.bool,
|
|
119
|
-
/**
|
|
120
|
-
* Increment value for the scale.
|
|
121
|
-
*/
|
|
122
|
-
incrementValue: PropTypes.number,
|
|
123
|
-
/**
|
|
124
|
-
* Scale bar width in pixels per unit value.
|
|
125
|
-
*/
|
|
126
|
-
widthPerUnit: PropTypes.number,
|
|
127
|
-
/**
|
|
128
|
-
* Scale bar css style can be used for positioning.
|
|
129
|
-
*/
|
|
130
|
-
cssStyle: PropTypes.objectOf(PropTypes.any),
|
|
131
|
-
}),
|
|
132
|
-
/**
|
|
133
|
-
* Parameters for the Distance Scale component
|
|
134
|
-
* Unit for the scale ruler
|
|
135
|
-
*/
|
|
136
|
-
coordinateUnit: PropTypes.oneOf(convert().possibilities()),
|
|
137
|
-
/**
|
|
138
|
-
* Prop containing color table data
|
|
139
|
-
*/
|
|
140
|
-
colorTables: PropTypes.array,
|
|
141
|
-
/**
|
|
142
|
-
* Prop containing edited data from layers
|
|
143
|
-
*/
|
|
144
|
-
editedData: PropTypes.objectOf(PropTypes.any),
|
|
145
|
-
/**
|
|
146
|
-
* For reacting to prop changes
|
|
147
|
-
*/
|
|
148
|
-
setProps: PropTypes.func,
|
|
149
|
-
/**
|
|
150
|
-
* Validate JSON datafile against schema
|
|
151
|
-
*/
|
|
152
|
-
checkDatafileSchema: PropTypes.bool,
|
|
153
|
-
/**
|
|
154
|
-
* For get mouse events
|
|
155
|
-
*/
|
|
156
|
-
onMouseEvent: PropTypes.func,
|
|
157
|
-
children: PropTypes.any,
|
|
158
|
-
};
|
|
159
|
-
export default DashSubsurfaceViewer;
|
|
160
|
-
//# sourceMappingURL=DashSubsurfaceViewer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DashSubsurfaceViewer.js","sourceRoot":"","sources":["../src/DashSubsurfaceView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C,KAAK,CAAC;QACnB;;WAEG;QACH,OAAO,EAAE,SAAS,CAAC,IAAI;QACvB;;WAEG;QACH,cAAc,EAAE,SAAS,CAAC,MAAM;QAChC;;WAEG;QACH,YAAY,EAAE,SAAS,CAAC,MAAM;QAC9B;;WAEG;QACH,QAAQ,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC;KAC9C,CAAC;IAEF;;;OAGG;IACH,cAAc,EAAE,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,aAAa,EAAE,CAAC;IAE1D;;OAEG;IACH,WAAW,EAAE,SAAS,CAAC,KAAK;IAE5B;;OAEG;IACH,UAAU,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC;IAE7C;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC,IAAI;IAExB;;OAEG;IACH,mBAAmB,EAAE,SAAS,CAAC,IAAI;IAEnC;;OAEG;IACH,YAAY,EAAE,SAAS,CAAC,IAAI;IAE5B,QAAQ,EAAE,SAAS,CAAC,GAAG;CAC1B,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
|
-
import { View } from "@deck.gl/core/typed";
|
|
4
|
-
import { colorTablesArray } from "@emerson-eps/color-tables/";
|
|
5
|
-
import SubsurfaceViewer, { SubsurfaceViewerProps } from "./SubsurfaceViewer";
|
|
6
|
-
import {
|
|
7
|
-
ViewsType,
|
|
8
|
-
TooltipCallback,
|
|
9
|
-
ViewStateType,
|
|
10
|
-
BoundsAccessor,
|
|
11
|
-
} from "./components/Map";
|
|
12
|
-
import { MapMouseEvent } from "./components/Map";
|
|
13
|
-
import convert, { Unit } from "convert-units";
|
|
14
|
-
|
|
15
|
-
export interface DashSubsurfaceViewerProps {
|
|
16
|
-
id: string;
|
|
17
|
-
resources?: Record<string, unknown>;
|
|
18
|
-
layers?: Record<string, unknown>[];
|
|
19
|
-
bounds?: [number, number, number, number] | BoundsAccessor;
|
|
20
|
-
views?: ViewsType;
|
|
21
|
-
coords?: {
|
|
22
|
-
visible?: boolean | null;
|
|
23
|
-
multiPicking?: boolean | null;
|
|
24
|
-
pickDepth?: number | null;
|
|
25
|
-
};
|
|
26
|
-
scale?: {
|
|
27
|
-
visible?: boolean | null;
|
|
28
|
-
incrementValue?: number | null;
|
|
29
|
-
widthPerUnit?: number | null;
|
|
30
|
-
cssStyle?: Record<string, unknown> | null;
|
|
31
|
-
};
|
|
32
|
-
coordinateUnit?: Unit;
|
|
33
|
-
colorTables?: colorTablesArray;
|
|
34
|
-
editedData?: Record<string, unknown>;
|
|
35
|
-
setProps?: (data: Record<string, unknown>) => void;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Validate JSON datafile against schema
|
|
39
|
-
*/
|
|
40
|
-
checkDatafileSchema?: boolean;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* For get mouse events
|
|
44
|
-
*/
|
|
45
|
-
onMouseEvent?: (event: MapMouseEvent) => void;
|
|
46
|
-
|
|
47
|
-
getCameraPosition?: (input: ViewStateType) => void;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* If changed will reset camera to default position.
|
|
51
|
-
*/
|
|
52
|
-
triggerHome?: number;
|
|
53
|
-
triggerResetMultipleWells?: number;
|
|
54
|
-
/**
|
|
55
|
-
* Range selection of the current well
|
|
56
|
-
*/
|
|
57
|
-
selection?: {
|
|
58
|
-
well: string | undefined;
|
|
59
|
-
selection: [number | undefined, number | undefined] | undefined;
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Override default tooltip with a callback.
|
|
64
|
-
*/
|
|
65
|
-
getTooltip?: TooltipCallback;
|
|
66
|
-
cameraPosition?: ViewStateType | undefined;
|
|
67
|
-
|
|
68
|
-
children?: React.ReactNode;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function mapAnnotation(annotationContainers: React.ReactNode) {
|
|
72
|
-
return React.Children.map(annotationContainers, (annotationContainer) => {
|
|
73
|
-
const viewId = (annotationContainer as React.ReactElement).key;
|
|
74
|
-
return (
|
|
75
|
-
// @ts-expect-error This is demonstrated to work with js, but with ts it gives error
|
|
76
|
-
<View key={viewId} id={viewId}>
|
|
77
|
-
{annotationContainer}
|
|
78
|
-
</View>
|
|
79
|
-
);
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
const DashSubsurfaceViewer: React.FC<DashSubsurfaceViewerProps> = ({
|
|
84
|
-
id,
|
|
85
|
-
resources,
|
|
86
|
-
layers,
|
|
87
|
-
bounds,
|
|
88
|
-
views,
|
|
89
|
-
coords,
|
|
90
|
-
scale,
|
|
91
|
-
coordinateUnit,
|
|
92
|
-
colorTables,
|
|
93
|
-
editedData,
|
|
94
|
-
setProps,
|
|
95
|
-
checkDatafileSchema,
|
|
96
|
-
onMouseEvent,
|
|
97
|
-
selection,
|
|
98
|
-
getTooltip,
|
|
99
|
-
cameraPosition,
|
|
100
|
-
getCameraPosition,
|
|
101
|
-
triggerHome,
|
|
102
|
-
triggerResetMultipleWells,
|
|
103
|
-
children,
|
|
104
|
-
}: DashSubsurfaceViewerProps) => {
|
|
105
|
-
const mapArgs: SubsurfaceViewerProps = {
|
|
106
|
-
id: id,
|
|
107
|
-
resources: resources,
|
|
108
|
-
layers: layers,
|
|
109
|
-
bounds: bounds,
|
|
110
|
-
views: views,
|
|
111
|
-
coords: coords,
|
|
112
|
-
scale: scale,
|
|
113
|
-
coordinateUnit: coordinateUnit,
|
|
114
|
-
colorTables: colorTables,
|
|
115
|
-
editedData: editedData,
|
|
116
|
-
setProps: setProps,
|
|
117
|
-
checkDatafileSchema: checkDatafileSchema,
|
|
118
|
-
onMouseEvent: onMouseEvent,
|
|
119
|
-
selection: selection,
|
|
120
|
-
getTooltip: getTooltip,
|
|
121
|
-
cameraPosition: cameraPosition,
|
|
122
|
-
getCameraPosition: getCameraPosition,
|
|
123
|
-
triggerHome: triggerHome,
|
|
124
|
-
triggerResetMultipleWells: triggerResetMultipleWells,
|
|
125
|
-
children: children,
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
return (
|
|
129
|
-
<SubsurfaceViewer {...mapArgs}>
|
|
130
|
-
{mapAnnotation(children)}
|
|
131
|
-
</SubsurfaceViewer>
|
|
132
|
-
);
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
DashSubsurfaceViewer.defaultProps = {
|
|
136
|
-
views: {
|
|
137
|
-
layout: [1, 1],
|
|
138
|
-
showLabel: false,
|
|
139
|
-
viewports: [{ id: "main-view", show3D: false, layerIds: [] }],
|
|
140
|
-
},
|
|
141
|
-
checkDatafileSchema: false,
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
DashSubsurfaceViewer.propTypes = {
|
|
145
|
-
/**
|
|
146
|
-
* The ID of this component, used to identify dash components
|
|
147
|
-
* in callbacks. The ID needs to be unique across all of the
|
|
148
|
-
* components in an app.
|
|
149
|
-
*/
|
|
150
|
-
id: PropTypes.string.isRequired,
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Resource dictionary made available in the DeckGL specification as an enum.
|
|
154
|
-
* The values can be accessed like this: `"@@#resources.resourceId"`, where
|
|
155
|
-
* `resourceId` is the key in the `resources` dict. For more information,
|
|
156
|
-
* see the DeckGL documentation on enums in the json spec:
|
|
157
|
-
* https://deck.gl/docs/api-reference/json/conversion-reference#enumerations-and-using-the--prefix
|
|
158
|
-
*/
|
|
159
|
-
resources: PropTypes.objectOf(PropTypes.any),
|
|
160
|
-
|
|
161
|
-
/* List of JSON object containing layer specific data.
|
|
162
|
-
* Each JSON object will consist of layer type with key as "@@type" and
|
|
163
|
-
* layer specific data, if any.
|
|
164
|
-
*/
|
|
165
|
-
layers: PropTypes.arrayOf(PropTypes.objectOf(PropTypes.any).isRequired),
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Coordinate boundary for the view defined as [left, bottom, right, top].
|
|
169
|
-
* It can be either an array or a callback returning [number, number, number, number].
|
|
170
|
-
*/
|
|
171
|
-
bounds: PropTypes.any,
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Views configuration for map. If not specified, all the layers will be
|
|
175
|
-
* displayed in a single 2D viewport.
|
|
176
|
-
* Example:
|
|
177
|
-
* views = {
|
|
178
|
-
* "layout": [1, 1],
|
|
179
|
-
* "showLabel": false,
|
|
180
|
-
* "viewports": [
|
|
181
|
-
* {
|
|
182
|
-
* "id": "view_1",
|
|
183
|
-
* "name"?: "View 1"
|
|
184
|
-
* "show3D"?: false,
|
|
185
|
-
* "layerIds": ["layer-ids"],
|
|
186
|
-
* "isSync?": true,
|
|
187
|
-
* }
|
|
188
|
-
* ]
|
|
189
|
-
* }
|
|
190
|
-
*/
|
|
191
|
-
// TODO - define proper type for views prop
|
|
192
|
-
views: PropTypes.any,
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* Parameters for the InfoCard component
|
|
196
|
-
*/
|
|
197
|
-
coords: PropTypes.shape({
|
|
198
|
-
/**
|
|
199
|
-
* Toggle component visibility.
|
|
200
|
-
*/
|
|
201
|
-
visible: PropTypes.bool,
|
|
202
|
-
/**
|
|
203
|
-
* Enable or disable multi picking. Might have a performance penalty.
|
|
204
|
-
* See https://deck.gl/docs/api-reference/core/deck#pickmultipleobjects
|
|
205
|
-
*/
|
|
206
|
-
multiPicking: PropTypes.bool,
|
|
207
|
-
/**
|
|
208
|
-
* Number of objects to pick. The more objects picked, the more picking operations will be done.
|
|
209
|
-
* See https://deck.gl/docs/api-reference/core/deck#pickmultipleobjects
|
|
210
|
-
*/
|
|
211
|
-
pickDepth: PropTypes.number,
|
|
212
|
-
}),
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* Parameters for the Distance Scale component
|
|
216
|
-
*/
|
|
217
|
-
scale: PropTypes.shape({
|
|
218
|
-
/**
|
|
219
|
-
* Toggle component visibility.
|
|
220
|
-
*/
|
|
221
|
-
visible: PropTypes.bool,
|
|
222
|
-
/**
|
|
223
|
-
* Increment value for the scale.
|
|
224
|
-
*/
|
|
225
|
-
incrementValue: PropTypes.number,
|
|
226
|
-
/**
|
|
227
|
-
* Scale bar width in pixels per unit value.
|
|
228
|
-
*/
|
|
229
|
-
widthPerUnit: PropTypes.number,
|
|
230
|
-
/**
|
|
231
|
-
* Scale bar css style can be used for positioning.
|
|
232
|
-
*/
|
|
233
|
-
cssStyle: PropTypes.objectOf(PropTypes.any),
|
|
234
|
-
}),
|
|
235
|
-
|
|
236
|
-
/**
|
|
237
|
-
* Parameters for the Distance Scale component
|
|
238
|
-
* Unit for the scale ruler
|
|
239
|
-
*/
|
|
240
|
-
coordinateUnit: PropTypes.oneOf(convert().possibilities()),
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* Prop containing color table data
|
|
244
|
-
*/
|
|
245
|
-
colorTables: PropTypes.array,
|
|
246
|
-
|
|
247
|
-
/**
|
|
248
|
-
* Prop containing edited data from layers
|
|
249
|
-
*/
|
|
250
|
-
editedData: PropTypes.objectOf(PropTypes.any),
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* For reacting to prop changes
|
|
254
|
-
*/
|
|
255
|
-
setProps: PropTypes.func,
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* Validate JSON datafile against schema
|
|
259
|
-
*/
|
|
260
|
-
checkDatafileSchema: PropTypes.bool,
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* For get mouse events
|
|
264
|
-
*/
|
|
265
|
-
onMouseEvent: PropTypes.func,
|
|
266
|
-
|
|
267
|
-
children: PropTypes.any,
|
|
268
|
-
};
|
|
269
|
-
|
|
270
|
-
export default DashSubsurfaceViewer;
|