@equinor/esv-intersection 1.4.3 → 1.5.2

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.
@@ -50,6 +50,8 @@ export interface GridLayerOptions extends LayerOptions {
50
50
  export interface WellborepathLayerOptions extends LayerOptions {
51
51
  stroke: string;
52
52
  strokeWidth: string;
53
+ curveType?: string;
54
+ tension?: number;
53
55
  }
54
56
  export interface GeomodelLayerOptions extends LayerOptions {
55
57
  }
@@ -133,12 +135,14 @@ export interface ScaleOptions {
133
135
  xBounds?: [number, number];
134
136
  yBounds?: [number, number];
135
137
  }
136
- export interface Interpolator {
138
+ export interface Interpolators {
137
139
  trajectory: any;
138
140
  curtain: any;
139
141
  position?: any;
140
142
  curve?: any;
141
143
  }
144
+ export interface Interpolator {
145
+ }
142
146
  export interface Trajectory {
143
147
  points: number[][];
144
148
  offset: number;
@@ -149,6 +153,11 @@ export interface ReferenceSystemOptions {
149
153
  tension?: number;
150
154
  trajectoryAngle?: number;
151
155
  calculateDisplacementFromBottom?: boolean;
156
+ curveInterpolator?: Interpolator;
157
+ trajectoryInterpolator?: Interpolator;
158
+ curtainInterpolator?: Interpolator;
159
+ approxT?: boolean;
160
+ quickT?: boolean;
152
161
  }
153
162
  export declare type BoundingBox = {
154
163
  x: number;
@@ -1,10 +1,20 @@
1
1
  import { Point, Texture } from 'pixi.js';
2
2
  import { WellboreBaseComponentLayer } from './WellboreBaseComponentLayer';
3
3
  import { CasingLayerOptions, Casing } from '..';
4
+ export interface CasingRenderObject {
5
+ pathPoints: number[][];
6
+ polygon: Point[];
7
+ leftPath: Point[];
8
+ rightPath: Point[];
9
+ radius: number;
10
+ diameter: number;
11
+ casingWallWidth: number;
12
+ }
4
13
  export declare class CasingLayer extends WellboreBaseComponentLayer {
5
14
  constructor(id?: string, options?: CasingLayerOptions);
6
15
  render(): void;
7
- drawCasing: (casing: Casing) => void;
16
+ prepareCasingRenderObject: (casing: Casing) => CasingRenderObject;
17
+ drawCasing: (zippedRenderObject: [Casing, CasingRenderObject]) => void;
8
18
  drawShoe(casingEnd: number, casingRadius: number): void;
9
19
  generateShoe: (casingEnd: number, casingRadius: number, length: number, width: number) => Point[];
10
20
  createTexture(diameter: number): Texture;
@@ -14,6 +14,7 @@ export declare class GeomodelCanvasLayer extends CanvasLayer {
14
14
  onMount(event: OnMountEvent): void;
15
15
  onUpdate(event: OnUpdateEvent): void;
16
16
  onRescale(event: OnRescaleEvent): void;
17
+ updatePaths(): void;
17
18
  render(): void;
18
19
  colorToCSSColor(color: number | string): string;
19
20
  generateSurfaceAreasPaths(): void;
@@ -0,0 +1,23 @@
1
+ import { Vector } from 'curve-interpolator/dist/src/interfaces';
2
+ declare type fx = (n: number) => Vector;
3
+ export declare class ArcLength {
4
+ /**
5
+ * Calculate using an adaptive bisect method
6
+ * @param {Number} func Curve function returning [x,y]
7
+ * @param {Number} minLimit Min limit
8
+ * @param {Number} maxLimit Max limit
9
+ * @param {Number} tolerance Result tolerance
10
+ * @param {Number} minDepth Min recursive depth before accepting solution
11
+ * @param {Number} maxDepth Max recursive depth
12
+ */
13
+ static bisect(func: fx, minLimit?: number, maxLimit?: number, tolerance?: number, minDepth?: number, maxDepth?: number): number;
14
+ /**
15
+ * Calculate using trapezoid method
16
+ * @param {Number} func Curve function returning [x,y]
17
+ * @param {Number} minLimit Min limit
18
+ * @param {Number} maxLimit Max limit
19
+ * @param {Number} segments Number of segments
20
+ */
21
+ static trapezoid(func: fx, minLimit?: number, maxLimit?: number, segments?: number): number;
22
+ }
23
+ export {};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Find index where value[index] =< searchValue and value[index+1] >= searchValue using binary search
3
+ * @param {Number} values Array of sorted values
4
+ * @param {Number} searchValue Value to search for
5
+ */
6
+ export declare class BinarySearch {
7
+ static search(values: number[], searchValue: number): number;
8
+ }
@@ -0,0 +1,34 @@
1
+ declare type fx = (n: number) => number;
2
+ export declare class RootFinder {
3
+ /**
4
+ * Find root using newthons method
5
+ * @param {Number} func f(x)
6
+ * @param {Number} precision Accuracy of result
7
+ * @param {Number} maxIterations Max number of iterations to use
8
+ * @param {Number} start Starting position
9
+ * @param {Number} minLimit Min limit of result
10
+ * @param {Number} maxLimit Max limit of result
11
+ */
12
+ static newton(func: fx, precision?: number, maxIterations?: number, start?: number, minLimit?: number, maxLimit?: number): number;
13
+ /**
14
+ * Find root using bisect method
15
+ * @param {Number} func f(x)
16
+ * @param {Number} precision Accuracy of result
17
+ * @param {Number} maxIterations Max number of iterations to use
18
+ * @param {Number} start Starting position
19
+ * @param {Number} minLimit Min limit of result
20
+ * @param {Number} maxLimit Max limit of result
21
+ */
22
+ static bisect(func: fx, precision?: number, maxIterations?: number, start?: number, minLimit?: number, maxLimit?: number): number;
23
+ /**
24
+ * Find root by trying available methods
25
+ * @param {Number} func f(x)
26
+ * @param {Number} precision Accuracy of result
27
+ * @param {Number} maxIterations Max number of iterations to use
28
+ * @param {Number} start Starting position
29
+ * @param {Number} minLimit Min limit of result
30
+ * @param {Number} maxLimit Max limit of result
31
+ */
32
+ static findRoot(func: fx, precision?: number, maxIterations?: number, start?: number, minLimit?: number, maxLimit?: number): number;
33
+ }
34
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/esv-intersection",
3
- "version": "1.4.3",
3
+ "version": "1.5.2",
4
4
  "description": "Intersection component package with testing and automatic documentation.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -40,19 +40,20 @@
40
40
  },
41
41
  "homepage": "https://github.com/equinor/esv-intersection#readme",
42
42
  "devDependencies": {
43
- "@storybook/addon-docs": "^6.1.20",
44
- "@storybook/addon-storysource": "^6.1.20",
45
- "@storybook/html": "^6.1.20",
46
- "@types/jest": "^26.0.20",
43
+ "@storybook/addon-docs": "^6.3.11",
44
+ "@storybook/addon-storysource": "^6.3.11",
45
+ "@storybook/html": "^6.3.11",
46
+ "@types/jest": "^27.0.2",
47
+ "@types/mock-raf": "^1.0.2",
47
48
  "@typescript-eslint/eslint-plugin": "^4.15.2",
48
49
  "@typescript-eslint/parser": "^4.15.2",
49
- "awesome-typescript-loader": "^5.2.1",
50
50
  "copyfiles": "^2.4.1",
51
51
  "eslint": "^7.20.0",
52
52
  "eslint-config-prettier": "^8.1.0",
53
53
  "eslint-plugin-prettier": "^3.3.1",
54
- "jest": "^26.6.3",
54
+ "jest": "^27.2.5",
55
55
  "jest-canvas-mock": "^2.3.1",
56
+ "mock-raf": "^1.0.1",
56
57
  "pixi.js": "^5.3.8",
57
58
  "prettier": "^2.2.1",
58
59
  "rimraf": "^3.0.2",
@@ -61,8 +62,8 @@
61
62
  "rollup-plugin-node-resolve": "^5.2.0",
62
63
  "rollup-plugin-terser": "^7.0.2",
63
64
  "rollup-plugin-typescript2": "^0.30.0",
64
- "storybook-dark-mode": "^1.0.4",
65
- "ts-jest": "^26.5.2",
65
+ "storybook-dark-mode": "^1.0.8",
66
+ "ts-jest": "^27.0.5",
66
67
  "tslib": "^2.1.0",
67
68
  "typedoc": "^0.20.28",
68
69
  "typescript": "^4.2.2"
@@ -79,7 +80,8 @@
79
80
  "ts",
80
81
  "tsx",
81
82
  "js"
82
- ]
83
+ ],
84
+ "testEnvironment": "jsdom"
83
85
  },
84
86
  "peerDependencies": {
85
87
  "pixi.js": "^5.2.1"
@@ -89,9 +91,9 @@
89
91
  "@equinor/videx-vector2": "^1.0.44",
90
92
  "@types/d3": "^5.7.2",
91
93
  "curve-interpolator": "2.0.8",
92
- "d3-array": "^2.11.0",
94
+ "d3-array": "^2.12.1",
93
95
  "d3-axis": "^1.0.12",
94
- "d3-scale": "^3.2.1",
96
+ "d3-scale": "^3.2.4",
95
97
  "d3-selection": "^1.4.1",
96
98
  "d3-shape": "^1.3.7",
97
99
  "d3-zoom": "^1.8.3"
package/CHANGELOG.md DELETED
@@ -1,217 +0,0 @@
1
- # Changelog
2
-
3
- ## New changes not yet released
4
-
5
- ## v1.4.3
6
- - Add option to use a optional range for generating seismic image
7
-
8
- ## v1.4.2
9
-
10
- - Improve wellborelayers textures
11
- - Update typescript to 4.2.2
12
-
13
- ## v1.4.1
14
-
15
- - Matching surface name checks are now case insensitive
16
- - Bumped d3-array package
17
-
18
- ## v1.4.0
19
-
20
- - added option to override arc division and tension in the reference system
21
- - removed group labels from being render in surface labels
22
- - pixi-layers skip render without referenceSystem
23
- - upgrade vulnerable packages
24
- - cleanup GeomodelLayerV2
25
- - cleanup render method on WellboreBaseComponentLayers
26
-
27
- ## v1.3.1
28
-
29
- - fix skip render without referenceSystem in CalloutCanvasLayer
30
-
31
- ## v1.3.0
32
-
33
- - fix CalloutCanvasLayer to always render on data update
34
- - fix position callout with displacement calculated from bottom
35
- - fix issue with missing labels in geomodel
36
- - fix onUnmount on PixiLayers
37
- - add export of interfaces AxisOptions, ControllerOptions, OverlayEvents and OverlayCallbacks
38
- - add destroy method to Controller
39
-
40
- ## v1.2.1
41
-
42
- - improved surface and surface label rendering order
43
- - improved setting data on layer creation
44
- - added fallback for various rendering functions when webGL is not available
45
-
46
- ## v1.2.0
47
-
48
- - deprecate GeomodelLayer (keeping api util next major release)
49
- - add support for inverse xBounds on several layers
50
- - add support for cement spanning multiple casings
51
- - fix issue in HighlightLayer storybook demo layer
52
- - use typescript types from curve-interpolator
53
- - add solid color casing option
54
- - compensate for zFactor in WellboreBaseComponentLayers
55
- - add calculateDisplacementFromBottom option to IntersectionReferenceSystem
56
-
57
- ## v1.1.0
58
-
59
- - surface labels improvement
60
- - bugfix: well layers rendering artifacts
61
- - bugfix: fix distortion in GeomodelLayer and GeomodelLayerV2 lines when increasing zFactor
62
-
63
- ## v1.0.0
64
-
65
- - bring package out of alpha
66
- - bugfix: corrected overlapping logic for WellboreItemShapeGenerator
67
- - minor refactoring
68
-
69
- ## v0.9.6-alpha
70
-
71
- - improve validation on trajectoryAngle in IntersectionReferenceSystem
72
- - handle cases where a curve is vertical
73
-
74
- ## v0.9.5-alpha
75
-
76
- - Added option to remove reference system when clearing data on layers
77
- - misc: added validation when missing data
78
-
79
- ## v0.9.4-alpha
80
-
81
- - bugfix: use only extensionStart as offset
82
- - bump websocket-extensions version
83
-
84
- ## v0.9.3-alpha
85
-
86
- - improve input validation on getExtendedTrajectory
87
-
88
- ## v0.9.2-alpha
89
-
90
- - bugfix: correctly handle position when md or position is supplied in callout layer
91
-
92
- ## v0.9.1-alpha
93
-
94
- - bugfix: corrected input validation on getExtendedTrajectory
95
-
96
- ## v0.9.0-alpha
97
-
98
- - added method in the IntersectionReferenceSystem to get an extended trajectory
99
- - added option to pass in increment, which help specify distance between points on various layers like cement, casing, and holesize layers
100
- - fixed a bug with z-index on html layers
101
- - improved perfomance on cement layer
102
- - add posibility to pass in either a curve length (measured depth, md) or a set of coordinates to the callout layer
103
- - resolve vulnerability
104
- - misc bugfixes and improvements
105
-
106
- ## v0.8.1-alpha
107
-
108
- - misc bugfixes
109
-
110
- ## v0.8.0-alpha
111
-
112
- - added clearAllData method to controller and layer manager
113
- - reworked callout layer
114
- - improved geolabel layer label positioning
115
- - improved input validation
116
- - improved error handling
117
- - misc bugfixes
118
-
119
- ## v0.7.1-alpha
120
-
121
- - improved documentation in the reference system
122
- - removed existing options when creating a reference system
123
- - added the option to pass in a trajectory angle in the reference system
124
-
125
- ## v0.7.0-alpha
126
-
127
- - added cement layer
128
- - fixed issue with peer dependency
129
- - misc bugfixes
130
-
131
- ## v0.6.4-alpha
132
-
133
- - set z-index for overlay and axis dynamically
134
- - misc bugfixes
135
- - improved documentation
136
-
137
- ## v0.6.3-alpha
138
-
139
- - methods show/hide axis label
140
- - methods for flipping axes
141
- - getter for axis in layer manager and controller
142
-
143
- ## v0.6.2-alpha
144
-
145
- - option to add offset in grid layer
146
- - toggle axis
147
- - set interactivity on layers, off by default
148
- - moved base layers to sub-folders
149
-
150
- ## v0.6.1-alpha
151
-
152
- - Expose offset methods in the layer manager and controller
153
- - Allow flipping axis in canvas layer and flip domain in geo labels
154
- - Set zoom levels
155
-
156
- ## v0.6.0-alpha
157
-
158
- - misc optimizations
159
- - improved value handling in IRS
160
- - allow for offset in IRS
161
- - allow for offset in axis
162
-
163
- ## v0.5.0-alpha
164
-
165
- - Added HTML base layer
166
- - Added story featuring point highlighting based on md input
167
-
168
- ## v0.4.0-alpha
169
-
170
- - Added event overlay
171
- - updated stories
172
- - bugfixes
173
-
174
- ## v0.3.2-alpha
175
-
176
- - Basic completion layer
177
- - Pixi.js is now a peer dependency
178
-
179
- ## v0.3.1-alpha
180
-
181
- - functioning defaults for layers
182
- - made setData and clearData available for layers
183
- - minor improvements
184
-
185
- ## v0.3.0-alpha
186
-
187
- - added top level interface
188
- - renamed WebglLayer to PixiLayer
189
- - small fixes
190
-
191
- ## v0.2.0-alpha
192
-
193
- Controls:
194
-
195
- - Layer manager
196
- - Reference system
197
-
198
- Custom Layers:
199
-
200
- - Geomodel label
201
- - Casing
202
-
203
- This release also features some miscellaneous improvements and optimizations
204
-
205
- ## v0.1.3-alpha
206
-
207
- Made interfaces and zoom and pan handler available
208
-
209
- ## v0.1.2-alpha
210
-
211
- Include actual files
212
-
213
- ## v0.1.1-alpha
214
-
215
- Initial release
216
-
217
- Contains Base, SVG, Canvas, Wellborepath, Callout, Image, and WebGL layers