@equinor/esv-intersection 3.0.0-beta.6 → 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 (73) hide show
  1. package/README.md +11 -16
  2. package/dist/components/axis.d.ts +47 -47
  3. package/dist/components/index.d.ts +1 -1
  4. package/dist/constants.d.ts +11 -11
  5. package/dist/control/ExtendedCurveInterpolator.d.ts +58 -58
  6. package/dist/control/IntersectionReferenceSystem.d.ts +96 -96
  7. package/dist/control/LayerManager.d.ts +76 -76
  8. package/dist/control/MainController.d.ts +154 -154
  9. package/dist/control/ZoomPanHandler.d.ts +158 -158
  10. package/dist/control/index.d.ts +5 -5
  11. package/dist/control/interfaces.d.ts +37 -37
  12. package/dist/control/overlay.d.ts +20 -20
  13. package/dist/datautils/colortable.d.ts +1 -1
  14. package/dist/datautils/findsample.d.ts +2 -2
  15. package/dist/datautils/index.d.ts +6 -6
  16. package/dist/datautils/interfaces.d.ts +63 -63
  17. package/dist/datautils/picks.d.ts +74 -74
  18. package/dist/datautils/schematicShapeGenerator.d.ts +59 -61
  19. package/dist/datautils/seismicimage.d.ts +45 -45
  20. package/dist/datautils/surfacedata.d.ts +10 -10
  21. package/dist/datautils/trajectory.d.ts +14 -14
  22. package/dist/index.cjs +15 -0
  23. package/dist/index.cjs.map +1 -0
  24. package/dist/index.d.ts +6 -6
  25. package/dist/index.mjs +7944 -0
  26. package/dist/index.mjs.map +1 -0
  27. package/dist/index.umd.js +15 -1
  28. package/dist/index.umd.js.map +1 -0
  29. package/dist/interfaces.d.ts +86 -86
  30. package/dist/layers/CalloutCanvasLayer.d.ts +60 -60
  31. package/dist/layers/CustomDisplayObjects/ComplexRope.d.ts +22 -22
  32. package/dist/layers/CustomDisplayObjects/ComplexRopeGeometry.d.ts +27 -27
  33. package/dist/layers/CustomDisplayObjects/FixedWidthSimpleRope.d.ts +20 -20
  34. package/dist/layers/CustomDisplayObjects/FixedWidthSimpleRopeGeometry.d.ts +26 -26
  35. package/dist/layers/CustomDisplayObjects/UniformTextureStretchRope.d.ts +17 -17
  36. package/dist/layers/CustomDisplayObjects/UniformTextureStretchRopeGeometry.d.ts +24 -24
  37. package/dist/layers/GeomodelCanvasLayer.d.ts +28 -28
  38. package/dist/layers/GeomodelLabelsLayer.d.ts +49 -49
  39. package/dist/layers/GeomodelLayerV2.d.ts +12 -12
  40. package/dist/layers/GridLayer.d.ts +29 -29
  41. package/dist/layers/ImageCanvasLayer.d.ts +20 -20
  42. package/dist/layers/ReferenceLineLayer.d.ts +29 -29
  43. package/dist/layers/SchematicLayer.d.ts +113 -114
  44. package/dist/layers/SeismicCanvasLayer.d.ts +18 -18
  45. package/dist/layers/WellborePathLayer.d.ts +17 -17
  46. package/dist/layers/base/CanvasLayer.d.ts +19 -19
  47. package/dist/layers/base/HTMLLayer.d.ts +13 -13
  48. package/dist/layers/base/Layer.d.ts +69 -69
  49. package/dist/layers/base/PixiLayer.d.ts +32 -32
  50. package/dist/layers/base/SVGLayer.d.ts +13 -13
  51. package/dist/layers/base/index.d.ts +5 -5
  52. package/dist/layers/index.d.ts +16 -16
  53. package/dist/layers/schematicInterfaces.d.ts +208 -208
  54. package/dist/tubing1.svg +3 -0
  55. package/dist/tubing2.svg +6 -0
  56. package/dist/tubing3.svg +12 -0
  57. package/dist/utils/arc-length.d.ts +23 -23
  58. package/dist/utils/binary-search.d.ts +8 -8
  59. package/dist/utils/color.d.ts +5 -5
  60. package/dist/utils/index.d.ts +1 -1
  61. package/dist/utils/root-finder.d.ts +34 -34
  62. package/dist/utils/text.d.ts +14 -14
  63. package/dist/utils/vectorUtils.d.ts +15 -15
  64. package/dist/vendor/pixi-dashed-line/index.d.ts +57 -0
  65. package/package.json +30 -55
  66. package/src/datautils/schematicShapeGenerator.ts +2 -8
  67. package/src/layers/SchematicLayer.ts +12 -37
  68. package/src/layers/base/PixiLayer.ts +4 -4
  69. package/src/vendor/pixi-dashed-line/index.ts +394 -0
  70. package/dist/datautils/camelcase.d.ts +0 -5
  71. package/dist/index.esm.js +0 -1
  72. package/dist/index.js +0 -1
  73. package/src/datautils/camelcase.ts +0 -28
package/README.md CHANGED
@@ -1,6 +1,4 @@
1
1
  [![npm version](https://badge.fury.io/js/%40equinor%2Fesv-intersection.svg)](https://badge.fury.io/js/%40equinor%2Fesv-intersection)
2
- ![Publish Package](https://github.com/equinor/esv-intersection/workflows/Publish%20Package/badge.svg)
3
- ![Unit tests](https://github.com/equinor/esv-intersection/workflows/Unit%20tests/badge.svg)
4
2
  # ESV Intersection component
5
3
  A reusable component to create intersection visualizations for wells
6
4
 
@@ -8,9 +6,9 @@ Part of the [Equinor Subsurface Visualization project](https://github.com/equino
8
6
 
9
7
  - **Repository**: https://github.com/equinor/esv-intersection
10
8
  - **NPM Package**: https://www.npmjs.com/package/@equinor/esv-intersection
11
- - **Documentation (latest)**: https://equinor.github.io/esv-intersection/
12
- - **Storybook (latest)**: https://equinor.github.io/esv-intersection/storybook/latest
13
- - **Storybook (nightly)**: https://equinor.github.io/esv-intersection/storybook/master
9
+ - **Documentation**: https://equinor.github.io/esv-intersection/
10
+ - **Storybook (latest release)**: https://equinor.github.io/esv-intersection/storybook/latest
11
+ - **Storybook (master branch)**: https://equinor.github.io/esv-intersection/storybook/master
14
12
 
15
13
  ## Getting started
16
14
 
@@ -47,27 +45,24 @@ For more examples, check out our stories in our online [storybook](https://equin
47
45
  ## Technical choices
48
46
 
49
47
  - **Compiler**: [Typescript](https://www.npmjs.com/package/typescript)
50
- - **Module bundler**: [Rollup](https://www.npmjs.com/package/rollup)
51
- - **Testing**: [Jest](https://www.npmjs.com/package/jest)
48
+ - **Module bundler**: [Vite](https://www.npmjs.com/package/vite)
49
+ - **Testing**: [Vitest](https://vitest.dev/)
52
50
  - **Documentation**: [TypeDoc](https://www.npmjs.com/package/typedoc)
53
- - **Code compressor**: [Terser](https://www.npmjs.com/package/terser)
54
51
  - **Miscellaneous**:
55
52
  - Architecture: A container component that holds several layers, specialized for the type of data and visualization they address (analogous to the VidEx-map component https://github.com/equinor/videx-map)
56
53
  - Browser support: Target Edge, Chrome, Firefox, Safari
57
54
  - Linting and unit tests run automatically on Github Actions
58
-
59
55
 
60
- ## Development methodology
61
- - The project is maintained by the [VidEx team](https://github.com/orgs/equinor/teams/viz) (Software Innovation Stavanger) and the [Heap Purple team](https://github.com/orgs/equinor/teams/heap-purple) (Software Innovation Bergen)
62
- - The maintainers meet once a month to discuss the direction of the project, and possible development activities
63
- - Development is currently limited to critical bug fixes. New features could be requested by opening a dedicated issue or, even better, by opening a [Pull Requests](CONTRIBUTION.md)
64
- - Development relies on a _project board_ hosted on github (https://github.com/equinor/intersection/projects/1)
56
+
57
+ ## Development
58
+ - The project is maintained by the [VidEx team](https://github.com/orgs/equinor/teams/viz) and the [Heap Purple team](https://github.com/orgs/equinor/teams/heap-purple)
59
+ - New features could be requested by opening a dedicated issue or, even better, by opening a [Pull Requests](CONTRIBUTION.md)
65
60
 
66
61
 
67
62
  ## Support
68
- If you are an equinor employee, the easiest way to get in touch with the maintainers is through the #esv-intersection channel on Slack.
63
+ If you are an Equinor employee, the easiest way to get in touch with the maintainers is through the #esv-intersection channel on Slack.
69
64
 
70
- Otherwise, Github issues are the main communication channel with the maintainers. If you have a bug report, a feature request, or need some help using the component, simply [create an issue in the repository](https://github.com/equinor/esv-intersection/issues) and one of the maintainers will pick it up. Before creating an issue, please have a look at the following guidelines. Also keep in mind that creating [Pull Requests](CONTRIBUTION.md) is the preferred way to contribute to the project.
65
+ Otherwise, Github issues are the main communication channel with the maintainers. If you have a bug report, a feature request, or need some help using the component, simply [create an issue in the repository](https://github.com/equinor/esv-intersection/issues) and one of the maintainers will pick it up. Before creating an issue, please have a look at the following guidelines. Also keep in mind that creating [Pull Requests](CONTRIBUTION.md) is the preferred way to contribute to the project.
71
66
 
72
67
  ### Help needed
73
68
  Describe your use case in details, make sure to include the version of the component you are using, and relevant software that are part of your pipeline (eg, Chrome/Firefox/Safari, Node, npm, …), including their version as well
@@ -1,47 +1,47 @@
1
- import { Selection } from 'd3-selection';
2
- import { ScaleLinear } from 'd3-scale';
3
- import { OnResizeEvent, OnRescaleEvent } from '../interfaces';
4
- export type Options = {
5
- offsetX: number;
6
- offsetY: number;
7
- visible: boolean;
8
- };
9
- export declare class Axis {
10
- private mainGroup;
11
- private _scaleX;
12
- private _scaleY;
13
- private _showLabels;
14
- private _labelXDesc;
15
- private _labelYDesc;
16
- private _unitOfMeasure;
17
- private _offsetX;
18
- private _offsetY;
19
- private _flipX;
20
- private _flipY;
21
- private visible;
22
- constructor(mainGroup: Selection<SVGElement, unknown, null, undefined>, showLabels: boolean, labelXDesc: string, labelYDesc: string, unitOfMeasure: string, options?: Options);
23
- private renderLabelx;
24
- private renderLabely;
25
- private renderGy;
26
- private renderGx;
27
- private createOrGet;
28
- render(): void;
29
- onResize(event: OnResizeEvent): void;
30
- onRescale(event: OnRescaleEvent): void;
31
- show(): Axis;
32
- hide(): Axis;
33
- flipX(flipX: boolean): Axis;
34
- flipY(flipY: boolean): Axis;
35
- showLabels(): Axis;
36
- hideLabels(): Axis;
37
- setLabelX(label: string): Axis;
38
- setLabelY(label: string): Axis;
39
- setUnitOfMeasure(uom: string): Axis;
40
- setLabels(labelX: string, labelY: string, unitOfMeasure: string): Axis;
41
- get offsetX(): number;
42
- set offsetX(offset: number);
43
- get offsetY(): number;
44
- set offsetY(offset: number);
45
- get scaleX(): ScaleLinear<number, number>;
46
- get scaleY(): ScaleLinear<number, number>;
47
- }
1
+ import { Selection } from 'd3-selection';
2
+ import { ScaleLinear } from 'd3-scale';
3
+ import { OnResizeEvent, OnRescaleEvent } from '../interfaces';
4
+ export declare type Options = {
5
+ offsetX: number;
6
+ offsetY: number;
7
+ visible: boolean;
8
+ };
9
+ export declare class Axis {
10
+ private mainGroup;
11
+ private _scaleX;
12
+ private _scaleY;
13
+ private _showLabels;
14
+ private _labelXDesc;
15
+ private _labelYDesc;
16
+ private _unitOfMeasure;
17
+ private _offsetX;
18
+ private _offsetY;
19
+ private _flipX;
20
+ private _flipY;
21
+ private visible;
22
+ constructor(mainGroup: Selection<SVGElement, unknown, null, undefined>, showLabels: boolean, labelXDesc: string, labelYDesc: string, unitOfMeasure: string, options?: Options);
23
+ private renderLabelx;
24
+ private renderLabely;
25
+ private renderGy;
26
+ private renderGx;
27
+ private createOrGet;
28
+ render(): void;
29
+ onResize(event: OnResizeEvent): void;
30
+ onRescale(event: OnRescaleEvent): void;
31
+ show(): Axis;
32
+ hide(): Axis;
33
+ flipX(flipX: boolean): Axis;
34
+ flipY(flipY: boolean): Axis;
35
+ showLabels(): Axis;
36
+ hideLabels(): Axis;
37
+ setLabelX(label: string): Axis;
38
+ setLabelY(label: string): Axis;
39
+ setUnitOfMeasure(uom: string): Axis;
40
+ setLabels(labelX: string, labelY: string, unitOfMeasure: string): Axis;
41
+ get offsetX(): number;
42
+ set offsetX(offset: number);
43
+ get offsetY(): number;
44
+ set offsetY(offset: number);
45
+ get scaleX(): ScaleLinear<number, number>;
46
+ get scaleY(): ScaleLinear<number, number>;
47
+ }
@@ -1 +1 @@
1
- export * from './axis';
1
+ export * from './axis';
@@ -1,11 +1,11 @@
1
- export declare const DEFAULT_LAYER_WIDTH = 200;
2
- export declare const DEFAULT_LAYER_HEIGHT = 300;
3
- export declare const HORIZONTAL_AXIS_MARGIN = 40;
4
- export declare const VERTICAL_AXIS_MARGIN = 30;
5
- export declare const EXAGGERATED_DIAMETER = 100;
6
- export declare const HOLE_OUTLINE = 0.6;
7
- export declare const SCREEN_OUTLINE = 0.3;
8
- export declare const SHOE_WIDTH = 8;
9
- export declare const SHOE_LENGTH = 16;
10
- export declare const DEFAULT_TEXTURE_SIZE = 64;
11
- export declare const SURFACE_LINE_WIDTH = 1;
1
+ export declare const DEFAULT_LAYER_WIDTH = 200;
2
+ export declare const DEFAULT_LAYER_HEIGHT = 300;
3
+ export declare const HORIZONTAL_AXIS_MARGIN = 40;
4
+ export declare const VERTICAL_AXIS_MARGIN = 30;
5
+ export declare const EXAGGERATED_DIAMETER = 100;
6
+ export declare const HOLE_OUTLINE = 0.6;
7
+ export declare const SCREEN_OUTLINE = 0.3;
8
+ export declare const SHOE_WIDTH = 8;
9
+ export declare const SHOE_LENGTH = 16;
10
+ export declare const DEFAULT_TEXTURE_SIZE = 64;
11
+ export declare const SURFACE_LINE_WIDTH = 1;
@@ -1,58 +1,58 @@
1
- import { CurveInterpolator } from 'curve-interpolator';
2
- import { Vector } from 'curve-interpolator/dist/src/interfaces';
3
- import { CurveInterpolatorOptions } from 'curve-interpolator/dist/src/curve-interpolator';
4
- export declare class ExtendedCurveInterpolator extends CurveInterpolator {
5
- arcLengthLookup: number[];
6
- constructor(points: Vector[], options?: CurveInterpolatorOptions);
7
- /**
8
- * Function which finds t value for arc length
9
- * @param {Number} arcLength Target arc length
10
- * @param {Number} tolerance Tolerance for result
11
- * @param {Number} iterations Max number of iterations to use
12
- */
13
- findTForArcLength(arcLength: number, options?: {
14
- approxT?: boolean;
15
- quickT?: boolean;
16
- normalizedLength?: number;
17
- }): number;
18
- /**
19
- * Function which finds t value for arc length by finding root
20
- * @param {Number} arcLength Target arc length
21
- * @param {Number} tolerance Tolerance for result
22
- * @param {Number} iterations Max number of iterations to use
23
- */
24
- findTByRootForArcLength(arcLength: number, tolerance?: number, iterations?: number): number;
25
- /**
26
- * Function which finds t value for arc length by simple approximation
27
- * @param {Number} arcLength Target arclength
28
- */
29
- findApproxTForArcLength(arcLength: number, normalizedLength?: number): number;
30
- /**
31
- * Function which finds t value for arc length using lookup table
32
- * @param {Number} arcLength Target arclength
33
- */
34
- findTQuickForArcLength(arcLength: number): number;
35
- generateArcLengthLookup(segments?: number): void;
36
- /**
37
- * Function calculating length along curve using interpolator.
38
- * @param {Number} from t at start (default = 0)
39
- * @param {Number} to t at end (default = 1)
40
- */
41
- getArcLength(from?: number, to?: number): number;
42
- /**
43
- * Function calculating length along curve using interpolator.
44
- * @param {Number} from t at start (default = 0)
45
- * @param {Number} to t at end (default = 1)
46
- */
47
- getQuickArcLength(from?: number, to?: number): number;
48
- /**
49
- * Function getting a point at curve length.
50
- * @param {Number} arcLength
51
- */
52
- getPointAtArcLength(arcLength: number, options?: {
53
- approxT?: boolean;
54
- quickT?: boolean;
55
- normalizedLength?: number;
56
- }): Vector;
57
- getPointAt(t: number): Vector;
58
- }
1
+ import { CurveInterpolator } from 'curve-interpolator';
2
+ import { Vector } from 'curve-interpolator/dist/src/interfaces';
3
+ import { CurveInterpolatorOptions } from 'curve-interpolator/dist/src/curve-interpolator';
4
+ export declare class ExtendedCurveInterpolator extends CurveInterpolator {
5
+ arcLengthLookup: number[];
6
+ constructor(points: Vector[], options?: CurveInterpolatorOptions);
7
+ /**
8
+ * Function which finds t value for arc length
9
+ * @param {Number} arcLength Target arc length
10
+ * @param {Number} tolerance Tolerance for result
11
+ * @param {Number} iterations Max number of iterations to use
12
+ */
13
+ findTForArcLength(arcLength: number, options?: {
14
+ approxT?: boolean;
15
+ quickT?: boolean;
16
+ normalizedLength?: number;
17
+ }): number;
18
+ /**
19
+ * Function which finds t value for arc length by finding root
20
+ * @param {Number} arcLength Target arc length
21
+ * @param {Number} tolerance Tolerance for result
22
+ * @param {Number} iterations Max number of iterations to use
23
+ */
24
+ findTByRootForArcLength(arcLength: number, tolerance?: number, iterations?: number): number;
25
+ /**
26
+ * Function which finds t value for arc length by simple approximation
27
+ * @param {Number} arcLength Target arclength
28
+ */
29
+ findApproxTForArcLength(arcLength: number, normalizedLength?: number): number;
30
+ /**
31
+ * Function which finds t value for arc length using lookup table
32
+ * @param {Number} arcLength Target arclength
33
+ */
34
+ findTQuickForArcLength(arcLength: number): number;
35
+ generateArcLengthLookup(segments?: number): void;
36
+ /**
37
+ * Function calculating length along curve using interpolator.
38
+ * @param {Number} from t at start (default = 0)
39
+ * @param {Number} to t at end (default = 1)
40
+ */
41
+ getArcLength(from?: number, to?: number): number;
42
+ /**
43
+ * Function calculating length along curve using interpolator.
44
+ * @param {Number} from t at start (default = 0)
45
+ * @param {Number} to t at end (default = 1)
46
+ */
47
+ getQuickArcLength(from?: number, to?: number): number;
48
+ /**
49
+ * Function getting a point at curve length.
50
+ * @param {Number} arcLength
51
+ */
52
+ getPointAtArcLength(arcLength: number, options?: {
53
+ approxT?: boolean;
54
+ quickT?: boolean;
55
+ normalizedLength?: number;
56
+ }): Vector;
57
+ getPointAt(t: number): Vector;
58
+ }
@@ -1,96 +1,96 @@
1
- import { CurveInterpolator } from 'curve-interpolator';
2
- import { Interpolators, Trajectory, MDPoint } from '../interfaces';
3
- import { ExtendedCurveInterpolator } from './ExtendedCurveInterpolator';
4
- export interface ReferenceSystemOptions {
5
- normalizedLength?: number;
6
- arcDivisions?: number;
7
- tension?: number;
8
- trajectoryAngle?: number;
9
- calculateDisplacementFromBottom?: boolean;
10
- curveInterpolator?: ExtendedCurveInterpolator;
11
- trajectoryInterpolator?: ExtendedCurveInterpolator;
12
- curtainInterpolator?: ExtendedCurveInterpolator;
13
- approxT?: boolean;
14
- quickT?: boolean;
15
- }
16
- export declare class IntersectionReferenceSystem {
17
- options: ReferenceSystemOptions;
18
- path: number[][];
19
- projectedPath: number[][];
20
- projectedTrajectory: number[][];
21
- private _offset;
22
- displacement: number;
23
- depthReference: number;
24
- wellboreId: number;
25
- trajectoryOffset: number;
26
- interpolators: Interpolators;
27
- startVector: number[];
28
- endVector: number[];
29
- _curtainPathCache: MDPoint[];
30
- /**
31
- * Creates a common reference system that layers and other components can use
32
- * @param path (required) array of 3d coordinates: [x, y, z]
33
- * @param options (optional)
34
- * @param options.trajectoryAngle (optional) - trajectory angle in degrees, overrides the calculated value
35
- * @param options.calculateDisplacementFromBottom - (optional) specify if the path is passed from bottom up
36
- */
37
- constructor(path: number[][], options?: ReferenceSystemOptions);
38
- private setPath;
39
- /**
40
- * Map a length along the curve to intersection coordinates
41
- * @param length length along the curve
42
- */
43
- project(length: number): number[];
44
- curtainTangent(length: number): number[];
45
- /**
46
- * Returns as resampled version of the projected path between start and end
47
- * Samples are picked from the beginning of the path at every CURTAIN_SAMPLING_INTERVAL meters
48
- * If the angle between two consecutive segments is close to 180 degrees depending on CURTAIN_SAMPLING_ANGLE_THRESHOLD,
49
- * a sample in between is discarded.
50
- *
51
- * The start and the end are not guaranteed to be part of the returned set of points
52
- * @param startMd in MD
53
- * @param endMd in MD
54
- * @param includeStartEnd guarantee to include the starting and end points
55
- */
56
- getCurtainPath(startMd: number, endMd: number, includeStartEnd?: boolean): MDPoint[];
57
- /**
58
- * Map a displacement back to length along the curve
59
- */
60
- unproject(displacement: number): number;
61
- /**
62
- * Get the normalized displacement [0 - 1] of a specific length along the curve
63
- */
64
- getProjectedLength(length: number): number;
65
- /**
66
- * Get the trajectory position at a length along the curve
67
- */
68
- getPosition(length: number): number[];
69
- /**
70
- * Generate a set of coordinates along the trajectory of the curve
71
- */
72
- getTrajectory(steps: number, from?: number, to?: number): Trajectory;
73
- /**
74
- * Generate a set of coordinates along the trajectory of the curve
75
- */
76
- getExtendedTrajectory(numPoints: number, startExtensionLength?: number, endExtensionLength?: number): Trajectory;
77
- getTrajectoryVector(): number[];
78
- /**
79
- * Perform a curtain projection on a set of points in 3D
80
- * @param points
81
- * @param origin
82
- * @param offset
83
- * @returns {array}
84
- */
85
- static toDisplacement(points: number[][], offset?: number): number[][];
86
- /**
87
- * returns a normalized vector
88
- * @param interpolator interpolated curve
89
- * @param from number between 0 and 1
90
- * @param to number between 0 and 1
91
- */
92
- static getDirectionVector(interpolator: CurveInterpolator, from: number, to: number): number[];
93
- get length(): number;
94
- get offset(): number;
95
- set offset(offset: number);
96
- }
1
+ import { CurveInterpolator } from 'curve-interpolator';
2
+ import { Interpolators, Trajectory, MDPoint } from '../interfaces';
3
+ import { ExtendedCurveInterpolator } from './ExtendedCurveInterpolator';
4
+ export interface ReferenceSystemOptions {
5
+ normalizedLength?: number;
6
+ arcDivisions?: number;
7
+ tension?: number;
8
+ trajectoryAngle?: number;
9
+ calculateDisplacementFromBottom?: boolean;
10
+ curveInterpolator?: ExtendedCurveInterpolator;
11
+ trajectoryInterpolator?: ExtendedCurveInterpolator;
12
+ curtainInterpolator?: ExtendedCurveInterpolator;
13
+ approxT?: boolean;
14
+ quickT?: boolean;
15
+ }
16
+ export declare class IntersectionReferenceSystem {
17
+ options: ReferenceSystemOptions;
18
+ path: number[][];
19
+ projectedPath: number[][];
20
+ projectedTrajectory: number[][];
21
+ private _offset;
22
+ displacement: number;
23
+ depthReference: number;
24
+ wellboreId: number;
25
+ trajectoryOffset: number;
26
+ interpolators: Interpolators;
27
+ startVector: number[];
28
+ endVector: number[];
29
+ _curtainPathCache: MDPoint[];
30
+ /**
31
+ * Creates a common reference system that layers and other components can use
32
+ * @param path (required) array of 3d coordinates: [x, y, z]
33
+ * @param options (optional)
34
+ * @param options.trajectoryAngle (optional) - trajectory angle in degrees, overrides the calculated value
35
+ * @param options.calculateDisplacementFromBottom - (optional) specify if the path is passed from bottom up
36
+ */
37
+ constructor(path: number[][], options?: ReferenceSystemOptions);
38
+ private setPath;
39
+ /**
40
+ * Map a length along the curve to intersection coordinates
41
+ * @param length length along the curve
42
+ */
43
+ project(length: number): number[];
44
+ curtainTangent(length: number): number[];
45
+ /**
46
+ * Returns as resampled version of the projected path between start and end
47
+ * Samples are picked from the beginning of the path at every CURTAIN_SAMPLING_INTERVAL meters
48
+ * If the angle between two consecutive segments is close to 180 degrees depending on CURTAIN_SAMPLING_ANGLE_THRESHOLD,
49
+ * a sample in between is discarded.
50
+ *
51
+ * The start and the end are not guaranteed to be part of the returned set of points
52
+ * @param startMd in MD
53
+ * @param endMd in MD
54
+ * @param includeStartEnd guarantee to include the starting and end points
55
+ */
56
+ getCurtainPath(startMd: number, endMd: number, includeStartEnd?: boolean): MDPoint[];
57
+ /**
58
+ * Map a displacement back to length along the curve
59
+ */
60
+ unproject(displacement: number): number;
61
+ /**
62
+ * Get the normalized displacement [0 - 1] of a specific length along the curve
63
+ */
64
+ getProjectedLength(length: number): number;
65
+ /**
66
+ * Get the trajectory position at a length along the curve
67
+ */
68
+ getPosition(length: number): number[];
69
+ /**
70
+ * Generate a set of coordinates along the trajectory of the curve
71
+ */
72
+ getTrajectory(steps: number, from?: number, to?: number): Trajectory;
73
+ /**
74
+ * Generate a set of coordinates along the trajectory of the curve
75
+ */
76
+ getExtendedTrajectory(numPoints: number, startExtensionLength?: number, endExtensionLength?: number): Trajectory;
77
+ getTrajectoryVector(): number[];
78
+ /**
79
+ * Perform a curtain projection on a set of points in 3D
80
+ * @param points
81
+ * @param origin
82
+ * @param offset
83
+ * @returns {array}
84
+ */
85
+ static toDisplacement(points: number[][], offset?: number): number[][];
86
+ /**
87
+ * returns a normalized vector
88
+ * @param interpolator interpolated curve
89
+ * @param from number between 0 and 1
90
+ * @param to number between 0 and 1
91
+ */
92
+ static getDirectionVector(interpolator: CurveInterpolator, from: number, to: number): number[];
93
+ get length(): number;
94
+ get offset(): number;
95
+ set offset(offset: number);
96
+ }
@@ -1,76 +1,76 @@
1
- import { ZoomPanHandler } from './ZoomPanHandler';
2
- import { Layer, LayerOptions } from '../layers';
3
- import { ScaleOptions } from '../interfaces';
4
- import { Axis } from '../components';
5
- import { IntersectionReferenceSystem } from './IntersectionReferenceSystem';
6
- import { AxisOptions } from './interfaces';
7
- export declare class LayerManager {
8
- private container;
9
- private layerContainer;
10
- private _zoomPanHandler;
11
- private layers;
12
- private _axis;
13
- private _svgContainer;
14
- /**
15
- * Handles layers and axis also holds a zoom and pan handler object
16
- * @param container root container
17
- * @param scaleOptions
18
- * @param axisOptions
19
- */
20
- constructor(container: HTMLElement, scaleOptions?: ScaleOptions, axisOptions?: AxisOptions);
21
- /**
22
- * Adds and mounts an array of layers
23
- * @param layers array of layers
24
- */
25
- addLayers(layers: Layer<unknown>[]): LayerManager;
26
- /**
27
- * Gets all layers currently mounted
28
- */
29
- getLayers(): Layer<unknown>[];
30
- /**
31
- * Clears data from all mounted layers
32
- * @param includeReferenceSystem - (optional) if true also removes reference system, default is true
33
- */
34
- clearAllData(includeReferenceSystem?: boolean): LayerManager;
35
- /**
36
- * Adds the layer to the manager, and mounts it
37
- * @param layer Layer
38
- * @param params extra params to pass to the onUpdate method
39
- */
40
- addLayer(layer: Layer<unknown>, params?: LayerOptions<unknown>): LayerManager;
41
- /**
42
- * Remove and unmount layer from manager
43
- * @param layerId name of layer
44
- */
45
- removeLayer(layerId: string): LayerManager;
46
- /**
47
- * Remove and unmount all layers from manager
48
- */
49
- removeAllLayers(): LayerManager;
50
- getLayer(layerId: string): Layer<unknown>;
51
- initLayer(layer: Layer<unknown>, params?: LayerOptions<unknown>): LayerManager;
52
- showLayer(layerId: string): LayerManager;
53
- hideLayer(layerId: string): LayerManager;
54
- /**
55
- * Adjust layers, axis, and zoom according to inputted dimensions
56
- * @param width (required)
57
- * @param height (required)
58
- */
59
- adjustToSize(width: number, height: number): void;
60
- setReferenceSystem(irs: IntersectionReferenceSystem): void;
61
- showAxis(): LayerManager;
62
- hideAxis(): LayerManager;
63
- showAxisLabels(): LayerManager;
64
- hideAxisLabels(): LayerManager;
65
- setAxisOffset(x: number, y: number): LayerManager;
66
- setXAxisOffset(x: number): LayerManager;
67
- setYAxisOffset(y: number): LayerManager;
68
- setZoomLevelBoundary(zoomlevels: [number, number]): LayerManager;
69
- setMaxZoomLevel(zoomlevel: number): LayerManager;
70
- setMinZoomLevel(zoomlevel: number): LayerManager;
71
- destroy(): LayerManager;
72
- get zoomPanHandler(): ZoomPanHandler;
73
- get axis(): Axis;
74
- private rescale;
75
- private createAxis;
76
- }
1
+ import { ZoomPanHandler } from './ZoomPanHandler';
2
+ import { Layer, LayerOptions } from '../layers';
3
+ import { ScaleOptions } from '../interfaces';
4
+ import { Axis } from '../components';
5
+ import { IntersectionReferenceSystem } from './IntersectionReferenceSystem';
6
+ import { AxisOptions } from './interfaces';
7
+ export declare class LayerManager {
8
+ private container;
9
+ private layerContainer;
10
+ private _zoomPanHandler;
11
+ private layers;
12
+ private _axis;
13
+ private _svgContainer;
14
+ /**
15
+ * Handles layers and axis also holds a zoom and pan handler object
16
+ * @param container root container
17
+ * @param scaleOptions
18
+ * @param axisOptions
19
+ */
20
+ constructor(container: HTMLElement, scaleOptions?: ScaleOptions, axisOptions?: AxisOptions);
21
+ /**
22
+ * Adds and mounts an array of layers
23
+ * @param layers array of layers
24
+ */
25
+ addLayers(layers: Layer<unknown>[]): LayerManager;
26
+ /**
27
+ * Gets all layers currently mounted
28
+ */
29
+ getLayers(): Layer<unknown>[];
30
+ /**
31
+ * Clears data from all mounted layers
32
+ * @param includeReferenceSystem - (optional) if true also removes reference system, default is true
33
+ */
34
+ clearAllData(includeReferenceSystem?: boolean): LayerManager;
35
+ /**
36
+ * Adds the layer to the manager, and mounts it
37
+ * @param layer Layer
38
+ * @param params extra params to pass to the onUpdate method
39
+ */
40
+ addLayer(layer: Layer<unknown>, params?: LayerOptions<unknown>): LayerManager;
41
+ /**
42
+ * Remove and unmount layer from manager
43
+ * @param layerId name of layer
44
+ */
45
+ removeLayer(layerId: string): LayerManager;
46
+ /**
47
+ * Remove and unmount all layers from manager
48
+ */
49
+ removeAllLayers(): LayerManager;
50
+ getLayer(layerId: string): Layer<unknown>;
51
+ initLayer(layer: Layer<unknown>, params?: LayerOptions<unknown>): LayerManager;
52
+ showLayer(layerId: string): LayerManager;
53
+ hideLayer(layerId: string): LayerManager;
54
+ /**
55
+ * Adjust layers, axis, and zoom according to inputted dimensions
56
+ * @param width (required)
57
+ * @param height (required)
58
+ */
59
+ adjustToSize(width: number, height: number): void;
60
+ setReferenceSystem(irs: IntersectionReferenceSystem): void;
61
+ showAxis(): LayerManager;
62
+ hideAxis(): LayerManager;
63
+ showAxisLabels(): LayerManager;
64
+ hideAxisLabels(): LayerManager;
65
+ setAxisOffset(x: number, y: number): LayerManager;
66
+ setXAxisOffset(x: number): LayerManager;
67
+ setYAxisOffset(y: number): LayerManager;
68
+ setZoomLevelBoundary(zoomlevels: [number, number]): LayerManager;
69
+ setMaxZoomLevel(zoomlevel: number): LayerManager;
70
+ setMinZoomLevel(zoomlevel: number): LayerManager;
71
+ destroy(): LayerManager;
72
+ get zoomPanHandler(): ZoomPanHandler;
73
+ get axis(): Axis;
74
+ private rescale;
75
+ private createAxis;
76
+ }