@equinor/videx-map 1.12.4 → 1.13.0-beta.1

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 (47) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +119 -119
  3. package/dist/ExplorationLayer.d.ts +1 -1
  4. package/dist/FaultlineModule.d.ts +2 -2
  5. package/dist/FieldModule.d.ts +3 -3
  6. package/dist/GeoJSONModule/GeoJSONModule.d.ts +2 -2
  7. package/dist/GeoJSONModule/labels.d.ts +1 -1
  8. package/dist/GeoJSONModule/linestring.d.ts +2 -2
  9. package/dist/GeoJSONModule/multipolygon.d.ts +2 -2
  10. package/dist/GeoJSONModule/point.d.ts +1 -1
  11. package/dist/GeoJSONModule/polygon.d.ts +1 -1
  12. package/dist/ModuleInterface.d.ts +3 -3
  13. package/dist/WellboreModule.d.ts +3 -2
  14. package/dist/index.esm.js +1 -15
  15. package/dist/index.js +1 -1
  16. package/dist/index.umd.js +1 -1
  17. package/dist/utils/ComparableArray.d.ts +60 -0
  18. package/dist/utils/LineDictionary.d.ts +2 -2
  19. package/dist/utils/Mesh.d.ts +2 -2
  20. package/dist/utils/PointDictionary.d.ts +1 -1
  21. package/dist/utils/Rect.d.ts +27 -0
  22. package/dist/utils/TriangleDictionary.d.ts +1 -1
  23. package/dist/utils/centerOfMass.d.ts +1 -1
  24. package/dist/utils/fields/Highlighter.d.ts +1 -1
  25. package/dist/utils/fields/LabelManager.d.ts +2 -2
  26. package/dist/utils/generateCircle.d.ts +1 -1
  27. package/dist/utils/lineReducer.d.ts +9 -0
  28. package/dist/utils/wellbores/Colors.d.ts +1 -1
  29. package/dist/utils/wellbores/Config.d.ts +3 -3
  30. package/dist/utils/wellbores/DataManager.d.ts +15 -0
  31. package/dist/utils/wellbores/Highlight.d.ts +1 -1
  32. package/dist/utils/wellbores/LabelType.d.ts +9 -0
  33. package/dist/utils/wellbores/Projector.d.ts +1 -1
  34. package/dist/utils/wellbores/RealtimeWellbore.d.ts +1 -1
  35. package/dist/utils/wellbores/Shader.d.ts +11 -14
  36. package/dist/utils/wellbores/data/Group.d.ts +1 -1
  37. package/dist/utils/wellbores/data/RootData.d.ts +2 -1
  38. package/dist/utils/wellbores/data/SourceData.d.ts +25 -0
  39. package/dist/utils/wellbores/data/WellboreData.d.ts +4 -0
  40. package/dist/utils/wellbores/data/WellboreEventData.d.ts +2 -2
  41. package/dist/utils/wellbores/highlight-helper.d.ts +3 -3
  42. package/dist/utils/wellbores/labels/Label.d.ts +3 -1
  43. package/dist/utils/wellbores/labels/label-helper.d.ts +1 -1
  44. package/dist/utils/wellbores/registries/CallbackRegistry.d.ts +23 -0
  45. package/dist/utils/wellbores/registries/ColorRegistry.d.ts +22 -0
  46. package/dist/utils/wellbores/registries/index.d.ts +2 -0
  47. package/package.json +101 -89
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2019 Equinor
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Equinor
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,119 +1,119 @@
1
- [![npm version](https://badge.fury.io/js/%40equinor%2Fvidex-map.svg)](https://badge.fury.io/js/%40equinor%2Fvidex-map)
2
- ![](https://github.com/equinor/videx-map/workflows/Unit%20test/badge.svg)
3
-
4
- # Videx map
5
-
6
- A leaflet layer for visualizing wellbore related data.
7
-
8
- - [GitHub Repository](https://github.com/equinor/videx-map)
9
- - [Documentation](https://equinor.github.io/videx-map/)
10
-
11
- ## Installation
12
- ```
13
- npm install --save @equinor/videx-map
14
- ```
15
-
16
- ## Usage
17
- ```js
18
- // ES6
19
- import { WellboreModule, FaultlineModule, ... } from '@equinor/videx-map';
20
- ```
21
-
22
- <br/>
23
-
24
- # Modules
25
- Videx map is divided into various modules with specific purposes. These modules can be used individually or combined into a single WebGL context.
26
-
27
- ## Wellbore Module
28
- Module responsible for visualizing wellbores with roots and paths.
29
-
30
- ### Configurations
31
-
32
- - <b>scale</b> - Relative scale of everything. (Default: 1.0)
33
- - <b>wellboreWidth</b> - Width of wellbore. (Default: 0.15)
34
- - <b>rootRadius</b> - Width of root. (Default: 0.4)
35
- - <b>labelScale</b> - Scale of labels. (Default: 0.011)
36
- - <b>labelBgOpacity</b> - Opacity of label background. (Default: 0.5)
37
- - <b>fontSize</b> - Size of font. (Default: 24)
38
- - <b>batchSize</b> - Amount of wellbores per batch. (Default: 25)
39
- - <b>zoomOrigin</b> - Origin zoom level, i.e. where input for scaling function is 0. (Default: 0)
40
- - <b>customEventHandler</b> - Provide your custom event handler.
41
- - <b>scaling</b> - Zoom event handler.
42
- - <b>gridSize</b> - Grid size to control resolution of spatial indexing.
43
- - <b>rootResize</b> - Resize configurations of roots.
44
- - <b>onWellboreClick</b> - Function to be called when a wellbore is selected.
45
- - <b>onHighlightOn</b> - Function to be called when wellbores are highlighted.
46
- - <b>onHighlightOff</b> - Function to be called when highlight is removed.
47
-
48
- ```js
49
- // Example configuration
50
- const wellbores: WellboreModule = new WellboreModule({
51
- rootRadius: 0.3,
52
- scale: 1.5,
53
- labelBgOpacity: 0.2,
54
- zoomOrigin: 0,
55
- scaling: zoom => factors[zoom] || 0,
56
- rootResize: {
57
- base: 1.75,
58
- multiplier: 0.5,
59
- zoomReference: 12.0,
60
- },
61
- onHighlightOn: event => {
62
- // Special 'HighlightOn' logic ...
63
- },
64
- onHighlightOff: () => {
65
- // Special 'HighlightOff' logic ...
66
- },
67
- onWellboreClick: wellbore => {
68
- // Special 'WellboreClick' logic ...
69
- }
70
- });
71
- ```
72
-
73
- ## Faultline Module
74
- Module responsible for visualizing faultlines on fields.
75
-
76
- - <b>color</b> - Color of faultline on format 0xRRGGBB. (Default: 0x727D88)
77
- - <b>alpha</b> - Alpha of faultlines. (Default: 1.0)
78
- - <b>outlineWidth</b> - Width of outline. (Default: 0.125)
79
-
80
- ```js
81
- // Example configuration
82
- const faultlines: FaultlineModule = new FaultlineModule({
83
- color: 0xFF00FF,
84
- alpha: 0.75,
85
- outlineWidth: 0.13,
86
- });
87
- ```
88
-
89
- ## Outline Module
90
- Module responsible for visualizing field outlines.
91
-
92
- - <b>zoomOrigin</b> - Origin zoom level, i.e. where input for scaling function is 0. (Default: 0)
93
- - <b>lineWidth</b> - Width of line. (Default: 0.125)
94
- - <b>scaling</b> - Zoom event handler.
95
-
96
- ```js
97
- // Example configuration
98
- const outlines: OutlineModule = new OutlineModule({
99
- zoomOrigin: 12,
100
- lineWidth: 0.1,
101
- scaling: zoom => (1.5 ** -zoom),
102
- });
103
- ```
104
-
105
- <br/>
106
-
107
- ## Contribution
108
- We greatly appreciate contributions to this repository, see our [contribution page](CONTRIBUTION.md) on how to get started.
109
-
110
- ### Quick start
111
- ```
112
- $ git clone https://github.com/equinor/videx-map.git
113
- $ npm install
114
- $ npm start
115
- ```
116
-
117
-
118
-
119
- ![Equinor Logo](images/equinor-logo.png)
1
+ [![npm version](https://badge.fury.io/js/%40equinor%2Fvidex-map.svg)](https://badge.fury.io/js/%40equinor%2Fvidex-map)
2
+ ![](https://github.com/equinor/videx-map/workflows/Unit%20test/badge.svg)
3
+
4
+ # Videx map
5
+
6
+ A leaflet layer for visualizing wellbore related data.
7
+
8
+ - [GitHub Repository](https://github.com/equinor/videx-map)
9
+ - [Documentation](https://equinor.github.io/videx-map/)
10
+
11
+ ## Installation
12
+ ```
13
+ npm install --save @equinor/videx-map
14
+ ```
15
+
16
+ ## Usage
17
+ ```js
18
+ // ES6
19
+ import { WellboreModule, FaultlineModule, ... } from '@equinor/videx-map';
20
+ ```
21
+
22
+ <br/>
23
+
24
+ # Modules
25
+ Videx map is divided into various modules with specific purposes. These modules can be used individually or combined into a single WebGL context.
26
+
27
+ ## Wellbore Module
28
+ Module responsible for visualizing wellbores with roots and paths.
29
+
30
+ ### Configurations
31
+
32
+ - <b>scale</b> - Relative scale of everything. (Default: 1.0)
33
+ - <b>wellboreWidth</b> - Width of wellbore. (Default: 0.15)
34
+ - <b>rootRadius</b> - Width of root. (Default: 0.4)
35
+ - <b>labelScale</b> - Scale of labels. (Default: 0.011)
36
+ - <b>labelBgOpacity</b> - Opacity of label background. (Default: 0.5)
37
+ - <b>fontSize</b> - Size of font. (Default: 24)
38
+ - <b>batchSize</b> - Amount of wellbores per batch. (Default: 25)
39
+ - <b>zoomOrigin</b> - Origin zoom level, i.e. where input for scaling function is 0. (Default: 0)
40
+ - <b>customEventHandler</b> - Provide your custom event handler.
41
+ - <b>scaling</b> - Zoom event handler.
42
+ - <b>gridSize</b> - Grid size to control resolution of spatial indexing.
43
+ - <b>rootResize</b> - Resize configurations of roots.
44
+ - <b>onWellboreClick</b> - Function to be called when a wellbore is selected.
45
+ - <b>onHighlightOn</b> - Function to be called when wellbores are highlighted.
46
+ - <b>onHighlightOff</b> - Function to be called when highlight is removed.
47
+
48
+ ```js
49
+ // Example configuration
50
+ const wellbores: WellboreModule = new WellboreModule({
51
+ rootRadius: 0.3,
52
+ scale: 1.5,
53
+ labelBgOpacity: 0.2,
54
+ zoomOrigin: 0,
55
+ scaling: zoom => factors[zoom] || 0,
56
+ rootResize: {
57
+ base: 1.75,
58
+ multiplier: 0.5,
59
+ zoomReference: 12.0,
60
+ },
61
+ onHighlightOn: event => {
62
+ // Special 'HighlightOn' logic ...
63
+ },
64
+ onHighlightOff: () => {
65
+ // Special 'HighlightOff' logic ...
66
+ },
67
+ onWellboreClick: wellbore => {
68
+ // Special 'WellboreClick' logic ...
69
+ }
70
+ });
71
+ ```
72
+
73
+ ## Faultline Module
74
+ Module responsible for visualizing faultlines on fields.
75
+
76
+ - <b>color</b> - Color of faultline on format 0xRRGGBB. (Default: 0x727D88)
77
+ - <b>alpha</b> - Alpha of faultlines. (Default: 1.0)
78
+ - <b>outlineWidth</b> - Width of outline. (Default: 0.125)
79
+
80
+ ```js
81
+ // Example configuration
82
+ const faultlines: FaultlineModule = new FaultlineModule({
83
+ color: 0xFF00FF,
84
+ alpha: 0.75,
85
+ outlineWidth: 0.13,
86
+ });
87
+ ```
88
+
89
+ ## Outline Module
90
+ Module responsible for visualizing field outlines.
91
+
92
+ - <b>zoomOrigin</b> - Origin zoom level, i.e. where input for scaling function is 0. (Default: 0)
93
+ - <b>lineWidth</b> - Width of line. (Default: 0.125)
94
+ - <b>scaling</b> - Zoom event handler.
95
+
96
+ ```js
97
+ // Example configuration
98
+ const outlines: OutlineModule = new OutlineModule({
99
+ zoomOrigin: 12,
100
+ lineWidth: 0.1,
101
+ scaling: zoom => (1.5 ** -zoom),
102
+ });
103
+ ```
104
+
105
+ <br/>
106
+
107
+ ## Contribution
108
+ We greatly appreciate contributions to this repository, see our [contribution page](CONTRIBUTION.md) on how to get started.
109
+
110
+ ### Quick start
111
+ ```
112
+ $ git clone https://github.com/equinor/videx-map.git
113
+ $ npm install
114
+ $ npm start
115
+ ```
116
+
117
+
118
+
119
+ ![Equinor Logo](images/equinor-logo.png)
@@ -1,7 +1,7 @@
1
+ import * as PIXI from 'pixi.js';
1
2
  import { ModuleInterface } from './ModuleInterface';
2
3
  import { RootUniforms } from './utils/wellbores/Shader';
3
4
  import PointDictionary from './utils/PointDictionary';
4
- import { selection } from 'd3';
5
5
  /**
6
6
  * Data assigned each point in point dictionary.
7
7
  */
@@ -13,7 +13,7 @@ interface FaultlineData {
13
13
  sourceUpdateDate: string;
14
14
  }
15
15
  /** Interface for faultline config. */
16
- interface InputConfig {
16
+ export interface InputConfig {
17
17
  /** Color of faultline on format 0xRRGGBB. (Default: 0x727D88) */
18
18
  color?: number;
19
19
  /** Alpha of faultlines. (Default: 1.0) */
@@ -46,6 +46,6 @@ export default class FaultlineModule extends ModuleInterface {
46
46
  set(data: FaultlineData[]): void;
47
47
  /** Clear all spawned graphic elements and return to pool. */
48
48
  clear(): void;
49
- resize(zoom: number): void;
49
+ resize(_zoom: number): void;
50
50
  }
51
51
  export {};
@@ -1,11 +1,11 @@
1
1
  import * as PIXI from 'pixi.js';
2
+ import Vector2 from '@equinor/videx-vector2';
2
3
  import { ModuleInterface } from './ModuleInterface';
3
4
  import { MeshData, MeshNormalData } from './utils/Mesh';
4
5
  import Highlighter from './utils/fields/Highlighter';
5
6
  import LabelManager from './utils/fields/LabelManager';
6
7
  import TriangleDictionary from './utils/TriangleDictionary';
7
- import Vector2 from '@equinor/videx-vector2';
8
- declare type vec3 = [number, number, number];
8
+ type vec3 = [number, number, number];
9
9
  interface FillUniform {
10
10
  col1: vec3;
11
11
  col2: vec3;
@@ -106,7 +106,7 @@ export default class FieldModule extends ModuleInterface {
106
106
  * @returns Projected polygons
107
107
  */
108
108
  projectPolygons(points: [number, number][]): Vector2[];
109
- resize(zoom: number): void;
109
+ resize(_zoom: number): void;
110
110
  highlight(lat: number, long: number): boolean;
111
111
  tryUnselect(): void;
112
112
  }
@@ -35,8 +35,8 @@ export default class GeoJSONModule extends ModuleInterface {
35
35
  * @returns List of features at the given position
36
36
  */
37
37
  testPosition(pos: Vector2): any;
38
- onAdd(map: import("leaflet").Map): void;
39
- onRemove(map: import("leaflet").Map): void;
38
+ onAdd(map: import('leaflet').Map): void;
39
+ onRemove(_map: import('leaflet').Map): void;
40
40
  resize(zoom: number): void;
41
41
  private handleMouseMove;
42
42
  private handleMouseOut;
@@ -1,7 +1,7 @@
1
1
  import * as PIXI from 'pixi.js';
2
2
  import Vector2 from '@equinor/videx-vector2';
3
3
  /** Data for label. */
4
- export declare type GeoJSONLabelData = {
4
+ export type GeoJSONLabelData = {
5
5
  position: Vector2;
6
6
  mass: number;
7
7
  };
@@ -5,7 +5,7 @@ import { MeshNormalData } from '../utils/Mesh';
5
5
  import LineDictionary from '../utils/LineDictionary';
6
6
  import { FeatureProps, FeatureStyle } from '.';
7
7
  import { ResizeConfig } from '../ResizeConfigInterface';
8
- declare type vec3 = [number, number, number];
8
+ type vec3 = [number, number, number];
9
9
  interface OutlineUniform {
10
10
  color: vec3;
11
11
  width: number;
@@ -49,7 +49,7 @@ export default class GeoJSONLineString {
49
49
  */
50
50
  projectPolygons(points: [number, number][]): Vector2[];
51
51
  resize(zoom: number): void;
52
- testPosition(pos: Vector2): any;
52
+ testPosition(pos: Vector2): number;
53
53
  getOutlineRadius(zoom?: number): number;
54
54
  }
55
55
  export {};
@@ -6,7 +6,7 @@ import GeoJSONLabels from './labels';
6
6
  import TriangleDictionary from '../utils/TriangleDictionary';
7
7
  import { FeatureProps, FeatureStyle } from '.';
8
8
  import { ResizeConfig, LabelResizeConfig } from '../ResizeConfigInterface';
9
- declare type vec3 = [number, number, number];
9
+ type vec3 = [number, number, number];
10
10
  interface FillUniform {
11
11
  col1: vec3;
12
12
  col2: vec3;
@@ -87,7 +87,7 @@ export default class GeoJSONMultiPolygon {
87
87
  */
88
88
  projectPolygons(points: [number, number][]): Vector2[];
89
89
  resize(zoom: number): void;
90
- testPosition(pos: Vector2): any;
90
+ testPosition(pos: Vector2): number;
91
91
  getOutlineRadius(zoom?: number): number;
92
92
  getLabelSize(zoom?: number): number;
93
93
  }
@@ -21,6 +21,6 @@ export default class GeoJSONPoint {
21
21
  * @returns Projected point
22
22
  */
23
23
  projectPoint(point: [number, number]): Vector2;
24
- resize(zoom: number): void;
24
+ resize(_zoom: number): void;
25
25
  testPosition(pos: Vector2): any;
26
26
  }
@@ -6,7 +6,7 @@ import GeoJSONLabels from './labels';
6
6
  import TriangleDictionary from '../utils/TriangleDictionary';
7
7
  import { FeatureProps, FeatureStyle } from '.';
8
8
  import { ResizeConfig, LabelResizeConfig } from '../ResizeConfigInterface';
9
- declare type vec3 = [number, number, number];
9
+ type vec3 = [number, number, number];
10
10
  interface FillUniform {
11
11
  col1: vec3;
12
12
  col2: vec3;
@@ -20,7 +20,7 @@ export declare abstract class ModuleInterface {
20
20
  * @returns True if new visibility was set
21
21
  */
22
22
  setVisibility(visible: boolean): boolean;
23
- onAdd(map: L.Map): void;
24
- onRemove(map: L.Map): void;
25
- resize(zoom: number): void;
23
+ onAdd(_map: L.Map): void;
24
+ onRemove(_map: L.Map): void;
25
+ resize(_zoom: number): void;
26
26
  }
@@ -20,6 +20,7 @@ export default class WellboreModule extends ModuleInterface {
20
20
  highlight: Highlight;
21
21
  currentZoom: number;
22
22
  private _deferredSelector;
23
+ private _deferredSelectorKeys;
23
24
  private _projector;
24
25
  private _eventHandler;
25
26
  private _redrawAnimFrame;
@@ -93,8 +94,8 @@ export default class WellboreModule extends ModuleInterface {
93
94
  */
94
95
  clear(...keys: string[]): void;
95
96
  resize(zoom: number): void;
96
- onAdd(map: import("leaflet").Map): void;
97
- onRemove(map: import("leaflet").Map): void;
97
+ onAdd(map: import('leaflet').Map): void;
98
+ onRemove(_map: import('leaflet').Map): void;
98
99
  get projector(): Projector;
99
100
  /**
100
101
  * Calculate root radius based on formula used in Shader.ts!