@equinor/videx-3d 1.1.1 → 3.0.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.
Files changed (74) hide show
  1. package/README.md +120 -120
  2. package/dist/chunk-DKAquGKk.js +2820 -0
  3. package/dist/chunk-DsUZyEG_.js +16 -0
  4. package/dist/generators.js +512 -716
  5. package/dist/main.js +6909 -8947
  6. package/dist/sdk.js +2 -785
  7. package/dist/src/sdk/materials/shaderLib/oit.glsl +106 -0
  8. package/dist/types/components/Annotations/AutoUpdate.d.ts +1 -1
  9. package/dist/types/components/Annotations/index.d.ts +2 -2
  10. package/dist/types/components/Annotations/types.d.ts +3 -1
  11. package/dist/types/components/Annotations/update-annotations.d.ts +10 -0
  12. package/dist/types/components/EventEmitter/picking-helper.d.ts +23 -1
  13. package/dist/types/components/Ocean/Ocean.d.ts +333 -0
  14. package/dist/types/components/Ocean/index.d.ts +6 -0
  15. package/dist/types/components/Ocean/ocean-bed-material.d.ts +60 -0
  16. package/dist/types/components/Ocean/ocean-contact.d.ts +39 -0
  17. package/dist/types/components/Ocean/ocean-material.d.ts +145 -0
  18. package/dist/types/components/Ocean/ocean-sampler.d.ts +93 -0
  19. package/dist/types/components/Ocean/ocean-volume-material.d.ts +54 -0
  20. package/dist/types/components/Surfaces/Surface.d.ts +8 -1
  21. package/dist/types/components/Surfaces/SurfaceMaterial.d.ts +3 -0
  22. package/dist/types/components/Surfaces/surface-defs.d.ts +1 -0
  23. package/dist/types/components/Tanker/Tanker.d.ts +47 -0
  24. package/dist/types/components/Tanker/TankerSuperstructure.d.ts +23 -0
  25. package/dist/types/components/Tanker/tanker-geometry-builder.d.ts +21 -0
  26. package/dist/types/generators/surface-generator.d.ts +1 -1
  27. package/dist/types/layers/layers.d.ts +4 -0
  28. package/dist/types/main.d.ts +1 -0
  29. package/dist/types/rendering/OitMaterial.d.ts +59 -0
  30. package/dist/types/rendering/Pass.d.ts +16 -0
  31. package/dist/types/rendering/RenderingPipeline.d.ts +46 -0
  32. package/dist/types/rendering/debug/DebugBoxOutputPass.d.ts +22 -0
  33. package/dist/types/rendering/debug/DebugPatternPass.d.ts +30 -0
  34. package/dist/types/rendering/fullscreen-renderer.d.ts +1 -0
  35. package/dist/types/rendering/fxaa-resolver.d.ts +25 -0
  36. package/dist/types/rendering/gpu-timer.d.ts +46 -0
  37. package/dist/types/rendering/index.d.ts +8 -1
  38. package/dist/types/rendering/oit-material.d.ts +122 -0
  39. package/dist/types/{components/Annotations/annotations-renderer.d.ts → rendering/passes/AnnotationsPass.d.ts} +14 -4
  40. package/dist/types/rendering/passes/FXAAPass.d.ts +17 -0
  41. package/dist/types/rendering/passes/OITRenderPass.d.ts +429 -0
  42. package/dist/types/rendering/passes/OutputPass.d.ts +19 -0
  43. package/dist/types/rendering/passes/RenderPass.d.ts +10 -0
  44. package/dist/types/rendering/passes/index.d.ts +4 -0
  45. package/dist/types/rendering/rendering-state.d.ts +59 -0
  46. package/dist/types/rendering/smaa-resolver.d.ts +58 -0
  47. package/dist/types/rendering/taa-resolver.d.ts +161 -0
  48. package/dist/types/rendering/temporal-resolver.d.ts +152 -0
  49. package/dist/types/sdk/geometries/boundary-loops.d.ts +38 -0
  50. package/dist/types/sdk/geometries/geometry-attributes.d.ts +37 -0
  51. package/dist/types/sdk/geometries/grid-sampling.d.ts +50 -0
  52. package/dist/types/sdk/geometries/ocean-geometry.d.ts +288 -0
  53. package/dist/types/sdk/geometries/packing.d.ts +1 -1
  54. package/dist/types/sdk/geometries/tessellation.d.ts +25 -0
  55. package/dist/types/sdk/index.d.ts +5 -0
  56. package/dist/types/sdk/utils/elevation-map.d.ts +23 -0
  57. package/dist/types/sdk/utils/trigonometry.d.ts +4 -1
  58. package/dist/types/sdk/utils/vector-operations.d.ts +7 -0
  59. package/package.json +9 -10
  60. package/dist/chunk-BlPg4RjP.js +0 -689
  61. package/dist/chunk-CnY6Tmof.js +0 -358
  62. package/dist/chunk-DuRASjkF.js +0 -17
  63. package/dist/chunk-iY0wQ9Z6.js +0 -887
  64. package/dist/types/rendering/render-passes.d.ts +0 -16
  65. /package/dist/{shaderLib → src/sdk/materials/shaderLib}/color-conversion.glsl +0 -0
  66. /package/dist/{shaderLib → src/sdk/materials/shaderLib}/colors.glsl +0 -0
  67. /package/dist/{shaderLib → src/sdk/materials/shaderLib}/glyphs.glsl +0 -0
  68. /package/dist/{shaderLib → src/sdk/materials/shaderLib}/random.glsl +0 -0
  69. /package/dist/{shaderLib → src/sdk/materials/shaderLib}/remap.glsl +0 -0
  70. /package/dist/{shaderLib → src/sdk/materials/shaderLib}/render-number.glsl +0 -0
  71. /package/dist/{shaderLib → src/sdk/materials/shaderLib}/render-text.glsl +0 -0
  72. /package/dist/{shaderLib → src/sdk/materials/shaderLib}/rotation.glsl +0 -0
  73. /package/dist/{shaderLib → src/sdk/materials/shaderLib}/sdf-functions.glsl +0 -0
  74. /package/dist/textures/{normal_map.jpg → public/normal_map.jpg} +0 -0
package/README.md CHANGED
@@ -1,120 +1,120 @@
1
- [![SCM Compliance](https://scm-compliance-api.radix.equinor.com/repos/equinor/videx-3d/badge)](https://scm-compliance-api.radix.equinor.com/repos/equinor/videx-3d/badge)
2
- ![](https://img.shields.io/npm/v/@equinor/videx-3d)
3
- # Introduction
4
- The purpose of this library is to help you add 3D visualizations of sub surface data to your web applications. It offers a paradigm for connecting data to React components, utilizing Three js and React Three Fiber.
5
-
6
- <img src="documents/videx-3d.png" alt="" width="800px">
7
-
8
- The library includes a variety of components, both for visualizing and managing data, including:
9
- - Wellbore trajectories
10
- - Wellbore data (such as casings, completion tools, formations, shoes etc.)
11
- - Horizons/surfaces
12
- - Generic support for pointer events (click, move, enter, exit)
13
- - A flexible point-feature label system
14
- - HTML well map schematic
15
-
16
- ## Overview
17
- This library contains multiple exports:
18
- - `@equinor/videx-3d` main export containing the components
19
- - `@equinor/videx-3d/sdk` shared code and declarations
20
- - `@equinor/videx-3d/generators` generator functions required by the included components
21
-
22
- ### Dependencies
23
- This library has dependencies to the following libs:
24
- - React and react-dom
25
- - THREE js (javascript 3d rendering library using WebGL)
26
- - React Three Fiber (bridge React and THREE js)
27
- - Comlink (simplifies working with web workers)
28
-
29
- ## Install
30
- ```
31
- npm i @equinor/videx-3d
32
- ```
33
-
34
- You also need to install the required peer-dependencies.
35
-
36
- First, if not already installed, you'll need React version 18 or later:
37
- ```
38
- // react
39
- npm i react react-dom
40
- ```
41
-
42
- React Three Fiber (R3F):
43
- ```
44
- // react three fiber
45
- npm i @react-three/fiber
46
- ```
47
- Note that if using React 18, you need `@react-three/fiber` version 8.
48
-
49
- Depending on your needs you might consider installing the following additional packages:
50
- ```
51
- // three js
52
- npm i three
53
-
54
- // drei
55
- npm i @react-three/drei
56
-
57
- // comlink - if using web workers
58
- npm i comlink
59
- ```
60
- Note that if using React 18, you need `@react-three/drei` version 9.
61
-
62
- ## Configure
63
- Rendering complex scenes in the browser (single threaded) can quickly become bottlenecked, degrading user experience. For this reason, most of the components have been decoupled from data management and processing, by depending on a _store interface_ and _generator_ functions. This allows the heavy work to be offloaded to web workers (but not required).
64
-
65
- The recommended setup is to run the data store implementation and generator registry in seperate web workers, and then pass a proxy for these instances to the respective providers. You need to use [Comlink](https://github.com/GoogleChromeLabs/comlink) for this to work.
66
-
67
- For example, assuming you have created a class `DataStore` (implementing the `Store` interface) you can _expose_ an instance of this class so that it can be run in isolation by a web worker:
68
-
69
- ```ts
70
- // set up worker endpoint: remote-store.ts
71
- import { expose } from 'comlink'
72
- import { MyStore } from './DataStore'
73
-
74
- const store = new DataStore()
75
-
76
- expose(store)
77
- ```
78
-
79
- Then we do the same exercise for the `GeneratorRegistry`:
80
-
81
- ```ts
82
- // set up registry endpoint: remote-registry.ts
83
- const registry = new GeneratorRegistry()
84
-
85
- // add all the ganerators you need
86
- registry.add('generatorName', generatorFunction)
87
-
88
- expose(registry)
89
- ```
90
-
91
- We then need to create the workers and point them to the scripts we exposed using Comlink. Using the `wrap` function will do this for us and return a proxy class instance that we can pass to the respective providers:
92
-
93
- ```tsx
94
- import { DataProvider, Store } from 'videx3d/sdk'
95
- import { Remote, wrap } from 'comlink'
96
-
97
- const store: Remote<Store> = wrap(new Worker(new URL('workers/remote-store.ts', import.meta.url), { type: 'module'}))
98
-
99
- const registry: Remote<Store> = wrap(new Worker(new URL('workers/remote-registry.ts', import.meta.url), { type: 'module'}))
100
-
101
- const ExampleApp = () => (
102
- <>
103
- { ... }
104
- <DataProvider store={store}>
105
- <RegistryProvider registry={registry}>
106
- { ... }
107
- </RegistryProvider>
108
- </DataProvider>
109
- { ... }
110
- <>
111
- )
112
- ```
113
- If instead you want to run the data store and/or registry on the main thread, simply create and pass an instance directly to the provider.
114
-
115
- For more information see the documentation section below.
116
-
117
- ## Documentation
118
- - [Getting Started](https://github.com/equinor/videx-3d/blob/main/documents/getting-started.md)
119
- - [Storybooks](https://equinor.github.io/videx-3d/)
120
- - [API docs](https://equinor.github.io/videx-3d/docs)
1
+ [![SCM Compliance](https://scm-compliance-api.radix.equinor.com/repos/equinor/videx-3d/badge)](https://scm-compliance-api.radix.equinor.com/repos/equinor/videx-3d/badge)
2
+ ![](https://img.shields.io/npm/v/@equinor/videx-3d)
3
+ # Introduction
4
+ The purpose of this library is to help you add 3D visualizations of subsurface data to your web applications. It offers a paradigm for connecting data to React components, utilizing Three.js and React Three Fiber.
5
+
6
+ <img src="documents/videx-3d.png" alt="" width="800px">
7
+
8
+ The library includes a variety of components, both for visualizing and managing data, including:
9
+ - Wellbore trajectories
10
+ - Wellbore data (such as casings, completion tools, formations, shoes etc.)
11
+ - Horizons/surfaces
12
+ - Generic support for pointer events (click, move, enter, exit)
13
+ - A flexible point-feature label system
14
+ - HTML well map schematic
15
+
16
+ ## Overview
17
+ This library contains multiple exports:
18
+ - `@equinor/videx-3d` main export containing the components
19
+ - `@equinor/videx-3d/sdk` shared code and declarations
20
+ - `@equinor/videx-3d/generators` generator functions required by the included components
21
+
22
+ ### Dependencies
23
+ This library has dependencies to the following libs:
24
+ - React and react-dom
25
+ - Three.js (JavaScript 3D rendering library using WebGL)
26
+ - React Three Fiber (bridge between React and Three.js)
27
+ - Comlink (simplifies working with web workers)
28
+
29
+ ## Install
30
+ ```
31
+ npm i @equinor/videx-3d
32
+ ```
33
+
34
+ You also need to install the required peer-dependencies.
35
+
36
+ First, if not already installed, you'll need React version 18 or later:
37
+ ```
38
+ // react
39
+ npm i react react-dom
40
+ ```
41
+
42
+ React Three Fiber (R3F):
43
+ ```
44
+ // react three fiber
45
+ npm i @react-three/fiber
46
+ ```
47
+ Note that if using React 18, you need `@react-three/fiber` version 8.
48
+
49
+ Depending on your needs you might consider installing the following additional packages:
50
+ ```
51
+ // three js
52
+ npm i three
53
+
54
+ // drei
55
+ npm i @react-three/drei
56
+
57
+ // comlink - if using web workers
58
+ npm i comlink
59
+ ```
60
+ Note that if using React 18, you need `@react-three/drei` version 9.
61
+
62
+ ## Configure
63
+ Rendering complex scenes in the browser (single threaded) can quickly become bottlenecked, degrading user experience. For this reason, most of the components have been decoupled from data management and processing, by depending on a _store interface_ and _generator_ functions. This allows the heavy work to be offloaded to web workers (but not required).
64
+
65
+ The recommended setup is to run the data store implementation and generator registry in separate web workers, and then pass a proxy for these instances to the respective providers. You need to use [Comlink](https://github.com/GoogleChromeLabs/comlink) for this to work.
66
+
67
+ For example, assuming you have created a class `DataStore` (implementing the `Store` interface) you can _expose_ an instance of this class so that it can be run in isolation by a web worker:
68
+
69
+ ```ts
70
+ // set up worker endpoint: remote-store.ts
71
+ import { expose } from 'comlink'
72
+ import { MyStore } from './DataStore'
73
+
74
+ const store = new DataStore()
75
+
76
+ expose(store)
77
+ ```
78
+
79
+ Then we do the same exercise for the `GeneratorRegistry`:
80
+
81
+ ```ts
82
+ // set up registry endpoint: remote-registry.ts
83
+ const registry = new GeneratorRegistry()
84
+
85
+ // add all the generators you need
86
+ registry.add('generatorName', generatorFunction)
87
+
88
+ expose(registry)
89
+ ```
90
+
91
+ We then need to create the workers and point them to the scripts we exposed using Comlink. Using the `wrap` function will do this for us and return a proxy class instance that we can pass to the respective providers:
92
+
93
+ ```tsx
94
+ import { DataProvider, Store } from 'videx3d/sdk'
95
+ import { Remote, wrap } from 'comlink'
96
+
97
+ const store: Remote<Store> = wrap(new Worker(new URL('workers/remote-store.ts', import.meta.url), { type: 'module'}))
98
+
99
+ const registry: Remote<GeneratorRegistry> = wrap(new Worker(new URL('workers/remote-registry.ts', import.meta.url), { type: 'module'}))
100
+
101
+ const ExampleApp = () => (
102
+ <>
103
+ { ... }
104
+ <DataProvider store={store}>
105
+ <RegistryProvider registry={registry}>
106
+ { ... }
107
+ </RegistryProvider>
108
+ </DataProvider>
109
+ { ... }
110
+ </>
111
+ )
112
+ ```
113
+ If instead you want to run the data store and/or registry on the main thread, simply create and pass an instance directly to the provider.
114
+
115
+ For more information see the documentation section below.
116
+
117
+ ## Documentation
118
+ - [Getting Started](https://github.com/equinor/videx-3d/blob/main/documents/getting-started.md)
119
+ - [Storybooks](https://equinor.github.io/videx-3d/)
120
+ - [API docs](https://equinor.github.io/videx-3d/docs)