@webviz/subsurface-viewer 1.14.1 → 1.14.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.
Files changed (64) hide show
  1. package/dist/DashSubsurfaceViewer.d.ts +9 -0
  2. package/dist/DashSubsurfaceViewer.js +2 -2
  3. package/dist/DashSubsurfaceViewer.js.map +1 -1
  4. package/dist/components/InfoCard.js +6 -3
  5. package/dist/components/InfoCard.js.map +1 -1
  6. package/dist/components/Map.d.ts +3 -0
  7. package/dist/components/Map.js +33 -15
  8. package/dist/components/Map.js.map +1 -1
  9. package/dist/index.d.ts +2 -0
  10. package/dist/index.js +1 -0
  11. package/dist/index.js.map +1 -1
  12. package/dist/layers/axes2d/axes2DLayer.js +3 -1
  13. package/dist/layers/axes2d/axes2DLayer.js.map +1 -1
  14. package/dist/layers/gpglLayers/gpglValueMappedSurfaceLayer.js +3 -6
  15. package/dist/layers/gpglLayers/gpglValueMappedSurfaceLayer.js.map +1 -1
  16. package/dist/layers/gpglLayers/texTriangle.fs.glsl.d.ts +1 -1
  17. package/dist/layers/gpglLayers/texTriangle.fs.glsl.js +8 -5
  18. package/dist/layers/gpglLayers/texTriangle.fs.glsl.js.map +1 -1
  19. package/dist/layers/grid3d/cellProperty.fs.glsl.d.ts +1 -1
  20. package/dist/layers/grid3d/cellProperty.fs.glsl.js +1 -1
  21. package/dist/layers/grid3d/nodeProperty.fs.glsl.d.ts +1 -1
  22. package/dist/layers/grid3d/nodeProperty.fs.glsl.js +1 -1
  23. package/dist/layers/grid3d/privateGrid3dLayer.js +3 -5
  24. package/dist/layers/grid3d/privateGrid3dLayer.js.map +1 -1
  25. package/dist/layers/index.d.ts +0 -1
  26. package/dist/layers/index.js +0 -1
  27. package/dist/layers/index.js.map +1 -1
  28. package/dist/layers/map/map.fs.glsl.d.ts +1 -1
  29. package/dist/layers/map/map.fs.glsl.js +1 -1
  30. package/dist/layers/map/privateMapLayer.js +3 -5
  31. package/dist/layers/map/privateMapLayer.js.map +1 -1
  32. package/dist/layers/shader_modules/index.d.ts +1 -1
  33. package/dist/layers/shader_modules/index.js +1 -1
  34. package/dist/layers/shader_modules/index.js.map +1 -1
  35. package/dist/layers/shader_modules/utilities.d.ts +85 -0
  36. package/dist/layers/shader_modules/utilities.js +168 -20
  37. package/dist/layers/shader_modules/utilities.js.map +1 -1
  38. package/dist/utils/serialize.d.ts +1 -1
  39. package/dist/utils/serialize.js +5 -2
  40. package/dist/utils/serialize.js.map +1 -1
  41. package/dist/viewports/index.d.ts +1 -1
  42. package/dist/viewports/index.js +1 -1
  43. package/dist/viewports/index.js.map +1 -1
  44. package/dist/viewports/sectionViewport.d.ts +5 -0
  45. package/dist/viewports/sectionViewport.js +7 -0
  46. package/dist/viewports/sectionViewport.js.map +1 -0
  47. package/dist/views/index.d.ts +1 -1
  48. package/dist/views/index.js +1 -1
  49. package/dist/views/index.js.map +1 -1
  50. package/dist/views/sectionView.d.ts +10 -0
  51. package/dist/views/sectionView.js +12 -0
  52. package/dist/views/sectionView.js.map +1 -0
  53. package/dist/views/viewport.d.ts +9 -0
  54. package/dist/views/viewport.js.map +1 -1
  55. package/package.json +2 -2
  56. package/dist/layers/intersection/unfoldedGeoJsonLayer.d.ts +0 -10
  57. package/dist/layers/intersection/unfoldedGeoJsonLayer.js +0 -64
  58. package/dist/layers/intersection/unfoldedGeoJsonLayer.js.map +0 -1
  59. package/dist/viewports/intersectionViewport.d.ts +0 -36
  60. package/dist/viewports/intersectionViewport.js +0 -65
  61. package/dist/viewports/intersectionViewport.js.map +0 -1
  62. package/dist/views/intersectionView.d.ts +0 -20
  63. package/dist/views/intersectionView.js +0 -23
  64. package/dist/views/intersectionView.js.map +0 -1
@@ -2,3 +2,88 @@ export declare const utilities: {
2
2
  name: string;
3
3
  fs: string;
4
4
  };
5
+ type RGB = [number, number, number];
6
+ /**
7
+ * Encodes a numeric index into an RGB array, where each element represents
8
+ * a color channel (red, green, blue) in the range [0, 255].
9
+ *
10
+ * This function is the same than the shader function `encodeIndexToRGB`,
11
+ * except that the shader function returns values in the range [0, 1] to satisfy
12
+ * OpenGL's requirements for color values.
13
+ *
14
+ * The encoding uses bit-shifting to split the index into three 8-bit values,
15
+ * allowing for unique representation of indices from 0 to 16,777,215.
16
+ *
17
+ * @param index - The numeric index to encode. Values outside the range [0, 16,777,215]
18
+ * are clamped to fit within the representable range.
19
+ * @returns An array of three numbers representing the encoded RGB value.
20
+ */
21
+ export declare function encodeIndexToRGB(index: number): RGB;
22
+ /**
23
+ * Decodes a numeric index from an RGB-encoded array.
24
+ * Used to decode indices encoded with the shader function `encodeIndexToRGB`.
25
+ *
26
+ * The function interprets the input array as a packed 24-bit integer,
27
+ * where each element represents a color channel (red, green, blue).
28
+ * The index is calculated as: (red * 65536) + (green * 256) + blue.
29
+ *
30
+ * @param encodedIndex - An array of three numbers representing the RGB channels.
31
+ * @returns The decoded numeric index.
32
+ */
33
+ export declare function decodeIndexFromRGB(encodedIndex: RGB): number;
34
+ /**
35
+ * Encodes a normalized value (in the range [0, 1]) into an RGB representation,
36
+ * where each element represents a color channel (red, green, blue) in the range [0, 255].
37
+ *
38
+ * This function is the same than the shader function `encodeNormalizedValueToRGB`,
39
+ * except that the shader function returns values in the range [0, 1] to satisfy
40
+ * OpenGL's requirements for color values.
41
+ *
42
+ * The value is first clamped to the [0, 1] range, then scaled by `constants.MAX_INDEX`
43
+ * and passed to `encodeIndexToRGB` for conversion.
44
+ *
45
+ * @param value - The normalized value to encode, expected to be between 0 and 1.
46
+ * @returns An RGB object representing the encoded value.
47
+ */
48
+ export declare function encodeNormalizedValueToRGB(value: number): RGB;
49
+ /**
50
+ * Decodes a normalized value from an RGB-encoded array.
51
+ * Used to decode indices encoded with the shader function `encodeNormalizedValueToRGB`.
52
+ *
53
+ * The function interprets the input `encodedValue` as a 3-element array representing
54
+ * the red, green, and blue channels. It reconstructs the original value by combining
55
+ * the channels into a single integer and normalizing it by dividing by `constants.MAX_INDEX`.
56
+ *
57
+ * @param encodedValue - An array of three numbers representing the RGB channels.
58
+ * @returns The decoded normalized value as a number in the range [0, 1].
59
+ */
60
+ export declare function decodeNormalizedValueFromRGB(encodedValue: RGB): number;
61
+ /**
62
+ * Encodes a normalized value (in the range [0, 1]) into an RGB representation,
63
+ * where each element represents a color channel (red, green, blue) in the range [0, 255].
64
+ * The value can be NaN, which gets encoded to [255, 255, 255].
65
+ *
66
+ * This function is the same than the shader function `encodeNormalizedValueWithNaNToRGB`,
67
+ * except that the shader function returns values in the range [0, 1] to satisfy
68
+ * OpenGL's requirements for color values.
69
+ *
70
+ * The value is first clamped to the [0, 1] range, then scaled by `constants.MAX_INDEX`
71
+ * and passed to `encodeIndexToRGB` for conversion.
72
+ *
73
+ * @param value - The normalized value to encode, expected to be between 0 and 1.
74
+ * @returns An RGB object representing the encoded value.
75
+ */
76
+ export declare function encodeNormalizedValueWithNaNToRGB(value: number): RGB;
77
+ /**
78
+ * Decodes a normalized value from an RGB-encoded array.
79
+ * Used to decode indices encoded with the shader function `encodeNormalizedValueWithNaNToRGB`.
80
+ *
81
+ * The function interprets the input `encodedValue` as a 3-element array representing
82
+ * the red, green, and blue channels. It reconstructs the original value by combining
83
+ * the channels into a single integer and normalizing it by dividing by `constants.MAX_INDEX`.
84
+ *
85
+ * @param encodedValue - An array of three numbers representing the RGB channels.
86
+ * @returns The decoded normalized value as a number in the range [0, 1].
87
+ */
88
+ export declare function decodeNormalizedValueWithNaNFromRGB(encodedValue: RGB): number;
89
+ export {};
@@ -1,26 +1,174 @@
1
- const fs = `vec4 encodeVertexIndexToRGB (int vertexIndex) {
1
+ const fs = `//
2
2
 
3
- float r = 0.0;
4
- float g = 0.0;
5
- float b = 0.0;
6
-
7
- if (vertexIndex >= (256 * 256) - 1) {
8
- r = floor(float(vertexIndex) / (256.0 * 256.0));
9
- vertexIndex -= int(r * (256.0 * 256.0));
10
- }
11
-
12
- if (vertexIndex >= 256 - 1) {
13
- g = floor(float(vertexIndex) / 256.0);
14
- vertexIndex -= int(g * 256.0);
15
- }
16
-
17
- b = float(vertexIndex);
18
-
19
- return vec4(r / 255.0, g / 255.0, b / 255.0, 1.0);
20
- }
21
- `;
3
+ bool isNanValue(float value) {
4
+ // isnan() does not work in some systems, , neither does (value == value)
5
+ return (value < 0.0 || value > 0.0 || value == 0.0) ? false : true;
6
+ }
7
+
8
+ const int MAX_INDEX = 256 * 256 * 256 - 1; // 16777215
9
+
10
+ // Encodes an index [0..16777215] to RGB color.
11
+ // Note: 256 * 256 * 256 - 1 = 16777215
12
+ // Alpha value is overwritten by Deck.gl to encode the layer index
13
+ vec4 encodeIndexToRGB(int index) {
14
+ index = clamp(index, 0, MAX_INDEX);
15
+
16
+ vec4 encoded = vec4(index >> 16 & 0xff, index >> 8 & 0xff, index & 0xff, 255.0);
17
+ return encoded / 255.0;
18
+ }
19
+
20
+ // Encodes a normalized float [0..1] to RGB color.
21
+ // The value is clamped to [0, 1] before encoding.
22
+ // Due to OpenGL framebuffer precision, only 16777215 values are distinguished.
23
+ // Note: 256 * 256 * 256 - 1 = 16777215
24
+ // Alpha value is overwritten by Deck.gl to encode the layer index
25
+ vec4 encodeNormalizedValueToRGB(float value) {
26
+ value = clamp(value, 0.0, 1.0);
27
+ return encodeIndexToRGB(int(value * float(MAX_INDEX)));
28
+ }
29
+
30
+ // Encodes a normalized float [0..1] to RGB color.
31
+ // NaN gets encoded to [1, 1, 1, 1].
32
+ // The value is clamped to [0, 1] before encoding.
33
+ // Due to OpenGL framebuffer precision, only 16777214 values are distinguished.
34
+ // Note: 256 * 256 * 256 - 2 = 16777214 (one is reserved for NaN)
35
+ // Alpha value is overwritten by Deck.gl to encode the layer index
36
+ vec4 encodeNormalizedValueWithNaNToRGB(float value) {
37
+ if( isNanValue(value) ) {
38
+ return vec4(1.0, 1.0, 1.0, 1.0);
39
+ }
40
+ value = clamp(value, 0.0, 1.0);
41
+ return encodeIndexToRGB(int(value * float(MAX_INDEX - 1)));
42
+ }
43
+ `;
22
44
  export const utilities = {
23
45
  name: "utilities",
24
46
  fs,
25
47
  };
48
+ const constants = {
49
+ MAX_INDEX: 256 * 256 * 256 - 1, // 16777215
50
+ SHIFT_VECTOR: [16, 8, 0],
51
+ ENCODE_VECTOR: [16777215 / 65536, 16777215 / 256, 16777215],
52
+ v256: 256, // 256
53
+ v256_2: 256 * 256, // 65536
54
+ v256_3: 256 * 256 * 256, // 16777216
55
+ MAX_NORMALIZED_FLOAT: 255 / 256 +
56
+ 255 / 256 / 256 +
57
+ 255 / 256 / 256 / 256 +
58
+ 255 / 256 / 256 / 256 / 256,
59
+ scaleForNaN: (256 * 256 * 256 - 1) / (256 * 256 * 256),
60
+ };
61
+ /**
62
+ * Encodes a numeric index into an RGB array, where each element represents
63
+ * a color channel (red, green, blue) in the range [0, 255].
64
+ *
65
+ * This function is the same than the shader function `encodeIndexToRGB`,
66
+ * except that the shader function returns values in the range [0, 1] to satisfy
67
+ * OpenGL's requirements for color values.
68
+ *
69
+ * The encoding uses bit-shifting to split the index into three 8-bit values,
70
+ * allowing for unique representation of indices from 0 to 16,777,215.
71
+ *
72
+ * @param index - The numeric index to encode. Values outside the range [0, 16,777,215]
73
+ * are clamped to fit within the representable range.
74
+ * @returns An array of three numbers representing the encoded RGB value.
75
+ */
76
+ export function encodeIndexToRGB(index) {
77
+ // clamp to range that can be encoded
78
+ index = Math.min(Math.max(index, 0), constants.MAX_INDEX);
79
+ const encoded = constants.SHIFT_VECTOR.map((v) => (index >> v) & 0xff);
80
+ return encoded;
81
+ }
82
+ /**
83
+ * Decodes a numeric index from an RGB-encoded array.
84
+ * Used to decode indices encoded with the shader function `encodeIndexToRGB`.
85
+ *
86
+ * The function interprets the input array as a packed 24-bit integer,
87
+ * where each element represents a color channel (red, green, blue).
88
+ * The index is calculated as: (red * 65536) + (green * 256) + blue.
89
+ *
90
+ * @param encodedIndex - An array of three numbers representing the RGB channels.
91
+ * @returns The decoded numeric index.
92
+ */
93
+ export function decodeIndexFromRGB(encodedIndex) {
94
+ return 65536 * encodedIndex[0] + 256 * encodedIndex[1] + encodedIndex[2];
95
+ }
96
+ /**
97
+ * Encodes a normalized value (in the range [0, 1]) into an RGB representation,
98
+ * where each element represents a color channel (red, green, blue) in the range [0, 255].
99
+ *
100
+ * This function is the same than the shader function `encodeNormalizedValueToRGB`,
101
+ * except that the shader function returns values in the range [0, 1] to satisfy
102
+ * OpenGL's requirements for color values.
103
+ *
104
+ * The value is first clamped to the [0, 1] range, then scaled by `constants.MAX_INDEX`
105
+ * and passed to `encodeIndexToRGB` for conversion.
106
+ *
107
+ * @param value - The normalized value to encode, expected to be between 0 and 1.
108
+ * @returns An RGB object representing the encoded value.
109
+ */
110
+ export function encodeNormalizedValueToRGB(value) {
111
+ // clamp to [0, 1]
112
+ value = Math.min(Math.max(value, 0.0), 1.0);
113
+ return encodeIndexToRGB(value * constants.MAX_INDEX);
114
+ }
115
+ /**
116
+ * Decodes a normalized value from an RGB-encoded array.
117
+ * Used to decode indices encoded with the shader function `encodeNormalizedValueToRGB`.
118
+ *
119
+ * The function interprets the input `encodedValue` as a 3-element array representing
120
+ * the red, green, and blue channels. It reconstructs the original value by combining
121
+ * the channels into a single integer and normalizing it by dividing by `constants.MAX_INDEX`.
122
+ *
123
+ * @param encodedValue - An array of three numbers representing the RGB channels.
124
+ * @returns The decoded normalized value as a number in the range [0, 1].
125
+ */
126
+ export function decodeNormalizedValueFromRGB(encodedValue) {
127
+ return ((65536 * encodedValue[0] + 256 * encodedValue[1] + encodedValue[2]) /
128
+ constants.MAX_INDEX);
129
+ }
130
+ /**
131
+ * Encodes a normalized value (in the range [0, 1]) into an RGB representation,
132
+ * where each element represents a color channel (red, green, blue) in the range [0, 255].
133
+ * The value can be NaN, which gets encoded to [255, 255, 255].
134
+ *
135
+ * This function is the same than the shader function `encodeNormalizedValueWithNaNToRGB`,
136
+ * except that the shader function returns values in the range [0, 1] to satisfy
137
+ * OpenGL's requirements for color values.
138
+ *
139
+ * The value is first clamped to the [0, 1] range, then scaled by `constants.MAX_INDEX`
140
+ * and passed to `encodeIndexToRGB` for conversion.
141
+ *
142
+ * @param value - The normalized value to encode, expected to be between 0 and 1.
143
+ * @returns An RGB object representing the encoded value.
144
+ */
145
+ export function encodeNormalizedValueWithNaNToRGB(value) {
146
+ if (Number.isNaN(value)) {
147
+ return [255, 255, 255];
148
+ }
149
+ // clamp to [0, 1]
150
+ value = Math.min(Math.max(value, 0.0), 1.0);
151
+ // MAX_INDEX is used for NaN, so we have one less value to use.
152
+ return encodeIndexToRGB(value * (constants.MAX_INDEX - 1));
153
+ }
154
+ /**
155
+ * Decodes a normalized value from an RGB-encoded array.
156
+ * Used to decode indices encoded with the shader function `encodeNormalizedValueWithNaNToRGB`.
157
+ *
158
+ * The function interprets the input `encodedValue` as a 3-element array representing
159
+ * the red, green, and blue channels. It reconstructs the original value by combining
160
+ * the channels into a single integer and normalizing it by dividing by `constants.MAX_INDEX`.
161
+ *
162
+ * @param encodedValue - An array of three numbers representing the RGB channels.
163
+ * @returns The decoded normalized value as a number in the range [0, 1].
164
+ */
165
+ export function decodeNormalizedValueWithNaNFromRGB(encodedValue) {
166
+ if (encodedValue[0] === 255 &&
167
+ encodedValue[1] === 255 &&
168
+ encodedValue[2] === 255) {
169
+ return Number.NaN;
170
+ }
171
+ return ((65536 * encodedValue[0] + 256 * encodedValue[1] + encodedValue[2]) /
172
+ (constants.MAX_INDEX - 1));
173
+ }
26
174
  //# sourceMappingURL=utilities.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utilities.js","sourceRoot":"","sources":["../../../src/layers/shader_modules/utilities.ts"],"names":[],"mappings":"AAAA,MAAM,EAAE,GAAG;;;;;;;;;;;;;;;;;;;;EAoBT,CAAC;AAEH,MAAM,CAAC,MAAM,SAAS,GAAG;IACrB,IAAI,EAAE,WAAW;IACjB,EAAE;CACL,CAAC"}
1
+ {"version":3,"file":"utilities.js","sourceRoot":"","sources":["../../../src/layers/shader_modules/utilities.ts"],"names":[],"mappings":"AAAA,MAAM,EAAE,GAAG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AAiB;IACjE,IACI,YAAY,CAAC,CAAC,CAAC,KAAK,GAAG;QACvB,YAAY,CAAC,CAAC,CAAC,KAAK,GAAG;QACvB,YAAY,CAAC,CAAC,CAAC,KAAK,GAAG,EACzB,CAAC;QACC,OAAO,MAAM,CAAC,GAAG,CAAC;IACtB,CAAC;IACD,OAAO,CACH,CAAC,KAAK,GAAG,YAAY,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,YAAY,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QACnE,CAAC,SAAS,CAAC,SAAS,GAAG,CAAC,CAAC,CAC5B,CAAC;AACN,CAAC"}
@@ -14,4 +14,4 @@ export declare function loadDataArray<T extends TypedArray>(data: string | numbe
14
14
  *
15
15
  * @param data - The Float32Array to dump
16
16
  */
17
- export declare function debug_dumpToBinaryFile(data: Float32Array): void;
17
+ export declare function debug_dumpToBinaryFile(data: Float32Array, size: number | [number, number]): void;
@@ -106,16 +106,19 @@ export function loadDataArray(data, type) {
106
106
  *
107
107
  * @param data - The Float32Array to dump
108
108
  */
109
- export function debug_dumpToBinaryFile(data) {
109
+ export function debug_dumpToBinaryFile(data, size) {
110
110
  // Write propertiesData to a binary file for debugging
111
111
  if (data instanceof Float32Array) {
112
+ const sizeTag = Array.isArray(size)
113
+ ? `-${size[0]}x${size[1]}`
114
+ : `-${size}`;
112
115
  const blob = new Blob([data.buffer], {
113
116
  type: "application/octet-stream",
114
117
  });
115
118
  const url = URL.createObjectURL(blob);
116
119
  const a = document.createElement("a");
117
120
  a.href = url;
118
- a.download = "propertiesData.bin";
121
+ a.download = `propertiesData${sizeTag}.bin`;
119
122
  a.style.display = "none";
120
123
  document.body.appendChild(a);
121
124
  a.click();
@@ -1 +1 @@
1
- {"version":3,"file":"serialize.js","sourceRoot":"","sources":["../../src/utils/serialize.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,KAAK,GAAG,MAAM,aAAa,CAAC;AAEnC,OAAO,EAAE,UAAU,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AC,CAAC,CAAC;QAC7B,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;AACL,CAAC"}
@@ -1 +1 @@
1
- export { default as IntersectionViewport } from "./intersectionViewport";
1
+ export { SectionViewport } from "./sectionViewport";
@@ -1,2 +1,2 @@
1
- export { default as IntersectionViewport } from "./intersectionViewport";
1
+ export { SectionViewport } from "./sectionViewport";
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/viewports/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/viewports/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { OrthographicViewport } from "@deck.gl/core";
2
+ import type { OrthographicViewportOptions } from "@deck.gl/core/dist/viewports/orthographic-viewport";
3
+ export declare class SectionViewport extends OrthographicViewport {
4
+ constructor(props: OrthographicViewportOptions);
5
+ }
@@ -0,0 +1,7 @@
1
+ import { OrthographicViewport } from "@deck.gl/core";
2
+ export class SectionViewport extends OrthographicViewport {
3
+ constructor(props) {
4
+ super(props);
5
+ }
6
+ }
7
+ //# sourceMappingURL=sectionViewport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sectionViewport.js","sourceRoot":"","sources":["../../src/viewports/sectionViewport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAGrD,MAAM,OAAO,eAAgB,SAAQ,oBAAoB;IACrD,YAAY,KAAkC;QAC1C,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;CACJ"}
@@ -1 +1 @@
1
- export { default as IntersectionView } from "./intersectionView";
1
+ export { SectionView } from "./sectionView";
@@ -1,2 +1,2 @@
1
- export { default as IntersectionView } from "./intersectionView";
1
+ export { SectionView } from "./sectionView";
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/views/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/views/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { OrthographicView } from "@deck.gl/core";
2
+ import type { OrthographicViewState, OrthographicViewProps } from "@deck.gl/core";
3
+ import { SectionViewport } from "../viewports/sectionViewport";
4
+ export type SectionViewState = OrthographicViewState;
5
+ export type SectionViewProps = OrthographicViewProps;
6
+ export declare class SectionView extends OrthographicView {
7
+ static displayName: string;
8
+ constructor(props?: SectionViewProps);
9
+ getViewportType(): typeof SectionViewport;
10
+ }
@@ -0,0 +1,12 @@
1
+ import { OrthographicView } from "@deck.gl/core";
2
+ import { SectionViewport } from "../viewports/sectionViewport";
3
+ export class SectionView extends OrthographicView {
4
+ constructor(props = {}) {
5
+ super(props);
6
+ }
7
+ getViewportType() {
8
+ return SectionViewport;
9
+ }
10
+ }
11
+ SectionView.displayName = "SectionView";
12
+ //# sourceMappingURL=sectionView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sectionView.js","sourceRoot":"","sources":["../../src/views/sectionView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAKjD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAM/D,MAAM,OAAO,WAAY,SAAQ,gBAAgB;IAG7C,YAAY,QAA0B,EAAE;QACpC,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAED,eAAe;QACX,OAAO,eAAe,CAAC;IAC3B,CAAC;;AARM,uBAAW,GAAG,aAAa,CAAC"}
@@ -1,3 +1,4 @@
1
+ import type { ViewTypeType } from "../components/Map";
1
2
  /**
2
3
  * Viewport type.
3
4
  */
@@ -12,8 +13,16 @@ export interface ViewportType {
12
13
  name?: string;
13
14
  /**
14
15
  * If true, displays map in 3D view, default is 2D view (false)
16
+ * @deprecated Use "viewType" instead.
15
17
  */
16
18
  show3D?: boolean;
19
+ /**
20
+ * Type of viewport.
21
+ * Use "OrbitView" for 3D
22
+ * Use "OrthographicView" for 2D (default)
23
+ * Use "SectionView" for unfolded 2D
24
+ */
25
+ viewType?: ViewTypeType;
17
26
  /**
18
27
  * Layers to be displayed on viewport
19
28
  */
@@ -1 +1 @@
1
- {"version":3,"file":"viewport.js","sourceRoot":"","sources":["../../src/views/viewport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAsC1B,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,SAAqC,EAAE,EAAE;IACtE,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;;QACtB,IAAI,CAAC,SAAS,EAAE,CAAC;YACb,OAAO,CAAC,CAAC;QACb,CAAC;QACD,OAAO,MAAA,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,0CAAE,aAAa,CAAC;IACzE,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC"}
1
+ {"version":3,"file":"viewport.js","sourceRoot":"","sources":["../../src/views/viewport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAgD1B,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,SAAqC,EAAE,EAAE;IACtE,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;;QACtB,IAAI,CAAC,SAAS,EAAE,CAAC;YACb,OAAO,CAAC,CAAC;QACb,CAAC;QACD,OAAO,MAAA,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,0CAAE,aAAa,CAAC;IACzE,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webviz/subsurface-viewer",
3
- "version": "1.14.1",
3
+ "version": "1.14.3",
4
4
  "description": "3D visualization component for subsurface reservoir data",
5
5
  "keywords": [
6
6
  "subsurface",
@@ -46,7 +46,7 @@
46
46
  "@equinor/eds-icons": "^0.21.0",
47
47
  "@turf/simplify": "^7.1.0",
48
48
  "@vivaxy/png": "^1.3.0",
49
- "@webviz/wsc-common": "1.3.6",
49
+ "@webviz/wsc-common": "1.3.7",
50
50
  "ajv": "^8.16.0",
51
51
  "convert-units": "^2.3.4",
52
52
  "d3": "^7.8.2",
@@ -1,10 +0,0 @@
1
- import type { Layer, Viewport } from "@deck.gl/core";
2
- import { GeoJsonLayer } from "@deck.gl/layers";
3
- import type { Feature } from "geojson";
4
- export default class UnfoldedGeoJsonLayer<D extends Feature = Feature> extends GeoJsonLayer<D> {
5
- renderLayers(): Layer[];
6
- filterSubLayer({ layer, viewport, }: {
7
- layer: Layer;
8
- viewport: Viewport;
9
- }): boolean;
10
- }
@@ -1,64 +0,0 @@
1
- import { GeoJsonLayer } from "@deck.gl/layers";
2
- import { isEqual, zip } from "lodash";
3
- import { distance } from "mathjs";
4
- import IntersectionViewport from "../../viewports/intersectionViewport";
5
- const planeY = 2000;
6
- function computeUnfoldedPath(worldCoordinates) {
7
- const z = worldCoordinates.map((v) => v[2]);
8
- const delta = worldCoordinates.map((v, i, coordinates) => {
9
- const prev = coordinates[i - 1] || v;
10
- return distance([prev[0], prev[1]], [v[0], v[1]]);
11
- });
12
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
- const a = [];
14
- delta.forEach((d) => {
15
- const prev = a.at(-1) || 0;
16
- a.push(d + prev);
17
- });
18
- const vAbscissa = zip(a, [...a].fill(planeY), z);
19
- return vAbscissa;
20
- }
21
- function computeUnfoldedPolygon(coordinates) {
22
- const half = Math.floor(coordinates.length / 2);
23
- const upper_line = coordinates.splice(0, half);
24
- const lower_line = coordinates.splice(0, half);
25
- const uul = computeUnfoldedPath(upper_line);
26
- const ull = computeUnfoldedPath(lower_line.reverse());
27
- const unfolded_coordinates = uul.concat(ull.reverse());
28
- unfolded_coordinates.push(uul[0]);
29
- return unfolded_coordinates;
30
- }
31
- function getUnfoldedPath(object) {
32
- const worldCoordinates = object.geometry
33
- .coordinates;
34
- // check if the path is polygon i.e. closed
35
- const is_closed = isEqual(worldCoordinates[0], worldCoordinates.at(-1));
36
- if (is_closed) {
37
- return computeUnfoldedPolygon(worldCoordinates);
38
- }
39
- else {
40
- return computeUnfoldedPath(worldCoordinates);
41
- }
42
- }
43
- export default class UnfoldedGeoJsonLayer extends GeoJsonLayer {
44
- renderLayers() {
45
- const layers = super.renderLayers();
46
- const path_layers = layers
47
- .flat()
48
- .filter((layer) => (layer === null || layer === void 0 ? void 0 : layer.constructor.name) === "PathLayer");
49
- path_layers.forEach((layer) => {
50
- const unfolded_layer = layer.clone(this.getSubLayerProps(Object.assign(Object.assign({}, layer), { id: layer.id + "-for-intersection-view", getPath: (object) => getUnfoldedPath(object) })));
51
- if (unfolded_layer)
52
- layers.push(unfolded_layer);
53
- });
54
- return layers;
55
- }
56
- filterSubLayer({ layer, viewport, }) {
57
- if (viewport.constructor === IntersectionViewport) {
58
- return layer.id.search("-for-intersection-view") != -1;
59
- }
60
- return layer.id.search("-for-intersection-view") == -1;
61
- }
62
- }
63
- UnfoldedGeoJsonLayer.layerName = "UnfoldedGeoJsonLayer";
64
- //# sourceMappingURL=unfoldedGeoJsonLayer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unfoldedGeoJsonLayer.js","sourceRoot":"","sources":["../../../src/layers/intersection/unfoldedGeoJsonLayer.ts"],"names":[],"mappings":"AACA,OA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CAAE,WAAW,CAAC,IAAI,MAAK,WAAW,CAAC,CAAC;QAEhE,WAAW,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YAC1B,MAAM,cAAc,GAAG,KAAK,CAAC,KAAK,CAC9B,IAAI,CAAC,gBAAgB,iCACd,KAAK,KACR,EAAE,EAAE,KAAK,CAAC,EAAE,GAAG,wBAAwB,EACvC,OAAO,EAAE,CAAC,MAAe,EAAc,EAAE,CACrC,eAAe,CAAC,MAAM,CAAC,IAC7B,CACL,CAAC;YACF,IAAI,cAAc;gBAAE,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,cAAc,CAAC,EACX,KAAK,EACL,QAAQ,GAIX;QACG,IAAI,QAAQ,CAAC,WAAW,KAAK,oBAAoB,EAAE,CAAC;YAChD,OAAO,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC,CAAC;IAC3D,CAAC;CACJ;AAED,oBAAoB,CAAC,SAAS,GAAG,sBAAsB,CAAC"}
@@ -1,36 +0,0 @@
1
- import { Viewport } from "@deck.gl/core";
2
- import type { Point2D, Point3D } from "../utils";
3
- export type Padding = {
4
- left?: number;
5
- right?: number;
6
- top?: number;
7
- bottom?: number;
8
- };
9
- export type IntersectionViewportOptions = {
10
- /** Name of the viewport */
11
- id?: string;
12
- /** Left offset from the canvas edge, in pixels */
13
- x?: number;
14
- /** Top offset from the canvas edge, in pixels */
15
- y?: number;
16
- /** Viewport width in pixels */
17
- width?: number;
18
- /** Viewport height in pixels */
19
- height?: number;
20
- /** The world position at the center of the viewport. Default `[0, 0, 0]`. */
21
- target?: Point3D | Point2D;
22
- /** The zoom level of the viewport. `zoom: 0` maps one unit distance to one pixel on screen, and increasing `zoom` by `1` scales the same object to twice as large.
23
- * To apply independent zoom levels to the X and Y axes, supply an array `[zoomX, zoomY]`. Default `0`. */
24
- zoom?: number | [number, number];
25
- /** Padding around the viewport, in pixels. */
26
- padding?: Padding | null;
27
- /** Distance of near clipping plane. Default `0.1`. */
28
- near?: number;
29
- /** Distance of far clipping plane. Default `1000`. */
30
- far?: number;
31
- /** Whether to use top-left coordinates (`true`) or bottom-left coordinates (`false`). Default `true`. */
32
- flipY?: boolean;
33
- };
34
- export default class IntersectionViewport extends Viewport {
35
- constructor(props: IntersectionViewportOptions);
36
- }