@webviz/subsurface-viewer 0.5.9 → 0.6.0

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.
@@ -0,0 +1,24 @@
1
+ import { LayerExtension } from "@deck.gl/core/typed";
2
+ import type { Layer, _ShaderModule as ShaderModule } from "@deck.gl/core/typed";
3
+ type SideProjectionExtensionProps = {
4
+ sideViewIds?: string[];
5
+ };
6
+ export declare class SideProjectionExtension extends LayerExtension {
7
+ static defaultProps: {
8
+ sideViewIds: never[];
9
+ };
10
+ static extensionName: string;
11
+ getShaders(this: Layer<SideProjectionExtensionProps>): {
12
+ modules: ShaderModule<import("@deck.gl/core/typed/shaderlib/project/viewport-uniforms").ProjectModuleSettings>[];
13
+ inject: {
14
+ "vs:#decl": string;
15
+ "vs:DECKGL_FILTER_GL_POSITION": string;
16
+ };
17
+ };
18
+ draw(this: Layer<Required<SideProjectionExtensionProps>>, { uniforms, }: {
19
+ uniforms: {
20
+ side_view: unknown;
21
+ };
22
+ }): void;
23
+ }
24
+ export {};
@@ -0,0 +1,51 @@
1
+ import { LayerExtension } from "@deck.gl/core/typed";
2
+ import { project32, project } from "@deck.gl/core/typed";
3
+ const defaultProps = {
4
+ sideViewIds: [],
5
+ };
6
+ const shaderFunction = `
7
+ uniform float side_view;
8
+
9
+ vec3 transform(vec3 clip_position) {
10
+ if (side_view < 1.0) {
11
+ return clip_position;
12
+ }
13
+ vec3 world_position = geometry.worldPosition.xyz;
14
+ vec4 transformed = vec4(world_position.x, world_position.z, 0.0, 1.0);
15
+
16
+ vec4 commonspace = project_position(transformed);
17
+
18
+ vec4 clipspace = project_common_position_to_clipspace(commonspace);
19
+
20
+ return clipspace.xyz;
21
+ }
22
+ `;
23
+ const shaderModuleVs = {
24
+ name: "unfold-vs",
25
+ vs: shaderFunction,
26
+ };
27
+ const injectionVs = {
28
+ "vs:#decl": `
29
+ varying vec3 new_position;
30
+ `,
31
+ "vs:DECKGL_FILTER_GL_POSITION": `
32
+ new_position = transform(position.xyz);
33
+ position.xyz = new_position;
34
+ `,
35
+ };
36
+ export class SideProjectionExtension extends LayerExtension {
37
+ getShaders() {
38
+ return {
39
+ modules: [shaderModuleVs, project, project32],
40
+ inject: injectionVs,
41
+ };
42
+ }
43
+ draw({ uniforms, }) {
44
+ const { sideViewIds } = this.props;
45
+ const isSideView = sideViewIds.includes(this.context.viewport.id);
46
+ uniforms.side_view = isSideView ? 1.0 : 0.0;
47
+ }
48
+ }
49
+ SideProjectionExtension.defaultProps = defaultProps;
50
+ SideProjectionExtension.extensionName = "SideProjectionExtension";
51
+ //# sourceMappingURL=side-projection-extension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"side-projection-extension.js","sourceRoot":"","sources":["../../src/extensions/side-projection-extension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGrD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,YAAY,GAAG;IACjB,WAAW,EAAE,EAAE;CAClB,CAAC;AAMF,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;CAgBtB,CAAC;AAEF,MAAM,cAAc,GAAiB;IACjC,IAAI,EAAE,WAAW;IACjB,EAAE,EAAE,cAAc;CACrB,CAAC;AAEF,MAAM,WAAW,GAAG;IAChB,UAAU,EAAE;;CAEf;IACG,8BAA8B,EAAE;;;CAGnC;CACA,CAAC;AAEF,MAAM,OAAO,uBAAwB,SAAQ,cAAc;IAIvD,UAAU;QACN,OAAO;YACH,OAAO,EAAE,CAAC,cAAc,EAAE,OAAO,EAAE,SAAS,CAAC;YAC7C,MAAM,EAAE,WAAW;SACtB,CAAC;IACN,CAAC;IAED,IAAI,CAEA,EACI,QAAQ,GAKX;QAED,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QACnC,MAAM,UAAU,GAAG,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAClE,QAAQ,CAAC,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IAChD,CAAC;;AAvBM,oCAAY,GAAG,YAAY,CAAC;AAC5B,qCAAa,GAAG,yBAAyB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webviz/subsurface-viewer",
3
- "version": "0.5.9",
3
+ "version": "0.6.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -22,7 +22,7 @@
22
22
  "license": "MPL-2.0",
23
23
  "dependencies": {
24
24
  "@deck.gl/core": "^8.9.32",
25
- "@emerson-eps/color-tables": "^0.4.61",
25
+ "@emerson-eps/color-tables": "^0.4.71",
26
26
  "@equinor/eds-core-react": "^0.33.0",
27
27
  "@equinor/eds-icons": "^0.19.1",
28
28
  "@nebula.gl/layers": "^1.0.4",