@webviz/subsurface-viewer 0.0.2-alpha.1 → 0.0.2-alpha.3

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 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
@@ -13,7 +13,7 @@
13
13
  "dependencies": {
14
14
  "@deck.gl/core": "^8.8.25",
15
15
  "@emerson-eps/color-tables": "^0.4.56",
16
- "@equinor/eds-core-react": "^0.12.1",
16
+ "@equinor/eds-core-react": "^0.16.1",
17
17
  "@equinor/eds-icons": "^0.19.1",
18
18
  "@mui/material": "^5.13.4",
19
19
  "@mui/system": "^5.12.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webviz/subsurface-viewer",
3
- "version": "0.0.2-alpha.1",
3
+ "version": "0.0.2-alpha.3",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -13,7 +13,7 @@
13
13
  "dependencies": {
14
14
  "@deck.gl/core": "^8.8.25",
15
15
  "@emerson-eps/color-tables": "^0.4.56",
16
- "@equinor/eds-core-react": "^0.12.1",
16
+ "@equinor/eds-core-react": "^0.16.1",
17
17
  "@equinor/eds-icons": "^0.19.1",
18
18
  "@mui/material": "^5.13.4",
19
19
  "@mui/system": "^5.12.1",
@@ -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,gBAA2C,MAAM,oBAAoB,CAAC;AAQ7E,OAAO,OAAiB,MAAM,eAAe,CAAC;AA0D9C,SAAS,aAAa,CAAC,oBAAqC;IACxD,OAAO,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,oBAAoB,EAAE,CAAC,mBAAmB,EAAE,EAAE;QACpE,MAAM,MAAM,GAAI,mBAA0C,CAAC,GAAG,CAAC;QAC/D,OAAO;QACH,oFAAoF;QACpF,oBAAC,IAAI,IAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,IACxB,mBAAmB,CACjB,CACV,CAAC;IACN,CAAC,CAAC,CAAC;AACP,CAAC;AAED,MAAM,oBAAoB,GAAwC,CAAC,EAC/D,EAAE,EACF,SAAS,EACT,MAA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