@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.
Files changed (177) hide show
  1. package/dist/index.d.ts +0 -1
  2. package/dist/index.js +0 -1
  3. package/dist/index.js.map +1 -1
  4. package/dist/package.json +5 -2
  5. package/package.json +6 -3
  6. package/dist/DashSubsurfaceViewer.d.ts +0 -56
  7. package/dist/DashSubsurfaceViewer.js +0 -160
  8. package/dist/DashSubsurfaceViewer.js.map +0 -1
  9. package/src/DashSubsurfaceViewer.tsx +0 -270
  10. package/src/SubsurfaceViewer.stories.tsx +0 -449
  11. package/src/SubsurfaceViewer.test.tsx +0 -98
  12. package/src/SubsurfaceViewer.tsx +0 -356
  13. package/src/__snapshots__/SubsurfaceViewer.test.tsx.snap +0 -178
  14. package/src/assets/glTF/north_arrow/scene.bin +0 -0
  15. package/src/assets/glTF/north_arrow/scene.gltf +0 -315
  16. package/src/assets/glTF/north_arrow/textures/Arrow5_baseColor.png +0 -0
  17. package/src/assets/glTF/north_arrow/textures/Arrow5_metallicRoughness.png +0 -0
  18. package/src/assets/glTF/north_arrow/textures/Arrow5_normal.png +0 -0
  19. package/src/components/ColorLegend.test.tsx +0 -32
  20. package/src/components/ColorLegend.tsx +0 -80
  21. package/src/components/ColorLegends.test.tsx +0 -97
  22. package/src/components/ColorLegends.tsx +0 -46
  23. package/src/components/DistanceScale.stories.tsx +0 -28
  24. package/src/components/DistanceScale.test.tsx +0 -36
  25. package/src/components/DistanceScale.tsx +0 -84
  26. package/src/components/InfoCard.test.tsx +0 -110
  27. package/src/components/InfoCard.tsx +0 -263
  28. package/src/components/Map.test.tsx +0 -142
  29. package/src/components/Map.tsx +0 -1435
  30. package/src/components/StatusIndicator.test.tsx +0 -14
  31. package/src/components/StatusIndicator.tsx +0 -38
  32. package/src/components/ViewAnnotation.tsx +0 -16
  33. package/src/components/ViewFooter.test.tsx +0 -12
  34. package/src/components/ViewFooter.tsx +0 -30
  35. package/src/components/__snapshots__/ColorLegends.test.tsx.snap +0 -15
  36. package/src/components/__snapshots__/DistanceScale.test.tsx.snap +0 -33
  37. package/src/components/__snapshots__/InfoCard.test.tsx.snap +0 -561
  38. package/src/components/__snapshots__/Map.test.tsx.snap +0 -119
  39. package/src/components/__snapshots__/StatusIndicator.test.tsx.snap +0 -3
  40. package/src/components/__snapshots__/ViewFooter.test.tsx.snap +0 -7
  41. package/src/components/settings/DrawModeSelector.test.tsx +0 -45
  42. package/src/components/settings/DrawModeSelector.tsx +0 -58
  43. package/src/components/settings/DrawModeSelector_performance.test.tsx +0 -35
  44. package/src/components/settings/LayerProperty.test.tsx +0 -35
  45. package/src/components/settings/LayerProperty.tsx +0 -153
  46. package/src/components/settings/LayerProperty_performance.test.tsx +0 -39
  47. package/src/components/settings/LayerSettingsButton.test.tsx +0 -133
  48. package/src/components/settings/LayerSettingsButton.tsx +0 -95
  49. package/src/components/settings/LayersButton.test.tsx +0 -102
  50. package/src/components/settings/LayersButton.tsx +0 -97
  51. package/src/components/settings/NumericInput.test.tsx +0 -25
  52. package/src/components/settings/NumericInput.tsx +0 -67
  53. package/src/components/settings/Settings.tsx +0 -71
  54. package/src/components/settings/SliderInput.test.tsx +0 -28
  55. package/src/components/settings/SliderInput.tsx +0 -71
  56. package/src/components/settings/ToggleButton.test.tsx +0 -25
  57. package/src/components/settings/ToggleButton.tsx +0 -53
  58. package/src/components/settings/__snapshots__/DrawModeSelector.test.tsx.snap +0 -124
  59. package/src/components/settings/__snapshots__/LayerProperty.test.tsx.snap +0 -124
  60. package/src/components/settings/__snapshots__/LayerSettingsButton.test.tsx.snap +0 -36
  61. package/src/components/settings/__snapshots__/LayersButton.test.tsx.snap +0 -83
  62. package/src/components/settings/__snapshots__/NumericInput.test.tsx.snap +0 -123
  63. package/src/components/settings/__snapshots__/SliderInput.test.tsx.snap +0 -244
  64. package/src/components/settings/__snapshots__/ToggleButton.test.tsx.snap +0 -182
  65. package/src/custom.d.ts +0 -9
  66. package/src/index.ts +0 -5
  67. package/src/inputSchema/ColorTables.json +0 -51
  68. package/src/inputSchema/FaultPolygons.json +0 -80
  69. package/src/inputSchema/Grid.json +0 -39
  70. package/src/inputSchema/PieChart.json +0 -72
  71. package/src/inputSchema/WellLog.json +0 -126
  72. package/src/inputSchema/WellLogTemplate.json +0 -136
  73. package/src/inputSchema/WellLogs.json +0 -5
  74. package/src/inputSchema/Wells.json +0 -106
  75. package/src/inputSchema/schemaValidationUtil.tsx +0 -55
  76. package/src/inputSchema/validator.tsx +0 -72
  77. package/src/inputSchema/wellCompletions.json +0 -108
  78. package/src/layers/BoxSelectionLayer/boxSelectionLayer.stories.tsx +0 -172
  79. package/src/layers/BoxSelectionLayer/boxSelectionLayer.tsx +0 -136
  80. package/src/layers/axes/axes-fragment.glsl.ts +0 -15
  81. package/src/layers/axes/axesLayer.stories.tsx +0 -87
  82. package/src/layers/axes/axesLayer.ts +0 -692
  83. package/src/layers/axes/boxLayer.ts +0 -71
  84. package/src/layers/axes/grid-vertex.glsl.ts +0 -14
  85. package/src/layers/axes2d/axes2DLayer.stories.tsx +0 -150
  86. package/src/layers/axes2d/axes2DLayer.ts +0 -841
  87. package/src/layers/axes2d/font-atlas.png +0 -0
  88. package/src/layers/axes2d/label-fragment.glsl.js +0 -37
  89. package/src/layers/axes2d/label-vertex.glsl.js +0 -20
  90. package/src/layers/axes2d/line-fragment.glsl.js +0 -14
  91. package/src/layers/axes2d/line-vertex.glsl.js +0 -13
  92. package/src/layers/colormap/colormap.fs.glsl.ts +0 -42
  93. package/src/layers/colormap/colormapLayer.ts +0 -247
  94. package/src/layers/drawing/drawingLayer.tsx +0 -256
  95. package/src/layers/fault_polygons/faultPolygonsLayer.ts +0 -54
  96. package/src/layers/grid3d/fragment.fs.glsl.ts +0 -109
  97. package/src/layers/grid3d/fragment_lines.glsl.ts +0 -21
  98. package/src/layers/grid3d/grid3dLayer.stories.tsx +0 -172
  99. package/src/layers/grid3d/grid3dLayer.ts +0 -248
  100. package/src/layers/grid3d/privateLayer.ts +0 -292
  101. package/src/layers/grid3d/vertex.glsl.ts +0 -43
  102. package/src/layers/grid3d/vertex_lines.glsl.ts +0 -15
  103. package/src/layers/grid3d/webworker.ts +0 -173
  104. package/src/layers/hillshading2d/hillshading2d.fs.glsl.ts +0 -62
  105. package/src/layers/hillshading2d/hillshading2dLayer.ts +0 -172
  106. package/src/layers/index.ts +0 -35
  107. package/src/layers/intersection/intersectionView.stories.tsx +0 -294
  108. package/src/layers/intersection/unfoldedGeoJsonLayer.ts +0 -92
  109. package/src/layers/map/fragment.fs.glsl.ts +0 -127
  110. package/src/layers/map/fragment_lines.glsl.ts +0 -21
  111. package/src/layers/map/mapLayer.stories.tsx +0 -1369
  112. package/src/layers/map/mapLayer.ts +0 -470
  113. package/src/layers/map/privateMapLayer.ts +0 -317
  114. package/src/layers/map/vertex.glsl.ts +0 -45
  115. package/src/layers/map/vertex_lines.glsl.ts +0 -15
  116. package/src/layers/map/webworker.ts +0 -479
  117. package/src/layers/northarrow/northArrow.stories.tsx +0 -108
  118. package/src/layers/northarrow/northArrow3DLayer.ts +0 -204
  119. package/src/layers/northarrow/northarrow-fragment.glsl.js +0 -14
  120. package/src/layers/northarrow/northarrow-vertex.glsl.js +0 -13
  121. package/src/layers/piechart/fragment.glsl.js +0 -42
  122. package/src/layers/piechart/pieChartLayer.ts +0 -246
  123. package/src/layers/piechart/vertex.glsl.js +0 -42
  124. package/src/layers/points/pointsLayer.stories.tsx +0 -141
  125. package/src/layers/points/pointsLayer.ts +0 -143
  126. package/src/layers/polylines/polylinesLayer.stories.tsx +0 -144
  127. package/src/layers/polylines/polylinesLayer.ts +0 -263
  128. package/src/layers/selectable_geojson/selectableGeoJsonLayer.ts +0 -25
  129. package/src/layers/shader_modules/decoder.fs.glsl.ts +0 -41
  130. package/src/layers/shader_modules/decoder.ts +0 -46
  131. package/src/layers/shader_modules/index.ts +0 -1
  132. package/src/layers/terrain/map3DLayer.stories.tsx +0 -340
  133. package/src/layers/terrain/map3DLayer.ts +0 -556
  134. package/src/layers/terrain/terrainMapLayer.ts +0 -334
  135. package/src/layers/terrain/terrainmap.fs.glsl.ts +0 -134
  136. package/src/layers/triangle/fragment.fs.glsl.ts +0 -126
  137. package/src/layers/triangle/fragment_lines.glsl.ts +0 -21
  138. package/src/layers/triangle/privateTriangleLayer.ts +0 -203
  139. package/src/layers/triangle/test_data/surfacePoints.ts +0 -4344
  140. package/src/layers/triangle/test_data/surfaceTriangles.ts +0 -7392
  141. package/src/layers/triangle/triangleLayer.stories.tsx +0 -191
  142. package/src/layers/triangle/triangleLayer.ts +0 -273
  143. package/src/layers/triangle/vertex.glsl.ts +0 -35
  144. package/src/layers/triangle/vertex_lines.glsl.ts +0 -15
  145. package/src/layers/triangle/webworker.ts +0 -165
  146. package/src/layers/utils/glsl.d.ts +0 -4
  147. package/src/layers/utils/layerTools.ts +0 -182
  148. package/src/layers/utils/propertyMapTools.ts +0 -43
  149. package/src/layers/wells/utils/spline.ts +0 -318
  150. package/src/layers/wells/wellsLayer.stories.tsx +0 -625
  151. package/src/layers/wells/wellsLayer.ts +0 -1377
  152. package/src/redux/actions.ts +0 -8
  153. package/src/redux/reducer.ts +0 -43
  154. package/src/redux/store.ts +0 -15
  155. package/src/redux/types.ts +0 -114
  156. package/src/storybook/SubsurfaceViewer.stories.jsx +0 -644
  157. package/src/storybook/components/InfoCard.stories.jsx +0 -39
  158. package/src/storybook/components/colorLegends/ContinuousLegend.stories.jsx +0 -32
  159. package/src/storybook/components/colorLegends/DiscreteLegend.stories.jsx +0 -33
  160. package/src/storybook/components/colorLegends/IndividualScaleForMap.stories.jsx +0 -99
  161. package/src/storybook/components/colorLegends/SingleScaleForMap.stories.jsx +0 -120
  162. package/src/storybook/components/settings/LayerSettingsButton.stories.jsx +0 -34
  163. package/src/storybook/components/settings/NumericInput.stories.jsx +0 -17
  164. package/src/storybook/components/settings/ToggleButton.stories.jsx +0 -16
  165. package/src/storybook/schemaValidation/sampleData.js +0 -177
  166. package/src/storybook/schemaValidation/schemaValidation.stories.jsx +0 -91
  167. package/src/test/TestWrapper.tsx +0 -13
  168. package/src/utils/configuration.ts +0 -61
  169. package/src/utils/fit-bounds.js +0 -85
  170. package/src/utils/measurement.ts +0 -61
  171. package/src/utils/northArrow.ts +0 -4
  172. package/src/utils/specExtractor.ts +0 -36
  173. package/src/viewports/index.js +0 -1
  174. package/src/viewports/intersectionViewport.ts +0 -137
  175. package/src/views/index.js +0 -1
  176. package/src/views/intersectionView.ts +0 -38
  177. package/tsconfig.json +0 -7
package/dist/index.d.ts CHANGED
@@ -1,2 +1 @@
1
1
  export { default, SubsurfaceViewerProps } from "./SubsurfaceViewer";
2
- export { default as DashSubsurfaceViewer, DashSubsurfaceViewerProps, } from "./DashSubsurfaceViewer";
package/dist/index.js CHANGED
@@ -1,3 +1,2 @@
1
1
  export { default } from "./SubsurfaceViewer";
2
- export { default as DashSubsurfaceViewer, } from "./DashSubsurfaceViewer";
3
2
  //# sourceMappingURL=index.js.map
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;AACpE,OAAO,EACH,OAAO,IAAI,oBAAoB,GAElC,MAAM,wBAAwB,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": "src/index.ts",
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.1-alpha.1",
3
+ "version": "0.0.2-alpha.2",
4
4
  "description": "",
5
- "main": "src/index.ts",
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/DashSubsurfaceViewer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE3C,OAAO,gBAA2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;;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;